Return the PB configuration.
439858
def pb_config(self):
        """"""
        pb = ProcessingBlock(self._pb_id)
        return json.dumps(pb.config)
1374864
def get_config():
    """"""
    from os import environ
    from os.path import expanduser
    from pathlib import Path
    import yaml

    def pexp(p):
        try:
            return Path(p).expanduser()
        except AttributeError:
            # python 3.4
            return Path(expanduser(p))

    paths = [environ.get("METAPACK_CONFIG"), '~/.metapack.yaml', '/etc/metapack.yaml']

    for p in paths:

        if not p:
            continue

        p = pexp(p)

        if p.exists():
            with p.open() as f:
                config = yaml.safe_load(f)
                if not config:
                    config = {}

                config['_loaded_from'] = str(p)
                return config

    return None
1253780
def get_config(name='root'):
    '''
    
    '''
    try:
        config = snapper.GetConfig(name)
        return config
    except dbus.DBusException as exc:
        raise CommandExecutionError(
            'Error encountered while retrieving configuration: {0}'
            .format(_dbus_exception_to_reason(exc, locals()))
        )
736808
def get_configuration_dict(self, secret_attrs=False):
        """"""
        cd = {'repo_nexml2json': self.repo_nexml2json,
              'number_of_shards': len(self._shards),
              'initialization': self._filepath_args,
              'shards': [],
              }
        for i in self._shards:
            cd['shards'].append(i.get_configuration_dict(secret_attrs=secret_attrs))
        return cd
1119923
def getConf(cls, settings, options):
        ""
        ports = ['http_port', 'https_port', 'cache_port']
        for port_name in ports:
            port = getattr(settings, port_name.upper(), None)
            # only use the settings ports if the defaults were left unchanged
            default = getattr(defaults, port_name.upper())
            if port and options.get(port_name) == default:
                options[port_name] = port

        _opts = [
            ('key', 'hx_private_key'),
            ('cert', 'hx_certficate'),
            ('wsgi', 'wsgi_application')
        ]
        for opt_name, settings_name in _opts:
            opt = getattr(settings, settings_name.upper(), None)
            if opt:
                options[opt_name] = opt

        if not options['settings']:
            options['settings'] = environ['DJANGO_SETTINGS_MODULE']
        return options
1274005
def metadata(self):
        """"""
        if not self._operation.HasField("metadata"):
            return None

        return protobuf_helpers.from_any_pb(
            self._metadata_type, self._operation.metadata
        )
228121
def to_dict(self):
        """"""
        config = {}
        for attr in dir(self):
            if not attr.startswith('_'):
                value = getattr(self, attr)
                if not hasattr(value, '__call__'):
                    config[attr] = value
        return config
234741
def config(env=DEFAULT_ENV, default='locmem://'):
    """"""
    config = {}

    s = os.environ.get(env, default)

    if s:
        config = parse(s)

    return config
160544
def configured_options(self):
        """"""
        stdout_lines = self._check_output(['config', '--list']).splitlines()
        return {key: value for key, value in [line.split('=') for line in stdout_lines]}
66226
def configuration(*args, **kwargs):
    """"""
    try:
        config_kwargs = {'mapping_class': kwargs.pop('mapping_class')}
    except KeyError:
        config_kwargs = {}
    cm = ConfigurationManager(*args, **kwargs)
    return cm.get_config(**config_kwargs)
507202
def configurations(self):
        
        if self._configuration_manager is None:
            self._configuration_manager = ConfigurationManager(session=self._session)
        return self._configuration_manager
783320
def get_configuration_dict(self, secret_attrs=False):
        """"""
        cd = super(TreeCollectionsShard, self).get_configuration_dict(secret_attrs=secret_attrs)
        # "rename" some keys in the dict provided
        cd['number of collections'] = cd.pop('number of documents')
        cd['collections'] = cd.pop('documents')
        return cd
209408
def from_pb(cls, policy_pb):
        
        policy = cls(policy_pb.etag, policy_pb.version)

        for binding in policy_pb.bindings:
            policy[binding.role] = sorted(binding.members)

        return policy
727626
def config(env=DEFAULT_ENV, default=None, engine=None, conn_max_age=0, ssl_require=False):
    """"""

    config = {}

    s = os.environ.get(env, default)

    if s:
        config = parse(s, engine, conn_max_age, ssl_require)

    return config
584941
def _get_base_configs(self):
        """"""
        return BIOSBaseConfigs(
            self._conn, utils.get_subresource_path_by(
                self, ["Oem", "Hpe", "Links", "BaseConfigs"]),
            redfish_version=self.redfish_version)
549429
def get_configuration_dict(self, secret_attrs=False):
        """"""
        cd = super(TaxonomicAmendmentsShard, self).get_configuration_dict(secret_attrs=secret_attrs)
        # "rename" some keys in the dict provided
        cd['number of amendments'] = cd.pop('number of documents')
        cd['amendments'] = cd.pop('documents')
        # add keys particular to this shard subclass
        if self._next_ott_id is not None:
            cd['_next_ott_id'] = self._next_ott_id,
        return cd
788968
def get_config():
        
        db_type = os.environ['DB_TYPE']
        db_host = os.environ['DB_HOST']
        db_user = os.environ['DB_USER']
        db_database = os.environ['DB_NAME']
        db_password = os.environ['DB_PASSWORD']
        db_prefix = os.environ['DB_PREFIX']

        check = Migration.check_packages(db_type)

        return check, {
            db_type: {
                'driver': db_type.strip(),
                'host': db_host.strip(),
                'database': db_database.strip(),
                'user': db_user.strip(),
                'password': db_password.strip(),
                'prefix': db_prefix.strip()
            }
        }