code: def preprocess(args):
      """
      Extract a tensor of (arrivals,departures) to Embarcadero station.
      """
      print("Loading data")
      dataset = load_bart_od()
  
      # The full dataset has all station->station ridership counts for all of 50
      # train stations. In this simple example we will model only the aggretate
      # counts to and from a single station, Embarcadero.
      i = dataset["stations"].index("EMBR")
      arrivals = dataset["counts"][:, :, i].sum(-1)
      departures = dataset["counts"][:, i, :].sum(-1)
      data = torch.stack([arrivals, departures], dim=-1)
      print(f"Loaded data of shape {tuple(data.shape)}")
  
      # This simple example uses no covariates, so we will construct a
      # zero-element tensor of the correct length as empty covariates.
      covariates = torch.zeros(len(data), 0)
  
      return data, covariates
  
file_path: pyro/examples/contrib/forecast/bart.py
imports: import argparse
  import logging
  import numpy
  import torch
  import pyro
  import pyro.distributions
  from pyro.contrib.examples.bart import load_bart_od
  from pyro.contrib.forecast import ForecastingModel, backtest
  from pyro.ops.tensor_utils import periodic_cumsum, periodic_repeat
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess(args) and returns: data,  covariates