


'''simple docstring'''






__UpperCAmelCase       							=				'''0.21.0'''

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
		from .utils import rich






import enum
import shutil
import sys


a__   ,				a__      :     int         =		shutil.get_terminal_size()

a__      :     Tuple         =		{'UP': 'A', 'DOWN': 'B', 'RIGHT': 'C', 'LEFT': 'D'}





class UpperCAmelCase_				( enum.Enum ):
  __lowerCAmelCase   :						int							=   0
  __lowerCAmelCase   :						Optional[int]							=   1




def      UpperCAmelCase_    (    _UpperCAmelCase							:Optional[int]  ,						_UpperCAmelCase							:int=""				)	->				str:
     '''simple docstring'''


     sys.stdout.write(str(_UpperCAmelCase				) + end				)
     sys.stdout.flush()

def      UpperCAmelCase_    (    _UpperCAmelCase							:Union[str, Any]  ,						_UpperCAmelCase							:Tuple  ,						_UpperCAmelCase							:Tuple=""				)	->				List[Any]:
     '''simple docstring'''


     forceWrite(f'\u001b[{color}m{content}\u001b[0m'  ,						_UpperCAmelCase				)

def      UpperCAmelCase_    (    )	->				Dict:
     '''simple docstring'''


     forceWrite('''\r'''				)

def      UpperCAmelCase_    (    _UpperCAmelCase							:int  ,						_UpperCAmelCase							:str				)	->				List[Any]:
     '''simple docstring'''


     forceWrite(f'\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'				)

def      UpperCAmelCase_    (    )	->				List[Any]:
     '''simple docstring'''


     forceWrite(''' ''' * TERMINAL_WIDTH				)
     reset_cursor()


def      UpperCAmelCase_    (    )	->				Tuple:
     '''simple docstring'''


     reset_cursor()
     forceWrite('''-''' * TERMINAL_WIDTH				)



