SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1305.0215 · 2013

Powerlaw: a Python package for analysis of heavy-tailed distributions

arXiv · PDF · Open in the Atlas

Code that ran

7 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 7 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1305.0215.json · badge: /api/ran/1305.0215.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jeffalstott/powerlaw canonical (classifier label)
classifier basis: census
7 ran · 7 no recorded run
FunctionStatusWhere it lives
bisect_map Ran
ran on a synthesized input
jeffalstott/powerlaw/powerlaw/utils.py
code served (permissive licence) · get_code("9846f7a2cbdc36a0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Define a simple test function that is monotonically increasing
def test_function(x):
    """A simple increasing function: f(x) = 2*x + 1"""
    return 2 * x + 1

# Set up the arguments for bisect_map
ARGS = {
    'mn': 0.0,                    # Lower bound
    'mx': 10.0,                   # Upper bound
    'function': test_function,    # Callable that takes a single value and returns a single value
    'target': 15.0,               # Target value to search for (2*7.5 + 1 = 16, so should find ~7.5)
    'tol': 0.01                   # Tolerance for convergence
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cdf Ran
ran on a synthesized input
jeffalstott/powerlaw/powerlaw/statistics.py
code served (permissive licence) · get_code("8d45632b465f9418")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from numpy import nan

# Construct valid arguments for the cdf function
data = np.array([1.5, 2.3, 3.1, 2.3, 4.5, 1.5, 5.0, 3.1])
xmin = 2.0
xmax = 4.5

ARGS = {
    "data": data,
    "xmin": xmin,
    "xmax": xmax,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
checkunique Ran
ran on a synthesized input
jeffalstott/powerlaw/powerlaw/utils.py
code served (permissive licence) · get_code("b10c6a813af26db7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function checkunique takes a sorted array and checks if all elements are unique
# It iterates through the array comparing consecutive elements
# It works with any sequence-like object that supports len() and indexing

# Test case 1: a list of unique elements (sorted)
data_unique = [1, 2, 3, 4, 5]

# Test case 2: a numpy array of unique elements (sorted)
data_numpy_unique = np.array([10, 20, 30, 40])

# Test case 3: a list with duplicates (sorted)
data_with_duplicates = [1, 2, 2, 3, 4]

# Test case 4: a numpy array with duplicates (sorted)
data_numpy_duplicates = np.array([5, 10, 10, 15, 20])

# Test case 5: a small tensor converted to list (sorted, unique)
data_tensor_unique = torch.tensor([100, 200, 300, 400]).tolist()

# Use a simple sorted array of unique elements as the primary test case
ARGS = {
    "data": [1, 2, 3, 4, 5]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
loglikelihood_ratio Ran
ran on a synthesized input
jeffalstott/powerlaw/powerlaw/statistics.py
code served (permissive licence) · get_code("dd1ffeb7f34fbce8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

torch_seed = 0
np.random.seed(torch_seed)

# Create sample loglikelihoods for two distributions
# Using small arrays with realistic log-likelihood values
loglikelihoods1 = np.array([-2.5, -1.8, -3.2, -2.1, -1.9])
loglikelihoods2 = np.array([-2.8, -2.1, -2.9, -2.4, -2.3])

ARGS = {
    "loglikelihoods1": loglikelihoods1,
    "loglikelihoods2": loglikelihoods2,
    "nested": False,
    "normalized_ratio": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
nested_loglikelihood_ratio Ran
ran on a synthesized input
jeffalstott/powerlaw/powerlaw/statistics.py
code served (permissive licence) · get_code("b5ba111c070273e5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample log-likelihood arrays
# These represent log-likelihoods for two different probability distributions
# across multiple observations
np.random.seed(0)
n_observations = 10

# Generate realistic log-likelihood values (typically negative)
loglikelihoods1 = np.random.randn(n_observations) - 2.0  # Model 1 log-likelihoods
loglikelihoods2 = np.random.randn(n_observations) - 2.5  # Model 2 log-likelihoods

ARGS = {
    "loglikelihoods1": loglikelihoods1,
    "loglikelihoods2": loglikelihoods2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
randomPowerLaw Ran
ran on a synthesized input
jeffalstott/powerlaw/testing/accuracy_overview.py
code served (permissive licence) · get_code("78468d71de69b0a1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Define ARGS dict with all parameters for randomPowerLaw
ARGS = {
    "alpha": -1.5,
    "xmin": 1.0,
    "xmax": 10.0,
    "size": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
randomPowerLawXmin Ran
ran on a synthesized input
jeffalstott/powerlaw/testing/accuracy_overview.py
code served (permissive licence) · get_code("84fb24ccc487e2cc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

np.random.seed(42)

ARGS = {
    'alpha': -2.5,
    'x0': 1.0,
    'xmax': 1000.0,
    'size': 100
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
distribution_compare Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/functional.py
code served (permissive licence) · get_code("aaf4971e99341fb0")
How it ran

no invocation recorded.

distribution_fit Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/functional.py
code served (permissive licence) · get_code("3d668418a5547b38")
How it ran

no invocation recorded.

likelihood_function_generator Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/functional.py
code served (permissive licence) · get_code("8e7b38b6cf03df6b")
How it ran

no invocation recorded.

load_test_dataset Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/data.py
code served (permissive licence) · get_code("b11a663e0be565d1")
How it ran

no invocation recorded.

plot_ccdf Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/plotting.py
code served (permissive licence) · get_code("b3482c492cfa42b9")
How it ran

no invocation recorded.

plot_cdf Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/plotting.py
code served (permissive licence) · get_code("ef612ff6cf165258")
How it ran

no invocation recorded.

plot_pdf Not yet run
unverified (harvested, no recorded run)
jeffalstott/powerlaw/powerlaw/plotting.py
code served (permissive licence) · get_code("05da55cf6bd9059b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Power laws are theoretically interesting probability distributions that are also frequently used to describe empirical data. In recent years effective statistical methods for fitting power laws have been developed, but appropriate use of these techniques requires significant programming and statistical insight. In order to greatly decrease the barriers to using good statistical methods for fitting power law distributions, we developed the powerlaw Python package. This software package provides easy commands for basic fitting and statistical analysis of distributions. Notably, it also seeks to support a variety of user needs by being exhaustive in the options available to the user. The source code is publicly available and easily extensible.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1305.0215")
get_code_for_paper("1305.0215")
have("1305.0215")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1305.0215.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1305.0215.svg)](https://syntology.ai/paper/1305.0215)

Connect an agent — have() is free.