code: def test_series_initializer(setup):
      # from tensor
      raw = np.random.rand(100)
      tensor = mt.tensor(raw, chunk_size=7)
      r = md.Series(tensor)
      result = r.execute().fetch()
      pd.testing.assert_series_equal(result, pd.Series(raw))
  
      r = md.Series(tensor, chunk_size=13)
      result = r.execute().fetch()
      pd.testing.assert_series_equal(result, pd.Series(raw))
  
      # from index
      raw = np.arange(100)
      np.random.shuffle(raw)
      raw = pd.Index(raw, name="idx_name")
      idx = md.Index(raw, chunk_size=7)
      r = md.Series(idx)
      result = r.execute().fetch()
      pd.testing.assert_series_equal(result, pd.Series(raw))
  
      # from Mars series
      raw = pd.Series(np.random.rand(100), name="series_name")
      ms = md.Series(raw, chunk_size=15) * 2
      r = md.Series(ms, num_partitions=11)
      result = r.execute().fetch()
      pd.testing.assert_series_equal(result, raw * 2)
  
      # from raw pandas initializer
      raw = pd.Series(np.random.rand(100), name="series_name")
      r = md.Series(raw, num_partitions=10)
      result = r.execute().fetch()
      pd.testing.assert_series_equal(result, raw)
  
      # test check instance
      r = r * 2
      assert isinstance(r, md.Series)
  
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 3 for calling a global function with example usage: test_series_initializer(setup) without return types