code: def is_writable(path):
      
      try:
          testfile = tempfile.TemporaryFile(dir=path)
          testfile.close()
      except OSError as e:
          if e.errno == errno.EACCES:  # 13
              return False
      return True
docs: Check if path has write access