code: def decode_union(self, data_type, obj):
          
          val = None
          if isinstance(obj, six.string_types):
              # Handles the shorthand format where the union is serialized as only
              # the string of the tag.
              tag = obj
              if data_type.definition._is_tag_present(tag, self.caller_permissions):
                  val_data_type = data_type.definition._get_val_data_type(
                      tag, self.caller_permissions)
                  if not isinstance(val_data_type, (bv.Void, bv.Nullable)):
                      raise bv.ValidationError(
                          "expected object for '%s', got symbol" % tag)
                  if tag == data_type.definition._catch_all:
                      raise bv.ValidationError(
                          "unexpected use of the catch-all tag '%s'" % tag)
              elif not self.strict and data_type.definition._catch_all:
                  tag = data_type.definition._catch_all
              else:
                  raise bv.ValidationError("unknown tag '%s'" % tag)
          elif isinstance(obj, dict):
              tag, val = self.decode_union_dict(
                  data_type, obj)
          else:
              raise bv.ValidationError("expected string or object, got %s" %
                                       bv.generic_type_name(obj))
          return data_type.definition(tag, val)
docs: The data_type argument must be a Union.
          See json_compat_obj_decode() for argument descriptions.