code: def get_module_names(module, all_scopes):
      """
      Returns a dictionary with name parts as keys and their call paths as
      values.
      """
      names = chain.from_iterable(module.get_used_names().values())
      if not all_scopes:
          # We have to filter all the names that don't have the module as a
          # parent_scope. There's None as a parent, because nodes in the module
          # node have the parent module and not suite as all the others.
          # Therefore it's important to catch that case.
          names = [
              n
              for n in names
              if get_parent_scope(n).parent in (module, None)
          ]
      return names
  
imports: import copy
  import sys
  import re
  import os
  from itertools import chain
  from contextlib import contextmanager
  from parso.python import tree
  from jedi._compatibility import unicode
  from jedi.parser_utils import get_parent_scope
label_desc: Use image node_id 6 for calling a global function with example usage: get_module_names(module, all_scopes) and returns: names