

def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, source, depth=1, compiled=False):
    unlink = []
    init_name = make_script(zip_dir, '__init__', '')
    unlink.append(init_name)
    init_basename = os.path.basename(init_name)
    script_name = make_script(zip_dir, script_basename, source)
    unlink.append(script_name)
    if compiled:
        init_name = compile_script(init_name)
        script_name = compile_script(script_name)
        unlink.extend((init_name, script_name))
    pkg_names = [os.sep.join(([pkg_name] * i)) for i in range(1, (depth + 1))]
    script_name_in_zip = os.path.join(pkg_names[(- 1)], os.path.basename(script_name))
    zip_filename = ((zip_basename + os.extsep) + 'zip')
    zip_name = os.path.join(zip_dir, zip_filename)
    zip_file = zipfile.ZipFile(zip_name, 'w')
    for name in pkg_names:
        init_name_in_zip = os.path.join(name, init_basename)
        zip_file.write(init_name, init_name_in_zip)
    zip_file.write(script_name, script_name_in_zip)
    zip_file.close()
    for name in unlink:
        os.unlink(name)
    return (zip_name, os.path.join(zip_name, script_name_in_zip))

dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/script_helper.py make_zip_pkg/original