def create_subpackage(path, parent_package_name, subpackage_name='plugins'):
 package_name = _module_name(parent_package_name, subpackage_name)
 package = types.ModuleType(package_name)
 package.__path__ = ([path] if isinstance(path, six.string_types) else list(path))
 sys.modules[package_name] = package
 return package

def create_subpackage ( path , parent_package_name , subpackage_name = 'plugins' ) : package_name = _module_name ( parent_package_name , subpackage_name ) package = types . ModuleType ( package_name ) package . __path__ = ( [ path ] if isinstance ( path , six . string_types ) else list ( path ) ) sys . modules [ package_name ] = package return package
dynamically create a package into which to load plugins .