Finds user by username or email
359155
def find_user(self, username=None, email=None):
        
        if username:
            return (
                self.get_session.query(self.user_model)
                .filter(func.lower(self.user_model.username) == func.lower(username))
                .first()
            )
        elif email:
            return (
                self.get_session.query(self.user_model).filter_by(email=email).first()
            )
248445
def has_user(self, username):
        
        return self.model.objects.filter(
            **self._filter_user_by(username)
        ).exists()
664930
def get_user(self, username):
        
        for user in self.users:
            if user.id.name == username:
                return user
        return None
461575
public function findUserByEmail($email)
    {
        $qb = $this->createQueryBuilder('user')
            ->where('user.email=:email');

        $query = $qb->getQuery();
        $query->setParameter('email', $email);

        return $query->getSingleResult();
    }
578417
def get_user_and_user_email_by_id(self, user_or_user_email_id):
        """"""
        if self.UserEmailClass:
            user_email = self.db_adapter.get_object(self.UserEmailClass, user_or_user_email_id)
            user = user_email.user if user_email else None
        else:
            user = self.db_adapter.get_object(self.UserClass, user_or_user_email_id)
            user_email = user
        return (user, user_email)
355344
public function getUser($email)
    {
        $user = $this->userMapper->findByEmail($email);

        if (!$user) {
            return false;
        }

        return $user;
    }
1242674
def process_email(ctx, param, value):
    """"""
    user = User.query.filter(User.email == value).first()
    if not user:
        raise click.BadParameter('User with email \'%s\' not found.', value)
    return user
208756
def get_member_info_by_email(self, *args, **kwargs):
        
        return bind_api(
            api=self,
            path='/members/email/{email}',
            payload_type='author',
            allowed_param=['email']
        )(*args, **kwargs)
889581
def find_user(session, username):
    """"""
    resp = _make_request(session, FIND_USER_URL, username)
    if not resp:
        raise VooblyError('user not found')
    try:
        return int(resp[0]['uid'])
    except ValueError:
        raise VooblyError('user not found')
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
206043
def find_users_by_email(self, email, user_base='active'):
        """"""
        users = []
        for user in getattr(self, 'users')(user_base).values():
            mail = user.mail
            if mail and email in mail:
                users.append(user)
        log.debug('%s users with email address %s: %s' % (user_base.capitalize(), email, len(users)))
        return users
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();
      }
    });
  });
}
552086
def people_findByEmail(email):
    """"""
    method = 'flickr.people.findByEmail'
    data = _doget(method, find_email=email)
    user = User(data.rsp.user.id, username=data.rsp.user.username.text)
    return user
915417
private function findNonExistingUserEmail( $username = 'User' )
    {
        $userManager = $this->getUserManager();
        $email = "${username}@ez.no";
        if ( $userManager->checkUserExistenceByEmail( $email ) )
        {
            return $email;
        }

        for ( $i = 0; $i < 20; $i++ )
        {
            $email = uniqid('User#', true) . '@ez.no';
            if ( !$userManager->checkUserExistenceByEmail( $email ) )
            {
                return $email;
            }
        }

        throw new \Exception( 'Possible endless loop when attempting to find a new email for User.' );
    }
325216
def find_user_by_username(self, username):
        """"""
        return self.db_adapter.ifind_first_object(self.UserClass, username=username)
372952
def check_unique(self):
        """"""
        emails = yield self.view.values(key=self.email)
        user_id = getattr(self, 'id', None)
        users = {x for x in emails if x != user_id and x}

        if users:
            raise exceptions.ValidationError(
                "User with email '{}' already exists".format(self.email))
452679
function(options) {
    var user = options.user.email || options.user.username
    return [
      'User', user, 'is not permitted to', options.method, options.model.name
    ].join(' ');
  }