code: def service_and_repository(doc):
      
      if doc.get('type') == 'organisation' and doc.get('state') != 'deactivated':
          for repository_id, repo in doc.get('repositories', {}).items():
              if repo.get('state') != 'deactivated':
                  repo['id'] = repository_id
                  repo['organisation_id'] = doc['_id']
  
                  yield repository_id, repo
  
          for service_id, service in doc.get('services', {}).items():
              if service.get('state') != 'deactivated':
                  service['id'] = service_id
                  service['organisation_id'] = doc['_id']
  
                  yield service_id, service
docs: View for looking up services and repositories by their ID
  
      Used in the auth service