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 itertools | |
async def repeat(value, *, offset, interval, count=None): | |
await asyncio.sleep(offset) | |
for i in (range(count) if count else itertools.cycle([None])): | |
yield value | |
await asyncio.sleep(interval) |
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 inspect | |
import asyncio | |
from async_generator import asynccontextmanager | |
class Response: | |
def __init__(self, body): | |
self._body = body | |
async def body(self): | |
return self._body |
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 sys | |
from functools import partial | |
from typing import Tuple | |
from docopt import DocoptExit, docopt | |
class GatewayConfigClient: | |
def configuration_get(self, destination: int, net_index: int): | |
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
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "gsmat.h" | |
#include "log.h" | |
#include "utils.h" | |
/* | |
* This a parser for Hayes command set used to talk with GSM modem. |
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 collections import defaultdict | |
from dataclasses import dataclass, field | |
import pytest | |
from _pytest.mark import Mark, ParameterSet | |
from _pytest.python import Metafunc | |
@dataclass | |
class Metafunc: |
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 pytest | |
from typing import NamedTuple | |
class FixtureConfig: | |
FIXTURE = None | |
@classmethod | |
def from_request(cls, request): | |
kwargs = {} |
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 pytest | |
from typing import NamedTuple | |
class SomeFixture(NamedTuple): | |
first_option: bool = False | |
second_option: bool = True | |
@pytest.fixture |
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 | |
def igather(*awaitables, loop=None, timeout=None): | |
loop = loop or asyncio.get_event_loop() | |
queue = asyncio.Queue() | |
cancelled = False | |
remaining = set(map(asyncio.ensure_future, awaitables)) |
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 contextlib | |
import functools | |
import json | |
from concurrent.futures import CancelledError | |
from datetime import datetime | |
import aiohttp | |
import pytest |
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
#!python3 | |
import signal | |
from contextlib import suppress | |
from concurrent.futures import ThreadPoolExecutor | |
from gi.repository import GLib | |
from prompt_toolkit import prompt | |
from prompt_toolkit.eventloop.defaults import get_event_loop, set_event_loop |
NewerOlder