






'''simple docstring'''







from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader

class _lowercase			(       _lowercase	):




							def __init__(							self:       List[str]    ,							UpperCamelCase__:       pyspark.sql.DataFrame    ,							UpperCamelCase__:       Optional[NamedSplit] = None    ,							UpperCamelCase__:       Optional[Features] = None    ,							UpperCamelCase__:       bool = True    ,							UpperCamelCase__:       str = None    ,							UpperCamelCase__:       bool = False    ,							UpperCamelCase__:       str = None    ,							UpperCamelCase__:       bool = True    ,							UpperCamelCase__:       str = "arrow"    ,							**UpperCamelCase__:       Union[str, Any]    ,							):
														super().__init__(
														    split=UpperCamelCase__    ,							features=UpperCamelCase__    ,							cache_dir=UpperCamelCase__    ,							keep_in_memory=UpperCamelCase__    ,							streaming=UpperCamelCase__    ,							**UpperCamelCase__    ,							)
														lowerCamelCase__      :			int 						= load_from_cache_file
														lowerCamelCase__      :			List[str] 						= file_format
														lowerCamelCase__      :			Tuple 						= Spark(
														    df=UpperCamelCase__    ,							features=UpperCamelCase__    ,							cache_dir=UpperCamelCase__    ,							working_dir=UpperCamelCase__    ,							**UpperCamelCase__    ,							)




							def 	lowerCamelCase_       (							self:       Optional[Any]  ):
														if self.streaming:
																					return self.builder.as_streaming_dataset(split=self.split  )
														lowerCamelCase__      :			str 						= None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
														self.builder.download_and_prepare(
														    download_mode=UpperCamelCase__    ,							file_format=self._file_format    ,							)
														return self.builder.as_dataset(split=self.split  )









'''simple docstring'''







# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script dumps information about the environment

import os
import platform
import sys


_A			:    Dict					  ='''3'''

print('''Python version:''', sys.version)

print('''OS platform:''', platform.platform())
print('''OS architecture:''', platform.machine())

try:
			import torch

			print('''Torch version:''', torch.__version__)
			print('''Cuda available:''', torch.cuda.is_available())
			print('''Cuda version:''', torch.version.cuda)
			print('''CuDNN version:''', torch.backends.cudnn.version())
			print('''Number of GPUs available:''', torch.cuda.device_count())
except ImportError:
			print('''Torch version:''', None)

try:
			import transformers

			print('''transformers version:''', transformers.__version__)
except ImportError:
			print('''transformers version:''', None)

