Get a plotting backend.

    Tries to get it using the name - or the default one.
974214
def _get_backend(name: str = None):
    
    if not backends:
        raise RuntimeError("No plotting backend available. Please, install matplotlib (preferred) or bokeh (limited).")
    if not name:
        name = _default_backend
    if name == "bokeh":
        raise RuntimeError("Support for bokeh has been discontinued. At some point, we may return to support holoviews.")
    backend = backends.get(name)
    if not backend:
        raise RuntimeError("Backend {0} does not exist. Use one of the following: {1}".format(name, ", ".join(backends.keys())))
    return name, backends[name]
226488
def get_director_backend(self, service_id, version_number, director_name, backend_name):
		""""""
		content = self._fetch("/service/%s/version/%d/director/%s/backend/%s" % (service_id, version_number, director_name, backend_name), method="GET")
		return FastlyDirectorBackend(self, content)
23179
def load_backend(backend_name):
    
    try:
        if len(backend_name.split(".")) > 1:
            mod = import_module(backend_name)
        else:
            mod = import_module("spamc.backend_%s" % backend_name)
        return mod
    except ImportError:
        error_msg = "%s isn't a spamc backend" % backend_name
        raise ImportError(error_msg)
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
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)
786441
def plot(self, **kwargs):
        
        set_kwargs_drawstyle(kwargs, "default")
        return _plot_estimate(
            self, estimate=getattr(self, self._estimate_name), confidence_intervals=self.confidence_interval_, **kwargs
        )
448527
def backend(self, client=None):
        '''
        '''
        session = self.session
        if session:
            return session.model(self).backend
301857
def get_backend_symbol(self, backend):
        
        out = SymbolHandle()
        check_call(_LIB.MXGenBackendSubgraph(self.handle, c_str(backend), ctypes.byref(out)))
        return Symbol(out)
181966
def plotter_cls(self):
        """"""
        ret = self._plotter_cls
        if ret is None:
            self._logger.debug('importing %s', self.module)
            mod = import_module(self.module)
            plotter = self.plotter_name
            if plotter not in vars(mod):
                raise ImportError("Module %r does not have a %r plotter!" % (
                    mod, plotter))
            ret = self._plotter_cls = getattr(mod, plotter)
            _versions.update(get_versions(key=lambda s: s == self._plugin))
        return ret
859150
def _get_plotL(self, Lplot='Tot', proj='All', ind=None, multi=False):
        
        ind = self._check_indch(ind)
        if ind.size>0:
            Ds, us = self.D[:,ind], self.u[:,ind]
            if ind.size==1:
                Ds, us = Ds.reshape((3,1)), us.reshape((3,1))
            kPIn, kPOut = self.kIn[ind], self.kOut[ind]
            if self.config.Id.Type=='Tor':
                kRMin = self._dgeom['kRMin'][ind]
            else:
                kRMin = None
            pts = _comp.LOS_CrossProj(self.config.Id.Type, Ds, us,
                                      kPIn, kPOut, kRMin, proj=proj,
                                      Lplot=Lplot, multi=multi)
        else:
            pts = None
        return pts
1041510
def import_backend(config):
    
    backend_name = config['backend']
    path = backend_name.split('.')
    backend_mod_name, backend_class_name = '.'.join(path[:-1]), path[-1]
    backend_mod = importlib.import_module(backend_mod_name)
    backend_class = getattr(backend_mod, backend_class_name)
    return backend_class(config['settings'])
1222098
def get_backend(tensor):
    
    for framework_name, backend in _backends.items():
        if backend.is_appropriate_type(tensor):
            return backend

    for BackendSubclass in AbstractBackend.__subclasses__():
        if _debug_importing:
            print('Testing for subclass of ', BackendSubclass)
        if BackendSubclass.framework_name not in _backends:
            # check that module was already imported. Otherwise it can't be imported
            if BackendSubclass.framework_name in sys.modules:
                if _debug_importing:
                    print('Imported backend for ', BackendSubclass.framework_name)
                backend = BackendSubclass()
                _backends[backend.framework_name] = backend
                if backend.is_appropriate_type(tensor):
                    return backend

    raise RuntimeError('Tensor type unknown to einops {}'.format(type(tensor)))
255809
def get_backend(config):
    

    backend_string = get_conf(config, 'Dagobahd.backend', None)

    if backend_string is None:
        from ..backend.base import BaseBackend
        return BaseBackend()

    elif backend_string.lower() == 'mongo':
        backend_kwargs = {}
        for conf_kwarg in ['host', 'port', 'db',
                           'dagobah_collection', 'job_collection',
                           'log_collection']:
            backend_kwargs[conf_kwarg] = get_conf(config,
                                                  'MongoBackend.%s' % conf_kwarg)
        backend_kwargs['port'] = int(backend_kwargs['port'])

        try:
            from ..backend.mongo import MongoBackend
        except:
            raise ImportError('Could not initialize the MongoDB Backend. Are you sure' +
                              ' the optional drivers are installed? If not, try running ' +
                              '"pip install pymongo" to install them.')
        return MongoBackend(**backend_kwargs)

    raise ValueError('unknown backend type specified in conf')
989667
def backend(self, name):
        
        try:
            backend = self.get_backend_handler_path(name)
            if backend is None:
                raise ex.VSTUtilsException("Backend is 'None'.")  # pragma: no cover
            return self._get_baskend(backend)
        except KeyError or ImportError:
            msg = "{} ({})".format(name, self.err_message) if self.err_message else name
            raise ex.UnknownTypeException(msg)
779372
public com.google.api.Backend getBackend() {
    return backend_ == null ? com.google.api.Backend.getDefaultInstance() : backend_;
  }
301628
def get_backend(backend, path, backends):
    """"""
    m_norm = normalize_vault_path(path)
    for mount_name, values in backends.items():
        b_norm = normalize_vault_path(mount_name)
        if (m_norm == b_norm) and values['type'] == backend:
            return values

    return None
101062
def get_plot_panel(self):
        """"""

        plot_type_no = self.chart_type_book.GetSelection()
        return self.chart_type_book.GetPage(plot_type_no)