# Path: common/utils.py
# def read_file(filename):
# def write_file(filename, text):
# def save_obj(filename, data):
# def load_obj(filename):
# def sha1(filename):
# def write_sha1(sha1, filename):
# def url_opener():
# def copy_file_from_url(url, out_file, expect_sha1 = None, max_retry = 4):
# def compress_file_data(out_filename, data, compress_type):
# def compress_file(out_filename, in_filename, compress_type):
# def uncompress_file(filename, compress_type):
# def _retry_on_eintr(func, *args):
# def safe_read(fd):
# def safe_write(fd, text):
# def print_traceback(*kwargs):
# def readline_backward(filename, buf_size=8192):


import sys
import os
import subprocess
import resource
from common import utils
    'cs' : 'ces',
    'da' : 'dan',
    'de' : 'deu',
    'de-f':'deu-frak',
    'en' : 'eng',
    'eo' : 'epo',
    'es' : 'spa',
    'et' : 'est',
    'fr' : 'fra',
    'he' : 'heb',
    'hr' : 'hrv',
    'hu' : 'hun',
    'id' : 'ind',
    'is' : 'isl',
    'it' : 'ita',
    'la' : 'ita',
    'no' : 'nor',
    'pl' : 'pol',
    'pt' : 'por',
    'ru' : 'rus',
    'sv' : 'swe',
    'ta' : 'tam',
    }

tesseract_path = 'tesseract'

def setrlimits():
    mega = 1 << 20
    resource.setrlimit(resource.RLIMIT_AS, (1536*mega, 1536*mega))
    resource.setrlimit(resource.RLIMIT_CORE, (128*mega, 128*mega))

# Path: common/utils.py
# def read_file(filename):
# def write_file(filename, text):
# def save_obj(filename, data):
# def load_obj(filename):
# def sha1(filename):
# def write_sha1(sha1, filename):
# def url_opener():
# def copy_file_from_url(url, out_file, expect_sha1 = None, max_retry = 4):
# def compress_file_data(out_filename, data, compress_type):
# def compress_file(out_filename, in_filename, compress_type):
# def uncompress_file(filename, compress_type):
# def _retry_on_eintr(func, *args):
# def safe_read(fd):
# def safe_write(fd, text):
# def print_traceback(*kwargs):
# def readline_backward(filename, buf_size=8192):


# Path: ocr/ocr.py
import sys
import os
import subprocess
import resource
from common import utils

    'cs' : 'ces',
    'da' : 'dan',
    'de' : 'deu',
    'de-f':'deu-frak',
    'en' : 'eng',
    'eo' : 'epo',
    'es' : 'spa',
    'et' : 'est',
    'fr' : 'fra',
    'he' : 'heb',
    'hr' : 'hrv',
    'hu' : 'hun',
    'id' : 'ind',
    'is' : 'isl',
    'it' : 'ita',
    'la' : 'ita',
    'no' : 'nor',
    'pl' : 'pol',
    'pt' : 'por',
    'ru' : 'rus',
    'sv' : 'swe',
    'ta' : 'tam',
    }

tesseract_path = 'tesseract'

def setrlimits():
    mega = 1 << 20
    resource.setrlimit(resource.RLIMIT_AS, (1536*mega, 1536*mega))
    resource.setrlimit(resource.RLIMIT_CORE, (128*mega, 128*mega))

    resource.setrlimit(resource.RLIMIT_CPU, (60*60, 60*60))