MCPcopy Index your code
hub / github.com/CandleLabAI/PCBSegClassNet / dict2str

Function dict2str

src/utils/options.py:47–63  ·  view source on GitHub ↗

dict to string for printing options. Args: opt (dict): Option dict. indent_level (int): Indent level. Default: 1. Return: (str): Option string for printing.

(opt, indent_level=1)

Source from the content-addressed store, hash-verified

45
46
47def dict2str(opt, indent_level=1):
48 """dict to string for printing options.
49 Args:
50 opt (dict): Option dict.
51 indent_level (int): Indent level. Default: 1.
52 Return:
53 (str): Option string for printing.
54 """
55 msg = "\n"
56 for k, v in opt.items():
57 if isinstance(v, dict):
58 msg += " " * (indent_level * 2) + k + ":["
59 msg += dict2str(v, indent_level + 1)
60 msg += " " * (indent_level * 2) + "]\n"
61 else:
62 msg += " " * (indent_level * 2) + k + ": " + str(v) + "\n"
63 return msg
64
65
66def get_msg():

Callers 2

init_logFunction · 0.90
init_logFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected