




import inspect
import unittest

from transformers import DPTConfig
from transformers.file_utils import is_torch_available, is_vision_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
	import torch
	from torch import nn

	from transformers import MODEL_MAPPING, DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel
	from transformers.models.dpt.modeling_dpt import DPT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
	from PIL import Image

	from transformers import DPTImageProcessor


class    lowerCamelCase    :






			'''simple docstring'''





			def __init__( self			:   Dict       ,						lowerCamelCase_			:   List[Any]       ,						lowerCamelCase_			:   Tuple=2       ,						lowerCamelCase_			:   Optional[Any]=32       ,						lowerCamelCase_			:   Dict=16       ,						lowerCamelCase_			:   Any=3       ,						lowerCamelCase_			:   Optional[int]=True       ,						lowerCamelCase_			:   Optional[int]=True       ,						lowerCamelCase_			:   Tuple=32       ,						lowerCamelCase_			:   List[str]=4       ,						lowerCamelCase_			:   int=[0, 1, 2, 3]       ,						lowerCamelCase_			:   Tuple=4       ,						lowerCamelCase_			:   List[str]=37       ,						lowerCamelCase_			:   Tuple="gelu"       ,						lowerCamelCase_			:   Tuple=0.1       ,						lowerCamelCase_			:   int=0.1       ,						lowerCamelCase_			:   Tuple=0.0_2       ,						lowerCamelCase_			:   List[str]=3       ,						lowerCamelCase_			:   Optional[Any]=[1, 384, 24, 24]       ,						lowerCamelCase_			:   Union[str, Any]=True       ,						lowerCamelCase_			:   Optional[int]=None       ,						)						->   List[Any]:
								__magic_name__							:	Optional[Any]    							=							parent
								__magic_name__							:	List[str]    							=							batch_size
								__magic_name__							:	Optional[int]    							=							image_size
								__magic_name__							:	Optional[int]    							=							patch_size
								__magic_name__							:	str    							=							num_channels
								__magic_name__							:	Optional[Any]    							=							is_training
								__magic_name__							:	Optional[int]    							=							use_labels
								__magic_name__							:	Tuple    							=							hidden_size
								__magic_name__							:	Optional[int]    							=							num_hidden_layers
								__magic_name__							:	str    							=							backbone_out_indices
								__magic_name__							:	Optional[int]    							=							num_attention_heads
								__magic_name__							:	str    							=							intermediate_size
								__magic_name__							:	int    							=							hidden_act
								__magic_name__							:	str    							=							hidden_dropout_prob
								__magic_name__							:	Dict    							=							attention_probs_dropout_prob
								__magic_name__							:	int    							=							initializer_range
								__magic_name__							:	Union[str, Any]    							=							num_labels
								__magic_name__							:	Union[str, Any]    							=							backbone_featmap_shape
								__magic_name__							:	Tuple    							=							scope
								__magic_name__							:	Any    							=							is_hybrid
								# sequence length of DPT = num_patches + 1 (we add 1 for the [CLS] token)
								__magic_name__							:	Union[str, Any]    							=							(image_size // patch_size) ** 2
								__magic_name__							:	Optional[int]    							=							num_patches + 1

			def 							UpperCAmelCase__       ( self			:   List[Any]  )						->   int:
								__magic_name__							:	str    							=							floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]  )

								__magic_name__							:	Optional[int]    							=							None
								if self.use_labels:
													__magic_name__							:	Union[str, Any]    							=							ids_tensor([self.batch_size, self.image_size, self.image_size]       ,						self.num_labels  )

								__magic_name__							:	int    							=							self.get_config()

								return config, pixel_values, labels

			def 							UpperCAmelCase__       ( self			:   int  )						->   Optional[Any]:
								__magic_name__							:	List[Any]    							=							{
								    '''global_padding''': '''same''',
								    '''layer_type''': '''bottleneck''',
								    '''depths''': [3, 4, 9],
								    '''out_features''': ['''stage1''', '''stage2''', '''stage3'''],
								    '''embedding_dynamic_padding''': True,
								    '''hidden_sizes''': [96, 192, 384, 768],
								    '''num_groups''': 2,
								}

								return DPTConfig(
								    image_size=self.image_size       ,						patch_size=self.patch_size       ,						num_channels=self.num_channels       ,						hidden_size=self.hidden_size       ,						num_hidden_layers=self.num_hidden_layers       ,						backbone_out_indices=self.backbone_out_indices       ,						num_attention_heads=self.num_attention_heads       ,						intermediate_size=self.intermediate_size       ,						hidden_act=self.hidden_act       ,						hidden_dropout_prob=self.hidden_dropout_prob       ,						attention_probs_dropout_prob=self.attention_probs_dropout_prob       ,						is_decoder=lowerCamelCase_       ,						initializer_range=self.initializer_range       ,						is_hybrid=self.is_hybrid       ,						backbone_config=lowerCamelCase_       ,						backbone_featmap_shape=self.backbone_featmap_shape       ,						)

			def 							UpperCAmelCase__       ( self			:   int       ,						lowerCamelCase_			:   List[str]       ,						lowerCamelCase_			:   Union[str, Any]       ,						lowerCamelCase_			:   Dict  )						->   Union[str, Any]:
								__magic_name__							:	int    							=							DPTModel(config=lowerCamelCase_  )
								model.to(lowerCamelCase_  )
								model.eval()
								__magic_name__							:	Any    							=							model(lowerCamelCase_  )
								self.parent.assertEqual(result.last_hidden_state.shape       ,						(self.batch_size, self.seq_length, self.hidden_size)  )

			def 							UpperCAmelCase__       ( self			:   Dict       ,						lowerCamelCase_			:   Optional[Any]       ,						lowerCamelCase_			:   str       ,						lowerCamelCase_			:   Any  )						->   int:
								__magic_name__							:	str    							=							self.num_labels
								__magic_name__							:	Optional[Any]    							=							DPTForDepthEstimation(lowerCamelCase_  )
								model.to(lowerCamelCase_  )
								model.eval()
								__magic_name__							:	Union[str, Any]    							=							model(lowerCamelCase_  )
								self.parent.assertEqual(result.predicted_depth.shape       ,						(self.batch_size, self.image_size, self.image_size)  )

			def 							UpperCAmelCase__       ( self			:   str       ,						lowerCamelCase_			:   List[str]       ,						lowerCamelCase_			:   Optional[Any]       ,						lowerCamelCase_			:   Optional[Any]  )						->   List[str]:
								__magic_name__							:	Dict    							=							self.num_labels
								__magic_name__							:	List[str]    							=							DPTForSemanticSegmentation(lowerCamelCase_  )
								model.to(lowerCamelCase_  )
								model.eval()
								__magic_name__							:	List[str]    							=							model(lowerCamelCase_       ,						labels=lowerCamelCase_  )
								self.parent.assertEqual(
								    result.logits.shape       ,						(self.batch_size, self.num_labels, self.image_size, self.image_size)  )


			def 							UpperCAmelCase__       ( self			:   List[str]  )						->   int:
								__magic_name__							:	Union[str, Any]    							=							self.prepare_config_and_inputs()
								__magic_name__							,    __magic_name__							,    __magic_name__							:	Any    							=							config_and_inputs
								__magic_name__							:	List[Any]    							=							{'''pixel_values''': pixel_values}
								return config, inputs_dict






@require_torch
class    lowerCamelCase    (		_lowerCamelCase				,_lowerCamelCase				,unittest.TestCase						):






			'''simple docstring'''





			UpperCamelCase__								=(DPTModel, DPTForDepthEstimation, DPTForSemanticSegmentation) if is_torch_available() else ()
			UpperCamelCase__								=(
			    {
			        '''depth-estimation''': DPTForDepthEstimation,
			        '''feature-extraction''': DPTModel,
			        '''image-segmentation''': DPTForSemanticSegmentation,
			    }
			    if is_torch_available()
			    else {}
			)

			UpperCamelCase__								=False
			UpperCamelCase__								=False
			UpperCamelCase__								=False

			def 							UpperCAmelCase__       ( self			:   Optional[Any]  )						->   Optional[Any]:
								__magic_name__							:	Tuple    							=							DPTModelTester(self  )
								__magic_name__							:	List[str]    							=							ConfigTester(self       ,						config_class=lowerCamelCase_       ,						has_text_modality=lowerCamelCase_       ,						hidden_size=37  )

			def 							UpperCAmelCase__       ( self			:   str  )						->   List[str]:
								self.config_tester.run_common_tests()

			@unittest.skip(reason='''DPT does not use inputs_embeds'''  )
			def 							UpperCAmelCase__       ( self			:   Any  )						->   List[Any]:
								pass

			def 							UpperCAmelCase__       ( self			:   Tuple  )						->   Dict:
								__magic_name__							,    __magic_name__							:	Dict    							=							self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
													__magic_name__							:	Tuple    							=							model_class(lowerCamelCase_  )
													self.assertIsInstance(model.get_input_embeddings()       ,						(nn.Module)  )
													__magic_name__							:	Optional[Any]    							=							model.get_output_embeddings()
													self.assertTrue(x is None or isinstance(lowerCamelCase_       ,						nn.Linear  )  )

			def 							UpperCAmelCase__       ( self			:   List[str]  )						->   Optional[Any]:
								__magic_name__							,    __magic_name__							:	List[Any]    							=							self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
													__magic_name__							:	Tuple    							=							model_class(lowerCamelCase_  )
													__magic_name__							:	Any    							=							inspect.signature(model.forward  )
													# signature.parameters is an OrderedDict => so arg_names order is deterministic
													__magic_name__							:	Optional[Any]    							=							[*signature.parameters.keys()]

													__magic_name__							:	Tuple    							=							['''pixel_values''']
													self.assertListEqual(arg_names[:1]       ,						lowerCamelCase_  )

			def 							UpperCAmelCase__       ( self			:   Union[str, Any]  )						->   int:
								__magic_name__							:	List[str]    							=							self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*lowerCamelCase_  )

			def 							UpperCAmelCase__       ( self			:   List[str]  )						->   Union[str, Any]:
								__magic_name__							:	Tuple    							=							self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_depth_estimation(*lowerCamelCase_  )

			def 							UpperCAmelCase__       ( self			:   Union[str, Any]  )						->   Union[str, Any]:
								__magic_name__							:	Tuple    							=							self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_semantic_segmentation(*lowerCamelCase_  )

			def 							UpperCAmelCase__       ( self			:   int  )						->   str:
								for model_class in self.all_model_classes:
													if model_class.__name__ == "DPTForDepthEstimation":
																		continue

													__magic_name__							,    __magic_name__							:	Dict    							=							self.model_tester.prepare_config_and_inputs_for_common()
													__magic_name__							:	int    							=							True

													if model_class in get_values(lowerCamelCase_  ):
																		continue

													__magic_name__							:	List[str]    							=							model_class(lowerCamelCase_  )
													model.to(lowerCamelCase_  )
													model.train()
													__magic_name__							:	Union[str, Any]    							=							self._prepare_for_class(lowerCamelCase_       ,						lowerCamelCase_       ,						return_labels=lowerCamelCase_  )
													__magic_name__							:	List[Any]    							=							model(**lowerCamelCase_  ).loss
													loss.backward()

			def 							UpperCAmelCase__       ( self			:   Optional[int]  )						->   Any:
								for model_class in self.all_model_classes:
													if model_class.__name__ == "DPTForDepthEstimation":
																		continue

													__magic_name__							,    __magic_name__							:	int    							=							self.model_tester.prepare_config_and_inputs_for_common()
													__magic_name__							:	Any    							=							False
													__magic_name__							:	Optional[int]    							=							True

													if model_class in get_values(lowerCamelCase_  ) or not model_class.supports_gradient_checkpointing:
																		continue
													__magic_name__							:	Any    							=							model_class(lowerCamelCase_  )
													model.to(lowerCamelCase_  )
													model.gradient_checkpointing_enable()
													model.train()
													__magic_name__							:	int    							=							self._prepare_for_class(lowerCamelCase_       ,						lowerCamelCase_       ,						return_labels=lowerCamelCase_  )
													__magic_name__							:	int    							=							model(**lowerCamelCase_  ).loss
													loss.backward()

			def 							UpperCAmelCase__       ( self			:   int  )						->   List[str]:
								__magic_name__							,    __magic_name__							:	Any    							=							self.model_tester.prepare_config_and_inputs_for_common()

								__magic_name__							:	Optional[Any]    							=							_config_zero_init(lowerCamelCase_  )
								for model_class in self.all_model_classes:
													__magic_name__							:	int    							=							model_class(config=lowerCamelCase_  )
													# Skip the check for the backbone
													__magic_name__							:	Dict    							=							[]
													for name, module in model.named_modules():
																		if module.__class__.__name__ == "DPTViTHybridEmbeddings":
																							__magic_name__							:	int    							=							[F'''{name}.{key}''' for key in module.state_dict().keys()]
																							break

													for name, param in model.named_parameters():
																		if param.requires_grad:
																							if name in backbone_params:
																												continue
																							self.assertIn(
																							    ((param.data.mean() * 1E9).round() / 1E9).item()       ,						[0.0, 1.0]       ,						msg=F'''Parameter {name} of model {model_class} seems not properly initialized'''       ,						)

			@unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.'''  )
			def 							UpperCAmelCase__       ( self			:   List[str]  )						->   List[Any]:
								pass

			@slow
			def 							UpperCAmelCase__       ( self			:   Dict  )						->   List[str]:
								for model_name in DPT_PRETRAINED_MODEL_ARCHIVE_LIST[1:]:
													__magic_name__							:	Dict    							=							DPTModel.from_pretrained(lowerCamelCase_  )
													self.assertIsNotNone(lowerCamelCase_  )


			def 							UpperCAmelCase__       ( self			:   Any  )						->   Dict:
								# We do this test only for DPTForDepthEstimation since it is the only model that uses readout_type
								__magic_name__							,    __magic_name__							:	Optional[int]    							=							self.model_tester.prepare_config_and_inputs_for_common()
								__magic_name__							:	List[Any]    							=							'''add'''
								with self.assertRaises(lowerCamelCase_  ):
													__magic_name__							:	Union[str, Any]    							=							DPTForDepthEstimation(lowerCamelCase_  )







def 		lowercase__   (		):





					'''simple docstring'''






					__magic_name__							:	Any    							=							Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''				)
					return image


@require_torch
@require_vision
@slow
class    lowerCamelCase    (		unittest.TestCase						):






			'''simple docstring'''





			def 							UpperCAmelCase__       ( self			:   Optional[Any]  )						->   str:
								__magic_name__							:	int    							=							DPTImageProcessor.from_pretrained('''Intel/dpt-hybrid-midas'''  )
								__magic_name__							:	List[Any]    							=							DPTForDepthEstimation.from_pretrained('''Intel/dpt-hybrid-midas'''  ).to(lowerCamelCase_  )

								__magic_name__							:	List[str]    							=							prepare_img()
								__magic_name__							:	Union[str, Any]    							=							image_processor(images=lowerCamelCase_       ,						return_tensors='''pt'''  ).to(lowerCamelCase_  )

								# forward pass
								with torch.no_grad():
													__magic_name__							:	List[str]    							=							model(**lowerCamelCase_  )
													__magic_name__							:	List[Any]    							=							outputs.predicted_depth

								# verify the predicted depth
								__magic_name__							:	Tuple    							=							torch.Size((1, 384, 384)  )
								self.assertEqual(predicted_depth.shape       ,						lowerCamelCase_  )

								__magic_name__							:	Dict    							=							torch.tensor(
								    [[[5.6_4_3_7, 5.6_1_4_6, 5.6_5_1_1], [5.4_3_7_1, 5.5_6_4_9, 5.5_9_5_8], [5.5_2_1_5, 5.5_1_8_4, 5.5_2_9_3]]]  ).to(lowerCamelCase_  )

								self.assertTrue(torch.allclose(outputs.predicted_depth[:3, :3, :3] / 100       ,						lowerCamelCase_       ,						atol=1E-4  )  )









import multiprocessing
import os
from typing import BinaryIO, Optional, Union

import fsspec

from .. import Dataset, Features, NamedSplit, config
from ..formatting import query_table
from ..packaged_modules.json.json import Json
from ..utils import logging
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader


class    lowerCamelCase    (		_lowerCamelCase						):






			'''simple docstring'''





			def __init__( self			:   List[Any]       ,						lowerCamelCase_			:   NestedDataStructureLike[PathLike]       ,						lowerCamelCase_			:   Optional[NamedSplit] = None       ,						lowerCamelCase_			:   Optional[Features] = None       ,						lowerCamelCase_			:   str = None       ,						lowerCamelCase_			:   bool = False       ,						lowerCamelCase_			:   bool = False       ,						lowerCamelCase_			:   Optional[str] = None       ,						lowerCamelCase_			:   Optional[int] = None       ,						**lowerCamelCase_			:   str       ,						)						->   Dict:
								super().__init__(
								    lowerCamelCase_       ,						split=lowerCamelCase_       ,						features=lowerCamelCase_       ,						cache_dir=lowerCamelCase_       ,						keep_in_memory=lowerCamelCase_       ,						streaming=lowerCamelCase_       ,						num_proc=lowerCamelCase_       ,						**lowerCamelCase_       ,						)
								__magic_name__							:	Optional[int]    							=							field
								__magic_name__							:	Optional[Any]    							=							path_or_paths if isinstance(lowerCamelCase_       ,						lowerCamelCase_  ) else {self.split: path_or_paths}
								__magic_name__							:	Optional[Any]    							=							Json(
								    cache_dir=lowerCamelCase_       ,						data_files=lowerCamelCase_       ,						features=lowerCamelCase_       ,						field=lowerCamelCase_       ,						**lowerCamelCase_       ,						)


			def 							UpperCAmelCase__       ( self			:   Optional[Any]  )						->   List[str]:
								# Build iterable dataset
								if self.streaming:
													__magic_name__							:	Optional[Any]    							=							self.builder.as_streaming_dataset(split=self.split  )
								# Build regular (map-style) dataset
								else:
													__magic_name__							:	int    							=							None
													__magic_name__							:	Tuple    							=							None
													__magic_name__							:	Tuple    							=							None
													__magic_name__							:	Optional[int]    							=							None

													self.builder.download_and_prepare(
													    download_config=lowerCamelCase_       ,						download_mode=lowerCamelCase_       ,						verification_mode=lowerCamelCase_       ,						base_path=lowerCamelCase_       ,						num_proc=self.num_proc       ,						)
													__magic_name__							:	Any    							=							self.builder.as_dataset(
													    split=self.split       ,						verification_mode=lowerCamelCase_       ,						in_memory=self.keep_in_memory  )
								return dataset






class    lowerCamelCase    :






			'''simple docstring'''





			def __init__( self			:   int       ,						lowerCamelCase_			:   Dataset       ,						lowerCamelCase_			:   Union[PathLike, BinaryIO]       ,						lowerCamelCase_			:   Optional[int] = None       ,						lowerCamelCase_			:   Optional[int] = None       ,						**lowerCamelCase_			:   List[Any]       ,						)						->   List[Any]:
								if num_proc is not None and num_proc <= 0:
													raise ValueError(F'''num_proc {num_proc} must be an integer > 0.'''  )

								__magic_name__							:	Optional[Any]    							=							dataset
								__magic_name__							:	Tuple    							=							path_or_buf
								__magic_name__							:	Dict    							=							batch_size if batch_size else config.DEFAULT_MAX_BATCH_SIZE
								__magic_name__							:	Any    							=							num_proc
								__magic_name__							:	Tuple    							=							'''utf-8'''
								__magic_name__							:	Tuple    							=							to_json_kwargs

			def 							UpperCAmelCase__       ( self			:   Dict  )						->   int:
								__magic_name__							:	int    							=							self.to_json_kwargs.pop('''path_or_buf'''       ,						lowerCamelCase_  )
								__magic_name__							:	Any    							=							self.to_json_kwargs.pop('''orient'''       ,						'''records'''  )
								__magic_name__							:	List[Any]    							=							self.to_json_kwargs.pop('''lines'''       ,						True if orient == '''records''' else False  )
								__magic_name__							:	Optional[int]    							=							self.to_json_kwargs.pop('''index'''       ,						False if orient in ['''split''', '''table'''] else True  )
								__magic_name__							:	List[str]    							=							self.to_json_kwargs.pop('''compression'''       ,						lowerCamelCase_  )

								if compression not in [None, "infer", "gzip", "bz2", "xz"]:
													raise NotImplementedError(F'''`datasets` currently does not support {compression} compression'''  )

								if isinstance(self.path_or_buf       ,						(str, bytes, os.PathLike)  ):
													with fsspec.open(self.path_or_buf       ,						'''wb'''       ,						compression=lowerCamelCase_  ) as buffer:
																		__magic_name__							:	str    							=							self._write(file_obj=lowerCamelCase_       ,						orient=lowerCamelCase_       ,						lines=lowerCamelCase_       ,						index=lowerCamelCase_       ,						**self.to_json_kwargs  )
								else:
													if compression:
																		raise NotImplementedError(
																		    F'''The compression parameter is not supported when writing to a buffer, but compression={compression}'''
																		    ''' was passed. Please provide a local path instead.'''  )
													__magic_name__							:	List[str]    							=							self._write(
													    file_obj=self.path_or_buf       ,						orient=lowerCamelCase_       ,						lines=lowerCamelCase_       ,						index=lowerCamelCase_       ,						**self.to_json_kwargs  )
								return written

			def 							UpperCAmelCase__       ( self			:   Optional[Any]       ,						lowerCamelCase_			:   Dict  )						->   Optional[int]:
								__magic_name__							,    __magic_name__							,    __magic_name__							,    __magic_name__							,    __magic_name__							:	Any    							=							args

								__magic_name__							:	List[Any]    							=							query_table(
								    table=self.dataset.data       ,						key=slice(lowerCamelCase_       ,						offset + self.batch_size  )       ,						indices=self.dataset._indices       ,						)
								__magic_name__							:	Optional[Any]    							=							batch.to_pandas().to_json(
								    path_or_buf=lowerCamelCase_       ,						orient=lowerCamelCase_       ,						lines=lowerCamelCase_       ,						index=lowerCamelCase_       ,						**lowerCamelCase_  )
								if not json_str.endswith('''\n'''  ):
													json_str += "\n"
								return json_str.encode(self.encoding  )


			def 							UpperCAmelCase__       ( self			:   int       ,						lowerCamelCase_			:   BinaryIO       ,						lowerCamelCase_			:   List[str]       ,						lowerCamelCase_			:   Union[str, Any]       ,						lowerCamelCase_			:   Any       ,						**lowerCamelCase_			:   Optional[Any]       ,						)						->   int:
								__magic_name__							:	Union[str, Any]    							=							0

								if self.num_proc is None or self.num_proc == 1:
													for offset in logging.tqdm(
													    range(0       ,						len(self.dataset  )       ,						self.batch_size  )       ,						unit='''ba'''       ,						disable=not logging.is_progress_bar_enabled()       ,						desc='''Creating json from Arrow format'''       ,						):
																		__magic_name__							:	List[str]    							=							self._batch_json((offset, orient, lines, index, to_json_kwargs)  )
																		written += file_obj.write(lowerCamelCase_  )
								else:
													__magic_name__							,    __magic_name__							:	Optional[Any]    							=							len(self.dataset  ), self.batch_size
													with multiprocessing.Pool(self.num_proc  ) as pool:
																		for json_str in logging.tqdm(
																		    pool.imap(
																		        self._batch_json       ,						[(offset, orient, lines, index, to_json_kwargs) for offset in range(0       ,						lowerCamelCase_       ,						lowerCamelCase_  )]       ,						)       ,						total=(num_rows // batch_size) + 1 if num_rows % batch_size else num_rows // batch_size       ,						unit='''ba'''       ,						disable=not logging.is_progress_bar_enabled()       ,						desc='''Creating json from Arrow format'''       ,						):
																							written += file_obj.write(lowerCamelCase_  )

								return written



