def validate_namespace(value, exception=BadValueError):
 if (not isinstance(value, basestring)):
  raise exception(('value should be a string; received %r (a %s):' % (value, type(value))))
 if (not _NAMESPACE_RE.match(value)):
  raise exception(('value "%s" does not match regex "%s"' % (value, _NAMESPACE_PATTERN)))

def validate_namespace ( value , exception = BadValueError ) : if ( not isinstance ( value , basestring ) ) : raise exception ( ( 'value should be a string; received %r (a %s):' % ( value , type ( value ) ) ) ) if ( not _NAMESPACE_RE . match ( value ) ) : raise exception ( ( 'value "%s" does not match regex "%s"' % ( value , _NAMESPACE_PATTERN ) ) )
raises an exception if value is not a valid namespace string .