def METHOD_NAME(replay_id: str, project_id: str, segment_id: int, segment):
    f = File.objects.create(name="rr:{segment_id}", type="replay.recording")
    f.putfile(BytesIO(compress(dumps_htmlsafe(segment).encode())))
    ReplayRecordingSegment.objects.create(
        replay_id=replay_id,
        project_id=project_id,
        segment_id=segment_id,
        file_id=f.id,
    )