This is mostly, but admittedly not entirely, refactoring. Major themes:
PEP8/style fixes, e.g. 80-character line limits, not using single-letter
variables (other than inside list comprehensions).
Eliminating unused things (commented-out code, some unused arguments).
A little casual renaming ("workspace_id" for "account_id", "concept_count"
for "term_count")
A sys.exit() in place of setting concept_lists to None when no concept lists
are specified (should have the same effect, because concept_lists was then
iterated over, so "None" would have caused a crash).
Some bail-out-early changes to avoid overindentation, i.e. instead of "if X:
do Y", use "if not X: continue" and then "do Y" de-indented.
Change [float(v) for v in unpack64(vector)] to unpack64(vector).tolist(),
which is numpy's builtin function for turning a vector into a list (and
recasting its numpy.floats to floats).
Inlining of some extended dictionary creation, as well as making
create_sentiment_table() consistent in iterating over a list vs. list
comprehension
This is mostly, but admittedly not entirely, refactoring. Major themes:
PEP8/style fixes, e.g. 80-character line limits, not using single-letter variables (other than inside list comprehensions).
Eliminating unused things (commented-out code, some unused arguments).
A little casual renaming ("workspace_id" for "account_id", "concept_count" for "term_count")
A sys.exit() in place of setting concept_lists to None when no concept lists are specified (should have the same effect, because concept_lists was then iterated over, so "None" would have caused a crash).
Some bail-out-early changes to avoid overindentation, i.e. instead of "if X: do Y", use "if not X: continue" and then "do Y" de-indented.
Change [float(v) for v in unpack64(vector)] to unpack64(vector).tolist(), which is numpy's builtin function for turning a vector into a list (and recasting its numpy.floats to floats).
Inlining of some extended dictionary creation, as well as making create_sentiment_table() consistent in iterating over a list vs. list comprehension