def validate_meta_info(container, template):
    " Validate meta information\n\n    Adds 'BIDS.NA' if no BIDS info present\n    Adds 'BIDS.valid' and 'BIDS.error_message'\n        to communicate to user if values are valid\n\n    Currently, validation is only checking if\n        mandatory properties are non-empty strings\n\n    Could add the following checks:\n        Are the values alpha numeric?\n\n\n    "
    namespace = template.namespace
    if ('info' not in container):
        container['info'] = {namespace: 'NA'}
    elif (namespace not in container['info']):
        container['info'][namespace] = 'NA'
    elif (container['info'][namespace] == 'NA'):
        pass
    else:
        valid = True
        error_message = ''
        templateName = container['info'][namespace].get('template')
        if templateName:
            templateDef = template.definitions.get(templateName)
            if templateDef:
                errors = template.validate(templateDef, container['info'][namespace])
                if errors:
                    valid = False
                    error_message = '\n'.join([format_validation_error(err) for err in errors])
            else:
                valid = False
                error_message += ('Unknown template: %s. ' % templateName)
        container['info'][namespace]['valid'] = valid
        container['info'][namespace]['error_message'] = error_message
Validate meta information

Adds 'BIDS.NA' if no BIDS info present
Adds 'BIDS.valid' and 'BIDS.error_message'
    to communicate to user if values are valid

Currently, validation is only checking if
    mandatory properties are non-empty strings

Could add the following checks:
    Are the values alpha numeric?
def validate_meta_info(container, template):
    " Validate meta information\n\n    Adds 'BIDS.NA' if no BIDS info present\n    Adds 'BIDS.valid' and 'BIDS.error_message'\n        to communicate to user if values are valid\n\n    Currently, validation is only checking if\n        mandatory properties are non-empty strings\n\n    Could add the following checks:\n        Are the values alpha numeric?\n\n\n    "
    namespace = template.namespace
    if ('info' not in container):
        container['info'] = {namespace: 'NA'}
    elif (namespace not in container['info']):
        container['info'][namespace] = 'NA'
    elif (container['info'][namespace] == 'NA'):
        pass
    else:
        valid = True
        error_message = 
        templateName = container['info'][namespace].get('template')
        if templateName:
            templateDef = template.definitions.get(templateName)
            if templateDef:
                errors = template.validate(templateDef, container['info'][namespace])
                if errors:
                    valid = False
                    error_message = '\n'.join([format_validation_error(err) for err in errors])
            else:
                valid = False
                error_message += ('Unknown template: %s. ' % templateName)
        container['info'][namespace]['valid'] = valid
        container['info'][namespace]['error_message'] = error_message