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

Method shouldDeriveSetStateType

source/python.js:17786–17796  ·  view source on GitHub ↗
(def, schema)

Source from the content-addressed store, hash-verified

17784 }
17785 }
17786 shouldDeriveSetStateType(def, schema) {
17787 const noTypeAnnotations = schema.arguments.every((arg) => arg.is_inferred_type());
17788 const shouldInfer = def.name === '__setstate__' && noTypeAnnotations;
17789 if (!shouldInfer) {
17790 return false;
17791 }
17792 if (def.name !== '__setstate__' && def.args.args.length !== 2) {
17793 throw new python.Error(`Invalid '__setstate' method.`);
17794 }
17795 return true;
17796 }
17797 checkApplyNumInputs(apply, expected_inputs) {
17798 if (apply.args.length !== expected_inputs) {
17799 throw new python.Error('Invalid number of arguments.');

Callers 1

emitFormalArgumentsMethod · 0.80

Calls 1

is_inferred_typeMethod · 0.80

Tested by

no test coverage detected