Merge callable look-up tables from two objects.

def _merge_ex_dicts(sexdict, oexdict):
    """Merge callable look-up tables from two objects."""
    # pylint: disable=R0101
    for okey, ovalue in oexdict.items():
        # Keys in other dictionary are callable paths or
        # callables ids depending on the full_cname argument
        # of the handler
        if okey in sexdict:
            svalue = sexdict[okey]
            # Each callable dictionary entry is itself a dictionary where the
            # key is (exception type, exception message) and the value is a
            # dictionary with keys 'function' (a list of callable paths to
            # the function), 'raised' (list of booleans indicating whether the
            # exception though each callable path was raised or not) and name
            for fkey, fvalue in ovalue.items():
                if fkey not in svalue:
                    # The other dictionary has a callable path not present in
                    # the self dictionary, add it unmodified
                    sexdict[okey][fkey] = fvalue
                else:
                    # The other dictionary has a callable and exception
                    # present in the self dictionary, have to check whether
                    # the callable path is the same (in which case update
                    # raise flag) or not (in which case add to 'function' and
                    # 'raise' keys
                    iobj = zip(fvalue["function"], fvalue["raised"])
                    for func, raised in iobj:
                        if func not in sexdict[okey][fkey]["function"]:
                            sexdict[okey][fkey]["function"].append(func)
                            sexdict[okey][fkey]["raised"].append(raised)
                        else:
                            idx = sexdict[okey][fkey]["function"].index(func)
                            sraised = sexdict[okey][fkey]["raised"][idx]
                            if sraised or raised:
                                sexdict[okey][fkey]["raised"][idx] = True
        else:
            sexdict[okey] = ovalue