class_docstr: Source for backtesting parameters. This class is thread safe.
class_docstr_tok: ["Source","for","backtesting","parameters",".","This","class","is","thread","safe","."]
docstr: Returns the next parameters to use in a backtest.
  If there are no more parameters to try then an empty list is returned.
  
  :param count: The max number of parameters to return.
  :type count: int
  :rtype: list of Parameters.
docstr_tok: ["Returns","the","next","parameters","to","use","in","a","backtest",".","If","there","are","no","more","parameters","to","try","then","an","empty","list","is","returned",".",":","param","count",":","The","max","number","of","parameters","to","return",".",":","type","count",":","int",":","rtype",":","list","of","Parameters","."]
code: def getNext(self, count):
      """
      Returns the next parameters to use in a backtest.
      If there are no more parameters to try then an empty list is returned.
  
      :param count: The max number of parameters to return.
      :type count: int
      :rtype: list of Parameters.
      """
  
      assert count > 0, "Invalid number of parameters"
  
      ret = []
      with self.__lock:
          if self.__iter is not None:
              try:
                  while count > 0:
                      params = six.next(self.__iter)
                      # Backward compatibility when parameters don't yield Parameters.
                      if not isinstance(params, Parameters):
                          params = Parameters(*params)
                      ret.append(params)
                      count -= 1
              except StopIteration:
                  self.__iter = None
      return ret
  
file_path: pyalgotrade/pyalgotrade/optimizer/base.py
imports: import threading
  import six
label_desc: Use image node_id 2 for calling the ParameterSource obj's underlying member method code with example usage: obj.getNext(count) and returns: ret