docs: def setmode(mode):
      """
      You must call this method prior to using all other calls.
  
      :param mode: the mode, one of :py:attr:`GPIO.BOARD`, :py:attr:`GPIO.BCM`,
          :py:attr:`GPIO.SUNXI`, or a `dict` or `object` representing a custom
          pin mapping.
      """
      if hasattr(mode, '__getitem__'):
          set_custom_pin_mappings(mode)
          mode = CUSTOM
  
      assert mode in [BCM, BOARD, SUNXI, CUSTOM]
      global _mode
      _mode = mode