code: def _create_file_filter(filter_, default_value=True):
      matches = (
          (lambda _: default_value)
          if filter_ is None
          else filter_
          if callable(filter_)
          else (lambda p: fnmatch.fnmatch(p, filter_))
          if isinstance(filter_, str)
          else (
              lambda p: any(fnmatch.fnmatch(p, pat) for pat in filter_)
          )
          if isinstance(filter_, (list, tuple))
          else None
      )
      if matches is None:
          raise ValueError(
              "filter should be None, a predicate function, a wildcard pattern or a list of those."
          )
      return matches
  
file_path: h2o-3/h2o-py/tests/_utils.py
imports: import fnmatch
  import importlib
  import os
  import re
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: _create_file_filter(filter_, default_value) and returns: matches