MCPcopy Create free account
hub / github.com/ipython/traitlets / cast_unicode

Function cast_unicode

traitlets/utils/__init__.py:9–12  ·  view source on GitHub ↗
(s: str | bytes, encoding: str = "utf-8")

Source from the content-addressed store, hash-verified

7
8# vestigal things from IPython_genutils.
9def cast_unicode(s: str | bytes, encoding: str = "utf-8") -> str:
10 if isinstance(s, bytes):
11 return s.decode(encoding, "replace")
12 return s
13
14
15def filefind(filename: str, path_dirs: Sequence[str] | None = None) -> str:

Callers 3

coerceMethod · 0.90
parse_command_lineMethod · 0.85
_parse_argsMethod · 0.85

Calls

no outgoing calls

Tested by 1

coerceMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…