<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid_timestamp(date, unit='millis'):
 """ Checks that a number that represents a date as milliseconds is correct. """

    assert isinstance(date, int), "Input is not instance of int"

    if unit is 'millis':
        return is_positive(date) and len(str(date)) == 13
    elif unit is 'seconds':
        return is_positive(date) and len(str(date)) == 10
    else:
        raise ValueError('Unknown unit "%s"' % unit)