def datetime_ceil(dateval):
    """
    Rounds the given datetime object upwards.

    :type dateval: datetime

    """
    if dateval.microsecond > 0:
        return dateval + timedelta(seconds=1, microseconds=-dateval.microsecond)
    return dateval
dataset/ETHPy150Open agronholm/apscheduler/apscheduler/util.py/datetime_ceil/original