class_docstr: A class for dispatching and caching trading calendars.
  
  Methods of a global instance of this class are provided by
  catalyst.utils.calendar_utils.
  
  Parameters
  ----------
  calendars : dict[str -> TradingCalendar]
      Initial set of calendars.
  calendar_factories : dict[str -> function]
      Factories for lazy calendar creation.
  aliases : dict[str -> str]
      Calendar name aliases.
class_docstr_tok: ["A","class","for","dispatching","and","caching","trading","calendars",".","Methods","of","a","global","instance","of","this","class","are","provided","by","catalyst.utils.calendar_utils",".","Parameters","--","--","--","--","--","calendars",":","dict","[","str","-",">","TradingCalendar","]","Initial","set","of","calendars",".","calendar_factories",":","dict","[","str","-",">","function","]","Factories","for","lazy","calendar","creation",".","aliases",":","dict","[","str","-",">","str","]","Calendar","name","aliases","."]
docstr: Retrieves an instance of a TradingCalendar whose name is given.
  
  Parameters
  ----------
  name : str
      The name of the TradingCalendar to be retrieved.
  
  Returns
  -------
  calendar : catalyst.utils.calendars.TradingCalendar
      The desired calendar.
docstr_tok: ["Retrieves","an","instance","of","a","TradingCalendar","whose","name","is","given",".","Parameters","--","--","--","--","--","name",":","str","The","name","of","the","TradingCalendar","to","be","retrieved",".","Returns","--","--","--","-","calendar",":","catalyst.utils.calendars.TradingCalendar","The","desired","calendar","."]
code: def get_calendar(self, name):
      """
      Retrieves an instance of a TradingCalendar whose name is given.
  
      Parameters
      ----------
      name : str
          The name of the TradingCalendar to be retrieved.
  
      Returns
      -------
      calendar : catalyst.utils.calendars.TradingCalendar
          The desired calendar.
      """
      canonical_name = self.resolve_alias(name)
  
      try:
          return self._calendars[canonical_name]
      except KeyError:
          # We haven't loaded this calendar yet, so make a new one.
          pass
  
      try:
          factory = self._calendar_factories[canonical_name]
      except KeyError:
          # We don't have a factory registered for this name.  Barf.
          raise InvalidCalendarName(calendar_name=name)
  
      # Cache the calendar for future use.
      calendar = self._calendars[canonical_name] = factory()
      return calendar
  
imports: from catalyst.errors import CalendarNameCollision, CyclicCalendarAlias, InvalidCalendarName
  from .exchange_calendar_open import OpenExchangeCalendar
  from .exchange_calendar_cfe import CFEExchangeCalendar
  from .exchange_calendar_ice import ICEExchangeCalendar
  from .exchange_calendar_nyse import NYSEExchangeCalendar
  from .exchange_calendar_cme import CMEExchangeCalendar
  from .exchange_calendar_bmf import BMFExchangeCalendar
  from .exchange_calendar_lse import LSEExchangeCalendar
  from .exchange_calendar_tsx import TSXExchangeCalendar
  from .us_futures_calendar import QuantopianUSFuturesCalendar
label_desc: Use image node_id 2 for calling the TradingCalendarDispatcher obj's underlying member method code with example usage: obj.get_calendar(name) and returns: calendar, self