 # Complete the PyMC model definition within the 'with pm.Model() as m:' block below. Your output must define a complete Bayesian model with appropriate priors, likelihood, and then sample the posterior using, `pm.sample(1000, tune=1000, chains=4, return_inferencedata=True, idata_kwargs={"log_likelihood": True})`. Do not include any extra commentary or text outside the code. Follow best practices for expert-level Bayesian modeling.
    
# Description: The mortality rates in 12 hospitals performing cardiac surgery on babies.

    
import pymc as pm
import numpy as np
import arviz as az
import matplotlib.pyplot as plt

# Given Data
N = 12  # Number of observations
n = np.array([47, 148, 119, 810, 211, 196, 148, 215, 207, 97, 256, 360])
r = np.array([0, 18, 8, 46, 8, 13, 9, 31, 14, 8, 29, 24])

with pm.Model() as m:
    
    