# Path: alembic/util.py
# class CommandError(Exception):
# class memoized_property(object):
# class immutabledict(dict):
# def _safe_int(value):
# def requires_07(feature):
# def template_to_file(template_file, dest, **kw):
# def create_module_class_proxy(cls, globals_, locals_):
#     def _install_proxy(obj):
#     def _remove_proxy():
#     def _create_op_proxy(name):
#         def _name_error(name):
# def coerce_resource_to_filename(fname):
# def status(_statmsg, fn, *arg, **kw):
# def err(message):
# def obfuscate_url_pw(u):
# def asbool(value):
# def warn(msg):
# def msg(msg, newline=True):
# def load_python_file(dir_, filename):
# def pyc_file_from_path(path):
# def rev_id():
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#     def _immutable(self, *arg, **kw):
#     def __new__(cls, *args):
#     def __init__(self, *args):
#     def __reduce__(self):
#     def union(self, d):
#     def __repr__(self):


import os
import shutil
import re
import inspect
import datetime
from alembic import util
            if script and script.is_head:
                heads.append(script.revision)
        return heads

    def get_base(self):
        """Return the "base" revision as a string.

        This is the revision number of the script that
        has a ``down_revision`` of None.

        Behavior is not defined if more than one script
        has a ``down_revision`` of None.

        """
        for script in self._revision_map.values():
            if script.down_revision is None \
                and script.revision in self._revision_map:
                return script.revision
        else:
            return None

    def _generate_template(self, src, dest, **kw):
        util.status("Generating %s" % os.path.abspath(dest),
            util.template_to_file,
            src,
            dest,
            **kw
        )

    def _copy_file(self, src, dest):

# Path: alembic/util.py
# class CommandError(Exception):
# class memoized_property(object):
# class immutabledict(dict):
# def _safe_int(value):
# def requires_07(feature):
# def template_to_file(template_file, dest, **kw):
# def create_module_class_proxy(cls, globals_, locals_):
#     def _install_proxy(obj):
#     def _remove_proxy():
#     def _create_op_proxy(name):
#         def _name_error(name):
# def coerce_resource_to_filename(fname):
# def status(_statmsg, fn, *arg, **kw):
# def err(message):
# def obfuscate_url_pw(u):
# def asbool(value):
# def warn(msg):
# def msg(msg, newline=True):
# def load_python_file(dir_, filename):
# def pyc_file_from_path(path):
# def rev_id():
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#     def _immutable(self, *arg, **kw):
#     def __new__(cls, *args):
#     def __init__(self, *args):
#     def __reduce__(self):
#     def union(self, d):
#     def __repr__(self):


# Path: alembic/script.py
import os
import shutil
import re
import inspect
import datetime
from alembic import util

            if script and script.is_head:
                heads.append(script.revision)
        return heads

    def get_base(self):
        """Return the "base" revision as a string.

        This is the revision number of the script that
        has a ``down_revision`` of None.

        Behavior is not defined if more than one script
        has a ``down_revision`` of None.

        """
        for script in self._revision_map.values():
            if script.down_revision is None \
                and script.revision in self._revision_map:
                return script.revision
        else:
            return None

    def _generate_template(self, src, dest, **kw):
        util.status("Generating %s" % os.path.abspath(dest),
            util.template_to_file,
            src,
            dest,
            **kw
        )

    def _copy_file(self, src, dest):

        util.status("Generating %s" % os.path.abspath(dest),