





import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
     import ctypes
     import msvcrt  # noqa



     class 							_UpperCamelCase					(	ctypes.Structure     ):
            # _fields is a specific attr expected by ctypes
            _UpperCamelCase				:					Optional[Any]         =   [('''size''', ctypes.c_int), ('''visible''', ctypes.c_byte)]




def  lowerCAmelCase_ (							)     ->		int:
       if os.name == "nt":
              UpperCamelCase_          =  CursorInfo()
              UpperCamelCase_          =  ctypes.windll.kernelaa.GetStdHandle(-11  )
              ctypes.windll.kernelaa.GetConsoleCursorInfo(UpperCamelCase_					,		ctypes.byref(UpperCamelCase_  )  )
              UpperCamelCase_          =  False
              ctypes.windll.kernelaa.SetConsoleCursorInfo(UpperCamelCase_					,		ctypes.byref(UpperCamelCase_  )  )
       elif os.name == "posix":
              sys.stdout.write("\033[?25l"  )
              sys.stdout.flush()




def  lowerCAmelCase_ (							)     ->		Optional[Any]:
       if os.name == "nt":
              UpperCamelCase_          =  CursorInfo()
              UpperCamelCase_          =  ctypes.windll.kernelaa.GetStdHandle(-11  )
              ctypes.windll.kernelaa.GetConsoleCursorInfo(UpperCamelCase_					,		ctypes.byref(UpperCamelCase_  )  )
              UpperCamelCase_          =  True
              ctypes.windll.kernelaa.SetConsoleCursorInfo(UpperCamelCase_					,		ctypes.byref(UpperCamelCase_  )  )
       elif os.name == "posix":
              sys.stdout.write("\033[?25h"  )
              sys.stdout.flush()







@contextmanager
def  lowerCAmelCase_ (							)     ->		List[Any]:
       try:
              hide_cursor()
              yield
       finally:
              show_cursor()








import jax.numpy as jnp

from ...utils import logging
from ..ta.modeling_flax_ta import FlaxTaEncoderModel, FlaxTaForConditionalGeneration, FlaxTaModel
from .configuration_mta import MTaConfig


_UpperCAmelCase        =				logging.get_logger(__name__)

_UpperCAmelCase        =				'T5Config'




def  lowerCAmelCase_ (							UpperCamelCase_					,		UpperCamelCase_					,		UpperCamelCase_  )     ->		jnp.ndarray:
       UpperCamelCase_          =  jnp.zeros_like(UpperCamelCase_  )
       UpperCamelCase_          =  shifted_input_ids.at[:, 1:].set(input_ids[:, :-1]  )
       UpperCamelCase_          =  shifted_input_ids.at[:, 0].set(UpperCamelCase_  )

       UpperCamelCase_          =  jnp.where(shifted_input_ids == -100					,		UpperCamelCase_					,		UpperCamelCase_  )
       return shifted_input_ids



class 							_UpperCamelCase					(	lowerCAmelCase_     ):
       _UpperCamelCase				:					Dict         =   '''mt5'''
       _UpperCamelCase				:					Union[str, Any]         =   MTaConfig



class 							_UpperCamelCase					(	lowerCAmelCase_     ):
       _UpperCamelCase				:					Dict         =   '''mt5'''
       _UpperCamelCase				:					Optional[int]         =   MTaConfig



class 							_UpperCamelCase					(	lowerCAmelCase_     ):
       _UpperCamelCase				:					Union[str, Any]         =   '''mt5'''
       _UpperCamelCase				:					List[Any]         =   MTaConfig

