Add a RapidSMS backend to this tenant
773061
def add_backend(self, backend):
        ""
        if backend in self.get_backends():
            return
        backend_link, created = BackendLink.all_tenants.get_or_create(backend=backend)
        self.backendlink_set.add(backend_link)
512727
def add_middleware(self, middleware):
        """"""
        if self.middleware is None:
            self._middleware = []
        self.middleware.append(middleware)
560079
def register_backend(self, name, backend):
        
        if not hasattr(backend, 'send') or not callable(backend.send):
            raise ValueError('Backend %s does not have a callable "send" method.' % backend.__class__.__name__)
        else:
            self.backends[name] = backend
150483
def add_endpoint(self, ep):
        """"""
        assert ep.name not in self.endpoints, ep
        self.endpoints[ep.name] = ep
1039636
def set_current_backend(cls, backend):
        ""
        for hook in cls._backend_switch_hooks:
            hook(backend)
        cls.current_backend = backend
402698
function(backend, name, options) {
        options = _.extend({keyPath: 'id'}, options || {});
        this.options = options;

        this.backend = backend;
        this.name = name;
        this.keyPath = this.options.keyPath;
    }
878798
def add_options(self):
        
        super(RtorrentQueueManager, self).add_options()
        self.jobs = None
        self.httpd = None

        # basic options
        self.add_bool_option("-n", "--dry-run",
            help="advise jobs not to do any real work, just tell what would happen")
        self.add_bool_option("--no-fork", "--fg", help="Don't fork into background (stay in foreground and log to console)")
        self.add_bool_option("--stop", help="Stop running daemon")
        self.add_bool_option("--restart", help="Stop running daemon, then fork into background")
        self.add_bool_option("-?", "--status", help="Check daemon status")
        self.add_value_option("--pid-file", "PATH",
            help="file holding the process ID of the daemon, when running in background")
        self.add_value_option("--guard-file", "PATH",
            help="guard file for the process watchdog")
610619
def backend(self):
    ""
    if self._backend is None:
      with io.open(path.join(path.abspath(path.dirname(__file__)), "runner.js")) as runner_file:
        runner_source = runner_file.read()
      self._backend = execjs.ExternalRuntime(name="Node.js (V8)",
                                             command=["node"],
                                             runner_source=runner_source)
    return self._backend
635675
def add_machine(opts = {})
      backend_name = opts.fetch(:backend, 'default')
      dryrun       = opts.fetch(:dryrun, false)
      hostname     = opts.fetch(:hostname)
      app_id       = opts.fetch(:app_id)

      if server = Boxcutter::Server.find_by_hostname("#{hostname}.blueboxgrid.com")

        if app = Boxcutter::LoadBalancer::Application.find(app_id)

          app.services.each do |service|
            service.each_backend_named(backend_name) do |backend|
              log "Adding server #{server.hostname} to backend #{backend.name}"
              unless dryrun
                response = backend.add_machine(server.id, :port => 80)
                log "Added #{server.hostname} to #{backend.name} with response: #{response.body}"
              else
                log "#{server.hostname} was not added to the backend because --dryrun was specified"
              end
            end
          end
        else
          log "Could not find application '#{app_id}'"
        end
      else
        log "Could not find server '#{hostname}' on BlueBoxGroup"
      end
    end
959969
def register_backends(vars):
    
    new_backends = {x.replace('Backend', ''): cls
                    for x, cls in vars.items()
                    if inspect.isclass(cls) and issubclass(cls, Backend)}
    available_backends.update(new_backends)
109999
def _build_backend():
    """"""
    ep = os.environ['PEP517_BUILD_BACKEND']
    mod_path, _, obj_path = ep.partition(':')
    try:
        obj = import_module(mod_path)
    except ImportError:
        raise BackendUnavailable
    if obj_path:
        for path_part in obj_path.split('.'):
            obj = getattr(obj, path_part)
    return obj
1369378
def access_add(name, event, cid, uid, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:add', **{
        'unicorn': ctx.repo.create_secure_service('unicorn'),
        'service': name,
        'event': event,
        'cids': cid,
        'uids': uid,
    })
101134
def add(gandi, resource, vhost, zone_alter, backend, port, ssl, private_key,
        poll_cert):
    
    result = []
    if backend:
        backends = backend
        for backend in backends:
            # Check if a port is set for each backend, else set a default port
            if 'port' not in backend:
                if not port:
                    backend['port'] = click.prompt('Please set a port for '
                                                   'backends. If you want to '
                                                   ' different port for '
                                                   'each backend, use `-b '
                                                   'ip:port`', type=int)
                else:
                    backend['port'] = port
            result = gandi.webacc.backend_add(resource, backend)

    if vhost:
        if not gandi.hostedcert.activate_ssl(vhost, ssl, private_key,
                                             poll_cert):
            return
        vhosts = vhost
        for vhost in vhosts:
            params = {'vhost': vhost}
            if zone_alter:
                params['zone_alter'] = zone_alter
            result = gandi.webacc.vhost_add(resource, params)
    return result
1221234
def _add_goterms_kws(self, go2obj_user, kws_gos):
        """"""
        if 'go2color' in kws_gos:
            for goid in kws_gos['go2color'].keys():
                self._add_goterms(go2obj_user, goid)
1173397
def setup(app):
    """"""
    app.add_config_value('jsdoc_source_root', '..', 'env')
    app.add_config_value('jsdoc_output_root', 'javascript', 'env')
    app.add_config_value('jsdoc_exclude', [], 'env')
    app.connect('builder-inited', generate_docs)
1089378
function BackendStorage (gateway, opts){
    
    // prepare ourself to make debug possible
    this.debug=opts.mysql.debug || opts.debug;
    this.gateway =gateway;
    this.count=0;  // stat for connection retry
    
    this.opts= {
            host     : opts.mysql.hostname || "localhost",
            user     : opts.mysql.username,
            password : opts.mysql.password,
            database : opts.mysql.basename || opts.username
    };  
    this.uid ="mysql:" + opts.mysql.username + "@" + opts.mysql.hostname + "/" + opts.mysql.basename;
    this.event = new EventEmitter();
    // create initial connection handler to database
    CreateConnection (this);
}
1333588
def setup(self, app):
        """"""
        super().setup(app)

        self.enabled = len(self.cfg.backends)

        self.default = self.cfg.default
        if not self.default and self.enabled:
            self.default = self.cfg.backends[0][0]

        self.backends_hash = {name: parse.urlparse(loc) for (name, loc) in self.cfg.backends}
        if self.default and self.default not in self.backends_hash:
            raise PluginException('Backend not found: %s' % self.default)