





'''simple docstring'''



import os
from shutil import copyfile
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


if TYPE_CHECKING:
	from transformers.pipelines.conversational import Conversation

_SCREAMING_SNAKE_CASE    =			logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE    =			{'''vocab_file''': '''tokenizer.model'''}

_SCREAMING_SNAKE_CASE    =			{
    '''vocab_file''': {
        '''hf-internal-testing/llama-tokenizer''': '''https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer.model''',
    },
    '''tokenizer_file''': {
        '''hf-internal-testing/llama-tokenizer''': '''https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer_config.json''',
    },
}
_SCREAMING_SNAKE_CASE    =			{
    '''hf-internal-testing/llama-tokenizer''': 2_0_4_8,
}
_SCREAMING_SNAKE_CASE    =			'''▁'''

_SCREAMING_SNAKE_CASE    ,		_SCREAMING_SNAKE_CASE    =			'''[INST]''', '''[/INST]'''
_SCREAMING_SNAKE_CASE    ,		_SCREAMING_SNAKE_CASE    =			'''<<SYS>>\n''', '''\n<</SYS>>\n\n'''

# fmt: off
_SCREAMING_SNAKE_CASE    =			'''You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your\
answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure\
that your responses are socially unbiased and positive in nature.

If a question does not make any sense, or is not factually coherent, explain why instead of answering something not\
correct. If you don\'t know the answer to a question, please don\'t share false information.'''






class 							__lowercase				(					lowerCAmelCase__  ):







	'''simple docstring'''

	a			: Union[str, Any]      =				VOCAB_FILES_NAMES
	a			: Union[str, Any]      =				PRETRAINED_VOCAB_FILES_MAP
	a			: Dict      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	a			: Optional[int]      =				["input_ids", "attention_mask"]


	def __init__(self   ,_lowerCamelCase   ,_lowerCamelCase="<unk>"   ,_lowerCamelCase="<s>"   ,_lowerCamelCase="</s>"   ,_lowerCamelCase=None   ,_lowerCamelCase = None   ,_lowerCamelCase=True   ,_lowerCamelCase=False   ,_lowerCamelCase=False   ,_lowerCamelCase=True   ,**_lowerCamelCase   ,)							->							Dict:







				'''simple docstring'''





				__lowercase   =							{} if sp_model_kwargs is None else sp_model_kwargs
				__lowercase   =							AddedToken(_lowerCamelCase   ,lstrip=_lowerCamelCase   ,rstrip=_lowerCamelCase       ) if isinstance(_lowerCamelCase   ,_lowerCamelCase       ) else bos_token
				__lowercase   =							AddedToken(_lowerCamelCase   ,lstrip=_lowerCamelCase   ,rstrip=_lowerCamelCase       ) if isinstance(_lowerCamelCase   ,_lowerCamelCase       ) else eos_token
				__lowercase   =							AddedToken(_lowerCamelCase   ,lstrip=_lowerCamelCase   ,rstrip=_lowerCamelCase       ) if isinstance(_lowerCamelCase   ,_lowerCamelCase       ) else unk_token
				__lowercase   =							AddedToken(_lowerCamelCase   ,lstrip=_lowerCamelCase   ,rstrip=_lowerCamelCase       ) if isinstance(_lowerCamelCase   ,_lowerCamelCase       ) else pad_token
				super().__init__(
				    bos_token=_lowerCamelCase   ,eos_token=_lowerCamelCase   ,unk_token=_lowerCamelCase   ,pad_token=_lowerCamelCase   ,add_bos_token=_lowerCamelCase   ,add_eos_token=_lowerCamelCase   ,sp_model_kwargs=self.sp_model_kwargs   ,clean_up_tokenization_spaces=_lowerCamelCase   ,legacy=_lowerCamelCase   ,**_lowerCamelCase   ,)
				if legacy:
							logger.warning_once(
							    f"You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to"
							    ''' read the related pull request available at https://github.com/huggingface/transformers/pull/24565'''       )
				__lowercase   =							legacy
				__lowercase   =							vocab_file
				__lowercase   =							add_bos_token
				__lowercase   =							add_eos_token
				__lowercase   =							spm.SentencePieceProcessor(**self.sp_model_kwargs       )
				self.sp_model.Load(_lowerCamelCase       )


	def __getstate__(self       )							->							Union[str, Any]:







				'''simple docstring'''





				__lowercase   =							self.__dict__.copy()
				__lowercase   =							None
				__lowercase   =							self.sp_model.serialized_model_proto()
				return state


	def __setstate__(self   ,_lowerCamelCase       )							->							Optional[Any]:







				'''simple docstring'''





				__lowercase   =							d
				__lowercase   =							spm.SentencePieceProcessor(**self.sp_model_kwargs       )
				self.sp_model.LoadFromSerializedProto(self.sp_model_proto       )


	@property
	def   _UpperCAmelCase   (self       )							->							Optional[int]:







				'''simple docstring'''





				return self.sp_model.get_piece_size()


	def   _UpperCAmelCase   (self       )							->							List[Any]:







				'''simple docstring'''





				__lowercase   =							{self.convert_ids_to_tokens(_lowerCamelCase       ): i for i in range(self.vocab_size       )}
				vocab.update(self.added_tokens_encoder       )
				return vocab


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,**_lowerCamelCase       )							->							List[str]:







				'''simple docstring'''





				if not self.legacy:
							__lowercase   =							SPIECE_UNDERLINE + text.replace(_lowerCamelCase   ,''' '''       )
				return super().tokenize(_lowerCamelCase   ,**_lowerCamelCase       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							Tuple:







				'''simple docstring'''





				if not self.legacy:
							__lowercase   =							text.startswith(_lowerCamelCase       )
							if is_first:
										__lowercase   =							text[1:]

				__lowercase   =							self.sp_model.encode(_lowerCamelCase   ,out_type=_lowerCamelCase       )

				if not self.legacy and not is_first and not text.startswith(''' '''       ) and tokens[0].startswith(_lowerCamelCase       ):
							__lowercase   =							([tokens[0][1:]] if len(tokens[0]       ) > 1 else []) + tokens[1:]
				return tokens


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							Tuple:







				'''simple docstring'''





				return self.sp_model.piece_to_id(_lowerCamelCase       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							Dict:







				'''simple docstring'''





				__lowercase   =							self.sp_model.IdToPiece(_lowerCamelCase       )
				return token


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							Optional[Any]:







				'''simple docstring'''





				__lowercase   =							[]
				__lowercase   =							''''''
				__lowercase   =							False
				for i, token in enumerate(_lowerCamelCase       ):
							# make sure that special tokens are not decoded using sentencepiece model
							if token in self.all_special_tokens:
										if not prev_is_special and i != 0:
													out_string += " "
										out_string += self.sp_model.decode(_lowerCamelCase       ) + token
										__lowercase   =							True
										__lowercase   =							[]
							else:
										current_sub_tokens.append(_lowerCamelCase       )
										__lowercase   =							False
				out_string += self.sp_model.decode(_lowerCamelCase       )
				return out_string


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase = None       )							->							Tuple[str]:







				'''simple docstring'''





				if not os.path.isdir(_lowerCamelCase       ):
							logger.error(f"Vocabulary path ({save_directory}) should be a directory"       )
							return
				__lowercase   =							os.path.join(
				    _lowerCamelCase   ,(filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file''']       )

				if os.path.abspath(self.vocab_file       ) != os.path.abspath(_lowerCamelCase       ) and os.path.isfile(self.vocab_file       ):
							copyfile(self.vocab_file   ,_lowerCamelCase       )
				elif not os.path.isfile(self.vocab_file       ):
							with open(_lowerCamelCase   ,'''wb'''       ) as fi:
										__lowercase   =							self.sp_model.serialized_model_proto()
										fi.write(_lowerCamelCase       )

				return (out_vocab_file,)


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase=None       )							->							Any:







				'''simple docstring'''





				__lowercase   =							[self.bos_token_id] if self.add_bos_token else []
				__lowercase   =							[self.eos_token_id] if self.add_eos_token else []

				__lowercase   =							bos_token_id + token_ids_a + eos_token_id

				if token_ids_a is not None:
							__lowercase   =							output + bos_token_id + token_ids_a + eos_token_id

				return output


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase = None   ,_lowerCamelCase = False       )							->							List[int]:







				'''simple docstring'''





				if already_has_special_tokens:
							return super().get_special_tokens_mask(
							    token_ids_a=_lowerCamelCase   ,token_ids_a=_lowerCamelCase   ,already_has_special_tokens=_lowerCamelCase       )

				__lowercase   =							[1] if self.add_bos_token else []
				__lowercase   =							[1] if self.add_eos_token else []

				if token_ids_a is None:
							return bos_token_id + ([0] * len(_lowerCamelCase       )) + eos_token_id
				return (
				    bos_token_id
				    + ([0] * len(_lowerCamelCase       ))
				    + eos_token_id
				    + bos_token_id
				    + ([0] * len(_lowerCamelCase       ))
				    + eos_token_id
				)


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase = None       )							->							List[int]:







				'''simple docstring'''





				__lowercase   =							[self.bos_token_id] if self.add_bos_token else []
				__lowercase   =							[self.eos_token_id] if self.add_eos_token else []

				__lowercase   =							[0] * len(bos_token_id + token_ids_a + eos_token_id       )

				if token_ids_a is not None:
							output += [1] * len(bos_token_id + token_ids_a + eos_token_id       )

				return output


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							List[int]:







				'''simple docstring'''





				__lowercase   =							list(conversation.iter_texts()       )
				if not all([is_user for is_user, msg in dialogue[::2]]       ) or not all(
				    [not is_user for is_user, msg in dialogue[1::2]]       ):
							raise ValueError(
							    '''The model only supports \'user\' and \'assistant\' roles, starting with user and alternating (u/a/u/a/u...)'''       )

				__lowercase   =							[]
				if len(conversation.past_user_inputs       ) > 0:
							if not conversation.past_user_inputs[0].startswith(_lowerCamelCase       ) or E_SYS not in conversation.past_user_inputs[0]:
										__lowercase   =							(
										    B_SYS + DEFAULT_SYSTEM_PROMPT + E_SYS + conversation.past_user_inputs[0]
										)
				elif not dialogue[0][1].startswith(_lowerCamelCase       ) or E_SYS not in dialogue[0][1]:
							__lowercase   =							(dialogue[0][0], B_SYS + DEFAULT_SYSTEM_PROMPT + E_SYS + dialogue[0][1])

				dialog_tokens += sum(
				    [
				        [self.bos_token_id]
				        + self.encode(
				            f"{B_INST} {(prompt[1]).strip()} {E_INST} {(answer[1]).strip()} "   ,add_special_tokens=_lowerCamelCase       )
				        + [self.eos_token_id]
				        for prompt, answer in zip(dialogue[::2]   ,dialogue[1::2]       )
				    ]   ,[]   ,)
				if not (dialogue[-1][0]):
							raise ValueError(f"Last message must be from user, got {dialogue[-1]['role']}"       )
				dialog_tokens += [self.bos_token_id] + self.encode(
				    f"{B_INST} {(dialogue[-1][1]).strip()} {E_INST}"   ,add_special_tokens=_lowerCamelCase       )
				return dialog_tokens












'''simple docstring'''



import argparse
import logging
import os
import sys
from collections import namedtuple

import torch
from modeling_bertabs import BertAbs, build_predictor
from torch.utils.data import DataLoader, SequentialSampler
from tqdm import tqdm

from transformers import BertTokenizer

from .utils_summarization import (
    CNNDMDataset,
    build_mask,
    compute_token_type_ids,
    encode_for_summarization,
    truncate_or_pad,
)


_SCREAMING_SNAKE_CASE    =			logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.INFO)


_SCREAMING_SNAKE_CASE    =			namedtuple('''Batch''', ['''document_names''', '''batch_size''', '''src''', '''segs''', '''mask_src''', '''tgt_str'''])




def       _lowerCAmelCase  ( lowerCamelCase_	:     int ):
			__lowercase   =							BertTokenizer.from_pretrained('''bert-base-uncased'''						,				do_lower_case=lowerCamelCase_ )
			__lowercase   =							BertAbs.from_pretrained('''remi/bertabs-finetuned-extractive-abstractive-summarization''' )
			model.to(args.device )
			model.eval()

			__lowercase   =							{
			    '''BOS''': tokenizer.vocab['''[unused0]'''],
			    '''EOS''': tokenizer.vocab['''[unused1]'''],
			    '''PAD''': tokenizer.vocab['''[PAD]'''],
			}

			if args.compute_rouge:
						__lowercase   =							[]
						__lowercase   =							[]

						import nltk
						import rouge

						nltk.download('''punkt''' )
						__lowercase   =							rouge.Rouge(
						    metrics=['''rouge-n''', '''rouge-l''']						,				max_n=2						,				limit_length=lowerCamelCase_						,				length_limit=args.beam_size						,				length_limit_type='''words'''						,				apply_avg=lowerCamelCase_						,				apply_best=lowerCamelCase_						,				alpha=0.5						,				weight_factor=1.2						,				stemming=lowerCamelCase_						,				)

			# these (unused) arguments are defined to keep the compatibility
			# with the legacy code and will be deleted in a next iteration.
			__lowercase   =							''''''
			__lowercase   =							''''''

			__lowercase   =							build_data_iterator(lowerCamelCase_						,				lowerCamelCase_ )
			__lowercase   =							build_predictor(lowerCamelCase_						,				lowerCamelCase_						,				lowerCamelCase_						,				lowerCamelCase_ )

			logger.info('''***** Running evaluation *****''' )
			logger.info('''  Number examples = %d'''						,				len(data_iterator.dataset ) )
			logger.info('''  Batch size = %d'''						,				args.batch_size )
			logger.info('''''' )
			logger.info('''***** Beam Search parameters *****''' )
			logger.info('''  Beam size = %d'''						,				args.beam_size )
			logger.info('''  Minimum length = %d'''						,				args.min_length )
			logger.info('''  Maximum length = %d'''						,				args.max_length )
			logger.info('''  Alpha (length penalty) = %.2f'''						,				args.alpha )
			logger.info('''  Trigrams %s be blocked'''						,				('''will''' if args.block_trigram else '''will NOT''') )

			for batch in tqdm(lowerCamelCase_ ):
						__lowercase   =							predictor.translate_batch(lowerCamelCase_ )
						__lowercase   =							predictor.from_batch(lowerCamelCase_ )
						__lowercase   =							[format_summary(lowerCamelCase_ ) for t in translations]
						save_summaries(lowerCamelCase_						,				args.summaries_output_dir						,				batch.document_names )

						if args.compute_rouge:
									reference_summaries += batch.tgt_str
									generated_summaries += summaries

			if args.compute_rouge:
						__lowercase   =							rouge_evaluator.get_scores(lowerCamelCase_						,				lowerCamelCase_ )
						__lowercase   =							format_rouge_scores(lowerCamelCase_ )
						save_rouge_scores(lowerCamelCase_ )
						print(lowerCamelCase_ )




def       _lowerCAmelCase  ( lowerCamelCase_	:     Optional[int]						,				lowerCamelCase_	:     str						,				lowerCamelCase_	:     Dict ):
			for summary, document_name in zip(lowerCamelCase_						,				lowerCamelCase_ ):
						# Prepare the summary file's name
						if "." in document_name:
									__lowercase   =							'''.'''.join(document_name.split('''.''' )[:-1] )
									__lowercase   =							document_name.split('''.''' )[-1]
									__lowercase   =							bare_document_name + '''_summary.''' + extension
						else:
									__lowercase   =							document_name + '''_summary'''

						__lowercase   =							os.path.join(lowerCamelCase_						,				lowerCamelCase_ )
						with open(lowerCamelCase_						,				'''w''' ) as output:
									output.write(lowerCamelCase_ )




def       _lowerCAmelCase  ( lowerCamelCase_	:     List[Any] ):
			__lowercase  ,						__lowercase  ,						__lowercase   =							translation
			__lowercase   =							(
			    raw_summary.replace('''[unused0]'''						,				'''''' )
			    .replace('''[unused3]'''						,				'''''' )
			    .replace('''[PAD]'''						,				'''''' )
			    .replace('''[unused1]'''						,				'''''' )
			    .replace(r''' +'''						,				''' ''' )
			    .replace(''' [unused2] '''						,				'''. ''' )
			    .replace('''[unused2]'''						,				'''''' )
			    .strip()
			)

			return summary




def       _lowerCAmelCase  ( lowerCamelCase_	:     int ):
			return """\n
****** ROUGE SCORES ******

** ROUGE 1
F1        >> {:.3f}
Precision >> {:.3f}
Recall    >> {:.3f}

** ROUGE 2
F1        >> {:.3f}
Precision >> {:.3f}
Recall    >> {:.3f}

** ROUGE L
F1        >> {:.3f}
Precision >> {:.3f}
Recall    >> {:.3f}""".format(
			    scores['''rouge-1''']['''f''']						,				scores['''rouge-1''']['''p''']						,				scores['''rouge-1''']['''r''']						,				scores['''rouge-2''']['''f''']						,				scores['''rouge-2''']['''p''']						,				scores['''rouge-2''']['''r''']						,				scores['''rouge-l''']['''f''']						,				scores['''rouge-l''']['''p''']						,				scores['''rouge-l''']['''r''']						,				)




def       _lowerCAmelCase  ( lowerCamelCase_	:     Dict ):
			with open('''rouge_scores.txt'''						,				'''w''' ) as output:
						output.write(lowerCamelCase_ )




def       _lowerCAmelCase  ( lowerCamelCase_	:     List[Any]						,				lowerCamelCase_	:     List[Any] ):
			__lowercase   =							load_and_cache_examples(lowerCamelCase_						,				lowerCamelCase_ )
			__lowercase   =							SequentialSampler(lowerCamelCase_ )

			def collate_fn(lowerCamelCase_	:     List[str] ):
						return collate(lowerCamelCase_						,				lowerCamelCase_						,				block_size=5_1_2						,				device=args.device )

			__lowercase   =							DataLoader(
			    lowerCamelCase_						,				sampler=lowerCamelCase_						,				batch_size=args.batch_size						,				collate_fn=lowerCamelCase_						,				)

			return iterator




def       _lowerCAmelCase  ( lowerCamelCase_	:     Optional[int]						,				lowerCamelCase_	:     List[Any] ):
			__lowercase   =							CNNDMDataset(args.documents_dir )
			return dataset




def       _lowerCAmelCase  ( lowerCamelCase_	:     Optional[int]						,				lowerCamelCase_	:     List[Any]						,				lowerCamelCase_	:     Any						,				lowerCamelCase_	:     Optional[Any] ):
			__lowercase   =							[x for x in data if not len(x[1] ) == 0]  # remove empty_files
			__lowercase   =							[name for name, _, _ in data]
			__lowercase   =							[''' '''.join(lowerCamelCase_ ) for _, _, summary_list in data]

			__lowercase   =							[encode_for_summarization(lowerCamelCase_						,				lowerCamelCase_						,				lowerCamelCase_ ) for _, story, summary in data]
			__lowercase   =							torch.tensor(
			    [truncate_or_pad(lowerCamelCase_						,				lowerCamelCase_						,				tokenizer.pad_token_id ) for story, _ in encoded_text] )
			__lowercase   =							compute_token_type_ids(lowerCamelCase_						,				tokenizer.cls_token_id )
			__lowercase   =							build_mask(lowerCamelCase_						,				tokenizer.pad_token_id )

			__lowercase   =							Batch(
			    document_names=lowerCamelCase_						,				batch_size=len(lowerCamelCase_ )						,				src=encoded_stories.to(lowerCamelCase_ )						,				segs=encoder_token_type_ids.to(lowerCamelCase_ )						,				mask_src=encoder_mask.to(lowerCamelCase_ )						,				tgt_str=lowerCamelCase_						,				)

			return batch




def       _lowerCAmelCase  ( lowerCamelCase_	:     List[Any]						,				lowerCamelCase_	:     Union[str, Any] ):
			__lowercase   =							summary_tokens.to('''cpu''' ).numpy()
			__lowercase   =							tokenizer.decode(lowerCamelCase_ )
			__lowercase   =							summary.split('''.''' )
			__lowercase   =							[s + '''.''' for s in sentences]
			return sentences




def       _lowerCAmelCase  ( ):
			__lowercase   =							argparse.ArgumentParser()
			parser.add_argument(
			    '''--documents_dir'''						,				default=lowerCamelCase_						,				type=lowerCamelCase_						,				required=lowerCamelCase_						,				help='''The folder where the documents to summarize are located.'''						,				)
			parser.add_argument(
			    '''--summaries_output_dir'''						,				default=lowerCamelCase_						,				type=lowerCamelCase_						,				required=lowerCamelCase_						,				help='''The folder in wich the summaries should be written. Defaults to the folder where the documents are'''						,				)
			parser.add_argument(
			    '''--compute_rouge'''						,				default=lowerCamelCase_						,				type=lowerCamelCase_						,				required=lowerCamelCase_						,				help='''Compute the ROUGE metrics during evaluation. Only available for the CNN/DailyMail dataset.'''						,				)
			# EVALUATION options
			parser.add_argument(
			    '''--no_cuda'''						,				default=lowerCamelCase_						,				type=lowerCamelCase_						,				help='''Whether to force the execution on CPU.'''						,				)
			parser.add_argument(
			    '''--batch_size'''						,				default=4						,				type=lowerCamelCase_						,				help='''Batch size per GPU/CPU for training.'''						,				)
			# BEAM SEARCH arguments
			parser.add_argument(
			    '''--min_length'''						,				default=5_0						,				type=lowerCamelCase_						,				help='''Minimum number of tokens for the summaries.'''						,				)
			parser.add_argument(
			    '''--max_length'''						,				default=2_0_0						,				type=lowerCamelCase_						,				help='''Maixmum number of tokens for the summaries.'''						,				)
			parser.add_argument(
			    '''--beam_size'''						,				default=5						,				type=lowerCamelCase_						,				help='''The number of beams to start with for each example.'''						,				)
			parser.add_argument(
			    '''--alpha'''						,				default=0.95						,				type=lowerCamelCase_						,				help='''The value of alpha for the length penalty in the beam search.'''						,				)
			parser.add_argument(
			    '''--block_trigram'''						,				default=lowerCamelCase_						,				type=lowerCamelCase_						,				help='''Whether to block the existence of repeating trigrams in the text generated by beam search.'''						,				)
			__lowercase   =							parser.parse_args()

			# Select device (distibuted not available)
			__lowercase   =							torch.device('''cuda''' if torch.cuda.is_available() and not args.no_cuda else '''cpu''' )

			# Check the existence of directories
			if not args.summaries_output_dir:
						__lowercase   =							args.documents_dir

			if not documents_dir_is_valid(args.documents_dir ):
						raise FileNotFoundError(
						    '''We could not find the directory you specified for the documents to summarize, or it was empty. Please'''
						    ''' specify a valid path.''' )
			os.makedirs(args.summaries_output_dir						,				exist_ok=lowerCamelCase_ )

			evaluate(lowerCamelCase_ )




def       _lowerCAmelCase  ( lowerCamelCase_	:     Optional[Any] ):
			if not os.path.exists(lowerCamelCase_ ):
						return False

			__lowercase   =							os.listdir(lowerCamelCase_ )
			if len(lowerCamelCase_ ) == 0:
						return False

			return True


if __name__ == "__main__":
	main()





