Populate the round-robin lists with the fallback backends.
9027
private void useFallbackBackends() {
    usingFallbackBackends = true;
    logger.log(ChannelLogLevel.INFO, "Using fallback backends");

    List<DropEntry> newDropList = new ArrayList<>();
    List<BackendAddressGroup> newBackendAddrList = new ArrayList<>();
    for (EquivalentAddressGroup eag : fallbackBackendList) {
      newDropList.add(null);
      newBackendAddrList.add(new BackendAddressGroup(eag, null));
    }
    useRoundRobinLists(newDropList, newBackendAddrList, null);
  }
608838
def populate_records(self):
        

        self.object_list = self.get_valuesqueryset(self.object_list)
        super(ValuesDatatable, self).populate_records()
1067086
def collect_results():
    
    results = []
    for exe, backendname in EXE_BACKEND_MATRIX:
        results.extend(benchmark_process_and_backend(exe, backendname))
    results.extend(benchmark_go())

    results.sort(
        key=lambda br: (br.benchmark, float(br.time), br.platform, br.backend))
    return results
1155204
private function populate() {
	
		$res = Database::load('SELECT * FROM `options` ORDER BY `group`');
			
		$this->list = array();
			
		foreach ($res as $o) {
			
			// esplode le options
			if ('list'==$o->type) {
				
				$listItems = explode('|', $o->list_options);
				
				foreach ($listItems as $listEntry) {
					
					list ($val,$text)	= explode(',', $listEntry);
					
					$listItem = new \stdClass();
					
					$listItem->value = $val;
					$listItem->text  = $text;
					
					$o->listItems[] = $listItem;
					
				}
				
			}

			// casting
			$o->value = $this->castTo($o->value, $o->type);
			
			$this->list[$o->name] = $o;
			
		}
	
	}
620361
def set_backend(self, backend):
        """"""
        if isinstance(backend, str):
            name = backend
            args = []
            kwargs = {}
        elif isinstance(backend, (tuple, list)):
            name = ''
            args = []
            kwargs = {}
            for i in range(len(backend)):
                if i == 0:
                    name = backend[i]
                else:
                    if isinstance(backend[i], dict):
                        kwargs.update(backend[i])
                    else:
                        args += backend[i]
        else:
            raise TypeError("Backend must be string, tuple, or list")
        if name in available_backends:
            self.backend = name
            self._backend = available_backends[name]()
        elif name is None:
            # The base class should not be called.
            raise Exception(("A backend (e.g. 'jNeuroML' or 'NEURON') "
                             "must be selected"))
        else:
            raise Exception("Backend %s not found in backends.py"
                            % name)
        self._backend.model = self
        self._backend.init_backend(*args, **kwargs)
767502
def create_backend(name: str=None, git_index: GitIndex=None, args: str=None) -> StorageBackend:
    """"""
    if name is None:
        name = config.BACKEND
    if not args:
        args = config.BACKEND_ARGS
    if args:
        try:
            kwargs = dict(p.split("=") for p in args.split(","))
        except:  # flake8: noqa
            raise ValueError("Invalid args") from None
    else:
        kwargs = {}
    if git_index is None:
        git_index = GitIndex()
    kwargs["index"] = git_index
    return __registry__[name](**kwargs)
464206
protected function populate()
    {
        $this->collection = AnalyticsDb::ADB_DIMS;

        // $match
        $this->pipeline['$match']['entity'] = $this->entity;
        $this->pipeline['$match']['ts'] = ['$gte' => $this->dateRange[0], '$lte' => $this->dateRange[1]];
        if(!empty($this->ref)){
            $this->pipeline['$match']['count.' . $this->ref] = ['$exists' => true];
        }else{
            $this->pipeline['$match']['count'] = ['$exists' => true];
        }


        // $project
        $this->pipeline['$project'] = [
            'ts'     => 1,
            'entity' => 1,
            'month'  => 1,
            'year'   => 1,
            'name'   => 1,
            'value'  => 1,
            'total'  => 1
        ];

        if (!empty($this->ref)) {
            $this->pipeline['$project']['count.' . $this->ref] = 1;
        }

        // $group
        $this->pipeline['$group'] = ['_id' => '$ts', 'totalCount' => ['$sum' => $this->getSumField()]];

        // $sort -> by timestamp
        $this->pipeline['$sort'] = ['_id' => 1];
    }
667725
protected function populate()
    {
        $this->collection = AnalyticsDb::ADB_STATS_DAILY;

        // $match
        $this->pipeline['$match']['entity'] = $this->entity;
        if (!empty($this->ref)) {
            $this->pipeline['$match']['ref'] = $this->ref;
        }
        $this->pipeline['$match']['ts'] = ['$gte' => $this->dateRange[0], '$lte' => $this->dateRange[1]];

        // $project
        $this->pipeline['$project'] = [
            'count'  => 1,
            'ref'    => 1,
            'ts'     => 1,
            'entity' => 1,
            'month'  => 1,
            'year'   => 1
        ];

        // $group
        $this->pipeline['$group'] = ['_id' => '$ts', 'totalCount' => ['$sum' => '$count']];

        // $sort -> by timestamp
        $this->pipeline['$sort'] = ['_id' => 1];
    }
630058
def get_backends():
    
    IGNORE_DIRS = ["core", "tools", "utils"]

    global backends
    if backends is None:
        backends = {}
        i3pystatus_dir = os.path.dirname(i3pystatus.__file__)
        subdirs = [
            x
            for x in next(os.walk(i3pystatus_dir))[1]
            if not x.startswith("_") and x not in IGNORE_DIRS
        ]
        for subdir in subdirs:
            dirs = next(os.walk(os.path.join(i3pystatus_dir, subdir)))[2]
            backends.update(
                {
                    x[:-3]: "i3pystatus.%s.%s" % (subdir, x[:-3])
                    for x in dirs
                    if not x.startswith("_") and x.endswith(".py")
                }
            )
    return backends
1205023
def backfill_derived_code_lists
      data_criteria_by_id = {}
      @data_criteria.each {|criteria| data_criteria_by_id[criteria.id] = criteria}
      @data_criteria.each do |criteria|
        if (criteria.derived_from)
          derived_from = data_criteria_by_id[criteria.derived_from]
          criteria.definition = derived_from.definition
          criteria.status = derived_from.status
          criteria.code_list_id = derived_from.code_list_id
        end
      end
    end
995745
def append_fallback(model, fields):
    
    fields = set(fields)
    trans = set()
    from modeltranslation.translator import translator
    opts = translator.get_options_for_model(model)
    for key, _ in opts.fields.items():
        if key in fields:
            langs = resolution_order(get_language(), getattr(model, key).fallback_languages)
            fields = fields.union(build_localized_fieldname(key, lang) for lang in langs)
            fields.remove(key)
            trans.add(key)
    return fields, trans
63675
def fallbackPackage(package_name, fallback_package_name):
    '''
    
    
    '''
    importer = Finder(package_name, fallback_package_name)
    sys.meta_path.append(importer)
611536
def init(self, back=None):
        '''
        
        '''
        back = self.backends(back)
        for fsb in back:
            fstr = '{0}.init'.format(fsb)
            if fstr in self.servers:
                self.servers[fstr]()
175783
def build_backend(tasks, default_host=('127.0.0.1', DEFAULT_PORT), *args, 
                  **kw):
    
    host, port = default_host
    if len(sys.argv) > 1:
        host = sys.argv[1]
    if len(sys.argv) > 2:
        port = sys.argv[2]
    
    return BackEnd(tasks, host, port, *args, **kw)
786156
def pop_back(self):
        ''''''
        backend = self.backend
        return backend.execute(backend.structure(self).pop_back(),
                               self.value_pickler.loads)
1105117
def set_backend(self, backend):
        

        self.backend = backend
        self.dagobah_id = self.backend.get_new_dagobah_id()

        for job in self.jobs:
            job.backend = backend
            for task in job.tasks.values():
                task.backend = backend

        self.commit(cascade=True)
393612
def fill_buckets(self):
        '''
        
        '''
        update_intervals = self.fileserver.update_intervals()
        self.buckets = {}
        for backend in self.fileserver.backends():
            fstr = '{0}.update'.format(backend)
            try:
                update_func = self.fileserver.servers[fstr]
            except KeyError:
                log.debug(
                    'No update function for the %s filserver backend',
                    backend
                )
                continue
            if backend in update_intervals:
                # Variable intervals are supported for this backend
                for id_, interval in six.iteritems(update_intervals[backend]):
                    if not interval:
                        # Don't allow an interval of 0
                        interval = DEFAULT_INTERVAL
                        log.debug(
                            'An update_interval of 0 is not supported, '
                            'falling back to %s', interval
                        )
                    i_ptr = self.buckets.setdefault(interval, OrderedDict())
                    # Backend doesn't technically need to be present in the
                    # key, all we *really* need is the function reference, but
                    # having it there makes it easier to provide meaningful
                    # debug logging in the update threads.
                    i_ptr.setdefault((backend, update_func), []).append(id_)
            else:
                # Variable intervals are not supported for this backend, so
                # fall back to the global interval for that fileserver. Since
                # this backend doesn't support variable updates, we have
                # nothing to pass to the backend's update func, so we'll just
                # set the value to None.
                try:
                    interval_key = '{0}_update_interval'.format(backend)
                    interval = self.opts[interval_key]
                except KeyError:
                    interval = DEFAULT_INTERVAL
                    log.warning(
                        '%s key missing from configuration. Falling back to '
                        'default interval of %d seconds',
                        interval_key, interval
                    )
                self.buckets.setdefault(
                    interval, OrderedDict())[(backend, update_func)] = None