def cast(self, builder, val, fromty, toty):
        """
        Cast a value of type *fromty* to type *toty*.
        This implements implicit conversions as can happen due to the
        granularity of the Numba type system, or lax Python semantics.
        """
        if fromty == toty or toty == types.Any:
            return val
        try:
            impl = self._casts.find((fromty, toty))
            return impl(self, builder, fromty, toty, val)
        except __HOLE__:
            raise NotImplementedError(
                "Cannot cast %s to %s: %s" % (fromty, toty, val))
dataset/ETHPy150Open numba/numba/numba/targets/base.py/BaseContext.cast