code: def test_fill_and_edges(self, device, batch, fill, height, width):
      black_image = torch.zeros(batch, 3, height, width, device=device)
      # we should pass height - 1 and width - 1 but rectangle should clip correctly
      points = (
          torch.tensor([0, 0, width, height])
          .to(device)
          .expand(batch, 1, 4)
      )
  
      image_w_rectangle = draw_rectangle(
          black_image, points, color=torch.tensor([1.0]), fill=fill
      )
  
      assert image_w_rectangle is black_image
      if fill:
          assert image_w_rectangle.sum() == batch * 3 * height * width
      else:
          # corners are double counted
          assert image_w_rectangle.sum() == batch * 3 * (
              2 * height + 2 * width - 4
          )
  
imports: import math
  import pytest
  import torch
  from kornia.testing import assert_close
  from kornia.utils import create_meshgrid, draw_convex_polygon, draw_rectangle
  from kornia.utils.draw import draw_line, draw_point2d
label_desc: Use image node_id 2 for calling the TestDrawRectangle obj's underlying member method code with example usage: obj.test_fill_and_edges(device, batch, fill, height, width) without return types