def sub_namespace(namespace, attrs, strict=False):
    """
    Get part of a namespace, as a dict
    """
    if strict:
        return {x:getattr(namespace, x) for x in attrs}
    else:
        return {x:getattr(namespace, x) for x in attrs if hasattr(namespace, x)}