Retrieve related objects.
@param key {string} The relation key to fetch models for.
@param options {object} Options for 'Backbone.Model.fetch' and 'Backbone.sync'.
@return {xhr} An array or request objects
901
function( key, options ) {
			options || ( options = {} );
			var rel = this.getRelation( key ),
				keyContents = rel && rel.keyContents,
				toFetch = keyContents && _.select( _.isArray( keyContents ) ? keyContents : [ keyContents ], function( item ) {
						var id = _.isString( item ) || _.isNumber( item ) ? item : item[ rel.relatedModel.prototype.idAttribute ];
						return id && !Backbone.Relational.store.find( rel.relatedModel, id );
					}, this );
			
			if ( toFetch && toFetch.length ) {
				// Create a model for each entry in 'keyContents' that is to be fetched
				var models = _.map( toFetch, function( item ) {
						if ( typeof( item ) === 'object' ) {
							var model = new rel.relatedModel( item );
						}
						else {
							var attrs = {};
							attrs[ rel.relatedModel.prototype.idAttribute ] = item;
							var model = new rel.relatedModel( attrs );
						}
						return model;
					}, this );
				
				// Try if the 'collection' can provide a url to fetch a set of models in one request.
				if ( rel.related instanceof Backbone.Collection && _.isFunction( rel.related.url ) ) {
					var setUrl = rel.related.url( models );
				}
				
				// An assumption is that when 'Backbone.Collection.url' is a function, it can handle building of set urls.
				// To make sure it can, test if the url we got by supplying a list of models to fetch is different from
				// the one supplied for the default fetch action (without args to 'url').
				if ( setUrl && setUrl !== rel.related.url() ) {
					var opts = _.defaults( {
							error: function() {
									var args = arguments;
									_.each( models, function( model ) {
											model.destroy();
											options.error && options.error.apply( model, args );
										})
								},
							url: setUrl
						},
						options,
						{ add: true }
					);
					
					var requests = [ rel.related.fetch( opts ) ];
				}
				else {
					var requests = _.map( models, function( model ) {
							var opts = _.defaults( {
								error: function() {
										model.destroy();
										options.error && options.error.apply( model, arguments );
									}
								},
								options
							);
							return model.fetch( opts );
						}, this );
				}
			}
			
			return _.isUndefined( requests ) ? [] : requests;
		}
282019
protected static Object fetchObject(String key) {
        String[] path = key.split("\\.");
        Object currentValue = fakeValuesMap;
        for (String pathSection : path) {
            currentValue = ((Map<String, Object>) currentValue).get(pathSection);
        }
        return currentValue;
    }
215414
function(options) {
      options || (options = {});
      var collection = this;
      var success = options.success;
      options.success = function(resp, status, xhr) {
        collection[options.add ? 'add' : 'reset'](collection.parse(resp, xhr), options);
        if (success) success(collection, resp);
      };
      options.error = wrapError(options.error, collection, options);
      return (this.sync || Backbone.sync).call(this, 'read', this, options);
    }
759714
def get(self, key):
        
        if key not in self:
            self[key] = set(get_descendants(self._target_graph, key))
        return self[key]
927746
function cacheGet(key, options) {
    if (shouldCache(options)) {
      return;
    }

    if (self.options.cache === 'memory') {
      return self.cache[key];
    }

    return self.options.cache.get(key);
  }
674279
protected function getRelationship($key)
    {
        if (true === $this->isHasOne($key)) {
            $this->touch();
            return $this->hasOneRelationships->get($key);
        }
        if (true === $this->isHasMany($key)) {
            $this->touch();
            $collection = $this->hasManyRelationships->get($key);
            if ($collection->isLoaded($collection)) {
                return iterator_to_array($collection);
            }
            return (true === $this->collectionAutoInit) ? iterator_to_array($collection) : $collection->allWithoutLoad();
        }
        return null;
    }
452257
function(model, db, options) {
		// a single model
		if (!isCollection(model)) return db.get(model.id, options.options.get);

		// process query requests
		if (options.query) return db.query(options.query, options.options.query);

		// regular collection fetch
		return db.allDocs(options.options.allDocs);
	}
1369843
def get(self, key: Any, default: Any=None) -> Any:
        ''''''

        return self.data.get(key, default)
1003750
function(options) {
          options = options ? _.clone(options) : {};
          if (options.parse === void 0) { options.parse = true; }
          var success = options.success;
          var collection = this;
          options.success = function(resp) {
            var arr = [];
            var keys = _.keys(resp);
            _.each(keys, function(key) {
              arr.push(resp[key]);
            });
            var method = options.reset ? 'reset' : 'set';
            collection[method](arr, options);
            if (success) { success(collection, arr, options); }
            options.autoSync = false;
            options.url = this.url;
            collection.trigger('sync', collection, arr, options);
          };
          return this.sync('read', this, options);
        }
135797
def load(key, options = {})
      @stack.each do |s|
        value = s.load(key, options)
        return value if value != nil
      end
      nil
    end
1370871
function(name, options) {
    const self = this
    const utils = self.store.utils

    // called every time before a parent query occures, with an include of this relation.
    // maybee the conditions of the parent query will contain variables whilch will let us
    // query this relation simultaneously.
    // e.g. Parent.find(99).include('children')
    //      with from: 'id' to: 'parent_id'
    //      99 => is the id!
    options.loadFromConditions =
      options.loadFromConditions ||
      function(parentCollection, parentConditions, include) {
        include = include || {}
        const conditions = utils.parentConditionsToConditions(
          parentConditions || [],
          options.from,
          options.to
        )
        if (!conditions) return

        return defaultFetch(parentCollection, conditions, include)
      }

    // called every time we need to fetch data for that relation
    options.loadFromRecords =
      options.loadFromRecords ||
      function(parentCollection, include, existingCollection) {
        include = include || {}

        const conditions = utils.recordsToConditions(
          parentCollection,
          options.from,
          options.to
        )
        if (!conditions) return Promise.resolve([]) // not enough info to form conditions. Better return an empty result instead of loading the whole dataset!

        return defaultFetch(
          parentCollection,
          conditions,
          include,
          existingCollection
        ).then(function(result) {
          // add the result to corresponding record
          parentCollection.forEach(function(record) {
            record.relations[name] = options.filterCache(record, result)
          })

          return result
        })
      }

    function defaultFetch(
      parentCollection,
      conditions,
      include,
      existingCollection
    ) {
      const relationCache = parentCollection.getInternal('relation_cache') || {}

      // return cached result, if available!
      if (relationCache[options.name]) {
        const result = relationCache[options.name]
        if (!result.then) return Promise.resolve(relationCache[options.name])
        return result
      }

      const query = options.model.where(conditions)
      if (options.conditions) query.where(options.conditions) // conditions on the relation
      if (options.scope) query[options.scope].apply(query, include.args) // scope on the relation
      if (include.conditions) query.where(include.conditions) // nested conditions via `where({relation_name: {...conditions...}})`
      if (include.children) query.include(include.children) // nested includes via `include({relation_name: {nested_relation_name: { ... }}})`
      if (include.scope) query[include.scope].apply(query, include.args) // scope defined via `include({relation_name: {$scope: 'myscope'}})`
      if (existingCollection) {
        const existingConditions = existingCollection.getInternal('conditions')
        const existingIncludes = existingCollection.getInternal('includes')

        if (existingIncludes) query.addInternal('includes', existingIncludes)
        if (existingConditions) {
          // add only new conditions
          const intConditions = query.getInternal('conditions')
          query.addInternal(
            'conditions',
            existingConditions.filter(function(c) {
              if (options.to.indexOf(c.attribute) !== -1) return false // ignore conditions with the target id field. existinCollection will automatically add such an id.

              var match = false
              intConditions.forEach(function(intC) {
                if (options.model.store.utils.compareObjects(c, intC, true))
                  match = true
              })
              return !match
            })
          )
        }

        utils.assignInternals(query, existingCollection, {
          exclude: ['relation', 'relation_to']
        })
      }

      const promise = query.then(function(result) {
        // overwrite cache result
        relationCache[options.name] = result
        return result
      })

      // store the promise in the cache object
      relationCache[options.name] = promise
      parentCollection.setInternal('relation_cache', relationCache)

      return promise
    }

    // called with every parent and child record. returns true/false for matching relations
    options.filterCache =
      options.filterCache ||
      function(parentRecord, records) {
        if (options.model) {
          const chain = options.model.chain()

          if (records) {
            if (!Array.isArray(records)) records = [records]
            const relatedRecords = records.filter(function(record) {
              var match = true

              options.from.forEach(function(key, index) {
                const opposite = options.to[index]
                const val1 = parentRecord[key]
                const val2 = record[opposite]
                if (!utils.checkFieldEquality(val1, val2)) match = false
              })
              return match
            })

            chain.add(relatedRecords) // add all child records
            chain._exists() // set this collection as existing (all records fetched from the datastore!)
          }

          chain.setInternal('relation', options) // add the parent relation of this collection
          chain.setInternal('relation_to', parentRecord) // + the parent record

          return chain
        }

        throw new Error('You need to implement your own `filterCache` function!')
      }

    options.getFromCache = function(parentRecord, include, existingCollection) {
      const parentCollection =
        parentRecord.__chainedModel ||
        parentRecord.model.chain().add(parentRecord)

      return options
        .loadFromRecords(parentCollection, include || {}, existingCollection)
        .then(function(result) {
          if (!result) return null
          return options.filterCache(parentRecord, result)
        })
    }

    return options
  }
1205507
def load(key, options = {})
      if options[:sync] || (value = @cache.load(key, options)) == nil
        value = @adapter.load(key, options)
        @cache.store(key, value, options) if value != nil
      end
      value
    end
93346
def fetch(key, cache_options, &block)
      if defined?(Rails)
        Rails.cache.fetch(key, cache_options, &block)
      else
        @cache[key] ||= yield
      end
    end
36466
function get(method, key) {
    if (exports.results.has(method))
        return exports.results.get(method).get(key);
}
156565
function modelQuery(options) {
            return models.Post.findPage(options)
                .then(({data, meta}) => {
                    return {
                        posts: data.map(model => urlsForPost(model.id, model.toJSON(options), options)),
                        meta: meta
                    };
                });
        }
1244107
def get(self, *args, **kwargs):
        """"""
        self.before_get(args, kwargs)

        relationship_field, model_relationship_field, related_type_, related_id_field = self._get_relationship_data()

        obj, data = self._data_layer.get_relationship(model_relationship_field,
                                                      related_type_,
                                                      related_id_field,
                                                      kwargs)

        result = {'links': {'self': request.path,
                            'related': self.schema._declared_fields[relationship_field].get_related_url(obj)},
                  'data': data}

        qs = QSManager(request.args, self.schema)
        if qs.include:
            schema = compute_schema(self.schema, dict(), qs, qs.include)

            serialized_obj = schema.dump(obj)
            result['included'] = serialized_obj.data.get('included', dict())

        final_result = self.after_get(result)

        return final_result
614792
function (optionCollection, key, model, collection) {
        if (optionCollection) {
            return strTo(optionCollection, model, Collection) || collection;
        }
        return strTo(key, model, Collection) || null;
    }