def format_structure(instance):
    """
    Returns a string representation for the structure
    """
    if hasattr(instance, "_fields_"):
        out = []
        for field in instance._fields_:
            out.append((field[0], getattr(instance, field[0], None)) % "[%s: %s]")
        return "".join(out)
    else:
        raise ValueError("Passed argument is not a structure!")
dataset/ETHPy150Open FinalTheory/wireless-network-reproduction/macdivert/models.py/format_structure/swapped operands of `%`