def get(self, var, section=None, **kwargs):
<EOL>if not section and self.section:<EOL><INDENT>section = self.section<EOL><DEDENT>default = kwargs.get('<STR_LIT:default>', None)<EOL>env_var = "<STR_LIT>".format(<EOL>_suffix(self.prefix) if self.prefix else '<STR_LIT>',<EOL>_suffix(alphasnake(section)) if section else '<STR_LIT>',<EOL>alphasnake(str(var))<EOL>).upper()<EOL>config = self.config.get(section, {}) if section else self.config<EOL>result = config.get(var, default)<EOL>result = os.getenv(env_var, default=result)<EOL>if result is None and '<STR_LIT:default>' not in kwargs:<EOL><INDENT>msg = "<STR_LIT>".format(var)<EOL>if section:<EOL><INDENT>msg = "<STR_LIT>".format(<EOL>msg, section<EOL>)<EOL><DEDENT>msg = "<STR_LIT>".format(msg, env_var)<EOL>if self.config_file:<EOL><INDENT>msg = "<STR_LIT>".format(msg, self.config_file)<EOL><DEDENT>raise ConfigError(msg)<EOL><DEDENT>return result<EOL>
Retrieve a config var.
        Return environment variable if it exists
        (ie [self.prefix + _] + [section + _] + var)
        otherwise var from config file.

        If both are null and no default is set a ConfigError will be raised,
        otherwise default will be returned.

        :param var: key to look up
        :param default: default value, must be supplied as keyword