MCPcopy
hub / github.com/openai/openai-python / format_time

Function format_time

src/openai/lib/_validators.py:605–613  ·  view source on GitHub ↗
(time: float)

Source from the content-addressed store, hash-verified

603 expected_time = size * 0.0515
604
605 def format_time(time: float) -> str:
606 if time < 60:
607 return f"{round(time, 2)} seconds"
608 elif time < 3600:
609 return f"{round(time / 60, 2)} minutes"
610 elif time < 86400:
611 return f"{round(time / 3600, 2)} hours"
612 else:
613 return f"{round(time / 86400, 2)} days"
614
615 time_string = format_time(expected_time + 140)
616 sys.stdout.write(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected