Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/astroid/brain/brain_numpy_random_mtrand.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# TODO(hippo91) : correct the functions return types 

6"""Astroid hooks for numpy.random.mtrand module.""" 

7from astroid import nodes 

8from astroid.brain.helpers import register_module_extender 

9from astroid.builder import parse 

10from astroid.manager import AstroidManager 

11 

12 

13def numpy_random_mtrand_transform() -> nodes.Module: 

14 return parse( 

15 """ 

16 def beta(a, b, size=None): return uninferable 

17 def binomial(n, p, size=None): return uninferable 

18 def bytes(length): return uninferable 

19 def chisquare(df, size=None): return uninferable 

20 def choice(a, size=None, replace=True, p=None): return uninferable 

21 def dirichlet(alpha, size=None): return uninferable 

22 def exponential(scale=1.0, size=None): return uninferable 

23 def f(dfnum, dfden, size=None): return uninferable 

24 def gamma(shape, scale=1.0, size=None): return uninferable 

25 def geometric(p, size=None): return uninferable 

26 def get_state(): return uninferable 

27 def gumbel(loc=0.0, scale=1.0, size=None): return uninferable 

28 def hypergeometric(ngood, nbad, nsample, size=None): return uninferable 

29 def laplace(loc=0.0, scale=1.0, size=None): return uninferable 

30 def logistic(loc=0.0, scale=1.0, size=None): return uninferable 

31 def lognormal(mean=0.0, sigma=1.0, size=None): return uninferable 

32 def logseries(p, size=None): return uninferable 

33 def multinomial(n, pvals, size=None): return uninferable 

34 def multivariate_normal(mean, cov, size=None): return uninferable 

35 def negative_binomial(n, p, size=None): return uninferable 

36 def noncentral_chisquare(df, nonc, size=None): return uninferable 

37 def noncentral_f(dfnum, dfden, nonc, size=None): return uninferable 

38 def normal(loc=0.0, scale=1.0, size=None): return uninferable 

39 def pareto(a, size=None): return uninferable 

40 def permutation(x): return uninferable 

41 def poisson(lam=1.0, size=None): return uninferable 

42 def power(a, size=None): return uninferable 

43 def rand(*args): return uninferable 

44 def randint(low, high=None, size=None, dtype='l'): 

45 import numpy 

46 return numpy.ndarray((1,1)) 

47 def randn(*args): return uninferable 

48 def random(size=None): return uninferable 

49 def random_integers(low, high=None, size=None): return uninferable 

50 def random_sample(size=None): return uninferable 

51 def rayleigh(scale=1.0, size=None): return uninferable 

52 def seed(seed=None): return uninferable 

53 def set_state(state): return uninferable 

54 def shuffle(x): return uninferable 

55 def standard_cauchy(size=None): return uninferable 

56 def standard_exponential(size=None): return uninferable 

57 def standard_gamma(shape, size=None): return uninferable 

58 def standard_normal(size=None): return uninferable 

59 def standard_t(df, size=None): return uninferable 

60 def triangular(left, mode, right, size=None): return uninferable 

61 def uniform(low=0.0, high=1.0, size=None): return uninferable 

62 def vonmises(mu, kappa, size=None): return uninferable 

63 def wald(mean, scale, size=None): return uninferable 

64 def weibull(a, size=None): return uninferable 

65 def zipf(a, size=None): return uninferable 

66 """ 

67 ) 

68 

69 

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

71 register_module_extender( 

72 manager, "numpy.random.mtrand", numpy_random_mtrand_transform 

73 )