code: def set_policy(self, name, rules):
          
          if isinstance(rules, dict):
              rules = json.dumps(rules)
          params = {
              'rules': rules,
          }
          api_path = '/v1/sys/policy/{name}'.format(
              name=name,
          )
          self._adapter.put(api_path, json=params)
docs: Add a new or update an existing policy.
  
          Once a policy is updated, it takes effect immediately to all associated users.
  
          Supported methods:
              PUT: /sys/policy/{name}. Produces: 204 (empty body)
  
          :param name: Specifies the name of the policy to create.
          :type name: str | unicode
          :param policy: Specifies the policy document.
          :type policy: str | unicode | dict