code: def runs_test(f, c, wfuncs, window):
      r"""Perform a runs test on binary series.
  
      Parameters
      ----------
      f : pandas.DataFrame
          Dataframe containing the column ``c``.
      c : str
          Name of the column in the dataframe ``f``.
      wfuncs : list
          The set of runs test functions to apply to the column:
  
          ``'all'``:
              Run all of the functions below.
          ``'rtotal'``:
              The running total over the ``window`` period.
          ``'runs'``:
              Total number of runs in ``window``.
          ``'streak'``:
              The length of the latest streak.
          ``'zscore'``:
              The Z-Score over the ``window`` period.
      window : int
          The rolling period.
  
      Returns
      -------
      new_features : pandas.DataFrame
          The dataframe containing the runs test features.
  
      References
      ----------
      For more information about runs tests for detecting non-randomness,
      refer to [RUNS]_.
  
      .. [RUNS] http://www.itl.nist.gov/div898/handbook/eda/section3/eda35d.htm
  
      """
  
      fc = f[c]
      all_funcs = {
          "runs": runs,
          "streak": streak,
          "rtotal": rtotal,
          "zscore": zscore,
      }
      # use all functions
      if "all" in wfuncs:
          wfuncs = list(all_funcs.keys())
      # apply each of the runs functions
      new_features = pd.DataFrame()
      for w in wfuncs:
          if w in all_funcs:
              new_feature = fc.rolling(window=window).apply(
                  all_funcs[w]
              )
              new_feature.fillna(0, inplace=True)
              new_column_name = PSEP.join([c, w])
              new_feature = new_feature.rename(new_column_name)
              frames = [new_features, new_feature]
              new_features = pd.concat(frames, axis=1)
          else:
              logger.info("Runs Function %s not found", w)
      return new_features
  
imports: from alphapy.calendrical import biz_day_month
  from alphapy.calendrical import biz_day_week
  from alphapy.globals import NULLTEXT
  from alphapy.globals import BSEP, PSEP, USEP
  from alphapy.variables import vexec
  import itertools
  import logging
  import math
  import numpy
  import pandas
label_desc: Use image node_id 41 for calling a global function with example usage: runs_test(f, c, wfuncs, window) and returns: new_features