'Get the value of a setting, or raise KeyError'

def get_setting(self, name):

    if (name == 'KEY'):
        return self.key
    if (name == 'SECRET'):
        if self.secret:
            return self.secret
        return getattr(settings, 'SOCIAL_AUTH_OAUTH_SECRETS', {}).get(self.backend_name, '')
    if self.other_settings:
        other_settings = json.loads(self.other_settings)
        assert isinstance(other_settings, dict), 'other_settings    should    be    a    JSON    object    (dictionary)'
        return other_settings[name]
    raise KeyError
