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: Registers a calendar by type.
  
  This is useful for registering a new calendar to be lazily instantiated
  at some future point in time.
  
  Parameters
  ----------
  name: str
      The key with which to register this calendar.
  calendar_type: type
      The type of the calendar to register.
  force : bool, optional
      If True, old calendars will be overwritten on a name collision.
      If False, name collisions will raise an exception.
      Default is False.
  
  Raises
  ------
  CalendarNameCollision
      If a calendar is already registered with the given calendar's name.
docstr_tok: ["Registers","a","calendar","by","type",".","This","is","useful","for","registering","a","new","calendar","to","be","lazily","instantiated","at","some","future","point","in","time",".","Parameters","--","--","--","--","--","name",":","str","The","key","with","which","to","register","this","calendar",".","calendar_type",":","type","The","type","of","the","calendar","to","register",".","force",":","bool",",","optional","If","True",",","old","calendars","will","be","overwritten","on","a","name","collision",".","If","False",",","name","collisions","will","raise","an","exception",".","Default","is","False",".","Raises","--","--","--","CalendarNameCollision","If","a","calendar","is","already","registered","with","the","given","calendar","'s","name","."]
code: def register_calendar_type(self, name, calendar_type, force=False):
      """
      Registers a calendar by type.
  
      This is useful for registering a new calendar to be lazily instantiated
      at some future point in time.
  
      Parameters
      ----------
      name: str
          The key with which to register this calendar.
      calendar_type: type
          The type of the calendar to register.
      force : bool, optional
          If True, old calendars will be overwritten on a name collision.
          If False, name collisions will raise an exception.
          Default is False.
  
      Raises
      ------
      CalendarNameCollision
          If a calendar is already registered with the given calendar's name.
      """
      if force:
          self.deregister_calendar(name)
  
      if self.has_calendar(name):
          raise CalendarNameCollision(calendar_name=name)
  
      self._calendar_factories[name] = calendar_type
  
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 5 for calling the TradingCalendarDispatcher obj's underlying member method code with example usage: obj.register_calendar_type(name, calendar_type, force) without return types