def write_pid(pidfile):
    server_logger.info("Writing pid file")
    piddir = os.path.dirname(pidfile)
    if piddir != '':
        try:
            os.makedirs(piddir)
        except __HOLE__:
            pass

    with open(pidfile, 'w') as fobj:
        fobj.write(str(os.getpid()))
dataset/ETHPy150Open spotify/luigi/luigi/process.py/write_pid