code: def unflatten(self, obj):
          
          obj.substitutions = [
              dict(from_id=key, to_id=value)
              for key, value in getattr(obj, "substitutions", {}).items()
          ]
docs: Translate substitutions dictionary into objects.