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 enum import Enum | |
from pydantic import BaseModel, Field | |
from typing import Union | |
# Artur: | |
{ | |
"boundary": "geojson", | |
"changedBy": "string", | |
"integrationId": "string" |
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
haystack = [1, 2, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6] | |
needle = [2, 1, 2] | |
def cut_substr_once(substr, string): | |
substr_size = len(substr) | |
for ind, _ in enumerate(string): | |
if substr == string[ind: ind + substr_size]: | |
return string[:ind], string[ind + substr_size:] |
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
{ | |
"type": "FeatureCollection", | |
"metadata": { | |
"name": "rent 2021", | |
"creator": "Yandex Map Constructor" | |
}, | |
"features": [ | |
{ | |
"type": "Feature", | |
"geometry": { |
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 os | |
import pathlib | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options as ChromeOptions | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.remote.webdriver import WebDriver | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.support.ui import WebDriverWait |
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
V 2 | |
[1. FACTORY DEMOLISHING SCENE] | |
As you might know, the Alpha team started | |
Demolishing the Workflow Worker Factory | |
The most significant part of the tiling department | |
has already been destroyed. | |
[2. TV SCENE] | |
Sounds scary, but the factory now consumes N times less energy and significantly decreased the amount of exhaust fumes. |
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
# diff -y <(gdalinfo alpha-48-manual-buffalo-preprocessed-data-2019-11-01-dem.scan.tms.float.assumed-2276-assumed.tif) <(gdalinfo alpha-48-manual-buffalo-preprocessed-data-2019-11-01-dem.scan.tms.float.assumed.tif) | |
Driver: GTiff/GeoTIFF Driver: GTiff/GeoTIFF | |
Files: alpha-48-manual-buffalo-preprocessed-data-2019-11-01-d | Files: alpha-48-manual-buffalo-preprocessed-data-2019-11-01-d | |
Size is 3355, 3692 Size is 3355, 3692 | |
Coordinate System is: Coordinate System is: | |
PROJCS["NAD83 / Texas North Central (ftUS)", | LOCAL_CS["unnamed", | |
GEOGCS["NAD83", | UNIT["foot",0.3048, | |
DATUM["North_American_Datum_1983", | AUTHORITY["EPSG","9002"]]] | |
SPHEROID["GRS 1980",6378137,298.257222101, | Origin = (2499916.634541186038405,7183205.565398516133428) | |
AUTHORITY["EPSG","7019"]], | Pixel Size = (0.300000011920929,-0.300000011920929) |
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
# coding: utf-8 | |
import cmath | |
import unittest | |
from itertools import chain | |
def eq_to_zero(x, eps=1e-7): | |
return abs(x) < eps | |
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
""" | |
$ dd if=/dev/urandom of=sample.txt bs=16M count=1 | |
$ python test.py | |
shared: | |
process 44666, memory 1M | |
process 44667, memory 1M | |
process 44668, memory 1M | |
total: 9M | |
separate: |
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
class Tuple(tuple): | |
def __setitem__(self, key, value): | |
print('tuple setitem', key, value) | |
super().__setitem__(key, value) | |
def __getitem__(self, item): | |
print('tuple getitem', item) | |
return super().__getitem__(item) | |
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 time | |
from itertools import zip_longest | |
import random | |
from multiprocessing import Process | |
def f(inflow_cache): | |
time.sleep(random.randint(2, 5)) | |
inflow_cache = list(filter(lambda t: t is not None, inflow_cache)) |
NewerOlder