code: def test_hetero_regional_smoke(duration, forecast, options, algo):
      num_regions = 6
      coupling = torch.eye(num_regions).clamp(min=0.1)
      population = torch.tensor([2.0, 3.0, 4.0, 10.0, 100.0, 1000.0])
      recovery_time = 7.0
  
      # Generate data.
      model = HeterogeneousRegionalSIRModel(
          population, coupling, recovery_time, data=[None] * duration
      )
      assert model.full_mass == [("R0", "R_drift", "rho0", "rho_drift")]
      for attempt in range(100):
          data = model.generate({"R0": 1.5})["obs"]
          assert data.shape == (duration, num_regions)
          if data.sum():
              break
      assert data.sum() > 0, "failed to generate positive data"
  
      # Infer.
      model = HeterogeneousRegionalSIRModel(
          population, coupling, recovery_time, data
      )
      num_samples = 5
      if algo == "mcmc":
          model.fit_mcmc(
              warmup_steps=1,
              num_samples=num_samples,
              max_tree_depth=2,
              **options,
          )
      else:
          model.fit_svi(num_steps=2, num_samples=num_samples, **options)
  
      # Predict and forecast.
      samples = model.predict(forecast=forecast)
      assert samples["S"].shape == (
          num_samples,
          duration + forecast,
          num_regions,
      )
      assert samples["I"].shape == (
          num_samples,
          duration + forecast,
          num_regions,
      )
  
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 14 for calling a global function with example usage: test_hetero_regional_smoke(duration, forecast, options, algo) without return types