def jsonp_is_valid(funcname):
 func_regex = re.compile('\n        ^[a-zA-Z_\\$]\n        [a-zA-Z0-9_\\$]*\n        (\\[[a-zA-Z0-9_\\$]*\\])*\n        (\\.[a-zA-Z0-9_\\$]+\n            (\\[[a-zA-Z0-9_\\$]*\\])*\n        )*$\n    ', re.VERBOSE)
 return bool(func_regex.match(funcname))

def jsonp_is_valid ( funcname ) : func_regex = re . compile ( '\n        ^[a-zA-Z_\\$]\n        [a-zA-Z0-9_\\$]*\n        (\\[[a-zA-Z0-9_\\$]*\\])*\n        (\\.[a-zA-Z0-9_\\$]+\n            (\\[[a-zA-Z0-9_\\$]*\\])*\n        )*$\n    ' , re . VERBOSE ) return bool ( func_regex . match ( funcname ) )
returns whether the jsonp function name is valid :arg funcname: the name of the jsonp function :returns: true or false .