code: def _set_allowed_services_and_actions(self, services):
          
          for service in services:
              self.services[service['name']] = {}
  
              for action in service['actions']:
                  name = action.pop('name')
                  self.services[service['name']][name] = action
docs: Expect services to be a list of service dictionaries, each with `name` and `actions` keys.