Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mtr = SubElement(parent, "mtr")
iterable = iter(range(len(row))) # type: Iterator[int]
if single_mtd:
mtd = SubElement(mtr, "mtd")
for i in iterable:
element = row[i]
if alignment:
column_align = {"r": "right", "l": "left", "c": "center"}.get(
alignment, ""
) # type: str
mtd = SubElement(mtr, "mtd", columnalign=column_align)
elif not single_mtd:
mtd = SubElement(mtr, "mtd")
if isinstance(element, list):
_classify_subgroup(element, mtd)
elif element in COMMANDS:
_convert_command(element, row, i, iterable, mtd)
else:
_classify(element, mtd)