




"""simple docstring"""







import os
import re
import warnings
from shutil import copyfile
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer


if TYPE_CHECKING:
  from ...tokenization_utils_base import TextInput
from ...utils import logging


SCREAMING_SNAKE_CASE_	     =       logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_	     =       {'vocab_file': 'spiece.model'}

SCREAMING_SNAKE_CASE_	     =       {
    'vocab_file': {
        't5-small': 'https://huggingface.co/t5-small/resolve/main/spiece.model',
        't5-base': 'https://huggingface.co/t5-base/resolve/main/spiece.model',
        't5-large': 'https://huggingface.co/t5-large/resolve/main/spiece.model',
        't5-3b': 'https://huggingface.co/t5-3b/resolve/main/spiece.model',
        't5-11b': 'https://huggingface.co/t5-11b/resolve/main/spiece.model',
    }
}


# TODO(PVP) - this should be removed in Transformers v5
SCREAMING_SNAKE_CASE_	     =       {
    't5-small': 512,
    't5-base': 512,
    't5-large': 512,
    't5-3b': 512,
    't5-11b': 512,
}

SCREAMING_SNAKE_CASE_	     =       '▁'

class 				snake_case_			(					__snake_case			):







   """simple docstring"""




   A_				      =       VOCAB_FILES_NAMES
   A_				      =       PRETRAINED_VOCAB_FILES_MAP
   A_				      =       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   A_				      =       ["""input_ids""", """attention_mask"""]







   def __init__(		self       ,					lowerCamelCase_       ,					lowerCamelCase_="</s>"       ,					lowerCamelCase_="<unk>"       ,					lowerCamelCase_="<pad>"       ,					lowerCamelCase_=1_0_0       ,					lowerCamelCase_=None       ,					lowerCamelCase_ = None       ,					lowerCamelCase_=True       ,					**lowerCamelCase_       ,					)				->   None:
       # Add extra_ids to the special token list
       if extra_ids > 0 and additional_special_tokens is None:
           UpperCamelCase              =	[F'<extra_id_{i}>' for i in range(lowerCamelCase_)]
       elif extra_ids > 0 and additional_special_tokens is not None:
           # Check that we have the right number of extra_id special tokens
           UpperCamelCase              =	len(set(filter(lambda lowerCamelCase_: bool('''extra_id''' in str(lowerCamelCase_))       ,					lowerCamelCase_)))
           if extra_tokens != extra_ids:
               raise ValueError(
                   F'Both extra_ids ({extra_ids}) and additional_special_tokens ({additional_special_tokens}) are'
                   ''' provided to T5Tokenizer. In this case the additional_special_tokens must include the extra_ids'''
                   ''' tokens''')
       if legacy:
           logger.warning_once(
               F'You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to'
               ''' read the related pull request available at https://github.com/huggingface/transformers/pull/24565''')

       UpperCamelCase              =	legacy
       UpperCamelCase              =	{} if sp_model_kwargs is None else sp_model_kwargs

       super().__init__(
           eos_token=lowerCamelCase_       ,					unk_token=lowerCamelCase_       ,					pad_token=lowerCamelCase_       ,					extra_ids=lowerCamelCase_       ,					additional_special_tokens=lowerCamelCase_       ,					sp_model_kwargs=self.sp_model_kwargs       ,					legacy=lowerCamelCase_       ,					**lowerCamelCase_       ,					)

       UpperCamelCase              =	vocab_file
       UpperCamelCase              =	extra_ids

       UpperCamelCase              =	spm.SentencePieceProcessor(**self.sp_model_kwargs)
       self.sp_model.Load(lowerCamelCase_)







   @staticmethod
   def   UpperCAmelCase__			(		lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_)				->   Optional[Any]:
       if pretrained_model_name_or_path in TaTokenizer.max_model_input_sizes:
           UpperCamelCase              =	TaTokenizer.max_model_input_sizes[pretrained_model_name_or_path]
           if init_max_model_length is not None and init_max_model_length != max_model_length:
               return init_max_model_length
           elif init_max_model_length is None:
               warnings.warn(
                   '''This tokenizer was incorrectly instantiated with a model max length of'''
                   F' {deprecated_max_model_length} which will be corrected in Transformers v5.\nFor now, this'
                   ''' behavior is kept to avoid breaking backwards compatibility when padding/encoding with'''
                   ''' `truncation is True`.\n- Be aware that you SHOULD NOT rely on'''
                   F' {pretrained_model_name_or_path} automatically truncating your input to'
                   F' {deprecated_max_model_length} when padding/encoding.\n- If you want to encode/pad to sequences'
                   F' longer than {deprecated_max_model_length} you can either instantiate this tokenizer with'
                   ''' `model_max_length` or pass `max_length` when encoding/padding.\n- To avoid this warning, please'''
                   ''' instantiate this tokenizer with `model_max_length` set to your preferred value.'''       ,					lowerCamelCase_       ,					)

       return max_model_length







   @property
   def   UpperCAmelCase__			(		self)				->   int:
       return self.sp_model.get_piece_size() + self._extra_ids







   def   UpperCAmelCase__			(		self)				->   Dict:
       UpperCamelCase              =	{self.convert_ids_to_tokens(lowerCamelCase_): i for i in range(self.vocab_size)}
       vocab.update(self.added_tokens_encoder)
       return vocab







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					lowerCamelCase_ = None       ,					lowerCamelCase_ = False)				->   List[int]:
       if already_has_special_tokens:
           return super().get_special_tokens_mask(
               token_ids_a=lowerCamelCase_       ,					token_ids_a=lowerCamelCase_       ,					already_has_special_tokens=lowerCamelCase_)

       # normal case: some special tokens
       if token_ids_a is None:
           return ([0] * len(lowerCamelCase_)) + [1]
       return ([0] * len(lowerCamelCase_)) + [1] + ([0] * len(lowerCamelCase_)) + [1]







   def   UpperCAmelCase__			(		self)				->   Optional[Any]:
       return list(
           set(filter(lambda lowerCamelCase_: bool(re.search(R'''<extra_id_\d+>'''       ,					lowerCamelCase_)) is not None       ,					self.additional_special_tokens)))







   def   UpperCAmelCase__			(		self)				->   Tuple:
       return [self._convert_token_to_id(lowerCamelCase_) for token in self.get_sentinel_tokens()]







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_)				->   List[int]:
       if len(lowerCamelCase_) > 0 and token_ids[-1] == self.eos_token_id:
           warnings.warn(
               F'This sequence already has {self.eos_token}. In future versions this behavior may lead to duplicated'
               ''' eos tokens being added.''')
           return token_ids
       else:
           return token_ids + [self.eos_token_id]







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					lowerCamelCase_ = None)				->   List[int]:
       UpperCamelCase              =	[self.eos_token_id]

       if token_ids_a is None:
           return len(token_ids_a + eos) * [0]
       return len(token_ids_a + eos + token_ids_a + eos) * [0]







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					lowerCamelCase_ = None)				->   List[int]:
       UpperCamelCase              =	self._add_eos_if_not_present(lowerCamelCase_)
       if token_ids_a is None:
           return token_ids_a
       else:
           UpperCamelCase              =	self._add_eos_if_not_present(lowerCamelCase_)
           return token_ids_a + token_ids_a







   def __getstate__(		self)				->   Optional[Any]:
       UpperCamelCase              =	self.__dict__.copy()
       UpperCamelCase              =	None
       return state







   def __setstate__(		self       ,					lowerCamelCase_)				->   Tuple:
       UpperCamelCase              =	d

       # for backward compatibility
       if not hasattr(self       ,					'''sp_model_kwargs'''):
           UpperCamelCase              =	{}

       UpperCamelCase              =	spm.SentencePieceProcessor(**self.sp_model_kwargs)
       self.sp_model.Load(self.vocab_file)







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					**lowerCamelCase_)				->   List[str]:
       # Replace the SPIECE_UNDERLINE with a space to make sure SPIECE_UNDERLINE is only used at
       # the beginning of the text
       if not self.legacy:
           UpperCamelCase              =	SPIECE_UNDERLINE + text.replace(lowerCamelCase_       ,					''' ''')
       return super().tokenize(lowerCamelCase_       ,					**lowerCamelCase_)







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					**lowerCamelCase_)				->   List[str]:
       if not self.legacy:
           UpperCamelCase              =	text.startswith(lowerCamelCase_)
           if is_first:
               UpperCamelCase              =	text[1:]

       UpperCamelCase              =	self.sp_model.encode(lowerCamelCase_       ,					out_type=lowerCamelCase_)

       if not self.legacy and not is_first and not text.startswith(''' ''') and tokens[0].startswith(lowerCamelCase_):
           UpperCamelCase              =	([tokens[0][1:]] if len(tokens[0]) > 1 else []) + tokens[1:]
       return tokens







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_)				->   Any:
       if token.startswith('''<extra_id_'''):
           UpperCamelCase              =	re.match(R'''<extra_id_(\d+)>'''       ,					lowerCamelCase_)
           UpperCamelCase              =	int(match.group(1))
           return self.vocab_size - num - 1
       return self.sp_model.piece_to_id(lowerCamelCase_)







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_)				->   Optional[Any]:
       if index < self.sp_model.get_piece_size():
           UpperCamelCase              =	self.sp_model.IdToPiece(lowerCamelCase_)
       else:
           UpperCamelCase              =	F'<extra_id_{self.vocab_size - 1 - index}>'
       return token







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_)				->   Any:
       UpperCamelCase              =	[]
       UpperCamelCase              =	""""""
       UpperCamelCase              =	False
       for token in tokens:
           # make sure that special tokens are not decoded using sentencepiece model
           if token in self.all_special_tokens:
               if not prev_is_special:
                   out_string += " "
               out_string += self.sp_model.decode(lowerCamelCase_) + token
               UpperCamelCase              =	True
               UpperCamelCase              =	[]
           else:
               current_sub_tokens.append(lowerCamelCase_)
               UpperCamelCase              =	False
       out_string += self.sp_model.decode(lowerCamelCase_)
       return out_string.strip()







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					lowerCamelCase_ = None)				->   Tuple[str]:
       if not os.path.isdir(lowerCamelCase_):
           logger.error(F'Vocabulary path ({save_directory}) should be a directory')
           return
       UpperCamelCase              =	os.path.join(
           lowerCamelCase_       ,					(filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file'''])

       if os.path.abspath(self.vocab_file) != os.path.abspath(lowerCamelCase_) and os.path.isfile(self.vocab_file):
           copyfile(self.vocab_file       ,					lowerCamelCase_)
       elif not os.path.isfile(self.vocab_file):
           with open(lowerCamelCase_       ,					'''wb''') as fi:
               UpperCamelCase              =	self.sp_model.serialized_model_proto()
               fi.write(lowerCamelCase_)

       return (out_vocab_file,)







"""simple docstring"""







import copy
import inspect
import unittest

from transformers import PretrainedConfig, SwiftFormerConfig
from transformers.testing_utils import (
    require_torch,
    require_vision,
    slow,
    torch_device,
)
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
				import torch
				from torch import nn

				from transformers import SwiftFormerForImageClassification, SwiftFormerModel
				from transformers.models.swiftformer.modeling_swiftformer import SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
				from PIL import Image

				from transformers import ViTImageProcessor


class      UpperCamelCase		:






						def __init__(		self  :Union[str, Any]			, __magic_name__  :Any			, __magic_name__  :List[str]=13			, __magic_name__  :Any=3			, __magic_name__  :str=True			, __magic_name__  :int=True			, __magic_name__  :Dict=0.1			, __magic_name__  :Optional[int]=0.1			, __magic_name__  :List[str]=224			, __magic_name__  :Any=1_000			, __magic_name__  :int=[3, 3, 6, 4]			, __magic_name__  :int=[48, 56, 112, 220]			, )      ->int:
										lowercase    :      Dict       = parent
										lowercase    :      List[str]       = batch_size
										lowercase    :      Union[str, Any]       = num_channels
										lowercase    :      Dict       = is_training
										lowercase    :      Any       = use_labels
										lowercase    :      Dict       = hidden_dropout_prob
										lowercase    :      Union[str, Any]       = attention_probs_dropout_prob
										lowercase    :      Optional[Any]       = num_labels
										lowercase    :      Optional[Any]       = image_size
										lowercase    :      Optional[int]       = layer_depths
										lowercase    :      Optional[int]       = embed_dims






						def      __snake_case      (		self  :Tuple				)      ->str:
										lowercase    :      Dict       = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)

										lowercase    :      Optional[Any]       = None
										if self.use_labels:
														lowercase    :      str       = ids_tensor([self.batch_size]			, self.num_labels				)

										lowercase    :      List[Any]       = self.get_config()

										return config, pixel_values, labels






						def      __snake_case      (		self  :Dict				)      ->Union[str, Any]:
										return SwiftFormerConfig(
										    depths=self.layer_depths			, embed_dims=self.embed_dims			, mlp_ratio=4			, downsamples=[True, True, True, True]			, hidden_act="""gelu"""			, num_labels=self.num_labels			, down_patch_size=3			, down_stride=2			, down_pad=1			, drop_rate=0.0			, drop_path_rate=0.0			, use_layer_scale=__magic_name__			, layer_scale_init_value=1E-5			, )






						def      __snake_case      (		self  :List[str]			, __magic_name__  :Union[str, Any]			, __magic_name__  :Dict			, __magic_name__  :Dict				)      ->Optional[Any]:
										lowercase    :      Optional[int]       = SwiftFormerModel(config=__magic_name__				)
										model.to(__magic_name__				)
										model.eval()
										lowercase    :      Union[str, Any]       = model(__magic_name__				)
										self.parent.assertEqual(result.last_hidden_state.shape			, (self.batch_size, self.embed_dims[-1], 7, 7)				)






						def      __snake_case      (		self  :Any			, __magic_name__  :Any			, __magic_name__  :Tuple			, __magic_name__  :Any				)      ->Union[str, Any]:
										lowercase    :      Optional[int]       = self.num_labels
										lowercase    :      List[str]       = SwiftFormerForImageClassification(__magic_name__				)
										model.to(__magic_name__				)
										model.eval()
										lowercase    :      List[Any]       = model(__magic_name__			, labels=__magic_name__				)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.num_labels)				)

										lowercase    :      Union[str, Any]       = SwiftFormerForImageClassification(__magic_name__				)
										model.to(__magic_name__				)
										model.eval()

										lowercase    :      Tuple       = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)
										lowercase    :      Union[str, Any]       = model(__magic_name__				)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.num_labels)				)






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:
										((lowercase)      ,      (lowercase)      ,      (lowercase))    :      Optional[Any]       = self.prepare_config_and_inputs()
										lowercase    :      Any       = {"""pixel_values""": pixel_values}
										return config, inputs_dict


@require_torch
class      UpperCamelCase		(__snake_case						,						__snake_case						,						unittest.TestCase     ):
						_SCREAMING_SNAKE_CASE  : List[str]												=		(SwiftFormerModel, SwiftFormerForImageClassification) if is_torch_available() else ()
						_SCREAMING_SNAKE_CASE  : Any												=		(
						    {"""feature-extraction""": SwiftFormerModel, """image-classification""": SwiftFormerForImageClassification}
						    if is_torch_available()
						    else {}
						)

						_SCREAMING_SNAKE_CASE  : Optional[Any]												=		False
						_SCREAMING_SNAKE_CASE  : Optional[Any]												=		False
						_SCREAMING_SNAKE_CASE  : List[str]												=		False
						_SCREAMING_SNAKE_CASE  : Tuple												=		False
						_SCREAMING_SNAKE_CASE  : List[Any]												=		False






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:
										lowercase    :      Optional[Any]       = SwiftFormerModelTester(self				)
										lowercase    :      List[str]       = ConfigTester(
										    self			, config_class=__magic_name__			, has_text_modality=__magic_name__			, hidden_size=37			, num_attention_heads=12			, num_hidden_layers=12			, )






						def      __snake_case      (		self  :Union[str, Any]				)      ->Union[str, Any]:
										self.config_tester.run_common_tests()






						@unittest.skip(reason="""SwiftFormer does not use inputs_embeds"""				)
						def      __snake_case      (		self  :Any				)      ->Any:
										pass






						def      __snake_case      (		self  :Optional[int]				)      ->List[Any]:
										lowercase      ,      lowercase    :      Optional[Any]       = self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
														lowercase    :      Dict       = model_class(__magic_name__				)
														lowercase    :      int       = model.get_output_embeddings()
														self.assertTrue(x is None or isinstance(__magic_name__			, nn.Linear				)				)






						def      __snake_case      (		self  :Any				)      ->List[str]:
										lowercase      ,      lowercase    :      int       = self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
														lowercase    :      Union[str, Any]       = model_class(__magic_name__				)
														lowercase    :      Tuple       = inspect.signature(model.forward				)
														# signature.parameters is an OrderedDict => so arg_names order is deterministic
														lowercase    :      str       = [*signature.parameters.keys()]

														lowercase    :      Any       = ["""pixel_values"""]
														self.assertListEqual(arg_names[:1]			, __magic_name__				)






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:
										lowercase    :      Union[str, Any]       = self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_model(*__magic_name__				)






						def      __snake_case      (		self  :List[Any]				)      ->List[str]:
										lowercase    :      Any       = self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_image_classification(*__magic_name__				)






						@slow
						def      __snake_case      (		self  :Any				)      ->Dict:
										for model_name in SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														lowercase    :      List[Any]       = SwiftFormerModel.from_pretrained(__magic_name__				)
														self.assertIsNotNone(__magic_name__				)






						@unittest.skip(reason="""SwiftFormer does not output attentions"""				)
						def      __snake_case      (		self  :List[str]				)      ->Optional[Any]:
										pass






						def      __snake_case      (		self  :List[str]				)      ->List[str]:
										def check_hidden_states_output(__magic_name__  :str			, __magic_name__  :Optional[Any]			, __magic_name__  :Tuple				):
														lowercase    :      Optional[Any]       = model_class(__magic_name__				)
														model.to(__magic_name__				)
														model.eval()

														with torch.no_grad():
																		lowercase    :      Dict       = model(**self._prepare_for_class(__magic_name__			, __magic_name__				)				)

														lowercase    :      Tuple       = outputs.hidden_states

														lowercase    :      List[str]       = 8
														self.assertEqual(len(__magic_name__				)			, __magic_name__				)  # TODO

														# SwiftFormer's feature maps are of shape (batch_size, embed_dims, height, width)
														# with the width and height being successively divided by 2, after every 2 blocks
														for i in range(len(__magic_name__				)				):
																		self.assertEqual(
																		    hidden_states[i].shape			, torch.Size(
																		        [
																		            self.model_tester.batch_size,
																		            self.model_tester.embed_dims[i // 2],
																		            (self.model_tester.image_size // 4) // 2 ** (i // 2),
																		            (self.model_tester.image_size // 4) // 2 ** (i // 2),
																		        ]				)			, )

										lowercase      ,      lowercase    :      Optional[Any]       = self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
														lowercase    :      Optional[int]       = True
														check_hidden_states_output(__magic_name__			, __magic_name__			, __magic_name__				)

														# check that output_hidden_states also work using config
														del inputs_dict["output_hidden_states"]
														lowercase    :      Any       = True

														check_hidden_states_output(__magic_name__			, __magic_name__			, __magic_name__				)






						def      __snake_case      (		self  :Any				)      ->Optional[int]:
										def _config_zero_init(__magic_name__  :List[Any]				):
														lowercase    :      Tuple       = copy.deepcopy(__magic_name__				)
														for key in configs_no_init.__dict__.keys():
																		if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
																						setattr(__magic_name__			, __magic_name__			, 1E-10				)
																		if isinstance(getattr(__magic_name__			, __magic_name__			, __magic_name__				)			, __magic_name__				):
																						lowercase    :      Any       = _config_zero_init(getattr(__magic_name__			, __magic_name__				)				)
																						setattr(__magic_name__			, __magic_name__			, __magic_name__				)
														return configs_no_init

										lowercase      ,      lowercase    :      Dict       = self.model_tester.prepare_config_and_inputs_for_common()

										lowercase    :      int       = _config_zero_init(__magic_name__				)
										for model_class in self.all_model_classes:
														lowercase    :      Union[str, Any]       = model_class(config=__magic_name__				)
														for name, param in model.named_parameters():
																		if param.requires_grad:
																						self.assertIn(
																						    ((param.data.mean() * 1E9) / 1E9).round().item()			, [0.0, 1.0]			, msg=f"""Parameter {name} of model {model_class} seems not properly initialized"""			, )






						@unittest.skip("""Will be fixed soon by reducing the size of the model used for common tests."""				)
						def      __snake_case      (		self  :Any				)      ->Any:
										pass


def      UpperCamelCase       ( )     ->       Tuple:
				lowercase    :      int       = Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png""" )
				return image


@require_torch
@require_vision
class      UpperCamelCase		(unittest.TestCase     ):






						@cached_property
						def      __snake_case      (		self  :Optional[Any]				)      ->List[str]:
										return ViTImageProcessor.from_pretrained("""MBZUAI/swiftformer-xs"""				) if is_vision_available() else None






						@slow
						def      __snake_case      (		self  :Optional[int]				)      ->int:
										lowercase    :      Union[str, Any]       = SwiftFormerForImageClassification.from_pretrained("""MBZUAI/swiftformer-xs"""				).to(__magic_name__				)

										lowercase    :      Any       = self.default_image_processor
										lowercase    :      str       = prepare_img()
										lowercase    :      Tuple       = image_processor(images=__magic_name__			, return_tensors="""pt"""				).to(__magic_name__				)

										# forward pass
										with torch.no_grad():
														lowercase    :      Union[str, Any]       = model(**__magic_name__				)

										# verify the logits
										lowercase    :      Optional[int]       = torch.Size((1, 1_000)				)
										self.assertEqual(outputs.logits.shape			, __magic_name__				)

										lowercase    :      Optional[Any]       = torch.tensor([[-2.17_03E00, 2.11_07E00, -2.08_11E00]]				).to(__magic_name__				)
										self.assertTrue(torch.allclose(outputs.logits[0, :3]			, __magic_name__			, atol=1E-4				)				)
