<commit_before>import json
import os
import redo
import platform
import configparser
import glob
from selenium import webdriver
import toml
import urllib
import tempfile
from munch import *
from steps.utils import running, nested_dict_iter, benchmark, ROOT, assert_equal_diff, compare, serialize
#import difflib
import shutil
import shlex
#import io
#from markdownify import markdownify as md
#from bs4 import BeautifulSoup
import psutil
import subprocess
import atexit
import time

#from ruamel.yaml import YAML
#yaml = YAML(typ='safe')
#yaml.default_flow_style = False

class Zotero:
  def __init__(self, userdata):
    assert not running('Zotero'), 'Zotero is running'
    self.userdata = userdata

    self.id = self.userdata.get('zotero', 'zotero')
    if self.id == 'zotero':
      self.port = 23119
    elif self.id == 'jurism':
      self.port = 24119
    else:
      raise ValueError(f'Unexpected client "{self.userdata.zotero}"')

    self.zotero = self.id == 'zotero'
    self.jurism = self.id == 'jurism'

    self.timeout = int(self.userdata.get('timeout', 60))

    with open(os.path.join(ROOT, 'gen/translators.json')) as f:
      self.translators = json.load(f, object_hook=Munch)
<commit_msg>cleanup<commit_after>import json
import os
import redo
import platform
import configparser
import glob
from selenium import webdriver
import toml
import urllib
import tempfile
from munch import *
from steps.utils import running, nested_dict_iter, benchmark, ROOT, assert_equal_diff, compare, serialize
#import difflib
import shutil
import shlex
#import io
#from markdownify import markdownify as md
#from bs4 import BeautifulSoup
import psutil
import subprocess
import atexit
import time

from ruamel.yaml import YAML
yaml = YAML(typ='safe')
yaml.default_flow_style = False

class Zotero:
  def __init__(self, userdata):
    assert not running('Zotero'), 'Zotero is running'
    self.userdata = userdata

    self.id = self.userdata.get('zotero', 'zotero')
    if self.id == 'zotero':
      self.port = 23119
    elif self.id == 'jurism':
      self.port = 24119
    else:
      raise ValueError(f'Unexpected client "{self.userdata.zotero}"')

    self.zotero = self.id == 'zotero'
    self.jurism = self.id == 'jurism'

    self.timeout = int(self.userdata.get('timeout', 60))

    with open(os.path.join(ROOT, 'gen/translators.json')) as f:
      self.translators = json.load(f, object_hook=Munch)

{'fraction_non_alphanumeric': 0.10087173100871731, 'fraction_numerical': 0.010792860107928601, 'mean_word_length': 4.227765726681128, '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': '2336723', 'n_tokens_mistral': 834, 'n_tokens_neox': 785, 'n_words': 234}