code: def compute_pmf_approximation(
      mean: float, sigma: float, skewness: float, n: int
  ):
      """Computes approximate probability mass function of Poisson binomial distribution.
  
      The computation is based on paper chapter 3.3 (refined normal approximation)
      https://www.researchgate.net/publication/257017356_On_computing_the_distribution_function_for_the_Poisson_binomial_distribution
  
      The tails of probability <10^(-15) are dropped.
      """
      if sigma == 0:
          return PMF(int(round(mean)), np.array([1]))
      G = lambda x: (
          norm.cdf(x) + skewness * (1 - x * x) * norm.pdf(x) / 6
      )
      # n can be large. Assuming that the output distribution is close to the
      # normal, for all i further than 8*sigma contributes less than 10^(-15).
      # So compute probabilities for (mean-8*sigma, mean+8*sigma).
      start = max(0, int(np.floor(mean - 8 * sigma)))
      end = min(n, int(np.round(mean + 8 * sigma)))
  
      xs = np.arange(start - 1, end + 1)
      cdf_values = G((xs + 0.5 - mean) / sigma)
      cdf_values = np.clip(cdf_values, 0, 1)
      return PMF(start, np.diff(cdf_values))
  
imports: import numpy
  from scipy.stats import norm
  from typing import Sequence, Tuple
  from dataclasses import dataclass
label_desc: Use image node_id 3 for calling a global function with example usage: compute_pmf_approximation(mean, sigma, skewness, n) and returns: PMF, PMF