def __init__(self, parent, cursor_description):
        context = parent.context
        dialect = context.dialect
        self.case_sensitive = dialect.case_sensitive
        self.matched_on_name = False
        self._orig_processors = None

        if context.result_column_struct:
            result_columns, cols_are_ordered, textual_ordered = \
                context.result_column_struct
            num_ctx_cols = len(result_columns)
        else:
            result_columns = cols_are_ordered = \
                num_ctx_cols = textual_ordered = False

        # merge cursor.description with the column info
        # present in the compiled structure, if any
        raw = self._merge_cursor_description(
            context, cursor_description, result_columns,
            num_ctx_cols, cols_are_ordered, textual_ordered)

        self._keymap = {}
        if not _baserowproxy_usecext:
            # keymap indexes by integer index: this is only used
            # in the pure Python BaseRowProxy.__getitem__
            # implementation to avoid an expensive
            # isinstance(key, util.int_types) in the most common
            # case path

            len_raw = len(raw)

            self._keymap.update([
                (elem[0], (elem[3], elem[4], elem[0]))
                for elem in raw
            ] + [
                (len_raw - elem[0], (elem[3], elem[4], elem[0]))
                for elem in raw
            ])

        # processors in key order for certain per-row
        # views like __iter__ and slices
        self._processors = [elem[3] for elem in raw]

        # keymap by primary string...
        by_key = dict([
            (elem[2], (elem[3], elem[4], elem[0]))
            for elem in raw
        ])

        # for compiled SQL constructs, copy additional lookup keys into
        # the key lookup map, such as Column objects, labels,
        # column keys and other names
        if num_ctx_cols:

            # if by-primary-string dictionary smaller (or bigger?!) than
            # number of columns, assume we have dupes, rewrite
            # dupe records with "None" for index which results in
            # ambiguous column exception when accessed.
            if len(by_key) != num_ctx_cols:
                seen = set()
                for rec in raw:
                    key = rec[1]
                    if key in seen:
                        # this is an "ambiguous" element, replacing
                        # the full record in the map
                        key = key.lower() if not self.case_sensitive else key
                        by_key[key] = (None, key, None)
                    seen.add(key)

                # copy secondary elements from compiled columns
                # into self._keymap, write in the potentially "ambiguous"
                # element
                self._keymap.update([
                    (obj_elem, by_key[elem[2]])
                    for elem in raw if elem[4]
                    for obj_elem in elem[4]
                ])

                # if we did a pure positional match, then reset the
                # original "expression element" back to the "unambiguous"
                # entry.  This is a new behavior in 1.1 which impacts
                # TextAsFrom but also straight compiled SQL constructs.
                if not self.matched_on_name:
                    self._keymap.update([
                        (elem[4][0], (elem[3], elem[4], elem[0]))
                        for elem in raw if elem[4]
                    ])
            else:
                # no dupes - copy secondary elements from compiled
                # columns into self._keymap
                self._keymap.update([
                    (obj_elem, (elem[3], elem[4], elem[0]))
                    for elem in raw if elem[4]
                    for obj_elem in elem[4]
                ])

        # update keymap with primary string names taking
        # precedence
        self._keymap.update(by_key)

        # update keymap with "translated" names (sqlite-only thing)
        if not num_ctx_cols and context._translate_colname:
            self._keymap.update([
                (elem[5], self._keymap[elem[2]])
                for elem in raw if elem[5]
            ])
dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/engine/result.py/ResultMetaData.__init__/swapped operands of `-`