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 timeit | |
import tulip | |
loop = tulip.get_event_loop() | |
def async_func(value): | |
p = tulip.Future() |
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 timeit | |
import tornloop | |
import tulip | |
loop = tornloop.TornadoLoop() | |
tulip.set_event_loop(loop) | |
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 re | |
import tulip | |
import tulipiostream | |
loop = tulip.get_event_loop() | |
LENGTH_PATTERN = re.compile(b'Content-Length: (\d*)\\r\\n') |
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 sqlalchemy import create_engine, event | |
from sqlalchemy.orm import sessionmaker | |
import model | |
if sys.version_info >= (2, 7): | |
import unittest as unittest2 |
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
DEBUG:tulip:Using selector: SelectSelector | |
DEBUG:tulip:poll0.000 took 0.000 seconds | |
DEBUG:tulip:poll0.010 took 0.016 seconds | |
DEBUG:tulip:poll0.000 took 0.000 seconds | |
DEBUG:tulip:poll0.010 took 0.015 seconds | |
DEBUG:tulip:poll0.000 took 0.000 seconds | |
DEBUG:tulip:poll0.010 took 0.000 seconds | |
DEBUG:tulip:poll0.010 took 0.016 seconds | |
DEBUG:tulip:poll0.000 took 0.000 seconds | |
DEBUG:tulip:poll0.010 took 0.015 seconds |
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 sqlalchemy import create_engine, event, Column, Integer | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.sql import func, select | |
Base = declarative_base() | |
class Job(Base): | |
__tablename__ = 'job' |
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 logging | |
import multiprocessing | |
import time | |
import mplog | |
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s' | |
logging.basicConfig(level=logging.DEBUG, format=FORMAT) | |
existing_logger = logging.getLogger('x') |
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 print_function | |
import ctypes | |
from ctypes import wintypes | |
GetCurrentProcess = ctypes.windll.kernel32.GetCurrentProcess | |
GetCurrentProcess.restype = wintypes.HANDLE | |
OpenProcessToken = ctypes.windll.advapi32.OpenProcessToken | |
OpenProcessToken.argtypes = (wintypes.HANDLE, wintypes.DWORD, ctypes.POINTER(wintypes.HANDLE)) | |
OpenProcessToken.restype = wintypes.BOOL |
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 ctypes | |
from ctypes import POINTER | |
from ctypes.wintypes import HANDLE, LPVOID, WORD, DWORD, BOOL | |
LPSTR = ctypes.c_char_p | |
LPBYTE = LPSTR | |
LPHANDLE = POINTER(HANDLE) | |
LPDWORD = POINTER(DWORD) |
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 webbrowser | |
from dropbox import client | |
APP_KEY = '' | |
APP_SECRET = '' | |
def authorize(): |