# 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 sys
from lib import utilities



def run(project_id, repo_path, cursor, **options):
    threshold = options.get('threshold', 0)

    cursor.execute('SELECT url FROM projects WHERE id = {}'.format(project_id))
    record = cursor.fetchone()

    full_url = utilities.TOKENIZER.tokenize(record[0].rstrip())

# 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: attributes/stars/main.py
import sys
from lib import utilities




def run(project_id, repo_path, cursor, **options):
    threshold = options.get('threshold', 0)

    cursor.execute('SELECT url FROM projects WHERE id = {}'.format(project_id))
    record = cursor.fetchone()

    full_url = utilities.TOKENIZER.tokenize(record[0].rstrip())

    json_response = utilities.url_to_json(full_url)