code: def check_for_nans_in_columns(df, columns=None):
      """
      Helper function to check for ``NaN`` in the data frame and raise a ``ValueError`` if there is one.
  
      :param df: the pandas DataFrame to test for NaNs
      :type df: pandas.DataFrame
      :param columns: a list of columns to test for NaNs. If left empty, all columns of the DataFrame will be tested.
      :type columns: list
  
      :return: None
      :rtype: None
      :raise: ``ValueError`` of ``NaNs`` are found in the DataFrame.
      """
      if columns is None:
          columns = df.columns
  
      if pd.isnull(df.loc[:, columns]).any().any():
          if not isinstance(columns, list):
              columns = list(columns)
          raise ValueError(
              "Columns {} of DataFrame must not contain NaN values".format(
                  df.loc[:, columns]
                  .columns[pd.isnull(df.loc[:, columns]).sum() > 0]
                  .tolist()
              )
          )
  
file_path: tsfresh/tsfresh/utilities/dataframe_functions.py
imports: import warnings
  import numpy
  import pandas
  from tsfresh import defaults
  from tsfresh.utilities.distribution import DistributorBaseClass, MapDistributor, MultiprocessingDistributor
label_desc: Use image node_id 1 for calling a global function with example usage: check_for_nans_in_columns(df, columns) without return types