def block_until_synchronised_files_data_source_started(source: SynchronisedFilesDataSource):
blocked = True<EOL>def unblock(*args):<EOL><INDENT>nonlocal blocked<EOL>blocked = False<EOL><DEDENT>event_handler = FileSystemEventHandler()<EOL>event_handler.on_modified = unblock<EOL>source._observer.schedule(event_handler, source._directory_location, recursive=True)<EOL>temp_file_name = "<STR_LIT>" % block_until_synchronised_files_data_source_started.__name__<EOL>temp_file_path = os.path.join(source._directory_location, temp_file_name)<EOL>i = <NUM_LIT:0><EOL>while blocked:<EOL><INDENT>with open(temp_file_path, '<STR_LIT:a>') as file:<EOL><INDENT>file.write(str(i))<EOL><DEDENT>sleep(<NUM_LIT:10> / <NUM_LIT:1000>)<EOL>i += <NUM_LIT:1><EOL><DEDENT>
Blocks until the given synchronised files data source has started to notice changes in the file system (may be a few
milliseconds after it has been started).
:param source: the synchronised files data source that has been started