Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A: | |
| def __init__(self): | |
| pass | |
| def make_sound(self): | |
| print("quack..quack..quack..quack..\n") # duck sound | |
| def make_sound_A(self): | |
| print("Yelp...Yelp...Yelp\n") # fox sound |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def print_formatted(_header, _items, padding=10, alignment="^"): | |
| """ | |
| Function to print header along with list of list in tabular format. | |
| :param alignment: ^ -center alignment; < -left alignment; > -right alignment | |
| :param _header: header strings for the table | |
| :param _items: list of list, representing collection of rows | |
| :param padding: padding count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from PyQt5 import QtCore | |
| class SymbolsProxy(QtCore.QSortFilterProxyModel): | |
| def __init__(self, df_symbol_exchange: 'pd.DataFrame', parent=None): | |
| super(SymbolsProxy, self).__init__(parent=parent) | |
| self.check_df = df_symbol_exchange | |
| self.exchange_filter = None | |
| self.symbols_filter: 'QtCore.QRegularExpression' =\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PyQt5.QtCore import Qt | |
| from PyQt5.QtGui import QBrush, QColor, QPalette | |
| from xml.etree import ElementTree | |
| def parse_xml(file_path) -> 'QPalette': | |
| def generate_brushes(brush_index): | |
| # required imports | |
| assert QColor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PyQt5 import QtCore, QtGui, QtWidgets | |
| import sys | |
| class QToaster(QtWidgets.QFrame): | |
| closed = QtCore.pyqtSignal() | |
| def __init__(self, *args, **kwargs): | |
| super(QToaster, self).__init__(*args, **kwargs) | |
| QtWidgets.QHBoxLayout(self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from PyQt5.QtCore import (QRectF, Qt, QPropertyAnimation, pyqtProperty, | |
| QPoint, QParallelAnimationGroup, QEasingCurve) | |
| from PyQt5.QtGui import QPainter, QPainterPath, QColor, QPen | |
| from PyQt5.QtWidgets import (QLabel, QWidget, QVBoxLayout, QApplication, | |
| QLineEdit, QPushButton) | |
| class BubbleLabel(QWidget): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import typing | |
| from functools import wraps | |
| def profiler(fn: typing.Callable): | |
| """to be used as a function decorator for monitoring execution time of a function""" | |
| @wraps(fn) | |
| def inner(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pprint | |
| from math import radians, sin, cos | |
| import numpy as np | |
| class Angle: | |
| """ | |
| class for interconversion of angle in degrees and radians | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string = "XSmPyeyHlTFjlvoIM.ZCuTlvrLkyVYjdJBqtdM SozWLxOrayj" | |
| # unscrambling start | |
| x = 0 | |
| result = "" | |
| while True: | |
| ch = string[x] | |
| if ch == '.': | |
| print(result[1:]) # print the result string omitting the first character | |
| break |