def configure_output_dir(d=None):
    '\n    Set output directory to d, or to /tmp/somerandomnumber if d is None\n    '
    G.first_row = True
    G.log_headers = []
    G.log_current_row = {}
    G.output_dir = (d or ('/tmp/experiments/%i' % int(time.time())))
    if (not osp.exists(G.output_dir)):
        os.makedirs(G.output_dir)
    G.output_file = open(osp.join(G.output_dir, 'log.txt'), 'w')
    atexit.register(G.output_file.close)
    print(colorize(('Logging data to %s' % G.output_file.name), 'green', bold=True))
Set output directory to d, or to /tmp/somerandomnumber if d is None
def configure_output_dir(d=None):
    '\n    \n    '
    G.first_row = True
    G.log_headers = []
    G.log_current_row = {}
    G.output_dir = (d or ('/tmp/experiments/%i' % int(time.time())))
    if (not osp.exists(G.output_dir)):
        os.makedirs(G.output_dir)
    G.output_file = open(osp.join(G.output_dir, 'log.txt'), 'w')
    atexit.register(G.output_file.close)
    print(colorize(('Logging data to %s' % G.output_file.name), 'green', bold=True))