<commit_before>#!/usr/bin/env python
#
# Avalanche
#
# Git clones avalanche and installs it
#
# Author <NAME> - 17/10/2012 <<EMAIL>> : First revision
####################################################################################################
import localpackage
import os

class Avalanche(localpackage.LocalPackage):
    """ Base class for avalanche."""
    def __init__(self, name, system, root_dep):
        """ Initialise avalanche."""
        self._root_dep = root_dep
        super(Avalanche, self).__init__(name, system)
    def get_dependencies(self):
        """ Depends on rat-dev and root."""
        return ["rat-dev", "rattools-dev", self._root_dep]
    def _is_downloaded(self):
        """ Check if downloaded."""
        return os.path.exists(self.get_install_path())
    def _is_installed(self):
        return self._system.library_exists("libavalanche", os.path.join(self.get_install_path(), 
                                                                        "lib"))
    def _download(self):
        """ Git clone rat-dev."""
        self._system.execute_command("git", ["clone", "<EMAIL>:mastbaum/avalanche.git",
                                             self.get_install_path()],
                                     verbose=True)
    def _install(self):
        """ Install Avalanche."""
        env = {"RATROOT" : self._dependency_paths["rat-dev"],
               "ROOTSYS" : self._dependency_paths[self._root_dep],
               "RATZDAB_ROOT" : os.path.join(self._dependency_paths["rattools-dev"], "ratzdab"),
               "PATH" : os.path.join(self._dependency_paths[self._root_dep], "bin"),
               "LD_LIBRARY_PATH" : os.path.join(self._dependency_paths[self._root_dep], "lib")}
        self._system.execute_command("make", [], env=env)
    def _update(self):
        """ Special updater for rat-tools, just git pull then install again."""
        self._system.execute_command("git", ["pull"], cwd=self.get_install_path(), verbose=True)
        self._install()
<commit_msg>Fixed avalanche installer bug.<commit_after>#!/usr/bin/env python
#
# Avalanche
#
# Git clones avalanche and installs it
#
# Author <NAME> - 17/10/2012 <<EMAIL>> : First revision
####################################################################################################
import localpackage
import os

class Avalanche(localpackage.LocalPackage):
    """ Base class for avalanche."""
    def __init__(self, name, system, root_dep):
        """ Initialise avalanche."""
        self._root_dep = root_dep
        super(Avalanche, self).__init__(name, system)
    def get_dependencies(self):
        """ Depends on rat-dev and root."""
        return ["rat-dev", "rattools-dev", self._root_dep]
    def _is_downloaded(self):
        """ Check if downloaded."""
        return os.path.exists(self.get_install_path())
    def _is_installed(self):
        return self._system.library_exists("libavalanche", os.path.join(self.get_install_path(), 
                                                                        "lib"))
    def _download(self):
        """ Git clone rat-dev."""
        self._system.execute_command("git", ["clone", "<EMAIL>:mastbaum/avalanche.git",
                                             self.get_install_path()],
                                     verbose=True)
    def _install(self):
        """ Install Avalanche."""
        env = {"RATROOT" : self._dependency_paths["rat-dev"],
               "ROOTSYS" : self._dependency_paths[self._root_dep],
               "RATZDAB_ROOT" : os.path.join(self._dependency_paths["rattools-dev"], "ratzdab"),
               "PATH" : os.path.join(self._dependency_paths[self._root_dep], "bin"),
               "LD_LIBRARY_PATH" : os.path.join(self._dependency_paths[self._root_dep], "lib")}
        self._system.execute_command("make", [], self.get_install_path(), env=env)
    def _update(self):
        """ Special updater for rat-tools, just git pull then install again."""
        self._system.execute_command("git", ["pull"], cwd=self.get_install_path(), verbose=True)
        self._install()

{'fraction_non_alphanumeric': 0.183349609375, 'fraction_numerical': 0.00390625, 'mean_word_length': 2.6033421284080913, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4587039', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1116, 'n_words': 220}