code: def _schedule(self) -> SchedulerOutputs:
      # Fix the current time.
      now = time.monotonic()
      ignored_seq_groups: List[SequenceGroup] = []
      scheduled: List[SequenceGroup] = []
      finished_seqs: List[int] = self.cleaned.copy()
      self.cleaned = []
      # The total number of sequences on the fly, including the
      # requests in the generation phase.
      num_curr_seqs = sum(
          seq_group.get_max_num_running_seqs()
          for seq_group in self.running
      )
      num_batched_tokens = 0
      # logger.info(f"swap: {self.swapped}, wait: {self.waiting}, run: {self.running}")
  
      if not self.swapped:
          # We restrict how many requests that can be run using these three arguments
          # Co(gc): If there are waiting requests, we will just try to add it into the
          # running state if not exceeds the stage
          # Co(gc): Record seq_len for prefill requests
          seq_lens = []
          # Co(gc): prefilled requests are prioritized over decoding stage requests
          while self.waiting:
              seq_group = self.waiting[0]
  
              invalidInputError(
                  seq_group.num_seqs() == 1,
                  "Waiting sequence group should have only one prompt "
                  "sequence.",
              )
              num_prompt_tokens = seq_group.get_seqs()[0].get_len()
              if num_prompt_tokens > self.prompt_limit:
                  logger.warning(
                      f"Input prompt ({num_prompt_tokens} tokens) is too long"
                      f" and exceeds limit of {self.prompt_limit}"
                  )
                  for seq in seq_group.get_seqs():
                      seq.status = SequenceStatus.FINISHED_IGNORED
                  ignored_seq_groups.append(seq_group)
                  self.waiting.pop(0)
                  continue
  
              # bigdl-llm change start
              # summary: removing block_manager related logic.
              # TODO(gc): If you can manage to make block_manager work,
              #  then this will be fine.
              # If the sequence group cannot be allocated, stop.
              # if not self.block_manager.can_allocate(seq_group):
              #     break
              # bigdl-llm change end
  
              # If the number of batched tokens exceeds the limit, stop.
              new_seq_lens = seq_lens + [num_prompt_tokens]
              num_batched_tokens = len(new_seq_lens) * max(new_seq_lens)
              if (
                  num_batched_tokens
                  > self.scheduler_config.max_num_batched_tokens
              ):
                  break
  
              # The total number of sequences in the RUNNING state should not
              # exceed the maximum number of sequences.
              num_new_seqs = seq_group.get_max_num_running_seqs()
              if (
                  num_curr_seqs + num_new_seqs
                  > self.scheduler_config.max_num_seqs
              ):
                  break
  
              seq_group = self.waiting.pop(0)
              for seq in seq_group.get_seqs():
                  seq.status = SequenceStatus.RUNNING
              # Co(gc): Only updated the seq_lens when all check passes
              seq_lens = new_seq_lens
              # bigdl-llm change start
              # summary: removing block_manager related logic.
              # self._allocate(seq_group)
              # bigdl-llm change end
              self.running.append(seq_group)
              num_batched_tokens += num_prompt_tokens
              num_curr_seqs += num_new_seqs
              scheduled.append(seq_group)
  
          if scheduled or ignored_seq_groups:
              scheduler_outputs = SchedulerOutputs(
                  scheduled_seq_groups=scheduled,
                  prompt_run=True,
                  num_batched_tokens=len(seq_lens) * max(seq_lens)
                  if seq_lens
                  else 0,
                  ignored_seq_groups=ignored_seq_groups,
                  finished_seqs=finished_seqs,
              )
              return scheduler_outputs
  
      # Now consider all the requests in decoding stage
      self.running = self.policy.sort_by_priority(now, self.running)
  
      # Reserve new token slots for the running sequence groups.
      running: List[SequenceGroup] = []
      preempted: List[SequenceGroup] = []
      while self.running:
          seq_group = self.running.pop(0)
          # while self.seq_ability < 0:
          #     if self.running:
          #         # Preempt the lowest-priority sequence groups.
          #         victim_seq_group = self.running.pop(-1)
          #         self._preempt(victim_seq_group)
          #         preempted.append(victim_seq_group)
          #     else:
          #         # No other sequence groups can be preempted.
          #         # Preempt the current sequence group.
          #         self._preempt(seq_group)
          #         preempted.append(seq_group)
          #         break
          # else:
          #     # Append new slots to the sequence group.
          #     # self._append_slot(seq_group, blocks_to_copy)
          running.append(seq_group)
      self.running = running
  
      # TODO (txy): inplement below methods
      # # Swap in the sequence groups in the SWAPPED state if possible.
      # self.swapped = self.policy.sort_by_priority(now, self.swapped)
      # if not preempted:
      #     num_curr_seqs = sum(seq_group.get_max_num_running_seqs()
      #                         for seq_group in self.running)
  
      #     while self.swapped:
      #         seq_group = self.swapped[0]
      #         # If the sequence group cannot be swapped in, stop.
      #         # if not self.block_manager.can_swap_in(seq_group):
      #         #     break
      #         if self.seq_ability <= 0:
      #             break
  
      #         # The total number of sequences in the RUNNING state should not
      #         # exceed the maximum number of sequences.
      #         num_new_seqs = seq_group.get_max_num_running_seqs()
      #         if (num_curr_seqs + num_new_seqs >
      #                 self.scheduler_config.max_num_seqs):
      #             break
  
      #         seq_group = self.swapped.pop(0)
      #         # self._swap_in(seq_group, blocks_to_swap_in)
      #         # self._append_slot(seq_group, blocks_to_copy)
      #         num_curr_seqs += num_new_seqs
      #         self.running.append(seq_group)
  
      # Each sequence in the generation phase only takes one token slot.
      # Therefore, the number of batched tokens is equal to the number of
      # sequences in the RUNNING state.
      num_batched_tokens = sum(
          seq_group.num_seqs(status=SequenceStatus.RUNNING)
          for seq_group in self.running
      )
  
      scheduler_outputs = SchedulerOutputs(
          scheduled_seq_groups=self.running,
          prompt_run=False,
          num_batched_tokens=num_batched_tokens,
          ignored_seq_groups=[],
          finished_seqs=finished_seqs,
      )
      return scheduler_outputs
  
imports: import enum
  import time
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  from bigdl.llm.vllm.config import SchedulerConfig
  from bigdl.llm.vllm.core.policy import PolicyFactory
  from bigdl.llm.vllm.logger import init_logger
  from bigdl.llm.vllm.sequence import SequenceData, SequenceStatus
  from bigdl.llm.vllm.sequence import Sequence, SequenceGroup, SequenceGroupMetadata
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 6 for calling the FixedWindowScheduler obj's underlying member method code with example usage: obj._schedule() and returns: scheduler_outputs, scheduler_outputs