code: 
  
  
  
  
  
  
  """simple docstring"""
  import enum
  import inspect
  from typing import Iterable, List, Optional, Tuple, Union
  
  
  
  class 					UpperCamelCase__   (							enum.Enum):
  
  
  
  
  
  
  
      """simple docstring"""
      __UpperCAmelCase											=   """timm"""
      __UpperCAmelCase											=   """transformers"""
  
  
  def        A	(							__snake_case:   Optional[Iterable[str]]   ,    __snake_case:   Optional[Iterable[int]]   ,    __snake_case:   Optional[Iterable[str]]     )						->		Optional[Any]:
  
         """simple docstring"""
  
  
  
  
  
         if stage_names is None:
                raise ValueError('Stage_names must be set for transformers backbones'     )
  
         if out_features is not None:
                if not isinstance(__snake_case   ,    (list,)     ):
                       raise ValueError(F"""out_features must be a list {type(__snake_case     )}"""     )
                if any(feat not in stage_names for feat in out_features     ):
                       raise ValueError(F"""out_features must be a subset of stage_names: {stage_names} got {out_features}"""     )
  
         if out_indices is not None:
                if not isinstance(__snake_case   ,    (list, tuple)     ):
                       raise ValueError(F"""out_indices must be a list or tuple, got {type(__snake_case     )}"""     )
                if any(idx >= len(__snake_case     ) for idx in out_indices     ):
                       raise ValueError('out_indices must be valid indices for stage_names {stage_names}, got {out_indices}'     )
  
         if out_features is not None and out_indices is not None:
                if len(__snake_case     ) != len(__snake_case     ):
                       raise ValueError('out_features and out_indices should have the same length if both are set'     )
                if out_features != [stage_names[idx] for idx in out_indices]:
                       raise ValueError('out_features and out_indices should correspond to the same stages if both are set'     )
  
  
  def        A	(							__snake_case:   Optional[List[str]]   ,    __snake_case:   Optional[Union[List[int], Tuple[int]]]   ,    __snake_case:   List[str]   ,    )						->		int:
  
         """simple docstring"""
  
  
  
  
  
         if out_indices is None and out_features is None:
                __magic_name__										=						[len(__snake_case     ) - 1]
                __magic_name__										=						[stage_names[-1]]
         elif out_indices is None and out_features is not None:
                __magic_name__										=						[stage_names.index(__snake_case     ) for layer in out_features]
         elif out_features is None and out_indices is not None:
                __magic_name__										=						[stage_names[idx] for idx in out_indices]
         return out_features, out_indices
  
  
  def        A	(							__snake_case:   Optional[List[str]]   ,    __snake_case:   Optional[Union[List[int], Tuple[int]]]   ,    __snake_case:   List[str]   ,    )						->		Tuple[List[str], List[int]]:
  
         """simple docstring"""
  
  
  
  
  
         verify_out_features_out_indices(out_features=__snake_case   ,    out_indices=__snake_case   ,    stage_names=__snake_case     )
         __magic_name__							,     __magic_name__										=						_align_output_features_output_indices(
             out_features=__snake_case   ,    out_indices=__snake_case   ,    stage_names=__snake_case     )
         # Verify that the aligned out_features and out_indices are valid
         verify_out_features_out_indices(out_features=__snake_case   ,    out_indices=__snake_case   ,    stage_names=__snake_case     )
         return output_features, output_indices
  
  
  
  class 					UpperCamelCase__   :
  
  
  
  
  
  
  
      """simple docstring"""
      __UpperCAmelCase											=   None
  
  
  
  
  
  
  
      def 							a__ (		self   :  int							,						UpperCamelCase_   :  List[Any]   ):
  
  
  
  
  
             '''simple docstring'''
  
             if getattr(self							,						'_backbone'							,						UpperCamelCase_   ) is None:
                    raise ValueError('self._backbone must be set before calling _init_timm_backbone'   )
  
             # These will diagree with the defaults for the transformers models e.g. for resnet50
             # the transformer model has out_features = ['stem', 'stage1', 'stage2', 'stage3', 'stage4']
             # the timm model has out_features = ['act', 'layer1', 'layer2', 'layer3', 'layer4']
             __magic_name__										=						[stage['module'] for stage in self._backbone.feature_info.info]
             __magic_name__										=						[stage['num_chs'] for stage in self._backbone.feature_info.info]
             __magic_name__										=						self._backbone.feature_info.out_indices
             __magic_name__										=						self._backbone.feature_info.module_name()
  
             # We verify the out indices and out features are valid
             verify_out_features_out_indices(
                 out_features=UpperCamelCase_							,						out_indices=UpperCamelCase_							,						stage_names=self.stage_names   )
             __magic_name__							,     __magic_name__										=						out_features, out_indices
  
  
  
  
  
  
  
      def 							a__ (		self   :  int							,						UpperCamelCase_   :  Dict   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__										=						getattr(UpperCamelCase_							,						'stage_names'   )
             __magic_name__										=						getattr(UpperCamelCase_							,						'out_features'							,						UpperCamelCase_   )
             __magic_name__										=						getattr(UpperCamelCase_							,						'out_indices'							,						UpperCamelCase_   )
  
             __magic_name__										=						stage_names
             __magic_name__							,     __magic_name__										=						get_aligned_output_features_output_indices(
                 out_features=UpperCamelCase_							,						out_indices=UpperCamelCase_							,						stage_names=UpperCamelCase_   )
             # Number of channels for each stage. This is set in the transformer backbone model init
             __magic_name__										=						None
  
  
  
  
  
  
  
      def 							a__ (		self   :  List[Any]							,						UpperCamelCase_   :  Union[str, Any]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__										=						config
  
             __magic_name__										=						getattr(UpperCamelCase_							,						'use_timm_backbone'							,						UpperCamelCase_   )
             __magic_name__										=						BackboneType.TIMM if self.use_timm_backbone else BackboneType.TRANSFORMERS
  
             if self.backbone_type == BackboneType.TIMM:
                    self._init_timm_backbone(UpperCamelCase_   )
             elif self.backbone_type == BackboneType.TRANSFORMERS:
                    self._init_transformers_backbone(UpperCamelCase_   )
             else:
                    raise ValueError(f"""backbone_type {self.backbone_type} not supported."""   )
  
  
  
  
  
  
  
      @property
      def 							a__ (		self   :  Any   ):
  
  
  
  
  
             '''simple docstring'''
  
             return self._out_features
  
  
  
  
  
  
  
      @out_features.setter
      def 							a__ (		self   :  Dict							,						UpperCamelCase_   :  List[str]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__							,     __magic_name__										=						get_aligned_output_features_output_indices(
                 out_features=UpperCamelCase_							,						out_indices=UpperCamelCase_							,						stage_names=self.stage_names   )
  
  
  
  
  
  
  
      @property
      def 							a__ (		self   :  List[Any]   ):
  
  
  
  
  
             '''simple docstring'''
  
             return self._out_indices
  
  
  
  
  
  
  
      @out_indices.setter
      def 							a__ (		self   :  List[str]							,						UpperCamelCase_   :  Union[Tuple[int], List[int]]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__							,     __magic_name__										=						get_aligned_output_features_output_indices(
                 out_features=UpperCamelCase_							,						out_indices=UpperCamelCase_							,						stage_names=self.stage_names   )
  
  
  
  
  
  
  
      @property
      def 							a__ (		self   :  Optional[Any]   ):
  
  
  
  
  
             '''simple docstring'''
  
             return {stage: self.num_features[i] for i, stage in enumerate(self.stage_names   )}
  
  
  
  
  
  
  
      @property
      def 							a__ (		self   :  Tuple   ):
  
  
  
  
  
             '''simple docstring'''
  
             return [self.out_feature_channels[name] for name in self.out_features]
  
  
  
  
  
  
  
      def 							a__ (		self   :  Union[str, Any]							,						*UpperCamelCase_   :  Optional[int]							,						**UpperCamelCase_   :  Union[str, Any]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__										=						dict(inspect.signature(self.forward   ).parameters   )
             __magic_name__										=						{k: v for k, v in kwargs.items() if k in signature}
             return self(*UpperCamelCase_							,						**UpperCamelCase_   )
  
  
  
  
  
  
  
      def 							a__ (		self   :  Optional[Any]							,						UpperCamelCase_   :  Tuple							,						UpperCamelCase_   :  Optional[bool] = None							,						UpperCamelCase_   :  Optional[bool] = None							,						UpperCamelCase_   :  Optional[bool] = None							,						):
  
  
  
  
  
             '''simple docstring'''
  
             raise NotImplementedError('This method should be implemented by the derived class.'   )
  
  
  
  
  
  
  
      def 							a__ (		self   :  Tuple   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__										=						super().to_dict()
             __magic_name__										=						output.pop('_out_features'   )
             __magic_name__										=						output.pop('_out_indices'   )
             return output
  
  
  
  class 					UpperCamelCase__   :
  
  
  
  
  
  
  
      """simple docstring"""
  
  
  
  
  
  
  
      @property
      def 							a__ (		self   :  Optional[int]   ):
  
  
  
  
  
             '''simple docstring'''
  
             return self._out_features
  
  
  
  
  
  
  
      @out_features.setter
      def 							a__ (		self   :  List[Any]							,						UpperCamelCase_   :  List[str]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__							,     __magic_name__										=						get_aligned_output_features_output_indices(
                 out_features=UpperCamelCase_							,						out_indices=UpperCamelCase_							,						stage_names=self.stage_names   )
  
  
  
  
  
  
  
      @property
      def 							a__ (		self   :  Tuple   ):
  
  
  
  
  
             '''simple docstring'''
  
             return self._out_indices
  
  
  
  
  
  
  
      @out_indices.setter
      def 							a__ (		self   :  int							,						UpperCamelCase_   :  Union[Tuple[int], List[int]]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__							,     __magic_name__										=						get_aligned_output_features_output_indices(
                 out_features=UpperCamelCase_							,						out_indices=UpperCamelCase_							,						stage_names=self.stage_names   )
  
  
  
  
  
  
  
      def 							a__ (		self   :  List[Any]   ):
  
  
  
  
  
             '''simple docstring'''
  
             __magic_name__										=						super().to_dict()
             __magic_name__										=						output.pop('_out_features'   )
             __magic_name__										=						output.pop('_out_indices'   )
             return output
style_context: 
  
  
  
  
  
  
  """simple docstring"""
  def        A	(							__snake_case:   Dict   ,    __snake_case:   Tuple     )						->		int:
  
         """simple docstring"""
  
  
  
  
  
         sequence.append(__snake_case     )
  
         __magic_name__										=						0
         while sequence[index] != target:
                index += 1
  
         sequence.pop()
  
         if index == len(__snake_case     ):
                return None
  
         return index
  
  
  if __name__ == "__main__":
   snake_case   :   Dict    		=		input("""Enter numbers separated by comma:\n""").strip()
   snake_case   :   List[str]    		=		[int(item) for item in user_input.split(""",""")]
  
   snake_case   :   Union[str, Any]    		=		input("""Enter a single number to be found in the list:\n""")
   snake_case   :   str    		=		int(target_input)
   snake_case   :   Any    		=		sentinel_linear_search(sequence, target)
   if result is not None:
    print(f"""{target} found at positions: {result}""")
   else:
    print("""Not found""")