code: def test_from_invalid_dim():
      # TODO(shapely-2.0) better error message?
      # pytest.raises(ValueError, match="at least 2 coordinate tuples|at least 2 coordinates"):
      with pytest.raises(shapely.GEOSException):
          LineString([(1, 2)])
  
      # exact error depends on numpy version
      with pytest.raises((ValueError, TypeError)):
          LineString([(1, 2, 3), (4, 5)])
  
      with pytest.raises((ValueError, TypeError)):
          LineString([(1, 2), (3, 4, 5)])
  
      msg = r"The ordinate \(last\) dimension should be 2 or 3, got {}"
      with pytest.raises(ValueError, match=msg.format(4)):
          LineString([(1, 2, 3, 4), (4, 5, 6, 7)])
  
      with pytest.raises(ValueError, match=msg.format(1)):
          LineString([(1,), (4,)])
  
imports: import numpy
  import pytest
  import shapely
  from shapely import LinearRing, LineString, Point
  from shapely.coords import CoordinateSequence
label_desc: Use image node_id 13 for calling a global function with example usage: test_from_invalid_dim() without return types