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
    
  
  
    
  | ## calling this url will return a QR code which encodes the str_in parameter: | |
| url = 'chart.apis.google.com/chart?cht=qr&chs=300x300&chl={str_in}&chld=H|0'.format(str_in='') | |
| ## find a str_in such that the generated QR code, when scanned, returns the url which generated it | 
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      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
    
  
  
    
  | from contextlib import contextmanager | |
| from functools import wraps | |
| class dummy_statsd_connection(object): | |
| def __init__(self, *args, **kwargs): | |
| self.data = [] | |
| self.log_data(args, kwargs) | |
| def log_data(self, *args, **kwargs): | |
| self.data.append({'args':args, 'kwargs':kwargs}) | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python | |
| import sys | |
| import os | |
| import subprocess | |
| import json | |
| import shlex | |
| MODULE_SETTINGS = type("MODULE_STATE", (object,), { | |
| "base_dir": "/home/mcgrady/ssh_mounts", | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| GLOBALS=type('GLOBALS',(object,),{ | |
| 'my_d': 0 | |
| } | |
| )() | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| import timeit | |
| import string | |
| import pprint | |
| def exfn(d_in, key): | |
| try: | 
  
    
      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
    
  
  
    
  | from twisted.internet import reactor, defer, task | |
| import random | |
| from contextlib import contextmanager | |
| def dummyLRP(choices, max_wait = 30): | |
| """ | |
| dummy long running sort and select proces. | |
| """ | |
| d = defer.Deferred() | |
| to_wait = random.uniform(0, max_wait) | 
  
    
      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 powerSet[A](s: Set[A]) = | |
| s.foldLeft(Set(Set.empty[A])) { | |
| (set, element) => | |
| set union (set map (_ + element)) | |
| } | 
  
    
      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
    
  
  
    
  | /* | |
| * Copyright 2012 Twitter Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software | 
  
    
      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
    
  
  
    
  | with openHDFS('/my/path/filename','w') as HFO: | |
| HFO.write('string A') | |
| ### on inpect /my/path/filename == 'string A' | |
| with openHDFS('/my/path/filename','w') as HFO: | |
| HFO.write('string B') | |
| ### on inpect /my/path/filename == 'string B' | |
| with openHDFS('/my/path/filename','a') as HFO: |