def mock_ssh_file(host, path, contents):
    if not isinstance(contents, bytes):
        raise TypeError('mock SSH file contents must be bytes')

    path = rel_posix_to_abs_local(host, path)

    basename, name = os.path.split(path)
    if not os.path.exists(basename):
        os.makedirs(basename)

    with open(path, 'wb') as f:
        f.write(contents)
    return path
Create a directory at ``path`` relative to the temp directory for
dataset/ETHPy150Open Yelp/mrjob/tests/mockssh.py/mock_ssh_file