def _triplet_with_context(seq: str, i: int):
    """Return the ith triplet in a sequence with the
    previous and following nucleotide

    Args:
        seq (str): Sequence
        i (int): 0-based index of the target triplet.

    Returns:
        str: The target triplet.
    """
    start = i * 3
    return seq[start-1:start+4]