Return the definitions of a the path under the cursor. goto function!
This follows complicated paths and returns the end, not the first
definition. The big difference between goto_assignments() and
goto_definitions() is that goto_assignments() doesn’t
follow imports and statements. Multiple objects may be returned,
because Python itself is a dynamic language, which means depending on
an option you can have two different versions of a function.

Return the first definition found. Imports and statements aren’t
followed. Multiple objects may be returned, because Python itself is a
dynamic language, which means depending on an option you can have two
different versions of a function.

Return classes.Definition objects, which contain all
names that point to the definition of the name under the cursor. This
is very useful for refactoring (renaming), or to show all usages of a
variable.

Returns a list of Definition objects, containing name parts.
This means you can call Definition.goto_assignments() and get the
reference of a name.
The parameters are the same as in Script, except or the
following ones:

Parameters:

all_scopes – If True lists the names of all scopes instead of only
the module namespace.

definitions – If True lists the names that have been defined by a
class, function or a statement (a=b returns a).

references – If True lists all the names that are not listed by
definitions=True. E.g. a=b returns b.