import socket import threading import Queue import collections import SocketServer import struct import os import sys import time import traceback import uuid import subprocess import StringIO import imp import hashlib import base64 import logging import re import ssl import tempfile import string import datetime import random import shutil import platform import errno, stat import zlib import code import glob import math import binascii import shlex import json import ctypes import threading import urllib import urllib2 import getpass import __future__ import netaddr import psutil if 'win' in sys.platform: import ctypes.wintypes else: import pty