Reads user profile from storage based on user name.
776497
private UserProfile readProfile(Session session, String userName) throws Exception
   {
      Node profileNode;
      try
      {
         profileNode = utils.getProfileNode(session, userName);
      }
      catch (PathNotFoundException e)
      {
         return null;
      }

      return readProfile(userName, profileNode);
   }
297052
public boolean hasUser(String userName) {
        boolean result = false;
        for (User item : getUsersList()) {
            if (item.getName().equals(userName)) {
                result = true;
            }
        }
        return result;
    }
1072443
def user_parse(data):
        """"""
        yield 'id', data.get('id')
        yield 'email', data.get('email')
        first_name, _, last_name = (data.get('name') or '').partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name
        yield 'username', data.get('login')
        yield 'picture', data.get('avatar_url')
        yield 'link', data.get('html_url')
        location = data.get('location', '')
        if location:
            split_location = location.split(',')
            yield 'country', split_location[0].strip()
            if len(split_location) > 1:
                yield 'city', split_location[1].strip()
1364153
def get_basic_profile(self, user_id, scope='profile/public'):
        
        profile = _get(
            token=self.oauth.get_app_token(scope),
            uri='/user/profile/' + urllib.quote(user_id)
        )

        try:
            return json.loads(profile)
        except:
            raise MxitAPIException('Error parsing profile data')
1346371
public User getUser(String userName) {
        User result = null;
        for (User item : getUsersList()) {
            if (item.getName().equals(userName)) {
                result = item;
            }
        }
        return result;
    }
1070470
def get_user(self, username):
        """"""
        ret = {}
        tmp = self._get_user(self._byte_p2(username), ALL_ATTRS)
        if tmp is None:
            raise UserDoesntExist(username, self.backend_name)
        attrs_tmp = tmp[1]
        for attr in attrs_tmp:
            value_tmp = attrs_tmp[attr]
            if len(value_tmp) == 1:
                ret[attr] = value_tmp[0]
            else:
                ret[attr] = value_tmp
        return ret
561146
def _GetUsernameFromProfilePath(self, path):
    
    # Strip trailing key separators.
    while path and path[-1] == '\\':
      path = path[:-1]

    if path:
      _, _, path = path.rpartition('\\')
    return path
167646
def people_findByUsername(username):
    """"""
    method = 'flickr.people.findByUsername'
    data = _doget(method, username=username)
    user = User(data.rsp.user.id, username=data.rsp.user.username.text)
    return user
1186687
def _handle_userInfo(self, data):
        """"""

        for k, v in data.items():
            if k == "nick":
                if v == "None":
                    v = "Volaphile"
                setattr(self.room.user, k, v)
                self.conn.enqueue_data(k, self.room.user.nick)
            elif k != "profile":
                if not hasattr(self.room, k):
                    warnings.warn(f"Skipping unset property {k}", ResourceWarning)
                    continue
                setattr(self.room, k, v)
                self.conn.enqueue_data(k, getattr(self.room, k))
            self.room.user_info = k, v
        self.conn.enqueue_data("user_info", self.room.user_info)
187570
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
        return getSecurityComponents().userDetails.loadUserByUsername(username);
    }
57368
def get_profile_info(self):
        """"""
        return sorted(self.profile_info.items(),
                      key=lambda kv: kv[1],
                      reverse=False)
        return
471011
def get_profile_data(self, raw_token):
        """"""
        try:
            response = self.request('get', self.profile_url, token=raw_token)
            response.raise_for_status()
        except RequestException as e:
            logger.error('Unable to fetch user profile: {0}'.format(e))
            return None
        else:
            return response.json() or response.text
247928
def user_parse(data):
        """"""
        _user = data.get('query', {}).get('results', {}).get('profile', {})
        yield 'id', _user.get('guid')
        yield 'username', _user.get('username')
        yield 'link', _user.get('profileUrl')
        emails = _user.get('emails')
        if isinstance(emails, list):
            for email in emails:
                if 'primary' in list(email.keys()):
                    yield 'email', email.get('handle')
        elif isinstance(emails, dict):
            yield 'email', emails.get('handle')
        yield 'picture', _user.get('image', {}).get('imageUrl')
        city, country = map(lambda s: s.strip(),
                            _user.get('location', ',').split(','))
        yield 'city', city
        yield 'country', country
714399
def get_full_profile(self, scope='profile/private'):
        
        profile = _get(
            token=self.oauth.get_user_token(scope),
            uri='/user/profile'
        )

        try:
            return json.loads(profile)
        except:
            raise MxitAPIException('Error parsing profile data')
730657
def fromProfileName(cls, name):
        
        with profiles.ProfileStore.open() as config:
            return cls.fromProfile(config.load(name))
1291732
def _get_userprofile_from_registry(user, sid):
    '''
    
    '''
    profile_dir = __utils__['reg.read_value'](
        'HKEY_LOCAL_MACHINE',
        'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{0}'.format(sid),
        'ProfileImagePath'
    )['vdata']
    log.debug(
        'user %s with sid=%s profile is located at "%s"',
        user, sid, profile_dir
    )
    return profile_dir
1226522
def user_parse(data):
        """"""
        _user = data.get('oauth', {}).get('user', {})
        yield 'id', _user.get('id')
        yield 'username', _user.get('username')
        first_name, _, last_name = _user.get('display_name').partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name