'Infer a constant value for the given variable *name*.
If no value can be inferred, numba.errors.ConstantInferenceError
is raised.'

def infer_constant(self, name):

    if (name not in self._cache):
        try:
            self._cache[name] = (True, self._do_infer(name))
        except ConstantInferenceError as exc:
            self._cache[name] = (False, (exc.__class__, exc.args))
    (success, val) = self._cache[name]
    if success:
        return val
    else:
        (exc, args) = val
        raise exc(*args)
