(a, fn)
| 8894 | return n; |
| 8895 | }; |
| 8896 | const map_aggregate = (a, fn) => { |
| 8897 | if (a instanceof builtins.tuple) { |
| 8898 | const t = new builtins.tuple(a.map((elem) => map_aggregate(elem, fn))); |
| 8899 | if (!builtins.hasattr(a, '_fields')) { |
| 8900 | return t; |
| 8901 | } |
| 8902 | throw new python.Error('Not implemented.'); |
| 8903 | // return type(a)(*t); |
| 8904 | } else if (Array.isArray(a)) { |
| 8905 | return a.map((elem) => map_aggregate(elem, fn)); |
| 8906 | } else if (a instanceof builtins.dict) { |
| 8907 | const rv = new builtins.dict(); |
| 8908 | for (const [k, v] of a) { |
| 8909 | rv.__setitem__(k, map_aggregate(v, fn)); |
| 8910 | } |
| 8911 | return rv; |
| 8912 | } else if (a instanceof builtins.slice) { |
| 8913 | throw new python.Error('Not implemented.'); |
| 8914 | // return slice(map_aggregate(a.start, fn), map_aggregate(a.stop, fn), map_aggregate(a.step, fn)) |
| 8915 | } |
| 8916 | return fn(a); |
| 8917 | }; |
| 8918 | for (const old_use of this._input_nodes.keys()) { |
| 8919 | old_use.users.pop(this); |
| 8920 | } |
nothing calls this directly
no test coverage detected