<commit_before>import re
from PyQt5 import QtWidgets, QtCore
import peacock
import mooseutils
from plugins.ExodusPlugin import ExodusPlugin

class ExodusPluginManager(QtWidgets.QWidget, peacock.base.PluginManager):

    def __init__(self, plugins=[]):
        super(ExodusPluginManager, self).__init__(plugins=plugins, plugin_base=ExodusPlugin)

        # The layouts for this widget
        self.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        self.MainLayout = QtWidgets.QHBoxLayout()

        self.LeftScrollArea = QtWidgets.QScrollArea()
        self.LeftScrollArea.setWidgetResizable(True)
        #self.LeftScrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
        #self.LeftScrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.LeftScrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.LeftScrollContent = QtWidgets.QWidget()
        self.LeftScrollArea.setWidget(self.LeftScrollContent)
        self.LeftLayout = QtWidgets.QVBoxLayout()
        self.LeftScrollContent.setLayout(self.LeftLayout)
        margins = self.LeftLayout.contentsMargins()
        self.LeftLayout.setContentsMargins(0, 0, margins.right(), 0) # leave some room for the vertical scrollbar
        self.RightLayout = QtWidgets.QVBoxLayout()
        self.WindowLayout = QtWidgets.QHBoxLayout()

        self.setLayout(self.MainLayout)
        self.MainLayout.addWidget(self.LeftScrollArea)
        self.MainLayout.addLayout(self.RightLayout)
        self.RightLayout.addLayout(self.WindowLayout)
        self.setup()
        self.LeftLayout.addStretch(1)

        # Set the width of the left-side widgets to that the VTK window gets the space
        self.fixLayoutWidth('LeftLayout')
        self.LeftScrollContent.setFixedWidth(self.LeftLayout.sizeHint().width())
        self.LeftScrollArea.setFixedWidth(self.LeftScrollContent.width())

        if 'BlockPlugin' in self:
            self['BlockPlugin'].setCollapsed(True)
        if 'BackgroundPlugin' in self:
            self['BackgroundPlugin'].setCollapsed(True)
        if 'CameraPlugin' in self:
            self['CameraPlugin'].setCollapsed(True)

    def repr(self):
        """
        Build the python script.
        """

        # Compile output from the plugins
        output = dict()
        for plugin in self._plugins.itervalues():
            for key, value in plugin.repr().iteritems():
                if key in output:
                    output[key] += value
                else:
                    output[key] = value

        # Make import unique
        mooseutils.unique_list(output['imports'], output['imports'])
<commit_msg>Remove frame and wiggle from ExodusViewer side widgets.<commit_after>import re
from PyQt5 import QtWidgets, QtCore
import peacock
import mooseutils
from plugins.ExodusPlugin import ExodusPlugin

class ExodusPluginManager(QtWidgets.QWidget, peacock.base.PluginManager):

    def __init__(self, plugins=[]):
        super(ExodusPluginManager, self).__init__(plugins=plugins, plugin_base=ExodusPlugin)

        # The layouts for this widget
        self.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        self.MainLayout = QtWidgets.QHBoxLayout()

        self.LeftScrollArea = QtWidgets.QScrollArea()
        self.LeftScrollArea.setWidgetResizable(True)
        self.LeftScrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
        self.LeftScrollArea.setStyleSheet("QScrollArea { background: transparent; }");
        self.LeftScrollArea.viewport().setStyleSheet(".QWidget { background: transparent; }");
        self.LeftScrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.LeftScrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.LeftScrollContent = QtWidgets.QWidget()
        self.LeftScrollArea.setWidget(self.LeftScrollContent)
        self.LeftLayout = QtWidgets.QVBoxLayout()
        self.LeftScrollContent.setLayout(self.LeftLayout)
        self.LeftLayout.setContentsMargins(0, 0, 0, 0)
        self.RightLayout = QtWidgets.QVBoxLayout()
        self.WindowLayout = QtWidgets.QHBoxLayout()

        self.setLayout(self.MainLayout)
        self.MainLayout.addWidget(self.LeftScrollArea)
        self.MainLayout.addLayout(self.RightLayout)
        self.RightLayout.addLayout(self.WindowLayout)
        self.setup()
        self.LeftLayout.addStretch(1)

        # Set the width of the left-side widgets to that the VTK window gets the space
        self.fixLayoutWidth('LeftLayout')
        self.LeftScrollContent.setFixedWidth(self.LeftLayout.sizeHint().width())
        self.LeftScrollArea.setFixedWidth(self.LeftScrollContent.width() + 15) # This gets rid of the horizontal "wiggle"

        if 'BlockPlugin' in self:
            self['BlockPlugin'].setCollapsed(True)
        if 'BackgroundPlugin' in self:
            self['BackgroundPlugin'].setCollapsed(True)
        if 'CameraPlugin' in self:
            self['CameraPlugin'].setCollapsed(True)

    def repr(self):
        """
        Build the python script.
        """

        # Compile output from the plugins
        output = dict()
        for plugin in self._plugins.itervalues():
            for key, value in plugin.repr().iteritems():
                if key in output:
                    output[key] += value
                else:
                    output[key] = value

        # Make import unique
        mooseutils.unique_list(output['imports'], output['imports'])

{'fraction_non_alphanumeric': 0.094006194206595, 'fraction_numerical': 0.0023683731098560756, 'mean_word_length': 2.9696312364425164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7552240', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1526, 'n_words': 286}