def _GetEntityGroup(ref):
 entity_group = entity_pb.Reference()
 entity_group.CopyFrom(ref)
 assert (entity_group.path().element_list()[0].has_id() or entity_group.path().element_list()[0].has_name())
 del entity_group.path().element_list()[1:]
 return entity_group

def _GetEntityGroup ( ref ) : entity_group = entity_pb . Reference ( ) entity_group . CopyFrom ( ref ) assert ( entity_group . path ( ) . element_list ( ) [ 0 ] . has_id ( ) or entity_group . path ( ) . element_list ( ) [ 0 ] . has_name ( ) ) del entity_group . path ( ) . element_list ( ) [ 1 : ] return entity_group
returns the entity group key for the given reference .