for key in f_dict.keys():
    print "key: " + str(key)

for key in f_dict.mget([123, 456]):
    print key.first
    print key.second

f_dict.set_keydimensions([1, 2, 3])

fastdict.save_compress_int("test.dict", f_dict)

f_dict = fastdict.FastCompressIntDict(8)

print f_dict.size()

fastdict.load_compress_int("test.dict", f_dict)

print f_dict.size()
 
f_dict_merge_source = fastdict.FastCompressIntDict(8)

f_dict_merge_source.set(789, 123, 3)

print f_dict_merge_source.size()
 
for key in f_dict_merge_source.keys():
    print "key: " + str(key)

f_dict.merge(f_dict_merge_source)

print "merged: "
for key in f_dict.keys():
    print "key: " + str(key)

for key in f_dict.mget([123, 456]):
    print key.first
    print key.second

f_dict.set_keydimensions([1, 2, 3])

fastdict.save_compress_int("test.dict", f_dict)

f_dict = fastdict.FastCompressIntDict(8)

print f_dict.size()

fastdict.load_compress_int("test.dict", f_dict)

print f_dict.size()

f_dict_merge_source = fastdict.FastCompressIntDict(8)

f_dict_merge_source.set(789, 123, 3)

print f_dict_merge_source.size()

for key in f_dict_merge_source.keys():
    print "key: " + str(key)

f_dict.merge(f_dict_merge_source)

print "merged: "
Exemple #3
0
#!/usr/bin/env python

import fastdict
import numpy as np
import argparse

parser = argparse.ArgumentParser(
    description='Tools for investigating dict file.')
parser.add_argument('-f', help='The filename of dict.')
args = parser.parse_args()

f_dict = fastdict.FastCompressIntDict(32)
fastdict.load_compress_int(args.f, f_dict)
print f_dict.size()

for key in f_dict.keys():
    print "key: " + str(key)

    for ele in f_dict.get(key):
        print ele
        print ele.first
        print ele.second
Exemple #4
0
#!/usr/bin/env python

import fastdict
import numpy as np
import argparse

parser = argparse.ArgumentParser(description = 'Tools for investigating dict file.')
parser.add_argument('-f', help = 'The filename of dict.')
args = parser.parse_args()

f_dict = fastdict.FastCompressIntDict(32)
fastdict.load_compress_int(args.f, f_dict)
print f_dict.size()
 
for key in f_dict.keys():
    print "key: " + str(key)

    for ele in f_dict.get(key):
        print ele
        print ele.first
        print ele.second