code: def test_infer_vegalite_type():
      def _check(arr, typ):
          assert infer_vegalite_type(arr) == typ
  
      _check(np.arange(5, dtype=float), "quantitative")
      _check(np.arange(5, dtype=int), "quantitative")
      _check(np.zeros(5, dtype=bool), "nominal")
      _check(pd.date_range("2012", "2013"), "temporal")
      _check(pd.timedelta_range(365, periods=12), "temporal")
  
      nulled = pd.Series(np.random.randint(10, size=10))
      nulled[0] = None
      _check(nulled, "quantitative")
      _check(["a", "b", "c"], "nominal")
  
      if hasattr(pytest, "warns"):  # added in pytest 2.8
          with pytest.warns(UserWarning):
              _check([], "nominal")
      else:
          with warnings.catch_warnings():
              warnings.filterwarnings("ignore")
              _check([], "nominal")
  
file_path: altair/tests/utils/test_utils.py
imports: import io
  import json
  import warnings
  import numpy
  import pandas
  import pytest
  from altair.utils import infer_vegalite_type, sanitize_dataframe
label_desc: Use image node_id 1 for calling a global function with example usage: test_infer_vegalite_type() without return types