code: def gen_matches(self, word):
          
  
          if word.startswith("$"):
              for match in self.gen_variable_completions(word, os.environ):
                  yield match
          else:
              head, tail = os.path.split(word)
              filenames = os.listdir(head or '.')
              completions = self.gen_filename_completions(tail, filenames)
              for match in completions:
                  yield os.path.join(head, match)
          for extension in self.extensions:
              for match in extension(word):
                  yield match
docs: Generate a sequence of possible completions for ``word``.
  
          :param word: the word to complete