class_docstr: A ZipFile subclass that ensures that implied directories
  are always included in the namelist.
docstr: Given a source (filename or zipfile), return an
  appropriate CompleteDirs subclass.
docstr_tok: ["Given","a","source","(","filename","or","zipfile",")",",","return","an","appropriate","CompleteDirs","subclass","."]
code: def make(cls, source):
      """
      Given a source (filename or zipfile), return an
      appropriate CompleteDirs subclass.
      """
      if isinstance(source, CompleteDirs):
          return source
  
      if not isinstance(source, zipfile.ZipFile):
          return cls(_pathlib_compat(source))
  
      # Only allow for FastLookup when supplied zipfile is read-only
      if "r" not in source.mode:
          cls = CompleteDirs
  
      source.__class__ = cls
      return source
  
imports: import io
  import posixpath
  import zipfile
  import itertools
  import contextlib
  import sys
  import pathlib
label_desc: Use image node_id 5 for calling the CompleteDirs obj's underlying member method code with example usage: obj.make(cls, source) and returns: source, source, cls