'''simple docstring'''
def  _UpperCamelCase (     _a	:	str			):




    """simple docstring"""



    __UpperCamelCase	:	Union[str, Any]		    =  0

    # if input_string is "aba" than new_input_string become "a|b|a"
    __UpperCamelCase	:	str		    =  ''
    __UpperCamelCase	:	List[str]		    =  ''

    # append each character + "|" in new_string for range(0, length-1)
    for i in input_string[: len(_a			) - 1]:
        new_input_string += i + "|"
    # append last character
    new_input_string += input_string[-1]

    # we will store the starting and ending of previous furthest ending palindromic
    # substring
    __UpperCamelCase    ,					__UpperCamelCase	:	str		    =  0, 0

    # length[i] shows the length of palindromic substring with center i
    __UpperCamelCase	:	Optional[int]		    =  [1 for i in range(len(_a			)			)]

    # for each character in new_string find corresponding palindromic string
    __UpperCamelCase	:	Dict		    =  0
    for j in range(len(_a			)			):
        __UpperCamelCase	:	List[str]		    =  1 if j > r else min(length[l + r - j] // 2				,     r - j + 1			)
        while (
            j - k >= 0
            and j + k < len(_a			)
            and new_input_string[k + j] == new_input_string[j - k]
        ):
            k += 1

        __UpperCamelCase	:	List[str]		    =  2 * k - 1

        # does this string is ending after the previously explored end (that is r) ?
        # if yes the update the new r to the last index of this
        if j + k - 1 > r:
            __UpperCamelCase	:	int		    =  j - k + 1  # noqa: E741
            __UpperCamelCase	:	str		    =  j + k - 1

        # update max_length and start position
        if max_length < length[j]:
            __UpperCamelCase	:	List[str]		    =  length[j]
            __UpperCamelCase	:	int		    =  j

    # create that string
    __UpperCamelCase	:	Optional[int]		    =  new_input_string[start - max_length // 2 : start + max_length // 2 + 1]
    for i in s:
        if i != "|":
            output_string += i

    return output_string


if __name__ == "__main__":
  import doctest

  doctest.testmod()




'''simple docstring'''
a=  '''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



