


import inspect

import jax
import jax.lax as lax
import jax.numpy as jnp

from ..utils import add_start_docstrings
from ..utils.logging import get_logger


lowerCAmelCase	=							get_logger(__name__)


lowerCAmelCase	=							R'\n    Args:\n        input_ids (`jnp.ndarray` of shape `(batch_size, sequence_length)`):\n            Indices of input sequence tokens in the vocabulary.\n\n            Indices can be obtained using [`PreTrainedTokenizer`]. See [`PreTrainedTokenizer.encode`] and\n            [`PreTrainedTokenizer.__call__`] for details.\n\n            [What are input IDs?](../glossary#input-ids)\n        scores (`jnp.ndarray` of shape `(batch_size, config.vocab_size)`):\n            Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam\n            search or log softmax for each vocabulary token when using beam search\n        kwargs (`Dict[str, Any]`, *optional*):\n            Additional logits processor specific kwargs.\n\n    Return:\n        `jnp.ndarray` of shape `(batch_size, config.vocab_size)`: The processed prediction scores.\n\n'


class 	_a							:

							@add_start_docstrings(UpperCamelCase_							)
							def __call__(							self:     Dict   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray							)      ->       jnp.ndarray:





									"""simple docstring"""







									raise NotImplementedError(
									    f'{self.__class__} is an abstract class. Only classes inheriting this class can be called.'							)


class 	_a							:

							@add_start_docstrings(UpperCamelCase_							)
							def __call__(							self:     Tuple   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray							)      ->       jnp.ndarray:





									"""simple docstring"""







									raise NotImplementedError(
									    f'{self.__class__} is an abstract class. Only classes inheriting this class can be called.'							)


class 	_a							(      UpperCamelCase__      ):

							@add_start_docstrings(UpperCamelCase_							)
							def __call__(							self:     Dict   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int   ,						**UpperCamelCase_:     str							)      ->       jnp.ndarray:





									"""simple docstring"""







									for processor in self:
											lowercase__						=				inspect.signature(processor.__call__							).parameters
											if len(UpperCamelCase_							) > 3:
													if not all(arg in kwargs for arg in list(function_args.keys()							)[2:]							):
															raise ValueError(
															    f'Make sure that all the required parameters: {list(function_args.keys()							)} for '
															    f'{processor.__class__} are passed to the logits processor.'							)
													lowercase__						=				processor(UpperCamelCase_   ,						UpperCamelCase_   ,						UpperCamelCase_   ,						**UpperCamelCase_							)
											else:
													lowercase__						=				processor(UpperCamelCase_   ,						UpperCamelCase_   ,						UpperCamelCase_							)
									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     List[Any]   ,						UpperCamelCase_:     float							)      ->       Optional[Any]:





									"""simple docstring"""







									if not isinstance(UpperCamelCase_   ,						UpperCamelCase_							) or not (temperature > 0):
											raise ValueError(f'`temperature` has to be a strictly positive float, but is {temperature}'							)

									lowercase__						=				temperature


							def __call__(							self:     Union[str, Any]   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__						=				scores / self.temperature
									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     int   ,						UpperCamelCase_:     float   ,						UpperCamelCase_:     float = -float('''Inf'''							)   ,						UpperCamelCase_:     int = 1							)      ->       Optional[Any]:





									"""simple docstring"""







									if not isinstance(UpperCamelCase_   ,						UpperCamelCase_							) or (top_p < 0 or top_p > 1.0):
											raise ValueError(f'`top_p` has to be a float > 0 and < 1, but is {top_p}'							)
									if not isinstance(UpperCamelCase_   ,						UpperCamelCase_							) or (min_tokens_to_keep < 1):
											raise ValueError(f'`min_tokens_to_keep` has to be a positive integer, but is {min_tokens_to_keep}'							)

									lowercase__						=				top_p
									lowercase__						=				filter_value
									lowercase__						=				min_tokens_to_keep


							def __call__(							self:     List[Any]   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__					,		lowercase__						=				lax.top_k(UpperCamelCase_   ,						scores.shape[-1]							)

									lowercase__						=				jnp.full_like(UpperCamelCase_   ,						self.filter_value							)
									lowercase__						=				jax.nn.softmax(UpperCamelCase_   ,						axis=-1							).cumsum(axis=-1							)
									lowercase__						=				cumulative_probs < self.top_p

									# include the token that is higher than top_p as well
									lowercase__						=				jnp.roll(UpperCamelCase_   ,						1							)
									score_mask |= score_mask.at[:, 0].set(UpperCamelCase_							)

									# min tokens to keep
									lowercase__						=				score_mask.at[:, : self.min_tokens_to_keep].set(UpperCamelCase_							)

									lowercase__						=				jnp.where(UpperCamelCase_   ,						UpperCamelCase_   ,						UpperCamelCase_							)
									lowercase__						=				jax.lax.sort_key_val(UpperCamelCase_   ,						UpperCamelCase_							)[-1]

									return next_scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     Dict   ,						UpperCamelCase_:     int   ,						UpperCamelCase_:     float = -float('''Inf'''							)   ,						UpperCamelCase_:     int = 1							)      ->       Dict:





									"""simple docstring"""







									if not isinstance(UpperCamelCase_   ,						UpperCamelCase_							) or top_k <= 0:
											raise ValueError(f'`top_k` has to be a strictly positive integer, but is {top_k}'							)

									lowercase__						=				max(UpperCamelCase_   ,						UpperCamelCase_							)
									lowercase__						=				filter_value


							def __call__(							self:     Any   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__					,		lowercase__						=				scores.shape
									lowercase__						=				jnp.full(batch_size * vocab_size   ,						self.filter_value							)

									lowercase__						=				min(self.top_k   ,						scores.shape[-1]							)  # Safety check
									lowercase__					,		lowercase__						=				lax.top_k(UpperCamelCase_   ,						UpperCamelCase_							)
									lowercase__						=				jnp.broadcast_to((jnp.arange(UpperCamelCase_							) * vocab_size)[:, None]   ,						(batch_size, topk)							).flatten()
									lowercase__						=				topk_scores.flatten()
									lowercase__						=				topk_indices.flatten() + shift

									lowercase__						=				next_scores_flat.at[topk_indices_flat].set(UpperCamelCase_							)
									lowercase__						=				next_scores_flat.reshape(UpperCamelCase_   ,						UpperCamelCase_							)
									return next_scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     Dict   ,						UpperCamelCase_:     int							)      ->       Any:





									"""simple docstring"""







									lowercase__						=				bos_token_id


							def __call__(							self:     Optional[Any]   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__						=				jnp.full(scores.shape   ,						-float('''inf'''							)							)

									lowercase__						=				1 - jnp.bool_(cur_len - 1							)

									lowercase__						=				jnp.where(UpperCamelCase_   ,						new_scores.at[:, self.bos_token_id].set(0							)   ,						UpperCamelCase_							)

									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     Dict   ,						UpperCamelCase_:     int   ,						UpperCamelCase_:     int							)      ->       Any:





									"""simple docstring"""







									lowercase__						=				max_length
									lowercase__						=				eos_token_id


							def __call__(							self:     List[str]   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__						=				jnp.full(scores.shape   ,						-float('''inf'''							)							)

									lowercase__						=				1 - jnp.bool_(cur_len - self.max_length + 1							)

									lowercase__						=				jnp.where(UpperCamelCase_   ,						new_scores.at[:, self.eos_token_id].set(0							)   ,						UpperCamelCase_							)

									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     Union[str, Any]   ,						UpperCamelCase_:     int   ,						UpperCamelCase_:     int							)      ->       Any:





									"""simple docstring"""







									if not isinstance(UpperCamelCase_   ,						UpperCamelCase_							) or min_length < 0:
											raise ValueError(f'`min_length` has to be a positive integer, but is {min_length}'							)

									if not isinstance(UpperCamelCase_   ,						UpperCamelCase_							) or eos_token_id < 0:
											raise ValueError(f'`eos_token_id` has to be a positive integer, but is {eos_token_id}'							)

									lowercase__						=				min_length
									lowercase__						=				eos_token_id


							def __call__(							self:     List[str]   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__						=				1 - jnp.clip(cur_len - self.min_length   ,						0   ,						1							)

									lowercase__						=				jnp.where(UpperCamelCase_   ,						scores.at[:, self.eos_token_id].set(-float('''inf'''							)							)   ,						UpperCamelCase_							)

									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     List[Any]   ,						UpperCamelCase_:     Optional[int]   ,						UpperCamelCase_:     Union[str, Any]							)      ->       Optional[Any]:





									"""simple docstring"""







									lowercase__						=				list(UpperCamelCase_							)
									lowercase__						=				begin_index


							def __call__(							self:     Tuple   ,						UpperCamelCase_:     List[str]   ,						UpperCamelCase_:     Optional[int]   ,						UpperCamelCase_:     int							)      ->       Tuple:





									"""simple docstring"""







									lowercase__						=				1 - jnp.bool_(cur_len - self.begin_index							)

									lowercase__						=				jnp.where(UpperCamelCase_   ,						scores.at[:, self.begin_suppress_tokens].set(-float('''inf'''							)							)   ,						UpperCamelCase_							)

									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     Optional[Any]   ,						UpperCamelCase_:     list							)      ->       int:





									"""simple docstring"""







									lowercase__						=				list(UpperCamelCase_							)


							def __call__(							self:     int   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									lowercase__						=				scores.at[..., self.suppress_tokens].set(-float('''inf'''							)							)

									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     str   ,						UpperCamelCase_:     Any							)      ->       Optional[Any]:





									"""simple docstring"""







									lowercase__						=				dict(UpperCamelCase_							)
									# Converts the dictionary of format {index: token} containing the tokens to be forced to an array, where the
									# index of the array corresponds to the index of the token to be forced, for XLA compatibility.
									# Indexes without forced tokens will have a negative value.
									lowercase__						=				jnp.ones((max(force_token_map.keys()							) + 1)   ,						dtype=jnp.intaa							) * -1
									for index, token in force_token_map.items():
											if token is not None:
													lowercase__						=				force_token_array.at[index].set(UpperCamelCase_							)
									lowercase__						=				jnp.intaa(UpperCamelCase_							)


							def __call__(							self:     str   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     jnp.ndarray   ,						UpperCamelCase_:     int							)      ->       jnp.ndarray:





									"""simple docstring"""







									def _force_token(UpperCamelCase_:     List[str]							):
											lowercase__						=				scores.shape[0]
											lowercase__						=				self.force_token_array[generation_idx]

											lowercase__						=				jnp.ones_like(UpperCamelCase_   ,						dtype=scores.dtype							) * -float('''inf'''							)
											lowercase__						=				jnp.zeros((batch_size, 1)   ,						dtype=scores.dtype							)
											lowercase__						=				lax.dynamic_update_slice(UpperCamelCase_   ,						UpperCamelCase_   ,						(0, current_token)							)
											return new_scores

									lowercase__						=				lax.cond(
									    cur_len >= self.force_token_array.shape[0]   ,						lambda: scores   ,						lambda: lax.cond(
									        self.force_token_array[cur_len] >= 0   ,						lambda: _force_token(UpperCamelCase_							)   ,						lambda: scores   ,						)   ,						)
									return scores


class 	_a							(      UpperCamelCase__      ):

							def __init__(							self:     Optional[int]   ,						UpperCamelCase_:     List[str]   ,						UpperCamelCase_:     int   ,						UpperCamelCase_:     int							)      ->       Union[str, Any]:





									"""simple docstring"""







									lowercase__						=				generate_config.eos_token_id
									lowercase__						=				generate_config.no_timestamps_token_id
									lowercase__						=				generate_config.no_timestamps_token_id + 1

									lowercase__						=				decoder_input_length + 1

									if generate_config.is_multilingual:
											# room for language token and task token
											self.begin_index += 2
									if hasattr(UpperCamelCase_   ,						'''max_initial_timestamp_index'''							):
											lowercase__						=				generate_config.max_initial_timestamp_index
									else:
											lowercase__						=				model_config.vocab_size
									if self.max_initial_timestamp_index is None:
											lowercase__						=				model_config.vocab_size


							def __call__(							self:     Any   ,						UpperCamelCase_:     Optional[int]   ,						UpperCamelCase_:     Optional[Any]   ,						UpperCamelCase_:     str							)      ->       Union[str, Any]:





									"""simple docstring"""







									lowercase__						=				scores.at[:, self.no_timestamps_token_id].set(-float('''inf'''							)							)

									def handle_pairs(UpperCamelCase_:     int   ,						UpperCamelCase_:     Tuple							):
											lowercase__						=				jnp.where((cur_len - self.begin_index) >= 1   ,						UpperCamelCase_   ,						UpperCamelCase_							)
											lowercase__						=				jnp.where(
											    input_ids_k[cur_len - 1] >= self.timestamp_begin   ,						True and last_was_timestamp   ,						UpperCamelCase_   ,						)

											lowercase__						=				jnp.where((cur_len - self.begin_index) < 2   ,						UpperCamelCase_   ,						UpperCamelCase_							)
											lowercase__						=				jnp.where(
											    input_ids_k[cur_len - 2] >= self.timestamp_begin   ,						UpperCamelCase_   ,						UpperCamelCase_   ,						)

											return jnp.where(
											    UpperCamelCase_   ,						jnp.where(
											        penultimate_was_timestamp > 0   ,						scores_k.at[self.timestamp_begin :].set(-float('''inf'''							)							)   ,						scores_k.at[: self.eos_token_id].set(-float('''inf'''							)							)   ,						)   ,						UpperCamelCase_   ,						)

									lowercase__						=				jax.vmap(UpperCamelCase_							)(UpperCamelCase_   ,						UpperCamelCase_							)

									lowercase__						=				jnp.where(cur_len == self.begin_index   ,						UpperCamelCase_   ,						UpperCamelCase_							)
									lowercase__						=				jnp.where(
									    self.max_initial_timestamp_index is not None   ,						True and apply_max_initial_timestamp   ,						UpperCamelCase_   ,						)

									lowercase__						=				self.timestamp_begin + self.max_initial_timestamp_index

									lowercase__						=				jnp.where(
									    UpperCamelCase_   ,						scores.at[:, last_allowed + 1 :].set(-float('''inf'''							)							)   ,						UpperCamelCase_   ,						)

									# if sum of probability over timestamps is above any other token, sample timestamp
									lowercase__						=				jax.nn.log_softmax(UpperCamelCase_   ,						axis=-1							)

									def handle_cumulative_probs(UpperCamelCase_:     Optional[Any]   ,						UpperCamelCase_:     Tuple							):
											lowercase__						=				jax.nn.logsumexp(logprobs_k[self.timestamp_begin :]   ,						axis=-1							)
											lowercase__						=				jnp.max(logprobs_k[: self.timestamp_begin]							)
											return jnp.where(
											    timestamp_logprob > max_text_token_logprob   ,						scores_k.at[: self.timestamp_begin].set(-float('''inf'''							)							)   ,						UpperCamelCase_   ,						)

									lowercase__						=				jax.vmap(UpperCamelCase_							)(UpperCamelCase_   ,						UpperCamelCase_							)

									return scores



import os
import re
import shutil
from argparse import ArgumentParser, Namespace

from datasets.commands import BaseDatasetsCLICommand
from datasets.utils.logging import get_logger


lowerCAmelCase	=							'<<<<<<< This should probably be modified because it mentions: '

lowerCAmelCase	=							'=======\n>>>>>>>\n'

lowerCAmelCase	=							[
    'TextEncoderConfig',
    'ByteTextEncoder',
    'SubwordTextEncoder',
    'encoder_config',
    'maybe_build_from_corpus',
    'manual_dir',
]

lowerCAmelCase	=							[
    # (pattern, replacement)
    # Order is important here for some replacements
    (R'tfds\.core', R'datasets'),
    (R'tf\.io\.gfile\.GFile', R'open'),
    (R'tf\.([\w\d]+)', R'datasets.Value(\'\1\')'),
    (R'tfds\.features\.Text\(\)', R'datasets.Value(\'string\')'),
    (R'tfds\.features\.Text\(', R'datasets.Value(\'string\'),'),
    (R'features\s*=\s*tfds.features.FeaturesDict\(', R'features=datasets.Features('),
    (R'tfds\.features\.FeaturesDict\(', R'dict('),
    (R'The TensorFlow Datasets Authors', R'The TensorFlow Datasets Authors and the HuggingFace Datasets Authors'),
    (R'tfds\.', R'datasets.'),
    (R'dl_manager\.manual_dir', R'self.config.data_dir'),
    (R'self\.builder_config', R'self.config'),
]
def       _a			(				SCREAMING_SNAKE_CASE					):


		"""simple docstring"""




		return ConvertCommand(args.tfds_path						,    args.datasets_directory					)


class 	_a							(      UpperCamelCase__      ):

							@staticmethod
							def 				lowerCamelCase_			(							UpperCamelCase_:     ArgumentParser							)      ->       int:





									"""simple docstring"""







									lowercase__						=				parser.add_parser(
									    '''convert'''   ,						help='''Convert a TensorFlow Datasets dataset to a HuggingFace Datasets dataset.'''   ,						)
									train_parser.add_argument(
									    '''--tfds_path'''   ,						type=UpperCamelCase_   ,						required=UpperCamelCase_   ,						help='''Path to a TensorFlow Datasets folder to convert or a single tfds file to convert.'''   ,						)
									train_parser.add_argument(
									    '''--datasets_directory'''   ,						type=UpperCamelCase_   ,						required=UpperCamelCase_   ,						help='''Path to the HuggingFace Datasets folder.'''							)
									train_parser.set_defaults(func=UpperCamelCase_							)

							def __init__(							self:     Dict   ,						UpperCamelCase_:     str   ,						UpperCamelCase_:     str   ,						*UpperCamelCase_:     Union[str, Any]							)      ->       List[str]:





									"""simple docstring"""







									lowercase__						=				get_logger('''datasets-cli/converting'''							)

									lowercase__						=				tfds_path
									lowercase__						=				datasets_directory


							def 				lowerCamelCase_			(							self:     str							)      ->       Dict:





									"""simple docstring"""







									if os.path.isdir(self._tfds_path							):
											lowercase__						=				os.path.abspath(self._tfds_path							)
									elif os.path.isfile(self._tfds_path							):
											lowercase__						=				os.path.dirname(self._tfds_path							)
									else:
											raise ValueError('''--tfds_path is neither a directory nor a file. Please check path.'''							)

									lowercase__						=				os.path.abspath(self._datasets_directory							)

									self._logger.info(f'Converting datasets from {abs_tfds_path} to {abs_datasets_path}'							)

									lowercase__						=				[]
									lowercase__						=				[]
									lowercase__						=				{}

									if os.path.isdir(self._tfds_path							):
											lowercase__						=				os.listdir(UpperCamelCase_							)
									else:
											lowercase__						=				[os.path.basename(self._tfds_path							)]

									for f_name in file_names:
											self._logger.info(f'Looking at file {f_name}'							)
											lowercase__						=				os.path.join(UpperCamelCase_   ,						UpperCamelCase_							)
											lowercase__						=				os.path.join(UpperCamelCase_   ,						UpperCamelCase_							)

											if not os.path.isfile(UpperCamelCase_							) or "__init__" in f_name or "_test" in f_name or ".py" not in f_name:
													self._logger.info('''Skipping file'''							)
													continue

											with open(UpperCamelCase_   ,						encoding='''utf-8'''							) as f:
													lowercase__						=				f.readlines()

											lowercase__						=				[]
											lowercase__						=				False
											lowercase__						=				False
											lowercase__						=				[]
											for line in lines:
													lowercase__						=				line

													# Convert imports
													if "import tensorflow.compat.v2 as tf" in out_line:
															continue
													elif "@tfds.core" in out_line:
															continue
													elif "builder=self" in out_line:
															continue
													elif "import tensorflow_datasets.public_api as tfds" in out_line:
															lowercase__						=				'''import datasets\n'''
													elif "import tensorflow" in out_line:
															# order is important here
															lowercase__						=				''''''
															continue
													elif "from absl import logging" in out_line:
															lowercase__						=				'''from datasets import logging\n'''
													elif "getLogger" in out_line:
															lowercase__						=				out_line.replace('''getLogger'''   ,						'''get_logger'''							)
													elif any(expression in out_line for expression in TO_HIGHLIGHT							):
															lowercase__						=				True
															lowercase__						=				list(filter(lambda UpperCamelCase_							: e in out_line   ,						UpperCamelCase_							)							)
															out_lines.append(HIGHLIGHT_MESSAGE_PRE + str(UpperCamelCase_							) + '''\n'''							)
															out_lines.append(UpperCamelCase_							)
															out_lines.append(UpperCamelCase_							)
															continue
													else:
															for pattern, replacement in TO_CONVERT:
																	lowercase__						=				re.sub(UpperCamelCase_   ,						UpperCamelCase_   ,						UpperCamelCase_							)

                # Take care of saving utilities (to later move them together with main script)
													if "tensorflow_datasets" in out_line:
															lowercase__						=				re.match(r'''from\stensorflow_datasets.*import\s([^\.\r\n]+)'''   ,						UpperCamelCase_							)
															tfds_imports.extend(imp.strip() for imp in match.group(1							).split(''','''							)							)
															lowercase__						=				'''from . import ''' + match.group(1							)

													# Check we have not forget anything
													if "tf." in out_line or "tfds." in out_line or "tensorflow_datasets" in out_line:
															raise ValueError(f'Error converting {out_line.strip()}'							)

													if "GeneratorBasedBuilder" in out_line or "BeamBasedBuilder" in out_line:
															lowercase__						=				True
													out_lines.append(UpperCamelCase_							)

											if is_builder or "wmt" in f_name:
													# We create a new directory for each dataset
													lowercase__						=				f_name.replace('''.py'''   ,						''''''							)
													lowercase__						=				os.path.join(UpperCamelCase_   ,						UpperCamelCase_							)
													lowercase__						=				os.path.join(UpperCamelCase_   ,						UpperCamelCase_							)
													os.makedirs(UpperCamelCase_   ,						exist_ok=UpperCamelCase_							)
													self._logger.info(f'Adding directory {output_dir}'							)
													imports_to_builder_map.update({imp: output_dir for imp in tfds_imports}							)
											else:
													# Utilities will be moved at the end
													utils_files.append(UpperCamelCase_							)

											if needs_manual_update:
													with_manual_update.append(UpperCamelCase_							)

											with open(UpperCamelCase_   ,						'''w'''   ,						encoding='''utf-8'''							) as f:
													f.writelines(UpperCamelCase_							)
											self._logger.info(f'Converted in {output_file}'							)

									for utils_file in utils_files:
											try:
													lowercase__						=				os.path.basename(UpperCamelCase_							)
													lowercase__						=				imports_to_builder_map[f_name.replace('''.py'''   ,						''''''							)]
													self._logger.info(f'Moving {dest_folder} to {utils_file}'							)
													shutil.copy(UpperCamelCase_   ,						UpperCamelCase_							)
											except KeyError:
													self._logger.error(f'Cannot find destination folder for {utils_file}. Please copy manually.'							)

									if with_manual_update:
											for file_path in with_manual_update:
													self._logger.warning(
													    f'You need to manually update file {file_path} to remove configurations using \'TextEncoderConfig\'.'							)


