code: def model(K, data):
      # Global parameters.
      weights = pyro.param(
          "weights", torch.ones(K) / K, constraint=constraints.simplex
      )
      locs = pyro.param("locs", 10 * torch.randn(K))
      scale = pyro.param(
          "scale", torch.tensor(0.5), constraint=constraints.positive
      )
  
      with pyro.plate("data"):
          return local_model(weights, locs, scale, data)
  
file_path: pyro/examples/contrib/autoname/scoping_mixture.py
imports: import argparse
  import torch
  from torch.distributions import constraints
  import pyro
  import pyro.distributions
  import pyro.optim
  from pyro.contrib.autoname import scope
  from pyro.infer import SVI, TraceEnum_ELBO, config_enumerate
label_desc: Use image node_id 1 for calling a global function with example usage: model(K, data) and returns: local_model