code: def test_minute_after_asset_stopped(self):
      # SHORT_ASSET's last day was 2015-01-06
      # get some history windows that straddle the end
      minutes = self.trading_calendars[Equity].minutes_for_session(
          pd.Timestamp("2015-01-07", tz="UTC")
      )[0:60]
  
      for idx, minute in enumerate(minutes):
          bar_data = self.create_bardata(lambda: minute)
          check_internal_consistency(
              bar_data, self.SHORT_ASSET, ALL_FIELDS, 30, "1m"
          )
  
      # Reset data portal because it has advanced past next test date.
      data_portal = self.make_data_portal()
  
      #                             close  high  low  open  price  volume
      # 2015-01-06 20:47:00+00:00    768   770  767   769    768   76800
      # 2015-01-06 20:48:00+00:00    769   771  768   770    769   76900
      # 2015-01-06 20:49:00+00:00    770   772  769   771    770   77000
      # 2015-01-06 20:50:00+00:00    771   773  770   772    771   77100
      # 2015-01-06 20:51:00+00:00    772   774  771   773    772   77200
      # 2015-01-06 20:52:00+00:00    773   775  772   774    773   77300
      # 2015-01-06 20:53:00+00:00    774   776  773   775    774   77400
      # 2015-01-06 20:54:00+00:00    775   777  774   776    775   77500
      # 2015-01-06 20:55:00+00:00    776   778  775   777    776   77600
      # 2015-01-06 20:56:00+00:00    777   779  776   778    777   77700
      # 2015-01-06 20:57:00+00:00    778   780  777   779    778   77800
      # 2015-01-06 20:58:00+00:00    779   781  778   780    779   77900
      # 2015-01-06 20:59:00+00:00    780   782  779   781    780   78000
      # 2015-01-06 21:00:00+00:00    781   783  780   782    781   78100
      # 2015-01-07 14:31:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:32:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:33:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:34:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:35:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:36:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:37:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:38:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:39:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:40:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:41:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:42:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:43:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:44:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:45:00+00:00    NaN   NaN  NaN   NaN    NaN       0
      # 2015-01-07 14:46:00+00:00    NaN   NaN  NaN   NaN    NaN       0
  
      # choose a window that contains the last minute of the asset
      window_start = pd.Timestamp("2015-01-06 20:47", tz="UTC")
      window_end = pd.Timestamp("2015-01-07 14:46", tz="UTC")
  
      bar_data = BarData(
          data_portal=data_portal,
          simulation_dt_func=lambda: minutes[15],
          data_frequency="minute",
          restrictions=NoRestrictions(),
          trading_calendar=self.trading_calendar,
      )
  
      bar_count = len(
          self.trading_calendar.minutes_in_range(
              window_start, window_end
          )
      )
      window = bar_data.history(
          self.SHORT_ASSET,
          ALL_FIELDS,
          bar_count,
          "1m",
      )
  
      # Window should start with 14 values and end with 16 NaNs/0s.
      for field in ALL_FIELDS:
          if field == "volume":
              np.testing.assert_array_equal(
                  range(76800, 78101, 100), window["volume"][0:14]
              )
              np.testing.assert_array_equal(
                  np.zeros(16), window["volume"][-16:]
              )
          else:
              np.testing.assert_array_equal(
                  np.array(range(768, 782)) + MINUTE_FIELD_INFO[field],
                  window[field][0:14],
              )
              np.testing.assert_array_equal(
                  np.full(16, np.nan), window[field][-16:]
              )
  
      # now do a smaller window that is entirely contained after the asset
      # ends
      window = bar_data.history(self.SHORT_ASSET, ALL_FIELDS, 5, "1m")
  
      for field in ALL_FIELDS:
          if field == "volume":
              np.testing.assert_array_equal(
                  np.zeros(5), window["volume"]
              )
          else:
              np.testing.assert_array_equal(
                  np.full(5, np.nan), window[field]
              )
  
imports: from textwrap import dedent
  from nose_parameterized import parameterized
  import numpy
  from numpy import nan
  import pandas
  from six import iteritems
  from catalyst import TradingAlgorithm
  from catalyst._protocol import handle_non_market_minutes, BarData
  from catalyst.assets import Asset, Equity
  from catalyst.errors import HistoryInInitialize, HistoryWindowStartsBeforeData
  from catalyst.finance.trading import SimulationParameters
  from catalyst.finance.asset_restrictions import NoRestrictions
  from catalyst.testing import create_minute_df_for_asset, str_to_seconds, MockDailyBarReader
  from catalyst.testing.fixtures import WithCreateBarData, WithDataPortal, CatalystTestCase, alias
label_desc: Use image node_id 8 for calling the MinuteEquityHistoryTestCase obj's underlying member method code with example usage: obj.test_minute_after_asset_stopped() without return types