code: def test_pandas_input_fn(pd_df):
      df, _, _ = pd_df
  
      # check dataset
      dataset = pandas_input_fn(df)()
      batch = tf.compat.v1.data.make_one_shot_iterator(
          dataset
      ).get_next()
      with tf.compat.v1.Session() as sess:
          features = sess.run(batch)
  
          # check the input function returns all the columns
          assert len(features) == len(df.columns)
  
          for k, v in features.items():
              assert k in df.columns.values
              # check if a list feature column converted correctly
              if len(v.shape) == 1:
                  assert np.array_equal(v, df[k].values)
              elif len(v.shape) == 2:
                  assert v.shape[1] == len(df[k][0])
  
      # check dataset with shuffles
      dataset = pandas_input_fn(df, shuffle=True, seed=SEED)()
      batch = tf.compat.v1.data.make_one_shot_iterator(
          dataset
      ).get_next()
      with tf.compat.v1.Session() as sess:
          features = sess.run(batch)
          print(features)
          # check the input function returns all the columns
          assert len(features) == len(df.columns)
  
          for k, v in features.items():
              assert k in df.columns.values
              # check if a list feature column converted correctly
              if len(v.shape) == 1:
                  assert not np.array_equal(v, df[k].values)
              elif len(v.shape) == 2:
                  assert v.shape[1] == len(df[k][0])
  
      # check dataset w/ label
      dataset_with_label = pandas_input_fn(
          df, y_col=DEFAULT_RATING_COL
      )()
      batch = tf.compat.v1.data.make_one_shot_iterator(
          dataset_with_label
      ).get_next()
      with tf.compat.v1.Session() as sess:
          features, label = sess.run(batch)
          assert len(features) == len(df.columns) - 1
  
file_path: recommenders/tests/unit/recommenders/utils/test_tf_utils.py
imports: import os
  import pytest
  import numpy
  import pandas
  import itertools
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, SEED
  from recommenders.evaluation.python_evaluation import rmse
label_desc: Use image node_id 2 for calling a global function with example usage: test_pandas_input_fn(pd_df) without return types