class_docstr: A predicate that only filters files
docstr: The FilePredicate filter function
  
  The arg slot expects a tuple of node_type and modpath.
  The predicate returns None (= agnostic about filtering) if
  the node is not a directory, otherwise it composites the
  modpath into a file path and applies it to the rest of
  the args
docstr_tok: ["The","FilePredicate","filter","function","The","arg","slot","expects","a","tuple","of","node_type","and","modpath",".","The","predicate","returns","None","(","=","agnostic","about","filtering",")","if","the","node","is","not","a","directory",",","otherwise","it","composites","the","modpath","into","a","file","path","and","applies","it","to","the","rest","of","the","args"]
code: def fn_filter(node_type__modpath__module, *args):
      """The FilePredicate filter function
  
      The arg slot expects a tuple of node_type and modpath.
      The predicate returns None (= agnostic about filtering) if
      the node is not a directory, otherwise it composites the
      modpath into a file path and applies it to the rest of
      the args
      """
      (node_type, modpath, module) = node_type__modpath__module
      if (
          node_type
          == cellprofiler_core.setting.FileCollectionDisplay.NODE_DIRECTORY
      ):
          return None
      elif isinstance(modpath[-1], tuple) and len(modpath[-1]) == 3:
          filename = modpath[-2]
      else:
          filename = modpath[-1]
      return args[0](filename, *args[1:])
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/setting/filter/_file_predicate.py
imports: import cellprofiler_core.setting
  from ._does_not_predicate import DoesNotPredicate
  from ._does_predicate import DoesPredicate
  from ._filter import CONTAINS_PREDICATE
  from ._filter import CONTAINS_REGEXP_PREDICATE
  from ._filter import ENDSWITH_PREDICATE
  from ._filter import EQ_PREDICATE
  from ._filter import STARTS_WITH_PREDICATE
  from ._filter_predicate import FilterPredicate
label_desc: Use image node_id 2 for calling the FilePredicate obj's underlying member method code with example usage: obj.fn_filter(node_type__modpath__module) and returns: args, None