You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
1.0 KiB
12 lines
1.0 KiB
from multiprocessing import Pool
|
|
def f(x):
|
|
print x["Id"]
|
|
print x["RId"]
|
|
def hehe():
|
|
data = {"expr" : "Id = 2153635508","entities" : [{ "logprob":-13.530, "Id":2153635508, "Ti":"libsvm a library for support vector machines", "Y":2011, "CC":7688, "RId":[2060367530, 2109943925, 1576520375, 1512098439, 2172000360, 2087347434, 2124351082, 2104978738, 1618905105, 2132870739, 2157239837, 2161920802, 1510526001, 2056983531, 1480229055, 2151040995, 1621799579, 2153104898, 1543810117, 2137346077, 2141057577, 2047542122, 2097850441, 2140586694, 2164938337, 2137285073, 2103568877, 2138907228, 2145276325, 2096613134, 1556115774, 2110899801, 1564719599, 1775273161, 2039402388, 2100967622, 34176136, 2139526185, 2011741120, 122929263, 2137518678, 2218312210], "AA":[{"AuId":2138800916,"AfId":16733864}, {"AuId":2168176072,"AfId":16733864}] }]}
|
|
pool = Pool(processes=4) # start 4 worker processes
|
|
pool.map(f, data["entities"])
|
|
pool.close()
|
|
pool.join()
|
|
if __name__ == '__main__':
|
|
hehe() |