#from collections import Counter
import sys, re, json, math
import traceback
import numpy as np
import pandas as pd
#import scipy
#import statsmodels.api as sm
#from sets import Set
#import matplotlib.pyplot as plt
#from sklearn.cluster import MiniBatchKMeans
import MySQLdb
#import subprocess
#import math
import yaml
import csv
import time
from kafka import KafkaConsumer
import urllib2 as urllib