def __call__(self, record) :
        block_key = None
        column = record[self.field]

        if column :

            doc = self.preprocess(column)

            try :
                doc_id = self.index._doc_to_id[doc]
            except __HOLE__ :
                raise AttributeError("Attempting to block with an index "
                                     "predicate without indexing records")

            if doc_id in self.canopy :
                block_key = self.canopy[doc_id]
            else :
                canopy_members = self.index.search(doc,
                                                   self.threshold)
                for member in canopy_members :
                    if member not in self.canopy :
                        self.canopy[member] = doc_id

                if canopy_members :
                    block_key = doc_id
                    self.canopy[doc_id] = doc_id
                else:
                    self.canopy[doc_id] = None


        if block_key is None :
            return []
        else :
            return [str(block_key)]
dataset/ETHPy150Open datamade/dedupe/dedupe/predicates.py/TfidfCanopyPredicate.__call__