import os
import re
import csv
import sys
import json
import math
import string
import socket
import random
import zipfile
import inspect
import binascii
import warnings
import importlib
import mimetypes
import threading
import traceback
from glob import glob
from uuid import uuid4
from io import StringIO, BytesIO
from pprint import pprint
from copy import deepcopy
from pprint import pformat
from hashlib import sha512
from functools import wraps
from xml.dom import minidom
from random import randrange
from contextlib import closing
from time import sleep, mktime
from urllib.parse import quote
from urllib.parse import urlparse
from urllib.parse import parse_qsl
from itertools import chain, count
from collections import defaultdict, OrderedDict
from datetime import date, time, datetime, timedelta
from threading import Thread, RLock, local, current_thread
from os.path import abspath, basename, dirname, exists, join

import pytz
import bcrypt
import stripe
import cherrypy
import django.conf
from pytz import UTC

from django import template
from django.utils.safestring import SafeString
from django.utils.text import normalize_newlines
from django.template import loader, Context, Variable, TemplateSyntaxError

import sqlalchemy
from sqlalchemy.sql import case
from sqlalchemy.event import listen
from sqlalchemy.ext import declarative
from sqlalchemy import func, or_, and_, not_
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.expression import FunctionElement
from sqlalchemy.orm.attributes import get_history, instance_state
from sqlalchemy.schema import Column, ForeignKey, UniqueConstraint
from sqlalchemy.orm import Query, relationship, joinedload, backref
from sqlalchemy.types import Boolean, Integer, Float, TypeDecorator, Date

from sideboard.lib import log, parse_config, entry_point, listify, DaemonTask, serializer, cached_property, stopped, on_startup
from sideboard.lib.sa import declarative_base, SessionManager, UTCDateTime, UUID, CoerceUTF8 as UnicodeText

import uber
import uber as sa  # used to avoid circular dependency import issues for SQLAlchemy models
from uber.amazon_ses import AmazonSES, EmailMessage  # TODO: replace this after boto adds Python 3 support
from uber.config import c, Config, SecretConfig
from uber.utils import *
from uber.decorators import *
from uber.models import *
from uber.automated_emails import *
from uber.badge_funcs import *
from uber import model_checks
from uber import custom_tags
from uber import server
from uber import sep_commands
from uber.tests import import_test_data

import os
import re
import csv
import sys
import json
import math
import string
import socket
import random
import zipfile
import inspect
import binascii
import warnings
import importlib
import mimetypes
import threading
import traceback
from glob import glob
from uuid import uuid4
from pprint import pprint
from copy import deepcopy
from pprint import pformat
from hashlib import sha512
from functools import wraps
from xml.dom import minidom
from random import randrange
from contextlib import closing
from time import sleep, mktime
from urllib.parse import quote
from io import StringIO, BytesIO
from urllib.parse import urlparse
from urllib.parse import parse_qsl
from itertools import chain, count
from collections import defaultdict, OrderedDict
from datetime import date, time, datetime, timedelta
from threading import Thread, RLock, local, current_thread
from os.path import abspath, basename, dirname, exists, join

import pytz
import bcrypt
import stripe
import cherrypy
import django.conf
from pytz import UTC

from django import template
from django.utils.safestring import SafeString
from django.utils.text import normalize_newlines
from django.template import loader, Context, Variable, TemplateSyntaxError

import sqlalchemy
from sqlalchemy.sql import case
from sqlalchemy.event import listen
from sqlalchemy.ext import declarative
from sqlalchemy import func, or_, and_, not_
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.expression import FunctionElement
from sqlalchemy.orm.attributes import get_history, instance_state
from sqlalchemy.schema import Column, ForeignKey, UniqueConstraint
from sqlalchemy.orm import Query, relationship, joinedload, backref
from sqlalchemy.types import Boolean, Integer, Float, TypeDecorator, Date

from sideboard.lib import log, parse_config, entry_point, listify, DaemonTask, serializer, cached_property, stopped, on_startup
from sideboard.lib.sa import declarative_base, SessionManager, UTCDateTime, UUID, CoerceUTF8 as UnicodeText

import uber
import uber as sa  # used to avoid circular dependency import issues for SQLAlchemy models
from uber.amazon_ses import AmazonSES, EmailMessage  # TODO: replace this after boto adds Python 3 support
from uber.config import c, Config, SecretConfig
from uber.utils import *
from uber.decorators import *
from uber.models import *
from uber.automated_emails import *
from uber.badge_funcs import *
from uber import model_checks
from uber import custom_tags
from uber import server
from uber import sep_commands
from uber.tests import import_test_data

Update common.py