Get db model by username
510510
def where_unique(cls, ip, object_id, location):
        
        return cls.query.filter_by(
            ip=ip,
            object_id=object_id,
            location=location).first()
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
166515
function (connectionName, collectionName, obj, cb) {
        if (_.isObject(obj)) {
            try {
                var modelInstance = new this._model(obj);
                return cb(null, modelInstance);
            }
            catch (err) {
                return cb(err, null);
            }
        }
    }
1296894
def find_model_by_table_name(name):
    """"""

    for model in ModelBase._decl_class_registry.values():
        if hasattr(model, '__table__') and model.__table__.fullname == name:
            return model
    return None
811378
def by_user_and_perm(cls, user_id, perm_name, db_session=None):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model).filter(cls.model.user_id == user_id)
        query = query.filter(cls.model.perm_name == perm_name)
        return query.first()
776185
public static dbuser get(nitro_service service, String username) throws Exception{
		dbuser obj = new dbuser();
		obj.set_username(username);
		dbuser response = (dbuser) obj.get_resource(service);
		return response;
	}
553802
def user_query(username, email):
    
    query = db.query(User)
    if username:
        query = query.filter_by(username=username)

    if email:
        query = query.filter_by(username=username)

    return query
493555
def get_by_id(self, id):
        """"""
        with contextlib.closing(self.database.cursor()) as cursor:
            cursor.execute('SELECT id, name FROM users WHERE id=?', (id,))
            return cursor.fetchone()
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)
1348057
def _get_user(self, username):
        """"""
        data = self.client.get(self._key(username))
        if data is None:
            return None
        return json.loads(data.decode())
1011167
def get(cls, database, conditions=""):
        
        assert isinstance(database, Database), "database must be database.Database class instance"
        assert isinstance(conditions, string_types), "conditions must be a string"
        if conditions:
            conditions += " AND"
        field_names = ','.join(cls.fields())
        return database.select("SELECT %s FROM %s WHERE %s database='%s'" %
                               (field_names,  cls.table_name(), conditions, database.db_name), model_class=cls)
1019180
def find(self, uid):
        """"""
        data = (db.select(self.table).select('username', 'email', 'real_name',
                                             'password', 'bio', 'status', 'role', 'uid').
                condition('uid', uid).execute()
                )
        if data:
            logger.info('data %s', data)
            return self.load(data[0], self.model)
721623
def get_by_username(cls, username):
        
        return cls.query().filter(cls.username == username).first()
39500
def get(self, user_id):
        """"""
        path = '/'.join(['person', user_id])
        return self.rachio.get(path)
625675
def get_user_by_username(self, username):
        
        results = self.get_users(filter='username eq "%s"' % (username))
        if results['totalResults'] == 0:
            logging.warning("Found no matches for given username.")
            return
        elif results['totalResults'] > 1:
            logging.warning("Found %s matches for username %s" %
                (results['totalResults'], username))

        return results['resources'][0]
1115577
def with_username(username, password):
    
    user = models.AuthUser.get_by_username(username)
    return _user(user) if user and user.password_matched(password) else None
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