public static void classDictInit(PyObject dict) { dict.__setitem__("deque", PyDeque.TYPE); dict.__setitem__("defaultdict", PyDefaultDict.TYPE); } }
public static void classDictInit(PyObject dict) { dict.__setitem__("BZ2File", PyBZ2File.TYPE); dict.__setitem__("BZ2Compressor", PyBZ2Compressor.TYPE); dict.__setitem__("BZ2Decompressor", PyBZ2Decompressor.TYPE); dict.__setitem__("classDictInit", null); }
public static void classDictInit(PyObject dict) { dict.__setitem__("__doc__", __doc__); dict.__setitem__("__name__", Py.newString("_weakref")); dict.__setitem__("ref", ReferenceType.TYPE); dict.__setitem__("ReferenceType", ReferenceType.TYPE); dict.__setitem__("ProxyType", ProxyType.TYPE); dict.__setitem__("CallableProxyType", CallableProxyType.TYPE); // __doc__, functions: getweakrefcount, getweakrefs, proxy dict.__setitem__("classDictInit", null); }
public static void classDictInit(PyObject dict) { dict.__setitem__("__name__", new PyString("zipimport")); dict.__setitem__("__doc__", __doc__); dict.__setitem__("zipimporter", zipimporter.TYPE); dict.__setitem__("_zip_directory_cache", _zip_directory_cache); dict.__setitem__("ZipImportError", ZipImportError); // Hide from Python dict.__setitem__("classDictInit", null); dict.__setitem__("initClassExceptions", null); }
public static void classDictInit(PyObject dict) { dict.__setitem__("__name__", new PyString("_functools")); dict.__setitem__("__doc__", __doc__); dict.__setitem__("partial", PyPartial.TYPE); // Hide from Python dict.__setitem__("classDictInit", null); }
public static void classDictInit(PyObject dict) { dict.__setitem__("LockType", PyType.fromClass(PyLock.class)); dict.__setitem__("_local", PyLocal.TYPE); dict.__setitem__("interruptAllThreads", null); }
public static void classDictInit(PyObject dict) { dict.__setitem__("__name__", Py.newString("_csv")); dict.__setitem__("__doc__", __doc__); dict.__setitem__("Dialect", PyDialect.TYPE); dict.__setitem__("Error", Error); for (QuoteStyle style : QuoteStyle.values()) { dict.__setitem__(style.name(), Py.newInteger(style.ordinal())); } dict.__setitem__("classDictInit", null); dict.__setitem__("field_limit", null); }
/** * Sets a variable in the local namespace. * * @param name the name of the variable * @param value the Python object to set the variable to */ public void set(String name, PyObject value) { getLocals().__setitem__(name.intern(), value); }
private static void addCode(PyObject dict, String name, int code, String message) { PyObject nameObj = Py.newString(name); PyObject codeObj = Py.newInteger(code); dict.__setitem__(nameObj, codeObj); errorcode.__setitem__(codeObj, nameObj); }
public void __setslice__( PyObject s_start, PyObject s_stop, PyObject s_step, PyObject value) { PySlice s = new PySlice(s_start, s_stop, s_step); __setitem__(s, value); }
private void module___init__(PyObject name, PyObject doc) { ensureDict(); __dict__.__setitem__("__name__", name); __dict__.__setitem__("__doc__", doc); if (name.equals(new PyString("__main__"))) { __dict__.__setitem__("__builtins__", Py.getSystemState().modules.__finditem__("__builtin__")); __dict__.__setitem__("__package__", Py.None); } }
public static PyObject UnicodeTranslateError() { PyObject dict = new PyStringMap(); dict.__setitem__("__init__", bindStaticJavaMethod("__init__", "UnicodeTranslateError__init__")); dict.__setitem__("__str__", bindStaticJavaMethod("__str__", "UnicodeTranslateError__str__")); return dict; }
private static PyObject buildClass(PyObject dict, String classname, String superclass, PyObject classDict, String doc) { classDict.__setitem__("__doc__", Py.newString(doc)); PyType type = (PyType)Py.makeClass("exceptions." + classname, dict.__finditem__(superclass), classDict); type.builtin = true; dict.__setitem__(classname, type); return type; }
public static PyObject _UnpickleableError() { dict = exceptionNamespace(); dict.__setitem__("__str__", getJavaFunc("__str__", "_UnpickleableError__str__")); return dict; }
public static PyObject exceptionNamespace() { PyObject dict = new PyStringMap(); dict.__setitem__("__module__", new PyString("binascii")); return dict; }
private static PyObject exceptionNamespace() { PyObject dict = new PyStringMap(); dict.__setitem__("__module__", new PyString("_csv")); return dict; } }
static final CType primitive(NativeType type) { CType t = new Builtin(type); CType.TYPE.fastGetDict().__setitem__(type.name(), t); return t; }
public static PyObject SystemExit() { PyObject dict = new PyStringMap(); defineSlots(dict, "code"); dict.__setitem__("__init__", bindStaticJavaMethod("__init__", "SystemExit__init__")); return dict; }
private boolean evaluatePythonExpression(Row r, PyCode code, PythonInterpreter interpreter) { evalColumns.clear(); try { ArrayList<Node> nodes = new ArrayList<>(r.getNodes()); Node node = nodes.get(0); interpreter.getLocals().__setitem__("nodeid", new PyString(node.getId())); PyObject output = interpreter.eval(code); return PythonTransformationHelper.getPyObjectValueAsBoolean(output); }catch(Exception e) { return onError; } }
public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) { switch (index) { case 22: arg1.__delslice__(arg2.__index__(), arg3.__index__()); return Py.None; case 24: return arg1.__getslice__(arg2.__index__(), arg3.__index__()); case 25: arg1.__setitem__(arg2, arg3); return Py.None; default: throw info.unexpectedCall(3, false); } }