Lines Matching +full:- +full:- +full:flatten
3 # Copyright (c) 2022-2024 Intel Corporation
4 # SPDX-License-Identifier: Apache-2.0
24 def flatten(name, value, name_sep="_", names_dict=None, parent_name=None, escape_sep=""): function
26 Flatten ``value`` into a plain dictionary.
31 … :param names_dict: An optional dictionary with 'foo':'bar' items to flatten 'foo' list properties
35 :param parent_name: the short, single-level, name of the ``value``.
36 :param value: object to flatten, for example, a dictionary:
88 flat_item = flatten(flat_name, val_, name_sep, names_dict, parent_name, escape_sep)
91 flat_item = flatten(flat_name, val, name_sep, names_dict, parent_name, escape_sep)
99 flat_item = flatten(name_k, val, name_sep, names_dict, key, escape_sep)
181 _grouping = name.split("/")[-1]
202 if args.flatten and args.flatten in t and isinstance(t[args.flatten], dict):
203 flat = t.pop(args.flatten)
209 … flat = flatten('', flat, args.transpose_separator, flat_list_dict, str(args.escape_separator))
212 … # Keep dictionary names as their properties and flatten the dictionary to a list of dictionaries.
220 t[args.flatten] = flat_list
222 t[args.flatten] = flat
224 # Flatten lists or dictionaries cloning the records with the rest of their items and
226 if args.flatten and args.flatten in t and isinstance(t[args.flatten], list):
227 flat = t.pop(args.flatten)
231 … t_clone.update({ args.flatten + args.flatten_separator + k : v for k,v in flat_item.items() })
233 …t_clone.update({ args.flatten + args.flatten_separator + str(idx) : v for idx,v in enumerate(flat_…
308 parser.add_argument('-y','--dry-run', action="store_true", help='Dry run.')
309 parser.add_argument('-c','--create-index', action="store_true", help='Create index.')
310 parser.add_argument('-m', '--map-file', required=False,
312 parser.add_argument('-i', '--index', required=True, default='tests-zephyr-1',
314 parser.add_argument('-r', '--run-date', help='Run date in ISO format', required=False)
315 parser.add_argument('--flatten', required=False, default=None,
317 help="Flatten one of the test suite's properties:\n"
322 parser.add_argument('--flatten-dict-name', required=False, default="name",
326 … "and'_depth' suffix will be added for number of `--transpose_separator`s in the name.\n"
328 parser.add_argument('--flatten-list-names', required=False, default=None,
335 parser.add_argument('--flatten-separator', required=False, default="_",
337 parser.add_argument('--transpose-separator', required=False, default="/",
339 "`flatten-dict-name` properties. Default: '%(default)s'")
340 parser.add_argument('--escape-separator', required=False, default='',
343 parser.add_argument('--transform', required=False,
349 parser.add_argument('--exclude', required=False, nargs='*', default=[],
352 parser.add_argument('--run-workflow', required=False,
355 parser.add_argument('--run-branch', required=False,
357 parser.add_argument('--run-id', required=False,
358 help="unique run-id (e.g. from github.run_id context)")
359 parser.add_argument('--run-attempt', required=False,
361 parser.add_argument('--bulk-timeout', required=False, type=int, default=60,