args_dict["M_c"] = M_c args_dict["X_L"] = X_L_prime args_dict["X_D"] = X_D_prime args_dict["Y"] = None args_dict["Q"] = [(0, 0)] args_dict["n"] = 10 out, id = au.call(method_name, args_dict, URI) time.sleep(1) method_name = "impute_and_confidence" args_dict = dict() args_dict["M_c"] = M_c args_dict["X_L"] = X_L_prime args_dict["X_D"] = X_D_prime args_dict["Y"] = None args_dict["Q"] = [(0, 0)] args_dict["n"] = 10 out, id = au.call(method_name, args_dict, URI) time.sleep(1) # programmatically call all the other method calls method_name_to_args = gu.get_method_name_to_args(LE.LocalEngine) for method_name, arg_str_list in six.iteritems(method_name_to_args): if method_name in non_stub: print("skipping non-stub method:", method_name) print() continue args_dict = dict(zip(arg_str_list, arg_str_list)) au.call_and_print(method_name, args_dict, URI) time.sleep(1)
args_dict['M_c'] = M_c args_dict['X_L'] = X_L_prime args_dict['X_D'] = X_D_prime args_dict['Y'] = None args_dict['Q'] = [(0, 0)] args_dict['n'] = 10 out, id = au.call(method_name, args_dict, URI) time.sleep(1) method_name = 'impute_and_confidence' args_dict = dict() args_dict['M_c'] = M_c args_dict['X_L'] = X_L_prime args_dict['X_D'] = X_D_prime args_dict['Y'] = None args_dict['Q'] = [(0, 0)] args_dict['n'] = 10 out, id = au.call(method_name, args_dict, URI) time.sleep(1) # programmatically call all the other method calls method_name_to_args = gu.get_method_name_to_args(LE.LocalEngine) for method_name, arg_str_list in method_name_to_args.iteritems(): if method_name in non_stub: print 'skipping non-stub method:', method_name print continue args_dict = dict(zip(arg_str_list, arg_str_list)) au.call_and_print(method_name, args_dict, URI) time.sleep(1)
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from functools import partial # import crosscat.EngineTemplate as EngineTemplate import crosscat.utils.data_utils as du import crosscat.utils.api_utils as au import crosscat.utils.general_utils as gu method_name_to_args = gu.get_method_name_to_args(EngineTemplate.EngineTemplate) method_names_set = set(gu.get_method_names(EngineTemplate.EngineTemplate)) class JSONRPCEngine(EngineTemplate.EngineTemplate): """An 'adapter' for sending commands to an Engine resident on a remote machine. JSONRPCEngine supports all methods that the remote engine does. The remote engine must be listening at the URI specified in the constructor. Commands are sent via JSONRPC-2.0. """ def __init__(self, seed=None, URI=None): super(JSONRPCEngine, self).__init__(seed=seed) self.URI = URI return
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from functools import partial # import crosscat.EngineTemplate as EngineTemplate import crosscat.utils.data_utils as du import crosscat.utils.api_utils as au import crosscat.utils.general_utils as gu method_name_to_args = gu.get_method_name_to_args(EngineTemplate.EngineTemplate) method_names_set = set(gu.get_method_names(EngineTemplate.EngineTemplate)) class JSONRPCEngine(EngineTemplate.EngineTemplate): """An 'adapter' for sending commands to an Engine resident on a remote machine. JSONRPCEngine supports all methods that the remote engine does. The remote engine must be listening at the URI specified in the constructor. Commands are sent via JSONRPC-2.0. """ def __init__(self, seed=None, URI=None): super(JSONRPCEngine, self).__init__(seed=seed) self.URI = URI return def dispatch(self, method_name, *args, **kwargs):