code: def target_binary_feature_real_test(x, y, test):
      """
      Calculate the feature significance of a real-valued feature to a binary target as a p-value.
      Use either the `Mann-Whitney U` or `Kolmogorov Smirnov` from  :func:`~scipy.stats.mannwhitneyu` or
      :func:`~scipy.stats.ks_2samp` for this.
  
      :param x: the real-valued feature vector
      :type x: pandas.Series
  
      :param y: the binary target vector
      :type y: pandas.Series
  
      :param test: The significance test to be used. Either ``'mann'`` for the Mann-Whitney-U test
                   or ``'smir'`` for the Kolmogorov-Smirnov test
      :type test: str
  
      :return: the p-value of the feature significance test. Lower p-values indicate a higher feature significance
      :rtype: float
  
      :raise: ``ValueError`` if the target is not binary.
      """
      __check_if_pandas_series(x, y)
      _check_for_nans(x, y)
  
      # Check for correct value range
      __check_for_binary_target(y)
  
      # Extract the unique values
      y0, y1 = np.unique(y.values)
  
      # Divide feature according to target
      x_y1 = x[y == y1]
      x_y0 = x[y == y0]
  
      if test == "mann":
          # Perform Mann-Whitney-U test
          U, p_mannwhitu = stats.mannwhitneyu(
              x_y1, x_y0, use_continuity=True, alternative="two-sided"
          )
          return p_mannwhitu
      elif test == "smir":
          # Perform Kolmogorov-Smirnov test
          KS, p_ks = stats.ks_2samp(x_y1, x_y0)
          return p_ks
      else:
          raise ValueError(
              "Please use a valid entry for test_for_binary_target_real_feature. "
              + "Valid entries are 'mann' and 'smir'."
          )
  
file_path: tsfresh/tsfresh/feature_selection/significance_tests.py
imports: import warnings
  from builtins import str
  import numpy
  import pandas
  from scipy import stats
label_desc: Use image node_id 2 for calling a global function with example usage: target_binary_feature_real_test(x, y, test) and returns: p_mannwhitu, p_ks