Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad TryExcept body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad Str attr SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Assign NameStore Num If Call AttributeLoad NameLoad attr Str body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad Return TupleLoad NameLoad NameLoad NameLoad With Call NameLoad NameLoad NameStore body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad NameLoad BinOpSub NameLoad Num NameLoad Return TupleLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad handlers ExceptHandler body If Call NameLoad NameLoad Str body Return TupleLoad Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num orelse Return TupleLoad Call NameLoad NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Import alias If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Import alias Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr For NameStore TupleLoad Str Str Str Str Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Str If CompareIs NameLoad NameLoad body Assign NameStore Str If CompareEq NameLoad Str body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str body Assign SubscriptStore NameLoad Index Num Str Assign NameStore Call AttributeLoad Str attr NameLoad If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore BinOpAdd BinOpAdd NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore Str If NameLoad body If BoolOpAnd Call NameLoad NameLoad Str CompareIn NameLoad AttributeLoad NameLoad attr body If UnaryOpNot CompareIs SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body Assign NameStore BinOpMod Str NameLoad If Call AttributeLoad NameLoad attr NameLoad body If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Import alias Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Return Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword ListLoad keyword NameLoad keyword Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad NameLoad Slice IfExp NameLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad Str attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Str Assign NameStore SubscriptLoad Call NameLoad NameLoad Slice Num Num Assign NameStore Call AttributeLoad Str attr GeneratorExp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad Call NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad If Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad If BoolOpAnd UnaryOpNot Call AttributeLoad NameLoad attr NameLoad UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad keyword Num Return Dict Str Str NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BoolOpOr AttributeLoad NameLoad attr TupleLoad Assign NameStore BinOpAdd NameLoad Call NameLoad GeneratorExp SubscriptLoad AttributeLoad NameLoad attr Index NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpAdd ListLoad AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareLt NameLoad Call NameLoad NameLoad body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore BinOpSub NameLoad Call NameLoad NameLoad If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad orelse TryExcept body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr body If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index Str NameLoad For NameStore NameLoad body If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore ListComp NameLoad comprehension NameStore NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad orelse Assign NameStore NameLoad Assign NameStore Call NameLoad Assign NameStore Num For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad keyword Num If CompareGt Call NameLoad NameLoad Num body Assign NameStore BinOpMod Str SubscriptLoad NameLoad Slice Num If CompareGt NameLoad Num body Assign NameStore BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListComp BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpMod Str TupleLoad BinOpMult Num Str NameLoad NameLoad NameLoad Return NameLoad decorator_list
N/A N/A 
My own variation on function-specific inspect-like features.
 itertools islice N/A inspect N/A warnings N/A re N/A os _compat _basestring logger pformat _memory_helpers open_py_source _compat PY3_OR_LATER get_func_code N/A N/A func N/A N/A N/A  Attempts to retrieve a reliable function code hash.

        The reason we don't use inspect.getsource is that it caches the
        source, whereas we want this to be modified on the fly when the
        function is modified.

        Returns
        -------
        func_code: string
            The function code
        source_file: string
            The path to the file in which the function is defined.
        first_line: int
            The first line of the code in the source file.

        Notes
        ------
        This function does a bit more magic than inspect, and is thus
        more robust.
     N/A source_file None N/A N/A N/A code N/A func __code__ N/A source_file N/A code co_filename N/A N/A N/A N/A N/A os path exists source_file N/A N/A source_code N/A N/A join N/A N/A N/A inspect getsourcelines func N/A 0 N/A line_no 1 N/A N/A N/A source_file startswith <doctest  N/A N/A N/A source_file line_no N/A N/A N/A N/A re match \<doctest (.*\.rst)\[(.*)\]\> source_file groups N/A line_no N/A int line_no N/A source_file N/A <doctest %s> source_file N/A N/A source_code source_file line_no N/A N/A open_py_source source_file source_file_obj N/A N/A first_line N/A code co_firstlineno N/A source_lines N/A list N/A islice source_file_obj N/A first_line 1 None N/A N/A N/A N/A join N/A N/A inspect getblock source_lines source_file first_line N/A N/A N/A N/A N/A hasattr func __code__ N/A N/A N/A N/A str N/A N/A N/A func __code__ __hash__ source_file -1 N/A N/A N/A N/A repr func source_file -1 N/A _clean_win_chars N/A N/A string N/A N/A N/A Windows cannot encode some characters in filename. N/A urllib N/A N/A hasattr urllib quote N/A N/A quote N/A urllib quote N/A N/A urllib.parse N/A quote N/A N/A urllib parse quote N/A char N/A < > ! : \ N/A N/A string N/A N/A string replace char N/A quote char N/A string N/A get_func_name N/A N/A func resolv_alias win_characters N/A True True N/A N/A  Return the function import path (as a list of module names), and
        a name for the function.

        Parameters
        ----------
        func: callable
            The func to inspect
        resolv_alias: boolean, optional
            If true, possible local aliases are indicated.
        win_characters: boolean, optional
            If true, substitute special characters using urllib.quote
            This is useful in Windows, as it cannot encode some filenames
     N/A N/A hasattr func __module__ N/A N/A module N/A func __module__ N/A N/A N/A N/A module N/A N/A inspect getmodule func N/A N/A N/A TypeError N/A N/A N/A hasattr func __class__ N/A N/A module N/A N/A func __class__ __module__ N/A N/A module unknown N/A N/A module None N/A N/A module N/A N/A module __main__ N/A N/A N/A N/A filename N/A N/A N/A os path abspath N/A N/A inspect getsourcefile func N/A N/A N/A N/A filename None N/A N/A filename None N/A N/A parts N/A N/A filename split N/A os sep N/A N/A N/A N/A parts N/A -1 startswith <ipython-input N/A N/A N/A parts N/A -1 __ipython-input__ N/A filename N/A N/A - join parts N/A N/A N/A filename endswith .py N/A N/A filename N/A filename N/A -3 N/A module N/A N/A module - filename N/A module N/A N/A module split . N/A N/A hasattr func func_name N/A N/A name N/A func func_name N/A N/A N/A hasattr func __name__ N/A N/A name N/A func __name__ N/A N/A name unknown N/A resolv_alias N/A N/A N/A N/A hasattr func func_globals N/A name N/A func func_globals N/A N/A N/A N/A N/A N/A func func_globals N/A name func N/A N/A name N/A %s-alias name N/A N/A N/A inspect ismethod func N/A N/A N/A hasattr func im_class N/A N/A klass N/A func im_class N/A N/A N/A module append N/A klass __name__ N/A N/A N/A N/A os name nt win_characters N/A N/A name N/A _clean_win_chars name N/A module N/A N/A _clean_win_chars s N/A s module N/A N/A module name N/A getfullargspec N/A N/A func N/A N/A N/A Compatibility function to provide inspect.getfullargspec in Python 2

    This should be rewritten using a backport of Python 3 signature
    once we drop support for Python 2.6. We went for a simpler
    approach at the time of writing because signature uses OrderedDict
    which is not available in Python 2.6.
     N/A N/A N/A N/A N/A inspect getfullargspec func N/A N/A N/A AttributeError N/A N/A arg_spec N/A N/A inspect getargspec func N/A collections N/A tuple_fields args varargs varkw defaults kwonlyargs kwonlydefaults annotations N/A tuple_type N/A N/A collections namedtuple FullArgSpec tuple_fields N/A N/A tuple_type args N/A arg_spec args varargs N/A arg_spec varargs varkw N/A arg_spec keywords defaults N/A arg_spec defaults kwonlyargs N/A kwonlydefaults None annotations N/A N/A _signature_str N/A N/A function_name arg_spec N/A N/A N/A Helper function to output a function signature N/A arg_spec_for_format N/A arg_spec N/A N/A PY3_OR_LATER 7 4 N/A arg_spec_str N/A N/A inspect formatargspec arg_spec_for_format N/A N/A N/A {0}{1} format function_name arg_spec_str N/A _function_called_str N/A N/A function_name args kwargs N/A N/A N/A Helper function to output a function call N/A template_str {0}({1}, {2}) N/A args_str N/A N/A repr args N/A 1 -1 N/A kwargs_str N/A N/A ,  join N/A N/A %s=%s N/A k v N/A N/A k v N/A N/A kwargs items N/A N/A N/A template_str format function_name args_str kwargs_str N/A filter_args N/A N/A func ignore_lst args kwargs N/A N/A N/A dict N/A N/A  Filters the given args and kwargs using a list of arguments to
        ignore, and a function specification.

        Parameters
        ----------
        func: callable
            Function giving the argument specification
        ignore_lst: list of strings
            List of arguments to ignore (either a name of an argument
            in the function spec, or '*', or '**')
        *args: list
            Positional arguments passed to the function.
        **kwargs: dict
            Keyword arguments passed to the function

        Returns
        -------
        filtered_args: list
            List of filtered positional and keyword arguments.
     N/A args N/A list args N/A N/A isinstance ignore_lst _basestring N/A N/A N/A ValueError N/A ignore_lst must be a list of parameters to ignore %s (type %s) was given N/A ignore_lst N/A type ignore_lst N/A N/A N/A N/A N/A inspect ismethod func N/A N/A N/A inspect isfunction func N/A N/A ignore_lst N/A N/A N/A N/A warnings warn N/A Cannot inspect object %s, ignore list will not work. func stacklevel 2 N/A N/A * ** args kwargs N/A arg_spec N/A getfullargspec func N/A arg_names N/A N/A arg_spec args N/A arg_spec kwonlyargs N/A arg_defaults N/A N/A arg_spec defaults N/A N/A arg_defaults N/A arg_defaults N/A tuple N/A N/A N/A arg_spec kwonlydefaults N/A k N/A k N/A arg_spec kwonlyargs N/A arg_varargs N/A arg_spec varargs N/A arg_varkw N/A arg_spec varkw N/A N/A N/A inspect ismethod func N/A N/A args N/A N/A N/A func __self__ args N/A N/A _ name N/A get_func_name func resolv_alias False N/A arg_dict N/A dict N/A arg_position -1 N/A N/A arg_position arg_name N/A enumerate arg_names N/A N/A N/A arg_position N/A len args N/A N/A N/A arg_name N/A arg_spec kwonlyargs N/A N/A N/A arg_dict N/A arg_name N/A args N/A arg_position N/A N/A N/A ValueError N/A Keyword-only parameter '%s' was passed as positional parameter for %s:
     %s was called. N/A arg_name N/A _signature_str name arg_spec N/A _function_called_str name args kwargs N/A N/A position N/A arg_position N/A len arg_names N/A N/A arg_name kwargs N/A N/A N/A arg_dict N/A arg_name N/A N/A kwargs pop arg_name N/A N/A N/A N/A N/A arg_dict N/A arg_name N/A arg_defaults N/A position N/A N/A N/A N/A IndexError KeyError N/A N/A N/A ValueError N/A Wrong number of arguments for %s:
     %s was called. N/A N/A _signature_str name arg_spec N/A _function_called_str name args kwargs N/A varkwargs N/A dict N/A N/A arg_name arg_value N/A sorted N/A N/A kwargs items N/A N/A N/A arg_name arg_dict N/A N/A N/A arg_dict N/A arg_name arg_value N/A N/A N/A arg_varkw None N/A N/A N/A varkwargs N/A arg_name arg_value N/A N/A N/A TypeError N/A Ignore list for %s() contains an unexpected keyword argument '%s' N/A name arg_name N/A N/A arg_varkw None N/A N/A N/A arg_dict N/A ** varkwargs N/A N/A arg_varargs None N/A N/A varargs N/A args N/A N/A arg_position 1 N/A N/A arg_dict N/A * varargs N/A item ignore_lst N/A N/A N/A item arg_dict N/A N/A N/A N/A arg_dict pop item N/A N/A N/A ValueError N/A Ignore list: argument '%s' is not defined for function %s N/A item N/A _signature_str name arg_spec N/A arg_dict N/A format_signature N/A N/A func N/A args kwargs N/A N/A N/A module name N/A get_func_name func N/A module N/A m N/A m module m N/A module N/A N/A N/A N/A module append name N/A module_path N/A N/A . join module N/A N/A module_path name N/A arg_str N/A list N/A previous_length 0 N/A arg args N/A N/A arg N/A pformat arg indent 2 N/A N/A N/A len arg 1500 N/A N/A arg N/A %s... N/A arg N/A 700 N/A N/A previous_length 80 N/A N/A arg N/A 
%s arg N/A previous_length N/A len arg N/A N/A N/A arg_str append arg N/A N/A N/A arg_str extend N/A N/A %s=%s N/A v N/A pformat i N/A N/A v i N/A N/A kwargs items N/A arg_str N/A N/A ,  join arg_str N/A signature N/A %s(%s) N/A name arg_str N/A N/A module_path signature N/A format_call N/A N/A func args kwargs object_name N/A Memory N/A N/A  Returns a nicely formatted statement displaying the function
        call with the given arguments.
     N/A N/A path signature N/A format_signature func args kwargs N/A msg N/A %s
[%s] Calling %s...
%s N/A N/A 80 _ object_name path signature N/A msg N/A