code: def sample(model: Model, sigma: Sigma) -> float:
      posterior_alpha = sigma.alpha + (model.data.X.n_obsv / 2.0)
      posterior_beta = sigma.beta + (
          0.5 * (np.sum(np.square(model.residuals())))
      )
      draw = np.power(
          np.random.gamma(posterior_alpha, 1.0 / posterior_beta), -0.5
      )
      return draw
  
file_path: imodels/imodels/experimental/bartpy/samplers/sigma.py
imports: import numpy
  from ..model import Model
  from ..samplers.sampler import Sampler
  from ..sigma import Sigma
label_desc: Use image node_id 2 for calling the SigmaSampler obj's underlying member method code with example usage: obj.sample(model, sigma) and returns: draw