parameters: (path)
docstring: Create a file if it doesn't exist and open for reading and writing.
docstring_summary: Create a file if it doesn't exist and open for reading and writing.
docstring_tokens: Create a file if it doesn t exist and open for reading and writing .
function: def _create_carefully(path):
      """Create a file if it doesn't exist and open for reading and writing."""
      fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0666)
      try:
          return open(path, 'rb+')
      finally:
          os.close(fd)
function_tokens: def _create_carefully ( path ) : fd = os . open ( path , os . O_CREAT | os . O_EXCL | os . O_RDWR , 0666 ) try : return open ( path , 'rb+' ) finally : os . close ( fd )