code: def discrete_model(args, data):
      # Sample global parameters.
      rate_s, prob_i, rho = global_model(args.population)
  
      # Sequentially sample time-local variables.
      S = torch.tensor(args.population - 1.0)
      I = torch.tensor(1.0)
      for t, datum in enumerate(data):
          S2I = pyro.sample(
              "S2I_{}".format(t),
              dist.Binomial(S, -(rate_s * I).expm1()),
          )
          I2R = pyro.sample(
              "I2R_{}".format(t), dist.Binomial(I, prob_i)
          )
          S = pyro.deterministic("S_{}".format(t), S - S2I)
          I = pyro.deterministic("I_{}".format(t), I + S2I - I2R)
          pyro.sample(
              "obs_{}".format(t),
              dist.ExtendedBinomial(S2I, rho),
              obs=datum,
          )
  
imports: import argparse
  import logging
  import math
  import re
  from collections import OrderedDict
  import torch
  import pyro
  import pyro.distributions
  import pyro.distributions.hmm
  import pyro.poutine
  from pyro.infer import MCMC, NUTS, config_enumerate, infer_discrete
  from pyro.infer.autoguide import init_to_value
  from pyro.ops.special import safe_log
  from pyro.ops.tensor_utils import convolve
  from pyro.util import warn_if_nan
label_desc: Use image node_id 2 for calling a global function with example usage: discrete_model(args, data) without return types