human
Complete this python program:
def get_cmdclass():
assistant
#Here is the Python code you requested.

    """Get the custom setuptools/distutils subclasses used by Versioneer.
    """
    if ('versioneer' in sys.modules):
        del sys.modules['versioneer']
    cmds = {}
    from distutils.core import Command
    class cmd_version(Command, ):
        description = 'report    generated    version    string'
        user_options = []
        boolean_options = []
        def initialize_options(self):
            pass
        def finalize_options(self):
            pass
        def run(self):
            vers = get_versions(verbose=True)
            print(('Version:    %s' % vers['version']))
            print(('    full-revisionid:    %s' % vers.get('full-revisionid')))
            print(('    dirty:    %s' % vers.get('dirty')))
            print(('    date:    %s' % vers.get('date')))
            if vers['error']:
                print(('    error:    %s' % vers['error']))
    cmds['version'] = cmd_version
    if ('setuptools' in sys.modules):
        from setuptools.command.build_py import build_py as _build_py
    else:
        from distutils.command.build_py import build_py as _build_py
    class cmd_build_py(_build_py, ):
        def run(self):
            root = get_root()
            cfg = get_config_from_root(root)
            versions = get_versions()
            _build_py.run(self)
            if cfg.versionfile_build:
                target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build)
                print(('UPDATING    %s' % target_versionfile))
                write_to_version_file(target_versionfile, versions)
    cmds['build_py'] = cmd_build_py
    if ('cx_Freeze' in sys.modules):
        from cx_Freeze.dist import build_exe as _build_exe
        class cmd_build_exe(_build_exe, ):
            def run(self):
                root = get_root()
                cfg = get_config_from_root(root)
                versions = get_versions()
                target_versionfile = cfg.versionfile_source
                print(('UPDATING    %s' % target_versionfile))
                write_to_version_file(target_versionfile, versions)
                _build_exe.run(self)
 ...