<commit_before>import frontend, backend, common
import argparse, os, shutil

def collect_stray_output(project_list, out_dir):
  dljc_out_dir = os.path.join(out_dir, common.DLJC_OUTPUT_DIR)
  common.mkdir(dljc_out_dir)

  jaif_out_dir = os.path.join(out_dir, "jaif")
  common.mkdir(jaif_out_dir)

  for project in project_list:
    dljc_in_dir = common.get_dljc_dir_for_project(project)
    shutil.move(dljc_in_dir, os.path.join(dljc_out_dir, project))

    shutil.move(os.path.join(common.get_project_dir(project), 'default.jaif'),
                os.path.join(jaif_out_dir, "{}.jaif".format(project)))

  shutil.move(os.path.join(common.CORPUS_DIR, 'corpus.jaif'),
              os.path.join(jaif_out_dir, 'corpus.jaif'))

def main():
  project_list = common.get_project_list()

  parser = argparse.ArgumentParser()

  
  parser.add_argument("-rc", "--recompute_clusters", action="store_true", help="recompute clustering for selected projects")
  parser.add_argument("-c", "--cluster", type=str, help="path to the json file that contains clustering information")
  parser.add_argument("-g", "--graph", action="store_true", help="set to regenerate graphs from the programs")
  parser.add_argument("-d", "--dir", type=str, required=True, help="The output directory")
  parser.add_argument("-p", "--projects", type=str, help="A comma separated list of projects to work with.")
  args = parser.parse_args()

  if args.projects:
    arg_projects = args.projects.split(',')
    project_list = [project for project in project_list if project in arg_projects]

  args.dir = os.path.abspath(os.path.join('results', args.dir))<commit_msg>Move class_info.json to results dir in cleanup script<commit_after>import frontend, backend, common
import argparse, os, shutil

def collect_stray_output(project_list, out_dir):
  dljc_out_dir = os.path.join(out_dir, common.DLJC_OUTPUT_DIR)
  common.mkdir(dljc_out_dir)

  jaif_out_dir = os.path.join(out_dir, "jaif")
  common.mkdir(jaif_out_dir)

  shutil.move(os.path.join(common.WORKING_DIR, 'class_info.json'),
              os.path.join(out_dir, 'class_info.json'))

  for project in project_list:
    dljc_in_dir = common.get_dljc_dir_for_project(project)
    shutil.move(dljc_in_dir, os.path.join(dljc_out_dir, project))

    shutil.move(os.path.join(common.get_project_dir(project), 'default.jaif'),
                os.path.join(jaif_out_dir, "{}.jaif".format(project)))

  shutil.move(os.path.join(common.CORPUS_DIR, 'corpus.jaif'),
              os.path.join(jaif_out_dir, 'corpus.jaif'))

def main():
  project_list = common.get_project_list()

  parser = argparse.ArgumentParser()

  
  parser.add_argument("-rc", "--recompute_clusters", action="store_true", help="recompute clustering for selected projects")
  parser.add_argument("-c", "--cluster", type=str, help="path to the json file that contains clustering information")
  parser.add_argument("-g", "--graph", action="store_true", help="set to regenerate graphs from the programs")
  parser.add_argument("-d", "--dir", type=str, required=True, help="The output directory")
  parser.add_argument("-p", "--projects", type=str, help="A comma separated list of projects to work with.")
  args = parser.parse_args()

  if args.projects:
    arg_projects = args.projects.split(',')
    project_list = [project for project in project_list if project in arg_projects]

  args.dir = os.path.abspath(os.path.join('results', args.dir))
{'fraction_non_alphanumeric': 0.1402688486265342, 'fraction_numerical': 0.0, 'mean_word_length': 4.841296928327645, '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': '3458689', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1147, 'n_words': 230}