Home | History | Annotate | Download | only in bots

Lines Matching refs:before

20 def _replace_prefix(val, before, after):
22 if val.startswith(before):
23 return val.replace(before, after, 1)
27 def _replace(val, before, after):
30 return _replace_prefix(val, before, after)
32 return [_replace(elem, before, after) for elem in val]
34 return {_replace(k, before, after):
35 _replace(v, before, after) for k, v in val.iteritems()}
39 def _replace_in_file(filename, before, after):
46 new_contents = _replace(contents, before, after)