Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/astroid/brain/brain_numpy_core_einsumfunc.py: 89%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html 

2# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE 

3# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt 

4 

5""" 

6Astroid hooks for numpy.core.einsumfunc module: 

7https://github.com/numpy/numpy/blob/main/numpy/core/einsumfunc.py. 

8""" 

9 

10from astroid import nodes 

11from astroid.brain.helpers import register_module_extender 

12from astroid.builder import parse 

13from astroid.manager import AstroidManager 

14 

15 

16def numpy_core_einsumfunc_transform() -> nodes.Module: 

17 return parse( 

18 """ 

19 def einsum(*operands, out=None, optimize=False, **kwargs): 

20 return numpy.ndarray([0, 0]) 

21 """ 

22 ) 

23 

24 

25def register(manager: AstroidManager) -> None: 

26 register_module_extender( 

27 manager, "numpy.core.einsumfunc", numpy_core_einsumfunc_transform 

28 )