code: def _wrap_init(class_dict: Dict[str, Any]) -> None:
      """Helper function to wrap the ``__init__`` (if present) from a class construction dict to apply the
      ``_validate_input`` function after instantiation. Modifies the dict inplace.
  
      Args:
          class_dict: The class construction dict, optionally containing an init to wrap.
  
      """
      if "__init__" in class_dict:
          fn = class_dict["__init__"]
  
          @functools.wraps(fn)
          def wrapper(self, *args, **kwargs):
              fn(self, *args, **kwargs)
              _validate_input(self)
  
          class_dict["__init__"] = wrapper
  
imports: import functools
  import os
  from enum import Enum
  from typing import Any, Dict, Iterable, List, Sequence, Tuple, Union, cast
  from pytorch_lightning.utilities.enums import LightningEnum
  from torch.utils.data import Dataset
  from flash.core.data.properties import Properties
  from flash.core.data.utils import _STAGES_PREFIX
  from flash.core.utilities.stages import RunningStage
label_desc: Use image node_id 4 for calling a global function with example usage: _wrap_init(class_dict) without return types