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
| from ctypes import * | |
| from ctypes.wintypes import (HANDLE, ULONG, DWORD, BOOL, LPCSTR, LPCWSTR, WORD, | |
| USHORT) | |
| import msvcrt | |
| import platform | |
| import sys | |
| #------------------------------------------------------------------------------ | |
| # WinSock2 definitions | |
| #------------------------------------------------------------------------------ |
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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
| plugins { | |
| java | |
| kotlin("jvm") version "1.3.61" | |
| kotlin("kapt") version "1.3.61" | |
| } | |
| version = "0.1-SNAPSHOT" |
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
| '''Example of a custom ReST directive in Python docutils''' | |
| import docutils.core | |
| from docutils.nodes import TextElement, Inline | |
| from docutils.parsers.rst import Directive, directives | |
| from docutils.writers.html4css1 import Writer, HTMLTranslator | |
| class foo(Inline, TextElement): | |
| '''This node class is a no-op -- just a fun way to define some parameters. | |
| There are lots of base classes to choose from in `docutils.nodes`. |
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 datetime | |
| import logging | |
| import random | |
| import sys | |
| import time | |
| # Deal with minor differences between PySide2 and PyQt5 | |
| try: | |
| from PySide2 import QtCore, QtGui, QtWidgets | |
| Signal = QtCore.Signal |
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
| # 05_aiohttp.py | |
| from aiohttp import web | |
| from aiohttp.web_log import AccessLogger | |
| from asyncio import CancelledError | |
| from contextvars import ContextVar | |
| import asyncio | |
| import logging | |
| import secrets |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| use std::io::{BufRead}; | |
| struct Processor<B: BufRead> { | |
| reader: B | |
| } | |
| // If you uncomment p in ValidatorA, compilation fails because the size of | |
| // ValidatorA can't be determined at compile time. Fair enough. | |
| struct ValidatorA { | |
| // p : Processor<BufRead> |
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
| use std::io::{self,BufRead,BufReader}; | |
| enum Utf8DecoderError<'a> { | |
| InvalidBytes(&'a [u8]), | |
| Io(io::Error), | |
| } | |
| struct Utf8Decoder<B: BufRead> { | |
| reader : B, | |
| bytes_read: usize |
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 argparse | |
| import importlib | |
| import logging | |
| import os | |
| import sys | |
| def main(args=None): | |
| scriptname = os.path.basename(__file__) | |
| parser = argparse.ArgumentParser(scriptname) | |
| levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL') |
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 os | |
| import re | |
| import string | |
| import sys | |
| _sfmt = string.Formatter() | |
| FIELD_SPEC = re.compile(r'^(\d+|\w+)(\.\w+|\[[^]]+\])*$') | |
| FMT_SPEC = re.compile(r'^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$') |