





from __future__ import annotations



def    __lowercase   (      _SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE	) ->   str:  # noqa: E741


      '''simple docstring'''


      while r - l > 1:
            SCREAMING_SNAKE_CASE		=						(l + r) // 2
            if v[m] >= key:
                  SCREAMING_SNAKE_CASE		=						m
            else:
                  SCREAMING_SNAKE_CASE		=						m  # noqa: E741
      return r



def    __lowercase   (      _SCREAMING_SNAKE_CASE	) ->   int:


      '''simple docstring'''


      if len(_SCREAMING_SNAKE_CASE	) == 0:
            return 0

      SCREAMING_SNAKE_CASE		=						[0] * len(_SCREAMING_SNAKE_CASE	)
      SCREAMING_SNAKE_CASE		=						1

      SCREAMING_SNAKE_CASE		=						v[0]

      for i in range(1 ,						len(_SCREAMING_SNAKE_CASE	)	):
            if v[i] < tail[0]:
                  SCREAMING_SNAKE_CASE		=						v[i]
            elif v[i] > tail[length - 1]:
                  SCREAMING_SNAKE_CASE		=						v[i]
                  length += 1
            else:
                  SCREAMING_SNAKE_CASE		=						v[i]

      return length


if __name__ == "__main__":
      import doctest

      doctest.testmod()









import os
from distutils.util import strtobool



def    __lowercase   (      _SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE	) ->   Tuple:


      '''simple docstring'''


      for e in env_keys:
            SCREAMING_SNAKE_CASE		=						int(os.environ.get(_SCREAMING_SNAKE_CASE ,						-1	)	)
            if val >= 0:
                  return val
      return default



def    __lowercase   (      _SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE=False	) ->   Optional[int]:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						os.environ.get(_SCREAMING_SNAKE_CASE ,						str(_SCREAMING_SNAKE_CASE	)	)
      return strtobool(_SCREAMING_SNAKE_CASE	) == 1  # As its name indicates `strtobool` actually returns an int...



def    __lowercase   (      _SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE="no"	) ->   Any:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						os.environ.get(_SCREAMING_SNAKE_CASE ,						str(_SCREAMING_SNAKE_CASE	)	)
      return value


