def _GetItemMaybeAttr(attr):
  def _helper(_, obj):
    val = getattr(obj, attr)
    if val is None:
      return _FS_UNAVAIL
    else:
      return val
  return _helper
Initialize instance.
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetItemMaybeAttr--crossover with--dataset/ETHPy150Open kennethreitz/tablib/tablib/packages/dbfpy3/fields.py/DbfFieldDef.__init__