def usernames(urls):
    usernames = StringCounter()
    for url, count in urls.items():
        uparse = urlparse(url)
        path = uparse.path
        hostname = uparse.hostname
        m = username_re.match(path)
        if m:
            usernames[m.group('username')] += count
        elif hostname in ['twitter.com', 'www.facebook.com']:
            usernames[path.lstrip('/')] += count
    return usernames
Add a recorder for recording.
dataset/ETHPy150Open dossier/dossier.web/dossier/extraction/usernames.py/usernames--crossover with--dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/recorders/recording_manager.py/RecordingManager.append