@rbac(('owner', 'user'))
    def set_flattened_value(self, path, value):
        obj, restofpath = proxy_parent(self, path)
        # if restofpath is truthy, it means either that path
        # contains a proxy or it contains some syntax that causes
        # getattr to fail, e.g., a function eval, array element ref, etc.
        if restofpath and IContainerProxy.providedBy(obj):
            obj.set_flattened_value(restofpath, value)
            return

        # get current value
        val = self.get(path)
        if not isinstance(val, int_types) and isinstance(val, complex_or_real_types):
            self.set(path, value[0])
            return
        elif hasattr(val, 'set_flattened_value'):
            val.set_flattened_value(value)
            return
        elif isinstance(val, ndarray):
            try:
                newshape = value.shape
                self.set(path, value.reshape(val.shape))
            except Exception as err:
                self.reraise_exception("ERROR setting value '%s.%s' shape: %s to shape %s"
                                       % (self.get_pathname(), path, val.shape, newshape),
                                          sys.exc_info())
            return

        # now get the non-indexed value and the index
        val = self.get(path.split('[',1)[0])
        idx = get_index(path)

        if isinstance(val, int_types):
            pass  # fall through to exception
        elif hasattr(val, '__setitem__') and idx is not None:
            if isinstance(val[idx], complex_or_real_types):
                val[idx] = value[0]
            else:
                val[idx] = value
            return
        elif IVariableTree.providedBy(val):
            raise NotImplementedError("no support for setting flattened values into vartrees")
        elif hasattr(val, 'set_flattened_value'):
            val.set_flattened_value(value)
            return

        self.raise_exception(path % "Failed to set flattened value to variable %s", TypeError)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/container.py/Container.set_flattened_value/swapped operands of `%`