def ctime(timestamp=None):
    if timestamp is None:
        timestamp = date().getTime() / 1000.
    d = date(0)
    d.setUTCSeconds(timestamp)
    jan = date(d.getFullYear(), 0, 1)
    jul = date(d.getFullYear(), 6, 1)
    dst = int(d.getTimezoneOffset() < max(jan.getTimezoneOffset(), jul.getTimezoneOffset()))
    d = date(0)
    d.setUTCSeconds(timestamp + (1 + dst) * 3600)
    weekdays = {1: "Mon", 2: "Tue", 3: "Wed", 4: "Thu", 
                5: "Fri", 6: "Sat", 0: "Sun"}
    months = {0:'Jan',1:'Feb',2:'Mar',3:'Apr',4:'May',5:'Jun',
        6:'Jul',7:'Aug',8:'Sep',9:'Oct',10:'Nov',11:'Dec'}
    result = "%s %s %2d %02d:%02d:%02d %d" % (weekdays[d.getUTCDay()],
        months[d.getUTCMonth()], d.getUTCDate(),
        d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), 
        d.getUTCFullYear())
    return result
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/time.py/ctime/original