

def gen_datetime(min_date=None, max_date=None):
    'Returns a random datetime value\n\n    :param min_date: A valid ``datetime.datetime`` object.\n    :param max_date: A valid ``datetime.datetime`` object.\n    :raises: ``ValueError`` if arguments are not valid ``datetime.datetime``\n        objects.\n    :returns: Random ``datetime.datetime`` object.\n\n    '
    _min_value = (datetime.datetime.now() - datetime.timedelta((365 * MIN_YEARS)))
    _max_value = (datetime.datetime.now() + datetime.timedelta((365 * MAX_YEARS)))
    if (min_date is None):
        min_date = _min_value
    if (max_date is None):
        max_date = _max_value
    if (not isinstance(min_date, datetime.datetime)):
        raise ValueError('%s is not a valid datetime.datetime object')
    if (not isinstance(max_date, datetime.datetime)):
        raise ValueError('%s is not a valid datetime.datetime object')
    assert (min_date < max_date)
    random.seed()
    diff = (max_date - min_date)
    seconds = random.randint(0, (((diff.days * 3600) * 24) + diff.seconds))
    return (min_date + datetime.timedelta(seconds=seconds))

dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py gen_datetime/original