/usr/local/lib/python3.6/site-packages/datasets/features/__pycache__
NameSizeModeActions
audio.cpython-36.pyc114730644editdlrm
features.cpython-36.pyc659380644editdlrm
image.cpython-36.pyc106000644editdlrm
translation.cpython-36.pyc51690644editdlrm
__init__.cpython-36.pyc5970644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/datasets/features/__pycache__/features.cpython-36.pyc (65938B)
3 <%Eg@s\dZddlZddlZddlZddlZddlmZmZddlm Z m Z m Z m Z ddl mZmZddlmZddlmZmZmZmZmZddlmZdd lmZmZddlZddlZddl Z!ddl"j#Z$ddl%Z dd l&m'Z(dd l&m)Z*d d l+m,Z,d dl-m.Z.d dl/m0Z0d dl1m2Z2m3Z3m4Z4ddl5m6Z6ddl7m8Z8m9Z9ddl:m;Z;mZ?e!j@eAdddZBeAe!j@dddZCeeDeDeeeDfdddZEdveed d!d"ZFe Gd#d$d$ZGGd%d&d&ZHe Gd'd(d(eHZIe Gd)d*d*eHZJe Gd+d,d,eHZKe Gd-d.d.eHZLGd/d0d0e!jMZNGd1d2d2eNZOGd3d4d4eNZPGd5d6d6eNZQGd7d8d8eNZRdwe!j@eDeDd9d:d;ZSGdd?d?e*ZUGd@dAdAe(ZVdBdCZWe GdDdEdEZXe GdFdGdGZeeYeZe[eGeXe;etj|dStjd|}|r|jd}tjd|}|d4krvtj|S|rtj|jd|jd St||d ddgdgdtjd|}|r|jd}|d5krtj|St||dddgdgdtjd|}|r|jd}|dkrH|jd } | d6kr8tj| St| dnT|dkr|jd } | d7krptj | St| dnt||dddgdd gdtjd!|} | r| jd} | d"krtjd#| jd } | r| jd} | jd }tj t | t |St||d$d%d&gd'gdn| d(krtjd#| jd } | rh| jd} | jd }tj t | t |St||d)d*d+gd,gdnt||d-d.d/gd'd,gdtd0|d1|dd2dS)8a string_to_arrow takes a datasets string dtype and converts it to a pyarrow.DataType. In effect, `dt == string_to_arrow(_arrow_to_datasets_dtype(dt))` This is necessary because the datasets.Value() primitive type is constructed using a string dtype Value(dtype=str) But Features.type (via `get_nested_type()` expects to resolve Features into a pyarrow Schema, which means that each Value() must be able to resolve into a corresponding pyarrow.DataType, which is the purpose of this function. NcSs|d|d}|rVt|dkr>dj|dd d|d n|d}|d|d7}|rt|dkrdj|dd d |dn|d}|d |d7}|S)NzA is not a validly formatted string representation of the pyarrow z type.rz, z or rz Valid examples include: r+z and z For more insformation, see: r?r?r?)lenjoin)dtypeZpa_dtypeexamplesurlsmsgr;r;r<_dtype_error_msgs22z)string_to_arrow.._dtype_error_msg_z^timestamp\[(.*)\]$rz)^(s|ms|us|ns),\s*tz=([a-zA-Z0-9/_+\-:]*)$smsusnsr timestampz timestamp[us]z!timestamp[us, tz=America/New_YorkzEhttps://arrow.apache.org/docs/python/generated/pyarrow.timestamp.html)rCrDz^duration\[(.*)\]$durationz duration[s]z duration[us]zDhttps://arrow.apache.org/docs/python/generated/pyarrow.duration.htmlz^time(.*)\[(.*)\]$Z32zc is not a valid unit for the pyarrow time32 type. Supported units: s (second) and ms (millisecond).Z64zh is not a valid unit for the pyarrow time64 type. Supported units: us (microsecond) and ns (nanosecond).timez time32[s]z time64[us]zBhttps://arrow.apache.org/docs/python/generated/pyarrow.time32.htmlzBhttps://arrow.apache.org/docs/python/generated/pyarrow.time64.htmlz^decimal(.*)\((.*)\)$Z128z^(\d+),\s*(-?\d+)$ decimal128zdecimal128(10, 2)zdecimal128(4, -2)zFhttps://arrow.apache.org/docs/python/generated/pyarrow.decimal128.htmlZ256 decimal256zdecimal256(30, 2)zdecimal256(38, -4)zFhttps://arrow.apache.org/docs/python/generated/pyarrow.decimal256.htmldecimalzdecimal128(12, 3)zdecimal256(40, 6)zNeither z nor z seems to be a pyarrow data type. Please make sure to use a correct data type, see: https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions)NN)rHrIrJrK)rHrIrJrK)rHrI)rJrK) r3__dict__researchgrouprLr7rMZtime32Ztime64rOintrP)r>rFZtimestamp_matchesZtimestamp_internalsZinternals_matchesZduration_matchesZduration_internalsZ time_matchesZtime_internals_bitsZtime_internals_unitZdecimal_matchesZdecimal_internals_bitsZ%decimal_internals_precision_and_scaler8r9r;r;r<string_to_arrowqs                               rW)objonly_1d_for_numpyoptimize_list_castingr#cstjrdtjkrddl}tjr0dtjkr0ddl}tjrJdtjkrJddlj }tj rbdtjkrbddl }t |t jr s~|jdkr|dfSfd d |Dd fSntjodtjkot ||jr s|jdkr|jjj d fSfd d |jjj Dd fSntjrndtjkrnt ||jrn sB|jdkrN|j d fSfd d |j Dd fSnFtjrdtjkrt ||jrԈ s|jdkrt j|d fSfdd t j|Dd fSntj rdtjkrt ||jjrt|d fSt |tjr,t|jddd fSt |tjr\fdd|jdjDd fSt |tjrv|jd fSt |tjr|j d fSt |t!rt |t" }i}x8|jD],\} } t| d\} } || O}| || <qW|r|n||fSt |t#t$frt%|dkrx|D]} t&| rPqWt| d\}}|sR rjfdd |Dd fSt |t#r~|dfSt#|d fSnt |t#r|ngt |t$fSn|dfSdS)a Cast pytorch/tensorflow/pandas objects to python numpy array/lists. It works recursively. If `optimize_list_casting` is True, to avoid iterating over possibly long lists, it first checks (recursively) if the first element that is not None or empty (if it is a sequence) has to be casted. If the first element needs to be casted, then all the elements of the list will be casted, otherwise they'll stay the same. This trick allows to cast objects that contain tokenizers outputs without iterating over every single token for example. Args: obj: the object (nested struct) to cast. only_1d_for_numpy (bool): whether to keep the full multi-dim tensors as multi-dim numpy arrays, or convert them to nested lists of 1-dimensional numpy arrays. This can be useful to keep only 1-d arrays to instantiate Arrow arrays. Indeed Arrow only support converting 1-dimensional array values. optimize_list_casting (bool): whether to optimize list casting by checking the first non-null element to see if it needs to be casted and if it doesn't, not checking the rest of the list elements. Returns: casted_obj: the casted object has_changed (bool): True if the object has been changed, False if it is identical tensorflowrNtorchZjaxPILrFcsg|]}t|ddqS))rYrZr)_cast_to_python_objects).0x)rYrZr;r< -sz+_cast_to_python_objects..Tcsg|]}t|ddqS))rYrZr)r^)r_r`)rYrZr;r<ra7scsg|]}t|ddqS))rYrZr)r^)r_r`)rYrZr;r<raAscsg|]}t|ddqS))rYrZr)r^)r_r`)rYrZr;r<raKs)rYrZcs$i|]\}}t|dd|qS))rYrZr)r^)r_keyvalue)rYrZr;r< Zsz+_cast_to_python_objects..listcsg|]}t|ddqS))rYrZr)r^)r_Zelmt)rYrZr;r<raxs)'rZ TF_AVAILABLEsysmodulesr[ZTORCH_AVAILABLEr\Z JAX_AVAILABLEZ jax.numpynumpyZ PIL_AVAILABLEZ PIL.Image isinstancenpndarrayndimZTensordetachcpuasarrayrrpdZSeriesr^tolistZ DataFrameto_dictitems TimestampZ to_pydatetimeZ TimedeltaZto_pytimedeltardictretupler@#_check_non_null_non_empty_recursive)rXrYrZtfr\Zjnpr]Z has_changedoutputkvZcasted_vZ has_changed_v first_elmtZcasted_first_elmtZhas_changed_first_elmtr;)rYrZr<r^s      "    "   $           r^FT)rXr#cCst|||ddS)a Cast numpy/pytorch/tensorflow/pandas objects to python lists. It works recursively. If `optimize_list_casting` is True, To avoid iterating over possibly long lists, it first checks (recursively) if the first element that is not None or empty (if it is a sequence) has to be casted. If the first element needs to be casted, then all the elements of the list will be casted, otherwise they'll stay the same. This trick allows to cast objects that contain tokenizers outputs without iterating over every single token for example. Args: obj: the object (nested struct) to cast only_1d_for_numpy (bool, default ``False``): whether to keep the full multi-dim tensors as multi-dim numpy arrays, or convert them to nested lists of 1-dimensional numpy arrays. This can be useful to keep only 1-d arrays to instantiate Arrow arrays. Indeed Arrow only support converting 1-dimensional array values. optimize_list_casting (bool, default ``True``): whether to optimize list casting by checking the first non-null element to see if it needs to be casted and if it doesn't, not checking the rest of the list elements. Returns: casted_obj: the casted object )rYrZr)r^)rXrYrZr;r;r<cast_to_python_objectss r}c@sXeZdZUdZedZeedZe e e ddddZ e ddZ ddZd d ZdS) Valuea The Value dtypes are as follows: null bool int8 int16 int32 int64 uint8 uint16 uint32 uint64 float16 float32 (alias float) float64 (alias double) time32[(s|ms)] time64[(us|ns)] timestamp[(s|ms|us|ns)] timestamp[(s|ms|us|ns), tz=(tzstring)] date32 date64 duration[(s|ms|us|ns)] decimal128(precision, scale) decimal256(precision, scale) binary large_binary string large_string Example: ```py >>> from datasets import Features >>> features = Features({'stars': Value(dtype='int32')}) >>> features {'stars': Value(dtype='int32', id=None)} ``` NF)defaultinitreprcCs0|jdkrd|_|jdkr d|_t|j|_dS)Ndoubler)floatr()rBrWpa_type)selfr;r;r< __post_init__s   zValue.__post_init__cCs|jS)N)r)rr;r;r<__call__szValue.__call__cCs`tjj|jrt|Stjj|jr,t|Stjj|jrBt|Stjj |jrXt |S|SdS)N) r3r0r2rr% is_integerrVZ is_floatingrr:r4)rrcr;r;r<encode_exampleszValue.encode_example)__name__ __module__ __qualname____doc__r4rBidrrr r r_typerrrr;r;r;r<r~s (  r~c@s$eZdZddZddZddZdS)_ArrayXDcCst|j|_dS)N)rvshape)rr;r;r<rsz_ArrayXD.__post_init__cCs t|jjd|j|j}|S)NZ ExtensionType)globals __class__rrrB)rrr;r;r<rsz_ArrayXD.__call__cCst|tjr|j}|S)N)rirjrkrq)rrcr;r;r<rs z_ArrayXD.encode_exampleN)rrrrrrr;r;r;r<rsrc@s8eZdZUdZeedZe ee ddddZ e dS)Array2Da'Create a two-dimensional array. Args: shape (`tuple`): The size of each dimension. dtype (`str`): The value of the data type. Example: ```py >>> from datasets import Features >>> features = Features({'x': Array2D(shape=(1, 3), dtype='int32')}) ``` NF)rrr) rrrrrvrr4rBrrrrr;r;r;r<rs  rc@s8eZdZUdZeedZe ee ddddZ e dS)Array3Da,Create a three-dimensional array. Args: shape (`tuple`): The size of each dimension. dtype (`str`): The value of the data type. Example: ```py >>> from datasets import Features >>> features = Features({'x': Array3D(shape=(1, 2, 3), dtype='int32')}) ``` NF)rrr) rrrrrvrr4rBrrrrr;r;r;r<r s  rc@s8eZdZUdZeedZe ee ddddZ e dS)Array4Da.Create a four-dimensional array. Args: shape (`tuple`): The size of each dimension. dtype (`str`): The value of the data type. Example: ```py >>> from datasets import Features >>> features = Features({'x': Array4D(shape=(1, 2, 2, 3), dtype='int32')}) ``` NF)rrr) rrrrrvrr4rBrrrrr;r;r;r<r$s  rc@s8eZdZUdZeedZe ee ddddZ e dS)Array5Da1Create a five-dimensional array. Args: shape (`tuple`): The size of each dimension. dtype (`str`): The value of the data type. Example: ```py >>> from datasets import Features >>> features = Features({'x': Array5D(shape=(1, 2, 2, 3, 3), dtype='int32')}) ``` NF)rrr) rrrrrvrr4rBrrrrr;r;r;r<r;s  rc@sJeZdZUdZeeeedddZddZ ddZ d d Z d d Z dS) _ArrayXDExtensionTypeN)rrBcCst|jdks|jdkrtdt||jkrBtd|d|jdt||_||_|j|j|_tj j ||jdS)NrzCYou must instantiate an array type with a value for dim that is > 1zshape=z and ndims=z don't match) ndimsr7r@rvr value_type_generate_dtype storage_dtyper3PyExtensionType__init__)rrrBr;r;r<rUs z_ArrayXDExtensionType.__init__cCs|j|j|jffS)N)rrr)rr;r;r< __reduce___sz _ArrayXDExtensionType.__reduce__cCstS)N)ArrayExtensionArray)rr;r;r<__arrow_ext_class__esz)_ArrayXDExtensionType.__arrow_ext_class__cCs*t|}xt|jD]}tj|}qW|S)N)rWreversedrr3list_)rrBdr;r;r<rhsz%_ArrayXDExtensionType._generate_dtypecCs t|jS)N)PandasArrayExtensionDtyper)rr;r;r<to_pandas_dtypepsz%_ArrayXDExtensionType.to_pandas_dtype) rrrrrrVrvr4rrrrrr;r;r;r<rRs   rc@seZdZdZdS)Array2DExtensionTyperN)rrrrr;r;r;r<rtsrc@seZdZdZdS)Array3DExtensionTypeN)rrrrr;r;r;r<rxsrc@seZdZdZdS)Array4DExtensionTypeN)rrrrr;r;r;r<r|src@seZdZdZdS)Array5DExtensionTypeN)rrrrr;r;r;r<rsr)runnestr#cs>tjtjdfdd |r$|}tjj|o._unnest_pa_type)r3DataTyper0Z is_primitiver2)rrr;)rr<_is_zero_copy_onlys rc@s8eZdZddZddZd ddZddd Zd d Zd S)rcCst|jjdd}|j|dS)NT)r)zero_copy_only)rstoragetypeto_numpy)rrr;r;r< __array__szArrayExtensionArray.__array__cCs |j|S)N)r)rir;r;r< __getitem__szArrayExtensionArray.__getitem__TcCs|j}d}tjt||jjdd}x,t|jjD]}||jj |9}|j }q6W|j|d}|j t|t|f|jj }t|rtj |j tj|tjdd}|S)NrF)rr)axis)rrjaranger@r1rrangerrrflattenreshapeinsertastyper)nan)rrrsize null_indicesr numpy_arrr;r;r<rs   zArrayExtensionArray.to_numpycCs|j}|jj}|jj}x,td|D]}||dkr"td|q"Wg}tjdd|jD}xt |j j ddD]\}} | r|j tj qt|||d} ||d||} xt|D] } | j} qW| j |d} |j | j| f|ddqtW|S)Nrz3Support only dynamic size on first dimension. Got: cSsg|] }|jqSr;)as_py)r_offr;r;r<rasz8ArrayExtensionArray.to_list_of_numpy..F)r)rrrrrr7rjarrayoffsets enumerater1rappendrrr)rrrrrZdimZarraysZfirst_dim_offsetsrr1Z storage_elZ first_dimrGrr;r;r<to_list_of_numpys$   "z$ArrayExtensionArray.to_list_of_numpycCs@t|jjdd}|jjddkr,|j|dS|j|djSdS)NT)rr)r)rrrrrrrq)rrr;r;r< to_pylists zArrayExtensionArray.to_pylistN)T)T)rrrrrrrrr;r;r;r<rs   rc@seZdZdZedejfdddZeej ej fdddZ e dd Z eed d d Zeed d dZeed ddZeejd ddZdS)rr)rcCs ||_dS)N) _value_type)rrr;r;r<rsz"PandasArrayExtensionDtype.__init__)rcsl|jjddkr"td|jjt|jddt|tjrXtjfdd|j D}n |j d}t |S)NrzSDynamic first dimension is not supported for PandasArrayExtensionDtype, dimension: T)rcsg|]}|jdqS))r)r)r_chunk)rr;r<rasz.)r) rrNotImplementedErrorrrir3 ChunkedArrayrjvstackchunksrPandasArrayExtensionArray)rrrr;)rr<__from_arrow__s  z(PandasArrayExtensionDtype.__from_arrow__cCstS)N)r)clsr;r;r<construct_array_typesz.PandasArrayExtensionDtype.construct_array_type)r#cCstjS)N)rjrk)rr;r;r<rszPandasArrayExtensionDtype.typecCsdS)NOr;)rr;r;r<kindszPandasArrayExtensionDtype.kindcCsd|jdS)Nzarray[r*)r)rr;r;r<nameszPandasArrayExtensionDtype.namecCs|jS)N)r)rr;r;r<rsz$PandasArrayExtensionDtype.value_typeN)rrr _metadatarrjrBrr3Arrayrr classmethodrpropertyrr4rrrr;r;r;r<rs rc@s eZdZd%ejedddZd&ddZd'eddd d Ze d(e e edd d d Z e e dddddZee dddZeedddZejdddZeeeejfeddddZeeeejfeejdfdddZd)e eeedddd Zedd!d"Zejdd#d$ZdS)*rF)datacopycCs$|s|ntj||_t|j|_dS)N)rjr_datarrB_dtype)rrrr;r;r<rsz"PandasArrayExtensionArray.__init__NcCsd|tkrFtjt|jtd}x$tt|jD]}|j|||<q,W|S|dkrT|jS|jj|SdS)a Convert to NumPy Array. Note that Pandas expects a 1D array when dtype is set to object. But for other dtypes, the returned shape is the same as the one of ``data``. More info about pandas 1D requirement for PandasExtensionArray here: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.api.extensions.ExtensionArray.html#pandas.api.extensions.ExtensionArray )rBN)objectrjemptyr@rrr)rrBoutrr;r;r<rs z#PandasArrayExtensionArray.__array__)deepr#cCst|jddS)NT)r)rr)rrr;r;r<rszPandasArrayExtensionArray.copy)rBrr#cCs*tj||dkr|n|j|d}|||dS)N)rBr)r)rjrr)rZscalarsrBrrr;r;r<_from_sequencesz(PandasArrayExtensionArray._from_sequence) to_concatr#cCs tjdd|D}||ddS)NcSsg|] }|jqSr;)r)r_var;r;r<ra"sz?PandasArrayExtensionArray._concat_same_type..F)r)rjr)rrrr;r;r<_concat_same_type sz+PandasArrayExtensionArray._concat_same_type)r#cCs|jS)N)r)rr;r;r<rB%szPandasArrayExtensionArray.dtypecCs|jjS)N)rnbytes)rr;r;r<r)sz PandasArrayExtensionArray.nbytescCstjdd|jDS)NcSsg|]}tj|jqSr;)rpisnaany)r_arrr;r;r<ra.sz2PandasArrayExtensionArray.isna..)rjrr)rr;r;r<r-szPandasArrayExtensionArray.isna)rbrcr#cCs tdS)N)r)rrbrcr;r;r< __setitem__0sz%PandasArrayExtensionArray.__setitem__)itemr#cCs&t|tr|j|St|j|ddS)NF)r)rirVrr)rrr;r;r<r3s  z%PandasArrayExtensionArray.__getitem__)indices allow_fill fill_valuer#cCstj|tjd}|r|dkr$|jjntj||jjd}|d k}|d kjrTtdnJt|dkrbn= -1 for `allow_fill` is TruerzAInvalid take for empty PandasArrayExtensionArray, must be all -1.F)r)rr?r?)rjrorVrBZna_valuerrr7r@all IndexErrorrrrtakesum)rrrrmaskrZtookr;r;r<r8s "       zPandasArrayExtensionArray.takecCs t|jS)N)r@r)rr;r;r<__len__Osz!PandasArrayExtensionArray.__len__cCs,t|tstdt||j|jkjS)NzInvalid type to compare to: )rirrrrr)rotherr;r;r<__eq__Rs z PandasArrayExtensionArray.__eq__)F)N)F)NF)FN)rrrrjrkr%rrrrrrr Sequence_rrrBrVrrrslicer rrrrrr;r;r;r<rs&  & rcCst|trt|jSdS)N)rirrr)rBr;r;r<pandas_types_mapperXs rc@s*eZdZUdZdZedZeedZ e e e dZ e e dZ ee ejZeedZeeeefdZeeeefeddddZeddZdd Zeeefeeefd d d Zeed ddZeeefeeefd ddZddZeej ej!fej"dddZ#e$ddZ%dS) ClassLabela Feature type for integer class labels. There are 3 ways to define a `ClassLabel`, which correspond to the 3 arguments: * `num_classes`: Create 0 to (num_classes-1) labels. * `names`: List of label strings. * `names_file`: File containing the list of labels. Under the hood the labels are stored as integers. You can use negative integers to represent unknown/missing labels. Args: num_classes (:obj:`int`, optional): Number of classes. All labels must be < `num_classes`. names (:obj:`list` of :obj:`str`, optional): String names for the integer classes. The order in which the names are provided is kept. names_file (:obj:`str`, optional): Path to a file with names for the integer classes, one per line. Example: ```py >>> from datasets Features >>> features = Features({'label': ClassLabel(num_classes=3, names=['bad', 'ok', 'good'])}) >>> features {'label': ClassLabel(num_classes=3, names=['bad', 'ok', 'good'], id=None)} ``` Nr'F)rrrcCs||_|jdk r"|jdk r"td|jdkrp|jdk rF|j|j|_n*|jdk rhddt|jD|_ntd|jdkrt|j|_n.|jt|jkrtdt|jd|jddd|jD|_d d t|jD|_ t|jt|j krtd dS) Nz7Please provide either names or names_file but not both.cSsg|] }t|qSr;)r4)r_rr;r;r<rasz,ClassLabel.__post_init__..z7Please provide either num_classes, names or names_file.zEClassLabel number of names do not match the defined num_classes. Got z names VS z num_classescSsg|] }t|qSr;)r4)r_rr;r;r<rascSsi|]\}}||qSr;r;)r_rrr;r;r<rdsz,ClassLabel.__post_init__..zBSome label names are duplicated. Each label name should be unique.) names_filenamesr7_load_names_from_file num_classesrr@_int2strr_str2int)rrr;r;r<rs$    zClassLabel.__post_init__cCs|jS)N)r)rr;r;r<rszClassLabel.__call__)valuesr#csbt|t r(t|t r(td|dd}t|tr@|g}d}fdd|D}|rZ|S|dS)aConversion class name string => integer. Example: ```py >>> from datasets import load_dataset >>> ds = load_dataset("rotten_tomatoes", split="train") >>> ds.features["label"].str2int('neg') 0 ``` zValues zS should be a string or an Iterable (list, numpy array, pytorch, tensorflow tensors)TFcsg|]}j|qSr;) _strval2int)r_rc)rr;r<rasz&ClassLabel.str2int..r)rir4rr7)rr return_listryr;)rr<str2ints  zClassLabel.str2int)rcr#c Csd}t|}|jj|}|dkrt|jj|j}|dkrty t|}Wntk r\d}YnX|dksp||jkrtd}|rtd||S)NFTrzInvalid string class label r?)r4rgetstriprVr7r)rrcZ failed_parseZ int_valuer;r;r<rs   zClassLabel._strval2intcst|t r(t|t r(td|dd}t|tr@|g}d}x6|D].}d|ko^jknsFtd|dqFWfdd |D}|r|S|dS) a^Conversion integer => class name string. Regarding unknown/missing labels: passing negative integers raises ValueError. Example: ```py >>> from datasets import load_dataset >>> ds = load_dataset("rotten_tomatoes", split="train") >>> ds.features["label"].int2str(0) 'neg' ``` zValues zU should be an integer or an Iterable (list, numpy array, pytorch, tensorflow tensors)TFrzInvalid integer class label rcsg|]}jt|qSr;)rrV)r_r{)rr;r<rasz&ClassLabel.int2str..)rirVrr7r)rrrr{ryr;)rr<int2strs  zClassLabel.int2strcCs\|jdkrtdt|tr&|j|}d|ko:|jknsXtd|dd|j|S)NzlTrying to use ClassLabel feature with undefined number of class. Please set ClassLabel.names or num_classes.rz Class label rz% greater than configured num_classes r?)rr7rir4r)rZ example_datar;r;r<rs   zClassLabel.encode_example)rr#csxt|tjrDtj|j}|djkrltd|ddjn(t|tjrltj fdd|j D}t |j S)aCast an Arrow array to the ClassLabel arrow storage type. The Arrow types that can be converted to the ClassLabel pyarrow storage type are: - pa.string() - pa.int() Args: storage (Union[pa.StringArray, pa.IntegerArray]): PyArrow array to cast. Returns: pa.Int64Array: Array in the ClassLabel arrow storage type maxz Class label z% greater than configured num_classes cs"g|]}|dk rj|ndqS)N)r)r_label)rr;r<rasz+ClassLabel.cast_storage..) rir3 IntegerArraypcmin_maxrrr7 StringArrayrrrr)rrrr;)rr< cast_storages  zClassLabel.cast_storagec Cs0t|dd}dd|jjdDSQRXdS)Nzutf-8)encodingcSsg|]}|jr|jqSr;)r )r_rr;r;r<rasz4ClassLabel._load_names_from_file.. )openreadsplit)Znames_filepathfr;r;r<rsz ClassLabel._load_names_from_file)&rrrrrrVrrr4rrrrrBr r3r'rr rr rrrrrrrrrr rrr Z Int64Arrayr staticmethodrr;r;r;r<r]s$      rc@sTeZdZUdZedZedZe e dZ e e  dZ e e eddddZe dS)raConstruct a list of feature from a single type or a dict of types. Mostly here for compatiblity with tfds. Args: feature: A list of features of a single type or a dictionary of types. length (`int`): Length of the sequence. Example: ```py >>> from datasets import Features, Sequence, Value, ClassLabel >>> features = Features({'post': Sequence(feature={'text': Value(dtype='string'), 'upvotes': Value(dtype='int32'), 'label': ClassLabel(num_classes=2, names=['hot', 'cold'])})}) >>> features {'post': Sequence(feature={'text': Value(dtype='string', id=None), 'upvotes': Value(dtype='int32', id=None), 'label': ClassLabel(num_classes=2, names=['hot', 'cold'], id=None)}, length=-1, id=None)} ``` rNreF)rrrr?)rrrrr featurelengthrVrrr4rBr rrrr;r;r;r<rs    r)schemar#cCs|dkr dSt|ttfrz|dks2t|tttfrzt|dkrt|dkrHnt|ttfr`|d}n|j}t|d|SdSndSdS)z Check if the object is not None. If the object is a list or a tuple, recursively check the first element of the sequence and stop if at any point the first element is not a sequence or is an empty sequence. NFrT)rirervrr@rrw)rXrr;r;r<rwJs&  rwcsttr"tjfddDSttrDtjfddDStttfr|tdkrftdt d}tj |Stt rt j }tj trtjfdd|DStj |j SS)a get_nested_type() converts a datasets.FeatureType into a pyarrow.DataType, and acts as the inverse of generate_from_arrow_type(). It performs double-duty as the implementation of Features.type and handles the conversion of datasets.Feature->pa.struct csi|]}t||qSr;)get_nested_type)r_rb)rr;r<rdksz#get_nested_type..csi|]}t||qSr;)r)r_rb)rr;r<rdosrzOWe defining list feature, you should just provide one example of the inner typercs i|]}tj|jj|jqSr;)r3rrrr)r_r)rr;r<rdzs)riFeaturesr3structrurervr@r7rrrrr)rrr;)rr<r`s"        rcsDttrFdkr"|dkr"td|dk rBfddt|DSdStttfrĈd|dkrhdSt|dkrx|D]}t|rzPqzWt|dd|krfdd |DSt|Sn|tt r|dkrdStj tr~i}t|ttfrBx>tj f|D]*\}fd d ddD||<qW|Sx6tj |D]&\}\}fd d |D||<qPW|St|t rtd |d nrt|dkrx|D]}t|j rPqWt|t stj |dd|krfdd |DSt|Sn0tt t ttttfr@|dk r<j|SdS|S)aEncode a nested example. This is used since some features (in particular ClassLabel) have some logic during encoding. To avoid iterating over possibly long lists, it first checks (recursively) if the first element that is not None or empty (if it is a sequence) has to be encoded. If the first element needs to be encoded, then all the elements of the list will be encoded, otherwise they'll stay the same. rNz*Got None but expected a dictionary insteadcs(i|] \}\}}t||dd|qS)r)level)encode_nested_example)r_rz sub_schemasub_obj)rr;r<rdsz)encode_nested_example..r)rcsg|]}t|ddqS)r)r)r )r_o)rr!r;r<rasz)encode_nested_example..cs"g|]}td|ddqS)rr)r)r )r_r#) dict_tuplesrr;r<rascsg|]}t|ddqS)r)r)r )r_r#)rr!r;r<rasz+Got a string but expected a list instead: ''cs g|]}tj|ddqS)r)r)r r)r_r#)rrr;r<ras)rirur7rrervr@rwr rrr4rrrr!r~rr)rrXrr|Z list_dictrzZsub_objsr;)r$rrr!r<r sR       &   r )token_per_repo_idcsttr*dk r&ddtDSdStttfrddkrLdStdkrxD]}t|r^Pq^Wt||krfddDStSnhttrtj trȇfddj DStj gSn,tt t frdk rj |dSdSS) aDecode a nested example. This is used since some features (in particular Audio and Image) have some logic during decoding. To avoid iterating over possibly long lists, it first checks (recursively) if the first element that is not None or empty (if it is a sequence) has to be decoded. If the first element needs to be decoded, then all the elements of the list will be decoded, otherwise they'll stay the same. NcSs i|]\}\}}t|||qSr;)decode_nested_example)r_rzr!r"r;r;r<rdsz)decode_nested_example..rcsg|]}t|qSr;)r')r_r#)r!r;r<rasz)decode_nested_example..cs$i|]}tj|g||qSr;)r'r)r_rz)rXrr;r<rds)r&) rirurrervr@rwr'rrrrdecode_example)rrXr&r|r;)rXrr!r<r's*       r')rXcst|trdd|DSd|ks.t|dtr@dd|jDSt|jd}|tkrptt|d|ddSd d t|D|ffd d|jDS) aRegenerate the nested feature object from a deserialized dict. We use the '_type' fields to get the dataclass name to load. generate_from_dict is the recursive helper for Features.from_dict, and allows for a convenient constructor syntax to define features from deserialized JSON dictionaries. This function is used in particular when deserializing a :class:`DatasetInfo` that was dumped to a JSON object. This acts as an analogue to :meth:`Features.from_arrow_schema` and handles the recursive field-by-field instantiation, but doesn't require any mapping to/from pyarrow, except for the fact that it takes advantage of the mapping of pyarrow primitive dtypes that :class:`Value` automatically performs. cSsg|] }t|qSr;)generate_from_dict)r_rcr;r;r<rasz&generate_from_dict..rcSsi|]\}}t||qSr;)r))r_rbrcr;r;r<rdsz&generate_from_dict..rr)rrcSsh|] }|jqSr;)r)r_rr;r;r< sz%generate_from_dict..csi|]\}}|kr||qSr;r;)r_rzr{) field_namesr;r<rds) rirerursrpoprr)r)rXZ class_typer;)r+r<r)s r))rr#cCst|tjrdd|DSt|tjr:tt|j|jdSt|tjrpt|j}t|t t t frf|gSt|dSt|t rddt tttg|j}||j|jdSt|tjrtn*t|tjrtt|dStd|d dS) a generate_from_arrow_type accepts an arrow DataType and returns a datasets FeatureType to be used as the type for a single field. This is the high-level arrow->datasets type conversion and is inverted by get_nested_type(). This operates at the individual *field* level, whereas Features.from_arrow_schema() operates at the full schema level and holds the methods that represent the bijection from Features<->pyarrow.Schema cSsi|]}t|j|jqSr;)generate_from_arrow_typerr)r_rr;r;r<rdsz,generate_from_arrow_type..)rr)rN)rrB)rBzCannot convert z to a Feature type.)rir3Z StructTypeZFixedSizeListTyperr-rZ list_sizeZListTyperurvrerrrrrrrZDictionaryTyperrr~r=r7)rrZ array_featurer;r;r<r- s"        r-)rrr#cCstj|}tj|j|d}xxt|jdD]f}tt|jd|j|dd}|j|j|d}tjtj |d|tj d}tj j ||}q,W|S)z=Build a PyArrow ListArray from a multidimensional NumPy array)rrN) rjrr3rrrlrr rrr& ListArray from_arrays)rrrrZ n_offsetsZ step_offsetsrr;r;r<numpy_to_pyarrow_listarray(s   r0)l_arrr#cCsvddt|D}dd|D}tjdgdd|Dtd}tj||d}tj|tjd}tj|}tj j ||S)NcSsg|]\}}|dkr|qS)Nr;)r_rrr;r;r<ra5sz:list_of_pa_arrays_to_pyarrow_listarray..cSsg|]}|dk r|qS)Nr;)r_rr;r;r<ra6srcSsg|] }t|qSr;)r@)r_rr;r;r<ra8s)rB)r) rrjZcumsumrrr3rr&Z concat_arraysr.r/)r1rrrr;r;r<&list_of_pa_arrays_to_pyarrow_listarray4s r2)r1rr#cs4t|dkr"tfdd|DStjgdSdS)zEBuild a PyArrow ListArray from a possibly nested list of NumPy arraysrcs$g|]}|dk rt|dndqS)N)r)r0)r_r)rr;r<raDsz9list_of_np_array_to_pyarrow_listarray..)rN)r@r2r3r)r1rr;)rr<%list_of_np_array_to_pyarrow_listarray@s r3)rcCs2t|tjrdSt|tr*tt|dSdSdS)zReturn `True` if data is a NumPy ndarray or (recursively) if first non-null value in list is a NumPy ndarray. Args: data (Any): Data. Returns: bool TrFN)rirjrkrecontains_any_np_arrayr)rr;r;r<r4Js  r4)rrr#cs<t|tjrt|dSt|tr8tfdd|DSdS)a0Convert to PyArrow ListArray either a NumPy ndarray or (recursively) a list that may contain any NumPy ndarray. Args: data (Union[np.ndarray, List]): Data. type (pa.DataType): Explicit PyArrow DataType passed to coerce the ListArray data type. Returns: pa.ListArray )rcsg|]}t|dqS))r)!any_np_array_to_pyarrow_listarray)r_r)rr;r<rahsz5any_np_array_to_pyarrow_listarray..N)rirjrkr0rer2)rrr;)rr<r5[s   r5)rrr#cCs(t|rt||jdStj||jSdS)zConvert to PyArrow ListArray. Args: data (Any): Sequence, iterable, np.ndarray or pd.Series. pa_type (_ArrayXDExtensionType): Any of the ArrayNDExtensionType. Returns: pyarrow.Array )rN)r4r5rr3rr)rrr;r;r<to_pyarrow_listarrayks r6)rignore_decode_attributer#cCsjt|tr tdd|jDSt|ttfr:t|dSt|trNt|jSt |dod|sb|j SdSdS)aRCheck if a (possibly nested) feature requires decoding. Args: feature (FeatureType): the feature type to be checked ignore_decode_attribute (:obj:`bool`, default ``False``): Whether to ignore the current value of the `decode` attribute of the decodable feature types. Returns: :obj:`bool` css|]}t|VqdS)N)require_decoding)r_rr;r;r< sz#require_decoding..rr(TN) rirurrrervr8rrhasattrdecode)rr7r;r;r<r8{s    r8)rr#cCs\t|tr tdd|jDSt|ttfr:t|dSt|trNt|jSt |dSdS)zCheck if a (possibly nested) feature requires storage casting. Args: feature (FeatureType): the feature type to be checked Returns: :obj:`bool` css|]}t|VqdS)N)require_storage_cast)r_rr;r;r<r9sz'require_storage_cast..rrN) rirurrrervr<rrr:)rr;r;r<r<s    r<cCs\t|tr tdd|jDSt|ttfr:t|dSt|trNt|jSt |dSdS)zCheck if a (possibly nested) feature requires embedding data into storage. Args: feature (FeatureType): the feature type to be checked Returns: :obj:`bool` css|]}t|VqdS)N)r<)r_rr;r;r<r9sz(require_storage_embed..rZ embed_storageN) rirurrrervr<rrr:)rr;r;r<require_storage_embeds    r=cstfdd}d|_|S)z Wrapper to keep the secondary dictionary, which tracks whether keys are decodable, of the :class:`datasets.Features` object in sync with the main dictionary. csZ|r|d}|dd}n |jd}|f||}t|dsBtdd|jD|_|S)Nrrr_column_requires_decodingcSsi|]\}}t||qSr;)r8)r_colrr;r;r<rdsz?keep_features_dicts_synced..wrapper..)r,r:AssertionErrorrsr>)argskwargsrr)funcr;r<wrappers z+keep_features_dicts_synced..wrapperZ_keep_dicts_synced)r Z_decorator_name_)rCrDr;)rCr<keep_features_dicts_synceds rEc s:eZdZdZfddZeejZeejZeej Z eej Z eej Z eej Z eej Z ddZeddZedd Zeejdd d d Zedd ddZddZddZddZd(eeeeeeedffdddZe edddZ!edddZ"dd d d!Z#ddd"d#d$Z$d)dd d&d'Z%Z&S)*ra A special dictionary that defines the internal structure of a dataset. Instantiated with a dictionary of type ``dict[str, FieldType]``, where keys are the desired column names, and values are the type of that column. ``FieldType`` can be one of the following: - a :class:`datasets.Value` feature specifies a single typed value, e.g. ``int64`` or ``string`` - a :class:`datasets.ClassLabel` feature specifies a field with a predefined set of classes which can have labels associated to them and will be stored as integers in the dataset - a python :obj:`dict` which specifies that the field is a nested field containing a mapping of sub-fields to sub-fields features. It's possible to have nested fields of nested fields in an arbitrary manner - a python :obj:`list` or a :class:`datasets.Sequence` specifies that the field contains a list of objects. The python :obj:`list` or :class:`datasets.Sequence` should be provided with a single sub-feature as an example of the feature type hosted in this list A :class:`datasets.Sequence` with a internal dictionary feature will be automatically converted into a dictionary of lists. This behavior is implemented to have a compatilbity layer with the TensorFlow Datasets library but may be un-wanted in some cases. If you don't want this behavior, you can use a python :obj:`list` instead of the :class:`datasets.Sequence`. - a :class:`Array2D`, :class:`Array3D`, :class:`Array4D` or :class:`Array5D` feature for multidimensional arrays - an :class:`Audio` feature to store the absolute path to an audio file or a dictionary with the relative path to an audio file ("path" key) and its bytes content ("bytes" key). This feature extracts the audio data. - an :class:`Image` feature to store the absolute path to an image file, an :obj:`np.ndarray` object, a :obj:`PIL.Image.Image` object or a dictionary with the relative path to an image file ("path" key) and its bytes content ("bytes" key). This feature extracts the image data. - :class:`datasets.Translation` and :class:`datasets.TranslationVariableLanguages`, the two features specific to Machine Translation cs&tj||dd|jD|_dS)NcSsi|]\}}t||qSr;)r8)r_r?rr;r;r<rdsz%Features.__init__..)superrrsr>)rrArB)rr;r<rszFeatures.__init__cCstt|ffS)N)rru)rr;r;r<rszFeatures.__reduce__cCst|S)z] Features field types. Returns: :obj:`pyarrow.DataType` )r)rr;r;r<rsz Features.typecCs,dd|jii}tj|jjdtj|iS)zV Features schema. Returns: :obj:`pyarrow.Schema` infofeatures huggingface)rrr3rrZ with_metadatajsondumps)rZ hf_metadatar;r;r< arrow_schemaszFeatures.arrow_schema) pa_schemar#cCs|jdk rjdjd|jkrjtj|jdjdj}d|krjd|dkrj|dddk rjtj|ddSdd|D}|f|S)a Construct Features from Arrow Schema. It also checks the schema metadata for Hugging Face Datasets features. Args: pa_schema (:obj:`pyarrow.Schema`): Arrow Schema. Returns: :class:`Features` NrIzutf-8rGrHcSsi|]}t|j|jqSr;)r-rr)r_rr;r;r<rd!sz.Features.from_arrow_schema..)metadataencoderJloadsr;r from_dict)rrMrNrXr;r;r<from_arrow_schemas $zFeatures.from_arrow_schema)r#cCst|}|f|S)a# Construct Features from dict. Regenerate the nested feature object from a deserialized dict. We use the '_type' key to infer the dataclass name of the feature FieldType. It allows for a convenient constructor syntax to define features from deserialized JSON dictionaries. This function is used in particular when deserializing a :class:`DatasetInfo` that was dumped to a JSON object. This acts as an analogue to :meth:`Features.from_arrow_schema` and handles the recursive field-by-field instantiation, but doesn't require any mapping to/from pyarrow, except for the fact that it takes advantage of the mapping of pyarrow primitive dtypes that :class:`Value` automatically performs. Args: dic (:obj:`dict[str, Any]`): Python dictionary. Returns: :class:`Features` Example:: >>> Features.from_dict({'_type': {'dtype': 'string', 'id': None, '_type': 'Value'}}) {'_type': Value(dtype='string', id=None)} )r))rZdicrXr;r;r<rQ$szFeatures.from_dictcCst|S)N)r)rr;r;r<rr@szFeatures.to_dictcCst|}t||S)z Encode example into a format for Arrow. Args: example (:obj:`dict[str, Any]`): Data in a Dataset row. Returns: :obj:`dict[str, Any]` )r}r )rexampler;r;r<rCs zFeatures.encode_examplecsji}t|tkr0tdt|dtx4|jD](\}t|}fdd|D|<q:W|S)z Encode batch into a format for Arrow. Args: batch (:obj:`dict[str, list[Any]]`): Data in a Dataset batch. Returns: :obj:`dict[str, list[Any]]` zColumn mismatch between batch z and features csg|]}t|qSr;)r )r_rX)rbrr;r<ra_sz)Features.encode_batch..)setr7rsr})rbatchZ encoded_batchcolumnr;)rbrr< encode_batchPs zFeatures.encode_batchN)rSr&cs,fddtfddjDDS)aDecode example with custom feature decoding. Args: example (:obj:`dict[str, Any]`): Dataset row data. token_per_repo_id (:obj:`dict`, optional): To access and decode audio or image files from private repositories on the Hub, you can pass a dictionary repo_id (str) -> token (bool or str) Returns: :obj:`dict[str, Any]` cs2i|]*\}\}}j|r(t||dn||qS))r&)r>r')r_ column_namerrc)rr&r;r<rdosz+Features.decode_example..csi|]\}}|kr||qSr;r;)r_rbrc)rSr;r<rdts)rrs)rrSr&r;)rSrr&r<r(bs zFeatures.decode_example)rVrXcs"jrfdd|DS|S)zDecode column with custom feature decoding. Args: column (:obj:`list[Any]`): Dataset column data. column_name (:obj:`str`): Dataset column name. Returns: :obj:`list[Any]` cs&g|]}|dk rt|ndqS)N)r')r_rc)rXrr;r<rasz*Features.decode_column..)r>)rrVrXr;)rXrr< decode_columnxs zFeatures.decode_column)rUcsDi}x:|jD].\}jr4fdd|Dn||<qW|S)zDecode batch with custom feature decoding. Args: batch (:obj:`dict[str, list[Any]]`): Dataset batch data. Returns: :obj:`dict[str, list[Any]]` cs&g|]}|dk rt|ndqS)N)r')r_rc)rXrr;r<rasz)Features.decode_batch..)rsr>)rrUZ decoded_batchrVr;)rXrr< decode_batchs  zFeatures.decode_batchcCs tj|S)a Make a deep copy of Features. Returns: :class:`Features` Example: ```py >>> from datasets import load_dataset >>> ds = load_dataset("rotten_tomatoes", split="train") >>> copy_of_features = ds.features.copy() >>> copy_of_features {'label': ClassLabel(num_classes=2, names=['neg', 'pos'], id=None), 'text': Value(dtype='string', id=None)} ``` )rdeepcopy)rr;r;r<rsz Features.copy)rr#csdfdd t||S)a Reorder Features fields to match the field order of other Features. The order of the fields is important since it matters for the underlying arrow data. Re-ordering the fields allows to make the underlying arrow data type match. Args: other (:class:`Features`): The other Features to align with. Returns: :class:`Features` Example:: >>> from datasets import Features, Sequence, Value >>> # let's say we have to features with a different order of nested fields (for a and b for example) >>> f1 = Features({"root": Sequence({"a": Value("string"), "b": Value("string")})}) >>> f2 = Features({"root": {"b": Sequence(Value("string")), "a": Sequence(Value("string"))}}) >>> assert f1.type != f2.type >>> # re-ordering keeps the base structure (here Sequence is defined at the root level), but make the fields order match >>> f1.reorder_fields_as(f2) {'root': Sequence(feature={'b': Value(dtype='string', id=None), 'a': Value(dtype='string', id=None)}, length=-1, id=None)} >>> assert f1.reorder_fields_as(f2).type == f2.type csrdddnd}ttrLjttrFddjDngttrֈjjj}}ttrddjD}tdd|jD||dSg}t|d ||dSnttrHttstd d |ttkr0td d |fd dDStt rtt sxtd d |t t krtdd |fddt t DSSdS)Nz at rr\cSsi|]\}}|g|qSr;r;)r_rzr{r;r;r<rdszIFeatures.reorder_fields_as..recursive_reorder..cSsi|]\}}|g|qSr;r;)r_rzr{r;r;r<rdscSsi|]\}}|d|qS)rr;)r_rzr{r;r;r<rds)rrrzType mismatch: between z and zKeys mismatch: between cs,i|]$}||d||qS)r+r;)r_rb)recursive_reordersourcestacktargetr;r<rdszLength mismatch: between cs$g|]}||dqS)z.r;)r_r)r]r^r_r`r;r<raszIFeatures.reorder_fields_as..recursive_reorder..) rirrrursrrr7sortedrer@r)r^r`r_Zstack_positionZid_rZ reordered)r])r^r_r`r<r]s8           z5Features.reorder_fields_as..recursive_reorder)r\)r)rrr;)r]r<reorder_fields_ass!zFeatures.reorder_fields_ascsxtd|D]}d}|j}x|jD]\}t|tr`d}|jfdd|jD|=q&t|trt|jtrd}|jfdd|jjD|=q&t|dr&|j |kr&d}|jfdd|j jD|=q&W|}|r Pq W|S) aCFlatten the features. Every dictionary column is removed and is replaced by all the subfields it contains. The new fields are named by concatenating the name of the original column and the subfield name like this: ".". If a column contains nested dictionaries, then all the lower-level subfields names are also concatenated to form new columns: "..", etc. Returns: Features: the flattened features Example: ```py >>> from datasets import load_dataset >>> ds = load_dataset("squad", split="train") >>> ds.features.flatten() {'answers.answer_start': Sequence(feature=Value(dtype='int32', id=None), length=-1, id=None), 'answers.text': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'context': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'question': Value(dtype='string', id=None), 'title': Value(dtype='string', id=None)} ``` rTFcs i|]\}}|d|qS)r+r;)r_rzr{)rXr;r<rd sz$Features.flatten..cs4i|],\}}t|tst|n|gd|qS)r+)rirur)r_rzr{)rXr;r<rdsrcs i|]\}}|d|qS)r+r;)r_rzr{)rXr;r<rds) rrrsriruupdaterrr:r)rZ max_depthdepthZ no_changeZ flattenedZ subfeaturer;)rXr<rs,    zFeatures.flatten)N)rc)'rrrrrrErur __delitem__rd setdefaultr,popitemclearrrrrLrr3ZSchemarRrQrrrrWrr r4rr%r(rerYrZrrbr __classcell__r;r;)rr<rs2          (=r)FT)F)N)r)N)N)N)N)F)qrrrJrSrfcollections.abcrrZ dataclassesrrrr functoolsrr operatorr typingr r r rrrrrrrhrjZpandasrpr/r3Zpyarrow.computeZcomputerZ pyarrow.typesZpandas.api.extensionsrZPandasExtensionArrayrZPandasExtensionDtyper\rtablerutilsrZutils.py_utilsrrraudiorimagerr translationr r! get_loggerrloggerrr4r=rWr%r^r}r~rrrrrrrrrrrrrrrrrrurervZ FeatureTyperwrr r'r)r-rkr.r0rr2r3r4r5r6r8r<r=rErr;r;r;r<s          @G    ";([@! H&'   "