
from .imports import is_tqdm_available


if is_tqdm_available():
   from tqdm.auto import tqdm as _tqdm

from ..state import PartialState






def   lowerCamelCase__							(					a = True		,		*a		,		**a      )      ->   Optional[Any]:
   if not is_tqdm_available():
      raise ImportError('''Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'''      )
   _A:  Optional[Any]					=       False
   if main_process_only:
      _A:  Union[str, Any]					=       PartialState().local_process_index == 0
   return _tqdm(*a		,		**a		,		disable=a      )





def   lowerCamelCase__							(					a      )      ->   bool:
   _A:  Dict					=       [int(a      ) for i in ip_va_address.split('''.'''      ) if i.isdigit()]
   return len(a      ) == 4 and all(0 <= int(a      ) <= 2_54 for octet in octets      )


if __name__ == "__main__":
   UpperCAmelCase__		:     str     			=      input().strip()
   UpperCAmelCase__		:     Any     			=      'valid' if is_ip_va_address_valid(ip) else 'invalid'
   print(F"""{ip} is a {valid_or_invalid} IP v4 address.""")



