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 xe >= maxx: xe = maxx-1 if ye >= maxy: ye = maxy-1 if ze >= maxz: ze = maxz-1
if xs < minx: x0 -= xs xs = 0 if ys < miny: y0 -= ys ys = 0 if zs < minz: z0 -= zs zs = 0 if xe > maxx: x0 = x0 - xe - maxx xe = maxx if ye > maxy: y0 = y0 - ye - maxy ye = maxy if ze > maxz: z0 = z0 - ze - maxz ze = maxz
def createObjectAt(self, imageData, x0, y0, z0, size): """ Create an object in the image at the give position @param imageData the image to modify @param x0, y0, z0 the coordinates of the object @param size the size of the object in pixels """ origr = math.pow(size*2.3561944901923448, 0.333333) #r = int(1+math.sqrt(size/math.pi)) n = 0 r = int(origr) maxx,maxy,maxz = imageData.GetDimensions() xs = int(x0-r) ys = int(y0-r) zs = int(z0-r) if xs < 0: xs = 0 if ys < 0: ys = 0 if zs < 0: zs = 0 xe = int(x0+r) ye = int(y0+r) ze = int(z0+r) if xe >= maxx: xe = maxx-1 if ye >= maxy: ye = maxy-1 if ze >= maxz: ze = maxz-1 count = 0 for x in range(xs,xe): for y in range(ys,ye): for z in range(zs,ze): # Do not use spacing to get real looking objects d = math.sqrt((x0-x)**2 + (y0-y)**2 + (z0-z)**2) if d <= r: #minval = int(255-(d/float(r)*128)) minval = 220 imageData.SetScalarComponentFromDouble(x,y,z,0,random.randint(minval,255)) count += 1
0291e4740f7b79883902a89fc31d6f97e7c67f93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2877/0291e4740f7b79883902a89fc31d6f97e7c67f93/TestData.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17109, 861, 12, 2890, 16, 26229, 16, 619, 20, 16, 677, 20, 16, 998, 20, 16, 963, 4672, 3536, 1788, 392, 733, 316, 326, 1316, 622, 326, 8492, 1754, 632, 891, 26229, 326, 1316, 358, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 17109, 861, 12, 2890, 16, 26229, 16, 619, 20, 16, 677, 20, 16, 998, 20, 16, 963, 4672, 3536, 1788, 392, 733, 316, 326, 1316, 622, 326, 8492, 1754, 632, 891, 26229, 326, 1316, 358, 56...
self.EndModal(wxID_OK)
rollcall = self.getRollCall() try: self.client.submitRollCall(self.group_href, rollcall) except SchoolToolError, e: wxMessageBox("Could not submit the roll call: %s" % e, self.title, wxICON_ERROR|wxOK) else: self.EndModal(wxID_OK)
def OnOk(self, event): """Verify that all required data is entered before closing the dialog. """ for (href, was_absent, absent, present, comment, resolve, dontresolve) in self.items: if absent.GetValue() == present.GetValue(): present.SetFocus() wxBell() return if (present.GetValue() and was_absent and resolve.GetValue() == dontresolve.GetValue()): resolve.SetFocus() wxBell() return self.EndModal(wxID_OK)
e3df1f749f4cd8d7ca96a6fae474b708235e4d14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/e3df1f749f4cd8d7ca96a6fae474b708235e4d14/wxclient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 8809, 12, 2890, 16, 871, 4672, 3536, 8097, 716, 777, 1931, 501, 353, 16219, 1865, 7647, 326, 6176, 18, 3536, 364, 261, 7547, 16, 1703, 67, 5113, 319, 16, 17245, 16, 3430, 16, 287...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 8809, 12, 2890, 16, 871, 4672, 3536, 8097, 716, 777, 1931, 501, 353, 16219, 1865, 7647, 326, 6176, 18, 3536, 364, 261, 7547, 16, 1703, 67, 5113, 319, 16, 17245, 16, 3430, 16, 287...
_INSTALL_ONLY_MASK = _notpre(RPMSENSE_SCRIPT_PRE | RPMSENSE_SCRIPT_POST \
_INSTALL_ONLY_MASK = _notpre(RPMSENSE_SCRIPT_PRE | RPMSENSE_SCRIPT_POST
def _notpre(x): return (x & ~RPMSENSE_PREREQ)
427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 902, 1484, 12, 92, 4672, 327, 261, 92, 473, 4871, 54, 12728, 1090, 50, 1090, 67, 8025, 654, 27247, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 902, 1484, 12, 92, 4672, 327, 261, 92, 473, 4871, 54, 12728, 1090, 50, 1090, 67, 8025, 654, 27247, 13, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
Returns a triplet (:class:`disco.func.OutputStream`, size, url) that is
Returns a pair (:class:`disco.func.OutputStream`, url) that is
def output_stream(stream, partition, url, params): """ :param stream: :class:`disco.func.OutputStream` object :param partition: partition id :param url: url of the input :param params: the :class:`disco.core.Params` object specified by the *params* parameter in :class:`disco.core.JobDict`. Returns a triplet (:class:`disco.func.OutputStream`, size, url) that is passed to the next *output_stream* function in the chain. The :meth:`disco.func.OutputStream.add` method of the last :class:`disco.func.OutputStream` object returned by the chain is used to output entries from map or reduce. Using an :func:`output_stream` allows you to customize where and how output is stored. The default should almost always be used. """
d3effb97995ceb9f72a50d2cfccbf82c7a148de6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/d3effb97995ceb9f72a50d2cfccbf82c7a148de6/func.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 67, 3256, 12, 3256, 16, 3590, 16, 880, 16, 859, 4672, 3536, 294, 891, 1407, 30, 294, 1106, 28288, 2251, 2894, 18, 644, 18, 4632, 68, 733, 294, 891, 3590, 30, 3590, 612, 294, 891...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 876, 67, 3256, 12, 3256, 16, 3590, 16, 880, 16, 859, 4672, 3536, 294, 891, 1407, 30, 294, 1106, 28288, 2251, 2894, 18, 644, 18, 4632, 68, 733, 294, 891, 3590, 30, 3590, 612, 294, 891...
else: flag = os.P_NOWAIT
def do_start(self, arg): self.get_status() if not self.zd_up: args = [ self.options.python, self.options.zdrun, ] args += self._get_override("-S", "schemafile") args += self._get_override("-C", "configfile") args += self._get_override("-b", "backofflimit") args += self._get_override("-d", "daemon", flag=1) args += self._get_override("-f", "forever", flag=1) args += self._get_override("-s", "sockname") args += self._get_override("-u", "user") args += self._get_override("-m", "umask") args += self._get_override( "-x", "exitcodes", ",".join(map(str, self.options.exitcodes))) args += self._get_override("-z", "directory") args.extend(self.options.program) if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args) elif not self.zd_pid: self.send_action("start") else: print "daemon process already running; pid=%d" % self.zd_pid return self.awhile(lambda: self.zd_pid, "daemon process started, pid=%(zd_pid)d")
1c0907fb9d7d2aa9077d3b2ae8dc5923afa457c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9782/1c0907fb9d7d2aa9077d3b2ae8dc5923afa457c0/zdctl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1937, 12, 2890, 16, 1501, 4672, 365, 18, 588, 67, 2327, 1435, 309, 486, 365, 18, 94, 72, 67, 416, 30, 833, 273, 306, 365, 18, 2116, 18, 8103, 16, 365, 18, 2116, 18, 94, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 1937, 12, 2890, 16, 1501, 4672, 365, 18, 588, 67, 2327, 1435, 309, 486, 365, 18, 94, 72, 67, 416, 30, 833, 273, 306, 365, 18, 2116, 18, 8103, 16, 365, 18, 2116, 18, 94, ...
libraries, extradirs, extraexportsymbols)
libraries, extradirs, extraexportsymbols, outputdir)
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) dllname = "%s.%s.slb" % (module, architecture) if not project: if architecture != "ppc": project = "%s.%s.mcp"%(module, architecture) else: project = "%s.mcp"%module if not projectdir: projectdir = PROJECTDIR if not sources: sources = [module + 'module.c'] if not sourcedirs: for moduledir in MODULEDIRS: if '%' in moduledir: moduledir = moduledir % module fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): moduledir, sourcefile = os.path.split(fn) sourcedirs = [relpath(projectdir, moduledir)] sources[0] = sourcefile break else: print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) sourcedirs = [] if architecture == "carbon": prefixname = "mwerks_carbonplugin_config.h" else: prefixname = "mwerks_plugin_config.h" dict = { "sysprefix" : relpath(projectdir, sys.prefix), "sources" : sources, "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, "mac_dllname" : dllname, "prefixname" : prefixname, } mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename)
700080c9619bc46969ee6f34b79646eca516507f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/700080c9619bc46969ee6f34b79646eca516507f/genpluginprojects.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 4094, 4406, 12, 991, 18123, 16, 1605, 16, 1984, 33, 7036, 16, 1984, 1214, 33, 7036, 16, 5550, 22850, 6487, 1084, 8291, 22850, 6487, 14732, 22850, 6487, 7582, 361, 10539, 22850, 6487,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3157, 4094, 4406, 12, 991, 18123, 16, 1605, 16, 1984, 33, 7036, 16, 1984, 1214, 33, 7036, 16, 5550, 22850, 6487, 1084, 8291, 22850, 6487, 14732, 22850, 6487, 7582, 361, 10539, 22850, 6487,...
str += '<H2>Package '+uid.name()+'</H2>\n\n'
str += '<h2>Package '+uid.name()+'</h2>\n\n'
def _module_to_html(self, uid): 'Return an HTML page for a Module' doc = self._docmap[uid] descr = doc.descr() if uid.is_package(): moduletype = 'package' else: moduletype = 'module' str = self._header(`uid`) str += self._navbar(moduletype, uid)
1b52b16120989cc834166571a9a1e9b8676d968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1b52b16120989cc834166571a9a1e9b8676d968f/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2978, 67, 869, 67, 2620, 12, 2890, 16, 4555, 4672, 296, 990, 392, 3982, 1363, 364, 279, 5924, 11, 997, 273, 365, 6315, 2434, 1458, 63, 1911, 65, 18426, 273, 997, 18, 28313, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2978, 67, 869, 67, 2620, 12, 2890, 16, 4555, 4672, 296, 990, 392, 3982, 1363, 364, 279, 5924, 11, 997, 273, 365, 6315, 2434, 1458, 63, 1911, 65, 18426, 273, 997, 18, 28313, 1435, ...
return self._ldap_call(self._l.unbind,)
return self._ldap_call(self._l.unbind)
def unbind(self): """ unbind_s() -> None unbind() -> int This call is used to unbind from the directory, terminate the current association, and free resources. Once called, the connection to the LDAP server is closed and the LDAP object is invalid. Further invocation of methods on the object will yield an exception. The unbind and unbind_s methods are identical, and are synchronous in nature """ return self._ldap_call(self._l.unbind,)
98616bb4635a2997ba80ebe92091c600f4e2e902 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4610/98616bb4635a2997ba80ebe92091c600f4e2e902/ldapobject.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17449, 12, 2890, 4672, 3536, 17449, 67, 87, 1435, 317, 599, 17449, 1435, 317, 509, 1220, 745, 353, 1399, 358, 17449, 628, 326, 1867, 16, 10850, 326, 783, 6384, 16, 471, 4843, 2703, 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, 17449, 12, 2890, 4672, 3536, 17449, 67, 87, 1435, 317, 599, 17449, 1435, 317, 509, 1220, 745, 353, 1399, 358, 17449, 628, 326, 1867, 16, 10850, 326, 783, 6384, 16, 471, 4843, 2703, 18, ...
if len(subject) > 2 and subject[2] == ':': topic = subject[3:].lstrip() else: topic = subject topic = topic.replace(' ', '') self.env.log.debug("Searching for message with topic %s", topic) db = self.env.get_read_db() cursor = db.cursor() cursor.execute('SELECT subject, conversation ' 'FROM mailinglistmessages ' 'WHERE list = %s AND date < %s' 'ORDER BY DATE LIMIT 1', (self.id, date)) for row in cursor: if subject == row[0].replace(' ',''): return MailinglistConversation(self.env, row[1]), False
if subject is not None: def prepare_subject_for_compare(subject): if len(subject) > 2 and subject[2] == ':': subject = subject[3:].lstrip() subject = subject.replace(" ","") return subject topic = prepare_subject_for_compare(subject) self.env.log.debug("Searching for message with topic %s", topic) db = self.env.get_read_db() cursor = db.cursor() cursor.execute('SELECT subject, conversation ' 'FROM mailinglistmessages ' 'WHERE list = %s AND date < %s' 'ORDER BY DATE DESC LIMIT 100', (self.id, date)) for row in cursor: if row[0] and prepare_subject_for_compare(row[0]) == topic: return MailinglistConversation(self.env, row[1]), False
def get_conv_ms(self, msg, subject, date): """ Returns the `MailinglistConversation` the msg belongs to. If the message is the first message in a conversation or if the conversation is unknown a newly created conversation is returned.
ed82221bab3db3c3569d41870d18fbd05b93e306 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/662/ed82221bab3db3c3569d41870d18fbd05b93e306/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4896, 67, 959, 12, 2890, 16, 1234, 16, 3221, 16, 1509, 4672, 3536, 2860, 326, 1375, 6759, 310, 1098, 15717, 68, 326, 1234, 11081, 358, 18, 971, 326, 883, 353, 326, 1122, 883, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 67, 4896, 67, 959, 12, 2890, 16, 1234, 16, 3221, 16, 1509, 4672, 3536, 2860, 326, 1375, 6759, 310, 1098, 15717, 68, 326, 1234, 11081, 358, 18, 971, 326, 883, 353, 326, 1122, 883, ...
while pp[i+1].chtype == chunk_type[COMMENT]: i = i + 1
def changeit(buf, pp): global onlylatexspecial, hist, out i, length = 0, len(pp) while 1: # sanity check: length should always equal len(pp) if len(pp) != length: print i, pp[i] raise 'FATAL', 'inconsistent length. thought ' + `length` + ', but should really be ' + `len(pp)` if i >= length: break ch = pp[i] i = i + 1 if type(ch) is StringType: #normally, only chunks are present in pp, # but in some cases, some extra info # has been inserted, e.g., the \end{...} clauses raise 'FATAL', 'got string, probably too many ' + `end` if ch.chtype == chunk_type[GROUP]: # check for {\em ...} constructs data = ch.data if data and \ data[0].chtype == chunk_type[CSNAME] and \ fontchanges.has_key(s(buf, data[0].data)): k = s(buf, data[0].data) del data[0] pp.insert(i-1, chunk(CSNAME, ch.where, fontchanges[k])) length, i = length+1, i+1 elif data: if len(data) \ and data[0].chtype == chunk_type[GROUP] \ and len(data[0].data) \ and data[0].data[0].chtype == chunk_type[CSNAME] \ and s(buf, data[0].data[0].data) == 'e': data[0] = data[0].data[0] print "invoking \\e magic group transform..." else:
a302c9555984072394cd72609bc8973adecd6fe3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a302c9555984072394cd72609bc8973adecd6fe3/partparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 305, 12, 4385, 16, 8228, 4672, 2552, 1338, 26264, 9371, 16, 5356, 16, 596, 225, 277, 16, 769, 273, 374, 16, 562, 12, 11858, 13, 1323, 404, 30, 468, 16267, 866, 30, 769, 1410, 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, 2549, 305, 12, 4385, 16, 8228, 4672, 2552, 1338, 26264, 9371, 16, 5356, 16, 596, 225, 277, 16, 769, 273, 374, 16, 562, 12, 11858, 13, 1323, 404, 30, 468, 16267, 866, 30, 769, 1410, 3...
circs_per_node,out_dir) = read_config(argv[1])
circs_per_node,out_dir,max_fetch_time) = read_config(argv[1])
def main(argv): TorUtil.read_config(argv[1]) (start_pct,stop_pct,nodes_per_slice,save_every, circs_per_node,out_dir) = read_config(argv[1]) try: (c,hdlr) = setup_handler() except Exception, e: plog("WARN", "Can't connect to Tor: "+str(e)) sql_file = os.getcwd()+'/'+out_dir+'/bwauthority.sqlite' hdlr.attach_sql_listener('sqlite:///'+sql_file) # set SOCKS proxy socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, tor_host, tor_port) socket.socket = socks.socksocket while True: pct = start_pct plog('INFO', 'Beginning time loop') while pct < stop_pct: pct_step = hdlr.rank_to_percent(nodes_per_slice) hdlr.reset_stats() hdlr.commit() plog('DEBUG', 'Reset stats') speedrace(hdlr, pct, pct+pct_step, circs_per_node, save_every, out_dir) plog('DEBUG', 'speedroced') hdlr.commit() hdlr.close_circuits() lo = str(round(pct,1)) hi = str(round(pct+pct_step,1)) hdlr.write_sql_stats(pct, pct+pct_step, os.getcwd()+'/'+out_dir+'/sql-'+lo+':'+hi+"-done-"+strftime("20%y-%m-%d-%H:%M:%S")) hdlr.write_strm_bws(pct, pct+pct_step, os.getcwd()+'/'+out_dir+'/bws-'+lo+':'+hi+"-done-"+strftime("20%y-%m-%d-%H:%M:%S")) plog('DEBUG', 'Wrote stats') pct += pct_step hdlr.save_sql_file(sql_file, "db-"+str(lo)+":"+str(hi)+"-"+strftime("20%y-%m-%d-%H:%M:%S")+".sqlite")
e8450ad1cd3c23315f682731ad3047861f509350 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3762/e8450ad1cd3c23315f682731ad3047861f509350/bwauthority.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 23763, 1304, 18, 896, 67, 1425, 12, 19485, 63, 21, 5717, 261, 1937, 67, 23989, 16, 5681, 67, 23989, 16, 4690, 67, 457, 67, 6665, 16, 5688, 67, 20434, 16, 5886, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 23763, 1304, 18, 896, 67, 1425, 12, 19485, 63, 21, 5717, 261, 1937, 67, 23989, 16, 5681, 67, 23989, 16, 4690, 67, 457, 67, 6665, 16, 5688, 67, 20434, 16, 5886, ...
return d._fix(context=self)
return d._fix(self)
def create_decimal(self, num='0'): """Creates a new Decimal instance but using self as context.""" d = Decimal(num, context=self) return d._fix(context=self)
dab988dd23e6328dadfe8408cd96abf4b017380d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dab988dd23e6328dadfe8408cd96abf4b017380d/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 12586, 12, 2890, 16, 818, 2218, 20, 11, 4672, 3536, 2729, 279, 394, 11322, 791, 1496, 1450, 365, 487, 819, 12123, 302, 273, 11322, 12, 2107, 16, 819, 33, 2890, 13, 327, 302, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 12586, 12, 2890, 16, 818, 2218, 20, 11, 4672, 3536, 2729, 279, 394, 11322, 791, 1496, 1450, 365, 487, 819, 12123, 302, 273, 11322, 12, 2107, 16, 819, 33, 2890, 13, 327, 302, ...
r'|this|throw|try|vararg|while|with|yield)', Keyword ), (r'(false|true|null)', Keyword.Constant),
r'|this|throw|try|vararg|while|with|yield)\b', Keyword), (r'(false|true|null)\b', Keyword.Constant),
def get_tokens_unprocessed(self, text): for index, token, value in \ RegexLexer.get_tokens_unprocessed(self, text): if token is Name: if value in self._functions: yield index, Name.Function, value continue elif '.' in value: a, b = value.split('.') yield index, Name, a yield index + len(a), Punctuation, u'.' yield index + len(a) + 1, Name, b continue yield index, token, value
2d7c675cae94a51f19c44cff1a4b58bbe1693839 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6148/2d7c675cae94a51f19c44cff1a4b58bbe1693839/agile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7860, 67, 318, 11005, 12, 2890, 16, 977, 4672, 364, 770, 16, 1147, 16, 460, 316, 521, 15078, 13356, 18, 588, 67, 7860, 67, 318, 11005, 12, 2890, 16, 977, 4672, 309, 1147, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7860, 67, 318, 11005, 12, 2890, 16, 977, 4672, 364, 770, 16, 1147, 16, 460, 316, 521, 15078, 13356, 18, 588, 67, 7860, 67, 318, 11005, 12, 2890, 16, 977, 4672, 309, 1147, 35...
defaultLocation = Carbon.File.FSRef(defaultLocation) args['defaultLocation'] = aepack.pack(defaultLocation)
if not isinstance(defaultLocation, Carbon.File.FSRef): defaultLocation = Carbon.File.FSRef(defaultLocation) args['defaultLocation'] = Carbon.AE.AECreateDesc( Carbon.AppleEvents.typeFSRef, defaultLocation.data)
def _process_Nav_args(dftflags, **args): import aepack import Carbon.AE import Carbon.File for k in args.keys(): if args[k] is None: del args[k] # Set some defaults, and modify some arguments if not args.has_key('dialogOptionFlags'): args['dialogOptionFlags'] = dftflags if args.has_key('defaultLocation') and \ not isinstance(args['defaultLocation'], Carbon.AE.AEDesc): defaultLocation = args['defaultLocation'] if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)): args['defaultLocation'] = aepack.pack(defaultLocation) else: defaultLocation = Carbon.File.FSRef(defaultLocation) args['defaultLocation'] = aepack.pack(defaultLocation) if args.has_key('typeList') and not isinstance(args['typeList'], Carbon.Res.ResourceType): typeList = args['typeList'][:] # Workaround for OSX typeless files: if 'TEXT' in typeList and not '\0\0\0\0' in typeList: typeList = typeList + ('\0\0\0\0',) data = 'Pyth' + struct.pack("hh", 0, len(typeList)) for type in typeList: data = data+type args['typeList'] = Carbon.Res.Handle(data) tpwanted = str if args.has_key('wanted'): tpwanted = args['wanted'] del args['wanted'] return args, tpwanted
f21d3a4fb4380b9f653ba59e69b112dd27736bbd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/f21d3a4fb4380b9f653ba59e69b112dd27736bbd/EasyDialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2567, 67, 12599, 67, 1968, 12, 72, 1222, 7133, 16, 2826, 1968, 4672, 1930, 279, 881, 484, 1930, 13353, 18, 16985, 1930, 13353, 18, 812, 364, 417, 316, 833, 18, 2452, 13332, 309, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2567, 67, 12599, 67, 1968, 12, 72, 1222, 7133, 16, 2826, 1968, 4672, 1930, 279, 881, 484, 1930, 13353, 18, 16985, 1930, 13353, 18, 812, 364, 417, 316, 833, 18, 2452, 13332, 309, 8...
obj_id2img_pos, step = self.getObj2ImgPos(strain_id_ls, img_pos_range=[0., 0.9])
StrainID2PCAPosInfo.x_var = explained_var[1] StrainID2PCAPosInfo.y_var = explained_var[0] obj_id2img_pos, step = self.getObj2ImgPos(strain_id_ls, img_pos_range=[0., snp_id_label_y_offset])
def getStrainID2PCAPosInfo(self, subSNPData, pca_range=[0,1]): """ 2008-10-07 """ sys.stderr.write("Getting StrainID2PCAPosInfo ... ") StrainID2PCAPosInfo = PassingData() import pca_module T, P, explained_var = pca_module.PCA_svd(subSNPData.data_matrix, standardize=True) #T[:,1] and T[:,2] are new positions for strain strain_id_ls, strain_id2pca_y = self.sortObjByPCA_value_ls(subSNPData.row_id2row_index, T[:,1], pca_range) strain_id2pca_x = self.getObj2posFromPCA_value_ls(subSNPData.row_id2row_index, T[:,2], pca_range) StrainID2PCAPosInfo.strain_id_ls = strain_id_ls StrainID2PCAPosInfo.strain_id2pca_y = strain_id2pca_y StrainID2PCAPosInfo.strain_id2pca_x = strain_id2pca_x obj_id2img_pos, step = self.getObj2ImgPos(strain_id_ls, img_pos_range=[0., 0.9]) StrainID2PCAPosInfo.strain_id2img_y_pos = obj_id2img_pos StrainID2PCAPosInfo.step = step sys.stderr.write("Done.\n") return StrainID2PCAPosInfo
8b01df4ec5dda455ad1b712723f6e5a54471503a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/8b01df4ec5dda455ad1b712723f6e5a54471503a/PlotGroupOfSNPs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1322, 9754, 734, 22, 3513, 37, 1616, 966, 12, 2890, 16, 720, 13653, 52, 751, 16, 293, 5353, 67, 3676, 22850, 20, 16, 21, 65, 4672, 3536, 4044, 28, 17, 2163, 17, 8642, 3536, 2589, 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, 1322, 9754, 734, 22, 3513, 37, 1616, 966, 12, 2890, 16, 720, 13653, 52, 751, 16, 293, 5353, 67, 3676, 22850, 20, 16, 21, 65, 4672, 3536, 4044, 28, 17, 2163, 17, 8642, 3536, 2589, 18,...
fileurl = KURL()
fileurl = KUrl()
def slotBrowseHomeDirClicked(self): fileurl = KURL() fileurl.setPath(self.homediredit.text()) self.homedirdialog.setCurrentURL(fileurl) if self.homedirdialog.exec_()==QDialog.Accepted: self.homediredit.setText(self.homedirdialog.url().path()) self.homedirectoryislinked = False
eb812f938fe74be7d359e6fa9fcc28e3d8c3b025 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1669/eb812f938fe74be7d359e6fa9fcc28e3d8c3b025/user.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4694, 27304, 8684, 1621, 27633, 12, 2890, 4672, 585, 718, 273, 1475, 1489, 1435, 585, 718, 18, 542, 743, 12, 2890, 18, 17125, 329, 2921, 305, 18, 955, 10756, 365, 18, 17125, 329, 6909, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4694, 27304, 8684, 1621, 27633, 12, 2890, 4672, 585, 718, 273, 1475, 1489, 1435, 585, 718, 18, 542, 743, 12, 2890, 18, 17125, 329, 2921, 305, 18, 955, 10756, 365, 18, 17125, 329, 6909, ...
return s
return ''.join(s)
def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads.
2084efa9b5d5fb134136ab2e22dad36cad278aaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2084efa9b5d5fb134136ab2e22dad36cad278aaa/httplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4626, 67, 896, 12, 2890, 16, 25123, 4672, 3536, 1994, 326, 1300, 434, 1731, 3764, 16, 1161, 773, 1776, 364, 4702, 6838, 18, 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, 389, 4626, 67, 896, 12, 2890, 16, 25123, 4672, 3536, 1994, 326, 1300, 434, 1731, 3764, 16, 1161, 773, 1776, 364, 4702, 6838, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
failure_map.add_regression_window(builder, regression_window)
if regression_window: failure_map.add_regression_window(builder, regression_window)
def failure_map(self, only_core_builders=True): builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses() failure_map = FailureMap() revision_to_failing_bots = {} for builder_status in builder_statuses: if builder_status["is_green"]: continue builder = self.builder_with_name(builder_status["name"]) regression_window = builder.find_blameworthy_regression_window(builder_status["build_number"]) failure_map.add_regression_window(builder, regression_window) return failure_map
a616433c95afa05fbdc12614493608a979cfcda3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/a616433c95afa05fbdc12614493608a979cfcda3/buildbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5166, 67, 1458, 12, 2890, 16, 1338, 67, 3644, 67, 3510, 414, 33, 5510, 4672, 2089, 67, 21655, 273, 365, 18, 3644, 67, 9574, 67, 21655, 1435, 309, 1338, 67, 3644, 67, 3510, 414, 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, 5166, 67, 1458, 12, 2890, 16, 1338, 67, 3644, 67, 3510, 414, 33, 5510, 4672, 2089, 67, 21655, 273, 365, 18, 3644, 67, 9574, 67, 21655, 1435, 309, 1338, 67, 3644, 67, 3510, 414, 469, ...
return unicode(self.text()).lower() < unicode(other.text()).lower()
return sort_key(unicode(self.text())) < sort_key(unicode(other.text()))
def __lt__(self, other): return unicode(self.text()).lower() < unicode(other.text()).lower()
0ac81d2c14ecbb444a2f2681fe9d408526d93e27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/0ac81d2c14ecbb444a2f2681fe9d408526d93e27/edit_authors_dialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5618, 972, 12, 2890, 16, 1308, 4672, 327, 5252, 12, 2890, 18, 955, 1435, 2934, 8167, 1435, 411, 5252, 12, 3011, 18, 955, 1435, 2934, 8167, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5618, 972, 12, 2890, 16, 1308, 4672, 327, 5252, 12, 2890, 18, 955, 1435, 2934, 8167, 1435, 411, 5252, 12, 3011, 18, 955, 1435, 2934, 8167, 1435, 2, -100, -100, -100, -100, -100, ...
def test_varsized_array(self): array = (c_int * 20)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29) varsize_array = (c_int * 1).from_address(addressof(array)) self.failUnlessEqual(varsize_array[0], 20) self.failUnlessEqual(varsize_array[1], 21) self.failUnlessEqual(varsize_array[2], 22) self.failUnlessEqual(varsize_array[3], 23) self.failUnlessEqual(varsize_array[4], 24) self.failUnlessEqual(varsize_array[5], 25) self.failUnlessEqual(varsize_array[6], 26) self.failUnlessEqual(varsize_array[7], 27) self.failUnlessEqual(varsize_array[8], 28) self.failUnlessEqual(varsize_array[9], 29) self.failUnlessEqual(varsize_array[-1], 20) self.failUnlessRaises(IndexError, lambda: varsize_array[-2]) self.failUnlessRaises(MemoryError, lambda: varsize_array[:]) varsize_array[0] = 100 varsize_array[1] = 101 varsize_array[2] = 102 varsize_array[3] = 103 varsize_array[4] = 104 varsize_array[5] = 105 varsize_array[6] = 106 varsize_array[7] = 107 varsize_array[8] = 108 varsize_array[9] = 109 for i in range(10): self.failUnlessEqual(varsize_array[i], i + 100) self.failUnlessEqual(array[i], i + 100) self.failUnlessEqual(varsize_array[0:10], range(100, 110)) self.failUnlessEqual(varsize_array[1:9], range(101, 109)) self.failUnlessEqual(varsize_array[1:-1], []) varsize_array[0:10] = range(1000, 1010) self.failUnlessEqual(varsize_array[0:10], range(1000, 1010)) varsize_array[1:9] = range(1001, 1009) self.failUnlessEqual(varsize_array[1:9], range(1001, 1009)) def test_vararray_is_sane(self): array = (c_int * 15)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29) varsize_array = (c_int * 1).from_address(addressof(array)) varsize_array[:] = [1, 2, 3, 4, 5] self.failUnlessEqual(array[:], [1, 2, 3, 4, 5, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0]) self.failUnlessEqual(varsize_array[0:10], [1, 2, 3, 4, 5, 25, 26, 27, 28, 29]) array[:5] = [10, 11, 12, 13, 14] self.failUnlessEqual(array[:], [10, 11, 12, 13, 14, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0]) self.failUnlessEqual(varsize_array[0:10], [10, 11, 12, 13, 14, 25, 26, 27, 28, 29])
def test_varsized_array(self): array = (c_int * 20)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29)
e1bb523633a9b6e3908d384a0d2bb14871e8e428 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e1bb523633a9b6e3908d384a0d2bb14871e8e428/test_varsize_struct.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4699, 1235, 67, 1126, 12, 2890, 4672, 526, 273, 261, 71, 67, 474, 380, 4200, 21433, 3462, 16, 9035, 16, 11201, 16, 10213, 16, 4248, 16, 6969, 16, 10659, 16, 12732, 16, 9131, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4699, 1235, 67, 1126, 12, 2890, 4672, 526, 273, 261, 71, 67, 474, 380, 4200, 21433, 3462, 16, 9035, 16, 11201, 16, 10213, 16, 4248, 16, 6969, 16, 10659, 16, 12732, 16, 9131, ...
attr = t.get_all_attributes(butname=True)
attr = t.get_all_attributes(butname = True, withparent = True)
def save(self): doc, xmlroot = cleanxml.emptydoc(XMLROOT) tags = self.get_all_tags() already_saved = [] #We avoid saving the same tag twice #we don't save tags with no attributes #It saves space and allow the saved list growth to be controlled for t in tags: attr = t.get_all_attributes(butname=True) if "special" in attr: continue if len(attr) > 0: tagname = t.get_name() if not tagname in already_saved: t_xml = doc.createElement("tag") t_xml.setAttribute("name", tagname) already_saved.append(tagname) for a in attr: value = t.get_attribute(a) if value: t_xml.setAttribute(a, value) xmlroot.appendChild(t_xml) cleanxml.savexml(self.filename, doc)
e8ec3436167c252d14b822975f4afc86cc8232c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/e8ec3436167c252d14b822975f4afc86cc8232c0/tagstore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 4672, 997, 16, 2025, 3085, 273, 2721, 2902, 18, 5531, 2434, 12, 4201, 9185, 13, 2342, 273, 365, 18, 588, 67, 454, 67, 4156, 1435, 1818, 67, 14077, 273, 5378, 468, 3218,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1923, 12, 2890, 4672, 997, 16, 2025, 3085, 273, 2721, 2902, 18, 5531, 2434, 12, 4201, 9185, 13, 2342, 273, 365, 18, 588, 67, 454, 67, 4156, 1435, 1818, 67, 14077, 273, 5378, 468, 3218,...
')'
'))'
def products_by_location(self, cursor, user, location_ids, product_ids=None, with_childs=False, skip_zero=True, context=None): """ Compute for each location and product the stock quantity in the default uom of the product.
62dd82a73f81c502cd51a77e9014499bded294a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/62dd82a73f81c502cd51a77e9014499bded294a6/product.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10406, 67, 1637, 67, 3562, 12, 2890, 16, 3347, 16, 729, 16, 2117, 67, 2232, 16, 3017, 67, 2232, 33, 7036, 16, 598, 67, 3624, 87, 33, 8381, 16, 2488, 67, 7124, 33, 5510, 16, 819, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10406, 67, 1637, 67, 3562, 12, 2890, 16, 3347, 16, 729, 16, 2117, 67, 2232, 16, 3017, 67, 2232, 33, 7036, 16, 598, 67, 3624, 87, 33, 8381, 16, 2488, 67, 7124, 33, 5510, 16, 819, 33...
check("$1")
def check(s): self.assertRaises(InterpolationSyntaxError, interpolate, s, d)
12b8ea72fd000ccb0df25fedfdf924ca30888d8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9785/12b8ea72fd000ccb0df25fedfdf924ca30888d8a/testInterp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 87, 4672, 365, 18, 11231, 12649, 6141, 12, 31516, 22510, 16, 13156, 16, 272, 16, 302, 13, 2, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 87, 4672, 365, 18, 11231, 12649, 6141, 12, 31516, 22510, 16, 13156, 16, 272, 16, 302, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
base = 'https://kovid@svn.kovidgoyal.net/code/calibre' tag = base + '/tags/'+__version__ client = pysvn.Client() client.exception_style = 1 try: client.ls(tag) except pysvn.ClientError, err: if err.args[1][0][1] == 160013: def get_credentials(realm, username, may_save): return (True, 'kovid', input('Enter password for kovid: '), True) client.callback_get_login = get_credentials def get_log_message(): return True, 'Tagging %s for release'%__version__ client.callback_get_log_message = get_log_message client.copy(base+'/trunk', tag)
check_call('bzr tag '+__version__)
def tag_release(): print 'Tagging release' base = 'https://kovid@svn.kovidgoyal.net/code/calibre' tag = base + '/tags/'+__version__ client = pysvn.Client() client.exception_style = 1 try: client.ls(tag) except pysvn.ClientError, err: if err.args[1][0][1] == 160013: # Tag does not exist def get_credentials(realm, username, may_save): return (True, 'kovid', input('Enter password for kovid: '), True) client.callback_get_login = get_credentials def get_log_message(): return True, 'Tagging %s for release'%__version__ client.callback_get_log_message = get_log_message client.copy(base+'/trunk', tag)
ec84002c1370c51697c04c0965338194f1cb50fd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/ec84002c1370c51697c04c0965338194f1cb50fd/upload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1047, 67, 9340, 13332, 1172, 296, 1805, 1998, 3992, 11, 1026, 273, 296, 4528, 2207, 28179, 1246, 36, 31505, 18, 28179, 1246, 3240, 93, 287, 18, 2758, 19, 710, 19, 771, 495, 266, 11, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1047, 67, 9340, 13332, 1172, 296, 1805, 1998, 3992, 11, 1026, 273, 296, 4528, 2207, 28179, 1246, 36, 31505, 18, 28179, 1246, 3240, 93, 287, 18, 2758, 19, 710, 19, 771, 495, 266, 11, 10...
def __init__(self, cache, coireVetoMissedCache, opts, deltaTime=20):
def __init__(self, cache, coireVetoMissedCache, opts):
def __init__(self, cache, coireVetoMissedCache, opts, deltaTime=20): """ Initialize this class and sets up all the cache files. @param cache: the cache of all files @param coireVetoMissedCache: the cache that contains the COIRE-files of the missed injections @param opts: The 'opts' from the main code @param deltaTime: The time window that is used in the time-series plots (in seconds) """ # must do this within here for unknown reason; error instead from glue.ligolw import table rcParams.update({'text.usetex': False})
115859e1e4ac66dbab60f88a183f2a4596551391 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/115859e1e4ac66dbab60f88a183f2a4596551391/followup_missed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1247, 16, 1825, 577, 58, 11453, 11729, 730, 1649, 16, 1500, 4672, 3536, 9190, 333, 667, 471, 1678, 731, 777, 326, 1247, 1390, 18, 632, 891, 1247, 30, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1247, 16, 1825, 577, 58, 11453, 11729, 730, 1649, 16, 1500, 4672, 3536, 9190, 333, 667, 471, 1678, 731, 777, 326, 1247, 1390, 18, 632, 891, 1247, 30, 326...
line()
line("array-open-1")
def compileNode(node, enableDebug=False): global indent global pretty if node.getChild("commentsBefore", False) != None: line() for comment in node.getChild("commentsBefore").children: # Additional new lines before big comment if comment.get("detail", False) == "multi": line() pretty += comment.get("text") # New line after singleline comment without line-ending if not comment.get("text").endswith("\n"): line() # Additional new lines after big comment elif comment.get("detail", False) == "multi": line() ################################################################## # Opening... ################################################################## if node.type == "map": if node.hasChildren(): line() pretty += "{" if node.hasChildren(): plus() line() elif node.type == "array": if node.hasChildren(): line() pretty += "[" if node.hasChildren(): plus() line() elif node.type == "block": line() pretty += "{" plus() line() elif node.type == "params": pretty += "(" elif node.type == "group": pretty += "(" elif node.type == "case": minus() line() pretty += "case " elif node.type == "catch": pretty += "catch" elif node.type == "finally": pretty += "finally" elif node.type == "delete": pretty += "delete " elif node.type == "break": pretty += "break" if node.get("label", False): pretty += " " + node.get("label", False) elif node.type == "continue": pretty += "continue" if node.get("label", False): pretty += " " + node.get("label", False) elif node.type == "elseStatement": line() pretty += "else" # This is a elseStatement without a block around (a set of {}) if not node.hasChild("block"): pretty += " " elif node.type == "switch" and node.get("switchType") == "case": pretty += "switch" elif node.type == "switch" and node.get("switchType") == "catch": pretty += "try" elif node.type == "throw": pretty += "throw " elif node.type == "instantiation": pretty += "new " elif node.type == "return": pretty += "return" if node.hasChildren(): pretty += " " elif node.type == "definitionList": pretty += "var " elif node.type == "default": minus() line() pretty += "default:" plus() line() elif node.type == "keyvalue": keyString = node.get("key") keyQuote = node.get("quotation", False) if keyQuote != None: # print "USE QUOTATION" if keyQuote == "doublequotes": keyString = '"' + keyString + '"' else: keyString = "'" + keyString + "'" elif keyString in config.JSPROTECTED or not KEY.match(keyString): print "ATTENTION: Auto protect key: %s" % keyString keyString = "\"" + keyString + "\"" pretty += keyString + " : " elif node.type == "expression": if node.parent.type == "loop": loopType = node.parent.get("loopType") if loopType == "DO": pretty += "while" # open expression block of IF/WHILE/DO-WHILE/FOR statements pretty += "(" elif node.parent.type == "catch": # open expression block of CATCH statement pretty += "(" elif node.parent.type == "switch" and node.parent.get("switchType") == "case": # open expression block of SWITCH statement pretty += "(" elif node.type == "loop": loopType = node.get("loopType") if loopType == "IF": pretty += "if" elif loopType == "WHILE": pretty += "while" elif loopType == "FOR": pretty += "for" elif loopType == "DO": pretty += "do" elif loopType == "WITH": pretty += "with" else: print "UNKNOWN LOOP TYPE: %s" % loopType elif node.type == "function": functionDeclHasParams = False pretty += "function" functionName = node.get("name", False) if functionName != None: pretty += " %s" % functionName elif node.type == "identifier": name = node.get("name", False) if name != None: pretty += name elif node.type == "call": callHasParams = False elif node.type == "definition": if node.parent.type != "definitionList": pretty += "var " pretty += node.get("identifier") elif node.type == "constant": if node.get("constantType") == "string": if node.get("detail") == "singlequotes": pretty += "'" else: pretty += '"' pretty += node.get("value") if node.get("detail") == "singlequotes": pretty += "'" else: pretty += '"' else: pretty += node.get("value") elif node.type == "third": if node.parent.type == "operation": if node.parent.get("operator") == "HOOK": pretty += " : " else: print "Unknown third argument... Not a hook" elif node.type == "labelTerminator": pretty += ":" ################################################################## # Children content ################################################################## if node.hasChildren(): childPosition = 1 childrenNumber = 0 # We need to ignore comment blocks # childrenNumber = len(node.children) for child in node.children: if child.type == "comment" or child.type == "commentsBefore": pass else: childrenNumber += 1 previousType = None for child in node.children: if child.type == "comment" or child.type == "commentsBefore": continue # Hints for close of node later if node.type == "call" and child.type == "params": callHasParams = True elif node.type == "function": if child.type == "params": functionDeclHasParams = True elif child.type == "body" and not functionDeclHasParams: # has no params before body, fix it here, and add body afterwards pretty += "()" functionDeclHasParams = True elif node.type == "definition" and child.type == "assignment": oper = child.get("operator", False) pretty += " " if oper != None: pretty += getTokenSource(oper) else: pretty += "=" pretty += " " elif node.type == "accessor" and child.type == "key": pretty += "[" elif node.type == "accessor" and child.type == "right": pretty += "." elif node.type == "loop" and node.get("loopType") == "FOR": if child.type == "first": pretty += "(" elif child.type == "statement": pretty += ")" else: if child.type == "second" and node.getChild("first", False) == None: pretty += "(" if child.type == "third" and node.getChild("first", False) == None and node.getChild("second", False) == None: pretty += "(" if not pretty.endswith(";") and not pretty.endswith("\n"): pretty += ";" elif node.type == "operation" and node.get("left", False) == "true": op = node.get("operator") if op == "TYPEOF": pretty += "typeof " elif op == None: print "BAD OPERATOR [A]: %s" % op else: pretty += getTokenSource(op) # Add child compileNode(child, enableDebug) if node.type == "operation" and child.type == "first" and node.get("left", False) != "true": op = node.get("operator") if op == "IN": pretty += " in " elif op == "INSTANCEOF": pretty += " instanceof " elif op == None: print "BAD OPERATOR [B]: %s" % op else: pretty += " " pretty += getTokenSource(op) pretty += " " elif node.type == "assignment" and child.type == "left": oper = node.get("operator", False) pretty += " " if oper != None: pretty += getTokenSource(oper) else: pretty += "=" pretty += " " elif node.type == "accessor" and child.type == "key": pretty += "]" # Separate children in parent list if childPosition < childrenNumber: if node.type == "variable": pretty += "." elif node.type == "map": pretty += ", " line() elif node.type == "array": pretty += ", " line() elif node.type == "definitionList": pretty += ", " elif node.type == "params": pretty += ", " elif node.type == "statementList": pretty += ", " separators = [ "block", "assignment", "call", "operation", "definition", "definitionList", "return", "break", "continue", "delete", "accessor", "instantiation", "throw", "variable", "function" ] not_after = [ "case", "default" ] not_in = [ "definitionList", "statementList", "params", "variable", "array" ] if node.type in [ "block", "file", "switch" ]: if not previousType in not_after: if child.type in separators: # pretty += "[[SEMI]]" semicolon() # not last child if childPosition == childrenNumber and node.type in [ "block", "switch", "file" ]: pass else: # pretty += "[[LINE]]" line() # Next... childPosition += 1 previousType = child.type ################################################################## # Closing... ################################################################## if node.type == "map": if node.hasChildren(): minus() line() pretty += "}" elif node.type == "array": if node.hasChildren(): minus() line() pretty += "]" elif node.type == "block": minus() line() pretty += "}" # Not it: # Function assignment if node.parent.type == "body" and node.parent.parent.type == "function" and node.parent.parent.parent.type == "right": pass else: line() elif node.type == "params": pretty += ")" elif node.type == "switch" and node.get("switchType") == "case": minus() minus() line() pretty += "}" # additional new line line() line() elif node.type == "group": pretty += ")" elif node.type == "case": pretty += ":" plus() line() elif node.type == "call" and not callHasParams: pretty += "()" elif node.type == "function" and not functionDeclHasParams: pretty += "()" elif node.type == "expression": if node.parent.type == "loop": pretty += ")" elif node.parent.type == "catch": pretty += ")" elif node.parent.type == "switch" and node.parent.get("switchType") == "case": pretty += ")" line() pretty += "{" plus() plus() elif node.type == "case": plus() line()
9899d5c45563dd4f9057d173402244e0cf855c51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/9899d5c45563dd4f9057d173402244e0cf855c51/prettyprint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 907, 12, 2159, 16, 4237, 2829, 33, 8381, 4672, 225, 2552, 3504, 2552, 7517, 282, 309, 756, 18, 588, 1763, 2932, 9231, 4649, 3113, 1083, 13, 480, 599, 30, 980, 2932, 1126, 17, 319...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4074, 907, 12, 2159, 16, 4237, 2829, 33, 8381, 4672, 225, 2552, 3504, 2552, 7517, 282, 309, 756, 18, 588, 1763, 2932, 9231, 4649, 3113, 1083, 13, 480, 599, 30, 980, 2932, 1126, 17, 319...
class ByteArraySubclass(bytearray): pass class ByteArraySubclassTest(unittest.TestCase):
class SubclassTest(unittest.TestCase):
def test_lower(self): pass
41f58a70ac168c3f468d2dacb945dd88f1c89350 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/41f58a70ac168c3f468d2dacb945dd88f1c89350/test_bytes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8167, 12, 2890, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8167, 12, 2890, 4672, 1342, 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, -10...
file_.schema = PSCFileSchema file_.setDownloadableFile(File(filename, filename, StringIO(data)))
file_.schema = PSCFileSchema if filename == '' and data == '': logging.info('file empty for %s' % file_) else: if filename is None: filename = file_.getId() file_.setDownloadableFile(File(filename, filename, StringIO(data)))
def _discovering_dist_ids(project): # for each file in the project we # extract the distutils name project_path = '/'.join(project.getPhysicalPath()) files = cat(**{'portal_type': ['PSCFile', 'PSCFileLink'], 'path': project_path}) ids = []
f273d3a72c298a8d2aac898efd04f1828f64062f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12516/f273d3a72c298a8d2aac898efd04f1828f64062f/setuphandlers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2251, 3165, 310, 67, 4413, 67, 2232, 12, 4406, 4672, 468, 364, 1517, 585, 316, 326, 1984, 732, 468, 2608, 326, 2411, 5471, 508, 1984, 67, 803, 273, 2023, 18, 5701, 12, 4406, 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, 389, 2251, 3165, 310, 67, 4413, 67, 2232, 12, 4406, 4672, 468, 364, 1517, 585, 316, 326, 1984, 732, 468, 2608, 326, 2411, 5471, 508, 1984, 67, 803, 273, 2023, 18, 5701, 12, 4406, 18, ...
(r'((,)(\s*)(' + _id + '))+', bygroups(Punctuation, Whitespace, \
(r'(?:(,)(\s*)(' + _id + '))+', bygroups(Punctuation, Whitespace, \
def __init__(self, **options): super(RagelJavaLexer, self).__init__(JavaLexer, RagelEmbeddedLexer, **options)
91ed42121659525c0110ea34e742958d4045be3c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6148/91ed42121659525c0110ea34e742958d4045be3c/parsers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 2116, 4672, 2240, 12, 54, 346, 292, 5852, 13356, 16, 365, 2934, 972, 2738, 972, 12, 5852, 13356, 16, 534, 346, 292, 14980, 13356, 16, 2826, 2116, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 2116, 4672, 2240, 12, 54, 346, 292, 5852, 13356, 16, 365, 2934, 972, 2738, 972, 12, 5852, 13356, 16, 534, 346, 292, 14980, 13356, 16, 2826, 2116, 1...
print query
def test_query(query): print query assert not parser.parse_query(query).xapian_term(self.request, connection).empty()
746edb0feccdfb2a232c5c4a587db71107da6345 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/746edb0feccdfb2a232c5c4a587db71107da6345/test_search.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2271, 12, 2271, 4672, 1815, 486, 2082, 18, 2670, 67, 2271, 12, 2271, 2934, 92, 2425, 304, 67, 6408, 12, 2890, 18, 2293, 16, 1459, 2934, 5531, 1435, 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, 1842, 67, 2271, 12, 2271, 4672, 1815, 486, 2082, 18, 2670, 67, 2271, 12, 2271, 2934, 92, 2425, 304, 67, 6408, 12, 2890, 18, 2293, 16, 1459, 2934, 5531, 1435, 2, -100, -100, -100, -100,...
self.__interest_id_assign += 1 self.__interests[self.__interest_id_assign] = description contextId = self.__interest_id_assign self.__sendAddInterest(contextId, parentId, zoneId) self.printInterests()
self._interestIdAssign += 1 self._interests[self._interestIdAssign] = description contextId = self._interestIdAssign self._sendAddInterest(contextId, parentId, zoneId) assert self.printInterests()
def addInterest(self, parentId, zoneId, description): """ Part of the new otp-server code. """ self.__interest_id_assign += 1 self.__interests[self.__interest_id_assign] = description contextId = self.__interest_id_assign self.__sendAddInterest(contextId, parentId, zoneId) self.printInterests() return contextId
6fa2adfa8af8fae19707bd7f23de8726e4edc65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/6fa2adfa8af8fae19707bd7f23de8726e4edc65d/ClientRepository.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 29281, 12, 2890, 16, 11582, 16, 29939, 16, 2477, 4672, 3536, 6393, 434, 326, 394, 28625, 17, 3567, 981, 18, 3536, 365, 6315, 2761, 395, 548, 4910, 1011, 404, 365, 6315, 2761, 25563,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 29281, 12, 2890, 16, 11582, 16, 29939, 16, 2477, 4672, 3536, 6393, 434, 326, 394, 28625, 17, 3567, 981, 18, 3536, 365, 6315, 2761, 395, 548, 4910, 1011, 404, 365, 6315, 2761, 25563,...
self.get_menustack().pushmenu(Menu(self.name, items, type='tv program menu'))
menu = Menu(self.name, items, type='tv program menu') self.get_menustack().pushmenu(menu) class CategoryItem(Item): """ Item for a TV category """ def __init__(self, parent, name): Item.__init__(self, parent) self.name = name self.parent = parent def actions(self): return [ Action(_('Browse list'), self.browse)] @kaa.notifier.yield_execution() def browse(self): """ Find all genres that are in this category """ items = [] if self.name==ALL: query_data = kaa.epg.search(attrs=['genre'], distinct=True) else: query_data = kaa.epg.search(attrs=['genre'], category=self.name, distinct=True) yield query_data query_data = query_data() query_data.sort() if self.name == ALL: for genre, in query_data: if genre not in EXCLUDE_GENRES: items.append(GenreItem(self.parent, genre)) else: for genre, in query_data: if genre not in EXCLUDE_GENRES: items.append(GenreItem(self.parent, genre, self.name)) menu = Menu(self.name, items, type='tv listing') self.get_menustack().pushmenu(menu)
def browse(self): """ Find all the programs with this genre """ items = [] # query epg in background query_data = kaa.epg.search(genre=self.name) yield query_data # fetch epg data from InProgress object query_data = query_data() for prg in query_data: items.append(ProgramItem(prg, self)) self.get_menustack().pushmenu(Menu(self.name, items, type='tv program menu'))
9da06e00b253d9d57b6bbb2a4bab6176fa69c325 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11399/9da06e00b253d9d57b6bbb2a4bab6176fa69c325/genre.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21670, 12, 2890, 4672, 3536, 4163, 777, 326, 25038, 598, 333, 3157, 266, 3536, 1516, 273, 5378, 468, 843, 31682, 316, 5412, 843, 67, 892, 273, 417, 7598, 18, 881, 75, 18, 3072, 12, 450...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4672, 3536, 4163, 777, 326, 25038, 598, 333, 3157, 266, 3536, 1516, 273, 5378, 468, 843, 31682, 316, 5412, 843, 67, 892, 273, 417, 7598, 18, 881, 75, 18, 3072, 12, 450...
rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document" \Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document" \Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document"'''])
rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document,vector" \Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document,vector" \Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document,vector"'''])
def checkFormatEntries(): ''' Check all formats (\Format entries) ''' checkViewer('a Tgif viewer and editor', ['tgif'], rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%" ""']) # checkViewer('a FIG viewer and editor', ['xfig'], rc_entry = [r'\Format fig fig FIG "" "%%" "%%" ""']) # checkViewer('a Grace viewer and editor', ['xmgrace'], rc_entry = [r'\Format agr agr Grace "" "%%" "%%" ""']) # checkViewer('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'], rc_entry = [r'\Format fen fen FEN "" "%%" "%%" ""']) # path, iv = checkViewer('a raster image viewer', ['xv', 'kview', 'gimp']) path, ie = checkViewer('a raster image editor', ['gimp']) addToRC(r'''\Format bmp bmp BMP "" "%s" "%s" ""
2c72e0ecaaf865dbd297652b27bf151011e987c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/2c72e0ecaaf865dbd297652b27bf151011e987c6/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1630, 5400, 13332, 9163, 2073, 777, 6449, 17938, 1630, 3222, 13, 9163, 866, 18415, 2668, 69, 399, 13905, 14157, 471, 4858, 2187, 10228, 88, 13905, 17337, 4519, 67, 4099, 273, 306, 86,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1630, 5400, 13332, 9163, 2073, 777, 6449, 17938, 1630, 3222, 13, 9163, 866, 18415, 2668, 69, 399, 13905, 14157, 471, 4858, 2187, 10228, 88, 13905, 17337, 4519, 67, 4099, 273, 306, 86,...
return data[:-2] + '\n'
return data.replace('\r\n', '\n')
def normalize_output(data): # Some operating systems do conversions on newline. We could possibly # fix that by doing the appropriate termios.tcsetattr()s. I couldn't # figure out the right combo on Tru64 and I don't have an IRIX box. # So just normalize the output and doc the problem O/Ses by allowing # certain combinations for some platforms, but avoid allowing other # differences (like extra whitespace, trailing garbage, etc.) # This is about the best we can do without getting some feedback # from someone more knowledgable. # OSF/1 (Tru64) apparently turns \n into \r\r\n. if data.endswith('\r\r\n'): return data[:-3] + '\n' # IRIX apparently turns \n into \r\n. if data.endswith('\r\n'): return data[:-2] + '\n' return data
9e9e8b6c6599e466b3ffa78ab2abe8280c69208d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9e9e8b6c6599e466b3ffa78ab2abe8280c69208d/test_pty.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3883, 67, 2844, 12, 892, 4672, 468, 10548, 16929, 14908, 741, 22586, 603, 9472, 18, 225, 1660, 3377, 10016, 468, 2917, 716, 635, 9957, 326, 5505, 2481, 7441, 18, 5111, 542, 1747, 1435, 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, 3883, 67, 2844, 12, 892, 4672, 468, 10548, 16929, 14908, 741, 22586, 603, 9472, 18, 225, 1660, 3377, 10016, 468, 2917, 716, 635, 9957, 326, 5505, 2481, 7441, 18, 5111, 542, 1747, 1435, 8...
line_length_rules = [ (re.compile(r'(?<=.{%i}[a-z,;:-IA])\s*(?P<ital></(i|b|u)>)?\s*(<p.*?>)\s*(?=(<(i|b|u)>)?[\w\d])' % line_length(html, .3), re.UNICODE), wrap_lines), ]
length = line_length(html, .3) line_length_rules = [] if length: line_length_rules = [ (re.compile(r'(?<=.{%i}[a-z,;:-IA])\s*(?P<ital></(i|b|u)>)?\s*(<p.*?>)\s*(?=(<(i|b|u)>)?[\w\d])' % length, re.UNICODE), wrap_lines), ]
def __call__(self, html, remove_special_chars=None): if remove_special_chars is not None: html = remove_special_chars.sub('', html) html = html.replace('\0', '') if self.is_baen(html): rules = [] elif self.is_book_designer(html): rules = self.BOOK_DESIGNER elif self.is_pdftohtml(html): line_length_rules = [ # Un wrap using punctuation (re.compile(r'(?<=.{%i}[a-z,;:-IA])\s*(?P<ital></(i|b|u)>)?\s*(<p.*?>)\s*(?=(<(i|b|u)>)?[\w\d])' % line_length(html, .3), re.UNICODE), wrap_lines), ]
65dfbd5cb4e3a11871ffb274b0830f8fb5ee2b5b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/65dfbd5cb4e3a11871ffb274b0830f8fb5ee2b5b/preprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 1729, 16, 1206, 67, 9371, 67, 7549, 33, 7036, 4672, 309, 1206, 67, 9371, 67, 7549, 353, 486, 599, 30, 1729, 273, 1206, 67, 9371, 67, 7549, 18, 1717, 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, 1001, 1991, 972, 12, 2890, 16, 1729, 16, 1206, 67, 9371, 67, 7549, 33, 7036, 4672, 309, 1206, 67, 9371, 67, 7549, 353, 486, 599, 30, 1729, 273, 1206, 67, 9371, 67, 7549, 18, 1717, 26...
raise osv.except_osv(_('Warning !'), _('There is no stage for lost oppportunities defined for this Sale Team.'))
raise osv.except_osv(_('Warning !'), _('There is no stage for lost opportunities defined for this Sale Team.'))
def case_mark_lost(self, cr, uid, ids, *args): """Mark the case as lost: state = done and probability = 0% @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of case Ids @param *args: Tuple Value for additional Params """ res = super(crm_opportunity, self).case_close(cr, uid, ids, args) stage_id = super(crm_opportunity, self).stage_next(cr, uid, ids, context={'force_domain': [('probability', '=', 0)]}) if not stage_id: raise osv.except_osv(_('Warning !'), _('There is no stage for lost oppportunities defined for this Sale Team.')) value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value'] value.update({'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'), 'stage_id': stage_id})
6b735b672cd7bc8954e370238249896149898448 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6b735b672cd7bc8954e370238249896149898448/crm_opportunity.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 648, 67, 3355, 67, 383, 334, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 3536, 3882, 326, 648, 487, 13557, 30, 919, 273, 2731, 471, 11331, 273, 374, 9, 632, 891, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 648, 67, 3355, 67, 383, 334, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 3536, 3882, 326, 648, 487, 13557, 30, 919, 273, 2731, 471, 11331, 273, 374, 9, 632, 891, 365...
"values",GL_GET_PIXEL_MAP_SIZE, "map",
"values",GL_GET_PIXEL_MAP_SIZE, "map",
def GL_GET_PIXEL_MAP_SIZE( pname ): """Given a pname, lookup the size using a glGet query...""" constant = PIXEL_MAP_SIZE_CONSTANT_MAP[ pname ] return glGetIntegerv( constant )
779beb78d8242dd156d555119ccab07062fb4bf3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1545/779beb78d8242dd156d555119ccab07062fb4bf3/glget.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10252, 67, 3264, 67, 27381, 2247, 67, 8352, 67, 4574, 12, 19952, 262, 30, 3536, 6083, 279, 19952, 16, 3689, 326, 963, 1450, 279, 5118, 967, 843, 7070, 3660, 5381, 273, 7024, 60, 2247, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10252, 67, 3264, 67, 27381, 2247, 67, 8352, 67, 4574, 12, 19952, 262, 30, 3536, 6083, 279, 19952, 16, 3689, 326, 963, 1450, 279, 5118, 967, 843, 7070, 3660, 5381, 273, 7024, 60, 2247, ...
return self.socket.accept()
res = self.socket.accept() if res is not None: sock = wc.objproxy.Proxy(res[0]) sock.family = self.socket.family sock.socktype = self.socket.socktype sock.proto = self.socket.proto return (sock, res[1])
def accept (self): """ Accept a new connection on the socket.
d8907582547be0ee979e312436b4cad8f2b84b5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/d8907582547be0ee979e312436b4cad8f2b84b5c/Dispatcher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 261, 2890, 4672, 3536, 8662, 279, 394, 1459, 603, 326, 2987, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2791, 261, 2890, 4672, 3536, 8662, 279, 394, 1459, 603, 326, 2987, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
1. Generated spanning tree; 2. Graph's preordering; 3. Graph's postordering.
1. Generated spanning tree 2. Graph's preordering 3. Graph's postordering
def depth_first_search(graph, root=None): """ Depth-first search. @type graph: graph @param graph: Graph. @type root: node @param root: Optional root node (will explore only root's connected component) @rtype: tuple @return: A tupple containing a dictionary and two lists: 1. Generated spanning tree; 2. Graph's preordering; 3. Graph's postordering. """ visited = {} # List for marking visited and non-visited nodes spanning_tree = {} # Spanning tree pre = [] # Graph's preordering post = [] # Graph's postordering # DFS from one node only if (root != None): spanning_tree[root] = None _dfs(graph, visited, spanning_tree, pre, post, root) return spanning_tree, pre, post # Algorithm loop for each in graph.get_nodes(): if (not each in visited): # Select a non-visited node spanning_tree[each] = None _dfs(graph, visited, spanning_tree, pre, post, each) # Explore node's connected component return spanning_tree, pre, post
7c73c280337c6073dae6db654966f6a3710b836c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4687/7c73c280337c6073dae6db654966f6a3710b836c/searching.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3598, 67, 3645, 67, 3072, 12, 4660, 16, 1365, 33, 7036, 4672, 3536, 25210, 17, 3645, 1623, 18, 225, 632, 723, 225, 2667, 30, 2667, 632, 891, 2667, 30, 5601, 18, 225, 632, 723, 225, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3598, 67, 3645, 67, 3072, 12, 4660, 16, 1365, 33, 7036, 4672, 3536, 25210, 17, 3645, 1623, 18, 225, 632, 723, 225, 2667, 30, 2667, 632, 891, 2667, 30, 5601, 18, 225, 632, 723, 225, 1...
'crh': [u'Resim', u'Ресим'],
'crh': [u'Fayl', u'Resim', u'Ресим'],
def __init__(self): self.name = None # Updated from http://meta.wikimedia.org/wiki/Interwiki_sorting_order self.alphabetic = [ 'af', 'ak', 'ace', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc', 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'bm', 'bn', 'zh-min-nan', 'nan', 'map-bms', 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo', 'bs', 'br', 'bg', 'bxr', 'ca', 'cv', 'ceb', 'cs', 'ch', 'cbk-zam', 'ny', 'sn', 'tum', 'cho', 'co', 'cy', 'da', 'dk', 'pdc', 'de', 'dv', 'nv', 'dsb', 'dz', 'mh', 'et', 'el', 'eml', 'en', 'myv', 'es', 'eo', 'ext', 'eu', 'ee', 'fa', 'hif', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv', 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'hak', 'xal', 'ko', 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo', 'bpy', 'id', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', 'it', 'he', 'jv', 'kl', 'kn', 'kr', 'pam', 'ka', 'ks', 'csb', 'kk', 'kw', 'rw', 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'ku', 'kj', 'lad', 'lbe', 'lo', 'la', 'lv', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', 'lmo', 'hu', 'mk', 'mg', 'ml', 'mt', 'mi', 'mr', 'arz', 'mzn', 'ms', 'cdo', 'mwl', 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'na', 'fj', 'nl', 'nds-nl', 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'pih', 'no', 'nb', 'nn', 'nrm', 'nov', 'ii', 'oc', 'mhr', 'or', 'om', 'ng', 'hz', 'uz', 'pa', 'pnb', 'pi', 'pag', 'pap', 'ps', 'km', 'pms', 'tpi', 'nds', 'pl', 'tokipona', 'tp', 'pnt', 'pt', 'aa', 'kaa', 'crh', 'ty', 'ksh', 'ro', 'rmy', 'rm', 'qu', 'ru', 'sah', 'se', 'sm', 'sa', 'sg', 'sc', 'za', 'sco', 'stq', 'st', 'tn', 'sq', 'scn', 'si', 'simple', 'sd', 'ss', 'sk', 'cu', 'sl', 'szl', 'so', 'ckb', 'srn', 'sr', 'sh', 'su', 'fi', 'sv', 'tl', 'ta', 'kab', 'roa-tara', 'tt', 'te', 'tet', 'th', 'ti', 'tg', 'to', 'chr', 'chy', 've', 'tr', 'tk', 'tw', 'udm', 'bug', 'uk', 'ur', 'ug', 'vec', 'vi', 'vo', 'fiu-vro', 'wa', 'zh-classical', 'vls', 'war', 'wo', 'wuu', 'ts', 'yi', 'yo', 'zh-yue', 'diq', 'zea', 'bat-smg', 'zh', 'zh-tw', 'zh-cn' ]
d0be13c8dd960f188cebfecb3decec6b1c69634e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/d0be13c8dd960f188cebfecb3decec6b1c69634e/family.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 468, 19301, 628, 1062, 2207, 3901, 18, 11999, 381, 1980, 18, 3341, 19, 13044, 19, 2465, 13044, 67, 28751, 67, 1019, 365, 18, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 468, 19301, 628, 1062, 2207, 3901, 18, 11999, 381, 1980, 18, 3341, 19, 13044, 19, 2465, 13044, 67, 28751, 67, 1019, 365, 18, 28...
if keg.name != " keg.name = ' keg.deltag('potiontype')
if potionkeg.name != " potionkeg.name = ' potionkeg.deltag('potiontype')
def onUse(char, keg): socket = char.socket kegfill = int(keg.gettag('kegfill')) backpack = char.getbackpack() if keg.hastag('potiontype'): checkkegstatus( char, keg, keg.gettag('potiontype') ) if kegfill > 0: count = backpack.countitems(['f0e']) if count >= 1: backpack.removeitems(['f0e'], 1) newpot = wolfpack.additem(potions[keg.gettag('potiontype')][POT_DEF]) newpot.decay = 1 newpot.magic = 1 if not tobackpack(newpot, char): newpot.update() kegfill -= 1 keg.settag('kegfill', kegfill ) if kegfill == 0: if keg.name != "#1041641": keg.name = '#1041641' keg.deltag('potiontype') else: socket.clilocmessage(500315) else: if keg.name != "#1041641": keg.name = '#1041641' if keg.hastag('potiontype'): keg.deltag('potiontype') return 1
d14ce2db290f3d620430d0bc52fea152c525be8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d14ce2db290f3d620430d0bc52fea152c525be8b/potionkeg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 3727, 12, 3001, 16, 417, 1332, 4672, 2987, 273, 1149, 18, 7814, 417, 1332, 5935, 273, 509, 12, 79, 1332, 18, 588, 2692, 2668, 79, 1332, 5935, 26112, 1473, 2920, 273, 1149, 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, 603, 3727, 12, 3001, 16, 417, 1332, 4672, 2987, 273, 1149, 18, 7814, 417, 1332, 5935, 273, 509, 12, 79, 1332, 18, 588, 2692, 2668, 79, 1332, 5935, 26112, 1473, 2920, 273, 1149, 18, 588...
self.moveFreeButton.setWhatsThis(
self.transFreeButton.setWhatsThis(
def add_whats_this_text( self ): """What's This text for some of the widgets in the Move Property Manager. """
6d3d96ad5a23bd76fa94c5a45c88b85764637d81 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/6d3d96ad5a23bd76fa94c5a45c88b85764637d81/MovePropertyManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 3350, 2323, 67, 2211, 67, 955, 12, 365, 262, 30, 3536, 23801, 1807, 1220, 977, 364, 2690, 434, 326, 10965, 316, 326, 9933, 4276, 8558, 18, 3536, 2, 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, 527, 67, 3350, 2323, 67, 2211, 67, 955, 12, 365, 262, 30, 3536, 23801, 1807, 1220, 977, 364, 2690, 434, 326, 10965, 316, 326, 9933, 4276, 8558, 18, 3536, 2, -100, -100, -100, -100, -10...
r""" The integer sequence A000010 is Euler's totient function. Number of positive integers $i < n$ that are relative prime to $n$. Number of totatives of $n$. Euler totient function $\phi(n)$: count numbers < $n$ and prime to $n$. euler_phi is a standard SAGE function implemented in PARI INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000010; a Euler's totient function sage: a(1) 1 sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(11) 10 sage: a.list(12) [1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4] sage: a(1/3) Traceback (most recent call last): ... TypeError: input must be an int, long, or Integer AUTHOR: -- Jaap Spies (2007-01-12) """ def __init__(self):
def __init__(self): r""" The integer sequence A000010 is Euler's totient function. Number of positive integers $i < n$ that are relative prime to $n$. Number of totatives of $n$. Euler totient function $\phi(n)$: count numbers < $n$ and prime to $n$. euler_phi is a standard SAGE function implemented in PARI INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000010; a Euler's totient function sage: a(1) 1 sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(11) 10 sage: a.list(12) [1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4] sage: a(1/3) Traceback (most recent call last): ... TypeError: input must be an int, long, or Integer AUTHOR: -- Jaap Spies (2007-01-12) """
def _eval(self, n): m = 0 while m*(m+1)//2 <= n: m += 1 m -= 1 k = n - m*(m+1)//2 if (m+k)%2: return ZZ(0) sign = (-1)**((m+k)//2 + k) return sign * arith.binomial((m+k)//2,k)
8b300fed02e947af57b58146f62dccfc715cf0b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8b300fed02e947af57b58146f62dccfc715cf0b9/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 312, 273, 374, 1323, 312, 21556, 81, 15, 21, 13, 759, 22, 1648, 290, 30, 312, 1011, 404, 312, 3947, 404, 417, 273, 290, 300, 312, 21556, 81, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 312, 273, 374, 1323, 312, 21556, 81, 15, 21, 13, 759, 22, 1648, 290, 30, 312, 1011, 404, 312, 3947, 404, 417, 273, 290, 300, 312, 21556, 81, 15, ...
n_tests = random.choice(xrange(1,len(self.targets)+1)) filetypes = random.sample(self.targets.keys(), n_tests)
typed_targets = {} for target in self.targets: for ftype in self.scan_filetypes: if target[-len(ftype):] == ftype: typed_targets.setdefault(ftype,[]) typed_targets[ftype].append(target) n_tests = random.choice(xrange(1,len(typed_targets)+1)) filetypes = random.sample(typed_targets.keys(), n_tests)
def run_test(self): # A single test should have a single cookie jar self.tor_cookie_jar = cookielib.MozillaCookieJar() self.cookie_jar = cookielib.MozillaCookieJar() self.headers = copy.copy(firefox_headers) self.tests_run += 1
ba5f7fa040706daf1e1b988aba2b93971703387a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3762/ba5f7fa040706daf1e1b988aba2b93971703387a/soat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3813, 12, 2890, 4672, 468, 432, 2202, 1842, 1410, 1240, 279, 2202, 3878, 7334, 365, 18, 13039, 67, 8417, 67, 11930, 273, 15860, 77, 30575, 18, 49, 11142, 10745, 6151, 10813, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3813, 12, 2890, 4672, 468, 432, 2202, 1842, 1410, 1240, 279, 2202, 3878, 7334, 365, 18, 13039, 67, 8417, 67, 11930, 273, 15860, 77, 30575, 18, 49, 11142, 10745, 6151, 10813, 14...
Returns the path of cached file or None. """ bucket = self.getBucketFromPath(path)
Returns the path of cached file or ``None``. Only 'result' files are looked up and returned, not sources. This method does not modify the filesystem if an appropriate bucket does not yet exist. """ bucket_path = self._getBucketPathFromPath(path) if not os.path.exists(bucket_path): return None bucket = Bucket(bucket_path)
def getCachedFile(self, path, suffix=None): """Check, whether the file in ``path`` is already cached.
bd1df902061fb04c8ccd7f5019bae40c68be6237 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9481/bd1df902061fb04c8ccd7f5019bae40c68be6237/cachemanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20543, 812, 12, 2890, 16, 589, 16, 3758, 33, 7036, 4672, 3536, 1564, 16, 2856, 326, 585, 316, 12176, 803, 10335, 353, 1818, 3472, 18, 2, 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, 20543, 812, 12, 2890, 16, 589, 16, 3758, 33, 7036, 4672, 3536, 1564, 16, 2856, 326, 585, 316, 12176, 803, 10335, 353, 1818, 3472, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
RESPONSE=REQUEST.RESPONSE
RESPONSE = getattr(REQUEST,'RESPONSE',None) if not RESPONSE:return False
def handle_modified_headers(self, last_mod=None, REQUEST=None): """ Check if the headers indicate we have changed content.
0179e56da136fc7e0a7b4b61f433510a7a074ee8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5225/0179e56da136fc7e0a7b4b61f433510a7a074ee8/ZWikiPage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 7342, 67, 2485, 12, 2890, 16, 1142, 67, 1711, 33, 7036, 16, 12492, 33, 7036, 4672, 3536, 2073, 309, 326, 1607, 10768, 732, 1240, 3550, 913, 18, 2, 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, 1640, 67, 7342, 67, 2485, 12, 2890, 16, 1142, 67, 1711, 33, 7036, 16, 12492, 33, 7036, 4672, 3536, 2073, 309, 326, 1607, 10768, 732, 1240, 3550, 913, 18, 2, -100, -100, -100, -100, -10...
self.gctrack()
TestCase.setUp(self)
def setUp(self): self.gctrack() self.src = gst.Pad("src", gst.PAD_SRC) self.sink = gst.Pad("sink", gst.PAD_SINK) caps = gst.caps_from_string("foo/bar") self.src.set_caps(caps) self.sink.set_caps(caps) self.sink.set_chain_function(self._chain_func) self.src.link(self.sink) self.buffers = []
ca1cb51d1abd8d3e44b0947fb497ec96d2d54736 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1020/ca1cb51d1abd8d3e44b0947fb497ec96d2d54736/test_pad.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 7766, 2449, 18, 542, 1211, 12, 2890, 13, 365, 18, 4816, 273, 314, 334, 18, 14878, 2932, 4816, 3113, 314, 334, 18, 17962, 67, 28413, 13, 365, 18, 17074, 273, 314,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 7766, 2449, 18, 542, 1211, 12, 2890, 13, 365, 18, 4816, 273, 314, 334, 18, 14878, 2932, 4816, 3113, 314, 334, 18, 17962, 67, 28413, 13, 365, 18, 17074, 273, 314,...
def rgbColorFromNode(node, greyScale=False, darknessLimit=1):
def rgbColorFromNode(node, greyScale=False, darknessLimit=0):
def rgbColorFromNode(node, greyScale=False, darknessLimit=1): """Extract text color from node attributes/style. Result is a rgb triple w/ individual values between [0...1]""" colorStr = node.style.get('color', None) or \ node.attributes.get('color', None) color = None if colorStr: color = _colorFromStr(colorStr.lower()) if greyScale and color: return _rgb2GreyScale(color, darknessLimit) return color
c42a30dc34aa4a74cf1303fad071ab56f2a3baf2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/c42a30dc34aa4a74cf1303fad071ab56f2a3baf2/styleutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6917, 2957, 28570, 12, 2159, 16, 5174, 93, 5587, 33, 8381, 16, 23433, 4496, 3039, 33, 20, 4672, 3536, 4976, 977, 2036, 628, 756, 1677, 19, 4060, 18, 3438, 353, 279, 6917, 14543, 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, 6917, 2957, 28570, 12, 2159, 16, 5174, 93, 5587, 33, 8381, 16, 23433, 4496, 3039, 33, 20, 4672, 3536, 4976, 977, 2036, 628, 756, 1677, 19, 4060, 18, 3438, 353, 279, 6917, 14543, 341, 1...
percent = int(POST.has_key(u'percent'))
percent = int(POST[u'percent'])
def ajax_createshare(request): ret = [] if request.method == u'POST': POST = request.POST if POST.has_key(u'username') and POST.has_key(u'percent'): percent = int(POST.has_key(u'percent')) if percent != 0: if random.randrange(2) == 1: ret = {"success" : False, "error" : "could not create share " + "blah" * 20} else: ret = {"success" : True, "error" : ""} else: ret = {"success" : False, "error" : "Percent cannot be 0"} print "returning ret: ", str(ret) json = simplejson.dumps(ret) print "json object is ", str(json) return HttpResponse(json, mimetype='application/json')
d5beb689159776dc2ff7bdfaa10b03d65fde7d32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/d5beb689159776dc2ff7bdfaa10b03d65fde7d32/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10733, 67, 19787, 76, 834, 12, 2293, 4672, 325, 273, 5378, 309, 590, 18, 2039, 422, 582, 11, 3798, 4278, 5485, 273, 590, 18, 3798, 309, 5485, 18, 5332, 67, 856, 12, 89, 11, 5053, 613...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10733, 67, 19787, 76, 834, 12, 2293, 4672, 325, 273, 5378, 309, 590, 18, 2039, 422, 582, 11, 3798, 4278, 5485, 273, 590, 18, 3798, 309, 5485, 18, 5332, 67, 856, 12, 89, 11, 5053, 613...
self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
prodlot_id = partial_datas.get('move%s_prodlot_id'%(move.id), False) if prodlot_id: self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}) self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
def action_done(self, cr, uid, ids, context=None): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ track_flag = False picking_ids = [] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj = self.pool.get('product.product') if context is None: context = {} for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting', 'confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context)
d672ae367f522aaa216aee2ee41d022ec54065f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d672ae367f522aaa216aee2ee41d022ec54065f3/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 490, 3223, 326, 3635, 2731, 471, 309, 777, 13934, 854, 2731, 16, 518, 903, 4076, 326, 6002, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1301, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 490, 3223, 326, 3635, 2731, 471, 309, 777, 13934, 854, 2731, 16, 518, 903, 4076, 326, 6002, 310, ...
func.prepared_async_call(arg._grid, arg.stream,
func.prepared_async_call(arg._grid, stream,
def fmod(arg, mod): """Return the floating point remainder of the division `arg/mod`, for each element in `arg` and `mod`.""" result = gpuarray.GPUArray(arg.shape, arg.dtype) func = elementwise.get_fmod_kernel() func.set_block_shape(*arg._block) func.prepared_async_call(arg._grid, arg.stream, arg.gpudata, mod.gpudata, result.gpudata, arg.mem_size) return result
84eb5784b45852e41dd494156dc9dff4f17b32bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12870/84eb5784b45852e41dd494156dc9dff4f17b32bd/cumath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1711, 12, 3175, 16, 681, 4672, 3536, 990, 326, 13861, 1634, 10022, 434, 326, 16536, 1375, 3175, 19, 1711, 9191, 364, 1517, 930, 316, 1375, 3175, 68, 471, 1375, 1711, 68, 12123, 563,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1711, 12, 3175, 16, 681, 4672, 3536, 990, 326, 13861, 1634, 10022, 434, 326, 16536, 1375, 3175, 19, 1711, 9191, 364, 1517, 930, 316, 1375, 3175, 68, 471, 1375, 1711, 68, 12123, 563,...
if np.all(kpt == 0):
if np.all(kpt_c == 0):
def get_pseudo_wave_function(self, band=0, kpt=0, spin=0, pad=True): kpt = self.get_bz_k_points()[k] state = self.calc.GetElectronicStates().GetState(band=n, spin=s, kptindex=k)
e9db7b8a6653142eaa426ab75d5677f98ffedcde /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/e9db7b8a6653142eaa426ab75d5677f98ffedcde/dacapo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 26023, 67, 17838, 67, 915, 12, 2890, 16, 8937, 33, 20, 16, 417, 337, 33, 20, 16, 12490, 33, 20, 16, 4627, 33, 5510, 4672, 417, 337, 273, 365, 18, 588, 67, 25292, 67, 79, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 26023, 67, 17838, 67, 915, 12, 2890, 16, 8937, 33, 20, 16, 417, 337, 33, 20, 16, 12490, 33, 20, 16, 4627, 33, 5510, 4672, 417, 337, 273, 365, 18, 588, 67, 25292, 67, 79, ...
elif isinstance(x, str):
elif isinstance(x, (bytes, bytearray)):
def dis(x=None): """Disassemble classes, methods, functions, or code. With no argument, disassemble the last traceback. """ if x is None: distb() return if hasattr(x, '__func__'): x = x.__func__ if hasattr(x, '__code__'): x = x.__code__ if hasattr(x, '__dict__'): items = sorted(x.__dict__.items()) for name, x1 in items: if isinstance(x1, (types.MethodType, types.FunctionType, types.CodeType, type)): print("Disassembly of %s:" % name) try: dis(x1) except TypeError as msg: print("Sorry:", msg) print() elif hasattr(x, 'co_code'): disassemble(x) elif isinstance(x, str): disassemble_string(x) else: raise TypeError("don't know how to disassemble %s objects" % type(x).__name__)
a0565c7b5bac8900fdac07491cf87011e980c32f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/a0565c7b5bac8900fdac07491cf87011e980c32f/dis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1015, 12, 92, 33, 7036, 4672, 3536, 1669, 29676, 3318, 16, 2590, 16, 4186, 16, 578, 981, 18, 225, 3423, 1158, 1237, 16, 1015, 29676, 326, 1142, 10820, 18, 225, 3536, 309, 619, 353, 599...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1015, 12, 92, 33, 7036, 4672, 3536, 1669, 29676, 3318, 16, 2590, 16, 4186, 16, 578, 981, 18, 225, 3423, 1158, 1237, 16, 1015, 29676, 326, 1142, 10820, 18, 225, 3536, 309, 619, 353, 599...
self.parser.switchInsertionMode("inTable") self.parser.processEndTag(name) self.parser.switchInsertionMode("inRow")
InTable(self.parser).processEndTag(name)
def endTagOther(self, name): self.parser.switchInsertionMode("inTable") self.parser.processEndTag(name) self.parser.switchInsertionMode("inRow")
3b3fb2ac5b0657a14c838c0f63502cfd168f2021 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/3b3fb2ac5b0657a14c838c0f63502cfd168f2021/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 8290, 12, 2890, 16, 508, 4672, 365, 18, 4288, 18, 9610, 29739, 2309, 2932, 267, 1388, 7923, 365, 18, 4288, 18, 2567, 25633, 12, 529, 13, 365, 18, 4288, 18, 9610, 29739, 2309, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 8290, 12, 2890, 16, 508, 4672, 365, 18, 4288, 18, 9610, 29739, 2309, 2932, 267, 1388, 7923, 365, 18, 4288, 18, 2567, 25633, 12, 529, 13, 365, 18, 4288, 18, 9610, 29739, 2309, 29...
self.next_watch_tick = broadcast(self.mpi_comm,
self.next_watch_tick = broadcast(self.mpi_comm,
def compute_watch_str(watch): try: return "%s=%g" % (watch.display, watch.compiled( *[dd.agg_func(values[dd.name]) for dd in watch.dep_data])) except ZeroDivisionError: return "%s:div0" % watch.display
26f8d8d9c4b3c67dbaf4f4dece66623b40a7f065 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12871/26f8d8d9c4b3c67dbaf4f4dece66623b40a7f065/log.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3671, 67, 7585, 67, 701, 12, 7585, 4672, 775, 30, 327, 2213, 87, 5095, 75, 6, 738, 261, 7585, 18, 5417, 16, 4267, 18, 19397, 12, 380, 63, 449, 18, 17535, 67, 644, 12, 2372, 63, 449...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3671, 67, 7585, 67, 701, 12, 7585, 4672, 775, 30, 327, 2213, 87, 5095, 75, 6, 738, 261, 7585, 18, 5417, 16, 4267, 18, 19397, 12, 380, 63, 449, 18, 17535, 67, 644, 12, 2372, 63, 449...
s = 'MatrixAlgebra(%s,%s)'%(K, self.__nrows)
s = 'MatrixAlgebra(%s,%s)'%(K.name(), self.__nrows)
def _magma_init_(self, magma): r""" EXAMPLES: We first coerce a square matrix. :: sage: magma(MatrixSpace(QQ,3)) # optional - magma Full Matrix Algebra of degree 3 over Rational Field :: sage: magma(MatrixSpace(Integers(8),2,3)) # optional - magma Full RMatrixSpace of 2 by 3 matrices over IntegerRing(8) """ K = self.base_ring()._magma_init_(magma) if self.__nrows == self.__ncols: s = 'MatrixAlgebra(%s,%s)'%(K, self.__nrows) else: s = 'RMatrixSpace(%s,%s,%s)'%(K, self.__nrows, self.__ncols) return s
f6a2599275d4217a1eb69500f679ca34a8c264e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f6a2599275d4217a1eb69500f679ca34a8c264e8/matrix_space.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4527, 2540, 67, 2738, 67, 12, 2890, 16, 4447, 2540, 4672, 436, 8395, 5675, 8900, 11386, 30, 1660, 1122, 12270, 279, 8576, 3148, 18, 225, 493, 225, 272, 410, 30, 4447, 2540, 12, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4527, 2540, 67, 2738, 67, 12, 2890, 16, 4447, 2540, 4672, 436, 8395, 5675, 8900, 11386, 30, 1660, 1122, 12270, 279, 8576, 3148, 18, 225, 493, 225, 272, 410, 30, 4447, 2540, 12, 46...
if isinstance(it, basebag): for elem, count in it._dict.items(): self._inc(value, -count) else: for value in it: self._inc(value, -1)
if not isinstance(other, basebag): other = self._from_iterable(other) for elem, count in other._dict.items(): self._inc(value, -count)
def __isub__(self, it: Iterable): """ if isinstance(it, basebag): This runs in O(it.num_unique_elements()) else: This runs in O(len(it))
3325486bf02adc2f21c90c503985367500ba994b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5397/3325486bf02adc2f21c90c503985367500ba994b/collections_.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 291, 373, 972, 12, 2890, 16, 518, 30, 6725, 4672, 3536, 309, 1549, 12, 305, 16, 1026, 22551, 4672, 1220, 7597, 316, 531, 12, 305, 18, 2107, 67, 6270, 67, 6274, 10756, 469, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 291, 373, 972, 12, 2890, 16, 518, 30, 6725, 4672, 3536, 309, 1549, 12, 305, 16, 1026, 22551, 4672, 1220, 7597, 316, 531, 12, 305, 18, 2107, 67, 6270, 67, 6274, 10756, 469, 30, ...
ut,
cols,
new_def = triples_to_defs(app, model, { field_name: new_triple,
54ac66928fb177a639e1f4657a89adc14eff3581 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13142/54ac66928fb177a639e1f4657a89adc14eff3581/startmigration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 394, 67, 536, 273, 22388, 67, 869, 67, 12537, 12, 2910, 16, 938, 16, 288, 652, 67, 529, 30, 394, 67, 313, 2444, 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 394, 67, 536, 273, 22388, 67, 869, 67, 12537, 12, 2910, 16, 938, 16, 288, 652, 67, 529, 30, 394, 67, 313, 2444, 16, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
print 'INFO: uninstalling published directory "%s"' % app_name
print 'INFO: uninstalling published directory "%s"' % dir_name
def uninstall(self): print 'INFO: uninstalling [%s-%s] package...' % (self.name, self.version) # registrations conf_file = configfiles.ConfigFileManager('conf/store.xml') pkgnode = conf_file.getPackageNode(self.name) if pkgnode: print 'INFO: removing package registrations' conf_file.removePackageNode(pkgnode) conf_file.close() # database items items = self.config_file.options('items') itemids = [self.config_file.get('items', x) for x in items] self.db = offlinedb.getHandle() txn = offlinedb.OfflineTransaction() try: try: for itemid in itemids: print 'INFO: removing object %s' % itemid try: oItem = self.db.getItem(itemid, txn) except: pass else: oItem.delete(txn) txn.commit() except Exception, e: txn.abort() raise e sys.exit(2) finally: offlinedb.close() # uninstall script contents = self.package_file.getnames() if '_uninstall.py' in contents: print 'INFO: running uninstallation script...' self.package_file.extract('_uninstall.py', serverSettings.temp_folder) execfile(serverSettings.temp_folder + '/_uninstall.py') os.remove(serverSettings.temp_folder + '/_uninstall.py') # files files = self.config_file.options('files') for fl in files: fname = self.config_file.get('files', fl) print 'INFO: removing file ' + fname if os.path.exists(fname): os.remove(fname) # check if it is a python file if fname[-3:] == '.py': dummy = [ os.remove(fname + x) for x in ('c', 'o') if os.path.exists(fname + x) ] # directories dirs = self.config_file.options('dirs') for dir in dirs: dirname = self.config_file.get('dirs', dir) if os.path.exists(dirname): print 'INFO: removing directory ' + dirname self._deltree(dirname) # published dirs if '_pubdir.xml' in contents: print 'INFO: uninstalling web apps...' dirsfile = self.package_file.extractfile('_pubdir.xml') _dom = minidom.parse(dirsfile) dirsConfig = configfiles.PubDirManager() dir_nodes = _dom.getElementsByTagName('dir') for dir_node in dir_nodes: #app_node = app_node.cloneNode(True) dir_name = dir_node.getAttribute('name') print 'INFO: uninstalling published directory "%s"' % app_name old_node = dirsConfig.getDirNode(dir_name) if old_node: dirsConfig.removeDirNode(old_node) else: print 'WARNING: published directory "%s" does not exist' % app_name dirname = 'pubdir/' + dir_name if os.path.exists(dirname): self._deltree(dirname)
2c7dd3f07ce9f11c27dc3916112c0a134ccac164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2504/2c7dd3f07ce9f11c27dc3916112c0a134ccac164/pakager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16577, 12, 2890, 4672, 1172, 296, 5923, 30, 16577, 310, 9799, 87, 6456, 87, 65, 2181, 7821, 738, 261, 2890, 18, 529, 16, 365, 18, 1589, 13, 225, 468, 28620, 2195, 67, 768, 273, 642, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16577, 12, 2890, 4672, 1172, 296, 5923, 30, 16577, 310, 9799, 87, 6456, 87, 65, 2181, 7821, 738, 261, 2890, 18, 529, 16, 365, 18, 1589, 13, 225, 468, 28620, 2195, 67, 768, 273, 642, ...
print "num_vertices = " + str(area.num_vertices(a, curve))
def cut_area(a, do_rapid, rapid_down_to_height, final_depth): print "num_curves = " + str(area.num_curves(a)) for curve in range(0, area.num_curves(a)): px = 0.0 py = 0.0 print "num_vertices = " + str(area.num_vertices(a, curve)) for vertex in range(0, area.num_vertices(a, curve)): sp, x, y, cx, cy = area.get_vertex(a, curve, vertex) if do_rapid: # rapid across rapid(x, y) ##rapid down rapid(z = rapid_down_to_height) #feed down feed(z = final_depth) do_rapid = False else: if sp == 1: arc_ccw(x, y, i = cx - px, j = cy - py) elif sp == -1: arc_cw(x, y, i = cx - px, j = cy - py) else: feed(x, y) px = x py = y
d08379b1231e3a601d94d8777964818b35b3055f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12576/d08379b1231e3a601d94d8777964818b35b3055f/area_funcs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6391, 67, 5036, 12, 69, 16, 741, 67, 1266, 350, 16, 767, 6610, 67, 2378, 67, 869, 67, 4210, 16, 727, 67, 5979, 4672, 1172, 315, 2107, 67, 1397, 3324, 273, 315, 397, 609, 12, 5036, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6391, 67, 5036, 12, 69, 16, 741, 67, 1266, 350, 16, 767, 6610, 67, 2378, 67, 869, 67, 4210, 16, 727, 67, 5979, 4672, 1172, 315, 2107, 67, 1397, 3324, 273, 315, 397, 609, 12, 5036, ...
webbrowser.open(url)
if len(url) > 2047: url = url[:2047] try: webbrowser.open(url) except error: traceback.print_exc()
def openExternalURL(self, url): webbrowser.open(url)
9635f15988cf3e0603b78f7afb2f51f067ac914a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/9635f15988cf3e0603b78f7afb2f51f067ac914a/UIBackendDelegate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 6841, 1785, 12, 2890, 16, 880, 4672, 3311, 11213, 18, 3190, 12, 718, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 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, 1696, 6841, 1785, 12, 2890, 16, 880, 4672, 3311, 11213, 18, 3190, 12, 718, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if valign == 'super': parent = inline if istate.nest and bstate.inline is not None: parent = bstate.inline istate.nest = False inline = etree.SubElement(parent, XHTML('sup')) elif valign == 'sub': parent = inline if istate.nest and bstate.inline is not None: parent = bstate.inline istate.nest = False inline = etree.SubElement(parent, XHTML('sub')) elif fsize != 3:
if fsize != 3:
def mobimlize_content(self, tag, text, bstate, istates): 'Convert text content' if text or tag != 'br': bstate.content = True istate = istates[-1] para = bstate.para if tag in SPECIAL_TAGS and not text: para = para if para is not None else bstate.body elif para is None or tag in ('td', 'th'): body = bstate.body if bstate.pbreak: etree.SubElement(body, MBP('pagebreak')) bstate.pbreak = False bstate.istate = None bstate.anchor = None parent = bstate.nested[-1] if bstate.nested else bstate.body indent = istate.indent left = istate.left if isinstance(indent, basestring): indent = 0 if indent < 0 and abs(indent) < left: left += indent indent = 0 elif indent != 0 and abs(indent) < self.profile.fbase: indent = (indent / abs(indent)) * self.profile.fbase if tag in NESTABLE_TAGS and not istate.rendered: para = wrapper = etree.SubElement( parent, XHTML(tag), attrib=istate.attrib) bstate.nested.append(para) if tag == 'li' and len(istates) > 1: istates[-2].list_num += 1 para.attrib['value'] = str(istates[-2].list_num) elif tag in NESTABLE_TAGS and istate.rendered: para = wrapper = bstate.nested[-1] elif left > 0 and indent >= 0: ems = self.profile.mobi_ems_per_blockquote para = wrapper = etree.SubElement(parent, XHTML('blockquote')) para = wrapper emleft = int(round(left / self.profile.fbase)) - ems emleft = min((emleft, 10)) while emleft > ems/2.0: para = etree.SubElement(para, XHTML('blockquote')) emleft -= ems else: para = wrapper = etree.SubElement(parent, XHTML('p')) bstate.inline = bstate.para = para vspace = bstate.vpadding + bstate.vmargin bstate.vpadding = bstate.vmargin = 0 if tag not in TABLE_TAGS: wrapper.attrib['height'] = self.mobimlize_measure(vspace) para.attrib['width'] = self.mobimlize_measure(indent) elif tag == 'table' and vspace > 0: vspace = int(round(vspace / self.profile.fbase)) while vspace > 0: wrapper.addprevious(etree.Element(XHTML('br'))) vspace -= 1 if istate.halign != 'auto' and isinstance(istate.halign, (str, unicode)): para.attrib['align'] = istate.halign istate.rendered = True pstate = bstate.istate if tag in CONTENT_TAGS: bstate.inline = para pstate = bstate.istate = None etree.SubElement(para, XHTML(tag), attrib=istate.attrib) elif tag in TABLE_TAGS: para.attrib['valign'] = 'top' if istate.ids: last = bstate.body[-1] for id in istate.ids: last.addprevious(etree.Element(XHTML('a'), attrib={'id': id})) istate.ids.clear() if not text: return if not pstate or istate != pstate: inline = para valign = istate.valign fsize = istate.fsize href = istate.href if not href: bstate.anchor = None elif pstate and pstate.href == href: inline = bstate.anchor else: inline = etree.SubElement(inline, XHTML('a'), href=href) bstate.anchor = inline if valign == 'super': parent = inline if istate.nest and bstate.inline is not None: parent = bstate.inline istate.nest = False inline = etree.SubElement(parent, XHTML('sup')) elif valign == 'sub': parent = inline if istate.nest and bstate.inline is not None: parent = bstate.inline istate.nest = False inline = etree.SubElement(parent, XHTML('sub')) elif fsize != 3: inline = etree.SubElement(inline, XHTML('font'), size=str(fsize)) if istate.family == 'monospace': inline = etree.SubElement(inline, XHTML('tt')) if istate.italic: inline = etree.SubElement(inline, XHTML('i')) if istate.bold: inline = etree.SubElement(inline, XHTML('b')) if istate.bgcolor is not None and istate.bgcolor != 'transparent' : inline = etree.SubElement(inline, XHTML('span'), bgcolor=istate.bgcolor) if istate.fgcolor != 'black': inline = etree.SubElement(inline, XHTML('font'), color=unicode(istate.fgcolor)) if istate.strikethrough: inline = etree.SubElement(inline, XHTML('s')) if istate.underline: inline = etree.SubElement(inline, XHTML('u')) bstate.inline = inline bstate.istate = istate inline = bstate.inline content = self.preize_text(text) if istate.preserve else [text] for item in content: if isinstance(item, basestring): if len(inline) == 0: inline.text = (inline.text or '') + item else: last = inline[-1] last.tail = (last.tail or '') + item else: inline.append(item)
7603f5b51cdca525812216d004694584ff3aa791 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7603f5b51cdca525812216d004694584ff3aa791/mobiml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 947, 381, 80, 554, 67, 1745, 12, 2890, 16, 1047, 16, 977, 16, 324, 2019, 16, 277, 7992, 4672, 296, 2723, 977, 913, 11, 309, 977, 578, 1047, 480, 296, 2848, 4278, 324, 2019, 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, 312, 947, 381, 80, 554, 67, 1745, 12, 2890, 16, 1047, 16, 977, 16, 324, 2019, 16, 277, 7992, 4672, 296, 2723, 977, 913, 11, 309, 977, 578, 1047, 480, 296, 2848, 4278, 324, 2019, 18, ...
self.dpi, self.saved_image_contents]
self.font_size, self.decimals, self.saved_image_contents]
def settings(self): """Return the settings to be loaded or saved to/from the pipeline These are the settings (from cellprofiler.settings) that are either read from the strings in the pipeline or written out to the pipeline. The settings should appear in a consistent order so they can be matched to the strings in the pipeline. """ return [self.objects_or_image, self.objects_name, self.measurement, self.image_name, self.text_color, self.display_image, self.dpi, self.saved_image_contents]
edc598b9bdc386736a3751d962a840353fbc9c99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2870/edc598b9bdc386736a3751d962a840353fbc9c99/displaydataonimage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1947, 12, 2890, 4672, 3536, 990, 326, 1947, 358, 506, 4203, 578, 5198, 358, 19, 2080, 326, 5873, 225, 8646, 854, 326, 1947, 261, 2080, 2484, 23097, 18, 4272, 13, 716, 854, 3344, 855, 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, 1947, 12, 2890, 4672, 3536, 990, 326, 1947, 358, 506, 4203, 578, 5198, 358, 19, 2080, 326, 5873, 225, 8646, 854, 326, 1947, 261, 2080, 2484, 23097, 18, 4272, 13, 716, 854, 3344, 855, 6...
def next_step_prepend(self, step):
def next_step_prepend(self, fn, *args, **dargs):
def next_step_prepend(self, step): """Insert a new step, executing first""" if not isinstance(step[0], basestring): step[0] = step[0].__name__ self.steps.insert(0, step) pickle.dump(self.steps, open(self.control + '.state', 'w'))
fa764631d776324d7bff704fa8425960083dba86 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/fa764631d776324d7bff704fa8425960083dba86/job.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 4119, 67, 23100, 12, 2890, 16, 2295, 16, 380, 1968, 16, 2826, 72, 1968, 4672, 3536, 4600, 279, 394, 2235, 16, 11274, 1122, 8395, 309, 486, 1549, 12, 4119, 63, 20, 6487, 10699...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1024, 67, 4119, 67, 23100, 12, 2890, 16, 2295, 16, 380, 1968, 16, 2826, 72, 1968, 4672, 3536, 4600, 279, 394, 2235, 16, 11274, 1122, 8395, 309, 486, 1549, 12, 4119, 63, 20, 6487, 10699...
file_name_pattern = r"<title>YouTube - (.*)</title>"
file_name_pattern = r"'VIDEO_TITLE': '(.*)',"
def get_file_name(self): if self.html == None: self.download_html()
bcdef10ae4237397c0a30f4efa6ae765ea1493e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9838/bcdef10ae4237397c0a30f4efa6ae765ea1493e0/YoutubeCom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 768, 67, 529, 12, 2890, 4672, 309, 365, 18, 2620, 422, 599, 30, 365, 18, 7813, 67, 2620, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 768, 67, 529, 12, 2890, 4672, 309, 365, 18, 2620, 422, 599, 30, 365, 18, 7813, 67, 2620, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
lcl = dict({'job': self}) str = """ from common.error import * from autotest_utils import * """ exec(str, lcl, lcl)
state_existed = self.__load_state() lcl = {'job': self} exec(JOB_PREAMBLE, lcl, lcl)
def step_engine(self): """the stepping engine -- if the control file defines step_init we will be using this engine to drive multiple runs. """ """Do the next step""" lcl = dict({'job': self})
dd4708a07aa2efc5f355ddd307dade3be9e87db0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/dd4708a07aa2efc5f355ddd307dade3be9e87db0/job.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2235, 67, 8944, 12, 2890, 4672, 3536, 5787, 2235, 1382, 4073, 1493, 309, 326, 3325, 585, 11164, 2235, 67, 2738, 732, 903, 506, 1450, 333, 4073, 358, 14316, 3229, 7597, 18, 3536, 3536, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2235, 67, 8944, 12, 2890, 4672, 3536, 5787, 2235, 1382, 4073, 1493, 309, 326, 3325, 585, 11164, 2235, 67, 2738, 732, 903, 506, 1450, 333, 4073, 358, 14316, 3229, 7597, 18, 3536, 3536, 32...
if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix)
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:] if rest[-1:] == '/': rest = rest[:-1] if '/' not in rest: del cache[path]
c5ad71f1ae1b114b5d8aef77121988e50a13a9d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c5ad71f1ae1b114b5d8aef77121988e50a13a9d1/statcache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13776, 67, 1214, 12, 3239, 4672, 3536, 1290, 588, 2973, 279, 1867, 471, 777, 3222, 316, 518, 16, 1496, 486, 2973, 3222, 316, 31220, 12123, 309, 1633, 18919, 21, 26894, 422, 2023, 471, 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, 13776, 67, 1214, 12, 3239, 4672, 3536, 1290, 588, 2973, 279, 1867, 471, 777, 3222, 316, 518, 16, 1496, 486, 2973, 3222, 316, 31220, 12123, 309, 1633, 18919, 21, 26894, 422, 2023, 471, 16...
time.sleep(.1)
n = 500 while PORT is None and n > 0: time.sleep(0.01) n -= 1 time.sleep(0.5)
def setUp(self): self.evt = threading.Event() servargs = (self.evt, "220 Hola mundo\n") threading.Thread(target=server, args=servargs).start() time.sleep(.1)
7b4fd585717660ae0f6a41180e84e8735a9ddc8d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/7b4fd585717660ae0f6a41180e84e8735a9ddc8d/test_smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 73, 11734, 273, 17254, 18, 1133, 1435, 703, 1401, 564, 273, 261, 2890, 18, 73, 11734, 16, 315, 27246, 670, 355, 69, 312, 31226, 64, 82, 7923, 17254, 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, 24292, 12, 2890, 4672, 365, 18, 73, 11734, 273, 17254, 18, 1133, 1435, 703, 1401, 564, 273, 261, 2890, 18, 73, 11734, 16, 315, 27246, 670, 355, 69, 312, 31226, 64, 82, 7923, 17254, 18,...
self.editRestriction, self.moveRestriction = parseRestrictions(self.restrictions)
self.editRestriction, self.moveRestriction \ = parseRestrictions(self.restrictions)
def endElement(self, name): if name == 'contributor': self.inContributorTag = False elif name == 'restrictions': self.editRestriction, self.moveRestriction = parseRestrictions(self.restrictions) elif name == 'redirect': self.isredirect = True elif name == 'revision': # All done for this. # Remove trailing newlines and spaces text = self.text.rstrip('\n ') # Replace newline by cr/nl text = u'\r\n'.join(text.split('\n')) # Decode the timestamp timestamp = (self.timestamp[0:4]+ self.timestamp[5:7]+ self.timestamp[8:10]+ self.timestamp[11:13]+ self.timestamp[14:16]+ self.timestamp[17:19]) self.title = self.title.strip() # Report back to the caller entry = XmlEntry(self.title, self.id, text, self.username, self.ipedit, timestamp, self.editRestriction, self.moveRestriction, self.revisionid, self.comment, self.isredirect) self.inRevisionTag = False self.callback(entry) elif self.headercallback: if name == 'namespace': self.header.namespaces[self.namespaceid] = self.namespace elif name == 'siteinfo': self.headercallback(self.header) self.header = None # Characters between this closing tag and the next opening tag is # ignored, it's just whitespace for XML formatting. self.destination = None
cea3abc8955b082fe2ab3706db1a0ad41622e9af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/cea3abc8955b082fe2ab3706db1a0ad41622e9af/xmlreader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14840, 12, 2890, 16, 508, 4672, 309, 508, 422, 296, 591, 19293, 4278, 365, 18, 267, 442, 19293, 1805, 273, 1083, 1327, 508, 422, 296, 23954, 87, 4278, 365, 18, 4619, 11670, 16, 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, 14840, 12, 2890, 16, 508, 4672, 309, 508, 422, 296, 591, 19293, 4278, 365, 18, 267, 442, 19293, 1805, 273, 1083, 1327, 508, 422, 296, 23954, 87, 4278, 365, 18, 4619, 11670, 16, 365, 18...
return self._prime
if len(self._raw['milnor']) == 0: return 1 else: return self._prime
def additive_order(self): """ The additive order of any element of the mod p Steenrod algebra is p.
1bc455c6708388944010d0eccf8c34ec66932b9d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/1bc455c6708388944010d0eccf8c34ec66932b9d/steenrod_algebra_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 3720, 67, 1019, 12, 2890, 4672, 3536, 1021, 527, 3720, 1353, 434, 1281, 930, 434, 326, 681, 293, 7780, 275, 303, 72, 524, 29087, 353, 293, 18, 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, 0, 0, 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, 527, 3720, 67, 1019, 12, 2890, 4672, 3536, 1021, 527, 3720, 1353, 434, 1281, 930, 434, 326, 681, 293, 7780, 275, 303, 72, 524, 29087, 353, 293, 18, 2, -100, -100, -100, -100, -100, -10...
except Exception as inst:
except Exception, inst:
def close(self, file): """ Close open port.
368bdd74e063c19063d4c5db99e94bb088943ceb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/368bdd74e063c19063d4c5db99e94bb088943ceb/virtio_guest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 16, 585, 4672, 3536, 3527, 1696, 1756, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 16, 585, 4672, 3536, 3527, 1696, 1756, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if limit is None and offset == '0': return _remove_limit_offset(sql)
def _mangle_sql(self, sql): order, limit, offset = _re_order_limit_offset.search(sql).groups() # Hack around an issue in [7885], extraneous "OFFSET 0": if limit is None and offset == '0': return _remove_limit_offset(sql) # If we have no OFFSET, look for LIMIT and replace with TOP if offset is None: if limit is None: return sql return self._replace_limit_with_top(sql, int(limit)) # Otherwise we have an OFFSET, synthesize an ordering if needed if order is None: meta = self.get_meta() order = meta.pk.attname+" ASC" return self._rewrite_limit_offset(sql, order, int(limit), int(offset))
4c8177be7cc904d5bf4a8dcebcb8057a88ac544c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1254/4c8177be7cc904d5bf4a8dcebcb8057a88ac544c/query.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 81, 4341, 67, 4669, 12, 2890, 16, 1847, 4672, 1353, 16, 1800, 16, 1384, 273, 389, 266, 67, 1019, 67, 3595, 67, 3348, 18, 3072, 12, 4669, 2934, 4650, 1435, 225, 468, 670, 484, 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, 389, 81, 4341, 67, 4669, 12, 2890, 16, 1847, 4672, 1353, 16, 1800, 16, 1384, 273, 389, 266, 67, 1019, 67, 3595, 67, 3348, 18, 3072, 12, 4669, 2934, 4650, 1435, 225, 468, 670, 484, 67...
def mobimlize_elem(self, elem, stylizer, bstate, istates):
def mobimlize_elem(self, elem, stylizer, bstate, istates, ignore_valign=False):
def mobimlize_elem(self, elem, stylizer, bstate, istates): if not isinstance(elem.tag, basestring) \ or namespace(elem.tag) != XHTML_NS: return style = stylizer.style(elem) # <mbp:frame-set/> does not exist lalalala if style['display'] in ('none', 'oeb-page-head', 'oeb-page-foot') \ or style['visibility'] == 'hidden': return tag = barename(elem.tag) istate = copy.copy(istates[-1]) istate.rendered = False istate.list_num = 0 istates.append(istate) left = 0 display = style['display'] isblock = not display.startswith('inline') isblock = isblock and style['float'] == 'none' isblock = isblock and tag != 'br' if isblock: bstate.para = None istate.halign = style['text-align'] istate.indent = style['text-indent'] if style['margin-left'] == 'auto' \ and style['margin-right'] == 'auto': istate.halign = 'center' margin = asfloat(style['margin-left']) padding = asfloat(style['padding-left']) if tag != 'body': left = margin + padding istate.left += left vmargin = asfloat(style['margin-top']) bstate.vmargin = max((bstate.vmargin, vmargin)) vpadding = asfloat(style['padding-top']) if vpadding > 0: bstate.vpadding += bstate.vmargin bstate.vmargin = 0 bstate.vpadding += vpadding elif not istate.href: margin = asfloat(style['margin-left']) padding = asfloat(style['padding-left']) lspace = margin + padding if lspace > 0: spaces = int(round((lspace * 3) / style['font-size'])) elem.text = (u'\xa0' * spaces) + (elem.text or '') margin = asfloat(style['margin-right']) padding = asfloat(style['padding-right']) rspace = margin + padding if rspace > 0: spaces = int(round((rspace * 3) / style['font-size'])) if len(elem) == 0: elem.text = (elem.text or '') + (u'\xa0' * spaces) else: last = elem[-1] last.text = (last.text or '') + (u'\xa0' * spaces) if bstate.content and style['page-break-before'] in PAGE_BREAKS: bstate.pbreak = True istate.fsize = self.mobimlize_font(style['font-size']) istate.italic = True if style['font-style'] == 'italic' else False weight = style['font-weight'] istate.bold = weight in ('bold', 'bolder') or asfloat(weight) > 400 istate.preserve = (style['white-space'] in ('pre', 'pre-wrap')) istate.bgcolor = style['background-color'] istate.fgcolor = style['color'] istate.strikethrough = style['text-decoration'] == 'line-through' istate.underline = style['text-decoration'] == 'underline' if 'monospace' in style['font-family']: istate.family = 'monospace' elif 'sans-serif' in style['font-family']: istate.family = 'sans-serif' else: istate.family = 'serif' valign = style['vertical-align'] if valign in ('super', 'text-top') or asfloat(valign) > 0: istate.nest = istate.valign in ('sub', 'super') istate.valign = 'super' elif valign == 'sub' or asfloat(valign) < 0: istate.nest = istate.valign in ('sub', 'super') istate.valign = 'sub' else: istate.valign = 'baseline' if 'id' in elem.attrib: istate.ids.add(elem.attrib['id']) if 'name' in elem.attrib: istate.ids.add(elem.attrib['name']) if tag == 'a' and 'href' in elem.attrib: istate.href = elem.attrib['href'] istate.attrib.clear() if tag == 'img' and 'src' in elem.attrib: istate.attrib['src'] = elem.attrib['src'] istate.attrib['align'] = 'baseline' for prop in ('width', 'height'): if style[prop] != 'auto': value = style[prop] if value == getattr(self.profile, prop): result = '100%' else: try: ems = int(round(float(value) / self.profile.fbase)) except: continue result = "%dem" % ems istate.attrib[prop] = result elif tag == 'hr' and asfloat(style['width']) > 0: prop = style['width'] / self.profile.width istate.attrib['width'] = "%d%%" % int(round(prop * 100)) elif display == 'table': tag = 'table' elif display == 'table-row': tag = 'tr' elif display == 'table-cell': tag = 'td' if tag in TABLE_TAGS and self.ignore_tables: tag = 'span' if tag == 'td' else 'div'
7603f5b51cdca525812216d004694584ff3aa791 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7603f5b51cdca525812216d004694584ff3aa791/mobiml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 947, 381, 80, 554, 67, 10037, 12, 2890, 16, 3659, 16, 16253, 80, 1824, 16, 324, 2019, 16, 277, 7992, 16, 2305, 67, 1125, 724, 33, 8381, 4672, 309, 486, 1549, 12, 10037, 18, 2692...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 312, 947, 381, 80, 554, 67, 10037, 12, 2890, 16, 3659, 16, 16253, 80, 1824, 16, 324, 2019, 16, 277, 7992, 16, 2305, 67, 1125, 724, 33, 8381, 4672, 309, 486, 1549, 12, 10037, 18, 2692...
value = '<a href="../;view?version=%s">%s issue</a>' value = Parser(value % (index, count))
value = '<a href="../;view?%s=%s">%s issue</a>' value = Parser(value % (filter, index, count))
def view(self, context): namespace = {}
cd8c400c39438236e4050aeb9ef5b078f4f88b75 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/cd8c400c39438236e4050aeb9ef5b078f4f88b75/tracker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1476, 12, 2890, 16, 819, 4672, 1981, 273, 2618, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1476, 12, 2890, 16, 819, 4672, 1981, 273, 2618, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
dprint(recorder)
self.dprint(recorder)
def action(self, index=-1, multiplier=1): if self.frame.root_accel.isRecordingActions(): recorder = self.frame.root_accel.stopRecordingActions() dprint(recorder) RecentMacros.appendRecording(recorder) macro = RecentMacros.getLastMacro() if macro: dprint("Playing back %s" % macro) wx.CallAfter(macro.playback, self.frame, self.mode, multiplier) else: dprint("No recorded macro.")
d77726ef8abb406e3169b9a46422cfcaff76a425 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/d77726ef8abb406e3169b9a46422cfcaff76a425/macro.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 12, 2890, 16, 770, 29711, 21, 16, 15027, 33, 21, 4672, 309, 365, 18, 3789, 18, 3085, 67, 30737, 18, 291, 21037, 6100, 13332, 15766, 273, 365, 18, 3789, 18, 3085, 67, 30737, 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, 1301, 12, 2890, 16, 770, 29711, 21, 16, 15027, 33, 21, 4672, 309, 365, 18, 3789, 18, 3085, 67, 30737, 18, 291, 21037, 6100, 13332, 15766, 273, 365, 18, 3789, 18, 3085, 67, 30737, 18, ...
nameAndVersion in
nameWithVersion in
def lookForUpdates(manifestitem, cataloglist, installinfo): """ Looks for updates for a given manifest item that is either installed or scheduled to be installed. This handles not only specific application updates, but also updates that aren't simply later versions of the manifest item. For example, AdobeCameraRaw is an update for Adobe Photoshop, but doesn't update the version of Adobe Photoshop. Returns a list of manifestitem names that are updates for manifestitem. """ nameWithVersion = os.path.split(manifestitem)[1] (name, includedversion) = nameAndVersion(nameWithVersion) # get a list of catalog items that are updates for other items update_list = [] for catalogname in cataloglist: updaters = catalog[catalogname]['updaters'] # list comprehension coming up... update_items = [catalogitem['name'] for catalogitem in updaters if (name in catalogitem.get('update_for',[]) or nameAndVersion in catalogitem.get('update_for',[]))] if update_items: update_list.extend(update_items) if update_list: # make sure the list has only unique items: update_list = list(set(update_list)) return update_list
d895a4c106d08d50fd3ac775349fac26b3867f78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6241/d895a4c106d08d50fd3ac775349fac26b3867f78/updatecheck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2324, 1290, 5121, 12, 14357, 1726, 16, 6222, 1098, 16, 3799, 1376, 4672, 3536, 10176, 87, 364, 4533, 364, 279, 864, 5643, 761, 716, 353, 3344, 5876, 578, 9755, 358, 506, 5876, 18, 1220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2324, 1290, 5121, 12, 14357, 1726, 16, 6222, 1098, 16, 3799, 1376, 4672, 3536, 10176, 87, 364, 4533, 364, 279, 864, 5643, 761, 716, 353, 3344, 5876, 578, 9755, 358, 506, 5876, 18, 1220, ...
args=[ _shmemBackstagePass(), size, type, ExprLiteral.FALSE ])
args=[ _shmemBackstagePass(), size, type, unsafe ])
def _shmemAlloc(size, type): # starts out UNprotected return ExprCall(ExprVar('Shmem::Alloc'), args=[ _shmemBackstagePass(), size, type, ExprLiteral.FALSE ])
57b779f8e44f5aec168416e9c11f076681b5b2e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/57b779f8e44f5aec168416e9c11f076681b5b2e4/lower.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 674, 3917, 8763, 12, 1467, 16, 618, 4672, 468, 2542, 596, 5019, 1117, 327, 8074, 1477, 12, 4742, 1537, 2668, 1555, 3917, 2866, 8763, 19899, 833, 22850, 389, 674, 3917, 2711, 12869, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 674, 3917, 8763, 12, 1467, 16, 618, 4672, 468, 2542, 596, 5019, 1117, 327, 8074, 1477, 12, 4742, 1537, 2668, 1555, 3917, 2866, 8763, 19899, 833, 22850, 389, 674, 3917, 2711, 12869, ...
pos = 5
pos = 0 profile = request.user.get_profile() ctype = ConfigType.objects.filter(name = type)[0] kind = Processing_kind.objects.filter(name__exact = self.id)[0] frame = range(len(files))[pos:] z = 0 for k in frame: if pos == total: break pos += 1 z += 1 try: f = open(files[k]) content = string.join(f.readlines(), '\n') base = os.path.basename(files[k]) name = base[:base.rfind('.')] res['config'] = str(name) f.close() except Exception, e: continue try: m = ConfigFile.objects.filter(kind = kind, name = name, type = ctype)[0] m.content = content except: m = ConfigFile(kind = kind, name = name, content = content, user = request.user, type = ctype, mode = profile.dflt_mode, group = profile.dflt_group) success = write_proxy(request, m) if z > STEP: break
def importConfigFiles(self, request): """ Import all configuration files in a directory. File names are matched against a pattern. """
236a6e47a71a984b0d175212e9adf254e5601029 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11651/236a6e47a71a984b0d175212e9adf254e5601029/pluginmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 809, 2697, 12, 2890, 16, 590, 4672, 3536, 6164, 777, 1664, 1390, 316, 279, 1867, 18, 1387, 1257, 854, 4847, 5314, 279, 1936, 18, 3536, 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, 0, 0, 0, 0, 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, 1930, 809, 2697, 12, 2890, 16, 590, 4672, 3536, 6164, 777, 1664, 1390, 316, 279, 1867, 18, 1387, 1257, 854, 4847, 5314, 279, 1936, 18, 3536, 2, -100, -100, -100, -100, -100, -100, -100, ...
if not os.path.isdir('plugins'): os.mkdir( 'plugins' ) if not os.path.isdir("plugins/"+plugin_name): os.mkdir( "plugins/"+plugin_name )
if not os.path.isdir(plugin["output_dir"]): plugin["output_dir"] = "plugins" os.mkdir( plugin["output_dir"] ) if not os.path.isdir(plugin["output_dir"]+"/"+plugin_name): os.mkdir( plugin["output_dir"]+"/"+plugin_name )
def make_file( template_dir, plugin_name, replacement_str, filename, new_file_name="", to_lower_case=False ): if not os.path.isdir('templates'): print "Error. There is not templates dir" sys.exit(3) try: f = open( "templates/" + template_dir + "/" + filename , 'r' ) except IOError: return new_file = f.read() f.close if new_file_name=="": new_file_name=plugin_name if to_lower_case: new_file = new_file.replace( replacement_str.lower(), plugin_name.lower() ) else: new_file = new_file.replace( replacement_str, plugin_name ) if not os.path.isdir('plugins'): os.mkdir( 'plugins' ) if not os.path.isdir("plugins/"+plugin_name): os.mkdir( "plugins/"+plugin_name ) try: ext = "." + filename.split('.')[1] except: ext = "" try: g = open( "plugins/" + plugin_name + "/" + new_file_name + ext, "w" ) print "Creating " + "plugins/" + plugin_name + "/" + new_file_name + ext + " file" except: print "plugins/" + plugin_name + "/" + plugin_name + ext print "Output file write error." sys.exit(2) if (ext==".hxx" or ext==".cxx") and plugin["license"]!="null": g.write( license_text + "\n\n" ) g.write( new_file ) g.close()
0bb9b8d1224012a3effeb47a46aa7c17b9bcedb7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1456/0bb9b8d1224012a3effeb47a46aa7c17b9bcedb7/TemplatedPluginsGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 768, 12, 1542, 67, 1214, 16, 1909, 67, 529, 16, 6060, 67, 701, 16, 1544, 16, 394, 67, 768, 67, 529, 1546, 3113, 358, 67, 8167, 67, 3593, 33, 8381, 262, 30, 309, 486, 1140...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1221, 67, 768, 12, 1542, 67, 1214, 16, 1909, 67, 529, 16, 6060, 67, 701, 16, 1544, 16, 394, 67, 768, 67, 529, 1546, 3113, 358, 67, 8167, 67, 3593, 33, 8381, 262, 30, 309, 486, 1140...
STRING 'r"abc"' (1, 4) (1, 11) OP '+' (1, 12) (1, 13) STRING 'r"ABC"' (1, 14) (1, 21) OP '+' (1, 22) (1, 23) STRING 'R"ABC"' (1, 24) (1, 31) OP '+' (1, 32) (1, 33) STRING 'R"ABC"' (1, 34) (1, 41)
STRING 'r"abc"' (1, 4) (1, 10) OP '+' (1, 11) (1, 12) STRING 'r"ABC"' (1, 13) (1, 19) OP '+' (1, 20) (1, 21) STRING 'R"ABC"' (1, 22) (1, 28) OP '+' (1, 29) (1, 30) STRING 'R"ABC"' (1, 31) (1, 37)
... " def y(m): # A whitespace after the colon\\n"
06160749de86348e8e0743d0ff468f96f0c89d4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/06160749de86348e8e0743d0ff468f96f0c89d4c/test_tokenize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 6647, 315, 225, 1652, 677, 12, 81, 4672, 468, 432, 7983, 1839, 326, 13336, 1695, 82, 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, ...
[ 1, 1, 1, 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, 1372, 6647, 315, 225, 1652, 677, 12, 81, 4672, 468, 432, 7983, 1839, 326, 13336, 1695, 82, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
except (urllib2.URLError, timeout):
except urllib2.URLError:
def get_page(self,url): html_page = None retry_count = 0 while not(html_page): try: html_page = urllib2.urlopen(url, timeout=30).read() except (urllib2.URLError, timeout): retry_count += 1 if retry_count >= 10: raise urllib2.URLError('URL %s failed too many times' % url) html_page = re.sub("(?s)<!--.*?-->"," ", html_page) # cut anything that looks suspicious html_page = re.sub("(?s)<script>.*?</script>"," ", html_page) return html_page
a63b7f958fe19e9c86ed6e4dfcb12f1fbfc0a7d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1866/a63b7f958fe19e9c86ed6e4dfcb12f1fbfc0a7d1/parse_gov_legislation_comm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2433, 12, 2890, 16, 718, 4672, 1729, 67, 2433, 273, 599, 3300, 67, 1883, 273, 374, 1323, 486, 12, 2620, 67, 2433, 4672, 775, 30, 1729, 67, 2433, 273, 11527, 22, 18, 295, 185...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2433, 12, 2890, 16, 718, 4672, 1729, 67, 2433, 273, 599, 3300, 67, 1883, 273, 374, 1323, 486, 12, 2620, 67, 2433, 4672, 775, 30, 1729, 67, 2433, 273, 11527, 22, 18, 295, 185...
def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() newtb = tb.tb_next if newtb is None: return (exctype, excvalue, tb) return (exctype, excvalue, newtb)
def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() newtb = tb.tb_next if newtb is None: return (exctype, excvalue, tb) return (exctype, excvalue, newtb)
e4122e065a122f30bf476ece570458641085b660 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/e4122e065a122f30bf476ece570458641085b660/unittest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 10075, 67, 1376, 12, 2890, 4672, 3536, 990, 279, 1177, 434, 2589, 18, 10075, 67, 1376, 1435, 598, 326, 10820, 2623, 18172, 5918, 31, 11234, 326, 1760, 1801, 434, 326, 10820, 2623, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10075, 67, 1376, 12, 2890, 4672, 3536, 990, 279, 1177, 434, 2589, 18, 10075, 67, 1376, 1435, 598, 326, 10820, 2623, 18172, 5918, 31, 11234, 326, 1760, 1801, 434, 326, 10820, 2623, ...
@param warnings: A list of the warnings generated by parsing. Any new warnings generated while will tokenizing this paragraph
@param errors: A list of the errors generated by parsing. Any new errors generated while will tokenizing this paragraph
def _tokenize_literal(lines, start, block_indent, tokens, warnings): """ Construct a L{Token} containing the literal block starting at C{lines[start]}, and append it to C{tokens}. C{block_indent} should be the indentation of the literal block. Any warnings generated while tokenizing the literal block will be appended to C{warnings}. @param lines: The list of lines to be tokenized @param start: The index into C{lines} of the first line of the literal block to be tokenized. @param block_indent: The indentation of C{lines[start]}. This is the indentation of the literal block. @param warnings: A list of the warnings generated by parsing. Any new warnings generated while will tokenizing this paragraph will be appended to this list. @return: The line number of the first line following the literal block. @type lines: C{list} of C{string} @type start: C{int} @type block_indent: C{int} @type tokens: C{list} of L{Token} @type warnings: C{list} of L{ParseError} @rtype: C{int} """ linenum = start + 1 while linenum < len(lines): # Find the indentation of this line. line = lines[linenum] indent = len(line) - len(line.lstrip()) # A Dedent to block_indent ends the literal block. # (Ignore blank likes, though) if len(line) != indent and indent <= block_indent: break # Go on to the next line. linenum += 1 # Add the token, and return the linenum after the token ends. contents = [line[block_indent+1:] for line in lines[start:linenum]] contents = '\n'.join(contents) contents = re.sub('(\A[ \n]*\n)|(\n[ \n]*\Z)', '', contents) tokens.append(Token(Token.LBLOCK, start, contents, block_indent)) return linenum
7bf7c136593a0f12e906094a55f7b8f591c5abaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7bf7c136593a0f12e906094a55f7b8f591c5abaf/epytext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2316, 554, 67, 13107, 12, 3548, 16, 787, 16, 1203, 67, 9355, 16, 2430, 16, 5599, 4672, 3536, 14291, 279, 511, 95, 1345, 97, 4191, 326, 7158, 1203, 5023, 622, 385, 95, 3548, 63, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2316, 554, 67, 13107, 12, 3548, 16, 787, 16, 1203, 67, 9355, 16, 2430, 16, 5599, 4672, 3536, 14291, 279, 511, 95, 1345, 97, 4191, 326, 7158, 1203, 5023, 622, 385, 95, 3548, 63, ...
self.save_option(os.path.expanduser(UserConfigPath), section, option, value)
self.save_option(UserConfigPath, section, option, value)
def save_user_option(self, section, option, value): self.save_option(os.path.expanduser(UserConfigPath), section, option, value)
25407cbc4e698f9aa33884a0e1598bb50b933b5f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1098/25407cbc4e698f9aa33884a0e1598bb50b933b5f/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 67, 1355, 67, 3482, 12, 2890, 16, 2442, 16, 1456, 16, 460, 4672, 365, 18, 5688, 67, 3482, 12, 538, 18, 803, 18, 12320, 1355, 12, 1299, 22341, 3631, 2442, 16, 1456, 16, 460, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 67, 1355, 67, 3482, 12, 2890, 16, 2442, 16, 1456, 16, 460, 4672, 365, 18, 5688, 67, 3482, 12, 538, 18, 803, 18, 12320, 1355, 12, 1299, 22341, 3631, 2442, 16, 1456, 16, 460, 13,...
print e
logger.error("Got error in load_phone_book : %s", e)
def load_phone_book(self, emission, source, param): print "load phone book called" try: new_edje = gui.edje_gui(self.main,'tele-people',self.edje_file) new_edje.edj.signal_callback_add("top_bar", "*", self.top_bar) new_edje.edj.name_set('contacts_list') except Exception,e: print e self.extra_child = new_edje new_edje.edj.layer_set(3) new_edje.edj.show() print "done" try: contacts_box = gui.edje_box(self,'V',1) except Exception,e: print e try: print "self.lists.generate_contacts_list(self,orig_parent,self.phone_book,contacts_edje,self.edje_obj)" self.contact_objects_list = gui.contact_list(self.phone_book,contacts_box,self.main.etk_obj.evas,self.edje_file,'tele-contacts_item',self) except Exception,e: print e try: to_2_swallowed = contacts_box.scrolled_view except Exception,e: print e try: print "new_edje.add(to_2_swallowed,contacts_edje)" new_edje.add(to_2_swallowed,contacts_box,"contacts-items") except Exception,e: print e try: contacts_box.box.show() except Exception,e: print e
01c25941dcc46b5166dcddd3aeed3ae3b26b48e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/01c25941dcc46b5166dcddd3aeed3ae3b26b48e6/paroli-dialer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 10540, 67, 3618, 12, 2890, 16, 801, 19710, 16, 1084, 16, 579, 4672, 1172, 315, 945, 7353, 6978, 2566, 6, 775, 30, 394, 67, 329, 78, 73, 273, 13238, 18, 329, 78, 73, 67, 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, 1262, 67, 10540, 67, 3618, 12, 2890, 16, 801, 19710, 16, 1084, 16, 579, 4672, 1172, 315, 945, 7353, 6978, 2566, 6, 775, 30, 394, 67, 329, 78, 73, 273, 13238, 18, 329, 78, 73, 67, 2...
furthestBlock.childNodes.remove(furthestBlock)
furthestBlock.parent.removeChild(furthestBlock)
def endTagFormatting(self, name): """The much-feared adoption agency algorithm""" # XXX I don't like while True + break... too much # possibility of infinite loops while True: # Step 1 paragraph 1 afeElement = self.parser.elementInActiveFormattingElements(name) if not afeElement or (afeElement in self.parser.openElements and not self.parser.elementInScope(afeElement.name)): self.parser.parseError() return
0124737d8d74ed97bd7de89db35d3433fa2eee2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/0124737d8d74ed97bd7de89db35d3433fa2eee2d/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 23974, 12, 2890, 16, 508, 4672, 3536, 1986, 9816, 17, 3030, 2258, 1261, 3482, 1737, 2075, 4886, 8395, 468, 11329, 467, 2727, 1404, 3007, 1323, 1053, 397, 898, 2777, 4885, 9816, 468,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 29765, 23974, 12, 2890, 16, 508, 4672, 3536, 1986, 9816, 17, 3030, 2258, 1261, 3482, 1737, 2075, 4886, 8395, 468, 11329, 467, 2727, 1404, 3007, 1323, 1053, 397, 898, 2777, 4885, 9816, 468,...
self.set_class_on_child(node, 'first', 0) option = node.parent if (option.parent.index(option) == len(option.parent) - 1): self.set_class_on_child(node, 'last', -1)
def visit_description(self, node): self.body.append(self.starttag(node, 'dd', '')) self.set_class_on_child(node, 'first', 0) option = node.parent if (option.parent.index(option) == len(option.parent) - 1): self.set_class_on_child(node, 'last', -1)
b517010752aa5e7489d2928e2f509576bebde892 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5620/b517010752aa5e7489d2928e2f509576bebde892/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 3384, 12, 2890, 16, 756, 4672, 365, 18, 3432, 18, 6923, 12, 2890, 18, 1937, 2692, 12, 2159, 16, 296, 449, 2187, 875, 3719, 365, 18, 542, 67, 1106, 67, 265, 67, 3624, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 3384, 12, 2890, 16, 756, 4672, 365, 18, 3432, 18, 6923, 12, 2890, 18, 1937, 2692, 12, 2159, 16, 296, 449, 2187, 875, 3719, 365, 18, 542, 67, 1106, 67, 265, 67, 3624, 12, ...
""" % message
""" % message_to_text(message)
def create(user, notice_type_label, message_template, object_list=[]): """ create a new notice. This is intended to be how other apps create new notices. """ notice_type = NoticeType.objects.get(label=notice_type_label) message = encode_message(message_template, *object_list) notice = Notice(user=user, message=message, notice_type=notice_type) notice.save() if should_send(notice, "1", default=True) and user.email: # Email subject = "%s Notification From Pinax" % notice_type.display # @@@ message_body = """
96d4b26e261803b7c9fd9486e033f88ff7979ae3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11515/96d4b26e261803b7c9fd9486e033f88ff7979ae3/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 1355, 16, 11690, 67, 723, 67, 1925, 16, 883, 67, 3202, 16, 733, 67, 1098, 33, 8526, 4672, 3536, 752, 279, 394, 11690, 18, 225, 1220, 353, 12613, 358, 506, 3661, 1308, 8279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 1355, 16, 11690, 67, 723, 67, 1925, 16, 883, 67, 3202, 16, 733, 67, 1098, 33, 8526, 4672, 3536, 752, 279, 394, 11690, 18, 225, 1220, 353, 12613, 358, 506, 3661, 1308, 8279, ...
depname, flagsymbol, depver = depstring.split()
try: depname, flagsymbol, depver = depstring.split() except ValueError, e: raise Errors.YumBaseError, 'No Packages found for %s - have you tried quoting the string?' % depstring
def returnPackageByDep(self, depstring): """Pass in a generic [build]require string and this function will pass back the best(or first) package it finds providing that dep.""" flags = {'>':'GT', '<':'LT', '=': 'EQ', '==': 'EQ', '>=':'GE', '<=':'LE'} self.doRepoSetup() # parse the string out # either it is 'dep (some operator) e:v-r' # or /file/dep # or packagename depname = depstring depflags = None depver = None if depstring[0] != '/': # not a file dep - look at it for being versioned if re.search('[>=<]', depstring): # versioned depname, flagsymbol, depver = depstring.split() if not flags.has_key(flagsymbol): raise Errors.YumBaseError, 'No Packages found for %s' % depstring depflags = flags[flagsymbol] sack = self.whatProvides(depname, depflags, depver) if len(sack) < 1: raise Errors.YumBaseError, 'No Packages found for %s' % depstring if len(sack) == 1: for po in sack: return po pkglist = sack.returnNewestByNameArch() best = pkglist[0] for pkg in pkglist[1:]: if len(pkg.name) < len(best.name): # shortest name silliness best = pkg continue elif len(pkg.name) > len(best.name): continue
c4784e849a7f3076b536bde64a1b16d50f2d4a2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/c4784e849a7f3076b536bde64a1b16d50f2d4a2f/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 327, 2261, 858, 16316, 12, 2890, 16, 5993, 1080, 4672, 3536, 6433, 316, 279, 5210, 306, 3510, 65, 6528, 533, 471, 333, 445, 903, 1342, 1473, 326, 3796, 12, 280, 1122, 13, 2181, 518, 13...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 327, 2261, 858, 16316, 12, 2890, 16, 5993, 1080, 4672, 3536, 6433, 316, 279, 5210, 306, 3510, 65, 6528, 533, 471, 333, 445, 903, 1342, 1473, 326, 3796, 12, 280, 1122, 13, 2181, 518, 13...
curve.symbol().setBrush(QBrush(brushColor))
curve.symbol().setBrush(brush)
def alphaChange(self): for curve in self.graph.itemList(): if isinstance(curve, QwtPlotCurve): brushColor = curve.symbol().brush().color() penColor = curve.symbol().pen().color() brushColor.setAlpha(self.graph.alphaValue) penColor.setAlpha(self.graph.alphaValue) curve.symbol().setBrush(QBrush(brushColor)) curve.symbol().setPen(QPen(penColor)) self.graph.replot()
067282b63a653595095eebe32ec342b08f0f88b0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/067282b63a653595095eebe32ec342b08f0f88b0/OWScatterPlot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4190, 3043, 12, 2890, 4672, 364, 8882, 316, 365, 18, 4660, 18, 1726, 682, 13332, 309, 1549, 12, 16683, 16, 2238, 6046, 11532, 9423, 4672, 5186, 1218, 2957, 273, 8882, 18, 7175, 7675, 284...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4190, 3043, 12, 2890, 4672, 364, 8882, 316, 365, 18, 4660, 18, 1726, 682, 13332, 309, 1549, 12, 16683, 16, 2238, 6046, 11532, 9423, 4672, 5186, 1218, 2957, 273, 8882, 18, 7175, 7675, 284...
req = get_current_request() return self._hasNewPosts(req.session, req.user)
return self._hasNewPosts(get_current_session(), get_current_user())
def hasNewPosts(self): req = get_current_request() return self._hasNewPosts(req.session, req.user)
604a24d9cb0133574151ad0b0952e0f42cebf4e1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11563/604a24d9cb0133574151ad0b0952e0f42cebf4e1/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 1908, 24983, 12, 2890, 4672, 1111, 273, 336, 67, 2972, 67, 2293, 1435, 327, 365, 6315, 5332, 1908, 24983, 12, 3658, 18, 3184, 16, 1111, 18, 1355, 13, 2, 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, 711, 1908, 24983, 12, 2890, 4672, 1111, 273, 336, 67, 2972, 67, 2293, 1435, 327, 365, 6315, 5332, 1908, 24983, 12, 3658, 18, 3184, 16, 1111, 18, 1355, 13, 2, -100, -100, -100, -100, -1...
this = apply(_quickfix.new_EventPx, args)
this = _quickfix.new_EventPx(*args)
def __init__(self, *args): this = apply(_quickfix.new_EventPx, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 1133, 21776, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 1133, 21776, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, ...
expected = self.slow_format(x, 10)[:-1]
expected = self.slow_format(x, 10)
def check_format_1(self, x): for base, mapper in (8, oct), (10, repr), (16, hex): got = mapper(x) expected = self.slow_format(x, base) msg = Frm("%s returned %r but expected %r for %r", mapper.__name__, got, expected, x) self.assertEqual(got, expected, msg) self.assertEqual(long(got, 0), x, Frm('long("%s", 0) != %r', got, x)) # str() has to be checked a little differently since there's no # trailing "L" got = str(x) expected = self.slow_format(x, 10)[:-1] msg = Frm("%s returned %r but expected %r for %r", mapper.__name__, got, expected, x) self.assertEqual(got, expected, msg)
db4b4093733ada209bb08e3a37d1f304061b8814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/db4b4093733ada209bb08e3a37d1f304061b8814/test_long.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2139, 67, 21, 12, 2890, 16, 619, 4672, 364, 1026, 16, 5815, 316, 261, 28, 16, 10844, 3631, 261, 2163, 16, 8480, 3631, 261, 2313, 16, 3827, 4672, 2363, 273, 5815, 12, 92, 13,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2139, 67, 21, 12, 2890, 16, 619, 4672, 364, 1026, 16, 5815, 316, 261, 28, 16, 10844, 3631, 261, 2163, 16, 8480, 3631, 261, 2313, 16, 3827, 4672, 2363, 273, 5815, 12, 92, 13,...
if game.ithere:
if game.tholian:
def attack(torps_ok): # bad guy attacks us # torps_ok == false forces use of phasers in an attack atackd = False; attempt = False; ihurt = False; hitmax=0.0; hittot=0.0; chgfac=1.0 jay = coord() where = "neither" # game could be over at this point, check if game.alldone: return if idebug: prout("=== ATTACK!") # Tholian gets to move before attacking if game.ithere: movetholian() # if you have just entered the RNZ, you'll get a warning if game.neutz: # The one chance not to be attacked game.neutz = False return # commanders get a chance to tac-move towards you if (((game.comhere or game.ishere) and not game.justin) or game.skill == SKILL_EMERITUS) and torps_ok: moveklings() # if no enemies remain after movement, we're done if game.nenhere==0 or (game.nenhere==1 and thing == game.quadrant and not iqengry): return # set up partial hits if attack happens during shield status change pfac = 1.0/game.inshld if game.shldchg: chgfac = 0.25+0.5*random.random() skip(1) # message verbosity control if game.skill <= SKILL_FAIR: where = "sector" for loop in range(game.nenhere): if game.kpower[loop] < 0: continue; # too weak to attack # compute hit strength and diminish shield power r = random.random() # Increase chance of photon torpedos if docked or enemy energy low if game.condition == "docked": r *= 0.25 if game.kpower[loop] < 500: r *= 0.25; jay = game.ks[loop] iquad = game.quad[jay.x][jay.y] if iquad==IHT or (iquad==IHQUEST and not iqengry): continue # different enemies have different probabilities of throwing a torp usephasers = not torps_ok or \ (iquad == IHK and r > 0.0005) or \ (iquad==IHC and r > 0.015) or \ (iquad==IHR and r > 0.3) or \ (iquad==IHS and r > 0.07) or \ (iquad==IHQUEST and r > 0.05) if usephasers: # Enemy uses phasers if game.condition == "docked": continue; # Don't waste the effort! attempt = True; # Attempt to attack dustfac = 0.8+0.05*random.random() hit = game.kpower[loop]*math.pow(dustfac,game.kavgd[loop]) game.kpower[loop] *= 0.75 else: # Enemy uses photon torpedo course = 1.90985*math.atan2(game.sector.y-jay.y, jay.x-game.sector.x) hit = 0 proutn(_("***TORPEDO INCOMING")) if not damaged(DSRSENS): proutn(_(" From ")) crmena(False, iquad, where, jay) attempt = True prout(" ") r = (random.random()+random.random())*0.5 -0.5 r += 0.002*game.kpower[loop]*r hit = torpedo(course, r, jay, 1, 1) if (game.state.remkl + game.state.remcom + game.state.nscrem)==0: finish(FWON); # Klingons did themselves in! if game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova or game.alldone: return; # Supernova or finished if hit == None: continue # incoming phaser or torpedo, shields may dissipate it if game.shldup or game.shldchg or game.condition=="docked": # shields will take hits propor = pfac * game.shield if game.condition =="docked": propr *= 2.1 if propor < 0.1: propor = 0.1 hitsh = propor*chgfac*hit+1.0 absorb = 0.8*hitsh if absorb > game.shield: absorb = game.shield game.shield -= absorb hit -= hitsh # taking a hit blasts us out of a starbase dock if game.condition == "docked": dock(False) # but the shields may take care of it if propor > 0.1 and hit < 0.005*game.energy: continue # hit from this opponent got through shields, so take damage ihurt = True proutn(_("%d unit hit") % int(hit)) if (damaged(DSRSENS) and usephasers) or game.skill<=SKILL_FAIR: proutn(_(" on the ")) crmshp() if not damaged(DSRSENS) and usephasers: proutn(_(" from ")) crmena(False, iquad, where, jay) skip(1) # Decide if hit is critical if hit > hitmax: hitmax = hit hittot += hit fry(hit) game.energy -= hit if game.energy <= 0: # Returning home upon your shield, not with it... finish(FBATTLE) return if not attempt and game.condition == "docked": prout(_("***Enemies decide against attacking your ship.")) if not atackd: return percent = 100.0*pfac*game.shield+0.5 if not ihurt: # Shields fully protect ship proutn(_("Enemy attack reduces shield strength to ")) else: # Print message if starship suffered hit(s) skip(1) proutn(_("Energy left %2d shields ") % int(game.energy)) if game.shldup: proutn(_("up ")) elif not damaged(DSHIELD): proutn(_("down ")) else: proutn(_("damaged, ")) prout(_("%d%%, torpedoes left %d") % (percent, game.torps)) # Check if anyone was hurt if hitmax >= 200 or hittot >= 500: icas= hittot*random.random()*0.015 if icas >= 2: skip(1) prout(_("Mc Coy- \"Sickbay to bridge. We suffered %d casualties") % icas) prout(_(" in that last attack.\"")) game.casual += icas game.state.crew -= icas # After attack, reset average distance to enemies for loop in range(game.nenhere): game.kavgd[loop] = game.kdist[loop] sortklings() return;
ad7e6b2e5d6f82e729fafaf4752f0fd8fed97fc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/ad7e6b2e5d6f82e729fafaf4752f0fd8fed97fc3/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13843, 12, 13039, 1121, 67, 601, 4672, 468, 5570, 3058, 93, 28444, 584, 468, 8934, 1121, 67, 601, 422, 629, 26376, 999, 434, 1844, 345, 414, 316, 392, 13843, 225, 396, 363, 72, 273, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13843, 12, 13039, 1121, 67, 601, 4672, 468, 5570, 3058, 93, 28444, 584, 468, 8934, 1121, 67, 601, 422, 629, 26376, 999, 434, 1844, 345, 414, 316, 392, 13843, 225, 396, 363, 72, 273, 10...
def call(self, auth, person_id_or_email, role_id_or_name):
def call(self, auth, role_id_or_name, person_id_or_email):
def call(self, auth, person_id_or_email, role_id_or_name): # Get all roles roles = {} for role_id, role in Roles(self.api).iteritems(): roles[role_id] = role['name'] roles[role['name']] = role_id
8b088994273084c8d761be5ee836c18cdb108d2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/8b088994273084c8d761be5ee836c18cdb108d2e/DeleteRoleFromPerson.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 1357, 16, 2478, 67, 350, 67, 280, 67, 529, 16, 6175, 67, 350, 67, 280, 67, 3652, 4672, 468, 968, 777, 4900, 4900, 273, 2618, 364, 2478, 67, 350, 16, 2478, 316, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 1357, 16, 2478, 67, 350, 67, 280, 67, 529, 16, 6175, 67, 350, 67, 280, 67, 3652, 4672, 468, 968, 777, 4900, 4900, 273, 2618, 364, 2478, 67, 350, 16, 2478, 316, 1...
nd = util.normpath(top[root_subtract_len:])
nd = util.normpath(top[common_prefix_len:])
def findfiles(s): work = [s] # self.root may end with a path separator when self.root == '/' root_subtract_len = len(self.root) if not self.root.endswith('/'): root_subtract_len += 1 while work: top = work.pop() names = os.listdir(top) names.sort() # nd is the top of the repository dir tree nd = util.normpath(top[root_subtract_len:]) if nd == '.': nd = '' else: # do not recurse into a repo contained in this # one. use bisect to find .hg directory so speed # is good on big directory. hg = bisect.bisect_left(names, '.hg') if hg < len(names) and names[hg] == '.hg': if os.path.isdir(os.path.join(top, '.hg')): continue for f in names: np = util.pconvert(os.path.join(nd, f)) if seen(np): continue p = os.path.join(top, f) # don't trip over symlinks st = os.lstat(p) if stat.S_ISDIR(st.st_mode): ds = os.path.join(nd, f +'/') if statmatch(ds, st): work.append(p) if statmatch(np, st) and np in dc: yield 'm', np, st elif statmatch(np, st): if self.supported_type(np, st): yield 'f', np, st elif np in dc: yield 'm', np, st
76955b5f90f3d64bee3c6b958809ace0ad01a1c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/76955b5f90f3d64bee3c6b958809ace0ad01a1c8/dirstate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 2354, 12, 87, 4672, 1440, 273, 306, 87, 65, 468, 365, 18, 3085, 2026, 679, 598, 279, 589, 4182, 1347, 365, 18, 3085, 422, 2023, 1365, 67, 1717, 1575, 67, 1897, 273, 562, 12, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2354, 12, 87, 4672, 1440, 273, 306, 87, 65, 468, 365, 18, 3085, 2026, 679, 598, 279, 589, 4182, 1347, 365, 18, 3085, 422, 2023, 1365, 67, 1717, 1575, 67, 1897, 273, 562, 12, 28...
help="Check completeness of docs. (not implemented yet)")
help="Check completeness of docs.")
def parse_arguments(): # Construct the option parser. usage = '%prog ACTION [options] NAMES...' version = "Epydoc, version %s" % epydoc.__version__ optparser = OptionParser(usage=usage, version=version) action_group = OptionGroup(optparser, 'Actions') options_group = OptionGroup(optparser, 'Options') # Add options -- Actions action_group.add_option( # --html "--html", action="store_const", dest="action", const="html", help="Write HTML output.") action_group.add_option( # --latex "--text", action="store_const", dest="action", const="text", help="Write plaintext output. (not implemented yet)") action_group.add_option( # --latex "--latex", action="store_const", dest="action", const="latex", help="Write LaTeX output.") action_group.add_option( # --dvi "--dvi", action="store_const", dest="action", const="dvi", help="Write DVI output.") action_group.add_option( # --ps "--ps", action="store_const", dest="action", const="ps", help="Write Postscript output.") action_group.add_option( # --pdf "--pdf", action="store_const", dest="action", const="pdf", help="Write PDF output.") action_group.add_option( # --check "--check", action="store_const", dest="action", const="check", help="Check completeness of docs. (not implemented yet)") # Add options -- Options options_group.add_option( # --output "--output", "-o", dest="target", metavar="PATH", help="The output directory. If PATH does not exist, then " "it will be created.") options_group.add_option( # --show-imports "--inheritance", dest="inheritance", metavar="STYLE", help="The format for showing inheritance objects. STYLE " "should be one of: %s." % ', '.join(INHERITANCE_STYLES)) options_group.add_option( # --output "--docformat", dest="docformat", metavar="NAME", help="The default markup language for docstrings. Defaults " "to \"%default\".") options_group.add_option( # --css "--css", dest="css", metavar="STYLESHEET", help="The CSS stylesheet. STYLESHEET can be either a " "builtin stylesheet or the name of a CSS file.") options_group.add_option( # --name "--name", dest="prj_name", metavar="NAME", help="The documented project's name (for the navigation bar).") options_group.add_option( # --url "--url", dest="prj_url", metavar="URL", help="The documented project's URL (for the navigation bar).") options_group.add_option( # --navlink "--navlink", dest="prj_link", metavar="HTML", help="HTML code for a navigation link to place in the " "navigation bar.") options_group.add_option( # --top "--top", dest="top_page", metavar="PAGE", help="The \"top\" page for the HTML documentation. PAGE can " "be a URL, the name of a module or class, or one of the " "special names \"trees.html\", \"indices.html\", or \"help.html\"") options_group.add_option( # --help-file "--help-file", dest="help_file", metavar="FILE", help="An alternate help file. FILE should contain the body " "of an HTML file -- navigation bars will be added to it.") options_group.add_option( # --frames "--show-frames", action="store_true", dest="show_frames", help="Include frames in the HTML output. (default)") options_group.add_option( # --no-frames "--no-frames", action="store_false", dest="show_frames", help="Do not include frames in the HTML output.") options_group.add_option( # --private "--show-private", action="store_true", dest="show_private", help="Include private variables in the output. (default)") options_group.add_option( # --no-private "--no-private", action="store_false", dest="show_private", help="Do not include private variables in the output.") options_group.add_option( # --show-imports "--show-imports", action="store_true", dest="show_imports", help="List each module's imports.") options_group.add_option( # --show-imports "--no-imports", action="store_false", dest="show_imports", help="Do not list each module's imports. (default)") options_group.add_option( # --quiet "--quiet", "-q", action="count", dest="quiet", help="Decrease the verbosity.") options_group.add_option( # --verbose "--verbose", "-v", action="count", dest="verbose", help="Increase the verbosity.") options_group.add_option( # --debug "--debug", action="store_true", dest="debug", help="Show full tracebacks for internal errors.") options_group.add_option( # --parse-only "--parse-only", action="store_false", dest="introspect", help="Get all information from parsing (don't introspect)") options_group.add_option( # --introspect-only "--introspect-only", action="store_false", dest="parse", help="Get all information from introspecting (don't parse)") if epydoc.DEBUG: # this option is for developers, not users. options_group.add_option( "--profile-epydoc", action="store_true", dest="profile", help="Run the profiler. Output will be written to profile.out") options_group.add_option( "--dotpath", dest="dotpath", metavar='PATH', help="The path to the Graphviz 'dot' executable.") options_group.add_option( '--config', action='append', dest="configfiles", metavar='FILE', help=("A configuration file, specifying additional OPTIONS " "and/or NAMES. This option may be repeated.")) options_group.add_option( '--graph', action='append', dest='graphs', metavar='GRAPHTYPE', help=("Include graphs of type GRAPHTYPE in the generated output. " "Graphs are generated using the Graphviz dot executable. " "If this executable is not on the path, then use --dotpath " "to specify its location. This option may be repeated to " "include multiple graph types in the output. GRAPHTYPE" "should be one of: all, %s." % ', '.join(GRAPH_TYPES))) options_group.add_option( '--separate-classes', action='store_true', dest='list_classes_separately', help=("When generating LaTeX or PDF output, list each class in " "its own section, instead of listing them under their " "containing module.")) options_group.add_option( '--show-sourcecode', action='store_true', dest='include_source_code', help=("Include source code with syntax highlighting in the " "HTML output.")) options_group.add_option( '--no-sourcecode', action='store_false', dest='include_source_code', help=("Do not include source code with syntax highlighting in the " "HTML output.")) options_group.add_option( '--pstat', action='append', dest='pstat_files', metavar='FILE', help="A pstat output file, to be used in generating call graphs.") # Add the option groups. optparser.add_option_group(action_group) optparser.add_option_group(options_group) # Set the option parser's defaults. optparser.set_defaults(action="html", show_frames=True, docformat='epytext', show_private=True, show_imports=False, inheritance="listed", verbose=0, quiet=0, parse=True, introspect=True, debug=epydoc.DEBUG, profile=False, graphs=[], list_classes_separately=False, include_source_code=True, pstat_files=[]) # Parse the arguments. options, names = optparser.parse_args() # Process any config files. if options.configfiles: try: parse_configfiles(options.configfiles, options, names) except (KeyboardInterrupt,SystemExit): raise except Exception, e: optparser.error('Error reading config file:\n %s' % e) # Check to make sure all options are valid. if len(names) == 0: optparser.error("No names specified.") # perform shell expansion. for i, name in enumerate(names[:]): if '?' in name or '*' in name: names[i:i+1] = glob(name) if options.inheritance not in INHERITANCE_STYLES: optparser.error("Bad inheritance style. Valid options are " + ",".join(INHERITANCE_STYLES)) if not options.parse and not options.introspect: optparser.error("Invalid option combination: --parse-only " "and --introspect-only.") if options.action == 'text' and len(names) > 1: optparser.error("--text option takes only one name.") # Check the list of requested graph types to make sure they're # acceptable. options.graphs = [graph_type.lower() for graph_type in options.graphs] for graph_type in options.graphs: if graph_type == 'callgraph' and not options.pstat_files: optparser.error('"callgraph" graph type may only be used if ' 'one or more pstat files are specified.') # If it's 'all', then add everything (but don't add callgraph if # we don't have any profiling info to base them on). if graph_type == 'all': if options.pstat_files: options.graphs = GRAPH_TYPES else: options.graphs = [g for g in GRAPH_TYPES if g != 'callgraph'] break elif graph_type not in GRAPH_TYPES: optparser.error("Invalid graph type %s." % graph_type) # Calculate verbosity. options.verbosity = options.verbose - options.quiet # The target default depends on the action. if options.target is None: options.target = options.action # Return parsed args. return options, names
afc291a99589b8ab3cf40186fee6ee73aa623eb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/afc291a99589b8ab3cf40186fee6ee73aa623eb8/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 7099, 13332, 468, 14291, 326, 1456, 2082, 18, 4084, 273, 1995, 14654, 11385, 306, 2116, 65, 6048, 55, 7821, 1177, 273, 315, 41, 2074, 2434, 16, 1177, 738, 87, 6, 738, 425, 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, 1109, 67, 7099, 13332, 468, 14291, 326, 1456, 2082, 18, 4084, 273, 1995, 14654, 11385, 306, 2116, 65, 6048, 55, 7821, 1177, 273, 315, 41, 2074, 2434, 16, 1177, 738, 87, 6, 738, 425, 20...
def details(self): """ call showMessage on selected message """ items = self.list.selectedItems() if len(items)>0: self.showMessage(items[0])
self.msg_box = None self.itemQueue = [] self.resize(700, 400)
def __init__(self, parent = None): QtGui.QDialog.__init__(self, parent) core.debug.DebugPrint.getInstance().set_stream(debugStream(self.write)) self.setWindowTitle('VisTrails messages') layout = QtGui.QVBoxLayout() self.setLayout(layout) self.list = QtGui.QListWidget() self.connect(self.list, QtCore.SIGNAL('itemDoubleClicked(QListWidgetItem *)'), self.showMessage) self.msg_box = None
037568dc5960fe0f55f627faf210c87f5ee28788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/037568dc5960fe0f55f627faf210c87f5ee28788/debug.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 273, 599, 4672, 23425, 18, 53, 6353, 16186, 2738, 972, 12, 2890, 16, 982, 13, 2922, 18, 4148, 18, 2829, 5108, 18, 588, 1442, 7675, 542, 67, 3256, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 273, 599, 4672, 23425, 18, 53, 6353, 16186, 2738, 972, 12, 2890, 16, 982, 13, 2922, 18, 4148, 18, 2829, 5108, 18, 588, 1442, 7675, 542, 67, 3256, ...
self.lastTileWidth = xsize - self.countTilesX * tileWidth self.lastTileHeight = ysize - self.countTilesY * tileHeight
self.lastTileWidth = int(xsize - self.countTilesX * tileWidth) self.lastTileHeight = int(ysize - self.countTilesY * tileHeight)
def __init__(self,xsize,ysize,tileWidth,tileHeight): self.tileWidth=tileWidth self.tileHeight=tileHeight self.countTilesX= int(xsize / tileWidth) self.countTilesY= int(ysize / tileHeight) self.lastTileWidth = xsize - self.countTilesX * tileWidth self.lastTileHeight = ysize - self.countTilesY * tileHeight
a177d602c3eac40ea636c309ed92c73cd25a92ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10289/a177d602c3eac40ea636c309ed92c73cd25a92ca/gdal_retile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 92, 1467, 16, 93, 1467, 16, 15368, 2384, 16, 15368, 2686, 4672, 365, 18, 15368, 2384, 33, 15368, 2384, 365, 18, 15368, 2686, 33, 15368, 2686, 365, 18, 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, 1001, 2738, 972, 12, 2890, 16, 92, 1467, 16, 93, 1467, 16, 15368, 2384, 16, 15368, 2686, 4672, 365, 18, 15368, 2384, 33, 15368, 2384, 365, 18, 15368, 2686, 33, 15368, 2686, 365, 18, 18...
@param transaction: A transaction that will be used to search the values().
@param cls: The class that we'll want to look for with C{searcher}.
def __init__(self, columns=None, transaction=None, searcher=None, **kwargs): """ @param columns: A list of Columns. Only the C{read} attribute needs to be set.
41cb05d3c0bc79154577310cba5e527648e6d7cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/41cb05d3c0bc79154577310cba5e527648e6d7cb/search.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2168, 33, 7036, 16, 2492, 33, 7036, 16, 27349, 33, 7036, 16, 2826, 4333, 4672, 3536, 632, 891, 2168, 30, 432, 666, 434, 14962, 18, 5098, 326, 385, 95, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 2168, 33, 7036, 16, 2492, 33, 7036, 16, 27349, 33, 7036, 16, 2826, 4333, 4672, 3536, 632, 891, 2168, 30, 432, 666, 434, 14962, 18, 5098, 326, 385, 95, ...