Sets backend (local or aws)
489534
def set_backend(backend_name: str):
  """"""
  global _backend, _backend_name
  _backend_name = backend_name

  assert not ncluster_globals.task_launched, "Not allowed to change backend after launching a task (this pattern is error-prone)"
  if backend_name == 'aws':
    _backend = aws_backend
  elif backend_name == 'local':
    _backend = local_backend
  else:
    assert False, f"Unknown backend {backend_name}"
  ncluster_globals.LOGDIR_ROOT = _backend.LOGDIR_ROOT
402698
function(backend, name, options) {
        options = _.extend({keyPath: 'id'}, options || {});
        this.options = options;

        this.backend = backend;
        this.name = name;
        this.keyPath = this.options.keyPath;
    }
59085
def _call_backend(self, method, default, *args, **kwargs):
        """"""
        meth = getattr(self.backend, method, None)
        if meth is None:
            return default
        else:
            return meth(*args, **kwargs)
678482
def set_server(self, pos, key, value):
        """"""
        self._ports_list[pos][key] = value
47469
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,
            typeCast : true,
            dateStrings: false,
            timezone: 'utc'
    };
    this.uid ="mysql:" + opts.mysql.username + "@" + opts.mysql.hostname + "/" + opts.mysql.basename;
    
    // create initial connection handler to database
    CreateConnection (this);  
}
88963
def available_backends(self, hub=None, group=None, project=None, access_token=None, user_id=None):
        
        if access_token:
            self.req.credential.set_token(access_token)
        if user_id:
            self.req.credential.set_user_id(user_id)
        if not self.check_credentials():
            raise CredentialsError('credentials invalid')
        else:

            url = get_backend_url(self.config, hub, group, project)

            ret = self.req.get(url)
            if (ret is not None) and (isinstance(ret, dict)):
                return []
            return [backend for backend in ret
                    if backend.get('status') == 'on']
777079
private function buildDataBackend()
    {
        $configuration = ConfigurationRegistry::getConfiguration();
        $backend = $this->makeDataBackend();

        // Installation
        if ($configuration->isAutomaticInstallation() && ! $backend->isInstalled()) {
            $lock = new Lock(self::INSTALL_LOCK);
            $lock->executeOnce(
                function () use ($backend) {
                    $backend->install();
                }
            );
        }

        // Update hook
        register_shutdown_function(array($this, "applyUpdatePlan"), $backend);

        return $backend;
    }
623746
function setup(global) {
  'use strict';

  if (process.env.NODE_ENV === 'production') {
    return;
  }

  if (!process.env.__REACT_DEVTOOLS_PORT__) {
    return;
  }

  const reactDevTools = require('react-devtools-core');
  try {
    reactDevTools.connectToDevTools({
      host: process.env.__REACT_DEVTOOLS_HOST__ || 'localhost',
      port: process.env.__REACT_DEVTOOLS_PORT__,
    });
  } catch (e) {
    console.error('Cannot connect to React DevTools')
  }
}
1367974
def set_default_backend(name: str):
    """"""
    global _default_backend
    if name == "bokeh":
        raise RuntimeError("Support for bokeh has been discontinued. At some point, we may return to support holoviews.")
    if not name in backends:
        raise RuntimeError("Backend {0} is not supported and cannot be set as default.".format(name))
    _default_backend = name
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);
}
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)
882182
public static function setAppLocale()
    {
        if (Session::has('locale')) {
            App::setLocale(Session::get('locale'));
        }
        elseif (
            ($user = BackendAuth::getUser()) &&
            ($locale = static::get('locale'))
        ) {
            Session::put('locale', $locale);
            App::setLocale($locale);
        }
    }
1316154
def set_backend_for_mayavi(self, command):
        
        calling_mayavi = False
        lines = command.splitlines()
        for l in lines:
            if not l.startswith('#'):
                if 'import mayavi' in l or 'from mayavi' in l:
                    calling_mayavi = True
                    break
        if calling_mayavi:
            message = _("Changing backend to Qt for Mayavi")
            self._append_plain_text(message + '\n')
            self.silent_execute("%gui inline\n%gui qt")
254501
function setCliConfiguration() {
  return yargs
    .usage('usage: $0 [options] <aws-elasticsearch-cluster-endpoint>')
    .option('h', {
      alias: 'host',
      default: HOST || '127.0.0.1',
      demand: false,
      describe: 'Host IP Address',
      type: 'string',
    })
    .option('p', {
      alias: 'port',
      default: PORT || 9200,
      demand: false,
      describe: 'Host Port',
      type: 'number',
    })
    .option('r', {
      alias: 'region',
      default: REGION || 'us-west-2',
      demand: false,
      describe: 'AWS region',
      type: 'string',
    })
    .option('e', {
      alias: 'endpoint',
      default: ENDPOINT,
      demand: true,
      describe: 'AWS Elasticsearch Endpoint',
      type: 'string',
    })
    .option('c', {
      alias: 'profile',
      default: AWS_PROFILE || 'default',
      demand: false,
      describe: 'AWS Credentials Profile',
      type: 'string',
    })
    .option('d', {
      alias: 'debug',
      default: DEBUG || false,
      demand: false,
      describe: 'Provides debug logging',
      type: 'boolean',
    })
    .help()
    .version()
    .strict()
}
448527
def backend(self, client=None):
        '''
        '''
        session = self.session
        if session:
            return session.model(self).backend
44576
function loadBackend(config, name) {
  var backendmod = require(name);

  if (config.debug) {
    l.log("Loading backend: " + name, 'DEBUG');
  }

  var ret = backendmod.init(startup_time, config, backendEvents, l);
  if (!ret) {
    l.log("Failed to load backend: " + name, "ERROR");
    process.exit(1);
  }
}
1210847
async function setEnv(service) {
  return new Promise((resolve) => {
    process.env[service.env] = `http://localhost:${service.port}`;
    resolve();
  });
}