code: def _guess_max_plate_nesting(model, args, kwargs):
      """
      Guesses max_plate_nesting by running the model once
      without enumeration. This optimistically assumes static model
      structure.
      """
      with poutine.block():
          model_trace = poutine.trace(model).get_trace(*args, **kwargs)
      sites = [
          site
          for site in model_trace.nodes.values()
          if site["type"] == "sample"
      ]
  
      dims = [
          frame.dim
          for site in sites
          for frame in site["cond_indep_stack"]
          if frame.vectorized
      ]
      max_plate_nesting = -min(dims) if dims else 0
      return max_plate_nesting
  
imports: import functools
  import traceback
  import warnings
  from collections import OrderedDict, defaultdict
  from functools import partial, reduce
  from itertools import product
  import torch
  from opt_einsum import shared_intermediates
  from torch.distributions import biject_to
  import pyro
  import pyro.poutine
  from pyro.distributions.util import broadcast_shape, logsumexp
  from pyro.infer import config_enumerate
  from pyro.infer.autoguide.initialization import InitMessenger, init_to_uniform
  from pyro.infer.util import is_validation_enabled
  from pyro.ops import stats
  from pyro.ops.contract import contract_to_tensor
  from pyro.ops.integrator import potential_grad
  from pyro.poutine.subsample_messenger import _Subsample
  from pyro.poutine.util import prune_subsample_sites
  from pyro.util import check_site_shape, ignore_jit_warnings
label_desc: Use image node_id 1 for calling a global function with example usage: _guess_max_plate_nesting(model, args, kwargs) and returns: max_plate_nesting