code: def maybe_construct_transformations(
      target: Any, transforms: Optional[Any]
  ) -> Any:
      if transforms is not None:
          return transforms
      flat_transforms = {}
      flat_target = ocp.utils.to_flat_dict(
          target, sep="/", keep_empty_nodes=True
      )
      for k, v in flat_target.items():
          if v is None:
              flat_transforms[k] = ocp.Transform(use_fallback=True)
      return flat_transforms
  
file_path: flax/flax/training/orbax_utils.py
imports: import dataclasses
  import inspect
  import warnings
  from typing import Any, Optional
  import jax
  import numpy
  import orbax.checkpoint
  from jax.sharding import Mesh
label_desc: Use image node_id 3 for calling a global function with example usage: maybe_construct_transformations(target, transforms) and returns: flat_transforms, transforms