def createNamespacePackage(module_name, is_top, module_relpath):
    source_ref = SourceCodeReference.fromFilenameAndLine(
        filename=module_relpath, line=1)
    source_ref = source_ref.atInternal()

    package = CompiledPythonPackage(
        module_name=module_name,
        is_top=is_top,
        mode="compiled",
        future_spec=FutureSpec(),
        source_ref=source_ref,
    )

    if python_version >= 0x300:
        statement = createPython3NamespacePath(package=package,
                                               module_relpath=module_relpath,
                                               source_ref=source_ref)
    else:
        statement = createPathAssignment(package, source_ref)

    package.setChild("body",
                     makeStatementsSequenceFromStatement(statement=statement))

    completeVariableClosures(package)

    return source_ref, package
def createNamespacePackage(module_name, is_top, source_ref):
    package = CompiledPythonPackage(
        module_name=module_name,
        is_top=is_top,
        mode="compiled",
        future_spec=FutureSpec(),
        source_ref=source_ref,
    )

    if python_version >= 0x300:
        statement = createPython3NamespacePath(package=package, source_ref=source_ref)
    else:
        statement = createPathAssignment(package, source_ref)

    package.setChild("body", makeStatementsSequenceFromStatement(statement=statement))

    completeVariableClosures(package)

    return package