region > findRecentByUser
555234
@Programmatic
    public List<PublishedEvent> findRecentByUser(final String user) {
        return repositoryService.allMatches(
                new QueryDefault<>(PublishedEvent.class, "findRecentByUser", "user", user));

    }
170961
@Override
	public List<CPRuleUserSegmentRel> findByCommerceUserSegmentEntryId(
		long commerceUserSegmentEntryId) {
		return findByCommerceUserSegmentEntryId(commerceUserSegmentEntryId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
1001636
def get_user_tenants(user, group):
    """"""
    if user.is_active and user.is_authenticated():
        if user.is_superuser or is_group_manager(user, group.pk):
            return Tenant.objects.filter(group=group)
        else:
            return Tenant.objects.filter(group=group, tenantrole__user=user).distinct()
    else:
        return Tenant.objects.none()
151976
public function findRecent(
        $excludeUuid = null,
        $limit = self::DEFAULT_LIMIT,
        array $types = null,
        $locale = null,
        $webspaceKey = null
    ) {
        $search = $this->createSearch($limit, $types, $locale, $webspaceKey);

        if ($excludeUuid) {
            $search->addQuery(new TermQuery('uuid', $excludeUuid), BoolQuery::MUST_NOT);
        }

        $search->addSort(new FieldSort('authored', FieldSort::DESC));

        return $this->repository->findDocuments($search);
    }
731726
@Override
  public final synchronized SeSeller find(final Map<String, Object> pReqVars,
    final String pName) throws Exception {
    if (this.sesellers == null) {
      this.sesellers = this.srvOrm.retrieveList(pReqVars, SeSeller.class);
    }
    for (SeSeller ses : this.sesellers) {
      if (ses.getUserAuth().getItsUser().equals(pName)) {
        return ses;
      }
    }
    return null;
  }
425190
public UserStatListResult getUserStatistic(String startTime, int duration)
            throws APIConnectionException, APIRequestException {
        return _reportClient.getUserStatistic(startTime, duration);
    }
1357784
public static List<SuspensionRecord> findByUser(EntityManager em, PrincipalUser user) {
        TypedQuery<SuspensionRecord> query = em.createNamedQuery("SuspensionRecord.findByUser", SuspensionRecord.class);

        try {
            query.setParameter("user", user);
            return query.getResultList();
        } catch (NoResultException ex) {
            return new ArrayList<>(0);
        }
    }
175584
private static String extractUser(String userInfo) {
    if (userInfo == null) {
      return null;
    }

    int index = userInfo.lastIndexOf(':');
    if (index == -1) {
      return userInfo;
    } else {
      return userInfo.substring(0, index);
    }
  }
751536
private Region find(Region x) {
    Region current = this.root;
    while (current != NULL_NODE) {
      long res = x.orderRelativeTo(current);
      if (res < 0) {
        current = current.left;
      } else if (res > 0) {
        current = current.right;
      } else {
        return current;
      }
    }
    return null;
  }
1315078
def find(*args, **kwargs):
    
    # default end_at to now and start to 1 day from now
    end_at = kwargs.get('end_at', datetime.datetime.now())
    start_at = kwargs.get('start_at', end_at - datetime.timedelta(days=1))

    # default # of records to fetch to be 50
    limit = kwargs.get('limit', 50)

    # if no user is defined, fetch for ALL
    user = kwargs.get('user', None)
    if user:
        return request_log.find(start_at, end_at, limit, spec={'user': user})
    else:
        return request_log.find(start_at, end_at, limit)
552044
@Override
    public List<User> searchUsers(String search) throws AuthenticationException {
        // Complete list of users
        String[] users = file_store.keySet().toArray(
                new String[file_store.size()]);
        List<User> found = new ArrayList<User>();

        // Look through the list for anyone who matches
        for (int i = 0; i < users.length; i++) {
            if (users[i].toLowerCase().contains(search.toLowerCase())) {
                found.add(getUser(users[i]));
            }
        }

        // Return the list
        return found;
    }
1136411
@Programmatic
    public List<SessionLogEntry> findByUserAndStrictlyBefore(
            final String user,
            final Timestamp from) {

        return repositoryService.allMatches(new QueryDefault<>(SessionLogEntry.class,
                "findByUserAndTimestampStrictlyBefore",
                "user", user,
                "from", from));
    }
663568
@Override
    public File findMostRecentSnapshot() throws IOException {
        List<File> files = findNValidSnapshots(1);
        if (files.size() == 0) {
            return null;
        }
        return files.get(0);
    }
1371068
@Override
	public List<CommerceAccountUserRel> findByCommerceAccountUserId(
		long commerceAccountUserId) {
		return findByCommerceAccountUserId(commerceAccountUserId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
874752
@Override
	public List<CommerceAccountUserRel> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
95838
@Override
    public Set<Node> findUsers(final String uid) {
        QueryBuilder qb = new LdapQueryBuilder();
        if ("*".equals(uid)) {
            qb.append(LdapKeys.OBJECT_CLASS, userObjectClass);
        } else {
            qb.append(LdapKeys.OBJECT_CLASS, userObjectClass);
            qb.append(userIdentifyer, uid + "*");
        }
        return findUsers(qb);
    }
1297171
public RestletUtilUser findUser(final String userIdentifier)
    {
        if(userIdentifier == null)
        {
            throw new NullPointerException("User identifier was null");
        }
        
        RestletUtilUser result = null;
        
        RepositoryConnection conn = null;
        try
        {
            conn = this.repository.getConnection();
            
            final String query = this.buildSparqlQueryToFindUser(userIdentifier, false);
            
            this.log.debug("findUser: query={}", query);
            
            final TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
            
            final TupleQueryResult queryResult = tupleQuery.evaluate();
            
            try
            {
                if(queryResult.hasNext())
                {
                    final BindingSet bindingSet = queryResult.next();
                    
                    result = this.buildRestletUserFromSparqlResult(userIdentifier, bindingSet);
                }
                else
                {
                    this.log.info("Could not find user with identifier, returning null: {}", userIdentifier);
                }
            }
            finally
            {
                queryResult.close();
            }
            
        }
        catch(final RepositoryException e)
        {
            throw new RuntimeException("Failure finding user in repository", e);
        }
        catch(final MalformedQueryException e)
        {
            throw new RuntimeException("Failure finding user in repository", e);
        }
        catch(final QueryEvaluationException e)
        {
            throw new RuntimeException("Failure finding user in repository", e);
        }
        finally
        {
            try
            {
                conn.close();
            }
            catch(final RepositoryException e)
            {
                this.log.error("Failure to close connection", e);
            }
        }
        
        return result;
    }