def METHOD_NAME(cls, v):
    instance = Pig.construct()
    error_messages = []
    match = 0
    # validate data type: BasquePig
    if not isinstance(v, BasquePig):
        error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
    else:
        match += 1
    # validate data type: DanishPig
    if not isinstance(v, DanishPig):
        error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
    else:
        match += 1
    if match > 1:
        # more than 1 match
        raise ValueError("Multiple matches found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
    elif match == 0:
        # no match
        raise ValueError("No match found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
    else:
        return v