def METHOD_NAME(self, formula, hash):
    self.cache.create(hash)
    try:
        response = requests.post(self.mathoid_url, data={
            'q': reescape.sub(lambda m: '\\' + m.group(0), formula).encode('utf-8'),
            'type': 'tex' if formula.startswith(r'\displaystyle') else 'inline-tex',
        })
        response.raise_for_status()
        data = response.json()
    except requests.ConnectionError:
        logger.exception('Failed to connect to mathoid for: %s', formula)
        return
    except requests.HTTPError as e:
        logger.error('Mathoid failed to render: %s\n%s', formula, e.response.text)
        return
    except Exception:
        logger.exception('Failed to connect to mathoid for: %s', formula)
        return
    if not data['success']:
        logger.error('Mathoid failure for: %s\n%s', formula, data)
        return
    if any(i not in data for i in ('mml', 'svg', 'mathoidStyle')):
        logger.error('Mathoid did not return required information (mml, svg, mathoidStyle needed):\n%s', data)
        return
    css = data['mathoidStyle']
    mml = data['mml']
    result = {
        'css': css,
        'mml': mml,
        'svg': self.cache.cache_data(hash, 'svg', data['svg'].encode('utf-8')),
    }
    self.cache.cache_data(hash, 'mml', mml.encode('utf-8'), url=False, gzip=False)
    self.cache.cache_data(hash, 'css', css.encode('utf-8'), url=False, gzip=False)
    return result