code: def run(
      strategyClass,
      barFeed,
      strategyParameters,
      workerCount=None,
      logLevel=logging.ERROR,
      batchSize=200,
  ):
      """Executes many instances of a strategy in parallel and finds the parameters that yield the best results.
  
      :param strategyClass: The strategy class.
      :param barFeed: The bar feed to use to backtest the strategy.
      :type barFeed: :class:`pyalgotrade.barfeed.BarFeed`.
      :param strategyParameters: The set of parameters to use for backtesting. An iterable object where **each element is
          a tuple that holds parameter values**.
      :param workerCount: The number of strategies to run in parallel. If None then as many workers as CPUs are used.
      :type workerCount: int.
      :param logLevel: The log level. Defaults to **logging.ERROR**.
      :param batchSize: The number of strategy executions that are delivered to each worker.
      :type batchSize: int.
      :rtype: A :class:`Results` instance with the best results found.
      """
  
      return run_impl(
          strategyClass,
          barFeed,
          strategyParameters,
          batchSize,
          workerCount=workerCount,
          logLevel=logLevel,
      )
  
file_path: pyalgotrade/pyalgotrade/optimizer/local.py
imports: import logging
  import multiprocessing
  import os
  import random
  import socket
  import threading
  import time
  from pyalgotrade.optimizer import base
  from pyalgotrade.optimizer import server
  from pyalgotrade.optimizer import worker
  from pyalgotrade.optimizer import xmlrpcserver
label_desc: Use image node_id 5 for calling a global function with example usage: run(strategyClass, barFeed, strategyParameters, workerCount, logLevel, batchSize) and returns: run_impl