in src/smclarify/bias/metrics/registry.py [0:0]
def __register(metrics, function):
if not isinstance(function, types.FunctionType):
raise TypeError("{} is not a function".format(function))
assert not any(x == function.__name__ for x in all_metrics()), "{} is already registered".format(function.__name__)
# assign first line of docstring as description
if not function.__doc__:
raise ValueError("Metric function doesn't have a docstring")
metrics.append(function)