Get active backends modules. Backend list can be filtered by
    supporting given currency.
507782
def get_backend_choices(currency=None):
    
    choices = []
    backends_names = getattr(settings, 'GETPAID_BACKENDS', [])

    for backend_name in backends_names:
        backend = import_module(backend_name)
        if currency:
            if currency in backend.PaymentProcessor.BACKEND_ACCEPTED_CURRENCY:
                choices.append(
                    (backend_name, backend.PaymentProcessor.BACKEND_NAME)
                )
        else:
            choices.append(
                (backend_name, backend.PaymentProcessor.BACKEND_NAME)
            )
    return choices
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)
807991
def _get_backend(args):
    """"""
    if args.backend == 'gatttool':
        backend = GatttoolBackend
    elif args.backend == 'bluepy':
        backend = BluepyBackend
    elif args.backend == 'pygatt':
        backend = PygattBackend
    else:
        raise Exception('unknown backend: {}'.format(args.backend))
    return backend
1144810
def envs(self, back=None, sources=False):
        '''
        
        '''
        back = self.backends(back)
        ret = set()
        if sources:
            ret = {}
        for fsb in back:
            fstr = '{0}.envs'.format(fsb)
            kwargs = {'ignore_cache': True} \
                if 'ignore_cache' in _argspec(self.servers[fstr]).args \
                and self.opts['__role'] == 'minion' \
                else {}
            if sources:
                ret[fsb] = self.servers[fstr](**kwargs)
            else:
                ret.update(self.servers[fstr](**kwargs))
        if sources:
            return ret
        return list(ret)
600843
def get_backend_init_list(backend_vals):
    """"""
    cmd_list = []
    for (key, val) in backend_vals.items():
        cmd_list.append('-backend-config')
        cmd_list.append(key + '=' + val)
    return cmd_list
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]
1286783
def parse_backend(backend):
    """"""
    r = urlparse.urlsplit(backend)
    scheme, host = r.scheme, r.netloc
    path, query = r.path, r.query
    if path and not query:
        query, path = path, ''
        if query:
            if query.find('?'):
                path = query
            else:
                query = query[1:]
    if query:
        params = dict(urlparse.parse_qsl(query))
    else:
        params = {}

    return scheme, host, params
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
1116202
protected function Modules($bundle)
    {
        $modules = PathUtil::BackendModules($bundle);
        $result = array();
        foreach ($modules as $module)
        {
            $instance = ClassFinder::CreateBackendModule(ClassFinder::CalcModuleType($bundle, $module));
            if ($instance instanceof BackendModule)
            {
                $result[] = $module;
            }
        }
        return $result;
    }
219896
def read_backend(self):
        '''
        '''
        session = self.session
        if session is not None:
            if self._field:
                return session.model(self._field.model).read_backend
            else:
                return session.model(self).read_backend
85794
public static Collection<CurrencyUnit> getCurrencies(String... providers) {
        return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow(
                () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup."))
                .getCurrencies(providers);
    }
379986
def list_formats(format_type, backend=None):
    
    if backend is None:
        backend = Store.current_backend
        mode = Store.renderers[backend].mode if backend in Store.renderers else None
    else:
        split = backend.split(':')
        backend, mode = split if len(split)==2 else (split[0], 'default')

    if backend in Store.renderers:
        return Store.renderers[backend].mode_formats[format_type][mode]
    else:
        return []
23561
public function getBackends()
    {
        $backends = array_map(
            function ($backend) {
                $new = (object)(array_merge(reset($backend), ['_id'=>array_keys($backend)[0]]));
                return $new;
            },
            $this['payment_backends']
        );
        // return backends (filtered if requested)
        return ($filters = func_get_args()) ? array_filter($backends, self::combineFilters(self::argsToVariadic($filters))) : $backends;
    }
94057
def get_backend(backend):
    """"""
    if backend == "random":
        backends = list_backends()
        random.shuffle(backends)
        return backends[0]

    return backend
1325634
def get_available_currencies():
    """"""
    r = requests.get(API_CURRENCIES)
    if r.status_code != requests.codes.ok:
        raise CryptonatorException(
            ("An error occurred while getting available currencies "
             "({} from Cryptonator).").format(r.status_code)
        )

    return [currency['code'] for currency in r.json()['rows']]
121506
public static function activeLocales(): array
    {
        $locales = app(ModuleService::class)
            ->findByInterface(ModuleLanguageInterface::class, false, true)
            ->map(static function (ModuleLanguageInterface $module): LocaleInterface {
                return $module->locale();
            });

        if ($locales->isEmpty()) {
            return [new LocaleEnUs()];
        }

        return $locales->all();
    }
728890
def getdb(backend=None, **kwargs):
    ''''''
    if isinstance(backend, BackendDataServer):
        return backend
    backend = backend or settings.DEFAULT_BACKEND
    if not backend:
        return None
    scheme, address, params = parse_backend(backend)
    params.update(kwargs)
    if 'timeout' in params:
        params['timeout'] = int(params['timeout'])
    return _getdb(scheme, address, params)