code: def valid_input_check(df):
      if f"{type(df)}" == "<class 'pandas.core.frame.SparseDataFrame'>":
          msg = (
              "SparseDataFrame support has been deprecated in pandas 1.0,"
              " and is no longer supported in mlxtend. "
              " Please"
              " see the pandas migration guide at"
              " https://pandas.pydata.org/pandas-docs/"
              "stable/user_guide/sparse.html#sparse-data-structures"
              " for supporting sparse data in DataFrames."
          )
          raise TypeError(msg)
  
      if df.size == 0:
          return
      if hasattr(df, "sparse"):
          if not isinstance(df.columns[0], str) and df.columns[0] != 0:
              raise ValueError(
                  "Due to current limitations in Pandas, "
                  "if the sparse format has integer column names,"
                  "names, please make sure they either start "
                  "with `0` or cast them as string column names: "
                  "`df.columns = [str(i) for i in df.columns`]."
              )
  
      # Fast path: if all columns are boolean, there is nothing to checks
      all_bools = df.dtypes.apply(pd.api.types.is_bool_dtype).all()
      if not all_bools:
          warnings.warn(
              "DataFrames with non-bool types result in worse computational"
              "performance and their support might be discontinued in the future."
              "Please use a DataFrame with bool type",
              DeprecationWarning,
          )
          # Pandas is much slower than numpy, so use np.where on Numpy arrays
          if hasattr(df, "sparse"):
              if df.size == 0:
                  values = df.values
              else:
                  values = df.sparse.to_coo().tocoo().data
          else:
              values = df.values
          idxs = np.where((values != 1) & (values != 0))
          if len(idxs[0]) > 0:
              # idxs has 1 dimension with sparse data and 2 with dense data
              val = values[tuple(loc[0] for loc in idxs)]
              s = (
                  "The allowed values for a DataFrame"
                  " are True, False, 0, 1. Found value %s" % (val)
              )
              raise ValueError(s)
  
file_path: mlxtend/mlxtend/frequent_patterns/fpcommon.py
imports: import collections
  import warnings
  import numpy
  import pandas
  from pandas import __version__
label_desc: Use image node_id 3 for calling a global function with example usage: valid_input_check(df) without return types