code: def _archive_cls(file, ext=''):
          
          cls = None
          filename = None
          if is_string(file):
              filename = file
          else:
              try:
                  filename = file.name
              except AttributeError:
                  raise UnrecognizedArchiveFormat(
                      "File object not a recognized archive format.")
          lookup_filename = filename + ext
          base, tail_ext = os.path.splitext(lookup_filename.lower())
          cls = extension_map.get(tail_ext)
          if not cls:
              base, ext = os.path.splitext(base)
              cls = extension_map.get(ext)
          if not cls:
              raise UnrecognizedArchiveFormat(
                  "Path not a recognized archive format: %s" % filename)
          return cls
docs: Return the proper Archive implementation class, based on the file type.