MCPcopy Create free account
hub / github.com/dagger/dagger / normalize_name

Function normalize_name

sdk/python/src/dagger/mod/_utils.py:59–63  ·  view source on GitHub ↗

Remove the last underscore, used to avoid conflicts with reserved words.

(name: str)

Source from the content-addressed store, hash-verified

57
58
59def normalize_name(name: str) -> str:
60 """Remove the last underscore, used to avoid conflicts with reserved words."""
61 if name.endswith("_") and name[-2] != "_" and not name.startswith("_"):
62 return name.removesuffix("_")
63 return name
64
65
66def get_meta(obj: Any, match: type[T]) -> T | None:

Callers 4

__post_init__Method · 0.90
nameMethod · 0.90
_make_parameterMethod · 0.90
test_normalize_nameFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_normalize_nameFunction · 0.72