@staticmethod
    def filter_args(loop_args):
        """Given a sequence of tuples of ``Args``, where each tuple comes from a
        different loop, create a sequence of ``Args`` where there are no duplicates
        and access modes are properly set (for example, an ``Arg`` whose ``Dat``
        appears in two different tuples with access mode ``WRITE`` and ``READ``,
        respectively, will have access mode ``RW`` in the returned sequence of
        ``Args``."""
        filtered_args = OrderedDict()
        for args in loop_args:
            for a in args:
                filtered_args[a.data] = filtered_args.get(a.data, a)
                if a.access != filtered_args[a.data].access:
                    if READ in [a.access, filtered_args[a.data].access]:
                        # If a READ and some sort of write (MIN, MAX, RW, WRITE,
                        # INC), then the access mode becomes RW
                        filtered_args[a.data]._access = RW
                    elif [a.access, filtered_args[a.data].access] in WRITE:
                        # Can't be a READ, so just stick to WRITE regardless of what
                        # the other access mode is
                        filtered_args[a.data]._access = WRITE
                    else:
                        # Neither READ nor WRITE, so access modes are some
                        # combinations of RW, INC, MIN, MAX. For simplicity,
                        # just make it RW.
                        filtered_args[a.data]._access = RW
        return filtered_args
dataset/ETHPy150Open OP2/PyOP2/pyop2/fusion.py/Arg.filter_args/swapped operands of `in`