code: def test_dataframe_initializer(setup):
      # from tensor
      raw = np.random.rand(100, 10)
      tensor = mt.tensor(raw, chunk_size=7)
      r = md.DataFrame(tensor)
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, pd.DataFrame(raw))
  
      r = md.DataFrame(tensor, chunk_size=13)
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, pd.DataFrame(raw))
  
      # from Mars dataframe
      raw = pd.DataFrame(
          np.random.rand(100, 10), columns=list("ABCDEFGHIJ")
      )
      df = md.DataFrame(raw, chunk_size=15) * 2
      r = md.DataFrame(df, num_partitions=11)
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, raw * 2)
  
      # from tileable dict
      raw_dict = {
          "C": np.random.choice(["u", "v", "w"], size=(100,)),
          "A": pd.Series(np.random.rand(100)),
          "B": np.random.randint(0, 10, size=(100,)),
      }
      m_dict = raw_dict.copy()
      m_dict["A"] = md.Series(m_dict["A"])
      m_dict["B"] = mt.tensor(m_dict["B"])
      r = md.DataFrame(m_dict, columns=list("ABC"))
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(
          result, pd.DataFrame(raw_dict, columns=list("ABC"))
      )
  
      r = md.DataFrame({"a": [mt.tensor([1, 2, 3]).sum() + 1]})
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, pd.DataFrame({"a": [7]}))
  
      # from tileable list
      raw_list = [
          np.random.choice(["u", "v", "w"], size=(3,)),
          pd.Series(np.random.rand(3)),
          np.random.randint(0, 10, size=(3,)),
      ]
      m_list = raw_list.copy()
      m_list[1] = md.Series(m_list[1])
      m_list[2] = mt.tensor(m_list[2])
      r = md.DataFrame(m_list, columns=list("ABC"))
      result = r.execute(extra_config={"check_dtypes": False}).fetch()
      pd.testing.assert_frame_equal(
          result, pd.DataFrame(raw_list, columns=list("ABC"))
      )
  
      # from raw pandas initializer
      raw = pd.DataFrame(
          np.random.rand(100, 10), columns=list("ABCDEFGHIJ")
      )
      r = md.DataFrame(raw, num_partitions=10)
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, raw)
  
      # from mars series
      raw_s = np.random.rand(100)
      s = md.Series(raw_s, chunk_size=20)
      r = md.DataFrame(s, num_partitions=10)
      result = r.execute().fetch()
      pd.testing.assert_frame_equal(result, pd.DataFrame(raw_s))
  
      # test check instance
      r = r * 2
      assert isinstance(r, md.DataFrame)
  
file_path: mars/mars/dataframe/tests/test_initializer.py
imports: import numpy
  import pandas
  from ...None import dataframe
  from ...None import tensor
  from ...tests.core import require_cudf, require_cupy
  from ...utils import lazy_import
label_desc: Use image node_id 1 for calling a global function with example usage: test_dataframe_initializer(setup) without return types