code: def main(args):
      # Here Alice and Bob slightly prefer one location over the other a priori
      shared_preference = torch.tensor([args.preference])
  
      alice_depth = args.depth
      num_samples = args.num_samples
  
      # We sample Alice's true choice of location
      # by marginalizing over her decision process
      alice_decision = HashingMarginal(
          Search(alice_fb).run(shared_preference, alice_depth)
      )
  
      # draw num_samples samples from Alice's decision process
      # and use those to estimate the marginal probability
      # that Alice chooses their preferred location
      alice_prob = sum(
          [alice_decision() for i in range(num_samples)]
      ) / float(num_samples)
  
      print(
          "Empirical frequency of Alice choosing their favored location "
          + "given preference {} and recursion depth {}: {}".format(
              shared_preference, alice_depth, alice_prob
          )
      )
  
file_path: pyro/examples/rsa/schelling_false.py
imports: import argparse
  import torch
  from search_inference import HashingMarginal, Search
  import pyro
  import pyro.poutine
  from pyro.distributions import Bernoulli
label_desc: Use image node_id 5 for calling a global function with example usage: main(args) without return types