rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if (module_path is not None) and self.modulePrefix(): module_path = '.'.join([self.modulePrefix(), module_path]) if (module_path is None) and self.generateToFiles(): raise pyxb.BindingGenerationError('No prefix or module name available for %s' % (module_record,)) | if (module_path is not None) and self.modulePrefix(): module_path = '.'.join([self.modulePrefix(), module_path]) if (module_path is None) and self.generateToFiles(): raise pyxb.BindingGenerationError('No prefix or module name available for %s' % (module_record,)) | def __assignModulePath (self, module_record, module_path=None): if module_record.modulePath() is not None: return module_record namespace = module_record.namespace() if not namespace.isAbsentNamespace(): if (module_path is None) and not (namespace.prefix() is None): module_path = namespace.prefix() module_path = self.namespaceModuleMap().get(namespace.uri(), module_path) if (module_path is not None) and self.modulePrefix(): # non-empty value module_path = '.'.join([self.modulePrefix(), module_path]) if (module_path is None) and self.generateToFiles(): raise pyxb.BindingGenerationError('No prefix or module name available for %s' % (module_record,)) module_record.setModulePath(module_path) return module_record | 8ea59cbae9a140c591f48604e56cd7f8c8b53ca7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/8ea59cbae9a140c591f48604e56cd7f8c8b53ca7/generate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6145,
3120,
743,
261,
2890,
16,
1605,
67,
3366,
16,
1605,
67,
803,
33,
7036,
4672,
309,
1605,
67,
3366,
18,
2978,
743,
1435,
353,
486,
599,
30,
327,
1605,
67,
3366,
1981,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6145,
3120,
743,
261,
2890,
16,
1605,
67,
3366,
16,
1605,
67,
803,
33,
7036,
4672,
309,
1605,
67,
3366,
18,
2978,
743,
1435,
353,
486,
599,
30,
327,
1605,
67,
3366,
1981,
273,
... |
if __name__=="__main__": | if __name__ == "__main__": | def weighted_average(obj,**kwargs): """ This function takes a SOM or SO and calculates the weighted average for the primary axis. Parameters: ---------- -> obj is a SOM or SO that will have the weighted average calculated from it -> kwargs is a list of key word arguments that the function accepts: start=<index of starting bin> end=<index of ending bin> Return: ------ <- A tuple (for a SO) or a list of tuples (for a SOM) containing the weighted average and the uncertainty squared associated with the weighted average Exceptions: ---------- <- TypeError is raised if a tuple or another construct (besides a SOM or SO) is passed to the function """ # import the helper functions import hlr_utils # set up for working through data # This time highest object in the hierarchy is NOT what we need result = [] if(hlr_utils.get_length(obj) > 1): res_descr = "list" else: res_descr = "number" (o_descr,d_descr)=hlr_utils.get_descr(obj) if(kwargs.has_key("start")): start=int(kwargs["start"]) else: start=0 if(kwargs.has_key("end")): end=int(kwargs["end"]) else: end=hlr_utils.get_length(obj)-1 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) # iterate through the values import utils for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"y") err2 = hlr_utils.get_err2(obj,i,o_descr,"y") value=utils.weighted_average(val, err2, start, end) hlr_utils.result_insert(result,res_descr,value,None,"all") import copy return copy.deepcopy(result) | ab79edf433672f6155274e6964e46e97c3dbeb1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/ab79edf433672f6155274e6964e46e97c3dbeb1c/hlr_weighted_average.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13747,
67,
15621,
12,
2603,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
578,
7460,
471,
17264,
326,
13747,
8164,
364,
326,
3354,
2654,
18,
225,
7012,
30,
12181,
317,
1081... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13747,
67,
15621,
12,
2603,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
578,
7460,
471,
17264,
326,
13747,
8164,
364,
326,
3354,
2654,
18,
225,
7012,
30,
12181,
317,
1081... |
def endElement(self, name ): """Signals the end of an element. | def endElementNS(self, name, qname): """Signals the end of an element in namespace mode. | def endElement(self, name ): """Signals the end of an element. | 52c4e834e77743da5017f08efdb43e047504d2bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/52c4e834e77743da5017f08efdb43e047504d2bc/handler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
262,
30,
3536,
23346,
326,
679,
434,
392,
930,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
262,
30,
3536,
23346,
326,
679,
434,
392,
930,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
peer_object[object.primary_key] = peer_object_id | peer_object[primary_key] = peer_object_id | def trace (message): if classname == trace_type and peer_object_id in trace_ids: message_verbose('TRACE>>'+message) | be959d0158ffaff6d50158269f03ba7f2c1da56f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7598/be959d0158ffaff6d50158269f03ba7f2c1da56f/RefreshPeer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
261,
2150,
4672,
309,
7479,
422,
2606,
67,
723,
471,
4261,
67,
1612,
67,
350,
316,
2606,
67,
2232,
30,
883,
67,
11369,
2668,
23827,
34,
1870,
15,
2150,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
261,
2150,
4672,
309,
7479,
422,
2606,
67,
723,
471,
4261,
67,
1612,
67,
350,
316,
2606,
67,
2232,
30,
883,
67,
11369,
2668,
23827,
34,
1870,
15,
2150,
13,
2,
-100,
-100,
-100,
... |
"""Returns the number of dates covered by the range.""" | """Return the number of dates covered by the range.""" | def __len__(): """Returns the number of dates covered by the range.""" | 5ba2b5ea4a81f7081be373d909b14bfbb8e141d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/5ba2b5ea4a81f7081be373d909b14bfbb8e141d0/interfaces.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
13332,
3536,
1356,
326,
1300,
434,
7811,
18147,
635,
326,
1048,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
13332,
3536,
1356,
326,
1300,
434,
7811,
18147,
635,
326,
1048,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
group theory. Of course, G must be a group of low order. | group theory. Of course, `G` must be a group of low order. EXAMPLES: | def cayley_table(self, names="x"): """ Returns the multiplication table, or Cayley table, of the finite group G in the form of a matrix with symbolic coefficients. This function is useful for learning, teaching, and exploring elementary group theory. Of course, G must be a group of low order. | 2d077a3331069892dd585070aa02c876686672d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/2d077a3331069892dd585070aa02c876686672d2/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
528,
30678,
67,
2121,
12,
2890,
16,
1257,
1546,
92,
6,
4672,
3536,
2860,
326,
23066,
1014,
16,
578,
385,
528,
30678,
1014,
16,
434,
326,
25922,
1041,
611,
316,
326,
646,
434,
279,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
528,
30678,
67,
2121,
12,
2890,
16,
1257,
1546,
92,
6,
4672,
3536,
2860,
326,
23066,
1014,
16,
578,
385,
528,
30678,
1014,
16,
434,
326,
25922,
1041,
611,
316,
326,
646,
434,
279,... |
def _act_smartly(self, rank, obstacle, obstacle_is_light, next_position): | def _act_smartly(self, rank): next_position = self.position + self.speed * delta_t obstacle, obstacle_is_light = self._next_obstacle(rank) | def _act_smartly(self, rank, obstacle, obstacle_is_light, next_position): # No obstacle if next_position + self.length / 2 + self.headway < obstacle: # « 1 trait danger, 2 traits sécurité : je fonce ! » self.position = next_position if self.speed + self.acceleration * delta_t >= self.location.max_speed: self.speed = self.location.max_speed elif self.speed < self.location.max_speed: self.speed += self.acceleration * delta_t # EXPERIMENTAL : accounting for the deceleration in front of an obstacle # There is a problem with this part: imho the car should not decelerate until either the car ahead does, or the traffic lights are red! Plus, this should be done using acceleration, not speed directly-- Sharayanan # I've done this because in real life, when a car arrives at a crossroad, it has to decelerate by security and because it cannot turn while moving so fast ; your second point is alright, but more difficult to implement -- Ch@hine if (self.position + self.speed * 30 * delta_t + self.length / 2 + self.headway > obstacle): if obstacle_is_light: if self.speed > 5: self.speed /= 1.5 else: if self.speed - self.location.cars[rank + 1].speed > 5: self.speed = (self.speed - self.location.cars[rank + 1].speed) / 2 + self.location.cars[rank + 1].speed # Obstacle = previous car elif not obstacle_is_light: # On s'arrête au prochain obstacle if not self.waiting: self.position = obstacle - self.length/2 - self.headway #CONVENTION SENSITIVE self.waiting = self.location.cars[rank + 1].waiting # EXPERIMENTAL : stop the car that is waiting if self.waiting: self.speed = 0 # Obstacle = light elif next_position + self.length / 2 + self.headway >= obstacle: id_slot = self.location.end.slots_roads.index(self.location) #slot in front of the car location if self.location.gates[1] and not self.location.end.slots_cars.has_key(id_slot): #le slot correspondant est vide # Everything's ok, let's go ! self.waiting = False self.join(self.location.end) else: # We have a closed gate in front of us : stop & align or the fronted (the 'en-face') slot is full self.position = self.location.length - self.headway - self.length / 2 self.waiting = True | 2868875de75ba3626bca979e4a65cc74c2a144ad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4798/2868875de75ba3626bca979e4a65cc74c2a144ad/car.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
621,
67,
26416,
715,
12,
2890,
16,
6171,
4672,
1024,
67,
3276,
9079,
273,
365,
18,
3276,
397,
365,
18,
13871,
380,
3622,
67,
88,
3768,
334,
16066,
16,
3768,
334,
16066,
67,
291,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
621,
67,
26416,
715,
12,
2890,
16,
6171,
4672,
1024,
67,
3276,
9079,
273,
365,
18,
3276,
397,
365,
18,
13871,
380,
3622,
67,
88,
3768,
334,
16066,
16,
3768,
334,
16066,
67,
291,
... |
line = line.rstrip() | line = line.strip() | def run(self, lines, method): self.generate_context(lines) self.context.dump(method) | 016d0650ec26df5df6781c2e39f30071cdb993ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/016d0650ec26df5df6781c2e39f30071cdb993ed/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
2362,
16,
707,
4672,
365,
18,
7163,
67,
2472,
12,
3548,
13,
365,
18,
2472,
18,
8481,
12,
2039,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
2362,
16,
707,
4672,
365,
18,
7163,
67,
2472,
12,
3548,
13,
365,
18,
2472,
18,
8481,
12,
2039,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
super(dm_campaign, self).write(cr, uid, cmp_id, {'name':default, 'date_start':0}) | super(dm_campaign, self).write(cr, uid, cmp_id, {'name':default, 'date_start':0, 'date':0}) | def copy(self, cr, uid, id, default=None, context={}): cmp_id = super(dm_campaign, self).copy(cr, uid, id, default) data = self.browse(cr, uid, cmp_id, context) default='Copy of %s' % data.name super(dm_campaign, self).write(cr, uid, cmp_id, {'name':default, 'date_start':0}) return cmp_id | 69c8954d987167cad030faf89e21c8ebbb6cb792 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/69c8954d987167cad030faf89e21c8ebbb6cb792/campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
805,
33,
7036,
16,
819,
12938,
4672,
9411,
67,
350,
273,
2240,
12,
10956,
67,
14608,
16,
365,
2934,
3530,
12,
3353,
16,
4555,
16,
612... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
805,
33,
7036,
16,
819,
12938,
4672,
9411,
67,
350,
273,
2240,
12,
10956,
67,
14608,
16,
365,
2934,
3530,
12,
3353,
16,
4555,
16,
612... |
msgFile = os.fdopen(fd, 'w') | msgFile = open(filename, 'w') | def writeToFile(filename, message, overwrite=True): dir_name = os.path.dirname(filename) if not os.access(dir_name, os.W_OK): os.mkdir(dir_name) if os.access(filename, os.F_OK) and not overwrite: # already have file there; let's back it up try: os.rename(filename, filename + '.save') except: return False fd = os.open(filename, os.O_WRONLY | os.O_CREAT, 0644) msgFile = os.fdopen(fd, 'w') try: msgFile.write(message) finally: msgFile.close() fd.close() return True | 842f6f8bff6392bf6a24eaf9a751f4cd3d375fdd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/842f6f8bff6392bf6a24eaf9a751f4cd3d375fdd/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12870,
812,
12,
3459,
16,
883,
16,
6156,
33,
5510,
4672,
1577,
67,
529,
273,
1140,
18,
803,
18,
12287,
12,
3459,
13,
309,
486,
1140,
18,
3860,
12,
1214,
67,
529,
16,
1140,
18,
59,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12870,
812,
12,
3459,
16,
883,
16,
6156,
33,
5510,
4672,
1577,
67,
529,
273,
1140,
18,
803,
18,
12287,
12,
3459,
13,
309,
486,
1140,
18,
3860,
12,
1214,
67,
529,
16,
1140,
18,
59,
... |
event.Skip() | else: event.Skip() | def OnCommand(self, event): """ Catch commands and pass them along to the blocks. Our events have ids between MINIMUM_WX_ID and MAXIMUM_WX_ID Delay imports to avoid circular references. """ from osaf.framework.blocks.Block import Block, BlockEvent from osaf.framework.notifications.Notification import Notification | dc2a7caed137386810b45c80164651c6b1ee2d33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/dc2a7caed137386810b45c80164651c6b1ee2d33/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2189,
12,
2890,
16,
871,
4672,
3536,
21984,
4364,
471,
1342,
2182,
7563,
358,
326,
4398,
18,
29613,
2641,
1240,
3258,
3086,
6989,
18605,
67,
59,
60,
67,
734,
471,
4552,
18605,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2189,
12,
2890,
16,
871,
4672,
3536,
21984,
4364,
471,
1342,
2182,
7563,
358,
326,
4398,
18,
29613,
2641,
1240,
3258,
3086,
6989,
18605,
67,
59,
60,
67,
734,
471,
4552,
18605,
67,
... |
class BozoError(Exception): pass | Unpacking sequence too short | def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError | 4f813074150348704b07b2ebfc7dc357e888a6aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4f813074150348704b07b2ebfc7dc357e888a6aa/test_unpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'notes': _('Notes')} | 'notes': _('Notes'), 'addresses': _('Addresses')} | def breadcrumbs(self): if self.context is not None: app = traverse(self.context, '/') return [(_('Start'), absoluteURL(self.request, app, 'start'))] else: return [] | 89cd969edd6ceca1627e34c91cdb07cb3359cec6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/89cd969edd6ceca1627e34c91cdb07cb3359cec6/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18414,
12,
2890,
4672,
309,
365,
18,
2472,
353,
486,
599,
30,
595,
273,
10080,
12,
2890,
18,
2472,
16,
2023,
13,
327,
306,
24899,
2668,
1685,
19899,
4967,
1785,
12,
2890,
18,
2293,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18414,
12,
2890,
4672,
309,
365,
18,
2472,
353,
486,
599,
30,
595,
273,
10080,
12,
2890,
18,
2472,
16,
2023,
13,
327,
306,
24899,
2668,
1685,
19899,
4967,
1785,
12,
2890,
18,
2293,
16,... |
output_format['last_mod_date'] = time.ctime(os.stat(path)[stat.ST_MTIME]) | try: output_format['last_mod_date'] = time.ctime(os.stat(path)[stat.ST_MTIME]) except OSError: continue | def perform_request_output_formats_management(ln=cdslang, sortby="code"): """ Returns the main management console for output formats. Includes list of output formats and associated administration tools. @param ln language @param sortby the sorting crieteria (can be 'code' or 'name') @return the main page for output formats management """ # Reload in case a format was changed bibformat_engine.clear_caches() # Get output formats lists of attributes output_formats_list = bibformat_engine.get_output_formats(with_attributes=True) output_formats = {} for filename in output_formats_list: output_format = output_formats_list[filename] code = output_format['attrs']['code'] path = CFG_BIBFORMAT_OUTPUTS_PATH + os.sep + filename output_format['editable'] = can_write_output_format(code) output_format['last_mod_date'] = time.ctime(os.stat(path)[stat.ST_MTIME]) # Validate the output format status = check_output_format(code) # If there is an error but the error is just 'format is not writable', do not display as error if len(status) > 1 or (len(status)==1 and status[0][0] != 'ERR_BIBFORMAT_CANNOT_WRITE_OUTPUT_FILE'): status = ''' <a style="color: rgb(255, 0, 0);" href="%(weburl)s/admin/bibformat/bibformatadmin.py/validate_format?ln=%(ln)s&bfo=%(bfo)s">Not OK</a> ''' % {'weburl':weburl, 'ln':ln, 'bfo':code} else: status = '<span style="color: rgb(0, 255, 0);">OK</span>' output_format['status'] = status output_formats[filename] = output_format # Sort according to code or name, inspired from Python Cookbook def get_attr(dic, attr): """ Returns the value given by 'attr' in the dictionary 'dic', representing an output format attributes. If attr is equal to 'code', returns the code attribute of the dictionary. Else returns the generic name @param dic a dictionary of the attribute of an output format, as returned by bibformat_engine.get_output_format @param the attribute we want to fetch. Either 'code' or any other string """ if attr == "code": return dic['attrs']['code'] else: return dic['attrs']['names']['generic'] def sort_by_attr(seq, attr): """ Sort dictionaries given in 'seq' according to parameter 'attr' """ intermed = [ (get_attr(x, attr), i, x) for i, x in enumerate(seq)] intermed.sort() return [x[-1] for x in intermed] if sortby != "code" and sortby != "name": sortby = "code" sorted_output_formats = sort_by_attr(output_formats.values(), sortby) return bibformat_templates.tmpl_admin_output_formats_management(ln, sorted_output_formats) | f5a875e8fb0a2e41ed3bb6e72f376d2f2d936dd5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/f5a875e8fb0a2e41ed3bb6e72f376d2f2d936dd5/bibformatadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
2844,
67,
11962,
67,
17381,
12,
2370,
33,
4315,
2069,
539,
16,
1524,
1637,
1546,
710,
6,
4672,
3536,
2860,
326,
2774,
11803,
2983,
364,
876,
6449,
18,
225,
657,
899... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
2844,
67,
11962,
67,
17381,
12,
2370,
33,
4315,
2069,
539,
16,
1524,
1637,
1546,
710,
6,
4672,
3536,
2860,
326,
2774,
11803,
2983,
364,
876,
6449,
18,
225,
657,
899... |
common.inprint("m_swizzle = swizzle;") common.inprint("m_neg = neg;") | def constructors(self, size = 0): common.inprint(self.tpl(size)) common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : ShGeneric<" + self.sizevar(size) + ", T>" + "(new ShVariableNode(Binding, " + self.sizevar(size) + "))") common.inprint("{") common.inprint("}") common.inprint("") | facca941ae19f8cbcd9c8ad3d939cf84df54688e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1804/facca941ae19f8cbcd9c8ad3d939cf84df54688e/ShAttribImpl.hpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19874,
12,
2890,
16,
963,
273,
374,
4672,
2975,
18,
267,
1188,
12,
2890,
18,
10933,
12,
1467,
3719,
2975,
18,
267,
1188,
12,
2890,
18,
10933,
6429,
12,
1467,
13,
397,
31120,
397,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19874,
12,
2890,
16,
963,
273,
374,
4672,
2975,
18,
267,
1188,
12,
2890,
18,
10933,
12,
1467,
3719,
2975,
18,
267,
1188,
12,
2890,
18,
10933,
6429,
12,
1467,
13,
397,
31120,
397,
365,
... | |
os.path.join('tools', 'run_tests.py'), options.params] | os.path.join('tools', 'run_tests.py')] | def runUnitSuite(options): """ Run all unit tests in a single process >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> options.modes = ['release', 'debug'] >>> runUnitSuite(options) /.../release/RunPython... tools/run_tests.py -v application i18n osaf repository - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /.../debug/RunPython... tools/run_tests.py -v application i18n osaf repository - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False """ failed = False for mode in options.modes: cmd = [options.runpython[mode], os.path.join('tools', 'run_tests.py'), options.params] if options.verbose: cmd += ['-v'] cmd += ['application', 'i18n', 'osaf', 'repository'] if options.verbose: log(' '.join(cmd)) if options.params: cmd += [ options.params ] if options.dryrun: result = 0 else: result = build_lib.runCommand(cmd, timeout=3600) if result != 0: log('***Error exit code=%d' % result) failed = True failedTests.append('unitSuite') if failed and not options.noStop: break log('- + ' * 15) return failed | b699ba32e2c975274e5bcf6e3ec7d39769952732 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/b699ba32e2c975274e5bcf6e3ec7d39769952732/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
2802,
13587,
12,
2116,
4672,
3536,
1939,
777,
2836,
7434,
316,
279,
2202,
1207,
225,
4080,
702,
273,
1109,
1320,
1435,
4080,
866,
1320,
12,
2116,
13,
4080,
702,
18,
25011,
2681,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
2802,
13587,
12,
2116,
4672,
3536,
1939,
777,
2836,
7434,
316,
279,
2202,
1207,
225,
4080,
702,
273,
1109,
1320,
1435,
4080,
866,
1320,
12,
2116,
13,
4080,
702,
18,
25011,
2681,
22... |
for p in Products.__ac_permissions__: | Products_permissions = getattr(Products, '__ac_permissions__', ()) for p in Products_permissions: | def possible_permissions(self): d={} for p in Products.__ac_permissions__: d[p[0]]=1 for p in self.aq_acquire('_getProductRegistryData')('ac_permissions'): d[p[0]]=1 | 023abfa1a167dbf1f94c12c929bf7bd4917336e5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9658/023abfa1a167dbf1f94c12c929bf7bd4917336e5/Role.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3323,
67,
9612,
12,
2890,
4672,
302,
12938,
8094,
87,
67,
9612,
273,
3869,
12,
13344,
16,
4940,
1077,
67,
9612,
972,
2187,
1832,
13,
364,
293,
316,
8094,
87,
67,
9612,
30,
302,
63,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3323,
67,
9612,
12,
2890,
4672,
302,
12938,
8094,
87,
67,
9612,
273,
3869,
12,
13344,
16,
4940,
1077,
67,
9612,
972,
2187,
1832,
13,
364,
293,
316,
8094,
87,
67,
9612,
30,
302,
63,
8... |
def all_devices_sxpr(self): | def all_devices_sxpr(self, target = None): | def all_devices_sxpr(self): """Returns the SXPR for all devices in the current configuration.""" sxprs = [] pci_devs = [] | 393521c96a1a88da8f338100ccd966a371bca9f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/393521c96a1a88da8f338100ccd966a371bca9f9/XendConfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
12506,
67,
30319,
683,
12,
2890,
16,
1018,
273,
599,
4672,
3536,
1356,
326,
348,
60,
8025,
364,
777,
7166,
316,
326,
783,
1664,
12123,
13280,
683,
87,
273,
5378,
6125,
77,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
12506,
67,
30319,
683,
12,
2890,
16,
1018,
273,
599,
4672,
3536,
1356,
326,
348,
60,
8025,
364,
777,
7166,
316,
326,
783,
1664,
12123,
13280,
683,
87,
273,
5378,
6125,
77,
67,... |
for user in users: if len(submissions) > 0: row = submissions.pop(0) submissions.append(row.copy()) | if len(submissions) == 1: row = submissions.pop(0) row['user'] = users[0] allocations.append(row) else: for user in users: | def _allocate(self, referencedBox): """ Get all (accepted or graded) assignments in the referenced assignment box and re-assign each submission to a new user. | 75da71d63e1ab9f43cb6dbe8dd29a0e8d1c2138c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7973/75da71d63e1ab9f43cb6dbe8dd29a0e8d1c2138c/ECReviewBox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16247,
12,
2890,
16,
8042,
3514,
4672,
3536,
968,
777,
261,
23847,
578,
3087,
785,
13,
13610,
316,
326,
8042,
6661,
3919,
471,
283,
17,
6145,
1517,
8515,
358,
279,
394,
729,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16247,
12,
2890,
16,
8042,
3514,
4672,
3536,
968,
777,
261,
23847,
578,
3087,
785,
13,
13610,
316,
326,
8042,
6661,
3919,
471,
283,
17,
6145,
1517,
8515,
358,
279,
394,
729,
18,
2... |
'Modules', ' | 'Modules', ' | def docmodule(self, object, name=None, mod=None, *ignored): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name try: all = object.__all__ except AttributeError: all = None parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) url = path if sys.platform == 'win32': import nturl2path url = nturl2path.pathname2url(path) filelink = '<a href="file:%s">%s</a>' % (url, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') docloc = self.getdocloc(object) if docloc is not None: docloc = '<br><a href="%(docloc)s">Module Docs</a>' % locals() else: docloc = '' result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink + docloc) | b169eaa91704a44e350cf66c5e68981964b6764d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/b169eaa91704a44e350cf66c5e68981964b6764d/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
2978,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
380,
24055,
4672,
3536,
25884,
3982,
7323,
364,
279,
1605,
733,
12123,
508,
273,
733,
16186,
529,
972,
468,
2305... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
2978,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
380,
24055,
4672,
3536,
25884,
3982,
7323,
364,
279,
1605,
733,
12123,
508,
273,
733,
16186,
529,
972,
468,
2305... |
print "__hash__:", args | def __hash__(self, *args): print "__hash__:", args return hash(id(self)) | 6addbd51e99eed73f715fd88f76faa1499ffcafa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/6addbd51e99eed73f715fd88f76faa1499ffcafa/test_class.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2816,
972,
12,
2890,
16,
380,
1968,
4672,
327,
1651,
12,
350,
12,
2890,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2816,
972,
12,
2890,
16,
380,
1968,
4672,
327,
1651,
12,
350,
12,
2890,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
initials = map(denormalize_segment, initials) | grid = map(denormalize_segment, *zip(*grid)) | def denormalize_segment(start_time, end_time): start_time = model.getStartTime() + model_sim_len * start_time end_time = model.getStartTime() + model_sim_len * end_time return (start_time, end_time) | 733964346bd705d3e3fa78795693f8a99289c936 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/733964346bd705d3e3fa78795693f8a99289c936/shooting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24919,
554,
67,
9273,
12,
1937,
67,
957,
16,
679,
67,
957,
4672,
787,
67,
957,
273,
938,
18,
588,
13649,
1435,
397,
938,
67,
9812,
67,
1897,
380,
787,
67,
957,
679,
67,
957,
273,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24919,
554,
67,
9273,
12,
1937,
67,
957,
16,
679,
67,
957,
4672,
787,
67,
957,
273,
938,
18,
588,
13649,
1435,
397,
938,
67,
9812,
67,
1897,
380,
787,
67,
957,
679,
67,
957,
273,
9... |
for task1 in range(len(self.runq_fnid)): task = self.prio_map[task1] fn = self.taskData.fn_index[self.runq_fnid[task]] taskname = self.runq_task[task] if bb.build.stamp_is_current(taskname, self.dataCache, fn): bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task))) self.runq_running[task] = 1 self.runq_buildable[task] = 1 self.task_complete(task) self.stats.taskCompleted() self.stats.taskSkipped() | def execute_runqueue_internal(self): """ Run the tasks in a queue prepared by prepare_runqueue """ | ac230953dd922cf11fe74221b49dcabc2432e962 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2672/ac230953dd922cf11fe74221b49dcabc2432e962/runqueue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
2681,
4000,
67,
7236,
12,
2890,
4672,
3536,
1939,
326,
4592,
316,
279,
2389,
8208,
635,
2911,
67,
2681,
4000,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
2681,
4000,
67,
7236,
12,
2890,
4672,
3536,
1939,
326,
4592,
316,
279,
2389,
8208,
635,
2911,
67,
2681,
4000,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
tree_index[str(n._nid)]=n | def _get_tree(self, tree=None, treeid=None, pre_drawing_action=None): if not treeid: treeid = hashlib.md5(str(time.time())).hexdigest() | cdfd4c15471b23ff2c41028a5d8437394e975ea0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/cdfd4c15471b23ff2c41028a5d8437394e975ea0/webplugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3413,
12,
2890,
16,
2151,
33,
7036,
16,
2151,
350,
33,
7036,
16,
675,
67,
9446,
310,
67,
1128,
33,
7036,
4672,
309,
486,
2151,
350,
30,
2151,
350,
273,
15956,
18,
1264,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3413,
12,
2890,
16,
2151,
33,
7036,
16,
2151,
350,
33,
7036,
16,
675,
67,
9446,
310,
67,
1128,
33,
7036,
4672,
309,
486,
2151,
350,
30,
2151,
350,
273,
15956,
18,
1264,... | |
def GetCity(ip=None, timezone=False) : """Gets the location with the context of the city of the given IP. If no IP is given, then the location of the client is given. The timezone option defaults to False, to spare the server some queries.""" baseurl = "http://ipinfodb.com/ip_query.php" return GetIPInfo(baseurl, ip, timezone) | def GetCountry(self, ip=None, timezone=False) : """Gets the location with the context of the country of the given IP. If no IP is given, then the location of the client is given. The timezone option defaults to False, to spare the server some queries.""" baseurl = "http://api.ipinfodb.com/v2/ip_query_country.php" return self.GetIPInfo(baseurl, ip, timezone) | def GetCity(ip=None, timezone=False) : """Gets the location with the context of the city of the given IP. If no IP is given, then the location of the client is given. The timezone option defaults to False, to spare the server some queries.""" baseurl = "http://ipinfodb.com/ip_query.php" return GetIPInfo(baseurl, ip, timezone) | f5d3e4af2e9677952e2fb6450f9be98ad4bd95c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8316/f5d3e4af2e9677952e2fb6450f9be98ad4bd95c8/pyipinfodb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
8142,
12,
2890,
16,
2359,
33,
7036,
16,
6371,
33,
8381,
13,
294,
3536,
3002,
326,
2117,
598,
326,
819,
434,
326,
5251,
434,
326,
864,
2971,
18,
225,
971,
1158,
2971,
353,
864,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
8142,
12,
2890,
16,
2359,
33,
7036,
16,
6371,
33,
8381,
13,
294,
3536,
3002,
326,
2117,
598,
326,
819,
434,
326,
5251,
434,
326,
864,
2971,
18,
225,
971,
1158,
2971,
353,
864,
1... |
NotImplementedError, "Coercion of this datatype not implemented yet" | elif self.type() == 'intvec': return tuple([sage.rings.integer.Integer(str(e)) for e in self]) else: raise NotImplementedError, "Coercion of this datatype not implemented yet" | def _sage_(self, R=None): """ Coerces self to SAGE. """ if self.type()=='poly': return self.sage_poly(R) if self.type() == 'module': return self.sage_matrix(R,sparse=True) if self.type() == 'matrix': return self.sage_matrix(R,sparse=False) if self.type() == 'list': return [ f._sage_(R) for f in self ] | d4e7b9609291ed79acc2fd37bcca0aec4fe0cc71 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/d4e7b9609291ed79acc2fd37bcca0aec4fe0cc71/singular.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
87,
410,
67,
12,
2890,
16,
534,
33,
7036,
4672,
3536,
7695,
264,
764,
365,
358,
348,
2833,
18,
3536,
309,
365,
18,
723,
1435,
18920,
16353,
4278,
327,
365,
18,
87,
410,
67,
1635... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
87,
410,
67,
12,
2890,
16,
534,
33,
7036,
4672,
3536,
7695,
264,
764,
365,
358,
348,
2833,
18,
3536,
309,
365,
18,
723,
1435,
18920,
16353,
4278,
327,
365,
18,
87,
410,
67,
1635... |
l = l[l.find(" ")+3:] l = l[:l.find(" ")] l = "".join(l.split()) | l = l.strip() l = l[l.find(" "):] l = l.strip() l = l[:40] l = l.replace(" ","") | def import_hexcap(): p = "" try: while 1: l = raw_input() l = l[l.find(" ")+3:] l = l[:l.find(" ")] l = "".join(l.split()) p += l except EOFError: pass p2="" for i in range(len(p)/2): p2 += chr(int(p[2*i:2*i+2],16)) return p2 | e331990b0d8485c2b144b8e75bc86ef78d647e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/e331990b0d8485c2b144b8e75bc86ef78d647e42/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
7118,
5909,
13332,
293,
273,
1408,
775,
30,
1323,
404,
30,
328,
273,
1831,
67,
2630,
1435,
328,
273,
328,
18,
6406,
1435,
328,
273,
328,
63,
80,
18,
4720,
2932,
225,
315,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
7118,
5909,
13332,
293,
273,
1408,
775,
30,
1323,
404,
30,
328,
273,
1831,
67,
2630,
1435,
328,
273,
328,
18,
6406,
1435,
328,
273,
328,
63,
80,
18,
4720,
2932,
225,
315,
4... |
glite_location = os.environ.get('GLITE_LOCATION').split('glite')[0] glite_ui= '%s/etc/profile.d/grid-env.sh ' % glite_location | gliteLocation = os.environ.get('GLITE_LOCATION').split('glite')[0] gliteUi = '%s/etc/profile.d/grid-env.sh ' % gliteLocation | def __init__( self, **args): | 7c4efde2270e23664acd0941720340358547054e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/7c4efde2270e23664acd0941720340358547054e/SchedulerGLite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
2826,
1968,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
2826,
1968,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.tasks.append(task) | state.tasks.append(task) | def _load_state(self, resource=None): # Load the resource as a unicode string Text._load_state(self, resource) # Split the raw data in lines. lines = self._data.splitlines() # Append None to signal the end of the data. lines.append(None) # Free the un-needed data structure, 'self._data' del self._data | 107a3ea087947fb4bcce4cb6619d3546a6509baa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/107a3ea087947fb4bcce4cb6619d3546a6509baa/TaskTracker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
2019,
12,
2890,
16,
1058,
33,
7036,
4672,
468,
4444,
326,
1058,
487,
279,
5252,
533,
3867,
6315,
945,
67,
2019,
12,
2890,
16,
1058,
13,
468,
5385,
326,
1831,
501,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
2019,
12,
2890,
16,
1058,
33,
7036,
4672,
468,
4444,
326,
1058,
487,
279,
5252,
533,
3867,
6315,
945,
67,
2019,
12,
2890,
16,
1058,
13,
468,
5385,
326,
1831,
501,
316,
... |
self.energyLabel.setText("Energy: %.3f" % E) self.energyLabel.repaint() self.graph.updateData(attrList) self.graph.repaint() if singleStep: noChange = 5 else: if E > minE*0.99: noChange += 1 | self.energyLabel.setText("Energy: %.3f" % E) self.energyLabel.repaint() self.graph.updateData(attrList) self.graph.repaint() if singleStep: noChange = 5 | def freeAttributes(self, iterations, steps, singleStep = False): attrList = self.getShownAttributeList() classes = [int(x.getclass()) for x in self.graph.rawdata] optimizer = self.lockToCircle and orangeom.optimizeAnchorsRadial or orangeom.optimizeAnchors ai = self.graph.attributeNameIndex attrIndices = [ai[label] for label in self.getShownAttributeList()] if not singleStep: minE = orangeom.computeEnergy(Numeric.transpose(self.graph.scaledData).tolist(), classes, self.graph.anchorData, attrIndices, self.attractG, -self.repelG) # repeat until less than 1% energy decrease in 5 consecutive iterations*steps steps noChange = 0 while noChange < 5: for i in range(iterations): self.graph.anchorData, E = optimizer(Numeric.transpose(self.graph.scaledData).tolist(), classes, self.graph.anchorData, attrIndices, self.attractG, -self.repelG, steps) self.energyLabel.setText("Energy: %.3f" % E) self.energyLabel.repaint() self.graph.updateData(attrList) self.graph.repaint() if singleStep: noChange = 5 else: if E > minE*0.99: noChange += 1 else: minE = E noChange = 0 | 40c2509d416a9941ff0b88f2e4a161e7800886f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/40c2509d416a9941ff0b88f2e4a161e7800886f3/OWRadviz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
2498,
12,
2890,
16,
11316,
16,
6075,
16,
2202,
4160,
273,
1083,
4672,
1604,
682,
273,
365,
18,
588,
27042,
1499,
682,
1435,
3318,
273,
306,
474,
12,
92,
18,
588,
1106,
10756,
364... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
2498,
12,
2890,
16,
11316,
16,
6075,
16,
2202,
4160,
273,
1083,
4672,
1604,
682,
273,
365,
18,
588,
27042,
1499,
682,
1435,
3318,
273,
306,
474,
12,
92,
18,
588,
1106,
10756,
364... |
def delete_parameter(self, param_id, parent_id, parent_type=ModuleFunction.vtType): | def delete_parameter(self, param_id, param_type, parent_type, parent_id): | def delete_parameter(self, param_id, parent_id, parent_type=ModuleFunction.vtType): self.db_delete_object(param_id, ModuleParam.vtType, parent_type, parent_id) self.remove_alias(ModuleParam.vtType, param_id, parent_type, parent_id, None) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
6775,
12,
2890,
16,
579,
67,
350,
16,
579,
67,
723,
16,
982,
67,
723,
16,
982,
67,
350,
4672,
365,
18,
1966,
67,
3733,
67,
1612,
12,
891,
67,
350,
16,
5924,
786,
18,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
6775,
12,
2890,
16,
579,
67,
350,
16,
579,
67,
723,
16,
982,
67,
723,
16,
982,
67,
350,
4672,
365,
18,
1966,
67,
3733,
67,
1612,
12,
891,
67,
350,
16,
5924,
786,
18,
11... |
def __init__(self, title, message, parent): self.loading_dialog = None self.message = message | def __init__(self, title, parent): self.loading_dialog = None | def __init__(self, title, message, parent): self.loading_dialog = None self.message = message self.parent = parent self.title = title | d4da2d8cacde0fd853192cdf7f0f0d9fb6c1ead0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14305/d4da2d8cacde0fd853192cdf7f0f0d9fb6c1ead0/pysdic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2077,
16,
982,
4672,
365,
18,
15174,
67,
12730,
273,
599,
365,
18,
2938,
273,
982,
365,
18,
2649,
273,
2077,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2077,
16,
982,
4672,
365,
18,
15174,
67,
12730,
273,
599,
365,
18,
2938,
273,
982,
365,
18,
2649,
273,
2077,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return a - text | return line_start_p - text | static int def _wordwrap_helper(char const *text, int w, h, void (*cb)(int a, int b, void *data), void *data): int y = land_text_y_pos() float fh = land_font_state->font->size char const *a = text printf("wordwrap %d %d\n", w, h) while 1: char *ptr = (char *)a if h > 0 and land_text_y_pos() >= y + h: break int n = 0, ok_n = 0 float offset = 0 float www = 0 int c while 1: # Find next possible break location. bool skip = True while 1: c = land_utf8_char(&ptr) if c == 0: break if c == '\n': break if c == ' ': if not skip: break else: skip = False n++ offset = land_text_get_char_offset(a, n) int x = offset if x > w: if ok_n > 0: n = ok_n else: www = x break www = x if c == 0 or c == '\n': break ok_n = n n++ if www > land_font_state->wordwrap_width: land_font_state->wordwrap_width = www land_font_state->wordwrap_height += fh cb(a - text, a + n - text, data) a += n + 1 if c == 0: break return a - text | bfbdc17cfb9650eed81eb71f02e1137ba3225959 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/930/bfbdc17cfb9650eed81eb71f02e1137ba3225959/font.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
760,
509,
1652,
389,
1095,
4113,
67,
4759,
12,
3001,
1866,
380,
955,
16,
509,
341,
16,
366,
16,
918,
261,
14,
7358,
21433,
474,
279,
16,
509,
324,
16,
918,
380,
892,
3631,
918,
380,
892,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
760,
509,
1652,
389,
1095,
4113,
67,
4759,
12,
3001,
1866,
380,
955,
16,
509,
341,
16,
366,
16,
918,
261,
14,
7358,
21433,
474,
279,
16,
509,
324,
16,
918,
380,
892,
3631,
918,
380,
892,
... |
if not token in ['else', 'elif', 'endif']: if skipped in self.state or ignored in self.state: return if token == 'if': ret = eval_macro(tokenize(line), self.defs) if ret: state[-1] = accepted else: state[-1] = ignored elif token == 'ifdef': m = re_mac.search(line) if m and m.group(0) in self.defs: state[-1] = accepted else: state[-1] = ignored elif token == 'ifndef': m = re_mac.search(line) if m and m.group(0) in self.defs: state[-1] = ignored else: state[-1] = accepted elif token == 'include' or token == 'import': (kind, inc) = extract_include(line, self.defs) if inc in self.ban_includes: return if token == 'import': self.ban_includes.append(inc) if ve: debug('preproc: include found %s (%s)', inc, kind) if kind == '"' or not strict_quotes: self.tryfind(inc) | def process_line(self, token, line): ve = Logs.verbose if ve: debug('preproc: line is %s - %s state is %s', token, line, self.state) state = self.state | f1abe304277b7050dee15acb300ba2380fec8230 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/f1abe304277b7050dee15acb300ba2380fec8230/c_preproc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1369,
12,
2890,
16,
1147,
16,
980,
4672,
10489,
273,
20238,
18,
11369,
309,
10489,
30,
1198,
2668,
1484,
9381,
30,
980,
353,
738,
87,
300,
738,
87,
919,
353,
738,
87,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1369,
12,
2890,
16,
1147,
16,
980,
4672,
10489,
273,
20238,
18,
11369,
309,
10489,
30,
1198,
2668,
1484,
9381,
30,
980,
353,
738,
87,
300,
738,
87,
919,
353,
738,
87,
2187,
... | |
state = self.locoHeadlight.getEnabled() | state = self.locoHeadlight.isSelected() | def whenLocoHeadlight(self, event) : if (self.currentThrottle != None) : wasState = self.currentThrottle.getF0() state = self.locoHeadlight.getEnabled() self.currentThrottle.setF0(state) self.msgText("changed light to: " + state + " was " + wasState + "\n") return | 9b2cca9b4b4b60ff6b3b43cc62a91b1f742b8a5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1660/9b2cca9b4b4b60ff6b3b43cc62a91b1f742b8a5c/RobotThrottle2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
1333,
83,
1414,
5099,
12,
2890,
16,
871,
13,
294,
309,
261,
2890,
18,
2972,
27636,
480,
599,
13,
294,
1703,
1119,
273,
365,
18,
2972,
27636,
18,
588,
42,
20,
1435,
919,
273,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
1333,
83,
1414,
5099,
12,
2890,
16,
871,
13,
294,
309,
261,
2890,
18,
2972,
27636,
480,
599,
13,
294,
1703,
1119,
273,
365,
18,
2972,
27636,
18,
588,
42,
20,
1435,
919,
273,
36... |
if self.within_title: self.title = self.body[self.within_title:] self.within_title = 0 | def depart_title(self, node): if self.within_title: self.title = self.body[self.within_title:] self.within_title = 0 self.body.append(self.context.pop()) | abbb486fa7fbeae8152e71da77d0a022282037ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/abbb486fa7fbeae8152e71da77d0a022282037ed/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
2649,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
2472,
18,
5120,
10756,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
2649,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
2472,
18,
5120,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def _debugbuf (self): """print debugging information about data buffer status""" | def __str__ (self): return "%s in state %s"%(self.__class__.__name__, str(self.state)) def debugbuf (self): """print debugging information about buffered data""" | def _debugbuf (self): """print debugging information about data buffer status""" debug(FILTER, "self.outbuf %r", self.outbuf.getvalue()) debug(FILTER, "self.tagbuf %r", self.tagbuf) debug(FILTER, "self.waitbuf %r", self.waitbuf) debug(FILTER, "self.inbuf %r", self.inbuf.getvalue()) | 528577c1e37e3cb64d12e96674d5cbd325e4bbd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/528577c1e37e3cb64d12e96674d5cbd325e4bbd0/HtmlParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
261,
2890,
4672,
327,
2213,
87,
316,
919,
738,
87,
6,
17105,
2890,
16186,
1106,
972,
16186,
529,
972,
16,
609,
12,
2890,
18,
2019,
3719,
282,
1652,
1198,
4385,
261,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
261,
2890,
4672,
327,
2213,
87,
316,
919,
738,
87,
6,
17105,
2890,
16186,
1106,
972,
16186,
529,
972,
16,
609,
12,
2890,
18,
2019,
3719,
282,
1652,
1198,
4385,
261,
289... |
sage: g=graphs.PetersenGraph() | sage: g = graphs.PetersenGraph() | def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the canonical label with respect to the partition. If no partition is given, uses the unit partition. INPUT: - ``partition`` - if given, the canonical label with respect to this partition will be computed. The default is the unit partition. - ``certify`` - if True, a dictionary mapping from the (di)graph to its canonical label will be given. - ``verbosity`` - gets passed to nice: prints helpful output. - ``edge_labels`` - default False, otherwise allows only permutations respecting edge labels. EXAMPLES:: sage: D = graphs.DodecahedralGraph() sage: E = D.canonical_label(); E Dodecahedron: Graph on 20 vertices sage: D.canonical_label(certify=True) (Dodecahedron: Graph on 20 vertices, {0: 0, 1: 19, 2: 16, 3: 15, 4: 9, 5: 1, 6: 10, 7: 8, 8: 14, 9: 12, 10: 17, 11: 11, 12: 5, 13: 6, 14: 2, 15: 4, 16: 3, 17: 7, 18: 13, 19: 18}) sage: D.is_isomorphic(E) True Multigraphs:: sage: G = Graph(multiedges=True,sparse=True) sage: G.add_edge((0,1)) sage: G.add_edge((0,1)) sage: G.add_edge((0,1)) sage: G.canonical_label() Multi-graph on 2 vertices sage: Graph('A?', implementation='c_graph').canonical_label() Graph on 2 vertices | a1371df28f1a50021d7507de4e96bdcb7caafce8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/a1371df28f1a50021d7507de4e96bdcb7caafce8/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7378,
67,
1925,
12,
2890,
16,
3590,
33,
7036,
16,
3320,
1164,
33,
8381,
16,
11561,
33,
20,
16,
3591,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
7378,
1433,
598,
8762,
358,
326,
3590,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7378,
67,
1925,
12,
2890,
16,
3590,
33,
7036,
16,
3320,
1164,
33,
8381,
16,
11561,
33,
20,
16,
3591,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
7378,
1433,
598,
8762,
358,
326,
3590,
... |
def _makeNewRecord(self, line, type, label, pseudolabel, opcode, operands, comment): | def _makeNewRecord(self, line, rectype, label, pseudolabel, opcode, operands, comment): | def _makeNewRecord(self, line, type, label, pseudolabel, opcode, operands, comment): srcfile = self.context.srcfile linenum = self.context.linenum srcline = line address = self.context.loc code = self.context.code if label == None and pseudolabel == None and opcode == None and operands == None: address = None code = None if type == None: type = RecordType.NONE return ParserRecord(srcfile, linenum, srcline, type, label, pseudolabel, opcode, operands, comment, address, code) | b1e36cd7bc5216c2322cd7b4ae7f5236112a9cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/b1e36cd7bc5216c2322cd7b4ae7f5236112a9cbd/assembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
1908,
2115,
12,
2890,
16,
980,
16,
4917,
388,
16,
1433,
16,
29606,
355,
873,
16,
11396,
16,
14883,
16,
2879,
4672,
1705,
768,
273,
365,
18,
2472,
18,
4816,
768,
4739,
7924,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
1908,
2115,
12,
2890,
16,
980,
16,
4917,
388,
16,
1433,
16,
29606,
355,
873,
16,
11396,
16,
14883,
16,
2879,
4672,
1705,
768,
273,
365,
18,
2472,
18,
4816,
768,
4739,
7924,
... |
def longcmd(self, line): | def longcmd(self, line, fileHandle=None): | def longcmd(self, line): """Internal: send a command and get the response plus following text.""" self.putcmd(line) return self.getlongresp() | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1525,
4172,
12,
2890,
16,
980,
16,
26662,
33,
7036,
4672,
3536,
3061,
30,
1366,
279,
1296,
471,
336,
326,
766,
8737,
3751,
977,
12123,
365,
18,
458,
4172,
12,
1369,
13,
327,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1525,
4172,
12,
2890,
16,
980,
16,
26662,
33,
7036,
4672,
3536,
3061,
30,
1366,
279,
1296,
471,
336,
326,
766,
8737,
3751,
977,
12123,
365,
18,
458,
4172,
12,
1369,
13,
327,
365,
18,
... |
mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).exclude() | try: mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).exclude() except RuntimeError: print "could not find declaration for %s" % prefix | def export_functions( mb ): """export utility functions.""" ## include all membership functions mb.namespace("alignlib").free_functions().include() # set call policies for functions that return the same object # from the first argument for prefix in ("fill", "add", "substitute", "reset", "perform", "copy", "combine", "complement", "rescore", "flatten", "filter", "readAlignataPairs", "calculateAffineScore", "extractMultipleAlignment", "rescaleProfileCounts", "normalizeProfileCounts", ): mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).call_policies = return_self() # set call policies for functions that return get a default object # in this case the caller is not a new object. for prefix in ("getDefault", ): mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).call_policies = \ return_value_policy( reference_existing_object ) # set call policies for functions that return set a default object # in this case the caller takes ownership of the old object for prefix in ("setDefault", ): mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).call_policies = \ return_value_policy( manage_new_object ) # other functions that return new objects, including the factory functions for prefix in ("extract", "read", "make", "exportProfileFrequencies", "splitAlignata" ): mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).call_policies = \ return_value_policy( manage_new_object ) ####################################################################################### ####################################################################################### ####################################################################################### ## patches to exclude problematic functions for prefix in ("getMapResidue", "makeSubstitutionMatrixAA", "makeRendererColumn", "makeAlignatorDotsWrap", "getDefaultPalette" ): mb.free_functions( lambda mem_fun: mem_fun.name.startswith( prefix )).exclude() ## can't export makeProfile(const std::string &, int) ## couldn't figure out what to mach const std::string & with ## tried: const std::string &, std::string const &, and more mb.free_functions( name='makeProfile', arg_types=[None, "int"] ).exclude() | 93a16038a56d9fbf8760018f7e923f04110343ab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8012/93a16038a56d9fbf8760018f7e923f04110343ab/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
10722,
12,
4903,
262,
30,
3536,
6530,
12788,
4186,
12123,
7541,
2341,
777,
12459,
4186,
4903,
18,
4937,
2932,
7989,
2941,
20387,
9156,
67,
10722,
7675,
6702,
1435,
225,
468,
444,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
10722,
12,
4903,
262,
30,
3536,
6530,
12788,
4186,
12123,
7541,
2341,
777,
12459,
4186,
4903,
18,
4937,
2932,
7989,
2941,
20387,
9156,
67,
10722,
7675,
6702,
1435,
225,
468,
444,... |
cty.POINTER(cty.c_float), cty.POINTER(cty.c_int)], | cty.POINTER(cty.c_float), cty.POINTER(cty.c_int)], | def fl_get_xyplot_data_pointer(obj, id, x, y, n): """ fl_get_xyplot_data_pointer(obj, id, x, y, n) """ _fl_get_xyplot_data_pointer(obj, id, x, y, n) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
1698,
4032,
67,
892,
67,
10437,
12,
2603,
16,
612,
16,
619,
16,
677,
16,
290,
4672,
3536,
1183,
67,
588,
67,
1698,
4032,
67,
892,
67,
10437,
12,
2603,
16,
612,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
1698,
4032,
67,
892,
67,
10437,
12,
2603,
16,
612,
16,
619,
16,
677,
16,
290,
4672,
3536,
1183,
67,
588,
67,
1698,
4032,
67,
892,
67,
10437,
12,
2603,
16,
612,
1... |
QToolTip.add(self.uhf_radiobtn,self.__tr("Unrestricted Hartree-Fock. All electrons are unpaired and spatial (spin) orbitals are uniquely defined for each electron. More time consuming, but more accurate, than ROHF. ")) | QToolTip.add(self.uhf_radiobtn,self.__tr("Unrestricted Hartree-Fock")) | def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) QToolTip.add(self.name_linedit,self.__tr("The name of the GAMESS jig.")) QWhatsThis.add(self.name_linedit,self.__tr("The name of the GAMESS jig.")) self.runtyp_combox.clear() self.runtyp_combox.insertItem(self.__tr("Energy")) self.runtyp_combox.insertItem(self.__tr("Optimization")) self.runtyp_combox.setCurrentItem(0) self.comment_linedit.setText(QString.null) self.choose_color_btn.setText(self.__tr("Choose...")) QToolTip.add(self.choose_color_btn,self.__tr("Change color")) self.scftyp_btngrp.setTitle(self.__tr("Electronic Structure Properties")) self.rhf_radiobtn.setText(self.__tr("RHF")) QToolTip.add(self.rhf_radiobtn,self.__tr("Restricted Hartree-Fock. All electrons are paired and each spatial orbital is doubly occupied. Cannot be used with multiplicities greater than 1.")) QWhatsThis.add(self.rhf_radiobtn,self.__tr("Restricted Hartree-Fock. All electrons are paired and each spatial orbital is doubly occupied. Cannot be used with multiplicities greater than 1.")) self.uhf_radiobtn.setText(self.__tr("UHF")) QToolTip.add(self.uhf_radiobtn,self.__tr("Unrestricted Hartree-Fock. All electrons are unpaired and spatial (spin) orbitals are uniquely defined for each electron. More time consuming, but more accurate, than ROHF. ")) QWhatsThis.add(self.uhf_radiobtn,self.__tr("Unrestricted Hartree-Fock. All electrons are unpaired and spatial (spin) orbitals are uniquely defined for each electron. More time consuming, but more accurate, than ROHF. ")) self.rohf_radiobtn.setText(self.__tr("ROHF")) QToolTip.add(self.rohf_radiobtn,self.__tr("Restricted Open-shell Hartree-Fock. Spin-paired electrons are assigned to doubly-occupied spatial orbitals, while electrons with unpaired spins are provided unique spatial orbitals.")) QWhatsThis.add(self.rohf_radiobtn,self.__tr("Restricted Open-shell Hartree-Fock. Spin-paired electrons are assigned to doubly-occupied spatial orbitals, while electrons with unpaired spins are provided unique spatial orbitals.")) self.textLabel1_4.setText(self.__tr("Charge:")) QToolTip.add(self.icharg_spinbox,self.__tr("The total charge of the structure to be treated quantum mechanically.")) QWhatsThis.add(self.icharg_spinbox,self.__tr("The total charge of the structure to be treated quantum mechanically.")) self.textLabel1_2_2.setText(self.__tr("Multiplicity:")) self.multi_combox.clear() self.multi_combox.insertItem(self.__tr("1")) self.multi_combox.insertItem(self.__tr("2")) self.multi_combox.insertItem(self.__tr("3")) self.multi_combox.insertItem(self.__tr("4")) self.multi_combox.insertItem(self.__tr("5")) self.multi_combox.insertItem(self.__tr("6")) self.multi_combox.insertItem(self.__tr("7")) QToolTip.add(self.multi_combox,self.__tr("N + 1, where N is the number of unpaired electrons.")) QWhatsThis.add(self.multi_combox,self.__tr("N + 1, where N is the number of unpaired electrons.")) self.groupBox8.setTitle(self.__tr("System Memory and Usage")) self.textLabel2_2.setText(self.__tr("Memory :")) self.textLabel1.setText(self.__tr("MB")) self.dirscf_checkbox.setText(self.__tr("DirectSCF")) QToolTip.add(self.dirscf_checkbox,self.__tr("Check this box to run the calculation in RAM and avoid hard disk usage for integral storage.")) QWhatsThis.add(self.dirscf_checkbox,self.__tr("Check this box to run the calculation in RAM and avoid hard disk usage for integral storage.")) self.groupBox2.setTitle(self.__tr("Electron Correlation Method")) self.textLabel6.setText(self.__tr("Basis Set :")) self.gbasis_combox.clear() self.gbasis_combox.insertItem(self.__tr("AM1")) self.gbasis_combox.insertItem(self.__tr("PM3")) self.gbasis_combox.insertItem(self.__tr("STO-3G")) self.gbasis_combox.insertItem(self.__tr("STO-6G")) self.gbasis_combox.insertItem(self.__tr("3-21G")) self.gbasis_combox.insertItem(self.__tr("3-21G*")) self.gbasis_combox.insertItem(self.__tr("6-31G")) self.gbasis_combox.insertItem(self.__tr("6-31G(d)")) self.gbasis_combox.insertItem(self.__tr("6-31G(d,p)")) self.gbasis_combox.insertItem(self.__tr("6-31+G(d)")) self.gbasis_combox.insertItem(self.__tr("6-31+G(d,p)")) self.gbasis_combox.insertItem(self.__tr("6-31++G(d)")) self.gbasis_combox.insertItem(self.__tr("6-31++G(d,p)")) self.gbasis_combox.insertItem(self.__tr("6-311G")) self.gbasis_combox.insertItem(self.__tr("6-311G(d)")) self.gbasis_combox.insertItem(self.__tr("6-311G(d,p)")) self.gbasis_combox.insertItem(self.__tr("6-311+G(d,p)")) self.gbasis_combox.insertItem(self.__tr("6-311++G(d,p)")) self.gbasis_combox.setCurrentItem(0) QToolTip.add(self.gbasis_combox,self.__tr("Select from among the standard Gaussian-type basis sets and semi-empirical parameters in GAMESS.")) QWhatsThis.add(self.gbasis_combox,self.__tr("Select from among the standard Gaussian-type basis sets and semi-empirical parameters in GAMESS.")) self.checkBox10_3_2.setText(self.__tr("Read $HESS Group")) self.checkBox10_2_2_2.setText(self.__tr("Read $VEC Group")) QToolTip.add(self.checkBox10_2_2_2,self.__tr("Only if Hf basis same as CI basis","Only if Hf basis same as CI basis")) QWhatsThis.add(self.checkBox10_2_2_2,self.__tr("Only if Hf basis same as CI basis")) self.checkBox35.setText(self.__tr("Frequencies")) self.ecm_btngrp.setTitle(QString.null) self.none_radiobtn.setText(self.__tr("None")) QToolTip.add(self.none_radiobtn,self.__tr("Select this button to neglect electron correlation in the calculation.")) QWhatsThis.add(self.none_radiobtn,self.__tr("Select this button to neglect electron correlation in the calculation.")) self.dft_radiobtn.setText(self.__tr("DFT")) QToolTip.add(self.dft_radiobtn,self.__tr("Select this button to perform a density functional theory calculation.")) QWhatsThis.add(self.dft_radiobtn,self.__tr("Select this button to perform a density functional theory calculation.")) self.mp2_radiobtn.setText(self.__tr("MP2")) QToolTip.add(self.mp2_radiobtn,self.__tr("Select this button to perform a Second-Order Moeller Plesset calculation.")) QWhatsThis.add(self.mp2_radiobtn,self.__tr("Select this button to perform a Second-Order Moeller Plesset calculation.")) self.dfttyp_label.setText(self.__tr("Functional:")) self.gridsize_label.setText(self.__tr("Grid Size:")) self.dfttyp_combox.clear() self.dfttyp_combox.insertItem(self.__tr("SLATER (E)")) self.dfttyp_combox.insertItem(self.__tr("BECKE (E)")) self.dfttyp_combox.insertItem(self.__tr("GILL (E)")) self.dfttyp_combox.insertItem(self.__tr("PBE (E)")) self.dfttyp_combox.insertItem(self.__tr("VWN (C)")) self.dfttyp_combox.insertItem(self.__tr("LYP (C)")) self.dfttyp_combox.insertItem(self.__tr("OP (C)")) self.dfttyp_combox.insertItem(self.__tr("SVWN/LDA (E+C)")) self.dfttyp_combox.insertItem(self.__tr("SLYP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("SOP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("BVWN (E+C)")) self.dfttyp_combox.insertItem(self.__tr("BLYP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("BOP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("GVWN (E+C)")) self.dfttyp_combox.insertItem(self.__tr("GLYP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("GOP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("PBEVWN (E+C)")) self.dfttyp_combox.insertItem(self.__tr("PBELYP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("PBEOP (E+C)")) self.dfttyp_combox.insertItem(self.__tr("BHHLYP (H)")) self.dfttyp_combox.insertItem(self.__tr("B3LYP (H)")) QToolTip.add(self.dfttyp_combox,self.__tr("Select an available density functional in GAMESS.")) QWhatsThis.add(self.dfttyp_combox,self.__tr("Select an available density functional in GAMESS.")) self.gridsize_combox.clear() self.gridsize_combox.insertItem(self.__tr("Coarse")) self.gridsize_combox.insertItem(self.__tr("Default")) self.gridsize_combox.insertItem(self.__tr("Fine")) self.gridsize_combox.insertItem(self.__tr("Army Grade")) self.gridsize_combox.setCurrentItem(1) QToolTip.add(self.gridsize_combox,self.__tr("Select the grid spacing for the DFT calculation.")) QWhatsThis.add(self.gridsize_combox,self.__tr("Select the grid spacing for the DFT calculation.")) self.core_electrons_checkbox.setText(self.__tr("Core electrons?")) QToolTip.add(self.core_electrons_checkbox,self.__tr("Check this box to include both the valence and core electrons in the MP2 calculation.")) QWhatsThis.add(self.core_electrons_checkbox,self.__tr("Check this box to include both the valence and core electrons in the MP2 calculation.")) self.groupBox3.setTitle(self.__tr("Convergence Criteria")) self.textLabel3.setText(self.__tr("Energy and Density:")) self.density_conv_combox.clear() self.density_conv_combox.insertItem(self.__tr("Coarse")) self.density_conv_combox.insertItem(self.__tr("Medium")) self.density_conv_combox.insertItem(self.__tr("Fine")) self.density_conv_combox.insertItem(self.__tr("Very Fine")) self.density_conv_combox.setCurrentItem(1) QToolTip.add(self.density_conv_combox,self.__tr("Selects the accuracy of the electron density convergence for the energy calculation.")) QWhatsThis.add(self.density_conv_combox,self.__tr("Selects the accuracy of the electron density convergence for the energy calculation.")) self.rmsd_lbl.setText(self.__tr("RMSD:")) self.rmsd_combox.clear() self.rmsd_combox.insertItem(self.__tr("Coarse")) self.rmsd_combox.insertItem(self.__tr("Medium")) self.rmsd_combox.insertItem(self.__tr("Fine")) self.rmsd_combox.insertItem(self.__tr("Very Fine")) self.rmsd_combox.setCurrentItem(1) self.iterations_lbl.setText(self.__tr("Iterations :")) self.edit_input_file_cbox.setText(self.__tr("Open Input File in text editor")) self.run_job_btn.setText(self.__tr("Save and Run")) QToolTip.add(self.run_job_btn,self.__tr("Save GAMESS parameters and launch job.")) self.save_btn.setText(self.__tr("Save")) self.cancel_btn.setText(self.__tr("Cancel")) QToolTip.add(self.cancel_btn,self.__tr("Closes this window.")) QWhatsThis.add(self.cancel_btn,self.__tr("Closes this window.")) | 24f41dc8e19de3c29875b1970aa782574333c759 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/24f41dc8e19de3c29875b1970aa782574333c759/GamessPropDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2653,
3043,
12,
2890,
4672,
365,
18,
542,
21158,
12,
2890,
16186,
313,
2932,
43,
1642,
1260,
6183,
6,
3719,
365,
18,
84,
542,
2069,
3083,
67,
22,
67,
22,
18,
542,
1528,
12,
2890,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2653,
3043,
12,
2890,
4672,
365,
18,
542,
21158,
12,
2890,
16186,
313,
2932,
43,
1642,
1260,
6183,
6,
3719,
365,
18,
84,
542,
2069,
3083,
67,
22,
67,
22,
18,
542,
1528,
12,
2890,
161... |
maptocolor = vtk.vtkImageMapToColors() maptocolor.SetInput(data) maptocolor.SetLookupTable(ctf) preview = maptocolor.GetOutput() | if not self.maptocolor: self.maptocolor = vtk.vtkImageMapToColors() self.maptocolor.SetOutputFormatToRGB() else: self.maptocolor.RemoveAllInputs() self.maptocolor.SetInput(data) self.maptocolor.SetLookupTable(ctf) preview = self.maptocolor.GetOutput() | def doPreview(self, depth, renew, timePoint = 0): """ Created: 08.11.2004, JM Description: Makes a two-dimensional preview using the class-specific combination function Parameters: depth The preview depth renew Flag indicating, whether the preview should be regenerated or if a stored image can be reused timePoint The timepoint from which to generate the preview Defaults to 0 """ Logging.info("Creating preview",kw="dataunit") preview = None if timePoint > self.getNumberOfTimepoints(): timepoint = self.getNumberOfTimepoints() - 1 self.oldAlphaStatus = scripting.wantAlphaChannel if depth == scripting.WHOLE_DATASET_NO_ALPHA: scripting.wantAlphaChannel = 0 # If the previously requested preview was a "show original" preview # then we can just restore the preview before that without any # processing showOrig = self.settings.get("ShowOriginal") if not showOrig and self.doOrig: self.doOrig = 0 Logging.info("Returning saved preview", kw = "dataunit") return self.origPreview # If the requested output channels have been specified, # then we map those through their corresponding ctf's # to be merged to the output n = len(self.sourceunits) merged = [] if self.outputChannels: merged = [] for i, unit in enumerate(self.sourceunits): if i in self.outputChannels and self.outputChannels[i]: data = unit.getTimepoint(timePoint) merged.append((data, unit.getColorTransferFunction())) if n not in self.outputChannels: self.outputChannels[n] = 0 # If either no output channels have been specified (in which case # we return just the normal preview) or the combined result # (n = last chl+1) has been requested if self.merging or not self.outputChannels or (n in self.outputChannels and self.outputChannels[n]): | c8ee53ed48ada46454df7f8acb44d7e777f12334 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/c8ee53ed48ada46454df7f8acb44d7e777f12334/CombinedDataUnit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
11124,
12,
2890,
16,
3598,
16,
15723,
16,
813,
2148,
273,
374,
4672,
3536,
12953,
30,
16314,
18,
2499,
18,
6976,
24,
16,
804,
49,
6507,
30,
490,
3223,
279,
2795,
17,
31236,
10143,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
11124,
12,
2890,
16,
3598,
16,
15723,
16,
813,
2148,
273,
374,
4672,
3536,
12953,
30,
16314,
18,
2499,
18,
6976,
24,
16,
804,
49,
6507,
30,
490,
3223,
279,
2795,
17,
31236,
10143,... |
sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) sys.stderr = sys.__stderr__ | save_stderr = sys.stderr try: sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) finally: sys.stderr = save_stderr | def assertParseFail(self, cmdline_args, expected_output): """Assert the parser fails with the expected message.""" sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) sys.stderr = sys.__stderr__ | 54b934e963d7972f62c3625b723cb51a21647124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54b934e963d7972f62c3625b723cb51a21647124/test_optparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
3201,
3754,
12,
2890,
16,
22877,
67,
1968,
16,
2665,
67,
2844,
4672,
3536,
8213,
326,
2082,
6684,
598,
326,
2665,
883,
12123,
2589,
18,
11241,
273,
15777,
1435,
365,
18,
11231,
126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
3201,
3754,
12,
2890,
16,
22877,
67,
1968,
16,
2665,
67,
2844,
4672,
3536,
8213,
326,
2082,
6684,
598,
326,
2665,
883,
12123,
2589,
18,
11241,
273,
15777,
1435,
365,
18,
11231,
126... |
configprc = configprc.replace(".panda3d","Panda3D-%s" % VERSION) | configprc = configprc.replace("$HOME/.panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION) | pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n" | 1d6df6d73c8ef78684d3f4ba80ae55ecdb660899 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7242/1d6df6d73c8ef78684d3f4ba80ae55ecdb660899/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
293,
464,
842,
722,
67,
76,
1011,
1548,
82,
7,
318,
536,
225,
453,
4307,
37,
67,
3932,
1653,
39,
6365,
67,
5757,
64,
82,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
293,
464,
842,
722,
67,
76,
1011,
1548,
82,
7,
318,
536,
225,
453,
4307,
37,
67,
3932,
1653,
39,
6365,
67,
5757,
64,
82,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
userid = "obspyck" passwd = "obspyck" | userid = self.server['User'] passwd = self.server['Password'] | def deleteEventInSeishub(self, resource_name): """ Delete xml file from seishub. (Move to seishubs trash folder if this option is activated) """ | f1b07e9850f312d642204d84482875b77beec5ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/f1b07e9850f312d642204d84482875b77beec5ed/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
1133,
382,
1761,
1468,
373,
12,
2890,
16,
1058,
67,
529,
4672,
3536,
2504,
2025,
585,
628,
695,
1468,
373,
18,
261,
7607,
358,
695,
1468,
373,
87,
20703,
3009,
309,
333,
1456,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
1133,
382,
1761,
1468,
373,
12,
2890,
16,
1058,
67,
529,
4672,
3536,
2504,
2025,
585,
628,
695,
1468,
373,
18,
261,
7607,
358,
695,
1468,
373,
87,
20703,
3009,
309,
333,
1456,
35... |
self.yflip = yflip = up[1] < 0.0 | def __init__(self, xoff, yoff, right, up, rot90): if rot90: self.xflip = xflip = right[1] < 0.0 self.yflip = yflip = up[0] < 0.0 else: self.xflip = xflip = right[0] < 0.0 self.yflip = yflip = up[1] < 0.0 | f3eeb04707884fb7833f737347fd9735848b706e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/f3eeb04707884fb7833f737347fd9735848b706e/dimensions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
619,
3674,
16,
677,
3674,
16,
2145,
16,
731,
16,
4168,
9349,
4672,
309,
4168,
9349,
30,
365,
18,
5841,
3169,
273,
619,
12357,
273,
2145,
63,
21,
65,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
619,
3674,
16,
677,
3674,
16,
2145,
16,
731,
16,
4168,
9349,
4672,
309,
4168,
9349,
30,
365,
18,
5841,
3169,
273,
619,
12357,
273,
2145,
63,
21,
65,
41... | |
try: datas = query.GetData(params, self)['query']['allmessages'] self._mediawiki_messages = _dict([(tag['name'].lower(), tag['*']) for tag in datas if not 'missing' in tag]) except NotImplementedError: api = False continue | datas = query.GetData(params, self)['query']['allmessages'][0] if "missing" in datas: raise KeyError("message is not exist.") elif datas['name'] not in self._mediawiki_messages: self._mediawiki_messages[datas['name']] = datas['*'] | def mediawiki_message(self, key): """Return the MediaWiki message text for key "key" """ # Allmessages is retrieved once for all per created Site object if not self._mediawiki_messages: api = False if verbose: output( u"Retrieving mediawiki messages from Special:Allmessages") # Only MediaWiki r27393/1.12 and higher support XML output for Special:Allmessages if self.versionnumber() < 12: usePHP = True else: if config.use_api: api = True usePHP = False elementtree = True try: try: from xml.etree.cElementTree import XML # 2.5 except ImportError: try: from cElementTree import XML except ImportError: from elementtree.ElementTree import XML except ImportError: if verbose: output(u'Elementtree was not found, using BeautifulSoup instead') elementtree = False | 00103de0ca80a4be4726ece47b24b9a4f2f37b7e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/00103de0ca80a4be4726ece47b24b9a4f2f37b7e/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3539,
13044,
67,
2150,
12,
2890,
16,
498,
4672,
3536,
990,
326,
6128,
25438,
883,
977,
364,
498,
315,
856,
6,
3536,
468,
4826,
6833,
353,
10295,
3647,
364,
777,
1534,
2522,
9063,
733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3539,
13044,
67,
2150,
12,
2890,
16,
498,
4672,
3536,
990,
326,
6128,
25438,
883,
977,
364,
498,
315,
856,
6,
3536,
468,
4826,
6833,
353,
10295,
3647,
364,
777,
1534,
2522,
9063,
733,
... |
masterDocDoxyfile = os.path.join(masterDocumentationProject.getDir(), "config/Doxyfile") if os.path.exists(masterDocDoxyfile): doxygenFileName = masterDocDoxyfile | def run(self): core = wnsbase.playground.Core.getCore() print "Identifying projects for documentation ..." # find all documentation projects: docProjects = [] masterDocumentationProject = None for project in core.getProjects().all: if isinstance(project, (wnsbase.playground.Project.Library, wnsbase.playground.Project.Binary, wnsbase.playground.Project.Documentation)): print "... found: " + project.getDir() docProjects.append(project) if isinstance(project, wnsbase.playground.Project.MasterDocumentation): # we can have only 1 (in words: one) master documentation project assert masterDocumentationProject == None masterDocumentationProject = project | 06896f132147024c27c1ca563e0150db5ca5f54b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8259/06896f132147024c27c1ca563e0150db5ca5f54b/CPPDocumentation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2922,
273,
341,
2387,
1969,
18,
1601,
2915,
18,
4670,
18,
588,
4670,
1435,
1172,
315,
25787,
310,
10137,
364,
7323,
18483,
468,
1104,
777,
7323,
10137,
30,
997,
152... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2922,
273,
341,
2387,
1969,
18,
1601,
2915,
18,
4670,
18,
588,
4670,
1435,
1172,
315,
25787,
310,
10137,
364,
7323,
18483,
468,
1104,
777,
7323,
10137,
30,
997,
152... | |
def set_item_active(self, item): data = self.tree.GetPyData(item) data.active = True | return def set_item_color(self, item): | def set_item_inactive(self, item): data = self.tree.GetPyData(item) data.active = False self.tree.SetItemTextColour(item, wx.LIGHT_GREY) | d1e76035df3472f45f93461e31a0956119a1e208 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3867/d1e76035df3472f45f93461e31a0956119a1e208/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1726,
67,
27366,
12,
2890,
16,
761,
4672,
501,
273,
365,
18,
3413,
18,
967,
9413,
751,
12,
1726,
13,
501,
18,
3535,
273,
1083,
365,
18,
3413,
18,
694,
1180,
1528,
26404,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1726,
67,
27366,
12,
2890,
16,
761,
4672,
501,
273,
365,
18,
3413,
18,
967,
9413,
751,
12,
1726,
13,
501,
18,
3535,
273,
1083,
365,
18,
3413,
18,
694,
1180,
1528,
26404,
12,... |
self.parameters, residuals, rank, s = numpy.linalg.lstsq(design_matrix, self.ln_rate_coeffs) | self.parameters, SSE, rank, s = numpy.linalg.lstsq(design_matrix, self.ln_rate_coeffs) | def __init__(self, pfs_react, pf_trans, temp_low, temp_high, mol_volume=None, temp_step=10*K): if len(pfs_react) == 0: raise ValueError("At least one reactant must be given.") self.pfs_react = pfs_react self.pf_trans = pf_trans self.temp_low = float(temp_low) self.temp_high = float(temp_high) self.temp_step = float(temp_step) self.temp_high = numpy.ceil((self.temp_high-self.temp_low)/self.temp_step)*self.temp_step+self.temp_low self.mol_volume = mol_volume | babfe6cdc2e10d52a4be5f9c9ca00afeb6de1c5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11051/babfe6cdc2e10d52a4be5f9c9ca00afeb6de1c5c/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
293,
2556,
67,
17056,
16,
10811,
67,
2338,
16,
1906,
67,
821,
16,
1906,
67,
8766,
16,
12629,
67,
9491,
33,
7036,
16,
1906,
67,
4119,
33,
2163,
14,
47,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
293,
2556,
67,
17056,
16,
10811,
67,
2338,
16,
1906,
67,
821,
16,
1906,
67,
8766,
16,
12629,
67,
9491,
33,
7036,
16,
1906,
67,
4119,
33,
2163,
14,
47,
... |
st t1, ds, [scale, index, base], disp | st t1, ds, [0, t0, t7], disp | def macroop ADC_P_R | dd95f0468c599f30303740527ce19d810f43aca6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7385/dd95f0468c599f30303740527ce19d810f43aca6/add_and_subtract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
432,
5528,
67,
52,
67,
54,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
432,
5528,
67,
52,
67,
54,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if content.valign == 'center' and i_h < val.height: | if val.valign == 'center' and i_h < val.height: | def update_content(self): """ update the listing area """ | 89d3a48576954c634545f1e0e240fa334f6245a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/89d3a48576954c634545f1e0e240fa334f6245a2/listing_area.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1745,
12,
2890,
4672,
3536,
1089,
326,
11591,
5091,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1745,
12,
2890,
4672,
3536,
1089,
326,
11591,
5091,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
To get a debug prompt, rerun this command with --config 'debugExceptions True' | To get a debug prompt, rerun this command with --debug-all | def findFile(file, searchdirs): return searchFile(file, searchdirs, error=1) | e18de1f7a6f661334ead2366d5536924e5851def /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/e18de1f7a6f661334ead2366d5536924e5851def/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
812,
12,
768,
16,
1623,
8291,
4672,
327,
1623,
812,
12,
768,
16,
1623,
8291,
16,
555,
33,
21,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
812,
12,
768,
16,
1623,
8291,
4672,
327,
1623,
812,
12,
768,
16,
1623,
8291,
16,
555,
33,
21,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'zip' : str(data.bill_postal_code), | 'zip' :data.bill_postal_code, | def prepareData(self, data): self.order = data # See tclink developer's guide for additional fields and info # convert amount to cents, no decimal point amount = str(data.balance).replace ('.', '') | 61512a3da045e7727e74347eadb4063ee34eb780 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13656/61512a3da045e7727e74347eadb4063ee34eb780/processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
16... |
if re.search('^[a-z0-9-_]+$', customfield['name']) == None: | if re.search('^[a-z][a-z0-9_]+$', customfield['name']) == None: | def verify_custom_field(self, customfield, create=True): """ Basic validation of the input for modifying or creating custom fields. """ # Name, Type and Label is required if not (customfield.get('name') and customfield.get('type') \ and customfield.get('label')): raise TracError("Custom field needs at least a name, type and label.") # Use lowercase custom fieldnames only customfield['name'] = customfield['name'].lower() # Only alphanumeric characters (and [-_]) allowed for custom fieldname if re.search('^[a-z0-9-_]+$', customfield['name']) == None: raise TracError("Only alphanumeric characters allowed for custom field name (a-z or 0-9 or -_).") # Name must begin with a character - anything else not supported by Trac if not customfield['name'][0].isalpha(): raise TracError("Custom field name must begin with a character (a-z).") # Check that it is a valid field type if not customfield['type'] in ['text', 'checkbox', 'select', 'radio', 'textarea']: raise TracError("%s is not a valid field type" % customfield['type']) # Check that field does not already exist (if modify it should already be deleted) if create and self.config.get('ticket-custom', customfield['name']): raise TracError("Can not create as field already exists.") | caf8002b94061925e182b60c3042be7d5acb2ed1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4/caf8002b94061925e182b60c3042be7d5acb2ed1/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
67,
3662,
67,
1518,
12,
2890,
16,
1679,
1518,
16,
752,
33,
5510,
4672,
3536,
7651,
3379,
434,
326,
810,
364,
21920,
578,
4979,
1679,
1466,
18,
3536,
468,
1770,
16,
1412,
471,
528... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
67,
3662,
67,
1518,
12,
2890,
16,
1679,
1518,
16,
752,
33,
5510,
4672,
3536,
7651,
3379,
434,
326,
810,
364,
21920,
578,
4979,
1679,
1466,
18,
3536,
468,
1770,
16,
1412,
471,
528... |
if not msg.epilogue.startswith('\n'): print >> self._fp | print >> self._fp | def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_boundary(failobj=_make_boundary()) print >> self._fp, '--' + boundary print >> self._fp, '\n' print >> self._fp, '--' + boundary + '--' return elif _isstring(subparts): # e.g. a non-strict parse of a message with no starting boundary. self._fp.write(subparts) return elif not isinstance(subparts, ListType): # Scalar payload subparts = [subparts] for part in subparts: s = StringIO() g = self.clone(s) g.flatten(part, unixfrom=False) msgtexts.append(s.getvalue()) # Now make sure the boundary we've selected doesn't appear in any of # the message texts. alltext = NL.join(msgtexts) # BAW: What about boundaries that are wrapped in double-quotes? boundary = msg.get_boundary(failobj=_make_boundary(alltext)) # If we had to calculate a new boundary because the body text # contained that string, set the new boundary. We don't do it # unconditionally because, while set_boundary() preserves order, it # doesn't preserve newlines/continuations in headers. This is no big # deal in practice, but turns out to be inconvenient for the unittest # suite. if msg.get_boundary() <> boundary: msg.set_boundary(boundary) # Write out any preamble if msg.preamble is not None: self._fp.write(msg.preamble) # If preamble is the empty string, the length of the split will be # 1, but the last element will be the empty string. If it's # anything else but does not end in a line separator, the length # will be > 1 and not end in an empty string. We need to # guarantee a newline after the preamble, but don't add too many. plines = NLCRE.split(msg.preamble) if plines <> [''] and plines[-1] <> '': self._fp.write('\n') # First boundary is a bit different; it doesn't have a leading extra # newline. print >> self._fp, '--' + boundary # Join and write the individual parts joiner = '\n--' + boundary + '\n' self._fp.write(joiner.join(msgtexts)) print >> self._fp, '\n--' + boundary + '--', # Write out any epilogue if msg.epilogue is not None: if not msg.epilogue.startswith('\n'): print >> self._fp self._fp.write(msg.epilogue) | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
16404,
12,
2890,
16,
1234,
4672,
468,
1021,
28837,
2674,
353,
358,
1045,
596,
1517,
1087,
18190,
16,
2691,
2182,
777,
468,
9475,
16,
471,
1508,
1221,
3071,
716,
326,
7679,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
16404,
12,
2890,
16,
1234,
4672,
468,
1021,
28837,
2674,
353,
358,
1045,
596,
1517,
1087,
18190,
16,
2691,
2182,
777,
468,
9475,
16,
471,
1508,
1221,
3071,
716,
326,
7679,... |
self.base_path except: self.base_path = self.path files = self.path.ant_glob('**/*') | files = self.files except: files = self.base_path.ant_glob('**/*') | def execute(self): | cbba43c9398057875d80ead8ea1865eb3a5ece78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/cbba43c9398057875d80ead8ea1865eb3a5ece78/Scripting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if seek and (seek.isCurrentlySeekable() & 1) and not (seek.isCurrentlySeekable() & 2): if not self.fast_winding_hint_message_showed: | if seek and not (seek.isCurrentlySeekable() & 2): if not self.fast_winding_hint_message_showed and (seek.isCurrentlySeekable() & 1): | def seekBack(self): seek = self.getSeek() if seek and (seek.isCurrentlySeekable() & 1) and not (seek.isCurrentlySeekable() & 2): if not self.fast_winding_hint_message_showed: self.session.open(MessageBox, _("No fast winding possible yet.. but you can use the number buttons to skip forward/backward!"), MessageBox.TYPE_INFO, timeout=10) self.fast_winding_hint_message_showed = True return seekstate = self.seekstate if seekstate == self.SEEK_STATE_PLAY: self.setSeekState(self.makeStateBackward(int(config.seek.enter_backward.value))) elif seekstate == self.SEEK_STATE_EOF: self.setSeekState(self.makeStateBackward(int(config.seek.enter_backward.value))) self.doSeekRelative(-6) elif seekstate == self.SEEK_STATE_PAUSE: self.doSeekRelative(-3) elif self.isStateForward(seekstate): speed = seekstate[1] if seekstate[2]: speed /= seekstate[2] speed = self.getLower(speed, config.seek.speeds_forward.value) if speed: self.setSeekState(self.makeStateForward(speed)) else: self.setSeekState(self.SEEK_STATE_PLAY) elif self.isStateBackward(seekstate): speed = -seekstate[1] if seekstate[2]: speed /= seekstate[2] speed = self.getHigher(speed, config.seek.speeds_backward.value) or config.seek.speeds_backward.value[-1] self.setSeekState(self.makeStateBackward(speed)) elif self.isStateSlowMotion(seekstate): speed = self.getHigher(seekstate[2], config.seek.speeds_slowmotion.value) if speed: self.setSeekState(self.makeStateSlowMotion(speed)) else: self.setSeekState(self.SEEK_STATE_PAUSE) | 1c954ba161bc3cd4b838b3c5a423d41847f0382a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/1c954ba161bc3cd4b838b3c5a423d41847f0382a/InfoBarGenerics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
2711,
12,
2890,
4672,
6520,
273,
365,
18,
588,
16134,
1435,
309,
6520,
471,
486,
261,
16508,
18,
291,
3935,
715,
16134,
429,
1435,
473,
576,
4672,
309,
486,
365,
18,
8076,
67,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
2711,
12,
2890,
4672,
6520,
273,
365,
18,
588,
16134,
1435,
309,
6520,
471,
486,
261,
16508,
18,
291,
3935,
715,
16134,
429,
1435,
473,
576,
4672,
309,
486,
365,
18,
8076,
67,
10... |
self.response.headers['Content-Type'] = 'application/json; charset=utf-8' benchmark = self.request.path[12:].decode('hex').encode('base64') b = Benchmark.get_by_key_name(benchmark) if b is None: | benchmark = self.request.path[12:] bm = Benchmark.get_by_key_name('v002.' + benchmark.encode('base64')) if bm is None: | def get(self): self.response.headers['Content-Type'] = 'application/json; charset=utf-8' benchmark = self.request.path[12:].decode('hex').encode('base64') | d5b946f43dd9078baac61400559a67557a9dfc53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6483/d5b946f43dd9078baac61400559a67557a9dfc53/gobuild.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
365,
18,
2740,
18,
2485,
3292,
1350,
17,
559,
3546,
273,
296,
3685,
19,
1977,
31,
4856,
33,
3158,
17,
28,
11,
14128,
273,
365,
18,
2293,
18,
803,
63,
2138,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
365,
18,
2740,
18,
2485,
3292,
1350,
17,
559,
3546,
273,
296,
3685,
19,
1977,
31,
4856,
33,
3158,
17,
28,
11,
14128,
273,
365,
18,
2293,
18,
803,
63,
2138,
30,
... |
sage: sleep(1.0) | sage: sleep(2.0) | def eval_function(self, f, arguments, job_name=None): """ Takes a function and it's arguments, pickles it, and creates a job which executes the function with the arguments. | 0a3cf6b0942a39f614dd6be42e493655a22f5532 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/0a3cf6b0942a39f614dd6be42e493655a22f5532/dsage_interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
67,
915,
12,
2890,
16,
284,
16,
1775,
16,
1719,
67,
529,
33,
7036,
4672,
3536,
23004,
279,
445,
471,
518,
1807,
1775,
16,
6002,
1040,
518,
16,
471,
3414,
279,
1719,
1492,
11997,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
67,
915,
12,
2890,
16,
284,
16,
1775,
16,
1719,
67,
529,
33,
7036,
4672,
3536,
23004,
279,
445,
471,
518,
1807,
1775,
16,
6002,
1040,
518,
16,
471,
3414,
279,
1719,
1492,
11997,
... |
if self.__cache: | if self.__cache: self.__cache.set( obj.cache_key, obj ) else: connection.pending_saves.append( obj ) def commit( self ): connection = self.__get_connection() connection.commit() for obj in connection.pending_saves: | def save( self, obj, commit = True ): """ Save the given object to the database. | 7a0368b5d9f680dd622b3b53276f761574b4f9d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6754/7a0368b5d9f680dd622b3b53276f761574b4f9d4/Database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
365,
16,
1081,
16,
3294,
273,
1053,
262,
30,
3536,
7074,
326,
864,
733,
358,
326,
2063,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
365,
16,
1081,
16,
3294,
273,
1053,
262,
30,
3536,
7074,
326,
864,
733,
358,
326,
2063,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
oneDMenu=['mtotal','m1','m2','mchirp','mc','distance','distMPC','dist','iota','eta','RA','dec','a1','a2','phi1','theta1','phi2','theta2'] | oneDMenu=['mtotal','m1','m2','mchirp','mc','distance','distMPC','dist','iota','psi','eta','RA','dec','a1','a2','phi1','theta1','phi2','theta2'] | def cbcBayesSkyRes(outdir,data,oneDMenu,twoDGreedyMenu,GreedyRes,confidence_levels,twoDplots,injfile=None,eventnum=None,skyres=None): if eventnum is not None and injfile is None: print "You specified an event number but no injection file. Ignoring!" if data is None: print 'You must specify an input data file' exit(1) # if outdir is None: print "You must specify an output directory." exit(1) if not os.path.isdir(outdir): os.makedirs(outdir) # summary_fo=open(os.path.join(outdir,'summary.ini'),'w') summary_file=ConfigParser() summary_file.add_section('metadata') summary_file.set('metadata','group_id','X') if eventnum: summary_file.set('metadata','event_id',str(eventnum)) summary_file.add_section('Confidence levels') summary_file.set('Confidence levels','confidence levels',str(confidence_levels)) # Load in the main data paramnames, pos=loadDataFile(data[0]) #Generate any required derived parameters if "m1" not in paramnames and "m2" not in paramnames and "mchirp" in paramnames and "eta" in paramnames: (m1,m2)=bppu.mc2ms(pos[:,paramnames.index('mchirp')],pos[:,paramnames.index('eta')]) pos=np.column_stack((pos,m1,m2)) paramnames.append("m1") paramnames.append("m2") # Nd=len(paramnames) print "Number of posterior samples: " + str(size(pos,0)) # Calculate means means = mean(pos,axis=0) meanStr=map(str,means) out=reduce(lambda a,b:a+'||'+b,meanStr) print 'Means:' print '||'+out+'||' RAdim=paramnames.index('RA') decdim=paramnames.index('dec') injection=None # Select injections using tc +/- 0.1s if it exists or eventnum from the injection file if injfile: import itertools injections = SimInspiralUtils.ReadSimInspiralFromFiles([injfile]) if(eventnum is not None): if(len(injections)<eventnum): print "Error: You asked for event %d, but %s contains only %d injections" %(eventnum,injfile,len(injections)) sys.exit(1) else: injection=injections[eventnum] else: if(len(injections)<1): print 'Warning: Cannot find injection with end time %f' %(means[2]) else: injection = itertools.ifilter(lambda a: abs(a.get_end() - means[2]) < 0.1, injections).next() #If injection parameter passed load object representation of injection #table entries. if injection: injpoint=map(lambda a: getinjpar(paramnames,injection,a),range(len(paramnames))) injvals=map(str,injpoint) out=reduce(lambda a,b:a+'||'+b,injvals) print 'Injected values:' print out #Add injection values to output file summary_file.add_section('Injection values') for parnum in range(len(paramnames)): summary_file.set('Injection values',paramnames[parnum],getinjpar(paramnames,injection,parnum)) # #If sky resolution parameter has been specified try and create sky map. skyreses=None if skyres is not None: RAvec=array(pos)[:,paramnames.index('RA')] decvec=array(pos)[:,paramnames.index('dec')] skypos=column_stack([RAvec,decvec]) injvalues=None if injection: injvalues=(injpoint[RAdim],injpoint[decdim]) skyreses,skyinjectionconfidence=bppu.plotSkyMap(skypos,skyres,injvalues,confidence_levels,outdir) #Loop over parameter pairs in twoDGreedyMenu and bin the sample pairs #using a greedy algorithm . The ranked pixels (toppoints) are used #to plot 2D histograms and evaluate Bayesian confidence intervals. summary_file.add_section('2D greedy cl') summary_file.add_section('2D greedy cl inj') ncon=len(confidence_levels) pos_array=np.array(pos) twoDGreedyCL={} twoDGreedyInj={} for par1_name,par2_name in twoDGreedyMenu: print "Binning %s-%s to determine confidence levels ..."%(par1_name,par2_name) #Bin sizes try: par1_bin=GreedyRes[par1_name] except KeyError: print "Bin size is not set for %s, skipping %s/%s binning."%(par1_name,par1_name,par2_name) continue try: par2_bin=GreedyRes[par2_name] except KeyError: print "Bin size is not set for %s, skipping %s/%s binning."%(par2_name,par1_name,par2_name) continue #Get posterior samples try: par1_index=paramnames.index(par1_name) except ValueError: print "No input chain for %s, skipping %s/%s binning."%(par1_name,par1_name,par2_name) continue try: par2_index=paramnames.index(par2_name) except ValueError: print "No input chain for %s, skipping %s/%s binning."%(par2_name,par1_name,par2_name) continue pars_name=("%s,%s"%(par1_name,par2_name)).lower() par1pos=pos_array[:,par1_index] par2pos=pos_array[:,par2_index] injection_=None if injection: par1_injvalue=np.array(injpoint)[par1_index] par2_injvalue=np.array(injpoint)[par2_index] injection_=(par1_injvalue,par2_injvalue) posterior_array=column_stack([par1pos,par2pos]) toppoints,injectionconfidence,twoDGreedyCL[pars_name],twoDGreedyInj[pars_name]=bppu.greedyBin2(posterior_array,(par1_bin,par2_bin),confidence_levels,par_names=(par1_name,par2_name),injection=injection_) #Plot 2D histograms of greedily binned points if injection is not None and par1_injvalue is not None and par2_injvalue is not None: bppu.plot2Dbins(np.array(toppoints),(par1_bin,par2_bin),outdir,par_names=(par1_name,par2_name),injpoint=[par1_injvalue,par2_injvalue]) else: bppu.plot2Dbins(np.array(toppoints),(par1_bin,par2_bin),outdir,par_names=(par1_name,par2_name)) # summaryString='[' for frac,area in twoDGreedyCL[pars_name].items(): summaryString+=str(area) summary_file.set('2D greedy cl',pars_name,summaryString+']') summary_file.set('2D greedy cl inj',pars_name,str(injectionconfidence)) if not os.path.exists(os.path.join(outdir,'pickle')): os.makedirs(os.path.join(outdir,'pickle')) pickle_to_file(twoDGreedyCL,os.path.join(outdir,'pickle','GreedyCL2.pickle')) pickle_to_file(twoDGreedyInj,os.path.join(outdir,'pickle','GreedyInj2.pickle')) for par in twoDGreedyCL.keys(): oneD_dict_to_file(twoDGreedyCL[par],os.path.join(outdir,str(par)+'_greedy2.dat')) #1D binning summary_file.add_section('1D mean') summary_file.add_section('1D median') summary_file.add_section('1D mode') summary_file.add_section('1D contigious cl') summary_file.add_section('1D greedy cl') summary_file.add_section('1D stacc') oneDStats={} oneDGreedyCL={} oneDContCL={} oneDGreedyInj={} oneDContInj={} max_pos,max_i=posMode(pos_array) #Loop over each parameter and determine the contigious and greedy #confidence levels and some statistics. for par_name in oneDMenu: print "Binning %s to determine confidence levels ..."%par_name try: par_index=paramnames.index(par_name) except ValueError: print "No input chain for %s, skipping binning."%par_name continue try: par_bin=GreedyRes[par_name] except KeyError: print "Bin size is not set for %s, skipping binning."%par_name continue oneDGreedyCL[par_name]={} oneDStats[par_name]={} oneDContCL[par_name]={} oneDGreedyInj[par_name]={} oneDContInj[par_name]={} par_samps=pos_array[:,par_index] summary_file.set('1D mode',par_name,str(par_samps[max_i])) summary_file.set("1D mean",par_name,str(np.mean(par_samps))) summary_file.set("1D median",par_name,str(np.median(par_samps))) oneDStats[par_name]['mode']=par_samps[max_i] oneDStats[par_name]['mean']=np.mean(par_samps) oneDStats[par_name]['median']=np.median(par_samps) par_injvalue_=None if injection: par_injvalue_=np.array(injpoint)[par_index] oneDGreedyCL[par_name],oneDGreedyInj[par_name],toppoints,injectionconfidence = bppu.greedyBin1(par_samps,par_bin,confidence_levels,par_injvalue=par_injvalue_) oneDContCL[par_name],oneDContInj[par_name]=bppu.contCL1(par_samps,par_bin,confidence_levels,par_injvalue=par_injvalue_) #Ilya's standard accuracy statistic if injection: injvalue=np.array(injpoint)[par_index] if injvalue: stacc=bppu.stacc_stat(par_samps,injvalue) summary_file.set('1D stacc',par_name,str(stacc)) oneDStats[par_name]['stacc']=stacc pickle_to_file(oneDGreedyCL,os.path.join(outdir,'pickle','GreedyCL1.pickle')) pickle_to_file(oneDContCL,os.path.join(outdir,'pickle','ContCL1.pickle')) pickle_to_file(oneDStats,os.path.join(outdir,'pickle','Stats1.pickle')) pickle_to_file(oneDContInj,os.path.join(outdir,'pickle','ContInj1.pickle')) pickle_to_file(oneDGreedyInj,os.path.join(outdir,'pickle','GreedyInj1.pickle')) for par in oneDGreedyCL.keys(): oneD_dict_to_file(oneDGreedyCL[par],os.path.join(outdir,str(par)+'_greedy1.dat')) # for par in oneDGreedyCL.keys(): oneD_dict_to_file(oneDContCL[par],os.path.join(outdir,str(par)+'_cont.dat')) # for par in oneDStats.keys(): oneD_dict_to_file(oneDStats[par],os.path.join(outdir,str(par)+'_stats.dat')) # for par in oneDStats.keys(): oneD_dict_to_file(oneDContInj[par],os.path.join(outdir,str(par)+'_cont_inj.dat')) # #####Generate 2D kde plots and webpage######## margdir=os.path.join(outdir,'2D') if not os.path.isdir(margdir): os.makedirs(margdir) twoDKdePaths=[] for par1,par2 in twoDplots: try: i=paramnames.index(par1) except ValueError: print "No input chain for %s, skipping 2D plot of %s-%s."%(par1,par1,par2) continue try: j=paramnames.index(par2) except ValueError: print "No input chain for %s, skipping 2D plot of %s-%s."%(par2,par1,par2) continue print 'Generating %s-%s plot'%(paramnames[i],paramnames[j]) if (size(np.unique(pos[:,i]))<2 or size(np.unique(pos[:,j]))<2): continue par_injvalues_=None if injection and reduce (lambda a,b: a and b, map(lambda idx: getinjpar(paramnames,injection,idx)>min(pos[:,idx]) and getinjpar(paramnames,injection,idx)<max(pos[:,idx]),[i,j])) : if getinjpar(paramnames,injection,i) is not None and getinjpar(paramnames,injection,j) is not None: par_injvalues_=( getinjpar(paramnames,injection,i) , getinjpar(paramnames,injection,j) ) myfig=bppu.plot2Dkernel(pos[:,i],pos[:,j],50,50,par_names=(par1,par2),par_injvalues=par_injvalues_) twoDKdePath=os.path.join(margdir,paramnames[i]+'-'+paramnames[j]+'_2Dkernel.png') twoDKdePaths.append(twoDKdePath) myfig.savefig(twoDKdePath) htmlfile=open(os.path.join(outdir,'posplots.html'),'w') htmlfile.write('<HTML><HEAD><TITLE>Posterior PDFs</TITLE></HEAD><BODY><h3>'+str(means[2])+' Posterior PDFs</h3>') if(skyres is not None): htmlfile.write('<table border=1><tr><td>Confidence region<td>size (sq. deg)</tr>') for (frac,skysize) in skyreses: htmlfile.write('<tr><td>%f<td>%f</tr>'%(frac,skysize)) htmlfile.write('</table>') htmlfile.write('Produced from '+str(size(pos,0))+' posterior samples.<br>') htmlfile.write('Samples read from %s<br>'%(data[0])) htmlfile.write('<h4>Mean parameter estimates</h4>') htmlfile.write('<table border=1><tr>') paramline=reduce(lambda a,b:a+'<td>'+b,paramnames) htmlfile.write('<td>'+paramline+'<td>logLmax</tr><tr>') meanline=reduce(lambda a,b:a+'<td>'+b,meanStr) htmlfile.write('<td>'+meanline+'</tr>') if injection: htmlfile.write('<tr><th colspan='+str(len(paramnames))+'>Injected values</tr>') injline=reduce(lambda a,b:a+'<td>'+b,injvals) htmlfile.write('<td>'+injline+'<td></tr>') htmlfile.write('</table>') if injection: if skyinjectionconfidence: htmlfile.write('<p>Injection found at confidence interval %f in sky location</p>'%(skyinjectionconfidence)) else: htmlfile.write('<p>Injection not found in posterior bins in sky location!</p>') htmlfile.write('<h5>2D Marginal PDFs</h5><br>') htmlfile.write('<table border=1><tr>') #htmlfile.write('<td width=30%><img width=100% src="m1m2.png"></td>') #htmlfile.write('<td width=30%><img width=100% src="RAdec.png"></td>') #htmlfile.write('<td width=30%><img width=100% src="Meta.png"></td>') #htmlfile.write('</tr><tr><td width=30%><img width=100% src="2D/Mchirp (Msun)-geocenter time ISCO_2Dkernel.png"</td>') if skyres is not None: htmlfile.write('<td width=30%><img width=100% src="skymap.png"></td>') else: htmlfile.write('<td width=30%><img width=100% src="m1dist.png:></td>') #htmlfile.write('<td width=30%><img width=100% src="m2dist.png"></td>') row_switch=1 for par1,par2 in twoDplots: if row_switch==3: row_switch=0 plot_path=None if os.path.isfile(os.path.join(outdir,'2D',par1+'-'+par2+'_2Dkernel.png')): plot_path='2D/'+par1+'-'+par2+'_2Dkernel.png' elif os.path.isfile(os.path.join(outdir,'2D',par2+'-'+par1+'_2Dkernel.png')): plot_path='2D/'+par2+'-'+par1+'_2Dkernel.png' if plot_path: if row_switch==0: htmlfile.write('<tr>') htmlfile.write('<td width=30%><img width=100% src="'+plot_path+'"></td>') if row_switch==2: htmlfile.write('</tr>') row_switch+=1 # if row_switch==2: htmlfile.write('<td></td></tr>') elif row_switch==1: htmlfile.write('<td></td><td></td></tr>') htmlfile.write('</table>') htmlfile.write('<br><a href="2D/">All 2D Marginal PDFs</a><hr><h5>1D marginal posterior PDFs</h5><br>') summary_file.add_section('1D ranking kde') summary_file.add_section('1D ranking bins') oneDplotPaths=[] for param in oneDMenu: try: par_index=paramnames.index(param) i=par_index except ValueError: print "No input chain for %s, skipping 1D plot."%param continue pos_samps=pos[:,i] injpar_=None if injection: injpar_=getinjpar(paramnames,injection,i) print "Generating 1D plot for %s."%param rbins,plotFig=bppu.plot1DPDF(pos_samps,param,injpar=injpar_) oneDplotPath=os.path.join(outdir,param+'.png') plotFig.savefig(os.path.join(outdir,param+'.png')) if rbins: print "r of injected value of %s (bins) = %f"%(param, rbins) ##Produce plot of raw samples myfig=plt.figure(figsize=(4,3.5),dpi=80) plt.plot(pos_samps,'.',figure=myfig) if injpar_: if min(pos_samps)<injpar_ and max(pos_samps)>injpar_: plt.plot([0,len(pos_samps)],[injpar_,injpar_],'r-.') myfig.savefig(os.path.join(outdir,param+'_samps.png')) #summary_file.set('1D ranking kde',param,rkde) summary_file.set('1D ranking bins',param,rbins) oneDplotPaths.append(oneDplotPath) for plotPath in oneDplotPaths: htmlfile.write('<img src="'+plotPath+'"><img src="'+plotPath.replace('.png','_samps.png')+'"><br>') htmlfile.write('<hr><br />Produced using cbcBayesSkyRes.py at '+strftime("%Y-%m-%d %H:%M:%S")) htmlfile.write('</BODY></HTML>') htmlfile.close() # Save posterior samples too... posfilename=os.path.join(outdir,'posterior_samples.dat') posfile=open(posfilename,'w') for row in pos: for i in row: posfile.write('%f\t'%(i)) posfile.write('\n') # #Close files posfile.close() summary_file.write(summary_fo) | 53137fadc21ddd0e3e68ed6dda56793f5e2409e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/53137fadc21ddd0e3e68ed6dda56793f5e2409e7/cbcBayesSkyRes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
71,
38,
528,
281,
5925,
93,
607,
12,
659,
1214,
16,
892,
16,
476,
40,
4599,
16,
15415,
40,
43,
15656,
93,
4599,
16,
43,
15656,
93,
607,
16,
27911,
67,
12095,
16,
15415,
40,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
71,
38,
528,
281,
5925,
93,
607,
12,
659,
1214,
16,
892,
16,
476,
40,
4599,
16,
15415,
40,
43,
15656,
93,
4599,
16,
43,
15656,
93,
607,
16,
27911,
67,
12095,
16,
15415,
40,
1... |
%prog [-s] [-t <email>] <OAI repository ID> %prog [-s] [-t <email>] -a""" | %prog [-s] [-t <email>] [-b <email>] <OAI repository ID> %prog [-s] [-t <email>] [-b <email>] -a""" | def __init__(self, typ): """ @param typ: 'hits' or 'clicks' """ con = MySQLdb.connect(read_default_file="/ldc/home/olac/.my.cnf") cur = con.cursor(MySQLdb.cursors.DictCursor) beg, end = previous_quarter() cur.execute(usageSQL, (typ, beg, end)) self.table = cur.fetchall() cur.close() con.close() | 3caa3912aa862dba53fc9416fce613ecd5e1867f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8937/3caa3912aa862dba53fc9416fce613ecd5e1867f/quarterly_report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3815,
4672,
3536,
632,
891,
3815,
30,
296,
15173,
11,
578,
296,
7475,
87,
11,
3536,
356,
273,
13485,
1966,
18,
3612,
12,
896,
67,
1886,
67,
768,
1546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3815,
4672,
3536,
632,
891,
3815,
30,
296,
15173,
11,
578,
296,
7475,
87,
11,
3536,
356,
273,
13485,
1966,
18,
3612,
12,
896,
67,
1886,
67,
768,
1546,
... |
'utf-8': 'utf-8', | def _isunicode(s): return isinstance(s, UnicodeType) | 5be2313c682ad37629b32edc2563c76d7023bdce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/5be2313c682ad37629b32edc2563c76d7023bdce/Charset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
291,
9124,
12,
87,
4672,
327,
1549,
12,
87,
16,
9633,
559,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
291,
9124,
12,
87,
4672,
327,
1549,
12,
87,
16,
9633,
559,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
return s[:i+1], None, s[i+2:] | return s[:i+1], None, None, s[i+2:] | def _split(s): # Return a triple: prefix, name, suffix # - prefix is text that can be used literally in the result (may be '') # - name is a referenced name, or None # - suffix is trailling text that may contain additional references # (may be '' or None) if "$" in s: i = s.find("$") c = s[i+1:i+2] if c == "": raise ZConfig.SubstitutionSyntaxError( "illegal lone '$' at end of source") if c == "$": return s[:i+1], None, s[i+2:] prefix = s[:i] if c == "{": m = _name_match(s, i + 2) if not m: raise ZConfig.SubstitutionSyntaxError( "'${' not followed by name") name = m.group(0) i = m.end() + 1 if not s.startswith("}", i - 1): raise ZConfig.SubstitutionSyntaxError( "'${%s' not followed by '}'" % name) else: m = _name_match(s, i+1) if not m: raise ZConfig.SubstitutionSyntaxError( "'$' not followed by '$' or name") name = m.group(0) i = m.end() return prefix, name.lower(), name, s[i:] else: return s, None, None | 15bf6994530c17c23f1bf769b237622bf9d50492 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9785/15bf6994530c17c23f1bf769b237622bf9d50492/substitution.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
12,
87,
4672,
468,
2000,
279,
14543,
30,
225,
1633,
16,
508,
16,
3758,
468,
300,
1633,
353,
977,
716,
848,
506,
1399,
328,
2165,
1230,
316,
326,
563,
261,
24877,
506,
28707,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
12,
87,
4672,
468,
2000,
279,
14543,
30,
225,
1633,
16,
508,
16,
3758,
468,
300,
1633,
353,
977,
716,
848,
506,
1399,
328,
2165,
1230,
316,
326,
563,
261,
24877,
506,
28707,... |
self.check_sizeof(slice(0), size(h + '3P')) h += 'P' class class_newstyle(object): def method(): pass self.check_sizeof(class_newstyle, size('P2P15Pl4PP9PP11PI') +\ size(h + '41P 10P 3P 6P')) def test_specialtypes(self): h = self.header size = self.calcsize self.check_sizeof({}, size(h + '3P2P') + 8*size('P2P')) longdict = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8} self.check_sizeof(longdict, size(h + '3P2P') + (8+16)*size('P2P')) | check(slice(1), size(h + '3P')) check('', size(vh + 'lic')) check('abc', size(vh + 'lic') + 3*self.c) check(super(int), size(h + '3P')) check((), size(vh)) check((1,2,3), size(vh) + 3*self.P) check(iter(()), size(h + 'lP')) s = size('P2P15Pl4PP9PP11PI') + size(vh + '41P 10P 3P 6P') class newstyleclass(object): pass check(newstyleclass, s) check(int, s) import types check(types.NotImplementedType, s) | def get_gen(): yield 1 | 2a9c012d274c588c51bc5660baff9bd0676bd399 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/2a9c012d274c588c51bc5660baff9bd0676bd399/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4507,
13332,
2824,
404,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4507,
13332,
2824,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if self._encoding == 'utf8': | if self._encoding == 'utf-8': | def _write(self, write_func, directory, filename, *args): # Display our progress. self._files_written += 1 log.progress(self._files_written/self._num_files, filename) path = os.path.join(directory, filename) if self._encoding == 'utf8': f = codecs.open(path, 'w', 'utf-8') write_func(f.write, *args) f.close() else: result = [] write_func(result.append, *args) s = u''.join(result) try: s = s.encode(self._encoding) except UnicodeError: log.error("Output could not be represented with the " "given encoding (%r). Unencodable characters " "will be displayed as '?'. It is recommended " "that you use a different output encoding (utf8, " "if it's supported by latex on your system).") s = s.encode(self._encoding, 'replace') f = open(path, 'w') f.write(s) f.close() | f521aeb366a177d9d9586aedb41900769604f286 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/f521aeb366a177d9d9586aedb41900769604f286/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
12,
2890,
16,
1045,
67,
644,
16,
1867,
16,
1544,
16,
380,
1968,
4672,
468,
9311,
3134,
4007,
18,
365,
6315,
2354,
67,
9748,
1011,
404,
613,
18,
8298,
12,
2890,
6315,
2354,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
12,
2890,
16,
1045,
67,
644,
16,
1867,
16,
1544,
16,
380,
1968,
4672,
468,
9311,
3134,
4007,
18,
365,
6315,
2354,
67,
9748,
1011,
404,
613,
18,
8298,
12,
2890,
6315,
2354,
... |
self._obj.accept(audio=audio, chat=chat, password=password) | self._obj.accept(*args, **kwargs) | def accept(self, audio=False, chat=False, password=None): event_names = ['SCSessionDidStart', 'SCSessionDidFail', 'SCSessionDidEnd'] with self.linked_notifications(event_names) as q: self._obj.accept(audio=audio, chat=chat, password=password) while True: notification = q.wait() if notification.name == 'SCSessionDidStart': break else: self._raise_if_error(notification) self._wait_for_chat_to_start() | 7af97fe23c327834e66dfbbfca2430afcdecd0cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/7af97fe23c327834e66dfbbfca2430afcdecd0cd/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
12,
2890,
16,
7447,
33,
8381,
16,
7916,
33,
8381,
16,
2201,
33,
7036,
4672,
871,
67,
1973,
273,
10228,
2312,
2157,
18250,
1685,
2187,
296,
2312,
2157,
18250,
3754,
2187,
296,
2312,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
12,
2890,
16,
7447,
33,
8381,
16,
7916,
33,
8381,
16,
2201,
33,
7036,
4672,
871,
67,
1973,
273,
10228,
2312,
2157,
18250,
1685,
2187,
296,
2312,
2157,
18250,
3754,
2187,
296,
2312,... |
min_count = int(match.group(4)) | min_count = int(match.group(6)) | def find_terms(pattern): if pattern[-1:] != ".": raise TypeError, "not a prosite pattern - needs a final '.'" pattern = pattern[:-1] terms = string.split(pattern, "-") result = [] for term in terms: # Starts with a "<"? if term[:1] == "<": term = term[1:] is_begin = 1 else: is_begin = 0 # Ends with a ">"? if term[-1:] == ">": term = term[:-1] is_end = 1 else: is_end = 0 # Get the elements of the term match = prosite_term_re.match(term) if match is None: raise TypeError, "not a Prosite term (%s)" % repr(term) if match.group(1) is not None: # Single letter ignore = 0 letters = match.group(1) elif match.group(2) is not None: # Letters inside of "[]"s ignore = 0 letters = match.group(2)[1:-1] elif match.group(3) is not None: # Letters inside of "{}"s ignore = 1 letters = match.group(3)[1:-1] else: raise TypeError, "not a prosite pattern - unknown group?" if match.group(4) is not None: # there is a minimum number min_count = int(match.group(4)) else: # no min, so it's 1 min_count = 1 if match.group(5) is not None: # there is a maximum number max_count = int(match.group(5)[1:]) else: # no max specified, so use the same as the min max_count = min_count result.append(PrositeTerm(letters, ignore, is_begin, is_end, min_count, max_count)) return result | 18dbba155bba07951da5424ebe81cc1b94eea170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/18dbba155bba07951da5424ebe81cc1b94eea170/Pattern.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
10112,
12,
4951,
4672,
309,
1936,
18919,
21,
26894,
480,
4585,
30,
1002,
3580,
16,
315,
902,
279,
450,
4256,
1936,
300,
4260,
279,
727,
2611,
6,
1936,
273,
1936,
10531,
17,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
10112,
12,
4951,
4672,
309,
1936,
18919,
21,
26894,
480,
4585,
30,
1002,
3580,
16,
315,
902,
279,
450,
4256,
1936,
300,
4260,
279,
727,
2611,
6,
1936,
273,
1936,
10531,
17,
2... |
if code > 0x100: | if code >= 0x100: | def repr__Unicode(space, w_unicode): hexdigits = "0123456789abcdef" chars = w_unicode._value size = len(chars) singlequote = doublequote = False for c in chars: if c == u'\'': singlequote = True elif c == u'"': doublequote = True if singlequote and not doublequote: quote = '"' else: quote = '\'' result = ['\0'] * (2 + size*6 + 1) result[0] = 'u' result[1] = quote i = 2 for ch in chars: if ch == u'\\' or ch == str(quote) : result[i] = '\\' result[i + 1] = str(ch) i += 2 continue | 0700e11977c8905de851580cfc37069f4e20a9c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/0700e11977c8905de851580cfc37069f4e20a9c8/unicodeobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8480,
972,
16532,
12,
2981,
16,
341,
67,
9124,
4672,
3827,
16649,
273,
315,
26684,
28953,
6,
5230,
273,
341,
67,
9124,
6315,
1132,
963,
273,
562,
12,
7549,
13,
225,
2202,
6889,
273,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8480,
972,
16532,
12,
2981,
16,
341,
67,
9124,
4672,
3827,
16649,
273,
315,
26684,
28953,
6,
5230,
273,
341,
67,
9124,
6315,
1132,
963,
273,
562,
12,
7549,
13,
225,
2202,
6889,
273,
16... |
sage: from sage.misc.sageinspect import sage_getsourcelines | sage: from sagenb.misc.sageinspect import sage_getsourcelines | def sage_getsourcelines(obj, is_binary=False): r""" Return a pair ([source_lines], starting line number) of the source code associated to obj, or None. INPUT: - ``obj`` - function, etc. - ``is_binary`` - boolean, ignored OUTPUT: (source_lines, lineno) or None: ``source_lines`` is a list of strings, and ``lineno`` is an integer. At this time we ignore ``is_binary`` in favour of a 'do our best' strategy. EXAMPLES:: sage: from sage.misc.sageinspect import sage_getsourcelines sage: sage_getsourcelines(matrix, True)[1] 33 sage: sage_getsourcelines(matrix, False)[0][0][4:] 'matrix(*args, **kwds):\n' AUTHORS: - William Stein - Extensions by Nick Alexander """ try: return obj._sage_src_lines_() except (AttributeError, TypeError): pass # Check if we deal with instance if isclassinstance(obj): obj=obj.__class__ # If we can handle it, we do. This is because Python's inspect will # happily dump binary for cython extension source code. d = inspect.getdoc(obj) pos = _extract_embedded_position(d) if pos is None: return inspect.getsourcelines(obj) (orig, filename, lineno) = pos try: source_lines = open(filename).readlines() except IOError: return None return _extract_source(source_lines, lineno), lineno | 4d25713f8b0421c8ec86dac00f7ab1999549be38 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/4d25713f8b0421c8ec86dac00f7ab1999549be38/sageinspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
410,
67,
14665,
477,
2183,
1465,
12,
2603,
16,
353,
67,
8578,
33,
8381,
4672,
436,
8395,
2000,
279,
3082,
23265,
3168,
67,
3548,
6487,
5023,
980,
1300,
13,
434,
326,
1084,
981,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
410,
67,
14665,
477,
2183,
1465,
12,
2603,
16,
353,
67,
8578,
33,
8381,
4672,
436,
8395,
2000,
279,
3082,
23265,
3168,
67,
3548,
6487,
5023,
980,
1300,
13,
434,
326,
1084,
981,
36... |
for userinfo in spwd.getspall(): if isnormal(userinfo[0]) == 1: | for userinfo in getspall(): if isnormal(userinfo[0]): | def __init__(self): self.wTree = gtk.glade.XML(VAR['TIMEKPRSHARED'] + '/timekpr.glade','mainwindow') self.get_limit_spin() self.get_from_spin() self.get_to_spin() self.get_labels() self.singleLimits = self.wTree.get_widget("singleLimits") self.singleBoundaries = self.wTree.get_widget("singleBoundaries") self.limitCheck = self.wTree.get_widget("limitCheck") self.boundariesCheck = self.wTree.get_widget("boundariesCheck") self.userSelect = self.wTree.get_widget("userSelect") self.rewardSpin = self.wTree.get_widget("rewardSpin") self.labelrewardspin = self.wTree.get_widget("labelrewardspin") self.labeluserstatus = self.wTree.get_widget("labeluserstatus") self.limiticon = self.wTree.get_widget("imagelimited1") self.boundariesicon = self.wTree.get_widget("imagelimited2") self.alldayloginicon = self.wTree.get_widget("imagealldaylogin") self.lockedicon = self.wTree.get_widget("imagelocked") self.extendLimitsButton = self.wTree.get_widget("extendLimitsButton") self.rewardButton = self.wTree.get_widget("rewardButton") self.clearallButton = self.wTree.get_widget("ClearAllRestrictionsButton") self.resettimeButton = self.wTree.get_widget("ResetTimeButton") self.lockLabel = self.wTree.get_widget("labelunlockbutton") self.statusbar = self.wTree.get_widget("statusbar") self.statusbarCID = self.statusbar.get_context_id("timekprstatus") dic = { "on_limitCheck_toggled": self.limitCheck_toggled, "on_boundariesCheck_toggled": self.boundariesCheck_toggled, "on_rewardButton_clicked": self.rewardButton_clicked, "on_extendLimitsButton_clicked": self.extendLimitsButton_clicked, "on_ClearAllRestrictionsButton_clicked": self.clearallrestrictions, "on_ResetTimeButton_clicked": self.resettimefile, "on_UnlockButton_clicked": self.lockunlockaccount, "on_apply_clicked": self.apply_clicked, "on_singleBoundaries_toggled": self.singleBoundariesCheck_toggled, "on_singleLimits_toggled": self.singleLimitsCheck_toggled, "on_userSelect_toggled": self.read_settings, "on_refresh_clicked": self.refreshButton_clicked, "on_cancel_clicked": self.cancel_clicked, "on_aboutmenuitem_select": self.showaboutdialog, 'gtk_main_quit': gtk.main_quit } self.wTree.signal_autoconnect(dic) #Using /etc/shadow spwd module for userinfo in spwd.getspall(): if isnormal(userinfo[0]) == 1: self.userSelect.append_text( userinfo[0] ) self.userSelect.set_active( 0 ) self.read_settings(self) return | bc3f8d334f44f36a68068a3c69525ff270e58205 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1574/bc3f8d334f44f36a68068a3c69525ff270e58205/timekpr-gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
91,
2471,
273,
22718,
18,
7043,
2486,
18,
4201,
12,
7716,
3292,
4684,
47,
8025,
8325,
5879,
3546,
397,
1173,
957,
79,
683,
18,
7043,
2486,
170... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
91,
2471,
273,
22718,
18,
7043,
2486,
18,
4201,
12,
7716,
3292,
4684,
47,
8025,
8325,
5879,
3546,
397,
1173,
957,
79,
683,
18,
7043,
2486,
170... |
return False s = StringIO.StringIO(self.get_data(cr)) | return False s = StringIO.StringIO(self.get_data(cr)) | def open(self, cr, mode=False): uid = self.context.uid if self.type in ('collection','database'): return False s = StringIO.StringIO(self.get_data(cr)) s.name = self return s | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
4422,
16,
1965,
33,
8381,
4672,
4555,
273,
365,
18,
2472,
18,
1911,
309,
365,
18,
723,
316,
7707,
5548,
17023,
6231,
11,
4672,
327,
1083,
272,
273,
15777,
18,
780,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
4422,
16,
1965,
33,
8381,
4672,
4555,
273,
365,
18,
2472,
18,
1911,
309,
365,
18,
723,
316,
7707,
5548,
17023,
6231,
11,
4672,
327,
1083,
272,
273,
15777,
18,
780,
... |
global _powell_funcalls | fcalls, func = wrap_function(func, args) | def fmin_powell(func, x0, args=(), xtol=1e-4, ftol=1e-4, maxiter=None, maxfun=None, full_output=0, disp=1, retall=0): """Minimize a function using modified Powell's method. Description: Uses a modification of Powell's method to find the minimum of a function of N variables Inputs: func -- the Python function or method to be minimized. x0 -- the initial guess. args -- extra arguments for func. Outputs: (xopt, {fopt, xi, direc, iter, funcalls, warnflag}, {allvecs}) xopt -- minimizer of function fopt -- value of function at minimum: fopt = func(xopt) direc -- current direction set iter -- number of iterations funcalls -- number of function calls warnflag -- Integer warning flag: 1 : 'Maximum number of function evaluations.' 2 : 'Maximum number of iterations.' allvecs -- a list of solutions at each iteration Additional Inputs: xtol -- line-search error tolerance. ftol -- acceptable relative error in func(xopt) for convergence. maxiter -- the maximum number of iterations to perform. maxfun -- the maximum number of function evaluations. full_output -- non-zero if fval and warnflag outputs are desired. disp -- non-zero to print convergence messages. retall -- non-zero to return a list of the solution at each iteration """ global _powell_funcalls x = asarray(x0) if retall: allvecs = [x] N = len(x) rank = len(x.shape) if not -1 < rank < 2: raise ValueError, "Initial guess must be a scalar or rank-1 sequence." if maxiter is None: maxiter = N * 1000 if maxfun is None: maxfun = N * 1000 direc = eye(N,typecode='d') fval = squeeze(apply(func, (x,)+args)) _powell_funcalls = 1 x1 = x.copy() iter = 0; ilist = range(N) while 1: fx = fval bigind = 0 delta = 0.0 for i in ilist: direc1 = direc[i] fx2 = fval fval, x, direc1 = _linesearch_powell(func, x, direc1, args=args, tol=xtol*100) if (fx2 - fval) > delta: delta = fx2 - fval bigind = i iter += 1 if retall: allvecs.append(x) if (2.0*(fx - fval) <= ftol*(abs(fx)+abs(fval))+1e-20): break if _powell_funcalls >= maxfun: break if iter >= maxiter: break # Construct the extrapolated point direc1 = x - x1 x2 = 2*x - x1 x1 = x.copy() fx2 = squeeze(apply(func, (x2,)+args)) _powell_funcalls +=1 if (fx > fx2): t = 2.0*(fx+fx2-2.0*fval) temp = (fx-fval-delta) t *= temp*temp temp = fx-fx2 t -= delta*temp*temp if t < 0.0: fval, x, direc1 = _linesearch_powell(func, x, direc1, args=args, tol=xtol*100) direc[bigind] = direc[-1] direc[-1] = direc1 warnflag = 0 if _powell_funcalls >= maxfun: warnflag = 1 if disp: print "Warning: Maximum number of function evaluations has "\ "been exceeded." elif iter >= maxiter: warnflag = 2 if disp: print "Warning: Maximum number of iterations has been exceeded" else: if disp: print "Optimization terminated successfully." print " Current function value: %f" % fval print " Iterations: %d" % iter print " Function evaluations: %d" % _powell_funcalls x = squeeze(x) if full_output: retlist = x, fval, direc, iter, _powell_funcalls, warnflag if retall: retlist += (allvecs,) else: retlist = x if retall: retlist = (x, allvecs) return retlist | 926e615eebcd9f2ca3373b1887f74b532b10bda4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/926e615eebcd9f2ca3373b1887f74b532b10bda4/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
67,
23509,
1165,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
24,
16,
284,
3490,
33,
21,
73,
17,
24,
16,
25743,
33,
7036,
16,
943,
12125,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
67,
23509,
1165,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
24,
16,
284,
3490,
33,
21,
73,
17,
24,
16,
25743,
33,
7036,
16,
943,
12125,
33,
70... |
assert(vals.imag > 1e10 and isfinite(vals)) | assert(isfinite(vals)) | def check_complex_bad2(self): v = 1+1j v += array(-1+1.j)/0. vals = nan_to_num(v) assert(vals.imag > 1e10 and isfinite(vals)) # !! This is actually (unexpectedly) positive # !! inf. Comment out for now, and see if it # !! changes #assert(vals.real < -1e10 and isfinite(vals)) | 9496b106d6e4258c5be22603073cc93174e67902 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/9496b106d6e4258c5be22603073cc93174e67902/test_misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
14259,
67,
8759,
22,
12,
2890,
4672,
331,
273,
404,
15,
21,
78,
331,
1011,
526,
19236,
21,
15,
21,
18,
78,
13176,
20,
18,
5773,
273,
6468,
67,
869,
67,
2107,
12,
90,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
14259,
67,
8759,
22,
12,
2890,
4672,
331,
273,
404,
15,
21,
78,
331,
1011,
526,
19236,
21,
15,
21,
18,
78,
13176,
20,
18,
5773,
273,
6468,
67,
869,
67,
2107,
12,
90,
13,
... |
['validate_rights:j_id268', 'Save local rights'], | ['validate_rights:document_rights_validate_button', 'Save local rights'], | def grant(self, permission, user): """Grant perm to user.""" fl = self.fl fl.assert_('Local rights' in fl.getBody(), 'Current page is not a rights tab.') server_url = fl.server_url params = [ ['AJAXREQUEST', 'add_rights_form:nxl_user_group_suggestion:j_id284'], ['add_rights_form', 'add_rights_form'], ['add_rights_form:nxl_user_group_suggestion:nxw_selection_suggest', user], ['add_rights_form:nxl_user_group_suggestion:nxw_selection_suggestionBox_selection', '0'], ['add_rights_form:j_id329', 'Grant'], ['add_rights_form:j_id334', 'Read'], ['javax.faces.ViewState', fl.getLastJsfState()], ['suggestionInputSelectorId', 'nxw_selection_suggest'], ['add_rights_form:nxl_user_group_suggestion:nxw_selection_suggestionBox:j_id292', 'add_rights_form:nxl_user_group_suggestion:nxw_selection_suggestionBox:j_id292'], ['suggestionSelectionListId', 'nxw_selection_list']] fl.post(server_url + "/view_documents.faces", params, description="Grant perm search user.") fl.assert_(user in fl.getBody(), "User not found") | 4f6cb47fd5a0cec6ab39d02a8adc2afbd0a822c2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11813/4f6cb47fd5a0cec6ab39d02a8adc2afbd0a822c2/pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7936,
12,
2890,
16,
4132,
16,
729,
4672,
3536,
9021,
4641,
358,
729,
12123,
1183,
273,
365,
18,
2242,
1183,
18,
11231,
67,
2668,
2042,
14989,
11,
316,
1183,
18,
588,
2250,
9334,
296,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7936,
12,
2890,
16,
4132,
16,
729,
4672,
3536,
9021,
4641,
358,
729,
12123,
1183,
273,
365,
18,
2242,
1183,
18,
11231,
67,
2668,
2042,
14989,
11,
316,
1183,
18,
588,
2250,
9334,
296,
3... |
if is_prime(n): | elif is_prime(n): | def __init__(self, DSage, n, concurrent=10, verbosity=0, trial_division_limit=10000, name='DistributedFactor'): r""" Parameters: DSage -- an instance of a dsage connection n -- the square-free number to be factored concurrent -- number of parallel jobs to run trial_division_limit -- perform trial division up to this number before attempting ecm. Defaults to 10000 which finishes quite quickly Set to -1 to skip (if the number is known to contain no small factors) name, verbosity -- obvious """ DistributedFunction.__init__(self, DSage) self.n = n self.prime_factors = [] self.cur_B1 = 2000 self.curve_count = 50 self.concurrent = concurrent self.verbosity = verbosity self.name = name # Trial division first to peel off some factors for d in prime_range(2, trial_division_limit): while d.divides(n): self.prime_factors.append(d) n = n // d if n == 1: self.done = True if is_prime(n): # The last value might be prime self.done = True self.prime_factors.append(n) else: self.composite_factors = [n] self.outstanding_jobs = [self.qsieve_job()] for i in range(concurrent-1): self.outstanding_jobs.append(self.ecm_job()) | 2c2a05f59bae8926618f31c0242348bbc44e958f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/2c2a05f59bae8926618f31c0242348bbc44e958f/dist_factor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8678,
410,
16,
290,
16,
10020,
33,
2163,
16,
11561,
33,
20,
16,
12950,
67,
2892,
1951,
67,
3595,
33,
23899,
16,
508,
2218,
1669,
11050,
6837,
11,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8678,
410,
16,
290,
16,
10020,
33,
2163,
16,
11561,
33,
20,
16,
12950,
67,
2892,
1951,
67,
3595,
33,
23899,
16,
508,
2218,
1669,
11050,
6837,
11,
4672,
... |
diffopts.context = 0 | diffopts = diffopts.copy(context=0) | def write(s, **kw): fp.write(s) | b10fc18f1402c8e80b1ee038ce9913bf099df5e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/b10fc18f1402c8e80b1ee038ce9913bf099df5e6/cmdutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
87,
16,
2826,
9987,
4672,
4253,
18,
2626,
12,
87,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
87,
16,
2826,
9987,
4672,
4253,
18,
2626,
12,
87,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
for all points :math:`$i$` in cluster :math:`$u$` and :math:`$j$` in cluster :math:`$v$`. This is also known as the | for all points :math:`i` in cluster :math:`u` and :math:`j` in cluster :math:`v`. This is also known as the | def linkage(y, method='single', metric='euclidean'): """ Performs hierarchical/agglomerative clustering on the condensed distance matrix y. y must be a {n \choose 2} sized vector where n is the number of original observations paired in the distance matrix. The behavior of this function is very similar to the MATLAB(TM) linkage function. A 4 by :math:`$(n-1)$` matrix ``Z`` is returned. At the :math:`$i$`th iteration, clusters with indices ``Z[i, 0]`` and ``Z[i, 1]`` are combined to form cluster :math:`$n + i$`. A cluster with an index less than :math:`$n$` corresponds to one of the :math:`$n$` original observations. The distance between clusters ``Z[i, 0]`` and ``Z[i, 1]`` is given by ``Z[i, 2]``. The fourth value ``Z[i, 3]`` represents the number of original observations in the newly formed cluster. The following linkage methods are used to compute the distance :math:`$d(s, t)$` between two clusters :math:`$s$` and :math:`$t$`. The algorithm begins with a forest of clusters that have yet to be used in the hierarchy being formed. When two clusters :math:`$s$` and :math:`$t$` from this forest are combined into a single cluster :math:`$u$`, :math:`$s$` and :math:`$t$` are removed from the forest, and :math:`$u$` is added to the forest. When only one cluster remains in the forest, the algorithm stops, and this cluster becomes the root. A distance matrix is maintained at each iteration. The ``d[i,j]`` entry corresponds to the distance between cluster :math:`$i$` and :math:`$j$` in the original forest. At each iteration, the algorithm must update the distance matrix to reflect the distance of the newly formed cluster u with the remaining clusters in the forest. Suppose there are :math:`$|u|$` original observations :math:`$u[0], \ldots, u[|u|-1]$` in cluster :math:`$u$` and :math:`$|v|$` original objects :math:`$v[0], \ldots, v[|v|-1]$` in cluster :math:`$v$`. Recall :math:`$s$` and :math:`$t$` are combined to form cluster :math:`$u$`. Let :math:`$v$` be any remaining cluster in the forest that is not :math:`$u$`. :Parameters: Q : ndarray A condensed or redundant distance matrix. A condensed distance matrix is a flat array containing the upper triangular of the distance matrix. This is the form that ``pdist`` returns. Alternatively, a collection of :math:`$m$` observation vectors in n dimensions may be passed as a :math:`$m$` by :math:`$n$` array. method : string The linkage algorithm to use. See the ``Linkage Methods`` section below for full descriptions. metric : string The distance metric to use. See the ``distance.pdist`` function for a list of valid distance metrics. Linkage Methods --------------- The following are methods for calculating the distance between the newly formed cluster :math:`$u$` and each :math:`$v$`. * method=``single`` assigns .. math: d(u,v) = \min(dist(u[i],v[j])) for all points :math:`$i$` in cluster :math:`$u$` and :math:`$j$` in cluster :math:`$v$`. This is also known as the Nearest Point Algorithm. * method=``complete`` assigns .. math: d(u, v) = \max(dist(u[i],v[j])) for all points :math:`$i$` in cluster u and :math:`$j$` in cluster :math:`$v$`. This is also known by the Farthest Point Algorithm or Voor Hees Algorithm. * method=``average`` assigns .. math: d(u,v) = \sum_{ij} \frac{d(u[i], v[j])} {(|u|*|v|) for all points :math:`$i$` and :math:`$j$` where :math:`$|u|$` and :math:`$|v|$` are the cardinalities of clusters :math:`$u$` and :math:`$v$`, respectively. This is also called the UPGMA algorithm. This is called UPGMA. * method='weighted' assigns .. math: d(u,v) = (dist(s,v) + dist(t,v))/2 where cluster u was formed with cluster s and t and v is a remaining cluster in the forest. (also called WPGMA) * method='centroid' assigns .. math: dist(s,t) = euclid(c_s, c_t) where :math:`$c_s$` and :math:`$c_t$` are the centroids of clusters :math:`$s$` and :math:`$t$`, respectively. When two clusters :math:`$s$` and :math:`$t$` are combined into a new cluster :math:`$u$`, the new centroid is computed over all the original objects in clusters :math:`$s$` and :math:`$t$`. The distance then becomes the Euclidean distance between the centroid of :math:`$u$` and the centroid of a remaining cluster :math:`$v$` in the forest. This is also known as the UPGMC algorithm. * method='median' assigns math:`$d(s,t)$` like the ``centroid`` method. When two clusters s and t are combined into a new cluster :math:`$u$`, the average of centroids s and t give the new centroid :math:`$u$`. This is also known as the WPGMC algorithm. * method='ward' uses the Ward variance minimization algorithm. The new entry :math:`$d(u,v)$` is computed as follows, .. math: d(u,v) = \sqrt{\frac{|v|+|s|} {T}d(v,s)^2 + \frac{|v|+|t|} {T}d(v,t)^2 + \frac{|v|} {T}d(s,t)^2} where :math:`$u$` is the newly joined cluster consisting of clusters :math:`$s$` and :math:`$t$`, :math:`$v$` is an unused cluster in the forest, :math:`$T=|v|+|s|+|t|$`, and :math:`$|*|$` is the cardinality of its argument. This is also known as the incremental algorithm. Warning ------- When the minimum distance pair in the forest is chosen, there may be two or more pairs with the same minimum distance. This implementation may chose a different minimum than the MATLAB(TM) version. """ if not isinstance(method, str): raise TypeError("Argument 'method' must be a string.") y = _convert_to_double(np.asarray(y, order='c')) s = y.shape if len(s) == 1: distance.is_valid_y(y, throw=True, name='y') d = distance.num_obs_y(y) if method not in _cpy_non_euclid_methods.keys(): raise ValueError("Valid methods when the raw observations are omitted are 'single', 'complete', 'weighted', and 'average'.") # Since the C code does not support striding using strides. [y] = _copy_arrays_if_base_present([y]) Z = np.zeros((d - 1, 4)) _hierarchy_wrap.linkage_wrap(y, Z, int(d), \ int(_cpy_non_euclid_methods[method])) elif len(s) == 2: X = y n = s[0] m = s[1] if method not in _cpy_linkage_methods: raise ValueError('Invalid method: %s' % method) if method in _cpy_non_euclid_methods.keys(): dm = distance.pdist(X, metric) Z = np.zeros((n - 1, 4)) _hierarchy_wrap.linkage_wrap(dm, Z, n, \ int(_cpy_non_euclid_methods[method])) elif method in _cpy_euclid_methods.keys(): if metric != 'euclidean': raise ValueError('Method %s requires the distance metric to be euclidean' % s) dm = distance.pdist(X, metric) Z = np.zeros((n - 1, 4)) _hierarchy_wrap.linkage_euclid_wrap(dm, Z, X, m, n, int(_cpy_euclid_methods[method])) return Z | 8172e9e1737f1f6d84d1b06fa46e587e764a1a0f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/8172e9e1737f1f6d84d1b06fa46e587e764a1a0f/hierarchy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
410,
12,
93,
16,
707,
2218,
7526,
2187,
3999,
2218,
73,
22392,
11,
4672,
3536,
27391,
26633,
19,
346,
7043,
362,
264,
1535,
18743,
603,
326,
6941,
28003,
3888,
3148,
677,
18,
677,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
410,
12,
93,
16,
707,
2218,
7526,
2187,
3999,
2218,
73,
22392,
11,
4672,
3536,
27391,
26633,
19,
346,
7043,
362,
264,
1535,
18743,
603,
326,
6941,
28003,
3888,
3148,
677,
18,
677,
... |
webbrowser.open('http://wiki.osafoundation.org/bin/view/Projects/ChandlerProductFAQ') | self.openURLOrDialog( 'http://wiki.osafoundation.org/bin/view/Projects/ChandlerProductFAQ' ) | def onHelpEvent(self, event): # For now, open the Chandler FAQ page: # # <http://lists.osafoundation.org/pipermail/design/2006-August/005311.html> webbrowser.open('http://wiki.osafoundation.org/bin/view/Projects/ChandlerProductFAQ') | 3e6151b19ff4fe94b4f5217930d4117be8b976d8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/3e6151b19ff4fe94b4f5217930d4117be8b976d8/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
6696,
1133,
12,
2890,
16,
871,
4672,
468,
2457,
2037,
16,
1696,
326,
1680,
464,
749,
15064,
53,
1363,
30,
468,
468,
411,
2505,
2207,
9772,
18,
538,
1727,
772,
367,
18,
3341,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
6696,
1133,
12,
2890,
16,
871,
4672,
468,
2457,
2037,
16,
1696,
326,
1680,
464,
749,
15064,
53,
1363,
30,
468,
468,
411,
2505,
2207,
9772,
18,
538,
1727,
772,
367,
18,
3341,
19,
... |
'TASKNAME': dynamic_util.cl_task_name(j), 'UNIQUEJOBID': dynamic_util.cl_unique_job_id(j), | 'TASKNAME': self.dynamic_util.cl_task_name(j), 'UNIQUEJOBID': self.dynamic_util.cl_unique_job_id(j), | def _cl_job_meta_message(self): j = self.job_info # called on client, so job_info is Job object exec self.importDynamicUtil() msg = { 'GRIDJOBID': dynamic_util.cl_grid_job_id(j), # e.g. https://grid-lb0.desy.de:9000/moqY5njFGurEuoDkkJmtBA 'INPUTDATASET': LCGAthenaUtil.cl_input_dataset(j), # e.g. fdr08_run2.0052283.physics_Muon.merge.AOD.o3_f8_m10 'JOB_ID_INSIDE_THE_TASK': dynamic_util.cl_job_id_inside_the_task(j), # subjob id e.g. 0 'NEVENTSREQUESTED': LCGAthenaUtil.cl_nevents_requested(j), # None or non-negative number e.g. 100 'OUTPUTDATASET': LCGAthenaUtil.cl_output_dataset(j),# e.g. user09.DavidTuckett.ganga.420.20091125.FZK-LCG2_SCRATCHDISK 'OUTPUTSE': LCGAthenaUtil.cl_output_se(j), # Unknown at submission. e.g. FZK-LCG2_SCRATCHDISK 'PILOT': 0, # 0 = not pilot, 1 = pilot 'PILOTNAME': None, 'REPORTER': 'ToolUI', # e.g. ToolUI, JobWN 'REPORTTIME': CommonUtil.utcnow(), # e.g. 2009-11-25T14:59:24.754249Z 'TARGET': LCGAthenaUtil.cl_target(j), # e.g. CE_xxx,SITE_CSCS-LCG2_DATADISK,SITE_DESY-ZN_DATADISK 'TASKNAME': dynamic_util.cl_task_name(j), # e.g. ganga:6702b50a-8a31-4476-8189-62ea5b8e00b3:TrigStudy 'UNIQUEJOBID': dynamic_util.cl_unique_job_id(j), # Ganga uuid e.g. 1c08ff3b-904f-4f77-a481-d6fa765813cb '___fqid' : j.fqid, } return msg | 8fc5b0bc368c704c04aaa9d01d8fe3d1ee85b726 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/8fc5b0bc368c704c04aaa9d01d8fe3d1ee85b726/AthenaMS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
830,
67,
4688,
67,
3901,
67,
2150,
12,
2890,
4672,
525,
273,
365,
18,
4688,
67,
1376,
468,
2566,
603,
1004,
16,
1427,
1719,
67,
1376,
353,
3956,
733,
1196,
365,
18,
5666,
9791,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
830,
67,
4688,
67,
3901,
67,
2150,
12,
2890,
4672,
525,
273,
365,
18,
4688,
67,
1376,
468,
2566,
603,
1004,
16,
1427,
1719,
67,
1376,
353,
3956,
733,
1196,
365,
18,
5666,
9791,
... |
self.webRefresh = util.boolify(webNode.getAttribute('refresh')) | self.webRefresh = webNode.getAttribute('refresh') | def loadWeb(self, webNode): if webNode.hasAttribute('listen'): #self.webListen = util.splitHostPort(webNode.getAttribute('listen')) self.webListen = webNode.getAttribute('listen') if webNode.hasAttribute('enable'): self.webEnable = util.boolify(webNode.getAttribute('enable')) if webNode.hasAttribute('secure'): self.webSecure = util.boolify(webNode.getAttribute('secure')) if webNode.hasAttribute('refresh'): self.webRefresh = util.boolify(webNode.getAttribute('refresh')) | e1e5ae3a24d9f12cb0977b92213665975deb50b5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10696/e1e5ae3a24d9f12cb0977b92213665975deb50b5/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
4079,
12,
2890,
16,
3311,
907,
4672,
309,
3311,
907,
18,
5332,
1499,
2668,
18085,
11,
4672,
468,
2890,
18,
4875,
14750,
273,
1709,
18,
4939,
16688,
12,
4875,
907,
18,
588,
1499,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
4079,
12,
2890,
16,
3311,
907,
4672,
309,
3311,
907,
18,
5332,
1499,
2668,
18085,
11,
4672,
468,
2890,
18,
4875,
14750,
273,
1709,
18,
4939,
16688,
12,
4875,
907,
18,
588,
1499,
... |
anyOpenTag,anyCloseTag = makeHTMLTags(Word(alphas,alphanums+"_")) | anyOpenTag,anyCloseTag = makeHTMLTags(Word(alphas,alphanums+"_:")) | def operatorPrecedence( baseExpr, opList ): """Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal - numTerms is the number of terms for this operator (must be 1 or 2) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants opAssoc.RIGHT and opAssoc.LEFT. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted) """ ret = Forward() lastExpr = baseExpr | ( Suppress('(') + ret + Suppress(')') ) for i,operDef in enumerate(opList): opExpr,arity,rightLeftAssoc,pa = (operDef + (None,))[:4] thisExpr = Forward().setName("expr%d" % i) if rightLeftAssoc == opAssoc.LEFT: if arity == 1: matchExpr = Group( lastExpr + opExpr ) elif arity == 2: matchExpr = Group( lastExpr + OneOrMore( opExpr + lastExpr ) ) else: raise ValueError, "operator must be unary (1) or binary (2)" elif rightLeftAssoc == opAssoc.RIGHT: if arity == 1: # try to avoid LR with this extra test if not isinstance(opExpr, Optional): opExpr = Optional(opExpr) matchExpr = FollowedBy(opExpr.expr + thisExpr) + Group( opExpr + thisExpr ) elif arity == 2: matchExpr = Group( lastExpr + OneOrMore( opExpr + thisExpr ) ) else: raise ValueError, "operator must be unary (1) or binary (2)" else: raise ValueError, "operator must indicate right or left associativity" if pa: matchExpr.setParseAction( pa ) thisExpr << ( matchExpr | lastExpr ) lastExpr = thisExpr ret << lastExpr return ret | bb0e6c1d8894ec4cade5f95640e793eeb8be8f10 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3693/bb0e6c1d8894ec4cade5f95640e793eeb8be8f10/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3726,
1386,
24092,
12,
1026,
4742,
16,
27571,
262,
30,
3536,
2276,
707,
364,
27389,
6473,
87,
434,
8041,
7165,
731,
434,
12213,
5960,
316,
279,
14172,
9360,
18,
225,
7692,
3062,
2026,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3726,
1386,
24092,
12,
1026,
4742,
16,
27571,
262,
30,
3536,
2276,
707,
364,
27389,
6473,
87,
434,
8041,
7165,
731,
434,
12213,
5960,
316,
279,
14172,
9360,
18,
225,
7692,
3062,
2026,
50... |
locs = N.asarray(locs) (vmin, vmax) = locs[[0,-1]] | (vmin, vmax) = (int(vmin), int(vmax)) | def _daily_finder(locs, freqstr, aslocator): if freqstr == 'B': periodsperyear = 261 elif freqstr == 'D': periodsperyear = 365 else: raise ValueError("unexpected frequency") locs = N.asarray(locs) (vmin, vmax) = locs[[0,-1]] span = vmax - vmin + 1 dates = date_array(start_date=Date(freqstr,vmin), end_date=Date(freqstr, vmax)) # Initialize the output if aslocator: default = N.arange(vmin, vmax+1) else: #asformatter format = N.empty(locs.size, dtype="|S8") format.flat = '' # Case 1. Less than a month if span <= (periodsperyear//12 - 2): month_start = period_break(dates,'month') if aslocator: major = default[month_start] minor = default else: year_start = period_break(dates,'year') format[:] = '%d' format[month_start] = '%d\n%b' format[year_start] = '%d\n%b\n%Y' if year_start.size == 0: if month_start.size == 0: if dates.size > 1: idx = 1 else: idx = 0 format[idx] = '%d\n%b\n%Y' else: format[month_break[0]] = '%d\n%b\n%Y' # Case 2. Less than three months elif span <= periodsperyear//4: month_start = period_break(dates,'month') if aslocator: major = default[month_start] minor = default else: week_start = (dates.day_of_week == 1) year_start = period_break(dates,'year') week_start[0] = False month_start[0] = False year_start[0] = False format[week_start] = '%d' format[month_start] = '\n\n%b' format[year_start] = '\n\n%b\n%Y' if year_start.size == 0: month_break = month_start.nonzero()[0] if month_break.size == 0: week_break = week_start.nonzero()[0] format[week_break[0]] = '\n\n%b\n%Y' else: format[month_break[0]] = '\n\n%b\n%Y' # Case 3. Less than 14 months ............... elif span <= 1.15 * periodsperyear: month_start = period_break(dates,'month') if aslocator: week_start = period_break(dates, 'week') minor_idx = (week_start | month_start) minor_idx[0] = True major = default[month_start] minor = default[minor_idx] else: year_start = period_break(dates,'year') month_start[0] = False year_start[0] = False format[month_start] = '%b' format[year_start] = '%b\n%Y' if not year_start.size: format[month_break[0]] = '%b\n%Y' # Case 4. Less than 2.5 years ............... elif span <= 2.5 * periodsperyear: year_start = period_break(dates,'year') if aslocator: month_start = period_break(dates, 'quarter') major = default[year_start] minor = default[month_start] else: quarter_start = period_break(dates, 'quarter') format[quarter_start] = '%b' format[year_start] = '%b\n%Y' # Case 4. Less than 4 years ................. elif span <= 4 * periodsperyear: year_start = period_break(dates,'year') month_start = period_break(dates, 'month') if aslocator: major = default[year_start] minor = default[month_start] else: month_break = dates[month_start].month jan_or_jul = month_start[(month_break == 1 | month_break == 7)] format[jan_or_jul] = '%b' format[year_start] = '%b\n%Y' # Case 5. Less than 11 years ................ elif span <= 11 * periodsperyear: year_start = period_break(dates,'year') if aslocator: quarter_start = period_break(dates, 'quarter') major = default[year_start] minor = default[quarter_start] else: format[year_start] = '%Y' # Case 6. More than 12 years ................ else: year_start = period_break(dates,'year') year_break = dates[year_start].years nyears = span/periodsperyear (min_anndef, maj_anndef) = _get_default_annual_spacing(nyears) major_idx = year_start[(year_break % maj_anndef == 0)] if aslocator: major = default[major_idx] minor_idx = year_start[(year_break % min_anndef == 0)] minor = default[minor_idx] else: format[major_idx] = '%Y' #............................................ if aslocator: return minor, major else: formatted = (format != '') return dict([(d,f) for (d,f) in zip(dates[formatted],format[formatted])]) | 7a3c507a500aec86f9240f3a0e8437c36eeb7238 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/7a3c507a500aec86f9240f3a0e8437c36eeb7238/mpl_timeseries_pgm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26790,
67,
15356,
12,
24323,
16,
7684,
701,
16,
487,
20048,
4672,
225,
309,
7684,
701,
422,
296,
38,
4278,
12777,
457,
6874,
273,
576,
9498,
1327,
7684,
701,
422,
296,
40,
4278,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26790,
67,
15356,
12,
24323,
16,
7684,
701,
16,
487,
20048,
4672,
225,
309,
7684,
701,
422,
296,
38,
4278,
12777,
457,
6874,
273,
576,
9498,
1327,
7684,
701,
422,
296,
40,
4278,
1... |
"non-zero flags not allowed in calls to recv_into() on %s" % self.__class__) | "non-zero flags not allowed in calls to recv_into() on %s" % self.__class__) | def recv_into (self, buffer, nbytes=None, flags=0): self._checkClosed() if buffer and (nbytes is None): nbytes = len(buffer) elif nbytes is None: nbytes = 1024 if self._sslobj: if flags != 0: raise ValueError( "non-zero flags not allowed in calls to recv_into() on %s" % self.__class__) while True: try: v = self.read(nbytes, buffer) sys.stdout.flush() return v except SSLError as x: if x.args[0] == SSL_ERROR_WANT_READ: continue else: raise x else: return socket.recv_into(self, buffer, nbytes, flags) | 80e3b731afdd5339bee603af01a80f172af03c74 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/80e3b731afdd5339bee603af01a80f172af03c74/ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10665,
67,
18591,
261,
2890,
16,
1613,
16,
26689,
33,
7036,
16,
2943,
33,
20,
4672,
365,
6315,
1893,
7395,
1435,
309,
1613,
471,
261,
82,
3890,
353,
599,
4672,
26689,
273,
562,
12,
410... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10665,
67,
18591,
261,
2890,
16,
1613,
16,
26689,
33,
7036,
16,
2943,
33,
20,
4672,
365,
6315,
1893,
7395,
1435,
309,
1613,
471,
261,
82,
3890,
353,
599,
4672,
26689,
273,
562,
12,
410... |
if self._cartan_type.is_irreducible(): | if self._cartan_type.is_atomic(): | def coerce_to_sl(self, x): """ For type ['A',r], this coerces an element of the ambient space into SL(r+1,CC) by subtracting a (possibly fractional) power of the determinant. """ if self._cartan_type.is_irreducible(): if self._cartan_type[0] == 'A': x = x - self._space.det(sum(x.to_vector())/(self._rank+1)) else: xv = x.to_vector() shifts = self._cartan_type._shifts types = self._cartan_type.component_types() for i in range(len(types)): if self._cartan_type.component_types()[i][0] == 'A': s = self._space.ambient_spaces()[i].det(sum(xv[shifts[i]:shifts[i+1]])/(types[i][1]+1)) x = x - self._space.inject_weights(i, s) return x | 4f1d9b099eb7fa4771eb32c91fd6665497057884 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/4f1d9b099eb7fa4771eb32c91fd6665497057884/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12270,
67,
869,
67,
2069,
12,
2890,
16,
619,
4672,
3536,
2457,
618,
10228,
37,
2187,
86,
6487,
333,
1825,
264,
764,
392,
930,
434,
326,
13232,
1979,
3476,
1368,
348,
48,
12,
86,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12270,
67,
869,
67,
2069,
12,
2890,
16,
619,
4672,
3536,
2457,
618,
10228,
37,
2187,
86,
6487,
333,
1825,
264,
764,
392,
930,
434,
326,
13232,
1979,
3476,
1368,
348,
48,
12,
86,
15,
... |
cnt = 0 | def extractKVParams(self, paramsStr): params = safesplitfields(paramsStr, ',') result = {} cnt = 0 for param in params: try: sidx = string.index(param, '=') except ValueError: result[`cnt`] = string.strip(param[sidx+1:]) else: result[string.strip(param[:sidx])] = string.strip(param[sidx+1:]) cnt = cnt + 1 return result | 6eb029397632b8d41c11a092feecd7f4c782a432 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/6eb029397632b8d41c11a092feecd7f4c782a432/methodparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
16945,
1370,
12,
2890,
16,
859,
1585,
4672,
859,
273,
11029,
281,
1127,
2821,
12,
2010,
1585,
16,
3316,
13,
563,
273,
2618,
225,
364,
579,
316,
859,
30,
775,
30,
272,
3465,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
16945,
1370,
12,
2890,
16,
859,
1585,
4672,
859,
273,
11029,
281,
1127,
2821,
12,
2010,
1585,
16,
3316,
13,
563,
273,
2618,
225,
364,
579,
316,
859,
30,
775,
30,
272,
3465,
273,
... | |
user_info = cherrypy.session.get('login_info', '') | def update_item_voting(self, **kw): vals = kw.get('_terp_values', '') vals = vals.split('!') vals = [v.split('|') for v in vals] vals = [(x.split(','), y.split(','), z.split(','), w.split(',')) for x, y, z, w in vals] vals = [dict(v) for v in vals] list = [] user_info = cherrypy.session.get('login_info', '') user_proxy = rpc.RPCProxy('comparison.user') user_id = user_proxy.search([('name', '=', user_info)]) for v in vals: items = {} if v.get('score_id') != '0' and user_id: items['score_id'] = v.get('score_id') items['factor_id'] = v.get('id') items['item_id'] = v.get('item_id') items['note'] = str(v.get('note')) items['user_id'] = user_id[0] list += [items] vproxy = rpc.RPCProxy('comparison.vote.values') vid = vproxy.search([]) value_name = vproxy.read(vid, ['name']) smodel = "comparison.vote" sproxy = rpc.RPCProxy(smodel) res = None if not user_info: return dict(res=res, item_id=item_id, value_name=value_name, id=id, show_header_footer=False, error="You are not logged in...") try: res = sproxy.vote_create_async(list) except Exception, e: return dict(error=str(e)) return dict(res=res, item_id=item_id, value_name=value_name, id=id, show_header_footer=False, error="") | 9dd6ccfb2ed2bf444290a1a5b4bd1d87fabf4ce1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/9dd6ccfb2ed2bf444290a1a5b4bd1d87fabf4ce1/comparison.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1726,
67,
90,
17128,
12,
2890,
16,
2826,
9987,
4672,
225,
5773,
273,
5323,
18,
588,
2668,
67,
387,
84,
67,
2372,
2187,
28707,
5773,
273,
5773,
18,
4939,
2668,
5124,
13,
5773,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1726,
67,
90,
17128,
12,
2890,
16,
2826,
9987,
4672,
225,
5773,
273,
5323,
18,
588,
2668,
67,
387,
84,
67,
2372,
2187,
28707,
5773,
273,
5773,
18,
4939,
2668,
5124,
13,
5773,... | |
default='{{project.req_settings.get("opencore_site_id") or default_opencore_site_id}}', | default='{{project.req_settings.get("opencore_site_id") or project.default_opencore_site_id}}', | def run(self): if self.maker.simulate: self.logger.notify('Would run "zopectl run %s %s"' % (self.script_path, self.script_args)) return if os.path.exists(self.script_path): zopectl_path = self.interpolate('{{env.base_path}}/opencore/zope/bin/zopectl') process_args = [zopectl_path, 'run', self.script_path] process_args.append(self.script_args) script_proc = subprocess.Popen(process_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.logger.notify('Script running (PID %s)' % script_proc.pid) script_proc.communicate() else: self.maker.beep_if_necessary() self.logger.warn('Tried to run zopectl script at %s but the ' 'path does not exist' % self.script_path, color='red') | 28788ba6ac21a5908980eaf510370d015c0438fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12796/28788ba6ac21a5908980eaf510370d015c0438fb/topp_opencore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
365,
18,
29261,
18,
9812,
6243,
30,
365,
18,
4901,
18,
12336,
2668,
59,
1006,
1086,
315,
94,
83,
1181,
80,
1086,
738,
87,
738,
87,
5187,
738,
261,
2890,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
365,
18,
29261,
18,
9812,
6243,
30,
365,
18,
4901,
18,
12336,
2668,
59,
1006,
1086,
315,
94,
83,
1181,
80,
1086,
738,
87,
738,
87,
5187,
738,
261,
2890,
18... |
if self.tkconsole.closing: return | def poll_subprocess(self): clt = self.rpcclt if clt is None: return try: response = clt.pollresponse(self.active_seq, wait=0.05) except (EOFError, IOError, KeyboardInterrupt): # lost connection or subprocess terminated itself, restart # [the KBI is from rpc.SocketIO.handle_EOF()] if self.tkconsole.closing: return response = None self.restart_subprocess() self.tkconsole.endexecuting() if response: self.tkconsole.resetoutput() self.active_seq = None how, what = response console = self.tkconsole.console if how == "OK": if what is not None: print >>console, `what` elif how == "EXCEPTION": if self.tkconsole.getvar("<<toggle-jit-stack-viewer>>"): self.remote_stack_viewer() elif how == "ERROR": errmsg = "PyShell.ModifiedInterpreter: Subprocess ERROR:\n" print >>sys.__stderr__, errmsg, what print >>console, errmsg, what # we received a response to the currently active seq number: self.tkconsole.endexecuting() # Reschedule myself in 50 ms self.tkconsole.text.after(50, self.poll_subprocess) | c972a8080ead593831900b1033e83bae7763ce08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c972a8080ead593831900b1033e83bae7763ce08/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
67,
1717,
2567,
12,
2890,
4672,
927,
88,
273,
365,
18,
7452,
830,
88,
309,
927,
88,
353,
599,
30,
327,
775,
30,
766,
273,
927,
88,
18,
13835,
2740,
12,
2890,
18,
3535,
67,
54... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
67,
1717,
2567,
12,
2890,
4672,
927,
88,
273,
365,
18,
7452,
830,
88,
309,
927,
88,
353,
599,
30,
327,
775,
30,
766,
273,
927,
88,
18,
13835,
2740,
12,
2890,
18,
3535,
67,
54... | |
if data and self.statuscode != 407: | if data and self.statuscode != 407 and hasattr(self.client, "server_content"): | def flush (self): """ Flush data of decoders (if any) and filters and write it to the client. return True if flush was successful. """ assert None == wc.log.debug(wc.LOG_PROXY, "%s HttpServer.flush", self) if not self.statuscode and self.method != 'CONNECT': wc.log.warn(wc.LOG_PROXY, "%s flush without status", self) return True data = self.flush_coders(self.decoders) try: for stage in FilterStages: data = wc.filter.applyfilter(stage, data, "finish", self.attrs) except wc.filter.FilterWait, msg: assert None == wc.log.debug(wc.LOG_PROXY, "%s FilterWait %s", self, msg) # the filter still needs some data # to save CPU time make connection unreadable for a while self.set_unreadable(1.0) return False except wc.filter.FilterRating, msg: assert None == wc.log.debug(wc.LOG_PROXY, "%s FilterRating from content %s", self, msg) self._show_rating_deny(str(msg)) return True data = self.flush_coders(self.encoders, data=data) # the client might already have closed if not self.client: return if self.defer_data: self.defer_data = False self.client.server_response(self, self.response, self.statuscode, self.headers) if not self.client: return if data and self.statuscode != 407: self.client.server_content(data) return True | 2587cda0d9e6af8d79e58281a1df4172573b051c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/2587cda0d9e6af8d79e58281a1df4172573b051c/HttpServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3663,
261,
2890,
4672,
3536,
11624,
501,
434,
443,
1559,
414,
261,
430,
1281,
13,
471,
3415,
471,
1045,
518,
358,
326,
1004,
18,
327,
1053,
309,
3663,
1703,
6873,
18,
3536,
1815,
599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3663,
261,
2890,
4672,
3536,
11624,
501,
434,
443,
1559,
414,
261,
430,
1281,
13,
471,
3415,
471,
1045,
518,
358,
326,
1004,
18,
327,
1053,
309,
3663,
1703,
6873,
18,
3536,
1815,
599,
... |
def __init__(self, host): | def __init__(self, host, timeout=None): | def __init__(self, host): from Testing.ZopeTestCase.zopedoctest.functional import http self.caller = http self.host = host | a6c2abea19b789a1dec03fd597cfe24a4e5a3b6e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9658/a6c2abea19b789a1dec03fd597cfe24a4e5a3b6e/testbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
2021,
33,
7036,
4672,
628,
7766,
310,
18,
62,
1306,
4709,
2449,
18,
94,
8889,
13410,
395,
18,
915,
287,
1930,
1062,
365,
18,
16140,
273,
1062,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
2021,
33,
7036,
4672,
628,
7766,
310,
18,
62,
1306,
4709,
2449,
18,
94,
8889,
13410,
395,
18,
915,
287,
1930,
1062,
365,
18,
16140,
273,
1062,
... |
self.logger=logging.getLogger("%s.controlsessoin"%(BASENAME,)) | self.logger=logging.getLogger('fuglu.controlsession') | def __init__(self,socket,controller): self.controller=controller self.socket=socket self.commands={ 'workerlist':self.workerlist, 'threadlist':self.threadlist, 'uptime':self.uptime, 'stats':self.stats } self.logger=logging.getLogger("%s.controlsessoin"%(BASENAME,)) | d9cf67144abef12545a88c1706b50a28ee7b1e30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10919/d9cf67144abef12545a88c1706b50a28ee7b1e30/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7814,
16,
5723,
4672,
365,
18,
5723,
33,
5723,
365,
18,
7814,
33,
7814,
365,
18,
7847,
5899,
296,
10124,
1098,
4278,
2890,
18,
10124,
1098,
16,
296,
5930... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7814,
16,
5723,
4672,
365,
18,
5723,
33,
5723,
365,
18,
7814,
33,
7814,
365,
18,
7847,
5899,
296,
10124,
1098,
4278,
2890,
18,
10124,
1098,
16,
296,
5930... |
flags_list = flags_to_str(flags) | flags_list = seq_to_parenlist(flags) | def append(self, folder, msg, flags=(), msg_time=None): '''Append a message to a folder | 85410ed715e4d58f7449b28c7d003bfab4608e73 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9352/85410ed715e4d58f7449b28c7d003bfab4608e73/imapclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
12,
2890,
16,
3009,
16,
1234,
16,
2943,
33,
9334,
1234,
67,
957,
33,
7036,
4672,
9163,
5736,
279,
883,
358,
279,
3009,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
12,
2890,
16,
3009,
16,
1234,
16,
2943,
33,
9334,
1234,
67,
957,
33,
7036,
4672,
9163,
5736,
279,
883,
358,
279,
3009,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.debugger.show_variables() | self.debugger.show_variables() | def OnEdit(self, event): watch = self.watches[self.selected] dlg = wxTextEntryDialog(self, 'Current expression:', 'Edit watch:', watch[0]) try: if dlg.ShowModal() == wxID_OK: del self.watches[self.selected] self.watches.insert(self.selected, [dlg.GetValue(), watch[1]] ) self.debugger.show_variables() finally: dlg.Destroy() | 872f754eafee36b7b9b20954604570707e5cd36c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/872f754eafee36b7b9b20954604570707e5cd36c/Debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4666,
12,
2890,
16,
871,
4672,
4267,
273,
365,
18,
7585,
281,
63,
2890,
18,
8109,
65,
25840,
273,
7075,
1528,
1622,
6353,
12,
2890,
16,
296,
3935,
2652,
30,
2187,
296,
4666,
4267... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4666,
12,
2890,
16,
871,
4672,
4267,
273,
365,
18,
7585,
281,
63,
2890,
18,
8109,
65,
25840,
273,
7075,
1528,
1622,
6353,
12,
2890,
16,
296,
3935,
2652,
30,
2187,
296,
4666,
4267... |
'vms':vms | 'vms':vms, 'can_create':can_create, | def list_(request): user = request.user if user.is_superuser: vms = VirtualMachine.objects.all() else: vms = user.filter_on_perms(VirtualMachine, ['admin']) return render_to_response('virtual_machine/list.html', { 'vms':vms }, context_instance=RequestContext(request), ) | 0f60187628e6e05b4b986d8381ca0a5c142e5167 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/0f60187628e6e05b4b986d8381ca0a5c142e5167/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
12,
2293,
4672,
729,
273,
590,
18,
1355,
309,
729,
18,
291,
67,
9565,
1355,
30,
23731,
273,
18452,
18,
6911,
18,
454,
1435,
469,
30,
23731,
273,
729,
18,
2188,
67,
265,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
12,
2293,
4672,
729,
273,
590,
18,
1355,
309,
729,
18,
291,
67,
9565,
1355,
30,
23731,
273,
18452,
18,
6911,
18,
454,
1435,
469,
30,
23731,
273,
729,
18,
2188,
67,
265,
67,
... |
stmt = self.com_node(nodelist[2]) | def com_try_except(self, nodelist): # try_except: 'try' ':' suite (except_clause ':' suite)* ['else' suite] #tryexcept: [TryNode, [except_clauses], elseNode)] stmt = self.com_node(nodelist[2]) clauses = [] elseNode = None for i in range(3, len(nodelist), 3): node = nodelist[i] if node[0] == symbol.except_clause: # except_clause: 'except' [expr [',' expr]] */ if len(node) > 2: expr1 = self.com_node(node[2]) if len(node) > 4: expr2 = self.com_assign(node[4], OP_ASSIGN) else: expr2 = None else: expr1 = expr2 = None clauses.append((expr1, expr2, self.com_node(nodelist[i+2]))) | 287fe64523cd49c771237c11cb76cd2bea168b63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/287fe64523cd49c771237c11cb76cd2bea168b63/transformer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
532,
67,
698,
67,
14137,
12,
2890,
16,
30068,
4672,
468,
775,
67,
14137,
30,
296,
698,
11,
3921,
11371,
261,
14137,
67,
18128,
3921,
11371,
17653,
10228,
12107,
11,
11371,
65,
468,
698,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
532,
67,
698,
67,
14137,
12,
2890,
16,
30068,
4672,
468,
775,
67,
14137,
30,
296,
698,
11,
3921,
11371,
261,
14137,
67,
18128,
3921,
11371,
17653,
10228,
12107,
11,
11371,
65,
468,
698,
... | |
bibclassify -t file.txt -K ontology.rdf -m SLOW | bibclassify -s -t file.txt -K ontology.rdf -m SLOW | def usage(code, msg=''): "Prints usage for this module." if msg: sys.stderr.write("Error: %s.\n" % msg) usagetext = """ Usage: bibclassify [options] Examples: bibclassify -f file.pdf -k thesaurus.txt -o TEXT bibclassify -t file.txt -K ontology.rdf -m SLOW Specific options: -f, --pdffile=FILENAME name of the pdf file to be classified -t, --textfile=FILENAME name of the text file to be classified -k, --thesaurus=FILENAME name of the text thesaurus (taxonomy) -K, --ontology=FILENAME name of the RDF ontology -o, --output=HTML|TEXT output list of keywords in either HTML or text -n, --nkeywords=NUMBER max number of keywords to be found -m, --mode=FAST|SLOW processing mode: FAST (run on abstract and selected pages), SLOW (run on whole document - more accurate) General options: -h, --help print this help and exit -V, --version print version and exit | 64a338f3e936f0b7dd77fc005559df697fcc01ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/64a338f3e936f0b7dd77fc005559df697fcc01ce/bibclassifylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
12,
710,
16,
1234,
2218,
11,
4672,
315,
15402,
4084,
364,
333,
1605,
1199,
309,
1234,
30,
2589,
18,
11241,
18,
2626,
2932,
668,
30,
738,
87,
8403,
82,
6,
738,
1234,
13,
584,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
12,
710,
16,
1234,
2218,
11,
4672,
315,
15402,
4084,
364,
333,
1605,
1199,
309,
1234,
30,
2589,
18,
11241,
18,
2626,
2932,
668,
30,
738,
87,
8403,
82,
6,
738,
1234,
13,
584,
34... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.