def check_or_raise_uri(value, message=u'WAMP message invalid', strict=False, allow_empty_components=False, allow_last_empty=False, allow_none=False):
 if (value is None):
  if allow_none:
   return
  else:
   raise ProtocolError(u'{0}: URI cannot be null'.format(message))
 if (type(value) != six.text_type):
  if (not ((value is None) and allow_none)):
   raise ProtocolError(u'{0}: invalid type {1} for URI'.format(message, type(value)))
 if strict:
  if allow_last_empty:
   pat = _URI_PAT_STRICT_LAST_EMPTY
  elif allow_empty_components:
   pat = _URI_PAT_STRICT_EMPTY
  else:
   pat = _URI_PAT_STRICT_NON_EMPTY
 elif allow_last_empty:
  pat = _URI_PAT_LOOSE_LAST_EMPTY
 elif allow_empty_components:
  pat = _URI_PAT_LOOSE_EMPTY
 else:
  pat = _URI_PAT_LOOSE_NON_EMPTY
 if (not pat.match(value)):
  raise ProtocolError(u"{0}: invalid value '{1}' for URI (did not match pattern {2}, strict={3}, allow_empty_components={4}, allow_last_empty={5}, allow_none={6})".format(message, value, pat.pattern, strict, allow_empty_components, allow_last_empty, allow_none))
 else:
  return value

def check_or_raise_uri ( value , message = u'WAMP message invalid' , strict = False , allow_empty_components = False , allow_last_empty = False , allow_none = False ) : if ( value is None ) : if allow_none : return else : raise ProtocolError ( u'{0}: URI cannot be null' . format ( message ) ) if ( type ( value ) != six . text_type ) : if ( not ( ( value is None ) and allow_none ) ) : raise ProtocolError ( u'{0}: invalid type {1} for URI' . format ( message , type ( value ) ) ) if strict : if allow_last_empty : pat = _URI_PAT_STRICT_LAST_EMPTY elif allow_empty_components : pat = _URI_PAT_STRICT_EMPTY else : pat = _URI_PAT_STRICT_NON_EMPTY elif allow_last_empty : pat = _URI_PAT_LOOSE_LAST_EMPTY elif allow_empty_components : pat = _URI_PAT_LOOSE_EMPTY else : pat = _URI_PAT_LOOSE_NON_EMPTY if ( not pat . match ( value ) ) : raise ProtocolError ( u"{0}: invalid value '{1}' for URI (did not match pattern {2}, strict={3}, allow_empty_components={4}, allow_last_empty={5}, allow_none={6})" . format ( message , value , pat . pattern , strict , allow_empty_components , allow_last_empty , allow_none ) ) else : return value
check a value for being a valid wamp uri .