code: async def dump_variant(obj, elem, elem_type=None, params=None, field_archiver=None):
      
      field_archiver = field_archiver if field_archiver else dump_field
      if isinstance(elem, x.VariantType) or elem_type.WRAPS_VALUE:
          return {
              elem.variant_elem: await field_archiver(None, getattr(elem, elem.variant_elem), elem.variant_elem_type)
          }
  
      else:
          fdef = elem_type.find_fdef(elem_type.f_specs(), elem)
          return {
              fdef[0]: await field_archiver(None, elem, fdef[1])
          }
docs: Transform variant to the popo object representation.
  
      :param obj:
      :param elem:
      :param elem_type:
      :param params:
      :param field_archiver:
      :return: