'''simple docstring'''




from __future__ import annotations

import bisect






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__ = 0							,    UpperCamelCase__ = -1							)      ->       int:
    if hi < 0:
        __lowerCamelCase            =    len(UpperCamelCase__							)

    while lo < hi:
        __lowerCamelCase            =    lo + (hi - lo) // 2
        if sorted_collection[mid] < item:
            __lowerCamelCase            =    mid + 1
        else:
            __lowerCamelCase            =    mid

    return lo






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__ = 0							,    UpperCamelCase__ = -1							)      ->       int:
    if hi < 0:
        __lowerCamelCase            =    len(UpperCamelCase__							)

    while lo < hi:
        __lowerCamelCase            =    lo + (hi - lo) // 2
        if sorted_collection[mid] <= item:
            __lowerCamelCase            =    mid + 1
        else:
            __lowerCamelCase            =    mid

    return lo






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__ = 0							,    UpperCamelCase__ = -1							)      ->       None:
    sorted_collection.insert(bisect_left(UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							)							,    UpperCamelCase__							)






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__ = 0							,    UpperCamelCase__ = -1							)      ->       None:
    sorted_collection.insert(bisect_right(UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							)							,    UpperCamelCase__							)






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							)      ->       int | None:
    __lowerCamelCase            =    0
    __lowerCamelCase            =    len(UpperCamelCase__							) - 1

    while left <= right:
        __lowerCamelCase            =    left + (right - left) // 2
        __lowerCamelCase            =    sorted_collection[midpoint]
        if current_item == item:
            return midpoint
        elif item < current_item:
            __lowerCamelCase            =    midpoint - 1
        else:
            __lowerCamelCase            =    midpoint + 1
    return None






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							)      ->       int | None:
    __lowerCamelCase            =    bisect.bisect_left(UpperCamelCase__							,    UpperCamelCase__							)
    if index != len(UpperCamelCase__							) and sorted_collection[index] == item:
        return index
    return None






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							)      ->       int | None:
    if right < left:
        return None

    __lowerCamelCase            =    left + (right - left) // 2

    if sorted_collection[midpoint] == item:
        return midpoint
    elif sorted_collection[midpoint] > item:
        return binary_search_by_recursion(UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    midpoint - 1							)
    else:
        return binary_search_by_recursion(UpperCamelCase__							,    UpperCamelCase__							,    midpoint + 1							,    UpperCamelCase__							)


if __name__ == "__main__":
  __UpperCAmelCase					=input("Enter numbers separated by comma:\n").strip()
  __UpperCAmelCase					=sorted(int(item) for item in user_input.split(","))
  __UpperCAmelCase					=int(input("Enter a single number to be found in the list:\n"))
  __UpperCAmelCase					=binary_search(collection, target)
  if result is None:
    print(f'{target} was not found in {collection}.')
  else:
    print(f'{target} was found at position {result} in {collection}.')

'''simple docstring'''




import re

from flax.core.frozen_dict import freeze
from flax.traverse_util import flatten_dict, unflatten_dict
from jax.experimental import PartitionSpec as P


# Sentinels
__UpperCAmelCase					=object()

# For specifying empty leaf dict `{}`
__UpperCAmelCase					=object()






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							)      ->       List[Any]:
    __lowerCamelCase            =    tuple((re.compile(x + '''$'''							) for x in qs)							)
    for i in range(len(UpperCamelCase__							) - len(UpperCamelCase__							) + 1							):
        __lowerCamelCase            =    [x.match(UpperCamelCase__							) for x, y in zip(UpperCamelCase__							,    ks[i:]							)]
        if matches and all(UpperCamelCase__							):
            return True
    return False






def __lowerCAmelCase					(				UpperCamelCase__							)      ->       Optional[int]:
    def replace(UpperCamelCase__							,    UpperCamelCase__							):
        for rule, replacement in rules:
            if _match(UpperCamelCase__							,    UpperCamelCase__							):
                return replacement
        return val

    return replace






def __lowerCAmelCase					(				)      ->       Dict:
    return [
        # embeddings
        (("transformer", "wpe", "embedding"), P('''mp'''							,    UpperCamelCase__							)),
        (("transformer", "wte", "embedding"), P('''mp'''							,    UpperCamelCase__							)),
        # atention
        (("attention", "(q_proj|k_proj|v_proj)", "kernel"), P(UpperCamelCase__							,    '''mp'''							)),
        (("attention", "out_proj", "kernel"), P('''mp'''							,    UpperCamelCase__							)),
        (("attention", "out_proj", "bias"), None),
        # mlp
        (("mlp", "c_fc", "kernel"), P(UpperCamelCase__							,    '''mp'''							)),
        (("mlp", "c_fc", "bias"), P('''mp'''							)),
        (("mlp", "c_proj", "kernel"), P('''mp'''							,    UpperCamelCase__							)),
        (("mlp", "c_proj", "bias"), None),
        # layer norms
        ((r"ln_\d+", "bias"), None),
        ((r"\d+", r"ln_\d+", "scale"), None),
        (("ln_f", "bias"), None),
        (("ln_f", "scale"), None),
    ]






def __lowerCAmelCase					(				UpperCamelCase__							)      ->       int:
    __lowerCamelCase            =    _get_partition_rules()
    __lowerCamelCase            =    _replacement_rules(UpperCamelCase__							)
    __lowerCamelCase            =    {k: _unmatched for k in flatten_dict(UpperCamelCase__							)}
    __lowerCamelCase            =    {k: replace(UpperCamelCase__							,    UpperCamelCase__							) for k, v in initd.items()}
    assert _unmatched not in result.values(), "Incomplete partition spec."
    return freeze(unflatten_dict(UpperCamelCase__							)							)
