def apply(self):
        """
        Rewrite all matching getitems as static_getitems where the index
        is the literal value of the string.
        """
        new_block = ir.Block(self.block.scope, self.block.loc)
        for inst in self.block.body:
            if isinstance(inst, ir.Assign):
                expr = inst.value
                if expr in self.getitems:
                    const, lit_val = self.getitems[expr]
                    new_expr = ir.Expr.static_getitem(value=expr.value,
                                                      index=lit_val,
                                                      index_var=expr.index,
                                                      loc=expr.loc)
                    self.calltypes[new_expr] = self.calltypes[expr]
                    inst = ir.Assign(value=new_expr, target=inst.target,
                                     loc=inst.loc)
            new_block.append(inst)
        return new_block

        Rewrite all matching getitems as static_getitems where the index
        is the literal value of the string.
        
numba/core/rewrites/static_getitem.py