From June 26, 2016 (python 3.5.2 release) to Aug. 31, 2016.
Python versions from 2.6 to 3.5
Without 2.7
| def optional_arg_decorator(fn): | |
| """ | |
| wrap a decorator so that it can optionally take args/kwargs | |
| when decorating a func | |
| """ | |
| # http://stackoverflow.com/a/32292739/2156113 | |
| @wraps(fn) | |
| def wrapped_decorator(*args, **kwargs): | |
| is_bound_method = args and hasattr(args[0], fn.__name__) |
| #!/usr/bin/env python3 | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # Version π, September 2017 | |
| # | |
| # Everyone is permitted to copy and distribute verbatim or modified | |
| # copies of this license document. | |
| # | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
| include meta.mk | |
| include concrete.mk | |
| CODE_TARGETS = postgresql-9.5.3 \ | |
| nginx-1.11.1 \ | |
| node-v6.2.1 | |
| $(foreach x,$(CODE_TARGETS),$(eval $(call META_TARGET,build/$x,.build-artefacts/$x,code/$x))) | |
| BASE_PYTHON = 3.6.1 | |
| BUILD_FEATURES = dev |
| import spacy | |
| nlp = spacy.load('🦄') | |
| doc = nlp(u'Wow, my model is named 🦄 !') | |
| for word in doc: | |
| print(word.text, word.tag_, word.dep_, word.head.text) |
| library itmap { | |
| struct entry { | |
| // Equal to the index of the key of this item in keys, plus 1. | |
| uint keyIndex; | |
| uint value; | |
| } | |
| struct itmap { | |
| mapping(uint => entry) data; | |
| uint[] keys; |
| import contextlib | |
| import OpenSSL.crypto | |
| import os | |
| import requests | |
| import ssl | |
| import tempfile | |
| @contextlib.contextmanager | |
| def pfx_to_pem(pfx_path, pfx_password): | |
| ''' Decrypts the .pfx file to be used with requests. ''' |
| # Initialize the scroll | |
| page = es.search( | |
| index = 'yourIndex', | |
| doc_type = 'yourType', | |
| scroll = '2m', | |
| search_type = 'scan', | |
| size = 1000, | |
| body = { | |
| # Your query's body | |
| }) |
| # -*- mode: conf; -*- | |
| # | |
| # NOTE: Settings generally support python interpolation. This means | |
| # values can contain python format strings which refer to other values | |
| # in the same section, or values in a special DEFAULT section. This | |
| # allows you for example to use common settings for multiple accounts: | |
| # | |
| # [Repository Gmail1] | |
| # trashfolder: %(gmailtrashfolder)s | |
| # |
| ;; just an example | |
| ((c++-mode . ((flymake-additional-compilation-flags . ("-I../" "-std=c++0x"))))) |