from __future__ import annotations





def     UpperCAmelCase						(   lowercase							,      lowercase							):







				"""simple docstring"""



				__lowercase      ,					__lowercase			      =							0, len(lowercase							) - 1
				while start_ind <= end_ind:
								if array[start_ind] == search_item:
												return start_ind
								elif array[end_ind] == search_item:
												return end_ind
								else:
												start_ind += 1
												end_ind -= 1
    # returns -1 if search_item is not found in array
				return -1


if __name__ == "__main__":
		print(double_linear_search(list(range(1_0_0)), 4_0))
from typing import TypeVar

from .arrow_dataset import Dataset, _split_by_node_map_style_dataset
from .iterable_dataset import IterableDataset, _split_by_node_iterable_dataset


__a  :					Union[str, Any]          =  TypeVar("""DatasetType""", Dataset, IterableDataset)





def     UpperCAmelCase						(   lowercase							,      lowercase							,      lowercase							):







				"""simple docstring"""



				if isinstance(lowercase							,      lowercase							):
								return _split_by_node_map_style_dataset(lowercase							,      rank=lowercase							,      world_size=lowercase							)
				else:
								return _split_by_node_iterable_dataset(lowercase							,      rank=lowercase							,      world_size=lowercase							)