SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.10252 · NeurIPS · 2021

Federated Multi-Task Learning under a Mixture of Distributions

Othmane Marfoq, Giovanni Neglia, Richard Vidal, Aurélien Bellet, Laetitia Kameni

arXiv · PDF · Open in the Atlas

Code that ran

12 of 17 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, 1 violated it and 8 have no contract verdict; 3 failures of our instrument; 5 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/2108.10252.json · badge: /api/ran/2108.10252.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
omarfoq/FedEM canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
tj-kim/pfeddef_v1 extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
omarfoq/FedEM/utils/metrics.py
code served (permissive licence) · get_code("1484765c5a875320")
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 Tensor, 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

torch.manual_seed(0)

# y_pred: model output logits, shape (batch_size, num_classes)
# y: ground truth labels, shape (batch_size,)
y_pred = torch.randn(2, 4)  # batch_size=2, num_classes=4
y = torch.tensor([0, 2])     # batch_size=2, class indices

ARGS = {
    "y_pred": y_pred,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
args_to_string Ran
ran; our contract draft was wrong, not the code
omarfoq/FedEM/utils/args.py
code served (permissive licence) · get_code("2aa9eaee30e6f00f")
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 str. 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 torch
import os

class Args:
    def __init__(self):
        self.decentralized = False
        self.experiment = "test_experiment"
        self.method = "fedavg"
        self.locally_tune_clients = False

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
binary_accuracy Ran
ran on a synthesized input
omarfoq/FedEM/utils/metrics.py
code served (permissive licence) · get_code("d86b1b7917839f9d")
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 Tensor, 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

torch.manual_seed(0)

# Create small binary prediction logits and binary labels
y_pred = torch.randn(2, 1)  # batch size 2, single output
y = torch.randint(0, 2, (2, 1)).float()  # batch size 2, binary labels

ARGS = {
    "y_pred": y_pred,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
compute_mixing_matrix Ran
ran on a synthesized input
omarfoq/FedEM/utils/decentralized.py
code served (permissive licence) · get_code("063c0646ab2e0dd5")
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 2, dtype family float, shape (4, 4) 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

# Create a small valid adjacency matrix for a connected graph
# Using a 4-node graph with specific connections
adjacency_matrix = np.array([
    [0, 1, 1, 0],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 1, 1, 0]
], dtype=float)

ARGS = {
    "adjacency_matrix": adjacency_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
cuda Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tj-kim/pfeddef_v1/transfer_attacks/TA_utils.py
code served (permissive licence) · get_code("558fdb5c17a3a411")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

tensor = torch.randn(2, 4)
is_cuda = False

ARGS = {
    "tensor": tensor,
    "is_cuda": is_cuda
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
get_communication_graph Ran
ran on a synthesized input
omarfoq/FedEM/utils/decentralized.py
code served (permissive licence) · get_code("90e04d573188fcbd")
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 Graph. 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 networkx as nx

# Define arguments for get_communication_graph
n = 5  # number of nodes
p = 0.3  # probability of edge creation
seed = 42  # random seed for reproducibility

ARGS = {
    "n": n,
    "p": p,
    "seed": seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Graph — a Graph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Graph output the recorded ndim 1 and dtype family int describe that coercion, not the output, and are not 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
get_lr_scheduler Ran
ran on a synthesized input
omarfoq/FedEM/utils/optim.py
code served (permissive licence) · get_code("2581454f884675e8")
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 LambdaLR. 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 torch
import torch.nn as nn
import torch.optim as optim
import numpy as np

torch.manual_seed(0)

# Create a simple model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Define arguments for different scheduler types
# We'll test with 'sqrt' scheduler as an example
ARGS = {
    'optimizer': optimizer,
    'scheduler_name': 'sqrt',
    'n_rounds': None
}
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 LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
get_mixing_matrix Ran
ran on a synthesized input
omarfoq/FedEM/utils/decentralized.py
code served (permissive licence) · get_code("b7accb5913464f4a")
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 2, dtype family float, shape (4, 4) 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 cvxpy as cp
import networkx as nx
import numpy as np

ARGS = {
    "n": 4,
    "p": 0.5,
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, networkx, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
mse Ran
ran on a synthesized input
omarfoq/FedEM/utils/metrics.py
code served (permissive licence) · get_code("e5d7e349519111ef")
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 Tensor, 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 torch.nn.functional as F

torch.manual_seed(0)

# Create small prediction and target tensors
# batch_size=2, feature_dim=4
y_pred = torch.randn(2, 4)
y = torch.randn(2, 4)

ARGS = {
    "y_pred": y_pred,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
parse_args Ran
ran on a synthesized input
omarfoq/FedEM/utils/args.py
code served (permissive licence) · get_code("214218b6675ec25e")
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 Namespace. 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 argparse

ARGS = {
    'args_list': [
        'test_experiment',
        'FedAvg',
        '--decentralized',
        '--sampling_rate', '0.8',
        '--input_dimension', '10',
        '--output_dimension', '5',
        '--n_learners', '3',
        '--n_rounds', '5',
        '--bz', '32',
        '--local_steps', '2',
        '--log_freq', '1',
        '--device', 'cpu',
        '--optimizer', 'sgd',
        '--lr', '0.01',
        '--lr_lambda', '0.001',
        '--lr_scheduler', 'constant',
        '--mu', '0.01',
        '--communication_probability', '0.1',
        '--q', '1.0',
        '--locally_tune_clients',
        '--validation',
        '--verbose', '1',
        '--seed', '42'
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
str2bool Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from eth-sri/eran
pointer only · get_code("f017532fc389cbfe")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

where Ran
ran; our contract draft was wrong, not the code
tj-kim/pfeddef_v1/transfer_attacks/TA_utils.py
code served (permissive licence) · get_code("f5f8985f740c045e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# Create a boolean condition tensor
cond = torch.tensor([[True, False, True, False],
                     [False, True, False, True]])

# Create x tensor with shape (2, 4)
x = torch.randn(2, 4)

# Create y tensor with shape (2, 4)
y = torch.randn(2, 4)

ARGS = {
    'cond': cond,
    'x': x,
    'y': y
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
get_mobilenet Not yet run
unverified (harvested, no recorded run)
omarfoq/FedEM/models.py
code served (permissive licence) · get_code("9c1e58d7bca6b6c9")
How it ran

no invocation recorded.

get_optimizer Not yet run
unverified (harvested, no recorded run)
omarfoq/FedEM/utils/optim.py
code served (permissive licence) · get_code("2131ebbda92151a1")
How it ran

no invocation recorded.

get_squeezenet Not yet run
unverified (harvested, no recorded run)
omarfoq/FedEM/models.py
code served (permissive licence) · get_code("3a84a16cfdc372ba")
How it ran

no invocation recorded.

get_vgg11 Not yet run
unverified (harvested, no recorded run)
omarfoq/FedEM/models.py
code served (permissive licence) · get_code("2d5ef5672e97f155")
How it ran

no invocation recorded.

init_clients Not yet run
unverified (harvested, no recorded run)
omarfoq/FedEM/run_experiment.py
code served (permissive licence) · get_code("825bbd029f466ff8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 7 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 7 later) and 10 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.

FunctionAlso present inEarliest-datedOthers named
str2bool 82 other papers
45 dated earlier, 1 the same month, 35 later, 1 same year, order not determinable
1510.03055 (2015-10)
A Diversity-Promoting Objective Function for Neural Conversation Models
1703.06490 (2017-03)
Generating Multi-label Discrete Patient Records using Generative Adversarial Networks
1710.10467 (2017-10)
Generalized End-to-End Loss for Speaker Verification
and 79 more not named here
get_mobilenet 4 other papers
4 later
2210.02129 (2022-10)
Decentralized Hyper-Gradient Computation over Time-Varying Directed Networks
2301.04632 (2023-01)
Federated Learning under Heterogeneous and Correlated Client Availability
2305.01068 (2023-05)
Personalized Federated Learning under Mixture of Distributions
and 1 more not named here
get_squeezenet 3 other papers
3 later
2301.04632 (2023-01)
Federated Learning under Heterogeneous and Correlated Client Availability
2305.01068 (2023-05)
Personalized Federated Learning under Mixture of Distributions
2310.05397 (2023-10)
Enhancing Clustered Federated Learning: Integration of Strategies and Improved Methodologies
get_vgg11 3 other papers
3 later
2301.04632 (2023-01)
Federated Learning under Heterogeneous and Correlated Client Availability
2305.01068 (2023-05)
Personalized Federated Learning under Mixture of Distributions
2310.05397 (2023-10)
Enhancing Clustered Federated Learning: Integration of Strategies and Improved Methodologies
cuda 2 other papers
1 dated earlier, 1 later
1612.00410 (2016-12)
Deep Variational Information Bottleneck
2402.03254 (2024-02)
Minimum Description Length and Generalization Guarantees for Representation Learning
args_to_string 1 other paper
1 later
2301.12379 (2023-01)
FedRC: Tackling Diverse Distribution Shifts Challenge in Federated Learning by Robust Clustering
where 1 other paper
1 later
2406.19298 (2024-06)
Compositional Image Decomposition with Diffusion Models

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

The increasing size of data generated by smartphones and IoT devices motivated the development of Federated Learning (FL), a framework for on-device collaborative training of machine learning models. First efforts in FL focused on learning a single global model with good average performance across clients, but the global model may be arbitrarily bad for a given client, due to the inherent heterogeneity of local data distributions. Federated multi-task learning (MTL) approaches can learn personalized models by formulating an opportune penalized optimization problem. The penalization term can capture complex relations among personalized models, but eschews clear statistical assumptions about local data distributions. In this work, we propose to study federated MTL under the flexible assumption that each local data distribution is a mixture of unknown underlying distributions. This assumption encompasses most of the existing personalized FL approaches and leads to federated EM-like algorithms for both client-server and fully decentralized settings. Moreover, it provides a principled way to serve personalized models to clients not seen at training time. The algorithms' convergence is analyzed through a novel federated surrogate optimization framework, which can be of general interest. Experimental results on FL benchmarks show that our approach provides models with higher accuracy and fairness than state-of-the-art methods.

For agents

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

get_harvested_code_for_paper("2108.10252")
get_code_for_paper("2108.10252")
have("2108.10252")

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

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

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

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

Connect an agent — have() is free.