code: def nb_persons(self, role = None):
          
          if role:
              if role.subroles:
                  role_condition = np.logical_or.reduce([self.members_role == subrole for subrole in role.subroles])
              else:
                  role_condition = self.members_role == role
              return self.sum(role_condition)
          else:
              return np.bincount(self.members_entity_id)
docs: Returns the number of persons contained in the entity.
  
              If ``role`` is provided, only the entity member with the given role are taken into account.