input: Write a python function to generate and stream HLS segments.
  assert len(stream_segments(2)) == 2
  assert "#EXTINF:5.0" in stream_segments(1)[0]
  assert "#EXT-X-CUE-OUT:DURATION=5.0" in stream_segments(1)[0]
output: def stream_segments(n_segments):
      segment_template = """#EXTM3U
  #EXT-X-VERSION:3
  #EXT-X-TARGETDURATION:5
  #EXTINF:5.0,
  segment{}.ts
  #EXT-X-CUE-OUT:DURATION=5.0
  """
      return [segment_template.format(i) for i in range(n_segments)]