docs: def cleanup(channel=None):
      """
      At the end any program, it is good practice to clean up any resources you
      might have used. This is no different with OPi.GPIO. By returning all
      channels you have used back to inputs with no pull up/down, you can avoid
      accidental damage to your Orange Pi by shorting out the pins. Note that
      this will only clean up GPIO channels that your script has used. Note that
      GPIO.cleanup() also clears the pin numbering system in use.
  
      To clean up at the end of your script:
  
      .. code:: python
  
         GPIO.cleanup()
  
      It is possible that don't want to clean up every channel leaving some set
      up when your program exits. You can clean up individual channels, a list or
      a tuple of channels:
  
      .. code:: python
  
         GPIO.cleanup(channel)
         GPIO.cleanup( (channel1, channel2) )
         GPIO.cleanup( [channel1, channel2] )
      """
      if channel is None:
          cleanup(list(_exports.keys()))
          setwarnings(True)
          global _mode
          _mode = None
      elif isinstance(channel, list):
          for ch in channel:
              cleanup(ch)
      else:
          _check_configured(channel)
          pin = get_gpio_pin(_mode, channel)
          event.cleanup(pin)
          sysfs.unexport(pin)
          del _exports[channel]