<commit_before># -*- coding: utf-8 -*-

import pyaudio

def audio_dump():
    pa = pyaudio.PyAudio()
    num_api = pa.get_host_api_count()
    num_dev = pa.get_device_count()

    api_info = [[]]
    for i in range(0,num_api):
        api_info[i] = pa.get_host_api_info_by_index(i)

    for i in range(0,num_dev):
        dev_info = pa.get_device_info_by_index(i)
        print "Index: %d" % i
        print " -DeviceName: %s\n -HostName: %s\n -SampleRate: %dHz\n -MaxInputChannels: %d\n -MaxOutputChannels: %d" % (dev_info['name'], api_info[dev_info['hostApi']]['name'], int(dev_info['defaultSampleRate']), int(dev_info['maxInputChannels']), int(dev_info['maxOutputChannels']))

audio_dump()<commit_msg>mod io_view<commit_after># -*- coding: utf-8 -*-

import sys
import codecs
import pyaudio

sys.stdout = codecs.getwriter('utf_8')(sys.stdout)

def audio_dump():
    pa = pyaudio.PyAudio()
    num_api = pa.get_host_api_count()
    num_dev = pa.get_device_count()

    api_info = []
    for i in range(0,num_api):
        api_info.append(pa.get_host_api_info_by_index(i))

    for i in range(0,num_dev):
        dev_info = pa.get_device_info_by_index(i)
        print "Index: %d" % i
        print " -DeviceName: %s" % dev_info['name']
        print " -HostName: %s" % api_info[int(dev_info['hostApi'])]['name']
        print " -SampleRate: %dHz\n -MaxInputChannels: %d\n -MaxOutputChannels: %d" % (int(dev_info['defaultSampleRate']), int(dev_info['maxInputChannels']), int(dev_info['maxOutputChannels']))

audio_dump()
{'fraction_non_alphanumeric': 0.16173570019723865, 'fraction_numerical': 0.0046022353714661405, 'mean_word_length': 3.9415584415584415, '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': '2590970', 'n_tokens_mistral': 586, 'n_tokens_neox': 576, 'n_words': 101}