def __get_namespace(args, kw='package'):
    """ Return the namespace of the package as specified as an argument
    unless it was specified in the package name.
    """
    namespace = args.namespace
    try:
        if args.__getattribute__(kw) and '/' in args.__getattribute__(kw):
            namespace = args.__getattribute__(kw).split('/', 1)[0]
    except AttributeError:
        pass
    return namespace
