nodes: 0, module; 1, function_definition; 2, function_name:open; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, dictionary_splat_pattern; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, return_statement; 13, identifier:mode; 14, None; 15, identifier:ac_parser; 16, None; 17, identifier:options; 18, comment:"""
      Open given configuration file with appropriate open flag.
  
      :param path: Configuration file path
      :param mode:
          Can be 'r' and 'rb' for reading (default) or 'w', 'wb' for writing.
          Please note that even if you specify 'r' or 'w', it will be changed to
          'rb' or 'wb' if selected backend, xml and configobj for example, for
          given config file prefer that.
      :param options:
          Optional keyword arguments passed to the internal file opening APIs of
          each backends such like 'buffering' optional parameter passed to
          builtin 'open' function.
  
      :return: A file object or None on any errors
      :raises: ValueError, UnknownProcessorTypeError, UnknownFileTypeError
      """; 19, assignment; 20, boolean_operator; 21, block; 22, call; 23, identifier:psr; 24, call; 25, comparison_operator:mode is not None; 26, call; 27, return_statement; 28, attribute; 29, argument_list; 30, identifier:find; 31, argument_list; 32, identifier:mode; 33, None; 34, attribute; 35, argument_list; 36, call; 37, identifier:psr; 38, identifier:ropen; 39, identifier:path; 40, dictionary_splat; 41, identifier:path; 42, keyword_argument; 43, identifier:mode; 44, identifier:startswith; 45, string; 46, attribute; 47, argument_list; 48, identifier:options; 49, identifier:forced_type; 50, identifier:ac_parser; 51, string_content:w; 52, identifier:psr; 53, identifier:wopen; 54, identifier:path; 55, dictionary_splat; 56, identifier:options
code: def open(path, mode=None, ac_parser=None, **options):
      """
      Open given configuration file with appropriate open flag.
  
      :param path: Configuration file path
      :param mode:
          Can be 'r' and 'rb' for reading (default) or 'w', 'wb' for writing.
          Please note that even if you specify 'r' or 'w', it will be changed to
          'rb' or 'wb' if selected backend, xml and configobj for example, for
          given config file prefer that.
      :param options:
          Optional keyword arguments passed to the internal file opening APIs of
          each backends such like 'buffering' optional parameter passed to
          builtin 'open' function.
  
      :return: A file object or None on any errors
      :raises: ValueError, UnknownProcessorTypeError, UnknownFileTypeError
      """
      psr = find(path, forced_type=ac_parser)
  
      if mode is not None and mode.startswith('w'):
          return psr.wopen(path, **options)
  
      return psr.ropen(path, **options)