code: def _check_friedman(n_strategies, n_datasets, ranked_data, alpha):
      """Check whether Friedman test is significant.
  
      Larger parts of code copied from scipy.
  
      Arguments
      ---------
      n_strategies : int
        number of strategies to evaluate
      n_datasets : int
        number of datasets classified per strategy
      ranked_data : np.array (shape: n_strategies * n_datasets)
        rank of strategy on dataset
  
      Returns
      -------
      is_significant : bool
        Indicates whether strategies differ significantly in terms of performance
        (according to Friedman test).
      """
      if n_strategies < 3:
          raise ValueError(
              "At least 3 sets of measurements must be given for Friedmann test, "
              f"got {n_strategies}."
          )
  
      # calculate c to correct chisq for ties:
      ties = 0
      for i in range(n_datasets):
          replist, repnum = find_repeats(ranked_data[i])
          for t in repnum:
              ties += t * (t * t - 1)
      c = 1 - ties / (
          n_strategies * (n_strategies * n_strategies - 1) * n_datasets
      )
  
      ssbn = np.sum(ranked_data.sum(axis=0) ** 2)
      chisq = (
          12.0 / (n_strategies * n_datasets * (n_strategies + 1)) * ssbn
          - 3 * n_datasets * (n_strategies + 1)
      ) / c
      p = distributions.chi2.sf(chisq, n_strategies - 1)
      if p < alpha:
          is_significant = True
      else:
          is_significant = False
      return is_significant
  
imports: import math
  import numpy
  from scipy.stats import distributions, find_repeats, rankdata
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 1 for calling a global function with example usage: _check_friedman(n_strategies, n_datasets, ranked_data, alpha) and returns: is_significant