We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
DOC: numpy.random.sample and numpy.random.random_sample
I just noticed in the docs that the page for `numpy.random.sample` indicates that the function should be called as `numpy.random.random_sample`. I understand that this may just indicate that the function may be called as either `sample` or `random_sample`, but it does come across as a mistake when first viewing the page. Perhaps make it more explicit that `random_sample` is an alias of `sample`? Or is this the accepted practice for functions that have aliases?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `numpy/random/__init__.py`
Content:
```
1 """
2 ========================
3 Random Number Generation
4 ========================
5 
6 Instantiate a BitGenerator and wrap it in a Generator
7 which will convert the uniform stream to a number of distributions. The "bare"
8 functions are kept for legacy code, they should be called with the newer API
9 via ``np.random.Generator().function`` instead
10 
11 ==================== =========================================================
12 Utility functions
13 -------------------- ---------------------------------------------------------
14 random               Uniformly distributed floats over ``[0, 1)``
15 integers             Uniformly distributed integers, replaces ``randint``
16 bytes                Uniformly distributed random bytes.
17 permutation          Randomly permute a sequence / generate a random sequence.
18 shuffle              Randomly permute a sequence in place.
19 seed                 Seed the random number generator.
20 choice               Random sample from 1-D array.
21 ==================== =========================================================
22 
23 ==================== =========================================================
24 Compatibility
25 functions - removed
26 in the new API
27 -------------------- ---------------------------------------------------------
28 rand                 Uniformly distributed values.
29 randn                Normally distributed values.
30 ranf                 Uniformly distributed floating point numbers.
31 random_integers      Uniformly distributed integers in a given range.
32                      (deprecated, use ``integers(..., closed=True)`` instead)
33 random_sample        Alias for `random_sample`
34 randint              Uniformly distributed integers in a given range
35 ==================== =========================================================
36 
37 ==================== =========================================================
38 Univariate
39 distributions
40 -------------------- ---------------------------------------------------------
41 beta                 Beta distribution over ``[0, 1]``.
42 binomial             Binomial distribution.
43 chisquare            :math:`\\chi^2` distribution.
44 exponential          Exponential distribution.
45 f                    F (Fisher-Snedecor) distribution.
46 gamma                Gamma distribution.
47 geometric            Geometric distribution.
48 gumbel               Gumbel distribution.
49 hypergeometric       Hypergeometric distribution.
50 laplace              Laplace distribution.
51 logistic             Logistic distribution.
52 lognormal            Log-normal distribution.
53 logseries            Logarithmic series distribution.
54 negative_binomial    Negative binomial distribution.
55 noncentral_chisquare Non-central chi-square distribution.
56 noncentral_f         Non-central F distribution.
57 normal               Normal / Gaussian distribution.
58 pareto               Pareto distribution.
59 poisson              Poisson distribution.
60 power                Power distribution.
61 rayleigh             Rayleigh distribution.
62 triangular           Triangular distribution.
63 uniform              Uniform distribution.
64 vonmises             Von Mises circular distribution.
65 wald                 Wald (inverse Gaussian) distribution.
66 weibull              Weibull distribution.
67 zipf                 Zipf's distribution over ranked data.
68 ==================== =========================================================
69 
70 ==================== ==========================================================
71 Multivariate
72 distributions
73 -------------------- ----------------------------------------------------------
74 dirichlet            Multivariate generalization of Beta distribution.
75 multinomial          Multivariate generalization of the binomial distribution.
76 multivariate_normal  Multivariate generalization of the normal distribution.
77 ==================== ==========================================================
78 
79 ==================== =========================================================
80 Standard
81 distributions
82 -------------------- ---------------------------------------------------------
83 standard_cauchy      Standard Cauchy-Lorentz distribution.
84 standard_exponential Standard exponential distribution.
85 standard_gamma       Standard Gamma distribution.
86 standard_normal      Standard normal distribution.
87 standard_t           Standard Student's t-distribution.
88 ==================== =========================================================
89 
90 ==================== =========================================================
91 Internal functions
92 -------------------- ---------------------------------------------------------
93 get_state            Get tuple representing internal state of generator.
94 set_state            Set state of generator.
95 ==================== =========================================================
96 
97 ============================================= ===
98 BitGenerator Streams that work with Generator
99 --------------------------------------------- ---
100 MT19937
101 DSFMT
102 PCG32
103 PCG64
104 Philox
105 ThreeFry
106 Xoshiro256
107 Xoshiro512
108 ============================================= ===
109 
110 """
111 from __future__ import division, absolute_import, print_function
112 
113 __all__ = [
114     'beta',
115     'binomial',
116     'bytes',
117     'chisquare',
118     'choice',
119     'dirichlet',
120     'exponential',
121     'f',
122     'gamma',
123     'geometric',
124     'get_state',
125     'gumbel',
126     'hypergeometric',
127     'laplace',
128     'logistic',
129     'lognormal',
130     'logseries',
131     'multinomial',
132     'multivariate_normal',
133     'negative_binomial',
134     'noncentral_chisquare',
135     'noncentral_f',
136     'normal',
137     'pareto',
138     'permutation',
139     'poisson',
140     'power',
141     'rand',
142     'randint',
143     'randn',
144     'random_integers',
145     'random_sample',
146     'rayleigh',
147     'seed',
148     'set_state',
149     'shuffle',
150     'standard_cauchy',
151     'standard_exponential',
152     'standard_gamma',
153     'standard_normal',
154     'standard_t',
155     'triangular',
156     'uniform',
157     'vonmises',
158     'wald',
159     'weibull',
160     'zipf',
161 ]
162 
163 from . import mtrand
164 from .mtrand import *
165 from .dsfmt import DSFMT
166 from .generator import Generator
167 from .mt19937 import MT19937
168 from .pcg32 import PCG32
169 from .pcg64 import PCG64
170 from .philox import Philox
171 from .threefry import ThreeFry
172 from .xoshiro256 import Xoshiro256
173 from .xoshiro512 import Xoshiro512
174 from .mtrand import RandomState
175 
176 __all__ += ['Generator', 'DSFMT', 'MT19937', 'Philox', 'PCG64', 'PCG32',
177             'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState']
178 
179 # Some aliases:
180 ranf = random = sample = random_sample
181 __all__.extend(['ranf', 'random', 'sample'])
182 
183 
184 def __RandomState_ctor():
185     """Return a RandomState instance.
186 
187     This function exists solely to assist (un)pickling.
188 
189     Note that the state of the RandomState returned here is irrelevant, as this function's
190     entire purpose is to return a newly allocated RandomState whose state pickle can set.
191     Consequently the RandomState returned by this function is a freshly allocated copy
192     with a seed=0.
193 
194     See https://github.com/numpy/numpy/issues/4763 for a detailed discussion
195 
196     """
197     return RandomState(seed=0)
198 
199 
200 from numpy._pytesttester import PytestTester
201 test = PytestTester(__name__)
202 del PytestTester
203
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -141,9 +141,12 @@
     'rand',
     'randint',
     'randn',
+    'random',
     'random_integers',
     'random_sample',
+    'ranf',
     'rayleigh',
+    'sample',
     'seed',
     'set_state',
     'shuffle',
@@ -176,10 +179,6 @@
 __all__ += ['Generator', 'DSFMT', 'MT19937', 'Philox', 'PCG64', 'PCG32',
             'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState']
 
-# Some aliases:
-ranf = random = sample = random_sample
-__all__.extend(['ranf', 'random', 'sample'])
-
 
 def __RandomState_ctor():
     """Return a RandomState instance.

{"golden_diff": "diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py\n--- a/numpy/random/__init__.py\n+++ b/numpy/random/__init__.py\n@@ -141,9 +141,12 @@\n     'rand',\n     'randint',\n     'randn',\n+    'random',\n     'random_integers',\n     'random_sample',\n+    'ranf',\n     'rayleigh',\n+    'sample',\n     'seed',\n     'set_state',\n     'shuffle',\n@@ -176,10 +179,6 @@\n __all__ += ['Generator', 'DSFMT', 'MT19937', 'Philox', 'PCG64', 'PCG32',\n             'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState']\n \n-# Some aliases:\n-ranf = random = sample = random_sample\n-__all__.extend(['ranf', 'random', 'sample'])\n-\n \n def __RandomState_ctor():\n     \"\"\"Return a RandomState instance.\n", "issue": "DOC: numpy.random.sample and numpy.random.random_sample\nI just noticed in the docs that the page for `numpy.random.sample` indicates that the function should be called as `numpy.random.random_sample`. I understand that this may just indicate that the function may be called as either `sample` or `random_sample`, but it does come across as a mistake when first viewing the page. Perhaps make it more explicit that `random_sample` is an alias of `sample`? Or is this the accepted practice for functions that have aliases?\n", "before_files": [{"content": "\"\"\"\n========================\nRandom Number Generation\n========================\n\nInstantiate a BitGenerator and wrap it in a Generator\nwhich will convert the uniform stream to a number of distributions. The \"bare\"\nfunctions are kept for legacy code, they should be called with the newer API\nvia ``np.random.Generator().function`` instead\n\n==================== =========================================================\nUtility functions\n-------------------- ---------------------------------------------------------\nrandom               Uniformly distributed floats over ``[0, 1)``\nintegers             Uniformly distributed integers, replaces ``randint``\nbytes                Uniformly distributed random bytes.\npermutation          Randomly permute a sequence / generate a random sequence.\nshuffle              Randomly permute a sequence in place.\nseed                 Seed the random number generator.\nchoice               Random sample from 1-D array.\n==================== =========================================================\n\n==================== =========================================================\nCompatibility\nfunctions - removed\nin the new API\n-------------------- ---------------------------------------------------------\nrand                 Uniformly distributed values.\nrandn                Normally distributed values.\nranf                 Uniformly distributed floating point numbers.\nrandom_integers      Uniformly distributed integers in a given range.\n                     (deprecated, use ``integers(..., closed=True)`` instead)\nrandom_sample        Alias for `random_sample`\nrandint              Uniformly distributed integers in a given range\n==================== =========================================================\n\n==================== =========================================================\nUnivariate\ndistributions\n-------------------- ---------------------------------------------------------\nbeta                 Beta distribution over ``[0, 1]``.\nbinomial             Binomial distribution.\nchisquare            :math:`\\\\chi^2` distribution.\nexponential          Exponential distribution.\nf                    F (Fisher-Snedecor) distribution.\ngamma                Gamma distribution.\ngeometric            Geometric distribution.\ngumbel               Gumbel distribution.\nhypergeometric       Hypergeometric distribution.\nlaplace              Laplace distribution.\nlogistic             Logistic distribution.\nlognormal            Log-normal distribution.\nlogseries            Logarithmic series distribution.\nnegative_binomial    Negative binomial distribution.\nnoncentral_chisquare Non-central chi-square distribution.\nnoncentral_f         Non-central F distribution.\nnormal               Normal / Gaussian distribution.\npareto               Pareto distribution.\npoisson              Poisson distribution.\npower                Power distribution.\nrayleigh             Rayleigh distribution.\ntriangular           Triangular distribution.\nuniform              Uniform distribution.\nvonmises             Von Mises circular distribution.\nwald                 Wald (inverse Gaussian) distribution.\nweibull              Weibull distribution.\nzipf                 Zipf's distribution over ranked data.\n==================== =========================================================\n\n==================== ==========================================================\nMultivariate\ndistributions\n-------------------- ----------------------------------------------------------\ndirichlet            Multivariate generalization of Beta distribution.\nmultinomial          Multivariate generalization of the binomial distribution.\nmultivariate_normal  Multivariate generalization of the normal distribution.\n==================== ==========================================================\n\n==================== =========================================================\nStandard\ndistributions\n-------------------- ---------------------------------------------------------\nstandard_cauchy      Standard Cauchy-Lorentz distribution.\nstandard_exponential Standard exponential distribution.\nstandard_gamma       Standard Gamma distribution.\nstandard_normal      Standard normal distribution.\nstandard_t           Standard Student's t-distribution.\n==================== =========================================================\n\n==================== =========================================================\nInternal functions\n-------------------- ---------------------------------------------------------\nget_state            Get tuple representing internal state of generator.\nset_state            Set state of generator.\n==================== =========================================================\n\n============================================= ===\nBitGenerator Streams that work with Generator\n--------------------------------------------- ---\nMT19937\nDSFMT\nPCG32\nPCG64\nPhilox\nThreeFry\nXoshiro256\nXoshiro512\n============================================= ===\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\n__all__ = [\n    'beta',\n    'binomial',\n    'bytes',\n    'chisquare',\n    'choice',\n    'dirichlet',\n    'exponential',\n    'f',\n    'gamma',\n    'geometric',\n    'get_state',\n    'gumbel',\n    'hypergeometric',\n    'laplace',\n    'logistic',\n    'lognormal',\n    'logseries',\n    'multinomial',\n    'multivariate_normal',\n    'negative_binomial',\n    'noncentral_chisquare',\n    'noncentral_f',\n    'normal',\n    'pareto',\n    'permutation',\n    'poisson',\n    'power',\n    'rand',\n    'randint',\n    'randn',\n    'random_integers',\n    'random_sample',\n    'rayleigh',\n    'seed',\n    'set_state',\n    'shuffle',\n    'standard_cauchy',\n    'standard_exponential',\n    'standard_gamma',\n    'standard_normal',\n    'standard_t',\n    'triangular',\n    'uniform',\n    'vonmises',\n    'wald',\n    'weibull',\n    'zipf',\n]\n\nfrom . import mtrand\nfrom .mtrand import *\nfrom .dsfmt import DSFMT\nfrom .generator import Generator\nfrom .mt19937 import MT19937\nfrom .pcg32 import PCG32\nfrom .pcg64 import PCG64\nfrom .philox import Philox\nfrom .threefry import ThreeFry\nfrom .xoshiro256 import Xoshiro256\nfrom .xoshiro512 import Xoshiro512\nfrom .mtrand import RandomState\n\n__all__ += ['Generator', 'DSFMT', 'MT19937', 'Philox', 'PCG64', 'PCG32',\n            'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState']\n\n# Some aliases:\nranf = random = sample = random_sample\n__all__.extend(['ranf', 'random', 'sample'])\n\n\ndef __RandomState_ctor():\n    \"\"\"Return a RandomState instance.\n\n    This function exists solely to assist (un)pickling.\n\n    Note that the state of the RandomState returned here is irrelevant, as this function's\n    entire purpose is to return a newly allocated RandomState whose state pickle can set.\n    Consequently the RandomState returned by this function is a freshly allocated copy\n    with a seed=0.\n\n    See https://github.com/numpy/numpy/issues/4763 for a detailed discussion\n\n    \"\"\"\n    return RandomState(seed=0)\n\n\nfrom numpy._pytesttester import PytestTester\ntest = PytestTester(__name__)\ndel PytestTester\n", "path": "numpy/random/__init__.py"}], "after_files": [{"content": "\"\"\"\n========================\nRandom Number Generation\n========================\n\nInstantiate a BitGenerator and wrap it in a Generator\nwhich will convert the uniform stream to a number of distributions. The \"bare\"\nfunctions are kept for legacy code, they should be called with the newer API\nvia ``np.random.Generator().function`` instead\n\n==================== =========================================================\nUtility functions\n-------------------- ---------------------------------------------------------\nrandom               Uniformly distributed floats over ``[0, 1)``\nintegers             Uniformly distributed integers, replaces ``randint``\nbytes                Uniformly distributed random bytes.\npermutation          Randomly permute a sequence / generate a random sequence.\nshuffle              Randomly permute a sequence in place.\nseed                 Seed the random number generator.\nchoice               Random sample from 1-D array.\n==================== =========================================================\n\n==================== =========================================================\nCompatibility\nfunctions - removed\nin the new API\n-------------------- ---------------------------------------------------------\nrand                 Uniformly distributed values.\nrandn                Normally distributed values.\nranf                 Uniformly distributed floating point numbers.\nrandom_integers      Uniformly distributed integers in a given range.\n                     (deprecated, use ``integers(..., closed=True)`` instead)\nrandom_sample        Alias for `random_sample`\nrandint              Uniformly distributed integers in a given range\n==================== =========================================================\n\n==================== =========================================================\nUnivariate\ndistributions\n-------------------- ---------------------------------------------------------\nbeta                 Beta distribution over ``[0, 1]``.\nbinomial             Binomial distribution.\nchisquare            :math:`\\\\chi^2` distribution.\nexponential          Exponential distribution.\nf                    F (Fisher-Snedecor) distribution.\ngamma                Gamma distribution.\ngeometric            Geometric distribution.\ngumbel               Gumbel distribution.\nhypergeometric       Hypergeometric distribution.\nlaplace              Laplace distribution.\nlogistic             Logistic distribution.\nlognormal            Log-normal distribution.\nlogseries            Logarithmic series distribution.\nnegative_binomial    Negative binomial distribution.\nnoncentral_chisquare Non-central chi-square distribution.\nnoncentral_f         Non-central F distribution.\nnormal               Normal / Gaussian distribution.\npareto               Pareto distribution.\npoisson              Poisson distribution.\npower                Power distribution.\nrayleigh             Rayleigh distribution.\ntriangular           Triangular distribution.\nuniform              Uniform distribution.\nvonmises             Von Mises circular distribution.\nwald                 Wald (inverse Gaussian) distribution.\nweibull              Weibull distribution.\nzipf                 Zipf's distribution over ranked data.\n==================== =========================================================\n\n==================== ==========================================================\nMultivariate\ndistributions\n-------------------- ----------------------------------------------------------\ndirichlet            Multivariate generalization of Beta distribution.\nmultinomial          Multivariate generalization of the binomial distribution.\nmultivariate_normal  Multivariate generalization of the normal distribution.\n==================== ==========================================================\n\n==================== =========================================================\nStandard\ndistributions\n-------------------- ---------------------------------------------------------\nstandard_cauchy      Standard Cauchy-Lorentz distribution.\nstandard_exponential Standard exponential distribution.\nstandard_gamma       Standard Gamma distribution.\nstandard_normal      Standard normal distribution.\nstandard_t           Standard Student's t-distribution.\n==================== =========================================================\n\n==================== =========================================================\nInternal functions\n-------------------- ---------------------------------------------------------\nget_state            Get tuple representing internal state of generator.\nset_state            Set state of generator.\n==================== =========================================================\n\n============================================= ===\nBitGenerator Streams that work with Generator\n--------------------------------------------- ---\nMT19937\nDSFMT\nPCG32\nPCG64\nPhilox\nThreeFry\nXoshiro256\nXoshiro512\n============================================= ===\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\n__all__ = [\n    'beta',\n    'binomial',\n    'bytes',\n    'chisquare',\n    'choice',\n    'dirichlet',\n    'exponential',\n    'f',\n    'gamma',\n    'geometric',\n    'get_state',\n    'gumbel',\n    'hypergeometric',\n    'laplace',\n    'logistic',\n    'lognormal',\n    'logseries',\n    'multinomial',\n    'multivariate_normal',\n    'negative_binomial',\n    'noncentral_chisquare',\n    'noncentral_f',\n    'normal',\n    'pareto',\n    'permutation',\n    'poisson',\n    'power',\n    'rand',\n    'randint',\n    'randn',\n    'random',\n    'random_integers',\n    'random_sample',\n    'ranf',\n    'rayleigh',\n    'sample',\n    'seed',\n    'set_state',\n    'shuffle',\n    'standard_cauchy',\n    'standard_exponential',\n    'standard_gamma',\n    'standard_normal',\n    'standard_t',\n    'triangular',\n    'uniform',\n    'vonmises',\n    'wald',\n    'weibull',\n    'zipf',\n]\n\nfrom . import mtrand\nfrom .mtrand import *\nfrom .dsfmt import DSFMT\nfrom .generator import Generator\nfrom .mt19937 import MT19937\nfrom .pcg32 import PCG32\nfrom .pcg64 import PCG64\nfrom .philox import Philox\nfrom .threefry import ThreeFry\nfrom .xoshiro256 import Xoshiro256\nfrom .xoshiro512 import Xoshiro512\nfrom .mtrand import RandomState\n\n__all__ += ['Generator', 'DSFMT', 'MT19937', 'Philox', 'PCG64', 'PCG32',\n            'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState']\n\n\ndef __RandomState_ctor():\n    \"\"\"Return a RandomState instance.\n\n    This function exists solely to assist (un)pickling.\n\n    Note that the state of the RandomState returned here is irrelevant, as this function's\n    entire purpose is to return a newly allocated RandomState whose state pickle can set.\n    Consequently the RandomState returned by this function is a freshly allocated copy\n    with a seed=0.\n\n    See https://github.com/numpy/numpy/issues/4763 for a detailed discussion\n\n    \"\"\"\n    return RandomState(seed=0)\n\n\nfrom numpy._pytesttester import PytestTester\ntest = PytestTester(__name__)\ndel PytestTester\n", "path": "numpy/random/__init__.py"}]}