Esempio n. 1
0
def build(version=None):
    if not version:
        version = datetime.now().strftime('%m%d%H%M%S')

    _version = _Version()
    _version.set(['setup.py',env.SETTINGS_BASE],version)

    with settings(warn_only=True):
        local('python setup.py bdist_wheel upload -r internal')

    _version.revert()
Esempio n. 2
0
def markAttendance(name):
    with open('Attendance.csv', 'r+') as f:

        myDataList = f.readlines()
        nameList = []

        for line in myDataList:
            entry = line.split(',')
            nameList.append(entry[0])

        if name not in nameList:
            now = datetime.now()
            dtString = now.strftime('%H:%M:%S')
            f.writelines(f'\n{name},{dtString}')
Esempio n. 3
0
from datatime import datetime
print(datetime.now().strftime('Today is %Y-%m-%d'))
Esempio n. 4
0
                    state, dev_cost = sess.run(
                        [final_state, cost],
                        feed_dict={
                            input_data: batch_x,
                            target: batch_y,
                            rnn_initial_state: state,
                            keep_prob: 1.0
                        })
                    total_cost += dev_cost
                    step += 1

                total_cost = np.exp(total_cost / step)
                print("Dev Perplexity %f" % total_cost)
                tt += 1
                save_path = saver.save(sess, model_save_path)
                print("Checkpoint at " + str(datetime.now()))

            step = 0
            total_cost = 0.0
            while (step + 1) * batch_size * num_steps < len(test_data):
                batch_x, batch_y = get_batch(index3, test_data, wordid_map,
                                             step, batch_size, num_steps)
                state, test_cost = sess.run(
                    [final_state, cost],
                    feed_dict={
                        input_data: batch_x,
                        target: batch_y,
                        rnn_initial_state: state,
                        keep_prob: 1.0
                    })
                total_cost += test_cost
 def __init__(self, name=None, **kwargs):
     self.start_time = datetime.now()
''' 
format
'''
# The format() built-in function and the str.format() method delegate the actual formatting
# to each type by calling their .__format__(format_spec) method

# The format() method of a string can also access these methods. When we
# use {!r} or {!s} formatting, we're requesting __repr__() or __str__(),
# respectively.

# '1 BRL = {rate:0.2f} USD'.format(rate=brl)

from datatime import datetime

now = datetime.now()
format(now, '%H:%M:%S')
"It's now {:%I:%M %p}".format(now)
"{0:06.4f}"  # 06.4f is the format specification that applies to item 0 of the argument list to be formatted


# def format
def __format__(self, fmt_spec=''):
    components = (format(c, fmt_spec) for c in self)
    return '({},{})'.format(*components)


class Vector2d:
    typecode = 'd'

    def __init__(self, x, y):
Esempio n. 7
0
def write_event(log, step: int, **data):
    data['step'] = step
    data['dt'] = datetime.now().isoformat()
    log.write(json.dumps(data, sort_keys=True))
    log.write('\n')
    log.flush()
Esempio n. 8
0
def current_month_num():
    return int(datetime.now().strftime('%m'))