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 asyncio | |
import functools | |
import logging | |
import os | |
import threading | |
import socket | |
import http.server | |
from typing import Dict, Any, Optional | |
# Third Party |
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 requests | |
import shutil | |
def download_manual(): | |
# three digit page number | |
code = 'aa99bbcc-110b-999a-9a11-bb99b9aa1d99' # example, will not work | |
url = "https://webcat.lex-com.net/AudiBordbuch/docs/{code}/files/assets/common/page-html5-substrates/page0{page_num:03d}_4.jpg?uni=c91d23879402ccf1e95bc4acbec392e4" | |
# low rez |
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 requests | |
import netCDF4 | |
import gzip | |
import tempfile | |
import traceback | |
import os.path | |
import glob | |
def test_cdf_bytes(cdf_compressed_bytes: bytes): |
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 googleapiclient import discovery | |
import httplib2 | |
from oauth2client.service_account import ServiceAccountCredentials | |
calendar_id = 'user@host.com' | |
resource_calendar_id = 'resourceUser@resource.calendar.google.com' | |
def get_delegated_endpoint(base_creds: ServiceAccountCredentials, user_email: str): | |
creds = base_creds.create_delegated(user_email) | |
http = httplib2.Http(timeout=15) |
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
#!/usr/bin/env python3 | |
import botocore.exceptions | |
import botocore.session | |
import tracemalloc | |
import aiobotocore.session | |
import gc | |
import os | |
import time | |
import sys | |
import asyncio |
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 asynctest | |
import asyncio | |
import logging | |
from collections import deque | |
class RateLimiter: | |
class Error(Exception): | |
pass |
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 asyncio | |
import argparse | |
import logging | |
import functools | |
# Third Party | |
from google.oauth2 import service_account | |
from google.oauth2 import _client | |
from google.auth import transport | |
from google.auth.transport import requests as gauth_requests |
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 argparse | |
from collections import defaultdict | |
from datetime import datetime, timedelta | |
import sys | |
import os | |
import logging | |
from google.cloud import datastore | |
from google.appengine.ext import ndb |
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 asyncio | |
async def generator_fn(): | |
print(f" enter generator {id(asyncio.Task.current_task())}") | |
try: | |
while True: | |
yield | |
except: |
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 asyncio | |
import logging | |
from typing import List | |
def _ignore_task_exception(task: asyncio.Future, logger: logging.Logger): | |
# noinspection PyBroadException | |
try: | |
task.result() | |
except BaseException: |