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
class A | |
def foo | |
puts "A" | |
end | |
def self.bar | |
puts "B" | |
end | |
end |
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 functools | |
import flask | |
import inspect | |
import sys | |
import traceback | |
def infer_args(func): | |
argspec = inspect.getargspec(func) | |
if argspec.defaults is None: |
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
def get_addr_range(start, end): | |
def to_int(ip): | |
return sum([int(p) << (24 - (8 * e)) for e, p in enumerate(ip.split("."))]) | |
def to_ip(val): | |
return ".".join(str((val & (0xff << s)) >> s) for s in range(24, -1, -8)) | |
for addr in xrange(to_int(start), to_int(end) + 1): | |
yield to_ip(addr) |
NewerOlder