<s> """<STR_LIT>""" <EOL> import platform <EOL> import re <EOL> import functools <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> def warn ( what ) : <EOL> """<STR_LIT>""" <EOL> def w ( fn ) : <EOL> @ functools . wraps ( fn ) <EOL> def wrapper ( * args , ** kwargs ) : <EOL> logger . warn ( "<STR_LIT>" % ( <EOL> fn . __name__ , what ) ) <EOL> return fn ( * args , ** kwargs ) <EOL> d = wrapper . __doc__ . split ( "<STR_LIT:\n>" ) <EOL> d [ <NUM_LIT:0> ] = "<STR_LIT>" % ( what , d [ <NUM_LIT:0> ] ) <EOL> wrapper . __doc__ = "<STR_LIT:\n>" . join ( d ) <EOL> return wrapper <EOL> return w <EOL> def arg ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> def w ( fn ) : <EOL> if not hasattr ( fn , "<STR_LIT>" ) : <EOL> fn . stap_args = [ ] <EOL> fn . stap_args . append ( ( args , kwargs ) ) <EOL> return fn <EOL> return w <EOL> def arg_pid ( fn ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( fn , "<STR_LIT>" ) : <EOL> fn . stap_args = [ ] <EOL> fn . stap_args . append ( ( ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> dict ( default = None , metavar = "<STR_LIT>" , type = int , <EOL> help = "<STR_LIT>" ) ) ) <EOL> return fn <EOL> def arg_process ( fn ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( fn , "<STR_LIT>" ) : <EOL> fn . stap_args = [ ] <EOL> fn . stap_args . append ( ( ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> dict ( default = None , metavar = "<STR_LIT>" , <EOL> type = str , <EOL> help = "<STR_LIT>" ) ) ) <EOL> return fn <EOL> def enable ( fn ) : <EOL> """<STR_LIT>""" <EOL> fn . stap_enabled = True <EOL> return fn <EOL> def linux ( * versions ) : <EOL> """<STR_LIT>""" <EOL> def w ( fn ) : <EOL> @ functools . wraps ( fn ) <EOL> def wrapper ( * args , ** kwargs ) : <EOL> current = platform . release ( ) <EOL> mo = re . match ( r"<STR_LIT>" , current ) <EOL> if mo : <EOL> current = mo . group ( <NUM_LIT:1> ) . split ( "<STR_LIT:.>" ) <EOL> for version in versions : <EOL> vv = version . split ( "<STR_LIT:.>" ) <EOL> if vv == current [ : len ( vv ) ] : <EOL> break <EOL> else : <EOL> logger . warn ( "<STR_LIT>" % ( <EOL> fn . __name__ , "<STR_LIT:.>" . join ( current ) ) ) <EOL> return fn ( * args , ** kwargs ) <EOL> return wrapper <EOL> return w </s>
