Skip to content

Instantly share code, notes, and snippets.

View adrinjalali's full-sized avatar

Adrin Jalali adrinjalali

View GitHub Profile
#%%
# coding: utf-8
"""
@file
@brief Wraps runtime into a :epkg:`scikit-learn` transformer.
"""
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from skl2onnx.algebra.onnx_operator_mixin import OnnxOperatorMixin
@adrinjalali
adrinjalali / run_script.py
Last active January 5, 2019 19:23
Run a python script and get the output as if it was run in the python interpreter.
# run as: python run_script.py < your_script.py
import code
import sys
icon = code.InteractiveConsole()
prompt = '>>>'
for line in sys.stdin:
line = line.rstrip()
print(prompt, line)