Best Python code snippet using tox_python
regex_util.py
Source:regex_util.py
...226# """227# enum_list = list(enum_dict)228# done = False229# scores = []230# def substitute_once(r: pre.Pregex) -> pre.Pregex:231# #REMINDER, there is the sub argument which is required in here232# nonlocal done233# nonlocal scores234# if done:235# return r236# else: 237# if r == sub:238# done = True239# scores.append(enum_dict[sub])240# return Hole()241# else: 242# return r.map(substitute_once) #TODO243# solutions = []244# for sub in enum_list: 245# while True:246# if len(solutions) == k: 247# assert k == len(scores)248# return tuple(zip(solutions, scores))249# solution = substitute_once(reg)250# if done:251# done = False252# solutions.append(solution)253# else: break254# if len(solutions) == 0:255# return tuple(((reg, 0.0),))256# assert len(solutions) == len(scores)257# return tuple(zip(solutions, scores))258 # holey = make_holey_sup_inner(r)259 # return holey, torch.Tensor([scores])260# prim_list = sketchPrimitives()261# specials = ["r_kleene", "r_plus", "r_maybe", "r_alt", "r_concat"]262# n_base_prim = len(prim_list) - len(specials)263# productions = [...
ref_fixer_hack.py
Source:ref_fixer_hack.py
...52 is_text_primitive = len(n.children) == 1 and isinstance(n.children[0], docutils.nodes.Text)53 if is_text_primitive:54 return is_text_primitive and re.match(_ACCEPTANCE_PATTERN, n.children[0].astext())55 return False56 def substitute_once(text: str) -> str:57 out = re.sub(r"\._[a-zA-Z0-9_]*", "", text)58 _replacements_made.append((text, out))59 return out60 # The objective here is to replace all references to hidden objects with their exported aliases.61 # For example: pycyphal.presentation._typed_session._publisher.Publisher --> pycyphal.presentation.Publisher62 for node in doctree.traverse(predicate):63 assert isinstance(node, docutils.nodes.FixedTextElement)64 node.children = [docutils.nodes.Text(substitute_once(node.children[0].astext()))]65def setup(app: sphinx.application.Sphinx):66 app.connect("missing-reference", missing_reference)67 app.connect("doctree-resolved", doctree_resolved)68 return {69 "parallel_read_safe": True,...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!