Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(6) | Call(6) | Derive(0) | Import(0)
Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; if a string, backslash escapes in it are processed. If it is a callable, it's passed the match object and must return a replacement string to be used.
def sub(pattern, repl, string, count=0, flags=0): """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; if a string, backslash escapes in it are processed. If it is a callable, it's passed the match object and must return a replacement string to be used.""" return _compile(pattern, flags).sub(repl, string, count)
# copied from tempdir plugin name = request._pyfuncitem.name name = py.std.re.sub("[\W]", "_", name) my_tmpdir = request.config._tmpdirhandler.mktemp(name, numbered=True) dep_file = dep_class(os.path.join(my_tmpdir.strpath, "testdb"))
def depfile_name(request): # copied from tempdir plugin name = request._pyfuncitem.name name = py.std.re.sub("[\W]", "_", name) my_tmpdir = request.config._tmpdirhandler.mktemp(name, numbered=True)
src/n/u/nupic-linux64-HEAD/lib/python2.6/site-packages/_pytest/tmpdir.py nupic-linux64(Download)
""" name = request.node.name name = py.std.re.sub("[\W]", "_", name) MAXVAL = 30 if len(name) > MAXVAL:
src/p/y/pytest-2.5.2/_pytest/tmpdir.py pytest(Download)
""" name = request.node.name name = py.std.re.sub("[\W]", "_", name) MAXVAL = 30 if len(name) > MAXVAL:
src/p/y/pytest-bdd-splinter-0.5.98/pytest_bdd_splinter/plugin.py pytest-bdd-splinter(Download)
def pytestbdd_file_download_dir(request): """Browser file download directory.""" name = request.node.name name = py.std.re.sub("[\W]", "_", name) x = request.config._tmpdirhandler.mktemp(name, numbered=True)
src/p/y/pytest-splinter-1.0.2/pytest_splinter/plugin.py pytest-splinter(Download)
def splinter_file_download_dir(request): """Browser file download directory.""" name = request.node.name name = py.std.re.sub("[\W]", "_", name) x = request.config._tmpdirhandler.mktemp(name, numbered=True)