def get_package_name(module_name, is_package=False):
    """Figure out a package name for a module."""
    if module_name is None:
        return ''
    parts = module_name.split('.')
    if not is_package:
        parts = parts[:-1]
    return '.'.join(parts)
