code: def test_concordance_index_fast_is_same_as_slow():
      size = 100
      T = np.random.normal(size=size)
      P = np.random.normal(size=size)
      C = np.random.choice([0, 1], size=size)
      Z = np.zeros_like(T)
  
      # Hard to imagine these failing
      assert slow_cindex(T, Z, C) == fast_cindex(T, Z, C)
      assert slow_cindex(T, T, C) == fast_cindex(T, T, C)
      # This is the real test though
      assert slow_cindex(T, P, C) == fast_cindex(T, P, C)
  
      cp = CoxPHFitter()
      df = load_rossi()
      cp.fit(df, duration_col="week", event_col="arrest")
  
      T = cp.durations.values.ravel()
      P = -cp.predict_partial_hazard(
          df[df.columns.difference(["week", "arrest"])]
      ).values.ravel()
  
      E = cp.event_observed.values.ravel()
  
      assert slow_cindex(T, P, E) == fast_cindex(T, P, E)
  
file_path: lifelines/lifelines/tests/utils/test_concordance.py
imports: import pytest
  import numpy
  import pandas
  from lifelines import CoxPHFitter
  from lifelines.datasets import load_rossi
  from lifelines.utils.concordance import concordance_index
  from lifelines.utils.concordance import concordance_index
  from lifelines.utils.concordance import naive_concordance_index
label_desc: Use image node_id 6 for calling a global function with example usage: test_concordance_index_fast_is_same_as_slow() without return types