bugged
stringlengths 4
228k
| fixed
stringlengths 0
96.3M
| __index_level_0__
int64 0
481k
|
---|---|---|
def set_source(self, source): """ Define an alternative source for the colormap. *source* can be any other matplotlib colormap object or its registered name, a NumPy array with one RGB triplet per row or the name of a textfile with one RGB triplet per line. Values should be between 0.0 and 1.0. """ self.source = source try: source = cm.get_cmap(source)
|
def set_source(self, source): """ Define an alternative source for the colormap. *source* can be any other matplotlib colormap object or its registered name, a NumPy array with one RGB triplet per row or the name of a textfile with one RGB triplet per line. Values should be between 0.0 and 1.0. """ self.source = source try: source = cm.get_cmap(source)
| 480,500 |
def uniconvw_run(): file=None icon=None _pkgdir = __path__[0] app_ver = string.strip(open(os.path.join(_pkgdir, 'VERSION')).read())
|
defuniconvw_run():file=Noneicon=None_pkgdir=__path__[0]app_ver=string.strip(open(os.path.join(_pkgdir,'VERSION')).read())
| 480,501 |
def uniconvw_run(): file=None icon=None _pkgdir = __path__[0] app_ver = string.strip(open(os.path.join(_pkgdir, 'VERSION')).read())
|
def uniconvw_run(): file=None icon=None _pkgdir = __path__[0] app_ver = string.strip(open(os.path.join(_pkgdir, 'VERSION')).read())
| 480,502 |
def clean_code(self, text): # remove XML comments text = re.sub(self.RE_XMLCOMMENT, '', text) # remove preprocessor directions text = re.sub(self.RE_PREPROCESSOR, '', text) # substitute multilines with one line text = re.sub(self.RE_MULTILINES, "", text) return text
|
def clean_code(self, text): # remove XML comments text = re.sub(self.RE_XMLCOMMENT, '', text) # remove preprocessor directions text = re.sub(self.RE_PREPROCESSOR, '', text) # substitute multilines with one line text = re.sub(self.RE_MULTILINES, "", text) return text
| 480,503 |
def write_function(self, fn, f): f.writelines([ r'\begin{functiondef}{', self.cmd('returnvalue', fn.return_value), ' ', self.cmd('function', fn.name), '(', ]) if fn.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), fn.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
|
def write_function(self, fn, f): f.writelines([ r'\begin{functiondef}{', self.cmd('returnvalue', fn.return_value), ' ', self.cmd('function', fn.name), '(', ]) if fn.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), fn.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
| 480,504 |
def write_function(self, fn, f): f.writelines([ r'\begin{functiondef}{', self.cmd('returnvalue', fn.return_value), ' ', self.cmd('function', fn.name), '(', ]) if fn.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), fn.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
|
def write_function(self, fn, f): f.writelines([ r'\begin{functiondef}{', self.cmd('returnvalue', fn.return_value), ' ', self.cmd('function', fn.name), '(', ]) if fn.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), fn.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
| 480,505 |
def write_function(self, fn, f): lines = [ '<div class="function_definition">\n', '<a name="function_%s">' % fn.name, '<h3><span class="type">%s</span> <span class="keyword">function</span> <span class="subroutine">%s</span>(<div class="parameters">' % (fn.return_value, fn.name) ] f.writelines(lines) subs = [] for var in fn.parameters: names = map(lambda var: var.name, fn.inputvars+fn.inoutputvars+fn.outputvars) if var in names: subs.append('<a href="#function_%s_var_%s"><span class="variable">%s</span></a>' % (fn.name, var, var)) else: subs.append('<span class="variable">%s</span>' % var) f.writelines([', '.join(subs)]) f.writelines(['</div>)</h3></a>\n']) f.writelines(['<div class="description">\n%s\n</div>' % fn.description])
|
def write_function(self, fn, f): lines = [ '<div class="function_definition">\n', '<a name="function_%s">' % fn.name, '<h3><span class="type">%s</span> <span class="keyword">function</span> <span class="subroutine">%s</span>(<div class="parameters">' % (fn.return_value, fn.name) ] f.writelines(lines) subs = [] for var in fn.parameters: names = map(lambda var: var.name, fn.inputvars+fn.inoutputvars+fn.outputvars) if var in names: subs.append('<a href="#function_%s_var_%s"><span class="variable">%s</span></a>' % (fn.name, var, var)) else: subs.append('<span class="variable">%s</span>' % var) f.writelines([', '.join(subs)]) f.writelines(['</div>)</h3></a>\n']) f.writelines(['<div class="description">\n%s\n</div>' % fn.description])
| 480,506 |
def interpret(self, nodes): "Extract information from the nodes."
|
def interpret(self, nodes): "Extract information from the nodes."
| 480,507 |
def extract_subroutine(self, node, text): "Extract subroutine from source code."
|
defextract_subroutine(self,node,text):"Extractsubroutinefromsourcecode."
| 480,508 |
def extract_subroutine(self, node, text): "Extract subroutine from source code."
|
def extract_subroutine(self, node, text): "Extract subroutine from source code."
| 480,509 |
def extract_variables(self, text, l): "Extract variable and group information from source code."
|
def extract_variables(self, text, l): "Extract variable and group information from source code."
| 480,510 |
def end_group(scanner, token): if not self.active_group.variables: error(15, 'No variable found in group: %s' % self.active_group.description) self.active_group = None self.current_comment = None
|
def end_group(scanner, token): if not self.active_group.variables: error(15, 'No variable found in group: %s' % self.active_group.description) self.active_group = None self.current_comment = None
| 480,511 |
def commentblock(scanner, token): self.current_comment = token.strip()
|
def commentblock(scanner, token): self.current_comment = token.strip()
| 480,512 |
def blank_lines(scanner, token): self.current_comment = None
|
def blank_lines(scanner, token): self.current_comment = None
| 480,513 |
def variable_definition(scanner, token): match = re.search(self.VARIABLE, token) if match: m = match.groups() vartype = m[1].split(",")[0].strip() if self.current_comment: self.current_comment = self.clean_description(self.current_comment) v = Variable(m[2], vartype, self.current_comment) else: v = Variable(m[2], vartype) dim = re.search(r"(dimension\(.*?\))", m[1]) if dim: v.dimension = dim.group(1) opt = re.search(r"optional", m[1])
|
def variable_definition(scanner, token): match = re.search(self.VARIABLE, token) if match: m = match.groups() vartype = m[1].split(",")[0].strip() if self.current_comment: self.current_comment = self.clean_description(self.current_comment) v = Variable(m[2], vartype, self.current_comment) else: v = Variable(m[2], vartype) dim = re.search(r"(dimension\(.*?\))", m[1]) if dim: v.dimension = dim.group(1) opt = re.search(r"optional", m[1])
| 480,514 |
def variable_definition(scanner, token): match = re.search(self.VARIABLE, token) if match: m = match.groups() vartype = m[1].split(",")[0].strip() if self.current_comment: self.current_comment = self.clean_description(self.current_comment) v = Variable(m[2], vartype, self.current_comment) else: v = Variable(m[2], vartype) dim = re.search(r"(dimension\(.*?\))", m[1]) if dim: v.dimension = dim.group(1) opt = re.search(r"optional", m[1])
|
def variable_definition(scanner, token): match = re.search(self.VARIABLE, token) if match: m = match.groups() vartype = m[1].split(",")[0].strip() if self.current_comment: self.current_comment = self.clean_description(self.current_comment) v = Variable(m[2], vartype, self.current_comment) else: v = Variable(m[2], vartype) dim = re.search(r"(dimension\(.*?\))", m[1]) if dim: v.dimension = dim.group(1) opt = re.search(r"optional", m[1])
| 480,515 |
def write_interface(self, interface, description, f): f.writelines([self.cmd('interface', interface), '\n']) f.writelines([self.env('desc', description), '\n'])
|
def write_interface(self, interface, description, f): f.writelines([self.cmd('interface', interface), '\n']) f.writelines([self.env('desc', description), '\n'])
| 480,516 |
def write_subroutine(self, sub, f): f.writelines([ r'\begin{subroutinedef}{', self.cmd('subroutine', sub.name), '(', self.cmd('sloppy') ]) if sub.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), sub.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
|
def write_subroutine(self, sub, f): f.writelines([ r'\begin{subroutinedef}{', self.cmd('subroutine', sub.name), '(', self.cmd('sloppy') ]) if sub.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), sub.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
| 480,517 |
def write_subroutine(self, sub, f): f.writelines([ r'\begin{subroutinedef}{', self.cmd('subroutine', sub.name), '(', self.cmd('sloppy') ]) if sub.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), sub.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
|
def write_subroutine(self, sub, f): f.writelines([ r'\begin{subroutinedef}{', self.cmd('subroutine', sub.name), '(', self.cmd('sloppy') ]) if sub.parameters: params = ", ".join(map(lambda s: self.cmd('textbf', s), sub.parameters)) f.writelines([params]) f.writelines([')}\n\n'])
| 480,518 |
def test_abundance_dist(self): dist = self.kh.abundance_distribution() assert dist[0] == 4**4 assert sum(dist[1:]) == 0 n = self.kh.consume('AAAA') n = self.kh.consume('AACT') dist = self.kh.abundance_distribution() assert sum(dist[1:]) == 2 assert dist[1] == 2
|
def test_abundance_dist(self): dist = self.kh.abundance_distribution() assert dist[0] == 4**4 assert sum(dist[1:]) == 0 n = self.kh.consume('AAAA') n = self.kh.consume('AACT') dist = self.kh.abundance_distribution() assert sum(dist[1:]) == 2, dist assert dist[1] == 2
| 480,519 |
def main(): global done, worker_count done = False worker_count = 0 infile = sys.argv[1] outfile = infile + '.graphsize2' print 'creating ht' ht = khmer.new_hashbits(K, HASHTABLE_SIZE, 1) print 'eating fa', infile total_reads, n_consumed = ht.consume_fasta(infile) outfp = open(outfile, 'w') inqueue = Queue.Queue(50) outqueue = Queue.Queue(50) ## worker and writer threads for i in range(WORKER_THREADS): t = threading.Thread(target=process, args=(inqueue, outqueue, ht)) worker_count += 1 t.start() threading.Thread(target=write, args=(outqueue, outfp)).start() ### main thread x = [] i = 0 for n, record in enumerate(screed.fasta.fasta_iter(open(infile))): if n % 10000 == 0: print '...', n x.append(record) i += 1 if i > GROUPSIZE: inqueue.put(x) x = [] i = 0 inqueue.put(x) done = True
|
def main(): global done, worker_count done = False worker_count = 0 infile = sys.argv[1] outfile = infile + '.graphsize' print 'creating ht' ht = khmer.new_hashbits(K, HASHTABLE_SIZE, 1) print 'eating fa', infile total_reads, n_consumed = ht.consume_fasta(infile) outfp = open(outfile, 'w') inqueue = Queue.Queue(50) outqueue = Queue.Queue(50) ## worker and writer threads for i in range(WORKER_THREADS): t = threading.Thread(target=process, args=(inqueue, outqueue, ht)) worker_count += 1 t.start() threading.Thread(target=write, args=(outqueue, outfp)).start() ### main thread x = [] i = 0 for n, record in enumerate(screed.fasta.fasta_iter(open(infile))): if n % 10000 == 0: print '...', n x.append(record) i += 1 if i > GROUPSIZE: inqueue.put(x) x = [] i = 0 inqueue.put(x) done = True
| 480,520 |
def test_3_merge_013(self): ht = khmer.new_hashbits(20, 4**14+1) filename = os.path.join(thisdir, 'test-graph2.fa')
|
def test_3_merge_013(self): ht = khmer.new_hashbits(20, 4**14+1) filename = os.path.join(thisdir, 'test-graph2.fa')
| 480,521 |
def test_3_merge_023(self): ht = khmer.new_hashbits(20, 4**14+1) filename = os.path.join(thisdir, 'test-graph2.fa')
|
def test_3_merge_023(self): ht = khmer.new_hashbits(20, 4**14+1) filename = os.path.join(thisdir, 'test-graph2.fa')
| 480,522 |
def test_random_20_a_succ(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
|
def test_random_20_a_succ(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
| 480,523 |
def test_random_20_a_succ_II(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
|
def test_random_20_a_succ_II(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
| 480,524 |
def test_random_20_a_succ_III(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
|
def test_random_20_a_succ_III(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
| 480,525 |
def test_save_load_merge(self): ht = khmer.new_hashbits(20, 4**14+1) filename = os.path.join(thisdir, 'test-graph2.fa')
|
def test_save_load_merge(self): ht = khmer.new_hashbits(20, 4**14+1) filename = os.path.join(thisdir, 'test-graph2.fa')
| 480,526 |
def test_complex6_32_12(self): ht = khmer.new_hashtable(20, 4**12+1)
|
def test_complex6_32_12(self): ht = khmer.new_hashtable(20, 4**12+1)
| 480,527 |
def test_complex6_32_12(self): ht = khmer.new_hashtable(20, 4**12+1)
|
def test_complex6_32_12(self): ht = khmer.new_hashtable(20, 4**12+1)
| 480,528 |
def main(dir1, dir2, n_threads): # detect all of the relevant partitionmap files subset_filenames = glob.glob(os.path.join(dir1, '*.pmap')) # create empty hashtable structure ht = khmer.new_hashtable(K, 1) # put jobs on queue merge_queue = Queue.Queue() for filename in subset_filenames: merge_queue.put((ht, filename)) print 'starting threads' threads = [] for n in range(n_threads): t = threading.Thread(target=pull_pair, args=(merge_queue,)) threads.append(t) t.start() # wait for threads for t in threads: t.join() # done! if merge_queue.qsize() == 1: ht, merge_file = merge_queue.get() shutil.copy(merge_file, os.path.join(dir2, os.path.basename(merge_file))) assert merge_queue.qsize() == 0
|
def main(dir1, dir2, n_threads): # detect all of the relevant partitionmap files subset_filenames = glob.glob(os.path.join(dir1, '*.pmap')) # create empty hashtable structure ht = khmer.new_hashbits(K, 1, 1) # put jobs on queue merge_queue = Queue.Queue() for filename in subset_filenames: merge_queue.put((ht, filename)) print 'starting threads' threads = [] for n in range(n_threads): t = threading.Thread(target=pull_pair, args=(merge_queue,)) threads.append(t) t.start() # wait for threads for t in threads: t.join() # done! if merge_queue.qsize() == 1: ht, merge_file = merge_queue.get() shutil.copy(merge_file, os.path.join(dir2, os.path.basename(merge_file))) assert merge_queue.qsize() == 0
| 480,529 |
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().rsplit('\t', 1) if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
|
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().rsplit('\t', 1) if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
| 480,530 |
def main(dir1, dir2, n_threads): # detect all of the relevant partitionmap files subset_filenames = glob.glob(os.path.join(dir1, '*.pmap')) # put on queue merge_queue = Queue.Queue() for filename in subset_filenames: merge_queue.put((ht, filename)) print 'starting threads' threads = [] for n in range(n_threads): t = threading.Thread(target=pull_pair, args=(merge_queue,)) threads.append(t) t.start() # wait for threads for t in threads: t.join() # done! if merge_queue.qsize() == 1: ht, merge_file = merge_queue.get() shutil.copy(merge_file, os.path.join(dir2, os.path.basename(merge_file))) assert merge_queue.qsize() == 0
|
def ht = khmer.new_hashtable(K, 1) main(dir1, ht = khmer.new_hashtable(K, 1) dir2, ht = khmer.new_hashtable(K, 1) n_threads): ht = khmer.new_hashtable(K, 1) # ht = khmer.new_hashtable(K, 1) detect ht = khmer.new_hashtable(K, 1) all ht = khmer.new_hashtable(K, 1) of ht = khmer.new_hashtable(K, 1) the ht = khmer.new_hashtable(K, 1) relevant ht = khmer.new_hashtable(K, 1) partitionmap ht = khmer.new_hashtable(K, 1) files ht = khmer.new_hashtable(K, 1) subset_filenames ht = khmer.new_hashtable(K, 1) = ht = khmer.new_hashtable(K, 1) glob.glob(os.path.join(dir1, ht = khmer.new_hashtable(K, 1) '*.pmap')) ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) # ht = khmer.new_hashtable(K, 1) put ht = khmer.new_hashtable(K, 1) on ht = khmer.new_hashtable(K, 1) queue ht = khmer.new_hashtable(K, 1) merge_queue ht = khmer.new_hashtable(K, 1) = ht = khmer.new_hashtable(K, 1) Queue.Queue() ht = khmer.new_hashtable(K, 1) for ht = khmer.new_hashtable(K, 1) filename ht = khmer.new_hashtable(K, 1) in ht = khmer.new_hashtable(K, 1) subset_filenames: ht = khmer.new_hashtable(K, 1) merge_queue.put((ht, ht = khmer.new_hashtable(K, 1) filename)) ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) print ht = khmer.new_hashtable(K, 1) 'starting ht = khmer.new_hashtable(K, 1) threads' ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) threads ht = khmer.new_hashtable(K, 1) = ht = khmer.new_hashtable(K, 1) [] ht = khmer.new_hashtable(K, 1) for ht = khmer.new_hashtable(K, 1) n ht = khmer.new_hashtable(K, 1) in ht = khmer.new_hashtable(K, 1) range(n_threads): ht = khmer.new_hashtable(K, 1) t ht = khmer.new_hashtable(K, 1) = ht = khmer.new_hashtable(K, 1) threading.Thread(target=pull_pair, ht = khmer.new_hashtable(K, 1) args=(merge_queue,)) ht = khmer.new_hashtable(K, 1) threads.append(t) ht = khmer.new_hashtable(K, 1) t.start() ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) # ht = khmer.new_hashtable(K, 1) wait ht = khmer.new_hashtable(K, 1) for ht = khmer.new_hashtable(K, 1) threads ht = khmer.new_hashtable(K, 1) for ht = khmer.new_hashtable(K, 1) t ht = khmer.new_hashtable(K, 1) in ht = khmer.new_hashtable(K, 1) threads: ht = khmer.new_hashtable(K, 1) t.join() ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) # ht = khmer.new_hashtable(K, 1) done! ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) if ht = khmer.new_hashtable(K, 1) merge_queue.qsize() ht = khmer.new_hashtable(K, 1) == ht = khmer.new_hashtable(K, 1) 1: ht = khmer.new_hashtable(K, 1) ht, ht = khmer.new_hashtable(K, 1) merge_file ht = khmer.new_hashtable(K, 1) = ht = khmer.new_hashtable(K, 1) merge_queue.get() ht = khmer.new_hashtable(K, 1) shutil.copy(merge_file, ht = khmer.new_hashtable(K, 1) os.path.join(dir2, ht = khmer.new_hashtable(K, 1) os.path.basename(merge_file))) ht = khmer.new_hashtable(K, 1) ht = khmer.new_hashtable(K, 1) assert ht = khmer.new_hashtable(K, 1) merge_queue.qsize() ht = khmer.new_hashtable(K, 1) == ht = khmer.new_hashtable(K, 1) 0 ht = khmer.new_hashtable(K, 1)
| 480,531 |
def test_random_20_a_succ_III(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
|
def test_random_20_a_succ_III(self): ht = khmer.new_hashbits(20, 4**13+1) filename = os.path.join(thisdir, 'test-data/random-20-a.fa') outfile = filename + '.out'
| 480,532 |
def test_surrendered(self): ht = khmer.new_hashtable(32, 4**15+1)
|
def test_surrendered(self): ht = khmer.new_hashtable(32, 4**15+1)
| 480,533 |
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
|
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().rsplit('\t', 1) if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
| 480,534 |
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
|
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
| 480,535 |
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
|
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
| 480,536 |
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
|
def read_partition_file(fp): for n, line in enumerate(fp): if n % 2 == 0: surrendered = False name, partition_id = line[1:].strip().split('\t') if '*' in partition_id: partition_id = int(partition_id[:-1]) surrendered = True else: partition_id = int(partition_id) else: sequence = line.strip() yield name, partition_id, surrendered, sequence
| 480,537 |
def threaded_calc(ht, filename, start, stop): x = ht.do_subset_partition(filename, start, stop) print 'done!' results.append(x)
|
def threaded_calc(ht, start, stop): x = ht.do_subset_partition(start, stop) print 'done!' results.append(x)
| 480,538 |
def threaded_calc(ht, filename, start, stop): x = ht.do_subset_partition(filename, start, stop) print 'done!' results.append(x)
|
defthreaded_calc(ht,filename,start,stop):x=ht.do_subset_partition(filename,start,stop)print'done!'results.append(x)
| 480,539 |
def threaded_calc(ht, filename, start, stop): x = ht.do_subset_partition(filename, start, stop) print 'done!' results.append(x)
|
def threaded_calc(ht, filename, start, stop): x = ht.do_subset_partition(filename, start, stop) print 'done!' results.append(x)
| 480,540 |
def threaded_calc(ht, filename, start, stop): x = ht.do_subset_partition(filename, start, stop) print 'done!' results.append(x)
|
def threaded_calc(ht, filename, start, stop): x = ht.do_subset_partition(filename, start, stop) print 'done!' results.append(x)
| 480,541 |
def test_simple_20_12(self): ht = khmer.new_hashtable(20, 4**12+1)
|
def test_simple_20_12(self): ht = khmer.new_hashtable(20, 4**12+1)
| 480,542 |
def test_simple_30_12(self): ht = khmer.new_hashtable(32, 4**12+1)
|
def test_simple_30_12(self): ht = khmer.new_hashtable(32, 4**12+1)
| 480,543 |
def test_merge_20_12(self): ht = khmer.new_hashtable(20, 4**12+1)
|
def test_merge_20_12(self): ht = khmer.new_hashtable(20, 4**12+1)
| 480,544 |
def test_merge_32_12(self): ht = khmer.new_hashtable(32, 4**12+1)
|
def test_merge_32_12(self): ht = khmer.new_hashtable(32, 4**12+1)
| 480,545 |
def test_complex_20_12(self): ht = khmer.new_hashtable(20, 4**12+1)
|
def test_complex_20_12(self): ht = khmer.new_hashtable(20, 4**12+1)
| 480,546 |
def test_complex_31_12(self): ht = khmer.new_hashtable(31, 4**12+1)
|
def test_complex_31_12(self): ht = khmer.new_hashtable(31, 4**12+1)
| 480,547 |
def test_complex_32_12(self): ht = khmer.new_hashtable(32, 4**12+1)
|
def test_complex_32_12(self): ht = khmer.new_hashtable(32, 4**12+1)
| 480,548 |
def main(filename): basename = os.path.basename(filename) # populate the hash table and tag set ht.consume_fasta_and_tag(filename, callback)
|
def main(filename): basename = os.path.basename(filename) # populate the hash table and tag set ht.consume_fasta_and_tag(filename, callback)
| 480,549 |
def main(filename): basename = os.path.basename(filename) # populate the hash table and tag set ht.consume_fasta_and_tag(filename, callback)
|
def main(filename): basename = os.path.basename(filename) # populate the hash table and tag set ht.consume_fasta(filename, 0, 0, None, True, callback)
| 480,550 |
def main(filename): basename = os.path.basename(filename) # populate the hash table and tag set ht.consume_fasta_and_tag(filename, callback)
|
def main(filename): basename = os.path.basename(filename) # populate the hash table and tag set ht.consume_fasta_and_tag(filename, callback)
| 480,551 |
def update_params(self, d): super(SourceDownloadsWidget, self).update_params(d) sources = [] releases = [] dist_tags = {}
|
def update_params(self, d): super(SourceDownloadsWidget, self).update_params(d) sources = [] releases = [] dist_tags = {}
| 480,552 |
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
|
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
| 480,553 |
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
|
def _default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
| 480,554 |
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
|
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
| 480,555 |
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
|
def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf
| 480,556 |
def changed_saved(self, current, previous): if current is None: return d = current.data(QtCore.Qt.UserRole).toMap() username = d[QtCore.QString('username')].toString() password = d[QtCore.QString('password')].toString() host = d[QtCore.QString('host')].toString() port = d[QtCore.QString('port')].toString() self.username_edit.setText(username) self.password_edit.setText(password) self.host_edit.setText(host) self.port_edit.setText(port)
|
def changed_saved(self): items = self.saved_items.selectedItems() if len(items) == 0: return d = current.data(QtCore.Qt.UserRole).toMap() username = d[QtCore.QString('username')].toString() password = d[QtCore.QString('password')].toString() host = d[QtCore.QString('host')].toString() port = d[QtCore.QString('port')].toString() self.username_edit.setText(username) self.password_edit.setText(password) self.host_edit.setText(host) self.port_edit.setText(port)
| 480,557 |
def remove_entry(self): items = self.saved_items.selectedItems() for item in items: print item.text() config = SafeConfig(os.path.join(sys.path[0], 'saved.ini')) config.remove_section(str(item.text())) config.write() self.load_saved_items()
|
def remove_entry(self): items = self.saved_items.selectedItems() for item in items: config = SafeConfig(os.path.join(sys.path[0], 'saved.ini')) config.remove_section(str(item.text())) config.write() self.load_saved_items()
| 480,558 |
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
|
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
| 480,559 |
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
|
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
| 480,560 |
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
|
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
| 480,561 |
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
|
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
| 480,562 |
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
|
def show_connection_page(self): page_hlayout = QtGui.QHBoxLayout() page_vlayout = QtGui.QVBoxLayout() page_layout = QtGui.QGridLayout() new_group = QtGui.QGroupBox("New Connection") layout = QtGui.QFormLayout()
| 480,563 |
def __init__(self, terminal): QtCore.QThread.__init__(self) self.terminal = terminal
|
def __init__(self, terminal, index): QtCore.QThread.__init__(self) self.terminal = terminal
| 480,564 |
def run(self): self.terminal.connect()
|
def run(self): self.terminal.connect()
| 480,565 |
def connection_finished(): term = th.terminal if term.channel.is_connected(): self.tabs.removeTab(idx) self.tabs.add_new_tab(term, index=idx) else: if term.channel.authentication_error: self.status_label.setText("Authentication Error.") else: self.status_label.setText("Unable to connect.") self.login_button.setDisabled(False) del term self.connection_threads.remove(th)
|
defconnection_finished():term=th.terminalifterm.channel.is_connected():self.tabs.removeTab(idx)self.tabs.add_new_tab(term,index=idx)else:ifterm.channel.authentication_error:self.status_label.setText("AuthenticationError.")else:self.status_label.setText("Unabletoconnect.")self.login_button.setDisabled(False)deltermself.connection_threads.remove(th)
| 480,566 |
def connection_finished(): term = th.terminal if term.channel.is_connected(): self.tabs.removeTab(idx) self.tabs.add_new_tab(term, index=idx) else: if term.channel.authentication_error: self.status_label.setText("Authentication Error.") else: self.status_label.setText("Unable to connect.") self.login_button.setDisabled(False) del term self.connection_threads.remove(th)
|
defconnection_finished():term=th.terminalifterm.channel.is_connected():self.tabs.removeTab(idx)self.tabs.add_new_tab(term,index=idx)else:ifterm.channel.authentication_error:self.status_label.setText("AuthenticationError.")else:self.status_label.setText("Unabletoconnect.")self.login_button.setDisabled(False)deltermself.connection_threads.remove(th)
| 480,567 |
def close_tab(self): sender = self.sender() for idx in range(0, self.tabs.count()): widget = self.tabs.widget(idx) if widget == sender: #or widget is None: self.tabs.close_tab(idx)
|
def close_tab(self): sender = self.sender() for idx in range(0, self.tabs.count()): widget = self.tabs.widget(idx) if widget == sender: #or widget is None: self.tabs.close_tab(idx)
| 480,568 |
def insert_row(self, num=1): buf = self.get_buffer() (row, col) = self.cursor.get_row_col() new_rows = [TerminalRow(self.width, self) for x in range(0, num)] buf.insert(row, '') buf[row:row + 1] = new_rows self.log.debug("Inserted %s row(s): %s" % (num, len(buf)))
|
def insert_row(self, num=1): buf = self.get_buffer() (row, col) = self.cursor.get_row_col() new_rows = [TerminalRow(self.width, self) for x in range(0, num)] buf.insert(row, '') buf[row:row + 1] = new_rows self.log.debug("Inserted %s row(s): %s" % (num, len(buf)))
| 480,569 |
def insert_row(self, num=1): buf = self.get_buffer() (row, col) = self.cursor.get_row_col() new_rows = [TerminalRow(self.width, self) for x in range(0, num)] buf.insert(row, '') buf[row:row + 1] = new_rows self.log.debug("Inserted %s row(s): %s" % (num, len(buf)))
|
def insert_row(self, num=1): buf = self.get_buffer() (row, col) = self.cursor.get_row_col() new_rows = [TerminalRow(self.width, self) for x in range(0, num)] buf.insert(row, '') buf[row:row + 1] = new_rows self.log.debug("Inserted %s row(s): %s" % (num, len(buf)))
| 480,570 |
def scroll(self, times=1): self.log.debug("screen scroll") if self.alternate_active: scroll_top = self.get_scroll_top() scroll_bottom = self.get_scroll_bottom() buf = self.get_buffer() for cnt in range(0, times): row = buf.pop(scroll_top - 1) row.reset() buf.insert(scroll_bottom - 1, row) self.parent.set_dirty() self.print_debug() return self.base += times self.log.debug("Scrolling screen buffer, base = %s, row = %s" % (self.base, self.cursor.row)) #if (self.base + self.height) - 1 >= self.scrollback: if (self.base - times) >= self.scrollback: self.log.debug("Scrollback exceeded...rolling over buffer.") self.base -= times for cnt in range(0, times): row = self.buffer.pop(0) row.reset() self.buffer.append(row) self.parent.set_dirty() self.parent.set_scroll_value(self.base)
|
def scroll(self, times=1): self.log.debug("screen scroll") if self.alternate_active: scroll_top = self.get_scroll_top() scroll_bottom = self.get_scroll_bottom() buf = self.get_buffer() first = scroll_top - 1 last = scroll_bottom - 1 rows = [TerminalRow(self.width, self) for x in range(0, times)] del buf[first:first + times] buf.insert(last, '') buf[last:last + 1] = rows repaint_buf = buf[first:last] for row in repaint_buf: row.set_dirty() return self.base += times self.log.debug("Scrolling screen buffer, base = %s, row = %s" % (self.base, self.cursor.row)) #if (self.base + self.height) - 1 >= self.scrollback: if (self.base - times) >= self.scrollback: self.log.debug("Scrollback exceeded...rolling over buffer.") self.base -= times for cnt in range(0, times): row = self.buffer.pop(0) row.reset() self.buffer.append(row) self.parent.set_dirty() self.parent.set_scroll_value(self.base)
| 480,571 |
def scroll(self, times=1): self.log.debug("screen scroll") if self.alternate_active: scroll_top = self.get_scroll_top() scroll_bottom = self.get_scroll_bottom() buf = self.get_buffer() for cnt in range(0, times): row = buf.pop(scroll_top - 1) row.reset() buf.insert(scroll_bottom - 1, row) self.parent.set_dirty() self.print_debug() return self.base += times self.log.debug("Scrolling screen buffer, base = %s, row = %s" % (self.base, self.cursor.row)) #if (self.base + self.height) - 1 >= self.scrollback: if (self.base - times) >= self.scrollback: self.log.debug("Scrollback exceeded...rolling over buffer.") self.base -= times for cnt in range(0, times): row = self.buffer.pop(0) row.reset() self.buffer.append(row) self.parent.set_dirty() self.parent.set_scroll_value(self.base)
|
defscroll(self,times=1):self.log.debug("screenscroll")ifself.alternate_active:scroll_top=self.get_scroll_top()scroll_bottom=self.get_scroll_bottom()buf=self.get_buffer()forcntinrange(0,times):row=buf.pop(scroll_top-1)row.reset()buf.insert(scroll_bottom-1,row)self.parent.set_dirty()self.print_debug()returnself.base+=timesself.log.debug("Scrollingscreenbuffer,base=%s,row=%s"%(self.base,self.cursor.row))#if(self.base+self.height)-1>=self.scrollback:if(self.base-times)>=self.scrollback:self.log.debug("Scrollbackexceeded...rollingoverbuffer.")self.base-=timesforcntinrange(0,times):row=self.buffer.pop(0)row.reset()self.buffer.append(row)self.parent.set_dirty()self.parent.set_scroll_value(self.base)
| 480,572 |
def process_call_function_command(message, sender, connection): try: interface = autobus.lookup_interface(message["interface_name"]) function = interface.lookup_function(message["function"]) except (autobus.NoSuchInterfaceException, autobus.NoSuchFunctionException) as e: connection.send_error(message, text=str(e)) return if function.special: function.invoke_special(message, connection) return invoke_message = create_message(RunFunctionCommand, interface_name=interface.name, function=function.name, arguments=message["arguments"]) interface.connection.send(invoke_message) print ("Sending run command to " + str(interface.connection.id) + " with message id " + str(invoke_message["message_id"]) + " whose response is to be forwarded with id " + str(message["message_id"])) # FIXME: This causes a response to a function invocation sent as a notification # to still be sent when the function returns on the remote side. We need to # somehow not add the message to this list and perhaps suppress the "sporadic # message received" warning that would consequently be printed to stdout once # the remote client sends back the return value if the incoming message here # is a notification. interface.connection.pending_responses[invoke_message["message_id"]] = ( sender, message["message_id"])
|
def process_call_function_command(message, sender, connection): interface_name = message["interface_name"] function_name = message["function"] print ("Attempting to dispatch function call from " + sender + " to interface " + interface_name + " and function " + function_name) try: interface = autobus.lookup_interface(interface_name) function = interface.lookup_function(function_name) except (autobus.NoSuchInterfaceException, autobus.NoSuchFunctionException) as e: connection.send_error(message, text=str(e)) return if function.special: function.invoke_special(message, connection) return invoke_message = create_message(RunFunctionCommand, interface_name=interface.name, function=function.name, arguments=message["arguments"]) interface.connection.send(invoke_message) print ("Sending run command to " + str(interface.connection.id) + " with message id " + str(invoke_message["message_id"]) + " whose response is to be forwarded with id " + str(message["message_id"])) # FIXME: This causes a response to a function invocation sent as a notification # to still be sent when the function returns on the remote side. We need to # somehow not add the message to this list and perhaps suppress the "sporadic # message received" warning that would consequently be printed to stdout once # the remote client sends back the return value if the incoming message here # is a notification. interface.connection.pending_responses[invoke_message["message_id"]] = ( sender, message["message_id"])
| 480,573 |
def do_GET(self): global last_plc_time global last_plc_address global last_rf_time global last_rf_address path = self.path if "?" not in path: # Serve the script page print "Serving script page for url " + path self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() with open("src/activehomed/receive_ie.html") as file: for line in file: self.wfile.write(line + " ") else: # Incoming event from the script page print "Inbound event for url " + path params = dict(parse_qsl(path.split("?")[1], True)) mode, address, command, sequence, timestamp, _, _ = (params["a"], params["b"], params["c"], params["d"], params["e"], params["f"], params["g"]) receive_action_event(mode, address, command, sequence, timestamp) repeat = False if mode.startswith("send") or mode.startswith("recv"): mode = mode[4:] now = time() if mode == "plc": repeat = (address == last_plc_address and (last_plc_time + PLC_DELAY) > now) last_plc_time = now last_plc_address = address elif mode == "rf": repeat = (address == last_rf_address and (last_rf_time + RF_DELAY) > now) last_rf_time = now last_rf_address = address house, unit = address[0], address[1:] if sequence == "": sequence = None else: try: sequence = int(sequence) except ValueError: print ("WARNING: Sequence number " + str(sequence) + " couldn't be converted to an integer.") if timestamp == "": timestamp = None receive_event(mode, house, unit, address, command, sequence, timestamp, repeat) self.send_response(200) self.send_header("Content-Type", "text/plain") self.end_headers() self.wfile.write("ok")
|
def do_GET(self): global last_plc_time global last_plc_address global last_rf_time global last_rf_address path = self.path if "?" not in path: # Serve the script page print "Serving script page for url " + path self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() with open("src/activehomed/receive_ie.html") as file: for line in file: self.wfile.write(line + " ") else: # Incoming event from the script page print "Inbound event for url " + path params = dict(parse_qsl(path.split("?")[1], True)) mode, address, command, sequence, timestamp, _, _ = (params["a"], params["b"], params["c"], params["d"], params["e"], params["f"], params["g"]) receive_action_event(mode, address, command, sequence, timestamp) repeat = False if mode.startswith("send") or mode.startswith("recv"): mode = mode[4:] now = time() if mode == "plc": repeat = (last_plc_time + PLC_DELAY) > now last_plc_time = now last_plc_address = address elif mode == "rf": repeat = (address == last_rf_address and (last_rf_time + RF_DELAY) > now) last_rf_time = now last_rf_address = address house, unit = address[0], address[1:] if sequence == "": sequence = None else: try: sequence = int(sequence) except ValueError: print ("WARNING: Sequence number " + str(sequence) + " couldn't be converted to an integer.") if timestamp == "": timestamp = None receive_event(mode, house, unit, address, command, sequence, timestamp, repeat) self.send_response(200) self.send_header("Content-Type", "text/plain") self.end_headers() self.wfile.write("ok")
| 480,574 |
def do_GET(self): global last_plc_time global last_plc_address global last_rf_time global last_rf_address path = self.path if "?" not in path: # Serve the script page print "Serving script page for url " + path self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() with open("src/activehomed/receive_ie.html") as file: for line in file: self.wfile.write(line + " ") else: # Incoming event from the script page print "Inbound event for url " + path params = dict(parse_qsl(path.split("?")[1], True)) mode, address, command, sequence, timestamp, _, _ = (params["a"], params["b"], params["c"], params["d"], params["e"], params["f"], params["g"]) receive_action_event(mode, address, command, sequence, timestamp) repeat = False if mode.startswith("send") or mode.startswith("recv"): mode = mode[4:] now = time() if mode == "plc": repeat = (address == last_plc_address and (last_plc_time + PLC_DELAY) > now) last_plc_time = now last_plc_address = address elif mode == "rf": repeat = (address == last_rf_address and (last_rf_time + RF_DELAY) > now) last_rf_time = now last_rf_address = address house, unit = address[0], address[1:] if sequence == "": sequence = None else: try: sequence = int(sequence) except ValueError: print ("WARNING: Sequence number " + str(sequence) + " couldn't be converted to an integer.") if timestamp == "": timestamp = None receive_event(mode, house, unit, address, command, sequence, timestamp, repeat) self.send_response(200) self.send_header("Content-Type", "text/plain") self.end_headers() self.wfile.write("ok")
|
def do_GET(self): global last_plc_time global last_plc_address global last_rf_time global last_rf_address path = self.path if "?" not in path: # Serve the script page print "Serving script page for url " + path self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() with open("src/activehomed/receive_ie.html") as file: for line in file: self.wfile.write(line + " ") else: # Incoming event from the script page print "Inbound event for url " + path params = dict(parse_qsl(path.split("?")[1], True)) mode, address, command, sequence, timestamp, _, _ = (params["a"], params["b"], params["c"], params["d"], params["e"], params["f"], params["g"]) receive_action_event(mode, address, command, sequence, timestamp) repeat = False if mode.startswith("send") or mode.startswith("recv"): mode = mode[4:] now = time() if mode == "plc": repeat = (address == last_plc_address and (last_plc_time + PLC_DELAY) > now) last_plc_time = now elif mode == "rf": repeat = (address == last_rf_address and (last_rf_time + RF_DELAY) > now) last_rf_time = now last_rf_address = address house, unit = address[0], address[1:] if sequence == "": sequence = None else: try: sequence = int(sequence) except ValueError: print ("WARNING: Sequence number " + str(sequence) + " couldn't be converted to an integer.") if timestamp == "": timestamp = None receive_event(mode, house, unit, address, command, sequence, timestamp, repeat) self.send_response(200) self.send_header("Content-Type", "text/plain") self.end_headers() self.wfile.write("ok")
| 480,575 |
def wrapper(*args, **kwargs): with lock: function(*args, **kwargs)
|
def wrapper(*args, **kwargs): with lock: function(*args, **kwargs)
| 480,576 |
def sql(self): return "objects.path like ? escape ?", [self.path.replace("/", "//") + "///%", "/"]
|
def sql(self): return "objects.path like ? escape ?", [self.path.replace("/", "//") + "///%", "/"]
| 480,577 |
def addquote(sink, arguments, context): """ Syntax: {addquote|<group>|<quote>} -- Adds a new quote to the specified group. This function then evaluates to the number that the new quote was assigned. Numbering starts at 1 for blank groups. Groups must already be present in the quote system configuration before quotes can be added to them; see ~config global quote. If the specified quote is empty, a ResponseException will be thrown. """ quotegroup = arguments.resolveString(0) quotetext = arguments.resolveString(1) if quotetext.strip() == "": raise ResponseException("You can't add an empty quote") with quote_lock: if not quotegroup in Configuration.getText(None, "quote/groupnames").split(" "): raise FactoidException("The group " + quotegroup + " does not exist.") next_id_result = execute("select nextquote from quotesequence where " "quotegroup = ?", [quotegroup]).fetchone() if next_id_result is None: next_id_result = 0 execute_commit("insert into quotesequence values (?, 0)", [quotegroup]) else: next_id_result = next_id_result[0] next_id_result += 1 execute_commit("update quotesequence set nextquote = ? where quotegroup = ?", [next_id_result, quotegroup]) execute_commit("insert into quotes values(?, ?, ?, ?)", [quotegroup, next_id_result, quotetext, False]) add_quote_info(quotegroup, next_id_result, nick=context.getSender().getNick(), user=context.getSender().getUsername(), host=context.getSender().getHostname(), server=context.getSender().getServerName(), scope=context.getCanonicalName(), date=str(currentTimeMillis())) sink.write(next_id_result)
|
def addquote(sink, arguments, context): """ Syntax: {addquote|<group>|<quote>} -- Adds a new quote to the specified group. This function then evaluates to the number that the new quote was assigned. Numbering starts at 1 for blank groups. Groups must already be present in the quote system configuration before quotes can be added to them; see ~config global quote. If the specified quote is empty, a ResponseException will be thrown. """ quotegroup = arguments.resolveString(0) quotetext = arguments.resolveString(1) if quotetext.strip() == "": raise FactoidException("You can't add an empty quote") with quote_lock: if not quotegroup in Configuration.getText(None, "quote/groupnames").split(" "): raise FactoidException("The group " + quotegroup + " does not exist.") next_id_result = execute("select nextquote from quotesequence where " "quotegroup = ?", [quotegroup]).fetchone() if next_id_result is None: next_id_result = 0 execute_commit("insert into quotesequence values (?, 0)", [quotegroup]) else: next_id_result = next_id_result[0] next_id_result += 1 execute_commit("update quotesequence set nextquote = ? where quotegroup = ?", [next_id_result, quotegroup]) execute_commit("insert into quotes values(?, ?, ?, ?)", [quotegroup, next_id_result, quotetext, False]) add_quote_info(quotegroup, next_id_result, nick=context.getSender().getNick(), user=context.getSender().getUsername(), host=context.getSender().getHostname(), server=context.getSender().getServerName(), scope=context.getCanonicalName(), date=str(currentTimeMillis())) sink.write(next_id_result)
| 480,578 |
def do_GET(self): path = self.path path_components = path[1:].split("/") if len(path_components) == 1 and path_components[0] == "": path_components = [] if len(path_components) > 0 and path_components[-1] == "": path_components = path_components[:-1] if len(path_components) == 0: self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write(""" <html><body><b>Group listing is not supported right now.</b> It will be supported at some time in the future. </body></html> """) return elif len(path_components) == 1: # Group listing with quote_lock: quotenumbers = search_quotes(path_components[0], "") # TODO: we need to add paging at some point quotedata = [get_quote_data(path_components[0], quotenumber) for quotenumber in quotenumbers] self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write(""" <html><body><h2>%s</h2><br/> """ % path_components[0]) for quotetext, quoteinfo in quotedata: self.wfile.write(""" %s<br/> <small><font color="#707070">Added by <font color="#008c00"><b>%s</b></font> <%s@%s> from %s on <font color="#0055bb"><b>%s</b></font> at %s</font></small><br/><br/> """ % (escapeHtml(quotetext), escapeHtml(quoteinfo["nick"]), escapeHtml(quoteinfo["user"]), escapeHtml(quoteinfo["host"]), escapeHtml(quoteinfo["server"]), escapeHtml(Date(long(quoteinfo["date"])).toString()), escapeHtml(quoteinfo["scope"]))) self.wfile.write(""" </body></html> """) return # OLD STUFF self.send_response(200) self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write("The path is " + self.path)
|
def do_GET(self): path = self.path path_components = path[1:].split("/") if len(path_components) == 1 and path_components[0] == "": path_components = [] if len(path_components) > 0 and path_components[-1] == "": path_components = path_components[:-1] if len(path_components) == 0: self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write(""" <html><body><b>Group listing is not supported right now.</b> It will be supported at some time in the future. </body></html> """) return elif len(path_components) == 1: # Group listing with quote_lock: quotenumbers = search_quotes(path_components[0], "") # TODO: we need to add paging at some point quotedata = [get_quote_data(path_components[0], quotenumber) for quotenumber in quotenumbers] self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write(""" <html><body><h2>%s</h2><br/> """ % path_components[0]) for quotetext, quoteinfo in quotedata: self.wfile.write(""" %s<br/> <small><font color="#707070">Added by <font color="#008c00"><b>%s</b></font> <%s@%s> from %s on <font color="#0055bb"><b>%s</b></font> at %s</font></small><br/><br/> """ % (escapeHtml(quotetext), escapeHtml(quoteinfo["nick"]), escapeHtml(quoteinfo["user"]), escapeHtml(quoteinfo["host"]), escapeHtml(quoteinfo["server"]), escapeHtml(Date(long(quoteinfo["date"])).toString()), escapeHtml(quoteinfo["scope"]))) self.wfile.write(""" </body></html> """) return # OLD STUFF self.send_response(200) self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write("The path is " + self.path)
| 480,579 |
def do_GET(self): path = self.path if ".." in path: raise Exception("Path can't contain two dots in a row") print "Initial path: " + path if path == "": path = "/" if path[0] != "/": raise Exception("Path doesn't start with a forward slash. It's " + path) path = root_path + path print "Getting result for path " + path try: result = client.cat(path) except: print "Result not there; trying index.html under it" if path[-1] != "/": path += "/" path += "index.html" try: result = client.cat(path) except: print "Couldn't find index.html either" print_exc() result = None if result == None: self.send_response(404) self.send_header("Content-Type", "text/html") self.no_cache() self.end_headers() self.wfile.write(error_response) return print "Got it! Propgetting..." # We have the file. Now we go figure out if we're supposed to use an # alternate displayer. try: display_type = client.propget("svnweb:display", path).values[0] except: display_type = None print "svnweb:display is " + str(display_type) if display_type == "mediawiki": print "Forwarding to mediawiki renderer" mime_type, result = display_mediawiki(self, path, result) else: print "No known renderer set with svnweb:display, displaying directly" try: mime_type = client.propget("svn:mime-type", path).values[0] except: print "Couldn't propget, looking up dynamically" mime_type, _ = mimetypes.guess_type(path) if mime_type is None: print "Dynamic lookup didn't find anything. Using text/plain." mime_type = "text/plain" print "Mime type is " + mime_type self.send_response(200) print "Response sent" if mime_type != None: print "Sending mime type" self.send_header("Content-Type", mime_type) print "Sending no-cache headers" self.no_cache() print "Ending headers" self.end_headers() print "Writing..." self.wfile.write(result) print "Output sent!" # That's it!
|
def do_GET(self): path = self.path if ".." in path: raise Exception("Path can't contain two dots in a row") print "Initial path: " + path if path == "": path = "/" if path[0] != "/": raise Exception("Path doesn't start with a forward slash. It's " + path) path = root_path + path print "Getting result for path " + path try: result = client.cat(path) except: print "Result not there; trying index.html under it" if path[-1] != "/": path += "/" path += "index.html" try: result = client.cat(path) except: print "Couldn't find index.html either" print_exc() result = None if result == None: self.send_response(404) self.send_header("Content-Type", "text/html") self.no_cache() self.end_headers() self.wfile.write(error_response) return print "Got it! Propgetting..." # We have the file. Now we go figure out if we're supposed to use an # alternate displayer. try: display_type = client.propget("svnweb:display", path).values()[0] except: display_type = None print "svnweb:display is " + str(display_type) if display_type == "mediawiki": print "Forwarding to mediawiki renderer" mime_type, result = display_mediawiki(self, path, result) else: print "No known renderer set with svnweb:display, displaying directly" try: mime_type = client.propget("svn:mime-type", path).values[0] except: print "Couldn't propget, looking up dynamically" mime_type, _ = mimetypes.guess_type(path) if mime_type is None: print "Dynamic lookup didn't find anything. Using text/plain." mime_type = "text/plain" print "Mime type is " + mime_type self.send_response(200) print "Response sent" if mime_type != None: print "Sending mime type" self.send_header("Content-Type", mime_type) print "Sending no-cache headers" self.no_cache() print "Ending headers" self.end_headers() print "Writing..." self.wfile.write(result) print "Output sent!" # That's it!
| 480,580 |
def do_GET(self): path = self.path if ".." in path: raise Exception("Path can't contain two dots in a row") print "Initial path: " + path if path == "": path = "/" if path[0] != "/": raise Exception("Path doesn't start with a forward slash. It's " + path) path = root_path + path print "Getting result for path " + path try: result = client.cat(path) except: print "Result not there; trying index.html under it" if path[-1] != "/": path += "/" path += "index.html" try: result = client.cat(path) except: print "Couldn't find index.html either" print_exc() result = None if result == None: self.send_response(404) self.send_header("Content-Type", "text/html") self.no_cache() self.end_headers() self.wfile.write(error_response) return print "Got it! Propgetting..." # We have the file. Now we go figure out if we're supposed to use an # alternate displayer. try: display_type = client.propget("svnweb:display", path).values[0] except: display_type = None print "svnweb:display is " + str(display_type) if display_type == "mediawiki": print "Forwarding to mediawiki renderer" mime_type, result = display_mediawiki(self, path, result) else: print "No known renderer set with svnweb:display, displaying directly" try: mime_type = client.propget("svn:mime-type", path).values[0] except: print "Couldn't propget, looking up dynamically" mime_type, _ = mimetypes.guess_type(path) if mime_type is None: print "Dynamic lookup didn't find anything. Using text/plain." mime_type = "text/plain" print "Mime type is " + mime_type self.send_response(200) print "Response sent" if mime_type != None: print "Sending mime type" self.send_header("Content-Type", mime_type) print "Sending no-cache headers" self.no_cache() print "Ending headers" self.end_headers() print "Writing..." self.wfile.write(result) print "Output sent!" # That's it!
|
def do_GET(self): path = self.path if ".." in path: raise Exception("Path can't contain two dots in a row") print "Initial path: " + path if path == "": path = "/" if path[0] != "/": raise Exception("Path doesn't start with a forward slash. It's " + path) path = root_path + path print "Getting result for path " + path try: result = client.cat(path) except: print "Result not there; trying index.html under it" if path[-1] != "/": path += "/" path += "index.html" try: result = client.cat(path) except: print "Couldn't find index.html either" print_exc() result = None if result == None: self.send_response(404) self.send_header("Content-Type", "text/html") self.no_cache() self.end_headers() self.wfile.write(error_response) return print "Got it! Propgetting..." # We have the file. Now we go figure out if we're supposed to use an # alternate displayer. try: display_type = client.propget("svnweb:display", path).values[0] except: display_type = None print "svnweb:display is " + str(display_type) if display_type == "mediawiki": print "Forwarding to mediawiki renderer" mime_type, result = display_mediawiki(self, path, result) else: print "No known renderer set with svnweb:display, displaying directly" try: mime_type = client.propget("svn:mime-type", path).values()[0] except: print "Couldn't propget, looking up dynamically" mime_type, _ = mimetypes.guess_type(path) if mime_type is None: print "Dynamic lookup didn't find anything. Using text/plain." mime_type = "text/plain" print "Mime type is " + mime_type self.send_response(200) print "Response sent" if mime_type != None: print "Sending mime type" self.send_header("Content-Type", mime_type) print "Sending no-cache headers" self.no_cache() print "Ending headers" self.end_headers() print "Writing..." self.wfile.write(result) print "Output sent!" # That's it!
| 480,581 |
def addquote(sink, arguments, context): """ Syntax: {addquote|<group>|<quote>} -- Adds a new quote to the specified group. This function then evaluates to the number that the new quote was assigned. Numbering starts at 1 for blank groups. Groups must already be present in the quote system configuration before quotes can be added to them; see ~config global quote. """ with quote_lock: quotegroup = arguments.resolveString(0) quotetext = arguments.resolveString(1) if not quotegroup in Configuration.getText(None, "quote/groupnames").split(" "): raise FactoidException("The group " + quotegroup + " does not exist.") next_id_result = execute("select nextquote from quotesequence where " "quotegroup = ?", [quotegroup]).fetchone() if next_id_result is None: next_id_result = 0 execute_commit("insert into quotesequence values (?, 0)", [quotegroup]) else: next_id_result = next_id_result[0] next_id_result += 1 execute_commit("update quotesequence set nextquote = ? where quotegroup = ?", [next_id_result, quotegroup]) execute_commit("insert into quotes values(?, ?, ?, ?)", [quotegroup, next_id_result, quotetext, False]) add_quote_info(quotegroup, next_id_result, nick=context.getSender().getNick(), user=context.getSender().getUsername(), host=context.getSender().getHostname(), server=context.getSender().getServerName(), scope=context.getCanonicalName(), date=str(currentTimeMillis())) sink.write(next_id_result)
|
def addquote(sink, arguments, context): """ Syntax: {addquote|<group>|<quote>} -- Adds a new quote to the specified group. This function then evaluates to the number that the new quote was assigned. Numbering starts at 1 for blank groups. Groups must already be present in the quote system configuration before quotes can be added to them; see ~config global quote. If the specified quote is empty, a ResponseException will be thrown. """ quotegroup = arguments.resolveString(0) quotetext = arguments.resolveString(1) if quotetext.strip() == "": raise ResponseException("You can't add an empty quote") with quote_lock: if not quotegroup in Configuration.getText(None, "quote/groupnames").split(" "): raise FactoidException("The group " + quotegroup + " does not exist.") next_id_result = execute("select nextquote from quotesequence where " "quotegroup = ?", [quotegroup]).fetchone() if next_id_result is None: next_id_result = 0 execute_commit("insert into quotesequence values (?, 0)", [quotegroup]) else: next_id_result = next_id_result[0] next_id_result += 1 execute_commit("update quotesequence set nextquote = ? where quotegroup = ?", [next_id_result, quotegroup]) execute_commit("insert into quotes values(?, ?, ?, ?)", [quotegroup, next_id_result, quotetext, False]) add_quote_info(quotegroup, next_id_result, nick=context.getSender().getNick(), user=context.getSender().getUsername(), host=context.getSender().getHostname(), server=context.getSender().getServerName(), scope=context.getCanonicalName(), date=str(currentTimeMillis())) sink.write(next_id_result)
| 480,582 |
def __eq__(self, other): return (isinstance(other, Changeset) and self.path == other.path and self.db is other.db)
|
def __eq__(self, other): return (isinstance(other, Changeset) and self.path == other.path and self.db is other.db)
| 480,583 |
def time_format_weekday_month_day(self, time): """ Returns time_format_weekday(time) + " " + time_format_month_day(time) """ return (self.time_format_weekday(time) + " " + self.time_format_month_day(time))
|
def time_format_weekday_month_day(self, time): """ Returns time_format_weekday(time) + " " + time_format_month_day(time) """ return (self.time_format_weekday(time) + " " + self.time_format_month_day(time))
| 480,584 |
def sanitize_file(name): return name.replace(".", "").replace("\\", "").replace("/", "")
|
def sanitize_file(name): return name.replace(".", "").replace("\\", "").replace("/", "")
| 480,585 |
def sanitize_file(name): return name.replace(".", "").replace("\\", "").replace("/", "")
|
def sanitize_file(name): return name.replace(".", "").replace("\\", "").replace("/", "")
| 480,586 |
def query(self, message, timeout=30): """ Sends the specified message from the server, waiting up to the specified timeout for a response. When a response is received, it is returned. If a response is not received within the specified amount of time, a TimeoutException will be raised. Otherwise, the response sent by the server will be returned. """ queue = Queue() if self.receive_queues is None: raise NotConnectedException() self.receive_queues[message["message_id"]] = queue self.send(message) try: response = queue.get(block=True, timeout=timeout) except Empty: try: del self.receive_queues[message["message_id"]] except KeyError: pass raise TimeoutException() # If we don't get a KeyError, it's guaranteed that the input thread # will already have removed the queue, so we don't need to worry about # removing it. return response
|
def query(self, message, timeout=30): """ Sends the specified message from the server, waiting up to the specified timeout for a response. When a response is received, it is returned. If a response is not received within the specified amount of time, a TimeoutException will be raised. Otherwise, the response sent by the server will be returned. """ queue = Queue() if self.receive_queues is None or self.input_thread is None: raise NotConnectedException() self.receive_queues[message["message_id"]] = queue self.send(message) try: response = queue.get(block=True, timeout=timeout) except Empty: try: del self.receive_queues[message["message_id"]] except KeyError: pass raise TimeoutException() # If we don't get a KeyError, it's guaranteed that the input thread # will already have removed the queue, so we don't need to worry about # removing it. return response
| 480,587 |
def inverse(self): """ Returns a new query that selects objects only if they would not be selected by this query. If you only want to invert a small part of the overall query, you can do that by constructing everything else in your query, creating a separate query, filtering it by the part you want to invert, inverting it, and then using the & operator to get a new query that only inverts the one query. """ return PrefixFilter("not", SQLFilter(*self.get_filter_sql()))
|
def inverse(self): """ Returns a new query that selects objects only if they would not be selected by this query. If you only want to invert a small part of the overall query, you can do that by constructing everything else in your query, creating a separate query, filtering it by the part you want to invert, inverting it, and then using the & operator to get a new query that only inverts the one query. """ query = Query(self.db) query.filters.append(PrefixFilter("not", SQLFilter(*self.get_filter_sql()))) return query
| 480,588 |
def foreign_get(object, item): if object is None or object is Null: return None try: return foreign_translate(object[item]) except KeyError: return None
|
def foreign_get(object, item): if object is None or object is Null: return None try: return foreign_translate(object[item]) except (KeyError, IndexError): return None
| 480,589 |
def usage(): print "Usage: ./cmeansMultiGPU.py INPUT_FILE NUM_CLUSTERS [THRESHOLD=0.0001] [MIN_ITERS=0] [MAX_ITERS=100] [DEVICE=0] [FUZZINESS=2] [DISTANCE_MEASURE=0] [K1=1.0] [K2=0.01] [K3=1.5] [MEMBER_THRESHOLD=0.05] [TABU_ITER=100] [TABU_TENURE=5] [MDL=0] [CPU_ONLY=0]" print print " INPUT_FILE and NUM_CLUSTERS are required." print " The rest of the parameters can be specified in NAME=VALUE form" print " Alternatively, the parameters can be provided positionally if all are provided"
|
def usage(): print "Usage: ./cmeansMultiGPU.py INPUT_FILE NUM_CLUSTERS [THRESHOLD=0.0001] [MIN_ITERS=0] [MAX_ITERS=100] [DEVICE=0] [FUZZINESS=2] [DISTANCE_MEASURE=0] [K1=1.0] [K2=0.01] [K3=1.5] [MEMBER_THRESHOLD=0.05] [TABU_ITER=100] [TABU_TENURE=5] [MDL=0] [CPU_ONLY=0] [TRUNCATE=1] [RANDOM_SEED=1]" print print " INPUT_FILE and NUM_CLUSTERS are required." print " The rest of the parameters can be specified in NAME=VALUE form" print " Alternatively, the parameters can be provided positionally if all are provided"
| 480,590 |
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
|
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD','FUZZINESS']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
| 480,591 |
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
|
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events if params['TRUNCATE']: params['NUM_EVENTS'] -= params['NUM_EVENTS'] % (16*num_gpus) print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % (16*num_gpus)) else: print "Invalid input file." sys.exit(1) return params
| 480,592 |
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
|
def current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) parseInputArgs(): current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) sys.argv current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_args current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) len(args) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) { current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'INPUT_FILE' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) '', current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'NUM_CLUSTERS' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'THRESHOLD' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0.0001, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'MIN_ITERS' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'MAX_ITERS' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 100, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'DEVICE' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'FUZZINESS' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) : current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 2, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'DISTANCE_MEASURE': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'K1': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 1.0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'K2': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0.01, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'K3': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 1.5, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'MEMBER_THRESHOLD': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0.05, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'TABU_ITER': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 100, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'TABU_TENURE': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 5, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'MDL': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 'CPU_ONLY': current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0, current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) } current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_params current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) len(params.keys()) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) if current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_args current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) == current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_params: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['INPUT_FILE'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[1] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_CLUSTERS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[2] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['THRESHOLD'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[3] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['MIN_ITERS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[4] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['MAX_ITERS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[5] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['DEVICE'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[6] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['FUZZINESS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[7] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['DISTANCE_MEASURE'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[8] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['K1'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[9] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['K2'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[10] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['K3'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[11] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['MEMBER_THRESHOLD'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[12] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['TABU_ITER'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[13] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['TABU_TENURE'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[14] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['MDL'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[15] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['CPU_ONLY'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[16] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) elif current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_args current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) == current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 3: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['INPUT_FILE'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[1] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_CLUSTERS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[2] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) elif current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 3 current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) < current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_args current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) < current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_params: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['INPUT_FILE'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[1] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_CLUSTERS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[2] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) for current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) arg current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) in current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) args[3:]: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) try: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) key,val current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) arg.split("=") current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) key current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) key.upper() current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) assert current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) key current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) in current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params.keys() current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) if current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) key current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) in current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params[key] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) float(val) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) else: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params[key] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) int(val) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) except current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) AssertionError: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) "Error: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) Found current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) invalid current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) parameter current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) '%s'" current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) % current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) key current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) except current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) ValueError: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) "Error: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) Invalid current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) value current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) '%s' current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) for current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) parameter current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) '%s'" current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) % current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) (val,key) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) usage() current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) sys.exit(1) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) else: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) "Invalid current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) command current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) line current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) arguments." current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) usage() current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) sys.exit(1) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) if current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) os.path.exists(params['INPUT_FILE']): current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) if current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['INPUT_FILE'].lower().endswith(".bin"): current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) input current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) open(params['INPUT_FILE'],'rb') current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) import current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) struct current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_EVENTS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) struct.unpack('i',input.read(4))[0] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_DIMENSIONS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) struct.unpack('i',input.read(4))[0] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) else: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) input current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) open(params['INPUT_FILE']) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) line current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) input.readline() current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) # current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) Read current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) the current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) header current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) line current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_dimensions current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) len(line.split(DELIMITER)) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_events current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 0 current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) for current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) line current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) in current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) input: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_events current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) += current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 1 current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_DIMENSIONS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_dimensions current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_EVENTS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) = current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) num_events current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_EVENTS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) -= current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params['NUM_EVENTS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) % current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 16 current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) "%d current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) events current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) removed current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) to current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) ensure current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) memory current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) alignment" current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) % current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) (params['NUM_EVENTS'] current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) % current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) 16) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) else: current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) print current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) "Invalid current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) input current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) file." current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) sys.exit(1) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) return current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH) params current_path = os.getcwd() print "Current Directory: %s" % current_path print "PROJECT_PATH: %s" % PROJECT_PATH print "Compiling C-means for target file" os.chdir(PROJECT_PATH)
| 480,593 |
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
|
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
| 480,594 |
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
|
def parseInputArgs(): args = sys.argv num_args = len(args) params = { 'INPUT_FILE' : '', 'NUM_CLUSTERS' : 0, 'THRESHOLD' : 0.0001, 'MIN_ITERS' : 0, 'MAX_ITERS' : 100, 'DEVICE' : 0, 'FUZZINESS' : 2, 'DISTANCE_MEASURE': 0, 'K1': 1.0, 'K2': 0.01, 'K3': 1.5, 'MEMBER_THRESHOLD': 0.05, 'TABU_ITER': 100, 'TABU_TENURE': 5, 'MDL': 0, 'CPU_ONLY': 0, } num_params = len(params.keys()) if num_args == num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] params['THRESHOLD'] = args[3] params['MIN_ITERS'] = args[4] params['MAX_ITERS'] = args[5] params['DEVICE'] = args[6] params['FUZZINESS'] = args[7] params['DISTANCE_MEASURE'] = args[8] params['K1'] = args[9] params['K2'] = args[10] params['K3'] = args[11] params['MEMBER_THRESHOLD'] = args[12] params['TABU_ITER'] = args[13] params['TABU_TENURE'] = args[14] params['MDL'] = args[15] params['CPU_ONLY'] = args[16] elif num_args == 3: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] elif 3 < num_args < num_params: params['INPUT_FILE'] = args[1] params['NUM_CLUSTERS'] = args[2] for arg in args[3:]: try: key,val = arg.split("=") key = key.upper() assert key in params.keys() if key in ['K1','K2','K3','MEMBER_THRESHOLD','THRESHOLD']: params[key] = float(val) else: params[key] = int(val) except AssertionError: print "Error: Found invalid parameter '%s'" % key except ValueError: print "Error: Invalid value '%s' for parameter '%s'" % (val,key) print usage() sys.exit(1) else: print "Invalid command line arguments." print usage() sys.exit(1) if os.path.exists(params['INPUT_FILE']): if params['INPUT_FILE'].lower().endswith(".bin"): input = open(params['INPUT_FILE'],'rb') import struct params['NUM_EVENTS'] = struct.unpack('i',input.read(4))[0] params['NUM_DIMENSIONS'] = struct.unpack('i',input.read(4))[0] else: input = open(params['INPUT_FILE']) line = input.readline() # Read the header line num_dimensions = len(line.split(DELIMITER)) num_events = 0 for line in input: num_events += 1 params['NUM_DIMENSIONS'] = num_dimensions params['NUM_EVENTS'] = num_events params['NUM_EVENTS'] -= params['NUM_EVENTS'] % 16 print "%d events removed to ensure memory alignment" % (params['NUM_EVENTS'] % 16) else: print "Invalid input file." sys.exit(1) return params
| 480,595 |
def evaluate(region, document, globs): try: old_compile = doctest.compile except AttributeError: old_compile = compile doctest.compile = monkey_compile if not isinstance(region.parsed, TestCase): return result = manuel.doctest.DocTestResult() if region.parsed.group: test_name = region.parsed.group else: test_name = os.path.split(document.location)[1] exc_msg = None output = region.parsed.output if output: match = doctest.DocTestParser._EXCEPTION_RE.match(output) if match: exc_msg = match.group('msg') test_options = {doctest.ELLIPSIS: True, doctest.IGNORE_EXCEPTION_DETAIL: True, doctest.DONT_ACCEPT_TRUE_FOR_1: True, } options = region.parsed.options if options: for x in options.split(','): x = x.strip() sign = x[0] value = eval('doctest.' + x[1:]) test_options[value] = sign == '+' example = doctest.Example(region.parsed.code, output, exc_msg=exc_msg, lineno=region.lineno, options=test_options) test = doctest.DocTest([example], globs, test_name, document.location, region.lineno-1, None) runner = doctest.DocTestRunner() runner.DIVIDER = '' # disable unwanted result formatting runner.run(test, clear_globs=False) region.evaluated = result doctest.compile = old_compile
|
def evaluate(region, document, globs): try: old_compile = doctest.compile except AttributeError: old_compile = compile doctest.compile = monkey_compile result = manuel.doctest.DocTestResult() if region.parsed.group: test_name = region.parsed.group else: test_name = os.path.split(document.location)[1] exc_msg = None output = region.parsed.output if output: match = doctest.DocTestParser._EXCEPTION_RE.match(output) if match: exc_msg = match.group('msg') test_options = {doctest.ELLIPSIS: True, doctest.IGNORE_EXCEPTION_DETAIL: True, doctest.DONT_ACCEPT_TRUE_FOR_1: True, } options = region.parsed.options if options: for x in options.split(','): x = x.strip() sign = x[0] value = eval('doctest.' + x[1:]) test_options[value] = sign == '+' example = doctest.Example(region.parsed.code, output, exc_msg=exc_msg, lineno=region.lineno, options=test_options) test = doctest.DocTest([example], globs, test_name, document.location, region.lineno-1, None) runner = doctest.DocTestRunner() runner.DIVIDER = '' # disable unwanted result formatting runner.run(test, clear_globs=False) region.evaluated = result doctest.compile = old_compile
| 480,596 |
def newlineify(s): if s[-1] != '\n': s += '\n' return s
|
def newlineify(s): if s == '' or s[-1] != '\n': s += '\n' return s
| 480,597 |
def evaluate_with(self, m, globs): globs = GlobWrapper(globs) for region in list(self): for evaluater in sort_handlers(m.evaluaters): evaluater(region, self, globs)
|
def evaluate_with(self, m, globs): wrapped_globs = GlobWrapper(globs) for region in list(self): for evaluater in sort_handlers(m.evaluaters): evaluater(region, self, globs)
| 480,598 |
def evaluate_with(self, m, globs): globs = GlobWrapper(globs) for region in list(self): for evaluater in sort_handlers(m.evaluaters): evaluater(region, self, globs)
|
def evaluate_with(self, m, globs): globs = GlobWrapper(globs) for region in list(self): for evaluater in sort_handlers(m.evaluaters): evaluater(region, self, globs)
| 480,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.