def split_exon(exon, cds):
    """Takes an exon and a CDS, and returns a map of regions for each
    feature (UTR5/3, CDS) that may be inferred from the arguments.
    Note that the CDS is simply returned as is, to simplify
    downstream handling of these features."""
    results = [cds]

    if exon["start"] < cds["start"]:
        utr = dict(exon)
        utr.update(
            end=cds["start"] - 1, feature=(exon["strand"] == "+" and "UTR5" or "UTR3")
        )
        results.append(utr)

    if exon["end"] > cds["end"]:
        utr = dict(exon)
        utr.update(
            start=cds["end"] + 1, feature=(exon["strand"] == "+" and "UTR3" or "UTR5")
        )
        results.append(utr)

    return results