class_docstr: Test the Fast Stochastic Oscillator
class_docstr_tok: ["Test","the","Fast","Stochastic","Oscillator"]
docstr: Test the output that is returned from the fast stochastic oscillator
  is the same as that from the ta-lib STOCHF function.
docstr_tok: ["Test","the","output","that","is","returned","from","the","fast","stochastic","oscillator","is","the","same","as","that","from","the","ta-lib","STOCHF","function","."]
code: def test_fso_expected_with_talib(self, seed):
      """
      Test the output that is returned from the fast stochastic oscillator
      is the same as that from the ta-lib STOCHF function.
      """
      window_length = 14
      nassets = 6
      rng = np.random.RandomState(seed=seed)
  
      input_size = (window_length, nassets)
  
      # values from 9 to 12
      closes = 9.0 + (rng.random_sample(input_size) * 3.0)
  
      # Values from 13 to 15
      highs = 13.0 + (rng.random_sample(input_size) * 2.0)
  
      # Values from 6 to 8.
      lows = 6.0 + (rng.random_sample(input_size) * 2.0)
  
      expected_out_k = []
      for i in range(nassets):
          fastk, fastd = talib.STOCHF(
              high=highs[:, i],
              low=lows[:, i],
              close=closes[:, i],
              fastk_period=window_length,
              fastd_period=1,
          )
  
          expected_out_k.append(fastk[-1])
      expected_out_k = np.array(expected_out_k)
  
      today = pd.Timestamp("2015")
      out = np.empty(shape=(nassets,), dtype=np.float)
      assets = np.arange(nassets, dtype=np.float)
  
      fso = FastStochasticOscillator()
      fso.compute(today, assets, out, closes, lows, highs)
  
      assert_equal(out, expected_out_k, array_decimal=6)
  
imports: from __future__ import division
  from nose_parameterized import parameterized
  from six.moves import range
  import numpy
  import pandas
  import talib
  from numpy.random import RandomState
  from zipline.lib.adjusted_array import AdjustedArray
  from zipline.pipeline.data import USEquityPricing
  from zipline.pipeline.factors import BollingerBands, Aroon, FastStochasticOscillator, IchimokuKinkoHyo, LinearWeightedMovingAverage, RateOfChangePercentage, TrueRange, MovingAverageConvergenceDivergenceSignal, AnnualizedVolatility, RSI
  from zipline.testing import check_allclose, parameter_space
  from zipline.testing.fixtures import ZiplineTestCase
  from zipline.testing.predicates import assert_equal
  from .base import BaseUSEquityPipelineTestCase
label_desc: Use image node_id 2 for calling the TestFastStochasticOscillator obj's underlying member method code with example usage: obj.test_fso_expected_with_talib(seed) without return types