Module Expr Str ImportFrom alias Assign NameStore Str Import alias identifier Import alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Call NameLoad NameLoad Num Str Str Str Str NameLoad Str body Expr Str If CompareEq AttributeLoad NameLoad attr Num body Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad orelse If CompareEq AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Return NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Call NameLoad NameLoad Num Str Str Str Str NameLoad body Expr Str Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Call NameLoad NameLoad Num Str Str Str Str NameLoad body Expr Str Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Call NameLoad NameLoad Num Str Str Str Str NameLoad body Expr Str Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Call NameLoad NameLoad Num Str Str Str Str NameLoad body Expr Str Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Call NameLoad NameLoad Num Str Str Str Str NameLoad Str body Expr Str If CompareNotIn NameLoad ListLoad Str Str Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad NameLoad Str Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad NameLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str Str Str body Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareEq NameLoad Str body If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Assign NameStore Str orelse Assign NameStore Str Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Str orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Str orelse Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If BoolOpOr BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str body Assign NameStore ListComp BinOpDiv Num NameLoad comprehension NameStore NameLoad Assign NameStore SubscriptLoad Dict Str Str Str Str Index NameLoad Assign NameStore Call NameLoad NameLoad NameLoad orelse If BoolOpOr BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad Str body Expr Str If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str Str Str body Raise Call NameLoad Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpSub BinOpMult Num NameLoad Num BinOpAdd NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpMult Num NameLoad BinOpAdd NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad Call NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad For NameStore Call NameLoad BinOpSub NameLoad NameLoad BinOpAdd BinOpSub NameLoad NameLoad NameLoad body For NameStore Call NameLoad BinOpAdd BinOpSub NameLoad NameLoad Num BinOpAdd BinOpSub NameLoad NameLoad Num body Assign SubscriptStore NameLoad Index TupleLoad BinOpSub BinOpAdd NameLoad NameLoad Num BinOpAdd NameLoad NameLoad Call AttributeLoad NameLoad attr BinOpMult AttributeLoad SubscriptLoad NameLoad ExtSlice Slice NameLoad BinOpAdd NameLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad attr NameLoad If NameLoad body If CompareGt SubscriptLoad NameLoad Index TupleLoad BinOpSub BinOpAdd NameLoad NameLoad Num BinOpAdd NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad BinOpSub BinOpAdd NameLoad NameLoad Num BinOpAdd NameLoad NameLoad BinOpDiv BinOpMult NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad BinOpSub BinOpAdd NameLoad NameLoad Num BinOpAdd NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index BinOpAdd NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad ExtSlice Slice NameLoad Index BinOpAdd NameLoad NameLoad NameLoad Return SubscriptLoad NameLoad Slice NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str If CompareEq NameLoad Str body Raise NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpMult NameLoad NameLoad Num keyword AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index BinOpAdd BinOpMult NameLoad NameLoad NameLoad AttributeLoad SubscriptLoad NameLoad ExtSlice Slice NameLoad BinOpAdd NameLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad attr Assign SubscriptStore NameLoad Index BinOpAdd BinOpMult NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad BinOpSub BinOpAdd NameLoad NameLoad Num BinOpAdd NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareEq AttributeLoad NameLoad attr Num body For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Return NameLoad orelse If CompareEq AttributeLoad NameLoad attr Num body For NameStore NameLoad body For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Return NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice BinOpSub NameLoad Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice Assign NameStore SubscriptLoad NameLoad Slice NameLoad If NameLoad body Assign NameStore BinOpMult BinOpDiv Num BinOpSub NameLoad NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad Num attr Assign NameStore Call AttributeLoad NameLoad attr ListComp BinOpSub NameLoad BinOpDiv NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult BinOpMult NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad BinOpSub NameLoad Num UnaryOpUSub NameLoad Num body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice Num NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Call NameLoad NameLoad Num Str NameLoad Str NameLoad body Expr Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str Str Str Str body Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad If CompareIn NameLoad ListLoad Str Str Str Str body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Str orelse Raise Call NameLoad Str If CompareEq NameLoad Str body Assign NameStore ListComp BinOpDiv Num NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad If CompareIs NameLoad NameLoad body Return TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp BinOpPow NameLoad NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMult BinOpDiv Num AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpDiv Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub Call NameLoad NameLoad NameLoad If CompareEq NameLoad Str body Return Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice BinOpSub NameLoad Num Num orelse If CompareEq NameLoad Str body Return Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice Num BinOpAdd NameLoad Num SubscriptLoad NameLoad Slice NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareEq NameLoad Str body Return Call AttributeLoad SubscriptLoad NameLoad Slice NameLoad attr BinOpSub Call NameLoad NameLoad NameLoad Num orelse If CompareEq NameLoad Str body Assign NameStore BinOpSub Call NameLoad NameLoad NameLoad Return Call AttributeLoad SubscriptLoad NameLoad Slice NameLoad attr NameLoad Num orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return TupleLoad Call NameLoad NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Slice Num Num NameLoad orelse If CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Slice Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareEq NameLoad Str body Return Call NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Return Call NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Return Call NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Return Call NameLoad NameLoad NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr BinOpMult BinOpMult BinOpMult AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore Dict Str Str Str Str Num Num Num Num FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore SubscriptLoad Dict Num Num BinOpMult NameLoad Num BinOpMult NameLoad Num Index SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpMult SubscriptLoad NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body If CompareGt SubscriptLoad NameLoad Index NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpDiv Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Return BinOpMult BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad BinOpMult BinOpDiv Num SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice NameLoad Index NameLoad attr TupleLoad NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore ListComp BinOpDiv Num NameLoad comprehension NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Return BinOpDiv BinOpAdd NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore ListComp BinOpDiv Num NameLoad comprehension NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Return BinOpDiv BinOpAdd NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str body Expr Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareGt NameLoad Call NameLoad BinOpAdd NameLoad Num BinOpSub Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpSub BinOpSub NameLoad NameLoad Num If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num SubscriptLoad NameLoad Slice NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice BinOpSub NameLoad Num Num SubscriptLoad NameLoad Slice NameLoad Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Slice Num If CompareEq NameLoad Str body Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpMult BinOpMult BinOpAdd Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr BinOpDiv BinOpMult NameLoad NameLoad BinOpSub Num BinOpMult NameLoad NameLoad AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Call NameLoad NameLoad Num keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num BinOpAdd Num Num If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Slice Num UnaryOpUSub SubscriptLoad AttributeLoad NameLoad attr Slice Num orelse Assign SubscriptStore NameLoad Slice Num UnaryOpUSub SubscriptLoad AttributeLoad NameLoad attr Slice Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num Num orelse Return Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad Dict Str Str Str Str Index NameLoad Return Call NameLoad ListComp BinOpDiv Num NameLoad comprehension NameStore Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str Str body Expr Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareEq NameLoad Str body For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareGt Call AttributeLoad NameLoad attr NameLoad Num body If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index NameLoad BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad BinOpDiv Num Call AttributeLoad NameLoad attr NameLoad orelse For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareLt Call AttributeLoad NameLoad attr NameLoad Num body If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index NameLoad BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad BinOpDiv Num Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad keyword AttributeLoad NameLoad attr If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Str If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Slice NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index BinOpAdd NameLoad NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpAdd BinOpSub NameLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad AttributeLoad NameLoad attr Return NameLoad If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Slice UnaryOpUSub NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index BinOpSub BinOpSub NameLoad NameLoad Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpSub NameLoad NameLoad BinOpSub BinOpAdd NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list
N/A N/A 
Linear Prediction (LP) functions for extrapolating and modeling NMR signals.
 __future__ print_function N/A __developer_info__ 
Notes
^^^^^
This module contains functions for performing linear prediction on NMR  data.
The algorithms used were selected for simplicity to show how linear prediction
works not for computational speed nor stability.  Locations where significant
improvements can be made to improve speed or stability are indicated with
SPEED and STABILITY within the source code with discussion following.

The notation for the Linear Prediction equation, coefficients, roots, etc.
closely match those in "NMR Data Processing" by Hoch snd Stern. This book was
references for many of the algorithms in this module.

Reduced order LP-SVD and LP-TLS methods are not implemented but should
be easy to add if desired.  See :py:func:`find_lproots_hsvd` for an example.

 N/A numpy np N/A scipy.linalg lp N/A N/A data pred slice order mode append bad_roots fix_mode mirror method N/A 1 N/A slice None 8 f after auto on None svd N/A N/A 
    Linear prediction extrapolation of 1D or 2D data.

    Parameters
    ----------
    data : ndarray
        1D or 2D NMR data with the last (-1) axis in the time domain.
    pred : int
        Number of points to predict along the last axis.
    slice : slice object, optional
        Slice object which selects the region along the last axis to use in LP
        equation.  The default (slice(None)) will use all points.
    order : int
        Prediction order, number of LP coefficients calculated.
    mode : {'f', 'b', 'fb' or 'bf'}
        Mode to generate LP filter. 'f' for forward,'b' for backward, fb for
        'forward-backward and 'bf' for backward-forward.
    extend : {'before', 'after'}
        Location to extend the data, either 'before' the current data, or
        'after' the existing data. This is independent of the `mode` parameter.
    bad_roots : {'incr', 'decr', None, 'auto'}
        Type of roots which to consider bad and to stabilize.  Option are those
        with increasing signals 'incr' or decreasing signals 'decr'.  None will
        perform no root stabiliting.  The default ('auto') will set the
        parameter based on the `mode` parameter.  'f' or 'fb' `mode` will
        results in a 'incr' `bad_roots` parameter, 'b' or 'bf` in 'decr'
    fix_mode : {'on', 'reflect'}
        Method used to stabilize bad roots, 'on' to move the roots onto the
        unit circle, 'reflect' to reflect bad roots across the unit circle.
        This parameter is ignored when `bad_roots` is None.
    mirror : {None, '0', '180'}
        Mode to form mirror image of data before processing.  None will
        process the data trace as provided (no mirror image). '0' or '180'
        forms a mirror image of the sliced trace to calculate the LP filter.
        '0' should be used with data with no delay, '180' with data
        with an initial half-point delay.
    method : {'svd', 'qr', 'choleskey', 'tls'}
        Method to use to calculate the LP filter. Choices are a SVD ('svd'), QR
        ('qr'), or Choleskey ('choleskey') decomposition, or Total Least
        Squares ('tls').

    Returns
    -------
    ndata : ndarray
        NMR data with `pred` number of points linear predicted and appended to
        the original data.

    Notes
    -----
    When given 2D data a series of 1D linear predictions are made to
    each row in the array, extending each by pred points. To perform a 2D
    linear prediction using a 2D prediction matrix use :py:func:`lp2d`.

    In forward-backward or backward-forward mode root stabilizing is done
    on both sets of signal roots as calculated in the first mode direction.
    After averaging the coefficient the roots are again stabilized.

    When the append parameter does not match the LP mode, for example
    if a backward linear prediction (mode='b') is used to predict points
    after the trace (append='after'), any root fixing is done before reversing
    the filter.

     N/A N/A N/A data ndim 1 N/A N/A N/A lp_1d data pred slice order mode append bad_roots fix_mode mirror method N/A N/A N/A N/A data ndim 2 N/A N/A s N/A list N/A data shape N/A N/A s N/A -1 N/A N/A s N/A -1 pred N/A new N/A N/A np empty s dtype N/A data dtype N/A N/A i trace N/A enumerate data N/A N/A N/A new N/A i N/A lp_1d trace pred slice order mode append bad_roots fix_mode mirror method N/A new N/A N/A N/A ValueError data must be a one or two dimensional array N/A lp_svd N/A N/A data pred slice order mode append bad_roots fix_mode mirror N/A 1 N/A slice None 8 f after auto on None N/A N/A 
    Linear Prediction extrapolation of 1D or 2D data using SVD decomposition.

    See :py:func:`lp` for documentation.

     N/A N/A lp data pred slice order mode append bad_roots fix_mode mirror method svd N/A lp_qr N/A N/A data pred slice order mode append bad_roots fix_mode mirror N/A 1 N/A slice None 8 f after auto on None N/A N/A 
    Linear Prediction extrapolation of 1D or 2D data using QR decomposition.

    See :py:func:`lp` for documentation

     N/A N/A lp data pred slice order mode append bad_roots fix_mode mirror method qr N/A lp_cho N/A N/A data pred slice order mode append bad_roots fix_mode mirror N/A 1 N/A slice None 8 f after auto on None N/A N/A 
    Linear Prediction extrapolation of 1D or 2D data using Cholesky
    decomposition.

    See :py:func:`lp` for documentation
     N/A N/A lp data pred slice order mode append bad_roots fix_mode mirror method cholesky N/A lp_tls N/A N/A data pred slice order mode append bad_roots fix_mode mirror N/A 1 N/A slice None 8 f after auto on None N/A N/A 
    Linear Prediction extrapolation of 1D or 2D data using Total Least Squares.

    See :py:func:`lp` for documentation.

     N/A N/A lp data pred slice order mode append bad_roots fix_mode mirror method tls N/A lp_1d N/A N/A trace pred slice order mode append bad_roots fix_mode mirror method N/A 1 N/A slice None 8 f after auto on None svd N/A N/A 
    Linear Prediction extrapolation of 1D data.

    Parameters
    ----------
    trace : ndarray
        1D NMR data in the time domain.
    pred : int
        Number of points to predict along the last axis.
    slice : slice object, optional
        Slice object which selects the region along the last axis to use in LP
        equation.  The default (slice(None)) will use all points.
    order : int
        Prediction order, number of LP coefficients calculated.
    mode : {'f', 'b', 'fb' or 'bf'}
        Mode to generate LP filter. 'f' for forward,'b' for backward, fb for
        'forward-backward and 'bf' for backward-forward.
    extend : {'before', 'after'}
        Location to extend the data, either 'before' the current data, or
        'after' the existing data. This is independent of the `mode` parameter.
    bad_roots : {'incr', 'decr', None, 'auto'}
        Type of roots which to consider bad and to stabilize.  Option are those
        with increasing signals 'incr' or decreasing signals 'decr'.  None will
        perform no root stabiliting.  The default ('auto') will set the
        parameter based on the `mode` parameter.  'f' or 'fb' `mode` will
        results in a 'incr' `bad_roots` parameter, 'b' or 'bf` in 'decr'
    fix_mode : {'on', 'reflect'}
        Method used to stabilize bad roots, 'on' to move the roots onto the
        unit circle, 'reflect' to reflect bad roots across the unit circle.
        This parameter is ignored when `bad_roots` is None.
    mirror : {None, '0', '180'}
        Mode to form mirror image of data before processing.  None will
        process the data trace as provided (no mirror image). '0' or '180'
        forms a mirror image of the sliced trace to calculate the LP filter.
        '0' should be used with data with no delay, '180' with data
        with an initial half-point delay.
    method : {'svd', 'qr', 'choleskey', 'tls'}
        Method to use to calculate the LP filter. Choices are a SVD ('svd'), QR
        ('qr'), or Choleskey ('choleskey') decomposition, or Total Least
        Squares ('tls').

    Returns
    -------
    ntrace : ndarray
        NMR data with `pred` number of points linear predicted and appended to
        the original data.

    Notes
    -----
    In forward-backward or backward-forward mode root stabilizing is done
    on both sets of signal roots as calculated in the first mode direction.
    After averaging the coefficient the roots are again stabilized.

    When the append parameter does not match the LP mode, for example
    if a backward linear prediction (mode='b') is used to predict points
    after the trace (append='after'), any root fixing is done before reversing
    the filter.


    See Also
    --------
    lp : 1D or 2D linear prediction extrapolation.

     N/A N/A mode N/A f b fb bf N/A N/A N/A ValueError mode must be 'f', 'b', 'fb', or 'bf' N/A N/A append N/A before after N/A N/A N/A ValueError append must be 'before' or 'after' N/A N/A bad_roots N/A None incr decr auto N/A N/A N/A ValueError bad_roots must be None, 'auto', 'incr' or 'decr' N/A N/A fix_mode N/A on reflect N/A N/A N/A ValueError fix_mode must be 'on' or 'reflect' N/A N/A mirror N/A None 0 180 N/A N/A N/A ValueError mirror must be None, '0' or '180' N/A N/A method N/A svd qr cholesky tls N/A N/A N/A ValueError Invalid method N/A N/A N/A trace ndim 1 N/A N/A N/A ValueError trace must be 1D N/A N/A bad_roots auto N/A N/A N/A N/A mode f N/A mode fb N/A N/A bad_roots incr N/A N/A bad_roots decr N/A x N/A trace N/A slice N/A N/A mirror None N/A N/A x N/A make_mirror x mirror N/A N/A mode fb N/A N/A a N/A find_lpc_fb x order bad_roots fix_mode method N/A mode f N/A N/A N/A mode bf N/A N/A a N/A find_lpc_bf x order bad_roots fix_mode method N/A mode b N/A N/A N/A D d N/A make_Dd x order mode N/A a N/A find_lpc D d method N/A N/A bad_roots None N/A N/A poles N/A find_roots a mode N/A poles N/A fix_roots poles bad_roots fix_mode N/A N/A N/A N/A mode b N/A append after N/A N/A mode f N/A append before N/A N/A poles N/A N/A 1.0 pole N/A pole poles N/A mode N/A N/A f b b f N/A mode N/A a N/A find_coeff poles mode N/A N/A N/A N/A N/A mode b N/A append after N/A N/A mode f N/A append before N/A N/A a N/A reverse_filter a mode N/A ntrace N/A extrapolate trace a pred append N/A ntrace N/A lp2d N/A N/A data pred P M mirror fix_points method N/A 0 True svd N/A N/A 
    Perform a forward 2D linear prediction extrapolation on data.

    Use the 2D linear prediction algorithm presented in:
    G. Zhu and A. Bax, Journal of Magnetic Resonance, 1992, 98, 192-199.
    to extend the last (1) axis by `pred` points. A PxM prediction matrix, C,
    is formed by solving the modified linear prediction equation given by:

    data[n,m] = /sigma_{l=0}^{P-1} /sigma_{k=1}^M C_{l,k}*data[n-l,m-k]

    For all valid points in data. This prediction matrix together with the
    data matrix with a mirror image appended is used to extend the last (1)
    axis by pred points resulting in a new array of size [N_0, N_1+pred] where
    N_0 and N_1 are the sizes of the original data.  To linear predict
    both dimensions this function should be used twice with a transpose
    between the uses.

    Backward linear prediction using this method is not possible as the
    method depends on being able to mirror the data before the first collected
    point. In backwards mode this would correspond to being able to correctly
    determind points after the last point which cannot be determinded using the
    mirror method. A backward prediction matrix can be calculated but would
    not prove useful.

    The forward-backward averaging of the linear prediction coefficients is
    not possible as there is no characteristic polynomial to root and reflect.
    Therefore the backward prediction matrix cannot be reversed.

    Parameters
    ----------
    data : ndarray
        2D NMR data (time domain for last axes).
    pred : int
        Number of points to predict along the last (1) axes.
    P : int
        Prediction matrix length along the non-predicted (0) axis.
    M : int
        Prediction matrix length along the predicted (1) axis.
    mirror : {'0' or '180'}
        Method to use for forming the mirror image of the non-predicted axis.
        '0' indicated no initial delay, '180' for a half-point delay.
    fix_points : bool
        True to reduce predicted points with magnitude larger than the largest
        data point. False leaved predicted points  unaltered.
    method : {'svd', 'qr', 'cholesky', 'tls'}
        Method used to calculate the LP prediction matrix.  See :py:func:`lp`
        for a description of theses methods.

    Returns
    -------
    ndata : ndarray
        2D NMR data with `pred` points appended to the last (1) axes.

    Notes
    -----
    The axes in this function are reversed as compared to the JMR paper.

     N/A N/A N/A data ndim 2 N/A N/A N/A ValueError data must be a 2D array N/A N/A mirror N/A 0 180 N/A N/A N/A ValueError mirror must be '0' or '180' N/A N/A method N/A svd qr cholesky tls N/A N/A N/A ValueError method must be 'svd', 'qr', 'cholesky' or 'tls' N/A N/A D d N/A make_lp2d_Dd data P M f N/A c N/A find_lpc D d method N/A C N/A N/A c reshape P M N/A N/A extrapolate_2d data C pred fix_points mirror N/A extrapolate_2d N/A N/A x C pred fix_points mirror N/A N/A N/A 
    Extrapolate points along the 1st axis using the lp2d algorithm.
     N/A N/A P M N/A C shape N/A c N/A N/A C flatten N/A x_max N/A N/A x max N/A N/A N_0 N_1 N/A x shape N/A N/A mirror 0 N/A N/A new N/A N/A np empty N/A N/A N/A 2 N_0 1 N/A N_1 pred dtype N/A x dtype N/A plane N/A N_0 1 N/A N/A new N/A N/A np empty N/A N/A 2 N_0 N/A N_1 pred dtype N/A x dtype N/A plane N_0 N/A last N/A N/A new shape N/A 0 N/A i N/A range N_1 N/A N/A N/A new N/A N/A N/A i N/A make_mirror N/A x N/A N/A N/A i mirror N/A j N/A range N/A N_1 M N/A N/A N_1 M pred N/A N/A i N/A range N/A N/A plane P 1 N/A N/A last P 1 N/A N/A N/A new N/A N/A N/A N/A i P 1 N/A j M N/A N/A np sum N/A N/A N/A new N/A N/A i N/A i P N/A j N/A j M flat c N/A fix_points N/A N/A N/A N/A new N/A N/A N/A N/A i P 1 N/A j M x_max N/A N/A N/A new N/A N/A N/A N/A i P 1 N/A j M N/A N/A x_max x_max N/A new N/A N/A N/A N/A i P 1 N/A j M N/A N/A new N/A N/A N/A N/A j M N/A make_mirror N/A new N/A N/A plane N/A N/A j M mirror N/A N/A new N/A plane N/A make_lp2d_Dd N/A N/A x P M mode N/A f N/A N/A 
    Form the lp2d equation matrix and vector.
     N/A N/A mode b N/A N/A NotImplemented N/A N/A N_0 N_1 N/A x shape N/A count_P N/A N/A N_0 P 1 N/A count_M N/A N_1 M N/A D N/A N/A np empty N/A N/A count_P count_M N/A P M dtype N/A x dtype N/A d N/A N/A np empty N/A N/A count_P count_M 1 dtype N/A x dtype N/A j N/A range count_M N/A N/A i N/A range count_P N/A N/A N/A D N/A N/A N/A j count_P i N/A N/A x N/A N/A i N/A i P N/A j N/A j M flat N/A N/A d N/A N/A N/A j count_P i N/A x N/A N/A N/A N/A i P 1 N/A j M N/A N/A D d N/A cadzow N/A N/A data M K niter min_var N/A False N/A N/A 
    Perform a (row wise) Cadzow-like signal enhancement on 1D or 2D data.

    Performs a Cadzow-like signal enhancement with optional adjustment
    of singular values using the minimum variance method as desribed in:
    Chen, VanHuffel, Decanniere, VanHecke, JMR, 1994, 109A, 46-55.

    For 2D data performs independant enhancement on each row of data array.

    Parameters
    ----------
    data : ndarray
        1D or 2D NMR data to enhance.
    M : int
        Large prediction order.  For best results should be between
        K + 5 and 2 * K.
    K : int
        Reduced prediction order.
    niter : int
        Number if iteration of the Cadzow procedure to perform.
    min_var : bool
        True to adjust retained singular values using the  minimum variance
        method. False does not correct the singular values and is the
        Cadzow method.

    Returns
    -------
    ndata : ndarray
        Array of enhanced data

     N/A N/A N/A data ndim 1 N/A N/A i N/A range niter N/A N/A data N/A cadzow_single data M K min_var N/A data N/A N/A N/A N/A data ndim 2 N/A N/A trace data N/A N/A i N/A range niter N/A N/A trace N/A cadzow_single trace M K min_var N/A data N/A N/A N/A ValueError data must be a 1D or 2D array N/A cadzow_single N/A N/A x M K min_var N/A False N/A N/A 
    Perform a single iteration of Cadzow signal enhancement on a 1D vector

    See :py:func:`cadzow` for documentation.

     N/A N N/A len x N/A L N/A N/A N M 1 N/A X N/A N/A N/A scipy linalg hankel N/A x N/A L N/A x N/A N/A L 1 N/A N/A U s Vh N/A N/A N/A scipy linalg svd X N/A Ul N/A N/A np mat N/A U N/A N/A N/A K N/A Vlh N/A N/A np mat N/A Vh N/A N/A K N/A N/A sl N/A s N/A K N/A min_var N/A N/A s2 N/A N/A 1.0 N/A M K N/A N/A N/A N/A np power N/A s N/A K 2 sum N/A sl N/A N/A np array N/A N/A l N/A s2 l N/A l sl N/A Sl N/A N/A np mat N/A N/A np diag sl N/A Xp N/A N/A Ul Sl Vlh N/A xp N/A N/A np empty_like x N/A N/A i v N/A enumerate N/A range N/A M 1 N/A L -1 N/A N/A N/A xp N/A i N/A N/A N/A N/A np diag N/A Xp N/A N/A N/A -1 v mean N/A xp N/A lp_model N/A N/A trace slice order mode mirror method full N/A N/A slice None 8 f None svd False N/A N/A 
    Use Linear Prediction to model 1D NMR time domain data.

    Parameters
    ----------
    trace : 1D ndarray
        One dimensional time domain NMR data to model.
    slice : slice object, optional
        Slice object which selects the region along the last axis to use in LP
        equation.  The default, slice(None), will use all points.
    order : int
        Prediction order, number of LP coefficients calculated.
    mode : {'f', 'b'}
        Mode to generate LP filter. 'f' for forward,'b' for backward.
    mirror : {None, '0', '180'}
        Mode to form mirror image of data before processing.  None will
        process the data trace as provided (no mirror image). '0' or '180'
        forms a mirror image of the sliced trace to calculate the LP filter.
        '0' should be used with data with no delay, '180' with data
        with an initial half-point delay.
    method : {'svd', 'qr', 'choleskey', 'tls'}
        Method to use to calculate the LP filter. Choices are a SVD ('svd'), QR
        ('qr'), or Choleskey ('choleskey') decomposition, or Hankel SVD
        ('hsvd').
    full : bool
        True to return amplitudes and phases calculated by performing a least
        squares fitting to the data after LP modeling.  False will return only
        the damping (relaxation) factors and signal frequencies.

    Returns
    -------
    damp : list
        List of damping (relaxation) factors found from LP modeling.
    freq : list
        List of signal frequencies found from LP modeling.
    amp : list, optional
        List of signal amplitudes found by least squares fitting of data after
        LP modeling, only returned when `full` parameter is True.
    phase : list, optional.
        List of signal phases found by least squares fitting of data after LP
        modeling, only returned when `full` parameter is True.


    Notes
    -----
    When backward LP is used the signal roots are reflected before calculating
    model parameters.

     N/A N/A mode N/A f b N/A N/A N/A ValueError mode must be 'f' or 'b' N/A N/A method N/A svd qr cholesky tls hsvd N/A N/A N/A ValueError Invalid method N/A N/A N/A trace ndim 1 N/A N/A N/A ValueError trace must be a 1D array N/A x N/A trace N/A slice N/A N/A mirror None N/A N/A x N/A make_mirror x mirror N/A N/A method N/A svd qr cholseky tls N/A N/A N/A D d N/A make_Dd x order mode N/A a N/A find_lpc D d method N/A poles N/A find_roots a mode N/A N/A N/A method hsvd N/A N/A poles N/A find_lproots_hsvd x M order K order mode mode zmethod sm N/A N/A N/A ValueError Invalid method N/A N/A mode b N/A N/A poles N/A N/A 1.0 pole N/A pole poles N/A damp N/A N/A root2damp pole N/A pole poles N/A freq N/A N/A root2freq pole N/A pole poles N/A N/A full False N/A N/A N/A damp freq N/A poles N/A N/A np array poles N/A B N/A N/A np row_stack N/A N/A poles i N/A i N/A range N/A len x N/A N/A z resid rank s N/A N/A N/A np linalg lstsq B N/A N/A np array x N/A amp N/A N/A cof2amp cof N/A cof z N/A phase N/A N/A cof2phase cof N/A cof z N/A N/A damp freq amp phase N/A root2damp N/A N/A pole N/A N/A N/A 
    Calculate the damping factor from a LP root
     N/A N/A N/A -1.0 N/A np pi N/A N/A np log N/A N/A np abs pole N/A root2freq N/A N/A pole N/A N/A N/A 
    Calculate the frequency from a LP root
     N/A N/A N/A N/A np arctan2 N/A pole imag N/A pole real N/A 2.0 N/A np pi N/A cof2amp N/A N/A z N/A N/A N/A 
    Calculate a signal amplitude from a model coefficient
     N/A N/A N/A np abs z N/A cof2phase N/A N/A z N/A N/A N/A 
    Calculate a signal phase from a model coefficient
     N/A N/A N/A np arctan2 N/A z imag N/A z real N/A make_D N/A N/A x order mode N/A N/A N/A 
    Make the LP equation D matrix (Da = d')
     N/A L N/A N/A len x order N/A N/A mode f N/A N/A N/A N/A N/A scipy linalg hankel N/A x N/A L N/A x N/A N/A L 1 -1 N/A N/A N/A mode b N/A N/A N/A N/A N/A scipy linalg hankel N/A x N/A 1 N/A L 1 N/A x N/A L N/A N/A N/A ValueError mode must be 'f' or 'b' N/A make_little_d N/A N/A x order mode N/A N/A N/A 
    Make the LP equation d' vector (Da = d')
     N/A N/A mode f N/A N/A N/A N/A N/A x N/A order reshape N/A N/A len x order 1 N/A N/A N/A mode b N/A N/A L N/A N/A len x order N/A N/A N/A N/A x N/A L reshape L 1 N/A N/A N/A ValueError mode must be 'f' or 'b' N/A make_Dd N/A N/A x order mode N/A N/A N/A 
    make the LP equation D matrix and d' vector (Da=d')
     N/A N/A N/A make_D x order mode N/A make_little_d x order mode N/A make_mirror N/A N/A x mode N/A N/A N/A 
    Make a mirror image trace.

    Reflects trace over zero as described in:
    G. Zhu and A. Bax, Journal of Magnetic Resonance, 1990, 90, 405

    When mode is "0" (no initial delay) form the an array with length 2N-1:
        x_n-1 ... x_1 x_0 x_1 ... x_n-1

    When mode is "180" (half point delay) form an array with length 2N:
        x_n-1 .. x_1 x_0 x_0 x_1 ... x_n-1


    Parameters
    ----------
    x : ndarray
        1D array to form mirrored trace from.
    mode : {'180', '0'}
        Mirror mode, see above.

     N/A N/A mode 0 N/A N/A N/A N/A np concatenate N/A N/A x N/A 0 -1 x N/A N/A N/A mode 180 N/A N/A N/A N/A np concatenate N/A N/A x N/A -1 x N/A find_lpc N/A N/A D d method N/A N/A N/A 
    Find linear prediction filter using a provided method.
     N/A N/A method svd N/A N/A N/A find_lpc_svd D d N/A N/A N/A method qr N/A N/A N/A find_lpc_qr D d N/A N/A N/A method cholesky N/A N/A N/A find_lpc_cholesky D d N/A N/A N/A method tls N/A N/A N/A find_lpc_tls D d N/A N/A N/A ValueError invalid method N/A find_lpc_svd N/A N/A D d N/A N/A N/A 
    Find linear prediction filter using single value decomposition.
     N/A L N/A N/A D shape N/A 0 N/A m N/A N/A D shape N/A 1 N/A N/A U s Vh N/A N/A N/A scipy linalg svd D N/A N/A U Vh N/A N/A N/A np mat U N/A N/A np mat Vh N/A Si N/A pinv_diagsvd s m L N/A N/A N/A np array N/A N/A N/A N/A Vh H Si N/A U H d N/A N/A eps N/A N/A N/A np finfo float eps N/A feps N/A N/A N/A np finfo single eps N/A _array_precision N/A f d F D 0 1 0 1 pinv_diagsvd N/A N/A s m L N/A N/A N/A 
    Construct the pseudo-inverse of the sigma matrix from singular values
     N/A t N/A N/A s dtype char N/A cond N/A N/A 0 1 N/A feps 1000.0 N/A eps 1000000.0 N/A N/A _array_precision N/A t N/A cutoff N/A N/A s N/A 0 cond N/A Si N/A N/A np zeros N/A m L t N/A i N/A range N/A len s N/A N/A N/A N/A s N/A i cutoff N/A N/A N/A Si N/A N/A i i N/A 1.0 N/A N/A np conj N/A s N/A i N/A Si N/A find_lpc_qr N/A N/A D d N/A N/A N/A 
    Find linear prediction filter using QR decomposition.
     N/A L N/A N/A D shape N/A 0 N/A m N/A N/A D shape N/A 1 N/A N/A q r N/A N/A N/A scipy linalg qr D N/A N/A q r N/A N/A N/A np mat q N/A N/A np mat r N/A N/A N/A N/A N/A N/A scipy linalg pinv2 r N/A q H d N/A find_lpc_cholesky N/A N/A D d N/A N/A N/A 
    Find linear prediction filter using a Cholesky decomposition.
     N/A D N/A N/A np mat D N/A DhD N/A N/A np mat N/A N/A np dot N/A D H D N/A Dhd N/A N/A np mat N/A N/A np dot N/A D H d N/A N/A c lower N/A N/A N/A scipy linalg cho_factor DhD N/A N/A N/A N/A scipy linalg cho_solve N/A c lower Dhd N/A find_lpc_tls N/A N/A D d N/A N/A N/A 
    Find linear prediction filter using the Total Least Squares method
     N/A m N/A N/A D shape N/A 1 N/A E N/A N/A np append D d axis 1 N/A N/A U s Vh N/A N/A N/A scipy linalg svd E N/A V N/A N/A np conj N/A Vh T N/A N/A N/A N/A N/A -1.0 N/A V N/A N/A m m N/A V N/A N/A m N/A m reshape N/A m 1 N/A find_lpc_fb N/A N/A x order bad_roots fix_mode method N/A N/A N/A 
    Determind LP coefficient using forward-backward linear prediction.

    Averages LP coefficients generated from solving the forward and backward
    linear prediction equations after reversing the roots of characteristic
    polynomial of the backward solution.  Method is described in:
    G. Zhu and A. Bax, Journal of Magnetic Resonance, 1992, 100, 202-207.

    Description of parameters can be found in :py:func:`lp`.

     N/A N/A D d N/A make_Dd x order f N/A a N/A find_lpc D d method N/A N/A bad_roots None N/A N/A poles N/A find_roots a f N/A poles N/A fix_roots poles bad_roots fix_mode N/A a N/A find_coeff poles f N/A forward_a N/A N/A a copy N/A N/A D d N/A make_Dd x order b N/A a N/A find_lpc D d method N/A poles N/A find_roots a b N/A poles N/A N/A 1.0 pole N/A pole poles N/A N/A bad_roots None N/A N/A poles N/A fix_roots poles bad_roots fix_mode N/A backward_a N/A find_coeff poles f N/A N/A N/A forward_a backward_a 2.0 N/A find_lpc_bf N/A N/A x order bad_roots fix_mode method N/A N/A N/A 
    Determind LP coefficient using backward-forward linear prediction.

    Averages LP coefficients generated from solving the forward and backward
    linear prediction equations after reversing the roots of characteristic
    polynomial of the forward solution.  Similar to method described in:
    G. Zhu and A. Bax, Journal of Magnetic Resonance, 1992, 100, 202-207.

    Description of parameters can be found in :py:func:`lp` function.

     N/A N/A D d N/A make_Dd x order b N/A a N/A find_lpc D d method N/A N/A bad_roots None N/A N/A poles N/A find_roots a b N/A poles N/A fix_roots poles bad_roots fix_mode N/A a N/A find_coeff poles b N/A backward_a N/A N/A a copy N/A N/A D d N/A make_Dd x order f N/A a N/A find_lpc D d method N/A poles N/A find_roots a f N/A poles N/A N/A 1.0 pole N/A pole poles N/A N/A bad_roots None N/A N/A poles N/A fix_roots poles bad_roots fix_mode N/A forward_a N/A find_coeff poles b N/A N/A N/A forward_a backward_a 2.0 N/A find_lproots_hsvd N/A N/A x M K mode zmethod N/A sm N/A N/A 
    Find LP roots (poles) using the HSVD method

    Perform a HSVD linear prediction to determind signal roots (poles) as
    described in:
    Barkhuijsen, DeBeer, and Van Ormondt, JMR, 1987, 73, 553

    Parameters x, M and K are the same as those described in the above article.
    zmethod refer to the method used to calculate Z', either a least-squares
    method (lstsq) can be used to solve U_b*Z'=U_t or the Sherman-Morrison
    formula (sm) can be used to avoid the full matrix inversion with equation
    [12] being used to find Z'. The Sherman-Morrison method should be faster
    with similar precision.

    Parameters
    ----------
    x : 1D ndarray
        1D trace of NMR data in the time domain, the FID.
    M : int
        Length (M+1) of data matrix to form.
    K : int
        Reduced prediction order (number of signal roots) Must be less than the
        smaller of M + 1 or len(x) - M.
    mode : {'f', 'b'}
        Mode to perform LP. 'f' for forward,'b' for backward.
    zmethod : {'lstsq', 'sm'}
        Method used to find Z' 'lstsq' for least squares, 'sm' for
        Sherman-Morrison.

    Returns
    -------
    y : ndarray
        Array of signal roots (poles)

     N/A N/A mode N/A f b N/A N/A N/A ValueError mode must be 'f' or 'b' N/A N/A zmethod N/A lstsq sm N/A N/A N/A ValueError zmethod must be 'lstsq' or 'sm' N/A N/A K N/A min N/A M 1 N/A N/A len x M N/A N/A N/A ValueError K must be less than min(M + 1, len(x) - M) N/A N N/A len x N/A L N/A N/A N M 1 N/A N/A mode f N/A N/A X N/A N/A N/A scipy linalg hankel N/A x N/A N/A L 1 N/A x N/A L N/A N/A X N/A N/A N/A scipy linalg hankel N/A x N/A N/A M 1 -1 N/A x N/A M -1 N/A N/A U s Vh N/A N/A N/A scipy linalg svd X N/A Uk N/A N/A np mat N/A U N/A N/A N/A K N/A Ub N/A Uk N/A -1 N/A Ut N/A Uk N/A 1 N/A N/A zmethod lstsq N/A N/A N/A Zp resid rank s N/A N/A N/A scipy linalg lstsq Ub Ut N/A N/A uh N/A Uk N/A -1 N/A u N/A uh H N/A Zp N/A N/A N/A N/A N/A np eye K dtype N/A u dtype N/A N/A u uh N/A 1.0 N/A uh u N/A Ub H Ut N/A N/A N/A N/A scipy linalg eigvals Zp N/A find_roots N/A N/A a mode N/A f N/A N/A 
    Find LP roots (poles) from a set of LP coefficients.

    Parameters
    ----------
    a : array
        LP coefficients.
    mode : {'f', 'b'}
        Mode of LP coefficients.  'f' for coefficients ordered m, m - 1,..., 1.
        'b' for coefficients ordered 1, 2, ...., m

    Returns
    -------
    roots : array
        LP roots (poles)

     N/A N/A mode N/A f b N/A N/A N/A ValueError mode must be 'f' or 'b' N/A p N/A N/A np empty N/A N/A len a 1 dtype N/A a dtype N/A N/A p N/A 0 N/A 1.0 0j N/A N/A mode f N/A N/A N/A p N/A 1 N/A N/A N/A a flat N/A -1 N/A N/A N/A p N/A 1 N/A N/A N/A a flat N/A N/A N/A N/A np roots p N/A find_coeff N/A N/A poles mode N/A f N/A N/A 
    Find LP coefficients from a set of LP roots (poles).

    Parameters
    ----------
    poles : ndarray
        Array of LP roots (poles)
    mode : {'f', 'b'}
        Mode in which LP coefficients should be returned.  'f' for coefficients
        ordered m, m - 1,..., 1. 'b' for coefficients ordered 1, 2, ...., m.

    Returns
    -------
    c : ndarray
        LP coefficients ordered according to `mode`.

     N/A N/A mode N/A f b N/A N/A N/A ValueError mode must be 'f'or 'b' N/A N/A mode f N/A N/A N/A N/A np squeeze N/A N/A N/A N/A np poly poles N/A 0 -1 N/A N/A N/A N/A np squeeze N/A N/A N/A N/A np poly poles N/A 1 N/A reverse_filter N/A N/A a mode N/A N/A N/A 
    Reverse a filter (change forward LP to backwards LP).
     N/A nmode N/A N/A f b b f N/A mode N/A N/A find_coeff N/A N/A 1.0 pole N/A pole N/A find_roots a mode nmode N/A fix_roots N/A N/A poles fix_roots fix_mode N/A incr reflect N/A N/A 
    Fix (stabilize) LP roots.

    Parameters
    ----------
    poles : ndarray
        Array of LP roots (poles).
    fix_roots : {'incr', 'decr'}
        Type of roots which to consider bad and to stabilize.  Either those
        with increasing signals 'incr' or decreasing signals 'decr'.
    fix_mode : {'on', 'reflect'}
        Method used to stabilize bad roots, 'on' to move the roots onto the
        unit circle, 'reflect' to reflect bad roots across the unit circle.

    Returns
    -------
    npoles : ndarray
        Array of stabilized LP roots (poles).

     N/A N/A fix_roots N/A incr decr N/A N/A N/A ValueError fix_roots must be 'incr' or 'decr' N/A N/A fix_mode N/A on reflect N/A N/A N/A ValueError fix_mode must be 'on' or 'reflect' N/A N/A fix_roots incr N/A N/A N/A i pole N/A enumerate poles N/A N/A N/A N/A N/A np abs pole 1 N/A N/A N/A fix_mode on N/A N/A N/A poles N/A i N/A pole N/A N/A np abs pole N/A N/A N/A poles N/A i N/A 1 N/A N/A np conj pole N/A N/A N/A i pole N/A enumerate poles N/A N/A N/A N/A N/A np abs pole 1 N/A N/A N/A fix_mode on N/A N/A N/A poles N/A i N/A pole N/A N/A np abs pole N/A N/A N/A poles N/A i N/A 1 N/A N/A np conj pole N/A poles N/A extrapolate N/A N/A trace a pred append N/A N/A N/A 
    Extrapolate points using LP prediction filter.

    Parameters
    ----------
    trace : 1D ndarray
        1D array to extrapolate from and append to.
    a : ndarray
        LP coefficients, must be ordered according to direction of
        extrapolation.
    pred : int
        Number of points to predict using LP.
    append : {'a', 'b'}
        Location to append new points, 'a' for after the current data, 'b' for
        before the current data.

    Returns
    -------
    ntrace : 1D ndarray
        1D array with extrapolated points appended

     N/A m N/A len a N/A M N/A len trace N/A ntrace N/A N/A np empty N/A M pred dtype N/A trace dtype N/A N/A append N/A after before N/A N/A N/A ValueError append must be 'a' or 'b' N/A N/A append after N/A N/A N/A ntrace N/A M trace N/A i N/A range pred N/A N/A N/A ntrace N/A N/A M i N/A N/A np sum N/A N/A np multiply N/A ntrace N/A N/A N/A M m i N/A M i N/A a flat N/A ntrace N/A N/A append before N/A N/A N/A ntrace N/A N/A M trace N/A i N/A range pred N/A N/A N/A ntrace N/A N/A N/A pred i 1 N/A N/A np sum N/A N/A np multiply N/A ntrace N/A N/A pred i N/A N/A pred m i N/A a flat N/A ntrace N/A