"""simple docstring"""




import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

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


if is_torch_available():
     import torch

     from transformers import (
         RemBertConfig,
         RemBertForCausalLM,
         RemBertForMaskedLM,
         RemBertForMultipleChoice,
         RemBertForQuestionAnswering,
         RemBertForSequenceClassification,
         RemBertForTokenClassification,
         RemBertModel,
     )
     from transformers.models.rembert.modeling_rembert import REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST


class   a__		:


   def __init__(							self      :							Optional[int],     lowerCAmelCase      :							int,     lowerCAmelCase      :							Tuple=13,     lowerCAmelCase      :							Tuple=7,     lowerCAmelCase      :							List[str]=True,     lowerCAmelCase      :							Tuple=True,     lowerCAmelCase      :							int=True,     lowerCAmelCase      :							List[str]=True,     lowerCAmelCase      :							List[str]=99,     lowerCAmelCase      :							List[str]=32,     lowerCAmelCase      :							Dict=18,     lowerCAmelCase      :							List[str]=43,     lowerCAmelCase      :							Tuple=5,     lowerCAmelCase      :							Optional[int]=4,     lowerCAmelCase      :							int=37,     lowerCAmelCase      :							Any="gelu",     lowerCAmelCase      :							Any=0.1,     lowerCAmelCase      :							int=0.1,     lowerCAmelCase      :							Tuple=512,     lowerCAmelCase      :							Optional[int]=16,     lowerCAmelCase      :							str=2,     lowerCAmelCase      :							str=0.02,     lowerCAmelCase      :							Any=3,     lowerCAmelCase      :							Any=4,     lowerCAmelCase      :							List[Any]=None,     )    ->       Dict:
         lowercase  :      Dict					=   parent
         lowercase  :      Dict					=   batch_size
         lowercase  :      Optional[Any]					=   seq_length
         lowercase  :      List[Any]					=   is_training
         lowercase  :      Any					=   use_input_mask
         lowercase  :      Optional[Any]					=   use_token_type_ids
         lowercase  :      List[Any]					=   use_labels
         lowercase  :      List[Any]					=   vocab_size
         lowercase  :      Any					=   hidden_size
         lowercase  :      int					=   input_embedding_size
         lowercase  :      Union[str, Any]					=   output_embedding_size
         lowercase  :      Optional[int]					=   num_hidden_layers
         lowercase  :      str					=   num_attention_heads
         lowercase  :      Union[str, Any]					=   intermediate_size
         lowercase  :      str					=   hidden_act
         lowercase  :      str					=   hidden_dropout_prob
         lowercase  :      Optional[int]					=   attention_probs_dropout_prob
         lowercase  :      Optional[int]					=   max_position_embeddings
         lowercase  :      List[str]					=   type_vocab_size
         lowercase  :      Dict					=   type_sequence_label_size
         lowercase  :      int					=   initializer_range
         lowercase  :      int					=   num_labels
         lowercase  :      Optional[int]					=   num_choices
         lowercase  :      Union[str, Any]					=   scope


   def        lowercase				(							self      :							Optional[Any]			)    ->       Any:
         lowercase  :      Optional[int]					=   ids_tensor([self.batch_size, self.seq_length],     self.vocab_size			)

         lowercase  :      Optional[int]					=   None
         if self.use_input_mask:
               lowercase  :      Optional[Any]					=   random_attention_mask([self.batch_size, self.seq_length]			)

         lowercase  :      Dict					=   None
         if self.use_token_type_ids:
               lowercase  :      Any					=   ids_tensor([self.batch_size, self.seq_length],     self.type_vocab_size			)

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

         lowercase  :      int					=   RemBertConfig(
             vocab_size=self.vocab_size,     hidden_size=self.hidden_size,     input_embedding_size=self.input_embedding_size,     output_embedding_size=self.output_embedding_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,     is_decoder=__lowerCamelCase,     initializer_range=self.initializer_range,     )

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


   def        lowercase				(							self      :							Optional[int]			)    ->       Optional[Any]:
         (
             lowercase    
         )  :      Optional[int]					=   self.prepare_config_and_inputs()

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

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


   def        lowercase				(							self      :							List[str],     lowerCAmelCase      :							Optional[Any],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							List[str],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							str			)    ->       Tuple:
         lowercase  :      Optional[int]					=   RemBertModel(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      int					=   model(__lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase			)
         lowercase  :      Optional[int]					=   model(__lowerCamelCase,     token_type_ids=__lowerCamelCase			)
         lowercase  :      Any					=   model(__lowerCamelCase			)
         self.parent.assertEqual(result.last_hidden_state.shape,     (self.batch_size, self.seq_length, self.hidden_size)			)


   def        lowercase				(							self      :							Union[str, Any],     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							Any,     lowerCAmelCase      :							Any,     lowerCAmelCase      :							Optional[Any],     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							Optional[Any],     )    ->       Optional[Any]:
         lowercase  :      List[Any]					=   True
         lowercase  :      List[Any]					=   RemBertModel(__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      Any					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     encoder_hidden_states=__lowerCamelCase,     encoder_attention_mask=__lowerCamelCase,     )
         lowercase  :      List[str]					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     encoder_hidden_states=__lowerCamelCase,     )
         lowercase  :      Optional[int]					=   model(__lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase			)
         self.parent.assertEqual(result.last_hidden_state.shape,     (self.batch_size, self.seq_length, self.hidden_size)			)


   def        lowercase				(							self      :							str,     lowerCAmelCase      :							Any,     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							Any,     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							int,     lowerCAmelCase      :							Optional[int],     lowerCAmelCase      :							Any,     lowerCAmelCase      :							List[Any],     )    ->       int:
         lowercase  :      int					=   RemBertForCausalLM(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      str					=   model(__lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     labels=__lowerCamelCase			)
         self.parent.assertEqual(result.logits.shape,     (self.batch_size, self.seq_length, self.vocab_size)			)


   def        lowercase				(							self      :							Any,     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							List[str],     lowerCAmelCase      :							Optional[int],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							List[str],     lowerCAmelCase      :							Optional[Any]			)    ->       str:
         lowercase  :      str					=   RemBertForMaskedLM(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      Dict					=   model(__lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     labels=__lowerCamelCase			)
         self.parent.assertEqual(result.logits.shape,     (self.batch_size, self.seq_length, self.vocab_size)			)


   def        lowercase				(							self      :							Optional[Any],     lowerCAmelCase      :							Optional[Any],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							Optional[int],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							int,     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							Tuple,     )    ->       str:
         lowercase  :      Optional[int]					=   True
         lowercase  :      int					=   True
         lowercase  :      int					=   RemBertForCausalLM(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()

         # first forward pass
         lowercase  :      Any					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     encoder_hidden_states=__lowerCamelCase,     encoder_attention_mask=__lowerCamelCase,     use_cache=__lowerCamelCase,     )
         lowercase  :      int					=   outputs.past_key_values

         # create hypothetical multiple next token and extent to next_input_ids
         lowercase  :      Any					=   ids_tensor((self.batch_size, 3),     config.vocab_size			)
         lowercase  :      Optional[int]					=   ids_tensor((self.batch_size, 3),     vocab_size=2			)

         # append to next input_ids and
         lowercase  :      str					=   torch.cat([input_ids, next_tokens],     dim=-1			)
         lowercase  :      Dict					=   torch.cat([input_mask, next_mask],     dim=-1			)

         lowercase  :      Any					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     encoder_hidden_states=__lowerCamelCase,     encoder_attention_mask=__lowerCamelCase,     output_hidden_states=__lowerCamelCase,     )["hidden_states"][0]
         lowercase  :      Dict					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     encoder_hidden_states=__lowerCamelCase,     encoder_attention_mask=__lowerCamelCase,     past_key_values=__lowerCamelCase,     output_hidden_states=__lowerCamelCase,     )["hidden_states"][0]

         # select random slice
         lowercase  :      Any					=   ids_tensor((1,),     output_from_past.shape[-1]			).item()
         lowercase  :      Optional[int]					=   output_from_no_past[:, -3:, random_slice_idx].detach()
         lowercase  :      List[str]					=   output_from_past[:, :, random_slice_idx].detach()

         self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]			)

         # test that outputs are equal for slice
         self.parent.assertTrue(torch.allclose(__lowerCamelCase,     __lowerCamelCase,     atol=1e-3			)			)


   def        lowercase				(							self      :							Union[str, Any],     lowerCAmelCase      :							List[Any],     lowerCAmelCase      :							Union[str, Any],     lowerCAmelCase      :							str,     lowerCAmelCase      :							Optional[int],     lowerCAmelCase      :							List[str],     lowerCAmelCase      :							Optional[int],     lowerCAmelCase      :							Optional[int]			)    ->       List[Any]:
         lowercase  :      List[str]					=   RemBertForQuestionAnswering(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      Tuple					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     start_positions=__lowerCamelCase,     end_positions=__lowerCamelCase,     )
         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        lowercase				(							self      :							Dict,     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							List[Any],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							str,     lowerCAmelCase      :							int,     lowerCAmelCase      :							Tuple,     lowerCAmelCase      :							int			)    ->       List[str]:
         lowercase  :      Union[str, Any]					=   self.num_labels
         lowercase  :      str					=   RemBertForSequenceClassification(__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      int					=   model(__lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     labels=__lowerCamelCase			)
         self.parent.assertEqual(result.logits.shape,     (self.batch_size, self.num_labels)			)


   def        lowercase				(							self      :							str,     lowerCAmelCase      :							int,     lowerCAmelCase      :							Optional[Any],     lowerCAmelCase      :							List[Any],     lowerCAmelCase      :							List[Any],     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							List[str],     lowerCAmelCase      :							Dict			)    ->       Optional[int]:
         lowercase  :      str					=   self.num_labels
         lowercase  :      Tuple					=   RemBertForTokenClassification(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      Optional[int]					=   model(__lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     labels=__lowerCamelCase			)
         self.parent.assertEqual(result.logits.shape,     (self.batch_size, self.seq_length, self.num_labels)			)


   def        lowercase				(							self      :							Dict,     lowerCAmelCase      :							List[str],     lowerCAmelCase      :							str,     lowerCAmelCase      :							Any,     lowerCAmelCase      :							int,     lowerCAmelCase      :							Dict,     lowerCAmelCase      :							int,     lowerCAmelCase      :							Tuple			)    ->       Any:
         lowercase  :      Optional[int]					=   self.num_choices
         lowercase  :      Tuple					=   RemBertForMultipleChoice(config=__lowerCamelCase			)
         model.to(__lowerCamelCase			)
         model.eval()
         lowercase  :      str					=   input_ids.unsqueeze(1			).expand(-1,     self.num_choices,     -1			).contiguous()
         lowercase  :      List[str]					=   token_type_ids.unsqueeze(1			).expand(-1,     self.num_choices,     -1			).contiguous()
         lowercase  :      List[str]					=   input_mask.unsqueeze(1			).expand(-1,     self.num_choices,     -1			).contiguous()
         lowercase  :      Optional[Any]					=   model(
             __lowerCamelCase,     attention_mask=__lowerCamelCase,     token_type_ids=__lowerCamelCase,     labels=__lowerCamelCase,     )
         self.parent.assertEqual(result.logits.shape,     (self.batch_size, self.num_choices)			)






   def        lowercase				(							self      :							Union[str, Any]			)    ->       int:
         lowercase  :      Union[str, Any]					=   self.prepare_config_and_inputs()
         (
             lowercase    
         )  :      Optional[Any]					=   config_and_inputs
         lowercase  :      List[Any]					=   {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
         return config, inputs_dict




@require_torch
class   a__		(						SCREAMING_SNAKE_CASE__,  SCREAMING_SNAKE_CASE__,  unittest.TestCase     ):
   _lowerCamelCase												=				(
       (
           RemBertModel,
           RemBertForMaskedLM,
           RemBertForCausalLM,
           RemBertForMultipleChoice,
           RemBertForQuestionAnswering,
           RemBertForSequenceClassification,
           RemBertForTokenClassification,
       )
       if is_torch_available()
       else ()
   )
   _lowerCamelCase												=				(RemBertForCausalLM,) if is_torch_available() else ()
   _lowerCamelCase												=				(
       {
           'feature-extraction': RemBertModel,
           'fill-mask': RemBertForMaskedLM,
           'question-answering': RemBertForQuestionAnswering,
           'text-classification': RemBertForSequenceClassification,
           'text-generation': RemBertForCausalLM,
           'token-classification': RemBertForTokenClassification,
           'zero-shot': RemBertForSequenceClassification,
       }
       if is_torch_available()
       else {}
   )


   def        lowercase				(							self      :							Optional[int]			)    ->       Any:
         lowercase  :      Any					=   RemBertModelTester(self			)
         lowercase  :      Optional[int]					=   ConfigTester(self,     config_class=__lowerCamelCase,     hidden_size=37			)


   def        lowercase				(							self      :							Optional[Any]			)    ->       Tuple:
         self.config_tester.run_common_tests()


   def        lowercase				(							self      :							Tuple			)    ->       List[Any]:
         lowercase  :      Any					=   self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*__lowerCamelCase			)


   def        lowercase				(							self      :							Tuple			)    ->       Tuple:
         lowercase  :      List[Any]					=   self.model_tester.prepare_config_and_inputs()
         for type in ["absolute", "relative_key", "relative_key_query"]:
               lowercase  :      int					=   type
               self.model_tester.create_and_check_model(*__lowerCamelCase			)


   def        lowercase				(							self      :							str			)    ->       List[str]:
         lowercase  :      Any					=   self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_masked_lm(*__lowerCamelCase			)


   def        lowercase				(							self      :							int			)    ->       Union[str, Any]:
         lowercase  :      Union[str, Any]					=   self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_multiple_choice(*__lowerCamelCase			)


   def        lowercase				(							self      :							List[str]			)    ->       Optional[Any]:
         lowercase  :      List[str]					=   self.model_tester.prepare_config_and_inputs_for_decoder()
         self.model_tester.create_and_check_decoder_model_past_large_inputs(*__lowerCamelCase			)


   def        lowercase				(							self      :							Optional[int]			)    ->       Optional[Any]:
         lowercase  :      Optional[Any]					=   self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_question_answering(*__lowerCamelCase			)


   def        lowercase				(							self      :							List[Any]			)    ->       List[Any]:
         lowercase  :      Any					=   self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_sequence_classification(*__lowerCamelCase			)


   def        lowercase				(							self      :							Tuple			)    ->       int:
         lowercase  :      Optional[int]					=   self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_token_classification(*__lowerCamelCase			)


   def        lowercase				(							self      :							Optional[Any]			)    ->       Dict:
         lowercase  :      List[Any]					=   self.model_tester.prepare_config_and_inputs_for_decoder()
         self.model_tester.create_and_check_model_as_decoder(*__lowerCamelCase			)


   def        lowercase				(							self      :							Any			)    ->       int:
         # This regression test was failing with PyTorch < 1.3
         (
             lowercase    
         )  :      Union[str, Any]					=   self.model_tester.prepare_config_and_inputs_for_decoder()

         lowercase  :      List[Any]					=   None

         self.model_tester.create_and_check_model_as_decoder(
             __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     __lowerCamelCase,     )






   @slow
   def        lowercase				(							self      :							Optional[int]			)    ->       Any:
         for model_name in REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
               lowercase  :      int					=   RemBertModel.from_pretrained(__lowerCamelCase			)
               self.assertIsNotNone(__lowerCamelCase			)




@require_torch
class   a__		(						unittest.TestCase     ):


   @slow
   def        lowercase				(							self      :							str			)    ->       List[str]:
         # Test exact values at the last hidden layer
         lowercase  :      str					=   RemBertModel.from_pretrained('google/rembert'			)
         lowercase  :      List[str]					=   torch.tensor([[312, 56498, 313, 2125, 313]]			)
         lowercase  :      List[Any]					=   torch.tensor([[0, 0, 0, 1, 1]]			)
         with torch.no_grad():
               lowercase  :      Union[str, Any]					=   model(__lowerCamelCase,     token_type_ids=__lowerCamelCase,     output_hidden_states=__lowerCamelCase			)

         lowercase  :      Union[str, Any]					=   1152

         lowercase  :      Dict					=   torch.Size((1, 5, hidden_size)			)
         self.assertEqual(output['last_hidden_state'].shape,     __lowerCamelCase			)

         lowercase  :      Dict					=   torch.tensor(
             [
                 [
                     [0.0754, -0.2022, 0.1904],
                     [-0.3354, -0.3692, -0.4791],
                     [-0.2314, -0.6729, -0.0749],
                     [-0.0396, -0.3105, -0.4234],
                     [-0.1571, -0.0525, 0.5353],
                 ]
             ]			)

         # Running on the original tf implementation gives slightly different results here.
         # Not clear why this variations is present
         # TODO: Find reason for discrepancy
         # expected_original_implementation = [[
         #     [0.07630594074726105, -0.20146065950393677, 0.19107051193714142],
         #     [-0.3405614495277405, -0.36971670389175415, -0.4808273911476135],
         #     [-0.22587086260318756, -0.6656315922737122, -0.07844287157058716],
         #     [-0.04145475849509239, -0.3077218234539032, -0.42316967248916626],
         #     [-0.15887849032878876, -0.054529931396245956, 0.5356100797653198]
         # ]]

         self.assertTrue(torch.allclose(output['last_hidden_state'][:, :, :3],     __lowerCamelCase,     atol=1e-4			)			)





"""simple docstring"""




import abc
import copy
import dataclasses
from dataclasses import dataclass
from typing import ClassVar, Dict, Type, TypeVar

from ..features import Features


_UpperCamelCase:				int    							=  TypeVar('T', bound='TaskTemplate')


@dataclass(frozen=SCREAMING_SNAKE_CASE__     )
class   a__		(						abc.ABC     ):
   # `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
   _lowerCamelCase												=				42
   _lowerCamelCase												=				42
   _lowerCamelCase												=				42


   def        lowercase				(							self      :							T,     lowerCAmelCase      :							Features			)    ->       T:
         return copy.deepcopy(self			)


   @property
   def        lowercase				(							self      :							Union[str, Any]			)    ->       Features:
         return Features(**self.input_schema,     **self.label_schema			)


   @property
   @abc.abstractmethod
   def        lowercase				(							self      :							Tuple			)    ->       Dict[str, str]:
         raise NotImplementedError






   @classmethod
   def        lowercase				(							cls      :							Type[T],     lowerCAmelCase      :							dict			)    ->       T:
         lowercase  :      Union[str, Any]					=   {f.name for f in dataclasses.fields(cls			)}
         return cls(**{k: v for k, v in template_dict.items() if k in field_names}			)
