Api standardization, feature importance folder

This commit is contained in:
Madison May
2014-10-17 12:16:35 -04:00
parent dfce9ede9f
commit c4fd8ea30d
15 changed files with 59 additions and 58 deletions
+12 -1
View File
@@ -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
-2
View File
@@ -1,2 +0,0 @@
local_api_root = "http://localhost:9438/"
api_root = "http://api.indico.io/"