From features:list , convert to a list using FEATURE_NAMES as the keys.
(features)
| 116 | |
| 117 | |
| 118 | def 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 | |
| 131 | def format_code(newline_forest, indent_forest, whitespace_forest, vec, code): |
no outgoing calls
no test coverage detected