def valid_name(name):
 if isinstance(name, bytes):
  name = name.decode('ascii')
 if (not Definitions.COOKIE_NAME_RE.match(name)):
  return False
 if (name[0] == '$'):
  return False
 return True

def valid_name ( name ) : if isinstance ( name , bytes ) : name = name . decode ( 'ascii' ) if ( not Definitions . COOKIE_NAME_RE . match ( name ) ) : return False if ( name [ 0 ] == '$' ) : return False return True
validate a cookie name string .