<commit_before>import os
import subprocess
import sys

def escape_dollar_sign(s):
  return s.replace("$", "\\$")

def get_audio_length(f):
  command = "soxi -D \"%s\"" % escape_dollar_sign(f)
  return float(subprocess.check_output(command, shell=True))

if __name__ == '__main__':
  target_dir = sys.argv[1]
  files = os.listdir(target_dir)
  total = sum([get_audio_length(os.path.join(target_dir, f)) for f in files])
  print total / 60. / 60.<commit_msg>also escaping backticks<commit_after>import os
import subprocess
import sys

def escape_characters(s):
  return (s
    .replace("$", "\\$")
    .replace("`", "\\`")
    )

def get_audio_length(f):
  command = "soxi -D \"%s\"" % escape_characters(f)
  return float(subprocess.check_output(command, shell=True))

if __name__ == '__main__':
  target_dir = sys.argv[1]
  files = os.listdir(target_dir)
  total = sum([get_audio_length(os.path.join(target_dir, f)) for f in files])
  print total / 60. / 60.
{'fraction_non_alphanumeric': 0.1588296760710554, 'fraction_numerical': 0.01044932079414838, 'mean_word_length': 4.382022471910112, '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': '4294726', 'n_tokens_mistral': 368, 'n_tokens_neox': 353, 'n_words': 79}