def valid_any_uri(item):
 try:
  part = urlparse.urlparse(item)
 except Exception:
  raise NotValid('AnyURI')
 if ((part[0] == 'urn') and (part[1] == '')):
  return True
 return True

def valid_any_uri ( item ) : try : part = urlparse . urlparse ( item ) except Exception : raise NotValid ( 'AnyURI' ) if ( ( part [ 0 ] == 'urn' ) and ( part [ 1 ] == '' ) ) : return True return True
very simplistic .