# Python random.paretovariate() Examples

The following are code examples for showing how to use random.paretovariate(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
```def _execute(self, sources, alignment_stream, interval):
if alignment_stream is None:
raise ToolExecutionError("Alignment stream expected")

for ti, _ in alignment_stream.window(interval, force_calculation=True):
yield StreamInstance(ti, random.paretovariate(alpha=self.alpha)) ```
Example 2
```def pareto_sequence(n,exponent=1.0):
"""
Return sample sequence of length n from a Pareto distribution.
"""
return [random.paretovariate(exponent) for i in range(n)] ```
Example 3
```def powerlaw_sequence(n,exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent-1) for i in range(n)] ```
Example 4
```def pareto_sequence(n,exponent=1.0):
"""
Return sample sequence of length n from a Pareto distribution.
"""
return [random.paretovariate(exponent) for i in range(n)] ```
Example 5
```def powerlaw_sequence(n,exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent-1) for i in range(n)] ```
Example 6
```def _resource_pr(self, resource, x, y, distance, deposit):
seed("{}.{}".format(x, y))
if resource == "clay":
v = paretovariate(2) / (distance + 1)
return v if v > 0.2 else 0
if resource == "elevation":
return paretovariate(4) / (distance + 1)
if resource == "ore":
dx, dy, dr = deposit
angle = math.atan2(dy - y, dx - x) % math.pi
diff = 0.5 / (angle - dr + 0.5)
v = paretovariate(2) / (distance + 1) * diff
return v if v > 0.4 else 0 ```
Example 7
 Project: graph-partition   Author: valiantljk   File: random_sequence.py    GNU General Public License v2.0 5 votes
```def pareto_sequence(n,exponent=1.0):
"""
Return sample sequence of length n from a Pareto distribution.
"""
return [random.paretovariate(exponent) for i in range(n)] ```
Example 8
 Project: graph-partition   Author: valiantljk   File: random_sequence.py    GNU General Public License v2.0 5 votes
```def powerlaw_sequence(n,exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent-1) for i in range(n)] ```
Example 9
 Project: Python-iBeacon-Scan   Author: NikNitro   File: crv_types.py    GNU General Public License v3.0 5 votes
```def sample(self):
return random.paretovariate(self.alpha) ```
Example 10
 Project: morpheo-plugin   Author: MorphoCity   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def powerlaw_sequence(n, exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent - 1) for i in range(n)] ```
Example 11
 Project: uv-align-distribute   Author: c30ra   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def pareto_sequence(n,exponent=1.0):
"""
Return sample sequence of length n from a Pareto distribution.
"""
return [random.paretovariate(exponent) for i in range(n)] ```
Example 12
 Project: uv-align-distribute   Author: c30ra   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def powerlaw_sequence(n,exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent-1) for i in range(n)] ```
Example 13
 Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def pareto_sequence(n,exponent=1.0):
"""
Return sample sequence of length n from a Pareto distribution.
"""
return [random.paretovariate(exponent) for i in range(n)] ```
Example 14
 Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def powerlaw_sequence(n,exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent-1) for i in range(n)] ```
Example 15
 Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def pareto_sequence(n,exponent=1.0):
"""
Return sample sequence of length n from a Pareto distribution.
"""
return [random.paretovariate(exponent) for i in range(n)] ```
Example 16
 Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def powerlaw_sequence(n,exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent-1) for i in range(n)] ```
Example 17
```def powerlaw_sequence(n, exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent - 1) for i in range(n)] ```
Example 18
 Project: aop-helpFinder   Author: jecarvaill   File: random_sequence.py    GNU General Public License v3.0 5 votes
```def powerlaw_sequence(n, exponent=2.0):
"""
Return sample sequence of length n from a power law distribution.
"""
return [random.paretovariate(exponent - 1) for i in range(n)] ```
Example 19
```def pareto_sequence(n,exponent=1.0):
```def powerlaw_sequence(n,exponent=2.0):