Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# This demonstrates doing multiple metadata fetches in parallel. | |
# It seems to be fast enough that the json decoding cost becomes | |
# a significant proportion of the execution time. | |
# It requires gevent; see http://www.gevent.org/intro.html#installation | |
# To make this do something useful, modify do_work(). | |
import gevent |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/usr/bin/env python | |
""" Check if an item on archive.org has an acoustid. | |
Usage: | |
./check_for_acoustid.py {item} | |
Usage with GNU Parallel: | |
cat itemlist.txt | parallel --max-procs=8 --group './check_for_acoustid.py {}' |