


from __future__ import annotations

import unittest

from transformers import EsmConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
       import numpy
       import tensorflow as tf

       from transformers.models.esm.modeling_tf_esm import (
           TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST,
           TFEsmForMaskedLM,
           TFEsmForSequenceClassification,
           TFEsmForTokenClassification,
           TFEsmModel,
       )

class       __magic_name__	:


     def __init__(      self							:     List[str]							,	lowerCamelCase__							:     Tuple							,	)  ->      Tuple:





      '''simple docstring'''






      UpperCamelCase__					:    Optional[int]          =   parent
      UpperCamelCase__					:    int          =   13
      UpperCamelCase__					:    Tuple          =   7
      UpperCamelCase__					:    Optional[Any]          =   True
      UpperCamelCase__					:    Dict          =   True
      UpperCamelCase__					:    List[str]          =   True
      UpperCamelCase__					:    Optional[Any]          =   99
      UpperCamelCase__					:    Dict          =   32
      UpperCamelCase__					:    Any          =   2
      UpperCamelCase__					:    int          =   4
      UpperCamelCase__					:    Optional[int]          =   37
      UpperCamelCase__					:    Optional[Any]          =   '''gelu'''
      UpperCamelCase__					:    Union[str, Any]          =   0.1
      UpperCamelCase__					:    Union[str, Any]          =   0.1
      UpperCamelCase__					:    Dict          =   512
      UpperCamelCase__					:    int          =   16
      UpperCamelCase__					:    str          =   2
      UpperCamelCase__					:    Dict          =   0.02
      UpperCamelCase__					:    Optional[int]          =   3
      UpperCamelCase__					:    Optional[int]          =   4
      UpperCamelCase__					:    str          =   None


     def      UpperCAmelCase__	(      self							:     str			)  ->      Any:





      '''simple docstring'''






      UpperCamelCase__					:    int          =   ids_tensor([self.batch_size, self.seq_length]							,	self.vocab_size			)

      UpperCamelCase__					:    int          =   None
      if self.use_input_mask:
       UpperCamelCase__					:    Tuple          =   random_attention_mask([self.batch_size, self.seq_length]			)

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

      UpperCamelCase__					:    Dict          =   EsmConfig(
          vocab_size=self.vocab_size							,	hidden_size=self.hidden_size							,	num_hidden_layers=self.num_hidden_layers							,	pad_token_id=1							,	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							,	)

      return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels


     def      UpperCAmelCase__	(      self							:     Optional[Any]			)  ->      List[Any]:





      '''simple docstring'''






      (
          (
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				
      )					:    List[Any]          =   self.prepare_config_and_inputs()

      UpperCamelCase__					:    Dict          =   True
      UpperCamelCase__					:    int          =   floats_tensor([self.batch_size, self.seq_length, self.hidden_size]			)
      UpperCamelCase__					:    Optional[Any]          =   ids_tensor([self.batch_size, self.seq_length]							,	vocab_size=2			)

      return (
          config,
          input_ids,
          input_mask,
          sequence_labels,
          token_labels,
          choice_labels,
          encoder_hidden_states,
          encoder_attention_mask,
      )


     def      UpperCAmelCase__	(      self							:     Any							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     Dict							,	lowerCamelCase__							:     Union[str, Any]							,	lowerCamelCase__							:     Dict							,	lowerCamelCase__							:     Dict			)  ->      List[Any]:





      '''simple docstring'''






      UpperCamelCase__					:    Union[str, Any]          =   TFEsmModel(config=lowerCamelCase__			)
      UpperCamelCase__					:    int          =   {'''input_ids''': input_ids, '''attention_mask''': input_mask}
      UpperCamelCase__					:    int          =   model(lowerCamelCase__			)

      UpperCamelCase__					:    Any          =   [input_ids, input_mask]
      UpperCamelCase__					:    Dict          =   model(lowerCamelCase__			)

      UpperCamelCase__					:    str          =   model(lowerCamelCase__			)

      self.parent.assertEqual(result.last_hidden_state.shape							,	(self.batch_size, self.seq_length, self.hidden_size)			)


     def      UpperCAmelCase__	(      self							:     List[Any]							,	lowerCamelCase__							:     List[Any]							,	lowerCamelCase__							:     Dict							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     Optional[Any]							,	lowerCamelCase__							:     Dict							,	lowerCamelCase__							:     Tuple							,	lowerCamelCase__							:     List[Any]							,	lowerCamelCase__							:     Optional[Any]							,	)  ->      Dict:





      '''simple docstring'''






      UpperCamelCase__					:    List[Any]          =   True

      UpperCamelCase__					:    Optional[Any]          =   TFEsmModel(config=lowerCamelCase__			)
      UpperCamelCase__					:    Optional[Any]          =   {
          '''input_ids''': input_ids,
          '''attention_mask''': input_mask,
          '''encoder_hidden_states''': encoder_hidden_states,
          '''encoder_attention_mask''': encoder_attention_mask,
      }
      UpperCamelCase__					:    Tuple          =   model(lowerCamelCase__			)

      UpperCamelCase__					:    List[str]          =   [input_ids, input_mask]
      UpperCamelCase__					:    Optional[Any]          =   model(lowerCamelCase__							,	encoder_hidden_states=lowerCamelCase__			)

      # Also check the case where encoder outputs are not passed
      UpperCamelCase__					:    List[str]          =   model(lowerCamelCase__							,	attention_mask=lowerCamelCase__			)

      self.parent.assertEqual(result.last_hidden_state.shape							,	(self.batch_size, self.seq_length, self.hidden_size)			)


     def      UpperCAmelCase__	(      self							:     Optional[int]							,	lowerCamelCase__							:     Dict							,	lowerCamelCase__							:     int							,	lowerCamelCase__							:     Optional[Any]							,	lowerCamelCase__							:     List[Any]							,	lowerCamelCase__							:     Optional[Any]							,	lowerCamelCase__							:     List[Any]			)  ->      Any:





      '''simple docstring'''






      UpperCamelCase__					:    int          =   TFEsmForMaskedLM(config=lowerCamelCase__			)
      UpperCamelCase__					:    List[str]          =   model([input_ids, input_mask]			)
      self.parent.assertEqual(result.logits.shape							,	(self.batch_size, self.seq_length, self.vocab_size)			)


     def      UpperCAmelCase__	(      self							:     Dict							,	lowerCamelCase__							:     List[Any]							,	lowerCamelCase__							:     Any							,	lowerCamelCase__							:     Optional[Any]							,	lowerCamelCase__							:     Dict							,	lowerCamelCase__							:     Optional[Any]							,	lowerCamelCase__							:     str			)  ->      str:





      '''simple docstring'''






      UpperCamelCase__					:    Optional[Any]          =   self.num_labels
      UpperCamelCase__					:    List[Any]          =   TFEsmForTokenClassification(config=lowerCamelCase__			)
      UpperCamelCase__					:    Any          =   {'''input_ids''': input_ids, '''attention_mask''': input_mask}
      UpperCamelCase__					:    Any          =   model(lowerCamelCase__			)
      self.parent.assertEqual(result.logits.shape							,	(self.batch_size, self.seq_length, self.num_labels)			)


     def      UpperCAmelCase__	(      self							:     Union[str, Any]			)  ->      Tuple:





      '''simple docstring'''






      UpperCamelCase__					:    Any          =   self.prepare_config_and_inputs()
      (
          (
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				(
          UpperCamelCase__
      )       ,				
      )					:    int          =   config_and_inputs
      UpperCamelCase__					:    Tuple          =   {'''input_ids''': input_ids, '''attention_mask''': input_mask}
      return config, inputs_dict



@require_tf
class       __magic_name__	(     __lowerCAmelCase					,				__lowerCAmelCase					,				unittest.TestCase):
     A:		Any			=      (
         (
             TFEsmModel,
             TFEsmForMaskedLM,
             TFEsmForSequenceClassification,
             TFEsmForTokenClassification,
         )
         if is_tf_available()
         else ()
     )
     A:		Dict			=      (
         {
             "feature-extraction": TFEsmModel,
             "fill-mask": TFEsmForMaskedLM,
             "text-classification": TFEsmForSequenceClassification,
             "token-classification": TFEsmForTokenClassification,
             "zero-shot": TFEsmForSequenceClassification,
         }
         if is_tf_available()
         else {}
     )
     A:		Optional[Any]			=      False
     A:		Union[str, Any]			=      False


     def      UpperCAmelCase__	(      self							:     Union[str, Any]			)  ->      Any:





      '''simple docstring'''






      UpperCamelCase__					:    Union[str, Any]          =   TFEsmModelTester(self			)
      UpperCamelCase__					:    Optional[Any]          =   ConfigTester(self							,	config_class=lowerCamelCase__							,	hidden_size=37			)


     def      UpperCAmelCase__	(      self							:     Any			)  ->      Any:





      '''simple docstring'''






      self.config_tester.run_common_tests()


     def      UpperCAmelCase__	(      self							:     List[str]			)  ->      Optional[int]:





      '''simple docstring'''






      UpperCamelCase__					:    Optional[Any]          =   self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*lowerCamelCase__			)


     def      UpperCAmelCase__	(      self							:     int			)  ->      Any:





      '''simple docstring'''






      UpperCamelCase__					:    List[str]          =   self.model_tester.prepare_config_and_inputs_for_decoder()
      self.model_tester.create_and_check_model_as_decoder(*lowerCamelCase__			)


     def      UpperCAmelCase__	(      self							:     Tuple			)  ->      Optional[int]:





      '''simple docstring'''






      UpperCamelCase__					:    Optional[int]          =   self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_masked_lm(*lowerCamelCase__			)


     def      UpperCAmelCase__	(      self							:     Dict			)  ->      List[Any]:





      '''simple docstring'''






      UpperCamelCase__					:    Union[str, Any]          =   self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_token_classification(*lowerCamelCase__			)


     @slow
     def      UpperCAmelCase__	(      self							:     Dict			)  ->      Optional[int]:





      '''simple docstring'''






      for model_name in TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
       UpperCamelCase__					:    Tuple          =   TFEsmModel.from_pretrained(lowerCamelCase__			)
       self.assertIsNotNone(lowerCamelCase__			)


     @unittest.skip('''Protein models do not support embedding resizing.'''			)
     def      UpperCAmelCase__	(      self							:     Dict			)  ->      Union[str, Any]:





      '''simple docstring'''






      pass


     @unittest.skip('''Protein models do not support embedding resizing.'''			)
     def      UpperCAmelCase__	(      self							:     List[Any]			)  ->      Optional[int]:





      '''simple docstring'''






      pass


     def      UpperCAmelCase__	(      self							:     str			)  ->      int:





      '''simple docstring'''






      UpperCamelCase__       ,				UpperCamelCase__					:    str          =   self.model_tester.prepare_config_and_inputs_for_common()

      for model_class in self.all_model_classes:
       UpperCamelCase__					:    List[Any]          =   model_class(lowerCamelCase__			)
       assert isinstance(model.get_input_embeddings()							,	tf.keras.layers.Layer			)
       if model_class is TFEsmForMaskedLM:
        # Output embedding test differs from the main test because they're a matrix, not a layer
        UpperCamelCase__					:    int          =   model.get_bias()
        assert isinstance(lowerCamelCase__							,	lowerCamelCase__			)
        for k, v in name.items():
         assert isinstance(lowerCamelCase__							,	tf.Variable			)
       else:
        UpperCamelCase__					:    Dict          =   model.get_output_embeddings()
        assert x is None
        UpperCamelCase__					:    Optional[Any]          =   model.get_bias()
        assert name is None



@require_tf
class       __magic_name__	(     unittest.TestCase):


     @slow
     def      UpperCAmelCase__	(      self							:     Union[str, Any]			)  ->      Dict:





      '''simple docstring'''






      UpperCamelCase__					:    Dict          =   TFEsmForMaskedLM.from_pretrained('''facebook/esm2_t6_8M_UR50D'''			)

      UpperCamelCase__					:    Optional[int]          =   tf.constant([[0, 1, 2, 3, 4, 5]]			)
      UpperCamelCase__					:    List[Any]          =   model(lowerCamelCase__			)[0]
      UpperCamelCase__					:    Tuple          =   [1, 6, 33]
      self.assertEqual(list(output.numpy().shape			)							,	lowerCamelCase__			)
      # compare the actual values for a slice.
      UpperCamelCase__					:    List[str]          =   tf.constant(
          [
              [
                  [8.92_1518, -10.58_9814, -6.467_1307],
                  [-6.396_7156, -13.91_1377, -1.121_1915],
                  [-7.78_1247, -13.95_1557, -3.74_0592],
              ]
          ]			)
      self.assertTrue(numpy.allclose(output[:, :3, :3].numpy()							,	expected_slice.numpy()							,	atol=1E-2			)			)


     @slow
     def      UpperCAmelCase__	(      self							:     Optional[Any]			)  ->      str:





      '''simple docstring'''






      UpperCamelCase__					:    Dict          =   TFEsmModel.from_pretrained('''facebook/esm2_t6_8M_UR50D'''			)

      UpperCamelCase__					:    Any          =   tf.constant([[0, 6, 4, 13, 5, 4, 16, 12, 11, 7, 2]]			)
      UpperCamelCase__					:    Optional[Any]          =   model(lowerCamelCase__			)[0]
      # compare the actual values for a slice.
      UpperCamelCase__					:    List[Any]          =   tf.constant(
          [
              [
                  [0.1444_3092, 0.5412_5327, 0.324_7739],
                  [0.3034_0484, 0.0052_6676, 0.3107_7722],
                  [0.3227_8043, -0.2498_7096, 0.341_4628],
              ]
          ]			)
      self.assertTrue(numpy.allclose(output[:, :3, :3].numpy()							,	expected_slice.numpy()							,	atol=1E-4			)			)






import os
import time
from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, List, Optional, Union

import torch
from filelock import FileLock
from torch.utils.data import Dataset

from ...models.auto.modeling_auto import MODEL_FOR_QUESTION_ANSWERING_MAPPING
from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging
from ..processors.squad import SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features


__UpperCamelCase       :       List[str]						       =				logging.get_logger(__name__)

__UpperCamelCase       :       Union[str, Any]						       =				list(MODEL_FOR_QUESTION_ANSWERING_MAPPING.keys())
__UpperCamelCase       :       Dict						       =				tuple(conf.model_type for conf in MODEL_CONFIG_CLASSES)

@dataclass
class       __magic_name__	:
     A:		str			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Model type selected in the list: " + ", ".join(__lowerCAmelCase)})
     A:		str			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "The input data dir. Should contain the .json files for the SQuAD task."})
     A:		int			=      field(
         default=1_2_8					,				metadata={
             "help": (
                 "The maximum total input sequence length after tokenization. Sequences longer "
                 "than this will be truncated, sequences shorter will be padded."
             )
         }					,				)
     A:		int			=      field(
         default=1_2_8					,				metadata={"help": "When splitting up a long document into chunks, how much stride to take between chunks."}					,				)
     A:		int			=      field(
         default=6_4					,				metadata={
             "help": (
                 "The maximum number of tokens for the question. Questions longer than this will "
                 "be truncated to this length."
             )
         }					,				)
     A:		int			=      field(
         default=3_0					,				metadata={
             "help": (
                 "The maximum length of an answer that can be generated. This is needed because the start "
                 "and end predictions are not conditioned on one another."
             )
         }					,				)
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Overwrite the cached training and evaluation sets"})
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "If true, the SQuAD examples contain some that do not have an answer."})
     A:		float			=      field(
         default=0.0					,				metadata={"help": "If null_score - best_non_null is greater than the threshold predict null."})
     A:		int			=      field(
         default=2_0					,				metadata={"help": "If null_score - best_non_null is greater than the threshold predict null."})
     A:		int			=      field(
         default=0					,				metadata={
             "help": (
                 "language id of input for language-specific xlm models (see"
                 " tokenization_xlm.PRETRAINED_INIT_CONFIGURATION)"
             )
         }					,				)
     A:		int			=      field(default=1					,				metadata={"help": "multiple threads for converting example to features"})



class       __magic_name__	(     __lowerCAmelCase):
     A:		Union[str, Any]			=      "train"
     A:		List[str]			=      "dev"



class       __magic_name__	(     __lowerCAmelCase):
     A:		SquadDataTrainingArguments
     A:		List[SquadFeatures]
     A:		Split
     A:		bool


     def __init__(      self							:     Tuple							,	lowerCamelCase__							:     SquadDataTrainingArguments							,	lowerCamelCase__							:     PreTrainedTokenizer							,	lowerCamelCase__							:     Optional[int] = None							,	lowerCamelCase__							:     Union[str, Split] = Split.train							,	lowerCamelCase__							:     Optional[bool] = False							,	lowerCamelCase__							:     Optional[str] = None							,	lowerCamelCase__							:     Optional[str] = "pt"							,	)  ->      int:





      '''simple docstring'''






      UpperCamelCase__					:    Dict          =   args
      UpperCamelCase__					:    Union[str, Any]          =   is_language_sensitive
      UpperCamelCase__					:    List[Any]          =   SquadVaProcessor() if args.version_2_with_negative else SquadVaProcessor()
      if isinstance(lowerCamelCase__							,	lowerCamelCase__			):
       try:
        UpperCamelCase__					:    Union[str, Any]          =   Split[mode]
       except KeyError:
        raise KeyError('''mode is not a valid split name'''			)
      UpperCamelCase__					:    List[str]          =   mode
      # Load data features from cache or dataset file
      UpperCamelCase__					:    List[str]          =   '''v2''' if args.version_2_with_negative else '''v1'''
      UpperCamelCase__					:    str          =   os.path.join(
          cache_dir if cache_dir is not None else args.data_dir							,	F"cached_{mode.value}_{tokenizer.__class__.__name__}_{args.max_seq_length}_{version_tag}"							,	)

      # Make sure only the first process in distributed training processes the dataset,
      # and the others will use the cache.
      UpperCamelCase__					:    Tuple          =   cached_features_file + '''.lock'''
      with FileLock(lowerCamelCase__			):
       if os.path.exists(lowerCamelCase__			) and not args.overwrite_cache:
        UpperCamelCase__					:    int          =   time.time()
        UpperCamelCase__					:    List[str]          =   torch.load(lowerCamelCase__			)

        # Legacy cache files have only features, while new cache files
        # will have dataset and examples also.
        UpperCamelCase__					:    Any          =   self.old_features['''features''']
        UpperCamelCase__					:    Union[str, Any]          =   self.old_features.get('''dataset'''							,	lowerCamelCase__			)
        UpperCamelCase__					:    List[str]          =   self.old_features.get('''examples'''							,	lowerCamelCase__			)
        logger.info(
            F"Loading features from cached file {cached_features_file} [took %.3f s]"							,	time.time() - start			)

        if self.dataset is None or self.examples is None:
         logger.warning(
             F"Deleting cached file {cached_features_file} will allow dataset and examples to be cached in"
             ''' future run'''			)
       else:
        if mode == Split.dev:
         UpperCamelCase__					:    List[str]          =   self.processor.get_dev_examples(args.data_dir			)
        else:
         UpperCamelCase__					:    Any          =   self.processor.get_train_examples(args.data_dir			)

        UpperCamelCase__       ,				UpperCamelCase__					:    Union[str, Any]          =   squad_convert_examples_to_features(
            examples=self.examples							,	tokenizer=lowerCamelCase__							,	max_seq_length=args.max_seq_length							,	doc_stride=args.doc_stride							,	max_query_length=args.max_query_length							,	is_training=mode == Split.train							,	threads=args.threads							,	return_dataset=lowerCamelCase__							,	)

        UpperCamelCase__					:    Tuple          =   time.time()
        torch.save(
            {'''features''': self.features, '''dataset''': self.dataset, '''examples''': self.examples}							,	lowerCamelCase__							,	)
        # ^ This seems to take a lot of time so I want to investigate why and how we can improve.
        logger.info(
            F"Saving features into cached file {cached_features_file} [took {time.time() - start:.3f} s]"			)


     def __len__(      self							:     Any			)  ->      List[str]:





      '''simple docstring'''






      return len(self.features			)


     def __getitem__(      self							:     Dict							,	lowerCamelCase__							:     Any			)  ->      Dict[str, torch.Tensor]:





      '''simple docstring'''






      UpperCamelCase__					:    List[Any]          =   self.features[i]

      UpperCamelCase__					:    Optional[Any]          =   torch.tensor(feature.input_ids							,	dtype=torch.long			)
      UpperCamelCase__					:    Tuple          =   torch.tensor(feature.attention_mask							,	dtype=torch.long			)
      UpperCamelCase__					:    Optional[int]          =   torch.tensor(feature.token_type_ids							,	dtype=torch.long			)
      UpperCamelCase__					:    int          =   torch.tensor(feature.cls_index							,	dtype=torch.long			)
      UpperCamelCase__					:    List[Any]          =   torch.tensor(feature.p_mask							,	dtype=torch.float			)
      UpperCamelCase__					:    Any          =   torch.tensor(feature.is_impossible							,	dtype=torch.float			)

      UpperCamelCase__					:    Dict          =   {
          '''input_ids''': input_ids,
          '''attention_mask''': attention_mask,
          '''token_type_ids''': token_type_ids,
      }

      if self.args.model_type in ["xlm", "roberta", "distilbert", "camembert"]:
       del inputs["token_type_ids"]

      if self.args.model_type in ["xlnet", "xlm"]:
       inputs.update({'''cls_index''': cls_index, '''p_mask''': p_mask}			)
       if self.args.version_2_with_negative:
        inputs.update({'''is_impossible''': is_impossible}			)
       if self.is_language_sensitive:
        inputs.update({'''langs''': (torch.ones(input_ids.shape							,	dtype=torch.intaa			) * self.args.lang_id)}			)

      if self.mode == Split.train:
       UpperCamelCase__					:    Optional[Any]          =   torch.tensor(feature.start_position							,	dtype=torch.long			)
       UpperCamelCase__					:    Optional[int]          =   torch.tensor(feature.end_position							,	dtype=torch.long			)
       inputs.update({'''start_positions''': start_positions, '''end_positions''': end_positions}			)

      return inputs


