Module Expr Str ImportFrom alias Import alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Assign NameStore NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryFinally body TryExcept body Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr Expr Call NameLoad orelse Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return Dict Str Num Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad If BoolOpAnd NameLoad CompareIn NameLoad AttributeLoad NameLoad attr body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad Raise orelse If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Return Call NameLoad NameLoad handlers ExceptHandler body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num AttributeLoad SubscriptLoad NameLoad Index Num attr Expr Call AttributeLoad NameLoad attr NameLoad Return Dict Str Num finalbody Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIn Str AttributeLoad NameLoad attr body Delete SubscriptDel AttributeLoad NameLoad attr Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Break Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareIn Str NameLoad body Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Num Index Num Delete SubscriptDel NameLoad Index Str orelse Assign NameStore Num Return Dict Str Str Str BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Return TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad Assign NameStore AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Num If CompareEq BinOpSub AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If BoolOpOr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr Num If BoolOpAnd CompareEq Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Slice Num Call AttributeLoad NameLoad attr body TryExcept body Return TupleLoad Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Pass If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body With Call NameLoad NameLoad Str NameStore body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Num NameLoad Return TupleLoad NameLoad NameLoad orelse Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad ListComp Call NameLoad NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad If NameLoad body TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass orelse For NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Slice Num body Assign NameStore Call NameLoad NameLoad NameLoad Return NameLoad decorator_list
N/A N/A CGI server interface to Python runtime.

CGI-compliant interface between the Python runtime and user-provided Python
code.
 __future__ with_statement N/A cStringIO email feedparser N/A imp N/A logging N/A marshal N/A os N/A sys N/A traceback N/A types HandleRequest N/A N/A unused_environ handler_name unused_url post_data unused_error application_root python_lib import_hook N/A None N/A N/A Handle a single CGI request.

  Handles a request for handler_name in the form 'path/to/handler.py' with the
  environment contained in environ.

  Args:
    handler_name: A str containing the user-specified handler file to use for
        this request as specified in the script field of a handler in app.yaml.
    post_data: A stream containing the post data for this request.
    application_root: A str containing the root path of the application.
    python_lib: A str containing the root the Python App Engine library.
    import_hook: Optional import hook (PEP 302 style loader).

  Returns:
    A dict containing zero or more of the following:
      error: App Engine error code. 0 for OK, 1 for error. Defaults to OK if not
          set. If set, then the other fields may be missing.
      response_code: HTTP response code.
      headers: A list of tuples (key, value) of HTTP headers.
      body: A str of the body of the response.
   N/A body N/A N/A cStringIO StringIO N/A module_name N/A _FileToModuleName handler_name N/A N/A parent_module _ submodule_name N/A N/A module_name rpartition . N/A parent_module N/A _GetModuleOrNone parent_module N/A main None N/A N/A module_name N/A sys modules N/A N/A module N/A N/A sys modules N/A module_name N/A main N/A _GetValidMain module N/A N/A main N/A N/A module N/A N/A imp new_module __main__ N/A N/A import_hook None N/A N/A N/A module __loader__ import_hook N/A saved_streams N/A N/A sys stdin N/A sys stdout N/A N/A N/A N/A N/A N/A N/A sys modules N/A __main__ module N/A N/A N/A module __dict__ N/A __name__ __main__ N/A N/A sys stdin post_data N/A N/A sys stdout body N/A main N/A N/A N/A N/A os environ N/A PATH_TRANSLATED N/A module __file__ N/A N/A main N/A N/A filename N/A _AbsolutePath handler_name application_root python_lib N/A N/A N/A filename endswith N/A N/A os sep __init__.py N/A N/A N/A module __path__ N/A N/A N/A N/A os path dirname filename N/A N/A import_hook None N/A N/A N/A code filename N/A _LoadModuleCode filename N/A N/A code N/A N/A import_hook get_code module_name N/A N/A code N/A N/A N/A error 2 N/A N/A N/A os environ N/A PATH_TRANSLATED filename N/A N/A module __file__ filename N/A N/A N/A N/A N/A sys modules N/A module_name module N/A N/A eval code N/A module __dict__ N/A N/A N/A N/A N/A N/A sys modules N/A module_name N/A N/A parent_module N/A submodule_name N/A parent_module __dict__ N/A N/A N/A N/A parent_module __dict__ N/A submodule_name N/A N/A N/A parent_module N/A N/A N/A N/A parent_module __dict__ N/A submodule_name module N/A N/A _ParseResponse body N/A N/A N/A N/A exception N/A N/A sys exc_info N/A message N/A N/A join N/A N/A traceback format_exception N/A exception N/A 0 N/A exception N/A 1 N/A N/A exception N/A 2 tb_next N/A N/A N/A logging error message N/A N/A error 1 N/A N/A N/A N/A sys stdin N/A sys stdout saved_streams N/A N/A module __name__ module_name N/A N/A __main__ N/A sys modules N/A N/A N/A N/A sys modules N/A __main__ N/A _ParseResponse N/A N/A response N/A N/A N/A Parses an HTTP response into a dict.

  Args:
    response: A cStringIO.StringIO (StringO) containing the HTTP response.

  Returns:
    A dict with fields:
      body: A str containing the body.
      headers: A list containing tuples (key, value) of key and value pairs.
      response_code: An int containing the HTTP response code.
   N/A N/A N/A response reset N/A parser N/A N/A feedparser FeedParser N/A N/A N/A parser _set_headersonly N/A True N/A N/A line N/A N/A response readline N/A N/A N/A N/A N/A feedparser headerRE match line N/A N/A N/A N/A N/A N/A feedparser NLCRE match line N/A N/A N/A N/A parser feed line N/A N/A N/A N/A parser feed line N/A parsed_response N/A N/A parser close N/A N/A Status parsed_response N/A N/A status N/A int N/A N/A N/A N/A parsed_response N/A Status split 1 N/A 0 N/A N/A parsed_response N/A Status N/A N/A status 200 N/A N/A body headers response_code N/A N/A N/A parsed_response get_payload N/A N/A response read N/A N/A parsed_response items status N/A _ParseHeader N/A N/A header N/A N/A N/A Parses a str header into a (key, value) pair. N/A N/A key _ value N/A N/A header partition : N/A N/A N/A N/A key strip N/A N/A value strip N/A _GetValidMain N/A N/A module N/A N/A N/A Returns a main function in module if it exists and is valid or None.

  A main function is valid if it can be called with no arguments, i.e. calling
  module.main() would be valid.

  Args:
    module: The module in which to search for a main function.

  Returns:
    A function that takes no arguments if found or None otherwise.
   N/A N/A N/A hasattr module main N/A N/A None N/A main N/A module main N/A N/A N/A hasattr main __call__ N/A N/A None N/A defaults N/A main __defaults__ N/A defaults N/A N/A default_argcount N/A len defaults N/A N/A default_argcount 0 N/A N/A N/A N/A N/A main __code__ co_argcount default_argcount 0 N/A N/A main N/A N/A None N/A _FileToModuleName N/A N/A filename N/A N/A N/A Returns the module name corresponding to a filename. N/A N/A _ lib suffix N/A N/A filename partition $PYTHON_LIB/ N/A lib N/A N/A module suffix N/A N/A module filename N/A module N/A N/A N/A os path normpath module N/A N/A .py module N/A N/A module N/A N/A N/A module rpartition .py N/A 0 N/A module N/A N/A module replace N/A os sep . N/A module N/A N/A module strip . N/A N/A N/A module endswith .__init__ N/A N/A module N/A N/A N/A module rpartition .__init__ N/A 0 N/A module N/A _AbsolutePath N/A N/A filename application_root python_lib N/A N/A N/A Returns the absolute path of a Python script file.

  Args:
    filename: A str containing the handler script path.
    application_root: The absolute path of the root of the application.
    python_lib: The absolute path of the Python library.

  Returns:
    The absolute path of the handler script.
   N/A N/A _ lib suffix N/A N/A filename partition $PYTHON_LIB/ N/A lib N/A N/A filename N/A N/A N/A os path join python_lib suffix N/A N/A filename N/A N/A N/A os path join application_root filename N/A N/A N/A N/A filename endswith N/A os sep N/A N/A N/A os path isdir filename N/A N/A filename N/A N/A N/A os path join filename __init__.py N/A filename N/A _LoadModuleCode N/A N/A filename N/A N/A N/A Loads the code of a module, using compiled bytecode if available.

  Args:
    filename: The Python script filename.

  Returns:
    A 2-tuple (code, filename) where:
      code: A code object contained in the file or None if it does not exist.
      filename: The name of the file loaded, either the same as the arg
          filename, or the corresponding .pyc file.
   N/A compiled_filename N/A filename c N/A N/A N/A N/A os path exists compiled_filename N/A N/A N/A open compiled_filename r f N/A N/A magic_numbers N/A N/A f read 8 N/A N/A N/A N/A len magic_numbers 8 N/A N/A magic_numbers N/A 4 N/A N/A imp get_magic N/A N/A N/A N/A N/A N/A _FixCodeFilename N/A N/A marshal load f filename compiled_filename N/A N/A N/A N/A EOFError ValueError N/A N/A N/A N/A N/A N/A os path exists filename N/A N/A N/A open filename r f N/A N/A code N/A compile N/A N/A f read filename exec 0 True N/A N/A code filename N/A N/A N/A None filename N/A _FixCodeFilename N/A N/A code filename N/A N/A N/A Creates a CodeType with co_filename replaced with filename.

  Also affects nested code objects in co_consts.

  Args:
    code: The code object to be replaced.
    filename: The replacement filename.

  Returns:
    A new code object with its co_filename set to the provided filename.
   N/A N/A isinstance code N/A types CodeType N/A N/A code N/A N/A types CodeType N/A code co_argcount N/A code co_nlocals N/A code co_stacksize N/A code co_flags N/A code co_code N/A tuple N/A N/A _FixCodeFilename c filename N/A c N/A code co_consts N/A code co_names N/A code co_varnames filename N/A code co_name N/A code co_firstlineno N/A code co_lnotab N/A code co_freevars N/A code co_cellvars N/A code N/A _GetModuleOrNone N/A N/A module_name N/A N/A N/A Returns a module if it exists or None. N/A module None N/A module_name N/A N/A N/A N/A module N/A __import__ module_name N/A N/A N/A ImportError N/A N/A N/A N/A name N/A N/A N/A module_name split . N/A 1 N/A N/A module N/A getattr module name N/A module N/A