code: def discover() -> List[Tuple[str, str]]:
      
      if IS_ROBOT and os.path.isdir('/dev/modules'):
          devices = os.listdir('/dev/modules')
      else:
          devices = []
  
      discovered_modules = []
  
      module_port_regex = re.compile('|'.join(MODULE_TYPES.keys()), re.I)
      for port in devices:
          match = module_port_regex.search(port)
          if match:
              name = match.group().lower()
              if name not in MODULE_TYPES:
                  log.warning("Unexpected module connected: {} on {}"
                              .format(name, port))
                  continue
              absolute_port = '/dev/modules/{}'.format(port)
              discovered_modules.append((absolute_port, name))
      log.info('Discovered modules: {}'.format(discovered_modules))
  
      return discovered_modules
docs: Scan for connected modules and instantiate handler classes