code: def check_dist_not_registered(dist, model=None):
      """Check that a dist is not registered in the model already"""
      from pymc.model import modelcontext
  
      try:
          model = modelcontext(None)
      except (TypeError, BlockModelAccessError):
          pass
      else:
          if dist in model.basic_RVs:
              raise ValueError(
                  f"The dist {dist} was already registered in the current model.\n"
                  f"You should use an unregistered (unnamed) distribution created via "
                  f"the `.dist()` API instead, such as:\n`dist=pm.Normal.dist(0, 1)`"
              )
  
imports: import functools
  import warnings
  from typing import Any, Dict, List, NewType, Optional, Sequence, Tuple, Union, cast
  import arviz
  import cloudpickle
  import numpy
  import xarray
  from cachetools import LRUCache, cachedmethod
  from pytensor import Variable
  from pytensor.compile import SharedVariable
  from pytensor.graph.utils import ValidatingScratchpad
  from pymc.exceptions import BlockModelAccessError
label_desc: Use image node_id 15 for calling a global function with example usage: check_dist_not_registered(dist, model) without return types