MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _recur_param

Function _recur_param

tools/toxnox.py:93–166  ·  view source on GitHub ↗
(
        prevtokens: list[str],
        prevtags: list[str],
        token_lists: Sequence[Sequence[str]],
    )

Source from the content-addressed store, hash-verified

91 must_be_present = None
92
93 def _recur_param(
94 prevtokens: list[str],
95 prevtags: list[str],
96 token_lists: Sequence[Sequence[str]],
97 ) -> Generator[tuple[list[str], list[str], str], None, None]:
98
99 if not token_lists:
100 return
101
102 tokens = token_lists[0]
103 remainder = token_lists[1:]
104
105 for i, token in enumerate(tokens):
106
107 if _is_py_version(token):
108 is_our_python = token == OUR_PYTHON
109 tokentag = _python_to_tag(token)
110 is_default_token = is_our_python
111 else:
112 is_our_python = False
113 tokentag = token
114 is_default_token = i == 0
115
116 if is_our_python:
117 our_python_tags = ["py"]
118 else:
119 our_python_tags = []
120
121 if not tokentag.startswith("_"):
122 tags = (
123 prevtags
124 + [tokentag]
125 + [tag + "-" + tokentag for tag in prevtags]
126 + our_python_tags
127 )
128 else:
129 tags = prevtags + our_python_tags
130
131 if remainder:
132 for args, newtags, ids in _recur_param(
133 prevtokens + [token], tags, remainder
134 ):
135 if not is_default_token:
136 newtags = [
137 t
138 for t in newtags
139 if tokentag in t or t in our_python_tags
140 ]
141
142 yield args, newtags, ids
143 else:
144 if not is_default_token:
145 newtags = [
146 t
147 for t in tags
148 if tokentag in t or t in our_python_tags
149 ]
150 else:

Callers 1

tox_parametersFunction · 0.85

Calls 5

_is_py_versionFunction · 0.85
_python_to_tagFunction · 0.85
startswithMethod · 0.45
removeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected