code: def validate(cls, dataset, vdims=True):
      dim_types = "key" if vdims else "all"
      geom_dims = cls.geom_dims(dataset)
      if len(geom_dims) != 2:
          raise DataError(
              "Expected %s instance to declare two key "
              "dimensions corresponding to the geometry "
              "coordinates but %d dimensions were found "
              "which did not refer to any columns."
              % (type(dataset).__name__, len(geom_dims)),
              cls,
          )
      not_found = [
          d.name
          for d in dataset.dimensions(dim_types)
          if d not in geom_dims and d.name not in dataset.data
      ]
      if not_found:
          raise DataError(
              "Supplied data does not contain specified "
              "dimensions, the following dimensions were "
              "not found: %s" % repr(not_found),
              cls,
          )
  
imports: import sys
  from collections import defaultdict
  import numpy
  import pandas
  from ..dimension import dimension_name
  from ..util import isscalar, unique_array, unique_iterator
  from .interface import DataError, Interface
  from .multipath import MultiInterface, ensure_ring
  from .pandas import PandasInterface
label_desc: Use image node_id 9 for calling the SpatialPandasInterface obj's underlying member method code with example usage: obj.validate(cls, dataset, vdims) without return types