def is_valid_user(self, username, password):
        stmt = """
                SELECT
                    password
                FROM
                    papercut_groups_auth
                WHERE
                    username='%s'
                """ % (username)
        num_rows = self.cursor.execute(stmt)
        if num_rows == 0 or num_rows is None:
            settings.logEvent('Error - Authentication failed for username \'%s\' (user not found)' % (username))
            return 0
        db_password = self.cursor.fetchone()[0]
        if db_password != password:
            settings.logEvent('Error - Authentication failed for username \'%s\' (incorrect password)' % (username))
            return 0
        else:
            return 1
dataset/ETHPy150Open jpm/papercut/auth/mysql.py/Papercut_Auth.is_valid_user/original