Jump to the next entities (ontology, class or property) depending on context
16134
def do_next(self, line):
        """"""
        if not self.current:
            print("Please select an ontology first. E.g. use the 'ls ontologies' or 'get ontology <name>' commands.")
        elif self.currentEntity:
            g = self.current['graph']
            if self.currentEntity['type'] == 'class':
                nextentity = g.nextClass(self.currentEntity['object'].uri)
                self._select_class(str(nextentity.uri))
            elif self.currentEntity['type'] == 'property':
                nextentity = g.nextProperty(self.currentEntity['object'].uri)
                self._select_property(str(nextentity.uri))
            elif self.currentEntity['type'] == 'concept':
                nextentity = g.nextConcept(self.currentEntity['object'].uri)
                self._select_concept(str(nextentity.uri))
            else:
                print("Not implemented")
        else:
            if len(self.all_ontologies) > 1:
                nextonto = self._next_ontology()
                self._load_ontology(nextonto)
            else:
                self._print("Only one ontology available in repository.")
1066526
function next() {
        $this->currentId++;
        if (!isset($this->classes[$this->currentId]) && !empty($this->todoClasses)) {
            $newUri = array_shift($this->todoClasses);
            $this->classes[] = $newUri;
            $class = new \core_kernel_classes_Class($newUri);
            foreach ($class->getSubClasses(false) as $subClass) {
                if (!in_array($subClass->getUri(), $this->classes) && !in_array($subClass->getUri(), $this->todoClasses)) {
                    $this->todoClasses[] = $subClass->getUri();
                }
            }
        }
    }
314861
function getEntities(callback) {
    self.get(filter, fields, null, page, sort, function(error, entities, pagination) {
      if (error) return callback(error);

      allEntities = allEntities.concat(entities);

      if (page < pagination.pages - 1) {

        // There are other pages
        // Get next page
        page++;
        getEntities(callback);

      } else {

        // No more pages
        // End it
        callback(null);
      }
    });
  }
1300695
function extendContext(context, opts) {
  Object.defineProperties(context, {
    [CONTEXT_SESSION]: {
      get() {
        if (this[_CONTEXT_SESSION]) return this[_CONTEXT_SESSION];
        this[_CONTEXT_SESSION] = new ContextSession(this, opts);
        return this[_CONTEXT_SESSION];
      },
      enumerable: true
    },
    session: {
      get() {
        return this[CONTEXT_SESSION].get();
      },
      set(val) {
        this[CONTEXT_SESSION].set(val);
      },
      configurable: true,
      enumerable: true
    },
    sessionOptions: {
      get() {
        return this[CONTEXT_SESSION].opts;
      },
      enumerable: true
    },
  });
}
81643
def context_chain(self) -> List['Context']:
        """"""
        contexts = []
        ctx = self  # type: Optional[Context]
        while ctx is not None:
            contexts.append(ctx)
            ctx = ctx.parent

        return contexts
1181511
public Object next(EntityMetadata m, List<Map<String, Object>> columnsToOutput)
    {
        return ((HBaseDataHandler) handler).next(m, columnsToOutput);
    }
983757
function (subtype, context, done) {
    var types = this.types
      , loaded = {};
    this.allExtensions(function (type, id, plugin, next) {
      if (!plugin[subtype]) return next();
      if ('string' === typeof plugin[subtype]) {
        try {
          plugin[subtype] = require(path.resolve(path.join(plugin.dir, plugin[subtype])));
        } catch (e) {
          // eslint-disable-next-line no-console
          console.log('failed to load plugin', id, e.message, e.stack);
          e.message += '; error loading plugin ' + id;
          return next(e);
        }
      }

      if (!loaded[type]) loaded[type] = {};
      if (!types[type][subtype]) {
        loaded[type][id] = plugin[subtype];
        return next();
      }
      types[type][subtype](id, plugin[subtype], plugin, context, function (err, initialized) {
        loaded[type][id] = initialized;
        next(err);
      });
    }, function (err) {
      done(err, loaded);
    });
  }
366444
@Override
    public E next()
    {
        if (!checkOnFetchSize() || scrollComplete)
        {
            throw new NoSuchElementException("Nothing to scroll further for:" + entityMetadata.getEntityClazz());
        }
        E result = (E) handler.next(entityMetadata, columns);
        if (!entityMetadata.isRelationViaJoinTable()
                && (entityMetadata.getRelationNames() == null || (entityMetadata.getRelationNames().isEmpty())))
        {
            return result;
        }
        else
        {
            return result = setRelationEntities(result, client, entityMetadata);
        }
    }
1261420
def generate_additional_context(self, matching_datasets):
        """"""
        top_tags = Tag.objects.filter(
            dataset__in=matching_datasets
        ).annotate(
            tag_count=Count('word')
        ).order_by('-tag_count')[:3]

        return {
            'top_tags': top_tags
        }
977278
function setContext(req, res, next) {
    currentContext = {req: req, res: res};
    next();
}
548847
function eachObj(obj, iteratee, context) {
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      iteratee.call(context || obj, key, obj[key]);
    }
  }
}
172191
def next(self):
        """"""
        if self.__empty:
            raise StopIteration
        if len(self.__data) or self._refresh():
            if self.__manipulate:
                _db = self.__collection.database
                return _db._fix_outgoing(self.__data.popleft(),
                                         self.__collection)
            else:
                return self.__data.popleft()
        else:
            raise StopIteration
1282379
function (oEvt) {
				// navigate to entity
				var sType = oEvt.getSource().data("type");
				this.getRouter().navTo("entity", {id: sType}, false);
			}
578303
def _startup(cls):
        
        for endpoint_name in sorted(hookenv.relation_types()):
            # populate context based on attached relations
            relf = relation_factory(endpoint_name)
            if not relf or not issubclass(relf, cls):
                continue

            rids = sorted(hookenv.relation_ids(endpoint_name))
            # ensure that relation IDs have the endpoint name prefix, in case
            # juju decides to drop it at some point
            rids = ['{}:{}'.format(endpoint_name, rid) if ':' not in rid
                    else rid for rid in rids]
            endpoint = relf(endpoint_name, rids)
            cls._endpoints[endpoint_name] = endpoint
            endpoint.register_triggers()
            endpoint._manage_departed()
            endpoint._manage_flags()
            for relation in endpoint.relations:
                hookenv.atexit(relation._flush_data)
49441
def add_entity(self, property_name, use_context=True):
        
        if self.has_property(property_name):
            err = 'Property "{}" already exists'
            raise PropertyExists(err.format(property_name))
        prop = EntityProperty(use_context=bool(use_context))
        self.entities[property_name] = prop
        return prop
370569
function (collection, data, action, options) {
                if (!(data instanceof Array)) {
                    throw "data has to be an array";
                }
                var context,
                    entity,
                    newData = [];
                for (var i = 0; i < data.length; i++) {
                    var value = data[i];
                    if (!(value instanceof Model)) {
                        // this is needed to determine the right context for collection models that are just links inside the collection
                        context = this.$dataSource._getContext(collection.$modelFactory, collection, value);
                        entity = context.createEntity(collection.$modelFactory, this._getIdForValue(value, collection.$modelFactory));
                        entity.set(this._parseModel(entity, value, action, options));
                        newData.push(entity);
                    }
                }

                return newData;
            }
617298
def _select_property(self, line):
        """"""
        g = self.current['graph']
        if not line:
            out = g.all_properties
            using_pattern = False
        else:
            using_pattern = True
            if line.isdigit():
                line = int(line)
            out = g.get_property(line)
        if out:
            if type(out) == type([]):
                choice = self._selectFromList(out, using_pattern, "property")
                if choice:
                    self.currentEntity = {'name': choice.locale or choice.uri,
                                          'object': choice, 'type': 'property'}

            else:
                self.currentEntity = {'name': out.locale or out.uri,
                                      'object': out, 'type': 'property'}

            # ..finally:
            if self.currentEntity:
                self._print_entity_intro(entity=self.currentEntity)
        else:
            print("not found")