def setup_log(): logging.basicConfig( level=logging.DEBUG, format= '[%(asctime)s] [%(process)s/%(threadName)s] [%(levelname)s] [%(name)s] %(message)s' ) debugging.install_handler()
# encoding: utf-8 """ Single-thread hoster for a custom-code based predictor """ import inspect import sys import json import time import traceback import logging from dataiku.core import debugging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') debugging.install_handler() from dataiku.base.utils import watch_stdin, get_json_friendly_error from dataiku.base.java_link import JavaLink import os, os.path as osp import inspect import pandas as pd import numpy as np class LoadedFunction(object): def __init__(self, code_file, function_name, data_folders=[]): self.code_file = code_file with open(code_file, 'r') as f: code = f.read()