class_docstr: A predicate that operates on file extensions
class_docstr_tok: ["A","predicate","that","operates","on","file","extensions"]
docstr: The ExtensionPredicate filter function
  
  If the element is a file, try the different predicates on
  all possible extension parsings.
docstr_tok: ["The","ExtensionPredicate","filter","function","If","the","element","is","a","file",",","try","the","different","predicates","on","all","possible","extension","parsings","."]
code: def fn_filter(node_type__modpath__module, *args):
      """The ExtensionPredicate filter function
  
      If the element is a file, try the different predicates on
      all possible extension parsings.
      """
      (node_type, modpath, module) = node_type__modpath__module
      if node_type == FileCollectionDisplay.NODE_DIRECTORY:
          return None
      elif isinstance(modpath[-1], tuple) and len(modpath[-1]) == 3:
          filename = modpath[-2]
      else:
          filename = modpath[-1]
      exts = ""
      while True:
          filename, ext = os.path.splitext(filename)
          if len(filename) == 0 or len(ext) == 0:
              return False
          exts = ext + exts
          if args[0](exts, *args[1:]):
              return True
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/setting/filter/_extension_predicate.py
imports: import os
  from ._does_not_predicate import DoesNotPredicate
  from ._does_predicate import DoesPredicate
  from ._filter_predicate import FilterPredicate
  from .._file_collection_display import FileCollectionDisplay
  from ...utilities.image import is_image_extension
label_desc: Use image node_id 2 for calling the ExtensionPredicate obj's underlying member method code with example usage: obj.fn_filter(node_type__modpath__module) and returns: None, False, True