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
if int(os.environ['TWISTED_NEWSTYLE']): | |
__metaclass__ = type | |
else: | |
from types import ClassType as __metaclass__ | |
class Deferred(_class_style): | |
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
if int(os.environ['TWISTED_NEWSTYLE']): | |
_class_style = object | |
else: | |
class _class_style: | |
pass | |
class Deferred(_class_style): | |
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
use std::thread; | |
use std::sync::Arc; | |
fn main() { | |
let pass = Arc::new("test".to_string()); | |
thread::spawn({let pass = pass.clone(); move || println!("{}", pass)}); | |
thread::spawn(move || println!("{}", 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
from __future__ import print_function | |
from twisted.internet.defer import Deferred | |
def make_request(): | |
global resolver | |
print("making request") | |
resolver = Deferred() | |
return resolver |
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
StreamServerEndpointService( | |
serverFromString(reactor, os.environ.get("PORT", "tcp:8080")), | |
server.Site( | |
wsgi.WSGIResource( | |
reactor, | |
reactor.getThreadPool(), | |
WSGIApplication(gh_client, repo), | |
) | |
) | |
).setServiceParent(multi) |
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
def poll_work(): | |
d = sqs.get_messages() | |
d.addCallback(process_messages) | |
d.addCallback(lambda _: poll_work()) |
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 hypothesis.strategies import * | |
def subset_strat(strategies): | |
def build(keys): | |
return fixed_dictionaries({key: strategies[key] for key in keys}) | |
return sets(sampled_from(strategies.keys())).flatmap(build) | |
if __name__ == "__main__": | |
print(subset_strat({"abc": integers(), "def": text()}).example()) |
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
eliot.tests.test_journald | |
JournaldDestinationTests | |
test_action_type ... [OK] | |
test_critical_priority ... [OK] | |
test_error_priority ... [FAIL] | |
test_identifier ... [FAIL] | |
test_info_priorities ... [FAIL] | |
test_json ... [FAIL] | |
test_message_type ... [FAIL] | |
test_no_type ... [FAIL] |
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 Request(object): | |
"Description of an HTTP request." | |
def engined(f): | |
"Turn an effect using function into one that uses a specific performer." | |
@wraps(f) | |
def wrapper(*args, **kwargs, engine=blocking_engine): | |
effect = f(*args, **kwargs) | |
result = engine(effect) |
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
DEPRECATION: --download-cache has been deprecated and will be removed in the future. Pip now automatically uses and configures its cache. | |
Collecting pytest | |
Getting page https://pypi.python.org/simple/pytest/ | |
1 location(s) to search for versions of pytest: | |
* https://pypi.python.org/simple/pytest/ | |
Skipping link file:///home/tomprince/.cache/pip/wheelhouse (from -f); not a file | |
Getting page https://pypi.python.org/simple/pytest/ | |
Analyzing links from page https://pypi.python.org/simple/pytest/ | |
Found link https://pypi.python.org/packages/source/p/pytest/pytest-2.0.0.zip#md5=f07c521dfd5a540f3dfea1846e58dab7 (from https://pypi.python.org/simple/pytest/), version: 2.0.0 | |
Found link https://pypi.python.org/packages/source/p/pytest/pytest-2.0.1.zip#md5=0667d82556db906a7429171589d95e4d (from https://pypi.python.org/simple/pytest/), version: 2.0.1 |