def _get_config(self, node):
if self._run_conf.config is None:<EOL><INDENT>log.debug('<STR_LIT>')<EOL>config = self._get_config_by_discovery(node)<EOL><DEDENT>else:<EOL><INDENT>log.debug('<STR_LIT>', self._run_conf.config)<EOL>if not os.path.exists(self._run_conf.config):<EOL><INDENT>raise IllegalConfiguration('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(self._run_conf.config))<EOL><DEDENT>if None in self._cache:<EOL><INDENT>return self._cache[None]<EOL><DEDENT>options, _ = self._read_configuration_file(self._run_conf.config)<EOL>if options is None:<EOL><INDENT>log.warning('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>config = self._create_check_config(self._options)<EOL><DEDENT>else:<EOL><INDENT>config = self._create_check_config(options)<EOL><DEDENT><DEDENT>final_config = {}<EOL>for attr in CheckConfiguration._fields:<EOL><INDENT>cli_val = getattr(self._override_by_cli, attr)<EOL>conf_val = getattr(config, attr)<EOL>final_config[attr] = cli_val if cli_val is not None else conf_val<EOL><DEDENT>config = CheckConfiguration(**final_config)<EOL>self._set_add_options(config.checked_codes, self._options)<EOL>if self._run_conf.config is not None:<EOL><INDENT>self._cache[None] = config<EOL><DEDENT>else:<EOL><INDENT>self._cache[self._get_node_dir(node)] = config<EOL><DEDENT>return config<EOL>
Get and cache the run configuration for `node`.

        If no configuration exists (not local and not for the parent node),
        returns and caches a default configuration.

        The algorithm:
        -------------
        * If the current directory's configuration exists in
           `self._cache` - return it.
        * If a configuration file does not exist in this directory:
          * If the directory is not a root directory:
            * Cache its configuration as this directory's and return it.
          * Else:
            * Cache a default configuration and return it.
        * Else:
          * Read the configuration file.
          * If a parent directory exists AND the configuration file
            allows inheritance:
            * Read the parent configuration by calling this function with the
              parent directory as `node`.
            * Merge the parent configuration with the current one and
              cache it.
        * If the user has specified one of `BASE_ERROR_SELECTION_OPTIONS` in
          the CLI - return the CLI configuration with the configuration match
          clauses
        * Set the `--add-select` and `--add-ignore` CLI configurations.