class_docstr: Wrap up custom function to be used as a predicate
  example: in_lambda(['labels_object_roles'], lambda labels_object_roles : len(labels_object_roles) > 3)
class_docstr_tok: ["Wrap","up","custom","function","to","be","used","as","a","predicate","example",":","in_lambda","(","[","'labels_object_roles","'","]",",","lambda","labels_object_roles",":","len","(","labels_object_roles",")",">","3",")"]
docstr: :param predicate_fields: list of fields to be used in predicate
  :param predicate_func: predicate function
         example: lambda labels_object_roles : len(labels_object_roles) > 3
  :param state_arg: additional object to keep function state. it will be passed to
         predicate_func after fields arguments ONLY if it is not None
docstr_tok: [":","param","predicate_fields",":","list","of","fields","to","be","used","in","predicate",":","param","predicate_func",":","predicate","function","example",":","lambda","labels_object_roles",":","len","(","labels_object_roles",")",">","3",":","param","state_arg",":","additional","object","to","keep","function","state",".","it","will","be","passed","to","predicate_func","after","fields","arguments","ONLY","if","it","is","not","None"]
code: def __init__(self, predicate_fields, predicate_func, state_arg=None):
      """
      :param predicate_fields: list of fields to be used in predicate
      :param predicate_func: predicate function
             example: lambda labels_object_roles : len(labels_object_roles) > 3
      :param state_arg: additional object to keep function state. it will be passed to
             predicate_func after fields arguments ONLY if it is not None
      """
      if not isinstance(predicate_fields, list):
          raise ValueError("Predicate fields should be a list")
      self._predicate_fields = predicate_fields
      self._predicate_func = predicate_func
      self._state_arg = state_arg
  
imports: import abc
  import collections.abc
  import hashlib
  import numpy
  import six
  import sys
label_desc: Use image node_id 1 to create a new in_lambda object from inherited base classes: PredicateBase with example: obj = in_lambda(predicate_fields, predicate_func, state_arg)