MCPcopy Create free account
hub / github.com/antlr/codebuff / todict

Function todict

python/src/groomlib.py:118–128  ·  view source on GitHub ↗

From features:list , convert to a list using FEATURE_NAMES as the keys.

(features)

Source from the content-addressed store, hash-verified

116
117
118def todict(features):
119 """
120 From features:list<object[]>, convert to a list<dict> using
121 FEATURE_NAMES as the keys.
122 """
123 records = []
124 n = len(FEATURE_NAMES)
125 for record in features:
126 d = dict((FEATURE_NAMES[i], record[i]) for i in range(0, n))
127 records += [d]
128 return records
129
130
131def format_code(newline_forest, indent_forest, whitespace_forest, vec, code):

Callers 1

convert_categorical_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected