<commit_before>import os
import platform
import urllib
import glob
import time
import sys
import subprocess
import string

def get_timestamp():
  print(time.time())

def install_dumpling():
  if (not os.path.isfile(dumplingPath)):
    url = "https://dumpling.azurewebsites.net/api/client/dumpling.py"
    urllib.urlretrieve(url, "dumpling.py")
    subprocess.call([sys.executable,"dumpling.py", "install", "--update"])
  subprocess.call([sys.executable, dumplingPath, "install", "--full"])

def ensure_installed():
  if (not os.path.isfile(dumplingPath)):
    print("Dumpling has not been installed yet. Please run \"DumplingHelper.py install_dumpling\" before collect_dumps.")
    sys.exit(1)

def find_latest_dump(folder, startTimeStr):
  startTime = float(startTimeStr)
  globPattern = "/*";

  # Outside of Windows, core files are generally dumped into the executable's directory,
  # so it may have many other files in it. Filter those out.
  if sys.platform != "win32":
    globPattern = "/*core*"

  allFiles = glob.glob(folder + globPattern);
  if allFiles:
    latestFile = max(allFiles, key=os.path.getmtime)
    latestTime = os.path.getmtime(latestFile)
    if (latestTime > startTime):
      return latestFile
  return None
<commit_msg>Download dumpling.py next to DumplingHelper.py, rather than in the current directory.<commit_after>import os
import platform
import urllib
import glob
import time
import sys
import subprocess
import string

def get_timestamp():
  print(time.time())

def install_dumpling():
  if (not os.path.isfile(dumplingPath)):
    url = "https://dumpling.azurewebsites.net/api/client/dumpling.py"
    scriptPath = os.path.dirname(os.path.realpath(__file__))
    downloadLocation = scriptPath + "/dumpling.py"
    urllib.urlretrieve(url, downloadLocation)
    subprocess.call([sys.executable, downloadLocation, "install", "--update"])
  subprocess.call([sys.executable, dumplingPath, "install", "--full"])

def ensure_installed():
  if (not os.path.isfile(dumplingPath)):
    print("Dumpling has not been installed yet. Please run \"DumplingHelper.py install_dumpling\" before collect_dumps.")
    sys.exit(1)

def find_latest_dump(folder, startTimeStr):
  startTime = float(startTimeStr)
  globPattern = "/*";

  # Outside of Windows, core files are generally dumped into the executable's directory,
  # so it may have many other files in it. Filter those out.
  if sys.platform != "win32":
    globPattern = "/*core*"

  allFiles = glob.glob(folder + globPattern);
  if allFiles:
    latestFile = max(allFiles, key=os.path.getmtime)
    latestTime = os.path.getmtime(latestFile)
    if (latestTime > startTime):
      return latestFile
  return None

{'fraction_non_alphanumeric': 0.11797543729065872, 'fraction_numerical': 0.002232973576479345, 'mean_word_length': 4.430303030303031, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3836979', 'n_tokens_mistral': 863, 'n_tokens_neox': 843, 'n_words': 226}