code: def is_file_exists_error(e):
      
      if six.PY3:
          return isinstance(e, FileExistsError)  # noqa: F821
      else:
          return isinstance(e, OSError) and e.errno == 17
docs: Returns whether the exception *e* was raised due to an already existing file or directory.