code: def is_excluded(root, excludes):
      
      sep = os.path.sep
      if not root.endswith(sep):
          root += sep
      for exclude in excludes:
          if root.startswith(exclude):
              return True
      return False
docs: Check if the directory is in the exclude list.
  
      Note: by having trailing slashes, we avoid common prefix issues, like
            e.g. an exlude "foo" also accidentally excluding "foobar".