def check_catalog(catalog):
    """ Checks catalog for conformance to the nbank namespace and version. Raises ValueError on failure """
    if not catalog.get('namespace', None) == 'neurobank.catalog':
        raise ValueError(
            "document does not have 'namespace' field set to 'neurobank.catalog'"
            )
    if not catalog.get('version', None) == '1.0':
        raise ValueError("catalog version is not equal to '1.0'")
    if 'resources' not in catalog:
        raise ValueError("document is missing 'resources' field")
    if not isinstance(catalog['resources'], (list, tuple)):
        raise ValueError("'resources' field is not a list or tuple")
