MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _FileNameToKey

Function _FileNameToKey

tensorflow/tools/api/tests/api_compatibility_test.py:110–121  ·  view source on GitHub ↗

From a given filename, construct a key we use for api objects.

(filename)

Source from the content-addressed store, hash-verified

108
109
110def _FileNameToKey(filename):
111 """From a given filename, construct a key we use for api objects."""
112
113 def _ReplaceDashWithCaps(matchobj):
114 match = matchobj.group(0)
115 return match[1].upper()
116
117 base_filename = os.path.basename(filename)
118 base_filename_without_ext = os.path.splitext(base_filename)[0]
119 api_object_key = re.sub('((-[a-z]){1})', _ReplaceDashWithCaps,
120 base_filename_without_ext)
121 return api_object_key
122
123
124def _VerifyNoSubclassOfMessageVisitor(path, parent, unused_children):

Callers 1

Calls 1

subMethod · 0.45

Tested by

no test coverage detected