code: def prune_dirs(self, src_root, relroot, dirs):
      pruned = []
      for name in sorted(dirs):
          last_rule_result = None
          relpath = os.path.join(relroot, name)
          for rule in self.rules:
              if rule.type != "dir":
                  continue
              rule_result, _test = rule.test(src_root, relpath)
              if rule_result is not None:
                  last_rule_result = rule_result
          if last_rule_result is False:
              log.debug("skipping directory %s", relpath)
              pruned.append(name)
              dirs.remove(name)
      return pruned
  
imports: import fnmatch
  import glob
  import logging
  import os
  import re
  import shutil
  from guild import util
label_desc: Use image node_id 5 for calling the FileSelect obj's underlying member method code with example usage: obj.prune_dirs(src_root, relroot, dirs) and returns: pruned