def load(self, config_path=None):
self._reset_config()<EOL>if not config_path:<EOL><INDENT>config_path = os.path.join(<EOL>appdirs.user_config_dir(self._app_name),<EOL>self._config_file<EOL>)<EOL><DEDENT>try:<EOL><INDENT>if hasattr(config_path, '<STR_LIT>'):<EOL><INDENT>config = yaml.safe_load(config_path)<EOL><DEDENT>else:<EOL><INDENT>with open(config_path, '<STR_LIT:rb>') as config_file:<EOL><INDENT>config = yaml.safe_load(config_file)<EOL><DEDENT><DEDENT><DEDENT>except EnvironmentError:<EOL><INDENT>raise exceptions.ConfigNotFoundError('<STR_LIT>'.format(<EOL>config_path=str(config_path),<EOL>))<EOL><DEDENT>except yaml.YAMLError:<EOL><INDENT>raise exceptions.ConfigSyntaxError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in config:<EOL><INDENT>self._printer_config = config['<STR_LIT>']<EOL>self._printer_name = self._printer_config.pop('<STR_LIT:type>').title()<EOL>if not self._printer_name or not hasattr(printer, self._printer_name):<EOL><INDENT>raise exceptions.ConfigSyntaxError(<EOL>'<STR_LIT>'.format(<EOL>printer_name=self._printer_name,<EOL>)<EOL>)<EOL><DEDENT><DEDENT>self._has_loaded = True<EOL>
Load and parse the configuration file using pyyaml

        :param config_path: An optional file path, file handle, or byte string
            for the configuration file.