'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 :meth:`goto_assignments` and
:meth:`goto_definitions` is that :meth:`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.
:rtype: list of :class:`classes.Definition`'

def goto_definitions(self):

    module_node = self._get_module_node()
    leaf = module_node.get_name_of_position(self._pos)
    if (leaf is None):
        leaf = module_node.get_leaf_for_position(self._pos)
        if (leaf is None):
            return []
    context = self._evaluator.create_context(self._get_module(), leaf)
    definitions = helpers.evaluate_goto_definition(self._evaluator, context, leaf)
    names = [s.name for s in definitions]
    defs = [classes.Definition(self._evaluator, name) for name in names]
    return helpers.sorted_definitions(set(defs))
