code: async def variant(self, elem=None, elem_type=None, params=None):
          
          elem_type = elem_type if elem_type else elem.__class__
  
          if hasattr(elem_type, 'blob_serialize'):
              elem = elem_type() if elem is None else elem
              return await elem.bob_serialize(self, elem=elem, elem_type=elem_type, params=params)
  
          if self.writing:
              return await self.dump_variant(elem=elem,
                                             elem_type=elem_type if elem_type else elem.__class__, params=params)
          else:
              return await self.load_variant(elem_type=elem_type if elem_type else elem.__class__,
                                             params=params, elem=elem)
docs: Loads/dumps variant type
          :param elem:
          :param elem_type:
          :param params:
          :param obj:
          :return: