




from math import asin, atan, cos, radians, sin, sqrt, tan

__lowerCAmelCase	:       List[Any]     =	637_8137.0
__lowerCAmelCase	:       List[str]     =	635_6752.31_4245
__lowerCAmelCase	:       Optional[int]     =	637_8137




def     __magic_name__       (				A	:      float,						A	:      float,						A	:      float,						A	:      float     ):






			'''simple docstring'''







			a					=    (AXIS_A - AXIS_B) / AXIS_A
			a					=    atan((1 - flattening) * tan(radians(A     )     )     )
			a					=    atan((1 - flattening) * tan(radians(A     )     )     )
			a					=    radians(A     )
			a					=    radians(A     )
			# Equation
			a					=    sin((phi_a - phi_a) / 2     )
			a					=    sin((lambda_a - lambda_a) / 2     )
			# Square both values
			sin_sq_phi *= sin_sq_phi
			sin_sq_lambda *= sin_sq_lambda
			a					=    sqrt(sin_sq_phi + (cos(A     ) * cos(A     ) * sin_sq_lambda)     )
			return 2 * RADIUS * asin(A     )


if __name__ == "__main__":
		import doctest

		doctest.testmod()












import multiprocessing
import time

from arguments import PretokenizationArguments
from datasets import load_dataset

from transformers import AutoTokenizer, HfArgumentParser




def     __magic_name__       (				A	:      List[str]     ):






			'''simple docstring'''







			a					=    {}
			a					=    tokenizer(example["content"],						truncation=A     )["input_ids"]
			a					=    len(example["content"]     ) / len(output["input_ids"]     )
			return output


__lowerCAmelCase	:       Dict     =	HfArgumentParser(PretokenizationArguments)
__lowerCAmelCase	:       str     =	parser.parse_args()
if args.num_workers is None:
		__lowerCAmelCase	:       List[Any]     =	multiprocessing.cpu_count()
__lowerCAmelCase	:       str     =	AutoTokenizer.from_pretrained(args.tokenizer_dir)

__lowerCAmelCase	:       List[Any]     =	time.time()
__lowerCAmelCase	:       str     =	load_dataset(args.dataset_name, split='train')
print(F'''Dataset loaded in {time.time()-t_start:.2f}s''')

__lowerCAmelCase	:       int     =	time.time()
__lowerCAmelCase	:       Optional[int]     =	ds.map(
    tokenize,
    num_proc=args.num_workers,
    remove_columns=[
        'repo_name',
        'path',
        'copies',
        'size',
        'content',
        'license',
        'hash',
        'line_mean',
        'line_max',
        'alpha_frac',
        'autogenerated',
    ],
)
print(F'''Dataset tokenized in {time.time()-t_start:.2f}s''')

__lowerCAmelCase	:       Tuple     =	time.time()
ds.push_to_hub(args.tokenized_data_repo)






print(F'''Data pushed to the hub in {time.time()-t_start:.2f}s''')






