code: async def variant(self, elem=None, elem_type=None, params=None, wrapped=None):
          
          elem_type = elem_type if elem_type else elem.__class__
          if hasattr(elem_type, "serialize_archive"):
              elem = elem_type() if elem is None else elem
              return await elem.serialize_archive(
                  self, elem=elem, elem_type=elem_type, params=params
              )
  
          if self.writing:
              return await self._dump_variant(
                  self.iobj,
                  elem=elem,
                  elem_type=elem_type if elem_type else elem.__class__,
                  params=params,
              )
          else:
              return await self._load_variant(
                  self.iobj,
                  elem_type=elem_type if elem_type else elem.__class__,
                  params=params,
                  elem=elem,
                  wrapped=wrapped,
              )
docs: Loads/dumps variant type
          :param elem:
          :param elem_type:
          :param params:
          :return: