class_docstr: Helper for different ways we can get benchmark data for the Zipline CLI and
  zipline.utils.run_algo.run_algorithm.
  
  Parameters
  ----------
  benchmark_returns : pd.Series, optional
      Series of returns to use as the benchmark.
  benchmark_file : str or file
      File containing a csv with `date` and `return` columns, to be read as
      the benchmark.
  benchmark_sid : int, optional
      Sid of the asset to use as a benchmark.
  benchmark_symbol : str, optional
      Symbol of the asset to use as a benchmark. Symbol will be looked up as
      of the end date of the backtest.
  no_benchmark : bool
      Flag indicating that no benchmark is configured. Benchmark-dependent
      metrics will be calculated using a dummy benchmark of all-zero returns.
class_docstr_tok: ["Helper","for","different","ways","we","can","get","benchmark","data","for","the","Zipline","CLI","and","zipline.utils.run_algo.run_algorithm",".","Parameters","--","--","--","--","--","benchmark_returns",":","pd.Series",",","optional","Series","of","returns","to","use","as","the","benchmark",".","benchmark_file",":","str","or","file","File","containing","a","csv","with","`","date","`","and","`","return","`","columns",",","to","be","read","as","the","benchmark",".","benchmark_sid",":","int",",","optional","Sid","of","the","asset","to","use","as","a","benchmark",".","benchmark_symbol",":","str",",","optional","Symbol","of","the","asset","to","use","as","a","benchmark",".","Symbol","will","be","looked","up","as","of","the","end","date","of","the","backtest",".","no_benchmark",":","bool","Flag","indicating","that","no","benchmark","is","configured",".","Benchmark-dependent","metrics","will","be","calculated","using","a","dummy","benchmark","of","all-zero","returns","."]
code: def from_returns(cls, benchmark_returns):
      return cls(
          benchmark_returns=benchmark_returns,
          benchmark_file=None,
          benchmark_sid=None,
          benchmark_symbol=None,
          no_benchmark=benchmark_returns is None,
      )
  
imports: import click
  import os
  import sys
  import warnings
  import logbook
  import pandas
  import six
  from toolz import concatv
  from trading_calendars import get_calendar
  from zipline.data import bundles
  from zipline.data.benchmarks import get_benchmark_returns_from_file
  from zipline.data.data_portal import DataPortal
  from zipline.finance import metrics
  from zipline.finance.trading import SimulationParameters
  from zipline.pipeline.data import USEquityPricing
  from zipline.pipeline.loaders import USEquityPricingLoader
  import zipline.utils.paths
  from zipline.extensions import load
  from zipline.errors import SymbolNotFound
  from zipline.algorithm import TradingAlgorithm, NoBenchmark
  from zipline.finance.blotter import Blotter
label_desc: Use image node_id 3 for calling the BenchmarkSpec obj's underlying member method code with example usage: obj.from_returns(cls, benchmark_returns) and returns: cls