def callBigDlFunc(bigdl_type, name, *args):
gateway = _get_gateway()<EOL>error = Exception("<STR_LIT>" % name)<EOL>for jinvoker in JavaCreator.instance(bigdl_type, gateway).value:<EOL><INDENT>try:<EOL><INDENT>api = getattr(jinvoker, name)<EOL>result = callJavaFunc(api, *args)<EOL><DEDENT>except Exception as e:<EOL><INDENT>error = e<EOL>if "<STR_LIT>" not in str(e):<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return result<EOL><DEDENT><DEDENT>raise error<EOL>
Call API in PythonBigDL