code: def set_context_window(self):
      def num_tokens(idx):
          if idx == -1:
              return (
                  0
                  if self.fixed_prompt.empty
                  else self.fixed_prompt.num_tokens()
              )
          return self.history[idx].num_tokens()
  
      def set_truncation(idx, trunc):
          if idx == -1 and not self.fixed_prompt.empty:
              self.fixed_prompt.truncate = trunc
          else:
              self.history[idx].truncate = trunc
  
      def truncate(idx, trunc):
          if idx == -1 and not self.fixed_prompt.empty:
              self.fixed_prompt.truncate += trunc
          else:
              self.history[idx].truncate += trunc
  
      # def get_truncation(idx, trunc):
      #     if idx == -1 and not self.fixed_prompt.empty: return self.fixed_prompt.truncate
      #     return self.history[idx].truncate
  
      context_step_size = 256  # TODO: Config option
      max_context_tokens = (
          model.config.max_seq_len
          - self.chunk_size
          - generator.settings.beam_length
      )
      min_context_tokens = max_context_tokens - context_step_size * 2
  
      if self.keep_fixed_prompt:
          current_context_tokens = num_tokens(-1)
          min_history_idx = 0
      else:
          current_context_tokens = 0
          min_history_idx = -1
  
      if self.first_history_idx < min_history_idx:
          self.first_history_idx = min_history_idx
  
      for i in range(self.first_history_idx + 1, len(self.history)):
          set_truncation(i, 0)
  
      for i in range(self.first_history_idx, len(self.history)):
          current_context_tokens += num_tokens(i)
  
      while current_context_tokens > max_context_tokens:
          tokens_to_cut = context_step_size
          while tokens_to_cut > 0:
              tokens = num_tokens(self.first_history_idx)
              if tokens_to_cut >= tokens:
                  tokens_to_cut -= tokens
                  current_context_tokens -= tokens
                  self.first_history_idx += 1
              else:
                  truncate(self.first_history_idx, tokens_to_cut)
                  current_context_tokens -= tokens_to_cut
                  tokens_to_cut = 0
  
imports: from model import ExLlama, ExLlamaCache, ExLlamaConfig
  from tokenizer import ExLlamaTokenizer
  from generator import ExLlamaGenerator
  import time
  import torch
  import os
  import json
  import uuid
label_desc: Use image node_id 13 for calling the Session obj's underlying member method code with example usage: obj.set_context_window() and returns: self, unknown