code: def get_block_type(values, dtype=None):
      
      dtype = dtype or values.dtype
      vtype = dtype.type
  
      if is_sparse(dtype):
          # Need this first(ish) so that Sparse[datetime] is sparse
          cls = ExtensionBlock
      elif is_categorical(values):
          cls = CategoricalBlock
      elif issubclass(vtype, np.datetime64):
          assert not is_datetime64tz_dtype(values)
          cls = DatetimeBlock
      elif is_datetime64tz_dtype(values):
          cls = DatetimeTZBlock
      elif is_interval_dtype(dtype) or is_period_dtype(dtype):
          cls = ObjectValuesExtensionBlock
      elif is_extension_array_dtype(values):
          cls = ExtensionBlock
      elif issubclass(vtype, np.floating):
          cls = FloatBlock
      elif issubclass(vtype, np.timedelta64):
          assert issubclass(vtype, np.integer)
          cls = TimeDeltaBlock
      elif issubclass(vtype, np.complexfloating):
          cls = ComplexBlock
      elif issubclass(vtype, np.integer):
          cls = IntBlock
      elif dtype == np.bool_:
          cls = BoolBlock
      else:
          cls = ObjectBlock
      return cls
docs: Find the appropriate Block subclass to use for the given values and dtype.
  
      Parameters
      ----------
      values : ndarray-like
      dtype : numpy or pandas dtype
  
      Returns
      -------
      cls : class, subclass of Block