code: def state_access_demo():
      env = StreamExecutionEnvironment.get_execution_environment()
  
      ds = env.from_collection(
          collection=[
              ("Alice", 110.1),
              ("Bob", 30.2),
              ("Alice", 20.0),
              ("Bob", 53.1),
              ("Alice", 13.1),
              ("Bob", 3.1),
              ("Bob", 16.1),
              ("Alice", 20.1),
          ],
          type_info=Types.TUPLE([Types.STRING(), Types.FLOAT()]),
      )
  
      # apply the process function onto a keyed stream
      ds.key_by(lambda value: value[0]).process(Sum()).print()
  
      # submit for execution
      env.execute()
  
file_path: flink/flink-python/pyflink/examples/datastream/state_access.py
imports: from pyflink.common import Time
  from pyflink.common.typeinfo import Types
  from pyflink.datastream import StreamExecutionEnvironment
  from pyflink.datastream.functions import KeyedProcessFunction, RuntimeContext
  from pyflink.datastream.state import ValueStateDescriptor, StateTtlConfig
label_desc: Use image node_id 1 for calling a global function with example usage: state_access_demo() without return types