code: def _defaults_from_env_vars(fn: Callable) -> Callable:
      """Copy of ``pytorch_lightning.trainer.connectors.env_vars_connector._defaults_from_env_vars``.
  
      Required to fix build error in readthedocs.
  
      """
  
      @wraps(fn)
      def insert_env_defaults(self, *args, **kwargs):
          cls = self.__class__  # get the class
          if args:  # inace any args passed move them to kwargs
              # parse only the argument names
              cls_arg_names = [
                  arg[0] for arg in get_init_arguments_and_types(cls)
              ]
              # convert args to kwargs
              kwargs.update(dict(zip(cls_arg_names, args)))
          env_variables = vars(parse_env_variables(cls))
          # update the kwargs by env variables
          kwargs = dict(
              list(env_variables.items()) + list(kwargs.items())
          )
  
          # all args were already moved to kwargs
          return fn(self, **kwargs)
  
      return insert_env_defaults
  
imports: import inspect
  import warnings
  from argparse import ArgumentParser, Namespace
  from functools import wraps
  from typing import Callable, List, Optional, Tuple, Union
  import torch
  from pytorch_lightning import LightningDataModule, LightningModule
  from pytorch_lightning import Trainer
  from pytorch_lightning.accelerators.tpu import TPUAccelerator
  from pytorch_lightning.callbacks import BaseFinetuning
  from pytorch_lightning.utilities.argparse import add_argparse_args, get_init_arguments_and_types, parse_env_variables
  from torch.utils.data import DataLoader
  import flash
  from flash.core.data.io.output import Output
  from flash.core.data.io.output_transform import OutputTransform
  from flash.core.data.io.transform_predictions import TransformPredictions
  from flash.core.model import Task
  from flash.core.registry import FlashRegistry
label_desc: Use image node_id 2 for calling a global function with example usage: _defaults_from_env_vars(fn) and returns: insert_env_defaults, fn