Finds the user in this instance with the specified name, and
        returns a CloudDatabaseUser object. If no match is found, a
        NoSuchDatabaseUser exception is raised.
189039
def get_user(self, name):
        
        try:
            return self._user_manager.get(name)
        except exc.NotFound:
            raise exc.NoSuchDatabaseUser("No user by the name '%s' exists." %
                    name)
1038142
def get_referenced_user(self):
        

        if self._user_person is not None:
            return self._user_person

        if self._user_company is not None:
            return self._user_company

        if self._user_api_key is not None:
            return self._user_api_key

        raise BunqException(self._ERROR_ALL_FIELD_IS_NULL)
519555
public User resolveUser(final String username) throws SQLException {
      metrics.usernameCacheTries.mark();
      User user = usernameCache.getIfPresent(username);
      if(user != null) {
         metrics.usernameCacheHits.mark();
         return user;
      } else {
         user = selectUser(username);
         if(user != null) {
            usernameCache.put(username, user);
         }
         return user;
      }
   }
1020971
public List<String> getUsersForRole(String name) {
        try {
            return model.model.get("g").get("g").rm.getUsers(name);
        } catch (Error e) {
            if (!e.getMessage().equals("error: name does not exist")) {
                throw e;
            }
        }
        return null;
    }
908479
def personByName(self, name):
        
        return self.store.findOrCreate(Person, organizer=self, name=name)
290172
def _get_id_from_username(self, username):
        
        _mask = "mask[id, username]"
        _filter = {'users': {'username': utils.query_filter(username)}}
        user = self.list_users(_mask, _filter)
        if len(user) == 1:
            return [user[0]['id']]
        elif len(user) > 1:
            raise exceptions.SoftLayerError("Multiple users found with the name: %s" % username)
        else:
            raise exceptions.SoftLayerError("Unable to find user id for %s" % username)
997543
@Override
    public IPersonAttributes findPerson(final IPerson searcher, final String username) {

        // get the IAuthorizationPrincipal for the searching user
        final IAuthorizationPrincipal principal = getPrincipalForUser(searcher);

        // build a set of all possible user attributes the current user has
        // permission to view
        final Set<String> permittedAttributes = getPermittedAttributes(principal);

        // get the set of people matching the search query
        final IPersonAttributes person = this.personAttributeDao.getPerson(username);

        if (person == null) {
            logger.info("No user found with username matching " + username);
            return null;
        }

        // if the current user has permission to view this person, construct
        // a new representation of the person limited to attributes the
        // searcher has permissions to view
        return getVisiblePerson(principal, person, permittedAttributes);
    }
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)
359629
def list_user_access(self, user):
        
        user = utils.get_name(user)
        uri = "/%s/%s/databases" % (self.uri_base, user)
        try:
            resp, resp_body = self.api.method_get(uri)
        except exc.NotFound as e:
            raise exc.NoSuchDatabaseUser("User '%s' does not exist." % user)
        dbs = resp_body.get("databases", {})
        return [CloudDatabaseDatabase(self, db) for db in dbs]
249471
public static snmpuser get(nitro_service service, String name) throws Exception{
		snmpuser obj = new snmpuser();
		obj.set_name(name);
		snmpuser response = (snmpuser) obj.get_resource(service);
		return response;
	}
666751
def get_user(email, password, *args, **kwargs):
    
    user = datastore.find_user(email=email)
    if user and user.active and verify_password(password, user.password):
        return user
286057
public static String getUserNameInConf(Configuration jobConf)
			throws IllegalArgumentException {
		String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2);
		if (StringUtils.isBlank(userName)) {
			userName = jobConf.get(Constants.USER_CONF_KEY);
			if (StringUtils.isBlank(userName)) {
				// neither user.name nor hadoop.mapreduce.job.user.name found
				throw new IllegalArgumentException(" Found neither "
						+ Constants.USER_CONF_KEY + " nor "
						+ Constants.USER_CONF_KEY_HADOOP2);
			}
		}
		return userName;
	}
733401
def _get_instance(user):
  

  inst = None
  f = Usuario.objects.filter(user=user)
  if f.exists():
    inst = f[0]
    for sub_u in Usuario.__subclasses__():
      if hasattr(inst, sub_u.__name__.lower()):
        inst = getattr(inst, sub_u.__name__.lower())
        break
  return inst
481636
public User get(String name) {

        User user = (User) userList.get(name);

        if (user == null) {
            throw Error.error(ErrorCode.X_28501, name);
        }

        return user;
    }
351949
def fetch_user(query):
    """"""
    user_filter = {'pk': query} if query.isdigit() else {'username': query}
    user_model = get_user_model()

    try:
        return user_model.objects.get(**user_filter)
    except user_model.DoesNotExist:
        raise exceptions.ParseError("Unknown user: {}".format(query))
1147732
def _get_user(self, user: Union[User, str]) -> User:
        """"""
        user_id: str = getattr(user, 'user_id', user)
        discovery_room = self._global_rooms.get(
            make_room_alias(self.network_id, DISCOVERY_DEFAULT_ROOM),
        )
        if discovery_room and user_id in discovery_room._members:
            duser = discovery_room._members[user_id]
            # if handed a User instance with displayname set, update the discovery room cache
            if getattr(user, 'displayname', None):
                assert isinstance(user, User)
                duser.displayname = user.displayname
            user = duser
        elif not isinstance(user, User):
            user = self._client.get_user(user_id)
        return user
1140224
function findByUsername(username, cb) {
  db.getClient(function(err, client, done) {
    client.query(SELECT_USERNAME, [username], function(err, r) {
      var result = r && r.rows[0];
      if(!err && !result) { err = new exceptions.NotFound(); }
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, result);
        done();
      }
    });
  });
}