code: def get_dtype(obj) -> DtypeObj:
      if isinstance(obj, DataFrame):
          # Note: we are assuming only one column
          return obj.dtypes.iat[0]
      else:
          return obj.dtype
  
imports: from pandas._typing import DtypeObj
  from pandas import DataFrame
label_desc: Use image node_id 1 for calling a global function with example usage: get_dtype(obj) and returns: obj, obj