<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_fastq_apipe_cl(sdf_file, start=None, end=None):
 """Return a command lines to provide streaming fastq input. For paired end, returns a forward and reverse command line. For single end returns a single command line and None for the pair. """

    cmd = ["rtg", "sdf2fastq", "--no-gzip", "-o", "-"]
    if start is not None:
        cmd += ["--start-id=%s" % start]
    if end is not None:
        cmd += ["--end-id=%s" % end]
    if is_paired(sdf_file):
        out = []
        for ext in ["left", "right"]:
            out.append("<(%s)" % _rtg_cmd(cmd + ["-i", os.path.join(sdf_file, ext)]))
        return out
    else:
        cmd += ["-i", sdf_file]
        return ["<(%s)" % _rtg_cmd(cmd), None]