def duplicate_status(seq1, seq2):
    """
    Determine if one sequence is a duplicate of another, and if so, whether     the duplicate is an exact match to or a prefix of the template sequence.

    A status of zero means not a duplicate, one means the second sequence is     an exact duplicate of the first, two means the second sequence is a     prefix of the first, and three means that the first sequence is a prefix     of the second.
    """
    seq1_len, seq2_len = len(seq1), len(seq2)
    if seq1_len == seq2_len:
        if seq1 == seq2:
            return 1
    elif seq1_len > seq2_len:
        if seq1[:seq2_len] == seq2:
            return 2
    elif seq1_len < seq2_len:
        if seq1 == seq2[:seq1_len]:
            return 3
    return 0
