<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _setting(self, key, default):
 """Return the setting, checking config, then the appropriate environment variable, falling back to the default, caching the results. :param str key: The key to get :param any default: The default value if not set :return: str """

        if key not in self._settings:
            value = self._settings_in.get(
                key, os.environ.get('STATSD_{}'.format(key).upper(), default))
            self._settings[key] = value
        return self._settings[key]