code: def construct_survival_curves(hazard_rates, timelines):
      """
      Given hazard rates, reconstruct the survival curves
  
      Parameters
      ----------
      hazard_rates: (n,t) array
      timelines: (t,) the observational times
  
      Returns
      -------
      t: survial curves, (n,t) array
      """
      cumulative_hazards = cumulative_integral(
          hazard_rates.values, timelines
      )
      return pd.DataFrame(np.exp(-cumulative_hazards), index=timelines)
  
imports: import numpy
  import pandas
  from scipy import stats
  from scipy.optimize import newton
  from scipy.integrate import cumtrapz
label_desc: Use image node_id 16 for calling a global function with example usage: construct_survival_curves(hazard_rates, timelines) and returns: pd