code: def validate_union(datum, schema, parent_ns=None, raise_errors=True):
      
      if isinstance(datum, tuple):
          (name, datum) = datum
          for candidate in schema:
              if extract_record_type(candidate) == 'record':
                  if name == candidate["name"]:
                      return validate(datum, schema=candidate,
                                      field=parent_ns,
                                      raise_errors=raise_errors)
          else:
              return False
  
      errors = []
      for s in schema:
          try:
              ret = validate(datum, schema=s,
                             field=parent_ns,
                             raise_errors=raise_errors)
              if ret:
                  # We exit on the first passing type in Unions
                  return True
          except ValidationError as e:
              errors.extend(e.errors)
      if raise_errors:
          raise ValidationError(*errors)
      return False
docs: Check that the data is a list type with possible options to
      validate as True.
  
      Parameters
      ----------
      datum: Any
          Data being validated
      schema: dict
          Schema
      parent_ns: str
          parent namespace
      raise_errors: bool
          If true, raises ValidationError on invalid data