MCPcopy Index your code
hub / github.com/apache/tvm / _format

Function _format

python/tvm/script/highlight.py:164–185  ·  view source on GitHub ↗

Format a code string using Black. Parameters ---------- code_str: str The string containing Python/TVMScript code to format formatter: Optional[str] The formatter to use. Can specify `ruff`, `black`, or auto-select by passing `None`. Returns ----

(code_str: str, formatter: str | None = None)

Source from the content-addressed store, hash-verified

162
163
164def _format(code_str: str, formatter: str | None = None) -> str:
165 """Format a code string using Black.
166
167 Parameters
168 ----------
169 code_str: str
170
171 The string containing Python/TVMScript code to format
172
173 formatter: Optional[str]
174
175 The formatter to use. Can specify `ruff`, `black`, or
176 auto-select by passing `None`.
177
178 Returns
179 -------
180 formatted: str
181
182 The formatted Python/TVMScript code
183
184 """
185 return _get_formatter(formatter)(code_str)
186
187
188def _get_pygments_style(

Callers 1

cprintFunction · 0.85

Calls 1

_get_formatterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…