import re


def get_tagged_functions_in_file(filename):
    """Given a filename, return a set of the target function names tagged with
    @coverage in that file."""
    token_regex = r"^.*@coverage(( (\w+))+).*$"
    token_pattern = re.compile(token_regex, re.IGNORECASE)

    cov_functions = set()

    line = ""
    with open(filename, "r") as f:
        while True:
            line = f.readline()
            if not line:
                break
            match = re.match(token_pattern, line)
            if match:
                loc = match.group(1).strip().split()
                for i in loc:
                    cov_functions.add(i)
    return cov_functions