<commit_before>from __future__ import division

def run():
  import os
  import libtbx.load_env
  from libtbx.test_utils import show_diff
  from libtbx import easy_run
  from glob import glob
  try:
    dials_regression = libtbx.env.dist_path('dials_regression')
  except KeyError, e:
    print 'FAIL: dials_regression not configured'
    exit(0)

  path = os.path.join(dials_regression, "centroid_test_data")

  # import the data
  cmd = "dials.import %s output=datablock.json" % ' '.join(glob(os.path.join(path,"*.cbf")))
  easy_run.fully_buffered(cmd).raise_if_errors()
  assert os.path.exists("datablock.json")

  # find the spots
  cmd = "dials.find_spots datablock.json min_spot_size=3"
  easy_run.fully_buffered(cmd).raise_if_errors()
  assert os.path.exists("strong.pickle")

  cmd = "dials.spot_counts_per_image datablock.json strong.pickle plot=spot_counts.png"
  result = easy_run.fully_buffered(cmd).raise_if_errors()
  assert os.path.exists("spot_counts.png")

  assert (
    "|image | #spots | #spots_no_ice | #spots_4A | total_intensity |" + \<commit_msg>fix test<commit_after>from __future__ import division

def run():
  import os
  import libtbx.load_env
  from libtbx.test_utils import show_diff
  from libtbx import easy_run
  from glob import glob
  try:
    dials_regression = libtbx.env.dist_path('dials_regression')
  except KeyError, e:
    print 'FAIL: dials_regression not configured'
    exit(0)

  path = os.path.join(dials_regression, "centroid_test_data")

  # import the data
  cmd = "dials.import %s output=datablock.json" % ' '.join(glob(os.path.join(path,"*.cbf")))
  easy_run.fully_buffered(cmd).raise_if_errors()
  assert os.path.exists("datablock.json")

  # find the spots
  cmd = "dials.find_spots datablock.json min_spot_size=3"
  easy_run.fully_buffered(cmd).raise_if_errors()
  assert os.path.exists("strong.pickle")

  cmd = "dials.spot_counts_per_image datablock.json strong.pickle plot=spot_counts.png"
  result = easy_run.fully_buffered(cmd).raise_if_errors()
  assert os.path.exists("spot_counts.png")

  assert (
    "|image | #spots | #spots_no_ice | total_intensity |" + \
{'fraction_non_alphanumeric': 0.11681582666038624, 'fraction_numerical': 0.0023551577955723034, 'mean_word_length': 4.709677419354839, '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': '3098985', 'n_tokens_mistral': 793, 'n_tokens_neox': 764, 'n_words': 146}