code: def gen_filter(filter_type, value=None):
      """ "Generate patch filtering function for testing"""
      if filter_type.lower() == "high":
  
          def my_filter(patch, location):
              if torch.any(patch > value):
                  return True
              return False
  
      elif filter_type.lower() == "low":
  
          def my_filter(patch, location):
              if torch.any(patch < value):
                  return True
              return False
  
      elif filter_type.lower() == "location":
  
          def my_filter(patch, location):
              if location in value:
                  return True
              return False
  
      return my_filter
  
file_path: MONAI/tests/test_sliding_window_splitter.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from torch.nn.functional import pad
  from monai.inferers import SlidingWindowSplitter
  from tests.utils import assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: gen_filter(filter_type, value) and returns: my_filter, False, True, False, True, False, True