brain_numpy_random_mtrand.py 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  2. # For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
  3. # Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
  4. # TODO(hippo91) : correct the functions return types
  5. """Astroid hooks for numpy.random.mtrand module."""
  6. from astroid.brain.helpers import register_module_extender
  7. from astroid.builder import parse
  8. from astroid.manager import AstroidManager
  9. def numpy_random_mtrand_transform():
  10. return parse(
  11. """
  12. def beta(a, b, size=None): return uninferable
  13. def binomial(n, p, size=None): return uninferable
  14. def bytes(length): return uninferable
  15. def chisquare(df, size=None): return uninferable
  16. def choice(a, size=None, replace=True, p=None): return uninferable
  17. def dirichlet(alpha, size=None): return uninferable
  18. def exponential(scale=1.0, size=None): return uninferable
  19. def f(dfnum, dfden, size=None): return uninferable
  20. def gamma(shape, scale=1.0, size=None): return uninferable
  21. def geometric(p, size=None): return uninferable
  22. def get_state(): return uninferable
  23. def gumbel(loc=0.0, scale=1.0, size=None): return uninferable
  24. def hypergeometric(ngood, nbad, nsample, size=None): return uninferable
  25. def laplace(loc=0.0, scale=1.0, size=None): return uninferable
  26. def logistic(loc=0.0, scale=1.0, size=None): return uninferable
  27. def lognormal(mean=0.0, sigma=1.0, size=None): return uninferable
  28. def logseries(p, size=None): return uninferable
  29. def multinomial(n, pvals, size=None): return uninferable
  30. def multivariate_normal(mean, cov, size=None): return uninferable
  31. def negative_binomial(n, p, size=None): return uninferable
  32. def noncentral_chisquare(df, nonc, size=None): return uninferable
  33. def noncentral_f(dfnum, dfden, nonc, size=None): return uninferable
  34. def normal(loc=0.0, scale=1.0, size=None): return uninferable
  35. def pareto(a, size=None): return uninferable
  36. def permutation(x): return uninferable
  37. def poisson(lam=1.0, size=None): return uninferable
  38. def power(a, size=None): return uninferable
  39. def rand(*args): return uninferable
  40. def randint(low, high=None, size=None, dtype='l'):
  41. import numpy
  42. return numpy.ndarray((1,1))
  43. def randn(*args): return uninferable
  44. def random(size=None): return uninferable
  45. def random_integers(low, high=None, size=None): return uninferable
  46. def random_sample(size=None): return uninferable
  47. def rayleigh(scale=1.0, size=None): return uninferable
  48. def seed(seed=None): return uninferable
  49. def set_state(state): return uninferable
  50. def shuffle(x): return uninferable
  51. def standard_cauchy(size=None): return uninferable
  52. def standard_exponential(size=None): return uninferable
  53. def standard_gamma(shape, size=None): return uninferable
  54. def standard_normal(size=None): return uninferable
  55. def standard_t(df, size=None): return uninferable
  56. def triangular(left, mode, right, size=None): return uninferable
  57. def uniform(low=0.0, high=1.0, size=None): return uninferable
  58. def vonmises(mu, kappa, size=None): return uninferable
  59. def wald(mean, scale, size=None): return uninferable
  60. def weibull(a, size=None): return uninferable
  61. def zipf(a, size=None): return uninferable
  62. """
  63. )
  64. register_module_extender(
  65. AstroidManager(), "numpy.random.mtrand", numpy_random_mtrand_transform
  66. )