Module Import alias Import alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body If BoolOpAnd CompareIn Str NameLoad Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Str body Return SubscriptLoad SubscriptLoad NameLoad Index Str Index Num decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str If Call NameLoad NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Dict Str ListLoad Dict Str NameLoad orelse If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore Dict Str ListComp Dict Str NameLoad comprehension NameStore NameLoad orelse Assign NameStore NameLoad Assign SubscriptStore NameLoad Index Str NameLoad For NameStore SubscriptLoad NameLoad Index Str body If UnaryOpNot Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str If CompareNotIn Str Call AttributeLoad NameLoad attr Str body Raise Call NameLoad Num Str If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad Num NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad Num NameLoad If NameLoad body Expr Call NameLoad NameLoad NameLoad If NameLoad body Expr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad Str body Return AttributeLoad NameLoad attr orelse If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Raise Call NameLoad Num Str Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword Num TryExcept body Assign NameStore Yield Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Raise Call NameLoad Num Str Raise Call NameLoad SubscriptLoad NameLoad Index Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad Str NameLoad If BoolOpAnd NameLoad CompareIsNot NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str attr Str Index Num If NameLoad body Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad Raise Call NameLoad Num NameLoad orelse Assign NameStore Str Raise Call NameLoad Num NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad NameLoad NameLoad body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Str Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad NameLoad If NameLoad body Raise Call NameLoad Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Str Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr UnaryOpNot Call NameLoad Call AttributeLoad NameLoad attr NameLoad If NameLoad body Raise Call NameLoad Num NameLoad decorator_list
N/A N/A json N/A logging N/A urllib N/A tornado.httpclient tornado.gen coroutine Return tornado.web RequestHandler tornado.options options chub API exceptions HTTPError _get_http_error N/A N/A kwargs N/A N/A N/A N/A N/A exc_info kwargs N/A hasattr N/A N/A kwargs N/A exc_info N/A 1 errors N/A N/A N/A N/A kwargs N/A exc_info N/A 1 N/A CorsHandler N/A RequestHandler N/A N/A Shared code for handling CORS set_default_headers N/A N/A self N/A N/A N/A Set the default headers

        If the 'cors' option is True, will set the 'Access-Control-Allow-Origin'
        header to '*'
         N/A N/A getattr options cors False N/A N/A N/A N/A self set_header Access-Control-Allow-Origin * N/A options N/A N/A self N/A args kwargs N/A N/A Default OPTIONS response

        If the 'cors' option is True, will respond with an empty response and
        set the 'Access-Control-Allow-Headers' and
        'Access-Control-Allow-Methods' headers
         N/A N/A getattr options cors False N/A N/A N/A N/A self set_header Access-Control-Allow-Headers Content-Type, Authorization, Accept, X-Requested-With N/A N/A N/A self set_header Access-Control-Allow-Methods OPTIONS, TRACE, GET, HEAD, POST, PUT, PATCH, DELETE N/A N/A N/A self finish N/A N/A JsonHandler N/A RequestHandler N/A N/A Shared code for handling JSON requests write_error N/A N/A self status_code N/A kwargs N/A N/A Override `write_error` in order to output JSON errors

        :param status_code: the response's status code, e.g. 500
         N/A http_error N/A _get_http_error kwargs N/A http_error N/A N/A N/A N/A self finish N/A N/A self _error_template status_code N/A http_error errors N/A http_error source N/A N/A source N/A N/A kwargs get source N/A getattr options name None N/A reason N/A N/A kwargs get reason N/A self _reason N/A N/A N/A self finish N/A N/A self _error_template status_code reason source N/A _error_template N/A N/A cls status_code errors source N/A None N/A N/A Construct JSON error response

        :param status_code: the http status code
        :param errors: string or list of error strings
        :param source: source of the error
        :returns: dictionary, e.g.
            {
                'status': 400,
                'errors': [
                    {
                        'source': 'accounts' ,
                        'message':'errormsg1'
                    },
                    {
                        'source': 'accounts',
                        'message':'errormsg2'
                    }
                ]
            }
         N/A N/A isinstance errors basestring N/A N/A errors_out N/A errors N/A N/A message errors N/A N/A N/A isinstance errors N/A list tuple N/A N/A errors_out N/A errors N/A N/A message e N/A e errors N/A N/A errors_out errors N/A N/A errors_out N/A status status_code N/A error N/A errors_out N/A errors N/A N/A N/A N/A N/A error get source N/A N/A N/A error N/A source source N/A N/A N/A logging error N/A N/A json dumps errors_out N/A errors_out N/A classmethod get_json_body N/A N/A self required validators N/A None None N/A N/A Get JSON from the request body

        :param required: optionally provide a list of keys that should be
        in the JSON body (raises a 400 HTTPError if any are missing)
        :param validator: optionally provide a dictionary of items that should
        be in the body with a method that validates the item.
        The method must be synchronous and return a boolean, no exceptions.
        :raises: HTTPError
         N/A content_type N/A N/A N/A N/A self request headers get Content-Type application/json N/A N/A application/json N/A N/A content_type split ; N/A N/A N/A HTTPError 415 Content-Type should be application/json N/A N/A N/A N/A self request body N/A N/A error Request body is empty N/A N/A N/A logging warning error N/A N/A HTTPError 400 error N/A N/A N/A body N/A N/A json loads N/A N/A self request body N/A N/A N/A N/A ValueError TypeError N/A N/A error Error parsing JSON N/A N/A N/A logging warning error N/A N/A HTTPError 400 error N/A required N/A N/A N/A _check_required body required N/A validators N/A N/A N/A _validate body validators N/A body N/A N/A AuthHandler N/A RequestHandler N/A N/A UNAUTHENTICATED_ACCESS unauthenticated N/A READ_ACCESS r N/A WRITE_ACCESS w N/A READ_WRITE_ACCESS rw N/A METHOD_ACCESS N/A GET HEAD POST PATCH PUT DELETE READ_ACCESS READ_ACCESS WRITE_ACCESS WRITE_ACCESS WRITE_ACCESS WRITE_ACCESS endpoint_access N/A N/A self method N/A N/A N/A 
        Determine access level needed for endpoint
        :param method: The request verb
        :return: String representing access type.
         N/A N/A method OPTIONS N/A N/A N/A self UNAUTHENTICATED_ACCESS N/A N/A N/A method N/A self METHOD_ACCESS N/A N/A N/A N/A logging error Cannot determine access needed for %s method method N/A N/A HTTPError 500 Internal Server Error N/A N/A N/A self METHOD_ACCESS N/A method N/A verify_token N/A N/A self token requested_access N/A N/A N/A 
        Check the token bearer is permitted to access the resource

        :param token: Access token
        :param requested_access: the access level the client has requested
        :returns: boolean
         N/A client N/A API N/A options url_auth auth_username N/A options service_id auth_password N/A options client_secret ca_certs N/A options ssl_ca_cert N/A headers N/A Content-Type Accept application/x-www-form-urlencoded application/json N/A body N/A N/A urllib urlencode N/A token requested_access token requested_access N/A N/A N/A N/A N/A client auth verify prepare_request headers headers request_timeout 180 N/A N/A N/A result N/A N/A N/A N/A N/A client auth verify post body body N/A N/A N/A N/A N/A tornado httpclient HTTPError N/A ex N/A N/A N/A N/A logging exception N/A ex message N/A N/A HTTPError 500 Internal Server Error N/A N/A Return N/A result N/A has_access N/A coroutine prepare N/A N/A self N/A N/A N/A If OAuth verification is required, validate provided token

        :raise: HTTPError if token does not have access
         N/A requested_access N/A N/A self endpoint_access N/A N/A self request method N/A use_oauth N/A getattr options use_oauth None N/A N/A use_oauth N/A requested_access N/A self UNAUTHENTICATED_ACCESS N/A N/A token N/A N/A N/A N/A N/A N/A N/A self request headers get Authorization split N/A -1 N/A token N/A N/A has_access N/A N/A N/A self verify_token token requested_access N/A N/A has_access N/A N/A msg N/A N/A '{}' access not granted. format requested_access N/A N/A HTTPError 403 msg N/A N/A msg OAuth token not provided N/A N/A HTTPError 401 msg N/A coroutine N/A BaseHandler N/A AuthHandler CorsHandler JsonHandler N/A N/A N/A _check_required N/A N/A body keys N/A N/A N/A msg Please provide a {} N/A errors N/A N/A N/A msg format k N/A k keys N/A k body N/A errors N/A N/A N/A HTTPError 400 errors N/A _validate N/A N/A body validators N/A N/A N/A msg Invalid data element {} N/A errors N/A N/A N/A msg format key N/A N/A key func N/A N/A validators items N/A N/A func N/A N/A body get key N/A errors N/A N/A N/A HTTPError 400 errors N/A