docstr: Check if we match 'dtype'.
  
  Parameters
  ----------
  dtype : object
      The object to check.
  
  Returns
  -------
  is_dtype : bool
  
  Notes
  -----
  The default implementation is True if
  
  1. ``cls.construct_from_string(dtype)`` is an instance
     of ``cls``.
  2. ``dtype`` is an object and is an instance of ``cls``
  3. ``dtype`` has a ``dtype`` attribute, and any of the above
     conditions is true for ``dtype.dtype``.
docstr_tok: ["Check","if","we","match","'dtype","'",".","Parameters","--","--","--","--","--","dtype",":","object","The","object","to","check",".","Returns","--","--","--","-","is_dtype",":","bool","Notes","--","--","-","The","default","implementation","is","True","if","1",".","``","cls.construct_from_string","(","dtype",")","``","is","an","instance","of","``","cls","``",".","2",".","``","dtype","``","is","an","object","and","is","an","instance","of","``","cls","``","3",".","``","dtype","``","has","a","``","dtype","``","attribute",",","and","any","of","the","above","conditions","is","true","for","``","dtype.dtype","``","."]
code: def is_dtype(cls, dtype):
      """Check if we match 'dtype'.
  
      Parameters
      ----------
      dtype : object
          The object to check.
  
      Returns
      -------
      is_dtype : bool
  
      Notes
      -----
      The default implementation is True if
  
      1. ``cls.construct_from_string(dtype)`` is an instance
         of ``cls``.
      2. ``dtype`` is an object and is an instance of ``cls``
      3. ``dtype`` has a ``dtype`` attribute, and any of the above
         conditions is true for ``dtype.dtype``.
      """
      dtype = getattr(dtype, "dtype", dtype)
  
      if isinstance(
          dtype, (ABCSeries, ABCIndexClass, ABCDataFrame, np.dtype)
      ):
          # https://github.com/pandas-dev/pandas/issues/22960
          # avoid passing data to `construct_from_string`. This could
          # cause a FutureWarning from numpy about failing elementwise
          # comparison from, e.g., comparing DataFrame == 'category'.
          return False
      elif dtype is None:
          return False
      elif isinstance(dtype, cls):
          return True
      try:
          return cls.construct_from_string(dtype) is not None
      except TypeError:
          return False
  
imports: import numpy
  from pandas.errors import AbstractMethodError
  from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
  from pandas import compat
label_desc: Use image node_id 5 for calling the _DtypeOpsMixin obj's underlying member method code with example usage: obj.is_dtype(cls, dtype) and returns: False, unknown, False, False, True