





'''simple docstring'''



import re
import tempfile
from pathlib import Path

import pytest
import yaml

from datasets.utils.readme import ReadMe


# @pytest.fixture
# def example_yaml_structure():

_SCREAMING_SNAKE_CASE					=    yaml.safe_load(
    '''\
name: \"\"
allow_empty: false
allow_empty_text: true
subsections:
  - name: \"Dataset Card for X\" # First-level markdown heading
    allow_empty: false
    allow_empty_text: true
    subsections:
      - name: \"Table of Contents\"
        allow_empty: false
        allow_empty_text: false
        subsections: null
      - name: \"Dataset Description\"
        allow_empty: false
        allow_empty_text: false
        subsections:
          - name: \"Dataset Summary\"
            allow_empty: false
            allow_empty_text: false
            subsections: null
          - name: \"Supported Tasks and Leaderboards\"
            allow_empty: true
            allow_empty_text: true
            subsections: null
          - name: Languages
            allow_empty: false
            allow_empty_text: true
            subsections: null
'''
)


_SCREAMING_SNAKE_CASE					=    {
    '''name''': '''root''',
    '''text''': '''''',
    '''is_empty_text''': True,
    '''subsections''': [
        {
            '''name''': '''Dataset Card for My Dataset''',
            '''text''': '''''',
            '''is_empty_text''': True,
            '''subsections''': [
                {'''name''': '''Table of Contents''', '''text''': '''Some text here.''', '''is_empty_text''': False, '''subsections''': []},
                {
                    '''name''': '''Dataset Description''',
                    '''text''': '''Some text here.''',
                    '''is_empty_text''': False,
                    '''subsections''': [
                        {
                            '''name''': '''Dataset Summary''',
                            '''text''': '''Some text here.''',
                            '''is_empty_text''': False,
                            '''subsections''': [],
                        },
                        {
                            '''name''': '''Supported Tasks and Leaderboards''',
                            '''text''': '''''',
                            '''is_empty_text''': True,
                            '''subsections''': [],
                        },
                        {'''name''': '''Languages''', '''text''': '''Language Text''', '''is_empty_text''': False, '''subsections''': []},
                    ],
                },
            ],
        }
    ],
}


_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''


_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
#### Extra Ignored Subsection
### Supported Tasks and Leaderboards
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    {
    '''name''': '''root''',
    '''text''': '''''',
    '''is_empty_text''': True,
    '''subsections''': [
        {
            '''name''': '''Dataset Card for My Dataset''',
            '''text''': '''''',
            '''is_empty_text''': True,
            '''subsections''': [
                {'''name''': '''Table of Contents''', '''text''': '''Some text here.''', '''is_empty_text''': False, '''subsections''': []},
                {
                    '''name''': '''Dataset Description''',
                    '''text''': '''Some text here.''',
                    '''is_empty_text''': False,
                    '''subsections''': [
                        {
                            '''name''': '''Dataset Summary''',
                            '''text''': '''Some text here.''',
                            '''is_empty_text''': False,
                            '''subsections''': [
                                {
                                    '''name''': '''Extra Ignored Subsection''',
                                    '''text''': '''''',
                                    '''is_empty_text''': True,
                                    '''subsections''': [],
                                }
                            ],
                        },
                        {
                            '''name''': '''Supported Tasks and Leaderboards''',
                            '''text''': '''''',
                            '''is_empty_text''': True,
                            '''subsections''': [],
                        },
                        {'''name''': '''Languages''', '''text''': '''Language Text''', '''is_empty_text''': False, '''subsections''': []},
                    ],
                },
            ],
        }
    ],
}

_SCREAMING_SNAKE_CASE					=    '''\
---
---
# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    (
    '''The following issues were found for the README at `{path}`:\n-\tEmpty YAML markers are present in the README.'''
)

_SCREAMING_SNAKE_CASE					=    '''\
# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    (
    '''The following issues were found for the README at `{path}`:\n-\tNo YAML markers are present in the README.'''
)

_SCREAMING_SNAKE_CASE					=    '''\
---
# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tOnly the start of YAML tags present in the README.'''

_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
### Supported Tasks and Leaderboards
### Languages
Language Text
'''
_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tExpected some content in section `Dataset Summary` but it is empty.\n-\tExpected some text in section `Dataset Summary` but it is empty (text in subsections are ignored).'''


_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
'''
_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tExpected some content in section `Dataset Card for My Dataset` but it is empty.\n-\tSection `Dataset Card for My Dataset` expected the following subsections: `Table of Contents`, `Dataset Description`. Found \'None\'.'''

_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tSection `Dataset Description` is missing subsection: `Supported Tasks and Leaderboards`.'''


_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
'''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tExpected some content in section `Languages` but it is empty.'''

_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''
_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tThe README has no first-level headings. One heading is expected. Skipping further validation for this README.'''

_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
# Dataset Card My Dataset
'''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tThe README has several first-level headings: `Dataset Card for My Dataset`, `Dataset Card My Dataset`. Only one heading is expected. Skipping further validation for this README.'''

_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tNo first-level heading starting with `Dataset Card for` found in README. Skipping further validation for this README.'''

_SCREAMING_SNAKE_CASE					=    ''''''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found for the README at `{path}`:\n-\tThe README has no first-level headings. One heading is expected. Skipping further validation for this README.\n-\tNo YAML markers are present in the README.'''

_SCREAMING_SNAKE_CASE					=    '''\
---
language:
- zh
- en
---

# Dataset Card for My Dataset
# Dataset Card for My Dataset
## Table of Contents
Some text here.
## Dataset Description
Some text here.
### Dataset Summary
Some text here.
### Supported Tasks and Leaderboards
### Languages
Language Text
'''

_SCREAMING_SNAKE_CASE					=    '''The following issues were found while parsing the README at `{path}`:\n-\tMultiple sections with the same heading `Dataset Card for My Dataset` have been found. Please keep only one of these sections.'''




@pytest.mark.parametrize(
    '''readme_md, expected_dict'''		,       [
        (README_CORRECT, CORRECT_DICT),
        (README_CORRECT_FOUR_LEVEL, CORRECT_DICT_FOUR_LEVEL),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  List[Any]		,       lowerCamelCase_			:  Optional[int]				):

			'''simple docstring'''





			assert ReadMe.from_string(lowerCamelCase_		,       lowerCamelCase_				).to_dict() == expected_dict




@pytest.mark.parametrize(
    '''readme_md, expected_error'''		,       [
        (README_NO_YAML, EXPECTED_ERROR_README_NO_YAML),
        (README_EMPTY_YAML, EXPECTED_ERROR_README_EMPTY_YAML),
        (README_INCORRECT_YAML, EXPECTED_ERROR_README_INCORRECT_YAML),
        (README_EMPTY, EXPECTED_ERROR_README_EMPTY),
        (README_NONE_SUBSECTION, EXPECTED_ERROR_README_NONE_SUBSECTION),
        (README_MISSING_FIRST_LEVEL, EXPECTED_ERROR_README_MISSING_FIRST_LEVEL),
        (README_MISSING_SUBSECTION, EXPECTED_ERROR_README_MISSING_SUBSECTION),
        (README_MISSING_TEXT, EXPECTED_ERROR_README_MISSING_TEXT),
        (README_WRONG_FIRST_LEVEL, EXPECTED_ERROR_README_WRONG_FIRST_LEVEL),
        (README_MULTIPLE_WRONG_FIRST_LEVEL, EXPECTED_ERROR_README_MULTIPLE_WRONG_FIRST_LEVEL),
        (README_MISSING_CONTENT, EXPECTED_ERROR_README_MISSING_CONTENT),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  int		,       lowerCamelCase_			:  Dict				):

			'''simple docstring'''





			with pytest.raises(lowerCamelCase_		,       match=re.escape(expected_error.format(path='''root'''				)				)				):
						__lowercase										=							ReadMe.from_string(lowerCamelCase_		,       lowerCamelCase_				)
						readme.validate()




@pytest.mark.parametrize(
    '''readme_md, expected_error'''		,       [
        (README_MULTIPLE_SAME_HEADING_1, EXPECTED_ERROR_README_MULTIPLE_SAME_HEADING_1),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  List[str]		,       lowerCamelCase_			:  Optional[Any]				):

			'''simple docstring'''





			with pytest.raises(lowerCamelCase_		,       match=re.escape(expected_error.format(path='''root'''				)				)				):
						ReadMe.from_string(lowerCamelCase_		,       lowerCamelCase_				)




@pytest.mark.parametrize(
    '''readme_md,'''		,       [
        (README_MULTIPLE_SAME_HEADING_1),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  List[Any]				):

			'''simple docstring'''





			ReadMe.from_string(lowerCamelCase_		,       lowerCamelCase_		,       suppress_parsing_errors=lowerCamelCase_				)




@pytest.mark.parametrize(
    '''readme_md, expected_dict'''		,       [
        (README_CORRECT, CORRECT_DICT),
        (README_CORRECT_FOUR_LEVEL, CORRECT_DICT_FOUR_LEVEL),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  List[str]		,       lowerCamelCase_			:  Tuple				):

			'''simple docstring'''





			with tempfile.TemporaryDirectory() as tmp_dir:
						__lowercase										=							Path(lowerCamelCase_				) / """README.md"""
						with open(lowerCamelCase_		,       '''w+'''				) as readme_file:
									readme_file.write(lowerCamelCase_				)
						__lowercase										=							ReadMe.from_readme(lowerCamelCase_		,       lowerCamelCase_				).to_dict()
						assert out["name"] == path
						assert out["text"] == ""
						assert out["is_empty_text"]
						assert out["subsections"] == expected_dict["subsections"]




@pytest.mark.parametrize(
    '''readme_md, expected_error'''		,       [
        (README_NO_YAML, EXPECTED_ERROR_README_NO_YAML),
        (README_EMPTY_YAML, EXPECTED_ERROR_README_EMPTY_YAML),
        (README_INCORRECT_YAML, EXPECTED_ERROR_README_INCORRECT_YAML),
        (README_EMPTY, EXPECTED_ERROR_README_EMPTY),
        (README_NONE_SUBSECTION, EXPECTED_ERROR_README_NONE_SUBSECTION),
        (README_MISSING_FIRST_LEVEL, EXPECTED_ERROR_README_MISSING_FIRST_LEVEL),
        (README_MISSING_SUBSECTION, EXPECTED_ERROR_README_MISSING_SUBSECTION),
        (README_MISSING_TEXT, EXPECTED_ERROR_README_MISSING_TEXT),
        (README_WRONG_FIRST_LEVEL, EXPECTED_ERROR_README_WRONG_FIRST_LEVEL),
        (README_MULTIPLE_WRONG_FIRST_LEVEL, EXPECTED_ERROR_README_MULTIPLE_WRONG_FIRST_LEVEL),
        (README_MISSING_CONTENT, EXPECTED_ERROR_README_MISSING_CONTENT),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  str		,       lowerCamelCase_			:  List[Any]				):

			'''simple docstring'''





			with tempfile.TemporaryDirectory() as tmp_dir:
						__lowercase										=							Path(lowerCamelCase_				) / """README.md"""
						with open(lowerCamelCase_		,       '''w+'''				) as readme_file:
									readme_file.write(lowerCamelCase_				)
						__lowercase										=							expected_error.format(path=lowerCamelCase_				)
						with pytest.raises(lowerCamelCase_		,       match=re.escape(lowerCamelCase_				)				):
									__lowercase										=							ReadMe.from_readme(lowerCamelCase_		,       lowerCamelCase_				)
									readme.validate()




@pytest.mark.parametrize(
    '''readme_md, expected_error'''		,       [
        (README_MULTIPLE_SAME_HEADING_1, EXPECTED_ERROR_README_MULTIPLE_SAME_HEADING_1),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  Optional[int]		,       lowerCamelCase_			:  str				):

			'''simple docstring'''





			with tempfile.TemporaryDirectory() as tmp_dir:
						__lowercase										=							Path(lowerCamelCase_				) / """README.md"""
						with open(lowerCamelCase_		,       '''w+'''				) as readme_file:
									readme_file.write(lowerCamelCase_				)
						__lowercase										=							expected_error.format(path=lowerCamelCase_				)
						with pytest.raises(lowerCamelCase_		,       match=re.escape(lowerCamelCase_				)				):
									ReadMe.from_readme(lowerCamelCase_		,       lowerCamelCase_				)




@pytest.mark.parametrize(
    '''readme_md,'''		,       [
        (README_MULTIPLE_SAME_HEADING_1),
    ]		,       )
def    _lowerCAmelCase						(				lowerCamelCase_			:  Any				):

			'''simple docstring'''





			with tempfile.TemporaryDirectory() as tmp_dir:
						__lowercase										=							Path(lowerCamelCase_				) / """README.md"""
						with open(lowerCamelCase_		,       '''w+'''				) as readme_file:
									readme_file.write(lowerCamelCase_				)
						ReadMe.from_readme(lowerCamelCase_		,       lowerCamelCase_		,       suppress_parsing_errors=lowerCamelCase_				)












'''simple docstring'''



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

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


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

_SCREAMING_SNAKE_CASE					=    '''=======
>>>>>>>
'''

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

_SCREAMING_SNAKE_CASE					=    [
    # (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    _lowerCAmelCase						(				lowerCamelCase_			:  Namespace				):
			return ConvertCommand(args.tfds_path		,       args.datasets_directory				)






class 							__lowercase       (      lowerCAmelCase__						):







	'''simple docstring'''

	@staticmethod
	def 						_UpperCAmelCase     (_lowerCamelCase )							->							Any:







				'''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=_lowerCamelCase     ,required=_lowerCamelCase     ,help='''Path to a TensorFlow Datasets folder to convert or a single tfds file to convert.'''     ,)
				train_parser.add_argument(
				    '''--datasets_directory'''     ,type=_lowerCamelCase     ,required=_lowerCamelCase     ,help='''Path to the HuggingFace Datasets folder.''' )
				train_parser.set_defaults(func=_lowerCamelCase )


	def __init__(self     ,_lowerCamelCase     ,_lowerCamelCase     ,*_lowerCamelCase )							->							List[Any]:







				'''simple docstring'''





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

				__lowercase										=							tfds_path
				__lowercase										=							datasets_directory


	def 						_UpperCAmelCase     (self )							->							str:







				'''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(_lowerCamelCase )
				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(_lowerCamelCase     ,_lowerCamelCase )
							__lowercase										=							os.path.join(_lowerCamelCase     ,_lowerCamelCase )

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

							with open(_lowerCamelCase     ,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 _lowerCamelCase : e in out_line     ,_lowerCamelCase ) )
													out_lines.append(HIGHLIGHT_MESSAGE_PRE + str(_lowerCamelCase ) + '''\n''' )
													out_lines.append(_lowerCamelCase )
													out_lines.append(_lowerCamelCase )
													continue
										else:
													for pattern, replacement in TO_CONVERT:
																__lowercase										=							re.sub(_lowerCamelCase     ,_lowerCamelCase     ,_lowerCamelCase )

                # 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]+)'''     ,_lowerCamelCase )
													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(_lowerCamelCase )

							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(_lowerCamelCase     ,_lowerCamelCase )
										__lowercase										=							os.path.join(_lowerCamelCase     ,_lowerCamelCase )
										os.makedirs(_lowerCamelCase     ,exist_ok=_lowerCamelCase )
										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(_lowerCamelCase )

							if needs_manual_update:
										with_manual_update.append(_lowerCamelCase )

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

				for utils_file in utils_files:
							try:
										__lowercase										=							os.path.basename(_lowerCamelCase )
										__lowercase										=							imports_to_builder_map[f_name.replace('''.py'''     ,'''''' )]
										self._logger.info(f"Moving {dest_folder} to {utils_file}" )
										shutil.copy(_lowerCamelCase     ,_lowerCamelCase )
							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'." )





