

def write_to_hdf5(group, name, value):
    filename = group.file.filename
    if isinstance(value, dict):
        dict_grp = group[k]
        for (k, v) in value.items():
            write_to_hdf5(dict_grp, k, v)
    elif isinstance(value, VariableTree):
        vtree_grp = group[name]
        for k in value.list_vars():
            write_to_hdf5(vtree_grp, k, value.get(k))
    elif isinstance(value, np.ndarray):
        dset = group[name]
        dset[:] = value[:]
    elif isinstance(value, list):
        if (len(value) > 0):
            if isinstance(value[0], str):
                dset = group[name]
                for (i, v) in enumerate(value):
                    dset[i] = value[i]
        else:
            pass
    elif (value == None):
        pass
    elif isinstance(value, (np.float64, float)):
        dset = group[name]
        dset[()] = value
    elif isinstance(value, int):
        dset = group[name]
        dset[()] = value
    elif isinstance(value, str):
        dset = group[name]
        dset[()] = value
        sys.stdout.flush()
    elif isinstance(value, bool):
        dset = group[name]
        dset[()] = value

dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/hdf5case.py write_to_hdf5/VarMisuse@36/43 `name`->`k`