



'''simple docstring'''




import os
import tempfile
from functools import partial
from unittest import TestCase
from unittest.mock import patch

import numpy as np
import pytest

from datasets.arrow_dataset import Dataset
from datasets.search import ElasticSearchIndex, FaissIndex, MissingIndex

from .utils import require_elasticsearch, require_faiss


lowerCamelCase							:Union[str, Any]       = pytest.mark.integration







@require_faiss
class      _lowerCAmelCase							(      __UpperCAmelCase			):


	def    _a     (self							):
				A_     :						Union[str, Any]     =					Dataset.from_dict({"""filename""": ["""my_name-train""" + """_""" + str(lowercase							) for x in np.arange(30							).tolist()]}							)
				return dset


	def    _a     (self							):
				import faiss

				A_     :						Dataset     =					self._create_dummy_dataset()
				A_     :						Optional[Any]     =					dset.map(
				    lambda lowercase	,				lowercase							: {"vecs": i * np.ones(5	,				dtype=np.floataa							)}	,				with_indices=lowercase	,				keep_in_memory=lowercase							)
				A_     :						int     =					dset.add_faiss_index("""vecs"""	,				batch_size=100	,				metric_type=faiss.METRIC_INNER_PRODUCT							)
				A_,   A_     :						List[Any]     =					dset.get_nearest_examples("""vecs"""	,				np.ones(5	,				dtype=np.floataa							)							)
				self.assertEqual(examples["""filename"""][0]	,				"""my_name-train_29"""							)
				dset.drop_index("""vecs"""							)


	def    _a     (self							):
				import faiss

				A_     :						Dataset     =					self._create_dummy_dataset()
				dset.add_faiss_index_from_external_arrays(
				    external_arrays=np.ones((30, 5)							) * np.arange(30							).reshape(-1	,				1							)	,				index_name="""vecs"""	,				batch_size=100	,				metric_type=faiss.METRIC_INNER_PRODUCT	,				)
				A_,   A_     :						Union[str, Any]     =					dset.get_nearest_examples("""vecs"""	,				np.ones(5	,				dtype=np.floataa							)							)
				self.assertEqual(examples["""filename"""][0]	,				"""my_name-train_29"""							)


	def    _a     (self							):
				import faiss

				A_     :						Dataset     =					self._create_dummy_dataset()
				dset.add_faiss_index_from_external_arrays(
				    external_arrays=np.ones((30, 5)							) * np.arange(30							).reshape(-1	,				1							)	,				index_name="""vecs"""	,				metric_type=faiss.METRIC_INNER_PRODUCT	,				)

				# Setting delete=False and unlinking manually is not pretty... but it is required on Windows to
				# ensure somewhat stable behaviour. If we don't, we get PermissionErrors. This is an age-old issue.
				# see https://bugs.python.org/issue14243 and
				# https://stackoverflow.com/questions/23212435/permission-denied-to-write-to-my-temporary-file/23212515
				with tempfile.NamedTemporaryFile(delete=lowercase							) as tmp_file:
							dset.save_faiss_index("""vecs"""	,				tmp_file.name							)
							dset.load_faiss_index("""vecs2"""	,				tmp_file.name							)
				os.unlink(tmp_file.name							)

				A_,   A_     :						Union[str, Any]     =					dset.get_nearest_examples("""vecs2"""	,				np.ones(5	,				dtype=np.floataa							)							)
				self.assertEqual(examples["""filename"""][0]	,				"""my_name-train_29"""							)


	def    _a     (self							):
				A_     :						Dataset     =					self._create_dummy_dataset()
				dset.add_faiss_index_from_external_arrays(
				    external_arrays=np.ones((30, 5)							) * np.arange(30							).reshape(-1	,				1							)	,				index_name="""vecs"""							)
				dset.drop_index("""vecs"""							)
				self.assertRaises(lowercase	,				partial(dset.get_nearest_examples	,				"""vecs2"""	,				np.ones(5	,				dtype=np.floataa							)							)							)


	def    _a     (self							):
				from elasticsearch import Elasticsearch

				A_     :						Dataset     =					self._create_dummy_dataset()
				with patch("""elasticsearch.Elasticsearch.search"""							) as mocked_search, patch(
				    """elasticsearch.client.IndicesClient.create"""							) as mocked_index_create, patch("""elasticsearch.helpers.streaming_bulk"""							) as mocked_bulk:
							A_     :						Union[str, Any]     =					{"""acknowledged""": True}
							mocked_bulk.return_value([(True, None)] * 30							)
							A_     :						List[Any]     =					{"""hits""": {"""hits""": [{"""_score""": 1, """_id""": 29}]}}
							A_     :						Union[str, Any]     =					Elasticsearch()

							dset.add_elasticsearch_index("""filename"""	,				es_client=lowercase							)
							A_,   A_     :						Optional[int]     =					dset.get_nearest_examples("""filename"""	,				"""my_name-train_29"""							)
							self.assertEqual(examples["""filename"""][0]	,				"""my_name-train_29"""							)







@require_faiss
class      _lowerCAmelCase							(      __UpperCAmelCase			):


	def    _a     (self							):
				import faiss

				A_     :						str     =					FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT							)

				# add vectors
				index.add_vectors(np.eye(5	,				dtype=np.floataa							)							)
				self.assertIsNotNone(index.faiss_index							)
				self.assertEqual(index.faiss_index.ntotal	,				5							)
				index.add_vectors(np.zeros((5, 5)	,				dtype=np.floataa							)							)
				self.assertEqual(index.faiss_index.ntotal	,				10							)

				# single query
				A_     :						Dict     =					np.zeros(5	,				dtype=np.floataa							)
				A_     :						List[str]     =					1
				A_,   A_     :						Optional[int]     =					index.search(lowercase							)
				self.assertRaises(lowercase	,				index.search	,				query.reshape(-1	,				1							)							)
				self.assertGreater(scores[0]	,				0							)
				self.assertEqual(indices[0]	,				1							)

				# batched queries
				A_     :						List[str]     =					np.eye(5	,				dtype=np.floataa							)[::-1]
				A_,   A_     :						Tuple     =					index.search_batch(lowercase							)
				self.assertRaises(lowercase	,				index.search_batch	,				queries[0]							)
				A_     :						int     =					[scores[0] for scores in total_scores]
				A_     :						List[Any]     =					[indices[0] for indices in total_indices]
				self.assertGreater(np.min(lowercase							)	,				0							)
				self.assertListEqual([4, 3, 2, 1, 0]	,				lowercase							)


	def    _a     (self							):
				import faiss

				A_     :						List[str]     =					FaissIndex(string_factory="""Flat"""							)
				index.add_vectors(np.eye(5	,				dtype=np.floataa							)							)
				self.assertIsInstance(index.faiss_index	,				faiss.IndexFlat							)
				A_     :						List[str]     =					FaissIndex(string_factory="""LSH"""							)
				index.add_vectors(np.eye(5	,				dtype=np.floataa							)							)
				self.assertIsInstance(index.faiss_index	,				faiss.IndexLSH							)
				with self.assertRaises(lowercase							):
							A_     :						Union[str, Any]     =					FaissIndex(string_factory="""Flat"""	,				custom_index=faiss.IndexFlat(5							)							)


	def    _a     (self							):
				import faiss

				A_     :						Union[str, Any]     =					faiss.IndexFlat(5							)
				A_     :						Optional[int]     =					FaissIndex(custom_index=lowercase							)
				index.add_vectors(np.eye(5	,				dtype=np.floataa							)							)
				self.assertIsInstance(index.faiss_index	,				faiss.IndexFlat							)


	def    _a     (self							):
				import faiss

				A_     :						Optional[int]     =					FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT							)
				index.add_vectors(np.eye(5	,				dtype=np.floataa							)							)

				# Setting delete=False and unlinking manually is not pretty... but it is required on Windows to
				# ensure somewhat stable behaviour. If we don't, we get PermissionErrors. This is an age-old issue.
				# see https://bugs.python.org/issue14243 and
				# https://stackoverflow.com/questions/23212435/permission-denied-to-write-to-my-temporary-file/23212515
				with tempfile.NamedTemporaryFile(delete=lowercase							) as tmp_file:
							index.save(tmp_file.name							)
							A_     :						Any     =					FaissIndex.load(tmp_file.name							)
				os.unlink(tmp_file.name							)

				A_     :						List[str]     =					np.zeros(5	,				dtype=np.floataa							)
				A_     :						Optional[Any]     =					1
				A_,   A_     :						Optional[int]     =					index.search(lowercase							)
				self.assertGreater(scores[0]	,				0							)
				self.assertEqual(indices[0]	,				1							)






@require_faiss
def      a      (			lowerCamelCase__   ):
			'''simple docstring'''





			import faiss

			A_     :						List[Any]     =					FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT   )
			index.add_vectors(np.eye(5						,				dtype=np.floataa   )   )

			A_     :						Tuple     =					"""index.faiss"""
			A_     :						Any     =					f'mock://{index_name}'
			index.save(lowerCamelCase__						,				storage_options=mockfs.storage_options   )
			A_     :						Optional[int]     =					FaissIndex.load(lowerCamelCase__						,				storage_options=mockfs.storage_options   )

			A_     :						Optional[Any]     =					np.zeros(5						,				dtype=np.floataa   )
			A_     :						Tuple     =					1
			A_,   A_     :						Any     =					index.search(lowerCamelCase__   )
			assert scores[0] > 0
			assert indices[0] == 1







@require_elasticsearch
class      _lowerCAmelCase							(      __UpperCAmelCase			):


	def    _a     (self							):
				from elasticsearch import Elasticsearch

				with patch("""elasticsearch.Elasticsearch.search"""							) as mocked_search, patch(
				    """elasticsearch.client.IndicesClient.create"""							) as mocked_index_create, patch("""elasticsearch.helpers.streaming_bulk"""							) as mocked_bulk:
							A_     :						List[str]     =					Elasticsearch()
							A_     :						Optional[int]     =					{"""acknowledged""": True}
							A_     :						Tuple     =					ElasticSearchIndex(es_client=lowercase							)
							mocked_bulk.return_value([(True, None)] * 3							)
							index.add_documents(["""foo""", """bar""", """foobar"""]							)

							# single query
							A_     :						int     =					"""foo"""
							A_     :						str     =					{"""hits""": {"""hits""": [{"""_score""": 1, """_id""": 0}]}}
							A_,   A_     :						Any     =					index.search(lowercase							)
							self.assertEqual(scores[0]	,				1							)
							self.assertEqual(indices[0]	,				0							)

							# single query with timeout
							A_     :						List[Any]     =					"""foo"""
							A_     :						Dict     =					{"""hits""": {"""hits""": [{"""_score""": 1, """_id""": 0}]}}
							A_,   A_     :						Tuple     =					index.search(lowercase	,				request_timeout=30							)
							self.assertEqual(scores[0]	,				1							)
							self.assertEqual(indices[0]	,				0							)

							# batched queries
							A_     :						List[Any]     =					["""foo""", """bar""", """foobar"""]
							A_     :						List[str]     =					{"""hits""": {"""hits""": [{"""_score""": 1, """_id""": 1}]}}
							A_,   A_     :						str     =					index.search_batch(lowercase							)
							A_     :						Optional[int]     =					[scores[0] for scores in total_scores]
							A_     :						Dict     =					[indices[0] for indices in total_indices]
							self.assertGreater(np.min(lowercase							)	,				0							)
							self.assertListEqual([1, 1, 1]	,				lowercase							)

							# batched queries with timeout
							A_     :						str     =					["""foo""", """bar""", """foobar"""]
							A_     :						Union[str, Any]     =					{"""hits""": {"""hits""": [{"""_score""": 1, """_id""": 1}]}}
							A_,   A_     :						Dict     =					index.search_batch(lowercase	,				request_timeout=30							)
							A_     :						Optional[Any]     =					[scores[0] for scores in total_scores]
							A_     :						Optional[Any]     =					[indices[0] for indices in total_indices]
							self.assertGreater(np.min(lowercase							)	,				0							)
							self.assertListEqual([1, 1, 1]	,				lowercase							)




'''simple docstring'''




import warnings
from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import TensorType, is_torch_available, logging


lowerCamelCase							:Dict       = logging.get_logger(__name__)

lowerCamelCase							:Any       = {
    '''facebook/bart-large''': '''https://huggingface.co/facebook/bart-large/resolve/main/config.json''',
    # See all BART models at https://huggingface.co/models?filter=bart
}







class      _lowerCAmelCase							(      __UpperCAmelCase			):
	__SCREAMING_SNAKE_CASE       :		List[Any]		      = 'bart'
	__SCREAMING_SNAKE_CASE       :		Union[str, Any]		      = ['past_key_values']
	__SCREAMING_SNAKE_CASE       :		Dict		      = {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}


	def __init__(self	,				lowercase=50265	,				lowercase=1024	,				lowercase=12	,				lowercase=4096	,				lowercase=16	,				lowercase=12	,				lowercase=4096	,				lowercase=16	,				lowercase=0.0	,				lowercase=0.0	,				lowercase="gelu"	,				lowercase=1024	,				lowercase=0.1	,				lowercase=0.0	,				lowercase=0.0	,				lowercase=0.02	,				lowercase=0.0	,				lowercase=False	,				lowercase=True	,				lowercase=3	,				lowercase=1	,				lowercase=0	,				lowercase=2	,				lowercase=True	,				lowercase=2	,				lowercase=2	,				**lowercase	,				):
				A_     :						Optional[int]     =					vocab_size
				A_     :						Dict     =					max_position_embeddings
				A_     :						Dict     =					d_model
				A_     :						Any     =					encoder_ffn_dim
				A_     :						Dict     =					encoder_layers
				A_     :						Optional[int]     =					encoder_attention_heads
				A_     :						Tuple     =					decoder_ffn_dim
				A_     :						List[str]     =					decoder_layers
				A_     :						int     =					decoder_attention_heads
				A_     :						Dict     =					dropout
				A_     :						List[str]     =					attention_dropout
				A_     :						int     =					activation_dropout
				A_     :						Dict     =					activation_function
				A_     :						List[Any]     =					init_std
				A_     :						Dict     =					encoder_layerdrop
				A_     :						Tuple     =					decoder_layerdrop
				A_     :						Optional[int]     =					classifier_dropout
				A_     :						Union[str, Any]     =					use_cache
				A_     :						Dict     =					encoder_layers
				A_     :						Dict     =					scale_embedding  # scale factor will be sqrt(d_model) if True

				super().__init__(
				    num_labels=lowercase	,				pad_token_id=lowercase	,				bos_token_id=lowercase	,				eos_token_id=lowercase	,				is_encoder_decoder=lowercase	,				decoder_start_token_id=lowercase	,				forced_eos_token_id=lowercase	,				**lowercase	,				)

				# ensure backward compatibility for BART CNN models
				if self.forced_bos_token_id is None and kwargs.get("""force_bos_token_to_be_generated"""	,				lowercase							):
							A_     :						List[str]     =					self.bos_token_id
							warnings.warn(
							    F'Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. '
							    """The config can simply be saved and uploaded again to be fixed."""							)







class      _lowerCAmelCase							(      __UpperCAmelCase			):


	@property
	def    _a     (self							):
				if self.task in ["default", "seq2seq-lm"]:
							A_     :						List[Any]     =					OrderedDict(
							    [
							        ("""input_ids""", {0: """batch""", 1: """encoder_sequence"""}),
							        ("""attention_mask""", {0: """batch""", 1: """encoder_sequence"""}),
							    ]							)

							if self.use_past:
										A_     :						Union[str, Any]     =					{0: """batch"""}
										A_     :						List[Any]     =					{0: """batch""", 1: """past_decoder_sequence + sequence"""}
							else:
										A_     :						Optional[int]     =					{0: """batch""", 1: """decoder_sequence"""}
										A_     :						List[str]     =					{0: """batch""", 1: """decoder_sequence"""}

							if self.use_past:
										self.fill_with_past_key_values_(lowercase	,				direction="""inputs"""							)
				elif self.task == "causal-lm":
							# TODO: figure this case out.
							A_     :						List[Any]     =					OrderedDict(
							    [
							        ("""input_ids""", {0: """batch""", 1: """encoder_sequence"""}),
							        ("""attention_mask""", {0: """batch""", 1: """encoder_sequence"""}),
							    ]							)
							if self.use_past:
										A_,   A_     :						Optional[int]     =					self.num_layers
										for i in range(lowercase							):
													A_     :						List[str]     =					{0: """batch""", 2: """past_sequence + sequence"""}
													A_     :						List[str]     =					{0: """batch""", 2: """past_sequence + sequence"""}
				else:
							A_     :						Union[str, Any]     =					OrderedDict(
							    [
							        ("""input_ids""", {0: """batch""", 1: """encoder_sequence"""}),
							        ("""attention_mask""", {0: """batch""", 1: """encoder_sequence"""}),
							        ("""decoder_input_ids""", {0: """batch""", 1: """decoder_sequence"""}),
							        ("""decoder_attention_mask""", {0: """batch""", 1: """decoder_sequence"""}),
							    ]							)

				return common_inputs


	@property
	def    _a     (self							):
				if self.task in ["default", "seq2seq-lm"]:
							A_     :						int     =					super().outputs
				else:
							A_     :						int     =					super(lowercase	,				self							).outputs
							if self.use_past:
										A_,   A_     :						Union[str, Any]     =					self.num_layers
										for i in range(lowercase							):
													A_     :						List[str]     =					{0: """batch""", 2: """past_sequence + sequence"""}
													A_     :						Optional[int]     =					{0: """batch""", 2: """past_sequence + sequence"""}
				return common_outputs


	def    _a     (self	,				lowercase	,				lowercase = -1	,				lowercase = -1	,				lowercase = False	,				lowercase = None	,				):
				A_     :						Optional[int]     =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
				    lowercase	,				lowercase	,				lowercase	,				lowercase	,				lowercase							)

				# Generate decoder inputs
				A_     :						int     =					seq_length if not self.use_past else 1
				A_     :						int     =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
				    lowercase	,				lowercase	,				lowercase	,				lowercase	,				lowercase							)
				A_     :						Optional[int]     =					{F'decoder_{name}': tensor for name, tensor in decoder_inputs.items()}
				A_     :						Dict     =					dict(**lowercase	,				**lowercase							)

				if self.use_past:
							if not is_torch_available():
										raise ValueError("""Cannot generate dummy past_keys inputs without PyTorch installed."""							)
							else:
										import torch
							A_,   A_     :						Union[str, Any]     =					common_inputs["""input_ids"""].shape
							A_     :						Optional[Any]     =					common_inputs["""decoder_input_ids"""].shape[1]
							A_,   A_     :						str     =					self.num_attention_heads
							A_     :						Tuple     =					(
							    batch,
							    num_encoder_attention_heads,
							    encoder_seq_length,
							    self._config.hidden_size // num_encoder_attention_heads,
							)
							A_     :						Tuple     =					decoder_seq_length + 3
							A_     :						Tuple     =					(
							    batch,
							    num_decoder_attention_heads,
							    decoder_past_length,
							    self._config.hidden_size // num_decoder_attention_heads,
							)

							A_     :						List[str]     =					torch.cat(
							    [common_inputs["""decoder_attention_mask"""], torch.ones(lowercase	,				lowercase							)]	,				dim=1							)

							A_     :						Union[str, Any]     =					[]
							# If the number of encoder and decoder layers are present in the model configuration, both are considered
							A_,   A_     :						Optional[int]     =					self.num_layers
							A_     :						List[Any]     =					min(lowercase	,				lowercase							)
							A_     :						Tuple     =					max(lowercase	,				lowercase							) - min_num_layers
							A_     :						List[str]     =					"""encoder""" if num_encoder_layers > num_decoder_layers else """decoder"""

							for _ in range(lowercase							):
										common_inputs["past_key_values"].append(
										    (
										        torch.zeros(lowercase							),
										        torch.zeros(lowercase							),
										        torch.zeros(lowercase							),
										        torch.zeros(lowercase							),
										    )							)
							# TODO: test this.
							A_     :						List[Any]     =					encoder_shape if remaining_side_name == """encoder""" else decoder_shape
							for _ in range(lowercase	,				lowercase							):
										common_inputs["past_key_values"].append((torch.zeros(lowercase							), torch.zeros(lowercase							))							)
				return common_inputs


	def    _a     (self	,				lowercase	,				lowercase = -1	,				lowercase = -1	,				lowercase = False	,				lowercase = None	,				):
				A_     :						Dict     =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
				    lowercase	,				lowercase	,				lowercase	,				lowercase	,				lowercase							)

				if self.use_past:
							if not is_torch_available():
										raise ValueError("""Cannot generate dummy past_keys inputs without PyTorch installed."""							)
							else:
										import torch
							A_,   A_     :						List[str]     =					common_inputs["""input_ids"""].shape
							# Not using the same length for past_key_values
							A_     :						Optional[Any]     =					seqlen + 2
							A_,   A_     :						str     =					self.num_layers
							A_,   A_     :						Optional[int]     =					self.num_attention_heads
							A_     :						str     =					(
							    batch,
							    num_encoder_attention_heads,
							    past_key_values_length,
							    self._config.hidden_size // num_encoder_attention_heads,
							)

							A_     :						Union[str, Any]     =					common_inputs["""attention_mask"""].dtype
							A_     :						int     =					torch.cat(
							    [common_inputs["""attention_mask"""], torch.ones(lowercase	,				lowercase	,				dtype=lowercase							)]	,				dim=1							)
							A_     :						int     =					[
							    (torch.zeros(lowercase							), torch.zeros(lowercase							)) for _ in range(lowercase							)
							]
				return common_inputs


	def    _a     (self	,				lowercase	,				lowercase = -1	,				lowercase = -1	,				lowercase = False	,				lowercase = None	,				):
				# Copied from OnnxConfig.generate_dummy_inputs
				# Did not use super(OnnxConfigWithPast, self).generate_dummy_inputs for code clarity.
				# If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
				A_     :						List[Any]     =					compute_effective_axis_dimension(
				    lowercase	,				fixed_dimension=OnnxConfig.default_fixed_batch	,				num_token_to_add=0							)

				# If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
				A_     :						Union[str, Any]     =					tokenizer.num_special_tokens_to_add(lowercase							)
				A_     :						List[Any]     =					compute_effective_axis_dimension(
				    lowercase	,				fixed_dimension=OnnxConfig.default_fixed_sequence	,				num_token_to_add=lowercase							)

				# Generate dummy inputs according to compute batch and sequence
				A_     :						str     =					[""" """.join([tokenizer.unk_token]							) * seq_length] * batch_size
				A_     :						Tuple     =					dict(tokenizer(lowercase	,				return_tensors=lowercase							)							)
				return common_inputs


	def    _a     (self	,				lowercase	,				lowercase = -1	,				lowercase = -1	,				lowercase = False	,				lowercase = None	,				):
				if self.task in ["default", "seq2seq-lm"]:
							A_     :						Union[str, Any]     =					self._generate_dummy_inputs_for_default_and_seqaseq_lm(
							    lowercase	,				batch_size=lowercase	,				seq_length=lowercase	,				is_pair=lowercase	,				framework=lowercase							)

				elif self.task == "causal-lm":
							A_     :						List[str]     =					self._generate_dummy_inputs_for_causal_lm(
							    lowercase	,				batch_size=lowercase	,				seq_length=lowercase	,				is_pair=lowercase	,				framework=lowercase							)
				else:
							A_     :						Optional[Any]     =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
							    lowercase	,				batch_size=lowercase	,				seq_length=lowercase	,				is_pair=lowercase	,				framework=lowercase							)

				return common_inputs


	def    _a     (self	,				lowercase	,				lowercase	,				lowercase	,				lowercase							):
				if self.task in ["default", "seq2seq-lm"]:
							A_     :						Optional[Any]     =					super()._flatten_past_key_values_(lowercase	,				lowercase	,				lowercase	,				lowercase							)
				else:
							A_     :						List[Any]     =					super(lowercase	,				self							)._flatten_past_key_values_(
							    lowercase	,				lowercase	,				lowercase	,				lowercase							)