<commit_before>import _hasher_obj_py as hop
import sys

if __name__ == "__main__":
    hasher = hop.new_HasherObjectPy()
    # setters are not working?
    up_path = hop.HasherObjectPy_get_base_updatepath(hasher)
    print(up_path)
    hop.HasherObjectPy_set_base_updatepath(hasher, "/home/ubuntu/memex/update/indexing/")
    up_path = hop.HasherObjectPy_get_base_updatepath(hasher)
    print(up_path)
    hop.HasherObjectPy_set_base_modelpath(hasher, "/home/ubuntu/memex/data/")
    status = hop.HasherObjectPy_initialize(hasher)
    if status != 0:
        print("Hasher was not able to initialize")
        sys.exit(-1)
    featurefilename = "/home/ubuntu/memex/DeepSentiBank_memex/cu_image_search/www/1480830128.81.dat"
    hop.HasherObjectPy_set_query_feats_from_disk(hasher, featurefilename)
    hop.HasherObjectPy_set_outputfile(hasher, featurefilename[:-4])
    out_res = hop.HasherObjectPy_find_knn_nodiskout(hasher)
    #delete_HasherObjectPy(hasher)<commit_msg>test python<commit_after>import _hasher_obj_py as hop
import sys

if __name__ == "__main__":
    hasher = hop.new_HasherObjectPy()
    # setters are not working?
    up_path = hop.HasherObjectPy_get_base_updatepath(hasher)
    print(up_path)
    hop.HasherObjectPy_set_base_updatepath(hasher, "/home/ubuntu/memex/update/indexing/")
    up_path = hop.HasherObjectPy_get_base_updatepath(hasher)
    print(up_path)
    hop.HasherObjectPy_set_base_modelpath(hasher, "/home/ubuntu/memex/data/")
    status = hop.HasherObjectPy_initialize(hasher)
    if status != 0:
        print("Hasher was not able to initialize")
        sys.exit(-1)
    featurefilename = "/home/ubuntu/memex/DeepSentiBank_memex/cu_image_search/www/1480830128.81.dat"
    featurefilename = "../../../scripts/index_update_8525658676137_5411457.dat"
    hop.HasherObjectPy_set_query_feats_from_disk(hasher, featurefilename)
    hop.HasherObjectPy_set_outputfile(hasher, featurefilename[:-4])
    hop.HasherObjectPy_find_knn(hasher)
    hop.HasherObjectPy_set_query_feats_from_disk(hasher, featurefilename)
    out_res = hop.HasherObjectPy_find_knn_nodiskout(hasher)
    #delete_HasherObjectPy(hasher)
{'fraction_non_alphanumeric': 0.09878277153558053, 'fraction_numerical': 0.023408239700374533, 'mean_word_length': 4.952646239554317, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7244316', 'n_tokens_mistral': 806, 'n_tokens_neox': 769, 'n_words': 97}