'''simple docstring'''




def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							)      ->       float:

    def get_matched_characters(UpperCamelCase__							,    UpperCamelCase__							) -> str:
        __lowerCamelCase            =    []
        __lowerCamelCase            =    min(len(_stra							)							,    len(_stra							)							) // 2
        for i, l in enumerate(_stra							):
            __lowerCamelCase            =    int(max(0							,    i - limit							)							)
            __lowerCamelCase            =    int(min(i + limit + 1							,    len(_stra							)							)							)
            if l in _stra[left:right]:
                matched.append(UpperCamelCase__							)
                __lowerCamelCase            =    f"""{_stra[0:_stra.index(UpperCamelCase__							)]} {_stra[_stra.index(UpperCamelCase__							) + 1:]}"""

        return "".join(UpperCamelCase__							)

    # matching characters
    __lowerCamelCase            =    get_matched_characters(UpperCamelCase__							,    UpperCamelCase__							)
    __lowerCamelCase            =    get_matched_characters(UpperCamelCase__							,    UpperCamelCase__							)
    __lowerCamelCase            =    len(UpperCamelCase__							)

    # transposition
    __lowerCamelCase            =    (
        len([(ca, ca) for ca, ca in zip(UpperCamelCase__							,    UpperCamelCase__							) if ca != ca]							) // 2
    )

    if not match_count:
        __lowerCamelCase            =    0.0
    else:
        __lowerCamelCase            =    (
            1
            / 3
            * (
                match_count / len(UpperCamelCase__							)
                + match_count / len(UpperCamelCase__							)
                + (match_count - transpositions) / match_count
            )
        )

    # common prefix up to 4 characters
    __lowerCamelCase            =    0
    for ca, ca in zip(stra[:4]							,    stra[:4]							):
        if ca == ca:
            prefix_len += 1
        else:
            break

    return jaro + 0.1 * prefix_len * (1 - jaro)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  print(jaro_winkler("hello", "world"))

'''simple docstring'''




def __lowerCAmelCase					(				UpperCamelCase__							)      ->       bool:
    if number < 0:
        raise ValueError('''number must not be negative'''							)
    return number & (number - 1) == 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()
