Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def format_segment(seg):
"""
Formats a segment assuming it's an instance of class segment with elements
filename, channel, speaker, start and stop times, label, and text
"""
ret_str = "{:} --> {:}".format(seconds_to_timestamp(seg.start),
seconds_to_timestamp(seg.stop))
ret_str += " ".format(seg.channel)
ret_str += " ".format(seg.speaker)
ret_str += "\n{:}\n".format(
seg.formatted_text if seg.formatted_text else seg.text)
return ret_str
def format_segment(seg):
"""
Formats a segment assuming it's an instance of class segment with elements
filename, channel, speaker, start and stop times, label, and text
"""
ret_str = "1\n{:} --> {:}\n".format(seconds_to_timestamp(seg.start),
seconds_to_timestamp(
seg.stop)).replace(".", ",")
ret_str += "{:}\n\n".format(
seg.formatted_text if seg.formatted_text else seg.text)
return ret_str
def format_segment(seg):
"""
Formats a segment assuming it's an instance of class segment with elements
filename, channel, speaker, start and stop times, label, and text
"""
ret_str = "1\n{:} --> {:}\n".format(seconds_to_timestamp(seg.start),
seconds_to_timestamp(
seg.stop)).replace(".", ",")
ret_str += "{:}\n\n".format(
seg.formatted_text if seg.formatted_text else seg.text)
return ret_str
def format_segment(seg):
"""
Formats a segment assuming it's an instance of class segment with elements
filename, channel, speaker, start and stop times, label, and text
"""
ret_str = "{:} --> {:}".format(seconds_to_timestamp(seg.start),
seconds_to_timestamp(seg.stop))
ret_str += " ".format(seg.channel)
ret_str += " ".format(seg.speaker)
ret_str += "\n{:}\n".format(
seg.formatted_text if seg.formatted_text else seg.text)
return ret_str