def find_devices(self, service_uuids=[], name=None):
<EOL>expected = set(service_uuids)<EOL>devices = self.list_devices()<EOL>found = []<EOL>for device in devices:<EOL><INDENT>if name is not None:<EOL><INDENT>if device.name == name:<EOL><INDENT>found.append(device)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>actual = set(device.advertised)<EOL>if actual >= expected:<EOL><INDENT>found.append(device)<EOL><DEDENT><DEDENT><DEDENT>return found<EOL>
Return devices that advertise the specified service UUIDs and/or have
        the specified name.  Service_uuids should be a list of Python uuid.UUID
        objects and is optional.  Name is a string device name to look for and is
        also optional.  Will not block, instead it returns immediately with a
        list of found devices (which might be empty).