MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / fix_method_name

Function fix_method_name

googleapiclient/discovery.py:151–165  ·  view source on GitHub ↗

Fix method names to avoid '$' characters and reserved word conflicts. Args: name: string, method name. Returns: The name with '_' appended if the name is a reserved word and '$' and '-' replaced with '_'.

(name)

Source from the content-addressed store, hash-verified

149
150
151def fix_method_name(name):
152 """Fix method names to avoid '$' characters and reserved word conflicts.
153
154 Args:
155 name: string, method name.
156
157 Returns:
158 The name with '_' appended if the name is a reserved word and '$' and '-'
159 replaced with '_'.
160 """
161 name = name.replace("$", "_").replace("-", "_")
162 if keyword.iskeyword(name) or name in RESERVED_WORDS:
163 return name + "_"
164 else:
165 return name
166
167
168def key2param(key):

Callers 3

createMethodFunction · 0.85
createNextMethodFunction · 0.85
createResourceMethodMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…