The sort key function for the search results
    Input:
        response_item: the tuple of (code, snippet)
    output:
        sortable value, the greatest first

def result_sort_key(response_item):
    """
    The sort key function for the search results
    Input:
        response_item: the tuple of (code, snippet)
    output:
        sortable value, the greatest first
    """
    code, snippet = response_item

    snippet_length = len(snippet)
    freq = search_freq.get(code, 0)
    beta = 0.05
    score = math.log(freq * 0.05 + 1) / (snippet_length + 1)

    return score