code: def getdata(args):
      dataformat = dict(
          bt=btfeeds.BacktraderCSVData,
          visualchart=btfeeds.VChartCSVData,
          sierrachart=btfeeds.SierraChartCSVData,
          yahoo=btfeeds.YahooFinanceCSVData,
          yahoo_unreversed=btfeeds.YahooFinanceCSVData,
      )
  
      dfkwargs = dict()
      if args.csvformat == "yahoo_unreversed":
          dfkwargs["reverse"] = True
  
      if args.fromdate:
          fromdate = datetime.datetime.strptime(
              args.fromdate, "%Y-%m-%d"
          )
          dfkwargs["fromdate"] = fromdate
  
      if args.todate:
          fromdate = datetime.datetime.strptime(args.todate, "%Y-%m-%d")
          dfkwargs["todate"] = todate
  
      if args.tend is not None:
          # internally only the "time" part is used
          dfkwargs["sessionend"] = datetime.datetime.strptime(
              args.tend, "%H:%M"
          )
  
      dfkwargs["dataname"] = args.infile
      dfcls = dataformat[args.csvformat]
  
      data = dfcls(**dfkwargs)
  
      return data
  
file_path: backtrader/samples/order-close/close-minute.py
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import datetime
  import backtrader
  import backtrader.feeds
label_desc: Use image node_id 2 for calling a global function with example usage: getdata(args) and returns: data