code: def dict(self, *args, **kwargs):
      object_dict = super().dict(*args, **kwargs)
      object_dict["roles"] = [r.name for r in self.roles]
      object_dict["stages"] = [s.name for s in self.stages]
      return object_dict
  
imports: from typing import Any, Dict, List, Literal, Optional
  from fate.components.core.essential import Label, Role, Stage
  from pydantic import BaseModel
label_desc: Use image node_id 1 for calling the ArtifactSpec obj's underlying member method code with example usage: obj.dict() and returns: object_dict