code: def run(otype):
      mtime0, mtime, mstatus = gen_mediator()
      ytime, ystatus = gen_outcome(otype, mtime0)
      df = build_df(ytime, ystatus, mtime0, mtime, mstatus)
  
      outcome_model = sm.PHReg.from_formula(
          "ytime ~ exp + mtime", status="ystatus", data=df
      )
      mediator_model = sm.PHReg.from_formula(
          "mtime ~ exp", status="mstatus", data=df
      )
  
      med = Mediation(
          outcome_model,
          mediator_model,
          "exp",
          "mtime",
          outcome_predict_kwargs={"pred_only": True},
      )
      med_result = med.fit(n_rep=20)
      print(med_result.summary())
  
file_path: statsmodels/examples/python/mediation_survival.py
imports: import pandas
  import numpy
  import statsmodels.api
  from statsmodels.stats.mediation import Mediation
label_desc: Use image node_id 4 for calling a global function with example usage: run(otype) without return types