Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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