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

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
given a tuple from _fields .