<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright:
    Mazama Science
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)
"""

from __future__ import (absolute_import, division, print_function)

# Basic packages
import sys
import logging

# For debugging, raise an exception on attempted chained assignment
# See http://pandas.pydata.org/pandas-docs/version/0.19.1/indexing.html#returning-a-view-versus-a-copy
import pandas as pd
pd.set_option('mode.chained_assignment', 'raise')

# Configure PyQt4 -- in order for the Python console to work, we need to load a particular
# version of some internal libraries. This must be done before the first import of the PyQt4 libraries.
# See http://stackoverflow.com/questions/11513132/embedding-ipython-qt-console-in-a-pyqt-application/20610786#20610786
import os
os.environ['QT_API'] = 'pyqt'
import sip
sip.setapi("QString", 2)
sip.setapi("QVariant", 2)
from PyQt4 import QtCore
from PyQt4 import QtGui

# Pyweed UI components
from gui.MainWindow import MainWindow
from preferences import Preferences


__appName__ = "PYWEED"
__version__ = "0.1.0"


LOGGER = logging.getLogger(__name__)


class NoConsoleLoggingFilter(logging.Filter):
    def filter(self, record):
        return not record.name.startswith('ipykernel')


class PyWEED(object):

    def __init__(self, app):<commit_msg>Manually set the matplotlib backend, this appears to fix a problem with threading and macosx plot generation. #40<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright:
    Mazama Science
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)
"""

from __future__ import (absolute_import, division, print_function)

# Basic packages
import sys
import logging

# For debugging, raise an exception on attempted chained assignment
# See http://pandas.pydata.org/pandas-docs/version/0.19.1/indexing.html#returning-a-view-versus-a-copy
import pandas as pd
pd.set_option('mode.chained_assignment', 'raise')

# Configure PyQt4 -- in order for the Python console to work, we need to load a particular
# version of some internal libraries. This must be done before the first import of the PyQt4 libraries.
# See http://stackoverflow.com/questions/11513132/embedding-ipython-qt-console-in-a-pyqt-application/20610786#20610786
import os
os.environ['QT_API'] = 'pyqt'
import sip
sip.setapi("QString", 2)
sip.setapi("QVariant", 2)
from PyQt4 import QtCore
from PyQt4 import QtGui

# Configure matplotlib backend
import matplotlib
matplotlib.use('AGG')

# Pyweed UI components
from gui.MainWindow import MainWindow
from preferences import Preferences


__appName__ = "PYWEED"
__version__ = "0.1.0"


LOGGER = logging.getLogger(__name__)


class NoConsoleLoggingFilter(logging.Filter):
    def filter(self, record):
        return not record.name.startswith('ipykernel')


class PyWEED(object):

    def __init__(self, app):
{'fraction_non_alphanumeric': 0.10549229738780978, 'fraction_numerical': 0.02679169457468185, 'mean_word_length': 4.700381679389313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '618063', 'n_tokens_mistral': 1012, 'n_tokens_neox': 952, 'n_words': 278}