# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/utilities.py
# TOKENIZER = None
# ACK_LANGUAGE_MAP = {
#     'c': 'cc',
#     'c++': 'cpp',
#     'c#': 'csharp',
#     'objective-c': 'objc',
#     'ojective-c++': 'objcpp',
# }
# def get_cache_hits():
# def get_loc(path, files=None):
# def search(
#     pattern, path, recursive=True, whole=False, ignorecase=False, include=None,
#     exclude=None
# ):
# def url_to_json(url, headers={}):
# def get_repo_path(repo_id, repositories_dir):
# def clone(owner, name, directory, date=None):
# def read(jsonfile):
# def parse_datetime_delta(datetime_delta):
# def is_cloneable(owner, name):
# def get_files(path, language):


import argparse
import os
import random
import sys
import threading
import time
from lib.core import establish_database_connection
from lib.core import init_attribute_plugins
from lib.core import load_attribute_plugins
from lib.core import process_configuration
from lib.core import process_repository
from lib.core import save_result
from lib.core import get_run_id
from lib.utilities import is_dir
        Dictionary of parsed commandline arguments.
    """
    parser = argparse.ArgumentParser(
        description='Calculate the score of a repository.'
    )
    parser.add_argument(
        '-c',
        '--config',
        type=argparse.FileType('r'),
        default='config.json',
        dest='config_file',
        help='Path to the configuration file.'
    )
    parser.add_argument(
        '-p',
        '--plugins',
        type=is_dir,
        default='attributes',
        dest='plugins_dir',
        help='Path to the folder containing your set of attribute plugins.'
    )
    parser.add_argument(
        'repository_id',
        type=int,
        nargs=1,
        help='Identifier for a project as it appears in the \
              GHTorrent database.'
    )
    parser.add_argument(
        'repository_path',

# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/utilities.py
# TOKENIZER = None
# ACK_LANGUAGE_MAP = {
#     'c': 'cc',
#     'c++': 'cpp',
#     'c#': 'csharp',
#     'objective-c': 'objc',
#     'ojective-c++': 'objcpp',
# }
# def get_cache_hits():
# def get_loc(path, files=None):
# def search(
#     pattern, path, recursive=True, whole=False, ignorecase=False, include=None,
#     exclude=None
# ):
# def url_to_json(url, headers={}):
# def get_repo_path(repo_id, repositories_dir):
# def clone(owner, name, directory, date=None):
# def read(jsonfile):
# def parse_datetime_delta(datetime_delta):
# def is_cloneable(owner, name):
# def get_files(path, language):


# Path: score_repo.py
import argparse
import os
import random
import sys
import threading
import time
from lib.core import establish_database_connection
from lib.core import init_attribute_plugins
from lib.core import load_attribute_plugins
from lib.core import process_configuration
from lib.core import process_repository
from lib.core import save_result
from lib.core import get_run_id
from lib.utilities import is_dir

        Dictionary of parsed commandline arguments.
    """
    parser = argparse.ArgumentParser(
        description='Calculate the score of a repository.'
    )
    parser.add_argument(
        '-c',
        '--config',
        type=argparse.FileType('r'),
        default='config.json',
        dest='config_file',
        help='Path to the configuration file.'
    )
    parser.add_argument(
        '-p',
        '--plugins',
        type=is_dir,
        default='attributes',
        dest='plugins_dir',
        help='Path to the folder containing your set of attribute plugins.'
    )
    parser.add_argument(
        'repository_id',
        type=int,
        nargs=1,
        help='Identifier for a project as it appears in the \
              GHTorrent database.'
    )
    parser.add_argument(
        'repository_path',

        type=is_dir,