'Return the first definition found, while optionally following imports.
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_assignments(self, follow_imports=False):

    def filter_follow_imports(names):
        for name in names:
            if isinstance(name, (imports.ImportName, TreeNameDefinition)):
                for context in name.infer():
                    (yield context.name)
            else:
                (yield name)
    names = self._goto()
    if follow_imports:
        names = filter_follow_imports(names)
    defs = [classes.Definition(self._evaluator, d) for d in set(names)]
    return helpers.sorted_definitions(defs)
