docs: def get_pci_device(d_info, pci_device_ids):
      """Get quantity of PCI devices.
  
      Get quantity of PCI devices of the node.
  
      :param d_info: the list of ipmitool parameters for accessing a node.
      :param pci_device_ids: the list contains pairs of <vendorID>/<deviceID> for
      PCI devices.
      :returns: the number of PCI devices.
      """
  
      # note:
      # Get quantity of PCI devices:
      # ipmi cmd '0xF1'
      #
      # $ ipmitool raw 0x2E 0xF1 0x80 0x28 0x00 0x1A 0x01 0x00
      #
      # Raw response:
      # 80 28 00 00 00 05 data1 data2 34 17 76 11 00 04
      # 01
  
      # data1: 2 octet of VendorID
      # data2: 2 octet of DeviceID
  
      ipmicmd = ipmi_command.Command(bmc=d_info['irmc_address'],
                                     userid=d_info['irmc_username'],
                                     password=d_info['irmc_password'])
  
      response = itertools.takewhile(
          lambda y: (y[1]['code'] != 0xC9 and y[1].get('error') is None),
          _pci_seq(ipmicmd))
  
      def _pci_count(accm, v):
          out = v[1]['data']
          # if system returns value, record id will be increased.
          pci_id = "0x{:02x}{:02x}/0x{:02x}{:02x}".format(
              out[7], out[6], out[9], out[8])
          return accm + 1 if pci_id in pci_device_ids else accm
  
      device_count = functools.reduce(_pci_count, response, 0)
  
      return device_count