human
Solve the following python programming problem given the following code:
@snippet
def client_run_sync_query_paged(client, _):
assistant
#Here is the Python code you requested.

    """Run a synchronous query with paged results.
    """
    TIMEOUT_MS = 1000
    PAGE_SIZE = 100
    LIMIT = 1000
    LIMITED = ('%s    LIMIT    %d' % (QUERY, LIMIT))
    all_rows = []
    def do_something_with(row):
        all_rows.append(row)
    query = client.run_sync_query(LIMITED)
    query.timeout_ms = TIMEOUT_MS
    query.max_results = PAGE_SIZE
    query.run()
    assert query.complete
    assert (query.page_token is not None)
    assert (len(query.rows) == PAGE_SIZE)
    assert ([field.name for field in query.schema] == ['name'])
    iterator = query.fetch_data()
    for row in iterator:
        do_something_with(row)
    assert (iterator.total_rows == LIMIT)
    assert (len(all_rows) == LIMIT)