code: def test_matrix():
      df = pd.read_csv(
          os.path.join(
              os.path.dirname(__file__), "..", "..", "data/titanic.csv"
          )
      )
      df = df[["Age", "Survived"]]
      df["Age_datetime"] = pd.to_datetime(
          df["Age"], infer_datetime_format=True
      )
      subset_df = df[["Survived", "Age_datetime"]]
  
      # check input types
      with pytest.raises(TypeError):
          numpy_array = np.random.randn(10, 10)  # not a DataFrame
          pps.matrix(numpy_array)
  
      with pytest.raises(ValueError):
          pps.matrix(df, output="invalid_output_type")
  
      # check return types
      assert isinstance(pps.matrix(df), pd.DataFrame)
      assert isinstance(pps.matrix(df, output="list"), list)
  
      # matrix catches single score errors under the hood
      invalid_score = [
          score
          for score in pps.matrix(subset_df, output="list")
          if (score["x"] == "Survived" and score["y"] == "Age_datetime")
      ][0]
      assert invalid_score["ppscore"] == 0
  
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 7 for calling a global function with example usage: test_matrix() without return types