code: def fully_pooled(at_bats, hits):
      r"""
      Number of hits in $K$ at bats for each player has a Binomial
      distribution with a common probability of success, $\phi$.
  
      :param (torch.Tensor) at_bats: Number of at bats for each player.
      :param (torch.Tensor) hits: Number of hits for the given at bats.
      :return: Number of hits predicted by the model.
      """
      phi_prior = Uniform(
          scalar_like(at_bats, 0), scalar_like(at_bats, 1)
      )
      phi = pyro.sample("phi", phi_prior)
      num_players = at_bats.shape[0]
      with pyro.plate("num_players", num_players):
          return pyro.sample("obs", Binomial(at_bats, phi), obs=hits)
  
file_path: pyro/examples/baseball.py
imports: import argparse
  import logging
  import math
  import pandas
  import torch
  import pyro
  from pyro.distributions import Beta, Binomial, HalfCauchy, Normal, Pareto, Uniform
  from pyro.distributions.util import scalar_like
  from pyro.infer import MCMC, NUTS, Predictive
  from pyro.infer.mcmc.util import initialize_model, summary
  from pyro.util import ignore_experimental_warning
label_desc: Use image node_id 1 for calling a global function with example usage: fully_pooled(at_bats, hits) and returns: pyro