<commit_before>#!/usr/bin/env python
__metaclass__ = type
from jujupy import (
    check_wordpress,
    Environment,
    format_listing,
    until_timeout,
)

from collections import defaultdict
import sys


def agent_update(environment, version):
    env = Environment(environment)
    for ignored in until_timeout(30):
        versions = defaultdict(list)
        status = env.get_status()
        for item_name, item in env.agent_items(status):
            versions[item.get('agent-version', 'unknown')].append(item_name)
        if versions.keys() == [version]:
            break
        print format_listing(versions, version)
        sys.stdout.flush()<commit_msg>Increase timeout for agent update to 5 minutes.<commit_after>#!/usr/bin/env python
__metaclass__ = type
from jujupy import (
    check_wordpress,
    Environment,
    format_listing,
    until_timeout,
)

from collections import defaultdict
import sys


def agent_update(environment, version):
    env = Environment(environment)
    for ignored in until_timeout(300):
        versions = defaultdict(list)
        status = env.get_status()
        for item_name, item in env.agent_items(status):
            versions[item.get('agent-version', 'unknown')].append(item_name)
        if versions.keys() == [version]:
            break
        print format_listing(versions, version)
        sys.stdout.flush()
{'fraction_non_alphanumeric': 0.09672727272727273, 'fraction_numerical': 0.004363636363636364, 'mean_word_length': 3.1570996978851964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2850645', 'n_tokens_mistral': 398, 'n_tokens_neox': 382, 'n_words': 96}