<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def interbase_range_affected_by_variant_on_transcript(variant, transcript):
 """ Convert from a variant's position in global genomic coordinates on the forward strand to an interval of interbase offsets on a particular transcript's mRNA. Parameters variant : varcode.Variant transcript : pyensembl.Transcript Assumes that the transcript overlaps the variant. Returns (start, end) tuple of offsets into the transcript's cDNA sequence which indicates which bases in the reference sequence are affected by a variant. Example: The insertion of "TTT" into the middle of an exon would result in an offset pair such as (100,100) since no reference bases are changed or deleted by an insertion. On the other hand, deletion the preceding "CGG" at that same locus could result in an offset pair such as (97, 100) """

    if variant.is_insertion:
        if transcript.strand == "+":
            # base-1 position of an insertion is the genomic nucleotide
            # before any inserted mutant nucleotides, so the start offset
            # of the actual inserted nucleotides is one past that reference
            # position
            start_offset = transcript.spliced_offset(variant.start) + 1
        else:
            # on the negative strand the genomic base-1 position actually
            # refers to the transcript base *after* the insertion, so we can
            # use that as the interbase coordinate for where the insertion
            # occurs
            start_offset = transcript.spliced_offset(variant.start)
        # an insertion happens *between* two reference bases
        # so the start:end offsets coincide
        end_offset = start_offset
    else:
        # reference bases affected by substitution or deletion defined by
        # range starting at first affected base
        offsets = []
        assert len(variant.ref) > 0
        for dna_pos in range(variant.start, variant.start + len(variant.ref)):
            try:
                offsets.append(transcript.spliced_offset(dna_pos))
            except ValueError:
                logger.info(
                    "Couldn't find position %d from %s on exons of %s",
                    dna_pos,
                    variant,
                    transcript)
        if len(offsets) == 0:
            raise ValueError(
                "Couldn't find any exonic reference bases affected by %s on %s",
                variant,
                transcript)
        start_offset = min(offsets)
        end_offset = max(offsets) + 1
    return (start_offset, end_offset)