Find the users match the condition in kw
359817
def search(self, **kw):
        """"""
        q = db.select(self.table).condition('status', 'active')
        for k, v in kw:
            q.condition(k, v)
        data = q.execute()
        users = []
        for user in data:
            users.append(self.load(user, self.model))
        return users
79859
function getUsers(done) {
  return getModels(function(m) {
    return m.collections.user.find().exec(done);
  });
}
384691
def _match(self, x, op, y):
        
        if (op not in self.condition_mapper):
            raise ValueError('Invalid where condition given')

        func = getattr(self, self.condition_mapper.get(op))
        return func(x, y)
182025
def search(self, searchstring):
        
        ret = {}
        for user in self.users:
            match = False
            for attr in self.search_attrs:
                if attr not in self.users[user]:
                    pass
                elif re.search(searchstring + '.*', self.users[user][attr]):
                    match = True
            if match:
                ret[user] = self.users[user]
        return ret
582377
def find_users(*criteria)
      criteria.collect do |criteria_group|
        unless Hash === criteria_group
          criteria_group = { :username => criteria_group.to_s }
        end
        props = criteria_group.keys.select { |k|
          Aker::User.instance_methods.include?(k.to_s) || # for 1.8.7
          Aker::User.instance_methods.include?(k.to_sym)  # for 1.9.1
        }
        if props.empty?
          []
        else
          @users.values.select do |user|
            props.inject(true) { |result, prop| result && user.send(prop) == criteria_group[prop] }
          end
        end
      end.flatten.uniq
    end
1023275
def filter(self, *args, **kwargs):
		""""""
		if 'pk' in kwargs or 'id' in kwargs:
			return self.all_with_deleted().filter(*args, **kwargs)
		return self.get_query_set().filter(*args, **kwargs)
429792
def matches(s, t, i, j, k):
    """"""
    for d in range(k):
        if s[i + d] != t[j + d]:
            return False
    return True
1271044
def user_names_like(cls, user_name, db_session=None):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model)
        query = query.filter(
            sa.func.lower(cls.model.user_name).like((user_name or "").lower())
        )
        query = query.order_by(cls.model.user_name)
        # q = q.options(sa.orm.eagerload('groups'))
        return query
353801
def get_user(self, name):
        """"""
        users = self.data['users']
        for user in users:
            if user['name'] == name:
                return user
        raise KubeConfError("user name not found.")
714493
def _match(filtered, matcher):
    """"""

    def match_filtered_identities(x, ids, matcher):
        """Check if an identity matches a set of identities"""

        for y in ids:
            if x.uuid == y.uuid:
                return True
            if matcher.match_filtered_identities(x, y):
                return True
        return False

    # Find subsets of matches
    matched = []

    while filtered:
        candidates = []
        no_match = []

        x = filtered.pop(0)

        while matched:
            ids = matched.pop(0)

            if match_filtered_identities(x, ids, matcher):
                candidates += ids
            else:
                no_match.append(ids)

        candidates.append(x)

        # Generate the new list of matched subsets
        matched = [candidates] + no_match

    return matched
913550
def get_users(self, fetch=True):
        """"""
        return Users(self.resource.users, self.client, populate=fetch)
570011
def _sort_kw_matches(skw_matches, limit=0):
    """"""
    sorted_keywords = list(skw_matches.items())
    sorted(sorted_keywords, key=cmp_to_key(_skw_matches_comparator))
    return limit and sorted_keywords[:limit] or sorted_keywords
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
443040
def get_values_of_matching_keys(pattern_dict, user_name):
    '''
    
    '''
    ret = []
    for expr in pattern_dict:
        if salt.utils.stringutils.expr_match(user_name, expr):
            ret.extend(pattern_dict[expr])
    return ret
224529
def find_entries(self, users, start, *args, **kwargs):
        
        forever = kwargs.get('all', False)
        for user in users:
            if forever:
                entries = Entry.objects.filter(user=user).order_by('start_time')
            else:
                entries = Entry.objects.filter(
                    user=user, start_time__gte=start).order_by(
                    'start_time')
            yield entries
649643
def match(pattern, data, **parse_kwargs):
    """"""
    return [m.value for m in parse(pattern, **parse_kwargs).find(data)]
1010126
def check_all(self, all_entries, *args, **kwargs):
        
        all_overlaps = 0
        while True:
            try:
                user_entries = all_entries.next()
            except StopIteration:
                return all_overlaps
            else:
                user_total_overlaps = self.check_entry(
                    user_entries, *args, **kwargs)
                all_overlaps += user_total_overlaps