import colorsys
import io

import cva
import matplotlib as mpl
import matplotlib.colors as mplc
import matplotlib.figure as mplfigure
import numpy as np
import torch
from matplotlib.backends.backend_agg import FigureCanvasAgg

from utils import img_tensorize


lowerCamelCase_				:		Optional[int]       						=       1_000


class 						a__							:



			def __init__(						self      ,						UpperCAmelCase      ,						UpperCAmelCase=1.2      ,						UpperCAmelCase="g"      ,						UpperCAmelCase=0.5      ,						UpperCAmelCase="-"      ,						UpperCAmelCase="test_out.jpg"      ,						UpperCAmelCase=True      ,						UpperCAmelCase=False      ,						UpperCAmelCase=None      ,						UpperCAmelCase=None      ,						UpperCAmelCase=0.7      ,						) ->    List[str]:
								if isinstance(UpperCAmelCase      ,						torch.Tensor    ):
													__a							=   img.numpy().astype('np.uint8'    )
								if isinstance(UpperCAmelCase      ,						UpperCAmelCase    ):
													__a							=   img_tensorize(UpperCAmelCase    )
								assert isinstance(UpperCAmelCase      ,						np.ndarray    )

								__a					,      __a							=   img.shape[1], img.shape[0]
								__a							=   mplfigure.Figure(frameon=UpperCAmelCase    )
								__a							=   fig.get_dpi()
								__a							=   (width * scale + 1e-2) / dpi
								__a							=   (height * scale + 1e-2) / dpi
								fig.set_size_inches(UpperCAmelCase      ,						UpperCAmelCase    )
								__a							=   fig.add_axes([0.0, 0.0, 1.0, 1.0]    )
								ax.axis('off'    )
								ax.set_xlim(0.0      ,						UpperCAmelCase    )
								ax.set_ylim(UpperCAmelCase    )

								__a							=   saveas
								__a							=   rgb
								__a							=   pynb
								__a							=   img
								__a							=   edgecolor
								__a							=   0.5
								__a							=   linestyle
								__a							=   int(np.sqrt(min(UpperCAmelCase      ,						UpperCAmelCase    )    ) * scale // 3    )
								__a							=   width
								__a							=   height
								__a							=   scale
								__a							=   fig
								__a							=   ax
								__a							=   pad
								__a							=   idaobj
								__a							=   idaattr
								__a							=   FigureCanvasAgg(UpperCAmelCase    )



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase=None    ) ->    Tuple:
								if color is None:
													__a							=   self.edgecolor
								((__a)					,      (__a)					,      (__a)					,      (__a))							=   box
								__a							=   xa - xa
								__a							=   ya - ya
								self.ax.add_patch(
								    mpl.patches.Rectangle(
								        (xa, ya)      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						fill=UpperCAmelCase      ,						edgecolor=UpperCAmelCase      ,						linewidth=self.font_size // 3      ,						alpha=self.alpha      ,						linestyle=self.linestyle      ,						)    )



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase=None      ,						UpperCAmelCase=None      ,						UpperCAmelCase=None      ,						UpperCAmelCase=None    ) ->    List[str]:
								if len(boxes.shape    ) > 2:
													__a							=   boxes[0]
								if len(obj_ids.shape    ) > 1:
													__a							=   obj_ids[0]
								if len(obj_scores.shape    ) > 1:
													__a							=   obj_scores[0]
								if len(attr_ids.shape    ) > 1:
													__a							=   attr_ids[0]
								if len(attr_scores.shape    ) > 1:
													__a							=   attr_scores[0]
								if isinstance(UpperCAmelCase      ,						torch.Tensor    ):
													__a							=   boxes.numpy()
								if isinstance(UpperCAmelCase      ,						UpperCAmelCase    ):
													__a							=   np.array(UpperCAmelCase    )
								assert isinstance(UpperCAmelCase      ,						np.ndarray    )
								__a							=   np.prod(boxes[:, 2:] - boxes[:, :2]      ,						axis=1    )
								__a							=   np.argsort(-areas    ).tolist()
								__a							=   boxes[sorted_idxs] if boxes is not None else None
								__a							=   obj_ids[sorted_idxs] if obj_ids is not None else None
								__a							=   obj_scores[sorted_idxs] if obj_scores is not None else None
								__a							=   attr_ids[sorted_idxs] if attr_ids is not None else None
								__a							=   attr_scores[sorted_idxs] if attr_scores is not None else None

								__a							=   [self._random_color(maximum=1    ) for _ in range(len(UpperCAmelCase    )    )]
								__a							=   [assigned_colors[idx] for idx in sorted_idxs]
								if obj_ids is not None:
													__a							=   self._create_text_labels_attr(UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase    )
													for i in range(len(UpperCAmelCase    )    ):
																		__a							=   assigned_colors[i]
																		self.add_box(boxes[i]      ,						UpperCAmelCase    )
																		self.draw_labels(labels[i]      ,						boxes[i]      ,						UpperCAmelCase    )



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase    ) ->    Dict:
								__a					,      __a					,      __a					,      __a							=   box
								__a							=   (xa, ya)
								__a							=   (ya - ya) * (xa - xa)
								__a							=   _SMALL_OBJ * self.scale
								if instance_area < small or ya - ya < 4_0 * self.scale:
													if ya >= self.height - 5:
																		__a							=   (xa, ya)
													else:
																		__a							=   (xa, ya)

								__a							=   (ya - ya) / np.sqrt(self.height * self.width    )
								__a							=   self._change_color_brightness(UpperCAmelCase      ,						brightness_factor=0.7    )
								__a							=   np.clip((height_ratio - 0.02) / 0.08 + 1      ,						1.2      ,						2    )
								font_size *= 0.75 * self.font_size

								self.draw_text(
								    text=UpperCAmelCase      ,						position=UpperCAmelCase      ,						color=UpperCAmelCase      ,						)



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase="g"      ,						UpperCAmelCase="left"      ,						) ->    List[str]:
								__a							=   0
								__a							=   self.font_size
								__a							=   np.maximum(list(mplc.to_rgb(UpperCAmelCase    )    )      ,						0.2    )
								__a							=   max(0.8      ,						np.max(UpperCAmelCase    )    )
								__a							=   {
								    'facecolor': 'black',
								    'alpha': self.alpha,
								    'pad': self.pad,
								    'edgecolor': 'none',
								}
								__a					,      __a							=   position
								self.ax.text(
								    UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						size=font_size * self.scale      ,						family='sans-serif'      ,						bbox=UpperCAmelCase      ,						verticalalignment='top'      ,						horizontalalignment=UpperCAmelCase      ,						color=UpperCAmelCase      ,						zorder=1_0      ,						rotation=UpperCAmelCase      ,						)



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase=None    ) ->    List[Any]:
								if saveas is None:
													__a							=   self.saveas
								if saveas.lower().endswith('.jpg'    ) or saveas.lower().endswith('.png'    ):
													cva.imwrite(
													    UpperCAmelCase      ,						self._get_buffer()[:, :, ::-1]      ,						)
								else:
													self.fig.savefig(UpperCAmelCase    )



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase    ) ->    Tuple:
								__a							=   [self.idaobj[i] for i in classes]
								__a							=   [self.idaattr[i] for i in attr_classes]
								__a							=   [
								    f'''{label} {score:.2f} {attr} {attr_score:.2f}'''
								    for label, score, attr, attr_score in zip(UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase      ,						UpperCAmelCase    )
								]
								return labels



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase    ) ->    List[Any]:
								__a							=   [self.idaobj[i] for i in classes]
								if scores is not None:
													if labels is None:
																		__a							=   ['{:.0f}%'.format(s * 1_0_0    ) for s in scores]
													else:
																		__a							=   ['{} {:.0f}%'.format(UpperCAmelCase      ,						s * 1_0_0    ) for li, s in zip(UpperCAmelCase      ,						UpperCAmelCase    )]
								return labels



			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase=2_5_5    ) ->    int:
								__a							=   np.random.randint(0      ,						len(_COLORS    )    )
								__a							=   _COLORS[idx] * maximum
								if not self.rgb:
													__a							=   ret[::-1]
								return ret



			def __SCREAMING_SNAKE_CASE							(						self    ) ->    Tuple:
								if not self.pynb:
													__a					,      __a							=   self.canvas.print_to_buffer()
													if (width, height) != (self.width, self.height):
																		__a							=   cva.resize(self.img      ,						(width, height)    )
													else:
																		__a							=   self.img
								else:
													__a							=   io.BytesIO()  # works for cairo backend
													self.canvas.print_rgba(UpperCAmelCase    )
													__a					,      __a							=   self.width, self.height
													__a							=   buf.getvalue()
													__a							=   self.img

								__a							=   np.frombuffer(UpperCAmelCase      ,						dtype='uint8'    )
								__a							=   buffer.reshape(UpperCAmelCase      ,						UpperCAmelCase      ,						4    )
								__a					,      __a							=   np.split(UpperCAmelCase      ,						[3]      ,						axis=2    )

								try:
													import numexpr as ne  # fuse them with numexpr

													__a							=   ne.evaluate('img * (1 - alpha / 255.0) + rgb * (alpha / 255.0)'    )
								except ImportError:
													__a							=   alpha.astype('float32'    ) / 255.0
													__a							=   img * (1 - alpha) + rgb * alpha

								return visualized_image.astype('uint8'    )







			def __SCREAMING_SNAKE_CASE							(						self      ,						UpperCAmelCase      ,						UpperCAmelCase    ) ->    Dict:
								assert brightness_factor >= -1.0 and brightness_factor <= 1.0
								__a							=   mplc.to_rgb(UpperCAmelCase    )
								__a							=   colorsys.rgb_to_hls(*mplc.to_rgb(UpperCAmelCase    )    )
								__a							=   polygon_color[1] + (brightness_factor * polygon_color[1])
								__a							=   0.0 if modified_lightness < 0.0 else modified_lightness
								__a							=   1.0 if modified_lightness > 1.0 else modified_lightness
								__a							=   colorsys.hls_to_rgb(polygon_color[0]      ,						UpperCAmelCase      ,						polygon_color[2]    )
								return modified_color






lowerCamelCase_				:		Optional[int]       						=       (
    np.array(
        [
            0.0_0_0,
            0.4_4_7,
            0.7_4_1,
            0.8_5_0,
            0.3_2_5,
            0.0_9_8,
            0.9_2_9,
            0.6_9_4,
            0.1_2_5,
            0.4_9_4,
            0.1_8_4,
            0.5_5_6,
            0.4_6_6,
            0.6_7_4,
            0.1_8_8,
            0.3_0_1,
            0.7_4_5,
            0.9_3_3,
            0.6_3_5,
            0.0_7_8,
            0.1_8_4,
            0.3_0_0,
            0.3_0_0,
            0.3_0_0,
            0.6_0_0,
            0.6_0_0,
            0.6_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.7_4_9,
            0.7_4_9,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.3_3_3,
            0.0_0_0,
            0.3_3_3,
            0.6_6_7,
            0.0_0_0,
            0.3_3_3,
            1.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.3_3_3,
            0.0_0_0,
            0.6_6_7,
            0.6_6_7,
            0.0_0_0,
            0.6_6_7,
            1.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.3_3_3,
            0.5_0_0,
            0.0_0_0,
            0.6_6_7,
            0.5_0_0,
            0.0_0_0,
            1.0_0_0,
            0.5_0_0,
            0.3_3_3,
            0.0_0_0,
            0.5_0_0,
            0.3_3_3,
            0.3_3_3,
            0.5_0_0,
            0.3_3_3,
            0.6_6_7,
            0.5_0_0,
            0.3_3_3,
            1.0_0_0,
            0.5_0_0,
            0.6_6_7,
            0.0_0_0,
            0.5_0_0,
            0.6_6_7,
            0.3_3_3,
            0.5_0_0,
            0.6_6_7,
            0.6_6_7,
            0.5_0_0,
            0.6_6_7,
            1.0_0_0,
            0.5_0_0,
            1.0_0_0,
            0.0_0_0,
            0.5_0_0,
            1.0_0_0,
            0.3_3_3,
            0.5_0_0,
            1.0_0_0,
            0.6_6_7,
            0.5_0_0,
            1.0_0_0,
            1.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.3_3_3,
            1.0_0_0,
            0.0_0_0,
            0.6_6_7,
            1.0_0_0,
            0.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.3_3_3,
            1.0_0_0,
            0.3_3_3,
            0.6_6_7,
            1.0_0_0,
            0.3_3_3,
            1.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.3_3_3,
            1.0_0_0,
            0.6_6_7,
            0.6_6_7,
            1.0_0_0,
            0.6_6_7,
            1.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.3_3_3,
            1.0_0_0,
            1.0_0_0,
            0.6_6_7,
            1.0_0_0,
            0.3_3_3,
            0.0_0_0,
            0.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.0_0_0,
            0.0_0_0,
            0.8_3_3,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.1_6_7,
            0.0_0_0,
            0.0_0_0,
            0.3_3_3,
            0.0_0_0,
            0.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.0_0_0,
            0.0_0_0,
            0.8_3_3,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.1_6_7,
            0.0_0_0,
            0.0_0_0,
            0.3_3_3,
            0.0_0_0,
            0.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.0_0_0,
            0.0_0_0,
            0.8_3_3,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.1_4_3,
            0.1_4_3,
            0.1_4_3,
            0.8_5_7,
            0.8_5_7,
            0.8_5_7,
            1.0_0_0,
            1.0_0_0,
            1.0_0_0,
        ]
    )
    .astype(np.floataa)
    .reshape(-1, 3)
)






"""simple docstring"""

import os
from argparse import ArgumentParser
from pathlib import Path
from shutil import copyfile, rmtree
from typing import Generator

import datasets.config
from datasets.builder import DatasetBuilder
from datasets.commands import BaseDatasetsCLICommand
from datasets.download.download_manager import DownloadMode
from datasets.load import dataset_module_factory, import_main_class
from datasets.utils.filelock import logger as fl_logger
from datasets.utils.info_utils import VerificationMode
from datasets.utils.logging import ERROR, get_logger


SCREAMING_SNAKE_CASE_			    =  get_logger(__name__)




def 			lowercase__  (    lowerCAmelCase :    Dict       )       ->					Any:






    """simple docstring"""




    return TestCommand(
        args.dataset       , args.name       , args.cache_dir       , args.data_dir       , args.all_configs       , args.save_info or args.save_infos       , args.ignore_verifications       , args.force_redownload       , args.clear_cache       , )







class    _UpperCAmelCase							(						SCREAMING_SNAKE_CASE_							):
      __SCREAMING_SNAKE_CASE      :							Optional[Any]												=		False  # to tell pytest it's not a test class




      @staticmethod
      def 			a_					(							lowercase_							)  ->    int:
          UpperCAmelCase  	=    parser.add_parser('test'      ,				help='Test dataset implementation.'							)
          test_parser.add_argument('--name'      ,				type=lowercase_      ,				default=lowercase_      ,				help='Dataset processing name'							)
          test_parser.add_argument(
              '--cache_dir'      ,				type=lowercase_      ,				default=lowercase_      ,				help='Cache directory where the datasets are stored.'      ,				)
          test_parser.add_argument(
              '--data_dir'      ,				type=lowercase_      ,				default=lowercase_      ,				help='Can be used to specify a manual directory to get the files from.'      ,				)
          test_parser.add_argument('--all_configs'      ,				action='store_true'      ,				help='Test all dataset configurations'							)
          test_parser.add_argument(
              '--save_info'      ,				action='store_true'      ,				help='Save the dataset infos in the dataset card (README.md)'							)
          test_parser.add_argument(
              '--ignore_verifications'      ,				action='store_true'      ,				help='Run the test without checksums and splits checks.'      ,				)
          test_parser.add_argument('--force_redownload'      ,				action='store_true'      ,				help='Force dataset redownload'							)
          test_parser.add_argument(
              '--clear_cache'      ,				action='store_true'      ,				help='Remove downloaded files and cached datasets after each config test'      ,				)
          # aliases
          test_parser.add_argument('--save_infos'      ,				action='store_true'      ,				help='alias to save_info'							)
          test_parser.add_argument('dataset'      ,				type=lowercase_      ,				help='Name of the dataset to download'							)
          test_parser.set_defaults(func=_test_command_factory							)




      def __init__(							self      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				lowercase_      ,				)  ->    List[Any]:
          UpperCAmelCase  	=    dataset
          UpperCAmelCase  	=    name
          UpperCAmelCase  	=    cache_dir
          UpperCAmelCase  	=    data_dir
          UpperCAmelCase  	=    all_configs
          UpperCAmelCase  	=    save_infos
          UpperCAmelCase  	=    ignore_verifications
          UpperCAmelCase  	=    force_redownload
          UpperCAmelCase  	=    clear_cache
          if clear_cache and not cache_dir:
              print(
                  'When --clear_cache is used, specifying a cache directory is mandatory.\n'
                  'The \'download\' folder of the cache directory and the dataset builder cache will be deleted after each configuration test.\n'
                  'Please provide a --cache_dir that will be used to test the dataset script.'							)
              exit(1							)
          if save_infos:
              UpperCAmelCase  	=    True




      def 			a_					(							self							)  ->    List[Any]:
          fl_logger().setLevel(lowercase_							)
          if self._name is not None and self._all_configs:
              print('Both parameters `config` and `all_configs` can\'t be used at once.'							)
              exit(1							)
          UpperCAmelCase	,							UpperCAmelCase  	=    self._dataset, self._name
          UpperCAmelCase  	=    dataset_module_factory(lowercase_							)
          UpperCAmelCase  	=    import_main_class(module.module_path							)
          UpperCAmelCase  	=    len(builder_cls.BUILDER_CONFIGS							) if self._all_configs and builder_cls.BUILDER_CONFIGS else 1

          def get_builders() -> Generator[DatasetBuilder, None, None]:
              if self._all_configs and builder_cls.BUILDER_CONFIGS:
                  for i, config in enumerate(builder_cls.BUILDER_CONFIGS							):
                      if "config_name" in module.builder_kwargs:
                          yield builder_cls(
                              cache_dir=self._cache_dir      ,				data_dir=self._data_dir      ,				**module.builder_kwargs      ,				)
                      else:
                          yield builder_cls(
                              config_name=config.name      ,				cache_dir=self._cache_dir      ,				data_dir=self._data_dir      ,				**module.builder_kwargs      ,				)
              else:
                  if "config_name" in module.builder_kwargs:
                      yield builder_cls(cache_dir=self._cache_dir      ,				data_dir=self._data_dir      ,				**module.builder_kwargs							)
                  else:
                      yield builder_cls(
                          config_name=lowercase_      ,				cache_dir=self._cache_dir      ,				data_dir=self._data_dir      ,				**module.builder_kwargs      ,				)

          for j, builder in enumerate(get_builders()							):
              print(F"Testing builder '{builder.config.name}' ({j + 1}/{n_builders})"							)
              UpperCAmelCase  	=    os.path.exists(
                  os.path.join(builder.get_imported_module_dir()      ,				datasets.config.DATASETDICT_INFOS_FILENAME							)							)  # record checksums only if we need to update a (deprecated) dataset_infos.json
              builder.download_and_prepare(
                  download_mode=DownloadMode.REUSE_CACHE_IF_EXISTS
                  if not self._force_redownload
                  else DownloadMode.FORCE_REDOWNLOAD      ,				verification_mode=VerificationMode.NO_CHECKS
                  if self._ignore_verifications
                  else VerificationMode.ALL_CHECKS      ,				try_from_hf_gcs=lowercase_      ,				)
              builder.as_dataset()
              if self._save_infos:
                  builder._save_infos()

              # If save_infos=True, the dataset card (README.md) is created next to the loaded module file.
              # The dataset_infos are saved in the YAML part of the README.md

              # Let's move it to the original directory of the dataset script, to allow the user to
              # upload them on S3 at the same time afterwards.
              if self._save_infos:
                  UpperCAmelCase  	=    os.path.join(builder_cls.get_imported_module_dir()      ,				'README.md'							)
                  UpperCAmelCase  	=    Path(lowercase_							).name + '.py'
                  UpperCAmelCase  	=    os.path.join(lowercase_      ,				lowercase_							)
                  if os.path.isfile(lowercase_							):
                      UpperCAmelCase  	=    os.path.dirname(lowercase_							)
                  elif os.path.isfile(lowercase_							):
                      UpperCAmelCase  	=    path
                  elif os.path.isdir(lowercase_							):  # for local directories containing only data files
                      UpperCAmelCase  	=    path
                  else:  # in case of a remote dataset
                      UpperCAmelCase  	=    None
                      print(F"Dataset card saved at {dataset_readme_path}"							)

                  # Move dataset_info back to the user
                  if dataset_dir is not None:
                      UpperCAmelCase  	=    os.path.join(lowercase_      ,				'README.md'							)
                      copyfile(lowercase_      ,				lowercase_							)
                      print(F"Dataset card saved at {user_dataset_readme_path}"							)

            # If clear_cache=True, the download folder and the dataset builder cache directory are deleted
              if self._clear_cache:
                  if os.path.isdir(builder._cache_dir							):
                      logger.warning(F"Clearing cache at {builder._cache_dir}"							)
                      rmtree(builder._cache_dir							)
                  UpperCAmelCase  	=    os.path.join(self._cache_dir      ,				datasets.config.DOWNLOADED_DATASETS_DIR							)
                  if os.path.isdir(lowercase_							):
                      logger.warning(F"Clearing cache at {download_dir}"							)
                      rmtree(lowercase_							)

          print('Test successful.'							)



