class_docstr: The implementation of InternalWindowProcessFunction for MergingWindowAssigner.
class_docstr_tok: ["The","implementation","of","InternalWindowProcessFunction","for","MergingWindowAssigner","."]
code: def clean_window_if_needed(self, window: W, current_time: int):
      if self.is_cleanup_time(window, current_time):
          self._ctx.clear_trigger(window)
          state_window = self._window_mapping.get(window)
          self._ctx.clear_window_state(state_window)
          # retire expired window
          self._initialize_cache(self._ctx.current_key())
          self._window_mapping.remove(window)
          self._sorted_windows.remove(window)
  
imports: from abc import abstractmethod, ABC
  from typing import Generic, List, Iterable, Dict, Set
  from pyflink.common import Row
  from pyflink.common.constants import MAX_LONG_VALUE
  from pyflink.datastream.state import MapState
  from pyflink.fn_execution.table.window_assigner import WindowAssigner, PanedWindowAssigner, MergingWindowAssigner
  from pyflink.fn_execution.table.window_context import Context, K, W
label_desc: Use image node_id 6 for calling the MergingWindowProcessFunction obj's underlying member method code with example usage: obj.clean_window_if_needed(window, current_time) without return types