@modifies
    @collective
    def set_local_diagonal_entries(self, rows, diag_val=1.0, idx=None):
        rows = np.asarray(rows, dtype=PETSc.IntType)
        rbs, _ = self.dims[0][0]
        # No need to set anything if we didn't get any rows.
        if len(rows) == 0:
            return
        if rbs > 1:
            if idx is not None:
                rows = rbs * rows + idx
            else:
                rows = np.dstack([rbs*rows + i for i in range(rbs)]).flatten()
        vals = np.repeat(diag_val, len(rows))
        closure = lambda: self.handle.setValuesLocalRCV(rows.reshape(-1, 1),
                                                        rows.reshape(-1, 1),
                                                        vals.reshape(-1, 1),
                                                        addv=PETSc.InsertMode.INSERT_VALUES)
        base._LazyMatOp(self, closure, new_state=Mat.INSERT_VALUES,
                        write=True).enqueue()
a.__xor__(b) <==> a^=b
dataset/ETHPy150Open OP2/PyOP2/pyop2/petsc_base.py/Mat.set_local_diagonal_entries--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/pymel/util/arrays.py/VectorN.__ixor__