def compat_open(filename, mode='r', encoding=None):
        """Back-port open() that accepts an encoding argument.

        In python3 this uses the built in open() and in python2 this
        uses the io.open() function.

        If the file is not being opened in binary mode, then we'll
        use locale.getpreferredencoding() to find the preferred
        encoding.

        """
        if mode not in 'b':
            encoding = locale.getpreferredencoding()
        return open(filename, mode, encoding=encoding)
dataset/ETHPy150Open aws/aws-cli/awscli/compat.py/compat_open/swapped operands of `not in`