/*
Find in Model, where 'key' is equal to id
541931
function _findAssociated(Model, key, id, cb){
	// Create where clause
	var options = {
		where: {}
	};
	options.where[key] = id;

	var finding = Model.find(options);

	finding.exec(function afterFound(err, models) {
		if(cb)
			cb(models);
	});
}
350258
@Override
    public Object find(Class entityClass, Object key)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
        JsonDocument doc;
        String id = generateJsonDocId(entityMetadata.getTableName(), key.toString());
        doc = bucket.get(id);
        LOGGER.debug("Found result for ID : " + key.toString() + " in the " + bucket.name() + " Bucket");

        if (doc == null)
        {
            return null;
        }
        else
        {
            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                    .getMetamodel(entityMetadata.getPersistenceUnit());
            EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz());
            return handler.getEntityFromDocument(entityClass, doc.content(), entityType);
        }
    }
916590
function find (state, prefix, objectsOrIds) {
  return Array.isArray(objectsOrIds)
    ? findMany(state, objectsOrIds, prefix)
    : findOne(state, objectsOrIds, prefix)
}
430575
@Transactional(readOnly = true)
	public Event find(Integer id) {
		return em.createQuery("FROM Event WHERE id = :id", Event.class)
				.setParameter("id", id)
				.getSingleResult();
	}
1235909
public static function find( $param = null, $param2 = null ) 
	{
		$settings = static::_model();

		$query = DB::select( $settings['table'] );

		// Do we have a find modifier?
		if ( !is_null( $settings['find_modifier'] ) ) 
		{
			$callbacks = $settings['find_modifier'];

			if ( !\CCArr::is_collection( $callbacks ) )
			{
				$callbacks = array( $callbacks );
			}

			foreach( $callbacks as $call )
			{
				if ( is_callable( $call ) ) 
				{
					call_user_func_array( $call, array( &$query ) );
				}
				else 
				{
					throw new ModelException( "Invalid Callback given to find modifiers." );
				}
			}
		}

		if ( !is_null( $param ) )
		{
			// Check if paramert 1 is a valid callback and not a string.
			// Strings as function callback are not possible because
			// the user might want to search by key like:
			// Model::find( 'key', 'type' );
			if ( is_callable( $param ) && !is_string( $param ) ) 
			{
				call_user_func_array( $param, array( &$query ) );
			}
			// When no param 2 isset we try to find the record by primary key
			elseif ( is_null( $param2 ) ) 
			{
				$query->where( $settings['table'].'.'.$settings['primary_key'], $param )
					->limit(1);
			}
			// When param one and two isset we try to find the record by
			// the given key and value.
			elseif ( !is_null( $param2 ) )
			{
				$query->where( $param, $param2 )
					->limit(1);
			}
		}

		// alway group the result
		$query->forward_key( $settings['primary_key'] );

		// and we have to fetch assoc
		$query->fetch_arguments = array( 'assoc' );

		// and assign
		return static::assign( $query->run() );
	}
470812
function _findType(details, keys) {
  if (details.card != null) {
    return keys.indexOf("card");
  } else if (details.bank_account != null) {
    return keys.indexOf("bank_account");
  } else if (details.pii != null) {
    return keys.indexOf("pii");
  } else return false;
}
826965
function RouteRule_find(data, key) {
        return data.filter(Type.isFunction(key) ? key : function (item) {
            return item.key === key;
        }).pop();
    }
1363444
def find_by!(conditions = {})
      result = find_by(conditions)
      if result.nil?
        raise RecordNotFound.new("Couldn't find #{name} with '#{conditions.keys.first}'=#{conditions.values.first}")
      end
      result
    end
747815
function find(id, callback) {
        var Model, request;

        Model = this;
        request = {
            action : 'findOne',
            model : Model,
            params : {
                id : id
            }
        };
        this.storage.findOne(request, function findOneCallback(data) {
            if (callback) {
                callback(data);
            }
        });
        return this;
    }
135282
function(model) {
        var modelObj = model.changedAttributes();
        _.each(model.changed, function(value, key) {
          if (typeof value === 'undefined' || value === null) {
            if (key == 'id') {
              delete modelObj[key];
            } else {
              modelObj[key] = null;
            }
          }
        });

        return modelObj;
      }
103339
function find($key=NULL,$val=NULL) {
		$out=[];
		if (isset($_SESSION[$this->key])) {
			foreach ($_SESSION[$this->key] as $id=>$item)
				if (!isset($key) ||
					array_key_exists($key,$item) && $item[$key]==$val ||
					$key=='_id' && $id==$val) {
					$obj=clone($this);
					$obj->id=$id;
					$obj->item=$item;
					$out[]=$obj;
				}
		}
		return $out;
	}
78422
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array())
	{
		$db = $this->DB();
		if (!$db || empty($this->_table)) {
			return false;
		}
		$table =& $this->TableInfo();
		$arr = $db->GetActiveRecordsClass(get_class($this),$this, $whereOrderBy,$bindarr,$pkeysArr,$extra,
			array('foreignName'=>$this->foreignName, 'belongsTo'=>$table->_belongsTo, 'hasMany'=>$table->_hasMany));
		return $arr;
	}
428912
function(req) {

    var pk = module.exports.parsePk(req);

    // Validate the required `id` parameter
    if (!pk) {

      var err = new Error(
        'No `id` parameter provided.' +
        '(Note: even if the model\'s primary key is not named `id`- ' +
        '`id` should be used as the name of the parameter- it will be ' +
        'mapped to the proper primary key name)'
      );
      err.status = 400;
      throw err;
    }

    return pk;
  }
1276878
def find_by_id(self, _id, **kwargs):
        

        if type(_id) == dict and _id.get("_id"):
            return self.find_one({"_id": ObjectId(_id["_id"])}, **kwargs)

        return self.find_one({"_id": ObjectId(_id)}, **kwargs)
171967
public static final <T extends Model> T find(Class<T> cls, Long id) {
		return Select.from(cls).where(_ID + "=?", id).fetchSingle();
	}
1194546
function(key, ctx, partials, returnFound) {
      var found,
          names = key.split('.'),
          val = this.f(names[0], ctx, partials, returnFound),
          doModelGet = this.options.modelGet,
          cx = null;

      if (key === '.' && isArray(ctx[ctx.length - 2])) {
        val = ctx[ctx.length - 1];
      } else {
        for (var i = 1; i < names.length; i++) {
          found = findInScope(names[i], val, doModelGet);
          if (found != null) {
            cx = val;
            val = found;
          } else {
            val = '';
          }
        }
      }

      if (returnFound && !val) {
        return false;
      }

      if (!returnFound && typeof val == 'function') {
        ctx.push(cx);
        val = this.mv(val, ctx, partials);
        ctx.pop();
      }

      return val;
    }
207480
def _get_by_id(collection, id):
    '''
    
    '''
    matches = [item for item in collection if item.id == id]
    if not matches:
        raise ValueError('Could not find a matching item')
    elif len(matches) > 1:
        raise ValueError('The id matched {0} items, not 1'.format(len(matches)))
    return matches[0]