brain_numpy_random_mtrand.py 3.5 KB

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