<commit_before>$(document).ready(function() {

    var iataCodes = [];

    var $originLocation = $('#originLocation');
    var $destinationLocation = $('#destinationLocation');
    var $departureDate = $('#departureDate');
    var $passengerType = $('#passengerType');
    var $passengerQuantity = $('#passengerQuantity');
    var $doAirFareRQ = $('#doAirFareRQ');

    var $originLocationGroup = $('#originLocationGroup');
    var $destinationLocationGroup = $('#destinationLocationGroup');
    var $departureDateGroup = $('#departureDateGroup');
    var $passengerQuantityGroup = $('#passengerQuantityGroup');

    var requestId;

    $.getJSON('/iata.json', function(data) {
        $.each(data, function (key, value) {
            iataCodes.push({label: value.name, value: value.iata});
        });
    });

    $.getJSON('/passenger_types.json', function (data) {
        $.each(data, function (key, value) {
            var $option = $(document.createElement('option'));
            $option.val(key);
            $option.text(value);

            $passengerType.append($option);
        });
    });

    $departureDate.datepicker({dateFormat: 'dd/mm/yy'});

    $originLocation.autocomplete({
        source: iataCodes,
        delay: 300,
        minLength: 2
    });
    $destinationLocation.autocomplete({
        source: iataCodes,
        delay: 300,
        minLength: 2
    });

    var timerId;

    function getSearchResult() {
        $.getJSON('get_request_result/' + requestId, function (data) {
            if (data.Success !== undefined && data.Success.Code === 0) {
                clearInterval(timerId);
                enableSearchButton();
                window.location.href = 'output_result/' + requestId;
            }
        });
    }

    function blockSearchButton() {
        $doAirFareRQ.text('Searching...');
        $doAirFareRQ.prop('disabled', true);
    }

    function enableSearchButton() {
        $doAirFareRQ.text('Search');
        $doAirFareRQ.attr('disabled', false);
    }

    function validate() {
        if ($originLocation.val() === '') {
            $originLocationGroup.addClass('has-error');
            $originLocation.focus();
            return false;
        }

        if ($destinationLocation.val() === '') {
            $destinationLocationGroup.addClass('has-error');
            $destinationLocation.focus();
            return false;
        }
<commit_msg>[task] Сделал защиту от двойного постинга<commit_after>$(document).ready(function() {

    var iataCodes = [];

    var $originLocation = $('#originLocation');
    var $destinationLocation = $('#destinationLocation');
    var $departureDate = $('#departureDate');
    var $passengerType = $('#passengerType');
    var $passengerQuantity = $('#passengerQuantity');
    var $doAirFareRQ = $('#doAirFareRQ');

    var $originLocationGroup = $('#originLocationGroup');
    var $destinationLocationGroup = $('#destinationLocationGroup');
    var $departureDateGroup = $('#departureDateGroup');
    var $passengerQuantityGroup = $('#passengerQuantityGroup');

    var requestId;

    $.getJSON('/iata.json', function(data) {
        $.each(data, function (key, value) {
            iataCodes.push({label: value.name, value: value.iata});
        });
    });

    $.getJSON('/passenger_types.json', function (data) {
        $.each(data, function (key, value) {
            var $option = $(document.createElement('option'));
            $option.val(key);
            $option.text(value);

            $passengerType.append($option);
        });
    });

    $departureDate.datepicker({dateFormat: 'dd/mm/yy'});

    $originLocation.autocomplete({
        source: iataCodes,
        delay: 300,
        minLength: 2
    });
    $destinationLocation.autocomplete({
        source: iataCodes,
        delay: 300,
        minLength: 2
    });

    var timerId;

    function getSearchResult() {
        $.getJSON('get_request_result/' + requestId, function (data) {
            if (data.Success !== undefined && data.Success.Code === 0) {
                clearInterval(timerId);
                enableSearchButton();
                window.location.href = 'output_result/' + requestId;
            }
        });
    }

    function blockSearchButton() {
        $doAirFareRQ.text('Searching...');
        $doAirFareRQ.prop('disabled', true);
    }

    function enableSearchButton() {
        $doAirFareRQ.text('Search');
        $doAirFareRQ.prop('disabled', false);
    }

    function validate() {

        if ($doAirFareRQ.attr('disabled')) {
            return false;
        }

        if ($originLocation.val() === '') {
            $originLocationGroup.addClass('has-error');
            $originLocation.focus();
            return false;
        }

        if ($destinationLocation.val() === '') {
            $destinationLocationGroup.addClass('has-error');
            $destinationLocation.focus();
            return false;
        }

{'fraction_non_alphanumeric': 0.1542649727767695, 'fraction_numerical': 0.003629764065335753, 'mean_word_length': 2.4183321847002066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5099878', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1355, 'n_words': 241}