Skip to content

Instantly share code, notes, and snippets.

import unittest
def bsearch_left(items, v):
'''
Binary search, finds left-most position.
Returns (bool, insertion-point after which
element should be inserted to maintain an invariant).
'''
if v is None:
raise ValueError('v must be set')
var server = nodeOauth2Server({
model: modelHandlers,
grants: ['password', 'refresh_token'],
debug: false,
refreshTokenLifetime: null, // never expire refresh token
passthroughErrors: true
});
module.exports = {
grantWrap: function oauthGrantWrap(req, res, next) {
import unittest
class _Node(object):
'''
Represents a node in a BST.
value is any object that implements __lt__(), enough for
sorting in python 3.
'''