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 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') |
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
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) { |
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 unittest | |
class _Node(object): | |
''' | |
Represents a node in a BST. | |
value is any object that implements __lt__(), enough for | |
sorting in python 3. | |
''' |
OlderNewer