code: def merge(self, a: "AllowArtifactDescribes"):
      if len(self.types) != len(set(self.types).union(a.types)):
          raise ValueError(
              f"artifact {self.name} declare multiple times with different types: `{self.types}` vs `{a.types}`"
          )
      if set(self.roles) != set(a.roles):
          raise ValueError(
              f"artifact {self.name} declare multiple times with different roles: `{self.roles}` vs `{a.roles}`"
          )
      if self.optional != a.optional:
          raise ValueError(
              f"artifact {self.name} declare multiple times with different optional: `{self.optional}` vs `{a.optional}`"
          )
      stages = set(self.stages)
      stages.update(a.stages)
      stages = list(stages)
      return AllowArtifactDescribes(
          name=self.name,
          types=self.types,
          roles=self.roles,
          stages=stages,
          desc=self.desc,
          optional=self.optional,
          is_multi=self.is_multi,
      )
  
imports: import typing
  from typing import Dict, List, Type, Union
label_desc: Use image node_id 7 for calling the AllowArtifactDescribes obj's underlying member method code with example usage: obj.merge(a) and returns: AllowArtifactDescribes