code: def pdf(alphas):
      '''Returns a Dirichlet PDF function'''
      alphap = alphas - 1
      c = np.exp(gammaln(alphas.sum()) - gammaln(alphas).sum())
      def dirichlet(xs):
          '''N x K array'''
          return c * (xs**alphap).prod(axis=1)
      return dirichlef pdf(alphas):
      '''Returns a Dirichlet PDF function'''
      alphap = alphas - 1
      c = np.exp(gammaln(alphas.sum()) - gammaln(alphas).sum())
      def dirichlet(xs):
          '''N x K array'''
          return c * (xs**alphap).prod(axis=1)
      return dirichlet
docs: Returns a Dirichlet PDF function