Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Effect(effect_id=effect_id, name=effect)
for effect_id, effect in enumerate(data["effects"])
]
effects.sort(key=lambda x: x.name)
self.effects = effects
if "palettes" in data and data["palettes"]:
palettes = [
Palette(palette_id=palette_id, name=palette)
for palette_id, palette in enumerate(data["palettes"])
]
palettes.sort(key=lambda x: x.name)
self.palettes = palettes
if "info" in data and data["info"]:
self.info = Info.from_dict(data["info"])
if "state" in data and data["state"]:
self.state = State.from_dict(data["state"], self.effects, self.palettes)
return self