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
def __case_6(self, node): | |
""" | |
Для кейса 6 нужно: | |
БРО должен быть ЧЕРНЫМ | |
ВЫХОДЯЩАЯ НОДА должна быть КРАСНОЙ | |
Затем, выполняется правая/левая ротация на бро | |
Ниже пример, когда направлеие бро - ЛЕВОЕ | |
Удвоенный черный | |
__50B__ | __35B__ |
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
if (parent is None # чёч? откуда она None вообще? в теории, не должно быть такого, но на всякий пожарный | |
or parent.parent is None # предок является корнем дерева | |
or (node.color != RED or parent.color != RED)): # нет нужды ребалансировать | |
return |
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
EXPLAIN PLAN FOR | |
SELECT NAME, sum(salary) | |
FROM HR.S_EMP e, HR.S_DEPT d | |
WHERE d.ID = e.DEPT_ID | |
GROUP BY NAME; | |
SELECT | |
OPERATION, | |
OBJECT_OWNER, | |
OBJECT_NAME, |
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 urllib | |
from queue import Queue | |
from threading import Thread | |
from time import time | |
import lxml.html | |
import pandas as pd | |
from tqdm import tqdm | |
df = pd.read_csv('no_lyrics') |
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 Song(object): | |
def __init__(self, artist, title): | |
self.artist = self.__format_str(artist) | |
self.title = self.__format_str(title) | |
self.url = None | |
self.lyric = None | |
def __format_str(self, s): | |
# убираем пробельчики в начале |
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 asyncio | |
import json | |
from time import time, sleep | |
import aiohttp | |
import pandas as pd | |
from bs4 import BeautifulSoup | |
from tqdm import tqdm | |
# Ващет СИКРЕТНА!!!!! Но код хранится в private репозитории, так что пох |
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 asyncio | |
import json | |
from time import time, sleep | |
import aiohttp | |
import pandas as pd | |
from bs4 import BeautifulSoup | |
from tqdm import tqdm | |
# Ващет СИКРЕТНА!!!!! Но код хранится в private репозитории, так что пох |
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 networkx as nx | |
# библиотека для построения графиков | |
import matplotlib.pyplot as plt | |
# статические массивы | |
import numpy as np | |
# комбинаторика | |
from itertools import permutations | |
# константы для названия станций |
OlderNewer