code: def one_of(*args):
      def validate(name, value):
          if value not in args:
              raise ValueError(
                  "%s directive must be one of %s, got '%s'"
                  % (name, args, value)
              )
          else:
              return value
  
      return validate
  
file_path: catboost/contrib/tools/cython/Cython/Compiler/Options.py
imports: from __future__ import absolute_import
label_desc: Use image node_id 2 for calling a global function with example usage: one_of() and returns: validate, value