<commit_before>from os.path import join, relpath
import os
import subprocess

os.environ['DJANGO_SETTINGS_MODULE'] = 'make.generate.django_settings'
from django.template.loader import render_to_string

import make.config as config
import util

def generate_deps():
  """Generate deps.js"""
  calc_deps = join(config.CLOSURE_LIBRARY, 'closure', 'bin', 'calcdeps.py')

  deps_file = join(config.JS_TEST_PATH, 'deps.js')
  subprocess.check_call(
      ['python', calc_deps, 
       '--dep={0}'.format(config.CLOSURE_LIBRARY),
       '--path={0}'.format(config.JS_PATH),
       '--path={0}'.format(config.JS_TEST_PATH),
       '--output_mode=deps',
       '--output_file={0}'.format(deps_file)])

def generate_alltests():
  """Generate alltests.js"""
  tests = []
  for dirpath,dirname,filenames in os.walk(config.JS_TEST_PATH):
    for filename in filenames:
      if filename.endswith('_test.html'):
        file = join(dirpath, filename)
        file = relpath(file, config.JS_TEST_PATH)
        tests.append(file)

  rendered = render_to_string('alltests.js', { 'tests': tests })
  path = join(config.JS_TEST_PATH, 'alltests.js')
  util.write_file(rendered, path, remove_blank_lines=True)

<commit_msg>Changed js_test to generate deps.js in new location.<commit_after>from os.path import join, relpath
import os
import subprocess

os.environ['DJANGO_SETTINGS_MODULE'] = 'make.generate.django_settings'
from django.template.loader import render_to_string

import make.config as config
import util

def generate_deps():
  """Generate deps.js"""
  calc_deps = join(config.CLOSURE_LIBRARY, 'closure', 'bin', 'calcdeps.py')

  deps_file = join(config.JS_DEST, 'deps.js')
  subprocess.check_call(
      ['python', calc_deps, 
       '--dep={0}'.format(config.CLOSURE_LIBRARY),
       '--path={0}'.format(config.JS_PATH),
       '--path={0}'.format(config.JS_TEST_PATH),
       '--output_mode=deps',
       '--output_file={0}'.format(deps_file)])
  os.chmod(deps_file, 0755)

def generate_alltests():
  """Generate alltests.js"""
  tests = []
  for dirpath,dirname,filenames in os.walk(config.JS_TEST_PATH):
    for filename in filenames:
      if filename.endswith('_test.html'):
        file = join(dirpath, filename)
        file = relpath(file, config.JS_TEST_PATH)
        tests.append(file)

  rendered = render_to_string('alltests.js', { 'tests': tests })
  path = join(config.JS_TEST_PATH, 'alltests.js')
  util.write_file(rendered, path, remove_blank_lines=True)


{'fraction_non_alphanumeric': 0.145985401459854, 'fraction_numerical': 0.004866180048661801, 'mean_word_length': 4.237791932059448, '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': '7128080', 'n_tokens_mistral': 878, 'n_tokens_neox': 861, 'n_words': 155}