rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
for_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="for").distinct().aggregate(Sum('score'))['score__sum'] against_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="against").distinct().aggregate(Sum('score'))['score__sum'] if for_score == None: for_score = 0 if against_score == None: against_score = 0
for_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="for").distinct().aggregate(Sum('score'))['score__sum'] or 0 against_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="against").distinct().aggregate(Sum('score'))['score__sum'] or 0
def mk_score(self, member): # Find all votes that # 1) This agenda is ascribed to # 2) the member participated in and either voted for or against for_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="for").distinct().aggregate(Sum('score'))['score__sum'] against_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="against").distinct().aggregate(Sum('score'))['score__sum'] if for_score == None: for_score = 0 if against_score == None: against_score = 0 return (for_score - against_score)
875ef932b836472b0010606b2f2ac47405119c3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1866/875ef932b836472b0010606b2f2ac47405119c3d/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5028, 67, 6355, 12, 2890, 16, 3140, 4672, 468, 4163, 777, 19588, 716, 468, 282, 404, 13, 1220, 28809, 353, 6972, 1533, 329, 358, 468, 282, 576, 13, 326, 3140, 30891, 690, 316, 471, 334...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5028, 67, 6355, 12, 2890, 16, 3140, 4672, 468, 4163, 777, 19588, 716, 468, 282, 404, 13, 1220, 28809, 353, 6972, 1533, 329, 358, 468, 282, 576, 13, 326, 3140, 30891, 690, 316, 471, 334...
{1/6, 1/4, 1/3, 1/2, 1/9, 0, 1/18, 5/12, Infinity, 1/12, 2/3, 5/6}
{1/2, 0, 1/3, 1/12, 5/6, 5/12, 1/4, 1/18, 1/6, 1/9, 2/3, Infinity}
def cusps(self, algorithm='default'): r""" Return a set of inequivalent cusps for self, i.e. a set of representatives for the orbits of self on $\mathbf{P}^1(\mathbf{Q})$. These should be returned in a reduced form.
c51ec0e30959829b530242dd6f31ebc27e35f74b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c51ec0e30959829b530242dd6f31ebc27e35f74b/congroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27964, 1121, 12, 2890, 16, 4886, 2218, 1886, 11, 4672, 436, 8395, 2000, 279, 444, 434, 316, 14298, 6505, 27964, 1121, 364, 365, 16, 277, 18, 73, 18, 279, 444, 434, 2406, 8785, 364, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 27964, 1121, 12, 2890, 16, 4886, 2218, 1886, 11, 4672, 436, 8395, 2000, 279, 444, 434, 316, 14298, 6505, 27964, 1121, 364, 365, 16, 277, 18, 73, 18, 279, 444, 434, 2406, 8785, 364, 326...
for k in self.compcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.compcodes[k]))
for k, v in self.namemappers[0].getall('comparison'): self.fp.write("\t%s : %s,\n" % (`k`, v))
def dumpindex(self): self.fp.write("\n#\n# Indices of types declared in this module\n#\n") self.fp.write("_classdeclarations = {\n") for k in self.classcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.classcodes[k])) self.fp.write("}\n") self.fp.write("\n_propdeclarations = {\n") for k in self.propcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.propcodes[k])) self.fp.write("}\n") self.fp.write("\n_compdeclarations = {\n") for k in self.compcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.compcodes[k])) self.fp.write("}\n") self.fp.write("\n_enumdeclarations = {\n") for k in self.enumcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.enumcodes[k])) self.fp.write("}\n")
42eee53a968a82394c0e1946ffbb8abc26471a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/42eee53a968a82394c0e1946ffbb8abc26471a5d/gensuitemodule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 1615, 12, 2890, 4672, 365, 18, 7944, 18, 2626, 31458, 82, 7, 64, 82, 7, 23046, 434, 1953, 7886, 316, 333, 1605, 64, 82, 7, 64, 82, 7923, 365, 18, 7944, 18, 2626, 2932, 67, 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, 4657, 1615, 12, 2890, 4672, 365, 18, 7944, 18, 2626, 31458, 82, 7, 64, 82, 7, 23046, 434, 1953, 7886, 316, 333, 1605, 64, 82, 7, 64, 82, 7923, 365, 18, 7944, 18, 2626, 2932, 67, 11...
json_serializer = serializers.get_serializer('python')() bugs = json_serializer.serialize(bunch_of_bugs)
obj_serializer = serializers.get_serializer('python')() bugs = obj_serializer.serialize(bunch_of_bugs)
def bugs_to_json_response(data, bunch_of_bugs, callback_function_name=''): """ The search results page accesses this view via jQuery's getJSON method, and loads its results into the DOM.""" # {{{ # FIXME: This looks super weird. json_serializer = serializers.get_serializer('python')() bugs = json_serializer.serialize(bunch_of_bugs) # Throughout the list, replace project primary keys with project names. for bug in bugs: project = Project.objects.get(pk=int(bug['fields']['project'])) bug['fields']['project'] = project.name data['bugs'] = bugs # JSON has to be an array of JS objects. # Let's make a list of Python objects first. data_list = [data] # Convert the list to a string expressing JSON array. json_array = simplejson.dumps(data_list, default=encode_datetime) return HttpResponse( callback_function_name + '(' + json_array + ')' ) # }}}
9e3652c04f45c52c39a6698bb28cb7653e709c43 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11976/9e3652c04f45c52c39a6698bb28cb7653e709c43/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22398, 67, 869, 67, 1977, 67, 2740, 12, 892, 16, 25606, 67, 792, 67, 19381, 16, 1348, 67, 915, 67, 529, 2218, 11, 4672, 3536, 1021, 1623, 1686, 1363, 2006, 281, 333, 1476, 3970, 11215,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22398, 67, 869, 67, 1977, 67, 2740, 12, 892, 16, 25606, 67, 792, 67, 19381, 16, 1348, 67, 915, 67, 529, 2218, 11, 4672, 3536, 1021, 1623, 1686, 1363, 2006, 281, 333, 1476, 3970, 11215,...
self.minmax[1]=self.minmax[0]*2
if self.minmax[0]==0: self.minmax[1]=1 else: self.minmax[1]=self.minmax[0]*2
def reframey(self): #no redraw! #get max and min from databuffers if self.zoomlevel==0: self.getminmax() if self.minmax[0]==self.minmax[1]: self.minmax[1]=self.minmax[0]*2 #calculate yframemin, max if self.scale_type=='linear': yrange=(self.minmax[1]-self.minmax[0])/(self.yframemax_when_rescaling-self.yframemin_when_rescaling) self.yframe[1]=self.minmax[1]+(1-self.yframemax_when_rescaling)*yrange self.yframe[0]=self.minmax[0]-(self.yframemin_when_rescaling*yrange) exponent=pow(10,floor(log10(self.yframe[1]-self.yframe[0]))) mantissa1=ceil(self.yframe[1]/exponent) mantissa0=floor(self.yframe[0]/exponent) ticks=mantissa1-mantissa0 if ticks>10: mantissa0=floor(mantissa0/2)*2 mantissa1=ceil(mantissa1/2)*2 ticks=(mantissa1-mantissa0)/2 elif ticks<5: ticks*=2 self.yticks_no=ticks
912698db6bf1ace6defb7275382e4229345f1963 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/912698db6bf1ace6defb7275382e4229345f1963/Plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1278, 1474, 93, 12, 2890, 4672, 225, 468, 2135, 16540, 5, 468, 588, 943, 471, 1131, 628, 10481, 3809, 414, 309, 365, 18, 14932, 2815, 631, 20, 30, 365, 18, 588, 1154, 1896, 1435, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1278, 1474, 93, 12, 2890, 4672, 225, 468, 2135, 16540, 5, 468, 588, 943, 471, 1131, 628, 10481, 3809, 414, 309, 365, 18, 14932, 2815, 631, 20, 30, 365, 18, 588, 1154, 1896, 1435, 309, ...
UsersController.groups.RemoveUsersFromGroup(group, [ login ], batch=True)
UsersController.groups.RemoveUsersFromGroup(group, [ login ], batch=True)
def DeleteUser(self, login=None, no_archive=False, uid=None, batch=False): """ Delete a user """ if login is None and uid is None: raise exceptions.BadArgumentError(logging.SYSU_SPECIFY_LGN_OR_UID)
2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2504, 1299, 12, 2890, 16, 3925, 33, 7036, 16, 1158, 67, 10686, 33, 8381, 16, 4555, 33, 7036, 16, 2581, 33, 8381, 4672, 3536, 2504, 279, 729, 3536, 309, 3925, 353, 599, 471, 4555, 353, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2504, 1299, 12, 2890, 16, 3925, 33, 7036, 16, 1158, 67, 10686, 33, 8381, 16, 4555, 33, 7036, 16, 2581, 33, 8381, 4672, 3536, 2504, 279, 729, 3536, 309, 3925, 353, 599, 471, 4555, 353, ...
self.pci_perm_dev_config = ['xend-pci-perm-devs']
pci_perm_dev_config = ['xend-pci-perm-devs']
def __devIsUnconstrained( self ): if os.path.exists(PERMISSIVE_CONFIG_FILE): try: fin = file(PERMISSIVE_CONFIG_FILE, 'rb') try: pci_perm_dev_config = parse(fin) finally: fin.close() if pci_perm_dev_config is None: pci_perm_dev_config = [''] else: pci_perm_dev_config.insert(0, '') self.pci_perm_dev_config = pci_perm_dev_config except Exception, ex: raise XendError("Reading config file %s: %s" % (PERMISSIVE_CONFIG_FILE,str(ex))) else: log.info("Config file does not exist: %s" % PERMISSIVE_CONFIG_FILE) self.pci_perm_dev_config = ['xend-pci-perm-devs']
03b02c0ea15a80e469b56c1a5f1ae2e0ce7ee5da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6195/03b02c0ea15a80e469b56c1a5f1ae2e0ce7ee5da/pciquirk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5206, 2520, 984, 591, 31142, 12, 365, 262, 30, 309, 1140, 18, 803, 18, 1808, 12, 3194, 7492, 1260, 5354, 67, 7203, 67, 3776, 4672, 775, 30, 574, 273, 585, 12, 3194, 7492, 1260, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5206, 2520, 984, 591, 31142, 12, 365, 262, 30, 309, 1140, 18, 803, 18, 1808, 12, 3194, 7492, 1260, 5354, 67, 7203, 67, 3776, 4672, 775, 30, 574, 273, 585, 12, 3194, 7492, 1260, ...
applyable = self.willApply
def do_update(self, arg): """ Usage: update [arg]
d6b45feb28107a284077c8d6876006fa58aedacc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/d6b45feb28107a284077c8d6876006fa58aedacc/session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 2725, 12, 2890, 16, 1501, 4672, 3536, 10858, 30, 1089, 306, 3175, 65, 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, 741, 67, 2725, 12, 2890, 16, 1501, 4672, 3536, 10858, 30, 1089, 306, 3175, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
misc.WriteLine(resolv,"nameserver " + network["dns2"])
if not network.get("dns2") == None: print "setting the second dns server...", network["dns2"] misc.WriteLine(resolv,"nameserver " + network["dns2"])
def run(self): #we don't touch the wifi interface #but we do remove all wifi entries from the #routing table
4c4d702e0ffb1d25ec2b8ef19df44973b9f936c2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12280/4c4d702e0ffb1d25ec2b8ef19df44973b9f936c2/networking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 1814, 2727, 1404, 6920, 326, 341, 704, 1560, 468, 12885, 732, 741, 1206, 777, 341, 704, 3222, 628, 326, 468, 16529, 1014, 2, 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, 0, 0, 0, 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, 4672, 468, 1814, 2727, 1404, 6920, 326, 341, 704, 1560, 468, 12885, 732, 741, 1206, 777, 341, 704, 3222, 628, 326, 468, 16529, 1014, 2, -100, -100, -100, -100, -100, -100...
path = self.path + os.sep + modulename + ".xrc"
path = module.__file__.split(os.sep) path = path[:-1] path = os.sep.join(path) path = path + os.sep + modulename + ".xrc"
def synchronizeView (self): wxMainFrame = app.association[id(app.model.mainFrame)] """ If it isn't in the association we need to construct it and put it in the association. """ if not app.association.has_key(id(self)): module = sys.modules[self.__class__.__module__] modulename = os.path.basename (module.__file__) modulename = os.path.splitext (modulename)[0] path = self.path + os.sep + modulename + ".xrc" """ ViewerParcels must have a resource file with the same name as the module with an .xrc extension """ assert (os.path.exists (path)) resources = wxXmlResource(path) panel = resources.LoadObject(wxMainFrame, modulename, "wxPanel") assert (panel != None) app.association[id(self)] = panel """ Set up model and resources for the convience of the parcel. OnInit gives the parcel a chance to wire up their events. """ panel.model = self panel.resources = resources panel.OnInit () else: panel = app.association[id(self)] """ We'll check to see if we've got a parcel installed in the view, and if so we'll remove it from the association and destroy it. Shortcut the case of setting the same window we've already set. """ container = wxMainFrame.FindWindowByName("ViewerParcel_container") children = container.GetChildren () assert (len (children) <= 1) if len (children) == 0 or children[0] != panel: for window in children: del app.association[id(window.model)] container.DestroyChildren () """ Attach the new parcel to the view. """ app.applicationResources.AttachUnknownControl ("ViewerParcel", panel)
3b22552d77071c2616eaf74c9b00efcf53122655 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/3b22552d77071c2616eaf74c9b00efcf53122655/ViewerParcel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16978, 1767, 261, 2890, 4672, 7075, 6376, 3219, 273, 595, 18, 19358, 63, 350, 12, 2910, 18, 2284, 18, 5254, 3219, 25887, 3536, 971, 518, 5177, 1404, 316, 326, 6384, 732, 1608, 358, 4872,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16978, 1767, 261, 2890, 4672, 7075, 6376, 3219, 273, 595, 18, 19358, 63, 350, 12, 2910, 18, 2284, 18, 5254, 3219, 25887, 3536, 971, 518, 5177, 1404, 316, 326, 6384, 732, 1608, 358, 4872,...
cmd = './configure --prefix %s %s %s ' + \ '--with-default-mozilla-five-home=%s' % \ (buildscript.config.prefix, buildscript.config.autogenargs, self.autogenargs, mozilla_path)
cmd = './configure ' + \ '--prefix %s ' % buildscript.config.prefix + \ '%s %s ' % (buildscript.config.autogenargs, self.autogenargs) + \ '--with-default-mozilla-five-home=%s' % mozilla_path
def do_configure(self, buildscript): checkoutdir = self.get_builddir(buildscript) os.chdir(checkoutdir) buildscript.message('configuring %s' % self.name)
44384f2e8dbd82686b46f7cf1ecbc9d9475f7afa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/44384f2e8dbd82686b46f7cf1ecbc9d9475f7afa/module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 14895, 12, 2890, 16, 1361, 4263, 4672, 13926, 1214, 273, 365, 18, 588, 67, 70, 89, 330, 449, 481, 12, 3510, 4263, 13, 1140, 18, 343, 1214, 12, 17300, 1214, 13, 1361, 4263, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 741, 67, 14895, 12, 2890, 16, 1361, 4263, 4672, 13926, 1214, 273, 365, 18, 588, 67, 70, 89, 330, 449, 481, 12, 3510, 4263, 13, 1140, 18, 343, 1214, 12, 17300, 1214, 13, 1361, 4263, 1...
import pdb; pdb.set_trace()
def local_gpu_elemwise_0(node): if isinstance(node.op, tensor.Elemwise): if numpy.any([hasattr(i.owner, 'op') and isinstance(i.owner.op, HostFromGpu) for i in node.inputs]): if numpy.any([o.type.dtype == 'float64' for o in node.outputs]): print 'WARNING: THERE ARE STILL float64s in your graph local_gpu_elemwise_0', node import pdb; pdb.set_trace() else: # move the add to a GpuAdd new_op = GpuElemwise(node.op.scalar_op, node.op.inplace_pattern) return [host_from_gpu(new_op(*(gpu_from_host(i) for i in node.inputs)))] return False
b8a03dada557ec2a8498c42856d86f348fbe7e7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/b8a03dada557ec2a8498c42856d86f348fbe7e7d/opt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1191, 67, 23162, 67, 10037, 2460, 67, 20, 12, 2159, 4672, 309, 1549, 12, 2159, 18, 556, 16, 8171, 18, 7498, 2460, 4672, 309, 3972, 18, 2273, 3816, 5332, 1747, 12, 77, 18, 8443, 16, 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, 1191, 67, 23162, 67, 10037, 2460, 67, 20, 12, 2159, 4672, 309, 1549, 12, 2159, 18, 556, 16, 8171, 18, 7498, 2460, 4672, 309, 3972, 18, 2273, 3816, 5332, 1747, 12, 77, 18, 8443, 16, 2...
def server_pidDied(self, pid, status):
def server_pidDied(self, server, pid, status):
def server_pidDied(self, pid, status): """ Called when the server collects a child process that has died. """ pass
fa2fb986f9aa927e065adf180cb4d1112e38071d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8749/fa2fb986f9aa927e065adf180cb4d1112e38071d/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1438, 67, 6610, 40, 2092, 12, 2890, 16, 1438, 16, 4231, 16, 1267, 4672, 3536, 11782, 1347, 326, 1438, 30976, 279, 1151, 1207, 716, 711, 302, 2092, 18, 3536, 1342, 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, 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, 1438, 67, 6610, 40, 2092, 12, 2890, 16, 1438, 16, 4231, 16, 1267, 4672, 3536, 11782, 1347, 326, 1438, 30976, 279, 1151, 1207, 716, 711, 302, 2092, 18, 3536, 1342, 2, -100, -100, -100, ...
return ratio[0] / ratio[1]
try: return ratio[0] / ratio[1] except ZeroDivisionError: return float("inf")
def __make_ratio(ratio): """ This function takes two values and returns the division of them. @param ratio: The numerator and denominator of the ratio @type ratio: C{tuple} @return: The ratio @rtype: C{float} """ return ratio[0] / ratio[1]
7974347db646bfdcf6b5a61e939ca71a8df13ddc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/7974347db646bfdcf6b5a61e939ca71a8df13ddc/find_ldb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 6540, 67, 9847, 12, 9847, 4672, 3536, 1220, 445, 5530, 2795, 924, 471, 1135, 326, 16536, 434, 2182, 18, 225, 632, 891, 7169, 30, 1021, 16730, 471, 15030, 434, 326, 7169, 632, 723, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6540, 67, 9847, 12, 9847, 4672, 3536, 1220, 445, 5530, 2795, 924, 471, 1135, 326, 16536, 434, 2182, 18, 225, 632, 891, 7169, 30, 1021, 16730, 471, 15030, 434, 326, 7169, 632, 723, ...
u=self.request['AUTHENTICATED_USER'] try: u="%s.%s" % (u, self.request['session__domain']) except: pass try: info=u+info
try: u=self.request['AUTHENTICATED_USER'] try: u="%s.%s" % (u, self.request['session__domain']) except: pass try: info=u+info except: pass
def publish(self, module_name, after_list, published='web_objects',
835d90b27a6a934b9f526a4b0ced014ec0fd8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/835d90b27a6a934b9f526a4b0ced014ec0fd8cc1/Publish.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 12, 2890, 16, 1605, 67, 529, 16, 1839, 67, 1098, 16, 9487, 2218, 4875, 67, 6911, 2187, 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, ...
[ 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 12, 2890, 16, 1605, 67, 529, 16, 1839, 67, 1098, 16, 9487, 2218, 4875, 67, 6911, 2187, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def create_pdf(pages, profile, opts, thumbnail=None):
def create_pdf(pages, profile, opts, thumbnail=None,toc=None):
def create_pdf(pages, profile, opts, thumbnail=None): width, height = PROFILES[profile] from reportlab.pdfgen import canvas pdf = canvas.Canvas(filename=opts.output, pagesize=(width,height+15)) pdf.setAuthor(opts.author) pdf.setTitle(opts.title) for page in pages: pdf.drawImage(page, x=0,y=0,width=width, height=height) pdf.showPage() # Write the document to disk pdf.save()
568b060552f92400b67f63712ed006478bcefe7a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/568b060552f92400b67f63712ed006478bcefe7a/convert_from.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 7699, 12, 7267, 16, 3042, 16, 1500, 16, 9134, 33, 7036, 16, 1391, 33, 7036, 4672, 1835, 16, 2072, 273, 4629, 12669, 63, 5040, 65, 225, 628, 2605, 7411, 18, 22353, 2137, 275, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 67, 7699, 12, 7267, 16, 3042, 16, 1500, 16, 9134, 33, 7036, 16, 1391, 33, 7036, 4672, 1835, 16, 2072, 273, 4629, 12669, 63, 5040, 65, 225, 628, 2605, 7411, 18, 22353, 2137, 275, ...
$('
lookup.attr('size', Math.max(10, lookup.attr('value').length)) lookup.autocomplete('../search/', { formatResult: function(data){ return $('<div />').html(data[0]).text(); },
def render(self, name, value, attrs=None): if attrs is None: attrs = {} rendered = super(ForeignKeySearchInput, self).render(name, value, attrs) if value: label = self.label_for_value(value) else: label = u'' return rendered + mark_safe(u''' <style type="text/css" media="screen"> #lookup_%(name)s { padding-right:16px; background: url( %(admin_media_prefix)simg/admin/selector-search.gif ) no-repeat right; } #del_%(name)s { display: none; } </style>
18cb4eda795ee2ec2d1f036e9a589d8ecbca50fc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/171/18cb4eda795ee2ec2d1f036e9a589d8ecbca50fc/admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 508, 16, 460, 16, 3422, 33, 7036, 4672, 309, 3422, 353, 599, 30, 3422, 273, 2618, 7935, 273, 2240, 12, 15420, 2979, 1210, 16, 365, 2934, 5902, 12, 529, 16, 460, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1743, 12, 2890, 16, 508, 16, 460, 16, 3422, 33, 7036, 4672, 309, 3422, 353, 599, 30, 3422, 273, 2618, 7935, 273, 2240, 12, 15420, 2979, 1210, 16, 365, 2934, 5902, 12, 529, 16, 460, 1...
print 'len = 0'
def run (self): global sd_id global sd_owner global sd_name global pfsd_port cli = Connect ('', 0) cli.setsock (self.client)
e85f847bb1195a073821bbb7a8be9da341db50ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12216/e85f847bb1195a073821bbb7a8be9da341db50ac/lan_tun.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 2552, 8349, 67, 350, 2552, 8349, 67, 8443, 2552, 8349, 67, 529, 2552, 293, 2556, 72, 67, 655, 4942, 273, 8289, 7707, 2187, 374, 13, 4942, 18, 4424, 975, 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, 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, 261, 2890, 4672, 2552, 8349, 67, 350, 2552, 8349, 67, 8443, 2552, 8349, 67, 529, 2552, 293, 2556, 72, 67, 655, 4942, 273, 8289, 7707, 2187, 374, 13, 4942, 18, 4424, 975, 261, 289...
self.start()
def __call__(self, iterable): try: self.maxval = len(iterable) except TypeError: # If the iterable has no length, then rely on the value provided # by the user, otherwise fail. if not (isinstance(self.maxval, (int, long)) and self.maxval > 0): raise RuntimeError('Could not determine maxval from iterable. ' 'You must explicitly provide a maxval.') self._iterable = iter(iterable) self.start() return self
bab4de0eb8c041c27799a711d2ac8110938e3728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5565/bab4de0eb8c041c27799a711d2ac8110938e3728/progressbar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 6087, 4672, 775, 30, 365, 18, 1896, 1125, 273, 562, 12, 15364, 13, 1335, 3580, 30, 468, 971, 326, 6087, 711, 1158, 769, 16, 1508, 21187, 603, 326, 460, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1991, 972, 12, 2890, 16, 6087, 4672, 775, 30, 365, 18, 1896, 1125, 273, 562, 12, 15364, 13, 1335, 3580, 30, 468, 971, 326, 6087, 711, 1158, 769, 16, 1508, 21187, 603, 326, 460, ...
:fas: Fedora Account System object. :app_title: Title of the web app.
:arg fas: Fedora Account System object. :arg app_title: Title of the web app.
def __init__(self, fas, app_title): '''Create a Packages Controller.
d0ea7754e4b0eb9d223e9b48c71f42ad0c5ab68c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/d0ea7754e4b0eb9d223e9b48c71f42ad0c5ab68c/collections.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 284, 345, 16, 595, 67, 2649, 4672, 9163, 1684, 279, 7930, 1023, 6629, 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, 1001, 2738, 972, 12, 2890, 16, 284, 345, 16, 595, 67, 2649, 4672, 9163, 1684, 279, 7930, 1023, 6629, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.pool.get('ir.model.data')._unlink(self.cr, self.uid, node.model, ids)
self.pool.get('ir.model.data')._unlink(self.cr, 1, node.model, ids)
def process_delete(self, node): assert getattr(node, 'model'), "Attribute %s of delete tag is empty !" % ('model',) if self.pool.get(node.model): if len(node.search): ids = self.pool.get(node.model).search(self.cr, self.uid, eval(node.search, self.eval_context)) else: ids = [self.get_id(node.id)] if len(ids): self.pool.get(node.model).unlink(self.cr, self.uid, ids) self.pool.get('ir.model.data')._unlink(self.cr, self.uid, node.model, ids) else: self.logger.log(logging.TEST, "Record not deleted.")
9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 3733, 12, 2890, 16, 756, 4672, 1815, 3869, 12, 2159, 16, 296, 2284, 19899, 315, 1499, 738, 87, 434, 1430, 1047, 353, 1008, 29054, 738, 7707, 2284, 2187, 13, 309, 365, 18, 601...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1207, 67, 3733, 12, 2890, 16, 756, 4672, 1815, 3869, 12, 2159, 16, 296, 2284, 19899, 315, 1499, 738, 87, 434, 1430, 1047, 353, 1008, 29054, 738, 7707, 2284, 2187, 13, 309, 365, 18, 601...
self._getitem_helper(Empty)
with test_support.check_warnings(): self._getslice_helper_deprecated(Empty)
def test_getitem_classic(self): class Empty: pass self._getitem_helper(Empty)
e36561352895170f28f77f0b4ec4292e35d1cc01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/e36561352895170f28f77f0b4ec4292e35d1cc01/test_index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 31571, 67, 1106, 335, 12, 2890, 4672, 667, 8953, 30, 1342, 365, 6315, 31571, 67, 4759, 12, 1921, 13, 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, 1842, 67, 31571, 67, 1106, 335, 12, 2890, 4672, 667, 8953, 30, 1342, 365, 6315, 31571, 67, 4759, 12, 1921, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
private1 = model.get_value(iter1, 2)
private1 = model.get_value(iter1, 2) * 10000 private1 += model.get_value(iter1, 1)
def PrivateRoomsSort(self, model, iter1, iter2, column): try: private1 = model.get_value(iter1, 2) except: private1 = 0 try: private2 = model.get_value(iter2, 2) except: private2 = 0 return cmp(private1, private2) #return cmp(val1+private1, val2+private2)
bd22d9a79d709d993463602575ff87e47daaa60e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/bd22d9a79d709d993463602575ff87e47daaa60e/chatrooms.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8726, 13646, 87, 4416, 12, 2890, 16, 938, 16, 1400, 21, 16, 1400, 22, 16, 1057, 4672, 775, 30, 3238, 21, 273, 938, 18, 588, 67, 1132, 12, 2165, 21, 16, 576, 13, 380, 12619, 3238, 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, 8726, 13646, 87, 4416, 12, 2890, 16, 938, 16, 1400, 21, 16, 1400, 22, 16, 1057, 4672, 775, 30, 3238, 21, 273, 938, 18, 588, 67, 1132, 12, 2165, 21, 16, 576, 13, 380, 12619, 3238, 2...
from tests.utils import testsFolder
global testsFolder
def setUp(self): self.cwd = os.getcwd() from tests.utils import testsFolder scriptDir=self.scriptDir if not os.path.isabs(scriptDir): scriptDir=os.path.join(testsFolder,scriptDir)
4ece2e440328414c83771baf032e11a7c9e680ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/4ece2e440328414c83771baf032e11a7c9e680ed/testutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 11089, 273, 1140, 18, 588, 11089, 1435, 2552, 7434, 3899, 2728, 1621, 33, 2890, 18, 4263, 1621, 309, 486, 1140, 18, 803, 18, 291, 5113, 12, 4263, 1621, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 11089, 273, 1140, 18, 588, 11089, 1435, 2552, 7434, 3899, 2728, 1621, 33, 2890, 18, 4263, 1621, 309, 486, 1140, 18, 803, 18, 291, 5113, 12, 4263, 1621, ...
for tick in range(self.yticks_no+1):
for tick in range(int(self.yticks_no+1)):
def reprint_ylabels(self): #clears ylabel area self.clearylabelarea() tick=1 if self.scale_type=='linear': for tick in range(self.yticks_no+1): tickvalue=self.ygrid[0]+tick*self.yticks_step self.printylabel(tick,tickvalue) else: tickvalue=self.ygrid[1] while tickvalue>self.ygrid[0]: self.printylabel(tick,tickvalue) tickvalue=tickvalue/self.yticks_step self.printylabel(tick,self.ygrid[0])
2e4e7c5daa9d6b052171f723237d43de6db2f864 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/2e4e7c5daa9d6b052171f723237d43de6db2f864/Plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 283, 1188, 67, 93, 5336, 12, 2890, 4672, 468, 2131, 5913, 16305, 5091, 365, 18, 2131, 814, 1925, 5036, 1435, 4024, 33, 21, 309, 365, 18, 5864, 67, 723, 18920, 12379, 4278, 364, 4024, 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, 283, 1188, 67, 93, 5336, 12, 2890, 4672, 468, 2131, 5913, 16305, 5091, 365, 18, 2131, 814, 1925, 5036, 1435, 4024, 33, 21, 309, 365, 18, 5864, 67, 723, 18920, 12379, 4278, 364, 4024, 3...
from util_win32 import *
from win32 import *
def groupname(gid=None): """Return the name of the group with the given gid. If gid is None, return the name of the current group.""" return None
074f17cd5a37b72e7ef47880a7f89a107d67cfd9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/074f17cd5a37b72e7ef47880a7f89a107d67cfd9/windows.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25329, 12, 15780, 33, 7036, 4672, 3536, 990, 326, 508, 434, 326, 1041, 598, 326, 864, 11399, 18, 225, 971, 11399, 353, 599, 16, 327, 326, 508, 434, 326, 783, 1041, 12123, 327, 599, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25329, 12, 15780, 33, 7036, 4672, 3536, 990, 326, 508, 434, 326, 1041, 598, 326, 864, 11399, 18, 225, 971, 11399, 353, 599, 16, 327, 326, 508, 434, 326, 783, 1041, 12123, 327, 599, 225...
uiDescription = """ <ui>
uiDescription = """ <ui>
def __init__(self): try: gettext.install('mirage', '/usr/share/locale', unicode=1) except: gettext.install('mirage', '/usr/local/share/locale', unicode=1) # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
f4fb8573b027b21956ca815c0edbf66e6ae6e39e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/f4fb8573b027b21956ca815c0edbf66e6ae6e39e/mirage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 225, 775, 30, 24972, 18, 5425, 2668, 81, 481, 410, 2187, 1173, 13640, 19, 14419, 19, 6339, 2187, 5252, 33, 21, 13, 1335, 30, 24972, 18, 5425, 2668, 81,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 225, 775, 30, 24972, 18, 5425, 2668, 81, 481, 410, 2187, 1173, 13640, 19, 14419, 19, 6339, 2187, 5252, 33, 21, 13, 1335, 30, 24972, 18, 5425, 2668, 81,...
message = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO,buttons=gtk.BUTTONS_OK, message_format="You do not have any LADSPA effects plugins installed")
message = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO,buttons=gtk.BUTTONS_OK, message_format=_("You do not have any LADSPA effects plugins installed"))
def OnEffectsButtonClicked(self, widget): """ Creates and shows the instrument effects dialog if LADSPA is installed. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. mouse -- reserved for GTK callbacks, don't use it explicitly. """ Globals.debug("props button pressed")
5603072287c6bacdc58a656a4cd46f28056efeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10033/5603072287c6bacdc58a656a4cd46f28056efeca/ControlsBox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 29013, 3616, 27633, 12, 2890, 16, 3604, 4672, 3536, 10210, 471, 17975, 326, 10353, 16605, 6176, 309, 511, 1880, 3118, 37, 353, 5876, 18, 225, 7012, 30, 3604, 1493, 8735, 364, 19688, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 29013, 3616, 27633, 12, 2890, 16, 3604, 4672, 3536, 10210, 471, 17975, 326, 10353, 16605, 6176, 309, 511, 1880, 3118, 37, 353, 5876, 18, 225, 7012, 30, 3604, 1493, 8735, 364, 19688, ...
writeQuickStub(f, attr, getterName)
writeQuickStub(f, customMethodCalls, attr, getterName)
def writeAttrStubs(f, attr): getterName = (attr.iface.name + '_' + header.attributeNativeName(attr, True)) writeQuickStub(f, attr, getterName) if attr.readonly: setterName = 'xpc_qsReadOnlySetter' else: setterName = (attr.iface.name + '_' + header.attributeNativeName(attr, False)) writeQuickStub(f, attr, setterName, isSetter=True) ps = ('{"%s", %s, %s}' % (attr.name, getterName, setterName)) return ps
8896184edbd95bdc709171e1892d30700ae56acd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/8896184edbd95bdc709171e1892d30700ae56acd/qsgen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 3843, 11974, 87, 12, 74, 16, 1604, 4672, 7060, 461, 273, 261, 1747, 18, 31479, 18, 529, 397, 4427, 397, 1446, 18, 4589, 9220, 461, 12, 1747, 16, 1053, 3719, 1045, 13663, 11974, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 3843, 11974, 87, 12, 74, 16, 1604, 4672, 7060, 461, 273, 261, 1747, 18, 31479, 18, 529, 397, 4427, 397, 1446, 18, 4589, 9220, 461, 12, 1747, 16, 1053, 3719, 1045, 13663, 11974, 1...
if len(obj) > maxLen:
if maxLen is not None and len(obj) > maxLen:
def fastRepr(obj, maxLen=200, strFactor=10, _visitedIds=None): """ caps the length of iterable types, so very large objects will print faster. also prevents infinite recursion """ try: if _visitedIds is None: _visitedIds = set() if id(obj) in _visitedIds: return '<ALREADY-VISITED %s>' % itype(obj) if type(obj) in (types.TupleType, types.ListType): s = '' s += {types.TupleType: '(', types.ListType: '[',}[type(obj)] if len(obj) > maxLen: o = obj[:maxLen] ellips = '...' else: o = obj ellips = '' _visitedIds.add(id(obj)) for item in o: s += fastRepr(item, maxLen, _visitedIds=_visitedIds) s += ', ' _visitedIds.remove(id(obj)) s += ellips s += {types.TupleType: ')', types.ListType: ']',}[type(obj)] return s elif type(obj) is types.DictType: s = '{' if len(obj) > maxLen: o = obj.keys()[:maxLen] ellips = '...' else: o = obj.keys() ellips = '' _visitedIds.add(id(obj)) for key in o: value = obj[key] s += '%s: %s, ' % (fastRepr(key, maxLen, _visitedIds=_visitedIds), fastRepr(value, maxLen, _visitedIds=_visitedIds)) _visitedIds.remove(id(obj)) s += ellips s += '}' return s elif type(obj) is types.StringType: maxLen *= strFactor if len(obj) > maxLen: return safeRepr(obj[:maxLen]) else: return safeRepr(obj) else: return safeRepr(obj) except: return '<** FAILED REPR OF %s **>' % obj.__class__.__name__
b56ba9c8567f94b958d3351d7fd7126133bdb03a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7242/b56ba9c8567f94b958d3351d7fd7126133bdb03a/PythonUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4797, 426, 683, 12, 2603, 16, 29618, 33, 6976, 16, 609, 6837, 33, 2163, 16, 389, 30129, 2673, 33, 7036, 4672, 3536, 15788, 326, 769, 434, 6087, 1953, 16, 1427, 8572, 7876, 2184, 903, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4797, 426, 683, 12, 2603, 16, 29618, 33, 6976, 16, 609, 6837, 33, 2163, 16, 389, 30129, 2673, 33, 7036, 4672, 3536, 15788, 326, 769, 434, 6087, 1953, 16, 1427, 8572, 7876, 2184, 903, 1...
'toric', 'laguna', 'hap', 'braid']:
'toric', 'laguna', 'braid']:
def gap_reset_workspace(max_workspace_size=None, verbose=False): r""" Call this to completely reset the GAP workspace, which is used by default when SAGE first starts GAP. The first time you start GAP from SAGE, it saves the startup state of GAP in the file \begin{verbatim} $HOME/.sage/gap-workspace \end{verbatim} This is useful, since then subsequent startup of GAP is at least 10 times as fast. Unfortunately, if you install any new code for GAP, it won't be noticed unless you explicitly load it, e.g., with gap.load_package("my_package") The packages sonata, guava, factint, gapdoc, grape, design, toric, and laguna are loaded in all cases before the workspace is saved, if they are available. """ if os.path.exists(WORKSPACE): os.unlink(WORKSPACE) g = Gap(use_workspace_cache=False, max_workspace_size=None) for pkg in ['ctbllib', 'sonata', 'guava', 'factint', \ 'gapdoc', 'grape', 'design', \ 'toric', 'laguna', 'hap', 'braid']: try: g.load_package(pkg, verbose=verbose) except RuntimeError, msg: if verbose: print '*** %s'%msg pass # end for g.eval('SaveWorkspace("%s");'%WORKSPACE)
e6e4051a3f5de1455b3f9fb014ea2fb37f7391ad /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/e6e4051a3f5de1455b3f9fb014ea2fb37f7391ad/gap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9300, 67, 6208, 67, 14915, 12, 1896, 67, 14915, 67, 1467, 33, 7036, 16, 3988, 33, 8381, 4672, 436, 8395, 3049, 333, 358, 14416, 2715, 326, 611, 2203, 6003, 16, 1492, 353, 1399, 635, 80...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9300, 67, 6208, 67, 14915, 12, 1896, 67, 14915, 67, 1467, 33, 7036, 16, 3988, 33, 8381, 4672, 436, 8395, 3049, 333, 358, 14416, 2715, 326, 611, 2203, 6003, 16, 1492, 353, 1399, 635, 80...
_inherit = 'res.partner'
# def _membership_cancel_search(self, cr, uid, obj, name, args):
7ed9ea3eff1885da52faa237ab195aed550d762a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/7ed9ea3eff1885da52faa237ab195aed550d762a/membership.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 565, 1652, 389, 19679, 67, 10996, 67, 3072, 12, 2890, 16, 4422, 16, 4555, 16, 1081, 16, 508, 16, 833, 4672, 2, 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, 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, 468, 565, 1652, 389, 19679, 67, 10996, 67, 3072, 12, 2890, 16, 4422, 16, 4555, 16, 1081, 16, 508, 16, 833, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
elif server_wait_dict['servers_connected']+1 >= MAX_SERVERS:
elif count_servers()+1 >= MAX_SERVERS:
def new_server(remoteip, remoteport, sock, thiscommhandle, listencommhandle): # DEBUG if DEBUG2: print getruntime(),"Server Conn.",remoteip,remoteport server_wait_dict = mycontext['server_wait_info'] server_wait_dict['lock'].acquire() # close sockets if the connection handle is not active if not server_wait_dict['active']: if DEBUG2: print getruntime(), "Too many servers connected, quietly droping new servers" sock.close() server_wait_dict['lock'].release() return # stop the server wait handle if the max number of servers is connected # TODO, stop the forwarder from advertising when the server wait handle is stopped elif server_wait_dict['servers_connected']+1 >= MAX_SERVERS: if DEBUG2: print getruntime(),"Server Limits Reached" #removed until stopcomm issue is resolved #stopcomm(server_wait_dict['handle']) server_wait_dict['active'] = False # stop advertising the forwarder nat_toggle_advertisement(False) else: server_wait_dict['servers_connected'] +=1 server_wait_dict['lock'].release() # Get the connection ID id = _get_conn_id() # Initialize the multiplexing socket with this socket mux = Multiplexer(sock, {"localip":FORWARDER_STATE["ip"], "localport":mycontext['SERVER_PORT'], "remoteip":remoteip, "remoteport":remoteport, "conn_id":id}) # Inject the ID into the socketInfo, for error handling # Assign our custom error delegate mux.setErrorDelegate(_mux_internal_error) # Helper wrapper function def rpc_wrapper(remoteip, remoteport, client_sock, thiscommhandle, listencommhandle): new_rpc(id, client_sock) # Set the RPC waitforconn mux.waitforconn(RPC_VIRTUAL_IP, RPC_VIRTUAL_PORT, rpc_wrapper) # Create an entry for the server _connection_entry(id,sock,mux,remoteip,remoteport,TYPE_MUX)
7a3c34460187cdf889fbabd2143f1bd73e2d1af2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/7a3c34460187cdf889fbabd2143f1bd73e2d1af2/forwarder_rpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 67, 3567, 12, 7222, 625, 16, 2632, 655, 16, 7313, 16, 333, 5702, 4110, 16, 6514, 5702, 4110, 4672, 468, 6369, 309, 6369, 22, 30, 1172, 336, 9448, 9334, 6, 2081, 6683, 1199, 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, 394, 67, 3567, 12, 7222, 625, 16, 2632, 655, 16, 7313, 16, 333, 5702, 4110, 16, 6514, 5702, 4110, 4672, 468, 6369, 309, 6369, 22, 30, 1172, 336, 9448, 9334, 6, 2081, 6683, 1199, 16, ...
raise apache.SERVER_RETURN, apache.HTTP_MOVED_PERMANENTLY
util.redirect(req, url)
def redirect_to_url(req, url): """ Redirect current page to url. @param req: request as received from apache @param url: url to redirect to""" req.err_headers_out.add("Location", url) if 'Set-Cookie' in req.headers_out: ## It's important not to loose the cookie of the user, in particular ## when it has just been set for the first time. req.err_headers_out.add('Set-Cookie', req.headers_out['Set-Cookie']) raise apache.SERVER_RETURN, apache.HTTP_MOVED_PERMANENTLY
a5da8b653657219114a15f1fa1e474d902eef8f4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/a5da8b653657219114a15f1fa1e474d902eef8f4/urlutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 67, 869, 67, 718, 12, 3658, 16, 880, 4672, 3536, 9942, 783, 1363, 358, 880, 18, 632, 891, 1111, 30, 590, 487, 5079, 628, 12291, 632, 891, 880, 30, 880, 358, 3136, 358, 8395, 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, 3136, 67, 869, 67, 718, 12, 3658, 16, 880, 4672, 3536, 9942, 783, 1363, 358, 880, 18, 632, 891, 1111, 30, 590, 487, 5079, 628, 12291, 632, 891, 880, 30, 880, 358, 3136, 358, 8395, 11...
Log("Source may have carbonfile support, but support defaults to " "off.\n Use --carbonfile to enable.", 5)
log.Log("Source may have carbonfile support, but support " "defaults to off.\n Use --carbonfile to enable.", 5)
def set_carbonfile(self): self.update_triple(self.src_fsa.carbonfile, self.dest_fsa.carbonfile, ('carbonfile_active', 'carbonfile_write', 'carbonfile_conn')) if self.src_fsa.carbonfile and not Globals.carbonfile_active: Log("Source may have carbonfile support, but support defaults to " "off.\n Use --carbonfile to enable.", 5)
5e1d50c457bca53a0ea2b3ac1de2c7abc816442b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/5e1d50c457bca53a0ea2b3ac1de2c7abc816442b/fs_abilities.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 71, 11801, 768, 12, 2890, 4672, 365, 18, 2725, 67, 313, 2444, 12, 2890, 18, 4816, 67, 2556, 69, 18, 71, 11801, 768, 16, 365, 18, 10488, 67, 2556, 69, 18, 71, 11801, 768, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 444, 67, 71, 11801, 768, 12, 2890, 4672, 365, 18, 2725, 67, 313, 2444, 12, 2890, 18, 4816, 67, 2556, 69, 18, 71, 11801, 768, 16, 365, 18, 10488, 67, 2556, 69, 18, 71, 11801, 768, 1...
response = self._conn.getresponse() return response.read()
return self._conn.getresponse().read()
def _request(self, name, params): """Call the name request with a dictionary parms. @return the XML response. """ params = urllib.urlencode(params) self._conn.request("POST", "/winservices-soap/generic/Authentication.asmx/%s" % name, params, self._headers) response = self._conn.getresponse() return response.read()
c6a77563c9cd6c680d40bef8dbd751781f42a3a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/c6a77563c9cd6c680d40bef8dbd751781f42a3a2/external_authentication_cern_wrapper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2293, 12, 2890, 16, 508, 16, 859, 4672, 3536, 1477, 326, 508, 590, 598, 279, 3880, 17902, 18, 632, 2463, 326, 3167, 766, 18, 3536, 859, 273, 11527, 18, 718, 3015, 12, 2010, 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, 389, 2293, 12, 2890, 16, 508, 16, 859, 4672, 3536, 1477, 326, 508, 590, 598, 279, 3880, 17902, 18, 632, 2463, 326, 3167, 766, 18, 3536, 859, 273, 11527, 18, 718, 3015, 12, 2010, 13, ...
if self._dirty:
if self._dirty or self._version == 0:
def _xmlValue(self, generator):
c0fc9a93f0848356d7a299d2a76a13bd68fbd983 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/c0fc9a93f0848356d7a299d2a76a13bd68fbd983/XMLLob.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2902, 620, 12, 2890, 16, 4456, 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, ...
[ 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, 389, 2902, 620, 12, 2890, 16, 4456, 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,...
return image.load(imageFilename)
img = image.load(imageFilename) return img
def getImage(self, imageFilename): '''Gets an image ''' return image.load(imageFilename)
455baf5c32d81b384f1b1df68c2a0cfb78dac821 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11641/455baf5c32d81b384f1b1df68c2a0cfb78dac821/GUIToolkit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10567, 12, 2890, 16, 1316, 5359, 4672, 9163, 3002, 392, 1316, 9163, 3774, 273, 1316, 18, 945, 12, 2730, 5359, 13, 327, 3774, 225, 2, 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, 10567, 12, 2890, 16, 1316, 5359, 4672, 9163, 3002, 392, 1316, 9163, 3774, 273, 1316, 18, 945, 12, 2730, 5359, 13, 327, 3774, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
def getText(text, encoding="utf8"): html = HtmlToText.execute( CMD_HTML_CONV, text )
def getText(html_content, encoding="utf8"): """ @param[in] html_content the content of the html page to convert @param[in] encoding the document encoding @returns the text representation of the Web page """ if not "<" in html_content or not ">" in html_content: return html_content html = HtmlToText.execute( CMD_HTML_CONV, html_content )
def getText(text, encoding="utf8"): html = HtmlToText.execute( CMD_HTML_CONV, text ) return html[1]
5e27b79c13e1b0f18d45a9785e67c1f52361b916 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6604/5e27b79c13e1b0f18d45a9785e67c1f52361b916/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6701, 12, 2620, 67, 1745, 16, 2688, 1546, 3158, 28, 6, 4672, 3536, 632, 891, 63, 267, 65, 1729, 67, 1745, 326, 913, 434, 326, 1729, 1363, 358, 1765, 632, 891, 63, 267, 65, 2688, 326,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6701, 12, 2620, 67, 1745, 16, 2688, 1546, 3158, 28, 6, 4672, 3536, 632, 891, 63, 267, 65, 1729, 67, 1745, 326, 913, 434, 326, 1729, 1363, 358, 1765, 632, 891, 63, 267, 65, 2688, 326,...
try: import Numeric
try: import Numeric except ImportError: pass else: has_numeric = 1
def _run(args = None): import sys if args is not None: sys.argv = args # See which of the numeric modules are installed has_numeric = 0 try: import Numeric m = Numeric has_numeric = 1 except ImportError: global numeric_tests numeric_tests = None has_numarray = 0 try: import numarray m = numarray has_numarray = 1 except ImportError: global _numarray_tests _numarray_tests = None # Bail if neither one is installed if not (has_numeric or has_numarray): return 0 # test the info routine outside the doctest. See numpy.cpp for an # explanation import numpy_ext if (has_numarray): numpy_ext.info(m.array((1,2,3))) failures = 0 # # Run tests 4 different ways if both modules are installed, just # to show that set_module_and_type() is working properly # # run all the tests with default module search print 'testing default extension module:', \ numpy_ext.get_module_name() or '[numeric support not installed]' failures += _count_failures() # test against Numeric if installed if has_numeric: print 'testing Numeric module explicitly' numpy_ext.set_module_and_type('Numeric', 'ArrayType') failures += _count_failures() global __test__ if has_numarray: print 'testing numarray module explicitly' numpy_ext.set_module_and_type('numarray', 'NDArray') # Add the _numarray_tests to the list of things to test in # this case. failures += _count_failures(('_numarray_tests', 'numeric_tests')) # see that we can go back to the default numpy_ext.set_module_and_type('', '') print 'testing default module again:', \ numpy_ext.get_module_name() or '[numeric support not installed]' failures += _count_failures() return failures
c3bda6a903020172db2a7b1f15fcc93edc0c37ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9978/c3bda6a903020172db2a7b1f15fcc93edc0c37ab/numpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2681, 12, 1968, 273, 599, 4672, 1930, 2589, 225, 309, 833, 353, 486, 599, 30, 2589, 18, 19485, 273, 833, 225, 468, 2164, 1492, 434, 326, 6389, 4381, 854, 5876, 711, 67, 5246, 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, 389, 2681, 12, 1968, 273, 599, 4672, 1930, 2589, 225, 309, 833, 353, 486, 599, 30, 2589, 18, 19485, 273, 833, 225, 468, 2164, 1492, 434, 326, 6389, 4381, 854, 5876, 711, 67, 5246, 273,...
os.system ("cp airdrop-ng.py build/ && cp -r lib build/ && cp docs/airdrop-ng.1 build/")
os.system ("cp airdrop-ng build/ && cp -r lib build/ && cp docs/airdrop-ng.1 build/")
def install(self): print "Build exist? " if os.path.isdir("build"): rmtree("build") # imported from shutil, or shutil.rmtree() print "File exists. Cleaning it..." os.mkdir ("build") else: os.mkdir ("build") print "Didn't exist. Creating..."
26abab8c7acd932f736bf6fbc420d33f7bfad8f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9343/26abab8c7acd932f736bf6fbc420d33f7bfad8f9/install.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 2890, 4672, 1172, 315, 3116, 1005, 35, 315, 309, 1140, 18, 803, 18, 291, 1214, 2932, 3510, 6, 4672, 17941, 2932, 3510, 7923, 225, 468, 9101, 628, 11060, 16, 578, 11060, 18, 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, 3799, 12, 2890, 4672, 1172, 315, 3116, 1005, 35, 315, 309, 1140, 18, 803, 18, 291, 1214, 2932, 3510, 6, 4672, 17941, 2932, 3510, 7923, 225, 468, 9101, 628, 11060, 16, 578, 11060, 18, 8...
ret
return [None, None]
def _synthesize(browser): """Attempt to synthesize a controller base on existing controllers. This is useful to create a controller when a user specifies a path to an entry in the BROWSER environment variable -- we can copy a general controller to operate using a specific installation of the desired browser in this way. If we can't create a controller in this way, or if there is no executable for the requested browser, return [None, None]. """ if not os.path.exists(browser): return [None, None] name = os.path.basename(browser) try: command = _browsers[name.lower()] except KeyError: return [None, None] # now attempt to clone to fit the new name: controller = command[1] if controller and name.lower() == controller.basename: import copy controller = copy.copy(controller) controller.name = browser controller.basename = os.path.basename(browser) register(browser, None, controller) return [None, controller] ret
87d020ae670b58acb81a351b0d2409493c54e55e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/87d020ae670b58acb81a351b0d2409493c54e55e/webbrowser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 11982, 7915, 554, 12, 11213, 4672, 3536, 7744, 358, 6194, 7915, 554, 279, 2596, 1026, 603, 2062, 12403, 18, 225, 1220, 353, 5301, 358, 752, 279, 2596, 1347, 279, 729, 11470, 279, 58...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11982, 7915, 554, 12, 11213, 4672, 3536, 7744, 358, 6194, 7915, 554, 279, 2596, 1026, 603, 2062, 12403, 18, 225, 1220, 353, 5301, 358, 752, 279, 2596, 1347, 279, 729, 11470, 279, 58...
debug_print('Timezone votes: %d GMT, %d LTZ, use_tz_var='%
debug_print('Timezone votes: %d GMT, %d LTZ, use_tz_var= %d'%
def update(self, booklists, collections_attributes): debug_print('Starting update', collections_attributes) for i, booklist in booklists.items(): playlist_map = self.build_id_playlist_map(i) debug_print('Updating XML Cache:', i) root = self.record_roots[i] lpath_map = self.build_lpath_map(root) gtz_count = ltz_count = 0 use_tz_var = False for book in booklist: path = os.path.join(self.prefixes[i], *(book.lpath.split('/'))) record = lpath_map.get(book.lpath, None) if record is None: record = self.create_text_record(root, i, book.lpath) (gtz_count, ltz_count, use_tz_var) = \ self.update_text_record(record, book, path, i, gtz_count, ltz_count, use_tz_var) # Ensure the collections in the XML database are recorded for # this book if book.device_collections is None: book.device_collections = [] book.device_collections = playlist_map.get(book.lpath, []) debug_print('Timezone votes: %d GMT, %d LTZ, use_tz_var='% (gtz_count, ltz_count, use_tz_var)) self.update_playlists(i, root, booklist, collections_attributes) # Update the device collections because update playlist could have added # some new ones. debug_print('In update/ Starting refresh of device_collections') for i, booklist in booklists.items(): playlist_map = self.build_id_playlist_map(i) for book in booklist: book.device_collections = playlist_map.get(book.lpath, []) self.fix_ids() debug_print('Finished update')
607db6a750a7f31ec492b2d8508171bcc549d83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/607db6a750a7f31ec492b2d8508171bcc549d83e/sony_cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 6978, 9772, 16, 6980, 67, 4350, 4672, 1198, 67, 1188, 2668, 11715, 1089, 2187, 6980, 67, 4350, 13, 364, 277, 16, 6978, 1098, 316, 6978, 9772, 18, 3319, 13332, 16428, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 16, 6978, 9772, 16, 6980, 67, 4350, 4672, 1198, 67, 1188, 2668, 11715, 1089, 2187, 6980, 67, 4350, 13, 364, 277, 16, 6978, 1098, 316, 6978, 9772, 18, 3319, 13332, 16428, ...
if len(dates[0])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours')
if len(dates[0])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes')
def checkCMOR(fout,file,table,noerror=cmor.CMOR_CRITICAL,variable=None,from_bounds=None,other_tables=None,dodrs=True): req_glbl_att = ['title','Conventions','source','experiment','source','institution','project_id','table_id','realization',] opt_glbl_att = ['cmor_version','history','references','comment','parent_experiment'] nerr=0 nwarn=0 ncheck=0 IPCC_std_vars=[] IPCC_std_axes=[] tables=[table,] if other_tables is not None: for t in other_tables: if not t in tables and t is not None: tables.append(t) etables = [] for tbl in tables: manageLog(fout,VERBOSE, 'Reading table:',tbl) e=readTable(tbl) etables.append(e) Vars=e['variable'] Axes=e['axis'] extra_req = e['general'].get('required_global_attributes','').split() for ex in extra_req: if not ex in req_glbl_att: req_glbl_att.append(ex) for v in Vars.keys(): IPCC_std_vars.append(Vars[v].get('out_name',v)) for a in Axes.keys(): onm = Axes[a].get('out_name',a) if not onm in IPCC_std_axes: IPCC_std_axes.append(onm) ## if IPCC_std_axes[-1]=='lev' : ## IPCC_std_axes.pop(-1) ## IPCC_std_axes.append('eta') ## Axes[a]['out_name']='eta' ver = e['general'].get('cmor_version',2.0) ver = '%g' % float(ver) spver = ver.split('.') major = int(spver[0]) if major>1: req_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','creation_date','frequency','modeling_realm'] else: opt_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','forcing','creation_date','frequency','modeling_realm'] if isinstance(file,str): fnm=file file=cdms2.open(file) elif isinstance(file,cdms2.dataset.CdmsFile): fnm=str(file).split('file')[1].split(',')[0].strip()[1:-1] else: nerr+=manageLog(fout, noerror, 'You must pass a file name or cdms2 file object') if fnm.split("_")[-1]=="clim.nc": is_clim = True else: is_clim = False pthroot, shrt_fnm = os.path.split(fnm) if variable is None: manageLog(fout,VERBOSE, 'Checking file argument',IPCC_std_axes) manageLog(fout,VERBOSE, 'Checking path structure for path:',pthroot) manageLog(fout,VERBOSE, 'Checking file structure for file:',fnm) print >> fout, 'Checking the file starts with variable name' ok = False for v in IPCC_std_vars: n = len(v) if shrt_fnm[:n] == v and shrt_fnm[n]=='_': ok = True break if not ok: nerr+=manageLog(fout, noerror, ''+shrt_fnm+' does not start with standard %s variable name followed by _' % file.project_id) vf=v #Check the variable is actually in the file if not v in file.variables.keys(): nerr+=manageLog(fout,noerror,"Your file name says it contains variable",v,"but it is not in your file, your file contains:",file.variables.keys()) if hasattr(file,'cmor_version'): up = False rew = False ver = getattr(file,'cmor_version') if isinstance(ver,numpy.ndarray): ver = '%g' % float(ver[0]) spver = ver.split('.') fmajor = int(spver[0]) if len(spver)>1 : minor = int(spver[1]) if len(spver)>2: patch = int(spver[2]) else: patch = 0 else: minor=0 patch=0 if fmajor>cmor.CMOR_VERSION_MAJOR: up = True elif fmajor<cmor.CMOR_VERSION_MAJOR: rew=True else: # Major matches if minor>cmor.CMOR_VERSION_MINOR: up = True elif minor<cmor.CMOR_VERSION_MINOR: rew = True else: # minor matches if patch>cmor.CMOR_VERSION_PATCH: up = True elif patch<cmor.CMOR_VERSION_PATCH: rew = True ncheck+=1 if up: if fmajor==cmor.CMOR_VERSION_MAJOR: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should upgrade your cmor" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) else: nerr+=manageLog(fout,noerror,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you need to upgrade cmor to check these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ncheck+=1 if rew: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should consider rewriting these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ## 32bit systems only if os.uname()[-1].find("64")==-1: sz=os.path.getsize(fnm) manageLog(fout,VERBOSE, 'Checking file size (32bit systems only):',sz) if sz>2**31: if major>1: ncheck+=1 nwarn+=1 ec =cmor.CMOR_WARNING else: ec=noerror manageLog(fout,ec, 'File size too large',sz,' (>2Gb)!') #nerr+=manageLog(fout, noerror, 'file size too large (>2Gb)!') manageLog(fout,VERBOSE, 'Checking that file contains required global attributes') for att in req_glbl_att: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) if not hasattr(file,att) and not att in shrt_vals: i = req_glbl_att.index(att) if i==0 or req_glbl_att[i-1] not in shrt_vals: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) else: pr = req_gbl_att[i-1] expt = getattr(file,"experiment","") shrt = shrt_vals[long_vals.index(expt)] if shrt == pr: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) fval=getattr(file,att,'') if att=='experiment_id': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att=='experiment': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in long_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment file attribute must be one of : %s, you have: %s' % (str(long_vals), fval) ) elif att=='parent_experiment_id': if fval == getattr(file,"experiment_id",""): nerr+=manageLog(fout,noerror,"parent_experiment_id and experiment_id cannot be the same you have %s for both" % fval) ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) shrt_vals.append("N/A") for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'parent_experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att == 'forcing': sp = fval.split(',') forcings=e['general'].get("forcings") for vl in sp: if not vl.strip() in forcings: nerr+=manageLog(fout,noerror,"file attribute forcing must be a comma separated list with values in: %s, yours is: %s (offending value: %s)" % (forcings,fval,vl.strip())) elif att == 'frequency': if not fval in ['yr','mon','day','6hr','3hr','subhr','fx','monClim']: nerr+=manageLog(fout,noerror, 'frequency must be one of:','yr','mon','day','6hr','3hr','subhr','fx','monClim') elif att in ['realization']: if isinstance(fval,numpy.ndarray): if len(fval)>1: nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') fval=fval[0] if not isinstance(fval,(int,numpy.int,numpy.int32)): nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') elif att in ['table_id']: manageLog(fout,VERBOSE, '\ttable_id is: ', fval) elif att == "creation_date": # checks that it matches: YYYY-MM-DDTHH:MM:SSZ fmt = "%Y-%m-%dT%H:%M:%SZ" try: t =time.strptime(fval,fmt) except: nerr+=manageLog(fout, noerror, 'Creation Date must be in format: %s yours is: %s' % (fmt,fval)) elif att == "branch_time": try: myval=float(fval) except: nerr+=manageLog(fout, noerror, 'branch_time must be convertible to float, you have %s' % (fval)) if getattr(file,"parent_experiment_id","").strip()=="N/A": if float(fval)!=0.: nerr+=manageLog(fout, noerror, 'if global attribute parent_experiment_id is N/A then branch_time must be 0., you have %s' % (fval)) elif att == "project_id": if e['general'].get("project_id") != fval: nerr+=manageLog(fout, noerror, 'project_id must be %s' % (e['general'].get("project_id"))) else: val=e['general'].get(att,None) if isinstance(fval,str) : fval=fval.strip().lower() if isinstance(val,str) : val=val.strip().lower() if val is not None: if isinstance(fval,str): res=fval.find(val) if res==-1: res=False else: res=True else: res=fval==val manageLog(fout,VERBOSE, '**************',att,val,fval) if not res: nerr+=manageLog(fout, noerror, 'attribute '+att+' must be set to: -'+val+'- +'+fval+'+ '+str(res)) for att in opt_glbl_att: ncheck+=1 if not hasattr(file,att): nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tIt is often helpful to define the global attribute: ',att) for att in file.attributes.keys(): ncheck+=1 if not att in req_glbl_att and not att in opt_glbl_att: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tYou have global attribute: %s which is neither required nor optional ' % att) if major>=2: # more file structure there tbl_id = getattr(file,'table_id').split()[1] tbl_date= getattr(file,'table_id').split('(')[1].split(')')[0].strip() ttbl_id = e['general'].get("table_id").split()[1] ttbl_date = e['general'].get("table_date").strip() if tbl_date!=ttbl_date: nwarn+=1 ncheck+=1 manageLog(fout,cmor.CMOR_WARNING,"File says table date was %s, but your table is dated from: %s" %( tbl_date,ttbl_date)) if tbl_id!=ttbl_id: nerr+=manageLog(fout, noerror, 'your file indicates a table id of %s while your table id is %s' % (tbl_id,ttbl_id)) sp = shrt_fnm.split(v)[1].split("_") t = file[v].getTime() if t is not None: n=6 t=t.clone() else: n=4 if is_clim: n+=1 expt = getattr(file,"experiment","") try: shrt = shrt_vals[long_vals.index(expt)] except: #Ok we must be in one of the XXXX or DDHH cases... for i in range(len(long_vals)): if long_vals[i][:-4]==expt[:-4]: shrt=shrt_vals[i][:-4]+expt[-4:] break if long_vals[i][:-10]==expt[:-10]: shrt=shrt_vals[i][:-10]+expt[-10:] break if shrt=="": n-=1 spoffset=-1 else: spoffset=0 print len(sp) if len(sp)<n: nerr+=manageLog(fout, noerror, 'your file name does not seem to match the profile: varid_tableid_modelid_exptid_rid[iid][pid][_startdate-enddate][_suffix][_clim].nc') if sp[1]!=tbl_id: nerr+=manageLog(fout, noerror, 'your file name indicates a table id of %s while your table id should be %s' % (sp[1],tbl_id)) if sp[2]!=getattr(file,'model_id'): fmodid = hyphenize(getattr(file,'model_id')) if sp[2]!=fmodid: nerr+=manageLog(fout, noerror, 'your file name indicates model_id is: %s but your file says it is: %s' % (sp[2],getattr(file,'model_id'))) if shrt!="": if shrt!=sp[3]: nerr+=manageLog(fout, noerror, 'your file name indicates exp_id is: %s but your file says it should be: %s' % (sp[3],shrt)) real = sp[4+spoffset] rsp=real.split("p") if hasattr(file,"physics_version"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate physics_version but your file says it should be: %s' % (file.physics_version)) elif int(rsp[0].split('i')[0][1:])!=int(file.physics_version): nerr+=manageLog(fout, noerror, 'your file name indicates physics_version is: %s but your file says it should be: %s' % (rsp[1],file.physics_version)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates physics_version to be %s but your file says it has not physics: %s' % (rsp[1])) real=rsp[0] rsp=real.split("i") if hasattr(file,"initialization_method"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate initialization_method but your file says it should be: %s' % (file.initialization_method)) elif int(rsp[1])!=int(file.initialization_method): nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method is: %s but your file says it should be: %s' % (rsp[1],file.initialization_method)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method to be %s but your file says it has not initialization_method: %s' % (rsp[1])) real=rsp[0] if int(real[1:])!=int(getattr(file,'realization')): nerr+=manageLog(fout, noerror, 'your file name indicates realization is: %s but your file says it is: %i' % (sp[3][3:],int(getattr(file,'realization')))) ## skip the following if it has no time if t is not None: # here we check the clim b4 going further checking into date clim_att = getattr(t,'climatology',None) if clim_att is None: has_clim = False else: has_clim = True if is_clim!=has_clim: if is_clim: nerr+=manageLog(fout, noerror, 'your file name indicates climatology, but the time axis does not have the climatology attribute') else: nerr+=manageLog(fout, noerror, 'your file name does not indicates climatology (_clim.nc), but the time axis has the climatology attribute') if is_clim: tmp = file(t.climatology,slice(0,1)) ft0 = tmp[0][0] tmp = file(t.climatology,slice(-1,None)) ft1 = tmp[-1][1] else: ft0=t[0] ft1=t[-1] ft0= cdtime.reltime(ft0,t.units).tocomp(t.getCalendar()) ft1= cdtime.reltime(ft1,t.units).tocomp(t.getCalendar()) dates = sp[5+spoffset].split("-") # now determines the frequency units = t.units.split("since")[0].strip() interval = float(e['general'].get("approx_interval")) interval = genutil.udunits(interval,units).to("s").value # determine what the frequency drname should be if (interval<2500.) : frequency = "subhr" elif (interval<15000.): frequency = "3hr" elif (interval<30000.): frequency = "6hr" elif (interval<100000.): frequency = "day" elif (interval<3.E6): frequency = "mon" else: frequency = "yr" if (interval == 0.): strcpy(tmp,"fx") #Now checks the frequecny attribute matches the one we just decided if file.frequency[-4:]=='Clim': frequency=frequency+"Clim" if file.frequency!=frequency: nerr+=manageLog(fout, noerror, 'your file indicates a frequency of "%s" but the approximate_interval suggests it should be: "%s"' % (file.frequency,frequency)) try: yr0=int(dates[0][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section start date iun your file',dates[0][:4]) frequency = 'yr' if interval<29.E6: frequency='mon' if len(dates[0])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m0 = int(dates[0][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section start date iun your file',dates[0][4:6]) else: m0=ft0.month if interval < 2E6: frequency='mon' if len(dates[0])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d0 = int(dates[0][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the day section start date iun your file',dates[0][6:8]) else: d0=ft0.day if interval < 86000: if len(dates[0])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h0 = int(dates[0][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section start date iun your file',dates[0][8:10]) else: h0= ft0.hour if interval < 3000: if len(dates[0])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn0 = int(dates[0][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the miuntes section start date iun your file',dates[0][10:12]) else: mn0=ft0.minute if interval < 50: if len(dates[0])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s0 = int(dates[0][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section start date iun your file',dates[0][12:14]) else: s0=ft0.second t0 = cdtime.comptime(yr0,m0,d0,h0,mn0,s0) try: yr1=int(dates[1][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section end date iun your file',dates[1][:4]) if interval<29.E6: if len(dates[1])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m1 = int(dates[1][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section end date iun your file',dates[1][4:6]) else: m1=ft1.month if interval < 2.E6: if len(dates[1])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d1 = int(dates[1][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the days section end date iun your file',dates[1][6:8]) else: d1=ft1.day if interval < 90000: if len(dates[1])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h1 = int(dates[1][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section end date iun your file',dates[1][8:10]) else: h1=ft1.hour if interval < 4000: if len(dates[1])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn1 = int(dates[1][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the minutes section end date iun your file',dates[1][10:12]) else: mn1=ft1.minute if interval < 100: if len(dates[1])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s1 = int(dates[1][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section end date iun your file',dates[1][12:14]) else: s1=ft1.second t1 = cdtime.comptime(yr1,m1,d1,h1,mn1,s1) if (ft0.year!=t0.year) or (ft0.month!=t0.month) or (ft0.day!=t0.day): nerr+=manageLog(fout, noerror, 'your file name indicates a start time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t0.year,t0.month,t0.day,ft0.year,ft0.month,ft0.day)) if (ft1.year!=t1.year) or (ft1.month!=t1.month) or (ft1.day!=t1.day): nerr+=manageLog(fout, noerror, 'your file name indicates an end time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t1.year,t1.month,t1.day,ft1.year,ft1.month,ft1.day)) manageLog(fout,VERBOSE, 'Checking that file contains only 1 variable') vars=file.listvariable() ## removes dims and other complementary vars # First bounds ## manageLog(fout,VERBOSE, vars) vars2=file.listvariable() vars3=[] vars4=[] for v in vars2: ## manageLog(fout,VERBOSE, v) V=file[v] b=getattr(V,'bounds',None) if b is not None: vars.pop(vars.index(b)) b=getattr(V,'ancillary_variables',None) if b is not None: for sp in b.split(): if sp.trip() in vars: vars.pop(sp.strip()) for ax in V.getAxisList(): b=getattr(ax,'bounds',None) if b is not None: if b in vars: vars.pop(vars.index(b)) Ab=file[b] # recovers associated bounds with axis f=getattr(Ab,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(True) f=getattr(ax,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(False) coords=getattr(V,'coordinates',None) if coords is not None: coords = coords.split() for c in coords: if c in vars: vars.pop(vars.index(c)) if hasattr(V,"grid_mapping"): if V.grid_mapping in vars: vars.pop(vars.index(V.grid_mapping)) manageLog(fout,VERBOSE, "Grid_mapping attribute found, we cannot check these files yet") ncheck+=1 nwarn+=1 return nwarn,ncheck,nerr t = V.getTime() if t is not None and hasattr(t,"climatology"): c = t.climatology if c in vars: vars.pop(vars.index(c)) if len(vars)!=1: nerr+=manageLog(fout, noerror, 'file must contain only 1 variable, you have: '+str(len(vars))+':'+str(vars)) var=vars[0] if major>=2 and dodrs: #Now checks for the DRS file structure prj_id = file.project_id.strip().replace(" ","_") prod = file.product inst = file.institute_id if inst == 'not specified' : inst = "INSTITUTE_ID" mod = file.model_id exp = file.experiment_id #by pass no sht for now... noff=0 fq = file.frequency realm = file.modeling_realm r = str(int(file.realization)) if hasattr(file,"initialization_method"): r+="i"+str(int(file.initialization_method)) if hasattr(file,"physics_version"): r+="p"+str(int(file.physics_version)) path = os.path.dirname(fnm).split("/") nerr += drs_check_pos(1,path,fout,noerror,'r%s' % r, 'realization') nerr += drs_check_pos(2,path,fout,noerror,var, 'variable') nerr += drs_check_pos(3,path,fout,noerror,realm, 'modeling realm') nerr += drs_check_pos(4,path,fout,noerror,fq, 'frequency') if exp == file.experiment: noff=1 else: nerr += drs_check_pos(5,path,fout,noerror,exp, 'experiment id') nerr += drs_check_pos(6-noff,path,fout,noerror,hyphenize(mod), 'model id') nerr += drs_check_pos(7-noff,path,fout,noerror,inst, 'insitution id') nerr += drs_check_pos(8-noff,path,fout,noerror,prod, 'product') nerr += drs_check_pos(9-noff,path,fout,noerror,prj_id, 'project id') fb=False if variable is not None: var=variable fb=from_bounds manageLog(fout,VERBOSE, 'Ok user asked to check the following variable:',variable,'with from bounds =',fb) manageLog(fout,VERBOSE, 'Checking variable name is %s compliant' % file.project_id) if not var in IPCC_std_vars: if var in Vars.keys(): nerr+=manageLog(fout, noerror, var+' is not valid, did you mean :'+Vars[var]['out_name']+' ?') else: nerr+=manageLog(fout, noerror, 'Variable name :'+var+' is not %s compliant' % file.project_id) if variable is None: manageLog(fout,VERBOSE, 'Checking that variable name in file matches file indications') if not var == vf: nerr+=manageLog(fout, noerror, 'File indicates it stores variable:'+vf+' but actually '+var+' is stored in it') V=file[var] axes=V.getAxisList() hasLat=0 hasLon=0 hasTime=0 hasLevel=0 ax_dict_name=[] for ax in axes: manageLog(fout,VERBOSE, 'Checking axis name is valid for:',ax.id,'on var:',V.id) if not ax.id in IPCC_std_axes: if ax.id in Axes.keys(): if major <2: ncheck+=1 nwarn+=1 nerr+=manageLog(fout,cmor.CMOR_WARNING, '\t\t'+ax.id+' is not preferred. We suggest you rename it:'+Axes[ax.id]['out_name']) else: manageLog(fout,noerror, '\t\tAxis name '+ax.id+' is not valid. We require you rename it:'+Axes[ax.id]['out_name']) elif (fb == False) or (fb == True and V.rank()!=2): nerr+=manageLog(fout, noerror, 'axis id: '+ax.id+' is not a valid IPCC name') if ax.isLatitude(): hasLat=1 if ax.isLongitude(): hasLon=1 if ax.isTime(): hasTime=1 if ax.isLevel(): hasLevel=1 old_ordering=0 o=V.getOrder(ids=1) if old_ordering: manageLog(fout,VERBOSE, 'Checking dimensions order') if hasTime: manageLog(fout,VERBOSE, '\tChecking time position') if o[0]=='t': o=o[1:] else: nerr+=manageLog(fout, noerror, 'time must be first dimension your ordering is:'+o) manageLog(fout,VERBOSE, '\tChecking none tzxy dims position') sp=o.split('(') if len(sp)>1: if o[0]!='(': nerr+=manageLog(fout, noerror, 'none zyx dimensions must come right after time dimension, you have:'+o) o=o.split(')')[-1] manageLog(fout,VERBOSE, '\tChecking level position') if hasLevel: if o[0]=='z': o=o[1:] else: nerr+=manageLog(fout, noerror, 'level must be ordered after time your order is:'+o) manageLog(fout,VERBOSE, '\tChecking latitude position') if hasLat: if o[0]=='y': o=o[1:] else: nerr+=manageLog(fout, noerror, 'latitude must be ordered after time and level your order is:'+o) manageLog(fout,VERBOSE, '\tChecking longitude position') if hasLon: if o[0]=='x': o=o[1:] else: nerr+=manageLog(fout, noerror, 'longitude must be ordered after time, level and latitude your order is:'+o) g=None if hasLat and hasLon: manageLog(fout,VERBOSE, 'Checking grid') g=V.getGrid() if not isinstance(g,cdms2.grid.AbstractRectGrid): nerr+=manageLog(fout, noerror, 'lat/lon variable ('+var+') must have Rectilinear grids') axes_nmes=Vars[var].get('dimensions',None) if axes_nmes is not None: manageLog(fout,VERBOSE, 'Checking rest of things on axes') axes_nmes=axes_nmes[::-1] axes_nmes_for_ordering=Vars[var]['dimensions'][::-1] coord=getattr(V,'coordinates',None) for nm in axes_nmes: req_Att=['standard_name','units'] anm = nm if nm in [ 'alevel','olevel','zlevel']: gnm=nm manageLog(fout,VERBOSE, '\tChecking special case %s, i.e' % (nm),'') tmpax=V.getLevel() print>>fout, tmpax.id,tmpax.standard_name for x in Axes.keys(): tmp=Axes[x].get('standard_name',None) if tmp is not None: tmp=tmp.strip() if tmp is not None and tmp==tmpax.standard_name: nm=x Nm=Axes[x]['out_name'] anm=x req_Att.append('formula') req_Att.append('formula_terms') if getattr(tmpax,"formula","")==Axes[x]['formula']: break axes_nmes_for_ordering[axes_nmes_for_ordering.index(gnm)]=nm elif not nm in V.getAxisIds(): try: Nm=Axes[nm]['out_name'] except: nerr+=manageLog(fout, noerror, 'with axis: '+nm+' not found for variable: '+var, noerror) else: Nm=nm if major>1: if Axes[anm].get("must_have_bounds","no")=="yes": req_Att.append("bounds") if Axes[anm].get("axis",None) is not None: req_Att.append("axis") else: req_Att.append("bounds") if nm == 'time' and is_clim: req_Att.pop(req_Att.index("bounds")) manageLog(fout,VERBOSE, '\tChecking',Nm) axindx=V.getAxisIndex(Nm) val=Axes[nm].get('value',None) if val is not None: #singleton dimension ? manageLog(fout,VERBOSE, '\t\tSingleton dimension') if val is None: nerr+=manageLog(fout, noerror, 'cannot retrieve needed axis:'+Nm) else: val=float(val) if axindx!=-1: nerr+=manageLog(fout, noerror, 'singleton dimension '+Nm+' must be defined via coordinates attributes on variable '+var+' not as an axis') else: manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute exists on '+var) aval=getattr(V,'coordinates',None) if aval is None: nerr+=manageLog(fout, noerror, 'singleton dimension must be defined via coordinates attribute') manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute matches for '+var) if not Nm in aval.split(): nerr+=manageLog(fout, noerror, 'coordinates atrtribute on '+var+' should be '+Nm+' it is '+aval) ax=file[Nm] mn,mx=Axes[nm].get('valid_min',None), Axes[nm].get('valid_max',None) manageLog(fout,VERBOSE, '\t\tChecks for value') if ax != val: manageLog(fout,VERBOSE, '\t\t\tNot matching, checking if valid range is defined in table') if mn is None and mx is None: nerr+=manageLog(fout, noerror, 'singleton dimension value for '+Nm+' must be '+str(val)) manageLog(fout,VERBOSE, '\t\t\tChecking if value is within range defined in table') if mn is not None: if mx is not None: if not( float(mn)<ax<float(mx)): nerr+=manageLog(fout, noerror, 'invalid value for singleton dimension '+Nm+': '+str(ax)+' must be between '+mn+' and '+mx) elif ax<float(mn): nerr+=manageLog(fout, noerror, 'invalid min for singleton dimension '+Nm+': '+str(ax)+' must be greater than '+mn) elif ax>float(mx): nerr+=manageLog(fout, noerror, 'invalid max for singleton dimension '+Nm+': '+str(ax)+' must be less than '+mx) manageLog(fout,VERBOSE, '\t\tChecking for bounds information') b=getattr(ax,'bounds',None) bv=Axes[nm].get('bounds_values',None) if bv is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in table, checking vs file') bv=bv.split() bv=float(bv[0]),float(bv[1]) if b is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in file, checking if matches') abv=file[b] ncheck+=1 if abv[0]!=bv[0] or abv[1]!=bv[1]: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tbounds_value for singleton dimension '+Nm+': '+str(abv)+' do not match requested bounds:'+str(bv)) else: nerr+=manageLog(fout, noerror, 'singleton dimension: '+Nm+' bounds required') else: ncheck+=1 if b is not None: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tSingleton dimension: '+Nm+' bounds should not be included') axes_nmes_for_ordering.pop(0) continue # singleton dimension checked no need to continue further if axindx==-1: nerr+=manageLog(fout, noerror, 'Variable '+var+' should have an axis called '+Axes[Nm]) ax=V.getAxis(axindx) manageLog(fout,VERBOSE, '\t\tChecking that dimension order is positioned:',axes_nmes_for_ordering.index(nm)+1,axes_nmes) if axindx!=axes_nmes_for_ordering.index(nm): nerr+=manageLog(fout, noerror, 'in ordering for dimension '+nm+' position is: '+str(axindx)+' but it should be: '+str(axes_nmes_for_ordering.index(nm))) if ('cell_bounds' in Axes[nm].get('ignored',[])) or ('cell_bounds' in Axes[nm].get('forbidden',[])) or ('cell_bounds' in Axes[nm].get('optional',[])): req_Att.pop(req_Att.index('bounds')) if 'units' in Axes[nm].get('ignored',[]) or 'units' in Axes[nm].get('optional',[]): try: req_Att.pop(req_Att.index('units')) except: pass ## Ok here we're trying to do the region thing, i.e coordinate attribute exist docoord=False if coord is not None: for c in coord.split(): nax=file[c] if ax.id in nax.getAxisIds(): oldax=ax ax=nax docoord=True manageLog(fout,VERBOSE, '\t\tChecking if required attributes are set:','') for r in req_Att: manageLog(fout,VERBOSE, r,'') val=getattr(ax,r,None) if val is None: print >>fout nerr+=manageLog(fout, noerror, 'attribute '+r+' is required for axis '+ax.id) if r!='units': good_val=Axes[nm].get(r,None) if good_val is not None: if val!=good_val: nerr+=manageLog(fout, noerror, 'axis attribute '+r+' should be: '+str(good_val)+' but is:'+str(val)) if r=='formula_terms': print 'Formula:',Axes[anm]['formula'],val print >>fout if not 'units' in Axes[nm].get('ignored',[]): if not 'units' in Axes[nm].get('optional',[]) or ('units' in Axes[nm].get('optional',[]) and hasattr(ax,'units')): if not ax.isTime(): manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major<2: u1=genutil.udunits(1,ax.units) try: u2=u1.to(Axes[nm]['units']) if u2.value!=1: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) except: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) else: if ax.units != Axes[nm]['units']: nerr+=manageLog(fout, noerror, 'units: '+ax.units+' are not the required units:'+Axes[nm]['units']) else: manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major>1: if ax.units.lower().find("days since")==-1: nerr+=manageLog(fout,noerror,'Time units must be in "days since", you have:',ax.units) bnds = ax.getBounds() if bnds is not None: for i in range(len(ax)): if ax[i]!=(bnds[i][0]+bnds[i][1])/2.: nerr+=manageLog(fout,noerror,"Time values are not average of time bounds") try: u=cdtime.reltime(1,ax.units) except: nerr+=manageLog(fout, noerror, 'invalid time units:'+ax.units+', should be in the form: "'+Axes[nm]['units']+'"') try: c=ax.calendar except: c='none' if not c in ["gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard"]: nerr+=manageLog(fout,noerror,"calendar must be one of [","gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard ] yours is",c) if c=='365_day': c=cdtime.NoLeapCalendar else: c=ax.getCalendar() manageLog(fout,VERBOSE, '\t\tView First and Last times:\t',ax.asComponentTime(c)[0],'\t',ax.asComponentTime(c)[-1]) tmpbnds=ax.getBounds() if tmpbnds is not None: manageLog(fout,VERBOSE, '\t\tView Bounds for first time:\t',cdtime.reltime(tmpbnds[0,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[0,1],ax.units).tocomp(c)) manageLog(fout,VERBOSE, '\t\tView Bounds for last time:\t',cdtime.reltime(tmpbnds[-1,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[-1,1],ax.units).tocomp(c)) else: manageLog(fout,VERBOSE,'\t\tNo Bounds for time') tp=Axes[nm].get('type','double') manageLog(fout,VERBOSE, '\t\tChecking axis is type',tp) if tp == 'double' : tp='d' elif tp == 'real' : tp='f' elif tp == 'character' : tp='c' elif tp == 'integer' : tp='l' else: nerr+=manageLog(fout, noerror, 'encountered unknown type:'+tp) if ax.typecode()!=tp: nerr+=manageLog(fout, noerror, 'required typecode for '+Nm+' should be '+tp+' not '+ax.typecode()) if ax.isLongitude(): manageLog(fout,VERBOSE, '\t\tChecking for axis attribute') a=getattr(ax,'axis',None) if a is None: nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute') if a!='X': nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute set to X not: '+a) manageLog(fout,VERBOSE, '\t\tChecking name') if not ax.id in ['lon','longitude']: nerr+=manageLog(fout, noerror, 'longitude axis name must be longitude or lon (prefered) not: '+ax.id)
147b07ceb0a19eed8a8cc3b164ebeadbb3bc2349 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9170/147b07ceb0a19eed8a8cc3b164ebeadbb3bc2349/check_CMOR_compliant.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 9611, 916, 12, 617, 322, 16, 768, 16, 2121, 16, 2135, 1636, 33, 7670, 280, 18, 9611, 916, 67, 5093, 21377, 16, 6105, 33, 7036, 16, 2080, 67, 10576, 33, 7036, 16, 3011, 67, 9373,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9611, 916, 12, 617, 322, 16, 768, 16, 2121, 16, 2135, 1636, 33, 7670, 280, 18, 9611, 916, 67, 5093, 21377, 16, 6105, 33, 7036, 16, 2080, 67, 10576, 33, 7036, 16, 3011, 67, 9373,...
def main(options=None): if not options: options = InetdOptions() options.parseOptions()
class SimpleConfFile: """Simple configuration file parser superclass. Filters out comments and empty lines (which includes lines that only contain comments). """
def main(options=None): if not options: options = InetdOptions() options.parseOptions() conf = inetdconf.InetdConf() conf.parseFile(open(options['file'])) app = Application('tinetd') for service in conf.services: if service.protocol != 'tcp' or service.socketType != 'stream': log.msg('Skipping unsupported type/protocol: %s/%s' % (service.socketType, service.protocol)) continue print 'Adding service:', service.name, service.port, service.protocol factory = InetdFactory(service) app.listenTCP(service.port, factory) app.run(save=0)
59b7c96d7977c3d04970c0f9d92a7da0b935ed55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/59b7c96d7977c3d04970c0f9d92a7da0b935ed55/inetdconf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 667, 4477, 3976, 812, 30, 3536, 5784, 1664, 585, 2082, 12098, 18, 225, 14475, 596, 5678, 471, 1008, 2362, 261, 12784, 6104, 2362, 716, 1338, 912, 5678, 2934, 3536, 225, 2195, 273, 17661, 72, 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, 667, 4477, 3976, 812, 30, 3536, 5784, 1664, 585, 2082, 12098, 18, 225, 14475, 596, 5678, 471, 1008, 2362, 261, 12784, 6104, 2362, 716, 1338, 912, 5678, 2934, 3536, 225, 2195, 273, 17661, 72, 3...
BADADDR - the specified address doesn't belong to any segment
BADADDR - the specified address doesn't belong to any segment
def SegStart(ea): """ Get start address of a segment @param ea: any address in the segment @return: start of segment BADADDR - the specified address doesn't belong to any segment """ seg = idaapi.getseg(ea) if not seg: return BADADDR else: return seg.startEA
b4e25f451affe08a6e318876abc65c2d4bf738a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4773/b4e25f451affe08a6e318876abc65c2d4bf738a0/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 348, 1332, 1685, 12, 24852, 4672, 3536, 968, 787, 1758, 434, 279, 3267, 225, 632, 891, 24164, 30, 1281, 1758, 316, 326, 3267, 225, 632, 2463, 30, 787, 434, 3267, 16467, 14142, 300, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 348, 1332, 1685, 12, 24852, 4672, 3536, 968, 787, 1758, 434, 279, 3267, 225, 632, 891, 24164, 30, 1281, 1758, 316, 326, 3267, 225, 632, 2463, 30, 787, 434, 3267, 16467, 14142, 300, 326, ...
__setattr__ = lambda self, name, value: _swig_setattr(self, CallEvent, name, value)
__setattr__ = lambda self, name, value: _swig_setattr(self, InviteEvent, name, value)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
5a446dc5431ef2708d3b137a144d856c9994dd9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5606/5a446dc5431ef2708d3b137a144d856c9994dd9d/tinyWRAP.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 1002, 6394, 2932, 2279, 3885, 2553, 7923, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 380, 1968, 16, 2826, 4333, 4672, 1002, 6394, 2932, 2279, 3885, 2553, 7923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
sage: o.quit(True)
sage: o.quit(True)
def quit(self, verbose=False): """ EXAMPLES: sage: o = Octave() sage: o._start() #optional -- requires Octave sage: o.quit(True) Exiting spawned Octave process.
7bf3fa1ea422232a4c63a09087e2223b29b5478a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/7bf3fa1ea422232a4c63a09087e2223b29b5478a/octave.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9706, 12, 2890, 16, 3988, 33, 8381, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 320, 273, 29482, 836, 1435, 272, 410, 30, 320, 6315, 1937, 1435, 565, 468, 10444, 1493, 4991, 29482, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9706, 12, 2890, 16, 3988, 33, 8381, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 320, 273, 29482, 836, 1435, 272, 410, 30, 320, 6315, 1937, 1435, 565, 468, 10444, 1493, 4991, 29482, ...
req.add_data(urllib.urlencode(data))
def clean_title(t): t = urllib.unquote(t) (t, ext) = os.path.splitext(t) m = re.match("(.*)(?:[(|\[]|, The$)",t, re.I) ret = t if m: ret = m.group(1) return urllib.quote(ret.strip())
2ffdaee9138ec9cb46201405bbe8379f1e308d49 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13713/2ffdaee9138ec9cb46201405bbe8379f1e308d49/ofdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 67, 2649, 12, 88, 4672, 268, 273, 11527, 18, 318, 6889, 12, 88, 13, 261, 88, 16, 1110, 13, 273, 1140, 18, 803, 18, 4939, 408, 12, 88, 13, 312, 273, 283, 18, 1916, 2932, 14361...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2721, 67, 2649, 12, 88, 4672, 268, 273, 11527, 18, 318, 6889, 12, 88, 13, 261, 88, 16, 1110, 13, 273, 1140, 18, 803, 18, 4939, 408, 12, 88, 13, 312, 273, 283, 18, 1916, 2932, 14361...
print resp
def validate(form, apikey): blog_url = get_application().cfg['blog_url'] cachekey = (apikey, blog_url) if cachekey in _verified_keys: return
8bfccfa618f95c1a94e37b33cdf9b243b47de766 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12815/8bfccfa618f95c1a94e37b33cdf9b243b47de766/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 12, 687, 16, 24731, 4672, 10700, 67, 718, 273, 336, 67, 3685, 7675, 7066, 3292, 11439, 67, 718, 3546, 1247, 856, 273, 261, 29879, 16, 10700, 67, 718, 13, 309, 1247, 856, 316, 389...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1954, 12, 687, 16, 24731, 4672, 10700, 67, 718, 273, 336, 67, 3685, 7675, 7066, 3292, 11439, 67, 718, 3546, 1247, 856, 273, 261, 29879, 16, 10700, 67, 718, 13, 309, 1247, 856, 316, 389...
self.failUnlessRaises(ValueError, make_array, 4, 3, -1)
self.failUnlessRaises(ValueError, make_array, 4, 2, -1)
def make_array(size, offset, strides): try: r = ndarray([size], buffer=x, offset=offset*x.itemsize) except: pass r.strides = strides=strides*x.itemsize return r
e11ca4d8afc3e412f530ccd55657b401294387ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/e11ca4d8afc3e412f530ccd55657b401294387ea/test_multiarray.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1126, 12, 1467, 16, 1384, 16, 21626, 4672, 775, 30, 436, 273, 8304, 3816, 1467, 6487, 1613, 33, 92, 16, 1384, 33, 3348, 14, 92, 18, 1726, 1467, 13, 1335, 30, 1342, 436, 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, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1126, 12, 1467, 16, 1384, 16, 21626, 4672, 775, 30, 436, 273, 8304, 3816, 1467, 6487, 1613, 33, 92, 16, 1384, 33, 3348, 14, 92, 18, 1726, 1467, 13, 1335, 30, 1342, 436, 18,...
libraries = ["ginac"]), \
libraries = ["pynac"]), \
def is_newer(file1, file2): """ Return True if either file2 does not exist or is older than file1. If file1 does not exist, always return False. """ if not os.path.exists(file1): return False if not os.path.exists(file2): return True if os.path.getmtime(file2) < os.path.getmtime(file1): return True return False
d061a18049c744ede72cc1e15956b57c439fa97f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d061a18049c744ede72cc1e15956b57c439fa97f/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2704, 264, 12, 768, 21, 16, 585, 22, 4672, 3536, 2000, 1053, 309, 3344, 585, 22, 1552, 486, 1005, 578, 353, 12156, 2353, 585, 21, 18, 225, 971, 585, 21, 1552, 486, 1005, 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, 353, 67, 2704, 264, 12, 768, 21, 16, 585, 22, 4672, 3536, 2000, 1053, 309, 3344, 585, 22, 1552, 486, 1005, 578, 353, 12156, 2353, 585, 21, 18, 225, 971, 585, 21, 1552, 486, 1005, 16,...
"\tcvs - to export sources with windows newlines \n" + \ "\tbash cvs - (cygwin) to export sources with posix newlines\n" + \ "\tbjam - to build BoostBook\n" + \ "\t7z - to create zipball\n" + \ "\tuser-config.jam in user directory ($HOME/%HOME%) - to build BoostBook\n" + \ "\tmv - posix move"
" CVS:\n"+ \ " cvs - (windows) to export sources with windows newlines \n" + \ " /usr/bin/cvs - (cygwin) to export sources with posix newlines\n" + \ " Utilities:\n" + \ " mv - (cygwin) posix move\n" + \ " /usr/bin/find - (cygwin) to export sources with posix newlines\n" + \ " 7z - to create zipball\n" + \ " BoostBook generation:\n" + \ " bjam\n" + \ " user-config.jam - in user directory ($HOME/%HOME%) for BoostBook generation\n" + \ " java\n" + \ " doxygen\n"
def accept_args( args ): #( release_version, cvs_tag, sf_user, temp_dir, start_step ) = accept_args( sys.argv[ 1: ] ) parser = optparse.OptionParser() parser.add_option( "", "--version", dest="version", help="release version" ) parser.add_option( "", "--tag", dest="tag", help="CVS tag" ) parser.add_option( "", "--user", dest="user", help="SourceForge user name" ) parser.add_option( "", "--toolset", dest="toolset", help="toolset to use to build needed tools" ) parser.usage = "make_tarballs [options] temp_dir [start_step]\n\n" + \ "Requirements:\n" + \ "\tcvs - to export sources with windows newlines \n" + \ "\tbash cvs - (cygwin) to export sources with posix newlines\n" + \ "\tbjam - to build BoostBook\n" + \ "\t7z - to create zipball\n" + \ "\tuser-config.jam in user directory ($HOME/%HOME%) - to build BoostBook\n" + \ "\tmv - posix move" ( options, args ) = parser.parse_args( args ) temp_dir = None start_step = None if ( len( args ) > 0 ): temp_dir = args[0] if ( len( args ) > 1 ): start_step = args[1] if ( start_step is None ): start_step = "" ( version, tag, user, toolset ) = ( options.version , options.tag , options.user , options.toolset ) if ( version is None or tag is None or user is None or temp_dir is None or toolset is None ): parser.print_help() sys.exit( 1 ) return ( version, tag, user, toolset, temp_dir, start_step )
aed988a5e1a863624694559f7ea11b246f37978e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7960/aed988a5e1a863624694559f7ea11b246f37978e/make_tarballs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 67, 1968, 12, 833, 262, 30, 468, 12, 3992, 67, 1589, 16, 276, 6904, 67, 2692, 16, 9033, 67, 1355, 16, 1906, 67, 1214, 16, 787, 67, 4119, 262, 273, 2791, 67, 1968, 12, 2589, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 1968, 12, 833, 262, 30, 468, 12, 3992, 67, 1589, 16, 276, 6904, 67, 2692, 16, 9033, 67, 1355, 16, 1906, 67, 1214, 16, 787, 67, 4119, 262, 273, 2791, 67, 1968, 12, 2589, 1...
if alg=="scipy":
if algorithm=="scipy":
def spherical_bessel_J(n, var, alg="maxima"): r""" Returns the spherical Bessel function of the first kind for integers n > -1. Reference: A&S 10.1.8 page 437 and A&S 10.1.15 page 439. EXAMPLES: sage: spherical_bessel_J(2,x) (-(1 - 24/(8*x^2))*sin(x) - 3*cos(x)/x)/x """ if alg=="scipy": import scipy.special ans = str(scipy.special.sph_jn(int(n),float(var))) ans = ans.replace("(","") ans = ans.replace(")","") ans = ans.replace("j","*I") return sage_eval(ans) _init() return meval("spherical_bessel_j(%s,%s)"%(ZZ(n),var))
6634f9ab85d7944da6788aaab93ffaa3f22ce5ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/6634f9ab85d7944da6788aaab93ffaa3f22ce5ac/special.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 21570, 67, 70, 403, 292, 67, 46, 12, 82, 16, 569, 16, 11989, 1546, 1896, 13888, 6, 4672, 436, 8395, 2860, 326, 272, 21570, 605, 403, 292, 445, 434, 326, 1122, 3846, 364, 12321, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21570, 67, 70, 403, 292, 67, 46, 12, 82, 16, 569, 16, 11989, 1546, 1896, 13888, 6, 4672, 436, 8395, 2860, 326, 272, 21570, 605, 403, 292, 445, 434, 326, 1122, 3846, 364, 12321, ...
frame = MyFrame(None, -1, "HTML Help Books")
frame = BookFrame(None, -1, "HTML Help Books")
def main(): app = wxPySimpleApp() frame = MyFrame(None, -1, "HTML Help Books") frame.Show(TRUE) app.MainLoop()
a4e2e4e03c3ae8d24817935745aacd63f3d1c84e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/a4e2e4e03c3ae8d24817935745aacd63f3d1c84e/wxApp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 595, 273, 7075, 9413, 5784, 3371, 1435, 2623, 273, 20258, 3219, 12, 7036, 16, 300, 21, 16, 315, 4870, 11288, 20258, 87, 7923, 2623, 18, 5706, 12, 18724, 13, 595, 18, 6376, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 595, 273, 7075, 9413, 5784, 3371, 1435, 2623, 273, 20258, 3219, 12, 7036, 16, 300, 21, 16, 315, 4870, 11288, 20258, 87, 7923, 2623, 18, 5706, 12, 18724, 13, 595, 18, 6376, ...
import robot
try: import robot except: class FakeModule: def __getattr(self, name): raise RuntimeError('Fake module set by robot_postinstall.py') sys.modules['urllib'] = FakeModule() import robot
def _get_installation_dir(): """Returns installation location. Works also with easy_install.""" import robot return os.path.dirname(os.path.abspath(robot.__file__))
2b825af498f7c2284c6009577a3c464ae30b5136 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6988/2b825af498f7c2284c6009577a3c464ae30b5136/robot_postinstall.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 5425, 367, 67, 1214, 13332, 3536, 1356, 13193, 2117, 18, 4147, 87, 2546, 598, 12779, 67, 5425, 12123, 775, 30, 1930, 14386, 1335, 30, 225, 667, 11551, 3120, 30, 1652, 1001,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 67, 5425, 367, 67, 1214, 13332, 3536, 1356, 13193, 2117, 18, 4147, 87, 2546, 598, 12779, 67, 5425, 12123, 775, 30, 1930, 14386, 1335, 30, 225, 667, 11551, 3120, 30, 1652, 1001,...
res_gfile.lower().find("postscript") == -1 and \
def get_plaintext_document_body(fpath): """Given a file-path to a full-text, return a list of unicode strings whereby each string is a line of the fulltext. In the case of a plain-text document, this simply means reading the contents in from the file. In the case of a PDF/PostScript however, this means converting the document to plaintext. @param: fpath: (string) - the path to the fulltext file @return: (list) of strings - each string being a line in the document. """ textbody = [] status = 0 if os.access(fpath, os.F_OK|os.R_OK): # filepath OK - attempt to extract references: ## get file type: pipe_gfile = os.popen("%s %s" % (CFG_PATH_GFILE, fpath), "r") res_gfile = pipe_gfile.readline() pipe_gfile.close() if res_gfile.lower().find("text") != -1 and \ res_gfile.lower().find("postscript") == -1 and \ res_gfile.lower().find("pdf") == -1: ## plain-text file: don't convert - just read in: #textbody = open("%s" % fpath, "r").readlines() textbody = [] for line in open("%s" % fpath, "r").readlines(): textbody.append(line.decode("utf-8")) else: ## assume file needs to be converted to text: (textbody, status) = convert_document_to_plaintext(fpath) else: ## filepath not OK status = 1
11ccb10bc99c9907d6df324bad7c06a4d678afe0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/11ccb10bc99c9907d6df324bad7c06a4d678afe0/refextract.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 412, 10133, 67, 5457, 67, 3432, 12, 28900, 4672, 3536, 6083, 279, 585, 17, 803, 358, 279, 1983, 17, 955, 16, 327, 279, 666, 434, 5252, 2064, 1625, 1637, 1517, 533, 353, 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, 336, 67, 412, 10133, 67, 5457, 67, 3432, 12, 28900, 4672, 3536, 6083, 279, 585, 17, 803, 358, 279, 1983, 17, 955, 16, 327, 279, 666, 434, 5252, 2064, 1625, 1637, 1517, 533, 353, 279, ...
self.exec_highlight(real_line, syn['start'], start - 1, syn['highlight'])
self.exec_highlight(real_line, syn['start'], start, syn['highlight'])
def apply_color(self, start, end): logging.debug('applying colors ' + str(self.color_changes))
22b211124f1671674be8b960bd63eef95c34375f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10698/22b211124f1671674be8b960bd63eef95c34375f/conque.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 67, 3266, 12, 2890, 16, 787, 16, 679, 4672, 2907, 18, 4148, 2668, 9010, 310, 5740, 296, 397, 609, 12, 2890, 18, 3266, 67, 6329, 3719, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 67, 3266, 12, 2890, 16, 787, 16, 679, 4672, 2907, 18, 4148, 2668, 9010, 310, 5740, 296, 397, 609, 12, 2890, 18, 3266, 67, 6329, 3719, 2, -100, -100, -100, -100, -100, -100, -100,...
base_url = re.sub('
base_url = re.sub('
def _terms_from_docstring(self, base_url, container, parsed_docstring): if parsed_docstring in (None, UNKNOWN): return [] terms = [] # Strip any existing anchor off: base_url = re.sub('#.*', '', base_url) for term in parsed_docstring.index_terms(): anchor = self._term_index_to_anchor(term) url = '%s#%s' % (base_url, anchor) terms.append( (term.to_plaintext(None), url, container) ) return terms
88424ed12500a547f79e2cb3a6b551257fd2c5fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/88424ed12500a547f79e2cb3a6b551257fd2c5fd/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10112, 67, 2080, 67, 24675, 12, 2890, 16, 1026, 67, 718, 16, 1478, 16, 2707, 67, 24675, 4672, 309, 2707, 67, 24675, 316, 261, 7036, 16, 13598, 4672, 327, 5378, 6548, 273, 5378, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10112, 67, 2080, 67, 24675, 12, 2890, 16, 1026, 67, 718, 16, 1478, 16, 2707, 67, 24675, 4672, 309, 2707, 67, 24675, 316, 261, 7036, 16, 13598, 4672, 327, 5378, 6548, 273, 5378, 46...
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
result = PyObject_CallFunction((PyObject*)&PyType_Type, "U(O){sOss}",
def visitModule(self, mod): self.emit("""
6172a5b1244bb0c984107d01116665024aade091 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/6172a5b1244bb0c984107d01116665024aade091/asdl_c.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 3120, 12, 2890, 16, 681, 4672, 365, 18, 18356, 2932, 3660, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 3757, 3120, 12, 2890, 16, 681, 4672, 365, 18, 18356, 2932, 3660, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return QuotientRingElement(self.parent(),self.__rep.lm())
return self.parent()(self.__rep.lm())
def lm(self): """ Return the leading monomial of this quotient ring element.
93452cacca64d6eff31f7868adc68d5c9f4369a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/93452cacca64d6eff31f7868adc68d5c9f4369a4/quotient_ring_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14966, 12, 2890, 4672, 3536, 2000, 326, 7676, 312, 4708, 649, 434, 333, 26708, 9221, 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, ...
[ 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14966, 12, 2890, 4672, 3536, 2000, 326, 7676, 312, 4708, 649, 434, 333, 26708, 9221, 930, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if collection is not None:
configurator = coil.getConfigurator(entity) if collection or configurator:
def displayTreeElement(self, write, inName, inPath, collection, indentLevel=0): subIndent = indentLevel + 1 for name, entity in collection.listStaticEntities(): collection = coil.getCollection(entity) if collection is not None: write('%s + <a href="%s/%s">%s</a> <br>' % (indentLevel * '&nbsp;', inPath, name, name)) self.displayTreeElement(write, name, '%s/%s' % (inPath, name), collection, subIndent) else: write("%s. %s <br>" % (subIndent * '&nbsp;', name))
1f122bb3850d13f1f283e90087c175a4016a47cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1f122bb3850d13f1f283e90087c175a4016a47cd/web.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 2471, 1046, 12, 2890, 16, 1045, 16, 316, 461, 16, 316, 743, 16, 1849, 16, 3504, 2355, 33, 20, 4672, 720, 7790, 273, 3504, 2355, 397, 404, 364, 508, 16, 1522, 316, 1849, 18, 109...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2562, 2471, 1046, 12, 2890, 16, 1045, 16, 316, 461, 16, 316, 743, 16, 1849, 16, 3504, 2355, 33, 20, 4672, 720, 7790, 273, 3504, 2355, 397, 404, 364, 508, 16, 1522, 316, 1849, 18, 109...
if options.debug: print "DEBUG: Working on:", rpm
if options.debug: print timestamp(), "DEBUG: Working on:", rpm
def main(): if options.demo: key = False current_channels = {} current_channel_labels = ['rhel-x86_64-server-5'] else: # Login to Satellite server key = login(options.user, options.password) # Build existing channel list current_channels = client.channel.list_all_channels(key) current_channel_labels = [] for channel in current_channels: current_channel_labels.append(channel['label']) if options.debug: print "DEBUG: Channels on current Satellite server:", current_channel_labels if client.api.get_version() < 5.1: # TODO: Haven't tested with Spacewalk, not sure how it is reported print "This script uses features not available with Satellite versions older than 5.1" sys.exit(1) if not options.client_actions_only: # This begins the server actions section if not os.path.exists(options.localdir): try: os.makedirs(options.localdir) except: print "Error: Unable to create %s" % (options.localdir) raise if (not options.delete) and (not options.no_rsync): # Sync local Dell repo with public Dell repo returncode = get_dell_repo(DELL_REPO_URL, options.localdir) if not returncode == 0: print "rsync process exited with returncode:", returncode # Build child channels based on dell repo as needed systems = build_channel_list(options.localdir, SYSTEM_VENDOR_ID) systems['platform_independent'] = PLATFORM_INDEPENDENT # Iterate through list of supported RHEL versions and archs, create parent channels if needed channels = {} print "Checking base channels on Satellite server" for parent in SUPPORTED_CHANNELS: if options.verbose: print "Checking base channel", parent # Check each supported base channel, skip if it does not exist on Satellite server if parent not in current_channel_labels: if options.verbose: print "-%s is not a current base channel, skipping." % (parent) continue else: channels[parent] = SUPPORTED_CHANNELS[parent] channels[parent]['child_channels'] = [] # Initialize key for child channels if options.verbose: print "+%s found on Satellite server, checking child channels." % (parent) if channels[parent]['arch'] == 'i386': # This is because Satellite stores x86 as 'ia32' arch = 'channel-ia32' else: arch = 'channel-' + channels[parent]['arch'] subdir = channels[parent]['subdir'] print " Checking child channels for %s" % parent for system in systems: # use system name plus parent to create a unique child channel c_label = DELL_INFO['label'] + '-' + system + '-' + parent c_name = DELL_INFO['name'] + ' on ' + systems[system] + ' for ' + parent c_summary = DELL_INFO['summary'] + ' on ' + systems[system] + ' running ' + parent c_arch = arch c_dir = options.localdir + system + '/' + subdir if options.verbose: print " Checking child channel:", c_label if channel_exists(key, c_label, current_channels): if options.delete: # Delete child channels if requested if options.demo: print "Deleting channel:", c_label else: delete_channel(key, c_label) else: if options.debug: print "DEBUG: checking for dir:", c_dir if options.verbose: print "Child channel already exists:", c_label if os.path.isdir(c_dir): channels[parent]['child_channels'].append(system) else: if not options.delete: # Build child channels if needed if options.debug: print "DEBUG: checking for dir:", c_dir if os.path.isdir(c_dir): channels[parent]['child_channels'].append(system) if options.debug: print "DEBUG: %s exists for %s, creating channel" % (subdir, system) if options.demo: if options.verbose: print "Creating child channel:", c_label else: create_channel(key, c_label, c_name, c_summary, c_arch, parent) else: if options.debug: print "DEBUG: %s does not exists for %s" % (subdir, system) if (not options.delete) and (not options.no_packages): # Iterate through channels, pushing rpms from the local repo as needed # TODO: check if rpm is already uploaded and orphaned or part of another channel if options.debug: print "DEBUG: Channel mapping:", channels print "Syncing rpms as needed" for parent in channels: print " Syncing rpms for child channels in %s" % parent for child in channels[parent]['child_channels']: dir = options.localdir + child + '/' + channels[parent]['subdir'] channel = DELL_INFO['label'] + '-' + child + '-' + parent if options.verbose: print " Syncing rpms to child channel", channel if options.debug: print "DEBUG: Looking for rpms in", dir rpms = gen_rpm_list(dir) # Get all packages in child channel existing_packages = client.channel.software.list_all_packages(key, channel) if options.debug: print "DEBUG: Existing packages in", channel, existing_packages for rpm in rpms: if options.debug: print "DEBUG: Working on:", rpm # Strip off '.rpm' at end of file to match against existing entries rpm_name = rpm.split('.rpm')[0] # Now strip off any preceeding paths rpm_name = rpm_name.split('/')[-1] # Iterate through existing packages, and skip existing ones if options.verbose: print "Checking if %s is already on the Satellite server in %s" % (rpm_name, channel) for package in existing_packages: existing_rpm_name = reconstruct_name(package) if options.debug: print "DEBUG: Checking match for %s and %s" % (rpm_name, existing_rpm_name) if existing_rpm_name == rpm_name: # This means the intended rpm is already in Satellite, so skip if options.verbose: print "- %s already in Satellite, skipping" % (rpm_name) break else: if options.verbose: print "+ %s is not in Satellite, adding" % (rpm_name) if options.debug: print "DEBUG: Calling: push_rpm(",rpm, channel, options.user, options.password, options.satserver, ")" returncode = push_rpm(rpm, channel, options.user, options.password, options.satserver) if not returncode == 0: print "rhnpush process exited with returncode:", returncode if returncode == 255: print "You may force package uploads with --force" sys.exit(1) print "Completed uploading rpms." if (not options.server_actions_only) and (not options.demo) and (not options.delete): # This is the client actions section print "Subscribing registered systems to the %s channel" % (PLATFORM_INDEPENDENT) client_systems = subscribe_clients(key) print "Scheduling software installation and actions on clients" client_systems = schedule_actions(key, client_systems) print "Waiting for client actions to complete" client_systems = get_action_results(key, client_systems) print "All actions completed.\n" show_client_results(client_systems) if not options.demo: logout(key)
07e2421549e748ccb09a392c60834eaea3e54917 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3457/07e2421549e748ccb09a392c60834eaea3e54917/dell-satellite-sync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 309, 702, 18, 27928, 30, 498, 273, 1083, 783, 67, 9114, 273, 2618, 783, 67, 4327, 67, 5336, 273, 10228, 30138, 292, 17, 92, 5292, 67, 1105, 17, 3567, 17, 25, 3546, 469, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2774, 13332, 309, 702, 18, 27928, 30, 498, 273, 1083, 783, 67, 9114, 273, 2618, 783, 67, 4327, 67, 5336, 273, 10228, 30138, 292, 17, 92, 5292, 67, 1105, 17, 3567, 17, 25, 3546, 469, ...
_check_testcase_name = re.compile(r'test.*').match
_check_testcase_name = re.compile(r'test.*|Test.*').match
def _makeResult(self): return _NumPyTextTestResult(self.stream, self.descriptions, self.verbosity)
c7108cb9ab07fc410cc8b2f849cbac1d04f3382c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/c7108cb9ab07fc410cc8b2f849cbac1d04f3382c/numpytest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6540, 1253, 12, 2890, 4672, 327, 389, 2578, 9413, 1528, 4709, 1253, 12, 2890, 18, 3256, 16, 365, 18, 30288, 16, 365, 18, 16629, 8807, 13, 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, 0, 0, 0, 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, 6540, 1253, 12, 2890, 4672, 327, 389, 2578, 9413, 1528, 4709, 1253, 12, 2890, 18, 3256, 16, 365, 18, 30288, 16, 365, 18, 16629, 8807, 13, 2, -100, -100, -100, -100, -100, -100, -1...
if self.text.get("insert-1c") not in (')',']','}'):
closer = self.text.get("insert-1c") if closer not in _openers:
def paren_closed_event(self, event): # If it was a shortcut and not really a closing paren, quit. if self.text.get("insert-1c") not in (')',']','}'): return hp = HyperParser(self.editwin, "insert-1c") if not hp.is_in_code(): return indices = hp.get_surrounding_brackets(keysym_opener[event.keysym], True) if indices is None: self.warn_mismatched() return self.activate_restore() self.create_tag(indices) self.set_timeout()
7bb1ffcf0ee05d862c7c1fe50088a3aee3de9ca1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7bb1ffcf0ee05d862c7c1fe50088a3aee3de9ca1/ParenMatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22146, 67, 12204, 67, 2575, 12, 2890, 16, 871, 4672, 468, 971, 518, 1703, 279, 10995, 471, 486, 8654, 279, 7647, 22146, 16, 9706, 18, 13306, 273, 365, 18, 955, 18, 588, 2932, 6387, 17,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22146, 67, 12204, 67, 2575, 12, 2890, 16, 871, 4672, 468, 971, 518, 1703, 279, 10995, 471, 486, 8654, 279, 7647, 22146, 16, 9706, 18, 13306, 273, 365, 18, 955, 18, 588, 2932, 6387, 17,...
return error.ForbiddenResource().render(request)
return ForbiddenResource().render(request)
def renderHTTP(self, ctx): """You know what you doing.""" self.fp.restat()
efd5801afde94f7f37bd13f397e0cd5c3bf1e769 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7162/efd5801afde94f7f37bd13f397e0cd5c3bf1e769/static.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 3693, 12, 2890, 16, 1103, 4672, 3536, 6225, 5055, 4121, 1846, 9957, 12123, 365, 18, 7944, 18, 266, 5642, 1435, 2, 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, 1743, 3693, 12, 2890, 16, 1103, 4672, 3536, 6225, 5055, 4121, 1846, 9957, 12123, 365, 18, 7944, 18, 266, 5642, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self._write_lock = thread.allocate_lock()
if debug_threads: self._write_lock = verbose_lock() else: self._write_lock = thread.allocate_lock()
def __init__(self, address=None, display=None, stream=None, stream_read=0, poll=None): if stream: self._connection = stream try: self._write = self._connection.send except AttributeError: self._write = self._connection.write self.close_connection = noop self._wait = stream_read self._poll = poll else: self._connection = network.sock(address, display) self._write = self._connection.send self.close_connection = self._connection.close self._wait = 1 self._poll = network.poll_for(self._connection) self._strings = {} self._fonts = {} self._bitmaps = {} self._counter = 0 self._poll_handlers = {} self.lost_and_found = [] self.event_queue = [] if thread is not None: self._write_lock = thread.allocate_lock()
ef588bb9cccfcf5dcc31d90b10c8000f0dd69bec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/454/ef588bb9cccfcf5dcc31d90b10c8000f0dd69bec/Server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1758, 33, 7036, 16, 2562, 33, 7036, 16, 1407, 33, 7036, 16, 1407, 67, 896, 33, 20, 16, 7672, 33, 7036, 4672, 309, 1407, 30, 365, 6315, 4071, 273, 1407,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1758, 33, 7036, 16, 2562, 33, 7036, 16, 1407, 33, 7036, 16, 1407, 67, 896, 33, 20, 16, 7672, 33, 7036, 4672, 309, 1407, 30, 365, 6315, 4071, 273, 1407,...
for i in range(len(self._open_tags)-1, -1, -1): if self._open_tags[i] == tag: tmp += self._open_tags[i]
for i in xrange(len(self._open_tags)-1, -1, -1): tmp += self._open_tags[i][1] if self._open_tags[i][1] == tag:
def close_tag(self, tag): tmp = '' for i in range(len(self._open_tags)-1, -1, -1): if self._open_tags[i] == tag: tmp += self._open_tags[i] del self._open_tags[i] break return tmp
0d3b7c933ce40b65066e2a8648277a602ab8beda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/0d3b7c933ce40b65066e2a8648277a602ab8beda/formatter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 67, 2692, 12, 2890, 16, 1047, 4672, 1853, 273, 225, 875, 364, 277, 316, 12314, 12, 1897, 12, 2890, 6315, 3190, 67, 4156, 24950, 21, 16, 300, 21, 16, 300, 21, 4672, 1853, 1011, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1746, 67, 2692, 12, 2890, 16, 1047, 4672, 1853, 273, 225, 875, 364, 277, 316, 12314, 12, 1897, 12, 2890, 6315, 3190, 67, 4156, 24950, 21, 16, 300, 21, 16, 300, 21, 4672, 1853, 1011, ...
return idaapi.toggle_signness(ea, n)
return idaapi.toggle_sign(ea, n)
def OpSign(ea, n): """ Change sign of the operand @param ea: linear address @param n: number of operand - 0 - the first operand - 1 - the second, third and all other operands - -1 - all operands """ return idaapi.toggle_signness(ea, n)
76aa24fecdace41c9fc827e500b95cfdf5053272 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4773/76aa24fecdace41c9fc827e500b95cfdf5053272/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6066, 2766, 12, 24852, 16, 290, 4672, 3536, 7576, 1573, 434, 326, 9886, 225, 632, 891, 24164, 30, 9103, 1758, 632, 891, 290, 30, 1300, 434, 9886, 300, 374, 300, 326, 1122, 9886, 300, 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, 6066, 2766, 12, 24852, 16, 290, 4672, 3536, 7576, 1573, 434, 326, 9886, 225, 632, 891, 24164, 30, 9103, 1758, 632, 891, 290, 30, 1300, 434, 9886, 300, 374, 300, 326, 1122, 9886, 300, 4...
html=urllib.urlopen(uri[3:])
html=urllib2.urlopen(uri[3:])
def getVidName(self,uri): # There's no Veoh here because it's taken directly from the addVid function in order to prevent redownloading the page if uri[0:3]=='yt:': try: html=urllib.urlopen('http://www.youtube.com/watch?v='+uri[3:]) for i in html: res=REGEX_HTTP_YOUTUBE_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) else: res=REGEX_HTTP_GENERIC_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) else: pass # Return Unknown title except: pass # Can't grab this? Return Unknown title elif uri[0:3]=='gv:': try: html=urllib.urlopen('http://video.google.com/videoplay?docid='+uri[3:]) for i in html: res=REGEX_HTTP_GVIDEO_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) else: res=REGEX_HTTP_GENERIC_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) else: pass # Return Unknown title except: pass # Can't grab this? Return Unknown title elif uri[0:3]=='dm:': try: html=urllib.urlopen(uri[3:]) for i in html: res=REGEX_HTTP_DAILYMOTION_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) else: res=REGEX_HTTP_GENERIC_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) else: pass # Return Unknown title except: pass # Can't grab this? Return Unknown title else: try: html=urllib.urlopen(uri[3:]) for i in html: res=REGEX_HTTP_GENERIC_TITLE_EXTRACT.search(i) if res: return self.noHtmlEnt(res.group(1)) except: pass # Can't grab this? Return Unknown title return 'Unknown title'
7ad6098b40f1a39c4d76402fede5772f656b7b13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/7ad6098b40f1a39c4d76402fede5772f656b7b13/DamnVid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11031, 350, 461, 12, 2890, 16, 1650, 4672, 468, 6149, 1807, 1158, 776, 4361, 76, 2674, 2724, 518, 1807, 9830, 5122, 628, 326, 527, 58, 350, 445, 316, 1353, 358, 5309, 1755, 995, 15174, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11031, 350, 461, 12, 2890, 16, 1650, 4672, 468, 6149, 1807, 1158, 776, 4361, 76, 2674, 2724, 518, 1807, 9830, 5122, 628, 326, 527, 58, 350, 445, 316, 1353, 358, 5309, 1755, 995, 15174, ...
propertiesList = SONG_TABLE_FIELDS sql="" op=' AND ' if mode==0 else ' OR ' for rule in listRules: i=listRules.index(rule) substValues1=(op,propertiesList[rule[0]][0],rule[2]) substValues2=(op,rule[2],propertiesList[rule[0]][0]) substValues3=(op,propertiesList[rule[0]][0]) dateType=propertiesList[rule[0]][1] emptVal = '""' if dateType=="T" else '"-1"' tuplOper=("=","<>",">",">=","<","<=") if dateType=="D": if rule[1]<6:
if self.isRunning(): propertiesList = SONG_TABLE_FIELDS sql="" op=' AND ' if mode==0 else ' OR ' for rule in listRules: i=listRules.index(rule) substValues1=(op,propertiesList[rule[0]][0],rule[2]) substValues2=(op,rule[2],propertiesList[rule[0]][0]) substValues3=(op,propertiesList[rule[0]][0]) dateType=propertiesList[rule[0]][1] emptVal = '""' if dateType=="T" else '"-1"' tuplOper=("=","<>",">",">=","<","<=") if dateType=="D": if rule[1]<6: for ix in range(0,6): if rule[1]==ix: substValues=(op,propertiesList[rule[0]][0],tuplOper[ix],rule[2]) sql+="%sstrftime('%%Y-%%m-%%d %%H:%%M:%%S',%s+2415018.5)%s'%s'" % substValues break else: substValues=(op,propertiesList[rule[0]][0],rule[2][:-1],unitList[int(rule[2][-1])]) if rule[1]==6: sql+="%s(%s+2415018.5)>julianday('now','-%s %s','localtime')" % substValues if rule[1]==7: sql+="%s(%s+2415018.5)<julianday('now','-%s %s','localtime')" % substValues else:
def LoadFilterPlaylist( self, mode, listRules, order, trend, crit, limit, random, num, repeat, shuffle, crossfade, accessible, unitList, trendList
00e4fd0138f9a3789c536c9ec79d8dcf4f1aa706 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/00e4fd0138f9a3789c536c9ec79d8dcf4f1aa706/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 1586, 30194, 12, 365, 16, 1965, 16, 666, 4478, 16, 1353, 16, 268, 20262, 16, 7921, 16, 1800, 16, 2744, 16, 818, 16, 7666, 16, 12552, 16, 6828, 507, 323, 16, 12718, 16, 2836, 68...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4444, 1586, 30194, 12, 365, 16, 1965, 16, 666, 4478, 16, 1353, 16, 268, 20262, 16, 7921, 16, 1800, 16, 2744, 16, 818, 16, 7666, 16, 12552, 16, 6828, 507, 323, 16, 12718, 16, 2836, 68...
if c == "\021":
if c == b"\021":
def process_rawq(self): """Transfer from raw queue to cooked queue.
4ff2306a48ad184f76d4bd456b4caf600359b831 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/4ff2306a48ad184f76d4bd456b4caf600359b831/telnetlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 1899, 85, 12, 2890, 4672, 3536, 5912, 628, 1831, 2389, 358, 15860, 329, 2389, 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...
[ 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 1899, 85, 12, 2890, 4672, 3536, 5912, 628, 1831, 2389, 358, 15860, 329, 2389, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
try: result = run_sql("""SELECT * FROM accROLE WHERE id = %s """ % (id_role, ))[0]
try: result = run_sql("""SELECT * FROM accROLE WHERE id = %s """, (id_role, ))[0]
def acc_getRoleDetails(id_role=0): """get all the fields for an action.""" details = [] try: result = run_sql("""SELECT * FROM accROLE WHERE id = %s """ % (id_role, ))[0] except IndexError: return details if result: for r in result: details.append(r) return details
26e50a54ed5eb379037d5a141a2bb8b9d14b42b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1931/26e50a54ed5eb379037d5a141a2bb8b9d14b42b7/access_control_admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4078, 67, 588, 2996, 3790, 12, 350, 67, 4615, 33, 20, 4672, 3536, 588, 777, 326, 1466, 364, 392, 1301, 12123, 225, 3189, 273, 5378, 775, 30, 563, 273, 1086, 67, 4669, 2932, 3660, 4803,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4078, 67, 588, 2996, 3790, 12, 350, 67, 4615, 33, 20, 4672, 3536, 588, 777, 326, 1466, 364, 392, 1301, 12123, 225, 3189, 273, 5378, 775, 30, 563, 273, 1086, 67, 4669, 2932, 3660, 4803,...
self.response_msg.body = self.error_message_format % values
self.response_msg.body = self._FormatErrorMessage(values) def _FormatErrorMessage(self, values): """Formats the body of an error message. @type values: dict @param values: dictionary with keys code, message and explain. @rtype: string @return: the body of the message """ return self.error_message_format % values
def _SetErrorStatus(self, err): """Sets the response code and body from a HttpException.
1f8588f6691bae503f7deb3e07278f1df8f48b00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/1f8588f6691bae503f7deb3e07278f1df8f48b00/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 694, 668, 1482, 12, 2890, 16, 393, 4672, 3536, 2785, 326, 766, 981, 471, 1417, 628, 279, 23190, 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, 389, 694, 668, 1482, 12, 2890, 16, 393, 4672, 3536, 2785, 326, 766, 981, 471, 1417, 628, 279, 23190, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
entity_types = tuple((name, tuple(entity_types_map[t] for t in types if t in entity_types_map)) for (name, types) in cls.conf.nearby_entity_types)
entity_types = tuple((name, tuple(entity_types_map[t] for t in types)) for (name, types) in cls.conf.nearby_entity_types)
def handle_GET(cls, request, context, entity=None): point = get_point(request, entity)
44e842068bde583178e6fc4457c2e411875f8bfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/44e842068bde583178e6fc4457c2e411875f8bfd/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 3264, 12, 6429, 16, 590, 16, 819, 16, 1522, 33, 7036, 4672, 1634, 273, 336, 67, 1153, 12, 2293, 16, 1522, 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, 1640, 67, 3264, 12, 6429, 16, 590, 16, 819, 16, 1522, 33, 7036, 4672, 1634, 273, 336, 67, 1153, 12, 2293, 16, 1522, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
output = pydoc.TextDoc().docmodule(module)
doc = pydoc.TextDoc() loc = doc.getdocloc(pydoc_mod) or "" if loc: loc = "\nMODULE DOCS\n " + loc + "\n" output = doc.docmodule(module)
def get_pydoc_text(module): "Returns pydoc generated output as text" output = pydoc.TextDoc().docmodule(module) # cleanup the extra text formatting that pydoc preforms patt = re.compile('\b.') output = patt.sub('', output) return output.strip()
3a7305ed14684a2fe2ed9ad7f91aae06dd81b520 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/3a7305ed14684a2fe2ed9ad7f91aae06dd81b520/test_pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2074, 2434, 67, 955, 12, 2978, 4672, 315, 1356, 2395, 2434, 4374, 876, 487, 977, 6, 997, 273, 2395, 2434, 18, 1528, 1759, 1435, 1515, 273, 997, 18, 588, 2434, 1829, 12, 2074, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 67, 2074, 2434, 67, 955, 12, 2978, 4672, 315, 1356, 2395, 2434, 4374, 876, 487, 977, 6, 997, 273, 2395, 2434, 18, 1528, 1759, 1435, 1515, 273, 997, 18, 588, 2434, 1829, 12, 2074, ...
load_msh(self.filepath,self.orbiterpath,self.convert_coords,self.show_single_sided)
param_vector=[self.convert_coords,self.show_single_sided,self.raise_small_hardness,self.default_hardness] load_msh(self.filepath,param_vector)
def execute(self,context): print("execute") load_msh(self.filepath,self.orbiterpath,self.convert_coords,self.show_single_sided) return{"FINISHED"}
86e35fd95f0c62cd139674c6ebaa7ac78d3174ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10993/86e35fd95f0c62cd139674c6ebaa7ac78d3174ba/io_import_msh.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 2472, 4672, 1172, 2932, 8837, 7923, 579, 67, 7737, 22850, 2890, 18, 6283, 67, 9076, 16, 2890, 18, 4500, 67, 7526, 67, 7722, 785, 16, 2890, 18, 11628, 67, 12019, 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, 1836, 12, 2890, 16, 2472, 4672, 1172, 2932, 8837, 7923, 579, 67, 7737, 22850, 2890, 18, 6283, 67, 9076, 16, 2890, 18, 4500, 67, 7526, 67, 7722, 785, 16, 2890, 18, 11628, 67, 12019, 67,...
def close (self): return os.close (self.fd) def fileno (self):
def close(self): return os.close(self.fd) def fileno(self):
def close (self): return os.close (self.fd)
79991224d1b5f3a4ab074ddac83ef59addf853be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/79991224d1b5f3a4ab074ddac83ef59addf853be/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 261, 2890, 4672, 327, 1140, 18, 4412, 261, 2890, 18, 8313, 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,...
[ 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, 1746, 261, 2890, 4672, 327, 1140, 18, 4412, 261, 2890, 18, 8313, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return None filename, lineno = m.group(1, 2) try: f = open(filename, "r") f.close() except IOError:
def _file_line_helper(self, line): for prog in self.file_line_progs: m = prog.search(line) if m: break else: return None filename, lineno = m.group(1, 2) try: f = open(filename, "r") f.close() except IOError: return None try: return filename, int(lineno) except TypeError: return None
8099e9c16705b9abc3882a656691df36e60f1692 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/8099e9c16705b9abc3882a656691df36e60f1692/OutputWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 768, 67, 1369, 67, 4759, 12, 2890, 16, 980, 4672, 364, 11243, 316, 365, 18, 768, 67, 1369, 67, 685, 564, 30, 312, 273, 11243, 18, 3072, 12, 1369, 13, 309, 312, 30, 898, 469, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 768, 67, 1369, 67, 4759, 12, 2890, 16, 980, 4672, 364, 11243, 316, 365, 18, 768, 67, 1369, 67, 685, 564, 30, 312, 273, 11243, 18, 3072, 12, 1369, 13, 309, 312, 30, 898, 469, 3...
def fling( path, port=PORT, title=None, description=None, image=None ):
def fling( path, port=PORT, title=None, description=None ):
def fling( path, port=PORT, title=None, description=None, image=None ): if type(port) == str: port = int(port) print "fling %s from port %d with title %s" % (path, port, title) if os.path.isabs(path): print "Use relative paths. %s is absolute" % path reactor.stop() p, ext = os.path.splitext( path ) d, fname = os.path.split(p) if not d: d = os.getcwd() dname, temp, ips = socket.gethostbyname_ex(socket.gethostname()) ip = ips[0] # HEREDAVE: need to be smarter. if not title: title = fname flung_across_lan = "Flung across local network from machine %s" % ( "with name %s at ip address %s." % ( dname, ip )) if not description: description = "" description += flung_across_lan url = "http://%s:%d/%s" % ( ip, port, path ) #image_url = "http://%s:%d/%s" % ( ip, port, image ) print "dir=", d print "directory contents", os.listdir(d) images = [f for f in os.listdir(d) if os.path.splitext(f)[1] in image_ext] if len(images) == 1: image_url = "http://%s:%d/%s" % ( ip, port, image ) else: for f in images: ifname = os.path.splitext(f)[0] if fname == ifname: image_url = "http://%s:%d/%s" % ( ip, port, image ) break else: image_url = "http://flingo.tv/images/fling/f_icon.jpg" print "title:",title print "description:", description print "image:", image_url print "url:", url fling_url="http://api.dave.flingo.tv/fling/fling?%s" % ( "title=%s&image=%s&description=%s&url=%s&version=%s"%( quote(title), quote(image_url), quote(description), quote(url), "1.0.12" )) print "fling_url:", fling_url result = get(fling_url) print "result:", result
84e89a3849dadf94d2be377cd31944826b724c66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14895/84e89a3849dadf94d2be377cd31944826b724c66/flingo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 310, 12, 589, 16, 1756, 33, 6354, 16, 2077, 33, 7036, 16, 2477, 33, 7036, 262, 30, 309, 618, 12, 655, 13, 422, 609, 30, 1756, 273, 509, 12, 655, 13, 1172, 315, 2242, 310, 738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 310, 12, 589, 16, 1756, 33, 6354, 16, 2077, 33, 7036, 16, 2477, 33, 7036, 262, 30, 309, 618, 12, 655, 13, 422, 609, 30, 1756, 273, 509, 12, 655, 13, 1172, 315, 2242, 310, 738...
print repr(filename)
def test_directory(self): dirname = os.path.join(test_support.TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb') filename = u'\xdf-\u66e8\u66e9\u66eb' oldwd = os.getcwd() os.mkdir(dirname) os.chdir(dirname) f = open(filename, 'w') f.write((filename + '\n').encode("utf-8")) f.close() print repr(filename) os.access(filename,os.R_OK) os.remove(filename) os.chdir(oldwd) os.rmdir(dirname)
44287811941912bde9ade84f87a2abf8a3069b5a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/44287811941912bde9ade84f87a2abf8a3069b5a/test_pep277.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5149, 12, 2890, 4672, 4283, 273, 1140, 18, 803, 18, 5701, 12, 3813, 67, 13261, 18, 16961, 19793, 16, 89, 11, 20799, 64, 30772, 64, 92, 2180, 6943, 89, 6028, 73, 28, 64, 89,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 5149, 12, 2890, 4672, 4283, 273, 1140, 18, 803, 18, 5701, 12, 3813, 67, 13261, 18, 16961, 19793, 16, 89, 11, 20799, 64, 30772, 64, 92, 2180, 6943, 89, 6028, 73, 28, 64, 89,...
commodity, differential = findbestdeal(curprices, destprices, m.quatloos,dontbuy)
commodity, differential = findbestdeal(curplanet, destplanet, m.quatloos, capacity, dontbuy)
def dotrade(self,report): dontbuy = ['id'] replinestart = " Trading at " + self.destination.name + " ("+str(self.destination.id)+") " if self.trade_manifest is None: report.append(replinestart+"can't trade without trade goods.") return if self.destination.resources is None: report.append(replinestart+"planet doesn't support trade.") return # sell whatever is in the hold m = self.trade_manifest curplanet = self.destination curprices = curplanet.getprices() shipsmanifest = m.manifestlist(['id','quatloos']) r = curplanet.resources for line in shipsmanifest: numtosell = getattr(m,line) if(numtosell > 0): dontbuy.append(line) profit = curplanet.getprice(line) * numtosell if line == 'people': report.append(replinestart + " disembarking " + str(numtosell) + " passengers.") else: report.append(replinestart + " selling " + str(numtosell) + " " + str(line) + " for " + str(profit) + ".") setattr(m,'quatloos',getattr(m,'quatloos')+profit) setattr(m,line,0) setattr(r,line,numtosell) if r.quatloos - profit < 0: r.quatloos = 0 else: setattr(r,'quatloos',getattr(r,'quatloos')-profit) m.save() r.save()
c3f898eb1ec727ded93431b29729d41521bf7937 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2020/c3f898eb1ec727ded93431b29729d41521bf7937/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 20077, 12, 2890, 16, 6006, 4672, 14046, 70, 9835, 273, 10228, 350, 3546, 6831, 267, 27893, 273, 315, 225, 2197, 7459, 622, 315, 397, 365, 18, 10590, 18, 529, 397, 315, 7566, 15, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 20077, 12, 2890, 16, 6006, 4672, 14046, 70, 9835, 273, 10228, 350, 3546, 6831, 267, 27893, 273, 315, 225, 2197, 7459, 622, 315, 397, 365, 18, 10590, 18, 529, 397, 315, 7566, 15, 7...
print "Reading %sPackages..." % dbpath
print "Reading %sPackages..." % rpmdbpath
def readRpmdb(dbpath, distroverpkg, releasever, configfiles, buildroot, arch, verbose, checkfileconflicts, reposdirs): from binascii import b2a_hex if verbose: print "Reading rpmdb, this can take some time..." print "Reading %sPackages..." % dbpath if verbose > 2: time1 = time.clock() (packages, keyring, maxtid, pkgdata, swapendian) = readPackages(dbpath, verbose) if verbose: if verbose > 2: time2 = time.clock() print "Needed", time2 - time1, "seconds to read Packages", \ "(%d rpm packages)." % len(packages.keys()) print "Reading the other files in %s..." % dbpath if verbose > 2: time1 = time.clock() if verbose and sys.version_info < (2, 3): print "If you use python-2.2 you can get the harmless output:", \ "'Python bsddb: close errno 13 in dealloc'." basenames = readDb(swapendian, dbpath + "Basenames") conflictname = readDb(swapendian, dbpath + "Conflictname") dirnames = readDb(swapendian, dbpath + "Dirnames", "bt") filemd5s = readDb(swapendian, dbpath + "Filemd5s") group = readDb(swapendian, dbpath + "Group") installtid = readDb(swapendian, dbpath + "Installtid", "bt", 1) name = readDb(swapendian, dbpath + "Name") providename = readDb(swapendian, dbpath + "Providename") provideversion = readDb(swapendian, dbpath + "Provideversion", "bt") pubkeys = readDb(swapendian, dbpath + "Pubkeys") requirename = readDb(swapendian, dbpath + "Requirename") requireversion = readDb(swapendian, dbpath + "Requireversion", "bt") sha1header = readDb(swapendian, dbpath + "Sha1header") sigmd5 = readDb(swapendian, dbpath + "Sigmd5") triggername = readDb(swapendian, dbpath + "Triggername") if verbose: if verbose > 2: time2 = time.clock() print "Needed", time2 - time1, "seconds to read the other files." print "Checking data integrity..." if verbose > 2: time1 = time.clock() # Checking data integrity of the rpmdb: for tid in packages.keys(): if tid > maxtid: print "wrong tid:", tid verifyStructure(verbose, packages, basenames, "basenames") verifyStructure(verbose, packages, conflictname, "conflictname") verifyStructure(verbose, packages, dirnames, "dirnames") for x in filemd5s.values(): for y in x.keys(): x[y] = b2a_hex(x[y]) verifyStructure(verbose, packages, filemd5s, "filemd5s") verifyStructure(verbose, packages, group, "group") verifyStructure(verbose, packages, installtid, "installtid") verifyStructure(verbose, packages, name, "name", 0) verifyStructure(verbose, packages, providename, "providename") verifyStructure(verbose, packages, provideversion, "provideversion") #verifyStructure(verbose, packages, pubkeys, "pubkeys") verifyStructure(verbose, packages, requirename, "requirename") verifyStructure(verbose, packages, requireversion, "requireversion") verifyStructure(verbose, packages, sha1header, "install_sha1header", 0) verifyStructure(verbose, packages, sigmd5, "install_md5", 0) verifyStructure(verbose, packages, triggername, "triggername") arch_hash = setMachineDistance(arch) checkdupes = {} # Find out 'arch', 'releasever' and set 'checkdupes'. for pkg in packages.values(): if dbpath != "/var/lib/rpm" and pkg["name"] in ("kernel", "kernel-smp"): if arch_hash.get(pkg["arch"], 999) == 999: arch = pkg["arch"] arch_hash = setMachineDistance(arch) print "Change 'arch' setting to be:", arch if not releasever and pkg["name"] in distroverpkg: releasever = pkg["version"] if pkg["name"] not in installonlypkgs: checkdupes.setdefault("%s.%s" % (pkg["name"], pkg["arch"]), []).append(pkg) # Check 'arch' and dupes: for pkg in packages.values(): if pkg["name"] != "gpg-pubkey" and \ arch_hash.get(pkg["arch"], 999) == 999: print "Warning: did not expect package with this arch: %s" % \ pkg.getFilename() if pkg["arch"] != "noarch" and \ checkdupes.has_key("%s.noarch" % pkg["name"]): print "Warning: noarch and arch-dependent package installed:", \ pkg.getFilename() for pkg in checkdupes.keys(): if len(checkdupes[pkg]) > 1: print "Warning: more than one package installed for %s." % pkg # Read in repositories to compare packages: if verbose > 2: time3 = time.clock() # Only very little information is taken from "repos", so we could # really only keep minimal info from the repos: filename, nevra, # rpm:header-range:end. repos = readRepos(releasever, configfiles, arch, buildroot, 1, 0, reposdirs, verbose) if repos == None: return 1 if verbose > 2: print "Needed", time.clock() - time3, "seconds to read the repos." for tid in packages.keys(): pkg = packages[tid] if pkg["name"] == "gpg-pubkey": continue # Check if we could write the rpmdb data again. region = "immutable" if pkg["rpmversion"][:3] not in ("4.0", "3.0", "2.2"): install_keys["archivesize"] = 1 if pkg["immutable1"] != None: region = "immutable1" install_keys["providename"] = 1 install_keys["provideflags"] = 1 install_keys["provideversion"] = 1 install_keys["dirindexes"] = 1 install_keys["dirnames"] = 1 install_keys["basenames"] = 1 (indexNo, storeSize, fmt, fmt2) = writeHeader(pkg.hdr.hash, rpmdbtag, region, {}, 1, pkg.rpmgroup) if pkg["rpmversion"][:3] not in ("4.0", "3.0", "2.2"): del install_keys["archivesize"] if pkg["immutable1"] != None: del install_keys["providename"] del install_keys["provideflags"] del install_keys["provideversion"] del install_keys["dirindexes"] del install_keys["dirnames"] del install_keys["basenames"] lead = pack("!2I", indexNo, storeSize) data = "".join([lead, fmt, fmt2]) if len(data) % 4 != 0: print "rpmdb header is not aligned to 4" if data != pkgdata[tid]: print "writeHeader() would not write the same rpmdb data for", \ pkg["name"], "(rpm-%s)" % pkg["rpmversion"] if verbose > 2: # This should be some more generic diff routine for headers. if fmt != pkg.hdrdata[3]: print "wrong fmt" if fmt2 != pkg.hdrdata[4]: print "wrong fmt2", len(fmt2), len(pkg.hdrdata[4]) for i in xrange(0, indexNo * 16, 16): (tag1, ttype1, offset1, count1) = unpack("!4I", fmt[i:i + 16]) (tag2, ttype2, offset2, count2) = unpack("!4I", pkg.hdrdata[3][i:i + 16]) if tag1 != tag2 or ttype1 != ttype2 or count1 != count2: print "tag:", tag1, tag2, i if offset1 != offset2: print "offset:", offset1, offset2, "tag=", tag1 # Try to just copy the immutable region to verify the sha1. immutable = pkg.getImmutableRegion() if immutable: (indexNo, storeSize, fmt, fmt2) = immutable else: # If we cannot use the immutable region, try to write our own # header again. pkg.sig = HdrIndex() if pkg["archivesize"] != None: pkg.sig["payloadsize"] = pkg["archivesize"] if pkg["rpmversion"][:3] not in ("4.0", "3.0", "2.2"): del pkg["archivesize"] (indexNo, storeSize, fmt, fmt2) = writeHeader(pkg.hdr.hash, rpmdbtag, region, install_keys, 0, pkg.rpmgroup) found = 0 nevra = pkg.getNEVRA0() for r in repos: if r.pkglist.has_key(nevra): repopkg = r.pkglist[nevra] headerend = None if repopkg["rpm:header-range:end"]: headerend = repopkg["rpm:header-range:end"] + 1 rpm = ReadRpm(repopkg.filename) if rpm.readHeader(rpmsigtag, rpmtag, 1, headerend=headerend): print "Cannot read %s.\n" % repopkg.filename continue rpm.closeFd() if rpm.hdrdata[3] != fmt or rpm.hdrdata[4] != fmt2: print "Rpm %s in repo does not match." % repopkg.filename continue found = 1 # Use the rpm header to write again a rpmdb entry and compare # that again to the currently existing rpmdb header. # We should try to write some of these ourselves: for s in ("installtime", "filestates", "instprefixes", "installcolor", "installtid"): if pkg[s] != None: rpm[s] = pkg[s] #rpm["installcolor"] = (getInstallColor(arch),) region = "immutable" if rpm["immutable1"]: region = "immutable1" rpm.genRpmdbHeader() (indexNoa, storeSizea, fmta, fmta2) = writeHeader(rpm.hdr.hash, rpmdbtag, region, install_keys, 0, rpm.rpmgroup) if fmt != fmta or fmt2 != fmta2: print "Could not write a new rpmdb for %s." % repopkg.filename continue break if found == 0 and configfiles: print "Warning: package not found in the repositories:", nevra # Verify the sha1 crc of the normal header data. (Signature # data does not have an extra crc.) sha1header = pkg["install_sha1header"] if sha1header == None: if verbose: print "Warning: package", pkg.getFilename(), \ "does not have a sha1 checksum." continue lead = pack("!8s2I", "\x8e\xad\xe8\x01\x00\x00\x00\x00", indexNo, storeSize) ctx = sha.new() ctx.update(lead) ctx.update(fmt) ctx.update(fmt2) if ctx.hexdigest() != sha1header: print pkg.getFilename(), \ "bad sha1: %s / %s" % (sha1header, ctx.hexdigest()) checkDeps(packages.values(), checkfileconflicts, 0) if verbose: if verbose > 2: time2 = time.clock() print "Needed", time2 - time1, "seconds to check the rpmdb data." print "Done with checkrpmdb." return None
427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 54, 84, 27574, 12, 1966, 803, 16, 27450, 502, 10657, 16, 3992, 502, 16, 642, 2354, 16, 1361, 3085, 16, 6637, 16, 3988, 16, 866, 768, 20340, 87, 16, 13686, 8291, 4672, 628, 28222, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 855, 54, 84, 27574, 12, 1966, 803, 16, 27450, 502, 10657, 16, 3992, 502, 16, 642, 2354, 16, 1361, 3085, 16, 6637, 16, 3988, 16, 866, 768, 20340, 87, 16, 13686, 8291, 4672, 628, 28222, ...
Actor.notify.debug("couldn't find anim: %s" % (animName))
assert Actor.notify.debug("couldn't find anim: %s" % (animName)) pass
def getAnimControls(self, animName=None, partName=None, lodName=None): """getAnimControls(self, string, string=None, string=None)
26a50769af9e847ffa019fc86f4e02f8fdb8466a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/26a50769af9e847ffa019fc86f4e02f8fdb8466a/Actor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 20892, 16795, 12, 2890, 16, 10536, 461, 33, 7036, 16, 1087, 461, 33, 7036, 16, 328, 369, 461, 33, 7036, 4672, 3536, 588, 20892, 16795, 12, 2890, 16, 533, 16, 533, 33, 7036, 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, 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, 20892, 16795, 12, 2890, 16, 10536, 461, 33, 7036, 16, 1087, 461, 33, 7036, 16, 328, 369, 461, 33, 7036, 4672, 3536, 588, 20892, 16795, 12, 2890, 16, 533, 16, 533, 33, 7036, 16, ...
test_capi1()
def test_capi1(): try: _testcapi.raise_exception(BadException, 1) except TypeError, err: exc, err, tb = sys.exc_info() co = tb.tb_frame.f_code assert co.co_name == "test_capi1" assert co.co_filename.endswith('test_exceptions.py') else: print "Expected exception"
32d377df1e9ddad95fbcd3226ba9db9047b3da91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/32d377df1e9ddad95fbcd3226ba9db9047b3da91/test_exceptions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 71, 2425, 21, 13332, 775, 30, 389, 3813, 71, 2425, 18, 11628, 67, 4064, 12, 6434, 503, 16, 404, 13, 1335, 3580, 16, 393, 30, 3533, 16, 393, 16, 8739, 273, 2589, 18, 10075, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 71, 2425, 21, 13332, 775, 30, 389, 3813, 71, 2425, 18, 11628, 67, 4064, 12, 6434, 503, 16, 404, 13, 1335, 3580, 16, 393, 30, 3533, 16, 393, 16, 8739, 273, 2589, 18, 10075, ...
class C(metaclass=ABCMeta):
class C: __metaclass__ = ABCMeta
def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. The abstract methods can be called using any of the the normal 'super' call mechanisms. Usage: class C(metaclass=ABCMeta): @abstractmethod def my_abstract_method(self, ...): ... """ funcobj.__isabstractmethod__ = True return funcobj
2e72eba2dfd7b1ea13acad90c47ad255949fd5fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/2e72eba2dfd7b1ea13acad90c47ad255949fd5fd/abc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8770, 2039, 12, 644, 2603, 4672, 3536, 37, 7367, 11193, 8770, 2590, 18, 225, 16412, 716, 326, 2191, 1106, 353, 29253, 2781, 578, 10379, 628, 518, 18, 225, 432, 667, 716, 711, 279, 2191, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8770, 2039, 12, 644, 2603, 4672, 3536, 37, 7367, 11193, 8770, 2590, 18, 225, 16412, 716, 326, 2191, 1106, 353, 29253, 2781, 578, 10379, 628, 518, 18, 225, 432, 667, 716, 711, 279, 2191, ...
def request(self, host, handler, request_body):
verbose = 0 def request(self, host, handler, request_body, verbose=0):
def __call__(self, *args): return self.__send(self.__name, args)
80ead46c3b0b9513bc116e8fe08faa2f91145a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/80ead46c3b0b9513bc116e8fe08faa2f91145a91/xmlrpclib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 380, 1968, 4672, 327, 365, 16186, 4661, 12, 2890, 16186, 529, 16, 833, 13, 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, 1001, 1991, 972, 12, 2890, 16, 380, 1968, 4672, 327, 365, 16186, 4661, 12, 2890, 16186, 529, 16, 833, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
('initenv <projectname> <repospath> <templatepath>',
('initenv <projectname> <db> <repospath> <templatepath>',
def _do_permission_remove(self, user, action): sql = "DELETE FROM permission" clauses = [] if action != '*': clauses.append("action='%s'" % action) if user != '*': clauses.append("username='%s'" % user) if clauses: sql += " WHERE " + " AND ".join(clauses) self.db_update(sql)
b9693b58296a549325f564cfbe9f19994f359aeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/b9693b58296a549325f564cfbe9f19994f359aeb/admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 9827, 67, 4479, 12, 2890, 16, 729, 16, 1301, 4672, 1847, 273, 315, 6460, 4571, 4132, 6, 14093, 273, 5378, 309, 1301, 480, 5306, 30, 14093, 18, 6923, 2932, 1128, 28713, 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, 389, 2896, 67, 9827, 67, 4479, 12, 2890, 16, 729, 16, 1301, 4672, 1847, 273, 315, 6460, 4571, 4132, 6, 14093, 273, 5378, 309, 1301, 480, 5306, 30, 14093, 18, 6923, 2932, 1128, 28713, 8...
list, tuple, or vector
list, tuple, or vector.
def frame3d(lower_left, upper_right, **kwds): """ Draw a frame in 3D. Primarily used as a helper function for creating frames for 3D graphics viewing. INPUT: - ``lower_left`` - the lower left corner of the frame, as a list, tuple, or vector - ``upper_right`` - the upper right corner of the frame, as a list, tuple, or vector Type ``line3d.options`` for a dictionary of the default options for lines, which are also available. EXAMPLES: A frame:: sage: from sage.plot.plot3d.shapes2 import frame3d sage: frame3d([1,3,2],vector([2,5,4]),color='red') This is usually used for making an actual plot:: sage: y = var('y') sage: plot3d(sin(x^2+y^2),(x,0,pi),(y,0,pi)) """ x0,y0,z0 = lower_left x1,y1,z1 = upper_right L1 = line3d([(x0,y0,z0), (x0,y1,z0), (x1,y1,z0), (x1,y0,z0), (x0,y0,z0), # top square (x0,y0,z1), (x0,y1,z1), (x1,y1,z1), (x1,y0,z1), (x0,y0,z1)], # bottom square **kwds) # 3 additional lines joining top to bottom v2 = line3d([(x0,y1,z0), (x0,y1,z1)], **kwds) v3 = line3d([(x1,y0,z0), (x1,y0,z1)], **kwds) v4 = line3d([(x1,y1,z0), (x1,y1,z1)], **kwds) F = L1 + v2 + v3 + v4 F._set_extra_kwds(kwds) return F
ac565fa7b2ba6c3b1ae16697410547f7b11f5dcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ac565fa7b2ba6c3b1ae16697410547f7b11f5dcf/shapes2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2623, 23, 72, 12, 8167, 67, 4482, 16, 3854, 67, 4083, 16, 2826, 25577, 4672, 3536, 10184, 279, 2623, 316, 890, 40, 18, 225, 2301, 381, 10243, 1399, 487, 279, 4222, 445, 364, 4979, 7793...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2623, 23, 72, 12, 8167, 67, 4482, 16, 3854, 67, 4083, 16, 2826, 25577, 4672, 3536, 10184, 279, 2623, 316, 890, 40, 18, 225, 2301, 381, 10243, 1399, 487, 279, 4222, 445, 364, 4979, 7793...
if regrtest.uselibfile or pypy_option.uselibfile:
if regrtest.uselibfile:
def getinvocation(self, regrtest): fspath = regrtest.getfspath() python = sys.executable pypy_script = pypydir.join('interpreter', 'py.py') alarm_script = pypydir.join('tool', 'alarm.py') regr_script = pypydir.join('tool', 'pytest', 'regrverbose.py') pypy_options = [] if regrtest.oldstyle or pypy_option.oldstyle: pypy_options.append('--oldstyle') if regrtest.uselibfile or pypy_option.uselibfile: pypy_options.append('--file') sopt = " ".join(pypy_options)
c59cd873c4c7fc192fb0abeb5e6245a3dba172d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/c59cd873c4c7fc192fb0abeb5e6245a3dba172d7/conftest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5768, 4431, 12, 2890, 16, 960, 3797, 395, 4672, 2662, 803, 273, 960, 3797, 395, 18, 588, 2556, 803, 1435, 5790, 273, 2589, 18, 17751, 18951, 93, 67, 4263, 273, 18951, 93, 1214, 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, 336, 5768, 4431, 12, 2890, 16, 960, 3797, 395, 4672, 2662, 803, 273, 960, 3797, 395, 18, 588, 2556, 803, 1435, 5790, 273, 2589, 18, 17751, 18951, 93, 67, 4263, 273, 18951, 93, 1214, 18...
font1 = font.nametofont("system") font2 = font.nametofont("system")
font1 = font.nametofont("TkDefaultFont") font2 = font.nametofont("TkDefaultFont")
def test_font_eq(self): font1 = font.nametofont("system") font2 = font.nametofont("system") self.assertIsNot(font1, font2) self.assertEqual(font1, font2) self.assertNotEqual(font1, font1.copy()) self.assertNotEqual(font1, 0)
070a608893576761c817346c01cb58c01d0a11eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/070a608893576761c817346c01cb58c01d0a11eb/test_font.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5776, 67, 11253, 12, 2890, 4672, 3512, 21, 273, 3512, 18, 17808, 278, 792, 1580, 2932, 56, 79, 1868, 5711, 7923, 3512, 22, 273, 3512, 18, 17808, 278, 792, 1580, 2932, 56, 79,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 5776, 67, 11253, 12, 2890, 4672, 3512, 21, 273, 3512, 18, 17808, 278, 792, 1580, 2932, 56, 79, 1868, 5711, 7923, 3512, 22, 273, 3512, 18, 17808, 278, 792, 1580, 2932, 56, 79,...
_fl_remove_fselector_appbutton = library.cfuncproto(
_fl_remove_fselector_appbutton = library.cfuncproto(
def fl_remove_fselector_appbutton(label): """Removes an application specific button from file selector. @param label: text of label @type label: str @example: fl_remoe_selector_appbutton("SomeButton") @status: Tested + Doc + NoDemo = OK """ _fl_remove_fselector_appbutton = library.cfuncproto( library.load_so_libforms(), "fl_remove_fselector_appbutton", None, [xfdata.STRING], """void fl_remove_fselector_appbutton(const char * p1)""") library.check_if_initialized() slabel = library.convert_to_string(label) library.keep_elem_refs(label, slabel) _fl_remove_fselector_appbutton(slabel)
7c584100a53e93efc0c612d27bbb65cabcf92aa6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2429/7c584100a53e93efc0c612d27bbb65cabcf92aa6/flgoodies.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 4479, 67, 74, 9663, 67, 2910, 5391, 12, 1925, 4672, 3536, 6220, 392, 2521, 2923, 3568, 628, 585, 3451, 18, 225, 632, 891, 1433, 30, 977, 434, 1433, 632, 723, 1433, 30, 609, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4479, 67, 74, 9663, 67, 2910, 5391, 12, 1925, 4672, 3536, 6220, 392, 2521, 2923, 3568, 628, 585, 3451, 18, 225, 632, 891, 1433, 30, 977, 434, 1433, 632, 723, 1433, 30, 609, ...
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def test_instance(): class A: pass a = A() a.a = a gc.collect() del a assert gc.collect() > 0
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1336, 13332, 667, 432, 30, 1342, 279, 273, 432, 1435, 279, 18, 69, 273, 279, 8859, 18, 14676, 1435, 1464, 279, 309, 8859, 18, 14676, 1435, 422, 374, 30, 1002, 7766, 2925, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1336, 13332, 667, 432, 30, 1342, 279, 273, 432, 1435, 279, 18, 69, 273, 279, 8859, 18, 14676, 1435, 1464, 279, 309, 8859, 18, 14676, 1435, 422, 374, 30, 1002, 7766, 2925, 225...
def writeCollectionItems(self, output): CollectionDTC.writeCollectionItems(self, output)
def writeCollectionItems(self, output, stripFrmId=''): CollectionDTC.writeCollectionItems(self, output, stripFrmId)
def writeCollectionItems(self, output): CollectionDTC.writeCollectionItems(self, output) warn = 0 for constr in self.textConstrLst: if constr.params['pPage'] == 'None': wxLogWarning('No control for %s, page %s'%( self.parentCompanion.name, constr.params['strText'])) warn = 1 if warn: wxLogWarning('The red-dashed area of a wxNotebook page must contain\n'\ 'a control or the generated source will be invalid outside the Designer')
cff9a3b23ca95402e5a55c5ae3ae6ec3fa22aa7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/cff9a3b23ca95402e5a55c5ae3ae6ec3fa22aa7f/Companions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 2532, 3126, 12, 2890, 16, 876, 16, 2569, 7167, 81, 548, 2218, 11, 4672, 2200, 9081, 39, 18, 2626, 2532, 3126, 12, 2890, 16, 876, 16, 2569, 7167, 81, 548, 13, 1894, 273, 374, 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, 1045, 2532, 3126, 12, 2890, 16, 876, 16, 2569, 7167, 81, 548, 2218, 11, 4672, 2200, 9081, 39, 18, 2626, 2532, 3126, 12, 2890, 16, 876, 16, 2569, 7167, 81, 548, 13, 1894, 273, 374, 36...
self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']])
self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], trans_obj['lang'], [trans_obj['res_id']])
def write(self, cursor, user, ids, vals, context=None): if not context: context = {} result = super(ir_translation, self).write(cursor, user, ids, vals, context=context) for trans_obj in self.read(cursor, user, ids, ['name','type','res_id','src','lang'], context=context): self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], trans_obj['lang'], source=trans_obj['src']) self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) return result
d67b6eccda0e5e7089cacd9a87e96452e1742151 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d67b6eccda0e5e7089cacd9a87e96452e1742151/ir_translation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 3347, 16, 729, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 273, 2618, 563, 273, 2240, 12, 481, 67, 10173, 16, 365, 2934, 2626, 12, 9216, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 12, 2890, 16, 3347, 16, 729, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 273, 2618, 563, 273, 2240, 12, 481, 67, 10173, 16, 365, 2934, 2626, 12, 9216, ...
return string_to_actioncode(self.config.get(self.section,'virusaction'))
virusaction=self.config.get(self.section,'virusaction') actioncode=string_to_actioncode(virusaction,self.config) return actioncode
def examine(self,suspect): starttime=time.time() if suspect.size>self.maxsize: self._logger().info('Not scanning - message too big') return content=suspect.getMessageRep().as_string()
50278795349bf7cd7e8bd9c1b278f201cd16f912 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10919/50278795349bf7cd7e8bd9c1b278f201cd16f912/clamav.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19707, 558, 12, 2890, 16, 87, 407, 1181, 4672, 23437, 33, 957, 18, 957, 1435, 225, 309, 11375, 1181, 18, 1467, 34, 2890, 18, 1896, 1467, 30, 365, 6315, 4901, 7675, 1376, 2668, 1248, 21...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19707, 558, 12, 2890, 16, 87, 407, 1181, 4672, 23437, 33, 957, 18, 957, 1435, 225, 309, 11375, 1181, 18, 1467, 34, 2890, 18, 1896, 1467, 30, 365, 6315, 4901, 7675, 1376, 2668, 1248, 21...
bins = arange(min(missedVal),max(missedVal), step )
bins = arange(min(missedVal),max(missedVal)+step, step ) plotbins = bins[0:-1] + step/2.
def efficiencyplot(found, missed, col_name, ifo=None, plot_type = 'linear', \ nbins = 40, output_name = None, plotsym = 'k-', plot_name = '', \ title_string = '', errors = False): """ function to plot the difference if col_name_a in two tables against the value of col_name_b in table1. @param found: metaDataTable containing found injections @param missed: metaDataTable containing missed injections @param col_name: name of column used to plot efficiency @param ifo: name of ifo (default = None), used in extracting information (e.g. which eff_dist) @param plot_type: either 'linear' or 'log' plot on x-axis @param plotsym: the symbol to use when plotting, default = 'k-' @param plot_name: name of the plot (for the legend) @param title_string: extra info for title @param errors: plot errorbars on the efficiencies (using binomial errors) default = False """ if not ifo and ("ifo" in found.validcolumns.keys()): ifo = found[0].ifo foundVal = readcol(found,col_name, ifo) missedVal = readcol(missed,col_name, ifo) if len(foundVal) or len(missedVal): # we have found or missed injections so we can generate the plot if plot_type == 'log': foundVal = log10(foundVal) missedVal = log10(missedVal) if len(foundVal): step = (max(foundVal) - min(foundVal)) /nbins bins = arange(min(foundVal),max(foundVal), step ) if step == 0: bins = array([foundVal[0]/2.0, foundVal[0], foundVal[0] * 3.0/2.0]) else: step = (max(missedVal) - min(missedVal)) /nbins bins = arange(min(missedVal),max(missedVal), step ) if step == 0: bins = array([missedVal[0]/2.0, missedVal[0], missedVal[0] * 3.0/2.0]) fig_num = gcf().number figure(100) [num_found,binsf,stuff] = hist(foundVal, bins) [num_missed,binsm,stuff] = hist(missedVal ,bins) close(100) figure(fig_num) num_found = array(num_found,'d') eff = num_found / (num_found + num_missed) error = sqrt( num_found * num_missed / (num_found + num_missed)**3 ) error = array(error) if plot_type == 'log': bins = 10**bins if plot_name: semilogx(bins, eff, plotsym,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth=2, label = plot_name) else: semilogx(bins, eff, plotsym,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth=2) if errors: errorbar(bins, eff, error,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth = 2, label = plot_name, \ fmt = plotsym) else: if errors: errorbar(bins, eff, error, fmt = plotsym, markersize=12,\ markerfacecolor='None',\ markeredgewidth=1, linewidth=1, label = plot_name) else: plot(bins, eff, plotsym,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth=1, label = plot_name) xlabel(col_name.replace("_"," "), size='x-large') ylabel('Efficiency', size='x-large') ylim(0,1.1) else: # no found or missed injections figtext(0,0,'No found or missed injections',fontsize=32) if ifo: title_string += ' ' + ifo title_string += ' ' + col_name.replace("_"," ") title_string += ' efficiency plot' title(title_string, size='x-large') grid(True) if output_name: if ifo: output_name += '_' + ifo output_name += '_' + col_name + '_eff.png' savefig(output_name)
c9b61fdc32295bdb8be1140c1b8359958473b6f4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/c9b61fdc32295bdb8be1140c1b8359958473b6f4/viz.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30325, 4032, 12, 7015, 16, 25143, 16, 645, 67, 529, 16, 21479, 33, 7036, 16, 3207, 67, 723, 273, 296, 12379, 2187, 521, 4264, 2679, 273, 8063, 16, 876, 67, 529, 273, 599, 16, 3207, 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, 30325, 4032, 12, 7015, 16, 25143, 16, 645, 67, 529, 16, 21479, 33, 7036, 16, 3207, 67, 723, 273, 296, 12379, 2187, 521, 4264, 2679, 273, 8063, 16, 876, 67, 529, 273, 599, 16, 3207, 8...
if self.parser.openElements[-1] == name:
if self.parser.openElements[-1].name == name:
def endTagTitleStyleScript(self, name): if self.parser.openElements[-1] == name: self.parser.openElements.pop() else: self.parser.parseError()
aef8e8816e937784b3d533d7714a0db19c756bcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/aef8e8816e937784b3d533d7714a0db19c756bcd/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 4247, 2885, 3651, 12, 2890, 16, 508, 4672, 309, 365, 18, 4288, 18, 3190, 3471, 18919, 21, 8009, 529, 422, 508, 30, 365, 18, 4288, 18, 3190, 3471, 18, 5120, 1435, 469, 30, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 4247, 2885, 3651, 12, 2890, 16, 508, 4672, 309, 365, 18, 4288, 18, 3190, 3471, 18919, 21, 8009, 529, 422, 508, 30, 365, 18, 4288, 18, 3190, 3471, 18, 5120, 1435, 469, 30, 365, ...
test_support.unlink(test_support.TESTFN)
def setUp(self): """Setup of a temp file to use for testing""" self.text = "test_urllib: %s\n" % self.__class__.__name__ test_support.unlink(test_support.TESTFN) FILE = file(test_support.TESTFN, 'wb') try: FILE.write(self.text) finally: FILE.close() self.pathname = test_support.TESTFN self.returned_obj = urllib.urlopen("file:%s" % self.pathname)
065633d95eb5cc43ee61fb41e230143f2be730e5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/065633d95eb5cc43ee61fb41e230143f2be730e5/test_urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 3536, 7365, 434, 279, 1906, 585, 358, 999, 364, 7769, 8395, 365, 18, 955, 273, 315, 3813, 67, 718, 2941, 30, 738, 87, 64, 82, 6, 738, 365, 16186, 1106, 972, 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, 24292, 12, 2890, 4672, 3536, 7365, 434, 279, 1906, 585, 358, 999, 364, 7769, 8395, 365, 18, 955, 273, 315, 3813, 67, 718, 2941, 30, 738, 87, 64, 82, 6, 738, 365, 16186, 1106, 972, 16...
self.stream.flush()
if self.stream: self.stream.flush()
def flush(self): """ Flushes the stream. """ self.stream.flush()
d00f51d3eb4b2b1e24f85499b017bd1975f762fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/d00f51d3eb4b2b1e24f85499b017bd1975f762fb/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 3536, 11624, 281, 326, 1407, 18, 3536, 365, 18, 3256, 18, 11330, 1435, 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, ...
[ 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 3536, 11624, 281, 326, 1407, 18, 3536, 365, 18, 3256, 18, 11330, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...