





import copy
import fnmatch
import json
import os
import pickle as pkl
import shutil
import sys
import tarfile
import tempfile
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial
from hashlib import shaaaa
from io import BytesIO
from pathlib import Path
from urllib.parse import urlparse
from zipfile import ZipFile, is_zipfile

import cva
import numpy as np
import requests
import wget
from filelock import FileLock
from PIL import Image
from tqdm.auto import tqdm
from yaml import Loader, dump, load


try:
				import torch

				_a						=   True
except ImportError:
				_a						=   False


try:
				from torch.hub import _get_torch_home

				_a						=   _get_torch_home()
except ImportError:
				_a						=   os.path.expanduser(
				    os.getenv("TORCH_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "torch"))
				)

_a						=   os.path.join(torch_cache_home, "transformers")

_a						=   "https://cdn.huggingface.co"
_a						=   "https://s3.amazonaws.com/models.huggingface.co/bert"
_a						=   "/".join(str(Path(__file__).resolve()).split("/")[:-1])
_a						=   os.path.join(PATH, "config.yaml")
_a						=   os.path.join(PATH, "attributes.txt")
_a						=   os.path.join(PATH, "objects.txt")
_a						=   os.getenv("PYTORCH_PRETRAINED_BERT_CACHE", default_cache_path)
_a						=   os.getenv("PYTORCH_TRANSFORMERS_CACHE", PYTORCH_PRETRAINED_BERT_CACHE)
_a						=   os.getenv("TRANSFORMERS_CACHE", PYTORCH_TRANSFORMERS_CACHE)
_a						=   "pytorch_model.bin"
_a						=   "config.yaml"





def lowerCAmelCase__(__snake_case=OBJECTS ,__snake_case=ATTRIBUTES							)       ->   List[Any]:







	'''simple docstring'''







	lowerCamelCase__              =	[]
	with open(__snake_case							) as f:
		for object in f.readlines():
			vg_classes.append(object.split(''','''							)[0].lower().strip()							)

	lowerCamelCase__              =	[]
	with open(__snake_case							) as f:
		for object in f.readlines():
			vg_attrs.append(object.split(''','''							)[0].lower().strip()							)
	return vg_classes, vg_attrs





def lowerCAmelCase__(__snake_case							)       ->   Any:







	'''simple docstring'''







	lowerCamelCase__              =	OrderedDict()
	with open(__snake_case ,'''rb'''							) as f:
		lowerCamelCase__              =	pkl.load(__snake_case							)['''model''']
	for k in copy.deepcopy(list(ckp.keys()							)							):
		lowerCamelCase__              =	ckp.pop(__snake_case							)
		if isinstance(__snake_case ,np.ndarray							):
			lowerCamelCase__              =	torch.tensor(__snake_case							)
		else:
			assert isinstance(__snake_case ,torch.tensor							), type(__snake_case							)
		lowerCamelCase__              =	v
	return r






class       __A					:

			'''simple docstring'''







			lowerCAmelCase_							  =		{}





			def __init__(					self ,						__lowerCAmelCase ,						__lowerCAmelCase = "root" ,						__lowerCAmelCase=0							):



				'''simple docstring'''







				lowerCamelCase__              =	name
				lowerCamelCase__              =	level
				lowerCamelCase__              =	{}
				for k, v in dictionary.items():
					if v is None:
						raise ValueError()
					lowerCamelCase__              =	copy.deepcopy(__lowerCAmelCase							)
					lowerCamelCase__              =	copy.deepcopy(__lowerCAmelCase							)
					if isinstance(__lowerCAmelCase ,						__lowerCAmelCase							):
						lowerCamelCase__              =	Config(__lowerCAmelCase ,						name=__lowerCAmelCase ,						level=level + 1							)
					lowerCamelCase__              =	v
					setattr(self ,						__lowerCAmelCase ,						__lowerCAmelCase							)

				lowerCamelCase__              =	d





			def __repr__(					self							):



				'''simple docstring'''







				return str(list((self._pointer.keys())							)							)





			def __setattr__(					self ,						__lowerCAmelCase ,						__lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__              =	val
				lowerCamelCase__              =	val
				lowerCamelCase__              =	key.split('''.'''							)
				lowerCamelCase__              =	len(__lowerCAmelCase							) - 1
				lowerCamelCase__              =	self._pointer
				if len(__lowerCAmelCase							) > 1:
					for i, l in enumerate(__lowerCAmelCase							):
						if hasattr(self ,						__lowerCAmelCase							) and isinstance(getattr(self ,						__lowerCAmelCase							) ,						__lowerCAmelCase							):
							setattr(getattr(self ,						__lowerCAmelCase							) ,						'''.'''.join(levels[i:]							) ,						__lowerCAmelCase							)
						if l == last_level:
							lowerCamelCase__              =	val
						else:
							lowerCamelCase__              =	pointer[l]





			def 	__lowerCamelCase       (					self							):



				'''simple docstring'''







				return self._pointer





			def 	__lowerCamelCase       (					self ,						__lowerCAmelCase ,						__lowerCAmelCase							):



				'''simple docstring'''







				with open(F'{file_name}' ,						'''w'''							) as stream:
					dump(__lowerCAmelCase ,						__lowerCAmelCase							)





			def 	__lowerCamelCase       (					self ,						__lowerCAmelCase ,						__lowerCAmelCase							):



				'''simple docstring'''







				with open(F'{file_name}' ,						'''w'''							) as stream:
					json.dump(__lowerCAmelCase ,						__lowerCAmelCase							)





			@staticmethod
			def 	__lowerCamelCase       (					__lowerCAmelCase							):



				'''simple docstring'''







				with open(__lowerCAmelCase							) as stream:
					lowerCamelCase__              =	load(__lowerCAmelCase ,						Loader=__lowerCAmelCase							)
				return data





			def __str__(					self							):



				'''simple docstring'''







				lowerCamelCase__              =	'''    '''
				if self._name != "root":
					lowerCamelCase__              =	F'{t * (self._level-1)}{self._name}:\n'
				else:
					lowerCamelCase__              =	''''''
				lowerCamelCase__              =	self._level
				for i, (k, v) in enumerate(self._pointer.items()							):
					if isinstance(__lowerCAmelCase ,						__lowerCAmelCase							):
						r += F'{t * (self._level)}{v}\n'
						self._level += 1
					else:
						r += F'{t * (self._level)}{k}: {v} ({type(__lowerCAmelCase							).__name__})\n'
					lowerCamelCase__              =	level
				return r[:-1]





			@classmethod
			def 	__lowerCamelCase       (					cls ,						__lowerCAmelCase ,						**__lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__       ,			lowerCamelCase__              =	cls.get_config_dict(__lowerCAmelCase ,						**__lowerCAmelCase							)
				return cls(__lowerCAmelCase							)





			@classmethod
			def 	__lowerCamelCase       (					cls ,						__lowerCAmelCase ,						**__lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__              =	kwargs.pop('''cache_dir''' ,						__lowerCAmelCase							)
				lowerCamelCase__              =	kwargs.pop('''force_download''' ,						__lowerCAmelCase							)
				lowerCamelCase__              =	kwargs.pop('''resume_download''' ,						__lowerCAmelCase							)
				lowerCamelCase__              =	kwargs.pop('''proxies''' ,						__lowerCAmelCase							)
				lowerCamelCase__              =	kwargs.pop('''local_files_only''' ,						__lowerCAmelCase							)

				if os.path.isdir(__lowerCAmelCase							):
					lowerCamelCase__              =	os.path.join(__lowerCAmelCase ,						__lowerCAmelCase							)
				elif os.path.isfile(__lowerCAmelCase							) or is_remote_url(__lowerCAmelCase							):
					lowerCamelCase__              =	pretrained_model_name_or_path
				else:
					lowerCamelCase__              =	hf_bucket_url(__lowerCAmelCase ,						filename=__lowerCAmelCase ,						use_cdn=__lowerCAmelCase							)

				try:
					# Load from URL or cache if already cached
					lowerCamelCase__              =	cached_path(
					    __lowerCAmelCase ,						cache_dir=__lowerCAmelCase ,						force_download=__lowerCAmelCase ,						proxies=__lowerCAmelCase ,						resume_download=__lowerCAmelCase ,						local_files_only=__lowerCAmelCase ,						)
					# Load config dict
					if resolved_config_file is None:
						raise EnvironmentError

					lowerCamelCase__              =	Config.load_yaml(__lowerCAmelCase							)

				except EnvironmentError:
					lowerCamelCase__              =	'''Can\'t load config for'''
					raise EnvironmentError(__lowerCAmelCase							)

				if resolved_config_file == config_file:
					print('''loading configuration file from path'''							)
				else:
					print('''loading configuration file cache'''							)

				return Config.load_yaml(__lowerCAmelCase							), kwargs





def lowerCAmelCase__(__snake_case							)       ->   str:







	'''simple docstring'''







	lowerCamelCase__              =	torch.load('''dump.pt''' ,map_location=in_tensor.device							)
	lowerCamelCase__              =	in_tensor.numpy()
	lowerCamelCase__              =	out_tensor.numpy()[0]
	print(na.shape ,na[0, 0, :5]							)
	print(na.shape ,na[0, 0, :5]							)
	assert np.allclose(__snake_case ,__snake_case ,rtol=0.0_1 ,atol=0.1							), (
	    F'{sum([1 for x in np.isclose(__snake_case ,__snake_case ,rtol=0.0_1 ,atol=0.1							).flatten() if x is False]							)/len(na.flatten()							)*100:.4f} %'
	    " element-wise mismatch"
	)
	raise Exception('''tensors are all good'''							)

	# Hugging face functions below





def lowerCAmelCase__(__snake_case							)       ->   str:







	'''simple docstring'''







	lowerCamelCase__              =	urlparse(__snake_case							)
	return parsed.scheme in ("http", "https")





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case=True							)       ->   str:







	'''simple docstring'''







	lowerCamelCase__              =	CLOUDFRONT_DISTRIB_PREFIX if use_cdn else S3_BUCKET_PREFIX
	lowerCamelCase__              =	'''/''' not in model_id
	if legacy_format:
		return F'{endpoint}/{model_id}-{filename}'
	else:
		return F'{endpoint}/{model_id}/{filename}'





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case=None ,__snake_case=0 ,__snake_case=None ,)       ->   int:







	'''simple docstring'''







	lowerCamelCase__              =	'''python/{}'''.format(sys.version.split()[0]							)
	if _torch_available:
		ua += "; torch/{}".format(torch.__version__							)
	if isinstance(__snake_case ,__snake_case							):
		ua += "; " + "; ".join('''{}/{}'''.format(__snake_case ,__snake_case							) for k, v in user_agent.items()							)
	elif isinstance(__snake_case ,__snake_case							):
		ua += "; " + user_agent
	lowerCamelCase__              =	{'''user-agent''': ua}
	if resume_size > 0:
		lowerCamelCase__              =	'''bytes=%d-''' % (resume_size,)
	lowerCamelCase__              =	requests.get(__snake_case ,stream=__snake_case ,proxies=__snake_case ,headers=__snake_case							)
	if response.status_code == 416:  # Range not satisfiable
		return
	lowerCamelCase__              =	response.headers.get('''Content-Length'''							)
	lowerCamelCase__              =	resume_size + int(__snake_case							) if content_length is not None else None
	lowerCamelCase__              =	tqdm(
	    unit='''B''' ,unit_scale=__snake_case ,total=__snake_case ,initial=__snake_case ,desc='''Downloading''' ,)
	for chunk in response.iter_content(chunk_size=1024							):
		if chunk:  # filter out keep-alive new chunks
			progress.update(len(__snake_case							)							)
			temp_file.write(__snake_case							)
	progress.close()





def lowerCAmelCase__(__snake_case ,__snake_case=None ,__snake_case=False ,__snake_case=None ,__snake_case=10 ,__snake_case=False ,__snake_case=None ,__snake_case=False ,)       ->   str:







	'''simple docstring'''







	if cache_dir is None:
		lowerCamelCase__              =	TRANSFORMERS_CACHE
	if isinstance(__snake_case ,__snake_case							):
		lowerCamelCase__              =	str(__snake_case							)

	os.makedirs(__snake_case ,exist_ok=__snake_case							)

	lowerCamelCase__              =	None
	if not local_files_only:
		try:
			lowerCamelCase__              =	requests.head(__snake_case ,allow_redirects=__snake_case ,proxies=__snake_case ,timeout=__snake_case							)
			if response.status_code == 200:
				lowerCamelCase__              =	response.headers.get('''ETag'''							)
		except (EnvironmentError, requests.exceptions.Timeout):
			# etag is already None
			pass

	lowerCamelCase__              =	url_to_filename(__snake_case ,__snake_case							)

	# get cache path to put the file
	lowerCamelCase__              =	os.path.join(__snake_case ,__snake_case							)

	# etag is None = we don't have a connection, or url doesn't exist, or is otherwise inaccessible.
	# try to get the last downloaded one
	if etag is None:
		if os.path.exists(__snake_case							):
			return cache_path
		else:
			lowerCamelCase__              =	[
			    file
			    for file in fnmatch.filter(os.listdir(__snake_case							) ,filename + '''.*'''							)
			    if not file.endswith('''.json'''							) and not file.endswith('''.lock'''							)
			]
			if len(__snake_case							) > 0:
				return os.path.join(__snake_case ,matching_files[-1]							)
			else:
				# If files cannot be found and local_files_only=True,
				# the models might've been found if local_files_only=False
				# Notify the user about that
				if local_files_only:
					raise ValueError(
					    '''Cannot find the requested files in the cached path and outgoing traffic has been'''
					    ''' disabled. To enable model look-ups and downloads online, set \'local_files_only\''''
					    ''' to False.'''							)
				return None

    # From now on, etag is not None.
	if os.path.exists(__snake_case							) and not force_download:
		return cache_path

	# Prevent parallel downloads of the same file with a lock.
	lowerCamelCase__              =	cache_path + '''.lock'''
	with FileLock(__snake_case							):
		# If the download just completed while the lock was activated.
		if os.path.exists(__snake_case							) and not force_download:
			# Even if returning early like here, the lock will be released.
			return cache_path

		if resume_download:
			lowerCamelCase__              =	cache_path + '''.incomplete'''

			@contextmanager
			def _resumable_file_manager():
				with open(__snake_case ,'''a+b'''							) as f:
					yield f

			lowerCamelCase__              =	_resumable_file_manager
			if os.path.exists(__snake_case							):
				lowerCamelCase__              =	os.stat(__snake_case							).st_size
			else:
				lowerCamelCase__              =	0
		else:
			lowerCamelCase__              =	partial(tempfile.NamedTemporaryFile ,dir=__snake_case ,delete=__snake_case							)
			lowerCamelCase__              =	0

		# Download to temporary file, then copy to cache dir once finished.
		# Otherwise you get corrupt cache entries if the download gets interrupted.
		with temp_file_manager() as temp_file:
			print(
			    '''%s not found in cache or force_download set to True, downloading to %s''' ,__snake_case ,temp_file.name ,)

			http_get(
			    __snake_case ,__snake_case ,proxies=__snake_case ,resume_size=__snake_case ,user_agent=__snake_case ,)

		os.replace(temp_file.name ,__snake_case							)

		lowerCamelCase__              =	{'''url''': url, '''etag''': etag}
		lowerCamelCase__              =	cache_path + '''.json'''
		with open(__snake_case ,'''w'''							) as meta_file:
			json.dump(__snake_case ,__snake_case							)

	return cache_path





def lowerCAmelCase__(__snake_case ,__snake_case=None							)       ->   Optional[int]:







	'''simple docstring'''







	lowerCamelCase__              =	url.encode('''utf-8'''							)
	lowerCamelCase__              =	shaaaa(__snake_case							)
	lowerCamelCase__              =	url_hash.hexdigest()

	if etag:
		lowerCamelCase__              =	etag.encode('''utf-8'''							)
		lowerCamelCase__              =	shaaaa(__snake_case							)
		filename += "." + etag_hash.hexdigest()

	if url.endswith('''.h5'''							):
		filename += ".h5"

	return filename





def lowerCAmelCase__(__snake_case ,__snake_case=None ,__snake_case=False ,__snake_case=None ,__snake_case=False ,__snake_case=None ,__snake_case=False ,__snake_case=False ,__snake_case=False ,)       ->   List[Any]:







	'''simple docstring'''







	if cache_dir is None:
		lowerCamelCase__              =	TRANSFORMERS_CACHE
	if isinstance(__snake_case ,__snake_case							):
		lowerCamelCase__              =	str(__snake_case							)
	if isinstance(__snake_case ,__snake_case							):
		lowerCamelCase__              =	str(__snake_case							)

	if is_remote_url(__snake_case							):
		# URL, so get it from the cache (downloading if necessary)
		lowerCamelCase__              =	get_from_cache(
		    __snake_case ,cache_dir=__snake_case ,force_download=__snake_case ,proxies=__snake_case ,resume_download=__snake_case ,user_agent=__snake_case ,local_files_only=__snake_case ,)
	elif os.path.exists(__snake_case							):
		# File, and it exists.
		lowerCamelCase__              =	url_or_filename
	elif urlparse(__snake_case							).scheme == "":
		# File, but it doesn't exist.
		raise EnvironmentError('''file {} not found'''.format(__snake_case							)							)
	else:
		# Something unknown
		raise ValueError('''unable to parse {} as a URL or as a local path'''.format(__snake_case							)							)

	if extract_compressed_file:
		if not is_zipfile(__snake_case							) and not tarfile.is_tarfile(__snake_case							):
			return output_path

		# Path where we extract compressed archives
		# We avoid '.' in dir name and add "-extracted" at the end: "./model.zip" => "./model-zip-extracted/"
		lowerCamelCase__       ,			lowerCamelCase__              =	os.path.split(__snake_case							)
		lowerCamelCase__              =	output_file.replace('''.''' ,'''-'''							) + '''-extracted'''
		lowerCamelCase__              =	os.path.join(__snake_case ,__snake_case							)

		if os.path.isdir(__snake_case							) and os.listdir(__snake_case							) and not force_extract:
			return output_path_extracted

		# Prevent parallel extractions
		lowerCamelCase__              =	output_path + '''.lock'''
		with FileLock(__snake_case							):
			shutil.rmtree(__snake_case ,ignore_errors=__snake_case							)
			os.makedirs(__snake_case							)
			if is_zipfile(__snake_case							):
				with ZipFile(__snake_case ,'''r'''							) as zip_file:
					zip_file.extractall(__snake_case							)
					zip_file.close()
			elif tarfile.is_tarfile(__snake_case							):
				lowerCamelCase__              =	tarfile.open(__snake_case							)
				tar_file.extractall(__snake_case							)
				tar_file.close()
			else:
				raise EnvironmentError('''Archive format of {} could not be identified'''.format(__snake_case							)							)

		return output_path_extracted

	return output_path





def lowerCAmelCase__(__snake_case ,__snake_case=","							)       ->   Any:







	'''simple docstring'''







	assert isinstance(__snake_case ,__snake_case							)
	if os.path.isfile(__snake_case							):
		with open(__snake_case							) as f:
			lowerCamelCase__              =	eval(f.read()							)
	else:
		lowerCamelCase__              =	requests.get(__snake_case							)
		try:
			lowerCamelCase__              =	requests.json()
		except Exception:
			lowerCamelCase__              =	req.content.decode()
			assert data is not None, "could not connect"
			try:
				lowerCamelCase__              =	eval(__snake_case							)
			except Exception:
				lowerCamelCase__              =	data.split('''\n'''							)
		req.close()
	return data





def lowerCAmelCase__(__snake_case							)       ->   Dict:







	'''simple docstring'''







	lowerCamelCase__              =	requests.get(__snake_case							)
	lowerCamelCase__              =	np.array(Image.open(BytesIO(response.content							)							)							)
	return img





def lowerCAmelCase__(__snake_case							)       ->   int:







	'''simple docstring'''







	lowerCamelCase__              =	url.split('''/'''							)[-1]
	if fn not in os.listdir(os.getcwd()							):
		wget.download(__snake_case							)
	with open(__snake_case ,'''rb'''							) as stream:
		lowerCamelCase__              =	pkl.load(__snake_case							)
	lowerCamelCase__              =	weights.pop('''model'''							)
	lowerCamelCase__              =	{}
	for k, v in model.items():
		lowerCamelCase__              =	torch.from_numpy(__snake_case							)
		if "running_var" in k:
			lowerCamelCase__              =	torch.tensor([0]							)
			lowerCamelCase__              =	k.replace('''running_var''' ,'''num_batches_tracked'''							)
			lowerCamelCase__              =	zero
	return new





def lowerCAmelCase__()       ->   Any:







	'''simple docstring'''







	print(F'{os.path.abspath(os.path.join(__snake_case ,os.pardir							)							)}/demo.ipynb'							)





def lowerCAmelCase__(__snake_case ,__snake_case="RGB"							)       ->   Optional[Any]:







	'''simple docstring'''







	assert isinstance(__snake_case ,__snake_case							)
	if os.path.isfile(__snake_case							):
		lowerCamelCase__              =	cva.imread(__snake_case							)
	else:
		lowerCamelCase__              =	get_image_from_url(__snake_case							)
		assert img is not None, F'could not connect to: {im}'
	lowerCamelCase__              =	cva.cvtColor(__snake_case ,cva.COLOR_BGR2RGB							)
	if input_format == "RGB":
		lowerCamelCase__              =	img[:, :, ::-1]
	return img





def lowerCAmelCase__(__snake_case ,__snake_case=1							)       ->   Any:







	'''simple docstring'''







	return (images[i : i + batch] for i in range(0 ,len(__snake_case							) ,__snake_case							))










import os
from collections import namedtuple

import pytest

from datasets import ClassLabel, Features, Sequence, Value
from datasets.commands.test import TestCommand
from datasets.info import DatasetInfo, DatasetInfosDict


_a						=   namedtuple(
    "_TestCommandArgs",
    [
        "dataset",
        "name",
        "cache_dir",
        "data_dir",
        "all_configs",
        "save_infos",
        "ignore_verifications",
        "force_redownload",
        "clear_cache",
    ],
    defaults=[None, None, None, False, False, False, False, False],
)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   List[str]:







	'''simple docstring'''







	return (abs(source - target							) / target) < 0.0_1





@pytest.mark.integration
def lowerCAmelCase__(__snake_case							)       ->   Tuple:







	'''simple docstring'''







	lowerCamelCase__              =	_TestCommandArgs(dataset=__snake_case ,all_configs=__snake_case ,save_infos=__snake_case							)
	lowerCamelCase__              =	TestCommand(*__snake_case							)
	test_command.run()
	lowerCamelCase__              =	os.path.join(__snake_case ,'''README.md'''							)
	assert os.path.exists(__snake_case							)
	lowerCamelCase__              =	DatasetInfosDict.from_directory(__snake_case							)
	lowerCamelCase__              =	DatasetInfosDict(
	    {
	        '''default''': DatasetInfo(
	            features=Features(
	                {
	                    '''tokens''': Sequence(Value('''string'''							)							),
	                    '''ner_tags''': Sequence(
	                        ClassLabel(names=['''O''', '''B-PER''', '''I-PER''', '''B-ORG''', '''I-ORG''', '''B-LOC''', '''I-LOC''']							)							),
	                    '''langs''': Sequence(Value('''string'''							)							),
	                    '''spans''': Sequence(Value('''string'''							)							),
	                }							) ,splits=[
	                {
	                    '''name''': '''train''',
	                    '''num_bytes''': 2351563,
	                    '''num_examples''': 10000,
	                },
	                {
	                    '''name''': '''validation''',
	                    '''num_bytes''': 238418,
	                    '''num_examples''': 1000,
	                },
	            ] ,download_size=3940680 ,dataset_size=2589981 ,)
	    }							)
	assert dataset_infos.keys() == expected_dataset_infos.keys()
	for key in DatasetInfo._INCLUDED_INFO_IN_YAML:
		lowerCamelCase__       ,			lowerCamelCase__              =	getattr(dataset_infos['''default'''] ,__snake_case							), getattr(expected_dataset_infos['''default'''] ,__snake_case							)
		if key == "num_bytes":
			assert is_apercent_close(__snake_case ,__snake_case							)
		elif key == "splits":
			assert list(__snake_case							) == list(__snake_case							)
			for split in result:
				assert result[split].name == expected[split].name
				assert result[split].num_examples == expected[split].num_examples
				assert is_apercent_close(result[split].num_bytes ,expected[split].num_bytes							)
		else:
			result == expected



