code: def partition_function(N, N1, zeta, q):
      """Partition function for Z.
  
      Parameters
      ----------
      N : int, float
          number of rows of input data X
      N1 : int, float
          parameter value from NN[k] for k=0:K-1
      zeta : float
          parameter value zeta
      q : int, float
          parameter value q
      """
      return sum(
          [
              binom(N1 - 1, q1)
              * binom(N - N1, q - q1)
              * zeta ** (q1)
              * (1 - zeta) ** (q - q1)
              for q1 in range(q + 1)
          ]
      )
  
file_path: sktime/sktime/transformations/series/hidalgo.py
imports: from functools import reduce
  import numpy
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils.validation import check_random_state
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 2 for calling a global function with example usage: partition_function(N, N1, zeta, q) and returns: sum