code: def validate_context(func):
      """Validate context in the preprocessor."""
  
      @functools.wraps(func)
      def transform_wrapper(self, *args, **kwargs):
          if not self.context:
              raise ValueError(
                  "Please call `fit` before calling `transform`."
              )
          return func(self, *args, **kwargs)
  
      return transform_wrapper
  
file_path: MatchZoo/matchzoo/engine/base_preprocessor.py
imports: import abc
  import functools
  import typing
  from pathlib import Path
  import dill
  import matchzoo
label_desc: Use image node_id 1 for calling a global function with example usage: validate_context(func) and returns: transform_wrapper, func