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 pylint(path, **meta): | |
""" Pylint code checking. | |
:return list: List of errors. | |
""" | |
from sys import version_info | |
if version_info > (3, 0): | |
import logging | |
logging.warn("Pylint don't supported python3 and will be disabled.") |
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
""" Interfaces for code checking. | |
""" | |
from __future__ import absolute_import, with_statement | |
import _ast | |
from os import path as op, environ | |
from .pep8 import BaseReport, StyleGuide | |
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
Traceback (most recent call last): | |
File "pylama/pylint/logilab/astng/scoped_nodes.py", line 284, in getattr | |
return [self.import_module(name, relative_only=True)] | |
File "pylama/pylint/logilab/astng/scoped_nodes.py", line 339, in import_module | |
return MANAGER.astng_from_module_name(absmodname) | |
File "pylama/pylint/logilab/astng/manager.py", line 133, in astng_from_module_name | |
return self.astng_from_file(filepath, modname, fallback=False) | |
File "pylama/pylint/logilab/astng/manager.py", line 104, in astng_from_file | |
return ASTNGBuilder(self).file_build(filepath, modname) | |
File "pylama/pylint/logilab/astng/builder.py", line 128, in file_build |
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
/*global window */ | |
'use strict'; | |
require('utils/preload'); | |
require('utils/legacy'); | |
var Backbone = require('backbone'); | |
var app = require('objects/app.js'); | |
var bqueue = require('objects/blanks-queue'); | |
var conf = require('utils/conf'); |
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 itertools import product, groupby | |
print sum([len(tuple(g)) ** 2 for _, g in groupby(sorted(map(sum, product(range(10), repeat=3))))]) |
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 itertools import product | |
print sum(1 for a, b in product(map(sum, product(range(10), repeat=3)), repeat=2) if a == b) |
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 aiohttp import CIMultiDict | |
# ... somewhere ... | |
request._headers = CIMultiDict(MY_CUSTOM_HEADER='VALUE HERE', MY_OTHER_CUSTOM_HEADER='VALUE HERE', **request.headers) |
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
""" Hello GIL! | |
""" | |
from __future__ import print_function | |
import math | |
import multiprocessing | |
import threading | |
from time import time |
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 os | |
import threading | |
import Queue | |
class WorkerThread(threading.Thread): | |
""" A worker thread that takes directory names from a queue, finds all | |
files in them recursively and reports the result. | |
Input is done by placing directory names (as strings) into the |
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
# Somewhere in your app (Ex. foundation/base/yourapp/mixin.py | |
class NameMixin(object): | |
name = db.Column(db.String(50)) |