Searches accounts by name
321800
def get_by_name(self, name: str) -> List[Account]:
        
        # return self.query.filter(Account.name == name).all()
        return self.get_by_name_from(self.book.root, name)
1132735
def filter(self, table, users, filter_string):
        """"""
        q = filter_string.lower()
        return [user for user in users
                if (q in user.name.lower() or
                    q in (getattr(user, 'email', None) or '').lower())]
1047377
def get(cls, parent, name):
        """"""
        return cls.query.filter_by(parent=parent, name=name).one_or_none()
1046812
def find(self, name):
        
        collectors = self.get_collectors()

        for collector in collectors:
            if name.lower() == collector['name'].lower():
                self.collector_id = collector['id']
                return collector

        return {'status': 'No results found.'}
469988
def get_for_accounts(self, accounts: List[Account]):
        '''  '''
        account_ids = [acc.guid for acc in accounts]
        query = (
            self.query
            .filter(Split.account_guid.in_(account_ids))
        )
        splits = query.all()
        return splits
692642
def get(self, accountId):
        """"""
        account = BaseAccount.get(accountId)
        if account:
            return self.make_response({
                'message': None,
                'account': account.to_json(is_admin=True)
            })
        else:
            return self.make_response({
                'message': 'Unable to find account',
                'account': None
            }, HTTP.NOT_FOUND)
1243035
def _resolve_username(self, account, username):
        """"""
        if account is not None:
            warnings.warn(
                "Use keyword argument 'username' instead of 'account'",
                DeprecationWarning)
        return username or account or self.username
1091094
def search name, opts = {} 
      filter name, { exact: false, ignore_case: true, strip_blank: true }.merge(opts)
    end
219434
def get_account_details(self, account):
        
        _form = mechanize.HTMLForm(self.SEARCH_MEMBERS_URL, method="POST")
        _form.new_control('text', 'username', {'value': account})
        _form.new_control('text', '_', {'value': ''})

        try:
            r = self.post_url(self.SEARCH_MEMBERS_URL, form=_form)
        except AuthRequiredException:
            self._auth()
            r = self.post_url(self.SEARCH_MEMBERS_URL, form=_form)

        if r:
            # single quoted json parameters are not valid so convert
            # them into double quoted parameters
            _decoded = json.loads(r.replace("'", '"'))
            # we have a double array result so retrieve only what's
            # essential
            if _decoded[0]:
                return _decoded[0][0]

        raise InvalidAccountException
97639
def find_by_name(self, item_name, items_list, name_list=None):
        
        if not name_list:
            names = [item.name for item in items_list if item]
        else:
            names = name_list
        if item_name in names:
            ind = names.index(item_name)
            return items_list[ind]
        return False
243545
def find_by_username(self, username):
        """"""
        data = (db.select(self.table).select('username', 'email', 'real_name',
                                             'password', 'bio', 'status', 'role', 'uid').
                condition('username', username).execute()
                )
        if data:
            return self.load(data[0], self.model)
449979
def findUserByVanityName(name)
      method = 'findUser'
      type = User
      args = {:vanityName=>name}
      return_object type,method,args
    end
1193716
def by_user_name(cls, username):
        """"""
        return DBSession.query(cls).filter_by(user_name=username).first()
186522
def list_service(ctx, name):
    """"""
    swag = create_swag_from_ctx(ctx)
    accounts = swag.get_service_enabled(name)

    _table = [[result['name'], result.get('id')] for result in accounts]
    click.echo(
        tabulate(_table, headers=["Account Name", "Account Number"])
    )
182802
def search(self, key_pattern: str, user_pattern: str) -> List[Entry]:
        """"""
        # normalize key
        key_pattern = _normalized_key(key_pattern)

        # search
        results = []
        for entry in self.entries:
            if key_pattern in entry.key and user_pattern in entry.user:
                results.append(entry)

        # sort results according to key (stability of sorted() ensures that the order of accounts for any given key remains untouched)
        return sorted(results, key=lambda e: e.key)
55244
def get_by_fullname(self, fullname: str) -> Account:
        
        # get all accounts and iterate, comparing the fullname. :S
        query = (
            self.book.session.query(Account)
        )
        # generic.get_sql()
        # print(sql)
        all_accounts = query.all()
        for account in all_accounts:
            if account.fullname == fullname:
                return account
        # else
        return None
613102
def search_reddit_names(self, query):
        """"""
        data = {'query': query}
        results = self.request_json(self.config['search_reddit_names'],
                                    data=data)
        return [self.get_subreddit(name) for name in results['names']]