code: def _minimal_reparam(fn, is_observed):
      # Unwrap Independent, Masked, Transformed etc.
      while isinstance(
          getattr(fn, "base_dist", None), dist.Distribution
      ):
          if isinstance(
              fn, torch.distributions.TransformedDistribution
          ):
              if _minimal_reparam(fn.base_dist, is_observed) is None:
                  return None  # No need to reparametrize.
              else:
                  return (
                      TransformReparam()
                  )  # Then reparametrize new sites.
          fn = fn.base_dist
  
      if isinstance(fn, dist.Stable):
          if not is_observed:
              return LatentStableReparam()
          elif fn.skew.requires_grad or fn.skew.any():
              return StableReparam()
          else:
              return SymmetricStableReparam()
  
      if isinstance(fn, dist.ProjectedNormal):
          return ProjectedNormalReparam()
  
imports: from abc import ABC, abstractmethod
  from typing import Callable, Dict, Optional, Union
  import torch
  from torch.distributions import constraints
  import pyro.distributions
  import pyro.poutine
  from .loc_scale import LocScaleReparam
  from .projected_normal import ProjectedNormalReparam
  from .reparam import Reparam
  from .softmax import GumbelSoftmaxReparam
  from .stable import LatentStableReparam, StableReparam, SymmetricStableReparam
  from .transform import TransformReparam
label_desc: Use image node_id 1 for calling a global function with example usage: _minimal_reparam(fn, is_observed) and returns: ProjectedNormalReparam, LatentStableReparam, None, TransformReparam, StableReparam, SymmetricStableReparam