code: def local_model(latent, ps, locs, scales, obs=None):
      i = latent.id.sample_(dist.Categorical(ps))
      return latent.x.sample_(dist.Normal(locs[i], scales[i]), obs=obs)
  
file_path: pyro/examples/contrib/autoname/mixture.py
imports: import argparse
  import torch
  from torch.distributions import constraints
  import pyro
  import pyro.distributions
  from pyro.contrib.autoname import named
  from pyro.infer import SVI, JitTrace_ELBO, Trace_ELBO
  from pyro.optim import Adam
label_desc: Use image node_id 2 for calling a global function with example usage: local_model(latent, ps, locs, scales, obs) and returns: latent