code: def _volumes(self):
          
  
          # to find all the possible mbed volumes, we look for registry entries
          # under all possible USB tree which have a "BSD Name" that starts with
          # "disk" # (i.e. this is a USB disk), and have a IORegistryEntryName that
          # matches /\cmbed/
          # Once we've found a disk, we can search up for a parent with a valid
          # serial number, and then search down again to find a tty that's part
          # of the same composite device
          # ioreg -a -r -n <usb_controller_name> -l
          usb_controllers = [
              # Leaving these here for reference. The code nominally scanned each controller,
              # but a bug (?) caused it to only pay attention to the last one. That seems to
              # work fine, so the others are commented out.
  #             "AppleUSBXHCI",
  #             "AppleUSBUHCI",
  #             "AppleUSBEHCI",
  #             "AppleUSBOHCI",
              "IOUSBHostDevice",
          ]
  
          cmp_par = "-n"
          # For El Captain we need to list all the instances of (-c) rather than
          # compare names (-n)
          if self.mac_version >= 10.11:
              cmp_par = "-c"
  
          for usb_controller in usb_controllers:
              ioreg_usb = subprocess.Popen(
                  ["ioreg", "-a", "-r", cmp_par, usb_controller, "-l"],
                  stdout=subprocess.PIPE,
              )
              usb_tree = _plist_from_popen(ioreg_usb)
  
          r = {}
  
          for name, obj in enumerate(usb_tree):
              pruned_obj = _prune(
                  obj,
                  [
                      "USB Serial Number",
                      "idVendor",
                      "BSD Name",
                      "IORegistryEntryName",
                      "idProduct",
                  ],
              )
              r.update(_dfs_usb_info(pruned_obj, []))
  
          return r
docs: returns a map {volume_id: {serial:, vendor_id:, product_id:, tty:}