Load the list of all of the distinct courses required for the
list of provided events and save the result in memory.
341286
protected function load_courses() {
        global $DB;

        $courseids = [];
        foreach ($this->events as $event) {
            if ($course = $event->get_course()) {
                $id = $course->get('id');
                $courseids[$id] = true;
            }
        }

        if (empty($courseids)) {
            $this->courses = [];
            return;
        }

        list($idsql, $params) = $DB->get_in_or_equal(array_keys($courseids));
        $sql = "SELECT * FROM {course} WHERE id {$idsql}";

        $this->courses = $DB->get_records_sql($sql, $params);
    }
366045
def bind_events(self, events):
        '''
        '''
        evs = self._events
        if evs and events:
            for event in evs.values():
                if event.name in events:
                    event.bind(events[event.name])
939620
def _load(self, event):
        
        if not event.data:
            return

        context = self.context()
        schema = self.schema()
        dbname = schema.dbname()
        clean = {}

        for col, value in event.data.items():
            try:
                model_dbname, col_name = col.split('.')
            except ValueError:
                col_name = col
                model_dbname = dbname

            # make sure the value we're setting is specific to this model
            try:
                column = schema.column(col_name)
            except orb.errors.ColumnNotFound:
                column = None

            if model_dbname != dbname or (column in clean and isinstance(clean[column], Model)):
                continue

            # look for preloaded reverse lookups and pipes
            elif not column:
                self.__preload[col_name] = value

            # extract the value from the database
            else:
                value = column.dbRestore(value, context=context)
                clean[column] = value

        # update the local values
        with WriteLocker(self.__dataLock):
            for col, val in clean.items():
                default = val if not isinstance(val, dict) else val.copy()
                self.__values[col.name()] = (default, val)
                self.__loaded.add(col)

        if self.processEvent(event):
            self.onLoad(event)
875301
def _LoadAuditEvents(handlers,
                     get_report_args,
                     actions=None,
                     token=None,
                     transformers=None):
  """"""
  if transformers is None:
    transformers = {}

  if data_store.RelationalDBEnabled():
    entries = data_store.REL_DB.ReadAPIAuditEntries(
        min_timestamp=get_report_args.start_time,
        max_timestamp=get_report_args.start_time + get_report_args.duration,
        router_method_names=list(handlers.keys()))
    rows = [_EntryToEvent(entry, handlers, transformers) for entry in entries]
  else:
    entries = report_utils.GetAuditLogEntries(
        offset=get_report_args.duration,
        now=get_report_args.start_time + get_report_args.duration,
        token=token)
    if actions is None:
      actions = set(handlers.values())
    rows = [entry for entry in entries if entry.action in actions]
  rows.sort(key=lambda row: row.timestamp, reverse=True)
  return rows
1173533
function load() {
		var newRules = Rules.rules;
		Object.keys(newRules).forEach(function(ruleId) {
			define(ruleId, newRules[ruleId]);
		});
	}
834877
public void addPossiblesEventsComplex() {
        Set<Scenario> scenarios = this.getScenarios();
        for (Scenario s : scenarios) {
            for (Class<? extends Event> c : s.getPossibleEventsOfNE().keySet()) {
                if (!this.getPossibleEventsOfNE().containsKey(c)) {
                    this.addPossibleEventsOfNE(c, s.getPossibleEventsOfNE()
                            .get(c));
                } else {
                    List<Set<NetworkElement>> elements = this
                            .getPossibleEventsOfNE().get(c);
                    // elements.addAll(s.getPossibleEventsOfNE().get(c));
                    for (Set<NetworkElement> sne : s.getPossibleEventsOfNE()
                            .get(c)) {
                        if (!elements.contains(sne))
                            elements.add(sne);
                    }
                    this.addPossibleEventsOfNE(c, elements);
                }
            }
            for (Class<? extends Event> c : s.getPossibleEventsOfScenario()
                    .keySet()) {
                if (!this.getPossibleEventsOfScenario().containsKey(c)) {
                    this.addPossibleEventsOfScenario(c, s
                            .getPossibleEventsOfScenario().get(c));
                } else {
                    List<Set<Scenario>> elements = this
                            .getPossibleEventsOfScenario().get(c);
                    // elements.addAll(s.getPossibleEventsOfScenario().get(c));
                    for (Set<Scenario> sne : s.getPossibleEventsOfScenario()
                            .get(c)) {
                        if (!elements.contains(sne))
                            elements.add(sne);
                    }
                    this.addPossibleEventsOfScenario(c, elements);
                }
            }
        }

    }
354628
public function eventArchiveList()
    {
        $entries = $this->eventManager()->archive();
        foreach ($entries as $entry) {
            yield $this->eventFormatShort($entry);
        }
    }
836357
def load(self, train=True, test=True, shuffle=True) -> tuple:
        
        return self.__load(self.__load_files, train, test, shuffle=shuffle)
1138710
def load(self, arguments):
        ""
        features = arguments[1:-1]
        list(map(self.load_feature, features))
1267924
def load(self, data):
        
        self.clear()
        self.update(data)
        self.enhance()
620075
protected function load_groups() {
        global $DB;

        $groupids = [];
        foreach ($this->events as $event) {
            if ($group = $event->get_group()) {
                $id = $group->get('id');
                $groupids[$id] = true;
            }
        }

        if (empty($groupids)) {
            $this->groups = [];
            return;
        }

        list($idsql, $params) = $DB->get_in_or_equal(array_keys($groupids));
        $sql = "SELECT * FROM {groups} WHERE id {$idsql}";

        $this->groups = $DB->get_records_sql($sql, $params);
    }
930304
public void load() {
        Stopwatchs.start("Load Plugins");

        classLoaders.clear();

        final ServletContext servletContext = AbstractServletListener.getServletContext();
        final Set<String> pluginDirPaths = servletContext.getResourcePaths("/plugins");

        final List<AbstractPlugin> plugins = new ArrayList<>();

        if (null != pluginDirPaths) {
            for (final String pluginDirPath : pluginDirPaths) {
                try {
                    LOGGER.log(Level.INFO, "Loading plugin under directory[{0}]", pluginDirPath);

                    final AbstractPlugin plugin = load(pluginDirPath, pluginCache);

                    if (plugin != null) {
                        plugins.add(plugin);
                    }
                } catch (final Exception e) {
                    LOGGER.log(Level.WARN, "Load plugin under directory[" + pluginDirPath + "] failed", e);
                }
            }
        }

        eventManager.fireEventSynchronously(new Event<>(PLUGIN_LOADED_EVENT, plugins));

        Stopwatchs.end();
    }
912866
def load_fetched_objects_into_contexts(events, model_data, context_hints_per_source):
    
    for event in events:
        context_hints = context_hints_per_source.get(event.source, {})
        for context_key, hints in context_hints.items():
            model = get_model(hints['app_name'], hints['model_name'])
            for d, value in dict_find(event.context, context_key):
                if isinstance(value, list):
                    for i, model_id in enumerate(d[context_key]):
                        d[context_key][i] = model_data[model].get(model_id)
                else:
                    d[context_key] = model_data[model].get(value)
758600
function load( available, toLoad ) {
    let loadList = available;
    if ('string' === typeof toLoad ) {
      loadList = [toLoad];
    }
    if (Array.isArray(toLoad)) {
      loadList = toLoad;
    }
    loadList.forEach(function( name ) {
      if ( available.indexOf(name) < 0 ) {
        return;
      }
      require('./'+name);
    });
  }
594455
def load_bulk(cls, bulk_data, parent=None, keep_ids=False):
        """"""

        cls = get_result_class(cls)

        # tree, iterative preorder
        added = []
        if parent:
            parent_id = parent.pk
        else:
            parent_id = None
        # stack of nodes to analize
        stack = [(parent_id, node) for node in bulk_data[::-1]]
        foreign_keys = cls.get_foreign_keys()
        while stack:
            parent_id, node_struct = stack.pop()
            # shallow copy of the data strucure so it doesn't persist...
            node_data = node_struct['data'].copy()
            cls._process_foreign_keys(foreign_keys, node_data)
            if keep_ids:
                node_data['id'] = node_struct['id']
            if parent_id:
                parent = cls.objects.get(pk=parent_id)
                node_obj = parent.add_child(**node_data)
            else:
                node_obj = cls.add_root(**node_data)
            added.append(node_obj.pk)
            if 'children' in node_struct:
                # extending the stack with the current node as the parent of
                # the new nodes
                stack.extend([
                    (node_obj.pk, node)
                    for node in node_struct['children'][::-1]
                ])
        return added
486636
def load(self, items):
        

        for k, vals in items:
            self[k] = "".join(vals)
481502
def loadRecords(self, records):
        
        try:
            if self._running:
                return
            
            self._cancelled = False
            self._running = True
            
            try:
                self.setDatabase(records.database())
            except AttributeError:
                pass
            
            self.startLoading()
            
            # make sure the orb module is loaded, or there is really no point
            if RecordSet is None:
                logger.error('Orb was not loaded.')
            
            # lookup a group of results
            if RecordSet.typecheck(records) and records.groupBy():
                levels = records.groupBy()
                next_levels = levels[1:]
                
                for key, records in records.grouped(levels[0]).items():
                    if self._cancelled:
                        break
                    
                    # PySide Hack! Emitting None across threads will crash Qt
                    #              when in PySide mode.
                    if key == None:
                        key = 'None'
                    
                    self.loadedGroup.emit(key, records, next_levels)
            
            # lookup a list of results, in batched mode
            elif self.isBatched():
                self.loadBatch(records)
                
            # lookup a list of results, not in batched mode
            else:
                records = list(records)
                if self._preloadColumns:
                    for record in curr_records:
                        record.recordValues(self._preloadColumns)
                
                self.loadedRecords[object].emit(records)
            
            self._running = False
            self.finishLoading()
        except ConnectionLostError:
            self.finishLoading()
            self.connectionLost.emit()
        except Interruption:
            self.finishLoading()
        finally:
            self.finishLoading()