def _set(self, assembly, name, value):
        """ Set `name` in `assembly` to `value`. """
        # Translating unicode to str to avoid issues like pyOpt option checks.
        if isinstance(value, dict):
            curr = assembly.get(name)
            if isinstance(curr, VariableTree):
                for key, val in value.items():
                    self._set(assembly, '.'.join((name, key)), val)
            elif '[' in name:
                if isinstance(value, unicode):
                    value = str(value)
                exec('assembly.%s = value' % name, _GLOBAL_DICT, locals())
            else:
                for key, val in value.items():
                    if isinstance(val, unicode):
                        value[key] = str(val)
                assembly.set(name, value)
        else:
            if isinstance(value, unicode):
                value = str(value)
            if '[' in name:
                exec('assembly.%s = value' % name, _GLOBAL_DICT, locals())
            else:
                assembly.set(name, value)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/query_hdf5.py/CaseDatasetHDF5._set/original