code: def infer_dtype_from(val, pandas_dtype=False):
      
      if is_scalar(val):
          return infer_dtype_from_scalar(val, pandas_dtype=pandas_dtype)
      return infer_dtype_from_array(val, pandas_dtype=pandas_dtype)
docs: interpret the dtype from a scalar or array. This is a convenience
      routines to infer dtype from a scalar or an array
  
      Parameters
      ----------
      pandas_dtype : bool, default False
          whether to infer dtype including pandas extension types.
          If False, scalar/array belongs to pandas extension types is inferred as
          object