code: def load(self, config_path=None):
          
  
          self._reset_config()
  
          if not config_path:
              config_path = os.path.join(
                  appdirs.user_config_dir(self._app_name),
                  self._config_file
              )
  
          try:
              # First check if it's file like. If it is, pyyaml can load it.
              # I'm checking type instead of catching exceptions to keep the
              # exception handling simple
              if hasattr(config_path, 'read'):
                  config = yaml.safe_load(config_path)
              else:
                  # If it isn't, it's a path. We have to open it first, otherwise
                  # pyyaml will try to read it as yaml
                  with open(config_path, 'rb') as config_file:
                      config = yaml.safe_load(config_file)
          except EnvironmentError:
              raise exceptions.ConfigNotFoundError('Couldn\'t read config at {config_path}'.format(
                  config_path=str(config_path),
              ))
          except yaml.YAMLError:
              raise exceptions.ConfigSyntaxError('Error parsing YAML')
  
          if 'printer' in config:
              self._printer_config = config['printer']
              self._printer_name = self._printer_config.pop('type').title()
  
              if not self._printer_name or not hasattr(printer, self._printer_name):
                  raise exceptions.ConfigSyntaxError(
                      'Printer type "{printer_name}" is invalid'.format(
                          printer_name=self._printer_name,
                      )
                  )
  
          self._has_loaded = True
docs: Load and parse the configuration file using pyyaml
  
          :param config_path: An optional file path, file handle, or byte string
              for the configuration file.