code
stringlengths
3
6.57k
HTTPResponse(body, status=206, **headers)
HTTPResponse(body, **headers)
MISC (TODO)
debug(mode=True)
warnings.simplefilter('default')
bool(mode)
http_date(value)
isinstance(value, (datedate, datetime)
value.utctimetuple()
isinstance(value, (int, float)
time.gmtime(value)
isinstance(value, basestring)
time.strftime("%a, %d %b %Y %H:%M:%S GMT", value)
parse_date(ims)
email.utils.parsedate_tz(ims)
time.mktime(ts[:8] + (0,)
except (TypeError, ValueError, IndexError, OverflowError)
parse_auth(header)
string (basic)
return (user,pass)
header.split(None, 1)
method.lower()
touni(base64.b64decode(tob(data)
split(':',1)
except (KeyError, ValueError)
parse_range_header(header, maxlen=0)
Yield (start, end)
r.split('-', 1)
split(',')
max(0, maxlen-int(end)
int(start)
int(start)
min(int(end)
_parse_qsl(qs)
qs.replace(';','&')
split('&')
pair.split('=', 1)
len(nv)
nv.append('')
urlunquote(nv[0].replace('+', ' ')
urlunquote(nv[1].replace('+', ' ')
r.append((key, value)
_lscmp(a, b)
sum(0 if x==y else 1 for x, y in zip(a, b)
len(a)
len(b)
cookie_encode(data, key)
a (byte)
base64.b64encode(pickle.dumps(data, -1)
base64.b64encode(hmac.new(tob(key)
digest()
tob('!')
tob('?')
cookie_decode(data, key)
tob(data)
cookie_is_encoded(data)
data.split(tob('?')
_lscmp(sig[1:], base64.b64encode(hmac.new(tob(key)
digest()
pickle.loads(base64.b64decode(msg)
cookie_is_encoded(data)
bool(data.startswith(tob('!')
tob('?')
html_escape(string)
string.replace('&','&')
replace('<','&lt;')
replace('>','&gt;')
replace('"','&quot;')
replace("'",'&#039;')
html_quote(string)
html_escape(string)
replace('\n','&#10;')
replace('\r','&#13;')
replace('\t','&#9;')
yieldroutes(func)
signature (name, args)
a()
b(x, y)
c(x, y=5)
d(x=5, y=6)
func.__name__.replace('__','/')
lstrip('/')
getargspec(func)
len(spec[0])
len(spec[3] or [])
tuple(spec[0][:argc])
path_shift(script_name, path_info, shift=1)
direction. (default: 1)
path_info.strip('/')
split('/')
script_name.strip('/')
split('/')
len(pathlist)
len(scriptlist)
AssertionError("Cannot shift. Nothing left from %s" % empty)
join(scriptlist)
join(pathlist)
path_info.endswith('/')
auth_basic(check, realm="private", text="Access denied")
auth (basic)