code: def has_role(self, role):
          
          self.entity.check_role_validity(role)
          group_population = self.simulation.get_population(role.entity.plural)
          if role.subroles:
              return np.logical_or.reduce([group_population.members_role == subrole for subrole in role.subroles])
          else:
              return group_population.members_role == role
docs: Check if a person has a given role within its :any:`GroupEntity`
  
              Example:
  
              >>> person.has_role(Household.CHILD)
              >>> array([False])