code: def _preprocess_scoring_data(
      event_times, predicted_scores, event_observed
  ):
      event_times = np.asarray(event_times, dtype=float)
      predicted_scores = np.asarray(predicted_scores, dtype=float)
  
      # Allow for (n, 1) or (1, n) arrays
      if event_times.ndim == 2 and (
          event_times.shape[0] == 1 or event_times.shape[1] == 1
      ):
          # Flatten array
          event_times = event_times.ravel()
      # Allow for (n, 1) or (1, n) arrays
      if predicted_scores.ndim == 2 and (
          predicted_scores.shape[0] == 1
          or predicted_scores.shape[1] == 1
      ):
          # Flatten array
          predicted_scores = predicted_scores.ravel()
  
      if event_times.shape != predicted_scores.shape:
          raise ValueError(
              "Event times and predictions must have the same shape"
          )
      if event_times.ndim != 1:
          raise ValueError(
              "Event times can only be 1-dimensional: (n,)"
          )
  
      if event_observed is None:
          event_observed = np.ones(event_times.shape[0], dtype=float)
      else:
          event_observed = np.asarray(
              event_observed, dtype=float
          ).ravel()
          if event_observed.shape != event_times.shape:
              raise ValueError(
                  "Observed events must be 1-dimensional of same length as event times"
              )
  
      # check for NaNs
      for a in [event_times, predicted_scores, event_observed]:
          if np.isnan(a).any():
              raise ValueError(
                  "NaNs detected in inputs, please correct or drop."
              )
  
      return event_times, predicted_scores, event_observed
  
file_path: lifelines/lifelines/utils/concordance.py
imports: import numpy
  from lifelines.utils.btree import _BTree
label_desc: Use image node_id 8 for calling a global function with example usage: _preprocess_scoring_data(event_times, predicted_scores, event_observed) and returns: event_times,  predicted_scores,  event_observed