code: def test_ewm():
      df = pd.DataFrame(np.random.rand(4, 3), columns=list("abc"))
      df2 = md.DataFrame(df)
  
      with pytest.raises(NotImplementedError):
          _ = df2.ewm(2, adjust=False, ignore_na=False)
  
      with pytest.raises(ValueError):
          _ = df2.ewm()
  
      with pytest.raises(ValueError):
          _ = df2.ewm(com=2, alpha=0.3)
  
      assert pytest.approx(df2.ewm(com=1).alpha) == 0.5
      with pytest.raises(ValueError):
          _ = df2.ewm(com=-1)
  
      assert pytest.approx(df2.ewm(span=3).alpha) == 0.5
      with pytest.raises(ValueError):
          _ = df2.ewm(span=0)
  
      assert pytest.approx(df2.ewm(halflife=1).alpha) == 0.5
      with pytest.raises(ValueError):
          _ = df2.ewm(halflife=-1)
  
      with pytest.raises(ValueError):
          _ = df2.ewm(alpha=2)
  
      r = df2.ewm(3)
      expected = df.ewm(3)
      assert repr(r) == repr(expected)
  
      r = df2.ewm(alpha=1)
      assert type(r).__name__ == "Expanding"
  
imports: import numpy
  import pandas
  import pytest
  from .....None import dataframe
  from .....core import tile
label_desc: Use image node_id 1 for calling a global function with example usage: test_ewm() without return types