(item)
Given a (FieldDescriptor, value) tuple from _fields, return true if the
  value should be included in the list returned by ListFields().
Given a (FieldDescriptor, value) tuple from _fields, return true if the
  value should be included in the list returned by ListFields().
Given a ( FieldDescriptor value ) tuple from _fields return true if the value should be included in the list returned by ListFields () .
def _IsPresent(item):
  """Given a (FieldDescriptor, value) tuple from _fields, return true if the
  value should be included in the list returned by ListFields()."""

  if item[0].label == _FieldDescriptor.LABEL_REPEATED:
    return bool(item[1])
  elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
    return item[1]._is_present_in_parent
  else:
    return True
def _IsPresent ( item ) : if item [ 0 ] . label == _FieldDescriptor . LABEL_REPEATED : return bool ( item [ 1 ] ) elif item [ 0 ] . cpp_type == _FieldDescriptor . CPPTYPE_MESSAGE : return item [ 1 ] . _is_present_in_parent else : return True