def METHOD_NAME(items, negate=None):
    """Returns a callable object that fetches each item in `items` from its
    operand's `metrics` attribute, and returns a tuple containing the results.
    The tuple will have the same number for elements as `items`.
    For example:
     - After `f = metricgetter(("a",))`, the call `f(x)` returns `(x.metrics["a"],)`.
     - After `g = metricgetter((4, 9))`, the call `g(x)` returns `(x.metrics[4], x.metrics[9])`.
    If the metric is None (e.g. no scores so can't calculate stdev), use 0 instead to sort.
    """
    if negate is None:
        def metricitemgetter(x):
            return tuple(x.metrics[item] or 0 for item in items)
    else:
        assert len(items) == len(negate), "items had %d items but negate had %d" % (len(items), len(negate))
        coeffs = [-1 if neg else 1 for neg in negate]
        def metricitemgetter(x):
            return tuple(coeff * (x.metrics[item] or 0) for (coeff, item) in zip(coeffs, items))
    return metricitemgetter