<commit_before>contract WorkAgreement {
    address client;
    address worker;
    mapping (address => bool) testers;
    uint price;
    uint end;

    function WorkAgreement(address _client, address _worker, uint _price,
                           uint length) {
        client = _client;
        worker = _worker;
        price = _price;
        end = length;
    }

    function addTester(address tester) {
        testers[tester] = true;
    }
}

contract WorkerDispatcher {
    struct Worker {
        string32 name;
        uint maxLength;
        uint price;
    }
    mapping (address => Worker) public workersInfo;
    uint numWorkers;
    mapping (uint => address) workerList;

    function buyContract(address worker, uint redundancy, uint price,
                         uint lenght) returns (address addr) {
        if (msg.value < lenght * price) return;
        if (workersInfo[worker].name == "") return;
        WorkAgreement wa = new WorkAgreement(msg.sender, worker,
                                             price, lenght);
        // TODO - create better way to asign testers
        for (uint i = 1; i < 3; i++) {
            uint n = uint(block.blockhash(block.number - i)) % numWorkers;
            if (workerList[n] == worker) continue;<commit_msg>Contract creation now checks length.<commit_after>contract WorkAgreement {
    address client;
    address worker;
    mapping (address => bool) testers;
    uint price;
    uint end;

    function WorkAgreement(address _client, address _worker, uint _price,
                           uint length) {
        client = _client;
        worker = _worker;
        price = _price;
        end = length;
    }

    function addTester(address tester) {
        testers[tester] = true;
    }
}

contract WorkerDispatcher {
    struct Worker {
        string32 name;
        uint maxLength;
        uint price;
    }
    mapping (address => Worker) public workersInfo;
    uint numWorkers;
    mapping (uint => address) workerList;

    function buyContract(address worker, uint redundancy, uint price,
                         uint length) returns (address addr) {
        if (msg.value < length * price &&
            workersInfo[worker].name == "" &&
            workersInfo[worker].maxLength < length) return;
        WorkAgreement wa = new WorkAgreement(msg.sender, worker,
                                             price, length);
        // TODO - create better way to asign testers
        for (uint i = 1; i < 3; i++) {
            uint n = uint(block.blockhash(block.number - i)) % numWorkers;
            if (workerList[n] == worker) continue;
{'fraction_non_alphanumeric': 0.08983631518842787, 'fraction_numerical': 0.0030452988199467074, 'mean_word_length': 1.9265033407572383, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '752064', 'n_tokens_mistral': 724, 'n_tokens_neox': 683, 'n_words': 217}