code: def completelist(self, text):
          
          path = os.path.expanduser(text)
          if len(path) == 0 or path[0] != os.path.sep:
              path = os.path.join(os.getcwd(), path)
          if text == '~':
              dpath = dtext = ''
              bpath = '~'
              files = ['~/']
          elif text.startswith('~') and text.find('/', 1) < 0:
              return self.matchuserhome(text)
          else:
              dtext = os.path.dirname(text)
              dpath = os.path.dirname(path)
              bpath = os.path.basename(path)
              files = os.listdir(dpath)
          if bpath =='':
              matches = [self.buildpath(text, f) for f in files if not f.startswith('.')]
          else:
              matches = [self.buildpath(dtext, f) for f in files if f.startswith(bpath)]
          if len(matches) == 0 and os.path.basename(path)=='..':
              files = os.listdir(path)
              matches = [os.path.join(text, f) for f in files]
          return matches
docs: Return a list of potential matches for completion
          
          n.b. you want to complete to a file in the current working directory
          that starts with a ~, use ./~ when typing in. Paths that start with
          ~ are magical and specify users' home paths