def METHOD_NAME(name):
    """
    Matches a single line of the form (some space)name = (some value). e.g.
    "  foo = 1".
    The whole line up to the assigned value is the first matching group,
    the rest of the line is the second matching group.
    i.e. group 1 is the assignment, group 2 is the value. In the above
    example group 1 would be "  foo = " and group 2 would be "1"
    """
    return re.compile(rf"\A(\s*{re.escape(name)}\s*=\s*)(.+)\Z")