<commit_before>#!/usr/bin/env python
#
# Checkout files from the SWIG library into Subversion's proxy directory
#

import sys, os, re, fileinput
if __name__ == "__main__":
  parent_dir = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0])))
  sys.path[0:0] = [ parent_dir, os.path.dirname(parent_dir) ]
import generator.swig
from gen_base import build_path_splitfile, build_path_join
from generator.util.executable import run

class Generator(generator.swig.Generator):

  def write(self):
    """Checkout all files"""
    for path in self.swig_checkout_files:
      self.checkout(path)

  def write_makefile_rules(self, makefile):
    """Write makefile rules to checkout files"""
    script_path = 'build/generator/swig/checkout_swig_header.py'
    conf = '$(abs_srcdir)/build.conf'
    makefile.write('CHECKOUT_SWIG = cd $(top_srcdir) && $(PYTHON)' +
                   ' %s %s $(SWIG)\n\n' % (script_path, conf))
    checkout_locations = []
    for path in self.swig_checkout_files:
      out = self._output_file(path)
      checkout_locations.append(out)
      makefile.write('%s: %s\n' % (out, script_path) +
                     '\t$(CHECKOUT_SWIG) %s\n\n' % path)<commit_msg>Import the shutil module for use in a conditional case.<commit_after>#!/usr/bin/env python
#
# Checkout files from the SWIG library into Subversion's proxy directory
#

import sys, os, re, fileinput, shutil
if __name__ == "__main__":
  parent_dir = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0])))
  sys.path[0:0] = [ parent_dir, os.path.dirname(parent_dir) ]
import generator.swig
from gen_base import build_path_splitfile, build_path_join
from generator.util.executable import run

class Generator(generator.swig.Generator):

  def write(self):
    """Checkout all files"""
    for path in self.swig_checkout_files:
      self.checkout(path)

  def write_makefile_rules(self, makefile):
    """Write makefile rules to checkout files"""
    script_path = 'build/generator/swig/checkout_swig_header.py'
    conf = '$(abs_srcdir)/build.conf'
    makefile.write('CHECKOUT_SWIG = cd $(top_srcdir) && $(PYTHON)' +
                   ' %s %s $(SWIG)\n\n' % (script_path, conf))
    checkout_locations = []
    for path in self.swig_checkout_files:
      out = self._output_file(path)
      checkout_locations.append(out)
      makefile.write('%s: %s\n' % (out, script_path) +
                     '\t$(CHECKOUT_SWIG) %s\n\n' % path)
{'fraction_non_alphanumeric': 0.13240131578947367, 'fraction_numerical': 0.0024671052631578946, 'mean_word_length': 3.751953125, 'pattern_counts': {'":': 2, '<': 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': '3510458', 'n_tokens_mistral': 851, 'n_tokens_neox': 836, 'n_words': 179}