

def create_mock_ssh_script(path):
    'Dump a wrapper script to the given file object that runs this\n    python script.'
    with open(path, 'w') as f:
        f.write('#!/bin/sh\n')
        f.write(('%s %s "$@"\n' % (pipes.quote(sys.executable), pipes.quote(os.path.abspath(__file__)))))
    os.chmod(path, (stat.S_IREAD | stat.S_IEXEC))

dataset/ETHPy150Open Yelp/mrjob/tests/mockssh.py create_mock_ssh_script/original