#NEWLINE# def is_rule_path( value ) : #NEWLINE# #INDENT# 'Detects whether the given value is a rule name.\n\n  Returns:\n    True if the string is a valid rule name.\n  ' #NEWLINE# if ( ( not isinstance ( value , str ) ) or ( not len ( value ) ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# semicolon = string . rfind ( value , ':' ) #NEWLINE# if ( semicolon < 0 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( ( string . find ( value , '\\' , semicolon ) >= 0 ) or ( string . find ( value , '/' , value ) >= 0 ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True