def METHOD_NAME(self, formula):
    if self.type == 'tex':
        return
    hash = hashlib.sha1(utf8bytes(formula)).hexdigest()
    formula = utf8text(formula)
    if self.cache.has_file(hash, 'css'):
        result = self.query_cache(hash)
    else:
        result = self.query_mathoid(formula, hash)
    if not result:
        return None
    result['tex'] = formula
    result['display'] = formula.startswith(r'\displaystyle')
    return {
        'mml': self.output_mml,
        'jax': self.output_jax,
        'svg': self.output_svg,
        'raw': lambda x: x,
    }[self.type](result)