
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE__     :    Optional[int]      							=					{
    "configuration_decision_transformer": [
        "DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "DecisionTransformerConfig",
    ],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__     :    int      							=					[
					    "DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "DecisionTransformerGPT2Model",
					    "DecisionTransformerGPT2PreTrainedModel",
					    "DecisionTransformerModel",
					    "DecisionTransformerPreTrainedModel",
					]


if TYPE_CHECKING:
					from .configuration_decision_transformer import (
					    DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    DecisionTransformerConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_decision_transformer import (
										    DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    DecisionTransformerGPTaModel,
										    DecisionTransformerGPTaPreTrainedModel,
										    DecisionTransformerModel,
										    DecisionTransformerPreTrainedModel,
										)


else:
					import sys

					SCREAMING_SNAKE_CASE__     :    List[Any]      							=					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





def 				__magic_name__				(     __lowerCAmelCase			:		list	,						__lowerCAmelCase			:		int	,						__lowerCAmelCase			:		int	,						__lowerCAmelCase			:		int							)    ->     int:
				__lowerCamelCase					      =			int((lower_bound + upper_bound) // 2							)
				if array[r] == value:
								return r
				if lower_bound >= upper_bound:
								return -1
				if array[r] < value:
								return binary_search(__lowerCAmelCase	,						r + 1	,						__lowerCAmelCase	,						__lowerCAmelCase							)
				else:
								return binary_search(__lowerCAmelCase	,						__lowerCAmelCase	,						r - 1	,						__lowerCAmelCase							)




def 				__magic_name__				(     __lowerCAmelCase			:		int	,						__lowerCAmelCase			:		list							)    ->     list:
				__lowerCamelCase					      =			0
				if matrix[index][0] == value:
								return [index, 0]
				while index < len(__lowerCAmelCase							) and matrix[index][0] < value:
								__lowerCamelCase					      =			binary_search(matrix[index]	,						0	,						len(matrix[index]							) - 1	,						__lowerCAmelCase							)
								if r != -1:
												return [index, r]
								index += 1
				return [-1, -1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()



