def METHOD_NAME(self, a, indices, b=None):
    # todo handle setting duplicated keys, a separate operand may be needed
    if b is None:
        a[indices] = self(a[indices])
    else:
        a[indices] = self(a[indices], b)