This file contains 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
""" | |
Скрипт парсит coverage output юнит тестов Mad и собирает единую метрику покрытия | |
""" | |
import itertools | |
import typing | |
from argparse import ArgumentParser | |
import sys | |
import re |
This file contains 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
Есть таблица следующего вида: | |
CREATE TABLE track_downloads ( | |
download_id BIGINT(20) NOT NULL AUTO_INCREMENT, | |
track_id INT NOT NULL, | |
user_id BIGINT(20) NOT NULL, | |
download_time TIMESTAMP NOT NULL DEFAULT 0, | |
PRIMARY KEY (download_id) | |
); |
This file contains 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
document_message { | |
url: "https://mmg.whatsapp.net/d/f/AjY52l7JBH1hemAIIwgke3RIzbfkeyfazcMuE_tXH-Tl.enc" | |
mimeType: "application/pdf" | |
title: "AlfaFuture \320\261\320\270\320\273\320\265\321\202" | |
file_sha256: "\006N\307z5D\362\234\260\215\265D\210\252\233JS\211\007;\023\320_\2027$\250fw\263\307\312" | |
file_length: 309189 | |
page_count: 1 | |
media_key: "k%z\231\222\241K\335\350v\246Y\234Ru\030\373@9\373\270\303\222\2513\313_\303*\035zi" | |
jpeg_thumbnail: "\377\330\377\340\000\020JFIF\000\001\001\000\000H\000H\000\000\377\341\000XExi |
This file contains 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 abc | |
class Abstract(object): | |
@abc.abstractmethod | |
def abstract(): | |
pass | |
class TrueAbstract(object): | |
__metaclass__ = abc.ABCMeta |
This file contains 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 abc | |
class Abstract(object): | |
@abc.abstractmethod | |
def abstract(): | |
pass | |
class TrueAbstract(object): | |
__metaclass__ = abc.ABCMeta |
This file contains 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
logging.getLogger("root").info("%s", obj) | |
logging.getLogger("root").info("%s"%obj) | |
logging.getLogger("root").info("{}".format(obj)) |
This file contains 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
Предположим вы парсите сайт кинопоиска и получаете набор фильмов: | |
cinema = { | |
title: <string> | |
rate: <integer> | |
description: <string> | |
} | |
Считайте title уникальным для простоты. | |
title неизменный, rate и description могут меняться |
This file contains 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
users | |
{ | |
name: { | |
first: <string> | |
middle: <string> | |
last: <string> | |
} | |
email: <string> | |
watched_movies: [ #просмотренные фильмы | |
{ |
This file contains 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 __future__ import division | |
import webdav.client as wc | |
import time | |
options = { | |
'webdav_hostname': "https://webdav.yandex.ru", | |
'webdav_login': "s.kaledin@coin32.com", | |
'webdav_password': "*******" | |
} |
This file contains 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
Test Cases for knapsack problem | |
Output is total value of solution | |
Data format: | |
[knapsack size] [count items] | |
[item1 value] [item1 weight] | |
... | |
[item-n value] [item-n weight] | |
Case 1 | |
Output: 13 |
NewerOlder