Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def color(self, value):
Utility.lazy_set(self, '_color', None, value)
for attr, attr_id in Workbook.STYLE_ATTRIBUTE_MAP.items():
obj = getattr(style, attr_id)
if obj and not obj.is_default: # we only care about it if it's not default
items[attr][obj] = items[attr].get(obj,
len(items[attr]) + 1)
obj.id = items[attr][obj] # apply
for k, v in items.items():
# ensure it's sorted properly
items[k] = [
tup[0] for tup in sorted(v.items(), key=lambda x: x[1])
]
self._items = items
self._styles = [
tup[0] for tup in sorted(styles.items(), key=lambda x: x[1])
]
Utility.YOLO = False