code: def test_xy_dim(self, xyz_levels: XYZ_Levels, xy_dim: int) -> None:
      x, y, z, levels = xyz_levels
      if xy_dim == 0:
          x = y = None
      elif xy_dim == 2:
          x, y = np.meshgrid(x, y)
  
      data = contour_data(x, y, z, levels)
      fill, line = data.fill_data, data.line_data
  
      assert isinstance(fill, FillData)
      assert np.allclose(fill.lower_levels, [-0.5, 1.5])
      assert np.allclose(fill.upper_levels, [1.5, 3.5])
      assert len(fill.xs) == 2
      assert len(fill.ys) == 2
      assert np.allclose(fill.xs[0], [0, 1, 1.5, 1, 0.5, 0, 0])
      assert np.allclose(fill.ys[0], [0, 0, 0, 0.5, 1, 1, 0])
      assert np.allclose(fill.xs[1], [0.5, 1, 1.5, 2, 2, 1, 0.5])
      assert np.allclose(fill.ys[1], [1, 0.5, 0, 0, 1, 1, 1])
  
      assert isinstance(line, LineData)
      assert np.allclose(line.levels, [-0.5, 1.5, 3.5])
      assert len(line.xs) == 3
      assert len(line.ys) == 3
      assert np.allclose(line.xs[0], [])
      assert np.allclose(line.ys[0], [])
      assert np.allclose(line.xs[1], [0.5, 1, 1.5])
      assert np.allclose(line.ys[1], [1, 0.5, 0])
      assert np.allclose(line.xs[2], [])
      assert np.allclose(line.ys[2], [])
  
imports: from __future__ import annotations
  import pytest
  from typing import TYPE_CHECKING
  import numpy
  from bokeh.plotting.contour import FillData, LineData, contour_data, from_contour
label_desc: Use image node_id 1 for calling the Test_contour_data obj's underlying member method code with example usage: obj.test_xy_dim(xyz_levels, xy_dim) without return types