MCPcopy Create free account
hub / github.com/ScottfreeLLC/AlphaPy / allvars

Function allvars

alphapy/variables.py:221–241  ·  view source on GitHub ↗

r"""Get the list of valid names in the expression. Parameters ---------- expr : str A valid expression conforming to the Variable Definition Language. Returns ------- vlist : list List of valid variable names.

(expr)

Source from the content-addressed store, hash-verified

219#
220
221def allvars(expr):
222 r"""Get the list of valid names in the expression.
223
224 Parameters
225 ----------
226 expr : str
227 A valid expression conforming to the Variable Definition Language.
228
229 Returns
230 -------
231 vlist : list
232 List of valid variable names.
233
234 """
235 regex = re.compile('\w+')
236 items = regex.findall(expr)
237 vlist = []
238 for item in items:
239 if valid_name(item):
240 vlist.append(item)
241 return vlist
242
243
244#

Callers 1

vwalkFunction · 0.85

Calls 1

valid_nameFunction · 0.90

Tested by

no test coverage detected