def __init__(self, candidate_class, cspaces, matchers, self_relations, nested_relations, symmetric_relations, **kwargs):
    self.candidate_class = candidate_class
    self.candidate_spaces = (cspaces if isinstance(cspaces, (list, tuple)) else [cspaces])
    self.matchers = (matchers if isinstance(matchers, (list, tuple)) else [matchers])
    self.nested_relations = nested_relations
    self.self_relations = self_relations
    self.symmetric_relations = symmetric_relations
    if (len(self.candidate_spaces) != len(self.matchers)):
        raise ValueError('Mismatched arity of candidate space and matcher.')
    else:
        self.arity = len(self.candidate_spaces)
    self.candidate_spaces = list(map(deepcopy, self.candidate_spaces))
    self.child_context_sets = ([None] * self.arity)
    for i in range(self.arity):
        self.child_context_sets[i] = set()
    super(CandidateExtractorUDF, self).__init__(**kwargs)
def __init__(self, candidate_class, cspaces, matchers, self_relations, nested_relations, symmetric_relations, **kwargs):
    self.candidate_class = candidate_class
    self.candidate_spaces = (cspaces if isinstance(cspaces, (list, tuple)) else [cspaces])
    self.matchers = (matchers if isinstance(matchers, (list, tuple)) else [matchers])
    self.nested_relations = nested_relations
    self.self_relations = self_relations
    self.symmetric_relations = symmetric_relations
    if (len(self.candidate_spaces) != len(self.matchers)):
        raise ValueError('Mismatched arity of candidate space and matcher.')
    else:
        self.arity = len(self.candidate_spaces)
    self.candidate_spaces = list(map(deepcopy, self.candidate_spaces))
    self.child_context_sets = ([None] * self.arity)
    for i in range(self.arity):
        self.child_context_sets[i] = set()
    super(CandidateExtractorUDF, self).__init__(**kwargs)