def METHOD_NAME(self, key, default_value=None):
    """
    A convenience method to extract a configuration value.
    :type key: str
    :param key: a field to look for in the ``self.config`` field
    :type default_value: anything
    :param default_value: the default value to return if a value for the
                          ``key`` is not available
    :return: a configuration value for the supplied ``key``
    """
    log.debug("Getting config key %s, with supplied default value: %s",
              key, default_value)
    value = default_value
    if isinstance(self.config, dict) and self.config.get(key):
        value = self.config.get(key, default_value)
    elif hasattr(self.config, key) and getattr(self.config, key):
        value = getattr(self.config, key)
    elif (self._config_parser.has_option(self.PROVIDER_ID, key) and
          self._config_parser.get(self.PROVIDER_ID, key)):
        value = self._config_parser.get(self.PROVIDER_ID, key)
    if isinstance(value, six.string_types) and not isinstance(
            value, six.text_type):
        return six.u(value)
    return value