import re


def extract_debt_annotations(content, debt_annotation='@debt'):
    """
    Extract debt annotations in a dictionnary containing
    raw annotation and the line

    :param content:
    :param debt_annotation:
    :return:
    """


    pattern = r'{}\(?([\'|\"\w+:?\s+\w+\'\"]*)\)?'.format(debt_annotation)

    matches = []
    for i_line, line in enumerate(content.split('\n')):

        match = re.findall(pattern, line)

        if len(match) > 0:
            matches.append({'annotation': match[0], 'line': i_line})

    return matches