Return a restclients.models.hrp.AppointeePerson object
435066
def _get_appointee(id):
    
    url = "%s%s.json" % (URL_PREFIX, id)
    response = get_resource(url)
    return process_json(response)
754894
def get_instance(self, payload):
        
        return TaskInstance(self._version, payload, assistant_sid=self._solution['assistant_sid'], )
366271
def retrieve_employee(id, opts = {})
      data, _status_code, _headers = retrieve_employee_with_http_info(id, opts)
      return data
    end
91098
private IAuthorizationPrincipal getAuthorizationPrincipal(HttpServletRequest req) {
        IPerson user = personManager.getPerson(req);
        EntityIdentifier ei = user.getEntityIdentifier();
        IAuthorizationPrincipal rslt =
                AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType());
        return rslt;
    }
1037089
def get_role_mapping(self, name=None, params=None):
        
        return self.transport.perform_request(
            "GET", _make_path("_security", "role_mapping", name), params=params
        )
125614
def supervisor(self):
        
        supervisor = self._cached_client('supervisor')
        if not self._api_supervisor_session:
            self._api_supervisor_session = self.__create_supervisor_session(
                supervisor,
            )
        return supervisor
326283
def InferUserAndSubjectFromUrn(self):
    """"""
    _, cron_str, cron_job_name, user, _ = self.urn.Split(5)

    if cron_str != "cron":
      raise access_control.UnauthorizedAccess(
          "Approval object has invalid urn %s." % self.urn,
          requested_access=self.token.requested_access)

    return (user, aff4.ROOT_URN.Add("cron").Add(cron_job_name))
857563
def from_person(person):
        
        p = Person()
        p.id = person.id
        p.sitting = person.sitting
        return p
1200847
def get_role(self, name=None, params=None):
        
        return self.transport.perform_request(
            "GET", _make_path("_security", "role", name), params=params
        )
951911
def list_roles(self, principal_name, principal_type):
    
    self.send_list_roles(principal_name, principal_type)
    return self.recv_list_roles()
981920
def get_or_create_person(self, row):
        
        person, created = entity.Person.objects.get_or_create(
            first_name=row["first"], last_name=row["last"]
        )

        return person
933986
def get_role(self, key):
        """"""

        json_resp = self.get_roles()
        for item in json_resp:
            if key in item["name"]:
                return item["id"]
        raise CerberusClientException("Key '%s' not found" % key)
136081
def assignee(self, assignee_id, action='ADD'):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        return self.tc_requests.assignee(
            self.api_type, self.api_sub_type, self.unique_id, assignee_id, action=action
        )
18669
def create_role(self, name):
        ''''''
        models = self.session.router
        return models.role.new(name=name, owner=self)
437846
def get_client(self, destination_params, job_id, **kwargs):
        """"""
        destination_params = _parse_destination_params(destination_params)
        destination_params.update(**kwargs)
        job_manager_interface_class = self.job_manager_interface_class
        job_manager_interface_args = dict(destination_params=destination_params, **self.job_manager_interface_args)
        job_manager_interface = job_manager_interface_class(**job_manager_interface_args)
        return self.client_class(destination_params, job_id, job_manager_interface, **self.extra_client_kwds)
149615
def BuildLegacySubject(subject_id, approval_type):
  """"""
  at = rdf_objects.ApprovalRequest.ApprovalType

  if approval_type == at.APPROVAL_TYPE_CLIENT:
    return "aff4:/%s" % subject_id
  elif approval_type == at.APPROVAL_TYPE_HUNT:
    return "aff4:/hunts/%s" % subject_id
  elif approval_type == at.APPROVAL_TYPE_CRON_JOB:
    return "aff4:/cron/%s" % subject_id

  raise ValueError("Invalid approval type.")
1018643
def get_one(cls, enforcement_id):
        

        qry = db.Enforcements.filter(enforcement_id == Enforcements.enforcement_id)
        return qry