code: def filter(cls, pythons):
      
      good = []
  
      MAJOR, MINOR, SUBMINOR = range(3)
      def version_filter(version):
        return (version[MAJOR] == 2 and version[MINOR] >= 7 or
                version[MAJOR] == 3 and version[MINOR] >= 4)
  
      all_versions = set(interpreter.identity.version for interpreter in pythons)
      good_versions = filter(version_filter, all_versions)
  
      for version in good_versions:
        # For each candidate, use the latest version we find on the filesystem.
        candidates = defaultdict(list)
        for interp in pythons:
          if interp.identity.version == version:
            candidates[interp.identity.interpreter].append(interp)
        for interp_class in candidates:
          candidates[interp_class].sort(
              key=lambda interp: os.path.getmtime(interp.binary), reverse=True)
          good.append(candidates[interp_class].pop(0))
  
      return good
docs: Given a map of python interpreters in the format provided by PythonInterpreter.find(),
        filter out duplicate versions and versions we would prefer not to use.
  
        Returns a map in the same format as find.