code: def get_early_closes(start, end):
      # 1:00 PM close rules based on
      # https://quant.stackexchange.com/questions/4083/nyse-early-close-rules-july-4th-and-dec-25th # noqa
      # and verified against http://www.nyse.com/pdfs/closings.pdf
  
      # These rules are valid starting in 1993
  
      start = canonicalize_datetime(start)
      end = canonicalize_datetime(end)
  
      start = max(start, datetime(1993, 1, 1, tzinfo=pytz.utc))
      end = max(end, datetime(1993, 1, 1, tzinfo=pytz.utc))
  
      # Not included here are early closes prior to 1993
      # or unplanned early closes
  
      early_close_rules = []
  
      day_after_thanksgiving = rrule.rrule(
          rrule.MONTHLY,
          bymonth=11,
          # 4th Friday isn't correct if month starts on Friday, so restrict to
          # day range:
          byweekday=(rrule.FR),
          bymonthday=range(23, 30),
          cache=True,
          dtstart=start,
          until=end,
      )
      early_close_rules.append(day_after_thanksgiving)
  
      christmas_eve = rrule.rrule(
          rrule.MONTHLY,
          bymonth=12,
          bymonthday=24,
          byweekday=(rrule.MO, rrule.TU, rrule.WE, rrule.TH),
          cache=True,
          dtstart=start,
          until=end,
      )
      early_close_rules.append(christmas_eve)
  
      friday_after_christmas = rrule.rrule(
          rrule.MONTHLY,
          bymonth=12,
          bymonthday=26,
          byweekday=rrule.FR,
          cache=True,
          dtstart=start,
          # valid 1993-2007
          until=min(end, datetime(2007, 12, 31, tzinfo=pytz.utc)),
      )
      early_close_rules.append(friday_after_christmas)
  
      day_before_independence_day = rrule.rrule(
          rrule.MONTHLY,
          bymonth=7,
          bymonthday=3,
          byweekday=(rrule.MO, rrule.TU, rrule.TH),
          cache=True,
          dtstart=start,
          until=end,
      )
      early_close_rules.append(day_before_independence_day)
  
      day_after_independence_day = rrule.rrule(
          rrule.MONTHLY,
          bymonth=7,
          bymonthday=5,
          byweekday=rrule.FR,
          cache=True,
          dtstart=start,
          # starting in 2013: wednesday before independence day
          until=min(end, datetime(2012, 12, 31, tzinfo=pytz.utc)),
      )
      early_close_rules.append(day_after_independence_day)
  
      wednesday_before_independence_day = rrule.rrule(
          rrule.MONTHLY,
          bymonth=7,
          bymonthday=3,
          byweekday=rrule.WE,
          cache=True,
          # starting in 2013
          dtstart=max(start, datetime(2013, 1, 1, tzinfo=pytz.utc)),
          until=max(end, datetime(2013, 1, 1, tzinfo=pytz.utc)),
      )
      early_close_rules.append(wednesday_before_independence_day)
  
      early_close_ruleset = rrule.rruleset()
  
      for rule in early_close_rules:
          early_close_ruleset.rrule(rule)
      early_closes = early_close_ruleset.between(start, end, inc=True)
  
      # Misc early closings from NYSE listing.
      # http://www.nyse.com/pdfs/closings.pdf
      #
      # New Year's Eve
      nye_1999 = datetime(1999, 12, 31, tzinfo=pytz.utc)
      if start <= nye_1999 and nye_1999 <= end:
          early_closes.append(nye_1999)
  
      early_closes.sort()
      return pd.DatetimeIndex(early_closes)
  
file_path: zipline/zipline/utils/tradingcalendar.py
imports: import pandas
  import pytz
  from datetime import datetime
  from dateutil import rrule
  from functools import partial
label_desc: Use image node_id 4 for calling a global function with example usage: get_early_closes(start, end) and returns: pd