mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-07-19 11:19:54 +08:00
Api standardization, feature importance folder
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
import inspect
|
||||
import inspect, json, requests
|
||||
import numpy as np
|
||||
from skimage.transform import resize
|
||||
|
||||
from indicoio import JSON_HEADERS
|
||||
|
||||
def api_handler(arg, url):
|
||||
data_dict = json.dumps({'data': arg})
|
||||
response = requests.post(url, data=data_dict, headers=JSON_HEADERS).json()
|
||||
results = response.get('results', False)
|
||||
if not results:
|
||||
error = response.get('error')
|
||||
raise ValueError(error)
|
||||
return results
|
||||
|
||||
class TypeCheck(object):
|
||||
"""
|
||||
Decorator that performs a typecheck on the input to a function
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
local_api_root = "http://localhost:9438/"
|
||||
api_root = "http://api.indico.io/"
|
||||
Reference in New Issue
Block a user