code: def test_unknown_start_smoke(
      duration, pre_obs_window, forecast, options
  ):
      population = 100
      recovery_time = 7.0
  
      # Generate data.
      data = [None] * duration
      model = UnknownStartSIRModel(
          population, recovery_time, pre_obs_window, data
      )
      assert model.full_mass == [("R0", "rho0", "rho1")]
      for attempt in range(100):
          data = model.generate({"R0": 1.5, "rho0": 0.1, "rho1": 0.5})[
              "obs"
          ]
          assert len(data) == pre_obs_window + duration
          data = data[pre_obs_window:]
          if data.sum():
              break
      assert data.sum() > 0, "failed to generate positive data"
      logger.info("data:\n{}".format(data))
  
      # Infer.
      model = UnknownStartSIRModel(
          population, recovery_time, pre_obs_window, data
      )
      num_samples = 5
      model.fit_mcmc(
          warmup_steps=1,
          num_samples=num_samples,
          max_tree_depth=2,
          **options,
      )
  
      # Predict and forecast.
      samples = model.predict(forecast=forecast)
      assert samples["S"].shape == (
          num_samples,
          pre_obs_window + duration + forecast,
      )
      assert samples["I"].shape == (
          num_samples,
          pre_obs_window + duration + forecast,
      )
  
      # Check time of first infection.
      t = samples["first_infection"]
      logger.info("first_infection:\n{}".format(t))
      assert t.shape == (num_samples,)
      assert (0 <= t).all()
      assert (t < pre_obs_window + duration).all()
      for I, ti in zip(samples["I"], t):
          assert (I[:ti] == 0).all()
          assert I[ti] > 0
  
imports: import logging
  import math
  import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro.contrib.epidemiology.models import HeterogeneousRegionalSIRModel, HeterogeneousSIRModel, OverdispersedSEIRModel, OverdispersedSIRModel, RegionalSIRModel, SimpleSEIRDModel, SimpleSEIRModel, SimpleSIRModel, SparseSIRModel, SuperspreadingSEIRModel, SuperspreadingSIRModel, UnknownStartSIRModel
  from tests.common import xfail_param
label_desc: Use image node_id 11 for calling a global function with example usage: test_unknown_start_smoke(duration, pre_obs_window, forecast, options) without return types