code: def enable_validation(is_validate: bool = True) -> None:
      """
      Enable or disable validation checks in Pyro. Validation checks provide
      useful warnings and errors, e.g. NaN checks, validating distribution
      arguments and support values, detecting incorrect use of ELBO and MCMC.
      Since some of these checks may be expensive, you may want to disable
      validation of mature models to speed up inference.
  
      The default behavior mimics Python's ``assert`` statement: validation is on
      by default, but is disabled if Python is run in optimized mode (via
      ``python -O``). Equivalently, the default behavior depends on Python's
      global ``__debug__`` value via ``pyro.enable_validation(__debug__)``.
  
      Validation is temporarily disabled during jit compilation, for all
      inference algorithms that support the PyTorch jit. We recommend developing
      models with non-jitted inference algorithms to ease debugging, then
      optionally moving to jitted inference once a model is correct.
  
      :param bool is_validate: (optional; defaults to True) whether to
          enable validation checks.
      """
      dist.enable_validation(is_validate)
      infer.enable_validation(is_validate)
      poutine.enable_validation(is_validate)
  
imports: import copy
  import warnings
  from collections import OrderedDict
  from contextlib import ExitStack, contextmanager
  from inspect import isclass
  from typing import Callable, Iterator, Optional, Sequence, Union
  import torch
  from torch.distributions import constraints
  import pyro.distributions
  import pyro.infer
  import pyro.poutine
  from pyro.distributions.torch_distribution import TorchDistributionMixin
  from pyro.params import param_with_module_name
  from pyro.params.param_store import ParamStoreDict
  from pyro.poutine.plate_messenger import PlateMessenger
  from pyro.poutine.runtime import _MODULE_NAMESPACE_DIVIDER, _PYRO_PARAM_STORE, InferDict, Message, am_i_wrapped, apply_stack, effectful
  from pyro.poutine.subsample_messenger import SubsampleMessenger
  from pyro.util import deep_getattr, set_rng_seed
label_desc: Use image node_id 13 for calling a global function with example usage: enable_validation(is_validate) without return types