code: def get_all_subtypes_with_tags(self):
          
          assert self.has_enumerated_subtypes(), 'Enumerated subtypes not set.'
          subtypes_with_tags = []  # List[Tuple[List[String], Struct]]
          fifo = deque([subtype_field.data_type
                        for subtype_field in self.get_enumerated_subtypes()])
          # Traverse down the hierarchy registering subtypes as they're found.
          while fifo:
              data_type = fifo.popleft()
              subtypes_with_tags.append((data_type._get_subtype_tags(), data_type))
              if data_type.has_enumerated_subtypes():
                  for subtype_field in data_type.get_enumerated_subtypes():
                      fifo.append(subtype_field.data_type)
          return subtypes_with_tags
docs: Unlike other enumerated-subtypes-related functionality, this method
          returns not just direct subtypes, but all subtypes of this struct. The
          tag of each subtype is the list of tags from which the type descends.
  
          This method only applies to structs that enumerate subtypes.
  
          Use this when you need to generate a lookup table for a root struct
          that maps a generated class representing a subtype to the tag it needs
          in the serialized format.
  
          Returns:
              List[Tuple[List[String], Struct]]