(name)
| 21930 | } |
| 21931 | |
| 21932 | resolve(name) { |
| 21933 | const index = name.lastIndexOf('.'); |
| 21934 | const memberName = index === -1 ? name : name.substring(index + 1, name.length); |
| 21935 | const moduleName = index === -1 ? '' : name.substring(0, index); |
| 21936 | const module = this.import(moduleName); |
| 21937 | let type = module ? module[memberName] : null; |
| 21938 | if (!type) { |
| 21939 | const index = name.indexOf('.'); |
| 21940 | const rootName = index === -1 ? '' : name.substring(0, index); |
| 21941 | if (rootName) { |
| 21942 | const root = this.import(rootName); |
| 21943 | if (root && root.__materialize__) { |
| 21944 | root.__materialize__(name); |
| 21945 | const module = this.import(moduleName); |
| 21946 | type = module ? module[memberName] : null; |
| 21947 | } |
| 21948 | } |
| 21949 | } |
| 21950 | if (!type) { |
| 21951 | if (!this._unresolved.has(name)) { |
| 21952 | const moduleName = name.split('.').shift(); |
| 21953 | if (this._registry.has(moduleName) && moduleName !== '__main__' && moduleName !== '__torch__') { |
| 21954 | this.emit('resolve', name); |
| 21955 | } |
| 21956 | const type = this._createType(name, class {}); |
| 21957 | this._unresolved.set(name, type); |
| 21958 | } |
| 21959 | type = this._unresolved.get(name); |
| 21960 | } |
| 21961 | return type; |
| 21962 | } |
| 21963 | |
| 21964 | invoke(target, args) { |
| 21965 | const builtins = this.builtins; |
no test coverage detected