code: def test_exception(self, batch_size, device, dtype, cdtype):
      with pytest.raises(ValueError):
          z = torch.randn(batch_size, 2, dtype=cdtype, device=device)
          assert So2(z)
      with pytest.raises(TypeError):
          assert So2.identity(1, device, dtype) * [1.0, 2.0, 1.0]
      with pytest.raises(ValueError):
          theta = torch.rand((2, 2), dtype=dtype, device=device)
          assert So2.exp(theta)
      with pytest.raises(ValueError):
          theta = torch.rand((2, 2), dtype=dtype, device=device)
          assert So2.hat(theta)
      with pytest.raises(ValueError):
          m = torch.rand((2, 2, 1), dtype=dtype, device=device)
          assert So2.from_matrix(m)
      with pytest.raises(ValueError):
          m = torch.rand((2, 2, 1), dtype=dtype, device=device)
          assert So2.from_matrix(m)
      with pytest.raises(Exception):
          assert So2.identity(batch_size=0)
  
imports: import pytest
  import torch
  from kornia.geometry.liegroup import So2
  from kornia.geometry.vector import Vector2
  from kornia.testing import BaseTester
label_desc: Use image node_id 5 for calling the TestSo2 obj's underlying member method code with example usage: obj.test_exception(batch_size, device, dtype, cdtype) without return types