def parse_values_in_lines(lines):
    """
    Parses the lines for 'A = B' lines and returns a dictionary, as well as the
    profile name
    """
    values = {}
    profile_name = None
    for line in lines:
        line = line.strip()
        if len(line) > 2 and line[0] == '[':
            profile_name = line[1:-1]
        try:
            key, val = line.split(' = ')
            values[key] = val
        except Exception:
            pass
    return profile_name, values