def _check_scheme(self, config):
try:<EOL><INDENT>scheme = config.get(<EOL>escape_for_ini('<STR_LIT>'),<EOL>escape_for_ini('<STR_LIT>'),<EOL>)<EOL><DEDENT>except (configparser.NoSectionError, configparser.NoOptionError):<EOL><INDENT>raise AttributeError("<STR_LIT>")<EOL><DEDENT>if scheme.startswith('<STR_LIT>'):<EOL><INDENT>scheme = scheme[<NUM_LIT:9>:]<EOL><DEDENT>if scheme != self.scheme:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % (self.scheme, scheme))<EOL><DEDENT>
check for a valid scheme

raise ValueError otherwise
raise AttributeError if missing