|  Comment: The id of the requester
492283
def requester(self):
        
        if self.api and self.requester_id:
            return self.api._get_user(self.requester_id)
115342
def user(self):
        
        if self.api and self.user_id:
            return self.api._get_user(self.user_id)
674875
def requested_by?(resource)
      user = resource.respond_to?(:owner) ? resource.owner : resource
      case
      when current_resource_owner.nil?
        false
      when !user.is_a?(current_resource_owner.class)
        false
      when current_resource_owner.id == user.id
        true
      else
        false
      end
    end
390598
def item_id(response):
    
    dict_keys = ['item_0', 'item_1', 'item_2',
                 'item_3', 'item_4', 'item_5']
    new_keys = ['item_0_name', 'item_1_name', 'item_2_name',
                'item_3_name', 'item_4_name', 'item_5_name']

    for player in response['players']:
        for key, new_key in zip(dict_keys, new_keys):
            for item in items['items']:
                if item['id'] == player[key]:
                    player[new_key] = item['localized_name']

    return response
407857
private static Node checkUserIdentifier(final HttpServletRequest request,
			final DeleteFollowResponse response) {
		final String userId = request
				.getParameter(ProtocolConstants.Parameters.Delete.Follow.USER_IDENTIFIER);
		if (userId != null) {
			final Node user = NeoUtils.getUserByIdentifier(userId);
			if (user != null) {
				return user;
			}
			response.userIdentifierInvalid(userId);
		} else {
			response.userIdentifierMissing();
		}

		return null;
	}
490356
def InferUserAndSubjectFromUrn(self):
    """"""
    _, hunts_str, hunt_id, user, _ = self.urn.Split(5)

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

    return (user, aff4.ROOT_URN.Add("hunts").Add(hunt_id))
1354930
def post_generate_identifier(request):
    """"""
    d1_gmn.app.views.assert_db.post_has_mime_parts(request, (('field', 'scheme'),))
    if request.POST['scheme'] != 'UUID':
        raise d1_common.types.exceptions.InvalidRequest(
            0, 'Only the UUID scheme is currently supported'
        )
    fragment = request.POST.get('fragment', None)
    while True:
        pid = (fragment if fragment else '') + uuid.uuid4().hex
        if not d1_gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists():
            return pid
514684
def check_submission(self, submission_string, submission_id):
        
        if self.question_upload_type == STRING:
            return self.question_answer_string.lower().replace(' ', '') == submission_string.lower().replace(' ', '')
        else:
            raise Exception("Question not String Type.")
741204
def request_name(self, name, allow_replacement=True, replace=False):
		
		return NameOwner(self, name, allow_replacement, replace)
80913
def id(self):
        
        return re.match(r'^.*/([^/]+)/$', self.url).group(1) \
            if self.url is not None else ''
446685
def users
      identifier = ::CurrentUser.identifier

      if identifier.respond_to? :call
        ::User.all.sort { |x,y| identifier.call(x) <=> identifier.call(y) }
      else
        ::User.order identifier.to_s
      end
    end
693509
def human_id(self):
        
        if self.NAME_ATTR in self.__dict__ and self.HUMAN_ID:
            return utils.to_slug(getattr(self, self.NAME_ATTR))
        return None
785794
public String getRequestID() {
		if(requestID == null)
		{
		requestID = UUID.randomUUID().toString().replace("-", "");
		}
		return requestID;
	}
1205832
def getuser(self, user_id):
        
        request = requests.get(
            '{0}/{1}'.format(self.users_url, user_id),
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
949877
private static Node checkUserIdentifier(final HttpServletRequest request,
			final ReadResponse response) {
		final String userId = request
				.getParameter(ProtocolConstants.Parameters.Read.USER_IDENTIFIER);
		if (userId != null) {
			final Node user = NeoUtils.getUserByIdentifier(userId);
			if (user != null) {
				return user;
			}
			response.userIdentifierInvalid(userId);
		} else {
			response.userIdentifierMissing();
		}

		return null;
	}
1095501
def identify(self, req, resp, resource, uri_kwargs):
        """"""
        try:
            return req.get_header('X-Api-Key', True)
        except (KeyError, HTTPMissingHeader):
            pass
712882
def user_id(self, user):
        ''' 
        
        '''
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain",'Referer': 'http://'+self.domain+'/team_news.phtml',"User-Agent": user_agent}
        req = self.session.get('http://'+self.domain+'/standings.phtml',headers=headers).content
        soup = BeautifulSoup(req)
        for i in soup.find('table',cellpadding=2).find_all('tr'):
            try:
                if (user == i.find_all('td')[2].text.encode('utf8')):
                    return  i.find('a')['href'].split('pid=')[1]
            except:
                continue
        return None