<commit_before>#!/bin/bash

PYTHON="/usr/bin/python3"
DEPENDANCIES="webcam python3-pip"

for pkg in ${DEPENDANCIES}; do
  dpkg -l ${pkg} > /dev/null 2>&1
  if [ $? -ne 0 ]; then
    sudo apt-get install ${pkg}
  fi
done

${PYTHON} -c "import PIL"
if [ $? -ne 0 ]; then
  python_ver=`${PYTHON} -V 2>&1 | cut -d" " -f2 | cut -d"." -f1,2`
  sudo pip-${python_ver} install Pillow
fi

HRHOME=`dirname $0`

sudo ${PYTHON} ${HRHOME}/app/home-recorder.py
#> ${HRHOME}/log.log 2>&1<commit_msg>Fix Pillow installation for jpeg support<commit_after>#!/bin/bash

PYTHON="/usr/bin/python3"
DEPENDANCIES="webcam python3-pip libjpeg8-dev"

for pkg in ${DEPENDANCIES}; do
  dpkg -l ${pkg} > /dev/null 2>&1
  if [ $? -ne 0 ]; then
    sudo apt-get install ${pkg}
  fi
done

if [ ! -f /usr/lib/lbjpeg.so ]; then
  sudo ln -s /usr/lib/arm-linux-gnueabihf/libjpeg.so /usr/lib/
fi

${PYTHON} -c "import PIL"
if [ $? -ne 0 ]; then
  python_ver=`${PYTHON} -V 2>&1 | cut -d" " -f2 | cut -d"." -f1,2`
  sudo pip-${python_ver} install Pillow
fi

HRHOME=`dirname $0`

sudo ${PYTHON} ${HRHOME}/app/home-recorder.py > ${HRHOME}/log.log 2>&1 & disown
{'fraction_non_alphanumeric': 0.19732142857142856, 'fraction_numerical': 0.025892857142857145, 'mean_word_length': 3.3449612403100777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '387787', 'n_tokens_mistral': 528, 'n_tokens_neox': 489, 'n_words': 122}