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 |
|---|---|---|---|---|---|---|
if len(status.get_payload()) < 2: print '! Not a valid bounce (expected at least 2 parts, found %d).' % len(status) | num_payloads = len(status.get_payload()) if num_payloads < 2: print '! Not a valid bounce (expected at least 2 parts, found %d).' % num_payloads | def findAddressInBounce(bounce): """Finds the faulty email address in a bounced email. See RFC 1894 for more information. Returns None or the email address.""" # Check that it is a bounce - a few MTA fail to set this correctly :( if bounce.get_content_type() != 'multipart/report': print '! Not a valid bounce (expected multipart/report, found %s).' % bounce.get_content_type() return None # Extract the second component of the multipart/report if len(bounce.get_payload()) < 2: print '! Not a valid bounce (expected at least 2 parts, found %d).' % len(bounce) return None status = bounce.get_payload(1) if status.get_content_type() != 'message/delivery-status': print '! Not a valid bounce (expected message/delivery-status, found %s).' % bounce.get_content_type() return None # The per-message-fields don't matter here, get only the per-recipient-fields if len(status.get_payload()) < 2: print '! Not a valid bounce (expected at least 2 parts, found %d).' % len(status) return None content = status.get_payload(1) if content.get_content_type() != 'text/plain': print '! Not a valid bounce (expected text/plain, found %s).' % bounce.get_content_type return None # Extract the faulty email address recipient_match = _recipient_re.search(content['Final-Recipient']) if recipient_match is None: print '! Missing final recipient.' return None email = recipient_match.group(1) # Check the action field if content['Action'] != 'failed': print '! Not a failed action (%s).' % content['Action'] return None # Mail forwarding loops, DNS errors and connection timeouts cause X-Postfix errors # Otherwise, the first sub-field should indicate a permanent failure postfix_error = content['Diagnostic-Code'] is not None \ and content['Diagnostic-Code'].startswith('X-Postfix') if not postfix_error and int(content['Status'][:1]) != 5: print '! Not a permanent failure status (%s).' % content['Status'] return None return email | aa6c6ed4cb8d69f8f552a4f3641ae5f8627933f3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5724/aa6c6ed4cb8d69f8f552a4f3641ae5f8627933f3/newsletter.bounces.processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
1887,
382,
38,
8386,
12,
70,
8386,
4672,
3536,
8947,
326,
12530,
93,
2699,
1758,
316,
279,
324,
27373,
2699,
18,
225,
2164,
8372,
6549,
11290,
364,
1898,
1779,
18,
2860,
599,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
1887,
382,
38,
8386,
12,
70,
8386,
4672,
3536,
8947,
326,
12530,
93,
2699,
1758,
316,
279,
324,
27373,
2699,
18,
225,
2164,
8372,
6549,
11290,
364,
1898,
1779,
18,
2860,
599,
578,
... |
line_to_appear = "%s%s %s %s"%elements | line_to_appear = "%s%s= %s %s"%elements | def format_string(object, ind, log, scope=False, allowed_line_lenght=80): name = str(object.name).strip() help = str(object.help).strip() if(scope): if(len(" "*ind+name) >= allowed_line_lenght): raise Sorry( "Cannot create doc file: scope is too deep or its name is too long.") fmt = "%s<b>%s</b> <b><FONT color=blue>%s</FONT></b>" elements = (" "*ind, name, help) line = fmt % elements line_to_appear = "%s%s %s"%elements if(len(line_to_appear) <= allowed_line_lenght): print >> log, line else: help_start = len(" "*ind+name)+1 help_offset = " "*help_start n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] while True: if(n_cut is None): break n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] else: values = (" ".join([str(i) for i in object.words])).strip() if(len(" "*ind+name) >= allowed_line_lenght): raise Sorry( "Cannot create doc file: scope is too deep or its name is too long.") elements = (" "*ind, name, values, help) fmt = "%s%s= <FONT color=CC0000>%s</FONT> <FONT color=blue>%s</FONT>" line = fmt % elements line_length = len(" "*ind+str(object.name)+str(object.help)+values) line_to_appear = "%s%s %s %s"%elements if(len(line_to_appear) <= allowed_line_lenght): print >> log, line else: help_start = len(" "*ind+name)+2 help_offset = " "*help_start n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] while True: if(n_cut is None): break n_cut = partial_line(line, allowed_line_lenght) print >> log, line[:n_cut] line = help_offset+line[n_cut:] | fe5344ca05b9020a2b9a31e2e21730727a2a37ab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/fe5344ca05b9020a2b9a31e2e21730727a2a37ab/as_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1080,
12,
1612,
16,
1547,
16,
613,
16,
2146,
33,
8381,
16,
2935,
67,
1369,
67,
1897,
75,
647,
33,
3672,
4672,
508,
273,
609,
12,
1612,
18,
529,
2934,
6406,
1435,
2809,
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,
740,
67,
1080,
12,
1612,
16,
1547,
16,
613,
16,
2146,
33,
8381,
16,
2935,
67,
1369,
67,
1897,
75,
647,
33,
3672,
4672,
508,
273,
609,
12,
1612,
18,
529,
2934,
6406,
1435,
2809,
273,
... |
libs.append(lib_prefix + 'tk'+ version) libs.append(lib_prefix + 'tcl'+ version) | libs.append('tk'+ version) libs.append('tcl'+ version) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | e0d4b5ad0098344c6e6ed4702755a1a5af537137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e0d4b5ad0098344c6e6ed4702755a1a5af537137/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
16099,
2761,
12,
2890,
16,
7290,
67,
8291,
16,
2561,
67,
8291,
4672,
468,
1021,
389,
16099,
2761,
1605,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
16099,
2761,
12,
2890,
16,
7290,
67,
8291,
16,
2561,
67,
8291,
4672,
468,
1021,
389,
16099,
2761,
1605,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise nodes.SkipNode | raise nodes.SkipNode | def visit_date(self, node): # TODO: include date in {doctype}info/date raise nodes.SkipNode | 81818dd428bfab36de0c7775dcdb742978a01329 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/81818dd428bfab36de0c7775dcdb742978a01329/docbook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
712,
12,
2890,
16,
756,
4672,
468,
2660,
30,
2341,
1509,
316,
288,
2896,
12387,
97,
1376,
19,
712,
1002,
2199,
18,
6368,
907,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
712,
12,
2890,
16,
756,
4672,
468,
2660,
30,
2341,
1509,
316,
288,
2896,
12387,
97,
1376,
19,
712,
1002,
2199,
18,
6368,
907,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
log.log(8,'audit',__('Trying next layout.')) | log.log(8,'audit',_('Trying next layout.')) | def nextLayout(self): "Return the next valid layout" | 93ee3f9539e14683ecbaefc8fb8d5483c91ccd22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5464/93ee3f9539e14683ecbaefc8fb8d5483c91ccd22/XiboClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
3744,
12,
2890,
4672,
315,
990,
326,
1024,
923,
3511,
6,
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,
1024,
3744,
12,
2890,
4672,
315,
990,
326,
1024,
923,
3511,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ns3.WifiHelper.EnablePcap("mixed-wireless", backboneDevices) | ns3.YansWifiPhyHelper.EnablePcap("mixed-wireless", backboneDevices) | def main(argv): # # First, we declare and initialize a few local variables that control some # simulation parameters. # backboneNodes = 10 infraNodes = 5 lanNodes = 5 stopTime = 10 # # Simulation defaults are typically set next, before command line # arguments are parsed. # ns3.Config.SetDefault("ns3::OnOffApplication::PacketSize", ns3.StringValue("210")) ns3.Config.SetDefault("ns3::OnOffApplication::DataRate", ns3.StringValue("448kb/s")) # # For convenience, we add the local variables to the command line argument # system so that they can be overridden with flags such as # "--backboneNodes=20" # cmd = ns3.CommandLine() #cmd.AddValue("backboneNodes", "number of backbone nodes", backboneNodes) #cmd.AddValue("infraNodes", "number of leaf nodes", infraNodes) #cmd.AddValue("lanNodes", "number of LAN nodes", lanNodes) #cmd.AddValue("stopTime", "simulation stop time(seconds)", stopTime) # # The system global variables and the local values added to the argument # system can be overridden by command line arguments by using this call. # cmd.Parse(argv) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # # Construct the backbone # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # Create a container to manage the nodes of the adhoc(backbone) network. # Later we'll create the rest of the nodes we'll need. # backbone = ns3.NodeContainer() backbone.Create(backboneNodes) # # Create the backbone wifi net devices and install them into the nodes in # our container # wifi = ns3.WifiHelper() wifi.SetMac("ns3::AdhocWifiMac") wifi.SetPhy("ns3::WifiPhy") backboneDevices = wifi.Install(backbone) # # Add the IPv4 protocol stack to the nodes in our container # internet = ns3.InternetStackHelper() internet.Install(backbone) # # Assign IPv4 addresses to the device drivers(actually to the associated # IPv4 interfaces) we just created. # ipAddrs = ns3.Ipv4AddressHelper() ipAddrs.SetBase(ns3.Ipv4Address("192.168.0.0"), ns3.Ipv4Mask("255.255.255.0")) ipAddrs.Assign(backboneDevices) # # The ad-hoc network nodes need a mobility model so we aggregate one to # each of the nodes we just finished building. # mobility = ns3.MobilityHelper() positionAlloc = ns3.ListPositionAllocator() x = 0.0 for i in range(backboneNodes): positionAlloc.Add(ns3.Vector(x, 0.0, 0.0)) x += 5.0 mobility.SetPositionAllocator(positionAlloc) mobility.SetMobilityModel("ns3::RandomDirection2dMobilityModel", "Bounds", ns3.RectangleValue(ns3.Rectangle(0, 1000, 0, 1000)), "Speed", ns3.RandomVariableValue(ns3.ConstantVariable(2000)), "Pause", ns3.RandomVariableValue(ns3.ConstantVariable(0.2))) mobility.Install(backbone) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # # Construct the LANs # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # Reset the address base-- all of the CSMA networks will be in # the "172.16 address space ipAddrs.SetBase(ns3.Ipv4Address("172.16.0.0"), ns3.Ipv4Mask("255.255.255.0")) for i in range(backboneNodes): print "Configuring local area network for backbone node ", i # # Create a container to manage the nodes of the LAN. We need # two containers here; one with all of the new nodes, and one # with all of the nodes including new and existing nodes # newLanNodes = ns3.NodeContainer() newLanNodes.Create(lanNodes - 1) # Now, create the container with all nodes on this link lan = ns3.NodeContainer(ns3.NodeContainer(backbone.Get(i)), newLanNodes) # # Create the CSMA net devices and install them into the nodes in our # collection. # csma = ns3.CsmaHelper() csma.SetChannelAttribute("DataRate", ns3.DataRateValue(ns3.DataRate(5000000))) csma.SetChannelAttribute("Delay", ns3.TimeValue(ns3.MilliSeconds(2))) lanDevices = csma.Install(lan) # # Add the IPv4 protocol stack to the new LAN nodes # internet.Install(newLanNodes) # # Assign IPv4 addresses to the device drivers(actually to the # associated IPv4 interfaces) we just created. # ipAddrs.Assign(lanDevices) # # Assign a new network prefix for the next LAN, according to the # network mask initialized above # ipAddrs.NewNetwork() # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # # Construct the mobile networks # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # Reset the address base-- all of the 802.11 networks will be in # the "10.0" address space ipAddrs.SetBase(ns3.Ipv4Address("10.0.0.0"), ns3.Ipv4Mask("255.255.255.0")) for i in range(backboneNodes): print "Configuring wireless network for backbone node ", i # # Create a container to manage the nodes of the LAN. We need # two containers here; one with all of the new nodes, and one # with all of the nodes including new and existing nodes # newInfraNodes = ns3.NodeContainer() newInfraNodes.Create(infraNodes - 1) # Now, create the container with all nodes on this link infra = ns3.NodeContainer(ns3.NodeContainer(backbone.Get(i)), newInfraNodes) # # Create another ad hoc network and devices # wifiInfra = ns3.WifiHelper() wifiInfra.SetMac("ns3::AdhocWifiMac") wifiInfra.SetPhy("ns3::WifiPhy") infraDevices = wifiInfra.Install(infra) # Add the IPv4 protocol stack to the nodes in our container # internet.Install(newInfraNodes) # # Assign IPv4 addresses to the device drivers(actually to the associated # IPv4 interfaces) we just created. # ipAddrs.Assign(infraDevices) # # Assign a new network prefix for each mobile network, according to # the network mask initialized above # ipAddrs.NewNetwork() # # The new wireless nodes need a mobility model so we aggregate one # to each of the nodes we just finished building. # subnetAlloc = ns3.ListPositionAllocator() for j in range(infra.GetN()): subnetAlloc.Add(ns3.Vector(0.0, j, 0.0)) mobility.PushReferenceMobilityModel(backbone.Get(i)) mobility.SetPositionAllocator(subnetAlloc) mobility.SetMobilityModel("ns3::RandomDirection2dMobilityModel", "Bounds", ns3.RectangleValue(ns3.Rectangle(-25, 25, -25, 25)), "Speed", ns3.RandomVariableValue(ns3.ConstantVariable(30)), "Pause", ns3.RandomVariableValue(ns3.ConstantVariable(0.4))) mobility.Install(infra) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # # Routing configuration # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / print "Enabling OLSR routing on all backbone nodes" olsr = ns3.OlsrHelper() olsr.Install(backbone) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # # Application configuration # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # Create the OnOff application to send UDP datagrams of size # 210 bytes at a rate of 448 Kb/s, between two nodes print "Create Applications." port = 9 # Discard port(RFC 863) # Let's make sure that the user does not define too few LAN nodes # to make this example work. We need lanNodes >= 5 assert (lanNodes >= 5) appSource = ns3.NodeList.GetNode(11) appSink = ns3.NodeList.GetNode(13) remoteAddr = ns3.Ipv4Address("172.16.0.5") onoff = ns3.OnOffHelper("ns3::UdpSocketFactory", ns3.Address(ns3.InetSocketAddress(remoteAddr, port))) onoff.SetAttribute("OnTime", ns3.RandomVariableValue(ns3.ConstantVariable(1))) onoff.SetAttribute("OffTime", ns3.RandomVariableValue(ns3.ConstantVariable(0))) apps = onoff.Install(ns3.NodeContainer(appSource)) apps.Start(ns3.Seconds(3.0)) apps.Stop(ns3.Seconds(20.0)) # Create a packet sink to receive these packets sink = ns3.PacketSinkHelper("ns3::UdpSocketFactory", ns3.InetSocketAddress(ns3.Ipv4Address.GetAny(), port)) apps = sink.Install(ns3.NodeContainer(appSink)) apps.Start(ns3.Seconds(3.0)) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / # # # Tracing configuration # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / print "Configure Tracing." # # Let's set up some ns-2-like ascii traces, using another helper class # #std.ofstream ascii #ascii.open("mixed-wireless.tr") #WifiHelper.EnableAsciiAll(ascii) #CsmaHelper.EnableAsciiAll(ascii) print "(tracing not done for Python)" # Look at nodes 11, 13 only # WifiHelper.EnableAscii(ascii, 11, 0); # WifiHelper.EnableAscii(ascii, 13, 0); # Let's do a pcap trace on the backbone devices ns3.WifiHelper.EnablePcap("mixed-wireless", backboneDevices) # Let's additionally trace the application Sink, ifIndex 0 ns3.CsmaHelper.EnablePcap("mixed-wireless", appSink.GetId(), 0) | 101ff6648fd16cde81e6411fa653e46544298119 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7746/101ff6648fd16cde81e6411fa653e46544298119/mixed-wireless.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
468,
468,
225,
5783,
16,
732,
14196,
471,
4046,
279,
11315,
1191,
3152,
716,
3325,
2690,
468,
225,
14754,
1472,
18,
468,
1473,
19930,
3205,
273,
1728,
8286,
354,
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,
2774,
12,
19485,
4672,
468,
468,
225,
5783,
16,
732,
14196,
471,
4046,
279,
11315,
1191,
3152,
716,
3325,
2690,
468,
225,
14754,
1472,
18,
468,
1473,
19930,
3205,
273,
1728,
8286,
354,
3... |
def fl_freeze_form(form): """ fl_freeze_form(form) | def fl_freeze_form(pForm): """ fl_freeze_form(pForm) | def fl_freeze_form(form): """ fl_freeze_form(form) It does not temporarily redraw the form while changes are being made, so all changes made are instead buffered internally. <form> form not to be re-drawn """ _fl_freeze_form(form) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
29631,
67,
687,
12,
84,
1204,
4672,
3536,
1183,
67,
29631,
67,
687,
12,
84,
1204,
13,
2597,
1552,
486,
18917,
16540,
326,
646,
1323,
3478,
854,
3832,
7165,
16,
1427,
777,
347... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
29631,
67,
687,
12,
84,
1204,
4672,
3536,
1183,
67,
29631,
67,
687,
12,
84,
1204,
13,
2597,
1552,
486,
18917,
16540,
326,
646,
1323,
3478,
854,
3832,
7165,
16,
1427,
777,
347... |
self.append(XY(x, y)) | elem = XY(x, y) if len(self) == 0: self.append(elem) elif self[-1] != elem: self.append(elem) | def add(self, x, y=None): if y is None: self.append(x) else: self.append(XY(x, y)) | 4f7b25db5ed136ca9c31593ee1d7b594af451c48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/81/4f7b25db5ed136ca9c31593ee1d7b594af451c48/DiagramMetrix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
2890,
16,
619,
16,
677,
33,
7036,
4672,
309,
677,
353,
599,
30,
365,
18,
6923,
12,
92,
13,
469,
30,
365,
18,
6923,
12,
8546,
12,
92,
16,
677,
3719,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
12,
2890,
16,
619,
16,
677,
33,
7036,
4672,
309,
677,
353,
599,
30,
365,
18,
6923,
12,
92,
13,
469,
30,
365,
18,
6923,
12,
8546,
12,
92,
16,
677,
3719,
2,
-100,
-100,
-100,
... |
log = open(LOG_FILE, 'w+') print >>log, '\n%s - starting up' % time.asctime(time.localtime()) | log = open(LOG_FILE, 'a+') print >>log, '%s - starting up' % time.asctime(time.localtime()) | def main(): log = open(LOG_FILE, 'w+') #don't care for long logs print >>log, '\n%s - starting up' % time.asctime(time.localtime()) log.flush() while True: rv = subprocess.call([NTPCOMMAND, NTPSERVER], stdout=log, stderr=log) if rv is 0: sys.exit(0) time.sleep(5) | 1c3cc43c3e7bbd0127250946bcbd7709b3519479 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6206/1c3cc43c3e7bbd0127250946bcbd7709b3519479/uptime-check.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
613,
273,
1696,
12,
4842,
67,
3776,
16,
296,
91,
15,
6134,
468,
19752,
1404,
7671,
364,
1525,
5963,
1172,
1671,
1330,
16,
2337,
82,
9,
87,
300,
5023,
731,
11,
738,
813,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
613,
273,
1696,
12,
4842,
67,
3776,
16,
296,
91,
15,
6134,
468,
19752,
1404,
7671,
364,
1525,
5963,
1172,
1671,
1330,
16,
2337,
82,
9,
87,
300,
5023,
731,
11,
738,
813,
... |
cells = sheet.getSelectedLocations() for (row, col) in cells: cell = sheet.getCell(row, col) if hasattr(cell, 'GetInteractor'): selectedIren = cell.GetInteractor() selectedIren.SetKeyCode(keyCode) selectedIren.GetInteractorStyle().OnChar() selectedIren.Render() | cells = sheet.getSelectedLocations() if (ren in self.getRenderersInCellList(sheet, cells)): for (row, col) in cells: cell = sheet.getCell(row, col) if hasattr(cell, 'GetInteractor'): selectedIren = cell.GetInteractor() selectedIren.SetKeyCode(keyCode) selectedIren.GetInteractorStyle().OnChar() selectedIren.Render() | def charEvent(self, istyle, name): """ charEvent(istyle: vtkInteractorStyle, name: str) -> None Make sure key presses also sync across selected renderers """ sheet = self.findSheetTabWidget() if sheet: iren = istyle.GetInteractor() keyCode = iren.GetKeyCode() if keyCode in ['w','W','s','S','r','R']: cells = sheet.getSelectedLocations() for (row, col) in cells: cell = sheet.getCell(row, col) if hasattr(cell, 'GetInteractor'): selectedIren = cell.GetInteractor() selectedIren.SetKeyCode(keyCode) selectedIren.GetInteractorStyle().OnChar() selectedIren.Render() istyle.OnChar() | e25f6b3864d5c7d3cb40e9df2cffa8fe2ac6dfdb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/e25f6b3864d5c7d3cb40e9df2cffa8fe2ac6dfdb/vtkcell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1149,
1133,
12,
2890,
16,
277,
4060,
16,
508,
4672,
3536,
1149,
1133,
12,
376,
1362,
30,
13659,
2465,
3362,
2885,
16,
508,
30,
609,
13,
317,
599,
4344,
3071,
498,
11779,
281,
2546,
379... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1149,
1133,
12,
2890,
16,
277,
4060,
16,
508,
4672,
3536,
1149,
1133,
12,
376,
1362,
30,
13659,
2465,
3362,
2885,
16,
508,
30,
609,
13,
317,
599,
4344,
3071,
498,
11779,
281,
2546,
379... |
DoPackage(argv_RealClean, PackageSets["all"]) or sys.exit(1) | def Hack1(): # appropriate pylib.GCC_BACKEND = True pylib.OMIT_GCC = False # hack os.environ["GCC_BACKEND"] = "yes" os.environ.pop("OMIT_GCC", None) reload(pylib) | f79eddf7420d7ecca90b9ab0d9d7d03ff433e039 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/f79eddf7420d7ecca90b9ab0d9d7d03ff433e039/bootntgnu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
484,
21,
13332,
225,
468,
5505,
2395,
2941,
18,
43,
6743,
67,
8720,
4415,
273,
1053,
2395,
2941,
18,
1872,
1285,
67,
43,
6743,
273,
1083,
225,
468,
11769,
1140,
18,
28684,
9614,
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,
670,
484,
21,
13332,
225,
468,
5505,
2395,
2941,
18,
43,
6743,
67,
8720,
4415,
273,
1053,
2395,
2941,
18,
1872,
1285,
67,
43,
6743,
273,
1083,
225,
468,
11769,
1140,
18,
28684,
9614,
4... | |
def minus(): | def dec_indent(): | def minus(): global indent indent -= 1 | 6ae6ed47bd06d9e4a84ff98ecaaaa5baa53ddb47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/6ae6ed47bd06d9e4a84ff98ecaaaa5baa53ddb47/compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2109,
67,
9355,
13332,
2552,
3504,
3504,
3947,
404,
282,
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,
... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2109,
67,
9355,
13332,
2552,
3504,
3504,
3947,
404,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.InsertColumn(0, 'Frame', wxLIST_FORMAT_LEFT, 150) | self.InsertColumn(0, 'Frame', wxLIST_FORMAT_LEFT, 150) | def __init__(self, parent, flist, debugger): wxListCtrl.__init__(self, parent, wxID_STACKVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Frame', wxLIST_FORMAT_LEFT, 150) self.InsertColumn(1, 'Line', wxLIST_FORMAT_LEFT, 35) self.InsertColumn(2, 'Code', wxLIST_FORMAT_LEFT, 300) EVT_LIST_ITEM_SELECTED(self, wxID_STACKVIEW, self.OnStackItemSelected) EVT_LIST_ITEM_DESELECTED(self, wxID_STACKVIEW, self.OnStackItemDeselected) EVT_LEFT_DCLICK(self, self.OnGotoSource) | 872f754eafee36b7b9b20954604570707e5cd36c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/872f754eafee36b7b9b20954604570707e5cd36c/Debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
284,
1098,
16,
19977,
4672,
7075,
682,
12418,
16186,
2738,
972,
12,
2890,
16,
982,
16,
7075,
734,
67,
21971,
12145,
16,
2154,
273,
7075,
13394,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
982,
16,
284,
1098,
16,
19977,
4672,
7075,
682,
12418,
16186,
2738,
972,
12,
2890,
16,
982,
16,
7075,
734,
67,
21971,
12145,
16,
2154,
273,
7075,
13394,
... |
fout.write('<fileLocation>%s</fileLocation>' % os.getcwd()) | fout.write('<filePath>%s</filePath>' % os.getcwd()) | def write_xml(self, file): | 76061b0a7fe72706f8f004d9f9895881c4406e39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3290/76061b0a7fe72706f8f004d9f9895881c4406e39/ISPyBXmlHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2902,
12,
2890,
16,
585,
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,
1045,
67,
2902,
12,
2890,
16,
585,
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,
... |
"%d clients waiting." % len(self.__storage._waiting)) | "Clients waiting: %d." % len(self.__storage._waiting)) | def wait(self): if self.__storage._transaction: d = Delay() self.__storage._waiting.append((d, self)) self._log("Transaction blocked waiting for storage. " "%d clients waiting." % len(self.__storage._waiting)) return d else: self.restart() | 1f9a2369082ff0d17f8ce1430fe22ba1a52aebd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/1f9a2369082ff0d17f8ce1430fe22ba1a52aebd9/StorageServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
12,
2890,
4672,
309,
365,
16186,
5697,
6315,
7958,
30,
302,
273,
20165,
1435,
365,
16186,
5697,
6315,
20241,
18,
6923,
12443,
72,
16,
365,
3719,
365,
6315,
1330,
2932,
3342,
14547,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2529,
12,
2890,
4672,
309,
365,
16186,
5697,
6315,
7958,
30,
302,
273,
20165,
1435,
365,
16186,
5697,
6315,
20241,
18,
6923,
12443,
72,
16,
365,
3719,
365,
6315,
1330,
2932,
3342,
14547,
... |
if not text_line.startswith( u'<!--' ): Rextlink = re.compile(r'(?i)\[\[(?P<linkname>http://[^\]]+?)\]\]') text_lineR = re.compile(Rextlink) MOextlink = text_lineR.search(text_line) while MOextlink: extlink_linkname = MOextlink.group('linkname') text_line=text_line[:MOextlink.start()] + '[%s]' % extlink_linkname + text_line[MOextlink.end(0):] MOextlink = text_lineR.search(text_line,MOextlink.start(0)+1) Rextlink = re.compile(r'(?i)\[(?P<linkname>[h]*[ft]+tp:[^ [\]\|]+?)(?P<linktext>[ \|]+(( *[^\]\|]*)|( *\[\[.+?\]\])*)+)*\]') text_lineR = re.compile(Rextlink) MOextlink = text_lineR.search(text_line) while MOextlink: extlink_linkname = MOextlink.group('linkname') extlink_linktext = MOextlink.group('linktext') self.refsequence += 1 ( refname, reftext ) = self.doConvertLinkTextToReference(self.refsequence, extlink_linkname, extlink_linktext) self.references.append( reftext ) if extlink_linktext: text_line=text_line[:MOextlink.start(0)] + '%s{{ref|%s}}' % (extlink_linktext, refname) + text_line[MOextlink.end(0):] else: text_line=text_line[:MOextlink.start(0)] + '{{ref|%s}}' % refname + text_line[MOextlink.end(0):] MOextlink = text_lineR.search(text_line,MOextlink.start(0)+1) Rdoi = re.compile(r'(?i){{doi\|(?P<doilink>[^}|]*)}}') doiR = re.compile(Rdoi) MOdoi = doiR.search(text_line) while MOdoi: doi_link = MOdoi.group('doilink') if doi_link: self.refsequence += 1 ( refname, reftext ) = self.doConvertDOIToReference( self.refsequence, doi_link ) self.references.append( reftext ) text_line=text_line[:MOdoi.start(0)] + '{{ref|%s}}' % refname + text_line[MOdoi.end(0):] MOdoi = doiR.search(text_line, MOdoi.start(0)+1) | if not text_line.startswith( u'<!--' ): Rextlink = re.compile(r'(?i)\[\[(?P<linkname>http://[^\]]+?)\]\]') text_lineR = re.compile(Rextlink) MOextlink = text_lineR.search(text_line) while MOextlink: extlink_linkname = MOextlink.group('linkname') text_line=text_line[:MOextlink.start()] + '[%s]' % extlink_linkname + text_line[MOextlink.end(0):] MOextlink = text_lineR.search(text_line,MOextlink.start(0)+1) Rextlink = re.compile(r'(?i)\[(?P<linkname>[h]*[ft]+tp:[^ [\]\|]+?)(?P<linktext>[ \|]+(( *[^\]\|]*)|( *\[\[.+?\]\])*)+)*\]') text_lineR = re.compile(Rextlink) MOextlink = text_lineR.search(text_line) while MOextlink: extlink_linkname = MOextlink.group('linkname') extlink_linktext = MOextlink.group('linktext') self.refsequence += 1 ( refname, reftext ) = self.doConvertLinkTextToReference(self.refsequence, extlink_linkname, extlink_linktext) self.references.append( reftext ) if extlink_linktext: text_line=text_line[:MOextlink.start(0)] + '%s{{ref|%s}}' % (extlink_linktext, refname) + text_line[MOextlink.end(0):] else: text_line=text_line[:MOextlink.start(0)] + '{{ref|%s}}' % refname + text_line[MOextlink.end(0):] MOextlink = text_lineR.search(text_line,MOextlink.start(0)+1) Rdoi = re.compile(r'(?i){{doi\|(?P<doilink>[^}|]*)}}') doiR = re.compile(Rdoi) MOdoi = doiR.search(text_line) while MOdoi: doi_link = MOdoi.group('doilink') if doi_link: self.refsequence += 1 ( refname, reftext ) = self.doConvertDOIToReference( self.refsequence, doi_link ) self.references.append( reftext ) text_line=text_line[:MOdoi.start(0)] + '{{ref|%s}}' % refname + text_line[MOdoi.end(0):] MOdoi = doiR.search(text_line, MOdoi.start(0)+1) | def doConvertExternalLinks(self, original_text): """ Returns the text which is generated by converting external links to References. Adds References to reference list. """ new_text = '' # Default is no text skipsection = False for text_line in original_text.splitlines(True): # Scan all text line by line # Check for protected sections m = re.search("== *(?P<sectionname>[^\]\|=]*) *==", text_line) # TODO: support subheadings within Notes section # TODO: support Notes in alphabetic order # TODO: support Notes in other orders if m: # if in a section, check if should skip this section if m.group('sectionname').lower().strip() in referencesectionnames: skipsection = True # skipsection left True so no further links converted if skipsection: new_text = new_text + text_line # skip section, so retain text. else: # TODO: recognize {{inline}} invisible footnotes when something can be done with them # # Ignore lines within comments if not text_line.startswith( u'<!--' ): # Fix erroneous external links in double brackets Rextlink = re.compile(r'(?i)\[\[(?P<linkname>http://[^\]]+?)\]\]') # TODO: compiling the regex each time might be inefficient text_lineR = re.compile(Rextlink) MOextlink = text_lineR.search(text_line) while MOextlink: # find all links on line extlink_linkname = MOextlink.group('linkname') # Rewrite double brackets to single ones text_line=text_line[:MOextlink.start()] + '[%s]' % extlink_linkname + text_line[MOextlink.end(0):] MOextlink = text_lineR.search(text_line,MOextlink.start(0)+1) # Regular expression to look for external link [linkname linktext] - linktext is optional. # Also accepts erroneous pipe symbol as separator. # Accepts wikilinks within <linktext> #Rextlink = re.compile(r'[^\[]\[(?P<linkname>[h]*[ft]+tp:[^ [\]\|]+?)(?P<linktext>[ \|]+(( *[^\]\|]*)|( *\[\[.+?\]\])*)+)*\][^\]]') #Rextlink = re.compile(r'\[(?P<linkname>[h]*[ft]+tp:[^ [\]\|]+?)(?P<linktext>[ \|]+(( *[^\]\|]*)|( *\[\[.+?\]\])*)+)*\]') Rextlink = re.compile(r'(?i)\[(?P<linkname>[h]*[ft]+tp:[^ [\]\|]+?)(?P<linktext>[ \|]+(( *[^\]\|]*)|( *\[\[.+?\]\])*)+)*\]') # TODO: compiling the regex each time might be inefficient text_lineR = re.compile(Rextlink) MOextlink = text_lineR.search(text_line) while MOextlink: # find all links on line extlink_linkname = MOextlink.group('linkname') extlink_linktext = MOextlink.group('linktext') self.refsequence += 1 ( refname, reftext ) = self.doConvertLinkTextToReference(self.refsequence, extlink_linkname, extlink_linktext) self.references.append( reftext ) # append new entry to References if extlink_linktext: # If there was text as part of link, reinsert text before footnote. text_line=text_line[:MOextlink.start(0)] + '%s{{ref|%s}}' % (extlink_linktext, refname) + text_line[MOextlink.end(0):] else: text_line=text_line[:MOextlink.start(0)] + '{{ref|%s}}' % refname + text_line[MOextlink.end(0):] MOextlink = text_lineR.search(text_line,MOextlink.start(0)+1) # Search for {{doi}} Rdoi = re.compile(r'(?i){{doi\|(?P<doilink>[^}|]*)}}') # TODO: compiling the regex each time might be inefficient doiR = re.compile(Rdoi) MOdoi = doiR.search(text_line) while MOdoi: # find all doi on line doi_link = MOdoi.group('doilink') if doi_link: self.refsequence += 1 ( refname, reftext ) = self.doConvertDOIToReference( self.refsequence, doi_link ) self.references.append( reftext ) # append new entry to References text_line=text_line[:MOdoi.start(0)] + '{{ref|%s}}' % refname + text_line[MOdoi.end(0):] MOdoi = doiR.search(text_line, MOdoi.start(0)+1) new_text = new_text + text_line # append new line to new text if new_text == '': new_text = original_text # If somehow no new text, return original text return new_text | 5ce396273c43ed3fd2b8edb1839c08165aac5b9f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/5ce396273c43ed3fd2b8edb1839c08165aac5b9f/standardize_notes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2723,
6841,
7100,
12,
2890,
16,
2282,
67,
955,
4672,
3536,
2860,
326,
977,
1492,
353,
4374,
635,
14540,
3903,
4716,
358,
868,
2980,
18,
15605,
868,
2980,
358,
2114,
666,
18,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2723,
6841,
7100,
12,
2890,
16,
2282,
67,
955,
4672,
3536,
2860,
326,
977,
1492,
353,
4374,
635,
14540,
3903,
4716,
358,
868,
2980,
18,
15605,
868,
2980,
358,
2114,
666,
18,
3536,
... |
return set(x[0] for x in cu) | return roles + set(x[0] for x in cu) | def getAuthorizedRoles(self, cu, user, password, allowAnonymous = True, remoteIp = None): """ Given a user and password, return the list of roles that are authorized via these credentials """ | c653e2025a02c9440fdef498c85df8c07929be61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/c653e2025a02c9440fdef498c85df8c07929be61/netauth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
15341,
6898,
12,
2890,
16,
15985,
16,
729,
16,
2201,
16,
1699,
18792,
273,
1053,
16,
2632,
5273,
273,
599,
4672,
3536,
16803,
279,
729,
471,
2201,
16,
327,
326,
666,
434,
4900,
71... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
15341,
6898,
12,
2890,
16,
15985,
16,
729,
16,
2201,
16,
1699,
18792,
273,
1053,
16,
2632,
5273,
273,
599,
4672,
3536,
16803,
279,
729,
471,
2201,
16,
327,
326,
666,
434,
4900,
71... |
return self.create_group(name, type, create=True, **data) | return self.create_group(name, type, **data) | def require_group(self, name, type='Group', **data): if not name in self: return self.create_group(name, type, create=True, **data) else: item = self[name] if not isinstance(item, registry[type]): raise NameError( "Incompatible object (%s) already exists" % \ item.__class__.__name__ ) return item | cab792a4f110eed45f76e4738dd2a2d559f6ea6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14949/cab792a4f110eed45f76e4738dd2a2d559f6ea6a/group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2583,
67,
1655,
12,
2890,
16,
508,
16,
618,
2218,
1114,
2187,
2826,
892,
4672,
309,
486,
508,
316,
365,
30,
327,
365,
18,
2640,
67,
1655,
12,
529,
16,
618,
16,
2826,
892,
13,
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,
2583,
67,
1655,
12,
2890,
16,
508,
16,
618,
2218,
1114,
2187,
2826,
892,
4672,
309,
486,
508,
316,
365,
30,
327,
365,
18,
2640,
67,
1655,
12,
529,
16,
618,
16,
2826,
892,
13,
469,
... |
nuninst[arch].append(pkg_name) | nuninst[arch].add(pkg_name) | def get_nuninst(self, requested_arch=None, build=False): """Return the uninstallability statistic for all the architectures | 469d67fca2e47a8c81512c4f86db64b0f50e5032 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2784/469d67fca2e47a8c81512c4f86db64b0f50e5032/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
82,
318,
8591,
12,
2890,
16,
3764,
67,
991,
33,
7036,
16,
1361,
33,
8381,
4672,
3536,
990,
326,
16577,
2967,
21605,
364,
777,
326,
6637,
15004,
1823,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
82,
318,
8591,
12,
2890,
16,
3764,
67,
991,
33,
7036,
16,
1361,
33,
8381,
4672,
3536,
990,
326,
16577,
2967,
21605,
364,
777,
326,
6637,
15004,
1823,
2,
-100,
-100,
-100,
-100... |
config_path = os.path.join(GOOGLE_CL_DIR, CONFIG_FILENAME) | config_path = get_config_path() | def set_missing_default(section, option, value, config_path=None): """Set the option for a section if not defined already. Keyword arguments: section: Title of the section to set the option in. option: Option to set. value: Value to give the option. config_path: Path to the configuration file. Default None to use the default path defined in this module. """ existing_value = '' try: existing_value = CONFIG.get(section, option) except ConfigParser.NoSectionError: CONFIG.add_section(section) except ConfigParser.NoOptionError: # If there's no such option, that's fine. We'll fix that in a sec. pass if not existing_value: if not config_path: config_path = os.path.join(GOOGLE_CL_DIR, CONFIG_FILENAME) if os.path.exists(config_path): CONFIG.set(section, option, value) with open(config_path, 'w') as config_file: CONFIG.write(config_file) | 9733652d586c2a46e5b22394a077d51d9be24bf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/9733652d586c2a46e5b22394a077d51d9be24bf0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
7337,
67,
1886,
12,
3464,
16,
1456,
16,
460,
16,
642,
67,
803,
33,
7036,
4672,
3536,
694,
326,
1456,
364,
279,
2442,
309,
486,
2553,
1818,
18,
225,
18317,
1775,
30,
2442,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
7337,
67,
1886,
12,
3464,
16,
1456,
16,
460,
16,
642,
67,
803,
33,
7036,
4672,
3536,
694,
326,
1456,
364,
279,
2442,
309,
486,
2553,
1818,
18,
225,
18317,
1775,
30,
2442,
30... |
(DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), (DialogCommand, "IDC_BUT_FILTER_DEFINE", "IDD_FILTER"), (DialogCommand, "IDC_BUT_TRAIN_NOW", "IDD_TRAINING"), (DialogCommand, "IDC_ADVANCED_BTN", "IDD_ADVANCED"), | def WizardTrainer(mgr, config, progress): import os, manager, train bayes_base = os.path.join(mgr.data_directory, "$sbwiz$default_bayes_database") mdb_base = os.path.join(mgr.data_directory, "$sbwiz$default_message_database") fnames = [] for ext in ".pck", ".db": fnames.append(bayes_base+ext) fnames.append(mdb_base+ext) config.wizard.temp_training_names = fnames # determine which db manager to use, and create it. ManagerClass = manager.GetStorageManagerClass() db_manager = ManagerClass(bayes_base, mdb_base) classifier_data = manager.ClassifierData(db_manager, mgr) classifier_data.InitNew() rescore = config.training.rescore if rescore: stages = ("Training", .3), ("Saving", .1), ("Scoring", .6) else: stages = ("Training", .9), ("Saving", .1) progress.set_stages(stages) print "About to train with", config.training.spam_folder_ids train.real_trainer(classifier_data, config, mgr.message_store, progress) # xxx - more hacks - we should pass the classifier data in. orig_classifier_data = mgr.classifier_data mgr.classifier_data = classifier_data # temporary try: progress.tick() if rescore: # Setup the "filter now" config to what we want. now_config = config.filter_now now_config.only_unread = False now_config.only_unseen = False now_config.action_all = False now_config.folder_ids = config.training.ham_folder_ids + \ config.training.spam_folder_ids now_config.include_sub = config.training.ham_include_sub or \ config.training.spam_include_sub import filter filter.filterer(mgr, config, progress) bayes = classifier_data.bayes progress.set_status("Completed training with %d spam and %d good messages" \ % (bayes.nspam, bayes.nham)) finally: mgr.wizard_classifier_data = classifier_data mgr.classifier_data = orig_classifier_data | 835d87ac4762dc3eafd717108cd77418589d2446 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/835d87ac4762dc3eafd717108cd77418589d2446/dialog_map.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
678,
13412,
1609,
14522,
12,
13552,
16,
642,
16,
4007,
4672,
1930,
1140,
16,
3301,
16,
4691,
324,
528,
281,
67,
1969,
273,
1140,
18,
803,
18,
5701,
12,
13552,
18,
892,
67,
5149,
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,
678,
13412,
1609,
14522,
12,
13552,
16,
642,
16,
4007,
4672,
1930,
1140,
16,
3301,
16,
4691,
324,
528,
281,
67,
1969,
273,
1140,
18,
803,
18,
5701,
12,
13552,
18,
892,
67,
5149,
16,
... | |
format_args['timestamp'] = strftime(timefmt, mi.pubdate.timetuple()) | format_args['pubdate'] = strftime(timefmt, mi.pubdate.timetuple()) | def get_components(template, mi, id, timefmt='%b %Y', length=250, sanitize_func=ascii_filename, replace_whitespace=False, to_lowercase=False): format_args = dict(**FORMAT_ARGS) if mi.title: format_args['title'] = mi.title if mi.authors: format_args['authors'] = mi.format_authors() if mi.author_sort: format_args['author_sort'] = mi.author_sort if mi.tags: format_args['tags'] = mi.format_tags() if format_args['tags'].startswith('/'): format_args['tags'] = format_args['tags'][1:] if mi.series: format_args['series'] = mi.series if mi.series_index is not None: format_args['series_index'] = mi.format_series_index() if mi.rating is not None: format_args['rating'] = mi.format_rating() if mi.isbn: format_args['isbn'] = mi.isbn if mi.publisher: format_args['publisher'] = mi.publisher if hasattr(mi.timestamp, 'timetuple'): format_args['timestamp'] = strftime(timefmt, mi.timestamp.timetuple()) if hasattr(mi.pubdate, 'timetuple'): format_args['timestamp'] = strftime(timefmt, mi.pubdate.timetuple()) format_args['id'] = str(id) components = [x.strip() for x in template.split('/') if x.strip()] components = [x.format(**format_args).strip() for x in components] components = [sanitize_func(x) for x in components if x] if not components: components = [str(id)] components = [x.encode(filesystem_encoding, 'replace') if isinstance(x, unicode) else x for x in components] if to_lowercase: components = [x.lower() for x in components] if replace_whitespace: components = [re.sub(r'\s', '_', x) for x in components] return shorten_components_to(length, components) | 3ef62526e9167d88af21092a0e0e0316ef53b148 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/3ef62526e9167d88af21092a0e0e0316ef53b148/save_to_disk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8119,
12,
3202,
16,
12837,
16,
612,
16,
813,
8666,
28713,
70,
738,
61,
2187,
769,
33,
26520,
16,
8881,
67,
644,
33,
9184,
67,
3459,
16,
1453,
67,
18777,
33,
8381,
16,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8119,
12,
3202,
16,
12837,
16,
612,
16,
813,
8666,
28713,
70,
738,
61,
2187,
769,
33,
26520,
16,
8881,
67,
644,
33,
9184,
67,
3459,
16,
1453,
67,
18777,
33,
8381,
16,
358,
... |
if parsedTracebacks: | if parsedTracebacks: | def updateCtrls(self, errorList, outputList=None, rootName='Error', runningDir='', errRaw=None): self.runningDir = runningDir self.tracebackType = rootName tree = self.errorStackTC tree.DeleteAllItems() rtTI = tree.AddRoot(rootName+'s') parsedTracebacks = 0 for err in errorList: if err.error and err.stack: errTI = tree.AppendItem(rtTI, string.strip(string.join(err.error, ' : '))) for si in err.stack: siTI = tree.AppendItem(errTI, '%d: %s: %s' % (si.lineNo, os.path.basename(si.file), string.strip(si.line))) tree.SetPyData(siTI, si) if err.stack: tree.SetItemHasChildren(errTI, true) tree.SetPyData(errTI, err.stack[-1]) parsedTracebacks = parsedTracebacks + 1 tree.SetItemHasChildren(rtTI, true) tree.Expand(rtTI) cookie = 0; firstErr, cookie = tree.GetFirstChild(rtTI, cookie) if firstErr.IsOk(): tree.Expand(firstErr) | 7fdd0ef709cbe80071c5b93bd489bc28c9945c90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/7fdd0ef709cbe80071c5b93bd489bc28c9945c90/ErrorStackFrm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
39,
313,
3251,
12,
2890,
16,
29902,
16,
876,
682,
33,
7036,
16,
1365,
461,
2218,
668,
2187,
3549,
1621,
2218,
2187,
393,
4809,
33,
7036,
4672,
365,
18,
8704,
1621,
273,
3549,
162... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
39,
313,
3251,
12,
2890,
16,
29902,
16,
876,
682,
33,
7036,
16,
1365,
461,
2218,
668,
2187,
3549,
1621,
2218,
2187,
393,
4809,
33,
7036,
4672,
365,
18,
8704,
1621,
273,
3549,
162... |
rc += u'''<span class="message">%s</span>''' % self.getMessage(event) | rc += u'''<span class="message">%s</span>''' % escape(self.getMessage(event)) | def format(self, event): if event.params.has_key('line'): line = event.params['line'] if line >= len(self.rawdata.split('\n')): # For some odd reason, UnicodeErrors tend to trigger a bug # in the SAX parser that misrepresents the current line number. # We try to capture the last known good line number/column as # we go along, and now it's time to fall back to that. line = event.params['line'] = event.params['backupline'] column = event.params['column'] = event.params['backupcolumn'] column = event.params['column'] codeFragment = self.rawdata.split('\n')[line-1] markerColumn = column if column > self.FRAGMENTLEN: codeFragment = '... ' + codeFragment[column-(self.FRAGMENTLEN/2):] markerColumn = 5 + (self.FRAGMENTLEN/2) if len(codeFragment) > self.FRAGMENTLEN: codeFragment = codeFragment[:(self.FRAGMENTLEN-4)] + ' ...' else: codeFragment = '' | 9801aa964e0e8792278d9eae89254f24c9de7624 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5012/9801aa964e0e8792278d9eae89254f24c9de7624/text_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
871,
4672,
309,
871,
18,
2010,
18,
5332,
67,
856,
2668,
1369,
11,
4672,
980,
273,
871,
18,
2010,
3292,
1369,
3546,
309,
980,
1545,
562,
12,
2890,
18,
1899,
892,
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,
740,
12,
2890,
16,
871,
4672,
309,
871,
18,
2010,
18,
5332,
67,
856,
2668,
1369,
11,
4672,
980,
273,
871,
18,
2010,
3292,
1369,
3546,
309,
980,
1545,
562,
12,
2890,
18,
1899,
892,
18... |
TEXT_EXTENSIONS=['.cpp', '.hpp', '.py', '.sh', '.txt', '.html', '.map', '.md5', '.xpm'] | TEXT_EXTENSIONS=['.cpp', '.hpp', '.py', '.sh', '.txt', '.html', '.map', '.md5', '.xpm', '.po', '.pot'] | def set_prop(filename, prop, value): args=['svn', 'ps', prop, value, filename] p=Popen(args, stdout=None) t=p.communicate()[0] | 915871c3194bb4e94cde4a6fe1799c8b5b7a626b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9898/915871c3194bb4e94cde4a6fe1799c8b5b7a626b/check_props.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
5986,
12,
3459,
16,
2270,
16,
460,
4672,
833,
33,
3292,
31505,
2187,
296,
1121,
2187,
2270,
16,
460,
16,
1544,
65,
293,
33,
52,
3190,
12,
1968,
16,
3909,
33,
7036,
13,
268,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
5986,
12,
3459,
16,
2270,
16,
460,
4672,
833,
33,
3292,
31505,
2187,
296,
1121,
2187,
2270,
16,
460,
16,
1544,
65,
293,
33,
52,
3190,
12,
1968,
16,
3909,
33,
7036,
13,
268,
... |
Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) | Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all vectors of length i. Reference: This is a slightly modified version of Cohn's Algorithm 2.7.5 in "A Course in Computational Number Theory", with the increment step moved around and slightly re-indexed to allow clean looping. Note: We could speed this up for very skew matrices by using LLL first, and then changing coordinates back, but for our purposes the simpler method is efficient enough. =) EXAMPLES: sage: Q = DiagonalQuadraticForm(ZZ, [1,1]) sage: Q.vectors_by_length(5) [[[0, 0]], [[0, -1], [-1, 0]], [[-1, -1], [1, -1]], [], [[0, -2], [-2, 0]], [[-1, -2], [1, -2], [-2, -1], [2, -1]]] sage: Q1 = DiagonalQuadraticForm(ZZ, [1,3,5,7]) sage: Q1.vectors_by_length(5) [[[0, 0, 0, 0]], [[-1, 0, 0, 0]], [], [[0, -1, 0, 0]], [[-1, -1, 0, 0], [1, -1, 0, 0], [-2, 0, 0, 0]], [[0, 0, -1, 0]]] """ Theta_Precision = bound ## Unsigned long n = self.dim() ## Make the vector of vectors which have a given value ## (So theta_vec[i] will have all vectors v with Q(v) = i.) empty_vec_list = [[] for i in range(Theta_Precision + 1)] theta_vec = [[] for i in range(Theta_Precision + 1)] ## Initialize Q with zeros and Copy the Cholesky array into Q Q = self.cholesky_decomposition() ## 1. Initialize T = n * [RDF(0)] ## Note: We index the entries as 0 --> n-1 U = n * [RDF(0)] i = n-1 T[i] = RDF(Theta_Precision) U[i] = RDF(0) L = n * [0] x = n * [0] Z = RDF(0) ## 2. Compute bounds Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) done_flag = False Q_val_double = RDF(0) Q_val = 0 ## WARNING: Still need a good way of checking overflow for this value... ## Big loop which runs through all vectors while not done_flag: ## 3b. Main loop -- try to generate a complete vector x (when i=0) while (i > 0): #print " i = ", i #print " T[i] = ", T[i] #print " Q[i][i] = ", Q[i][i] #print " x[i] = ", x[i] #print " U[i] = ", U[i] #print " x[i] + U[i] = ", (x[i] + U[i]) #print " T[i-1] = ", T[i-1] T[i-1] = T[i] - Q[i][i] * (x[i] + U[i]) * (x[i] + U[i]) #print " T[i-1] = ", T[i-1] #print " x = ", x #print i = i - 1 U[i] = 0 for j in range(i+1, n): U[i] = U[i] + Q[i][j] * x[j] ## Now go back and compute the bounds... ## 2. Compute bounds Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) ## 4. Solution found (This happens when i = 0) #print "-- Solution found! --" #print " x = ", x #print " Q_val = Q(x) = ", Q_val Q_val_double = Theta_Precision - T[0] + Q[0][0] * (x[0] + U[0]) * (x[0] + U[0]) Q_val = ZZ(floor(round(Q_val_double))) ## SANITY CHECK: Roundoff Error is < 0.001 if abs(Q_val_double - Q_val) > 0.001: print " x = ", x print " Float = ", Q_val_double, " Long = ", Q_val raise RuntimeError, "The roundoff error is bigger than 0.001, so we should use more precision somewhere..." #print " Float = ", Q_val_double, " Long = ", Q_val, " XX " #print " The float value is ", Q_val_double #print " The associated long value is ", Q_val if (Q_val <= Theta_Precision): #print " Have vector ", x, " with value ", Q_val theta_vec[Q_val].append(deepcopy(x)) ## 5. Check if x = 0, for exit condition. =) j = 0 done_flag = True while (j < n): if (x[j] != 0): done_flag = False j += 1 ## 3a. Increment (and carry if we go out of bounds) x[i] += 1 while (x[i] > L[i]) and (i < n-1): i += 1 x[i] += 1 #print " Leaving ThetaVectors()" return theta_vec | 0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c66354c12254d8eae6cadb4a5b1df3ff8ce42d5/quadratic_form__split_local_covering.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10046,
67,
1637,
67,
2469,
12,
2890,
16,
2489,
4672,
3536,
2860,
279,
666,
434,
3025,
10046,
9475,
598,
3675,
924,
18,
225,
1220,
353,
279,
28224,
4886,
1492,
4692,
326,
1680,
9112,
1846... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10046,
67,
1637,
67,
2469,
12,
2890,
16,
2489,
4672,
3536,
2860,
279,
666,
434,
3025,
10046,
9475,
598,
3675,
924,
18,
225,
1220,
353,
279,
28224,
4886,
1492,
4692,
326,
1680,
9112,
1846... |
lines.append([]) | lines.append([]) | def drawstringframedsoft(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): | f9be34fe6bf36d18d76b59cccedd089b5c4584eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/f9be34fe6bf36d18d76b59cccedd089b5c4584eb/osd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
9269,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
1080,
74,
1940,
329,
9269,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,
... |
if not plugin in self.active: self.pdbg("parse_size [SIZE] \"%s\" not active" % plugin_t) | expanded = self.expand_filename(plugin_name) if expanded == []: self.pdbg("parse_size [SIZE] \"%s\" not active" % match.group(3)) | def parse_size(self): """check the given size of the plugin.""" self.parse_dbg_indent += " " match = re_size_fun.match(self.buffer) if match: p = match.span(0)[1] self.buffer = self.buffer[p:] self.pdbg("parse_size new buffer = %s" % self.buffer) bang = match.group(1) # means "is not this size" wanted_size = int(match.group(2)) plugin = C.cname(match.group(3)) plugin_t = C.truename(plugin) expr = "[SIZE %s%d %s]" % (bang, wanted_size, plugin_t) self.pdbg("parse_size, expr=%s" % expr) if not plugin in self.active: self.pdbg("parse_size [SIZE] \"%s\" not active" % plugin_t) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(False, expr) # file does not exist if self.datadir == None: # this case is reached when doing fromfile checks, # which do not have access to the actual plugin, so we # always assume the test is merely for file existence, # to err on the side of caution self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(True, expr) actual_size = os.path.getsize(self.datadir.find_path(plugin)) bool = (actual_size == wanted_size) if bang == "!": bool = not bool self.pdbg("parse_size [SIZE] returning: (%s, %s)" % (bool, expr)) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(bool, expr) self.parse_error(_["Invalid [SIZE] function"]) return(None, None) | 3da534b9bf37dbde04239e14e13a579e2b0fe147 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2827/3da534b9bf37dbde04239e14e13a579e2b0fe147/mlox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1467,
12,
2890,
4672,
3536,
1893,
326,
864,
963,
434,
326,
1909,
12123,
365,
18,
2670,
67,
1966,
75,
67,
9355,
1011,
315,
225,
315,
845,
273,
283,
67,
1467,
67,
12125,
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,
1109,
67,
1467,
12,
2890,
4672,
3536,
1893,
326,
864,
963,
434,
326,
1909,
12123,
365,
18,
2670,
67,
1966,
75,
67,
9355,
1011,
315,
225,
315,
845,
273,
283,
67,
1467,
67,
12125,
18,
... |
elif (suffix==".lib"): cmd = cmd + ' "' + PREFIX + '/lib/' + x[:-4] + '.a"' if (PkgSelected(opts,"FMOD")): cmd = cmd + ' -L"' + THIRDPARTY + 'fmod/lib" -lfmod-3.74' | elif (suffix==".lib"): cmd = cmd + ' ' + PREFIX + '/lib/' + x[:-4] + '.a' if (PkgSelected(opts,"FMOD")): cmd = cmd + ' -L' + THIRDPARTY + 'fmod/lib -lfmod-3.74' | def CompileLink(dll=0, obj=[], opts=[], xdep=[]): if (dll==0): sys.exit("Syntax error in CompileLink directive") if (COMPILER=="MSVC7"): ALLTARGETS.append(PREFIX+"/bin/"+dll) lib = PREFIX+"/lib/"+dll[:-4]+".lib" dll = PREFIX+"/bin/"+dll wobj = [] for x in obj: suffix = x[-4:] if (suffix==".obj"): wobj.append(PREFIX+"/tmp/"+x) elif (suffix==".dll"): wobj.append(PREFIX+"/lib/"+x[:-4]+".lib") elif (suffix==".lib"): wobj.append(PREFIX+"/lib/"+x) elif (suffix==".res"): wobj.append(PREFIX+"/tmp/"+x) else: sys.exit("unknown suffix in object list.") if (older(dll, wobj+xdep)): cmd = 'link.exe /nologo /NODEFAULTLIB:LIBCI.LIB' if (dll[-4:]!=".exe"): cmd = cmd + " /DLL" if (OPTIMIZE==1): cmd = cmd + " /DEBUG /NODEFAULTLIB:MSVCRT.LIB " if (OPTIMIZE==2): cmd = cmd + " /DEBUG /NODEFAULTLIB:MSVCRT.LIB " if (OPTIMIZE==3): cmd = cmd + " /DEBUG /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF " if (OPTIMIZE==4): cmd = cmd + " /DEBUG /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF /LTCG " cmd = cmd + " /MAP /MAPINFO:EXPORTS /MAPINFO:LINES /fixed:no /incremental:no /stack:4194304 " if (opts.count("NOLIBCI")): cmd = cmd + " /NODEFAULTLIB:LIBCI.LIB " if (opts.count("MAXEGGDEF")): cmd = cmd + ' /DEF:pandatool/src/maxegg/MaxEgg.def' cmd = cmd + ' /OUT:"' + dll + '" /IMPLIB:"' + lib + '" /MAP:NUL' cmd = cmd + ' /LIBPATH:"' + PREFIX + '/python/libs" ' for x in wobj: cmd = cmd + ' "' + x + '"' if (dll[-4:]==".exe"): cmd = cmd + ' "' + PREFIX + '/tmp/pandaIcon.res"' if (opts.count("D3D8") or opts.count("D3D9") or opts.count("DXDRAW") or opts.count("DXSOUND") or opts.count("DXGUID")): cmd = cmd + ' /LIBPATH:"' + DIRECTXSDK + 'lib/x86"' cmd = cmd + ' /LIBPATH:"' + DIRECTXSDK + 'lib"' if (opts.count("D3D8")): cmd = cmd + ' d3d8.lib d3dx8.lib dxerr8.lib' if (opts.count("D3D9")): cmd = cmd + ' d3d9.lib d3dx9.lib dxerr9.lib' if (opts.count("DXDRAW")): cmd = cmd + ' ddraw.lib' if (opts.count("DXSOUND")): cmd = cmd + ' dsound.lib' if (opts.count("DXGUID")): cmd = cmd + ' dxguid.lib' if (opts.count("WINSOCK")): cmd = cmd + " wsock32.lib" if (opts.count("WINSOCK2")): cmd = cmd + " wsock32.lib ws2_32.lib" if (opts.count("WINCOMCTL")): cmd = cmd + ' comctl32.lib' if (opts.count("WINUSER")): cmd = cmd + " user32.lib" if (opts.count("WINMM")): cmd = cmd + " winmm.lib" if (opts.count("WINIMM")): cmd = cmd + " imm32.lib" if (opts.count("WINKERNEL")): cmd = cmd + " kernel32.lib" if (opts.count("WINOLDNAMES")): cmd = cmd + " oldnames.lib" if (opts.count("WINGDI")): cmd = cmd + " gdi32.lib" if (opts.count("ADVAPI")): cmd = cmd + " advapi32.lib" if (opts.count("GLUT")): cmd = cmd + " opengl32.lib glu32.lib" if (PkgSelected(opts,"ZLIB")): cmd = cmd + ' "' + THIRDPARTY + 'zlib/lib/libz.lib"' if (PkgSelected(opts,"PNG")): cmd = cmd + ' "' + THIRDPARTY + 'png/lib/libpng.lib"' if (PkgSelected(opts,"JPEG")): cmd = cmd + ' "' + THIRDPARTY + 'jpeg/lib/libjpeg.lib"' if (PkgSelected(opts,"TIFF")): cmd = cmd + ' "' + THIRDPARTY + 'tiff/lib/libtiff.lib"' if (PkgSelected(opts,"VRPN")): cmd = cmd + ' "' + THIRDPARTY + 'vrpn/lib/vrpn.lib"' cmd = cmd + ' "' + THIRDPARTY + 'vrpn/lib/quat.lib"' if (PkgSelected(opts,"FMOD")): cmd = cmd + ' "' + THIRDPARTY + 'fmod/lib/fmod.lib"' if (PkgSelected(opts,"MILES")): cmd = cmd + ' "' + THIRDPARTY + 'miles/lib/mss32.lib"' if (PkgSelected(opts,"NVIDIACG")): if (opts.count("CGGL")): cmd = cmd + ' "' + THIRDPARTY + 'nvidiacg/lib/cgGL.lib"' cmd = cmd + ' "' + THIRDPARTY + 'nvidiacg/lib/cg.lib"' if (PkgSelected(opts,"HELIX")): cmd = cmd + ' "' + THIRDPARTY + 'helix/lib/runtlib.lib"' cmd = cmd + ' "' + THIRDPARTY + 'helix/lib/syslib.lib"' cmd = cmd + ' "' + THIRDPARTY + 'helix/lib/contlib.lib"' cmd = cmd + ' "' + THIRDPARTY + 'helix/lib/debuglib.lib"' cmd = cmd + ' "' + THIRDPARTY + 'helix/lib/utillib.lib"' cmd = cmd + ' "' + THIRDPARTY + 'helix/lib/stlport_vc7.lib"' if (PkgSelected(opts,"NSPR")): cmd = cmd + ' "' + THIRDPARTY + 'nspr/lib/libnspr4.lib"' if (PkgSelected(opts,"SSL")): cmd = cmd + ' "' + THIRDPARTY + 'ssl/lib/ssleay32.lib"' cmd = cmd + ' "' + THIRDPARTY + 'ssl/lib/libeay32.lib"' if (PkgSelected(opts,"FREETYPE")): cmd = cmd + ' "' + THIRDPARTY + 'freetype/lib/libfreetype.lib"' if (PkgSelected(opts,"FFTW")): cmd = cmd + ' "' + THIRDPARTY + 'fftw/lib/rfftw.lib"' cmd = cmd + ' "' + THIRDPARTY + 'fftw/lib/fftw.lib"' if (PkgSelected(opts,"MAYA5")): cmd = cmd + ' "' + Maya5SDK + 'lib/Foundation.lib"' cmd = cmd + ' "' + Maya5SDK + 'lib/OpenMaya.lib"' cmd = cmd + ' "' + Maya5SDK + 'lib/OpenMayaAnim.lib"' if (PkgSelected(opts,"MAYA6")): cmd = cmd + ' "' + Maya6SDK + 'lib/Foundation.lib"' cmd = cmd + ' "' + Maya6SDK + 'lib/OpenMaya.lib"' cmd = cmd + ' "' + Maya6SDK + 'lib/OpenMayaAnim.lib"' for max in ["MAX5","MAX6","MAX7"]: if PkgSelected(opts,max): cmd = cmd + ' "' + MAXSDK[max] + 'lib/core.lib"' cmd = cmd + ' "' + MAXSDK[max] + 'lib/mesh.lib"' cmd = cmd + ' "' + MAXSDK[max] + 'lib/maxutil.lib"' cmd = cmd + ' "' + MAXSDK[max] + 'lib/paramblk2.lib"' oscmd(cmd) updatefiledate(dll) if ((OPTIMIZE == 1) and (dll[-4:]==".dll")): CopyFile(dll[:-4]+"_d.dll", dll) if (COMPILER=="LINUXA"): ALLTARGETS.append(PREFIX+"/lib/"+dll[:-4]+".so") if (dll[-4:]==".exe"): wdll = PREFIX+"/bin/"+dll[:-4] else: wdll = PREFIX+"/lib/"+dll[:-4]+".so" wobj = [] for x in obj: suffix = x[-4:] if (suffix==".obj"): wobj.append(PREFIX+"/tmp/"+x[:-4]+".o") elif (suffix==".dll"): wobj.append(PREFIX+"/lib/"+x[:-4]+".so") elif (suffix==".lib"): wobj.append(PREFIX+"/lib/"+x[:-4]+".a") else: sys.exit("unknown suffix in object list.") if (older(wdll, wobj+xdep)): if (dll[-4:]==".exe"): cmd = 'g++ -o "' + wdll + '" -L"' + PREFIX + '/lib"' else: cmd = 'g++ -shared -o "' + wdll + '" -L"' + PREFIX + '/lib"' for x in obj: suffix = x[-4:] if (suffix==".obj"): cmd = cmd + ' "' + PREFIX + '/tmp/' + x[:-4] + '.o"' elif (suffix==".dll"): cmd = cmd + ' -l' + x[3:-4] elif (suffix==".lib"): cmd = cmd + ' "' + PREFIX + '/lib/' + x[:-4] + '.a"' if (PkgSelected(opts,"FMOD")): cmd = cmd + ' -L"' + THIRDPARTY + 'fmod/lib" -lfmod-3.74' if (PkgSelected(opts,"NVIDIACG")): cmd = cmd + ' -L"' + THIRDPARTY + 'nvidiacg/lib" ' if (opts.count("CGGL")): cmd = cmd + " -lCgGL" cmd = cmd + " -lCg" if (PkgSelected(opts,"NSPR")): cmd = cmd + ' -L"' + THIRDPARTY + 'nspr/lib" -lpandanspr4' if (PkgSelected(opts,"ZLIB")): cmd = cmd + " -lz" if (PkgSelected(opts,"PNG")): cmd = cmd + " -lpng" if (PkgSelected(opts,"JPEG")): cmd = cmd + " -ljpeg" if (PkgSelected(opts,"TIFF")): cmd = cmd + " -ltiff" if (PkgSelected(opts,"SSL")): cmd = cmd + " -lssl" if (PkgSelected(opts,"FREETYPE")): cmd = cmd + " -lfreetype" if (PkgSelected(opts,"VRPN")): cmd = cmd + ' -L"' + THIRDPARTY + 'vrpn/lib" -lvrpn -lquat' if (PkgSelected(opts,"FFTW")): cmd = cmd + ' -L"' + THIRDPARTY + 'fftw/lib" -lrfftw -lfftw' if (opts.count("GLUT")): cmd = cmd + " -lGL -lGLU" oscmd(cmd) updatefiledate(wdll) | e743cb25c4127c99b6bf2de385cf618b18e32531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/e743cb25c4127c99b6bf2de385cf618b18e32531/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
2098,
12,
27670,
33,
20,
16,
1081,
22850,
6487,
1500,
22850,
6487,
619,
15037,
33,
8526,
4672,
309,
261,
27670,
631,
20,
4672,
2589,
18,
8593,
2932,
8070,
555,
316,
16143,
2098,
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,
16143,
2098,
12,
27670,
33,
20,
16,
1081,
22850,
6487,
1500,
22850,
6487,
619,
15037,
33,
8526,
4672,
309,
261,
27670,
631,
20,
4672,
2589,
18,
8593,
2932,
8070,
555,
316,
16143,
2098,
8... |
items = [] | items = [self.item] + self.second + self.third + self.items | def delete( self): self.unselect() items = [] if self.item: items += [self.item] self.paper.unregister_id( self.item) self.item = None if self.second: items += [self.second] self.second = None if self.third: items += [self.third] self.third = None if self.items: items.extend( self.items) self.items = [] map( self.paper.delete, items) self.item = None return self | 5f5d6008fa9cca2d302d06c0211631310bea39cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4298/5f5d6008fa9cca2d302d06c0211631310bea39cc/classes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
365,
4672,
365,
18,
318,
4025,
1435,
1516,
273,
306,
2890,
18,
1726,
65,
397,
365,
18,
8538,
397,
365,
18,
451,
6909,
397,
365,
18,
3319,
309,
365,
18,
1726,
30,
1516,
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,
1430,
12,
365,
4672,
365,
18,
318,
4025,
1435,
1516,
273,
306,
2890,
18,
1726,
65,
397,
365,
18,
8538,
397,
365,
18,
451,
6909,
397,
365,
18,
3319,
309,
365,
18,
1726,
30,
1516,
1011... |
return Query(Query.OP_AND_NOT, Query(''), i2x(query.query)) | return Query(OP_AND_NOT, Query(''), i2x(query.query)) | def _query2xquery(self, query): """take a "itools" query and return a "xapian" query """ query_class = query.__class__ fields = self._fields if query_class is EqQuery or query_class is PhraseQuery: # EqQuery = PhraseQuery, the field must be indexed name = query.name if name in fields: info = fields[name] return _make_PhraseQuery(info['type'], query.value, info['prefix']) else: # If there is a problem => an empty result return Query() elif query_class is RangeQuery: # RangeQuery, the field must be stored name = query.name if name in fields: info = fields[name] field_type = info['type'] value = info['value'] | 85023dcdde8b7afb3f3ab2553b9e226ae1122e12 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/85023dcdde8b7afb3f3ab2553b9e226ae1122e12/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2271,
22,
92,
2271,
12,
2890,
16,
843,
4672,
3536,
22188,
279,
315,
305,
8192,
6,
843,
471,
327,
279,
315,
92,
2425,
304,
6,
843,
3536,
843,
67,
1106,
273,
843,
16186,
1106,
972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2271,
22,
92,
2271,
12,
2890,
16,
843,
4672,
3536,
22188,
279,
315,
305,
8192,
6,
843,
471,
327,
279,
315,
92,
2425,
304,
6,
843,
3536,
843,
67,
1106,
273,
843,
16186,
1106,
972... |
if options.debug: print "DEBUG: %s exists for %s, creating channel" % (subdir, system) | if options.debug: print timestamp(), "DEBUG: %s exists for %s, creating channel" % (subdir, system) | 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,
... |
print obj | def on_about1_activate(self, imageMenuItem): print obj pixbuf = gtk.gdk.pixbuf_new_from_file( os.path.join(DATADIR, LOGOFILE)) copyright = unicode(COPYRIGHT, "latin-1").encode("utf8") gnome.ui.About(PROG_NAME, str(VERSION), copyright, COMMENTS, AUTHORS, logo_pixbuf=pixbuf).show() | 827901416b3a8c17566b00744ad346a16c1efce7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2629/827901416b3a8c17566b00744ad346a16c1efce7/GnomeBoyAdvance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
21071,
21,
67,
10014,
12,
2890,
16,
1316,
12958,
4672,
225,
11871,
4385,
273,
22718,
18,
75,
2883,
18,
14861,
4385,
67,
2704,
67,
2080,
67,
768,
12,
1140,
18,
803,
18,
5701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
21071,
21,
67,
10014,
12,
2890,
16,
1316,
12958,
4672,
225,
11871,
4385,
273,
22718,
18,
75,
2883,
18,
14861,
4385,
67,
2704,
67,
2080,
67,
768,
12,
1140,
18,
803,
18,
5701,
... | |
p -- a prime (default: 0); just the p-new subspace if given | p -- a prime (default: 0); just the $p$-new subspace if given | def dimension_new_cusp_forms_eps(eps, k=2, p=0): """ Dimension of the new subspace (or p-new subspace) of cusp forms of weight k and character eps. INPUT: eps -- a Dirichlet character k -- an integer (ddefault: 2) p -- a prime (default: 0); just the p-new subspace if given OUTPUT: Integer EXAMPLES: sage: G = DirichletGroup(9) sage: eps = G.0^3 sage: eps.conductor() 3 sage: [sage.modular.dims.dimension_new_cusp_forms_eps(eps, k) for k in [2..10]] [0, 0, 0, 2, 0, 2, 0, 2, 0] sage: [sage.modular.dims.dimension_cusp_forms_eps(eps, k) for k in [2..10]] [0, 0, 0, 2, 0, 4, 0, 6, 0] sage: [sage.modular.dims.dimension_new_cusp_forms_eps(eps, k, 3) for k in [2..10]] [0, 0, 0, 2, 0, 2, 0, 2, 0] Double check using modular symbols (independent calculation): sage: [ModularSymbols(eps,k,sign=1).cuspidal_subspace().new_subspace().dimension() for k in [2..10]] [0, 0, 0, 2, 0, 2, 0, 2, 0] sage: [ModularSymbols(eps,k,sign=1).cuspidal_subspace().new_subspace(3).dimension() for k in [2..10]] [0, 0, 0, 2, 0, 2, 0, 2, 0] Another example at level 33: sage: G = DirichletGroup(33) sage: eps = G.1 sage: eps.conductor() 11 sage: [sage.modular.dims.dimension_new_cusp_forms_eps(G.1, k) for k in [2..4]] [0, 4, 0] sage: [sage.modular.dims.dimension_new_cusp_forms_eps(G.1^2, k) for k in [2..4]] [2, 0, 6] sage: [sage.modular.dims.dimension_new_cusp_forms_eps(G.1^2, k, 3) for k in [2..4]] [2, 0, 6] """ if not isinstance(eps, dirichlet.DirichletCharacter): raise TypeError, "eps = (%s) must be a DirichletCharacter"%eps if k < 0: return Z(0) if eps.is_even(): if k % 2 == 1: return Z(0) else: # odd if k % 2 == 0: return Z(0) if k == 0: return Z(0) elif k == 1: raise NotImplementedError, "Computation of dimensions of spaces of weight 1 modular forms not implemented." N = eps.modulus() if p == 0 or N%p != 0 or valuation(eps.conductor(),p) == valuation(N,p): D = [eps.conductor()*d for d in divisors(N//eps.conductor())] return sum([dimension_cusp_forms_eps(eps.restrict(M), k)*mumu(N//M) for M in D]) eps_p = eps.restrict(N//p) old = dimension_cusp_forms(eps_p, k) return dimension_cusp_forms(eps, k) - 2*old | 2d5430f87d71c70bab3397c63a6cf10def24c15d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2d5430f87d71c70bab3397c63a6cf10def24c15d/dims.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4968,
67,
2704,
67,
71,
407,
84,
67,
9741,
67,
13058,
12,
13058,
16,
417,
33,
22,
16,
293,
33,
20,
4672,
3536,
13037,
434,
326,
394,
720,
2981,
261,
280,
293,
17,
2704,
720,
2981,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4968,
67,
2704,
67,
71,
407,
84,
67,
9741,
67,
13058,
12,
13058,
16,
417,
33,
22,
16,
293,
33,
20,
4672,
3536,
13037,
434,
326,
394,
720,
2981,
261,
280,
293,
17,
2704,
720,
2981,
... |
""" | """ | def fl_get_filename(): """ fl_get_filename() -> filename string """ retval = _fl_get_filename() return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
3459,
13332,
3536,
1183,
67,
588,
67,
3459,
1435,
317,
1544,
533,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67,
3459,
1435,
327,
5221,
282,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
588,
67,
3459,
13332,
3536,
1183,
67,
588,
67,
3459,
1435,
317,
1544,
533,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67,
3459,
1435,
327,
5221,
282,
2,
-100,
-100,
-100,
-100... |
expr = unicode('[A-Z]', 'utf-8') if not re.match(expr, idx): | else: idx = idx.encode('utf-8') if not re.match('[A-Z]', idx): | def data(self): context = Acquisition.aq_inner(self.context) query = self.buildQuery() portal_catalog = getToolByName(context, 'portal_catalog') if hasattr(portal_catalog, 'getZCatalog'): portal_catalog = portal_catalog.getZCatalog() results = portal_catalog.evalAdvancedQuery(query, (('sortable_title','asc'),)) | 4cb20a7520466a743f140e09a0dbdb9a420661ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6871/4cb20a7520466a743f140e09a0dbdb9a420661ed/glossary.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
4672,
819,
273,
12848,
22094,
18,
69,
85,
67,
7872,
12,
2890,
18,
2472,
13,
843,
273,
365,
18,
3510,
1138,
1435,
11899,
67,
7199,
273,
336,
6364,
5911,
12,
2472,
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,
501,
12,
2890,
4672,
819,
273,
12848,
22094,
18,
69,
85,
67,
7872,
12,
2890,
18,
2472,
13,
843,
273,
365,
18,
3510,
1138,
1435,
11899,
67,
7199,
273,
336,
6364,
5911,
12,
2472,
16,
2... |
datadir = config["datadir"] dirname = data["root_datadir"] if os.path.isfile(dirname): dirname = os.path.dirname(dirname) template_files = None while len(dirname) >= len(datadir): template_files = tools.Walk(self._request, dirname, 1, pattern) if template_files: break dirname = os.path.split(dirname)[0] | template_files = os.listdir(flavourdir) template_files = [flavourdir + os.sep + m for m in template_files if m.endswith("." + taste)] | def _getFlavour(self, taste='html'): """ Flavours, or views, or templates, as some may call it, defaults are given, but can be overidden with files on the datadir. Don't like the default html templates, add your own, head.html, story.html etc. """ data = self._request.getData() config = self._request.getConfiguration() | 2650d3b87c62181d9bfa8d18c12821ad50d1cec2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/2650d3b87c62181d9bfa8d18c12821ad50d1cec2/blosxom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
2340,
842,
477,
12,
2890,
16,
268,
14725,
2218,
2620,
11,
4672,
3536,
3857,
842,
4390,
16,
578,
7361,
16,
578,
5539,
16,
487,
2690,
2026,
745,
518,
16,
3467,
854,
864,
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,
389,
588,
2340,
842,
477,
12,
2890,
16,
268,
14725,
2218,
2620,
11,
4672,
3536,
3857,
842,
4390,
16,
578,
7361,
16,
578,
5539,
16,
487,
2690,
2026,
745,
518,
16,
3467,
854,
864,
16,
... |
for i in range((len(ids) / ID_MAX) + \ ((len(ids) % ID_MAX) and 1 or 0)): sub_ids = ids[ID_MAX * i:ID_MAX * (i + 1)] str_d = string.join(('%d',) * len(sub_ids), ',') if domain1: cursor.execute('SELECT id FROM "'+self._table+'" ' \ 'WHERE id IN (' + str_d + ') ' + domain1, sub_ids + domain2) if not cursor.rowcount == len({}.fromkeys(ids)): raise ExceptORM('AccessError', 'You try to bypass an access rule ' \ '(Document type: %s).' % self._description) cursor.execute('DELETE FROM inherit ' \ 'WHERE (obj_type = %s AND obj_id IN ('+str_d+')) ' \ 'OR (inst_type = %s AND inst_id IN ('+str_d+'))', ((self._name,) + tuple(sub_ids) + \ (self._name,) + tuple(sub_ids))) if domain: cursor.execute('DELETE FROM "'+self._table+'" ' \ 'WHERE id IN (' + str_d + ') ' + domain1, sub_ids + domain2) else: cursor.execute('DELETE FROM "'+self._table+'" ' \ 'WHERE id IN (' + str_d + ')', sub_ids) | for i in range((len(ids) / ID_MAX) + \ ((len(ids) % ID_MAX) and 1 or 0)): sub_ids = ids[ID_MAX * i:ID_MAX * (i + 1)] str_d = ','.join(('%d',) * len(sub_ids)) if domain1: cursor.execute('SELECT id FROM "'+self._table+'" ' \ 'WHERE id IN (' + str_d + ') ' + domain1, sub_ids + domain2) if not cursor.rowcount == len({}.fromkeys(ids)): raise ExceptORM('AccessError', 'You try to bypass an access rule ' \ '(Document type: %s).' % self._description) cursor.execute('DELETE FROM inherit ' \ 'WHERE (obj_type = %s AND obj_id IN ('+str_d+')) ' \ 'OR (inst_type = %s AND inst_id IN ('+str_d+'))', ((self._name,) + tuple(sub_ids) + \ (self._name,) + tuple(sub_ids))) if domain1: cursor.execute('DELETE FROM "'+self._table+'" ' \ 'WHERE id IN (' + str_d + ') ' + domain1, sub_ids + domain2) else: cursor.execute('DELETE FROM "'+self._table+'" ' \ 'WHERE id IN (' + str_d + ')', sub_ids) | def unlink(self, cursor, user, ids, context=None): if context is None: context = {} if not ids: return True if isinstance(ids, (int, long)): ids = [ids] delta = context.get('read_delta', False) if delta and self._log_access: for i in range((len(ids) / ID_MAX) + \ ((len(ids) % ID_MAX) and 1 or 0)): sub_ids = ids[ID_MAX * i:ID_MAX * (i + 1)] cursor.execute( "SELECT (now() - min(write_date)) <= '%s'::interval " \ "FROM \"%s\" WHERE id in (%s)" % \ (delta, self._table, ",".join([str(x) for x in sub_ids]))) res = cursor.fetchone() if res and res[0]: raise ExceptORM('ConcurrencyException', 'This record was modified in the meanwhile') | 9e0ae9536dc7834898d295ba30f5cd42568d3a14 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9266/9e0ae9536dc7834898d295ba30f5cd42568d3a14/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
309,
486,
3258,
30,
327,
1053,
309,
1549,
12,
2232,
16,
261,
474,
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,
8255,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
309,
486,
3258,
30,
327,
1053,
309,
1549,
12,
2232,
16,
261,
474,
16,
... |
'except': 'except', | 'except': 'try', | def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" if done is None: done = {} for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath): writedoc(modname) return | 87936c71021d9a681449d24e2ed4c60f0fb1304b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/87936c71021d9a681449d24e2ed4c60f0fb1304b/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
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,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
273,... |
self.__touchViss[event.cursorid].move(event) | touchVis.move(event) | def __showMTEventHook(self, event): if isinstance(event, avg.TouchEvent) and event.source == avg.TOUCH: if event.type == avg.CURSORDOWN: self.__touchViss[event.cursorid] = TouchVisualization(event, parent=self.__touchVisOverlay) elif event.type == avg.CURSORMOTION: self.__touchViss[event.cursorid].move(event) elif event.type == avg.CURSORUP: self.__touchViss[event.cursorid].unlink(True) del self.__touchViss[event.cursorid] if self.__oldEventHook: return self.__oldEventHook() else: return False | c54cee01a069914e3fbf52d025e56410e8007bc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/c54cee01a069914e3fbf52d025e56410e8007bc7/AVGAppStarter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4500,
6152,
1133,
5394,
12,
2890,
16,
871,
4672,
309,
1549,
12,
2575,
16,
11152,
18,
10491,
1133,
13,
471,
871,
18,
3168,
422,
11152,
18,
4296,
57,
1792,
30,
309,
871,
18,
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,
4500,
6152,
1133,
5394,
12,
2890,
16,
871,
4672,
309,
1549,
12,
2575,
16,
11152,
18,
10491,
1133,
13,
471,
871,
18,
3168,
422,
11152,
18,
4296,
57,
1792,
30,
309,
871,
18,
723,
... |
""" | ''' | def testViewThatProvidesAnInterface(self): request = TestRequest() self.assertEqual(queryView(ob, 'test', request, None), None) | 1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1767,
18163,
17727,
979,
1358,
12,
2890,
4672,
590,
273,
7766,
691,
1435,
365,
18,
11231,
5812,
12,
2271,
1767,
12,
947,
16,
296,
3813,
2187,
590,
16,
599,
3631,
599,
13,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1767,
18163,
17727,
979,
1358,
12,
2890,
4672,
590,
273,
7766,
691,
1435,
365,
18,
11231,
5812,
12,
2271,
1767,
12,
947,
16,
296,
3813,
2187,
590,
16,
599,
3631,
599,
13,
2,
-100... |
self.binary = 1 | if HIGHEST_PROTOCOL: self.protocol = HIGHEST_PROTOCOL else: self.protocol = 1 | def __init__(self, dbenv=None): self.db = db.DB(dbenv) self.binary = 1 | f9c4a8b0d48c7569ef7f49ce143062df7be08a95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/f9c4a8b0d48c7569ef7f49ce143062df7be08a95/dbshelve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1319,
3074,
33,
7036,
4672,
365,
18,
1966,
273,
1319,
18,
2290,
12,
1966,
3074,
13,
365,
18,
8578,
273,
404,
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,
1001,
2738,
972,
12,
2890,
16,
1319,
3074,
33,
7036,
4672,
365,
18,
1966,
273,
1319,
18,
2290,
12,
1966,
3074,
13,
365,
18,
8578,
273,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def onRemoveItemEvent(self, event): | def onRemoveEvent(self, event): | def onRemoveItemEvent(self, event): """ Permanently remove the collection - we eventually need a user confirmation here """ def deleteItem(item): # TODO: for item collectionsactually call item.delete(), # and also delete any items that exist only in the # doomed itemcollection (garbage collection would be a # big help here) | 7207560c5095c4a188a7748f8fdb81de55e60379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/7207560c5095c4a188a7748f8fdb81de55e60379/SideBar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3288,
1133,
12,
2890,
16,
871,
4672,
3536,
13813,
12055,
715,
1206,
326,
1849,
300,
732,
18011,
1608,
279,
729,
14296,
2674,
3536,
1652,
1430,
1180,
12,
1726,
4672,
468,
2660,
30,
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,
603,
3288,
1133,
12,
2890,
16,
871,
4672,
3536,
13813,
12055,
715,
1206,
326,
1849,
300,
732,
18011,
1608,
279,
729,
14296,
2674,
3536,
1652,
1430,
1180,
12,
1726,
4672,
468,
2660,
30,
3... |
if self._port and self._root: mappings = [{'port': self._port, 'docroot': self._root}] | if self._root: if self._port: mappings = [{'port': self._port, 'docroot': self._root}] else: mappings = [ {'port': 8000, 'docroot': self._root}, {'port': 8080, 'docroot': self._root}, {'port': 8443, 'docroot': self._root, 'sslcert': Lighttpd._pem_file} ] | def Start(self): if self.IsRunning(): raise 'Lighttpd already running' | a843a3fde6e142db763e90030cbbeac0ebe0dac1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/a843a3fde6e142db763e90030cbbeac0ebe0dac1/http_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3603,
12,
2890,
4672,
309,
365,
18,
2520,
7051,
13332,
1002,
296,
12128,
6834,
72,
1818,
3549,
11,
2,
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,
3603,
12,
2890,
4672,
309,
365,
18,
2520,
7051,
13332,
1002,
296,
12128,
6834,
72,
1818,
3549,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if font is None: ImageDraw.ImageDraw.text(self, xy, string, fill=fill, font=ttfont) | if ttfont is None: if scale == 1: ImageDraw.ImageDraw.text(self, xy, string, fill=fill) else: size = self.textsize(string) image = Image.new('RGBA', size) draw = ImageDraw.Draw(image) draw.text((0, 0), string, fill=fill) del draw basesize = (size[0] * 2, size[1] * 2) text_image = image.resize(basesize, Image.ANTIALIAS) self.image.paste(text_image, xy, text_image) | def truetypeText(self, xy, string, **kwargs): fill = kwargs.get('fill') font = kwargs.get('font') fontsize = kwargs.get('fontsize', 11) ttfont = self.setupFont(font, fontsize) | 1611c7cdabe4372a729b6cf8f378ae5e9645662c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/81/1611c7cdabe4372a729b6cf8f378ae5e9645662c/DiagramDraw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
433,
89,
5872,
1528,
12,
2890,
16,
7668,
16,
533,
16,
2826,
4333,
4672,
3636,
273,
1205,
18,
588,
2668,
5935,
6134,
3512,
273,
1205,
18,
588,
2668,
5776,
6134,
14869,
273,
1205,
18,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
433,
89,
5872,
1528,
12,
2890,
16,
7668,
16,
533,
16,
2826,
4333,
4672,
3636,
273,
1205,
18,
588,
2668,
5935,
6134,
3512,
273,
1205,
18,
588,
2668,
5776,
6134,
14869,
273,
1205,
18,
58... |
v.prepend_value('CPPPATH', conf.environ['INCLUDE']) v.prepend_value('LIBPATH', conf.environ['LIB']) | def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != 'win32': conf.fatal('MSVC module only works under native Win32 Python! cygwin is not supported yet') v = conf.env compiler = v['MSVC_COMPILER'] or 'msvc' path = v['PATH'] if compiler=='msvc': compiler_name = 'CL' linker_name = 'LINK' lib_name = 'LIB' else: compiler_name = 'ICL' linker_name = 'XILINK' lib_name = 'XILIB' # compiler cxx = None if v['CXX']: cxx = v['CXX'] elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path) if not cxx: conf.fatal('%s was not found (compiler)' % compiler_name) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH = ';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, env=env): conf.fatal('the msvc compiler could not be identified') # c/c++ compiler v['CC'] = v['CXX'] = cxx v['CC_NAME'] = v['CXX_NAME'] = 'msvc' # environment flags v.prepend_value('CPPPATH', conf.environ['INCLUDE']) v.prepend_value('LIBPATH', conf.environ['LIB']) # linker if not v['LINK_CXX']: link = conf.find_program(linker_name, path_list=path) if link: v['LINK_CXX'] = link else: conf.fatal('%s was not found (linker)' % linker_name) v['LINK'] = link if not v['LINK_CC']: v['LINK_CC'] = v['LINK_CXX'] # staticlib linker if not v['STLIBLINK']: stliblink = conf.find_program(lib_name, path_list=path) if not stliblink: return v['STLIBLINK'] = stliblink v['STLINKFLAGS'] = ['/NOLOGO'] # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later manifesttool = conf.find_program('MT', path_list=path) if manifesttool: v['MT'] = manifesttool v['MTFLAGS'] = ['/NOLOGO'] conf.check_tool('winres') if not conf.env['WINRC']: warn('Resource compiler not found. Compiling resource file is disabled') | ec4bfaec0f2ea9e6b7e203e2cbde2de37419f6cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7302/ec4bfaec0f2ea9e6b7e203e2cbde2de37419f6cd/msvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
959,
4227,
12,
3923,
4672,
468,
6541,
358,
589,
740,
31810,
16,
1800,
1674,
1338,
358,
6448,
21628,
1578,
18,
1624,
73,
9795,
518,
1597,
363,
87,
18,
309,
2589,
18,
9898,
480... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
959,
4227,
12,
3923,
4672,
468,
6541,
358,
589,
740,
31810,
16,
1800,
1674,
1338,
358,
6448,
21628,
1578,
18,
1624,
73,
9795,
518,
1597,
363,
87,
18,
309,
2589,
18,
9898,
480... | |
if nText!='' and nText[0]!=' ': | if (nText!='' and nText[0]!=' ') or hasattr(f,'cbDefn'): | def breakLines(self, width): """ Returns a broken line structure. There are two cases A) For the simple case of a single formatting input fragment the output is A fragment specifier with kind = 0 fontName, fontSize, leading, textColor lines= A list of lines Each line has two items. 1) unused width in points 2) word list | 4053ccde74e7c74099e1cffeb6655b5a605674ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/4053ccde74e7c74099e1cffeb6655b5a605674ab/paragraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
898,
5763,
12,
2890,
16,
1835,
4672,
3536,
2860,
279,
12933,
980,
3695,
18,
6149,
854,
2795,
6088,
225,
432,
13,
2457,
326,
4143,
648,
434,
279,
2202,
10407,
810,
5481,
326,
876,
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,
898,
5763,
12,
2890,
16,
1835,
4672,
3536,
2860,
279,
12933,
980,
3695,
18,
6149,
854,
2795,
6088,
225,
432,
13,
2457,
326,
4143,
648,
434,
279,
2202,
10407,
810,
5481,
326,
876,
353,
... |
def end_boolean(self, join=string.join): value = join(self._data, "") if value == "0": | dispatch = {} def end_boolean(self, data): if data == "0": | def end_boolean(self, join=string.join): value = join(self._data, "") if value == "0": self.append(False) elif value == "1": self.append(True) else: raise TypeError, "bad boolean value" self._value = 0 | 80ead46c3b0b9513bc116e8fe08faa2f91145a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/80ead46c3b0b9513bc116e8fe08faa2f91145a91/xmlrpclib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3435,
273,
2618,
225,
1652,
679,
67,
6494,
12,
2890,
16,
501,
4672,
309,
501,
422,
315,
20,
6877,
365,
18,
6923,
12,
8381,
13,
1327,
460,
422,
315,
21,
6877,
365,
18,
6923,
12,
5510,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3435,
273,
2618,
225,
1652,
679,
67,
6494,
12,
2890,
16,
501,
4672,
309,
501,
422,
315,
20,
6877,
365,
18,
6923,
12,
8381,
13,
1327,
460,
422,
315,
21,
6877,
365,
18,
6923,
12,
5510,
13,
... |
self.dtp.factory = self return self.dtp | def buildProtocol(self,addr): p = DTP() p.factory = self p.pi = self p.transport = self.dtpPort if self.dtpPort: p.DTPLoseConnection = self.dtpPort.loseConnection self.dtp = p return p | def buildProtocol(self, addr): self.dtp = DTP() self.dtp.pi = self self.dtp.factory = self return self.dtp | 07377cad2b39b3e3d459447a924d1bc82ce72f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07377cad2b39b3e3d459447a924d1bc82ce72f33/ftp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5752,
12,
2890,
16,
3091,
4672,
365,
18,
72,
6834,
273,
10696,
52,
1435,
365,
18,
72,
6834,
18,
7259,
273,
365,
365,
18,
72,
6834,
18,
6848,
273,
365,
327,
365,
18,
72,
6834,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5752,
12,
2890,
16,
3091,
4672,
365,
18,
72,
6834,
273,
10696,
52,
1435,
365,
18,
72,
6834,
18,
7259,
273,
365,
365,
18,
72,
6834,
18,
6848,
273,
365,
327,
365,
18,
72,
6834,
... |
char.frozen = int( textentries[ key ] ) | char.frozen = str2bool( textentries[ key ] ) | def charinfo_response( player, args, choice ): socket = player.socket char = args[0] if choice.button == 0 or not char or not socket: return 1 # check for rank #if char.rank >= player.rank and not player == char: # socket.sysmessage( "You've burnt your fingers!" ) # return 1 textentries = choice.text keys = textentries.keys() for key in keys: if key == 1: char.name = textentries[ key ] elif key == 2: char.title = textentries[ key ] elif key == 3: char.id = int( hex2dec( textentries[ key ] ) ) elif key == 4: char.orgid = int( hex2dec( textentries[ key ] ) ) elif key == 5: char.skin = int( hex2dec( textentries[ key ] ) ) elif key == 6: char.orgskin = int( hex2dec( textentries[ key ] ) ) elif key == 7: char.fame = int( textentries[ key ] ) elif key == 8: char.karma = int( textentries[ key ] ) elif key == 9: char.kills = int( textentries[ key ] ) elif key == 10: char.deaths = int( textentries[ key ] ) elif key == 11: char.pos = ( textentries[ key ] ) elif key == 12: char.direction = int( textentries[ key ] ) elif key == 13: char.invulnerable = int( textentries[ key ] ) elif key == 14: char.strength = int( textentries[ key ] ) elif key == 15: char.dexterity = int( textentries[ key ] ) elif key == 16: char.intelligence = int( textentries[ key ] ) elif key == 17: char.maxhitpoints = int( textentries[ key ] ) elif key == 18: char.hitpoints = int( textentries[ key ] ) elif key == 19: char.maxstamina = int( textentries[ key ] ) elif key == 20: char.stamina = int( textentries[ key ] ) elif key == 21: char.maxmana = int( textentries[ key ] ) elif key == 22: char.mana = int( textentries[ key ] ) elif key == 23: char.hidden = int( textentries[ key ] ) elif key == 24: char.dead = int( textentries[ key ] ) elif key == 25: char.polymorph = int( textentries[ key ] ) elif key == 26: char.incognito = int( textentries[ key ] ) elif key == 27: char.hunger = int( textentries[ key ] ) elif key == 28: char.war = int( textentries[ key ] ) elif key == 29: char.invisible = int( textentries[ key ] ) elif key == 30: char.frozen = int( textentries[ key ] ) elif key == 31: char.stealthedsteps = int( textentries[ key ] ) elif key == 32: char.strength2 = int( hex2dec( textentries[ key ] ) ) elif key == 33: char.dexterity2 = int( hex2dec( textentries[ key ] ) ) elif key == 34: char.intelligence2 = int( hex2dec( textentries[ key ] ) ) elif key == 35: char.saycolor = int( hex2dec( textentries[ key ] ) ) elif key == 36: char.emotecolor = int( hex2dec( textentries[ key ] ) ) elif key == 37: if ( textentries[key] ) == "female": char.gender = 1 elif ( textentries[key] ) == "male": char.gender = 0 elif ( textentries[key] ) == "none": char.gender = 0 elif len(textentries[key]) == 1: if ( int( textentries[ key ] ) < 0 ) or ( int( textentries[ key ] ) > 1 ): char.gender = 0 else: char.gender = int( textentries[ key ] ) elif key == 38: if not char.npc: char.account.name = textentries[ key ] else: if ( textentries[ key ] ) == 'Null' or ( textentries[ key ] ) == 'None': char.owner = 'None' else: char.owner = int( textentries[ key ] ) elif key == 39: if not char.npc: char.visrange = int( textentries[ key ] ) #else: # char.spawnregion = ( textentries[ key ] ) elif key == 40: if not char.npc: char.lightbonus = int( textentries[ key ] ) #else: # char.carve = ( textentries[ key ] ) elif key == 41: if not char.npc: char.profile = textentries[ key ] elif key == 42: if not char.npc: if (textentries[ key ]) == '': if char.hastag( 'guild' ): char.deltag( 'guild' ) else: char.settag( 'guild', int( hex2dec( textentries[ key ] ) ) ) elif key == 43: if not char.npc: if (textentries[ key ]) == '': if char.hastag( 'notoriety' ): char.deltag( 'notoriety' ) else: char.settag( 'notoriety', int( textentries[ key ] ) ) #elif char.npc: # if not textentries[ key ] == '': # char.mindamage = int( textentries[ key ] ) elif key == 44: if not char.npc: if (textentries[ key ]) == '': if char.hastag( 'poisoned' ): char.deltag( 'poisoned' ) else: char.settag( 'poisoned', int( textentries[ key ] ) ) #elif char.npc: # if not textentries[ key ] == '': # char.maxdamage = int( textentries[ key ] ) elif key == 46: if char.npc: if textentries[ key ] == '' or int(textentries[ key ]) <= 0: if char.hastag( 'dmg_fire' ): char.deltag( 'dmg_fire' ) elif int( textentries[ key ] ) <= 100: char.settag( 'dmg_fire', int( textentries[ key ] ) ) elif key == 47: if char.npc: if textentries[ key ] == '' or int(textentries[ key ]) <= 0: if char.hastag( 'dmg_cold' ): char.deltag( 'dmg_cold' ) elif int( textentries[ key ] ) <= 100: char.settag( 'dmg_cold', int( textentries[ key ] ) ) elif key == 48: if char.npc: if textentries[ key ] == '' or int(textentries[ key ]) <= 0: if char.hastag( 'dmg_poison' ): char.deltag( 'dmg_poison' ) elif int( textentries[ key ] ) <= 100: char.settag( 'dmg_poison', int( textentries[ key ] ) ) elif key == 49: if char.npc: if textentries[ key ] == '' or int(textentries[ key ]) <= 0: if char.hastag( 'dmg_energy' ): char.deltag( 'dmg_energy' ) elif int( textentries[ key ] ) <= 100: char.settag( 'dmg_energy', int( textentries[ key ] ) ) elif key == 50: if char.npc: if (textentries[ key ]) == '' or int(textentries[ key ]) == 0: if char.hastag( 'res_physical' ): char.deltag( 'res_physical' ) else: char.settag( 'res_physical', int( textentries[ key ] ) ) elif key == 51: if char.npc: if (textentries[ key ]) == '' or int(textentries[ key ]) == 0: if char.hastag( 'res_fire' ): char.deltag( 'res_fire' ) elif int( textentries[ key ] ) <= 100: char.settag( 'res_fire', int( textentries[ key ] ) ) elif key == 52: if char.npc: if (textentries[ key ]) == '' or int(textentries[ key ]) == 0: if char.hastag( 'res_cold' ): char.deltag( 'res_cold' ) elif int( textentries[ key ] ) <= 100: char.settag( 'res_cold', int( textentries[ key ] ) ) elif key == 53: if char.npc: if (textentries[ key ]) == '' or int(textentries[ key ]) == 0: if char.hastag( 'res_poison' ): char.deltag( 'res_poison' ) elif int( textentries[ key ] ) <= 100: char.settag( 'res_poison', int( textentries[ key ] ) ) elif key == 54: if char.npc: if (textentries[ key ]) == '' or int(textentries[ key ]) == 0: if char.hastag( 'res_energy' ): char.deltag( 'res_energy' ) elif int( textentries[ key ] ) <= 100: char.settag( 'res_energy', int( textentries[ key ] ) ) if choice.button == 1: charinfo( socket, char ) char.update() return 1 | 02db11658d92161398ef40c48df266b74fc14e36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/02db11658d92161398ef40c48df266b74fc14e36/info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1149,
1376,
67,
2740,
12,
7291,
16,
833,
16,
6023,
262,
30,
2987,
273,
7291,
18,
7814,
1149,
273,
833,
63,
20,
65,
309,
6023,
18,
5391,
422,
374,
578,
486,
1149,
578,
486,
2987,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1149,
1376,
67,
2740,
12,
7291,
16,
833,
16,
6023,
262,
30,
2987,
273,
7291,
18,
7814,
1149,
273,
833,
63,
20,
65,
309,
6023,
18,
5391,
422,
374,
578,
486,
1149,
578,
486,
2987,
30,
... |
self.listenerTCP.loseConnection() d = defer.maybeDeferred(self.listenerUDP.stopListening) | """Asynchronously disconnect listenerTCP, listenerUDP and resolver""" d1 = self.listenerTCP.loseConnection() d2 = defer.maybeDeferred(self.listenerUDP.stopListening) d = defer.gatherResults([d1, d2]) | def tearDown(self): self.listenerTCP.loseConnection() d = defer.maybeDeferred(self.listenerUDP.stopListening) def disconnectTransport(ignored): if getattr(self.resolver.protocol, 'transport', None) is not None: return self.resolver.protocol.transport.stopListening() d.addCallback(disconnectTransport) d.addCallback(lambda x : self.failUnless( self.listenerUDP.disconnected and self.listenerTCP.disconnected)) return d | 208054dd22eacf6ec28ee6065ea7ed8cf531641d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/208054dd22eacf6ec28ee6065ea7ed8cf531641d/test_names.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
3536,
1463,
24845,
9479,
2991,
13891,
16,
2991,
20352,
471,
5039,
8395,
302,
21,
273,
365,
18,
12757,
13891,
18,
2061,
1952,
1435,
302,
22,
273,
2220,
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,
268,
2091,
4164,
12,
2890,
4672,
3536,
1463,
24845,
9479,
2991,
13891,
16,
2991,
20352,
471,
5039,
8395,
302,
21,
273,
365,
18,
12757,
13891,
18,
2061,
1952,
1435,
302,
22,
273,
2220,
18... |
self.right_term_weight * self.shape_factor_right * (1. / term2)) | self.right_term_weight * self.shape_factor_right * tmp) | def gradient(self, u_isos): assert u_isos.size() > 0 result = flex.double() for u in u_isos: arg1 = self.shape_factor_left * (self.u_min - u) arg2 = self.shape_factor_right * (self.u_max - u) if(u > self.right_limit or u < self.left_limit): if(arg1 > self.overflow_limit): term1 = math.exp(700) else: term1 = math.exp(arg1) if(arg2 > self.overflow_limit): term2 = math.exp(700) else: term2 = math.exp(arg2) result.append( -self.left_term_weight * self.shape_factor_left * term1 + \ self.right_term_weight * self.shape_factor_right * (1. / term2)) else: result.append(0.0) return result / u_isos.size() | bfd2bea68c116864fd0bb4e1ccab07e25bcd9507 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/bfd2bea68c116864fd0bb4e1ccab07e25bcd9507/minimization.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10292,
12,
2890,
16,
582,
67,
291,
538,
4672,
1815,
582,
67,
291,
538,
18,
1467,
1435,
405,
374,
563,
273,
16600,
18,
9056,
1435,
364,
582,
316,
582,
67,
291,
538,
30,
1501,
21,
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,
10292,
12,
2890,
16,
582,
67,
291,
538,
4672,
1815,
582,
67,
291,
538,
18,
1467,
1435,
405,
374,
563,
273,
16600,
18,
9056,
1435,
364,
582,
316,
582,
67,
291,
538,
30,
1501,
21,
273,... |
_fl_add_labelbutton = cfuncproto(so_libforms, "fl_add_labelbutton", | _fl_add_labelbutton = cfuncproto(so_libforms, "fl_add_labelbutton", | def fl_add_scrollbutton(type, x, y, w, h, label): """ fl_add_scrollbutton(type, x, y, w, h, label) -> object """ retval = _fl_add_scrollbutton(type, x, y, w, h, label) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
12033,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
1289,
67,
12033,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
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,
1183,
67,
1289,
67,
12033,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
1289,
67,
12033,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16... |
return (self.formatter.url(1, words[0], 'external', unescaped=1) + | return (self.formatter.url(1, words[0], css='external', unescaped=1) + | def _url_bracket_repl(self, word): """Handle bracketed URLs.""" | 6c45d0daee8f78aac05aa72e34a881edf98b1f34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/6c45d0daee8f78aac05aa72e34a881edf98b1f34/wiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
718,
67,
21025,
67,
26745,
12,
2890,
16,
2076,
4672,
3536,
3259,
9843,
329,
10414,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
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,
389,
718,
67,
21025,
67,
26745,
12,
2890,
16,
2076,
4672,
3536,
3259,
9843,
329,
10414,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
sources=[join('src', 'npymath', 'npy_math.c.src'), floupi], | sources=[join('src', 'npymath', 'npy_math.c.src'), generate_npymath_ini], | def floupi(ext, build_dir): from numpy.distutils.misc_util import get_cmd install_dir = get_cmd('install').install_libbase npymath_install_dir = os.path.join(install_dir, 'numpy', 'core') npymath_install_dir = os.path.abspath(npymath_install_dir) | ce55f14c83259b6ce3ba0d91c0128324a330e2aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/ce55f14c83259b6ce3ba0d91c0128324a330e2aa/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20802,
416,
77,
12,
408,
16,
1361,
67,
1214,
4672,
628,
3972,
18,
4413,
5471,
18,
23667,
67,
1367,
1930,
336,
67,
4172,
3799,
67,
1214,
273,
336,
67,
4172,
2668,
5425,
16063,
5425,
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,
20802,
416,
77,
12,
408,
16,
1361,
67,
1214,
4672,
628,
3972,
18,
4413,
5471,
18,
23667,
67,
1367,
1930,
336,
67,
4172,
3799,
67,
1214,
273,
336,
67,
4172,
2668,
5425,
16063,
5425,
67,... |
raise NotImplementedError | index = 0 for x in a: if x == b: return index index += 1 raise ValueError, 'sequence.index(x): x not in sequence' | def indexOf(a, b): 'indexOf(a, b) -- Return the first index of b in a.' raise NotImplementedError | 39c5737ba98e6027e2af425491ab21c58fd0ced2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/39c5737ba98e6027e2af425491ab21c58fd0ced2/operator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3133,
12,
69,
16,
324,
4672,
296,
31806,
12,
69,
16,
324,
13,
1493,
2000,
326,
1122,
770,
434,
324,
316,
279,
1093,
1002,
11206,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3133,
12,
69,
16,
324,
4672,
296,
31806,
12,
69,
16,
324,
13,
1493,
2000,
326,
1122,
770,
434,
324,
316,
279,
1093,
1002,
11206,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
l = [1L, 2L, 3L, 4L, 5L] * (size // 5) | l = [1L, 2L, 3L, 4L, 5L] * size size *= 5 | def test_index(self, size): l = [1L, 2L, 3L, 4L, 5L] * (size // 5) self.assertEquals(l.index(1), 0) self.assertEquals(l.index(5, size - 5), size - 1) self.assertEquals(l.index(5, size - 5, size), size - 1) self.assertRaises(ValueError, l.index, 1, size - 4, size) self.assertRaises(ValueError, l.index, 6L) | 636d1adc496d164c344c7505fdccb652d190f169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/636d1adc496d164c344c7505fdccb652d190f169/test_bigmem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1615,
12,
2890,
16,
963,
4672,
328,
273,
306,
21,
48,
16,
576,
48,
16,
890,
48,
16,
1059,
48,
16,
1381,
48,
65,
380,
963,
963,
6413,
1381,
365,
18,
11231,
8867,
12,
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,
1842,
67,
1615,
12,
2890,
16,
963,
4672,
328,
273,
306,
21,
48,
16,
576,
48,
16,
890,
48,
16,
1059,
48,
16,
1381,
48,
65,
380,
963,
963,
6413,
1381,
365,
18,
11231,
8867,
12,
80,
... |
msg = "server is not initialized for RLS connections" logger.error(msg) return (1, msg) | global logger global xmlparser, dbobj, rls logger.debug("Method insertmap called") if not rls: msg = "server is not initialized for RLS connections" logger.error(msg) return (1, msg) code = 1 try: lfnpfn_dict = cPickle.loads(arg[1]) if not isinstance(lfnpfn_dict, dict): raise ServerHandlerException, \ "LFN/PFN mapping from client is not dictionary" cred = self.request.get_delegated_credential() remote_dn = cred.inquire_cred()[1].display() lwtparser = ldbd.LIGOLwParser() ligomd = ldbd.LIGOMetadata(xmlparser,lwtparser,dbobj) ligomd.parse(arg[0]) ligomd.set_dn(remote_dn) for lfn in lfnpfn_dict.keys(): ligomd.add_lfn(lfn) result = str(ligomd.insert()) logger.info("Method insert: %s rows affected by insert" % result) for lfn in lfnpfn_dict.keys(): pfns = lfnpfn_dict[lfn] if not isinstance( pfns, types.ListType ): raise ServerHandlerException, \ "PFN must be a single string or a list of PFNs" rls.lrc_create_lfn( lfn, pfns[0] ) for pfn in pfns[1:len(pfns)]: rls.lrc_add( lfn, pfn ) logger.info("Method insertmap: insert LFN mappings for %s" % str(lfnpfn_dict.keys())) code = 0 except Exception, e: result = ("Error inserting LFN/PFN mapping into RLS: %s" % e) logger.error(result) return (code,result) return (code,result) | def insertmap(self, arg): """ Insert some LIGO_LW xml data in the metadata database with an LFN to PFN mapping inserted into the RLS database. | 0054f41ea899cadb48038f4e8db82f40cc43d80f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/0054f41ea899cadb48038f4e8db82f40cc43d80f/LDBDServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
1458,
12,
2890,
16,
1501,
4672,
3536,
8040,
2690,
511,
3047,
51,
67,
48,
59,
2025,
501,
316,
326,
1982,
2063,
598,
392,
18803,
50,
358,
453,
19793,
2874,
9564,
1368,
326,
534,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2243,
1458,
12,
2890,
16,
1501,
4672,
3536,
8040,
2690,
511,
3047,
51,
67,
48,
59,
2025,
501,
316,
326,
1982,
2063,
598,
392,
18803,
50,
358,
453,
19793,
2874,
9564,
1368,
326,
534,
30... |
self.__decomp = [D[i](vals[i]) for i in range(len(D))] return self.__decomp | return [D[i](vals[i]) for i in range(len(D))] | def decomposition(self): """ Return the decomposition of self as a product of Dirichlet characters of prime power modulus, where the prime powers exactly divide the modulus of this character. EXAMPLES:: sage: G.<a,b> = DirichletGroup(20) sage: c = a*b sage: d = c.decomposition(); d [[-1], [zeta4]] sage: d[0].parent() Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2 sage: d[1].parent() Group of Dirichlet characters of modulus 5 over Cyclotomic Field of order 4 and degree 2 We can't multiply directly, since coercion of one element into the other parent fails in both cases:: sage: d[0]*d[1] == c Traceback (most recent call last): ... TypeError: unsupported operand parent(s) for '*': 'Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2' and 'Group of Dirichlet characters of modulus 5 over Cyclotomic Field of order 4 and degree 2' We can multiply if we're explicit about where we want the multiplication to take place. :: sage: G(d[0])*G(d[1]) == c True | 80bb64cda04307dbe55314d6e4fce85c5aab0086 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/80bb64cda04307dbe55314d6e4fce85c5aab0086/dirichlet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26288,
12,
2890,
4672,
3536,
2000,
326,
26288,
434,
365,
487,
279,
3017,
434,
8446,
1354,
1810,
3949,
434,
17014,
7212,
24770,
16,
1625,
326,
17014,
7602,
414,
8950,
12326,
326,
24770,
434... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26288,
12,
2890,
4672,
3536,
2000,
326,
26288,
434,
365,
487,
279,
3017,
434,
8446,
1354,
1810,
3949,
434,
17014,
7212,
24770,
16,
1625,
326,
17014,
7602,
414,
8950,
12326,
326,
24770,
434... |
'version': '20100223', 'md5': '700b9f54e740b1b962c8a3a0f52b7c04', | 'version': '20100427', 'md5': '1fe68f486bba8995f6a5cf0ed06c80f3', | def __init__(self, config): self.config = config self.source_files = self.source_files[config.arch] | 1977216e9227d7c52177cd47dc767b0313840525 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/914/1977216e9227d7c52177cd47dc767b0313840525/mingw-gcc-build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
4672,
365,
18,
1425,
273,
642,
365,
18,
3168,
67,
2354,
273,
365,
18,
3168,
67,
2354,
63,
1425,
18,
991,
65,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
4672,
365,
18,
1425,
273,
642,
365,
18,
3168,
67,
2354,
273,
365,
18,
3168,
67,
2354,
63,
1425,
18,
991,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
def dataOperation(self): | def dataOperation( self ): | def dataOperation(self): return self.__showPlotPage( "DataOperation", "/systems/accounting/dataOperation.mako" ) | 58668d6b0627a86d62021e84f19a1c9e98f1340e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12767/58668d6b0627a86d62021e84f19a1c9e98f1340e/accountingPlots.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
2988,
12,
365,
262,
30,
327,
365,
16186,
4500,
11532,
1964,
12,
315,
751,
2988,
3113,
2206,
4299,
87,
19,
4631,
310,
19,
892,
2988,
18,
81,
581,
83,
6,
262,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
501,
2988,
12,
365,
262,
30,
327,
365,
16186,
4500,
11532,
1964,
12,
315,
751,
2988,
3113,
2206,
4299,
87,
19,
4631,
310,
19,
892,
2988,
18,
81,
581,
83,
6,
262,
2,
-100,
-100,
-100,... |
print lift_dev.strides | def prepare_dev_data(self): ldis = self.ldis | b769fd037350b5e3cb3a44881d3b41eb3702788b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10367/b769fd037350b5e3cb3a44881d3b41eb3702788b/opencl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
67,
5206,
67,
892,
12,
2890,
4672,
328,
2251,
273,
365,
18,
1236,
291,
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,
2911,
67,
5206,
67,
892,
12,
2890,
4672,
328,
2251,
273,
365,
18,
1236,
291,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
p1 = pp[1]; p2 = ((pp[1]+pp[0])/2, ) if p1 and p2: self._cellDraw(color, p1, p2) | p1 = pp[1]; p2 = ((pp[1]+pp[0])/2, ) if p1 and p2: self._cellDraw(color, p1, p2) | def _anotherDraw(self, layerColor): """ The original way of selecting cookies, but do it layer by layer, so we can control how to display each layer. """ if self.havelist: glCallList(self.displist) return glNewList(self.displist, GL_COMPILE_AND_EXECUTE) for layer in self.layeredCurves.keys(): bbox = self.layeredCurves[layer][0] curves = self.layeredCurves[layer][1:] if not curves: continue color = layerColor[layer] for c in curves: c.draw() try: bblo, bbhi = bbox.data[1], bbox.data[0] allCells = genDiam(bblo-1.6, bbhi+1.6, self.latticeType) for cell in allCells: for pp in cell: p1 = p2 = None if self.isin(pp[0], curves): if self.isin(pp[1], curves): p1 = pp[0]; p2 = pp[1] else: p1 = pp[0]; p2 = ((pp[1]+pp[0])/2, ) elif self.isin(pp[1], curves): p1 = pp[1]; p2 = ((pp[1]+pp[0])/2, ) if p1 and p2: self._cellDraw(color, p1, p2) except: # bruce 041028 -- protect against exceptions while making display # list, or OpenGL will be left in an unusable state (due to the lack # of a matching glEndList) in which any subsequent glNewList is an # invalid operation. (Also done in chem.py; see more comments there.) print_compact_traceback( "bug: exception in shape.draw's displist; ignored: ") glEndList() self.havelist = 1 # | be7153ce421a674e97de640e3063c3bb1bccf4a9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/be7153ce421a674e97de640e3063c3bb1bccf4a9/shape.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
304,
3011,
6493,
12,
2890,
16,
3018,
2957,
4672,
3536,
1021,
2282,
4031,
434,
24674,
7237,
16,
1496,
741,
518,
3018,
635,
3018,
16,
1427,
732,
848,
3325,
3661,
358,
2562,
1517,
3018... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
304,
3011,
6493,
12,
2890,
16,
3018,
2957,
4672,
3536,
1021,
2282,
4031,
434,
24674,
7237,
16,
1496,
741,
518,
3018,
635,
3018,
16,
1427,
732,
848,
3325,
3661,
358,
2562,
1517,
3018... |
@attempt_time: [int] number of tries | @attempt_times: [int] number of tries | def send_email(fromaddr, toaddr, subject="", content="", html_content='', html_images={}, header=None, footer=None, html_header=None, html_footer=None, copy_to_admin=0, attempt_times=1, attempt_sleeptime=10, debug_level=0, ln=cdslang, charset='utf-8' ): """Send an forged email to TOADDR from FROMADDR with message created from subjet, content and possibly header and footer. @param fromaddr: [string] sender @param toaddr: [string] receivers separated by , @param subject: [string] subject of the email @param content: [string] content of the email @param html_content: [string] html version of the email @param html_images: [dict] dictionary of image id, image path @param header: [string] header to add, None for the Default @param footer: [string] footer to add, None for the Default @param html_header: [string] header to add to the html part, None for the Default @param html_footer: [string] footer to add to the html part, None for the Default @param copy_to_admin: [int] if 1 add emailamin in receivers @attempt_time: [int] number of tries @attempt_sleeptime: [int] seconds in between tries @debug_level: [int] debug level @ln: [string] invenio language @param charset: which charset to use in message ('utf-8' by default) If sending fails, try to send it ATTEMPT_TIMES, and wait for ATTEMPT_SLEEPTIME seconds in between tries. e.g.: send_email('foo.bar@cern.ch', 'bar.foo@cern.ch', 'Let\'s try!'', 'check 1234', '<strong>check</strong> <em>1234</em><img src="cid:image1">', {'image1': '/tmp/quantum.jpg'}) @return [bool]: True if email was sent okay, False if it was not. """ toaddr = toaddr.strip() usebcc = ',' in toaddr # More than one address, let's use Bcc in place of To if copy_to_admin: if len(toaddr) > 0: toaddr += ",%s" % (adminemail,) else: toaddr = adminemail body = forge_email(fromaddr, toaddr, subject, content, html_content, html_images, usebcc, header, footer, html_header, html_footer, ln, charset) toaddr = toaddr.split(",") if attempt_times < 1 or len(toaddr[0]) == 0: log('ERR_MISCUTIL_NOT_ATTEMPTING_SEND_EMAIL', fromaddr, toaddr, body) return False try: server = smtplib.SMTP(CFG_MISCUTIL_SMTP_HOST, CFG_MISCUTIL_SMTP_PORT) if debug_level > 2: server.set_debuglevel(1) else: server.set_debuglevel(0) server.sendmail(fromaddr, toaddr, body) server.quit() except (smtplib.SMTPException, socket.error): if attempt_times > 1: if (debug_level > 1): log('ERR_MISCUTIL_CONNECTION_SMTP', attempt_sleeptime, sys.exc_info()[0], fromaddr, toaddr, body) sleep(attempt_sleeptime) return send_email(fromaddr, toaddr, body, attempt_times-1, attempt_sleeptime) else: log('ERR_MISCUTIL_SENDING_EMAIL', fromaddr, toaddr, body) return False except Exception: register_exception() return False return True | 6d399595de35ef862c0bef9ac8000a2c3c313783 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/6d399595de35ef862c0bef9ac8000a2c3c313783/mailutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
3652,
12,
2080,
4793,
16,
358,
4793,
16,
3221,
1546,
3113,
913,
1546,
3113,
1729,
67,
1745,
2218,
2187,
1729,
67,
7369,
28793,
1446,
33,
7036,
16,
9860,
33,
7036,
16,
1729,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1366,
67,
3652,
12,
2080,
4793,
16,
358,
4793,
16,
3221,
1546,
3113,
913,
1546,
3113,
1729,
67,
1745,
2218,
2187,
1729,
67,
7369,
28793,
1446,
33,
7036,
16,
9860,
33,
7036,
16,
1729,
6... |
from nt import stat, getcwd | from nt import stat, getcwd, environ, listdir | def _os_bootstrap(): "Set up 'os' module replacement functions for use during import bootstrap." global _os_stat, _os_path_join, _os_path_dirname, _os_getcwd names = sys.builtin_module_names join = dirname = None mindirlen = 0 if 'posix' in names: from posix import stat, getcwd sep = '/' mindirlen = 1 elif 'nt' in names: from nt import stat, getcwd sep = '\\' mindirlen = 3 elif 'dos' in names: from dos import stat, getcwd sep = '\\' mindirlen = 3 elif 'os2' in names: from os2 import stat, getcwd sep = '\\' elif 'mac' in names: from mac import stat, getcwd def join(a, b): if a == '': return b path = s if ':' not in a: a = ':' + a if a[-1:] != ':': a = a + ':' return a + b else: raise ImportError, 'no os specific module found' if join is None: def join(a, b, sep=sep): if a == '': return b lastchar = a[-1:] if lastchar == '/' or lastchar == sep: return a + b return a + sep + b if dirname is None: def dirname(a, sep=sep, mindirlen=mindirlen): for i in range(len(a)-1, -1, -1): c = a[i] if c == '/' or c == sep: if i < mindirlen: return a[:i+1] return a[:i] return '' _os_stat = stat _os_getcwd = getcwd _os_path_join = join _os_path_dirname = dirname | 59d55e3eafa5f2caeb1279be446bd3e94a5799a4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11925/59d55e3eafa5f2caeb1279be446bd3e94a5799a4/iu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
538,
67,
12722,
13332,
315,
694,
731,
296,
538,
11,
1605,
6060,
4186,
364,
999,
4982,
1930,
7065,
1199,
225,
2552,
389,
538,
67,
5642,
16,
389,
538,
67,
803,
67,
5701,
16,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
538,
67,
12722,
13332,
315,
694,
731,
296,
538,
11,
1605,
6060,
4186,
364,
999,
4982,
1930,
7065,
1199,
225,
2552,
389,
538,
67,
5642,
16,
389,
538,
67,
803,
67,
5701,
16,
389,
... |
try: if channel: res += remBans(channel) else: for channel in irc.state.channels.keys(): if channel not in self.bans: self.bans[channel] = [] res += remBans(channel) except KeyError, e: irc.error("%s, Please wait longer" % e) return irc.reply("Cleared %i obsolete bans" % res) | if channel: r_res += remBans(channel) a_res += addBans(channel) else: for channel in irc.state.channels.keys(): if channel not in self.bans: self.bans[channel] = [] r_res += remBans(channel) a_res += addBans(channel) irc.reply("Cleared %i obsolete bans" % r_res) irc.reply("Added %i new bans" % a_res) delta = r_res + a_res irc.reply("Delta: %s%i" % (str(delta and ' +')[-1], delta)) | def remBans(chan): bans = getBans(chan) old_bans = bans[:] new_bans = [i.mask for i in self.bans[chan]] remove_bans = [] for ban in old_bans: if ban not in new_bans: remove_bans.append(ban) bans.remove(ban) | 353e8a3cb6570f78f25b8d8c4070231630fbefe3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3106/353e8a3cb6570f78f25b8d8c4070231630fbefe3/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
849,
38,
634,
12,
7472,
4672,
324,
634,
273,
2882,
634,
12,
7472,
13,
1592,
67,
70,
634,
273,
324,
634,
10531,
65,
394,
67,
70,
634,
273,
306,
77,
18,
4455,
364,
277,
316,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
849,
38,
634,
12,
7472,
4672,
324,
634,
273,
2882,
634,
12,
7472,
13,
1592,
67,
70,
634,
273,
324,
634,
10531,
65,
394,
67,
70,
634,
273,
306,
77,
18,
4455,
364,
277,
316,
365,
18,... |
Ae = self._queryDB(self.dbAe, "power-law-coefficient", points, coordsys) | Ae = self._queryDB(self.dbAe, "flow-constant", points, coordsys) | def main(self, *args, **kwds): """ Application driver. """ # Get output points self._info.log("Reading geometry.") self.geometry.read() points = self.geometry.vertices coordsys = self.geometry.coordsys | 0e6a0097ccf05012138cebb996dd675e522b96cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8645/0e6a0097ccf05012138cebb996dd675e522b96cb/powerlaw_gendb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
3536,
4257,
3419,
18,
3536,
468,
968,
876,
3143,
365,
6315,
1376,
18,
1330,
2932,
15714,
5316,
1199,
13,
365,
18,
14330,
18,
896,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
3536,
4257,
3419,
18,
3536,
468,
968,
876,
3143,
365,
6315,
1376,
18,
1330,
2932,
15714,
5316,
1199,
13,
365,
18,
14330,
18,
896,
... |
pass | if self.console != None: event = Event(self, codec) self.console.event(broker, event) | def _handleEventInd(self, broker, codec, seq): pass | 37e775a6ad926a53362cdd8bc0a5083eb6cfa230 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/197/37e775a6ad926a53362cdd8bc0a5083eb6cfa230/qmfconsole.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
1133,
3866,
12,
2890,
16,
8625,
16,
9196,
16,
3833,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4110,
1133,
3866,
12,
2890,
16,
8625,
16,
9196,
16,
3833,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
except etree.XMLSyntaxError: | except etree.XMLSyntaxError, err: | def first_pass(data): try: data = etree.fromstring(data) except etree.XMLSyntaxError: repl = lambda m: ENTITYDEFS.get(m.group(1), m.group(0)) data = ENTITY_RE.sub(repl, data) try: data = etree.fromstring(data) except etree.XMLSyntaxError: self.oeb.logger.warn('Parsing file %r as HTML' % self.href) data = html.fromstring(data) data.attrib.pop('xmlns', None) for elem in data.iter(tag=etree.Comment): if elem.text: elem.text = elem.text.strip('-') data = etree.tostring(data, encoding=unicode) try: data = etree.fromstring(data) except etree.XMLSyntaxError: data = etree.fromstring(data, parser=RECOVER_PARSER) return data | 3219cb3aa57d1fba8ed1e67c8e84a21ddde839db /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/3219cb3aa57d1fba8ed1e67c8e84a21ddde839db/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1122,
67,
5466,
12,
892,
4672,
775,
30,
501,
273,
12031,
18,
2080,
1080,
12,
892,
13,
1335,
12031,
18,
4201,
22510,
16,
393,
30,
6831,
273,
3195,
312,
30,
17020,
1639,
4931,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1122,
67,
5466,
12,
892,
4672,
775,
30,
501,
273,
12031,
18,
2080,
1080,
12,
892,
13,
1335,
12031,
18,
4201,
22510,
16,
393,
30,
6831,
273,
3195,
312,
30,
17020,
1639,
4931,
18,
588,
... |
for (receiverkey, r_senderkey), receiver in self.receivers: | for (receiverkey_, r_senderkey), receiver in self.receivers: | def _live_receivers(self, senderkey): """Filter sequence of receivers to get resolved, live receivers | db232a6076ff07af41c1e40efe1d6bc4dbc6deb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3115/db232a6076ff07af41c1e40efe1d6bc4dbc6deb3/dispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16472,
67,
8606,
6760,
12,
2890,
16,
5793,
856,
4672,
3536,
1586,
3102,
434,
22686,
358,
336,
4640,
16,
8429,
22686,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16472,
67,
8606,
6760,
12,
2890,
16,
5793,
856,
4672,
3536,
1586,
3102,
434,
22686,
358,
336,
4640,
16,
8429,
22686,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
for trove in troves: if not filter(trove): | for trv in troves: if not filter(trv): | def browse(self, auth, char): defaultPage = False if not char: char = 'A' defaultPage = True # since the repository is multihomed and we're not doing any # label filtering, a single call will return all the available # troves. We use the first repository name here because we have to # pick one,,, troves = self.repos.troveNamesOnServer(self.serverNameList[0]) | c5a8de451fccc795e38df460d36b2c068f05d595 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/c5a8de451fccc795e38df460d36b2c068f05d595/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
12,
2890,
16,
1357,
16,
1149,
4672,
805,
1964,
273,
1083,
309,
486,
1149,
30,
1149,
273,
296,
37,
11,
805,
1964,
273,
1053,
468,
3241,
326,
3352,
353,
3309,
17125,
329,
471,
732... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21670,
12,
2890,
16,
1357,
16,
1149,
4672,
805,
1964,
273,
1083,
309,
486,
1149,
30,
1149,
273,
296,
37,
11,
805,
1964,
273,
1053,
468,
3241,
326,
3352,
353,
3309,
17125,
329,
471,
732... |
db_audiostore.remus_audio_objects_au_title, | db_audiostore.remus_artists_art_sortname, | def TIME_TO_SEC(*args): return sqlquery.Function("TIME_TO_SEC", *args) | 94ef7893d5420c833293379b7ff14f3df7e583b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2515/94ef7893d5420c833293379b7ff14f3df7e583b2/as_collection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8721,
67,
4296,
67,
11944,
30857,
1968,
4672,
327,
1847,
2271,
18,
2083,
2932,
4684,
67,
4296,
67,
11944,
3113,
380,
1968,
13,
282,
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,
8721,
67,
4296,
67,
11944,
30857,
1968,
4672,
327,
1847,
2271,
18,
2083,
2932,
4684,
67,
4296,
67,
11944,
3113,
380,
1968,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if ' | if ' | def substitute_file(name): subst = '' f = open(name) for l in f: if '#define LIBTORRENT_VERSION_MAJOR' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION_MAJOR %d\n' % version[0] elif '#define LIBTORRENT_VERSION_MINOR' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION_MINOR %d\n' % version[1] if '#define LIBTORRENT_VERSION_TINY' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION_TINY %d\n' % version[2] elif '#define LIBTORRENT_VERSION' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION "%d.%d.%d.%d"\n' % (version[0], version[1], version[2], version[3]) elif 'AC_INIT([libtorrent-rasterbar]' in l and filename.endiswith('.in'): l = 'AC_INIT([libtorrent-rasterbar], [%d.%d.%d], [arvid@cs.umu.se])\n' % (version[0], version[1], version[2]) elif 'set (VERSION ' in l and filename.endiswith('.in'): l = 'set (VERSION "%d.%d.%d")\n' % (version[0], version[1], version[2]) elif ':Version: ' in l and filename.endiswith('.rst'): l = ':Version: %d.%d.%d\n' % (version[0], version[1], version[2]) elif 'VERSION = ' in l and filename.endiswith('Jamfile'): l = 'VERSION = %d.%d.%d ;\n' % (version[0], version[1], version[2]) subst += l f.close() open(name, 'w+').write(subst) | fd006a93a4ec9c4675abaa4e9de0a045dec16be6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6321/fd006a93a4ec9c4675abaa4e9de0a045dec16be6/set_version.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14811,
67,
768,
12,
529,
4672,
27750,
273,
875,
284,
273,
1696,
12,
529,
13,
364,
328,
316,
284,
30,
309,
2946,
11255,
23983,
56,
916,
7480,
67,
5757,
67,
26976,
916,
11,
316,
328,
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,
14811,
67,
768,
12,
529,
4672,
27750,
273,
875,
284,
273,
1696,
12,
529,
13,
364,
328,
316,
284,
30,
309,
2946,
11255,
23983,
56,
916,
7480,
67,
5757,
67,
26976,
916,
11,
316,
328,
4... |
b = numpy.array([sum(weights*y), sum(weights*y*x)]) A = numpy.array([[sum(weights), sum(weights*x)], [sum(weights*x), sum(weights*x*x)]]) beta = numpy.linalg.solve(A,b) yest[i] = beta[0] + beta[1]*x[i] | weights_mul_x = weights * x b1 = numpy.dot(weights,y) b2 = numpy.dot(weights_mul_x,y) A11 = sum(weights) A12 = sum(weights_mul_x) A21 = A12 A22 = numpy.dot(weights_mul_x,x) determinant = A11*A22 - A12*A21 beta1 = (A22*b1-A12*b2) / determinant beta2 = (A11*b2-A21*b1) / determinant yest[i] = beta1 + beta2*x[i] | def lowess(x, y, f=2./3., iter=3): """lowess(x, y, f=2./3., iter=3) -> yest Lowess smoother: Robust locally weighted regression. The lowess function fits a nonparametric regression curve to a scatterplot. The arrays x and y contain an equal number of elements; each pair (x[i], y[i]) defines a data point in the scatterplot. The function returns the estimated (smooth) values of y. The smoothing span is given by f. A larger value for f will result in a smoother curve. The number of robustifying iterations is given by iter. The function will run faster with a smaller number of iterations. x and y should be numpy float arrays of equal length. The return value is also a numpy float array of that length. e.g. >>> import numpy >>> x = numpy.array([4, 4, 7, 7, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, ... 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, ... 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, ... 20, 22, 23, 24, 24, 24, 24, 25], numpy.float) >>> y = numpy.array([2, 10, 4, 22, 16, 10, 18, 26, 34, 17, 28, 14, 20, 24, ... 28, 26, 34, 34, 46, 26, 36, 60, 80, 20, 26, 54, 32, 40, ... 32, 40, 50, 42, 56, 76, 84, 36, 46, 68, 32, 48, 52, 56, ... 64, 66, 54, 70, 92, 93, 120, 85], numpy.float) >>> result = lowess(x, y) >>> len(result) 50 >>> print "[%0.2f, ..., %0.2f]" % (result[0], result[-1]) [4.85, ..., 84.98] """ n = len(x) r = int(numpy.ceil(f*n)) h = [numpy.sort(abs(x-x[i]))[r] for i in range(n)] w = numpy.clip(abs(([x]-numpy.transpose([x]))/h),0.0,1.0) w = 1-w*w*w w = w*w*w yest = numpy.zeros(n) delta = numpy.ones(n) for iteration in range(iter): for i in range(n): weights = delta * w[:,i] b = numpy.array([sum(weights*y), sum(weights*y*x)]) A = numpy.array([[sum(weights), sum(weights*x)], [sum(weights*x), sum(weights*x*x)]]) beta = numpy.linalg.solve(A,b) yest[i] = beta[0] + beta[1]*x[i] residuals = y-yest s = numpy.median(abs(residuals)) delta = numpy.clip(residuals/(6*s),-1,1) delta = 1-delta*delta delta = delta*delta return yest | 7bfba2c40b0bbb01bc773c20d21101cda8238741 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/7bfba2c40b0bbb01bc773c20d21101cda8238741/lowess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4587,
403,
12,
92,
16,
677,
16,
284,
33,
22,
18,
19,
23,
12990,
1400,
33,
23,
4672,
3536,
821,
403,
12,
92,
16,
677,
16,
284,
33,
22,
18,
19,
23,
12990,
1400,
33,
23,
13,
317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4587,
403,
12,
92,
16,
677,
16,
284,
33,
22,
18,
19,
23,
12990,
1400,
33,
23,
4672,
3536,
821,
403,
12,
92,
16,
677,
16,
284,
33,
22,
18,
19,
23,
12990,
1400,
33,
23,
13,
317,
... |
return QuotientRingElement(self.parent(),self.__rep.lt()) | return self.parent()(self.__rep.lt()) | def lt(self): """ Return the leading term 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,
13489,
12,
2890,
4672,
3536,
2000,
326,
7676,
2481,
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,
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,
13489,
12,
2890,
4672,
3536,
2000,
326,
7676,
2481,
434,
333,
26708,
9221,
930,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if c[0] == conflict_prop: | if c == conflict_prop: | def check(self, pkg): if pkg.isSource(): return | c7f8ca4eae0a48ee8b0def089e7e9eb17ea020a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10341/c7f8ca4eae0a48ee8b0def089e7e9eb17ea020a8/BrandingPolicyCheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
4672,
309,
3475,
18,
291,
1830,
13332,
327,
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,
866,
12,
2890,
16,
3475,
4672,
309,
3475,
18,
291,
1830,
13332,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
os.system(flac_command) os.system(metaflac_command) rm_command = '%s%s.wav' % (pathname_cdparanoia, path_tail_cdparanoia) if os.path.exists (rm_command): os.unlink(rm_command) | popen3.run(cmd, self, 9) if not self.abort: os.system(metaflac_command) if os.path.exists(wav_file) and not keep_wav: os.unlink(wav_file) if self.abort: rc.post_event(Event(OSD_MESSAGE, arg=_('Ripping aborted'))) self.current_track = -1 if output and os.path.exists (output): os.unlink(output) return | def cd_backup_threaded(self, device, rip_format='mp3'): rip_format = rip_format album = 'default_album' artist = 'default_artist' genre = 'default_genre' dir_audio_default = "dir_audio_default" path_head = '' for media in config.REMOVABLE_MEDIA: if media.devicename == device: media.type = 'cdrip' # Get the artist, album and song_names (discid, artist, album, genre, song_names) = self.get_formatted_cd_info(device) dir_audio = config.AUDIO_BACKUP_DIR user_rip_path_prefs = { 'artist': artist, 'album': album, 'genre': genre } path_list = re.split("\\/", config.CD_RIP_PN_PREF) # Get everything up to the last "/" if len(path_list) != 0: for i in range (0, len(path_list)-1 ): path_head += '/' + path_list[i] path_tail_temp = '/' + path_list[len(path_list)-1] # If no directory structure preferences were given use default dir structure if len(path_list) == 0: pathname = dir_audio + "/" + artists + "/" + album + "/" # Else use the preferences given by user else: path_temp = dir_audio + path_head pathname = path_temp % user_rip_path_prefs try: os.makedirs(pathname, 0777) except: _debug_(_( 'Directory %s already exists' ) % pathname) | 2dea6659ea7caf6d2ece3ed17231f52f1963d82e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/2dea6659ea7caf6d2ece3ed17231f52f1963d82e/cdbackup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7976,
67,
9572,
67,
451,
20528,
12,
2890,
16,
2346,
16,
436,
625,
67,
2139,
2218,
1291,
23,
11,
4672,
436,
625,
67,
2139,
273,
436,
625,
67,
2139,
14844,
273,
296,
1886,
67,
25090,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7976,
67,
9572,
67,
451,
20528,
12,
2890,
16,
2346,
16,
436,
625,
67,
2139,
2218,
1291,
23,
11,
4672,
436,
625,
67,
2139,
273,
436,
625,
67,
2139,
14844,
273,
296,
1886,
67,
25090,
1... |
if ent[3] == -1: locale_len = len(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(0))) timestr = 'unset' timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) else: timestr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(ent[3])) | if showdate: if ent[3] == -1: locale_len = len(time.strftime("%Y-%m-%d %H:%M:%S ", time.localtime(0))) timestr = 'unset' timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) else: timestr = time.strftime("%Y-%m-%d %H:%M:%S ", time.localtime(ent[3])) | def debugstate(ui, repo): """show the contents of the current dirstate""" k = repo.dirstate._map.items() k.sort() for file_, ent in k: if ent[3] == -1: # Pad or slice to locale representation locale_len = len(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(0))) timestr = 'unset' timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) else: timestr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(ent[3])) if ent[1] & 020000: mode = 'lnk' else: mode = '%3o' % (ent[1] & 0777) ui.write("%c %s %10d %s %s\n" % (ent[0], mode, ent[2], timestr, file_)) for f in repo.dirstate.copies(): ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) | d324c8346e4390f4f5bdd3e4e144d41a6df0bbc4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/d324c8346e4390f4f5bdd3e4e144d41a6df0bbc4/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
2019,
12,
4881,
16,
3538,
4672,
3536,
4500,
326,
2939,
434,
326,
783,
302,
920,
340,
8395,
417,
273,
3538,
18,
72,
920,
340,
6315,
1458,
18,
3319,
1435,
417,
18,
3804,
1435,
364,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
2019,
12,
4881,
16,
3538,
4672,
3536,
4500,
326,
2939,
434,
326,
783,
302,
920,
340,
8395,
417,
273,
3538,
18,
72,
920,
340,
6315,
1458,
18,
3319,
1435,
417,
18,
3804,
1435,
364,... |
column = gtk.TreeViewColumn(_('Size'), gtk.CellRendererText(), text=DownloadStatusManager.C_SIZE_TEXT) self.treeDownloads.append_column(column) | if gpodder.interface != gpodder.MAEMO: column = gtk.TreeViewColumn(_('Size'), gtk.CellRendererText(), text=DownloadStatusManager.C_SIZE_TEXT) self.treeDownloads.append_column(column) | def new(self): if gpodder.interface == gpodder.MAEMO: # Maemo-specific changes to the UI global scalable_dir scalable_dir = scalable_dir.replace('.svg', '.png') self.app = hildon.Program() gtk.set_application_name('gPodder') self.window = hildon.Window() self.window.connect('delete-event', self.on_gPodder_delete_event) self.window.connect('window-state-event', self.window_state_event) self.itemUpdateChannel.show() self.UpdateChannelSeparator.show() # Remove old toolbar from its parent widget self.toolbar.get_parent().remove(self.toolbar) | 510c784e2954344f295cb7cfc7e22925148e180f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/510c784e2954344f295cb7cfc7e22925148e180f/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
12,
2890,
4672,
309,
4178,
369,
765,
18,
5831,
422,
4178,
369,
765,
18,
5535,
3375,
51,
30,
468,
490,
69,
351,
83,
17,
12524,
3478,
358,
326,
6484,
2552,
8292,
429,
67,
1214,
82... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
309,
4178,
369,
765,
18,
5831,
422,
4178,
369,
765,
18,
5535,
3375,
51,
30,
468,
490,
69,
351,
83,
17,
12524,
3478,
358,
326,
6484,
2552,
8292,
429,
67,
1214,
82... |
libraries = ['g0nntl', 'jcntl', 'gmpxx', 'ntl', 'gmp', 'm', 'stdc++', ], | libraries = ['g0nntl', 'jcntl', 'gmpxx', 'ntl', 'gmp', 'm', 'stdc++', 'pari-gmp', 'curvesntl'], | def is_older(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 | 7cda91eb177705e615db09d610e4d5c9a3f71bb3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7cda91eb177705e615db09d610e4d5c9a3f71bb3/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1498,
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,
3712... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1498,
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,
3712... |
FL_Coord, STRING], | FL_Coord, STRING], | def fl_create_bitmapbutton(type, x, y, w, h, label): """ fl_create_bitmapbutton(type, x, y, w, h, label) -> object """ retval = _fl_create_bitmapbutton(type, x, y, w, h, label) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
2640,
67,
3682,
1458,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
2640,
67,
3682,
1458,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
67,
3682,
1458,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
2640,
67,
3682,
1458,
5391,
12,
723,
16,
619,
16,
677,
16,
341,
1... |
h_file = join(scons_build_dir, local_dir, '__ufunc_api.h') t_file = join(scons_build_dir, local_dir, 'ufunc_api.txt') | h_file = join(get_scons_pkg_build_dir(config.name), '__ufunc_api.h') t_file = join(get_scons_pkg_build_dir(config.name), 'ufunc_api.txt') | def add_ufunc_api(): scons_build_dir = get_scons_build_dir() # XXX: I really have to think about how to communicate path info # between scons and distutils, and set the options at one single # location. h_file = join(scons_build_dir, local_dir, '__ufunc_api.h') t_file = join(scons_build_dir, local_dir, 'ufunc_api.txt') config.add_data_files((header_dir, h_file), (header_dir, t_file)) | be0d287b2b23b89e5bf121558fc5ee4ea97710c2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/be0d287b2b23b89e5bf121558fc5ee4ea97710c2/setupscons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
89,
644,
67,
2425,
13332,
272,
8559,
67,
3510,
67,
1214,
273,
336,
67,
87,
8559,
67,
3510,
67,
1214,
1435,
468,
11329,
30,
467,
8654,
1240,
358,
15507,
2973,
3661,
358,
15541,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
67,
89,
644,
67,
2425,
13332,
272,
8559,
67,
3510,
67,
1214,
273,
336,
67,
87,
8559,
67,
3510,
67,
1214,
1435,
468,
11329,
30,
467,
8654,
1240,
358,
15507,
2973,
3661,
358,
15541,... |
r = density*(r-1)*1.+1 g = density*(g-1)*1.+1 b = density*(b-1)*1.+1 | r = density*(r-1)+1 g = density*(g-1)+1 b = density*(b-1)+1 | def __init__(self, cyan=0, magenta=0, yellow=0, black=0, spotName=None, density=1): """ Initialize with four colors in range [0-1]. the optional spotName and density may be of use to specific renderers. The spotName is intended for use as an identifier to the rendere not client programs. """ self.cyan = cyan self.magenta = magenta self.yellow = yellow self.black = black self.spotName = spotName self.density = max(min(density,1),0) # force into right range | ec9c8490c178c5807ecb074c4f06d84c1fe24b76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ec9c8490c178c5807ecb074c4f06d84c1fe24b76/colors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
23403,
33,
20,
16,
4447,
24066,
33,
20,
16,
20614,
33,
20,
16,
7721,
33,
20,
16,
16463,
461,
33,
7036,
16,
12142,
33,
21,
4672,
3536,
9190,
598,
12792,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23403,
33,
20,
16,
4447,
24066,
33,
20,
16,
20614,
33,
20,
16,
7721,
33,
20,
16,
16463,
461,
33,
7036,
16,
12142,
33,
21,
4672,
3536,
9190,
598,
12792,... |
""" | """ | def flimage_dup(pImage): """ flimage_dup(pImage) -> pImage """ retval = _flimage_dup(pImage) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
26427,
12,
84,
2040,
4672,
3536,
1183,
2730,
67,
26427,
12,
84,
2040,
13,
317,
293,
2040,
3536,
225,
5221,
273,
389,
2242,
2730,
67,
26427,
12,
84,
2040,
13,
327,
5221,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
26427,
12,
84,
2040,
4672,
3536,
1183,
2730,
67,
26427,
12,
84,
2040,
13,
317,
293,
2040,
3536,
225,
5221,
273,
389,
2242,
2730,
67,
26427,
12,
84,
2040,
13,
327,
5221,... |
m.make('boundary',type='boundary',xyz=(-257,-257,settlement_height),bbox=[2,514,256]) m.make('boundary',type='boundary',xyz=(-257,-257,settlement_height),bbox=[514,2,256]) m.make('boundary',type='boundary',xyz=(-257, 256,settlement_height),bbox=[514,2,256]) m.make('boundary',type='boundary',xyz=( 256,-257,settlement_height),bbox=[2,514,256]) | m.make('boundary',type='boundary',xyz=(-321,-321,-20),bbox=[2,642,300],mode="fixed") m.make('boundary',type='boundary',xyz=(-321,-321,-20),bbox=[642,2,300],mode="fixed") m.make('boundary',type='boundary',xyz=(-321, 320,-20),bbox=[642,2,300],mode="fixed") m.make('boundary',type='boundary',xyz=( 320,-321,-20),bbox=[2,642,300],mode="fixed") | def default(mapeditor): | 5cf935667b0428112ba8aca2021ee7385ac591ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12932/5cf935667b0428112ba8aca2021ee7385ac591ed/define_world.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
12,
1458,
9177,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
12,
1458,
9177,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Otherwise, this calls get(key, default) on the wrapped | Otherwise, this calls __getitem__(key) on the wrapped | def __getitem__(self, key, default=None): """ If the key ends with _escaped, then this will retrieve the value for the key and escape it. | 0a9c43a9f1cd83052a21299d004e9103f1d25faf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11836/0a9c43a9f1cd83052a21299d004e9103f1d25faf/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
16,
805,
33,
7036,
4672,
3536,
971,
326,
498,
3930,
598,
389,
16502,
16,
1508,
333,
903,
4614,
326,
460,
364,
326,
498,
471,
4114,
518,
18,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
16,
805,
33,
7036,
4672,
3536,
971,
326,
498,
3930,
598,
389,
16502,
16,
1508,
333,
903,
4614,
326,
460,
364,
326,
498,
471,
4114,
518,
18,
2,
-1... |
This is computed using Pari. EXAMPLES: sage: bessel_Y(2,1.1) -1.4314714939590090 sage: bessel_Y(3.001,2.1) -1.0299574976424311 | This is computed using Maxima by default. EXAMPLES: sage: bessel_Y(2,1.1,"scipy") -1.4314714939... sage: bessel_Y(2,1.1) -1.4314714939590... sage: bessel_Y(3.001,2.1) -1.0299574976424... | def bessel_Y(nu,z): r""" Implements the "Y-Bessel function", or "Bessel function of the 2nd kind", with index (or "order") nu and argument z. Defn: | ca593d9d36e8d19087c538053571939068f391f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/ca593d9d36e8d19087c538053571939068f391f1/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
403,
292,
67,
61,
12,
13053,
16,
94,
4672,
436,
8395,
29704,
326,
315,
61,
17,
38,
403,
292,
445,
3113,
578,
315,
38,
403,
292,
445,
434,
326,
576,
4880,
3846,
3113,
598,
770,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
403,
292,
67,
61,
12,
13053,
16,
94,
4672,
436,
8395,
29704,
326,
315,
61,
17,
38,
403,
292,
445,
3113,
578,
315,
38,
403,
292,
445,
434,
326,
576,
4880,
3846,
3113,
598,
770,
... |
chunk = self.socket.recv(size - len(received)) | chunk = self.recv(size - len(received)) | def read(self, size=None, bufferSize=64*1024): if size: # Read the amount specified, first from our # local read buffer then from the socket itself. # If we can't read the complete packet, return # None and keep the partial packet buffered. received = self.readBuffer[:size] while len(received) < size: chunk = self.socket.recv(size - len(received)) if not chunk: self.readBuffer = received return None received += chunk self.readBuffer = received[size:] return received[:size] else: # Keep reading until there's no more to read received = self.readBuffer self.readBuffer = '' while 1: buffer = self.socket.recv(bufferSize) if not buffer: break received += buffer return received | 5ec5176a26cc188e3bf773bf903bbc68efe95421 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/5ec5176a26cc188e3bf773bf903bbc68efe95421/Network.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
963,
33,
7036,
16,
16939,
33,
1105,
14,
2163,
3247,
4672,
309,
963,
30,
468,
2720,
326,
3844,
1269,
16,
1122,
628,
3134,
468,
1191,
855,
1613,
1508,
628,
326,
2987,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
963,
33,
7036,
16,
16939,
33,
1105,
14,
2163,
3247,
4672,
309,
963,
30,
468,
2720,
326,
3844,
1269,
16,
1122,
628,
3134,
468,
1191,
855,
1613,
1508,
628,
326,
2987,
... |
'plugin_depends': 'PluginDepends' | 'plugin_depends': 'PluginDepends', | def __init__(self, taskbrowser): """Constructor.""" # store references to some objects widgets = { 'dialog': 'PreferencesDialog', 'backend_tree': 'BackendTree', 'plugin_tree': 'PluginTree', 'plugin_about_dialog': 'PluginAboutDialog', 'plugin_configure': 'plugin_configure', 'plugin_depends': 'PluginDepends' 'plugin_config_dialog': 'PluginConfigDialog', } for attr, widget in widgets.iteritems(): setattr(self, attr, taskbrowser.builder.get_object(widget)) # keep a reference to the parent task browser self.tb = taskbrowser # initialize tree models self._init_backend_tree() # this can't happen yet, due to the order of things in # TaskBrowser.__init__(). Happens in activate() instead. # self._init_plugin_tree() | 967023748625d5d6d6d0b2aef98301cfc91182bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/967023748625d5d6d6d0b2aef98301cfc91182bb/preferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1562,
11213,
4672,
3536,
6293,
12123,
468,
1707,
5351,
358,
2690,
2184,
10965,
273,
288,
296,
12730,
4278,
296,
12377,
6353,
2187,
296,
9993,
67,
3413,
4278,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1562,
11213,
4672,
3536,
6293,
12123,
468,
1707,
5351,
358,
2690,
2184,
10965,
273,
288,
296,
12730,
4278,
296,
12377,
6353,
2187,
296,
9993,
67,
3413,
4278,... |
for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) | def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in func.GetOriginalArgs(): arg.WriteClientSideValidationCode(file) file.Write(" helper_->%s(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | 4f0c32d419b2a9783e1458192f5c0d3d79813764 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/4f0c32d419b2a9783e1458192f5c0d3d79813764/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
43,
11386,
22,
13621,
1864,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
8368,
326,
611,
11386,
22,
10886,
285,
12123,
9380,
67,
644,
273,
1326,
18,
967,
966,
2668,
11299,
67,
644,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2598,
43,
11386,
22,
13621,
1864,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
8368,
326,
611,
11386,
22,
10886,
285,
12123,
9380,
67,
644,
273,
1326,
18,
967,
966,
2668,
11299,
67,
644,
6... | |
rp = subdir.append(filename) try: rp.touch() except IOError: | try: rp = subdir.append(filename) rp.touch() except (IOError, OSError): | def supports_unusual_chars(): """Test handling of several chars sometimes not supported""" for filename in [':', '\\', chr(175)]: rp = subdir.append(filename) try: rp.touch() except IOError: assert not rp.lstat() return 0 assert rp.lstat() rp.delete() return 1 | 9b05d018329541e70a79d43c99c681099e18be29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/783/9b05d018329541e70a79d43c99c681099e18be29/fs_abilities.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6146,
67,
318,
407,
1462,
67,
7549,
13332,
3536,
4709,
5057,
434,
11392,
5230,
16594,
486,
3260,
8395,
364,
1544,
316,
306,
4278,
2187,
3718,
2187,
4513,
12,
4033,
25,
13,
14542,
775,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6146,
67,
318,
407,
1462,
67,
7549,
13332,
3536,
4709,
5057,
434,
11392,
5230,
16594,
486,
3260,
8395,
364,
1544,
316,
306,
4278,
2187,
3718,
2187,
4513,
12,
4033,
25,
13,
14542,
775,
30... |
capacity = int(line.rsplit('=',1)[1]) / 1048576.0 print "[formatted] capacity =", capacity elif capacity == 1 and line.find("READ CAPACITY:") > -1: capacity = int(line.rsplit('=',1)[1]) / 1048576.0 print "[READ CAP] capacity =", capacity elif line.find("Disc status:") > -1: if line.find("blank") > -1: print "[Disc status] capacity=%d, used=0" % (capacity) capacity = used used = 0 elif line.find("Free Blocks:") > -1: | formatted_capacity = int(line.rsplit('=',1)[1]) / 1048576.0 print "[dvd+rw-mediainfo] formatted capacity =", formatted_capacity elif formatted_capacity == 0 and line.find("READ CAPACITY:") > -1: read_capacity = int(line.rsplit('=',1)[1]) / 1048576.0 print "[dvd+rw-mediainfo] READ CAPACITY =", read_capacity for line in mediuminfo.splitlines(): if line.find("Free Blocks:") > -1: | def mediainfoCB(self, mediuminfo, retval, extra_args): capacity = 1 used = 0 infotext = "" mediatype = "" for line in mediuminfo.splitlines(): if line.find("Mounted Media:") > -1: mediatype = line.rsplit(',',1)[1][1:] if mediatype.find("RW") > 0 or mediatype.find("RAM") > 0: self.formattable = True else: self.formattable = False if line.find("Legacy lead-out at:") > -1: used = int(line.rsplit('=',1)[1]) / 1048576.0 print "[lead out] used =", used elif line.find("formatted:") > -1: capacity = int(line.rsplit('=',1)[1]) / 1048576.0 print "[formatted] capacity =", capacity elif capacity == 1 and line.find("READ CAPACITY:") > -1: capacity = int(line.rsplit('=',1)[1]) / 1048576.0 print "[READ CAP] capacity =", capacity elif line.find("Disc status:") > -1: if line.find("blank") > -1: print "[Disc status] capacity=%d, used=0" % (capacity) capacity = used used = 0 elif line.find("Free Blocks:") > -1: try: size = eval(line[14:].replace("KB","*1024")) except: size = 0 if size > 0: capacity = size / 1048576 if used: used = capacity-used print "[free blocks] capacity=%d, used=%d" % (capacity, used) infotext += line+'\n' self["details"].setText(infotext) if self.formattable: self["key_yellow"].text = _("Format") else: self["key_yellow"].text = "" percent = 100 * used / (capacity or 1) if capacity > 4600: self["space_label"].text = "%d / %d MB" % (used, capacity) + " (%.2f%% " % percent + _("of a DUAL layer medium used.") + ")" self["space_bar"].value = int(percent) elif capacity > 1: self["space_label"].text = "%d / %d MB" % (used, capacity) + " (%.2f%% " % percent + _("of a SINGLE layer medium used.") + ")" self["space_bar"].value = int(percent) elif capacity == 1 and used > 0: self["space_label"].text = "%d MB " % (used) + _("on READ ONLY medium.") self["space_bar"].value = int(percent) else: self["space_label"].text = _("Medium is not a writeable DVD!") self["space_bar"].value = 0 free = capacity-used if free < 2: free = 0 self["info"].text = "Media-Type:\t\t%s\nFree capacity:\t\t%d MB" % (mediatype or "NO DVD", free) | 946a71097573dc8abc273d24efd23bab3e5f2fb2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/946a71097573dc8abc273d24efd23bab3e5f2fb2/DVDToolbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20623,
28935,
8876,
12,
2890,
16,
16212,
1376,
16,
5221,
16,
2870,
67,
1968,
4672,
7519,
273,
404,
1399,
273,
374,
8286,
352,
408,
273,
1408,
25381,
273,
1408,
364,
980,
316,
16212,
1376... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20623,
28935,
8876,
12,
2890,
16,
16212,
1376,
16,
5221,
16,
2870,
67,
1968,
4672,
7519,
273,
404,
1399,
273,
374,
8286,
352,
408,
273,
1408,
25381,
273,
1408,
364,
980,
316,
16212,
1376... |
self.type, | type, | def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), stn(MAGIC, 6), stn(VERSION, 2), stn(self.uname, 32), stn(self.gname, 32), itn(self.devmajor, 8, posix), itn(self.devminor, 8, posix), stn(self.prefix, 155) ] | 14cab674653252113190b16078d9d939372d8557 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14cab674653252113190b16078d9d939372d8557/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
1203,
487,
279,
13908,
1160,
533,
18,
3536,
2140,
273,
306,
384,
82,
12,
2890,
18,
529,
16,
2130,
3631,
518,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
1203,
487,
279,
13908,
1160,
533,
18,
3536,
2140,
273,
306,
384,
82,
12,
2890,
18,
529,
16,
2130,
3631,
518,... |
self.parser.insertionModes["inHead"](self.parser).processStartTag(name, | self.parser.phase.insertionModes["inHead"](self.parser).processStartTag(name, | def startTagFromHead(self, name, attributes): self.parser.parseError() self.parser.insertionModes["inHead"](self.parser).processStartTag(name, attributes) | 6bc7941c16c64cd9f9d3fb7afe784cbd71460eba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/6bc7941c16c64cd9f9d3fb7afe784cbd71460eba/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1265,
1414,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
2670,
668,
1435,
365,
18,
4288,
18,
13961,
18,
6387,
285,
18868,
9614,
267,
1414,
11929,
12,
2890,
18,
4288... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1265,
1414,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
2670,
668,
1435,
365,
18,
4288,
18,
13961,
18,
6387,
285,
18868,
9614,
267,
1414,
11929,
12,
2890,
18,
4288... |
) | f_pg_def = res[0] | a73711cb180c536a45540480eccaf5c3f0aa8ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a73711cb180c536a45540480eccaf5c3f0aa8ad3/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
284,
67,
8365,
67,
536,
273,
400,
63,
20,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
284,
67,
8365,
67,
536,
273,
400,
63,
20,
65,
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,... | |
'href': dispatch.translate(request, path_obj.pootle_path), | 'href': dispatch.translate(request, path_obj.pootle_path, match_names=[]), | def translate_all_link(request, path_obj): #FIXME: what permissions to check for here? return { 'href': dispatch.translate(request, path_obj.pootle_path), 'text': _('Translate All') } | b54db69da23400637b595a18ddca1290e0889661 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11388/b54db69da23400637b595a18ddca1290e0889661/item_dict.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
454,
67,
1232,
12,
2293,
16,
589,
67,
2603,
4672,
468,
25810,
30,
4121,
4371,
358,
866,
364,
2674,
35,
327,
288,
296,
7547,
4278,
3435,
18,
13929,
12,
2293,
16,
589,
67,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4204,
67,
454,
67,
1232,
12,
2293,
16,
589,
67,
2603,
4672,
468,
25810,
30,
4121,
4371,
358,
866,
364,
2674,
35,
327,
288,
296,
7547,
4278,
3435,
18,
13929,
12,
2293,
16,
589,
67,
26... |
self.nim = nimmanager.nimList()[slotid][1] | def __init__(self, session, slotid): Screen.__init__(self, session) self.nim = nimmanager.nimList()[slotid][1] self["actions"] = NumberActionMap(["SetupActions"], { "ok": self.keySave, "cancel": self.keyCancel, "left": self.keyLeft, "right": self.keyRight, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal }, -1) | 02c49e642a6bcc65d1cdc443510d9cfefdcfbe93 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/02c49e642a6bcc65d1cdc443510d9cfefdcfbe93/Satconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1339,
16,
4694,
350,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
225,
365,
9614,
4905,
11929,
273,
3588,
1803,
863,
3816,
6,
7365,
6100,
6,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1339,
16,
4694,
350,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
225,
365,
9614,
4905,
11929,
273,
3588,
1803,
863,
3816,
6,
7365,
6100,
6,
64... | |
Example ------- | Examples -------- | def cublasCaxpy(n, alpha, x, incx, y, incy): """ Complex vector addition. Computes the sum of a single-precision complex vector scaled by a single-precision complex scalar and another single-precision complex vector. Parameters ---------- n : int Number of elements in input vectors. alpha : numpy.complex64 Single-precision complex scalar. x : ctypes.c_void_p Pointer to single-precision complex input vector. incx : int Storage spacing between elements of `x`. y : ctypes.c_void_p Pointer to single-precision complex input/output vector. incy : int Storage spacing between elements of `y`. Example ------- >>> import pycuda.autoinit >>> import pycuda.gpuarray as gpuarray >>> import numpy as np >>> alpha = np.complex64(np.random.rand()) >>> x = np.random.rand(5).astype(np.complex64) >>> y = np.random.rand(5).astype(np.complex64) >>> x_gpu = gpuarray.to_gpu(x) >>> y_gpu = gpuarray.to_gpu(y) >>> cublasCaxpy(x_gpu.size, alpha, x_gpu.gpudata, 1, y_gpu.gpudata, 1) >>> np.allclose(y_gpu.get(), alpha*x+y) True Notes ----- Both `x` and `y` must contain `n` elements. """ _libcublas.cublasCaxpy(n, cuda.cuFloatComplex(alpha.real, alpha.imag), int(x), incx, int(y), incy) status = cublasGetError() cublasCheckStatus(status) | f3eb0a79d8c436d509dec60f91ff7a7dcced528c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/f3eb0a79d8c436d509dec60f91ff7a7dcced528c/cublas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
30579,
39,
651,
2074,
12,
82,
16,
4190,
16,
619,
16,
7290,
92,
16,
677,
16,
316,
2431,
4672,
3536,
16060,
3806,
2719,
18,
225,
14169,
281,
326,
2142,
434,
279,
2202,
17,
14548,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
30579,
39,
651,
2074,
12,
82,
16,
4190,
16,
619,
16,
7290,
92,
16,
677,
16,
316,
2431,
4672,
3536,
16060,
3806,
2719,
18,
225,
14169,
281,
326,
2142,
434,
279,
2202,
17,
14548,
... |
results.append(len(self._bugzilla.query({ | results['new_this_week'] = len(self._bugzilla.query({ | def _get_bug_stats(self, package, collection='Fedora'): """ Returns (# of open bugs, # of new bugs, # of closed bugs) """ results = [] last_week = str(datetime.utcnow() - timedelta(days=7)), | db7abe949e3fbab840693ccf5a932baa23e6ea8d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12732/db7abe949e3fbab840693ccf5a932baa23e6ea8d/bugzillaconnector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
925,
67,
5296,
12,
2890,
16,
2181,
16,
1849,
2218,
42,
15534,
11,
4672,
3536,
2860,
23885,
434,
1696,
22398,
16,
468,
434,
394,
22398,
16,
468,
434,
4375,
22398,
13,
3536... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
925,
67,
5296,
12,
2890,
16,
2181,
16,
1849,
2218,
42,
15534,
11,
4672,
3536,
2860,
23885,
434,
1696,
22398,
16,
468,
434,
394,
22398,
16,
468,
434,
4375,
22398,
13,
3536... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 280) else quickfix.StringField.__init__(self, 280, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
576,
3672,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
576,
3672,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.