<commit_before>#!/usr/bin/env python
"""
This is the launcher for Titan
"""

import logging
from subprocess import Popen, PIPE
from os import listdir
from sys import argv
from os.path import dirname, realpath, isfile, join, splitext, basename
from collections import namedtuple
from itertools import chain
from socket import gethostname
from time import strftime, gmtime

# Types
TiLanguage = namedtuple("TiLanguage", "supported_extensions execution_string")

# Configurations
logging.basicConfig(format='%(message)s', level=logging.INFO)

# Contants
CURRENT_DIR = dirname(realpath(__file__))

PUBLIC_MODULES_DIR = join(CURRENT_DIR, "modules/public/")
PRIVATE_MODULES_DIR = join(CURRENT_DIR, "modules/private/")

# Log Directory
LOG_DIR = join(CURRENT_DIR, "log")

# Report Directory
REPORT_DIR = join(CURRENT_DIR, "reports")

# Get Hostname
HOSTNAME = gethostname()

# Get Runtime
DATE = strftime("%Y-%m-%dT%H:%M:%S%z", gmtime())

# Get modules
MODULES = [
    join(PUBLIC_MODULES_DIR, fname) for fname in listdir(PUBLIC_MODULES_DIR)\
    if isfile(join(PUBLIC_MODULES_DIR, fname))
]

PYTHON_LANGUAGE = TiLanguage(
    supported_extensions = [".py", ".pyc"],
    execution_string = "python",
)

RUBY_LANGUAGE = TiLanguage(
    supported_extensions = [".rb"],
    execution_string = "ruby"
)

BASH_LANGUAGE = TiLanguage(
    supported_extensions = [".bash", ".sh"],
    execution_string = "/bin/bash"
)

SUPPORTED_LANGUAGES = [
    PYTHON_LANGUAGE,
    RUBY_LANGUAGE,
    BASH_LANGUAGE,
]

# Set Debugging
test = False
<commit_msg>added php as a language type<commit_after>#!/usr/bin/env python
"""
This is the launcher for Titan
"""

import logging
from subprocess import Popen, PIPE
from os import listdir
from sys import argv
from os.path import dirname, realpath, isfile, join, splitext, basename
from collections import namedtuple
from itertools import chain
from socket import gethostname
from time import strftime, gmtime

# Types
TiLanguage = namedtuple("TiLanguage", "supported_extensions execution_string")

# Configurations
logging.basicConfig(format='%(message)s', level=logging.INFO)

# Contants
CURRENT_DIR = dirname(realpath(__file__))

PUBLIC_MODULES_DIR = join(CURRENT_DIR, "modules/public/")
PRIVATE_MODULES_DIR = join(CURRENT_DIR, "modules/private/")

# Log Directory
LOG_DIR = join(CURRENT_DIR, "log")

# Report Directory
REPORT_DIR = join(CURRENT_DIR, "reports")

# Get Hostname
HOSTNAME = gethostname()

# Get Runtime
DATE = strftime("%Y-%m-%dT%H:%M:%S%z", gmtime())

# Get modules
MODULES = [
    join(PUBLIC_MODULES_DIR, fname) for fname in listdir(PUBLIC_MODULES_DIR)\
    if isfile(join(PUBLIC_MODULES_DIR, fname))
]

PYTHON_LANGUAGE = TiLanguage(
    supported_extensions = [".py", ".pyc"],
    execution_string = "python",
)

RUBY_LANGUAGE = TiLanguage(
    supported_extensions = [".rb"],
    execution_string = "ruby"
)

BASH_LANGUAGE = TiLanguage(
    supported_extensions = [".bash", ".sh"],
    execution_string = "/bin/bash"
)

PHP_LANGUAGE = TiLanguage(
    supported_extensions = [".php"],
    execution_string = "php"
)

SUPPORTED_LANGUAGES = [
    PYTHON_LANGUAGE,
    RUBY_LANGUAGE,
    BASH_LANGUAGE,
    PHP_LANGUAGE,
]

# Set Debugging
test = False

{'fraction_non_alphanumeric': 0.11532434973362582, 'fraction_numerical': 0.0, 'mean_word_length': 5.1980582524271846, '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': '2835051', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1097, 'n_words': 262}