This file contains 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 json | |
from salesforce_api import Salesforce | |
client = Salesforce( | |
username=credentials['sf_username'], | |
password=credentials['sf_password'], | |
security_token=credentials['sf_security_token'] | |
) | |
def dump_table(table_name, where=None): |
This file contains 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 gevent.monkey; gevent.monkey.patch_all(); | |
import gevent.queue | |
import functools | |
import time | |
import random | |
Q = gevent.queue.Queue() | |
QUIT = "QUIT" |
This file contains 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 itertools | |
def expand_letters(word, times): | |
expanded_letters = [] | |
for letter in word: | |
expanded_letters.append( (letter for _ in xrange(times)) ) | |
return ''.join(itertools.chain.from_iterable(expanded_letters)) | |
print expand_letters("Hello", 2) |