code: def crop(window, height, width):
      """Crops a window to given height and width.
  
      Parameters
      ----------
      window : Window.
          The input window.
      height, width : int
          The number of rows and cols in the cropped window.
  
      Returns
      -------
      Window
          A new Window object.
      """
      window = evaluate(window, height=height, width=width)
  
      row_start = min(max(window.row_off, 0), height)
      col_start = min(max(window.col_off, 0), width)
      row_stop = max(0, min(window.row_off + window.height, height))
      col_stop = max(0, min(window.col_off + window.width, width))
  
      return Window(
          col_start,
          row_start,
          col_stop - col_start,
          row_stop - row_start,
      )
  
imports: import collections
  from collections.abc import Iterable
  import functools
  import math
  import warnings
  from affine import Affine
  import attr
  import numpy
  from rasterio.errors import WindowError, RasterioDeprecationWarning
  from rasterio.transform import rowcol, guard_transform
label_desc: Use image node_id 14 for calling a global function with example usage: crop(window, height, width) and returns: Window