code: def _get_imr_duration(m1, m2, s1z, s2z, f_low, approximant="SEOBNRv4"):
      
      m1, m2, s1z, s2z, f_low = float(m1), float(m2), float(s1z), float(s2z),\
                                float(f_low)
      if approximant == "SEOBNRv2":
          chi = lalsimulation.SimIMRPhenomBComputeChi(m1, m2, s1z, s2z)
          time_length = lalsimulation.SimIMRSEOBNRv2ChirpTimeSingleSpin(
                                  m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, chi, f_low)
      elif approximant == "IMRPhenomD":
          time_length = lalsimulation.SimIMRPhenomDChirpTime(
                             m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, s1z, s2z, f_low)
      elif approximant == "SEOBNRv4":
          # NB for no clear reason this function has f_low as first argument
          time_length = lalsimulation.SimIMRSEOBNRv4ROMTimeOfFrequency(
                             f_low, m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, s1z, s2z)
      else:
          raise RuntimeError("I can't calculate a duration for %s" % approximant)
      # FIXME Add an extra factor of 1.1 for 'safety' since the duration
      # functions are approximate
      return time_length * 1.1
docs: Wrapper of lalsimulation template duration approximate formula