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

Function replace_string_in_line

tensorflow/tools/ci_build/update_version.py:59–64  ·  view source on GitHub ↗

Replace with sed when regex is required.

(search, replace, filename)

Source from the content-addressed store, hash-verified

57
58
59def replace_string_in_line(search, replace, filename):
60 """Replace with sed when regex is required."""
61 with open(filename, "r") as source:
62 content = source.read()
63 with open(filename, "w") as source:
64 source.write(re.sub(search, replace, content))
65
66
67class Version(object):

Callers 4

update_version_hFunction · 0.85
update_setup_dot_pyFunction · 0.85
update_readmeFunction · 0.85
update_tensorflow_bzlFunction · 0.85

Calls 3

readMethod · 0.45
writeMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected