code: def test_minute_early_close(self):
      # 2014-07-03 is an early close
      # HALF_DAY_TEST_ASSET started trading on 2014-07-02, how convenient
      #
      # five minutes into the day after the early close, get 20 1m bars
  
      cal = self.trading_calendar
  
      window_start = pd.Timestamp("2014-07-03 16:46:00", tz="UTC")
      window_end = pd.Timestamp("2014-07-07 13:35:00", tz="UTC")
      bar_count = len(cal.minutes_in_range(window_start, window_end))
  
      window = self.data_portal.get_history_window(
          [self.HALF_DAY_TEST_ASSET],
          window_end,
          bar_count,
          "1m",
          "close",
          "minute",
      )[self.HALF_DAY_TEST_ASSET]
  
      # 390 minutes for 7/2, 210 minutes for 7/3, 7/4-7/6 closed
      # first minute of 7/7 is the 600th trading minute for this asset
      # this asset's first minute had a close value of 2, so every value is
      # 2 + (minute index)
      expected = range(587, 607)
  
      # First 15 bars on occur at the end of 2014-07-03.
      np.testing.assert_array_equal(window[:15], expected[:15])
      # Interim bars (only on other calendars) should all be nan.
      np.testing.assert_array_equal(
          window[15:-5],
          np.full(len(window) - 20, np.nan),
      )
      # Last 5 bars occur at the start of 2014-07-07.
      np.testing.assert_array_equal(window[-5:], expected[-5:])
  
      self.assertEqual(
          window.index[14], pd.Timestamp("2014-07-03 17:00", tz="UTC")
      )
  
      self.assertEqual(
          window.index[-5], pd.Timestamp("2014-07-07 13:31", tz="UTC")
      )
  
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 14 for calling the MinuteEquityHistoryTestCase obj's underlying member method code with example usage: obj.test_minute_early_close() without return types