original_docstring: Force creation of file at path and open it.
docstring: Force creation of file at path and open it.
docstring_tokens: Force creation of file at path and open it .
code: def _open_file_force_create(path, mode="w"):
      """Force creation of file at path and open it."""
      try:
          os.makedirs(os.path.dirname(path))
      except OSError as error:
          if error.errno != errno.EEXIST:
              raise error
  
      with open(os.path.join(os.path.dirname(path), "__init__.py"), "w"):
          pass
  
      return open(path, mode)
code_tokens: def _open_file_force_create ( path , mode = "w" ) : try : os . makedirs ( os . path . dirname ( path ) ) except OSError as error : if error . errno != errno . EEXIST : raise error with open ( os . path . join ( os . path . dirname ( path ) , "__init__.py" ) , "w" ) : pass return open ( path , mode )
short_docstring: Force creation of file at path and open it.
short_docstring_tokens: Force creation of file at path and open it .
comment: """Force creation of file at path and open it."""