def METHOD_NAME(self, text):
    text = [tuple([x.lower() for x in z]) for z in text]
    if text[0] == ('http-equiv', 'content-type'):
        d = dict(text)
        if 'charset' in d:
            encoding = d['charset']
            error = FoundEncoding()
            error.encoding = encoding
            raise error
        if text[1][0] == 'content':
            encoding = re.search('charset.*=(.+)', text[1][1]).group(1)
            error = FoundEncoding()
            error.encoding = encoding
            raise error