def parse_repeat(n, msg) -> tuple:
    """
    Parse the argument for the repeat command.
    :param n: the number of times of repeat.
    :param msg: the message to be repeated.
    :return: (number of times of repeat, message to be repeated)
    :raises ValueError:
        if n is not an integre between 1 and 5, or msg is None,
        or len(msg) > 2000.
    """
    try:
        n = int(n)
        if not 1 <= n <= 5:
            raise ValueError
    except (TypeError, ValueError):
        raise ValueError('Please enter a number between 1 and 5.')
    if not msg or len(msg) > 2000:
        raise ValueError('Please enter a message with length less than 2000 '
                         'for me to repeat.')
    return n, msg