parameters: (self, zip_path)
docstring: Check if the ZIP file contains another file with the same name, so it is going to be overwritten.
          @param zip_path: zip file path
          @return: comparison boolean
docstring_summary: Check if the ZIP file contains another file with the same name, so it is going to be overwritten.
docstring_tokens: Check if the ZIP file contains another file with the same name so it is going to be overwritten .
function: def is_overwritten(self, zip_path):
          """Check if the ZIP file contains another file with the same name, so it is going to be overwritten.
          @param zip_path: zip file path
          @return: comparison boolean
          """
          with ZipFile(zip_path, "r") as archive:
              try:
                  # Test if zip file contains a file named as itself.
                  for name in archive.namelist():
                      if name == os.path.basename(zip_path):
                          return True
                  return False
              except BadZipfile:
                  raise CuckooPackageError("Invalid Zip file")
function_tokens: def is_overwritten ( self , zip_path ) : with ZipFile ( zip_path , "r" ) as archive : try : # Test if zip file contains a file named as itself. for name in archive . namelist ( ) : if name == os . path . basename ( zip_path ) : return True return False except BadZipfile : raise CuckooPackageError ( "Invalid Zip file" )