MCPcopy
hub / github.com/SwanHubX/SwanLab / _optional_string

Function _optional_string

swanlab/cli/ping/__init__.py:236–242  ·  view source on GitHub ↗
(message: Message, field: str)

Source from the content-addressed store, hash-verified

234
235
236def _optional_string(message: Message, field: str) -> Optional[str]:
237 if not _has_field(message, field):
238 return None
239 value = getattr(message, field)
240 if value == "":
241 return None
242 return str(value)
243
244
245def _metadata_python_version(metadata: MetadataSnapshot) -> Optional[str]:

Callers 5

_metadata_python_versionFunction · 0.85
_format_systemFunction · 0.85
_format_hardwareFunction · 0.85
_format_cpu_memoryFunction · 0.85
_format_acceleratorsFunction · 0.85

Calls 1

_has_fieldFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…