code: def model_1(capture_history, sex):
      N, T = capture_history.shape
      phi = pyro.sample(
          "phi", dist.Uniform(0.0, 1.0)
      )  # survival probability
      rho = pyro.sample(
          "rho", dist.Uniform(0.0, 1.0)
      )  # recapture probability
  
      with pyro.plate("animals", N, dim=-1):
          z = torch.ones(N)
          # we use this mask to eliminate extraneous log probabilities
          # that arise for a given individual before its first capture.
          first_capture_mask = torch.zeros(N).bool()
          for t in pyro.markov(range(T)):
              with poutine.mask(mask=first_capture_mask):
                  mu_z_t = first_capture_mask.float() * phi * z + (
                      1 - first_capture_mask.float()
                  )
                  # we use parallel enumeration to exactly sum out
                  # the discrete states z_t.
                  z = pyro.sample(
                      "z_{}".format(t),
                      dist.Bernoulli(mu_z_t),
                      infer={"enumerate": "parallel"},
                  )
                  mu_y_t = rho * z
                  pyro.sample(
                      "y_{}".format(t),
                      dist.Bernoulli(mu_y_t),
                      obs=capture_history[:, t],
                  )
              first_capture_mask |= capture_history[:, t].bool()
  
file_path: pyro/examples/capture_recapture/cjs.py
imports: import argparse
  import os
  import numpy
  import torch
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.infer import SVI, TraceEnum_ELBO, TraceTMC_ELBO
  from pyro.infer.autoguide import AutoDiagonalNormal
  from pyro.optim import Adam
label_desc: Use image node_id 1 for calling a global function with example usage: model_1(capture_history, sex) without return types