This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A wrapper to execute Hyperopt cost functions safely on a separate process, with timeout | |
This code is based off parts of https://github.com/hyperopt/hyperopt-sklearn, | |
which falls under the following license: | |
======= | |
Copyright (c) 2013, James Bergstra | |
All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class array_like(object): | |
def __init__(self, *args): | |
self.arguments = args # the arguments to run `asarray` on | |
def __call__(self, wrapped): | |
import inspect | |
# check that self.arguments are valid | |
argspec = inspect.getargspec(wrapped) |