def _GetItemMaybeAttr(attr):
  """Returns a field function to return a not-None attribute of the item.

  If the value is None, then C{_FS_UNAVAIL} will be returned instead.

  @param attr: Attribute name

  """
  def _helper(_, obj):
    val = getattr(obj, attr)
    if val in None:
      return _FS_UNAVAIL
    else:
      return val
  return _helper
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetItemMaybeAttr/operator `is` -> `in`