/*
Documented, #find
544769
public static <E> Optional<E> find(final Iterable<E> iterable, final Predicate<E> pred) {
        for (E element : iterable) {
            if (pred.test(element)) {
                return Optional.of(element);
            }
        }
        return Optional.absent();
    }
1196418
function findValues(toSearch, ...searchFor) {
  const searchesLen = searchFor.length;
  let results = {};
  let searches = {};

  for (let i = 0; i < searchesLen; i++) {
    searches[searchFor[i]] = true;
  }

  /* Object, Object -> Void */
  function traverseObject(toSearchObj, searchForObj) {
    const allKeys = Object.keys(toSearchObj);
    const len = allKeys.length;

    for (let i = 0; i < len; i++) {
      const key = allKeys[i];
      const val = toSearchObj[key];

      if (searchForObj[key] && !results[key]) {
        results[key] = val;
      } else if (isObject(val)) {
        traverseObject(val, searchForObj);
      } else if (isArray(val)) {
        traverseArray(val, searchForObj);
      }
    }
  }

  /* Array, Object -> Void */
  function traverseArray(arr, searchForObj) {
    const len = arr.length;

    for (let i = 0; i < len; i++) {
      const item = arr[i];

      if (isArray(item)) {
        traverseArray(item, searchForObj);
      } else if (isObject(item)) {
        traverseObject(item, searchForObj);
      }
    }
  }

  traverseObject(toSearch, searches);

  return results;
}
1291293
def find(self, collection, selector={}):
        """"""
        results = []
        for _id, doc in self.collection_data.data.get(collection, {}).items():
            doc.update({'_id': _id})
            if selector == {}:
                results.append(doc)
            for key, value in selector.items():
                if key in doc and doc[key] == value:
                    results.append(doc)
        return results
665392
function findSync(pattern, basePath, findDir) {
  const matches = [];

  (function findSyncRecurse(base) {
    let children;
    try {
      children = fs.readdirSync(base);
    } catch (exception) {
      if (exception.code === 'ENOENT') {
        return;
      }
      throw exception;
    }

    children.forEach((child) => {
      const childPath = path.join(base, child);
      const childIsDirectory = fs.lstatSync(childPath).isDirectory();
      const patternMatches = pattern.test(childPath);

      if (!patternMatches) {
        if (!childIsDirectory) {
          return;
        }
        findSyncRecurse(childPath);
        return;
      }

      if (!findDir) {
        matches.push(childPath);
        return;
      }

      if (childIsDirectory) {
        matches.push(childPath);
      }
    });
  })(basePath);
  return matches;
}
1066651
def find( str )
      super lambda { raise Errno::ENOENT, str } do |dir|
        path = extensions.find do |ext|
          file = dir.join str + ext
          break file if file.exist?
        end
        break path if path
      end
    end
1365100
function find(test, paths, callback, one) {
  var state = {
    broken: false,
    checked: [],
    test: augment(test)
  }

  if (!callback) {
    callback = paths
    paths = [process.cwd()]
  } else if (typeof paths === 'string') {
    paths = [paths]
  }

  return visitAll(state, paths, null, one, done)

  function done(result) {
    callback(null, one ? result[0] || null : result)
  }
}
548045
@Override
    public <T> T find(Class<T> entityClass, Object primaryKey)
    {
        try
        {
            return ivEm.find(entityClass, primaryKey);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
228635
public <T> T find(Connection conn, Collection<String> fields, Entity where, RsHandler<T> rsh) throws SQLException {
		final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
		query.setFields(fields);
		return find(conn, query, rsh);
	}
1095867
@SuppressWarnings("uncheck")// cortiz, might change in jongo 1.4
    protected Iterable<T> returnList(final Find find) {
        return (Iterable<T>)find.as(clazz);
    }
1354671
function find(prefix, suffix)
    {
        if(valStack.length > 0)
        {
            var currentVal = valStack[valStack.length - 1];

            if(prefix.length > 0)
            {
                // Manipulate prefix and suffix
                var currentField = prefix.shift();
                suffix.push(currentField);

                if(currentVal.hasOwnProperty(currentField))
                {
                    if(prefix.length > 0)
                    {
                        valStack.push(currentVal[currentField]);
                        find(prefix, suffix);
                        valStack.pop();
                    }
                    else
                    {
                        //finalResults.push(currentVal[currentField]);
                        store(suffix, currentVal[currentField]);
                    }
                }
                else if(currentField == "$")
                {
                    find(prefix, suffix);
                }
                else if(currentField == "*")
                {
                    findInEachChild(prefix, suffix);
                }
                else if(currentField == "^")
                {
                    findInParent(prefix, suffix);
                }
                else if(currentField == "~")
                {
                    findInAllDescendants(prefix, suffix);
                }
                else if(currentField.indexOf(",") >= 0)
                {
                    findMultiple(prefix, suffix);
                }
                else if(currentField.substr(0, 1) == "?")
                {
                    findByCondition(currentField.replace(/^\?\((.*?)\)$/,"$1"), prefix, suffix);
                }
                else
                {
                    // alert("Property not found");
                    // NOOP
                }

                // Restore prefix and suffix
                prefix.unshift(suffix.pop());
            }
            else
            {
                // alert("prefix is empty!");
                //finalResults.push(currentVal);
                store(suffix, currentVal);
            }
        }
        else
        {
            // alert("valStack is empty!");
            // NOOP
        }
    }
317288
function findAll(predicate) {
        var key,
            elem,
            result = [];
        for (key in _idMap) {
            if (_idMap.hasOwnProperty(key)) {
                elem = _idMap[key];
                if (predicate(elem)) {
                    result.push(elem);
                }
            }
        }
        return result;
    }
821329
function find(params = {}) {
  const name = params.type;

  if (Utils.has(availableDirectives, name)) {
    return new availableDirectives[name](params);
  }

  // Only show warning if someone explicity enters a bad name
  if (name) { Logger.warn(`Directive type '${name}' does not exist. Falling back to 'text'`); }
  /* eslint-disable-next-line new-cap */
  return new availableDirectives.text(params);
}
1310645
function findExternal(source, externals, context) {
  if (!externals) return false

  // string match
  if (typeof externals === 'string') return (source === externals)

  // array: recurse
  if (externals instanceof Array) {
    return externals.some(function (e) { return findExternal(source, e, context) })
  }

  if (externals instanceof RegExp) {
    return externals.test(source)
  }

  if (typeof externals === 'function') {
    var functionExternalFound = false
    externals.call(null, context, source, function(err, value) {
      if (err) {
        functionExternalFound = false
      } else {
        functionExternalFound = findExternal(source, value, context)
      }
    })
    return functionExternalFound
  }

  // else, vanilla object
  for (var key in externals) {
    if (!has(externals, key)) continue
    if (source === key) return true
  }
  return false
}
1092116
function find(array, exp) {
  return (isArray(array) && isDefined(exp))
    //return the member and not an array like `first`
    ? findInArray(array, $parse(exp), false)
    : array;
}
774711
function find($selector, $idx=null, $lowercase=false)
	{
		$selectors = $this->parse_selector($selector);
		if (($count=count($selectors))===0) return array();
		$found_keys = array();

		// find each selector
		for ($c=0; $c<$count; ++$c)
		{
			// The change on the below line was documented on the sourceforge code tracker id 2788009
			// used to be: if (($levle=count($selectors[0]))===0) return array();
			if (($levle=count($selectors[$c]))===0) return array();
			if (!isset($this->_[HDOM_INFO_BEGIN])) return array();

			$head = array($this->_[HDOM_INFO_BEGIN]=>1);

			// handle descendant selectors, no recursive!
			for ($l=0; $l<$levle; ++$l)
			{
				$ret = array();
				foreach ($head as $k=>$v)
				{
					$n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
					//PaperG - Pass this optional parameter on to the seek function.
					$n->seek($selectors[$c][$l], $ret, $lowercase);
				}
				$head = $ret;
			}

			foreach ($head as $k=>$v)
			{
				if (!isset($found_keys[$k]))
				{
					$found_keys[$k] = 1;
				}
			}
		}

		// sort keys
		ksort($found_keys);

		$found = array();
		foreach ($found_keys as $k=>$v)
			$found[] = $this->dom->nodes[$k];

		// return nth-element or array
		if (is_null($idx)) return $found;
		else if ($idx<0) $idx = count($found) + $idx;
		return (isset($found[$idx])) ? $found[$idx] : null;
	}
1122772
function findAll (tree, test) {
  var found = test(tree) ? [tree] : []
  if (isNode(tree)) {
    if (tree.children.length > 0) {
      tree.children.forEach(function (child) {
        found = found.concat(findAll(child, test))
      })
    }
  }

  return found
}
711923
@Override
  public void findOne(String sql,
                      Object[] params, 
                      Result<Cursor> result)
  {
    
    _db.findOne(sql, result, params);
  }