def annotate(title, format_type, message=None, data=None, metric=1.0):
    """
    Annotate a test case with info that should be displayed in the reports.

    Parameters
    ----------
    title : str
        A human-readable descriptive title of the test case.
    format_type : str
        A string that determines how the result data is formatted in the
        report. It is expected not to be None.

        * 'number' : 'data' is a single number which can be an integer or
          float and should be represented as such.
        * 'count' : 'data' is a list, set or tuple. Choosing 'count' will
          display the length of that list e.g. number of metabolites without
          formula.
        * 'percent' : Instead of 'data' the content of 'metric' ought to be
          displayed e.g. percentage of metabolites without charge.
          'metric' is expected to be a floating point number.
        * 'raw' : 'data' is ought to be displayed "as is" without formatting.
          This option is appropriate for single strings or a boolean output.

    message : str
        A short written explanation that states and possibly explains the test
        result.
    data
        Raw data which the test case generates and assesses. Can be of the
        following types: list, set, tuple, string, float, integer, and boolean.
    metric: float
        A value x in the range of 0 <= x <= 1 which represents the fraction of
        'data' to the total in the model. For example, if 'data' are all
        metabolites without formula, 'metric' should be the fraction of
        metabolites without formula from the total of metabolites in the model.

    Returns
    -------
    function
        The decorated function, now extended by the attribute 'annotation'.

    Notes
    -----
    Adds "annotation" attribute to the function object, which stores values for
    predefined keys as a dictionary.

    """
    if format_type not in TYPES:
        raise ValueError(
            "Invalid type. Expected one of: {}.".format(", ".join(TYPES)))

    def decorator(func):
        func.annotation = dict(
            title=title,
            summary=extended_summary(func),
            message=message,
            data=data,
            format_type=format_type,
            metric=metric)
        return func
    return decorator