<commit_before># -*- coding: utf-8 -*-
"""
Created on Sat Apr 15 00:15:10 2017

@author: matthias
"""


## kann nur mit python3 geöffnet werden, nicht mit python.
import numpy as np
import matplotlib.pyplot as plt
import sys
import PyQt5
from PyQt5.QtWidgets import QWidget, QCheckBox, QApplication, QPushButton, QHBoxLayout, QVBoxLayout, QLabel

from PyQt5.QtCore import Qt


class Step(QWidget):
    def __init__(self):
        QWidget.__init__(self)
        self.initUI()

    def initUI(self):
        pass
       
class Loop(QWidget):      
    def __init__(self):
        QWidget.__init__(self)
        self.number=0
        self.Steps=[]
        self.initUI()
        
    def initUI(self):
	
        self.MainHBox=QHBoxLayout(self)
        self.NumberLabel=QLabel('  ')
        self.MainHBox.addWidget(self.NumberLabel)
        self.StepBox=QVBoxLayout()
        self.StepBox.setSpacing(0)
        self.MainHBox.addLayout(self.StepBox)
        self.addStep()
        self.StepBox.addStretch()
        
        self.setWindowTitle('Loop')
        self.show()

    def addStep(self):
        newStep=Step(self)
        self.StepBox.addWidget(newStep)
        self.Steps.append(newStep)

    def insertStep(self,number):
        newStep=Step(self)
        self.StepBox.insertWidget(number,newStep)
        self.Steps.insert(number,newStep)
        self.numerateSteps()

    def insertLoop(self,number):
        ILoop=LoopStep(self)
        self.StepBox.insertWidget(number,ILoop)
        self.Steps.insert(number,ILoop)
        self.numerateSteps()

    def numerateSteps(self):
        for i in range(len(self.Steps)):
            self.Steps[i].number=i+1
            self.Steps[i].NumberLabel.setText(str(i+1))

    def removeWidget(self,Widget):
        if len(self.Steps)>1:
            self.StepBox.removeWidget(Widget)
            Widget.hide()
            self.Steps.remove(Widget)
            del Widget
            self.numerateSteps()
        else:
            pass


class Step(QWidget):
    def __init__(self, root):
        QWidget.__init__(self)
        self.root=root
        self.number=0
        self.HBox=QHBoxLayout(self)

        self.NumberLabel=QLabel(str(len(root.Steps)+1))

        self.StepLabel=QLabel('||kind of Step                                                   Step Body||')

        self.AddStepButton=QPushButton('+')
        self.AddStepButton.clicked.connect(self.insertStep)

        self.AddLoopButton=QPushButton('add Loop')
        self.AddLoopButton.clicked.connect(self.insertLoop)<commit_msg>Steps wird kleiner, wenn man schritte entfernt<commit_after># -*- coding: utf-8 -*-
"""
Created on Sat Apr 15 00:15:10 2017

@author: matthias
"""


## kann nur mit python3 geöffnet werden, nicht mit python.
import numpy as np
import matplotlib.pyplot as plt
import sys
import PyQt5
from PyQt5.QtWidgets import QWidget, QCheckBox, QApplication, QPushButton, QHBoxLayout, QVBoxLayout, QLabel

from PyQt5.QtCore import Qt


class Step(QWidget):
    def __init__(self):
        QWidget.__init__(self)
        self.initUI()

    def initUI(self):
        pass
       
class Loop(QWidget):      
    def __init__(self):
        QWidget.__init__(self)
        self.number=0
        self.Steps=[]
        self.initUI()
        
    def initUI(self):
	
        self.MainHBox=QHBoxLayout(self)
        self.NumberLabel=QLabel('  ')
        self.MainHBox.addWidget(self.NumberLabel)
        self.StepBox=QVBoxLayout()
        self.StepBox.setSpacing(0)
        self.MainHBox.addLayout(self.StepBox)
        self.addStep()
        self.StepBox.addStretch()
        
        self.setWindowTitle('Loop')
        self.show()

    def addStep(self):
        newStep=Step(self)
        self.StepBox.addWidget(newStep)
        self.Steps.append(newStep)

    def insertStep(self,number):
        newStep=Step(self)
        self.StepBox.insertWidget(number,newStep)
        self.Steps.insert(number,newStep)
        self.numerateSteps()

    def insertLoop(self,number):
        ILoop=LoopStep(self)
        self.StepBox.insertWidget(number,ILoop)
        self.Steps.insert(number,ILoop)
        self.numerateSteps()

    def numerateSteps(self):
        for i in range(len(self.Steps)):
            self.Steps[i].number=i+1
            self.Steps[i].NumberLabel.setText(str(i+1))

    def removeWidget(self,Widget):
        if len(self.Steps)>1:
            self.StepBox.removeWidget(Widget)
            Widget.hide()
            self.Steps.remove(Widget)
            del Widget
            self.numerateSteps()
            self.adjustSize()
        else:
            pass


class Step(QWidget):
    def __init__(self, root):
        QWidget.__init__(self)
        self.root=root
        self.number=0
        self.HBox=QHBoxLayout(self)

        self.NumberLabel=QLabel(str(len(root.Steps)+1))

        self.StepLabel=QLabel('||kind of Step                                                   Step Body||')

        self.AddStepButton=QPushButton('+')
        self.AddStepButton.clicked.connect(self.insertStep)

        self.AddLoopButton=QPushButton('add Loop')
        self.AddLoopButton.clicked.connect(self.insertLoop)
{'fraction_non_alphanumeric': 0.10957839518165922, 'fraction_numerical': 0.00932582086652419, 'mean_word_length': 2.2561669829222013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '688950', 'n_tokens_mistral': 1665, 'n_tokens_neox': 1614, 'n_words': 272}