code: 
  
  
  
  """simple docstring"""
  import math
  class 							_UpperCAmelCase							:
  
  
  
  
  
       '''simple docstring'''
  
  
  
       def __init__(      self ,			A	)							->      Optional[int]:
           _UpperCAmelCase							:						List[str]       							=					len(A	)
           _UpperCAmelCase							:						Union[str, Any]       							=					[0] * (
               4 * self.N
           )  # approximate the overall size of segment tree with array N
           self.build(1 ,			0 ,			self.N - 1	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A	)							->      Union[str, Any]:
           return idx * 2
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A	)							->      Optional[Any]:
           return idx * 2 + 1
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A ,			A ,			A	)							->      Dict:  # noqa: E741
           if l == r:
               _UpperCAmelCase							:						Tuple       							=					A[l]
           else:
               _UpperCAmelCase							:						List[Any]       							=					(l + r) // 2
               self.build(self.left(A	) ,			A ,			A	)
               self.build(self.right(A	) ,			mid + 1 ,			A	)
               _UpperCAmelCase							:						Union[str, Any]       							=					max(self.st[self.left(A	)] ,			self.st[self.right(A	)]	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A ,			A ,			A	)							->      Union[str, Any]:
           return self.update_recursive(1 ,			0 ,			self.N - 1 ,			a - 1 ,			b - 1 ,			A	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A ,			A ,			A ,			A ,			A ,			A	)							->      Any:  # noqa: E741
           if r < a or l > b:
               return True
           if l == r:
               _UpperCAmelCase							:						List[str]       							=					val
               return True
           _UpperCAmelCase							:						Tuple       							=					(l + r) // 2
           self.update_recursive(self.left(A	) ,			A ,			A ,			A ,			A ,			A	)
           self.update_recursive(self.right(A	) ,			mid + 1 ,			A ,			A ,			A ,			A	)
           _UpperCAmelCase							:						Any       							=					max(self.st[self.left(A	)] ,			self.st[self.right(A	)]	)
           return True
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A ,			A	)							->      int:
           return self.query_recursive(1 ,			0 ,			self.N - 1 ,			a - 1 ,			b - 1	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A ,			A ,			A ,			A ,			A	)							->      Optional[int]:  # noqa: E741
           if r < a or l > b:
               return -math.inf
           if l >= a and r <= b:
               return self.st[idx]
           _UpperCAmelCase							:						Optional[int]       							=					(l + r) // 2
           _UpperCAmelCase							:						Optional[int]       							=					self.query_recursive(self.left(A	) ,			A ,			A ,			A ,			A	)
           _UpperCAmelCase							:						List[Any]       							=					self.query_recursive(self.right(A	) ,			mid + 1 ,			A ,			A ,			A	)
           return max(A ,			A	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      Optional[Any]:
           _UpperCAmelCase							:						int       							=					[]
           for i in range(1 ,			N + 1	):
               show_list += [self.query(A ,			A	)]
           print(A	)
  
  
  if __name__ == "__main__":
        _lowerCAmelCase					:Dict  =      [1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
        _lowerCAmelCase					:int  =      15
        _lowerCAmelCase					:str  =      SegmentTree(A)
        print(segt.query(4, 6))
        print(segt.query(7, 11))
        print(segt.query(7, 12))
        segt.update(1, 3, 111)
        print(segt.query(1, 15))
        segt.update(7, 8, 235)
        segt.show_data()
  
  
  
style_context: 
  
  
  
  """simple docstring"""
  import os
  
  from apache_beam.io.filesystems import FileSystems
  from apache_beam.pipeline import Pipeline
  
  from .logging import get_logger
  
  
  _lowerCAmelCase					:Optional[int]  =      2 << 20  # 2mb
  _lowerCAmelCase					:Union[str, Any]  =      get_logger(__name__)
  class 							_UpperCAmelCase							(				a   ):
  
  
  
  
  
       '''simple docstring'''
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      Any:
           _UpperCAmelCase							:						str       							=					self._options.get_all_options().get('''runner'''	)
           return runner in [None, "DirectRunner", "PortableRunner"]
  
  
  
  
  
  def 				lowerCamelCase_		(UpperCamelCase__	:	List[str]  , UpperCamelCase__	:	str  , UpperCamelCase__	:	Dict=False							):
      _UpperCAmelCase							:						Union[str, Any]       							=					FileSystems
      if fs.exists(UpperCamelCase__							):
          if force_upload:
              logger.info(F'Remote path already exist: {remote_file_path}. Overwriting it as force_upload=True.'							)
          else:
              logger.info(F'Remote path already exist: {remote_file_path}. Skipping it as force_upload=False.'							)
              return
      with fs.create(UpperCamelCase__							) as remote_file:
          with open(UpperCamelCase__  , '''rb'''							) as local_file:
              _UpperCAmelCase							:						Optional[Any]       							=					local_file.read(UpperCamelCase__							)
              while chunk:
                  remote_file.write(UpperCamelCase__							)
                  _UpperCAmelCase							:						List[Any]       							=					local_file.read(UpperCamelCase__							)
  
  
  
  
  
  def 				lowerCamelCase_		(UpperCamelCase__	:	int  , UpperCamelCase__	:	Dict  , UpperCamelCase__	:	str=False							):
      _UpperCAmelCase							:						int       							=					FileSystems
      if os.path.exists(UpperCamelCase__							):
          if force_download:
              logger.info(F'Local path already exist: {remote_file_path}. Overwriting it as force_upload=True.'							)
          else:
              logger.info(F'Local path already exist: {remote_file_path}. Skipping it as force_upload=False.'							)
              return
      with fs.open(UpperCamelCase__							) as remote_file:
          with open(UpperCamelCase__  , '''wb'''							) as local_file:
              _UpperCAmelCase							:						List[str]       							=					remote_file.read(UpperCamelCase__							)
              while chunk:
                  local_file.write(UpperCamelCase__							)
                  _UpperCAmelCase							:						List[Any]       							=					remote_file.read(UpperCamelCase__							)
  
  
  