add multiple upstream backends
500320
function addLoggingBackend(backend, minLoglevel=99){
    // function or string input supported
    if (typeof backend === 'function'){
        _loggingBackends.push(backend);

    // lookup
    }else{
        if (backend === 'fancy-cli'){
            _loggingBackends.push(_fancyCliLogger(minLoglevel));
        }else if (backend === 'cli'){
            _loggingBackends.push(_simpleCliLogger(minLoglevel));
        }else{
            throw new Error('Unknown backend <' + backend + '>');
        }
    }    
}
791088
def append_sources_from(self, other):
        """"""
        # Get aliases lists from this `CatDict` and other
        self_aliases = self[self._KEYS.SOURCE].split(',')
        other_aliases = other[self._KEYS.SOURCE].split(',')

        # Store alias to `self`
        self[self._KEYS.SOURCE] = uniq_cdl(self_aliases + other_aliases)

        return
67261
def addthisbunch(bunchdt, data, commdct, thisbunch, theidf):
    """"""
    key = thisbunch.key.upper()
    obj = copy.copy(thisbunch.obj)
    abunch = obj2bunch(data, commdct, obj)
    bunchdt[key].append(abunch)
    return abunch
760294
def create_back_links(env):
    
    if env.needs_workflow['backlink_creation']:
        return

    needs = env.needs_all_needs
    for key, need in needs.items():
        for link in need["links"]:
            link_main = link.split('.')[0]
            try:
                link_part = link.split('.')[1]
            except IndexError:
                link_part = None

            if link_main in needs:
                if key not in needs[link_main]["links_back"]:
                    needs[link_main]["links_back"].append(key)

                # Handling of links to need_parts inside a need
                if link_part is not None:
                    if link_part in needs[link_main]['parts']:
                        if 'links_back' not in needs[link_main]['parts'][link_part].keys():
                            needs[link_main]['parts'][link_part]['links_back'] = []
                        needs[link_main]['parts'][link_part]['links_back'].append(key)

    env.needs_workflow['backlink_creation'] = True
1355401
def backend_add(cls, name, backend):
        
        oper = cls.call(
            'hosting.rproxy.server.create', cls.usable_id(name), backend)
        cls.echo('Adding backend %s:%s into webaccelerator' %
                 (backend['ip'], backend['port']))
        cls.display_progress(oper)
        cls.echo('Backend added')
        return oper
789403
def init_backends():
    """"""

    global _BACKENDS, _ACTIVE_BACKENDS

    try:
        from .cffi_backend import CFFIBackend
    except ImportError:
        pass
    else:
        _BACKENDS.append(CFFIBackend)

    from .ctypes_backend import CTypesBackend
    from .null_backend import NullBackend

    _BACKENDS.append(CTypesBackend)
    _ACTIVE_BACKENDS = _BACKENDS[:]
    # null isn't active by default
    _BACKENDS.append(NullBackend)
67907
def add(event, reactors, saltenv='base', test=None):
    '''
    
    '''
    if isinstance(reactors, string_types):
        reactors = [reactors]

    sevent = salt.utils.event.get_event(
            'master',
            __opts__['sock_dir'],
            __opts__['transport'],
            opts=__opts__,
            listen=True)

    master_key = salt.utils.master.get_master_key('root', __opts__)

    __jid_event__.fire_event({'event': event,
                              'reactors': reactors,
                              'key': master_key},
                             'salt/reactors/manage/add')

    res = sevent.get_event(wait=30, tag='salt/reactors/manage/add-complete')
    return res['result']
1064031
def register_endpoints(self, backend_names):
        
        url_map = [("^{}".format(self.name), self.ping_endpoint)]

        return url_map
911346
def sync_fork(gh_token, github_repo_id, repo, push=True):
    """"""
    if not gh_token:
        _LOGGER.warning('Skipping the upstream repo sync, no token')
        return
    _LOGGER.info('Check if repo has to be sync with upstream')
    github_con = Github(gh_token)
    github_repo = github_con.get_repo(github_repo_id)

    if not github_repo.parent:
        _LOGGER.warning('This repo has no upstream')
        return

    upstream_url = 'https://github.com/{}.git'.format(github_repo.parent.full_name)
    upstream = repo.create_remote('upstream', url=upstream_url)
    upstream.fetch()
    active_branch_name = repo.active_branch.name
    if not active_branch_name in repo.remotes.upstream.refs:
        _LOGGER.info('Upstream has no branch %s to merge from', active_branch_name)
        return
    else:
        _LOGGER.info('Merge from upstream')
    msg = repo.git.rebase('upstream/{}'.format(repo.active_branch.name))
    _LOGGER.debug(msg)
    if push:
        msg = repo.git.push()
        _LOGGER.debug(msg)
1039636
def set_current_backend(cls, backend):
        ""
        for hook in cls._backend_switch_hooks:
            hook(backend)
        cls.current_backend = backend
996013
private function addNextRequests()
    {
        $limit = max($this->getPoolSize() - count($this->waitQueue), 0);
        while ($limit--) {
            if (!$this->addNextRequest()) {
                break;
            }
        }
    }
562664
function() {
    const query = {clientId};
    var   body  = sg.extend({partnerId, version, sessionId}, {rsvr});

    self.POST('hq', '/clientStart', query, body, function(err, config) {
      //console.log('clientStart-object', query, body, err, config);

      if (sg.ok(err, config)) {
        self.config = sg.deepCopy(config);

        _.each(self.config.upstreams, (upstream, prj_app) => {
          self.upstreams[prj_app] = upstream;
        });

        if (sg.verbosity() > 2) {
          _.each(self.upstreams, (upstream, prj_app) => {
            console.log(`Using upstream: ${sg.lpad(prj_app, 20)} ->> ${upstream}`);
          });
        }

        ctor_callback(err, self.config);
      }

    });
  }
1357081
function upstream_sources(g, node) {
    var flatMap = _.compose(_.flatten, _.map);
    function rec(node) {
        var inputs = g.node_get_inputs(node);
        var sources = _.filter(inputs, (node) => {
            return node.name === 'read' || node.name === 'emit';
        });
        var nonsources = _.difference(inputs, sources);
        return sources.concat(flatMap(nonsources, rec));
    }
    return _.uniq(rec(node));
}
545881
def attach(options = {})
      options = Aws::Util.deep_merge(options,
        auto_scaling_group_name: @group_name,
        load_balancer_names: [@name]
      )
      resp = @client.attach_load_balancers(options)
      resp.data
    end
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)
580464
def get_backend(name):
    """"""

    for backend in _BACKENDS:
        if backend.NAME == name:
            return backend
    raise KeyError("Backend %r not available" % name)
165777
function addToQueueConcat(sources, dest, options) {
      queueConcat.push({
        src:     sources,
        dest:    dest,
        options: _.extend({}, defaultOptions, options || {})
      });
    }