# 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 distutils.spawn
import importlib
import multiprocessing
import os
import shutil
import sys
import types
import traceback
import attributes
from datetime import datetime
from lib import utilities

        self._parse_attributes(attributes, **goptions)
        self._parse_keystring(keystring)

    def global_init(self, samples):
        try:
            if not self._validate_dependencies():
                raise Exception(
                    'Missing dependencies must be installed to continue.'
                )

            self.database.connect()
            for attribute in self.attributes:
                if hasattr(attribute.reference, 'global_init'):
                    with self.database.cursor() as cursor:
                        attribute.reference.global_init(cursor, samples)
        finally:
            self.database.disconnect()

    def run(self, project_id, repository_root):
        rresults = dict()
        repository_home = os.path.join(repository_root, str(project_id))
        outq = multiprocessing.Queue(maxsize=1)

        try:
            self.database.connect()

            repository_path = None
            if self.requires_source:
                repository_path = self._init_repository(

# 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: lib/attributes.py
import distutils.spawn
import importlib
import multiprocessing
import os
import shutil
import sys
import types
import traceback
import attributes
from datetime import datetime
from lib import utilities


        self._parse_attributes(attributes, **goptions)
        self._parse_keystring(keystring)

    def global_init(self, samples):
        try:
            if not self._validate_dependencies():
                raise Exception(
                    'Missing dependencies must be installed to continue.'
                )

            self.database.connect()
            for attribute in self.attributes:
                if hasattr(attribute.reference, 'global_init'):
                    with self.database.cursor() as cursor:
                        attribute.reference.global_init(cursor, samples)
        finally:
            self.database.disconnect()

    def run(self, project_id, repository_root):
        rresults = dict()
        repository_home = os.path.join(repository_root, str(project_id))
        outq = multiprocessing.Queue(maxsize=1)

        try:
            self.database.connect()

            repository_path = None
            if self.requires_source:
                repository_path = self._init_repository(

                    project_id, repository_home