MCPcopy Create free account
hub / github.com/apple/axlearn / canonicalize_to_string

Function canonicalize_to_string

axlearn/cloud/common/utils.py:209–215  ·  view source on GitHub ↗

Converts lists to delimited strings.

(v: Union[str, Sequence[str]], *, delimiter: str = ",")

Source from the content-addressed store, hash-verified

207
208
209def canonicalize_to_string(v: Union[str, Sequence[str]], *, delimiter: str = ",") -> str:
210 """Converts lists to delimited strings."""
211 if not v:
212 return ""
213 if not isinstance(v, str) and isinstance(v, Sequence):
214 v = delimiter.join([elem.strip() for elem in v])
215 return str(v)
216
217
218def parse_action(

Callers 3

_docker_bundler_to_flagsFunction · 0.90
bundleMethod · 0.90

Calls 1

joinMethod · 0.80

Tested by 1