<commit_before>#!/usr/bin/env python

import os
import atexit
import logging
import time

#### Python Pillar client
# Creates pid file
PID_PATH = '/tmp/pillar'
pid = str(os.getpid())
pidfile = "%s/pillar.%s.pid" % (PID_PATH, pid)
if os.path.isfile(pidfile):
    print "%s already exists, exiting" % pidfile
    sys.exit()
else:
    file(pidfile, 'w').write(pid)
def on_exit():
    os.unlink(pidfile)


atexit.register(on_exit)
####


#### Actual worker code
print "python %s" % os.environ.get('MY_ENV')<commit_msg>updated python time<commit_after>#!/usr/bin/env python

import os
import atexit
import logging
import time
import sys
import signal

#### Python Pillar client
# Creates pid file
PID_PATH  = '/tmp/pillar'
WORKER_ID = os.environ.get('WORKER_ID')
pid = str(os.getpid())
pidfile = "%s/pillar.%s.pid" % (PID_PATH, WORKER_ID)
if os.path.isfile(pidfile):
    print "%s already exists, exiting" % pidfile
    sys.exit()
else:
    file(pidfile, 'w').write(pid)

def cleanup(*args):
    # print "Removing file %s" % pidfile
    if os.path.exists(pidfile):
        os.remove(pidfile)
    sys.exit()

# atexit.register(cleanup)
signal.signal(signal.SIGTERM, cleanup)
####


#### Actual worker code
print "python %s" % os.environ.get('MY_ENV')
{'fraction_non_alphanumeric': 0.15836012861736334, 'fraction_numerical': 0.0, 'mean_word_length': 4.253164556962025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2845015', 'n_tokens_mistral': 471, 'n_tokens_neox': 450, 'n_words': 111}