當前位置: 首頁>>代碼示例>>Python>>正文


Python entrypoints.get_group_all方法代碼示例

本文整理匯總了Python中entrypoints.get_group_all方法的典型用法代碼示例。如果您正苦於以下問題:Python entrypoints.get_group_all方法的具體用法?Python entrypoints.get_group_all怎麽用?Python entrypoints.get_group_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在entrypoints的用法示例。


在下文中一共展示了entrypoints.get_group_all方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_backend

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def load_backend(backend_name):
    # Static backends
    if backend_name in MLFLOW_BACKENDS:
        return MLFLOW_BACKENDS[backend_name]()

    # backends from plugin
    try:
        backend_builder = entrypoints.get_single(ENTRYPOINT_GROUP_NAME,
                                                 backend_name).load()
        return backend_builder()
    except entrypoints.NoSuchEntryPoint:
        # TODO Should be a error when all backends are migrated here
        available_entrypoints = entrypoints.get_group_all(
            ENTRYPOINT_GROUP_NAME)
        available_plugins = [
            entrypoint.name for entrypoint in available_entrypoints]
        __logger__.warning("Backend '%s' is not available. Available plugins are %s",
                           backend_name, available_plugins + list(MLFLOW_BACKENDS.keys()))

    return None 
開發者ID:mlflow,項目名稱:mlflow,代碼行數:22,代碼來源:loader.py

示例2: _get_entrypoints_lib

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def _get_entrypoints_lib(group, name=None):
    import entrypoints

    # Monkey patch some attributes for better API compatibility
    entrypoints.EntryPoint.dist = property(lambda self: self.distro)

    if name:
        return entrypoints.get_single(group, name)
    else:
        from collections import OrderedDict
        # Copied from 'get_group_named()' except that it preserves order
        result = OrderedDict()
        for ep in entrypoints.get_group_all(group):
            if ep.name not in result:
                result[ep.name] = ep
        return result 
開發者ID:Kintyre,項目名稱:ksconf,代碼行數:18,代碼來源:__init__.py

示例3: _get_entry_points

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def _get_entry_points():
    import importlib

    class BasebandFormat:
        def __init__(self, name, value):
            self.name = name
            self.value = value

        def load(self):
            return importlib.import_module(self.value)

        def __repr__(self):
            return f"BasebandFormat('{self.name}', '{self.value}')"

    entries = {key: BasebandFormat(key, 'baseband.'+key) for key
               in ('dada', 'guppi', 'mark4', 'mark5b', 'vdif', 'gsb')}
    try:
        from entrypoints import get_group_all
    except ImportError:
        try:
            from pkg_resources import iter_entry_points as get_group_all
        except ImportError:
            return entries

    for entry_point in get_group_all('baseband.io'):
        entries.setdefault(entry_point.name, entry_point)

    return entries 
開發者ID:mhvk,項目名稱:baseband,代碼行數:30,代碼來源:__init__.py

示例4: test_get_group_all

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def test_get_group_all():
    group = entrypoints.get_group_all('entrypoints.test1', sample_path)
    print(group)
    assert len(group) == 5
    assert {ep.name for ep in group} == {'abc', 'rew', 'opo', 'njn'} 
開發者ID:takluyver,項目名稱:entrypoints,代碼行數:7,代碼來源:test_entrypoints.py

示例5: names

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def names(self) -> List[str]:
        """List the names of the registered and entry points plugins."""
        exts = list(self._plugins.keys())
        more_exts = [
            ep.name for ep in entrypoints.get_group_all(self.entry_point_group)
        ]
        exts.extend(more_exts)
        return sorted(set(exts)) 
開發者ID:altair-viz,項目名稱:altair,代碼行數:10,代碼來源:plugin_registry.py

示例6: before_start

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def before_start(self, checkers):
        """
        Loads entry points named kibitzr.before_start
        and call each one with two arguments:

            1. Application instance;
            2. List of configured checkers
        """
        for point in entrypoints.get_group_all("kibitzr.before_start"):
            entry = point.load()
            entry(self, checkers) 
開發者ID:kibitzr,項目名稱:kibitzr,代碼行數:13,代碼來源:app.py

示例7: load_extensions

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def load_extensions(self):
        for point in entrypoints.get_group_all("kibitzr.creds"):
            factory = point.load()
            self.extensions[point.name] = factory() 
開發者ID:kibitzr,項目名稱:kibitzr,代碼行數:6,代碼來源:conf.py

示例8: load_extensions

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def load_extensions():
    """Return list of fetcher promoters defined in Kibitzr extensions"""
    return [
        point.load()
        for point in entrypoints.get_group_all("kibitzr.fetcher")
    ] 
開發者ID:kibitzr,項目名稱:kibitzr,代碼行數:8,代碼來源:loader.py

示例9: load_extensions

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def load_extensions():
    """Return list of Kibitzr CLI extensions"""
    return [
        point.load()
        for point in entrypoints.get_group_all("kibitzr.cli")
    ] 
開發者ID:kibitzr,項目名稱:kibitzr,代碼行數:8,代碼來源:cli.py

示例10: __init__

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def __init__(self):
        super(PipelineProcessorRegistry, self).__init__()

        # Register all known processors based on entrypoint configuration
        for processor in entrypoints.get_group_all('elyra.pipeline.processors'):
            try:
                # instantiate an actual instance of the processor
                processor_instance = processor.load()()  # Load an instance
                processor_type = processor_instance.type
                self.log.info('Registering processor "{}" with type -> {}'.format(processor, processor_type))
                self.__processors[processor_type] = processor_instance
            except Exception:
                # log and ignore initialization errors
                self.log.error('Error registering processor "{}"'.format(processor)) 
開發者ID:elyra-ai,項目名稱:elyra,代碼行數:16,代碼來源:processor.py

示例11: register_entrypoints

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def register_entrypoints(self):
        """
        Runs through all the packages that has the `group_name` defined as the entrypoint
        and register that into the registry
        """
        for entrypoint in entrypoints.get_group_all(self.group_name):
            self.registry[entrypoint.name] = entrypoint
        self._has_registered = True 
開發者ID:mlflow,項目名稱:mlflow,代碼行數:10,代碼來源:plugin_manager.py

示例12: register_entrypoints

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def register_entrypoints(self):
        """Register tracking stores provided by other packages"""
        for entrypoint in entrypoints.get_group_all("mlflow.run_context_provider"):
            try:
                self.register(entrypoint.load())
            except (AttributeError, ImportError) as exc:
                warnings.warn(
                    'Failure attempting to register context provider "{}": {}'.format(
                        entrypoint.name, str(exc)
                    ),
                    stacklevel=2
                ) 
開發者ID:mlflow,項目名稱:mlflow,代碼行數:14,代碼來源:registry.py

示例13: register_entrypoints

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def register_entrypoints(self):
        """Register tracking stores provided by other packages"""
        for entrypoint in entrypoints.get_group_all(self.group_name):
            try:
                self.register(entrypoint.name, entrypoint.load())
            except (AttributeError, ImportError) as exc:
                warnings.warn(
                    'Failure attempting to register store for scheme "{}": {}'.format(
                        entrypoint.name, str(exc)
                    ),
                    stacklevel=2
                ) 
開發者ID:mlflow,項目名稱:mlflow,代碼行數:14,代碼來源:registry.py

示例14: register_entrypoints

# 需要導入模塊: import entrypoints [as 別名]
# 或者: from entrypoints import get_group_all [as 別名]
def register_entrypoints(self):
        # Register artifact repositories provided by other packages
        for entrypoint in entrypoints.get_group_all("mlflow.artifact_repository"):
            try:
                self.register(entrypoint.name, entrypoint.load())
            except (AttributeError, ImportError) as exc:
                warnings.warn(
                    'Failure attempting to register artifact repository for scheme "{}": {}'.format(
                        entrypoint.name, str(exc)
                    ),
                    stacklevel=2
                ) 
開發者ID:mlflow,項目名稱:mlflow,代碼行數:14,代碼來源:artifact_repository_registry.py


注:本文中的entrypoints.get_group_all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。