class_docstr: Wrapper of ``pandas_market_calendars`` for a trading calendar. The package
  ``pandas_market_calendar`` must be installed
  
  Params:
  
    - ``calendar`` (default ``None``)
  
      The param ``calendar`` accepts the following:
  
      - string: the name of one of the calendars supported, for example
        `NYSE`. The wrapper will attempt to get a calendar instance
  
      - calendar instance: as returned by ``get_calendar('NYSE')``
  
    - ``cachesize`` (default ``365``)
  
      Number of days to cache in advance for lookup
  
  See also:
  
    - https://github.com/rsheftel/pandas_market_calendars
  
    - http://pandas-market-calendars.readthedocs.io/
class_docstr_tok: ["Wrapper","of","``","pandas_market_calendars","``","for","a","trading","calendar",".","The","package","``","pandas_market_calendar","``","must","be","installed","Params",":","-","``","calendar","``","(","default","``","None","``",")","The","param","``","calendar","``","accepts","the","following",":","-","string",":","the","name","of","one","of","the","calendars","supported",",","for","example","`","NYSE","`",".","The","wrapper","will","attempt","to","get","a","calendar","instance","-","calendar","instance",":","as","returned","by","``","get_calendar","(","'NYSE","'",")","``","-","``","cachesize","``","(","default","``","365","``",")","Number","of","days","to","cache","in","advance","for","lookup","See","also",":","-","https",":","\/\/github.com\/rsheftel\/pandas_market_calendars","-","http",":","\/\/pandas-market-calendars.readthedocs.io\/"]
docstr: Returns the opening and closing times for the given ``day``. If the
  method is called, the assumption is that ``day`` is an actual trading
  day
  
  The return value is a tuple with 2 components: opentime, closetime
docstr_tok: ["Returns","the","opening","and","closing","times","for","the","given","``","day","``",".","If","the","method","is","called",",","the","assumption","is","that","``","day","``","is","an","actual","trading","day","The","return","value","is","a","tuple","with","2","components",":","opentime",",","closetime"]
code: def schedule(self, day, tz=None):
      """
      Returns the opening and closing times for the given ``day``. If the
      method is called, the assumption is that ``day`` is an actual trading
      day
  
      The return value is a tuple with 2 components: opentime, closetime
      """
      while True:
          i = self.idcache.index.searchsorted(day.date())
          if i == len(self.idcache):
              # keep a cache of 1 year to speed up searching
              self.idcache = self._calendar.schedule(
                  day, day + self.csize
              )
              continue
  
          st = (x.tz_localize(None) for x in self.idcache.iloc[i, 0:2])
          opening, closing = st  # Get utc naive times
          if day > closing:  # passed time is over the sessionend
              day += ONEDAY  # wrap over to next day
              continue
  
          return opening.to_pydatetime(), closing.to_pydatetime()
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from datetime import datetime, timedelta, time
  from .metabase import MetaParams
  from backtrader.utils.py3 import string_types, with_metaclass
  from backtrader.utils import UTC
label_desc: Use image node_id 3 for calling the PandasMarketCalendar obj's underlying member method code with example usage: obj.schedule(day, tz) and returns: opening,  closing