code: def test_compute_ma():
      stock_orig = [
          100.0,
          0.1531138587991997,
          0.6937500710898674,
          -0.9998892390840102,
          -0.46790785174554383,
          0.24992469198859263,
          0.8371986752411684,
          0.9996789142433975,
      ]
      ma10d_orig = [
          91.0,
          0.12982588130881456,
          0.6364686654113839,
          -0.9111588177100766,
          -0.45638926346295605,
          0.22777211487458476,
          0.7335679046265856,
          0.9544686462652832,
      ]
      ma30d_orig = [
          71.0,
          0.029843302068984976,
          0.40788852852895285,
          -0.5654851211095089,
          -0.3735139378462722,
          0.0648917102227224,
          0.4075702001405792,
          0.5942823972334838,
      ]
      index = [
          "count",
          "mean",
          "std",
          "min",
          "25%",
          "50%",
          "75%",
          "max",
      ]
      dforig = pd.DataFrame(
          {"Stock": stock_orig, "10d": ma10d_orig, "30d": ma30d_orig},
          index=index,
      )
      x = np.sin(np.linspace(1, 10, 100))
      df = pd.DataFrame({"Stock": x}).astype(np.float64)
      ma = compute_ma(df, ema, spans=[10, 30], plot=False)
      assert all(abs((dforig - ma.describe()) <= 1e-15).all())
  
file_path: FinQuant/tests/test_moving_average.py
imports: import matplotlib.pyplot
  import numpy
  import pandas
  from finquant.moving_average import compute_ma, ema, ema_std, plot_bollinger_band, sma, sma_std
label_desc: Use image node_id 5 for calling a global function with example usage: test_compute_ma() without return types