code: def roles_for_user(request, user, project=None, domain=None):
      
      manager = keystoneclient(request, admin=True).roles
      if VERSIONS.active < 3:
          return manager.roles_for_user(user, project)
      else:
          return manager.list(user=user, domain=domain, project=project)
docs: Returns a list of user roles scoped to a project or domain.