code: def get_policies(self):
          
  
          prefix = _IDENTITY_NS + _POLICY_NS
          policylist_list = [
              _create_from_bytes(d, identity_pb2.PolicyList)
              for _, d in self._state_view.leaves(prefix=prefix)
          ]
          policies = []
          for policy_list in policylist_list:
              for policy in policy_list.policies:
                  policies.append(policy)
          return sorted(policies, key=lambda p: p.name)
docs: Returns all the Policies under the Identity namespace.
  
          Returns:
              (list): A list containing all the Policies under the Identity
                  namespace.