code: def get_window_size(x_size, window_size, shift_size=None):
      use_window_size = list(window_size)
      if shift_size is not None:
          use_shift_size = list(shift_size)
      for i in range(len(x_size)):
          if x_size[i] <= window_size[i]:
              use_window_size[i] = x_size[i]
              if shift_size is not None:
                  use_shift_size[i] = 0
  
      if shift_size is None:
          return tuple(use_window_size)
      else:
          return tuple(use_window_size), tuple(use_shift_size)
  
imports: import math
  from functools import lru_cache
  from typing import List, Optional
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from vissl.config import AttrDict
  from vissl.models.model_helpers import DropPath, rearrange, to_2tuple, trunc_normal_
  from vissl.models.trunks import register_model_trunk
label_desc: Use image node_id 4 for calling a global function with example usage: get_window_size(x_size, window_size, shift_size) and returns: tuple, tuple,  tuple