code: def test_predictors():
      y = "Survived"
      df = pd.read_csv(
          os.path.join(
              os.path.dirname(__file__), "..", "..", "data/titanic.csv"
          )
      )
      df = df[["Age", y]]
  
      duplicate_column_names_df = pd.DataFrame()
      duplicate_column_names_df["x1"] = np.random.uniform(-2, 2, 10)
      duplicate_column_names_df["x2"] = np.random.uniform(-2, 2, 10)
      duplicate_column_names_df[
          "unique_column_name"
      ] = np.random.uniform(-2, 2, 10)
      duplicate_column_names_df.columns = [
          "duplicate_column_name",
          "duplicate_column_name",
          "unique_column_name",
      ]
  
      # check input types
      with pytest.raises(TypeError):
          numpy_array = np.random.randn(10, 10)  # not a DataFrame
          pps.predictors(numpy_array, y)
  
      with pytest.raises(ValueError):
          pps.predictors(df, "y_column_that_does_not_exist")
  
      with pytest.raises(ValueError):
          pps.predictors(df, y, output="invalid_output_type")
  
      with pytest.raises(ValueError):
          pps.predictors(df, y, sorted="invalid_value_for_sorted")
  
      with pytest.raises(AssertionError):
          # df shall not have duplicate column names
          pps.predictors(
              duplicate_column_names_df, "duplicate_column_name"
          )
  
      # check return types
      result_df = pps.predictors(df, y)
      assert isinstance(result_df, pd.DataFrame)
      assert y not in result_df.index
  
      list_of_dicts = pps.predictors(df, y, output="list")
      assert isinstance(list_of_dicts, list)
      assert isinstance(list_of_dicts[0], dict)
  
file_path: dtale/tests/dtale/ppscore/test_calculation.py
imports: import os
  import pytest
  import pandas
  import numpy
  import sys
  import dtale.ppscore
  from dtale.pandas_util import check_pandas_version
label_desc: Use image node_id 6 for calling a global function with example usage: test_predictors() without return types