





def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase						,	_UpperCAmelCase )			->     List[str]:
    lowerCamelCase__    :      List[Any]					 =		0
    lowerCamelCase__    :      Any					 =		len(__lowerCamelCase ) - 1

    while left <= right:
        # avoid divided by 0 during interpolation
        if sorted_collection[left] == sorted_collection[right]:
            if sorted_collection[left] == item:
                return left
            else:
                return None

        lowerCamelCase__    :      Optional[int]					 =		left + ((item - sorted_collection[left]) * (right - left)) // (
            sorted_collection[right] - sorted_collection[left]
        )

        # out of range check
        if point < 0 or point >= len(__lowerCamelCase ):
            return None

        lowerCamelCase__    :      Any					 =		sorted_collection[point]
        if current_item == item:
            return point
        else:
            if point < left:
                lowerCamelCase__    :      Optional[int]					 =		left
                lowerCamelCase__    :      Optional[Any]					 =		point
            elif point > right:
                lowerCamelCase__    :      str					 =		right
                lowerCamelCase__    :      List[str]					 =		point
            else:
                if item < current_item:
                    lowerCamelCase__    :      Optional[Any]					 =		point - 1
                else:
                    lowerCamelCase__    :      int					 =		point + 1
    return None


def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase						,	_UpperCAmelCase						,	_UpperCAmelCase						,	_UpperCAmelCase )			->     List[str]:

    # avoid divided by 0 during interpolation
    if sorted_collection[left] == sorted_collection[right]:
        if sorted_collection[left] == item:
            return left
        else:
            return None

    lowerCamelCase__    :      List[str]					 =		left + ((item - sorted_collection[left]) * (right - left)) // (
        sorted_collection[right] - sorted_collection[left]
    )

    # out of range check
    if point < 0 or point >= len(__lowerCamelCase ):
        return None

    if sorted_collection[point] == item:
        return point
    elif point < left:
        return interpolation_search_by_recursion(__lowerCamelCase						,	__lowerCamelCase						,	__lowerCamelCase						,	__lowerCamelCase )
    elif point > right:
        return interpolation_search_by_recursion(__lowerCamelCase						,	__lowerCamelCase						,	__lowerCamelCase						,	__lowerCamelCase )
    else:
        if sorted_collection[point] > item:
            return interpolation_search_by_recursion(
                __lowerCamelCase						,	__lowerCamelCase						,	__lowerCamelCase						,	point - 1 )
        else:
            return interpolation_search_by_recursion(
                __lowerCamelCase						,	__lowerCamelCase						,	point + 1						,	__lowerCamelCase )


def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase )			->     int:
    if collection != sorted(__lowerCamelCase ):
        raise ValueError('Collection must be ascending sorted' )
    return True


if __name__ == "__main__":
    import sys
    _UpperCAmelCase				:       str	   =				0
    if debug == 1:
        _UpperCAmelCase				:       Union[str, Any]	   =				[10, 30, 40, 45, 50, 66, 77, 93]
        try:
            __assert_sorted(collection)
        except ValueError:
            sys.exit("""Sequence must be ascending sorted to apply interpolation search""")
        _UpperCAmelCase				:       List[str]	   =				67

    _UpperCAmelCase				:       Union[str, Any]	   =				interpolation_search(collection, target)
    if result is not None:
        print(F"""{target} found at positions: {result}""")
    else:
        print("""Not found""")












'''simple docstring'''

import importlib.metadata
import operator
import re
import sys
from typing import Optional

from packaging import version


lowercase_					= {
    """<""": operator.lt,
    """<=""": operator.le,
    """==""": operator.eq,
    """!=""": operator.ne,
    """>=""": operator.ge,
    """>""": operator.gt,
}





def lowerCamelCase						(     __lowerCamelCase :    Tuple					,       __lowerCamelCase :    Optional[Any]					,       __lowerCamelCase :    Dict					,       __lowerCamelCase :    List[Any]					,       __lowerCamelCase :    Optional[int]					,       __lowerCamelCase :    Optional[Any]    )						->Tuple:
    if got_ver is None or want_ver is None:
        raise ValueError(
            F'Unable to compare versions for {requirement}: need={want_ver} found={got_ver}. This is unusual. Consider'
            F' reinstalling {pkg}.'    )
    if not ops[op](version.parse(__lowerCamelCase    )					,       version.parse(__lowerCamelCase    )    ):
        raise ImportError(
            F'{requirement} is required for a normal functioning of this module, but found {pkg}=={got_ver}.{hint}'    )





def lowerCamelCase						(     __lowerCamelCase :    str					,       __lowerCamelCase :    Optional[str] = None    )						->None:
    _SCREAMING_SNAKE_CASE									=			F'\n{hint}' if hint is not None else """"""

    # non-versioned check
    if re.match(R"""^[\w_\-\d]+$"""					,       __lowerCamelCase    ):
        _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE									=			requirement, None, None
    else:
        _SCREAMING_SNAKE_CASE									=			re.findall(R"""^([^!=<>\s]+)([\s!=<>]{1,2}.+)"""					,       __lowerCamelCase    )
        if not match:
            raise ValueError(
                """requirement needs to be in the pip package format, .e.g., package_a==1.23, or package_b>=1.23, but"""
                F' got {requirement}'    )
        _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE									=			match[0]
        _SCREAMING_SNAKE_CASE									=			want_full.split(""","""    )  # there could be multiple requirements
        _SCREAMING_SNAKE_CASE									=			{}
        for w in want_range:
            _SCREAMING_SNAKE_CASE									=			re.findall(R"""^([\s!=<>]{1,2})(.+)"""					,       __lowerCamelCase    )
            if not match:
                raise ValueError(
                    """requirement needs to be in the pip package format, .e.g., package_a==1.23, or package_b>=1.23,"""
                    F' but got {requirement}'    )
            _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE									=			match[0]
            _SCREAMING_SNAKE_CASE									=			want_ver
            if op not in ops:
                raise ValueError(F'{requirement}: need one of {list(ops.keys()    )}, but got {op}'    )

    # special case
    if pkg == "python":
        _SCREAMING_SNAKE_CASE									=			""".""".join([str(__lowerCamelCase    ) for x in sys.version_info[:3]]    )
        for op, want_ver in wanted.items():
            _compare_versions(__lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase    )
        return

    # check if any version is installed
    try:
        _SCREAMING_SNAKE_CASE									=			importlib.metadata.version(__lowerCamelCase    )
    except importlib.metadata.PackageNotFoundError:
        raise importlib.metadata.PackageNotFoundError(
            F'The \'{requirement}\' distribution was not found and is required by this application. {hint}'    )

    # check that the right version is installed if version number or a range was provided
    if want_ver is not None:
        for op, want_ver in wanted.items():
            _compare_versions(__lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase					,       __lowerCamelCase    )






def lowerCamelCase						(     __lowerCamelCase :    Union[str, Any]    )						->str:
    _SCREAMING_SNAKE_CASE									=			"""Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main"""
    return require_version(__lowerCamelCase					,       __lowerCamelCase    )



