code: def complete_from_dir(directory):
      '''
      This is necessary so that we get the imports from the same directory where the file
      we are completing is located.
      '''
      global currDirModule
      if currDirModule is not None:
          if len(sys.path) > 0 and sys.path[0] == currDirModule:
              del sys.path[0]
  
      currDirModule = directory
      sys.path.insert(0, directoryf complete_from_dir(directory):
      '''
      This is necessary so that we get the imports from the same directory where the file
      we are completing is located.
      '''
      global currDirModule
      if currDirModule is not None:
          if len(sys.path) > 0 and sys.path[0] == currDirModule:
              del sys.path[0]
  
      currDirModule = directory
      sys.path.insert(0, directory)
docs: This is necessary so that we get the imports from the same directory where the file
      we are completing is located.