<commit_before>#!/bin/bash

git diff-index --quiet --cached HEAD || git diff-files --quiet || { echo "Please, commit your changes or stash them before updating canvas."; echo "Aborting"; exit 1; }

if [ ! -f tip.tar.gz ]; then
  wget https://bitbucket.org/biolab/orange/get/tip.tar.gzi
fi
rm -rf biolab-orange-*
tar -xzf tip.tar.gz
mv biolab-orange-*/Orange/OrangeCanvas canvas
rm canvas/orng*
mv canvas/main.py canvas/__main__.py
2to3 -n -W --no-diffs canvas
echo biolab-orange-* | awk -F"-" '{print $3}' > canvas/source-revision.txt
rev=`cat canvas/source-revision.txt`
rm -rf ../Orange/canvas
mv canvas ../Orange/
rm -rf biolab-orange-*
git checkout -b merge-canvas-$rev || exit 1
git add ../Orange/canvas
git commit -am "Updated canvas to $rev"

echo "Please apply the following patches:"
echo
echo cd ../Orange 
for p in ../scripts/patches/*; do
    echo patch -p2 \< $p
done<commit_msg>Fixed a type in update_canvas script.<commit_after>#!/bin/bash

git diff-index --quiet --cached HEAD || git diff-files --quiet || { echo "Please, commit your changes or stash them before updating canvas."; echo "Aborting"; exit 1; }

if [ ! -f tip.tar.gz ]; then
  wget https://bitbucket.org/biolab/orange/get/tip.tar.gz
fi
rm -rf biolab-orange-*
tar -xzf tip.tar.gz
mv biolab-orange-*/Orange/OrangeCanvas canvas
rm canvas/orng*
mv canvas/main.py canvas/__main__.py
2to3 -n -W --no-diffs canvas
echo biolab-orange-* | awk -F"-" '{print $3}' > canvas/source-revision.txt
rev=`cat canvas/source-revision.txt`
rm -rf ../Orange/canvas
mv canvas ../Orange/
rm -rf biolab-orange-*
git checkout -b merge-canvas-$rev || exit 1
git add ../Orange/canvas
git commit -am "Updated canvas to $rev"

echo "Please apply the following patches:"
echo
echo cd ../Orange 
for p in ../scripts/patches/*; do
    echo patch -p2 \< $p
done
{'fraction_non_alphanumeric': 0.15218594355285003, 'fraction_numerical': 0.006640841173215274, 'mean_word_length': 3.294536817102138, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2610037', 'n_tokens_mistral': 681, 'n_tokens_neox': 628, 'n_words': 212}