code: def test_memory_usage():
      dtypes = ["int64", "float64", "complex128", "object", "bool"]
      data = dict([(t, np.ones(shape=500).astype(t)) for t in dtypes])
      raw = pd.DataFrame(data)
  
      df = from_pandas_df(raw, chunk_size=(500, 2))
      r = tile(df.memory_usage())
  
      assert isinstance(r, SERIES_TYPE)
      assert r.shape == (6,)
      assert len(r.chunks) == 3
      assert r.chunks[0].op.stage is None
  
      df = from_pandas_df(raw, chunk_size=(100, 3))
      r = tile(df.memory_usage(index=True))
  
      assert isinstance(r, SERIES_TYPE)
      assert r.shape == (6,)
      assert len(r.chunks) == 2
      assert r.chunks[0].op.stage == OperandStage.reduce
  
      r = tile(df.memory_usage(index=False))
  
      assert isinstance(r, SERIES_TYPE)
      assert r.shape == (5,)
      assert len(r.chunks) == 2
      assert r.chunks[0].op.stage == OperandStage.reduce
  
      raw = pd.Series(np.ones(shape=500).astype("object"), name="s")
  
      series = from_pandas_series(raw)
      r = tile(series.memory_usage())
  
      assert isinstance(r, TENSOR_TYPE)
      assert r.shape == ()
      assert len(r.chunks) == 1
      assert r.chunks[0].op.stage is None
  
      series = from_pandas_series(raw, chunk_size=100)
      r = tile(series.memory_usage())
  
      assert isinstance(r, TENSOR_TYPE)
      assert r.shape == ()
      assert len(r.chunks) == 1
      assert r.chunks[0].op.stage == OperandStage.reduce
  
imports: from typing import List, Union
  import numpy
  import pandas
  import pytest
  from ....None import opcodes
  from ....config import options, option_context
  from ....core import OutputType, tile, Tileable
  from ....core.graph import TileableGraph, TileableGraphBuilder, TileContext, ChunkGraphBuilder
  from ....core.operand import OperandStage
  from ....tensor.core import TENSOR_TYPE
  from ...None import eval, cut, get_dummies, to_numeric
  from ...core import DATAFRAME_TYPE, SERIES_TYPE, SERIES_CHUNK_TYPE, INDEX_TYPE, CATEGORICAL_TYPE, CATEGORICAL_CHUNK_TYPE, DataFrameData, SeriesData
  from ...datasource.dataframe import from_pandas
  from ...datasource.series import from_pandas
  from ...datasource.index import from_pandas
  from ..None import to_gpu, to_cpu, astype
label_desc: Use image node_id 18 for calling a global function with example usage: test_memory_usage() without return types