MCPcopy
hub / github.com/lutzroeder/netron / invoke

Method invoke

source/python.js:21964–21987  ·  view source on GitHub ↗
(target, args)

Source from the content-addressed store, hash-verified

21962 }
21963
21964 invoke(target, args) {
21965 const builtins = this.builtins;
21966 if (typeof target === 'string') {
21967 target = this.resolve(target);
21968 }
21969 if (target) {
21970 if (target.__class__ === builtins.type) {
21971 if (target.prototype && target.prototype.__class__ === target) {
21972 return Reflect.construct(target, args);
21973 }
21974 const obj = Object.create(target);
21975 if (obj.__init__ && typeof obj.__init__ === 'function') {
21976 obj.__init__(...args);
21977 }
21978 return obj;
21979 } else if (target.__class__ === builtins.function) {
21980 if (target.__call__) {
21981 return target.__call__(args);
21982 }
21983 return target(...args);
21984 }
21985 }
21986 throw new python.Error('Unsupported invoke target.');
21987 }
21988
21989 call(target, name, args, keywords, context) {
21990 const builtins = this.builtins;

Callers 11

openMethod · 0.45
openMethod · 0.45
__new__Method · 0.45
constructorMethod · 0.45
_instantiateMethod · 0.45
_newobjMethod · 0.45
_reduceMethod · 0.45
load_pickleMethod · 0.45
openMethod · 0.45

Calls 4

resolveMethod · 0.45
createMethod · 0.45
__init__Method · 0.45
__call__Method · 0.45

Tested by

no test coverage detected