<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
# provides functions for selecting a sample of training data

from __future__ import annotations

import itertools
import logging
import collections
import functools
import random
from abc import ABC
import math

from typing import Sequence, Iterable, Dict, FrozenSet

from . import blocking
from .predicates import Predicate
from ._typing import Data, RecordID

logger = logging.getLogger(__name__)

Cover = Dict[Predicate, FrozenSet[int]]
ComparisonCover = Dict[Predicate, FrozenSet[tuple[RecordID, RecordID]]]


class BlockLearner(ABC):
    def learn(self, matches, recall, candidate_types="simple"):<commit_msg>frozenset -> FrozenSet<commit_after>from __future__ import annotations

import itertools
import logging
import collections
import functools
import random
from abc import ABC
import math

from typing import Sequence, Iterable, Dict, FrozenSet

from . import blocking
from .predicates import Predicate
from ._typing import Data, RecordID

logger = logging.getLogger(__name__)

Cover = Dict[Predicate, FrozenSet[int]]
ComparisonCover = Dict[Predicate, FrozenSet[tuple[RecordID, RecordID]]]


class BlockLearner(ABC):
    def learn(self, matches, recall, candidate_types="simple"):
{'fraction_non_alphanumeric': 0.07926341072858287, 'fraction_numerical': 0.0008006405124099279, 'mean_word_length': 6.142857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1156348', 'n_tokens_mistral': 368, 'n_tokens_neox': 357, 'n_words': 122}