importos.pathDELETE_MARKER_MESSAGE='''\This file is placed here by pip to indicate the source was puthere by pip.Once this package is successfully installed this source code will bedeleted (unless you remove this file).'''PIP_DELETE_MARKER_FILENAME='pip-delete-this-directory.txt'defhas_delete_marker_file(directory):# type: (str) -> boolreturnos.path.exists(os.path.join(directory,PIP_DELETE_MARKER_FILENAME))defwrite_delete_marker_file(directory):# type: (str) -> None""" Write the pip delete marker file into this directory. """filepath=os.path.join(directory,PIP_DELETE_MARKER_FILENAME)withopen(filepath,'w')asmarker_fp:marker_fp.write(DELETE_MARKER_MESSAGE)