def extract_annotations(data):
    """ Extract annotations from stream XML. """
    annotations = {}

    if data.annotation:
        for line in data.annotation.string.split('\n'):
            if ':' not in line:
                continue
            key, value = line.split(':', 2)
            annotations[key] = value.strip()

    return annotations