def launch(self, function: Callable[["Fabric"], Any] = _do_nothing, *args: Any, **kwargs: Any) -> Any:
        """Launch and initialize all the processes needed for distributed execution.

        Args:
            function: Optional function to launch when using a spawn/fork-based strategy, for example, when using the
                XLA strategy (``accelerator="tpu"``). The function must accept at least one argument, to which
                the Fabric object itself will be passed.
            *args: Optional positional arguments to be passed to the function.
            **kwargs: Optional keyword arguments to be passed to the function.

        Returns:
            Returns the output of the function that ran in worker process with rank 0.

        The ``launch()`` method should only be used if you intend to specify accelerator, devices, and so on in
        the code (programmatically). If you are launching with the Lightning CLI, ``fabric run ...``, remove
        ``launch()`` from your code.

        The ``launch()`` is a no-op when called multiple times and no function is passed in.

        """
        if _is_using_cli():
            raise RuntimeError(
                "This script was launched through the CLI, and processes have already been created. Calling "
                " `.launch()` again is not allowed."
            )
        if function is not _do_nothing:
            if not callable(function):
                raise TypeError(
                    f"`Fabric.launch(...)` needs to be a callable, but got {function}."
                    " HINT: do `.launch(your_fn)` instead of `.launch(your_fn())`"
                )
            if not inspect.signature(function).parameters:
                raise TypeError(
                    f"`Fabric.launch(function={function})` needs to take at least one argument. The launcher will"
                    " pass in the `Fabric` object so you can use it inside the function."
                )
        elif isinstance(self.strategy.launcher, (_MultiProcessingLauncher, _XLALauncher)):
            raise TypeError(
                f"To spawn processes with the `{type(self.strategy).__name__}` strategy, `.launch()` needs to be called"
                " with a function that contains the code to launch in processes."
            )
        return self._wrap_and_launch(function, self, *args, **kwargs)
Launch and initialize all the processes needed for distributed execution.

        Args:
            function: Optional function to launch when using a spawn/fork-based strategy, for example, when using the
                XLA strategy (``accelerator="tpu"``). The function must accept at least one argument, to which
                the Fabric object itself will be passed.
            *args: Optional positional arguments to be passed to the function.
            **kwargs: Optional keyword arguments to be passed to the function.

        Returns:
            Returns the output of the function that ran in worker process with rank 0.

        The ``launch()`` method should only be used if you intend to specify accelerator, devices, and so on in
        the code (programmatically). If you are launching with the Lightning CLI, ``fabric run ...``, remove
        ``launch()`` from your code.

        The ``launch()`` is a no-op when called multiple times and no function is passed in.

        
src/lightning/fabric/fabric.py