def ohm_to_spec(ohm):
    """Creates a config spec from an OrderedHierarchicalMapping
    """
    spec_type = defaultdict(lambda: "string",
                            [(type(3), "integer"),
                             (type("bla"), "string"),
                             (type(True), "boolean"),
                             (type(3.14), "float"),
                             (tuple, "tuple")])

    value_transform = lambda value: (spec_type[type(value)] +
                                     (value % "(default=%s)"
                                      if not (isinstance(value, tuple) or
                                              isinstance(value, list))
                                      else "(default=list%s)" % str(
                                          tuple(value))))

    return ohm_to_spec_list(ohm, value_transform)
dataset/ETHPy150Open duerrp/pyexperiment/pyexperiment/utils/config_conversion.py/ohm_to_spec/swapped operands of `%`