code: def list_devices(class_name, name_pattern, **kwargs):
      
      classpath = abspath(Device.DEVICE_ROOT_PATH + '/' + class_name)
  
      return (Device(class_name, name, name_exact=True)
              for name in list_device_names(classpath, name_pattern, **kwargs))
docs: This is a generator function that takes same arguments as `Device` class
      and enumerates all devices present in the system that match the provided
      arguments.
  
      Parameters:
          class_name: class name of the device, a subdirectory of /sys/class.
              For example, 'tacho-motor'.
          name_pattern: pattern that device name should match.
              For example, 'sensor*' or 'motor*'. Default value: '*'.
          keyword arguments: used for matching the corresponding device
              attributes. For example, address='outA', or
              driver_name=['lego-ev3-us', 'lego-nxt-us']. When argument value
              is a list, then a match against any entry of the list is
              enough.