# [ "lsof", '-w', '-Ff', "-p", str( pid ) ] ) # nprocs = len( # filter( # lambda s: s and s[ 0 ] == 'f' and s[1: ].isdigit(), # procs.split( '\n' ) ) # ) # return nprocs def build_vector_features(base_vector, features) : v = [] for feature in base_vector : nb_feat = 0 if feature not in features else features[feature] v.append(nb_feat) return v parser = tw.get_argument_parser() args = parser.parse_args() ## # args.diroutput ## if not os.path.isdir(args.diroutput) : print 'OUTPUTDIR %s does not exist, create it or choose an other directory'%s(args.diroutput) exit(0) ## # args.testcorpus ## if not os.path.isfile(args.testcorpus) or args.testcorpus == '' :
# filter( # lambda s: s and s[ 0 ] == 'f' and s[1: ].isdigit(), # procs.split( '\n' ) ) # ) # return nprocs def build_vector_features(base_vector, features): v = [] for feature in base_vector: nb_feat = 0 if feature not in features else features[feature] v.append(nb_feat) return v parser = tw.get_argument_parser() parser = tw.add_argument_parser(parser) args = parser.parse_args() ## # args.diroutput ## if not os.path.isdir(args.diroutput): print 'OUTPUTDIR %s does not exist, create it or choose an other directory' % s( args.diroutput) exit(0) ## # args.testcorpus ##