Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias Import alias identifier ImportFrom alias alias Import alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str Str Num attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Num Num Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Num FunctionDef arguments args NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad orelse With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad Call NameLoad keyword Str keyword NameLoad attr NameLoad Assign NameStore ListComp Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body ImportFrom alias ImportFrom alias Import alias Expr Call NameLoad Str Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr keyword Call NameLoad Call AttributeLoad NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr Str attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return ListComp NameLoad comprehension NameStore NameLoad CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Call Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore DictComp NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad Num Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Assign NameStore Call NameLoad NameLoad Assert CompareEq Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad keyword Call AttributeLoad NameLoad attr NameLoad keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Lambda arguments args defaults Call NameLoad ListComp SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Num Index Num comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore TupleLoad Num NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad decorator_list Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr Call NameLoad BinOpAdd ListLoad NameLoad ListComp Call NameLoad comprehension NameStore Call NameLoad NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args defaults Call NameLoad ListComp BinOpSub Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore TupleLoad Num NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad decorator_list Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr Call NameLoad BinOpAdd ListLoad NameLoad ListComp Call NameLoad comprehension NameStore Call NameLoad NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Call NameLoad BinOpMod Str NameLoad ImportFrom alias Assign NameStore Call NameLoad keyword Call NameLoad keyword Call AttributeLoad NameLoad attr NameLoad keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp BinOpAdd BinOpSub NameLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword Num ExtSlice Index NameLoad Slice BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr comprehension NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args defaults body Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr ListComp Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad keyword NameLoad comprehension NameStore Call NameLoad NameLoad Call NameLoad NameLoad Assert Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Num AugAssignDiv NameStore SubscriptLoad Call AttributeLoad NameLoad attr keyword Num ExtSlice Slice Index NameLoad AugAssignAdd NameStore Call AttributeLoad NameLoad attr ListComp Call AttributeLoad Call NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index NameLoad ExtSlice Index NameLoad Slice comprehension NameStore Call NameLoad NameLoad Return NameLoad decorator_list Assign NameStore TupleLoad Num NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad decorator_list Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr Call NameLoad BinOpAdd ListLoad NameLoad ListComp Call NameLoad comprehension NameStore Call NameLoad NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Str Expr Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad keyword Call NameLoad keyword Call AttributeLoad NameLoad attr NameLoad keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpMult Num Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpMult Num Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args defaults Call NameLoad ListComp SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Num Index Num comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore TupleLoad Num NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad decorator_list Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr Call NameLoad BinOpAdd ListLoad NameLoad ListComp Call NameLoad comprehension NameStore Call NameLoad NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Str Expr Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad keyword Call NameLoad keyword Call AttributeLoad NameLoad attr NameLoad keyword BinOpMult Num Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad keyword BinOpAdd NameLoad Num keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad BinOpDiv Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpMult Num Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad Num NameLoad Assign AttributeStore NameLoad attr BinOpMult Num Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args defaults Call NameLoad ListComp SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Num Index Num comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore TupleLoad Num NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad decorator_list Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr Call NameLoad BinOpAdd ListLoad NameLoad ListComp Call NameLoad comprehension NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Call AttributeLoad NameLoad attr keyword TupleLoad Num Num For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num keyword SubscriptLoad NameLoad Index NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str BinOpMod Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad body Expr Call AttributeLoad NameLoad attr keyword TupleLoad Num Num For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad Call NameLoad NameLoad NameLoad body If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num orelse Assign NameStore AttributeLoad NameLoad attr If NameLoad body Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpMult SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp BinOpSub Call NameLoad SubscriptLoad NameLoad Slice BinOpSub NameLoad NameLoad BinOpAdd NameLoad Num Call AttributeLoad NameLoad attr NameLoad comprehension NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr NameLoad keyword Num keyword SubscriptLoad NameLoad Index NameLoad keyword NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num keyword SubscriptLoad NameLoad Index NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str BinOpMod Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Num attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body If CompareEq AttributeLoad AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad attr attr Num body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad attr ExtSlice Slice Index Num orelse Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad attr Assign NameStore BinOpFloorDiv NameLoad Num Assign NameStore BinOpSub Call NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice Slice NameLoad keyword Num Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad ExtSlice Index NameLoad Index NameLoad Slice NameLoad keyword TupleLoad Num BinOpSub NameLoad NameLoad keyword NameLoad Assign NameStore BinOpSub Call NameLoad NameLoad keyword Num Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr Num Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num AttributeLoad NameLoad attr AugAssignDiv NameStore Call AttributeLoad NameLoad attr AugAssignAdd NameStore Call AttributeLoad Call AttributeLoad Call NameLoad keyword NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore IfExp CompareGt Call NameLoad NameLoad Num BinOpDiv Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad BinOpAdd NameLoad Num Num For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad BinOpMult NameLoad NameLoad BinOpSub SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad keyword SubscriptLoad NameLoad ExtSlice Slice Index NameLoad keyword BinOpMult Num NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword Str Expr Call AttributeLoad NameLoad attr ListLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad BinOpAdd Call AttributeLoad NameLoad attr BinOpMult BinOpAdd NameLoad Num NameLoad Call AttributeLoad NameLoad attr Num Str Expr Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad BinOpAdd Call AttributeLoad NameLoad attr BinOpMult BinOpAdd NameLoad Num NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad BinOpDiv BinOpMult NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str BinOpMod Str NameLoad Str decorator_list FunctionDef arguments args defaults body Assign NameStore Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str BinOpMod Str NameLoad ImportFrom alias If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call NameLoad Str NameLoad Expr Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad Lambda arguments args NameParam defaults CompareGt SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Slice UnaryOpUSub NameLoad comprehension NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Slice UnaryOpUSub NameLoad comprehension NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore Num Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Assign NameStore ListLoad Str Str Str Str Str Assign NameStore ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad For NameStore NameLoad body Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str TupleLoad NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call NameLoad Str NameLoad With Call AttributeLoad NameLoad attr NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Expr Call NameLoad Str NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad With Call AttributeLoad NameLoad attr NameLoad Str NameStore body Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad keyword BinOpMod Str SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad keyword BinOpMod Str SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 
Linear dynamical system model for the AP text dataset.
Each document is modeled as a draw from an LDS with
categorical observations.
 __future__ print_function N/A os N/A re N/A gzip N/A time N/A cPickle N/A operator N/A collections N/A numpy np scipy.misc logsumexp sklearn.feature_extraction.text CountVectorizer N/A matplotlib.pyplot plt hips.plotting.layout create_axis_at_location create_figure N/A brewer2mpl pgmult.lds MultinomialLDS pgmult.particle_lds LogisticNormalMultinomialLDS ParticleSBMultinomialLDS pgmult.hmm MultinomialHMM pgmult.utils pi_to_psi pylds.models DefaultLDS NonstationaryLDS pybasicbayes.distributions GaussianFixed Multinomial Regression pybasicbayes.util.text progprint_xrange autoregressive.distributions AutoRegression N/A colors N/A N/A N/A brewer2mpl get_map Set1 Qualitative 9 mpl_colors N/A goodcolors N/A N/A np array N/A 0 1 2 4 6 7 8 N/A colors N/A N/A N/A np array colors N/A goodcolors N/A N/A N/A np seterr invalid warn N/A N/A N/A N/A np random seed 0 N/A N/A N/A np seterr invalid warn N/A N/A N/A N/A np random seed 0 N/A K 200 load N/A N/A filename N/A None N/A N/A N/A filename None N/A N/A bigstr N/A download_ap N/A N/A N/A open filename r infile N/A N/A bigstr N/A N/A infile read N/A docs N/A N/A re findall (?<=<TEXT> ).*?(?= </TEXT>) N/A N/A bigstr translate None N/A vectorizer N/A N/A N/A CountVectorizer stop_words english max_features K fit docs N/A docs N/A N/A make_onehot_seq doc vectorizer N/A doc docs N/A words N/A N/A vectorizer get_feature_names N/A N/A docs words N/A download_ap N/A N/A N/A N/A cStringIO StringIO urllib2 urlopen N/A tarfile N/A N/A print Downloading AP data... N/A response N/A urlopen http://www.cs.princeton.edu/~blei/lda-c/ap.tgz N/A tar N/A N/A tarfile open fileobj N/A StringIO N/A N/A response read N/A N/A N/A N/A N/A tar extractfile ap/ap.txt read N/A filter_wordseq N/A N/A doc vectorizer N/A N/A N/A N/A w N/A w doc N/A w N/A vectorizer vocabulary_ N/A make_onehot_seq N/A N/A doc vectorizer N/A N/A N/A lst N/A filter_wordseq N/A N/A N/A vectorizer build_analyzer doc vectorizer N/A indices N/A word idx N/A N/A idx word N/A enumerate N/A N/A N/A vectorizer vocabulary_ keys N/A out N/A N/A np zeros N/A N/A len lst N/A len indices N/A N/A wordidx word N/A enumerate lst N/A N/A N/A out N/A N/A wordidx N/A indices N/A word 1 N/A out N/A N/A Results N/A N/A collections namedtuple Results N/A lls test_lls pred_lls samples timestamps fit_lds_model N/A N/A Xs Xtest D N_samples N/A 100 N/A N/A Nx N/A len Xs N/A N/A N/A len Xtest Nx N/A model N/A MultinomialLDS K D init_dynamics_distn N/A GaussianFixed mu N/A N/A np zeros D sigma N/A 1 N/A N/A np eye D dynamics_distn N/A AutoRegression nu_0 N/A D 1 S_0 N/A 1 N/A N/A np eye D M_0 N/A N/A np zeros N/A D D K_0 N/A 1 N/A N/A np eye D sigma_C 1.0 N/A X Xs N/A N/A N/A N/A model add_data X N/A N/A N/A model resample_parameters N/A compute_pred_ll N/A N/A N/A N/A N/A sum N/A N/A N/A N/A model predictive_log_likelihood Xt data_index i M 10 N/A 0 N/A N/A i Xt N/A enumerate Xtest N/A init_results N/A 0 None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll resample N/A N/A N/A N/A N/A tic N/A N/A time time N/A N/A N/A model resample_model N/A toc N/A N/A N/A time time tic N/A N/A toc None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll N/A N/A N/A times samples lls test_lls pred_lls N/A map N/A np array N/A zip N/A N/A init_results N/A N/A resample N/A _ N/A progprint_xrange N_samples perline 5 N/A timestamps N/A N/A np cumsum times N/A N/A Results lls test_lls pred_lls samples timestamps N/A fit_hmm N/A N/A Xs Xtest D_hmm N_samples N/A 100 N/A N/A N/A print N/A Fitting HMM with %d states D_hmm N/A model N/A MultinomialHMM K D_hmm alpha_0 10.0 N/A X Xs N/A N/A N/A N/A model add_data X N/A compute_pred_ll N/A N/A N/A N/A N/A sum N/A N/A N/A N/A model log_likelihood N/A N/A np vstack N/A N/A Xs N/A i N/A Xtest N/A i N/A N/A model log_likelihood N/A Xs N/A i N/A N/A i Xt N/A enumerate Xtest N/A init_results N/A 0 None N/A N/A model log_likelihood N/A N/A model log_likelihood Xtest N/A compute_pred_ll resample N/A N/A N/A N/A N/A tic N/A N/A time time N/A N/A N/A model resample_model N/A toc N/A N/A N/A time time tic N/A N/A toc None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll N/A N/A N/A times samples lls test_lls pred_lls N/A map N/A np array N/A zip N/A N/A init_results N/A N/A resample N/A _ N/A progprint_xrange N_samples perline 5 N/A timestamps N/A N/A np cumsum times N/A N/A Results lls test_lls pred_lls samples timestamps N/A fit_gaussian_lds_model N/A N/A Xs Xtest D_gauss_lds N_samples N/A 100 N/A N/A N/A print N/A Fitting Gaussian (Raw) LDS with %d states D_gauss_lds pylds.models NonstationaryLDS N/A model N/A NonstationaryLDS init_dynamics_distn N/A GaussianFixed mu N/A N/A np zeros D sigma N/A 1 N/A N/A np eye D dynamics_distn N/A AutoRegression nu_0 N/A D 1 S_0 N/A 1 N/A N/A np eye D M_0 N/A N/A np zeros N/A D D K_0 N/A 1 N/A N/A np eye D emission_distn N/A Regression nu_0 N/A K 1 S_0 N/A K N/A N/A np eye K M_0 N/A N/A np zeros N/A K D K_0 N/A K N/A N/A np eye D N/A Xs_centered N/A N/A N/A X N/A N/A N/A np mean X axis 0 N/A N/A None N/A N/A 0.001 N/A N/A N/A np random randn N/A X shape N/A X Xs N/A X Xs_centered N/A N/A N/A N/A model add_data X compute_pred_ll N/A N/A N/A N/A N/A pred_ll 0 N/A N/A i Xt N/A enumerate Xtest N/A N/A Npred 10 N/A Tpred N/A N/A Xt shape N/A 0 N/A preds N/A N/A model sample_predictions N/A Xs_centered N/A i Tpred Npred Npred N/A inds N/A N/A np argmax preds axis 1 N/A pi N/A N/A N/A np array N/A N/A N/A np bincount N/A inds N/A t minlength K N/A t N/A xrange Tpred N/A float Npred N/A N/A N/A np allclose N/A N/A pi sum axis 1 1.0 N/A pi N/A N/A np clip pi 1e-08 1.0 N/A pi N/A N/A N/A pi sum axis 1 N/A N/A N/A None N/A pred_ll N/A N/A np sum N/A N/A N/A N/A Multinomial weights N/A pi N/A t K K log_likelihood N/A N/A Xt N/A t N/A N/A None N/A N/A t N/A xrange Tpred N/A pred_ll N/A N/A init_results N/A 0 None N/A np nan N/A np nan N/A compute_pred_ll resample N/A N/A N/A N/A N/A tic N/A N/A time time N/A N/A N/A model resample_model N/A toc N/A N/A N/A time time tic N/A N/A toc None N/A np nan N/A np nan N/A compute_pred_ll N/A N/A N/A times samples lls test_lls pred_lls N/A map N/A np array N/A zip N/A N/A init_results N/A N/A resample N/A _ N/A progprint_xrange N_samples perline 5 N/A timestamps N/A N/A np cumsum times N/A N/A Results lls test_lls pred_lls samples timestamps N/A fit_ln_lds_model N/A N/A Xs Xtest D N_samples N/A 100 N/A N/A 
    Fit a logistic normal LDS model with pMCMC
     N/A N/A print N/A Fitting Logistic Normal LDS with %d states D N/A model N/A LogisticNormalMultinomialLDS init_dynamics_distn N/A GaussianFixed mu N/A N/A np zeros D sigma N/A 1 N/A N/A np eye D dynamics_distn N/A AutoRegression nu_0 N/A D 1 S_0 N/A D N/A N/A np eye D M_0 N/A N/A np zeros N/A D D K_0 N/A D N/A N/A np eye D emission_distn N/A Regression nu_0 N/A K 1 S_0 N/A K N/A N/A np eye K M_0 N/A N/A np zeros N/A K D K_0 N/A K N/A N/A np eye D N/A N/A model A N/A 0.5 N/A N/A np eye D N/A N/A model sigma_states N/A N/A np eye D N/A N/A model C N/A 0.33 N/A N/A N/A np random randn K D N/A N/A model sigma_obs N/A 0.1 N/A N/A np eye K N/A X Xs N/A N/A N/A N/A model add_data X N/A compute_pred_ll N/A N/A N/A N/A N/A sum N/A N/A N/A N/A model predictive_log_likelihood Xt data_index i Npred 10 N/A 0 N/A N/A i Xt N/A enumerate Xtest N/A init_results N/A 0 None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll resample N/A N/A N/A N/A N/A tic N/A N/A time time N/A N/A N/A model resample_model N/A toc N/A N/A N/A time time tic N/A N/A toc None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll N/A N/A N/A times samples lls test_lls pred_lls N/A map N/A np array N/A zip N/A N/A init_results N/A N/A resample N/A _ N/A progprint_xrange N_samples perline 5 N/A timestamps N/A N/A np cumsum times N/A N/A Results lls test_lls pred_lls samples timestamps N/A fit_lds_model_with_pmcmc N/A N/A Xs Xtest D N_samples N/A 100 N/A N/A 
    Fit a logistic normal LDS model with pMCMC
     N/A N/A print N/A Fitting SBM-LDS with %d states using pMCMC D N/A model N/A ParticleSBMultinomialLDS init_dynamics_distn N/A GaussianFixed mu N/A N/A np zeros D sigma N/A 1 N/A N/A np eye D dynamics_distn N/A AutoRegression nu_0 N/A D 1 S_0 N/A D N/A N/A np eye D M_0 N/A N/A np zeros N/A D D K_0 N/A D N/A N/A np eye D emission_distn N/A Regression nu_0 N/A K 1 S_0 N/A K N/A N/A np eye K M_0 N/A N/A np zeros N/A K D K_0 N/A K N/A N/A np eye D mu N/A pi_to_psi N/A N/A N/A np ones K K N/A N/A model A N/A 0.5 N/A N/A np eye D N/A N/A model sigma_states N/A N/A np eye D N/A N/A model C N/A N/A N/A np random randn N/A K 1 D N/A N/A model sigma_obs N/A 0.1 N/A N/A np eye K N/A X Xs N/A N/A N/A N/A model add_data X N/A compute_pred_ll N/A N/A N/A N/A N/A sum N/A N/A N/A N/A model predictive_log_likelihood Xt data_index i Npred 10 N/A 0 N/A N/A i Xt N/A enumerate Xtest N/A init_results N/A 0 None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll resample N/A N/A N/A N/A N/A tic N/A N/A time time N/A N/A N/A model resample_model N/A toc N/A N/A N/A time time tic N/A N/A toc None N/A N/A model log_likelihood N/A np nan N/A compute_pred_ll N/A N/A N/A times samples lls test_lls pred_lls N/A map N/A np array N/A zip N/A N/A init_results N/A N/A resample N/A _ N/A progprint_xrange N_samples N/A timestamps N/A N/A np cumsum times N/A N/A Results lls test_lls pred_lls samples timestamps N/A plot_log_likelihood N/A N/A results names run outname N/A pred_ll_vs_time.pdf N/A N/A N/A N/A plt figure figsize N/A 3 3.2 N/A N/A i N/A result name N/A enumerate N/A zip results names N/A N/A N/A N/A plt plot N/A result timestamps N/A result lls lw 2 color N/A colors N/A i label name N/A N/A N/A plt legend loc lower right N/A N/A N/A plt xlabel Time (s) N/A N/A N/A plt ylabel Log Likelihood N/A N/A N/A plt savefig N/A N/A N/A os path join results ap N/A run%03d run outname N/A N/A N/A plt tight_layout N/A plot_pred_log_likelihood N/A N/A results names run outname smooth N/A pred_ll_vs_time.pdf True N/A N/A N/A N/A plt figure figsize N/A 3 3.2 N/A N/A i N/A result name N/A enumerate N/A zip results names N/A N/A N/A N/A N/A result pred_lls ndim 2 N/A N/A pred_ll N/A N/A result pred_lls N/A N/A N/A 0 N/A N/A pred_ll N/A result pred_lls N/A smooth N/A N/A win 10 N/A pad_pred_ll N/A N/A np concatenate N/A N/A N/A pred_ll N/A 0 N/A N/A np ones win pred_ll N/A smooth_pred_ll N/A N/A np array N/A N/A N/A logsumexp N/A pad_pred_ll N/A N/A j win N/A j 1 N/A N/A np log win N/A j N/A xrange win N/A pad_pred_ll size N/A N/A N/A plt plot N/A N/A np clip N/A result timestamps 0.001 N/A np inf smooth_pred_ll lw 2 color N/A colors N/A i label name N/A N/A N/A N/A plt plot N/A N/A np clip N/A result timestamps 0.001 N/A np inf N/A result pred_lls lw 2 color N/A colors N/A i label name N/A N/A N/A plt xlabel Time (s) N/A N/A N/A plt xscale log N/A N/A N/A plt ylabel Pred. Log Likelihood N/A N/A N/A plt ylim -700 -500 N/A N/A N/A plt savefig N/A N/A N/A os path join results ap N/A run%03d run outname N/A N/A N/A plt tight_layout N/A plot_pred_ll_vs_D N/A N/A all_results Ds Xtrain Xtest run N/A N/A N/A N N/A len Ds N/A M N/A len N/A all_results N/A 0 N/A T N/A len N/A N/A N/A all_results N/A 0 N/A 0 pred_lls N/A pred_lls N/A N/A np zeros N/A N M T N/A n N/A xrange N N/A N/A m N/A xrange M N/A N/A N/A N/A N/A N/A N/A all_results N/A n N/A m pred_lls ndim 2 N/A N/A N/A pred_lls N/A N/A n m N/A N/A N/A N/A all_results N/A n N/A m pred_lls N/A N/A N/A 0 N/A N/A N/A pred_lls N/A N/A n m N/A N/A N/A all_results N/A n N/A m pred_lls N/A burnin N/A T 2 N/A pred_ll_mean N/A N/A logsumexp N/A pred_lls N/A N/A N/A N/A burnin axis -1 N/A N/A np log N/A T burnin N/A pred_ll_std N/A N/A np zeros_like pred_ll_mean N/A n N/A xrange N N/A N/A m N/A xrange M N/A N/A samples N/A N/A N/A np random choice N/A pred_lls N/A N/A n N/A m N/A burnin size N/A 100 N/A T burnin replace True N/A pll_samples N/A N/A logsumexp samples axis 1 N/A N/A np log N/A T burnin N/A N/A pred_ll_std N/A N/A n m N/A N/A pll_samples std N/A baseline 0 N/A N/A Xtr Xte N/A zip Xtrain Xtest N/A N/A pi_emp N/A N/A N/A Xtr sum 0 N/A float N/A N/A Xtr sum N/A pi_emp N/A N/A np clip pi_emp 1e-08 N/A np inf N/A pi_emp N/A N/A pi_emp sum N/A baseline N/A N/A N/A N/A N/A Multinomial weights pi_emp K N/A N/A Xtr shape N/A 1 log_likelihood Xte sum N/A fig N/A N/A plt figure figsize N/A 3 3 N/A ax N/A N/A fig add_subplot 111 N/A width N/A N/A N/A len Ds 1 N/A N/A N/A np min N/A N/A np diff Ds N/A M 1.0 1.0 N/A m N/A xrange M N/A N/A N/A N/A ax bar N/A Ds N/A m width N/A N/A pred_ll_mean N/A N/A N/A m baseline yerr N/A pred_ll_std N/A N/A N/A m width N/A 0.9 width color N/A colors N/A m ecolor k N/A N/A N/A ax plot N/A N/A N/A N/A Ds min width N/A N/A N/A Ds max N/A N/A M 1 width N/A N/A np zeros 2 -k N/A N/A N/A ax set_xlim N/A N/A N/A Ds min width N/A N/A N/A Ds max N/A N/A M 1 width N/A N/A N/A ax set_xticks N/A Ds N/A N/A M width 2.0 N/A N/A N/A ax set_xticklabels Ds N/A N/A N/A ax set_xlabel D N/A N/A N/A ax set_ylabel Pred. Log Likelihood N/A N/A N/A ax set_title AP News N/A N/A N/A plt savefig N/A N/A N/A os path join results ap N/A run%03d run pred_ll_vs_D.pdf N/A fit_joint_corpus N/A N/A N/A N/A N/A run 13 N/A results_dir N/A N/A N/A os path join results ap N/A run%03d run pgmult.internals.utils mkdir N/A N/A N/A N/A N/A os path exists results_dir N/A N/A N/A print Making results directory:  results_dir N/A N/A mkdir results_dir N/A N/A Xs words N/A load N/A N_docs 10 N/A T_split 10 N/A Xfilt N/A filter N/A N/A N/A X N/A N/A N/A N/A X shape N/A 0 N/A 2 T_split Xs N/A Xtrain N/A N/A X N/A N/A T_split N/A X N/A Xfilt N/A N_docs N/A Xtest N/A N/A X N/A N/A T_split N/A X N/A Xfilt N/A N_docs N/A N_samples 500 N/A all_results N/A N/A Ds N/A N/A np array N/A 10 N/A models N/A SBM-LDS HMM Raw LDS LNM-LDS SBM-LDS (pMCMC) N/A methods N/A fit_lds_model fit_hmm fit_gaussian_lds_model fit_ln_lds_model fit_lds_model_with_pmcmc N/A D Ds N/A N/A D_results N/A N/A N/A model method N/A zip models methods N/A N/A results_file N/A N/A N/A os path join results_dir N/A results_%s_D%d.pkl.gz N/A model D N/A N/A N/A N/A os path exists results_file N/A N/A N/A print Loading from:  results_file N/A N/A N/A gzip open results_file r f N/A N/A D_model_results N/A N/A cPickle load f N/A N/A N/A print Fitting  model  for D= D N/A D_model_results N/A method Xtrain Xtest D N_samples N/A N/A N/A gzip open results_file w f N/A N/A N/A print Saving to:  results_file N/A N/A N/A cPickle dump D_model_results f protocol -1 N/A N/A N/A D_results append D_model_results N/A N/A N/A all_results append D_results N/A res_index 0 N/A N/A plot_log_likelihood N/A all_results N/A res_index models run outname N/A train_ll_vs_time_D%d.pdf N/A Ds N/A res_index N/A N/A plot_pred_log_likelihood N/A all_results N/A res_index models run outname N/A pred_ll_vs_time_D%d.pdf N/A Ds N/A res_index N/A N/A plot_pred_ll_vs_D all_results Ds Xtrain Xtest run N/A N/A N/A plt show N/A N/A N/A __name__ __main__ N/A N/A N/A fit_joint_corpus