(
        plugin: Any,
        task_function: TaskFunction,
        config: DictConfig,
        config_loader: Optional[ConfigLoader] = None,
        hydra_context: Optional[HydraContext] = None,
    )
return plugin
With HydraContext introduced in #1581, we need to set up the plugins in a way
        that's compatible with both Hydra 1.0 and Hydra 1.1 syntax.
        This method should be deleted in the next major release.
With HydraContext introduced in #1581, we need to set up the plugins in a way
        that's compatible with both Hydra 1.0 and Hydra 1.1 syntax.
        This method should be deleted in the next major release.
With HydraContext introduced in #1581 we need to set up the plugins in a way that s compatible with both Hydra 1 . 0 and Hydra 1 . 1 syntax . This method should be deleted in the next major release .
def _setup_plugin(
        plugin: Any,
        task_function: TaskFunction,
        config: DictConfig,
        config_loader: Optional[ConfigLoader] = None,
        hydra_context: Optional[HydraContext] = None,
    ) -> Any:
        """
        With HydraContext introduced in #1581, we need to set up the plugins in a way
        that's compatible with both Hydra 1.0 and Hydra 1.1 syntax.
        This method should be deleted in the next major release.
        """
        assert isinstance(plugin, Sweeper) or isinstance(plugin, Launcher)
        assert (
            config_loader is not None or hydra_context is not None
        ), "config_loader and hydra_context cannot both be None"

        param_keys = signature(plugin.setup).parameters.keys()

        if "hydra_context" not in param_keys:
            # DEPRECATED: remove in 1.2
            # hydra_context will be required in 1.2
            deprecation_warning(
                message=dedent(
                    """
                    Plugin's setup() signature has changed in Hydra 1.1.
                    Support for the old style will be removed in Hydra 1.2.
                    For more info, check https://github.com/facebookresearch/hydra/pull/1581."""
                ),
            )
            config_loader = (
                config_loader
                if config_loader is not None
                else hydra_context.config_loader  # type: ignore
            )
            plugin.setup(  # type: ignore
                config=config,
                config_loader=config_loader,
                task_function=task_function,
            )
        else:
            if hydra_context is None:
                # hydra_context could be None when an incompatible Sweeper instantiates a compatible Launcher
                assert config_loader is not None
                hydra_context = HydraContext(
                    config_loader=config_loader, callbacks=Callbacks()
                )
            plugin.setup(
                config=config, hydra_context=hydra_context, task_function=task_function
            )
        return plugin
def _setup_plugin ( plugin : Any , task_function : TaskFunction , config : DictConfig , config_loader : Optional [ ConfigLoader ] = None , hydra_context : Optional [ HydraContext ] = None , ) -> Any : assert isinstance ( plugin , Sweeper ) or isinstance ( plugin , Launcher ) assert ( config_loader is not None or hydra_context is not None ) , "config_loader and hydra_context cannot both be None" param_keys = signature ( plugin . setup ) . parameters . keys ( ) if "hydra_context" not in param_keys : # DEPRECATED: remove in 1.2 # hydra_context will be required in 1.2 deprecation_warning ( message = dedent ( """
                    Plugin's setup() signature has changed in Hydra 1.1.
                    Support for the old style will be removed in Hydra 1.2.
                    For more info, check https://github.com/facebookresearch/hydra/pull/1581.""" ) , ) config_loader = ( config_loader if config_loader is not None else hydra_context . config_loader # type: ignore ) plugin . setup ( # type: ignore config = config , config_loader = config_loader , task_function = task_function , ) else : if hydra_context is None : # hydra_context could be None when an incompatible Sweeper instantiates a compatible Launcher assert config_loader is not None hydra_context = HydraContext ( config_loader = config_loader , callbacks = Callbacks ( ) ) plugin . setup ( config = config , hydra_context = hydra_context , task_function = task_function ) return plugin