def find_device(self, service_uuids=[], name=None, timeout_sec=TIMEOUT_SEC):
start = time.time()<EOL>while True:<EOL><INDENT>found = self.find_devices(service_uuids, name)<EOL>if len(found) > <NUM_LIT:0>:<EOL><INDENT>return found[<NUM_LIT:0>]<EOL><DEDENT>if time.time()-start >= timeout_sec:<EOL><INDENT>return None<EOL><DEDENT>time.sleep(<NUM_LIT:1>)<EOL><DEDENT>
Return the first device that advertises the specified service UUIDs or
        has the specified name. Will wait up to timeout_sec seconds for the device
        to be found, and if the timeout is zero then it will not wait at all and
        immediately return a result.  When no device is found a value of None is
        returned.