
"""simple docstring"""
import unittest

from transformers import MarkupLMConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
    import torch

    from transformers import (
        MarkupLMForQuestionAnswering,
        MarkupLMForSequenceClassification,
        MarkupLMForTokenClassification,
        MarkupLMModel,
    )

# TODO check dependencies
from transformers import MarkupLMFeatureExtractor, MarkupLMProcessor, MarkupLMTokenizer






class   _UpperCAmelCase					:
    def __init__(     self    ,     snake_case_    ,     snake_case_=13    ,     snake_case_=7    ,     snake_case_=True    ,     snake_case_=True    ,     snake_case_=True    ,     snake_case_=True    ,     snake_case_=99    ,     snake_case_=32    ,     snake_case_=5    ,     snake_case_=4    ,     snake_case_=37    ,     snake_case_="gelu"    ,     snake_case_=0.1    ,     snake_case_=0.1    ,     snake_case_=5_12    ,     snake_case_=16    ,     snake_case_=2    ,     snake_case_=0.02    ,     snake_case_=3    ,     snake_case_=None    ,     snake_case_=20    ,     snake_case_=30    ,     snake_case_=2    ,     snake_case_=2    ,     snake_case_=10    ,     ):
      _snake_case  :    Optional[Any]            = parent
      _snake_case  :    Tuple            = batch_size
      _snake_case  :    List[str]            = seq_length
      _snake_case  :    Optional[int]            = is_training
      _snake_case  :    List[Any]            = use_input_mask
      _snake_case  :    Tuple            = use_token_type_ids
      _snake_case  :    Union[str, Any]            = use_labels
      _snake_case  :    Union[str, Any]            = vocab_size
      _snake_case  :    int            = hidden_size
      _snake_case  :    Optional[Any]            = num_hidden_layers
      _snake_case  :    List[Any]            = num_attention_heads
      _snake_case  :    int            = intermediate_size
      _snake_case  :    Union[str, Any]            = hidden_act
      _snake_case  :    Union[str, Any]            = hidden_dropout_prob
      _snake_case  :    Optional[int]            = attention_probs_dropout_prob
      _snake_case  :    Union[str, Any]            = max_position_embeddings
      _snake_case  :    int            = type_vocab_size
      _snake_case  :    Tuple            = type_sequence_label_size
      _snake_case  :    Tuple            = initializer_range
      _snake_case  :    Optional[Any]            = num_labels
      _snake_case  :    Union[str, Any]            = scope
      _snake_case  :    int            = max_xpath_tag_unit_embeddings
      _snake_case  :    Optional[int]            = max_xpath_subs_unit_embeddings
      _snake_case  :    Optional[Any]            = tag_pad_id
      _snake_case  :    str            = subs_pad_id
      _snake_case  :    List[str]            = max_depth
    def        lowerCamelCase__						(     self  ):
      _snake_case  :    List[Any]            = ids_tensor([self.batch_size, self.seq_length]    ,     self.vocab_size  )

      _snake_case  :    List[str]            = ids_tensor(
          [self.batch_size, self.seq_length, self.max_depth]    ,     self.max_xpath_tag_unit_embeddings  )

      _snake_case  :    Any            = ids_tensor(
          [self.batch_size, self.seq_length, self.max_depth]    ,     self.max_xpath_subs_unit_embeddings  )

      _snake_case  :    Dict            = None
      if self.use_input_mask:
        _snake_case  :    Tuple            = ids_tensor([self.batch_size, self.seq_length]    ,     vocab_size=2  )

      _snake_case  :    int            = None
      if self.use_token_type_ids:
        _snake_case  :    Tuple            = ids_tensor([self.batch_size, self.seq_length]    ,     self.type_vocab_size  )

      _snake_case  :    List[str]            = None
      _snake_case  :    str            = None
      if self.use_labels:
        _snake_case  :    int            = ids_tensor([self.batch_size]    ,     self.type_sequence_label_size  )
        _snake_case  :    Union[str, Any]            = ids_tensor([self.batch_size, self.seq_length]    ,     self.num_labels  )

      _snake_case  :    Optional[int]            = self.get_config()

      return (
          config,
          input_ids,
          xpath_tags_seq,
          xpath_subs_seq,
          token_type_ids,
          input_mask,
          sequence_labels,
          token_labels,
      )
    def        lowerCamelCase__						(     self  ):
      return MarkupLMConfig(
          vocab_size=self.vocab_size    ,     hidden_size=self.hidden_size    ,     num_hidden_layers=self.num_hidden_layers    ,     num_attention_heads=self.num_attention_heads    ,     intermediate_size=self.intermediate_size    ,     hidden_act=self.hidden_act    ,     hidden_dropout_prob=self.hidden_dropout_prob    ,     attention_probs_dropout_prob=self.attention_probs_dropout_prob    ,     max_position_embeddings=self.max_position_embeddings    ,     type_vocab_size=self.type_vocab_size    ,     initializer_range=self.initializer_range    ,     max_xpath_tag_unit_embeddings=self.max_xpath_tag_unit_embeddings    ,     max_xpath_subs_unit_embeddings=self.max_xpath_subs_unit_embeddings    ,     tag_pad_id=self.tag_pad_id    ,     subs_pad_id=self.subs_pad_id    ,     max_depth=self.max_depth    ,     )
    def        lowerCamelCase__						(     self    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     ):
      _snake_case  :    Optional[int]            = MarkupLMModel(config=snake_case_  )
      model.to(snake_case_  )
      model.eval()
      print("Configs:"    ,     model.config.tag_pad_id    ,     model.config.subs_pad_id  )
      _snake_case  :    List[Any]            = model(snake_case_    ,     attention_mask=snake_case_    ,     token_type_ids=snake_case_  )
      _snake_case  :    List[Any]            = model(snake_case_    ,     token_type_ids=snake_case_  )
      _snake_case  :    Optional[int]            = model(snake_case_  )
      self.parent.assertEqual(result.last_hidden_state.shape    ,     (self.batch_size, self.seq_length, self.hidden_size)  )
      self.parent.assertEqual(result.pooler_output.shape    ,     (self.batch_size, self.hidden_size)  )
    def        lowerCamelCase__						(     self    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     ):
      _snake_case  :    str            = self.num_labels
      _snake_case  :    int            = MarkupLMForSequenceClassification(snake_case_  )
      model.to(snake_case_  )
      model.eval()
      _snake_case  :    int            = model(
          snake_case_    ,     xpath_tags_seq=snake_case_    ,     xpath_subs_seq=snake_case_    ,     attention_mask=snake_case_    ,     token_type_ids=snake_case_    ,     labels=snake_case_    ,     )
      self.parent.assertEqual(result.logits.shape    ,     (self.batch_size, self.num_labels)  )
    def        lowerCamelCase__						(     self    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     ):
      _snake_case  :    int            = self.num_labels
      _snake_case  :    List[Any]            = MarkupLMForTokenClassification(config=snake_case_  )
      model.to(snake_case_  )
      model.eval()
      _snake_case  :    List[str]            = model(
          snake_case_    ,     xpath_tags_seq=snake_case_    ,     xpath_subs_seq=snake_case_    ,     attention_mask=snake_case_    ,     token_type_ids=snake_case_    ,     labels=snake_case_    ,     )
      self.parent.assertEqual(result.logits.shape    ,     (self.batch_size, self.seq_length, self.num_labels)  )
    def        lowerCamelCase__						(     self    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     ):
      _snake_case  :    Any            = MarkupLMForQuestionAnswering(config=snake_case_  )
      model.to(snake_case_  )
      model.eval()
      _snake_case  :    str            = model(
          snake_case_    ,     xpath_tags_seq=snake_case_    ,     xpath_subs_seq=snake_case_    ,     attention_mask=snake_case_    ,     token_type_ids=snake_case_    ,     start_positions=snake_case_    ,     end_positions=snake_case_    ,     )
      self.parent.assertEqual(result.start_logits.shape    ,     (self.batch_size, self.seq_length)  )
      self.parent.assertEqual(result.end_logits.shape    ,     (self.batch_size, self.seq_length)  )


    def        lowerCamelCase__						(     self  ):
      _snake_case  :    Optional[Any]            = self.prepare_config_and_inputs()
      (
          (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       (
          _snake_case
      )      ,       
      )  :    Tuple            = config_and_inputs
      _snake_case  :    Optional[Any]            = {
          "input_ids": input_ids,
          "xpath_tags_seq": xpath_tags_seq,
          "xpath_subs_seq": xpath_subs_seq,
          "token_type_ids": token_type_ids,
          "attention_mask": input_mask,
      }
      return config, inputs_dict






@require_torch
class   _UpperCAmelCase					(       _snake_case		,       _snake_case		,       unittest.TestCase):
    __lowercase				:			Union[str, Any]	=       (
        (
            MarkupLMModel,
            MarkupLMForSequenceClassification,
            MarkupLMForTokenClassification,
            MarkupLMForQuestionAnswering,
        )
        if is_torch_available()
        else None
    )
    __lowercase				:			Optional[Any]	=       (
        {
            """feature-extraction""": MarkupLMModel,
            """question-answering""": MarkupLMForQuestionAnswering,
            """text-classification""": MarkupLMForSequenceClassification,
            """token-classification""": MarkupLMForTokenClassification,
            """zero-shot""": MarkupLMForSequenceClassification,
        }
        if is_torch_available()
        else {}
    )
    def        lowerCamelCase__						(     self    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_    ,     snake_case_  ):
      # ValueError: Nodes must be of type `List[str]` (single pretokenized example), or `List[List[str]]`
      # (batch of pretokenized examples).
      return True
    def        lowerCamelCase__						(     self  ):
      _snake_case  :    str            = MarkupLMModelTester(self  )
      _snake_case  :    Optional[int]            = ConfigTester(self    ,     config_class=snake_case_    ,     hidden_size=37  )
    def        lowerCamelCase__						(     self  ):
      self.config_tester.run_common_tests()
    def        lowerCamelCase__						(     self  ):
      _snake_case  :    int            = self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*snake_case_  )
    def        lowerCamelCase__						(     self  ):
      _snake_case  :    int            = self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_sequence_classification(*snake_case_  )
    def        lowerCamelCase__						(     self  ):
      _snake_case  :    Optional[Any]            = self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_token_classification(*snake_case_  )


    def        lowerCamelCase__						(     self  ):
      _snake_case  :    Any            = self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_question_answering(*snake_case_  )


def 					a__ ( ):

  """simple docstring"""







  _snake_case  :    int            = "\n    <!DOCTYPE html>\n    <html>\n    <head>\n    <title>Page Title</title>\n    </head>\n    <body>\n\n    <h1>This is a Heading</h1>\n    <p>This is a paragraph.</p>\n\n    </body>\n    </html>\n    "

  return html_string






@require_torch
class   _UpperCAmelCase					(       unittest.TestCase):
    @cached_property
    def        lowerCamelCase__						(     self  ):
      # TODO use from_pretrained here
      _snake_case  :    List[Any]            = MarkupLMFeatureExtractor()
      _snake_case  :    Optional[int]            = MarkupLMTokenizer.from_pretrained("microsoft/markuplm-base"  )

      return MarkupLMProcessor(snake_case_    ,     snake_case_  )


    @slow
    def        lowerCamelCase__						(     self  ):
      _snake_case  :    List[Any]            = MarkupLMModel.from_pretrained("microsoft/markuplm-base"  ).to(snake_case_  )

      _snake_case  :    List[str]            = self.default_processor

      _snake_case  :    List[str]            = processor(prepare_html_string()    ,     return_tensors="pt"  )
      _snake_case  :    Tuple            = inputs.to(snake_case_  )

      # forward pass
      with torch.no_grad():
        _snake_case  :    Optional[Any]            = model(**snake_case_  )

      # verify the last hidden states
      _snake_case  :    Tuple            = torch.Size([1, 14, 7_68]  )
      self.assertEqual(outputs.last_hidden_state.shape    ,     snake_case_  )

      _snake_case  :    Dict            = torch.tensor(
          [[0.0675, -0.0052, 0.5001], [-0.2281, 0.0802, 0.2192], [-0.0583, -0.3311, 0.1185]]  ).to(snake_case_  )

      self.assertTrue(torch.allclose(outputs.last_hidden_state[0, :3, :3]    ,     snake_case_    ,     atol=1E-4  )  )









'''simple docstring'''







import csv
import os

import pytest

from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
from datasets.io.csv import CsvDatasetReader, CsvDatasetWriter

from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase ) ->			Dict:
							assert isinstance(UpperCamelCase							,     UpperCamelCase )
							assert dataset.num_rows == 4
							assert dataset.num_columns == 3
							assert dataset.column_names == ["col_1", "col_2", "col_3"]
							for feature, expected_dtype in expected_features.items():
														assert dataset.features[feature].dtype == expected_dtype





@pytest.mark.parametrize("""keep_in_memory"""							,     [False, True] )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			Any:
							lowerCamelCase__   :      Any			    =			tmp_path / """cache"""
							lowerCamelCase__   :      int			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
														lowerCamelCase__   :      Any			    =			CsvDatasetReader(UpperCamelCase							,     cache_dir=UpperCamelCase							,     keep_in_memory=UpperCamelCase ).read()
							_check_csv_dataset(UpperCamelCase							,     UpperCamelCase )





@pytest.mark.parametrize(
    """features"""							,     [
        None,
        {"""col_1""": """string""", """col_2""": """int64""", """col_3""": """float64"""},
        {"""col_1""": """string""", """col_2""": """string""", """col_3""": """string"""},
        {"""col_1""": """int32""", """col_2""": """int32""", """col_3""": """int32"""},
        {"""col_1""": """float32""", """col_2""": """float32""", """col_3""": """float32"""},
    ]							,     )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			Any:
							lowerCamelCase__   :      Optional[int]			    =			tmp_path / """cache"""
							# CSV file loses col_1 string dtype information: default now is "int64" instead of "string"
							lowerCamelCase__   :      int			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							lowerCamelCase__   :      int			    =			features.copy() if features else default_expected_features
							lowerCamelCase__   :      List[Any]			    =			(
							    Features({feature: Value(UpperCamelCase ) for feature, dtype in features.items()} ) if features is not None else None
							)
							lowerCamelCase__   :      Union[str, Any]			    =			CsvDatasetReader(UpperCamelCase							,     features=UpperCamelCase							,     cache_dir=UpperCamelCase ).read()
							_check_csv_dataset(UpperCamelCase							,     UpperCamelCase )





@pytest.mark.parametrize("""split"""							,     [None, NamedSplit("""train""" ), """train""", """test"""] )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			Union[str, Any]:
							lowerCamelCase__   :      Any			    =			tmp_path / """cache"""
							lowerCamelCase__   :      Union[str, Any]			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							lowerCamelCase__   :      List[Any]			    =			CsvDatasetReader(UpperCamelCase							,     cache_dir=UpperCamelCase							,     split=UpperCamelCase ).read()
							_check_csv_dataset(UpperCamelCase							,     UpperCamelCase )
							assert dataset.split == split if split else "train"





@pytest.mark.parametrize("""path_type"""							,     [str, list] )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			Union[str, Any]:
							if issubclass(UpperCamelCase							,     UpperCamelCase ):
														lowerCamelCase__   :      int			    =			csv_path
							elif issubclass(UpperCamelCase							,     UpperCamelCase ):
														lowerCamelCase__   :      Tuple			    =			[csv_path]
							lowerCamelCase__   :      Optional[int]			    =			tmp_path / """cache"""
							lowerCamelCase__   :      str			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							lowerCamelCase__   :      Dict			    =			CsvDatasetReader(UpperCamelCase							,     cache_dir=UpperCamelCase ).read()
							_check_csv_dataset(UpperCamelCase							,     UpperCamelCase )





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase=("train",) ) ->			int:
							assert isinstance(UpperCamelCase							,     UpperCamelCase )
							for split in splits:
														lowerCamelCase__   :      Optional[Any]			    =			dataset_dict[split]
														assert dataset.num_rows == 4
														assert dataset.num_columns == 3
														assert dataset.column_names == ["col_1", "col_2", "col_3"]
														for feature, expected_dtype in expected_features.items():
																					assert dataset.features[feature].dtype == expected_dtype





@pytest.mark.parametrize("""keep_in_memory"""							,     [False, True] )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			Optional[Any]:
							lowerCamelCase__   :      List[Any]			    =			tmp_path / """cache"""
							lowerCamelCase__   :      Dict			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
														lowerCamelCase__   :      Any			    =			CsvDatasetReader({"""train""": csv_path}							,     cache_dir=UpperCamelCase							,     keep_in_memory=UpperCamelCase ).read()
							_check_csv_datasetdict(UpperCamelCase							,     UpperCamelCase )





@pytest.mark.parametrize(
    """features"""							,     [
        None,
        {"""col_1""": """string""", """col_2""": """int64""", """col_3""": """float64"""},
        {"""col_1""": """string""", """col_2""": """string""", """col_3""": """string"""},
        {"""col_1""": """int32""", """col_2""": """int32""", """col_3""": """int32"""},
        {"""col_1""": """float32""", """col_2""": """float32""", """col_3""": """float32"""},
    ]							,     )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			int:
							lowerCamelCase__   :      int			    =			tmp_path / """cache"""
							# CSV file loses col_1 string dtype information: default now is "int64" instead of "string"
							lowerCamelCase__   :      Optional[Any]			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							lowerCamelCase__   :      List[str]			    =			features.copy() if features else default_expected_features
							lowerCamelCase__   :      Tuple			    =			(
							    Features({feature: Value(UpperCamelCase ) for feature, dtype in features.items()} ) if features is not None else None
							)
							lowerCamelCase__   :      str			    =			CsvDatasetReader({"""train""": csv_path}							,     features=UpperCamelCase							,     cache_dir=UpperCamelCase ).read()
							_check_csv_datasetdict(UpperCamelCase							,     UpperCamelCase )





@pytest.mark.parametrize("""split"""							,     [None, NamedSplit("""train""" ), """train""", """test"""] )
def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase							,     UpperCamelCase ) ->			Any:
							if split:
														lowerCamelCase__   :      Tuple			    =			{split: csv_path}
							else:
														lowerCamelCase__   :      Union[str, Any]			    =			{"""train""": csv_path, """test""": csv_path}
							lowerCamelCase__   :      Dict			    =			tmp_path / """cache"""
							lowerCamelCase__   :      Union[str, Any]			    =			{"""col_1""": """int64""", """col_2""": """int64""", """col_3""": """float64"""}
							lowerCamelCase__   :      Tuple			    =			CsvDatasetReader(UpperCamelCase							,     cache_dir=UpperCamelCase ).read()
							_check_csv_datasetdict(UpperCamelCase							,     UpperCamelCase							,     splits=list(path.keys() ) )
							assert all(dataset[split].split == split for split in path.keys() )





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase ) ->			Tuple:
							with open(UpperCamelCase							,     encoding="""utf-8""" ) as csvfile:
														yield from csv.reader(UpperCamelCase )





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase ) ->			Optional[int]:
							lowerCamelCase__   :      Union[str, Any]			    =			tmp_path / """cache"""
							lowerCamelCase__   :      List[str]			    =			os.path.join(UpperCamelCase							,     """tmp.csv""" )
							lowerCamelCase__   :      Optional[Any]			    =			CsvDatasetReader({"""train""": csv_path}							,     cache_dir=UpperCamelCase ).read()
							CsvDatasetWriter(dataset["""train"""]							,     UpperCamelCase							,     num_proc=1 ).write()

							lowerCamelCase__   :      Optional[Any]			    =			iter_csv_file(UpperCamelCase )
							lowerCamelCase__   :      str			    =			iter_csv_file(UpperCamelCase )

							for rowa, rowa in zip(UpperCamelCase							,     UpperCamelCase ):
														assert rowa == rowa





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase ) ->			List[str]:
							lowerCamelCase__   :      Any			    =			tmp_path / """cache"""
							lowerCamelCase__   :      List[str]			    =			os.path.join(UpperCamelCase							,     """tmp.csv""" )
							lowerCamelCase__   :      Optional[int]			    =			CsvDatasetReader({"""train""": csv_path}							,     cache_dir=UpperCamelCase ).read()
							CsvDatasetWriter(dataset["""train"""]							,     UpperCamelCase							,     num_proc=2 ).write()

							lowerCamelCase__   :      Tuple			    =			iter_csv_file(UpperCamelCase )
							lowerCamelCase__   :      Union[str, Any]			    =			iter_csv_file(UpperCamelCase )

							for rowa, rowa in zip(UpperCamelCase							,     UpperCamelCase ):
														assert rowa == rowa





def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase ) ->			Optional[int]:
							lowerCamelCase__   :      List[Any]			    =			tmp_path / """cache"""
							lowerCamelCase__   :      List[Any]			    =			os.path.join(UpperCamelCase							,     """tmp.csv""" )
							lowerCamelCase__   :      Dict			    =			CsvDatasetReader({"""train""": csv_path}							,     cache_dir=UpperCamelCase ).read()
							with pytest.raises(UpperCamelCase ):
														CsvDatasetWriter(dataset["""train"""]							,     UpperCamelCase							,     num_proc=0 )

