import random


def random_sequence(length=11, template='ACGT'):
    """
    Generate random sequence of specified length.

    Args:
        length (int): Length of random sequence to generate.
        template (str): String with bases to use in generating sequence.

    Example:
        >>> sequtils.random_sequence()
        CGGACGGTATG
        >>> sequtils.random_sequence(length=5, template='AC')
        CCCAA
    """
    tlen = len(template)
    seq = ''
    for i in range(0, length):
        seq += template[int(random.random() * tlen)]
    return seq