1674 lines
65 KiB
Text
1674 lines
65 KiB
Text
[
|
|
{"type":"CommentSingle","value":"# From CPython (Lib/asyncio/coroutines.py)"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Name","value":"__all__"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'coroutine'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'iscoroutinefunction'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'iscoroutine'"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"collections.abc"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"functools"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"inspect"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"os"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"sys"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"traceback"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"types"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"warnings"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordNamespace","value":"from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"."},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"base_futures"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"."},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"constants"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":"."},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"format_helpers"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordNamespace","value":"from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameNamespace","value":".log"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordNamespace","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"logger"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"_is_debug_mode"},
|
|
{"type":"Punctuation","value":"():"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# If you set _DEBUG to true, @coroutine will wrap the resulting"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# generator objects in a CoroWrapper instance (defined below). That"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# instance will log a message when the generator is never iterated"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# over, which may happen when you forget to use \"await\" or \"yield from\""},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# with a coroutine call."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Note that the value of the _DEBUG flag is taken"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# when the decorator is used, so to be of any use it must be set"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# before you define your coroutines. A downside of using this feature"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# is that tracebacks show entries for the CoroWrapper.__next__ method"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# when _DEBUG is true."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"sys"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"flags"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"dev_mode"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"or"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"sys"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"flags"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"ignore_environment"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltin","value":"bool"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"os"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"environ"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"get"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralStringSingle","value":"'PYTHONASYNCIODEBUG'"},
|
|
{"type":"Punctuation","value":")))"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Name","value":"_DEBUG"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_is_debug_mode"},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Keyword","value":"class"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameClass","value":"CoroWrapper"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Wrapper for coroutine object in _DEBUG mode."},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunctionMagic","value":"__init__"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"assert"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"isgenerator"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"or"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"iscoroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Punctuation","value":"),"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"CommentSingle","value":"# Used to unwrap @coroutine decorator"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_source_traceback"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"format_helpers"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"extract_stack"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"sys"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_getframe"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":"))"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__name__"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'__name__'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__qualname__"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'__qualname__'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunctionMagic","value":"__repr__"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_format_coroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_source_traceback"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_source_traceback"},
|
|
{"type":"Punctuation","value":"["},
|
|
{"type":"Operator","value":"-"},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":"]"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"+="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"', created at "},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"frame"},
|
|
{"type":"Punctuation","value":"["},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Punctuation","value":"]"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":":"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"frame"},
|
|
{"type":"Punctuation","value":"["},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":"]"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'\u003c"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__class__"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__name__"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" "},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"\u003e'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunctionMagic","value":"__iter__"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunctionMagic","value":"__next__"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"send"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"send"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"value"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"send"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"value"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"throw"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"type"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"value"},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"traceback"},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"throw"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltin","value":"type"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"value"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"traceback"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"close"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"close"},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"NameDecorator","value":"@property"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"gi_frame"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_frame"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"NameDecorator","value":"@property"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"gi_running"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_running"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"NameDecorator","value":"@property"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"gi_code"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_code"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunctionMagic","value":"__await__"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"NameDecorator","value":"@property"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"gi_yieldfrom"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_yieldfrom"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunctionMagic","value":"__del__"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Be careful accessing self.gen.frame -- self.gen might not exist."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'gen'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"gen"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'gi_frame'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"is"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"frame"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"f_lasti"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"=="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"-"},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"msg"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"LiteralStringInterpol","value":"!r}"},
|
|
{"type":"LiteralStringSingle","value":" was never yielded from'"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"tb"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltinPseudo","value":"self"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'_source_traceback'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"())"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"tb"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"tb"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"''"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"join"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"traceback"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"format_list"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"tb"},
|
|
{"type":"Punctuation","value":"))"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"msg"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"+="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringEscape","value":"\\n"},
|
|
{"type":"LiteralStringSingle","value":"Coroutine object created at '"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'(most recent call last, truncated to '"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"constants"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"DEBUG_STACK_DEPTH"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" last lines):"},
|
|
{"type":"LiteralStringEscape","value":"\\n"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"msg"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"+="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"tb"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"rstrip"},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"logger"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"error"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"msg"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"coroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"LiteralStringDouble","value":"\"\"\"Decorator to mark coroutines.\n\n If the coroutine is not yielded from before it is destroyed,\n an error message is logged.\n \"\"\""},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"warnings"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"warn"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralStringSingle","value":"'\"@coroutine\" decorator is deprecated since Python 3.8, use \"async def\" instead'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameException","value":"DeprecationWarning"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"stacklevel"},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"LiteralNumberInteger","value":"2"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"iscoroutinefunction"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# In Python 3.5 that's all we need to do for coroutines"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# defined with \"async def\"."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"isgeneratorfunction"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameDecorator","value":"@functools.wraps"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"coro"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Operator","value":"*"},
|
|
{"type":"Name","value":"args"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"**"},
|
|
{"type":"Name","value":"kw"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Operator","value":"*"},
|
|
{"type":"Name","value":"args"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"**"},
|
|
{"type":"Name","value":"kw"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"base_futures"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"isfuture"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"or"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"isgenerator"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"or"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltin","value":"isinstance"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"CoroWrapper"},
|
|
{"type":"Punctuation","value":")):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"yield from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# If 'res' is an awaitable, run it."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"try"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"await_meth"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameFunctionMagic","value":"__await__"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"except"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameException","value":"AttributeError"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"pass"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"isinstance"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"collections"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"abc"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"Awaitable"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"yield from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"await_meth"},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"res"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"types"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"coroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_DEBUG"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"wrapper"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameDecorator","value":"@functools.wraps"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"wrapper"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Operator","value":"*"},
|
|
{"type":"Name","value":"args"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"**"},
|
|
{"type":"Name","value":"kwds"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"w"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"CoroWrapper"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Operator","value":"*"},
|
|
{"type":"Name","value":"args"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"**"},
|
|
{"type":"Name","value":"kwds"},
|
|
{"type":"Punctuation","value":"),"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"w"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_source_traceback"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"del"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"w"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_source_traceback"},
|
|
{"type":"Punctuation","value":"["},
|
|
{"type":"Operator","value":"-"},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":"]"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Python \u003c 3.5 does not implement __qualname__"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# on generator objects, so we set it manually."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# We use getattr as some callables (such as"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# functools.partial may lack __qualname__)."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"w"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__name__"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'__name__'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"w"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__qualname__"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'__qualname__'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"w"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"wrapper"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_is_coroutine"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_is_coroutine"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"CommentSingle","value":"# For iscoroutinefunction()."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"wrapper"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"CommentSingle","value":"# A marker for iscoroutinefunction."},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Name","value":"_is_coroutine"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"object"},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"iscoroutinefunction"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"LiteralStringDouble","value":"\"\"\"Return True if func is a decorated coroutine function.\"\"\""},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"iscoroutinefunction"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"or"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameBuiltin","value":"getattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'_is_coroutine'"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"is"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_is_coroutine"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"CommentSingle","value":"# Prioritize native coroutine check to speed-up"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"CommentSingle","value":"# asyncio.iscoroutine."},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Name","value":"_COROUTINE_TYPES"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"types"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"CoroutineType"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"types"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"GeneratorType"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"collections"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"abc"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"Coroutine"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"CoroWrapper"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Name","value":"_iscoroutine_typecache"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"set"},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"iscoroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"obj"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"LiteralStringDouble","value":"\"\"\"Return True if obj is a coroutine object.\"\"\""},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"type"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"obj"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"in"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_iscoroutine_typecache"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"True"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"isinstance"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"obj"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"_COROUTINE_TYPES"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Just in case we don't want to cache more than 100"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# positive types. That shouldn't ever happen, unless"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# someone stressing the system on purpose."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"len"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"_iscoroutine_typecache"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"\u003c"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"100"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"_iscoroutine_typecache"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"add"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameBuiltin","value":"type"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"obj"},
|
|
{"type":"Punctuation","value":"))"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"True"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"False"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"_format_coroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"assert"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"iscoroutine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"is_corowrapper"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"isinstance"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"CoroWrapper"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"get_name"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Coroutines compiled with Cython sometimes don't have"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# proper __qualname__ or __name__. While that is a bug"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# in Cython, asyncio shouldn't crash with an AttributeError"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# in its __repr__ functions."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"is_corowrapper"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"format_helpers"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_format_callback"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"(),"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{})"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"hasattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'__qualname__'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__qualname__"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__qualname__"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"elif"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"hasattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'__name__'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__name__"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__name__"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Stop masking Cython bugs, expose them in a friendly way."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'\u003c"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"NameBuiltin","value":"type"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"NameVariableMagic","value":"__name__"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" without __name__\u003e'"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"()'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"def"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"is_running"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"try"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"cr_running"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"except"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameException","value":"AttributeError"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"try"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_running"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"except"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameException","value":"AttributeError"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"False"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"coro_code"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"hasattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'cr_code'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"cr_code"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_code"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"cr_code"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"elif"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"hasattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'gi_code'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_code"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_code"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_code"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"get_name"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_code"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# Built-in types might not have __qualname__ or __name__."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"is_running"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":"):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" running'"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"coro_frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"hasattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'gi_frame'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_frame"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"gi_frame"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"elif"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameBuiltin","value":"hasattr"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'cr_frame'"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"cr_frame"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"cr_frame"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"CommentSingle","value":"# If Cython's coroutine has a fake code object without proper"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"CommentSingle","value":"# co_filename -- expose that."},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"filename"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_code"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"co_filename"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"or"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'\u003cempty co_filename\u003e'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"is_corowrapper"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"is"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"and"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"inspect"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"isgeneratorfunction"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":")):"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"source"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"format_helpers"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"_get_function_source"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"coro"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"func"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"source"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"is"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"filename"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"source"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"is"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" done, defined at "},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"filename"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":":"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" running, defined at "},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"filename"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":":"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"elif"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_frame"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"is"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"OperatorWord","value":"not"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"None"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_frame"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"f_lineno"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" running at "},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"filename"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":":"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Punctuation","value":":"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_code"},
|
|
{"type":"Operator","value":"."},
|
|
{"type":"Name","value":"co_firstlineno"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringAffix","value":"f"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"coro_name"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":" done, defined at "},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"filename"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":":"},
|
|
{"type":"LiteralStringInterpol","value":"{"},
|
|
{"type":"Name","value":"lineno"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringSingle","value":"'"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"coro_repr"},
|
|
{"type":"Text","value":"\n\n"}
|
|
]
|