def read_named_ranges(xml_source, workbook):
    """Read named ranges, excluding poorly defined ranges."""
    named_ranges = []
    root = fromstring(xml_source)
    names_root = root.find(QName('http://schemas.openxmlformats.org/spreadsheetml/2006/main',
            'definedNames').text)
    if names_root is not None:

        for name_node in names_root.getchildren():
            range_name = name_node.get('name')

            if name_node.get("hidden", '0') == '1':
                continue

            valid = True

            for discarded_range in DISCARDED_RANGES:
                if range_name in discarded_range:
                    valid = False

            for bad_range in BUGGY_NAMED_RANGES:
                if bad_range in name_node.text:
                    valid = False

            if valid:
                destinations = split_named_range(name_node.text)

                new_destinations = []
                for worksheet, cells_range in destinations:

                    # it can happen that a valid named range references
                    # a missing worksheet, when Excel didn't properly maintain
                    # the named range list
                    #
                    # we just ignore them here
                    worksheet = workbook.get_sheet_by_name(worksheet)
                    if worksheet:
                        new_destinations.append((worksheet, cells_range))

                named_range = NamedRange(range_name, new_destinations)
                named_ranges.append(named_range)

    return named_ranges
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/reader/workbook.py/read_named_ranges/swapped operands of `in`