Module ImportFrom alias Expr Str Assign NameStore NameStore Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias identifier Import alias ImportFrom alias ImportFrom alias Assign NameStore NameLoad Assign NameStore Str Assign NameStore Call NameLoad GeneratorExp TupleLoad SubscriptLoad NameLoad Index Num TupleLoad Call AttributeLoad SubscriptLoad NameLoad Slice Num Num attr SubscriptLoad NameLoad Slice Num comprehension NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Dict Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Str TupleLoad Str Str ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call NameLoad NameLoad If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Return NameLoad orelse If Call NameLoad AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr GeneratorExp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr orelse If Call NameLoad AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore SubscriptLoad NameLoad Slice Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Yield AttributeLoad NameLoad attr If BoolOpOr CompareIs AttributeLoad NameLoad attr NameLoad CompareIs AttributeLoad NameLoad attr NameLoad body Expr Yield AttributeLoad NameLoad attr orelse If Call NameLoad AttributeLoad NameLoad attr Str body For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Yield NameLoad orelse If Call NameLoad AttributeLoad NameLoad attr Str body For NameStore AttributeLoad NameLoad attr body Expr Yield NameLoad orelse If Call NameLoad AttributeLoad NameLoad attr Str body Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Return BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad Call NameLoad NameLoad attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad decorator_list decorator_list FunctionDef arguments args defaults vararg kwarg body Expr Call NameLoad NameLoad NameLoad Raise Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults vararg kwarg body Expr Str Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body If CompareEq Call NameLoad NameLoad Num body Return SubscriptLoad NameLoad Index Num Return NameLoad orelse If NameLoad body If CompareEq Call NameLoad NameLoad Num body Return TupleLoad SubscriptLoad NameLoad Index Num NameLoad Return TupleLoad NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Num Str kwarg body Expr Str For NameStore NameLoad body For NameStore Call AttributeLoad NameLoad attr Str body Assign SubscriptStore Call NameLoad Index NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore NameLoad If NameLoad body Assign NameStore NameLoad If Call NameLoad NameLoad body Assign NameStore BinOpAdd BinOpMod Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad If NameLoad body Import alias identifier Assign NameStore AttributeLoad NameLoad attr If NameLoad body Import alias Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body If NameLoad body Assign NameStore Str orelse Assign NameStore Str If BoolOpOr NameLoad NameLoad body Assign NameStore Str Assign NameStore NameLoad If NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Assign NameStore Call NameLoad NameLoad Str Str handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Raise FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad For NameStore NameLoad body If CompareIs NameLoad NameLoad body Expr Yield NameLoad orelse Expr Yield Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults TupleLoad Str body Return ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad decorator_list Assign NameStore NameLoad If BoolOpAnd NameLoad CompareIn Str NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr If NameLoad body FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list orelse FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad Str body Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad NameLoad orelse Return NameLoad decorator_list Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore NameStore NameStore NameLoad Assign NameStore NameStore ListComp NameLoad comprehension NameStore Call NameLoad NameLoad Assign NameStore BoolOpOr BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore NameStore NameLoad If BoolOpOr NameLoad BoolOpAnd NameLoad Call AttributeLoad NameLoad attr body TryExcept body Assign NameStore NameStore BoolOpOr Call NameLoad Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Pass TryExcept body If NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Call NameLoad orelse If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Raise Expr Yield Call NameLoad keyword NameLoad keyword NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults kwarg body Assign AttributeStore NameLoad attr Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr Str ListLoad Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad decorator_list decorator_list Assign NameStore Call AttributeLoad NameLoad attr TupleLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If BoolOpOr UnaryOpNot NameLoad UnaryOpNot Call AttributeLoad NameLoad attr body Return For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr Str body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num If CompareEq Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore NameLoad orelse If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse Raise Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Yield TupleLoad NameLoad NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore NameLoad orelse Raise Call NameLoad NameLoad orelse Assign NameStore NameLoad Import alias Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return Call AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Return NameLoad Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str NameLoad body Expr Str Return ListComp Call NameLoad Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If NameLoad body Assign NameStore Call NameLoad NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Dict For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore NameLoad If CompareLt NameLoad Call NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If NameLoad body TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body AugAssignAdd AttributeStore NameLoad attr BinOpAdd Str Call NameLoad TupleLoad NameLoad NameLoad NameLoad Raise orelse Assign NameStore NameLoad orelse Assign NameStore NameLoad Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad NameLoad Assign NameStore ListLoad TupleLoad TupleLoad Str NameLoad TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore NameLoad If UnaryOpNot NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If CompareEq NameLoad Str body Assign NameStore NameLoad Assign NameStore NameLoad orelse If CompareEq NameLoad Str body Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad orelse TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Num If CompareIn Str NameLoad body Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad orelse Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad NameLoad name NameStore body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad TupleLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Num If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore IfExp NameLoad NameLoad NameLoad Return Call NameLoad TupleLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad orelse Assign TupleStore NameStore NameStore NameLoad Assign NameStore IfExp NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad IfExp NameLoad NameLoad NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Str For NameStore NameLoad body If UnaryOpNot NameLoad body Continue Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Str Num orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice Num NameLoad orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice Num NameLoad orelse Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Dict Str Str Str Str Str Str Str Str Str NameLoad Str NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd NameLoad CompareIsNot AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Call NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Return NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults Str kwarg body Expr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore NameLoad If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad keyword Str NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad NameLoad NameLoad orelse If CompareIn NameLoad TupleLoad Str Str body Assign NameStore Call NameLoad NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore NameLoad If Call AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Str decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Num keyword Str keyword AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Yield Str For TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr body Expr Yield BinOpMod Str BoolOpOr BoolOpAnd CompareIsNot NameLoad NameLoad BinOpMod Str NameLoad Str If Call NameLoad NameLoad Str body For NameStore NameLoad body Expr Yield BinOpMod Str Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore BoolOpOr BoolOpAnd NameLoad Call NameLoad NameLoad Str Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Yield Call AttributeLoad NameLoad attr NameLoad Expr Yield Str Expr Yield Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Import alias alias Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Yield Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Str keyword Str Expr Yield Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Import alias Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str Str keyword Str keyword Str keyword Num keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Return NameLoad decorator_list FunctionDef arguments args defaults kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd NameLoad NameLoad body Raise Call NameLoad Str If NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad TupleLoad Str NameLoad TupleLoad Str NameLoad If NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad TupleLoad Str NameLoad TupleLoad Str NameLoad If NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list orelse FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Import alias Import alias Assign NameStore Call NameLoad Assign NameStore NameStore IfExp CompareIsNot NameLoad NameLoad Call NameLoad NameLoad ListLoad If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Assign NameStore NameLoad orelse Raise Call NameLoad NameLoad If UnaryOpNot NameLoad body Assign NameStore Dict Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad If Call AttributeLoad NameLoad attr Str body Expr Call NameLoad NameLoad Return TupleLoad Num NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str Call NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore NameLoad If BoolOpAnd Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str If CompareNotIn Str NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr Str body If BoolOpAnd CompareEq Call AttributeLoad NameLoad attr Str Str CompareIn Str Call AttributeLoad NameLoad attr Str body Assign NameStore Str orelse Assign NameStore Str orelse Assign NameStore Str Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad Str SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str IfExp CompareIn Str NameLoad Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad TryFinally body If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad orelse If CompareIs Call AttributeLoad NameLoad attr Str Str body Assign SubscriptStore NameLoad Index Str Call Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str keyword Str If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad orelse If CompareIs Call AttributeLoad NameLoad attr Str Str body Assign SubscriptStore NameLoad Index Str Call Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr orelse If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str keyword Str orelse Assign SubscriptStore NameLoad Index Str Call Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr If CompareIs Call AttributeLoad NameLoad attr Str NameLoad body Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr TupleLoad Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword Call AttributeLoad NameLoad attr Str keyword SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore ListLoad For NameStore Call NameLoad SubscriptLoad NameLoad Index Str NameLoad body If UnaryOpNot AttributeLoad NameLoad attr body Continue Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse For NameStore Call NameLoad SubscriptLoad NameLoad Index Str NameLoad body If UnaryOpNot AttributeLoad NameLoad attr body Continue Expr Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr finalbody If CompareNotIn Call Call NameLoad Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str NameLoad TupleLoad Num Num Num body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Return TupleLoad Num NameLoad decorator_list If CompareEq NameLoad Str body Import alias Assign TupleStore NameStore NameStore Call NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Slice Num Expr Call AttributeLoad NameLoad attr NameLoad
N/A __future__ print_function N/A 

**pyline**

Pyline is a UNIX command-line tool for
line-based processing in Python
with regex and output transform features
similar to grep, sed, and awk.

Features:

* Python ``str.split()`` by a delimiter (``-F``)
* Python ``shlex.split(posix=True)`` with POSIX quote parsing (``--shlex``)
* Python Regex (``-r``, ``--regex``, ``-R``, ``--regex-options``)
* Output as ``txt``, ``csv``, ``tsv``, ``json``, ``html``
  (``-O|--output-format=csv``)
* Output as Markdown/ReStructuredText ``checkbox`` lists
  (``-O|--output-format=checkbok``)
* (Lazy) sorting (``-s``, ``--sort-asc``, ``-S``, ``--sort-desc``) # XXX TODO
* Path.py or pathlib objects from each line (``-p``)
* ``namedtuple``s, ``yield``ing generators

**Usage**

Shell::

    pyline.py --help

    # Print every line (null transform)
    cat ~/.bashrc | pyline.py line
    cat ~/.bashrc | pyline.py l

    # Number every line
    cat ~/.bashrc | pyline -n l

    # Print every word (str.split(--input-delim=None))
    cat ~/.bashrc | pyline.py words
    cat ~/.bashrc | pyline.py w

    # Split into words and print (default: tab separated)
    cat ~/.bashrc | pyline.py 'len(w) >= 2 and w[1] or "?"

    # Select the last word, dropping lines with no words
    pyline.py -f ~/.bashrc 'w[-1:]'

    # Regex matching with groups
    cat ~/.bashrc | pyline.py -n -r '^#(.*)'         'rgx and (rgx.group(0), rgx.group(1))'

    # Call a module function
    cat > pf.py << EOF
    def backwards(line):
        return line[::-1]
    EOF
    echo "wrd.nu" | pyline -m pf 'pf.backwards(l)'

.. note:: This file should only import from the standard library
    so that it is vendorable by copying one file::

    .. code:: bash

        # pip install pyline
        pyline      # -> pyline:main entry_point

        # vendored as pyline.py
        cp ./pyline.py ${__DOTFILES}/scripts/pyline.py
        pyline.py   # -> ${__DOTFILES}/scripts/pyline.py

 N/A __version__ version 0.3.12 N/A cgi N/A csv N/A collections N/A codecs N/A json N/A logging N/A textwrap N/A pprint N/A re N/A shlex _shlex N/A sys collections namedtuple functools partial N/A EPILOG __doc__ N/A REGEX_DOC 
I  IGNORECASE  Perform case-insensitive matching.
L  LOCALE      Make \w, \W, , \B, dependent on the current locale.
M  MULTILINE   "^" matches the beginning of lines (after a newline)
                as well as the string.
                "$" matches the end of lines (before a newline) as well
                as the end of the string.
S  DOTALL      "." matches any character at all, including the newline.
X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
U  UNICODE     Make \w, \W, , \B, dependent on the Unicode locale. N/A REGEX_OPTIONS N/A dict N/A N/A N/A l N/A 0 N/A N/A N/A N/A l N/A 1 14 strip N/A l N/A 15 N/A l N/A N/A REGEX_DOC split l N/A STANDARD_REGEXES N/A N/A DEFAULT_LOGGER pyline N/A log N/A N/A logging getLogger DEFAULT_LOGGER N/A hdlr N/A N/A logging StreamHandler stream N/A sys stderr N/A fmt N/A N/A logging Formatter %(levelname)-5s %(name)s:%(lineno)5s: %(message)s N/A N/A N/A hdlr setFormatter fmt N/A N/A N/A log addHandler hdlr N/A N/A N/A log setLevel N/A logging WARN N/A Result N/A namedtuple Result N/A n result PylineResult N/A Result N/A __str__ N/A N/A self N/A N/A N/A result N/A self result N/A odelim N/A odelim N/A unicode odelim N/A N/A N/A result None N/A result False N/A N/A result N/A N/A N/A hasattr N/A self result itervalues N/A N/A result N/A N/A odelim join N/A N/A unicode s N/A s N/A N/A N/A self result itervalues N/A N/A N/A hasattr N/A self result __iter__ N/A N/A result N/A N/A odelim join N/A N/A unicode s N/A s result N/A N/A N/A N/A result N/A -1 N/A N/A result N/A result N/A -1 N/A result N/A __unicode__ N/A N/A self N/A N/A N/A N/A N/A self __str__ N/A _numbered N/A N/A self N/A opts N/A N/A N/A N/A self n N/A N/A N/A N/A self result None N/A N/A self result False N/A N/A N/A N/A self result N/A N/A N/A hasattr N/A self result itervalues N/A N/A col N/A N/A N/A self result itervalues N/A N/A N/A col N/A N/A N/A hasattr N/A self result __iter__ N/A N/A col N/A self result N/A N/A N/A col N/A N/A N/A hasattr N/A self result rstrip N/A N/A N/A N/A N/A N/A self result rstrip N/A _numbered_str N/A N/A self odelim N/A N/A N/A record N/A N/A self _numbered N/A N/A  %4d%s%s N/A N/A N/A record next odelim N/A N/A N/A unicode odelim join N/A N/A str x N/A x record N/A N/A debug N/A N/A N/A args kwargs N/A N/A N/A log_ args kwargs N/A N/A Exception args kwargs N/A log_ N/A N/A N/A args kwargs N/A N/A log through to stderr and return what is passed in

    .. code::

        log(value) -> value
        log(value, **kwargs) -> (value, kwargs)
        log(value1, value2, **kwargs) -> ([value1, value2], kwargs)
        log(value1, value2) -> [value1, value2]
     N/A N/A N/A log debug N/A args kwargs N/A N/A kwargs None N/A N/A N/A N/A len args 1 N/A N/A N/A args N/A 0 N/A args N/A N/A args N/A N/A N/A N/A len args 1 N/A N/A N/A N/A args N/A 0 kwargs N/A N/A args kwargs N/A N/A kwargs N/A pyline N/A N/A iterable cmd codefunc col_map uri meta modules regex regex_options path_tools_pathpy path_tools_pathlib shlex idelim idelim_split_max odelim N/A None None None None None N/A None None False False None None -1 kwargs N/A N/A 
    Process an iterable of lines

    Args:
        iterable (iterable): iterable of strings (e.g. sys.stdin or a file)
        cmd (str): python command string
        codefunc (callable): alternative to cmd ``codefunc(locals())``
        col_map (None or OrderedDict): a column-key to type-callable mapping
        uri (None or str): uri of the current file (for PylineResult objs)
        meta (None or str): uri of the current file (for PylineResult objs)
        modules ([str]): list of modules to import
        regex (str): regex pattern to match (with groups)
        regex_options (TODO): Regex options: I L M S X U (see ``pydoc re``)
        path_tools (bool): try to cast each line to a file
        idelim (str): input delimiter
        idelim_split_max (int): str.split(idelim, idelim_split_max)
        odelim (str): output delimiter

    Returns:
        iterable of PylineResult namedtuples
     N/A _importset modules N/A N/A _import N/A N/A _importset split , N/A N/A N/A N/A locals N/A _import N/A __import__ N/A N/A _import strip N/A _rgx None N/A regex N/A N/A _regexstr regex N/A N/A bool regex_options N/A N/A _regexstr N/A N/A (?%s) regex_options _regexstr N/A N/A N/A log info N/A _rgx _regexstr N/A _rgx N/A N/A re compile _regexstr N/A Path str N/A path_tools_pathpy N/A N/A path pathpy N/A Path N/A pathpy path N/A path_tools_pathlib N/A N/A pathlib N/A Path N/A pathlib Path N/A N/A N/A cmd None N/A codefunc None N/A N/A regex N/A N/A cmd rgx and rgx.groups() N/A N/A cmd line N/A N/A path_tools_pathpy path_tools_pathlib N/A N/A cmd p N/A codeobj None N/A cmd N/A N/A N/A N/A N/A N/A log info N/A cmd cmd N/A codeobj N/A compile cmd command eval N/A N/A N/A Exception N/A e N/A N/A N/A e message N/A %s
cmd: %s N/A N/A e message cmd N/A N/A N/A log error N/A repr cmd N/A N/A N/A log exception e N/A item_keys N/A N/A obj keys N/A N/A N/A N/A isinstance keys N/A str unicode N/A N/A keys N/A keys N/A k keys N/A N/A N/A k None N/A N/A N/A k N/A N/A N/A N/A N/A obj __getslice__ k N/A k N/A N/A obj keys N/A N/A : N/A N/A N/A N/A N/A obj __getslice__ k N/A k keys N/A j N/A N/A args N/A N/A N/A N/A N/A odelim join N/A N/A str _value N/A _value args N/A N/A i_last None N/A N/A cmd N/A i_last cmd N/A N/A iterable N/A list iterable N/A i_last N/A len iterable N/A pp N/A pprint pformat N/A shlex N/A splitfunc N/A N/A line N/A N/A N/A N/A N/A _shlex split line posix True N/A N/A splitfunc N/A N/A obj N/A N/A N/A N/A hasattr obj strip N/A N/A N/A N/A N/A N/A obj strip split idelim idelim_split_max N/A N/A obj N/A N/A global_ctxt N/A globals N/A N/A i obj N/A enumerate iterable N/A N/A l line o obj N/A w words N/A _w N/A _w N/A splitfunc line N/A rgx N/A N/A _rgx N/A N/A _rgx match line None N/A p path None N/A N/A path_tools_pathpy N/A path_tools_pathlib N/A N/A line rstrip N/A N/A N/A N/A p path N/A N/A Path N/A N/A line strip None N/A N/A N/A Exception N/A e N/A N/A N/A N/A log exception e N/A N/A N/A N/A codeobj N/A N/A result N/A eval codeobj global_ctxt N/A locals N/A N/A codefunc N/A N/A ctxt N/A N/A global_ctxt copy N/A N/A N/A ctxt update N/A locals N/A result N/A codefunc ctxt N/A N/A N/A Exception N/A e N/A N/A N/A e cmd cmd N/A N/A N/A log exception N/A repr cmd N/A N/A N/A log exception e N/A N/A N/A N/A PylineResult n i result result N/A OrderedDict_ N/A N/A collections OrderedDict N/A keys N/A N/A self N/A N/A N/A N/A list N/A N/A N/A collections OrderedDict keys self N/A values N/A N/A self N/A N/A N/A N/A list N/A N/A N/A collections OrderedDict values self N/A N/A PylineDatasource N/A object N/A __init__ N/A N/A self N/A kwargs N/A N/A N/A self data N/A OrderedDict_ N/A N/A N/A self data N/A uri N/A N/A kwargs get uri N/A N/A N/A self data N/A meta N/A N/A kwargs get meta OrderedDict_ N/A N/A N/A self data N/A resultsets N/A N/A kwargs get resultsets N/A N/A results N/A N/A kwargs get results N/A N/A results None N/A N/A N/A N/A self add_resultset results N/A add_resultset N/A N/A self results N/A N/A N/A N/A results None N/A N/A N/A N/A N/A N/A self data N/A resultsets append results N/A N/A N/A typestr_func_map N/A N/A collections OrderedDict N/A N/A b bool N/A bool bool N/A xsd:bool bool N/A bin bin N/A h hex N/A hex hex N/A i int N/A int int N/A xsd:integer int N/A f float N/A float float N/A xsd:float float N/A s str N/A str str N/A xsd:string str N/A u unicode N/A unicode unicode N/A COLSPECSTRRGX N/A N/A re compile :: parse_colspecstr N/A N/A colspecstr default N/A unicode N/A N/A 

    Args:
        colspecstr (str): e.g. "0,1,2,3" or "0,1,4::int"

    Keyword Arguments:
        default (callable): type casting callable

    Yields:
        tuple: (colkey, coltypefunc)

    .. code::

        ' '
        0
        0,1,2
        2, 1, 0
        2:int
        0:str, 1:int, 2:int
        0:int, 1:int, 2:int  # raises
        0, 1, 2:int
        2::int, 2::xsd:integer  #
        #0:"xsd:string", 2:xsd:integer #
        attr:"xsd:string", attr2:"xsd:integer" #

        # - [ ] ENH: [rdflib] RDFa default context
        # - [ ] ENH: shlex quote parsing after the split

     N/A N/A N/A colspecstr N/A N/A N/A colspecstr strip N/A N/A N/A N/A n colspecstr_col_n N/A enumerate N/A N/A colspecstr split , N/A N/A colkeystr None N/A coltypefunc default N/A colspecstrrgx_split N/A N/A COLSPECSTRRGX split colspecstr_col_n maxsplit 1 N/A N/A N/A len colspecstrrgx_split 2 N/A N/A N/A colkeystr coltypestr colspecstrrgx_split N/A N/A N/A N/A len colspecstrrgx_split 1 N/A N/A colkeystr N/A colspecstrrgx_split N/A 0 N/A N/A N/A ValueError colspecstrrgx_split N/A colkey N/A N/A N/A parse_field colkeystr strip N/A coltypestr N/A N/A N/A parse_field coltypestr strip N/A coltypefunc N/A N/A typestr_func_map get coltypestr default N/A N/A N/A colkey coltypefunc N/A N/A SHLEXRGX N/A N/A re compile ['"]+ parse_field N/A N/A colspecfieldstr shlex N/A None N/A N/A 

    Args:
        str_ (basestring):
        shlex (None or bool): default None: shlex if ' or ", if True shlex
     N/A N/A shlex None N/A N/A matchobj N/A N/A SHLEXRGX match colspecfieldstr N/A shlex N/A bool matchobj N/A retval None N/A shlex N/A N/A shlexoutput N/A N/A _shlex split colspecfieldstr comments False posix True N/A shlexoutput N/A N/A shlexword1 N/A shlexoutput N/A 0 N/A retval shlexword1 N/A N/A N/A ValueError colspecfieldstr N/A N/A retval colspecfieldstr N/A pdb N/A N/A N/A pdb set_trace N/A retval N/A build_column_map N/A N/A colspecstr N/A N/A N/A 
    Args:
        colspecstr (str or OrderedDict): a colspecstrstr column-key to type-callable mapping
    Returns:
        OrderedDict: (colkey, type_func) mappings "column_map" # TODO
     N/A N/A colspecstr N/A N/A N/A N/A collections OrderedDict N/A N/A hasattr colspecstr items N/A N/A colspecstr N/A N/A N/A collections OrderedDict N/A parse_colspecstr colspecstr default unicode N/A get_list_from_str N/A N/A str_ idelim typefunc N/A , int N/A N/A 
    Split a string of things separated by commas & cast/wrap with typefunc

    Args:
        str_ (str (.strip, .split)): string to split
        idelim (str): string to split by ("input delimiter")
        typefunc (callable): wrap results with this callable
    Returns:
        list: list of Type_func(
     N/A N/A N/A typefunc N/A N/A x strip N/A x N/A N/A str_ split idelim N/A sort_by N/A N/A iterable sortstr reverse col_map default_type default_value N/A None False None None None N/A N/A sort an iterable, cast to ``col_map.get(colkey, default_type)``,
    and default to ``default_value``.

    Args:
        iterable (iterable): iterable of lines/rows
    Kwargs:
        sortstr (None, str): comma separated list of column index (``1,2,3``)
        reverse (bool): (True, Descending), (False, Ascending) default: False
        col_map (None, dict): dict mapping column n to a typefunc
        default_type (None, callable): type callable (default: None)
        default_value (\*): default N/A value for columns not specified
                            in col_map (default: None)
    Returns:
        list: sorted list of lines/rows
     keyfunc_iter N/A N/A obj sortstr col_map N/A sortstr col_map N/A N/A Parse and yield column values according to ``sortstr`` and ``col_map``

        Args:
            obj (object): obj to sort (as from ``sorted(keyfunc=thisfunc)``)
            sortstr (str): sort string of comma-separated columns
            col_map (None, dict): dict mapping column n to a typefunc (default: None)
        Yields:
            object: typecasted column value
         N/A sortstr N/A N/A column_sequence N/A get_list_from_str sortstr typefunc int N/A N/A column_sequence N/A xrange N/A len N/A obj result N/A N/A N/A log debug N/A column_sequence column_sequence N/A N/A col_map None N/A N/A col_map N/A N/A n column_sequence N/A N/A type_func N/A N/A col_map get N/A str n default_type N/A retval default_value N/A N/A n N/A len N/A obj result N/A N/A colvalue N/A N/A obj result N/A n N/A type_func N/A N/A N/A N/A retval N/A type_func colvalue N/A N/A N/A ValueError N/A e N/A N/A N/A e msg N/A N/A repr N/A type_func colvalue e N/A N/A N/A retval colvalue N/A N/A retval default_value N/A N/A retval N/A keyfunc N/A N/A obj sortstr col_map N/A sortstr col_map N/A N/A key function (e.g. for ``sorted(key=keyfunc)``)

        Args:
            obj (PylineResult): ``obj.result = ['col1', 'col2', 'coln']``
        Returns:
            tuple: (col2, col0, col1)
         N/A keyvalue N/A tuple N/A keyfunc_iter obj sortstr col_map N/A errdata N/A N/A N/A keyvalue keyvalue N/A sortstr sortstr N/A N/A N/A log debug N/A errdata N/A keyvalue N/A N/A sorted_values N/A sorted iterable key keyfunc reverse reverse N/A sorted_values N/A str2boolintorfloat N/A N/A str_ N/A N/A N/A 
    Try to cast a string as a ``bool``, ``float``, ``int``,
    or ``str_.__class__``.

    Args:
        str_ (basestring): string to try and cast
    Returns:
        object: casted ``{boot, float, int, or str_.__class__}``
     N/A match N/A N/A re match ([\d\.]+) str_ N/A type_ None N/A N/A match N/A N/A type_ N/A str_ __class__ N/A value str_ N/A value_lower N/A N/A N/A N/A value strip lower N/A N/A value_lower true N/A N/A type_ bool N/A value True N/A N/A N/A value_lower false N/A N/A type_ bool N/A value False N/A value N/A N/A N/A N/A numstr N/A N/A match group 1 N/A N/A . numstr N/A N/A type_ float N/A value N/A type_ numstr N/A N/A type_ int N/A value N/A type_ numstr N/A N/A N/A N/A ValueError NameError IndexError N/A e N/A N/A value str_ N/A N/A N/A log exception N/A e N/A type_ value N/A value N/A parse_formatstring N/A N/A str_ N/A N/A N/A 
    Parse a format string like
    ``format:+isTrue,-isFalse,key0=value,key1=1.1,keyTrue=true``

    Args:
        str_ (basestring): _format

    Returns:
        OrderedDict_: {key: {True|False|float|int|str}}

        .. code:: python

            {
                fmtkey:   _formatstr,
                argkey: argstr,

                'key0':   'value0',
                'key1':   1,
                'key2':   True,
                'key2.1': 2.1,
            }

    Inspired by rdflib ``rdfpipe -h | grep 'FORMAT:'``::

        FORMAT:(+)KW1,-KW2,KW3=VALUE
        format
        format:opt1
        format:opt2=True

     N/A fmtkey _output_format N/A argkey _output_format_args N/A strsplit N/A N/A str_ split : 1 N/A N/A N/A len strsplit 1 N/A N/A _format N/A strsplit N/A 0 N/A _format N/A _format _format None N/A N/A OrderedDict_ N/A N/A fmtkey _format N/A argkey None N/A N/A N/A _format argstr strsplit N/A _format N/A _format _format None N/A opts N/A OrderedDict_ N/A N/A opts N/A fmtkey _format N/A N/A opts N/A argkey N/A argstr argstr None N/A _args N/A N/A N/A x strip N/A x N/A N/A argstr split , N/A arg _args N/A N/A N/A arg N/A N/A N/A N/A key value N/A None None N/A N/A = arg N/A N/A N/A key value N/A N/A N/A x strip N/A x N/A N/A arg split = 1 N/A N/A N/A N/A arg N/A 0 - N/A N/A N/A key value N/A N/A arg N/A 1 False N/A N/A N/A N/A arg N/A 0 + N/A N/A N/A key value N/A N/A arg N/A 1 True N/A N/A N/A key value N/A arg True N/A N/A N/A isinstance value N/A bool float int N/A N/A N/A opts N/A key N/A str2boolintorfloat value N/A N/A N/A opts N/A key value N/A opts N/A ResultWriter N/A object N/A N/A OUTPUT_FILETYPES N/A csv json tsv html jinja txt checkbox chk , True True True True True True N/A output_format None __init__ N/A N/A self _output N/A args kwargs N/A N/A N/A self _output _output N/A N/A self _conf kwargs N/A N/A N/A self setup _output args kwargs N/A setup N/A N/A self N/A args kwargs N/A N/A N/A set_output N/A N/A self _output N/A N/A N/A N/A _output N/A N/A self _output None N/A N/A N/A Exception N/A N/A N/A self _output _output N/A header N/A N/A self N/A args kwargs N/A N/A N/A write N/A N/A self obj N/A N/A N/A N/A print N/A unicode obj file N/A self _output N/A write_numbered N/A N/A self obj N/A N/A N/A N/A print obj file N/A self _output N/A footer N/A N/A self N/A args kwargs N/A N/A N/A is_valid_output_format N/A N/A cls _output_formatstr N/A N/A N/A opts N/A parse_formatstring _output_formatstr N/A _output_format N/A N/A opts get _output_format N/A N/A _output_format N/A cls OUTPUT_FILETYPES N/A N/A _output_format N/A False N/A classmethod get_writer N/A N/A cls _output output_format N/A csv kwargs N/A N/A get writer object for _output with the specified output_format

        Args:
            _output (file-like .write): output to write to
        Kwargs:
            output_format (str): a formatstring to be parsed by
                            :py:func:`parse_formatstring`
            Filetypes::

                txt | csv | tsv | json | html | jinja | checkbox

        Returns:
            ResultWriter: a configured ResultWriter subclass instance
         N/A opts N/A parse_formatstring N/A N/A output_format strip N/A _output_format N/A N/A opts pop _output_format None N/A N/A N/A opts update kwargs N/A N/A N/A N/A cls is_valid_output_format _output_format N/A N/A N/A ValueError N/A _output_format: %r _output_format N/A writer None N/A N/A _output_format txt N/A N/A writer N/A ResultWriter_txt _output N/A N/A N/A _output_format csv N/A N/A writer N/A ResultWriter_csv _output opts N/A N/A N/A _output_format tsv N/A N/A writer N/A ResultWriter_csv _output delimiter opts N/A N/A N/A _output_format json N/A N/A writer N/A ResultWriter_json _output N/A N/A N/A _output_format html N/A N/A writer N/A ResultWriter_html _output opts N/A N/A N/A N/A _output_format startswith jinja N/A N/A writer N/A ResultWriter_jinja _output opts N/A N/A N/A _output_format N/A checkbox chk N/A N/A writer N/A ResultWriter_checkbox _output opts N/A N/A N/A ValueError N/A _output_format: %r _output_format N/A output_func None N/A N/A N/A kwargs get number_lines N/A N/A output_func N/A writer write_numbered N/A N/A output_func N/A writer write N/A N/A writer output_func output_func N/A writer N/A classmethod N/A ResultWriter_txt N/A ResultWriter N/A N/A output_format txt write_numbered N/A N/A self obj N/A N/A N/A N/A N/A self write N/A N/A obj _numbered_str odelim N/A N/A ResultWriter_csv N/A ResultWriter N/A N/A output_format csv setup N/A N/A self N/A args kwargs N/A N/A N/A self delimiter N/A N/A kwargs get delimiter N/A N/A N/A ResultWriter OUTPUT_FILETYPES get N/A self output_format , N/A N/A self _output_csv N/A N/A csv writer N/A self _output quoting N/A csv QUOTE_NONNUMERIC delimiter N/A self delimiter N/A header N/A N/A self N/A args kwargs N/A N/A attrs N/A N/A kwargs get attrs N/A N/A attrs None N/A N/A N/A N/A N/A self _output_csv writerow attrs N/A write N/A N/A self obj N/A N/A N/A N/A N/A N/A self _output_csv writerow N/A obj result N/A write_numbered N/A N/A self obj N/A N/A N/A N/A N/A N/A self _output_csv writerow N/A tuple N/A N/A obj _numbered N/A N/A ResultWriter_json N/A ResultWriter N/A N/A output_format json write N/A N/A self obj N/A N/A N/A N/A print N/A N/A json dumps N/A N/A obj _asdict indent 2 end ,
 file N/A self _output N/A N/A write_numbered write N/A ResultWriter_html N/A ResultWriter N/A N/A output_format html N/A escape_func N/A staticmethod N/A cgi escape header N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A self _output write <table> N/A N/A N/A N/A self _output write <tr> N/A attrs N/A N/A kwargs get attrs N/A N/A attrs None N/A N/A col attrs N/A N/A N/A N/A N/A self _output write N/A <th>%s</th> N/A N/A self escape_func col N/A N/A N/A N/A self _output write </tr> N/A _html_row N/A N/A self obj N/A N/A N/A N/A 
<tr> N/A N/A attr col N/A N/A N/A N/A obj _asdict iteritems N/A N/A N/A N/A <td%s> N/A N/A N/A attr None N/A  class="%s" attr N/A N/A hasattr col __iter__ N/A N/A value col N/A N/A N/A N/A <span>%s</span> N/A N/A self escape_func value N/A N/A colvalue N/A N/A col N/A hasattr col rstrip N/A N/A col rstrip N/A str col N/A N/A N/A N/A self escape_func colvalue N/A N/A </td> N/A N/A </tr> N/A write N/A N/A self obj N/A N/A N/A N/A N/A N/A self _output write N/A N/A join N/A N/A self _html_row obj N/A footer N/A N/A self N/A N/A N/A N/A N/A N/A self _output write </table>
 N/A N/A ResultWriter_jinja N/A ResultWriter N/A N/A output_format jinja N/A escape_func N/A staticmethod N/A cgi escape setup N/A N/A self N/A args kwargs N/A N/A N/A N/A log debug N/A args args N/A N/A N/A log debug N/A kwargs kwargs N/A jinja2 os N/A N/A self escape_func N/A jinja2 escape N/A templatepath N/A N/A kwargs get template N/A N/A kwargs get tmpl N/A N/A templatepath None N/A N/A N/A ValueError Specify at least a template= like 'jinja:+autoescape,template=./template.jinja2' N/A N/A self templatepath N/A N/A N/A os path dirname templatepath N/A N/A self template N/A N/A N/A os path basename templatepath N/A N/A self loader N/A N/A jinja2 FileSystemLoader N/A self templatepath N/A envargs N/A OrderedDict_ N/A N/A envargs N/A autoescape N/A N/A kwargs get autoescape True N/A N/A self env N/A N/A jinja2 Environment envargs N/A N/A self tmpl N/A N/A N/A self loader load N/A self env N/A self template N/A write N/A N/A self obj N/A N/A N/A context N/A OrderedDict_ N/A N/A context N/A obj obj N/A jinja2_output N/A N/A N/A self tmpl render context N/A N/A N/A N/A self _output write jinja2_output N/A N/A ResultWriter_checkbox N/A ResultWriter N/A N/A output_format checkbox _checkbox_row N/A N/A self obj wrap N/A 79 N/A N/A N/A N/A N/A join N/A N/A textwrap wrap N/A unicode obj initial_indent - [ ]  subsequent_indent N/A N/A N/A write N/A N/A self obj N/A N/A N/A N/A N/A N/A self _output write N/A N/A join N/A N/A self _checkbox_row obj N/A N/A get_option_parser N/A N/A N/A N/A N/A optparse N/A prs N/A N/A optparse OptionParser usage %prog [-f<path>] [-o|--output-file=<path>] 
              [-F|--input-delim='\t'] 
              [--max|--max-split=3] 
              [-d|--output-delimiter='||'] 
              [-n|--number-lines] 
              [-m|--modules=<mod2>] 
              [-p|--pathpy] [--pathlib] 
              [-r '<rgx>'|--regex='<rgx>'] 
              '<python_expression>' 
 description Pyline is a UNIX command-line tool for line-based processing in Python with regex and output transform features similar to grep, sed, and awk. epilog EPILOG N/A N/A N/A prs add_option -f --in --input-file dest file action store default - help Input file  #default: '-' for stdin N/A N/A N/A prs add_option -F --input-delim dest idelim action store default None help words = line.split(-F)  #default: None (whitespace) N/A N/A N/A prs add_option --max --input-delim-split-max --max-split dest idelim_split_max action store default -1 type int help words = line.split(-F, --max) N/A N/A N/A prs add_option --shlex action store_true help words = shlex.split(line) N/A N/A N/A prs add_option -o --out --output-file dest output action store default - help Output file  #default: '-' for stdout N/A N/A N/A prs add_option -d --output-delim dest odelim default help String output delimiter for lists and tuples  #default: '\t' (tab, chr(9), $'\t') N/A N/A N/A prs add_option -O --output-format --output-filetype dest _output_format action store default txt help Output output_format <txt|csv|tsv|json|checkbox|chk|html>   #default: txt N/A N/A N/A prs add_option -p --pathpy dest path_tools_pathpy action store_true help p = path.Path(line); import path   #pip install path.py N/A N/A N/A prs add_option --pathlib dest path_tools_pathlib action store_true help p = pathlib.Path(line); import pathlib N/A N/A N/A prs add_option -r --regex dest regex action store help rgx = re.compile(-r).match(line) N/A N/A N/A prs add_option -R --regex-options dest regex_options action store default help Regex options: I L M S X U (ref: `$ pydoc re`) N/A N/A N/A prs add_option --cols dest col_mapstr action store help Optional column mappings (4::int, 0::unicode) N/A N/A N/A prs add_option -s --sort-asc dest sort_asc action store help sorted(lines, key=itemgetter(*-s)) N/A N/A N/A prs add_option -S --sort-desc dest sort_desc action store help sorted(lines, key=itemgetter(*-S), reverse=True) N/A N/A N/A prs add_option -n --number-lines dest number_lines action store_true help Print line numbers of matches N/A N/A N/A prs add_option -m --modules dest modules action append default N/A help for m in modules: import m  #default: [] N/A N/A N/A prs add_option -i --ipython dest start_ipython action store_true help Start IPython with results N/A N/A N/A prs add_option -v --verbose dest verbose action store_true N/A N/A N/A prs add_option -q --quiet dest quiet action store_true N/A N/A N/A prs add_option --version dest version action store_true help Print the version string N/A prs N/A get_sort_function N/A N/A N/A kwargs N/A N/A 
    get a sort function from the given opts dict

    Args:
        opts (dict): sort_asc:bool, sort_desc:bool
     N/A sortstr N/A N/A kwargs get sortstr N/A sortfunc None N/A reverse None N/A col_map N/A N/A kwargs get col_map N/A sort_asc N/A N/A kwargs get sort_asc N/A sort_desc N/A N/A kwargs get sort_desc N/A N/A sort_asc sort_desc N/A N/A N/A ValueError sort_asc and sort_desc are both specified N/A sort_asc N/A N/A sortstr sort_asc N/A reverse False N/A N/A N/A log info N/A N/A sort_asc sortstr N/A reverse reverse N/A sort_desc N/A N/A sortstr sort_desc N/A reverse True N/A N/A N/A log info N/A N/A sort_desc sortstr N/A reverse reverse N/A sortstr N/A sortfunc N/A N/A iterable sortstr reverse col_map N/A sortstr reverse col_map N/A N/A N/A sort_by iterable sortstr reverse reverse col_map col_map N/A N/A null_sortfunc N/A N/A iterable N/A N/A N/A iterable N/A N/A sortfunc null_sortfunc N/A sortfunc N/A main N/A N/A args iterable output results opts N/A None None None None None N/A N/A parse args, process iterable, write to output, return a returncode

    ``pyline.main`` function

    Kwargs:
        args (None or list[str]): list of commandline arguments (``--help``)
        iterable (None or iterable[object{str,}]): iterable of objects
        output (object:write): a file-like object with a ``.write`` method
        results (None or object:append): if not None, append results here
        opts (None): if set, these preempt args and argument parsing
    Returns:
        int: nonzero on error

    Raises:
        OptParseError: optparse.parse_args(args) may raise

    .. code::

        import pyline
        pyline.main(['-v', 'l and l[1]'], ['one 1', 'two 2', 'three 3'])
        pyline.main(['-v', 'w and w[1]'], ['one 1', 'two 2', 'three 3'])

     N/A logging N/A sys N/A prs N/A get_option_parser N/A argv args N/A N/A args None N/A list args N/A N/A N/A opts None N/A N/A N/A opts args N/A N/A prs parse_args args N/A optsdict None N/A N/A hasattr opts __dict__ N/A N/A optsdict N/A opts __dict__ N/A N/A N/A hasattr opts items N/A N/A optsdict opts N/A N/A N/A ValueError opts N/A N/A optsdict N/A N/A optsdict N/A N/A opts optsdict N/A log N/A N/A logging getLogger DEFAULT_LOGGER N/A N/A N/A N/A opts get quiet N/A N/A N/A N/A log setLevel N/A logging WARN N/A N/A N/A opts get verbose N/A N/A N/A N/A log setLevel N/A logging DEBUG N/A N/A N/A N/A log setLevel N/A logging ERROR N/A N/A N/A log info N/A pyline.version __version__ N/A N/A N/A log info N/A argv argv N/A N/A N/A log info N/A args args N/A N/A N/A opts get version N/A N/A N/A print __version__ N/A N/A 0 None N/A N/A opts N/A col_map N/A N/A collections OrderedDict N/A N/A N/A opts get col_mapstr N/A N/A N/A opts N/A col_map N/A build_column_map N/A N/A opts get col_mapstr N/A sortfunc None N/A N/A N/A N/A opts get sort_asc N/A N/A opts get sort_desc N/A N/A N/A N/A prs error both sort-asc and sort-desc are specified N/A N/A cmd opts N/A N/A cmd N/A N/A join args N/A N/A N/A N/A cmd strip N/A N/A N/A N/A opts get regex N/A N/A N/A N/A N/A N/A opts get _output_format json N/A < N/A N/A opts get regex N/A N/A cmd rgx and rgx.groupdict() N/A N/A cmd rgx and rgx.groups() N/A N/A cmd obj N/A N/A opts N/A cmd N/A N/A cmd strip N/A N/A N/A log info N/A cmd N/A opts N/A cmd N/A N/A opts N/A attrs N/A N/A col_map opts N/A list N/A N/A N/A opts N/A col_map keys None N/A N/A N/A N/A iterable None N/A N/A N/A opts N/A _file iterable N/A N/A N/A N/A N/A opts get file - N/A N/A N/A opts N/A _file N/A N/A N/A codecs getreader utf8 N/A sys stdin N/A N/A N/A opts N/A _file N/A N/A codecs open N/A opts N/A file r encoding utf8 N/A N/A output None N/A N/A N/A opts N/A _output output N/A N/A N/A N/A N/A opts get output - N/A N/A N/A opts N/A _output N/A N/A N/A codecs getwriter utf8 N/A sys stdout N/A N/A N/A N/A opts get output N/A N/A N/A opts N/A _output N/A N/A codecs open N/A opts N/A output w encoding utf8 N/A N/A N/A opts N/A _output N/A N/A N/A codecs getwriter utf8 N/A sys stdout N/A N/A N/A N/A opts get _output_format None N/A N/A N/A opts N/A _output_format json N/A N/A N/A log info N/A _output_format N/A opts N/A _output_format N/A N/A N/A log info N/A opts opts N/A writer N/A N/A ResultWriter get_writer N/A opts N/A _output output_format N/A opts N/A _output_format number_lines N/A N/A opts get number_lines attrs N/A opts N/A attrs N/A N/A N/A writer header N/A sortfunc N/A get_sort_function opts N/A sortfunc N/A N/A _results N/A N/A result N/A pyline N/A opts N/A _file opts N/A N/A N/A N/A result result N/A N/A N/A N/A N/A _results append result N/A sorted_results N/A sortfunc _results N/A N/A results None N/A N/A N/A N/A results extend sorted_results N/A result sorted_results N/A N/A N/A N/A writer output_func result N/A N/A result N/A pyline N/A opts N/A _file opts N/A N/A N/A N/A result result N/A N/A N/A N/A N/A writer output_func result N/A N/A results None N/A N/A N/A N/A results append result N/A N/A N/A writer footer N/A N/A N/A N/A N/A getattr N/A N/A opts get _file N/A codecs EncodedFile fileno int N/A 0 1 2 N/A N/A N/A N/A N/A opts N/A _file close N/A N/A 0 results N/A N/A N/A __name__ __main__ N/A N/A sys N/A N/A retval _ N/A main args N/A N/A sys argv N/A 1 N/A N/A N/A sys exit retval