code: def test_from_tuples():
      msg = "Cannot infer number of levels from empty list"
      with pytest.raises(TypeError, match=msg):
          MultiIndex.from_tuples([])
  
      expected = MultiIndex(
          levels=[[1, 3], [2, 4]],
          codes=[[0, 1], [0, 1]],
          names=["a", "b"],
      )
  
      # input tuples
      result = MultiIndex.from_tuples(
          ((1, 2), (3, 4)), names=["a", "b"]
      )
      tm.assert_index_equal(result, expected)
  
imports: from datetime import date, datetime
  import itertools
  import numpy
  import pytest
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
  import pandas
  from pandas import Index, MultiIndex, Series, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 17 for calling a global function with example usage: test_from_tuples() without return types