parameters: (self, path)
docstring: If the target file exists, check if it can be opened for writing
docstring_summary: If the target file exists, check if it can be opened for writing
docstring_tokens: If the target file exists check if it can be opened for writing
function: def is_writable(self, path):
          """If the target file exists, check if it can be opened for writing"""
          try:
              if not os.path.exists(path):
                  '''Path doesn't exist, assume writable'''
                  return True
              if os.access(path, os.W_OK):
                  '''File is writable'''
                  return True
              return False
          except:
              return False
function_tokens: def is_writable ( self , path ) : try : if not os . path . exists ( path ) : '''Path doesn't exist, assume writable''' return True if os . access ( path , os . W_OK ) : '''File is writable''' return True return False except : return False