code: def declaration_path(decl):
      
  
      if not decl:
          return []
      if not decl.cache.declaration_path:
          result = [decl.name]
          parent = decl.parent
          while parent:
              if parent.cache.declaration_path:
                  result.reverse()
                  decl.cache.declaration_path = parent.cache.declaration_path + \
                      result
                  return decl.cache.declaration_path
              else:
                  result.append(parent.name)
                  parent = parent.parent
          result.reverse()
          decl.cache.declaration_path = result
          return result
  
      return decl.cache.declaration_path
docs: Returns a list of parent declarations names.
  
      Args:
          decl (declaration_t): declaration for which declaration path
                                should be calculated.
  
      Returns:
          list[(str | basestring)]: list of names, where first item is the top
                                    parent name and last item the inputted
                                    declaration name.