def METHOD_NAME(contents, name):
    lines = contents.split("\n")
    matcher = assignment_matcher(name)
    for l in lines:
        match = matcher.match(l)
        if match is not None:
            return match[2].strip()
    raise ValueError(f"Key {name} not found in {contents}")