MCPcopy
hub / github.com/celery/celery / pretty

Function pretty

celery/utils/text.py:103–113  ·  view source on GitHub ↗

Format value for printing to console.

(value: str, width: int = 80, nl_width: int = 80, sep: str = '\n', **
           kw: Any)

Source from the content-addressed store, hash-verified

101
102
103def pretty(value: str, width: int = 80, nl_width: int = 80, sep: str = '\n', **
104 kw: Any) -> str:
105 """Format value for printing to console."""
106 if isinstance(value, dict):
107 return f'{sep} {pformat(value, 4, nl_width)[1:]}'
108 elif isinstance(value, tuple):
109 return '{}{}{}'.format(
110 sep, ' ' * 4, pformat(value, width=nl_width, **kw),
111 )
112 else:
113 return pformat(value, width=width, **kw)
114
115
116def match_case(s: str, other: str) -> str:

Callers 2

test_prettyFunction · 0.90
humanizeMethod · 0.90

Calls 1

formatMethod · 0.45

Tested by 1

test_prettyFunction · 0.72