def create_static_file(file, permission=None, replacements=None):
    """
    Copies the static resource file to the newly created project.
    """
    if os.path.sep in file:
        file_name = file[file.rfind(os.path.sep):]
    else:
        file_name = file
    res_file = resource_string('spark_package.resources', file_name).decode("utf-8")
    if replacements is not None:
        for placeholder, value in replacements:
            res_file = res_file.replace(placeholder, value)
    f = open(file, 'w')
    f.write(res_file)
    f.close()
    if permission is not None:
        os.chmod(file, permission)
dataset/ETHPy150Open databricks/spark-package-cmd-tool/python/spark_package/spark_package.py/create_static_file/original