Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
custom_tags[annotation.group("key")] = annotation.group("value")
continue
raw_list.append(v)
sequence = dumper.represent_list(raw_list)
if use_annotations:
for i, v in enumerate(sequence.value):
if str(i) in custom_styles:
if isinstance(v, yaml.nodes.ScalarNode):
v.style = custom_styles[str(i)]
elif custom_styles[str(i)] == "flow":
v.flow_style = True
if str(i) in custom_tags:
v.tag = custom_tags[str(i)]
return sequence
dumper = OrderedIndentlessDumper if indentless else OrderedDumper
dumper.add_representer(OrderedDict, represent_dict_order)
dumper.add_representer(list, represent_list)
return dumper