<commit_before>import argparse
import numpy as np
import matplotlib.pyplot as plt
from FAUSTPy import *

# set up command line arguments
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--faustfloat',
                    dest="faustfloat",
                    default="float",
                    help="The value of FAUSTFLOAT.")
parser.add_argument('-p', '--path',
                    dest="faust_path",
                    default="",
                    help="The path of FAUSTFLOAT.")
parser.add_argument('-c', '--cflags',
                    dest="cflags",
                    default=[],
                    type=str.split,
                    help="Extra compiler flags")
parser.add_argument('-s', '--fs',
                    dest="fs",
                    default=48000,
                    type=int,
                    help="The sampling frequency")
args = parser.parse_args()

wrapper.FAUST_PATH = args.faust_path

dattorro = FAUST("dattorro_notch_cut_regalia.dsp", args.fs, args.faustfloat,
                 extra_compile_args=args.cflags)

audio = np.zeros((dattorro.dsp.num_in, args.fs), dtype=dattorro.dsp.dtype)
audio[:,0] = 1

out = dattorro.compute(audio)

print(audio)
print(out)

spec = np.fft.fft(out)[:,:args.fs/2]

fig = plt.figure()
p   = fig.add_subplot(1,1,1)
p.plot(20*np.log10(np.absolute(spec.T)+1e-8))

plt.show()

print("everything passes!")<commit_msg>__main__.py: make the comments look nicer.<commit_after>import argparse
import numpy as np
import matplotlib.pyplot as plt
from FAUSTPy import *

#######################################################
# set up command line arguments
#######################################################

parser = argparse.ArgumentParser()
parser.add_argument('-f', '--faustfloat',
                    dest="faustfloat",
                    default="float",
                    help="The value of FAUSTFLOAT.")
parser.add_argument('-p', '--path',
                    dest="faust_path",
                    default="",
                    help="The path of FAUSTFLOAT.")
parser.add_argument('-c', '--cflags',
                    dest="cflags",
                    default=[],
                    type=str.split,
                    help="Extra compiler flags")
parser.add_argument('-s', '--fs',
                    dest="fs",
                    default=48000,
                    type=int,
                    help="The sampling frequency")
args = parser.parse_args()

#######################################################
# initialise the FAUST object and get the default parameters
#######################################################

wrapper.FAUST_PATH = args.faust_path

dattorro = FAUST("dattorro_notch_cut_regalia.dsp", args.fs, args.faustfloat,
                 extra_compile_args=args.cflags)

#######################################################
# plot the frequency response with the default settings
#######################################################

audio = np.zeros((dattorro.dsp.num_in, args.fs), dtype=dattorro.dsp.dtype)
audio[:,0] = 1

out = dattorro.compute(audio)

print(audio)
print(out)

spec = np.fft.fft(out)[:,:args.fs/2]

fig = plt.figure()
p   = fig.add_subplot(1,1,1)
p.plot(20*np.log10(np.absolute(spec.T)+1e-8))

################
# show the plots
################

plt.show()

print("everything passes!")
{'fraction_non_alphanumeric': 0.22876013209246474, 'fraction_numerical': 0.01020714500150105, 'mean_word_length': 2.5484558040468586, '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': '1260353', 'n_tokens_mistral': 1010, 'n_tokens_neox': 956, 'n_words': 186}