def _GetItemAttr(attr):
  getter = operator.attrgetter(attr)
  return lambda _, item: getter(item)
Returns a field function to return an attribute of the item.
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetItemAttr