code: def runstrat(pargs=None):
      args = parse_args(pargs)
  
      cerebro = bt.Cerebro()
      data = bt.feeds.BacktraderCSVData(dataname=args.data)
      cerebro.adddata(data)
  
      cerebro.addanalyzer(bt.analyzers.Returns)
      cerebro.optstrategy(StFetcher, idx=[0, 1])
      results = cerebro.run(
          maxcpus=args.maxcpus, optreturn=args.optreturn
      )
  
      strats = [x[0] for x in results]  # flatten the result
      for i, strat in enumerate(strats):
          rets = strat.analyzers.returns.get_analysis()
          print(
              "Strat {} Name {}:\n  - analyzer: {}\n".format(
                  i, strat.__class__.__name__, rets
              )
          )
  
file_path: backtrader/samples/strategy-selection/strategy-selection.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import backtrader
label_desc: Use image node_id 1 for calling a global function with example usage: runstrat(pargs) without return types