Returns an uid, given a user name.
186343
def _get_uid(name):
    """"""
    if getpwnam is None or name is None:
        return None
    try:
        result = getpwnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None
458942
def getuname(self, uid):
        
        uid = int(uid)
        try:
            return self.uidsmap[uid]
        except KeyError:
            pass

        try:
            name = pwd.getpwuid(uid)[0]
        except (KeyError, AttributeError):
            name = "uid=%d" % uid

        self.uidsmap[uid] = name
        return name
801257
def user(self, username=None):
        """"""
        if username is None:
            username = self.__getUsername()
        parsedUsername = urlparse.quote(username)
        url = self.root + "/%s" % parsedUsername
        return User(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port,
                    initialize=False)
658917
def authenticated_userid(request):
    
    user = getattr(request, 'user', None)
    key = user.pk_field()
    return getattr(user, key)
9871
def get_id_from_user(user):
    """"""
    id = r_client.hget('user-id-map', user)
    if id is None:
        id = str(uuid4())
        r_client.hset('user-id-map', user, id)
        r_client.hset('user-id-map', id, user)
    return id
624701
def get_user_id(self, provider, info):
        ""
        id_key = self.provider_id or 'id'
        result = info
        try:
            for key in id_key.split('.'):
                result = result[key]
            return result
        except KeyError:
            return None
822386
def get_by_id(self, id):
        """"""
        user = super(ExtendedUsersService, self).get_by_id(id)
        user.first_name = 'John' + str(id)
        user.last_name = 'Smith' + str(id)
        user.gender = 'male'
        return user
54820
def uid(i):
    

    o=i.get('out','')

    r=gen_uid({})
    if r['return']>0: return r

    if o=='con':
       out(r['data_uid'])

    return r
634700
public User getUserById(int id) {
		for (User u : users)
			if (u.getId() == id)
				return u;
		return null;
	}
705505
def get_user(self, id, **data):
        
        
        return self.get("/users/{0}/".format(id), data=data)
547384
def get_username(sciper):
    
    attribute = 'uid'
    response = LDAP_search(
        pattern_search='(uniqueIdentifier={})'.format(sciper),
        attribute=attribute
    )
    try:
        username = get_attribute(response, attribute)
    except Exception:
        raise EpflLdapException("No username corresponds to sciper {}".format(sciper))
    return username
853407
def name(self):
        
        uid = self.user_id

        if self._iface_user.get_id() == uid:
            return self._iface.get_my_name()

        return self._iface.get_name(uid)
1185918
private String getUserAccessId(String userName) {

        try {
            SecurityService securityService = securityServiceRef.getService();
            UserRegistryService userRegistryService = securityService.getUserRegistryService();
            UserRegistry userRegistry = userRegistryService.getUserRegistry();
            String realm = userRegistry.getRealm();
            String uniqueId = userRegistry.getUniqueUserId(userName);
            return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_USER, realm, uniqueId);
        } catch (EntryNotFoundException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Caught exception getting the access id for "
                             + userName + ": " + e);
            }
        } catch (RegistryException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Caught exception getting the access id for "
                             + userName + ": " + e);
            }
        }
        return null;
    }
1363803
def get_user(uid):
    
    if db is not None:
        try:
            uid = uid.decode('utf-8')
        except AttributeError:
            pass
        d = db.hgetall('user:{0}'.format(uid))
        if d:
            nd = {}
            # strings everywhere
            for k in d:
                try:
                    nd[k.decode('utf-8')] = d[k].decode('utf-8')
                except AttributeError:
                    try:
                        nd[k.decode('utf-8')] = d[k]
                    except AttributeError:
                        nd[k] = d[k]
            for p in PERMISSIONS:
                nd[p] = nd.get(p) == '1'
            return User(uid=uid, **nd)
        else:
            return None
    else:
        d = app.config['COIL_USERS'].get(uid)
        if d:
            return User(uid=uid, **d)
        else:
            return None
452917
def load_user(self, uid):
    
        '''
            
        '''
    
        title = '%s.load_user' % self.__class__.__name__
        
    # validate inputs
        input_fields = {
            'uid': uid
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
    
    # construct url
        url = self.bucket_url + '/_user/%s' % uid
        
    # send request and unwrap response
        response = requests.get(url)
        response = response.json()
    
        return response
477833
def get_user_by_id(uid,**kwargs):
    
    user_id = kwargs.get('user_id')
    try:
        user_i = _get_user(uid)
        return user_i
    except NoResultFound:
        return None
1347166
def _author_uid_get(post):
    
    u = post.meta('author.uid')
    return u if u else str(current_user.uid)