rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
raise pyxb.SchemaValidationError('Expected restriction or extension as sole child of %s in %s' % (content_node.name(), self.name())) | raise pyxb.SchemaValidationError('Expected restriction or extension as sole child of %s in %s' % (content_node.nodeName, self.name())) | def __setContentFromDOM (self, node, **kw): attr_val = NodeAttribute(node, 'abstract') if attr_val is not None: self.__abstract = datatypes.boolean(attr_val) # Assume we're in the short-hand case: the entire content is # implicitly wrapped in a complex restriction of the ur-type. definition_node_list = node.childNodes is_complex_content = True self.__baseTypeDefinition = ComplexTypeDefinition.UrTypeDefinition() method = self.DM_restriction # Determine whether above assumption is correct by looking for # element content and seeing if it's one of the wrapper # elements. first_elt = LocateFirstChildElement(node) content_node = None if first_elt: have_content = False if xsd.nodeIsNamed(first_elt, 'simpleContent'): have_content = True is_complex_content = False elif xsd.nodeIsNamed(first_elt, 'complexContent'): have_content = True else: # Not one of the wrappers; use implicit wrapper around # the children pass if have_content: # Repeat the search to verify that only the one child is present. content_node = LocateFirstChildElement(node, require_unique=True) assert content_node == first_elt # Identify the contained restriction or extension # element, and extract the base type. ions = LocateFirstChildElement(content_node, absent_ok=False) if xsd.nodeIsNamed(ions, 'restriction'): method = self.DM_restriction elif xsd.nodeIsNamed(ions, 'extension'): method = self.DM_extension else: raise pyxb.SchemaValidationError('Expected restriction or extension as sole child of %s in %s' % (content_node.name(), self.name())) self.__baseAttribute = NodeAttribute(ions, 'base') if self.__baseAttribute is None: raise pyxb.SchemaValidationError('Element %s missing base attribute' % (ions.nodeName,)) self.__baseTypeDefinition = None # The content is defined by the restriction/extension element definition_node_list = ions.childNodes # deriviationMethod is assigned after resolution completes self.__pendingDerivationMethod = method self.__isComplexContent = is_complex_content | bd7add1d37c3af7c4c261d431cba89ebbac69980 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/bd7add1d37c3af7c4c261d431cba89ebbac69980/structures.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1350,
1265,
8168,
261,
2890,
16,
756,
16,
2826,
9987,
4672,
1604,
67,
1125,
273,
2029,
1499,
12,
2159,
16,
296,
17801,
6134,
309,
1604,
67,
1125,
353,
486,
599,
30,
365,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1350,
1265,
8168,
261,
2890,
16,
756,
16,
2826,
9987,
4672,
1604,
67,
1125,
273,
2029,
1499,
12,
2159,
16,
296,
17801,
6134,
309,
1604,
67,
1125,
353,
486,
599,
30,
365,
161... |
result.sign = 1 | result.sign = 0 | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
365,
397,
1308,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
365,
397,
1308,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if debug: s.debuglevel = 5 s.connect(config['smtp_server'], config['smtp_port']) if ssl: s.ehlo() s.starttls() s.ehlo() if config['smtp_user'] or config['smtp_password']: s.login(config['smtp_user'], config['smtp_password']) s.sendmail(email_from, flatten([email_to, email_cc, email_bcc]), msg.as_string() ) s.quit() | try: if debug: smtplib.stderr = WriteToLogger() s.set_debuglevel(int(bool(debug))) s.connect(config['smtp_server'], config['smtp_port']) if ssl: s.ehlo() s.starttls() s.ehlo() if config['smtp_user'] or config['smtp_password']: s.login(config['smtp_user'], config['smtp_password']) s.sendmail(email_from, flatten([email_to, email_cc, email_bcc]), msg.as_string() ) finally: s.quit() if debug: smtplib.stderr = oldstderr | def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, tinycrm=False, ssl=False, debug=False, subtype='plain', x_headers=None): """Send an email.""" import smtplib from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from email.MIMEMultipart import MIMEMultipart from email.Header import Header from email.Utils import formatdate, COMMASPACE from email.Utils import formatdate, COMMASPACE from email import Encoders if x_headers is None: x_headers = {} if not ssl: ssl = config.get('smtp_ssl', False) if not email_from and not config['email_from']: raise Exception("No Email sender by default, see config file") if not email_cc: email_cc = [] if not email_bcc: email_bcc = [] if not attach: msg = MIMEText(body or '',_subtype=subtype,_charset='utf-8') else: msg = MIMEMultipart() msg['Subject'] = Header(ustr(subject), 'utf-8') msg['From'] = email_from del msg['Reply-To'] if reply_to: msg['Reply-To'] = reply_to else: msg['Reply-To'] = msg['From'] msg['To'] = COMMASPACE.join(email_to) if email_cc: msg['Cc'] = COMMASPACE.join(email_cc) if email_bcc: msg['Bcc'] = COMMASPACE.join(email_bcc) msg['Date'] = formatdate(localtime=True) # Add OpenERP Server information msg['X-Generated-By'] = 'OpenERP (http://www.openerp.com)' msg['X-OpenERP-Server-Host'] = socket.gethostname() msg['X-OpenERP-Server-Version'] = release.version # Add dynamic X Header for key, value in x_headers.items(): msg['X-OpenERP-%s' % key] = str(value) if tinycrm: msg['Message-Id'] = "<%s-tinycrm-%s@%s>" % (time.time(), tinycrm, socket.gethostname()) if attach: msg.attach( MIMEText(body or '', _charset='utf-8', _subtype=subtype) ) for (fname,fcontent) in attach: part = MIMEBase('application', "octet-stream") part.set_payload( fcontent ) Encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment; filename="%s"' % (fname,)) msg.attach(part) try: s = smtplib.SMTP() if debug: s.debuglevel = 5 s.connect(config['smtp_server'], config['smtp_port']) if ssl: s.ehlo() s.starttls() s.ehlo() if config['smtp_user'] or config['smtp_password']: s.login(config['smtp_user'], config['smtp_password']) s.sendmail(email_from, flatten([email_to, email_cc, email_bcc]), msg.as_string() ) s.quit() except Exception, e: import netsvc netsvc.Logger().notifyChannel('email_send', netsvc.LOG_ERROR, e) return False return True | 7a561ffcd85a478515dbc72af04fb70847991e16 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/7a561ffcd85a478515dbc72af04fb70847991e16/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2699,
67,
4661,
12,
3652,
67,
2080,
16,
2699,
67,
869,
16,
3221,
16,
1417,
16,
2699,
67,
952,
33,
7036,
16,
2699,
67,
31345,
33,
7036,
16,
4332,
67,
869,
33,
8381,
16,
3306,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2699,
67,
4661,
12,
3652,
67,
2080,
16,
2699,
67,
869,
16,
3221,
16,
1417,
16,
2699,
67,
952,
33,
7036,
16,
2699,
67,
31345,
33,
7036,
16,
4332,
67,
869,
33,
8381,
16,
3306,
33,
70... |
assert(core.SVN_VER_MAJOR, core.SVN_VER_MINOR) >= (1, 3), "Subversion 1.3 or later required" | assert(svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR) >= (1, 3), "Subversion 1.3 or later required" | def __init__(self, url): assert(core.SVN_VER_MAJOR, core.SVN_VER_MINOR) >= (1, 3), "Subversion 1.3 or later required" self.url = url | 712021c6e5e001b1a637ac5d8f566b3f45b629d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1870/712021c6e5e001b1a637ac5d8f566b3f45b629d4/sloccompare.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
4672,
1815,
12,
31505,
18,
3644,
18,
23927,
50,
67,
2204,
67,
26976,
916,
16,
5893,
82,
18,
3644,
18,
23927,
50,
67,
2204,
67,
6236,
916,
13,
1545... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
880,
4672,
1815,
12,
31505,
18,
3644,
18,
23927,
50,
67,
2204,
67,
26976,
916,
16,
5893,
82,
18,
3644,
18,
23927,
50,
67,
2204,
67,
6236,
916,
13,
1545... |
aH = (availHeight - H - max(pS,tSB) - tH)*0.99 | aH = (availHeight-H-tHS-hx)*0.99999 | def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,tH,tSB = I2W[I] _, h = c.wrapOn(canv,availWidth,0xfffffff) if x: h += max(c.getSpaceBefore()-pS,0) pS = c.getSpaceAfter() H += h+pS if H+tH+max(tSB,pS)>=availHeight-_FUZZ: break i += 1 | 8d8c0ec1fd140512007c83c05dcbc570c6560932 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8d8c0ec1fd140512007c83c05dcbc570c6560932/flowables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
848,
90,
273,
365,
18,
4169,
90,
385,
273,
365,
6315,
1745,
619,
273,
277,
273,
670,
273,
293,
55,
273,
374,
290,
273,
562,
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,
1416,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
848,
90,
273,
365,
18,
4169,
90,
385,
273,
365,
6315,
1745,
619,
273,
277,
273,
670,
273,
293,
55,
273,
374,
290,
273,
562,
12... |
filename = os.path.join(dir, testfile) fp = open(filename, 'w') fp.write('blat') fp.close() os.unlink(filename) tempdir = dir break | filename = os.path.join(dir, testfile) if os.name == 'posix': try: fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700) except OSError: pass else: fp = os.fdopen(fd, 'w') fp.write('blat') fp.close() os.unlink(filename) del fp, fd tempdir = dir break else: fp = open(filename, 'w') fp.write('blat') fp.close() os.unlink(filename) tempdir = dir break | def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') elif os.name == 'mac': import macfs, MACFS try: refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kTemporaryFolderType, 1) dirname = macfs.FSSpec((refnum, dirid, '')).as_pathname() attempdirs.insert(0, dirname) except macfs.error: pass for envname in 'TMPDIR', 'TEMP', 'TMP': if os.environ.has_key(envname): attempdirs.insert(0, os.environ[envname]) testfile = gettempprefix() + 'test' for dir in attempdirs: try: filename = os.path.join(dir, testfile) fp = open(filename, 'w') fp.write('blat') fp.close() os.unlink(filename) tempdir = dir break except IOError: pass if tempdir is None: msg = "Can't find a usable temporary directory amongst " + `attempdirs` raise IOError, msg return tempdir | eeefb3a92e4f5b0a4ffd5d599463c440c73bdd16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/eeefb3a92e4f5b0a4ffd5d599463c440c73bdd16/tempfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5814,
1214,
13332,
3536,
2083,
358,
4604,
326,
1867,
358,
999,
12123,
2552,
23101,
309,
23101,
353,
486,
599,
30,
327,
23101,
775,
30,
14720,
273,
1140,
18,
588,
11089,
1435,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5814,
1214,
13332,
3536,
2083,
358,
4604,
326,
1867,
358,
999,
12123,
2552,
23101,
309,
23101,
353,
486,
599,
30,
327,
23101,
775,
30,
14720,
273,
1140,
18,
588,
11089,
1435,
1335,
... |
values=converter.values where, wvals=self._uniqueWhere(conn, self) values+=wvals | where, values=self._uniqueWhere(conn, self, converter) | def _update_raw(self, adict): """update self in database with the values in adict""" | 1e90cec39e33610ec66eb5f5d2969bba1d7d215f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/1e90cec39e33610ec66eb5f5d2969bba1d7d215f/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
1899,
12,
2890,
16,
1261,
933,
4672,
3536,
2725,
365,
316,
2063,
598,
326,
924,
316,
1261,
933,
8395,
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,
2725,
67,
1899,
12,
2890,
16,
1261,
933,
4672,
3536,
2725,
365,
316,
2063,
598,
326,
924,
316,
1261,
933,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def model_id_get(self, cr, model, id_str): | def model_id_get(self, cr, id_str): | def model_id_get(self, cr, model, id_str): model_data_obj = self.pool.get('ir.model.data') mod = self.module if '.' in id_str: mod,id_str = id_str.split('.') return model_data_obj.get_object_reference(cr, self.uid, mod, id_str) | 4bc20ff99f4251e4705e5836bf656f172bf6fd92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bc20ff99f4251e4705e5836bf656f172bf6fd92/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
938,
67,
350,
67,
588,
12,
2890,
16,
4422,
16,
612,
67,
701,
4672,
938,
67,
892,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2284,
18,
892,
6134,
681,
273,
365,
18,
2978,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
938,
67,
350,
67,
588,
12,
2890,
16,
4422,
16,
612,
67,
701,
4672,
938,
67,
892,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2284,
18,
892,
6134,
681,
273,
365,
18,
2978,... |
out_fn = string.replace (f, '.py', '.pyc') | out_fn = f + (__debug__ and "c" or "o") compile_msg = "byte-compiling %s to %s" % \ (f, os.path.basename (out_fn)) skip_msg = "byte-compilation of %s skipped" % f | def run (self): | fee53bc8f1351bfd4fd61ee232169dccdca95730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fee53bc8f1351bfd4fd61ee232169dccdca95730/install_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return l = len( self.s ) if not self.s or ( not self.s[ l-1 ].isalnum() and self.s[ l-1 ] not in ( '.', '_' ) ): return i = 1 while i < l+1: if not self.s[ -i ].isalnum() and self.s[ -i ] not in ( '.', '_' ): break i += 1 return self.s[ -i +1: ] def get_args( self ): """Check if an unclosed parenthesis exists, then attempt to get the argspec() for it. On success, update self.argspec and return True, otherwise set self.argspec to None and return False""" def getpydocspec( f, func ): try: argspec = pydoc.getdoc( f ) except NameError: return None rx = re.compile( r'([a-zA-Z_][a-zA-Z0-9_]*?)\((.*?)\)' ) s = rx.search( argspec ) if s is None: return None if s.groups()[0] != func: return None args = [ i.strip() for i in s.groups()[1].split(',') ] return [func, (args, None, None, None)] def getargspec( func ): try: if func in self.interp.locals: f = self.interp.locals[ func ] except TypeError: return None else: try: f = eval( func, self.interp.locals ) except Exception: return None try: if inspect.isclass(f): argspec = inspect.getargspec( f.__init__ ) else: argspec = inspect.getargspec( f ) self.argspec = [func, argspec] return True except (NameError, TypeError, KeyError), x: t = getpydocspec( f, func ) if t is None: return None self.argspec = t return True except AttributeError: return None def parse_parens( s ): """Run a string through the pyparsing pattern for paren counting.""" try: parsed = self.pparser.parseString( s ).asList() except ParseException: return False return parsed def walk( seq ): """Walk a nested list and return the last list found that doesn't have a close paren in it (i.e. the active function)""" r = None if isinstance( seq, list ): if ")" not in seq and "(" in seq: r = seq[ seq.index('(') - 1 ] for i in seq: t = walk( i ) if t: r = t return r if not OPTS.argspec: return False t = parse_parens( self.s ) if not t: return False func = walk( t ) if not func: return False return getargspec( func ) def complete( self ): """Construct a full list of possible completions and construct and display them in a window. Also check if there's an available argspec (via the inspect module) and bang that on top of the completions too.""" words = [] i = 0 if not self.get_args(): self.argspec = None cw = self.cw() if not (cw or self.argspec): self.scr.redrawwin() self.scr.refresh() return None if not cw: self.matches = [] try: self.completer.complete( cw, 0 ) except Exception: | return l = len( self.s ) if not self.s or ( not self.s[ l-1 ].isalnum() and self.s[ l-1 ] not in ( '.', '_' ) ): return i = 1 while i < l+1: if not self.s[ -i ].isalnum() and self.s[ -i ] not in ( '.', '_' ): break i += 1 return self.s[ -i +1: ] def get_args( self ): """Check if an unclosed parenthesis exists, then attempt to get the argspec() for it. On success, update self.argspec and return True, otherwise set self.argspec to None and return False""" def getpydocspec( f, func ): try: argspec = pydoc.getdoc( f ) except NameError: return None rx = re.compile( r'([a-zA-Z_][a-zA-Z0-9_]*?)\((.*?)\)' ) s = rx.search( argspec ) if s is None: return None if s.groups()[0] != func: return None args = [ i.strip() for i in s.groups()[1].split(',') ] return [func, (args, None, None, None)] def getargspec( func ): try: if func in self.interp.locals: f = self.interp.locals[ func ] except TypeError: return None else: try: f = eval( func, self.interp.locals ) except Exception: return None try: if inspect.isclass(f): argspec = inspect.getargspec( f.__init__ ) else: argspec = inspect.getargspec( f ) self.argspec = [func, argspec] return True except (NameError, TypeError, KeyError), x: t = getpydocspec( f, func ) if t is None: return None self.argspec = t return True except AttributeError: return None def parse_parens( s ): """Run a string through the pyparsing pattern for paren counting.""" try: parsed = self.pparser.parseString( s ).asList() except ParseException: return False return parsed def walk( seq ): """Walk a nested list and return the last list found that doesn't have a close paren in it (i.e. the active function)""" r = None if isinstance( seq, list ): if ")" not in seq and "(" in seq: r = seq[ seq.index('(') - 1 ] for i in seq: t = walk( i ) if t: r = t return r if not OPTS.argspec: return False t = parse_parens( self.s ) if not t: return False func = walk( t ) if not func: return False return getargspec( func ) def complete( self ): """Construct a full list of possible completions and construct and display them in a window. Also check if there's an available argspec (via the inspect module) and bang that on top of the completions too.""" words = [] i = 0 if not self.get_args(): self.argspec = None cw = self.cw() if not (cw or self.argspec): self.scr.redrawwin() self.scr.refresh() return None if not cw: self.matches = [] try: self.completer.complete( cw, 0 ) except Exception: | def cw( self ): """Return the current word, i.e. the (incomplete) word directly to the left of the cursor""" | 62b5311573ce50804121e2c3e6ff3852a1e8c517 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6932/62b5311573ce50804121e2c3e6ff3852a1e8c517/bpython.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14098,
12,
365,
262,
30,
3536,
990,
326,
783,
2076,
16,
277,
18,
73,
18,
326,
261,
17624,
13,
2076,
5122,
358,
326,
2002,
434,
326,
3347,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14098,
12,
365,
262,
30,
3536,
990,
326,
783,
2076,
16,
277,
18,
73,
18,
326,
261,
17624,
13,
2076,
5122,
358,
326,
2002,
434,
326,
3347,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return FileSource.write(self, format) | if not self.error: return FileSource.write(self, format) else: output = self.serializeXHTML() | def write(self, format, output=None): """Write Source through OutputFormat `format`. Write contents as string `output` instead if specified. """ if not output: return FileSource.write(self, format) | 3bf9ebed2f619a1c24db9c9ba73698de2a5cee81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11472/3bf9ebed2f619a1c24db9c9ba73698de2a5cee81/Sources.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
740,
16,
876,
33,
7036,
4672,
3536,
3067,
4998,
3059,
3633,
1630,
1375,
2139,
8338,
2598,
2939,
487,
533,
1375,
2844,
68,
3560,
309,
1269,
18,
3536,
309,
486,
876,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
740,
16,
876,
33,
7036,
4672,
3536,
3067,
4998,
3059,
3633,
1630,
1375,
2139,
8338,
2598,
2939,
487,
533,
1375,
2844,
68,
3560,
309,
1269,
18,
3536,
309,
486,
876,
... |
towrite = "hello, world\n" | towrite = b"hello, world\n" | def test_file(self): import time, rfc822, socket h = urllib2.FileHandler() o = h.parent = MockOpener() | 53b6b3309dd08b3f534f7668ceecca4063fd2c62 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/53b6b3309dd08b3f534f7668ceecca4063fd2c62/test_urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
768,
12,
2890,
4672,
1930,
813,
16,
16590,
24532,
16,
2987,
366,
273,
11527,
22,
18,
28942,
1435,
320,
273,
366,
18,
2938,
273,
7867,
3817,
708,
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,
768,
12,
2890,
4672,
1930,
813,
16,
16590,
24532,
16,
2987,
366,
273,
11527,
22,
18,
28942,
1435,
320,
273,
366,
18,
2938,
273,
7867,
3817,
708,
1435,
2,
-100,
-100,
-100,
-1... |
create(DB_NAME, USER_PASSWORD, 'en_US', CONFIG['admin_passwd']) | create(DB_NAME, CONFIG['admin_passwd'], 'en_US', USER_PASSWORD) | def install_module(name): ''' Install module for the tested database ''' database = Database().connect() cursor = database.cursor() databases = database.list(cursor) cursor.close() if DB_NAME not in databases: create(DB_NAME, USER_PASSWORD, 'en_US', CONFIG['admin_passwd']) cursor = DB.cursor() module_obj = POOL.get('ir.module.module') module_ids = module_obj.search(cursor, USER, [ ('name', '=', name), ('state', '!=', 'installed'), ]) if not module_ids: cursor.close() return module_obj.button_install(cursor, USER, module_ids, CONTEXT) cursor.commit() install_upgrade_obj = POOL.get('ir.module.module.install_upgrade', type='wizard') wiz_id = install_upgrade_obj.create(cursor, USER) cursor.commit() install_upgrade_obj.execute(cursor, USER, wiz_id, {}, 'start', CONTEXT) cursor.commit() install_upgrade_obj.delete(cursor, USER, wiz_id) cursor.commit() cursor.close() | b15934a9df76154e34928ac609071da37269a95d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/b15934a9df76154e34928ac609071da37269a95d/test_tryton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
2978,
12,
529,
4672,
9163,
10284,
1605,
364,
326,
18432,
2063,
9163,
2063,
273,
5130,
7675,
3612,
1435,
3347,
273,
2063,
18,
9216,
1435,
16358,
273,
2063,
18,
1098,
12,
9216,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
2978,
12,
529,
4672,
9163,
10284,
1605,
364,
326,
18432,
2063,
9163,
2063,
273,
5130,
7675,
3612,
1435,
3347,
273,
2063,
18,
9216,
1435,
16358,
273,
2063,
18,
1098,
12,
9216,
1... |
return [name for (name,) in connection.cursor().execute("SELECT name FROM sqlite_master WHERE type == 'table'")] | cursor = connection.cursor() cursor.execute("SELECT name FROM sqlite_master WHERE type == 'table'") return [name for (name,) in cursor] | def get_table_names(connection): """ Return a list of the table names in the database. """ return [name for (name,) in connection.cursor().execute("SELECT name FROM sqlite_master WHERE type == 'table'")] | 3e6d9f6b759de94a9a183072c94cc952e9fcf558 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/3e6d9f6b759de94a9a183072c94cc952e9fcf558/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2121,
67,
1973,
12,
4071,
4672,
3536,
2000,
279,
666,
434,
326,
1014,
1257,
316,
326,
2063,
18,
3536,
3347,
273,
1459,
18,
9216,
1435,
3347,
18,
8837,
2932,
4803,
508,
4571,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2121,
67,
1973,
12,
4071,
4672,
3536,
2000,
279,
666,
434,
326,
1014,
1257,
316,
326,
2063,
18,
3536,
3347,
273,
1459,
18,
9216,
1435,
3347,
18,
8837,
2932,
4803,
508,
4571,
1... |
raise NameError, "The id "+ident+" for the Virtual System has\ already been implemented. The id for each Virtual System has\ to be unique." | raise NameError,("The id "+ident+" for the Virtual System has"+ " already been implemented. The id for each Virtual System"+ " has to be unique.") | def createVirtualSystem(self, ident, info, node=None, infoID=None): """ This method will create a VirtualSystem. | 1e366dda56653bbe1874c94abe9d80a9b34ba33a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9789/1e366dda56653bbe1874c94abe9d80a9b34ba33a/OvfFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
6466,
3163,
12,
2890,
16,
3390,
16,
1123,
16,
756,
33,
7036,
16,
1123,
734,
33,
7036,
4672,
3536,
1220,
707,
903,
752,
279,
7269,
3163,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
6466,
3163,
12,
2890,
16,
3390,
16,
1123,
16,
756,
33,
7036,
16,
1123,
734,
33,
7036,
4672,
3536,
1220,
707,
903,
752,
279,
7269,
3163,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
n = i + hwin | n = i + hwin + 1 | def _safe_coord(i, j, img, win_size): """Return the coordinates of a window only if it fits inside the image.""" hwin = (win_size - 1) / 2 m = i - hwin n = i + hwin p = j - hwin q = j + hwin if (m < 0) or (n >= img.shape[0]) or \ (p < 0) or (q >= img.shape[1]): raise IndexError("Patch crosses image boundary") else: return m, n, p, q | 0813b9d638a165c62c5cc2fcc988b2d8388d9e2d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12843/0813b9d638a165c62c5cc2fcc988b2d8388d9e2d/correspond.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4626,
67,
5732,
12,
77,
16,
525,
16,
3774,
16,
5657,
67,
1467,
4672,
3536,
990,
326,
5513,
434,
279,
2742,
1338,
309,
518,
13351,
4832,
326,
1316,
12123,
366,
8082,
273,
261,
8082... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4626,
67,
5732,
12,
77,
16,
525,
16,
3774,
16,
5657,
67,
1467,
4672,
3536,
990,
326,
5513,
434,
279,
2742,
1338,
309,
518,
13351,
4832,
326,
1316,
12123,
366,
8082,
273,
261,
8082... |
if revision == 'INITIAL': | if revision == 'INITIAL' or self.is_hash_rx.match(revision): | def _checkoutUpstreamRevision(self, revision): """ Concretely do the checkout of the upstream revision and return the last applied changeset. """ | 5e5b4967e89c99046884bacd6b13974d01087474 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/5e5b4967e89c99046884bacd6b13974d01087474/darcs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17300,
1211,
3256,
7939,
12,
2890,
16,
6350,
4672,
3536,
735,
71,
1349,
2357,
741,
326,
13926,
434,
326,
13505,
6350,
471,
327,
326,
1142,
6754,
22463,
18,
3536,
2,
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,
389,
17300,
1211,
3256,
7939,
12,
2890,
16,
6350,
4672,
3536,
735,
71,
1349,
2357,
741,
326,
13926,
434,
326,
13505,
6350,
471,
327,
326,
1142,
6754,
22463,
18,
3536,
2,
-100,
-100,
-100... |
patch = Patch(name, self.__patch_dir, self.__refs_dir) | patch = self.get_patch(name) | def new_patch(self, name, message = None, can_edit = True, unapplied = False, show_patch = False, top = None, bottom = None, commit = True, author_name = None, author_email = None, author_date = None, committer_name = None, committer_email = None, before_existing = False): """Creates a new patch """ | 4c0dd2995d5836c340489a2105d8518d7018ef27 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12366/4c0dd2995d5836c340489a2105d8518d7018ef27/stack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
2272,
12,
2890,
16,
508,
16,
883,
273,
599,
16,
848,
67,
4619,
273,
1053,
16,
640,
438,
3110,
273,
1083,
16,
2405,
67,
2272,
273,
1083,
16,
1760,
273,
599,
16,
5469,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
2272,
12,
2890,
16,
508,
16,
883,
273,
599,
16,
848,
67,
4619,
273,
1053,
16,
640,
438,
3110,
273,
1083,
16,
2405,
67,
2272,
273,
1083,
16,
1760,
273,
599,
16,
5469,
273,
... |
from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot | from scipy.basic._dotblas import dot, vdot, inner, alterdot, restoredot | def vdot(a, b): """Returns the dot product of 2 vectors (or anything that can be made into a vector). NB: this is not the same as `dot`, as it takes the conjugate of its first argument if complex and always returns a scalar.""" return dot(asarray(a).ravel().conj(), asarray(b).ravel()) | 3464418761b89f678c112224a4b0dfd1ffe871f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/3464418761b89f678c112224a4b0dfd1ffe871f8/numeric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
9811,
12,
69,
16,
324,
4672,
3536,
1356,
326,
3928,
3017,
434,
576,
10046,
261,
280,
6967,
716,
848,
506,
7165,
1368,
279,
3806,
2934,
20096,
30,
333,
353,
486,
326,
1967,
487,
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,
331,
9811,
12,
69,
16,
324,
4672,
3536,
1356,
326,
3928,
3017,
434,
576,
10046,
261,
280,
6967,
716,
848,
506,
7165,
1368,
279,
3806,
2934,
20096,
30,
333,
353,
486,
326,
1967,
487,
13... |
class _SSLBioProxy: | class _BioProxy: | def listenTCP(port, factory, backlog=5, interface='', reactor=twisted.internet.reactor, postConnectionCheck=None): """ A convenience function to listen for TCP connections using Twisted. NOTE: You must call startTLS(ctx) to go into SSL/TLS mode. See IReactorTCP interface in Twisted. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=1, client=0, contextFactory=None, postConnectionCheck=postConnectionCheck) return reactor.listenTCP(port, wrappingFactory, backlog, interface) | d11d01823be9c35cb9fd8c8343ce3aea15de9275 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8055/d11d01823be9c35cb9fd8c8343ce3aea15de9275/TwistedProtocolWrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6514,
13891,
12,
655,
16,
3272,
16,
1473,
1330,
33,
25,
16,
1560,
2218,
2187,
19178,
33,
11246,
25444,
18,
267,
14726,
18,
266,
3362,
16,
1603,
1952,
1564,
33,
7036,
4672,
3536,
432,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6514,
13891,
12,
655,
16,
3272,
16,
1473,
1330,
33,
25,
16,
1560,
2218,
2187,
19178,
33,
11246,
25444,
18,
267,
14726,
18,
266,
3362,
16,
1603,
1952,
1564,
33,
7036,
4672,
3536,
432,
1... |
format = "iiiiiiiiiii" | format = "PPiiiiiiiiP" | def OnNotify(self, hwnd, msg, wparam, lparam): format = "iiiiiiiiiii" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, idFrom, code, iItem, iSubItem, uNewState, uOldState, uChanged, actionx, actiony, lParam \ = struct.unpack(format, buf) # *sigh* - work around a problem with old commctrl modules, which had a # bad value for PY_OU, which therefore cause most "control notification" # messages to be wrong. # Code that needs to work with both pre and post pywin32-204 must do # this too. code += commctrl.PY_0U if code == commctrl.NM_DBLCLK: print "Double click on item", iItem+1 return 1 | 13c8c3152e50a362ae3a884f3a33d4f5f14d6b08 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/992/13c8c3152e50a362ae3a884f3a33d4f5f14d6b08/win32gui_dialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
9168,
12,
2890,
16,
16139,
4880,
16,
1234,
16,
341,
891,
16,
328,
891,
4672,
740,
273,
315,
6584,
2835,
2835,
2835,
2835,
52,
6,
1681,
273,
5657,
1578,
20292,
18,
9413,
6464,
189... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9168,
12,
2890,
16,
16139,
4880,
16,
1234,
16,
341,
891,
16,
328,
891,
4672,
740,
273,
315,
6584,
2835,
2835,
2835,
2835,
52,
6,
1681,
273,
5657,
1578,
20292,
18,
9413,
6464,
189... |
_mapping = {'From': parse_address, 'To': parse_address, 'cc': parse_address} | _mapping = {'From': parse_cpim_address, 'To': parse_cpim_address, 'cc': parse_cpim_address} | def parse_address(s): """ >>> alice = parse_address('<sip:alice@example.com>') >>> alice.user, alice.host, alice.display ('alice', 'example.com', None) >>> alice = parse_address('Alice The Great <sip:alice@example.com>') >>> alice.user, alice.host, alice.display ('alice', 'example.com', 'Alice The Great') """ m = _re_address.match(s) if not m: raise ValueError('Cannot parse message/cpim address: %r' % s) display, uri = m.groups() if display: display = display.strip().strip('"') uri = SIPAddress.parse(uri) return SIPURI(user=uri.username, host=uri.domain, display=display) | 04c9ceb1ad424e50306688dc2122d5969d04b7a9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/04c9ceb1ad424e50306688dc2122d5969d04b7a9/cpim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2867,
12,
87,
4672,
3536,
4080,
524,
1812,
273,
1109,
67,
2867,
2668,
32,
28477,
30,
287,
1812,
36,
8236,
18,
832,
1870,
13,
4080,
524,
1812,
18,
1355,
16,
524,
1812,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2867,
12,
87,
4672,
3536,
4080,
524,
1812,
273,
1109,
67,
2867,
2668,
32,
28477,
30,
287,
1812,
36,
8236,
18,
832,
1870,
13,
4080,
524,
1812,
18,
1355,
16,
524,
1812,
18,
2... |
p.wait() | my_stdin=file(redirectin, 'r') p = subprocess.Popen([cmd]+args, stdin=my_stdin, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) try: output = SuckOutputWithTimeout(p.stdout, timeout) except ReadTimeoutException: sys.stdout.write('%s[Error: Timed out executing program %s/%s'% (futuretest, localdir, execname)) if not onlyone: sys.stdout.write(' %s %s (%s %s) (%d-%d)'% (' '.join(globalExecopts), execopts, ' '.join(globalCompopts),compopts, compoptsnum, execoptsnum)) sys.stdout.write(']\n') kill_proc(p, killtimeout) continue status = p.returncode | def kill_proc(p, timeout): k = subprocess.Popen(['kill',str(p.pid)]) k.wait() now = time.time() end_time = now + timeout # give it a little time while end_time > now: if p.poll(): return now = time.time() # use the big hammer (and don't bother waiting) subprocess.Popen(['kill','-9', str(p.pid)]) return | 97dd26e665e2ca235f4c8596da4b25c90663de32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6895/97dd26e665e2ca235f4c8596da4b25c90663de32/sub_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
9381,
12,
84,
16,
2021,
4672,
417,
273,
6652,
18,
52,
3190,
12,
3292,
16418,
2187,
701,
12,
84,
18,
6610,
13,
5717,
417,
18,
7048,
1435,
2037,
273,
813,
18,
957,
1435,
679,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
9381,
12,
84,
16,
2021,
4672,
417,
273,
6652,
18,
52,
3190,
12,
3292,
16418,
2187,
701,
12,
84,
18,
6610,
13,
5717,
417,
18,
7048,
1435,
2037,
273,
813,
18,
957,
1435,
679,... |
f = file(self['configfile'], 'w') | f = file(self.configfile, 'w') | def write_proxyconf (self): """write proxy configuration""" f = file(self['configfile'], 'w') f.write("""<?xml version="1.0" encoding="%s"?> | 540a64c653d1a99ca189c67f23ae6401e651dc1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/540a64c653d1a99ca189c67f23ae6401e651dc1e/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
5656,
3923,
261,
2890,
4672,
3536,
2626,
2889,
1664,
8395,
284,
273,
585,
12,
2890,
18,
1425,
768,
16,
296,
91,
6134,
284,
18,
2626,
2932,
3660,
12880,
2902,
1177,
1546,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
5656,
3923,
261,
2890,
4672,
3536,
2626,
2889,
1664,
8395,
284,
273,
585,
12,
2890,
18,
1425,
768,
16,
296,
91,
6134,
284,
18,
2626,
2932,
3660,
12880,
2902,
1177,
1546,
21,
... |
CopyFile(File, To) open(os.path.join(To, "cm3.cfg"), "w").write("INSTALL_ROOT = (path() & SL & \"..\")\ninclude(path() & \"/config/" + Config + "\")\n") | CopyFile(File, Config) open(os.path.join(Bin, "cm3.cfg"), "w").write("INSTALL_ROOT = (path() & SL & \"..\")\ninclude(path() & \"/config/" + Config + "\")\n") | def CopyConfigForDistribution(To): # # The distributed environment is minimal and targets only one # or a small number of targets (e.g. NT386*). # # The distributed environment does not require a source tree. # a = os.path.join(Root, "m3-sys", "cminstall", "src") To = os.path.join(To, "bin/config") CreateDirectory(To) for a in [Target + "*", "*.common"]: for File in glob.glob(os.path.join(a, "config-no-install", a)): if os.path.isfile(File): #print(File + " => " + To + "\n") CopyFile(File, To) open(os.path.join(To, "cm3.cfg"), "w").write("INSTALL_ROOT = (path() & SL & \"..\")\ninclude(path() & \"/config/" + Config + "\")\n") return True | 3b0586008beb14fad734e30d2ce6078e77fa5efb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9328/3b0586008beb14fad734e30d2ce6078e77fa5efb/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5631,
809,
1290,
9003,
12,
774,
4672,
468,
468,
1021,
16859,
3330,
353,
16745,
471,
5774,
1338,
1245,
468,
578,
279,
5264,
1300,
434,
5774,
261,
73,
18,
75,
18,
20064,
23,
5292,
14,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5631,
809,
1290,
9003,
12,
774,
4672,
468,
468,
1021,
16859,
3330,
353,
16745,
471,
5774,
1338,
1245,
468,
578,
279,
5264,
1300,
434,
5774,
261,
73,
18,
75,
18,
20064,
23,
5292,
14,
29... |
def get_contents_to_filename(self, filename, headers=None): fp = open(filename, 'wb') self.get_contents_to_file(fp, headers) fp.close() | def get_contents_to_filename(self, filename, headers=None): fp = open(filename, 'wb') self.get_contents_to_file(fp, headers) fp.close() | 1f4a2dc574098ffd7e911994c94e3b14e9ae7ff1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1098/1f4a2dc574098ffd7e911994c94e3b14e9ae7ff1/key.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3980,
67,
869,
67,
3459,
12,
2890,
16,
1544,
16,
1607,
33,
7036,
4672,
4253,
273,
1696,
12,
3459,
16,
296,
9464,
6134,
365,
18,
588,
67,
3980,
67,
869,
67,
768,
12,
7944,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
3980,
67,
869,
67,
3459,
12,
2890,
16,
1544,
16,
1607,
33,
7036,
4672,
4253,
273,
1696,
12,
3459,
16,
296,
9464,
6134,
365,
18,
588,
67,
3980,
67,
869,
67,
768,
12,
7944,
... | |
v1=Vector(0,0,1) v2=Vector(0,0,0) v3=Vector(1,0,0) | v1=Vector(0.5,0.5,1.3) v2=Vector(0.1,0.1,0.1) v3=Vector(1.9,0.8,0.6) | def right_multiply(self, matrix): "Return Vector=Vector x Matrix" x,y,z=matrixmultiply(self._ar, matrix) return Vector(x,y,z) | 1361533b7b7846e8edc2806567abeb60f5403418 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/1361533b7b7846e8edc2806567abeb60f5403418/Vector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2145,
67,
7027,
1283,
12,
2890,
16,
3148,
4672,
315,
990,
5589,
33,
5018,
619,
7298,
6,
619,
16,
93,
16,
94,
33,
5667,
7027,
1283,
12,
2890,
6315,
297,
16,
3148,
13,
327,
5589,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2145,
67,
7027,
1283,
12,
2890,
16,
3148,
4672,
315,
990,
5589,
33,
5018,
619,
7298,
6,
619,
16,
93,
16,
94,
33,
5667,
7027,
1283,
12,
2890,
6315,
297,
16,
3148,
13,
327,
5589,
12,
... |
None, [cty.POINTER(FL_OBJECT), STRING], | None, [cty.POINTER(FL_OBJECT), STRING], | def fl_delete_folder_bynumber(ob, num): """ fl_delete_folder_bynumber(ob, num) """ _fl_delete_folder_bynumber(ob, num) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
3733,
67,
5609,
67,
70,
878,
1226,
12,
947,
16,
818,
4672,
3536,
1183,
67,
3733,
67,
5609,
67,
70,
878,
1226,
12,
947,
16,
818,
13,
3536,
225,
389,
2242,
67,
3733,
67,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
3733,
67,
5609,
67,
70,
878,
1226,
12,
947,
16,
818,
4672,
3536,
1183,
67,
3733,
67,
5609,
67,
70,
878,
1226,
12,
947,
16,
818,
13,
3536,
225,
389,
2242,
67,
3733,
67,
56... |
tp = TextParser9(inputfilename,outputfilename); | tp = TextParser7(inputfilename,outputfilename); | def Parse(self): infile = file(inputfilename, 'r') outLines = [] for line in infile.readlines(): patt = re.compile("^([A-Z0-9a-z()=/:%. -]+),([0-9A-F]+),([A-Za-z0-9. -]+),([0-9A-F][0-9A-F]),([A-Z][A-Z]),([1-9N-]+)$") patt1 = re.compile("^[^,]+,([0-9A-F]+),.*$") m = patt.match(line) m1 = patt1.match(line) if m: # <entry group="0001" element="0001" vr="LO" vm="1" owner="Private Creator"/> dicom = "<entry group=\"%s\" element=\"%s\" vr=\"%s\" vm=\"%s\" owner=\"%s\" >"%(m.group(2),m.group(4),m.group(5),m.group(6),m.group(3)) #print dicom dicom += '\n' dicom += "<description>%s</description>\n</entry>\n"%(m.group(1).rstrip()) outLines.append( dicom ) else: #print line n = eval( '0x' + m1.group(1) ) #print m1.group(1) if( not (n % 2 == 0) ): print n print line #print self.Reformat(line) #outLines.append( self.Reformat(line) + '\n' ) outfile = file(outputfilename, 'w') outfile.writelines( outLines ) outfile.close() | 0bf182bda5e1c2c826e7d85cda3c069055f17548 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13995/0bf182bda5e1c2c826e7d85cda3c069055f17548/txt2xml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
12,
2890,
4672,
14568,
273,
585,
12,
2630,
3459,
16,
296,
86,
6134,
596,
5763,
273,
5378,
364,
980,
316,
14568,
18,
896,
3548,
13332,
28560,
273,
283,
18,
11100,
2932,
66,
3816,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
12,
2890,
4672,
14568,
273,
585,
12,
2630,
3459,
16,
296,
86,
6134,
596,
5763,
273,
5378,
364,
980,
316,
14568,
18,
896,
3548,
13332,
28560,
273,
283,
18,
11100,
2932,
66,
3816,
... |
select items.name as row1, d.bucket as col1, d.startdate as col2, d.enddate as col3, | select x.name as row1, x.bucket as col1, x.startdate as col2, x.enddate as col3, | def resultquery(basequery, bucket, startdate, enddate, offset=0, limit=None, sortsql='1 asc'): # Build the SQL filter basesql = basequery._get_sql_clause() | cdc3170f54826926ee38929502eb93f6afc6e6b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8604/cdc3170f54826926ee38929502eb93f6afc6e6b8/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
563,
2271,
12,
1969,
2271,
16,
2783,
16,
787,
712,
16,
679,
712,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1524,
4669,
2218,
21,
6972,
11,
4672,
468,
3998,
326,
3063,
1034,
8337,
121... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
563,
2271,
12,
1969,
2271,
16,
2783,
16,
787,
712,
16,
679,
712,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1524,
4669,
2218,
21,
6972,
11,
4672,
468,
3998,
326,
3063,
1034,
8337,
121... |
optlist, args = getopt.getopt(argv[1:], 'h', ['help']) | optlist, args = getopt.getopt(argv[1:], 'ho:', ['help', 'output-dir']) | def __init__(self, argv): self._argv = argv self._broken = False self._repository = None self._want_help = False self._error_message = None self._generate_all = True self._stats_to_generate = [] self._svn_binary = 'svn' self._outpur_dir = 'mpy-svn-stats' | 6b9b071b98917bc4ce6a2b46cff255e9e6def7cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2516/6b9b071b98917bc4ce6a2b46cff255e9e6def7cf/mpy-svn-stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5261,
4672,
365,
6315,
19485,
273,
5261,
365,
6315,
70,
19906,
273,
1083,
365,
6315,
9071,
273,
599,
365,
6315,
17369,
67,
5201,
273,
1083,
365,
6315,
1636... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5261,
4672,
365,
6315,
19485,
273,
5261,
365,
6315,
70,
19906,
273,
1083,
365,
6315,
9071,
273,
599,
365,
6315,
17369,
67,
5201,
273,
1083,
365,
6315,
1636... |
yield Partition_class(list(p[:-1]) + [p[-1] + 1]) yield Partition_class(p + [1]) | yield p[:-1] + [p[-1] + 1] yield p + [1] | def iterator(self): """ An iterator a list of the partitions of n. | 11ebf77aac87afdd37db81b40563f856ff2c2da9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/11ebf77aac87afdd37db81b40563f856ff2c2da9/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2775,
12,
2890,
4672,
3536,
1922,
2775,
279,
666,
434,
326,
10060,
434,
290,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2775,
12,
2890,
4672,
3536,
1922,
2775,
279,
666,
434,
326,
10060,
434,
290,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.__options.keys() or self.__short_options.keys() or self.arguments: | if self.__options.keys() or self.__short_options.keys() or self.__arguments: | def write_sub_file(self): """ Write a submit file for this Condor job. """ if not self.__log_file: raise CondorSubmitError, "Log file not specified." if not self.__err_file: raise CondorSubmitError, "Error file not specified." if not self.__out_file: raise CondorSubmitError, "Output file not specified." if not self.__sub_file_path: raise CondorSubmitError, 'No path for submit file.' try: subfile = open(self.__sub_file_path, 'w') except: raise CondorSubmitError, "Cannot open file " + self.__sub_file_path | dd5d58a2066bc8b3a2147871b925d5775f0b657e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/dd5d58a2066bc8b3a2147871b925d5775f0b657e/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1717,
67,
768,
12,
2890,
4672,
3536,
2598,
279,
4879,
585,
364,
333,
735,
72,
280,
1719,
18,
3536,
309,
486,
365,
16186,
1330,
67,
768,
30,
1002,
735,
72,
280,
11620,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1717,
67,
768,
12,
2890,
4672,
3536,
2598,
279,
4879,
585,
364,
333,
735,
72,
280,
1719,
18,
3536,
309,
486,
365,
16186,
1330,
67,
768,
30,
1002,
735,
72,
280,
11620,
668,
... |
__traceback_info__ = bound_names, args, kw, self.func_defaults | new_globals = f.func_globals.copy() new_globals['__traceback_supplement__'] = ( FSPythonScriptTracebackSupplement, self) | def _exec(self, bound_names, args, kw): """Call a Python Script | 436015ee93d40fa39a5fdf742275a50bf0876a6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/436015ee93d40fa39a5fdf742275a50bf0876a6f/FSPythonScript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4177,
12,
2890,
16,
2489,
67,
1973,
16,
833,
16,
5323,
4672,
3536,
1477,
279,
6600,
7739,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4177,
12,
2890,
16,
2489,
67,
1973,
16,
833,
16,
5323,
4672,
3536,
1477,
279,
6600,
7739,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""Assert that the given messages match the logged messages. | """Assert the current array of log messages, and clear its contents. | def assertMessages(self, messages): """Assert that the given messages match the logged messages. | d8c1c1336a756a7132d5b6f944aab071a74505ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/d8c1c1336a756a7132d5b6f944aab071a74505ba/logtesting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
5058,
12,
2890,
16,
2743,
4672,
3536,
8213,
716,
326,
864,
2743,
845,
326,
7545,
2743,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
5058,
12,
2890,
16,
2743,
4672,
3536,
8213,
716,
326,
864,
2743,
845,
326,
7545,
2743,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
banner = 'jbo 0.1\nDatabase instances: entries, tokens, classes' | banner = 'jbo 0.1\nDatabase instances: entries, tokens, classes, affixes' | def shell(): """Interactive shell with databases loaded.""" import code banner = 'jbo 0.1\nDatabase instances: entries, tokens, classes' with dbopenbuild('entries') as entries: with dbopen('tokens') as tokens: with dbopen('classes') as classes: context = dict(entries=entries, tokens=tokens, classes=classes) code.interact(banner, local=context) | 9e0587fba07937933c2d46e1e83aab97377f2c09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14853/9e0587fba07937933c2d46e1e83aab97377f2c09/jbo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5972,
13332,
3536,
26442,
5972,
598,
16358,
4203,
12123,
1930,
981,
14090,
273,
296,
78,
1075,
374,
18,
21,
64,
82,
4254,
3884,
30,
3222,
16,
2430,
16,
3318,
16,
10073,
904,
281,
11,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5972,
13332,
3536,
26442,
5972,
598,
16358,
4203,
12123,
1930,
981,
14090,
273,
296,
78,
1075,
374,
18,
21,
64,
82,
4254,
3884,
30,
3222,
16,
2430,
16,
3318,
16,
10073,
904,
281,
11,
5... |
if charAsInt > 0 and charAsInt <= 1114111: | if 0 < charAsInt and charAsInt <= 1114111 and not (55296 <= charAsInt and charAsInt <= 57343): | def consumeNumberEntity(self, isHex): """This function returns either U+FFFD or the character based on the decimal or hexadecimal representation. It also discards ";" if present. If not present self.tokenQueue.append({"type": "ParseError"}) is invoked. """ | 3b3d37440d70ae4e98b98ada10860ecb71ad4bd2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10463/3b3d37440d70ae4e98b98ada10860ecb71ad4bd2/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
1854,
1943,
12,
2890,
16,
353,
7037,
4672,
3536,
2503,
445,
1135,
3344,
587,
15,
2246,
16894,
578,
326,
3351,
2511,
603,
326,
6970,
578,
20070,
4335,
18,
2597,
2546,
10388,
87,
114... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
1854,
1943,
12,
2890,
16,
353,
7037,
4672,
3536,
2503,
445,
1135,
3344,
587,
15,
2246,
16894,
578,
326,
3351,
2511,
603,
326,
6970,
578,
20070,
4335,
18,
2597,
2546,
10388,
87,
114... |
``group`` - (integer): the congruence subgroup. ``weight`` - (integer): the weight. | - ``group`` - (integer): the congruence subgroup. - ``weight`` - (integer): the weight. | def __repr__(self): """ Return the string representation of this ManinSymbbol list. | f24ed23ca578b7754f3c6e09286c906b75c8f52b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f24ed23ca578b7754f3c6e09286c906b75c8f52b/manin_symbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
3536,
2000,
326,
533,
4335,
434,
333,
8660,
267,
10876,
1627,
31697,
666,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
12715,
972,
12,
2890,
4672,
3536,
2000,
326,
533,
4335,
434,
333,
8660,
267,
10876,
1627,
31697,
666,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
minLeadZeroCount = 0 leadZeroCounts = [] | def main(): global VERBOSE_OUTPUT_ENABLED # seedq holds addresses of machines containing the file # Each element is a tuple of the form ([user@]host, file) seedq = Queue.Queue() # targetq holds addresses of machines that need the file # Each element is a tuple of the form ([user@]host, filedest) targetq = TargetQueue() # list of sub process PID's pidList = [] # set logging to default logging_enabled = LOGGING_ENABLED # You can use -u to specify a username username = None # script usage usage = USAGE % sys.argv[0] try: optlist, args = getopt.gnu_getopt(sys.argv[1:], "u:f:r:l:sv") except: print "ERROR: ", sys.exc_info()[1] sys.exit(1) if len(args) < 2: print "ERROR: Must specify a file and a file destination" print usage sys.exit(1) # get name of file to transfer try: filename = args[0] filepath = os.path.realpath(filename) filedest = args[1] #if filedest[0] != '/': # print "Specify a full path for filedest" # sys.exit(1) except: print usage sys.exit(1) if not os.path.isfile(filepath): print "ERROR: '%s' not found" % filepath sys.exit(1) # 3 ways to populate the targetq targetList = [] # temporarily holds target hosts for opt, arg in optlist: if opt == '-f': # file # read '\n' separated hosts from file try: FILE = open(arg, "r") except: print "ERROR: Failed to open hosts file:", arg sys.exit(0) for host in FILE.readlines(): targetList.append((host.split("\n")[0].strip(), filedest)) FILE.close() elif opt == '-r': # range. modify to work with letters and not just ints try: # format: -r <base_hostname><[0-1,3-3,5-11...]> # eg. -r host[1-2,4-6] generates host1, host2, host4, host5, host6 basehost = arg.split("[")[0] # get 3 part ranges eg: ["1-3","5-5"] ranges = arg.split("[")[1].strip("[]").split(",") minLeadZeroCount = 0 leadZeroCounts = [] splitRanges = [] for rng in ranges: first = rng.split("-")[0] last = rng.split("-")[1] splitRanges.append((first, last)) leadZeroCounts.append(len(re.search("0*(?=.*)", first).group(0))) leadZeroCounts.append(len(re.search("0*(?=.*)", last).group(0))) if leadZeroCounts: minLeadZeroCount = min(leadZeroCounts) basehost = basehost + "0" * minLeadZeroCount for first, last in splitRanges: first = first[minLeadZeroCount:] last = last[minLeadZeroCount:] for first, last in splitRanges: for num in range(int(first), int(last)+1): host = basehost + str(num) targetList.append((host, filedest)) except: print "ERROR: Invalid argument for -r:", arg sys.exit(1) elif opt == '-l': # list # quote multiple hosts # read list of hosts from stdin hostlist = arg.split() for host in hostlist: targetList.append((host.strip(), filedest)) elif opt == '-u': # username username = arg elif opt == '-s': # log transfer statistics logging_enabled = True elif opt == '-v': # verbose output VERBOSE_OUTPUT_ENABLED = True # remove duplicate targets and add them to targetq targetList = set(targetList) for target in targetList: if username: # add username to scp call target = (username + '@' + target[0], target[1]) targetq.put(target) # ensure there are target hosts in the queue if targetq.qsize() < 1: print "There are no targets in the queue" print usage sys.exit(1) # ready to start the transfers print "transferring %s to %d host(s)..." % (filename, targetq.qsize()) start_time = time.time() # see TimeQueue definition above for more info timeq = TimeQueue(start_time) # used to tell threads to exit haltFlag = threading.Event() try: # returns when all transfers are complete or exception startTransfers(seedq, targetq, timeq, filepath, filedest, username,\ pidList, haltFlag) except KeyboardInterrupt: # catches ctrl-c haltFlag.set() # tell threads to exit print "Caught ctrl-c. Exiting" pids = [pid for pid in pidList] # make a deep copy for pid in pids: # I don't know about this one... try: ret = call("kill -9 %d" % pid, shell=True, stdin=PIPE,\ stdout=PIPE, stderr=PIPE) except: print sys.exc_info()[1] continue os._exit(2) # transfers are complete, print out the stats elapsed_time = time.time() - start_time file_size = os.path.getsize(filepath) / (10**6) # file size in MB files_received = seedq.qsize() - 1 # -1 for first seed stats = "\nreceived by: %d hosts\nfile_size: %dMB\ \nelapsed time: %.2fs" % (files_received, file_size, elapsed_time) print stats # create log file # use -s switch to turn on or off if logging_enabled: header = time.ctime() + "\n" if not os.path.exists(LOG_FILE): header = "Columns: [Elapsed Time(s)] [Active Seeds] " +\ "[Files Transferred]\n\n" + header logfile = open(LOG_FILE, "a") logfile.write(header) while timeq.qsize() > 0: string = timeq.get() logfile.write(string+"\n") logfile.write("\n\n") logfile.close() | 831790812a3211288da3aab1b4dd59ac30700abd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1259/831790812a3211288da3aab1b4dd59ac30700abd/scpWave.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
27857,
67,
15527,
67,
13560,
468,
5009,
85,
14798,
6138,
434,
15942,
4191,
326,
585,
468,
8315,
930,
353,
279,
3193,
434,
326,
646,
23265,
1355,
36,
65,
2564,
16,
585,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
27857,
67,
15527,
67,
13560,
468,
5009,
85,
14798,
6138,
434,
15942,
4191,
326,
585,
468,
8315,
930,
353,
279,
3193,
434,
326,
646,
23265,
1355,
36,
65,
2564,
16,
585,... | |
Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED | if (ValueStartPtr - len(DEFINE_STR + Name)) <= 0: Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED else: Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED | def CreateHFileContent(BaseName, UniObjectClass): Str = '' ValueStartPtr = 60 Line = COMMENT_DEFINE_STR + ' ' + LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(0, 4) + COMMENT_NOT_REFERENCED Str = WriteLine(Str, Line) Line = COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED Str = WriteLine(Str, Line) for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])): StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index] Name = StringItem.StringName Token = StringItem.Token Referenced = StringItem.Referenced if Name != None: Line = '' if Referenced == True: Line = DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) else: Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED Str = WriteLine(Str, Line) Str = WriteLine(Str, '') Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strings[];') return Str | 614e21f3bcc0f7b4e0780d7c976646c5c8a34925 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/914/614e21f3bcc0f7b4e0780d7c976646c5c8a34925/StrGather.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
44,
25391,
12,
29907,
16,
1351,
77,
921,
797,
4672,
3978,
273,
875,
1445,
1685,
5263,
273,
4752,
5377,
273,
19400,
67,
12904,
3740,
67,
3902,
397,
296,
296,
397,
24748,
67,
1985,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
44,
25391,
12,
29907,
16,
1351,
77,
921,
797,
4672,
3978,
273,
875,
1445,
1685,
5263,
273,
4752,
5377,
273,
19400,
67,
12904,
3740,
67,
3902,
397,
296,
296,
397,
24748,
67,
1985,
... |
self._request.script_root, | self._request.url_root, | def mailAccountData(self, cleartext_passwd=None): """ Mail a user who forgot his password a message enabling him to login again. """ from MoinMoin.mail import sendmail from MoinMoin.wikiutil import getLocalizedPage _ = self._request.getText | d8318f825990ad571d2bfd8bb37101f725c6ae08 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/d8318f825990ad571d2bfd8bb37101f725c6ae08/user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4791,
3032,
751,
12,
2890,
16,
1619,
485,
408,
67,
24002,
33,
7036,
4672,
3536,
11542,
279,
729,
10354,
364,
13212,
18423,
2201,
279,
883,
570,
17912,
366,
381,
358,
3925,
3382,
18,
3536... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4791,
3032,
751,
12,
2890,
16,
1619,
485,
408,
67,
24002,
33,
7036,
4672,
3536,
11542,
279,
729,
10354,
364,
13212,
18423,
2201,
279,
883,
570,
17912,
366,
381,
358,
3925,
3382,
18,
3536... |
_introspecting[oid] = module_doc | def introspect_module(module): """ Add API documentation information about the module C{module} to C{module_doc}. """ oid = id(module) if oid in _introspecting: return _introspecting[oid] # Create the ModuleDoc module_doc = ModuleDoc(pyval=module, repr=value_repr(module), canonical_name = get_canonical_name(module)) _introspecting[oid] = module_doc # Record the module's docstring & docformat. if hasattr(module, '__doc__'): module_doc.docstring = get_docstring(module) if hasattr(module, '__docformat__'): module_doc.docformat = unicode(module.__docformat__) # Record the module's __all__ attribute (public names). if hasattr(module, '__all__'): try: public_names = Set([str(name) for name in module.__all__]) for name, var_doc in module_doc.variables.items(): if name in public_names: var_doc.is_public = True if not isinstance(var_doc, ModuleDoc): var_doc.is_imported = False else: var_doc.is_public = False except: pass # Record the module's filename if hasattr(module, '__file__'): try: module_doc.filename = unicode(module.__file__) except: pass # If the module has a __path__, then it's (probably) a # package; so set is_package=True and record its __path__. if hasattr(module, '__path__'): module_doc.is_package = True try: module_doc.path = [unicode(p) for p in module.__path__] except: pass else: module_doc.is_package = False # Make sure we have a name for the package. dotted_name = module_doc.canonical_name if dotted_name is UNKNOWN: dotted_name = DottedName(module.__name__) # Record the module's parent package, if it has one. if len(dotted_name) > 1: package_name = str(dotted_name.container()) package = sys.modules.get(package_name) if package is not None: module_doc.package = introspect_docs(package) else: module_doc.package = None # Initialize the submodules property module_doc.submodules = [] # Add the module to its parent package's submodules list. if module_doc.package not in (None, UNKNOWN): module_doc.package.submodules.append(module_doc) # Record the module's variables. module_doc.variables = {} for child_name in dir(module): if child_name in UNDOCUMENTED_MODULE_VARS: continue child = getattr(module, child_name) # Create a VariableDoc for the child, and introspect its # value if it's defined in this module. container = get_containing_module(child) if container != None and container == module_doc.canonical_name: # Local variable. child_val_doc = introspect_docs(child, context=module_doc) child_var_doc = VariableDoc(name=child_name, value=child_val_doc, is_imported=False, container=module_doc) elif container is None or module_doc.canonical_name is UNKNOWN: # Possibly imported variable. child_val_doc = introspect_docs(child, context=module_doc) child_var_doc = VariableDoc(name=child_name, value=child_val_doc, container=module_doc) else: # Imported variable. child_val_doc = _get_valuedoc(child) child_var_doc = VariableDoc(name=child_name, value=child_val_doc, is_imported=True, container=module_doc) module_doc.variables[child_name] = child_var_doc return module_doc | 08a8d419de217e1cbe66629e4e7451c337e7c3a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/08a8d419de217e1cbe66629e4e7451c337e7c3a9/docintrospecter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30165,
67,
2978,
12,
2978,
4672,
3536,
1436,
1491,
7323,
1779,
2973,
326,
1605,
385,
95,
2978,
97,
358,
385,
95,
2978,
67,
2434,
5496,
3536,
7764,
273,
612,
12,
2978,
13,
309,
7764,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30165,
67,
2978,
12,
2978,
4672,
3536,
1436,
1491,
7323,
1779,
2973,
326,
1605,
385,
95,
2978,
97,
358,
385,
95,
2978,
67,
2434,
5496,
3536,
7764,
273,
612,
12,
2978,
13,
309,
7764,
31... | |
<screen name="IPKGMenu" position="center,center" size="560,400" title="Select upgrade source to edit." > <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" /> <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor=" <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor=" <widget name="filelist" position="5,50" size="550,340" scrollbarMode="showOnDemand" /> </screen>""" def __init__(self, session, plugin_path): Screen.__init__(self, session) self.skin_path = plugin_path self["key_red"] = StaticText(_("Close")) self["key_green"] = StaticText(_("Edit")) self.sel = [] self.val = [] self.entry = False self.exe = False self.path = "" self["actions"] = NumberActionMap(["SetupActions"], { "ok": self.KeyOk, "cancel": self.keyCancel }, -1) self["shortcuts"] = ActionMap(["ShortcutActions"], { "red": self.keyCancel, "green": self.KeyOk, }) self.flist = [] self["filelist"] = MenuList(self.flist) self.fill_list() self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setWindowTitle() def setWindowTitle(self): self.setTitle(_("Select upgrade source to edit.")) def fill_list(self): self.flist = [] self.path = '/etc/ipkg/' if (os_path.exists(self.path) == False): self.entry = False return for file in listdir(self.path): if (file.endswith(".conf")): if file != 'arch.conf': self.flist.append((file)) self.entry = True self["filelist"].l.setList(self.flist) def KeyOk(self): if (self.exe == False) and (self.entry == True): self.sel = self["filelist"].getCurrent() self.val = self.path + self.sel self.session.open(IPKGSource, self.val) def keyCancel(self): self.close() def Exit(self): self.close() class IPKGSource(Screen): skin = """ <screen name="IPKGSource" position="center,center" size="560,80" title="Edit upgrade source url." > <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" /> <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor=" <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor=" <widget name="text" position="5,50" size="550,25" font="Regular;20" backgroundColor="background" foregroundColor=" </screen>""" def __init__(self, session, configfile = None): Screen.__init__(self, session) self.session = session self.configfile = configfile text = "" if self.configfile: try: fp = file(configfile, 'r') sources = fp.readlines() if sources: text = sources[0] fp.close() except IOError: pass desk = getDesktop(0) x= int(desk.size().width()) y= int(desk.size().height()) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Save")) if (y>=720): self["text"] = Input(text, maxSize=False, type=Input.TEXT) else: self["text"] = Input(text, maxSize=False, visible_width = 55, type=Input.TEXT) self["actions"] = NumberActionMap(["WizardActions", "InputActions", "TextEntryActions", "KeyboardInputActions","ShortcutActions"], { "ok": self.go, "back": self.close, "red": self.close, "green": self.go, "left": self.keyLeft, "right": self.keyRight, "home": self.keyHome, "end": self.keyEnd, "deleteForward": self.keyDeleteForward, "deleteBackward": self.keyDeleteBackward, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal }, -1) self.onLayoutFinish.append(self.layoutFinished) def layoutFinished(self): self.setWindowTitle() self["text"].right() def setWindowTitle(self): self.setTitle(_("Edit upgrade source url.")) def go(self): text = self["text"].getText() if text: fp = file(self.configfile, 'w') fp.write(text) fp.write("\n") fp.close() self.close() def keyLeft(self): self["text"].left() def keyRight(self): self["text"].right() def keyHome(self): self["text"].home() def keyEnd(self): self["text"].end() def keyDeleteForward(self): self["text"].delete() def keyDeleteBackward(self): self["text"].deleteBackward() def keyNumberGlobal(self, number): self["text"].number(number) class PacketManager(Screen): skin = """ <screen name="PacketManager" position="center,center" size="530,420" title="Packet manager" > <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" /> <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor=" <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor=" <widget source="list" render="Listbox" position="5,50" size="520,365" scrollbarMode="showOnDemand"> <convert type="TemplatedMultiContent"> {"template": [ MultiContentEntryText(pos = (5, 1), size = (440, 28), font=0, flags = RT_HALIGN_LEFT, text = 0), MultiContentEntryText(pos = (5, 26), size = (440, 20), font=1, flags = RT_HALIGN_LEFT, text = 2), MultiContentEntryPixmapAlphaTest(pos = (445, 2), size = (48, 48), png = 4), MultiContentEntryPixmapAlphaTest(pos = (5, 50), size = (510, 2), png = 5), ], "fonts": [gFont("Regular", 22),gFont("Regular", 14)], "itemHeight": 52 } </convert> </widget> </screen>""" def __init__(self, session, plugin_path, args = None): Screen.__init__(self, session) self.session = session self.skin_path = plugin_path self["shortcuts"] = ActionMap(["ShortcutActions", "WizardActions"], { "ok": self.go, "back": self.exit, "red": self.exit, "green": self.reload, }, -1) self.list = [] self.statuslist = [] self["list"] = List(self.list) self["key_red"] = StaticText(_("Close")) self["key_green"] = StaticText(_("Reload")) self.list_updating = True self.packetlist = [] self.installed_packetlist = {} self.Console = Console() self.cmdList = [] self.cachelist = [] self.cache_ttl = 86400 self.cache_file = '/usr/lib/enigma2/python/Plugins/SystemPlugins/SoftwareManager/packetmanager.cache' self.oktext = _("\nAfter pressing OK, please wait!") self.unwanted_extensions = ('-dbg', '-dev', '-doc', 'busybox') self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback) self.onShown.append(self.setWindowTitle) self.onLayoutFinish.append(self.rebuildList) def exit(self): self.ipkg.stop() if self.Console is not None: if len(self.Console.appContainers): for name in self.Console.appContainers.keys(): self.Console.kill(name) self.close() def reload(self): if (os_path.exists(self.cache_file) == True): remove(self.cache_file) self.list_updating = True self.rebuildList() def setWindowTitle(self): self.setTitle(_("Packet manager")) def setStatus(self,status = None): if status: self.statuslist = [] divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) if status == 'update': statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png")) self.statuslist.append(( _("Package list update"), '', _("Trying to download a new packetlist. Please wait..." ),'',statuspng, divpng )) self['list'].setList(self.statuslist) elif status == 'error': statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/remove.png")) self.statuslist.append(( _("Error"), '', _("There was an error downloading the packetlist. Please try again." ),'',statuspng, divpng )) self['list'].setList(self.statuslist) def rebuildList(self): self.setStatus('update') self.inv_cache = 0 self.vc = valid_cache(self.cache_file, self.cache_ttl) if self.cache_ttl > 0 and self.vc != 0: try: self.buildPacketList() except: self.inv_cache = 1 if self.cache_ttl == 0 or self.inv_cache == 1 or self.vc == 0: self.run = 0 self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) def go(self, returnValue = None): cur = self["list"].getCurrent() if cur: status = cur[3] package = cur[0] self.cmdList = [] if status == 'installed': self.cmdList.append((IpkgComponent.CMD_REMOVE, { "package": package })) if len(self.cmdList): self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + package + "\n" + self.oktext) elif status == 'upgradeable': self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package })) if len(self.cmdList): self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to upgrade the package:\n") + package + "\n" + self.oktext) elif status == "installable": self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package })) if len(self.cmdList): self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + package + "\n" + self.oktext) def runRemove(self, result): if result: self.session.openWithCallback(self.runRemoveFinished, Ipkg, cmdList = self.cmdList) def runRemoveFinished(self): self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) def RemoveReboot(self, result): if result is None: return if result is False: cur = self["list"].getCurrent() if cur: item = self['list'].getIndex() self.list[item] = self.buildEntryComponent(cur[0], cur[1], cur[2], 'installable') self.cachelist[item] = [cur[0], cur[1], cur[2], 'installable'] self['list'].setList(self.list) write_cache(self.cache_file, self.cachelist) self.reloadPluginlist() if result: quitMainloop(3) def runUpgrade(self, result): if result: self.session.openWithCallback(self.runUpgradeFinished, Ipkg, cmdList = self.cmdList) def runUpgradeFinished(self): self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) def UpgradeReboot(self, result): if result is None: return if result is False: cur = self["list"].getCurrent() if cur: item = self['list'].getIndex() self.list[item] = self.buildEntryComponent(cur[0], cur[1], cur[2], 'installed') self.cachelist[item] = [cur[0], cur[1], cur[2], 'installed'] self['list'].setList(self.list) write_cache(self.cache_file, self.cachelist) self.reloadPluginlist() if result: quitMainloop(3) def ipkgCallback(self, event, param): if event == IpkgComponent.EVENT_ERROR: self.list_updating = False self.setStatus('error') elif event == IpkgComponent.EVENT_DONE: if self.list_updating: self.list_updating = False if not self.Console: self.Console = Console() cmd = "ipkg list" self.Console.ePopen(cmd, self.IpkgList_Finished) pass def IpkgList_Finished(self, result, retval, extra_args = None): if len(result): self.packetlist = [] for x in result.splitlines(): split = x.split(' - ') if not any(split[0].strip().endswith(x) for x in self.unwanted_extensions): self.packetlist.append([split[0].strip(), split[1].strip(),split[2].strip()]) if not self.Console: self.Console = Console() cmd = "ipkg list_installed" self.Console.ePopen(cmd, self.IpkgListInstalled_Finished) def IpkgListInstalled_Finished(self, result, retval, extra_args = None): if len(result): self.installed_packetlist = {} for x in result.splitlines(): split = x.split(' - ') if not any(split[0].strip().endswith(x) for x in self.unwanted_extensions): self.installed_packetlist[split[0].strip()] = split[1].strip() self.buildPacketList() def buildEntryComponent(self, name, version, description, state): divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) if state == 'installed': installedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installed.png")) return((name, version, description, state, installedpng, divpng)) elif state == 'upgradeable': upgradeablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgradeable.png")) return((name, version, description, state, upgradeablepng, divpng)) else: installablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installable.png")) return((name, version, description, state, installablepng, divpng)) def buildPacketList(self): self.list = [] self.cachelist = [] if self.cache_ttl > 0 and self.vc != 0: print 'Loading packagelist cache from ',self.cache_file try: self.cachelist = load_cache(self.cache_file) if len(self.cachelist) > 0: for x in self.cachelist: self.list.append(self.buildEntryComponent(x[0], x[1], x[2], x[3])) self['list'].setList(self.list) except: self.inv_cache = 1 if self.cache_ttl == 0 or self.inv_cache == 1 or self.vc == 0: print 'rebuilding fresh package list' for x in self.packetlist: status = "" if self.installed_packetlist.has_key(x[0].strip()): if self.installed_packetlist[x[0].strip()] == x[1].strip(): status = "installed" self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) else: status = "upgradeable" self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) else: status = "installable" self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) if not any(x[0].strip().endswith(x) for x in self.unwanted_extensions): self.cachelist.append([x[0].strip(), x[1].strip(), x[2].strip(), status]) write_cache(self.cache_file, self.cachelist) self['list'].setList(self.list) def reloadPluginlist(self): plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) class PluginManager(Screen, DreamInfoHandler): lastDownloadDate = None skin = """ <screen name="PluginManager" position="center,center" size="560,440" title="Plugin manager" > | <screen name="PluginManager" position="center,center" size="560,440" title="Extensions management" > | def startRestore(self, ret = False): if (ret == True): self.exe = True self.session.open(RestoreScreen, runRestore = True) | 018534fa7bf9be0885b2ffc753d8d6fc5b56143c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/018534fa7bf9be0885b2ffc753d8d6fc5b56143c/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
10874,
12,
2890,
16,
325,
273,
1083,
4672,
309,
261,
1349,
422,
1053,
4672,
365,
18,
14880,
273,
1053,
365,
18,
3184,
18,
3190,
12,
10874,
7956,
16,
1086,
10874,
273,
1053,
13,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
10874,
12,
2890,
16,
325,
273,
1083,
4672,
309,
261,
1349,
422,
1053,
4672,
365,
18,
14880,
273,
1053,
365,
18,
3184,
18,
3190,
12,
10874,
7956,
16,
1086,
10874,
273,
1053,
13,
2,... |
argv = sys.argv[:] if '-a' in argv: argv.remove('-a') if '--aggregate' in argv: argv.remove('--aggregate') f = os.popen(string.join(argv), 'r') | global MASTER_OPTS if '-a' in MASTER_OPTS: MASTER_OPTS.remove('-a') if '--aggregate' in MASTER_OPTS: MASTER_OPTS.remove('--aggregate') f = os.popen('%s %s' % (sys.argv[0], string.join(MASTER_OPTS)), 'r') | def run_with_aggregate(): '''pipe the synctool output through the aggregator''' argv = sys.argv[:] if '-a' in argv: argv.remove('-a') if '--aggregate' in argv: argv.remove('--aggregate') f = os.popen(string.join(argv), 'r') synctool_aggr.aggregate(f) f.close() | 4bc860481f67ff4a303cc6e193d0e6513b1e43b6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13401/4bc860481f67ff4a303cc6e193d0e6513b1e43b6/synctool_master.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
1918,
67,
18573,
13332,
9163,
14772,
326,
6194,
299,
1371,
876,
3059,
326,
20762,
26418,
225,
2552,
27312,
67,
15620,
55,
565,
309,
2400,
69,
11,
316,
27312,
67,
15620,
55,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
1918,
67,
18573,
13332,
9163,
14772,
326,
6194,
299,
1371,
876,
3059,
326,
20762,
26418,
225,
2552,
27312,
67,
15620,
55,
565,
309,
2400,
69,
11,
316,
27312,
67,
15620,
55,
30,... |
print _("Found:"), item_fullpath2, "[" + str(self.images_found) + "]" | print _("Found:"), item_fullpath2, "[" + str(self.images_found) + "]" | def expand_directory(self, item, stop_when_image_found, go_buttons_enabled): if self.stop_now == False and self.closing_app == False: folderlist = [] | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
5149,
12,
2890,
16,
761,
16,
2132,
67,
13723,
67,
2730,
67,
7015,
16,
1960,
67,
16016,
67,
5745,
4672,
309,
365,
18,
5681,
67,
3338,
422,
1083,
471,
365,
18,
19506,
67,
291... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
5149,
12,
2890,
16,
761,
16,
2132,
67,
13723,
67,
2730,
67,
7015,
16,
1960,
67,
16016,
67,
5745,
4672,
309,
365,
18,
5681,
67,
3338,
422,
1083,
471,
365,
18,
19506,
67,
291... |
status, v = db.get_tag_value_by_id (DADGAD_ID, 'testconvtag') | status, v = db.get_tag_value_by_id (self.dadgadID, 'testconvtag') | def testAddValuelessTag (self): # fails against sandbox db = self.db o = db.delete_abstract_tag ('testconvtag') o = db.create_abstract_tag ('testconvtag', "a conventional (valueless) tag") o = db.tag_object_by_id (DADGAD_ID, 'testconvtag') self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (DADGAD_ID, 'testconvtag') self.assertEqual (v, None) | a258ae866ad40d7092b84a6b1737df504976b56c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12637/a258ae866ad40d7092b84a6b1737df504976b56c/fdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
986,
58,
700,
12617,
1805,
261,
2890,
4672,
468,
6684,
5314,
15202,
1319,
273,
365,
18,
1966,
320,
273,
1319,
18,
3733,
67,
17801,
67,
2692,
7707,
3813,
4896,
2692,
6134,
320,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
986,
58,
700,
12617,
1805,
261,
2890,
4672,
468,
6684,
5314,
15202,
1319,
273,
365,
18,
1966,
320,
273,
1319,
18,
3733,
67,
17801,
67,
2692,
7707,
3813,
4896,
2692,
6134,
320,
273,... |
print "caught OSError [Errno %s]: %s: could not remove path %s" % (e.errno,e.strerror,e.filename) | print "could not remove path, caught OSError [Errno %s]: %s" % (e.errno,e.strerror) s = os.stat(testdir) from pprint import pformat print "os.stat(%s): %s" % (testdir, pformat(dict([(name, getattr(s, name)) for name in dir(s) if not name.startswith('__')]))) | def _setUpTestdir(): testdir = os.path.abspath("_trial_temp") if os.path.exists(testdir): try: shutil.rmtree(testdir) except OSError, e: print "caught OSError [Errno %s]: %s: could not remove path %s" % (e.errno,e.strerror,e.filename) try: os.rename(testdir, os.path.abspath("_trial_temp_old%s" % random.randint(0, 99999999))) except OSError, e: print "caught OSError [Errno %s]: %s: could not rename path %s" % (e.errno,e.strerror,e.filename) raise os.mkdir(testdir) os.chdir(testdir) | 788d8b77a7111e5277757ab5f5c6083d4805f860 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/788d8b77a7111e5277757ab5f5c6083d4805f860/trial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
1211,
4709,
1214,
13332,
1842,
1214,
273,
1140,
18,
803,
18,
5113,
803,
2932,
67,
17493,
67,
5814,
7923,
309,
1140,
18,
803,
18,
1808,
12,
3813,
1214,
4672,
775,
30,
11060,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
1211,
4709,
1214,
13332,
1842,
1214,
273,
1140,
18,
803,
18,
5113,
803,
2932,
67,
17493,
67,
5814,
7923,
309,
1140,
18,
803,
18,
1808,
12,
3813,
1214,
4672,
775,
30,
11060,
1... |
fields_names=fields_names, context=context) | fields_names=fields_names2, context=context) | def read(self, cursor, user, ids, fields_names=None, context=None): selection_obj = self.pool.get('analytic_account.account.selection') | 6f2ae78add653846b7a66d96a9984580301c14a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9277/6f2ae78add653846b7a66d96a9984580301c14a7/purchase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
1466,
67,
1973,
33,
7036,
16,
819,
33,
7036,
4672,
4421,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
304,
7834,
335,
67,
4631,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
1466,
67,
1973,
33,
7036,
16,
819,
33,
7036,
4672,
4421,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
304,
7834,
335,
67,
4631,
18,
... |
cmd += [ options.params ] | cmd += [options.params] | def runScriptPerfTests(options, testlist, largeData=False, repeat=1, logger=log): """ Run script performance tests. >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> runScriptPerfTests(options, ['foobar']) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar --create foobar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> runScriptPerfTests(options, ['foobar'], largeData=True) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar --restore=test_profile/__repository__.001 foobar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> options.profile = True >>> runScriptPerfTests(options, ['foobar.py']) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar.py --catsProfile=test_profile/foobar.hotshot --create foobar.py 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False """ failed = False l = len(options.chandlerHome) + 1 timeLog = os.path.join(options.profileDir, 'time.log') if repeat == 1: just = 20 elif repeat == 2: just = 13 else: just = 6 for item in testlist: #$CHANDLERBIN/release/$RUN_CHANDLER --create --catch=tests # --profileDir="$PC_DIR" # --catsPerfLog="$TIME_LOG" # --scriptFile="$TESTNAME" &> $TESTLOG if item.startswith(options.chandlerHome): item = item[l:] name = item[item.rfind('/') + 1:] cmd = [ options.runchandler['release'], '--catch=tests', '--profileDir=%s' % options.profileDir, '--parcelPath=%s' % options.parcelPath, '--catsPerfLog=%s' % timeLog, '--scriptFile=%s' % item ] if options.profile: cmd += ['--catsProfile=%s.hotshot' % os.path.join(options.profileDir, name[:-3])] if not largeData: cmd += ['--create'] else: cmd += ['--restore=%s' % os.path.join(options.profileDir, '__repository__.001')] if options.params: cmd += [ options.params ] if options.verbose: log(' '.join(cmd)) values = [] log(name.ljust(33), newline=' ') for _x in range(repeat): if not options.dryrun: if os.path.isfile(timeLog): os.remove(timeLog) if options.dryrun: result = 0 else: tempLogger = DelayedLogger() result = build_lib.runCommand(cmd, timeout=1800, logger=tempLogger) if result != 0: if options.tbox: if result == -9: log("***Error: A timeout error has happened for %s" % name) log("***Error: The process output will be dumped below but it may be incomplete") log("***Error: due to the process either crashing or being killed.") # Strip OSAF_QA lines because we don't want to include # results from failed runs for args, kw in tempLogger.delayed: if not args[0].startswith('OSAF_QA: '): log(*args, **kw) else: tempLogger.logAll() log('***Error exit code=%d, %s' % (result, name)) failed = True failedTests.append(item) if not options.noStop: break else: if options.dryrun: value = 0.00 else: if os.path.isfile(timeLog): value = float(open(timeLog).readline()[:-1]) else: log('\ntimeLog [%s] not found' % timeLog) failed = True failedTests.append(item) if not options.noStop: break log(('%02.2f' % value).rjust(just), newline=' ') if not options.dryrun: values.append((value, tempLogger)) else: values.append((value, None)) if options.dryrun: log('- + ' * 15) else: tempLogger('- + ' * 15) else: try: originalValues = values[:] values.sort() value = values[repeat/2] log(' | ', newline='') log(('%02.2f' % value[0]).rjust(6) , newline='') log(u' \u00B1 '.encode('utf8'), newline='') # Unicode PLUS-MINUS SIGN log(('%02.2f' % stddev([x for x, _y in values])).rjust(6)) if not options.dryrun: if options.tbox: for args, kw in value[1].delayed: logger(*args, **kw) else: for _n, tempLogger in originalValues: for args, kw in tempLogger.delayed: logger(*args, **kw) except IndexError: if not options.noStop: raise if failed and not options.noStop: break return failed | 134ce2a6ff32b988db479ade6fcf70a08aac23f5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/134ce2a6ff32b988db479ade6fcf70a08aac23f5/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3651,
22016,
14650,
12,
2116,
16,
1842,
1098,
16,
7876,
751,
33,
8381,
16,
7666,
33,
21,
16,
1194,
33,
1330,
4672,
3536,
1939,
2728,
9239,
7434,
18,
225,
4080,
702,
273,
1109,
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,
1086,
3651,
22016,
14650,
12,
2116,
16,
1842,
1098,
16,
7876,
751,
33,
8381,
16,
7666,
33,
21,
16,
1194,
33,
1330,
4672,
3536,
1939,
2728,
9239,
7434,
18,
225,
4080,
702,
273,
1109,
13... |
VARIABLE_MODIFIER = IDENTIFIER VARIABLE_DEFINITION = Optional(VARIABLE_MODIFIER) + Optional(STATIC) + Optional(CONST ^ VAR) + IDENTIFIER + Optional(TYPE) + Optional(MULTI_LINE_COMMENT) + (INIT ^ TERMINATOR) | VARIABLE_MODIFIER = Optional(STATIC) & Optional(IDENTIFIER) VARIABLE_DEFINITION = VARIABLE_MODIFIER + Optional(CONST ^ VAR) + IDENTIFIER + Optional(TYPE) + Optional(MULTI_LINE_COMMENT) + (INIT ^ TERMINATOR) | def locate(pattern, root=os.getcwd()): for path, dirs, files in os.walk(root): for filename in [os.path.abspath(os.path.join(path, filename)) for filename in files if fnmatch.fnmatch(filename, pattern)]: yield filename | 9e2da5c522d4417e89635884c8b4382192c0812c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/886/9e2da5c522d4417e89635884c8b4382192c0812c/asGrammar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10627,
12,
4951,
16,
1365,
33,
538,
18,
588,
11089,
1435,
4672,
364,
589,
16,
7717,
16,
1390,
316,
1140,
18,
11348,
12,
3085,
4672,
364,
1544,
316,
306,
538,
18,
803,
18,
5113,
803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10627,
12,
4951,
16,
1365,
33,
538,
18,
588,
11089,
1435,
4672,
364,
589,
16,
7717,
16,
1390,
316,
1140,
18,
11348,
12,
3085,
4672,
364,
1544,
316,
306,
538,
18,
803,
18,
5113,
803,
... |
ordering = ('label') | ordering = ('label',) | def __unicode__(self): return str(self.label) | ac2a11cac423968e5903ec3c602861a03abd7de2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1104/ac2a11cac423968e5903ec3c602861a03abd7de2/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
972,
12,
2890,
4672,
327,
609,
12,
2890,
18,
1925,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
972,
12,
2890,
4672,
327,
609,
12,
2890,
18,
1925,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if platform in ['cygwin', 'aix4']: | data = open('pyconfig.h').read() m = re.search(r" if m is not None: | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 19d173486b2263a269260343d65ac3929c89297e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19d173486b2263a269260343d65ac3929c89297e/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
self.fixBrokenPeers = True | self.fixBrokenPeers = fixBrokenPeers | def __init__(self, privateKey=None, certificate=None, method=None, verify=False, caCerts=None, verifyDepth=9, requireCertificate=True, verifyOnce=True, enableSingleUseKeys=True, enableSessions=True, fixBrokenPeers=True): """ Create an OpenSSL context SSL connection context factory. | c23ebb7c004652ff3bf068ce4c36ad02acfb0e06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8962/c23ebb7c004652ff3bf068ce4c36ad02acfb0e06/sslverify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11896,
33,
7036,
16,
4944,
33,
7036,
16,
707,
33,
7036,
16,
3929,
33,
8381,
16,
3474,
16273,
33,
7036,
16,
3929,
6148,
33,
29,
16,
2583,
4719,
33,
5510... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11896,
33,
7036,
16,
4944,
33,
7036,
16,
707,
33,
7036,
16,
3929,
33,
8381,
16,
3474,
16273,
33,
7036,
16,
3929,
6148,
33,
29,
16,
2583,
4719,
33,
5510... |
numPages = input1.getNumPages() for page in range(numPages): output.addPage(input1.getPage(page)) | numPages = input1.getNumPages() for page in range(numPages): output.addPage(input1.getPage(page)) | def __init__(self, inputDoc): from pyPdf import PdfFileWriter, PdfFileReader | 2a202aba6a65480f7f49fbf5e3e8c684ce7ba30a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/71/2a202aba6a65480f7f49fbf5e3e8c684ce7ba30a/bookfold.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
810,
1759,
4672,
628,
2395,
18562,
1930,
9989,
812,
2289,
16,
9989,
812,
2514,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
810,
1759,
4672,
628,
2395,
18562,
1930,
9989,
812,
2289,
16,
9989,
812,
2514,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def match(input_reader): | def match(self, input_reader): | def match(input_reader): """ Match the given rule in the string from the given position on. | 1a538dbbf019ceab4e4a535a8fb5d2caacba9021 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/847/1a538dbbf019ceab4e4a535a8fb5d2caacba9021/yeanpypa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
845,
12,
2890,
16,
810,
67,
10530,
4672,
3536,
4639,
326,
864,
1720,
316,
326,
533,
628,
326,
864,
1754,
603,
18,
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,
845,
12,
2890,
16,
810,
67,
10530,
4672,
3536,
4639,
326,
864,
1720,
316,
326,
533,
628,
326,
864,
1754,
603,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return media.drive_status = s media.set_id('') media.label = '' media.type = 'empty_cdrom' media.item = None media.videoitem = None media.cached = False | return False self.drive_status = s self.set_id('') self.label = '' self.type = 'empty_cdrom' self.item = None self.videoitem = None | def identify(self, media): """ magic! Try to find out as much as possible about the disc in the rom drive: title, image, play options, ... """ # Check drive status (tray pos, disc ready) try: CDSL_CURRENT = ( (int ) ( ~ 0 >> 1 ) ) fd = os.open(media.devicename, os.O_RDONLY | os.O_NONBLOCK) if os.uname()[0] == 'FreeBSD': try: data = array.array('c', '\000'*4096) (address, length) = data.buffer_info() buf = struct.pack('BBHP', CD_MSF_FORMAT, 0, length, address) # use unthreader ioctl here, it is fast s = util.ioctl.ioctl(fd, CDIOREADTOCENTRYS, buf) s = CDS_DISC_OK except: s = CDS_NO_DISC else: # use unthreader ioctl here, it is fast s = util.ioctl.ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) except: # maybe we need to close the fd if ioctl fails, maybe # open fails and there is no fd try: os.close(fd) except: pass media.drive_status = None return | 073a135df00509e35117ba8274a235acd11e762b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/073a135df00509e35117ba8274a235acd11e762b/rom_drives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9786,
12,
2890,
16,
3539,
4672,
3536,
8146,
5,
6161,
358,
1104,
596,
487,
9816,
487,
3323,
2973,
326,
19169,
316,
326,
24137,
14316,
30,
2077,
16,
1316,
16,
6599,
702,
16,
1372,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9786,
12,
2890,
16,
3539,
4672,
3536,
8146,
5,
6161,
358,
1104,
596,
487,
9816,
487,
3323,
2973,
326,
19169,
316,
326,
24137,
14316,
30,
2077,
16,
1316,
16,
6599,
702,
16,
1372,
3536,
... |
text += "<nobr>Unhandled exception of type <b>%s </b> occured at %d:%02d:%02d:</nobr><br><nobr>Traceback:</nobr><br>" % ( str(type) , t[3],t[4],t[5]) | text += "<hr><nobr>Unhandled exception of type <b>%s </b> occured at %d:%02d:%02d:</nobr><br><nobr>Traceback:</nobr><br>" % ( str(type) , t[3],t[4],t[5]) | def exceptionHandler(self, type, value, tracebackInfo): if self.focusOnCatchException: self.canvasDlg.menuItemShowOutputWindow() self.canvasDlg.workspace.cascade() # cascade shown windows | b2656ae570f7b3421360ebf79830008e8b88da06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/b2656ae570f7b3421360ebf79830008e8b88da06/orngOutput.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1520,
1503,
12,
2890,
16,
618,
16,
460,
16,
10820,
966,
4672,
309,
365,
18,
13923,
1398,
14842,
503,
30,
365,
18,
15424,
40,
23623,
18,
5414,
1180,
5706,
1447,
3829,
1435,
365,
18,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1520,
1503,
12,
2890,
16,
618,
16,
460,
16,
10820,
966,
4672,
309,
365,
18,
13923,
1398,
14842,
503,
30,
365,
18,
15424,
40,
23623,
18,
5414,
1180,
5706,
1447,
3829,
1435,
365,
18,
154... |
cmds.append('create unique index index_key on | cmds.append('create index index_key on | def rep_discrepency(): # # the set of representative clones where the final MGI ID is a RIKEN clone # and the final MGI ID != the record's RIKEN clone ID # global cmds cmds.append('select f1._Fantom2_key, f1.riken_cloneid, f1.final_mgiID, f1.riken_cluster, f1.seq_note ' + \ 'into #rep4 ' + \ 'from MGI_Fantom2 f1 ' + \ 'where f1.seq_note = "Representative" ' + \ 'and f1.final_mgiID not in ("zilch", "zzilch")') cmds.append('select * into #nondups4 from #rep4 group by final_mgiID having count(*) = 1') cmds.append('select * ' + \ 'into #rep_discr ' + \ 'from #nondups4 ' + \ 'where final_mgiID not like "MGI:%" ' + \ 'and riken_cloneid != final_mgiID') cmds.append('create unique index index_key on #rep_discr(_Fantom2_key)') # results[30] cmds.append('select * from #rep_discr order by final_mgiID') | 3859a6fe7c8ce4969be2d87260ff72e4850e244c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/340/3859a6fe7c8ce4969be2d87260ff72e4850e244c/fantom2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2071,
67,
2251,
1793,
84,
2075,
13332,
225,
468,
468,
326,
444,
434,
23174,
927,
5322,
1625,
326,
727,
490,
13797,
1599,
353,
279,
534,
45,
47,
1157,
3236,
468,
471,
326,
727,
490,
137... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2071,
67,
2251,
1793,
84,
2075,
13332,
225,
468,
468,
326,
444,
434,
23174,
927,
5322,
1625,
326,
727,
490,
13797,
1599,
353,
279,
534,
45,
47,
1157,
3236,
468,
471,
326,
727,
490,
137... |
self._data_file_zips[file_hash] = file_name return self._data_file_zips[file_hash] | if is_modules: self._module_zips[file_hash] = arch_file_name return self._module_zips[file_hash] else: self._data_file_zips[file_hash] = arch_file_name return self._data_file_zips[file_hash] | def _archive_files(self, data_files, is_modules=False): if len(data_files) == 0: return None file_hash = hash(data_files) if is_modules: if self._module_zips.has_key(file_hash): return self._module_zips[file_hash] else: if self._data_file_zips.has_key(file_hash): return self._data_file_zips[file_hash] # TODO: this is insecure, try to use the arch_fd in creating the Zipfile object if is_modules: arch_prefix = "modules_" else: arch_prefix = "data_" arch_fd, file_name = tempfile.mkstemp(suffix=".zip", prefix=arch_prefix, dir=self._task_dir_name) os.close(arch_fd) archive_zip = zipfile.PyZipFile(file_name, mode="w") for dfile in data_files: ind_file_name = dfile.split("/")[-1] if is_modules: try: archive_zip.writepy(pathname=dfile+".py") except IOError: logging.info("Couldn't find file for module "+dfile) else: archive_zip.write(filename=dfile, arcname=ind_file_name) archive_zip.close() self._data_file_zips[file_hash] = file_name return self._data_file_zips[file_hash] | ab9fe8db7af7ff011d226c9ae484f81c77e81f98 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8868/ab9fe8db7af7ff011d226c9ae484f81c77e81f98/pymw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10686,
67,
2354,
12,
2890,
16,
501,
67,
2354,
16,
353,
67,
6400,
33,
8381,
4672,
309,
562,
12,
892,
67,
2354,
13,
422,
374,
30,
327,
599,
225,
585,
67,
2816,
273,
1651,
12,
89... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10686,
67,
2354,
12,
2890,
16,
501,
67,
2354,
16,
353,
67,
6400,
33,
8381,
4672,
309,
562,
12,
892,
67,
2354,
13,
422,
374,
30,
327,
599,
225,
585,
67,
2816,
273,
1651,
12,
89... |
this = apply(_quickfix.new_LiquidityPctHigh, args) | this = _quickfix.new_LiquidityPctHigh(*args) | def __init__(self, *args): this = apply(_quickfix.new_LiquidityPctHigh, 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,
48,
18988,
24237,
52,
299,
8573,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
48,
18988,
24237,
52,
299,
8573,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
... |
--m-distr 2 --min-mass " + minmass + " --max-mass " + maxmass + " \ --mean-mass " + opts.mean_mass + " --stdev-mass " + opts.stdev_mass + " \ | --m-distr 2 --min-mass " + mass_dict["min-mass"] + " --max-mass " + mass_dict["max-mass"] + " \ --mean-mass " + mass_dict["mean-mass"] + " --stdev-mass " + mass_dict["stdev-mass"] + " \ | def symlinksafe( target, linkname ): """ Creates a link, does not nag about when it already exists """ try: os.symlink( target, linkname ) except OSError, (errno, strerror): if errno==17: print "WARNING: link %s already exist" % (linkname) else: raise | 6ad3c83b17a791224c0765a4003cd99798d403c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/6ad3c83b17a791224c0765a4003cd99798d403c1/upperlimit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10563,
4626,
12,
1018,
16,
1692,
529,
262,
30,
3536,
10210,
279,
1692,
16,
1552,
486,
290,
346,
2973,
1347,
518,
1818,
1704,
3536,
775,
30,
1140,
18,
21278,
12,
1018,
16,
1692,
529,
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,
10563,
4626,
12,
1018,
16,
1692,
529,
262,
30,
3536,
10210,
279,
1692,
16,
1552,
486,
290,
346,
2973,
1347,
518,
1818,
1704,
3536,
775,
30,
1140,
18,
21278,
12,
1018,
16,
1692,
529,
26... |
self._actions = elementary.Box(self._parent) | self._actions = elementary.Box(self) | def _actions_init(self): sp = elementary.Separator(self._parent) sp.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) sp.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0) sp.size_hint_min_set(600, 1) sp.horizontal_set(True) self.pack(sp, 0, 4, 4, 1) sp.show() | f19f67252e27de0a9cffd2db52e80d7e4b065acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12343/f19f67252e27de0a9cffd2db52e80d7e4b065acc/fileselector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4905,
67,
2738,
12,
2890,
4672,
1694,
273,
930,
814,
18,
6581,
12,
2890,
6315,
2938,
13,
1694,
18,
1467,
67,
11317,
67,
7989,
67,
542,
12,
73,
4423,
18,
24427,
3033,
67,
44,
321... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4905,
67,
2738,
12,
2890,
4672,
1694,
273,
930,
814,
18,
6581,
12,
2890,
6315,
2938,
13,
1694,
18,
1467,
67,
11317,
67,
7989,
67,
542,
12,
73,
4423,
18,
24427,
3033,
67,
44,
321... |
share[0].id = dbshare.id | share[0].id = dbshare[0].id | def AddShare(self, share): """ | 7d7b5c42fc3a010e7d8b973b4f3b4c929699ab1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4762/7d7b5c42fc3a010e7d8b973b4f3b4c929699ab1b/lookup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
9535,
12,
2890,
16,
7433,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
9535,
12,
2890,
16,
7433,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
groupdict = match.groupdict() method = dispatch[groupdict["start"] or groupdict["backquote"] or groupdict["refend"] or groupdict["fnend"]] | groups = match.groupdict() method = dispatch[groups['start'] or groups['backquote'] or groups['refend'] or groups['fnend']] | def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages. | 018a79821ccb1056404d43dbe32e444d1a0e03c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/018a79821ccb1056404d43dbe32e444d1a0e03c1/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
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,
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,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
-100,
-100,
-100,
-100,
-100,... |
exec "from __future__ import division, with_statement; with = 0" | exec "from __future__ import print_function; print 0" | def test_parserhack(self): # test that the parser.c::future_hack function works as expected # Note: although this test must pass, it's not testing the original # bug as of 2.6 since the with statement is not optional and # the parser hack disabled. If a new keyword is introduced in # 2.6, change this to refer to the new future import. try: exec "from __future__ import division, with_statement; with = 0" except SyntaxError: pass else: self.fail("syntax error didn't occur") | bdca942ffcdb6e14758d3e2f7a9e9fbbfa931c06 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/bdca942ffcdb6e14758d3e2f7a9e9fbbfa931c06/test_future.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4288,
76,
484,
12,
2890,
4672,
468,
1842,
716,
326,
2082,
18,
71,
2866,
14343,
67,
76,
484,
445,
6330,
487,
2665,
468,
3609,
30,
26347,
333,
1842,
1297,
1342,
16,
518,
1807,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4288,
76,
484,
12,
2890,
4672,
468,
1842,
716,
326,
2082,
18,
71,
2866,
14343,
67,
76,
484,
445,
6330,
487,
2665,
468,
3609,
30,
26347,
333,
1842,
1297,
1342,
16,
518,
1807,
... |
md.pop(1) | md._pop(1) | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0, args=None): have_arg=args.has_key try: items=self.tpValues() except: items=None if not items and have_arg('leaves'): items=1 tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<TR>\n') # Add +/- icon if items: if level: if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') output('<TD WIDTH="16" VALIGN="TOP">') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: treeData['tree-item-expanded']=1 del substate[exp-1] output('<A HREF="%s?tree-state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?tree-state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] output('</TD>\n') else: level=level+1 if level > 3: output('<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') # add item text dataspan=colspan-level output('<TD COLSPAN="%s" VALIGN="TOP">' % dataspan) output(section(self, md)) output('</TD>\n</TR>\n') if exp: level=level+1 if level > 2: h='<TD COLSPAN="%s"></TD>' % (level-1) elif level > 1: h='<TD></TD>' * (level-1) else: h='' if have_arg('header'): if md.has_key(args['header']): output(md.getitem(args['header'],0)( self, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD COLSPAN="%s" VALIGN="TOP">' % (h, dataspan-1)), standard_html_footer='</TD></TR>', )) if items==1: # leaves treeData['-tree-substate-']=sub treeData['tree-level']=level md.push(treeData) output(md.getitem(args['leaves'],0)( self,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD COLSPAN="%s" VALIGN="TOP">' % (h, dataspan-1)), standard_html_footer='</TD></TR>', )) md.pop(1) elif have_arg('expand'): treeData['-tree-substate-']=sub treeData['tree-level']=level md.push(treeData) output(md.getitem(args['expand'],0)(self,md)) md.pop(1) else: __traceback_info__=sub, args, state, substate for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level, args) if not sub[1]: del sub[1] if have_arg('footer'): if md.has_key(args['footer']): output(md.getitem(args['footer'],0)( self, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD COLSPAN="%s" VALIGN="TOP">' % (h, dataspan-1)), standard_html_footer='</TD></TR>', )) return data | 4bfabee08bc58b7d857ce85c5add2cdd6cc571dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bfabee08bc58b7d857ce85c5add2cdd6cc571dd/TreeTag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8071,
3420,
7775,
12,
2890,
16,
1365,
67,
718,
16,
880,
16,
919,
16,
720,
2019,
16,
501,
16,
20856,
16,
2442,
16,
3481,
16,
2151,
751,
16,
1801,
33,
20,
16,
833,
33,
7036,
4672,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8071,
3420,
7775,
12,
2890,
16,
1365,
67,
718,
16,
880,
16,
919,
16,
720,
2019,
16,
501,
16,
20856,
16,
2442,
16,
3481,
16,
2151,
751,
16,
1801,
33,
20,
16,
833,
33,
7036,
4672,
22... |
if subscriber.isSubscribedTo(pageList): lang = subscriber.language or request.cfg.language_default if not lang in subscriber_list: subscriber_list[lang] = [] if return_users: subscriber_list[lang].append(subscriber) else: subscriber_list[lang].append(subscriber.email) | lang = subscriber.language or request.cfg.language_default if not lang in subscriber_list: subscriber_list[lang] = [] if return_users: subscriber_list[lang].append(subscriber) else: subscriber_list[lang].append(subscriber.email) | def getSubscribers(self, request, **kw): """ Get all subscribers of this page. | c620b8cbbbba92978c7f601553761177b85695fa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/c620b8cbbbba92978c7f601553761177b85695fa/Page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7040,
17769,
12,
2890,
16,
590,
16,
2826,
9987,
4672,
3536,
968,
777,
16768,
434,
333,
1363,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7040,
17769,
12,
2890,
16,
590,
16,
2826,
9987,
4672,
3536,
968,
777,
16768,
434,
333,
1363,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print self.__class__.__name__, 'called' raise TypeError, self.__class__.__name__ | print self.__class__.__name__, 'called' raise TypeError, self.__class__.__name__ | def __call__(self, *args): | b9679862b3bc229dc33d817f27a2e579866d7871 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9658/b9679862b3bc229dc33d817f27a2e579866d7871/testBeforeTraverse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
1968,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
1968,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
Collection of elements [5, 0, 0, 0, 0] indexed by [0, 1, 2, 3, 4] | Collection of elements [6, 0, 0, 0, 0, 0] indexed by [0, 1, 2, 3, 4, 5] | def dft(self, chi = lambda x: x): """ Implements a discrete Fourier transform "over QQ" using exact N-th roots of unity. | 9c13afcbe9dba10ea8450a988631f90a3447d7ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/9c13afcbe9dba10ea8450a988631f90a3447d7ef/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
1222,
12,
2890,
16,
17198,
273,
3195,
619,
30,
619,
4672,
3536,
29704,
279,
20035,
478,
24775,
2510,
315,
1643,
2238,
53,
6,
1450,
5565,
423,
17,
451,
12876,
434,
640,
560,
18,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
1222,
12,
2890,
16,
17198,
273,
3195,
619,
30,
619,
4672,
3536,
29704,
279,
20035,
478,
24775,
2510,
315,
1643,
2238,
53,
6,
1450,
5565,
423,
17,
451,
12876,
434,
640,
560,
18,
2,... |
request.session.delete_test_cookie() | if request.session.test_cookie_worked(): request.session.delete_test_cookie() | def internal_login(request, username, password): try: user = auth.authenticate(username=username, password=password) except: user = None if not user: return "Incorrect username or password." elif not user.is_active: return "This account is inactive." elif not request.session.test_cookie_worked(): return "Cookies must be enabled." auth.login(request, user) request.session.delete_test_cookie() user.last_login = datetime.datetime.now() user.save() | 9045ed5b9513f1546686fbe758aa026e1b7607e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6757/9045ed5b9513f1546686fbe758aa026e1b7607e0/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2713,
67,
5819,
12,
2293,
16,
2718,
16,
2201,
4672,
775,
30,
729,
273,
1357,
18,
22035,
12,
5053,
33,
5053,
16,
2201,
33,
3664,
13,
1335,
30,
729,
273,
599,
309,
486,
729,
30,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2713,
67,
5819,
12,
2293,
16,
2718,
16,
2201,
4672,
775,
30,
729,
273,
1357,
18,
22035,
12,
5053,
33,
5053,
16,
2201,
33,
3664,
13,
1335,
30,
729,
273,
599,
309,
486,
729,
30,
327,
... |
""" | """ | def mouseMoveEvent(self, event): """ Dispatches mouse motion events depending on shift and control key state. """ ##self.debug_event(event, 'mouseMoveEvent') buttons, modifiers = event.buttons(), event.modifiers() if buttons & Qt.LeftButton: if modifiers & Qt.ShiftModifier: pass # self.leftShiftDrag(event) elif modifiers & Qt.ControlModifier: pass # self.leftCntlDrag(event) else: pass # self.leftDrag(event) | b4b66c5fd8aab2a545043d6730aa32d9c4d8cfcb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/b4b66c5fd8aab2a545043d6730aa32d9c4d8cfcb/ThumbView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
7607,
1133,
12,
2890,
16,
871,
4672,
3536,
11552,
281,
7644,
21188,
2641,
8353,
603,
4654,
471,
3325,
498,
919,
18,
3536,
7541,
2890,
18,
4148,
67,
2575,
12,
2575,
16,
296,
11697,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
7607,
1133,
12,
2890,
16,
871,
4672,
3536,
11552,
281,
7644,
21188,
2641,
8353,
603,
4654,
471,
3325,
498,
919,
18,
3536,
7541,
2890,
18,
4148,
67,
2575,
12,
2575,
16,
296,
11697,
... |
return _("%(size)s kb/s", {"size": value}) | return _("%(size)s kB/s", {"size": value}) | def download_rate(rate): if rate >= (1 << 30): value = "%1.1f" % (rate / float(1 << 30)) return _("%(size)s gb/s", {"size": value}) elif rate >= (1 << 20): value = "%1.1f" % (rate / float(1 << 20)) return _("%(size)s mb/s", {"size": value}) elif rate >= (1 << 10): value = "%1.1f" % (rate / float(1 << 10)) return _("%(size)s kb/s", {"size": value}) elif rate > 0: value = "%1.1f" % rate return _("%(size)s b/s", {"size": value}) else: return "" | 132199c8f77aa077f25012f0ee66e3cce0bfb608 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/132199c8f77aa077f25012f0ee66e3cce0bfb608/displaytext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
5141,
12,
5141,
4672,
309,
4993,
1545,
261,
21,
2296,
5196,
4672,
460,
273,
2213,
21,
18,
21,
74,
6,
738,
261,
5141,
342,
1431,
12,
21,
2296,
5196,
3719,
327,
389,
2932,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
5141,
12,
5141,
4672,
309,
4993,
1545,
261,
21,
2296,
5196,
4672,
460,
273,
2213,
21,
18,
21,
74,
6,
738,
261,
5141,
342,
1431,
12,
21,
2296,
5196,
3719,
327,
389,
2932,
17... |
env1.eval("spy=function(){return spy;}") | env1.eval("spy=function(){return spy;}") | def _testSecurityChecks(self): with JSContext() as env1: env1.securityToken = "foo" # Create a function in env1. env1.eval("spy=function(){return spy;}") | d76ea3f452d147f051e65b20fdab9b87a8b84413 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2065/d76ea3f452d147f051e65b20fdab9b87a8b84413/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
4368,
4081,
12,
2890,
4672,
598,
6756,
1042,
1435,
487,
1550,
21,
30,
1550,
21,
18,
7462,
1345,
273,
315,
11351,
6,
225,
468,
1788,
279,
445,
316,
1550,
21,
18,
1550,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
4368,
4081,
12,
2890,
4672,
598,
6756,
1042,
1435,
487,
1550,
21,
30,
1550,
21,
18,
7462,
1345,
273,
315,
11351,
6,
225,
468,
1788,
279,
445,
316,
1550,
21,
18,
1550,
21,
... |
class TestSelectSkinFallbackForm(ptc.FunctionalTestCase): | class TestSelectSkinFallbackForm(base.BaseFunctionalTestCase): | def testSkinSwitchedOnRealTraversalEvent(self): # Create new skin based on Plone Default and make this the # default skin. new_default_skin(self.portal) response = self.publish( self.folder_path + '/getCurrentSkinName', basic=self.basic_auth) self.assertEqual("Monty Python Skin", response.getBody()) | 1bd0163763e58b854569a506d2538cc71f97eeaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10439/1bd0163763e58b854569a506d2538cc71f97eeaf/test_menu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
26827,
10200,
329,
1398,
6955,
25087,
1133,
12,
2890,
4672,
468,
1788,
394,
18705,
2511,
603,
3008,
476,
2989,
471,
1221,
333,
326,
468,
805,
18705,
18,
394,
67,
1886,
67,
7771,
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,
1842,
26827,
10200,
329,
1398,
6955,
25087,
1133,
12,
2890,
4672,
468,
1788,
394,
18705,
2511,
603,
3008,
476,
2989,
471,
1221,
333,
326,
468,
805,
18705,
18,
394,
67,
1886,
67,
7771,
26... |
model.PackageListing.c.statuscode==self.approvedStatus | model.PackageListing.c.statuscode==self.approvedStatus, model.Collection.c.statuscode.in_((self.activeStatus, self.develStatus)), | def bugzilla(self): '''Return the package attributes used by bugzilla. | cc2daa09cb4582a681b88afc71238891318df62a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/cc2daa09cb4582a681b88afc71238891318df62a/acls.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7934,
15990,
12,
2890,
4672,
9163,
990,
326,
2181,
1677,
1399,
635,
7934,
15990,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7934,
15990,
12,
2890,
4672,
9163,
990,
326,
2181,
1677,
1399,
635,
7934,
15990,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
body = "<html><body>simple</body></html>" start_response("200 OK",[('Content-Type','text/html'), ('Content-Length',len(body))]) | length = environ.get('CONTENT_LENGTH', 0) if length and int(length) > self.threshold: self.monitor.append(environ) environ[ENVIRON_RECEIVED] = 0 environ[REQUEST_STARTED] = time.time() environ[REQUEST_FINISHED] = None environ['wsgi.input'] = \ _ProgressFile(environ, environ['wsgi.input']) def finalizer(exc_info=None): environ[REQUEST_FINISHED] = time.time() return catch_errors(self.application, environ, start_response, finalizer, finalizer) return self.application(environ, start_response) def uploads(self): return self.monitor class UploadProgressReporter: """ reports on the progress of uploads for a given user This reporter returns a JSON file (for use in AJAX) listing the uploads in progress for the given user. By default, this reporter uses the ``REMOTE_USER`` environment to compare between the current request and uploads in-progress. If they match, then a response record is formed. ``match()`` This member function can be overriden to provide alternative matching criteria. It takes two environments, the first is the current request, the second is a current upload. ``report()`` This member function takes an environment and builds a ``dict`` that will be used to create a JSON mapping for the given upload. By default, this just includes the percent complete and the request url. """ def __init__(self, monitor): self.monitor = monitor def match(self, search_environ, upload_environ): if search_environ.get('REMOTE_USER',None) == \ upload_environ.get('REMOTE_USER',0): return True return False def report(self, environ): retval = { 'started': time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(environ[REQUEST_STARTED])), 'finished': '', 'content_length': environ.get('CONTENT_LENGTH'), 'bytes_received': environ[ENVIRON_RECEIVED], 'path_info': environ.get('PATH_INFO',''), 'query_string': environ.get('QUERY_STRING','')} finished = environ[REQUEST_FINISHED] if finished: retval['finished'] = time.strftime("%Y:%m:%d %H:%M:%S", time.gmtime(finished)) return retval def __call__(self, environ, start_response): body = [] for map in [self.report(env) for env in self.monitor.uploads() if self.match(environ, env)]: parts = [] for k,v in map.items(): v = str(v).replace("\\","\\\\").replace('"','\\"') parts.append('%s: "%s"' % (k,v)) body.append("{ %s }" % ", ".join(parts)) body = "[ %s ]" % ", ".join(body) start_response("200 OK", [ ('Content-Type', 'text/plain'), ('Content-Length', len(body))]) | def __call__(self, environ, start_response): body = "<html><body>simple</body></html>" start_response("200 OK",[('Content-Type','text/html'), ('Content-Length',len(body))]) return [body] | dc894ac722676e3fe8d537e2a3ab6e790ae1c1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/dc894ac722676e3fe8d537e2a3ab6e790ae1c1d9/progress.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
769,
273,
5473,
18,
588,
2668,
9689,
67,
7096,
2187,
374,
13,
309,
769,
471,
509,
12,
2469,
13,
405,
365,
18,
8699,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
769,
273,
5473,
18,
588,
2668,
9689,
67,
7096,
2187,
374,
13,
309,
769,
471,
509,
12,
2469,
13,
405,
365,
18,
8699,
30,
... |
@slicer(10000) | @slicer(500) | def setup(): web.config.db_parameters = dict(dbn="postgres", db="dbglog", user="pharos", pw="pharos") web.load() | 8e5c0aa3d71fe3f457cd7be9d11fa2c36a7d451c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3913/8e5c0aa3d71fe3f457cd7be9d11fa2c36a7d451c/logdaemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13332,
3311,
18,
1425,
18,
1966,
67,
3977,
273,
2065,
12,
1966,
82,
1546,
2767,
14107,
3113,
1319,
1546,
1966,
75,
1330,
3113,
729,
1546,
844,
297,
538,
3113,
8772,
1546,
844,
297,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13332,
3311,
18,
1425,
18,
1966,
67,
3977,
273,
2065,
12,
1966,
82,
1546,
2767,
14107,
3113,
1319,
1546,
1966,
75,
1330,
3113,
729,
1546,
844,
297,
538,
3113,
8772,
1546,
844,
297,... |
"unsupported type version of node object: %s", ltypever) | "unsupported type version of node object: %s" % (ltypever,)) | def _checkAttributes(self, node): """_checkAttributes(node) -> None. Checks file node-specific attributes. | 510280e4d3d3d19e69c6e84a904db893de1fec21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12687/510280e4d3d3d19e69c6e84a904db893de1fec21/FileNode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
2498,
12,
2890,
16,
756,
4672,
3536,
67,
1893,
2498,
12,
2159,
13,
317,
599,
18,
225,
13074,
585,
756,
17,
12524,
1677,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
2498,
12,
2890,
16,
756,
4672,
3536,
67,
1893,
2498,
12,
2159,
13,
317,
599,
18,
225,
13074,
585,
756,
17,
12524,
1677,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if on == 1 and sn != 2: return self._fix_nan(context) if sn == 1 and on != 2: return other._fix_nan(context) | if on == 1 and sn == 0: return self._fix(context) if sn == 1 and on == 0: return other._fix(context) | def min(self, other, context=None): """Returns the smaller value. | e6e00a7a9f91c40dc04fd913e6ab50eb2137e169 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/e6e00a7a9f91c40dc04fd913e6ab50eb2137e169/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
326,
10648,
460,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
326,
10648,
460,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
>>> home1 = '%s/home/%s' % (path, user1) | >>> home1 = '%s/home/%s/' % (path, user1) | def delticket(): ''' Temporary, to debug problems with tickets. Initialization >>> auth = 'Basic %s' % base64.encodestring('%s:%s' % (user1, password1)).strip() >>> authHeaders = {'Authorization': auth} >>> minTicket = """<?xml version="1.0" encoding="UTF-8"?> ... <X:ticketinfo xmlns:D="DAV:" ... xmlns:X="http://www.xythos.com/namespaces/StorageServer"> ... <D:privilege><D:read/></D:privilege> ... <X:timeout>Second-60</X:timeout> ... </X:ticketinfo>""" >>> home1 = '%s/home/%s' % (path, user1) Create ticket, works >>> r = request('MKTICKET', home1, body=minTicket, headers=authHeaders) >>> r.status # MKTICKET OK 200 >>> ticket = r.getheader('Ticket') >>> ticket GET with ticket, does not seem to work, status 401 (unauthorized) >>> t = {'Ticket': ticket} >>> r = request('GET', home1, headers=t) >>> r.status # GET with ticket OK 200 >>> r = request('GET', '%s?ticket=%s' % (home1, ticket)) >>> r.status # GET with ticket OK 200 DELTICKET does not seem to work, status 501 (not implemented) >>> t = {'Ticket': ticket, 'Authorization': auth} >>> r = request('DELTICKET', home1, headers=t) >>> r.status # DELTICKET OK (No Content) 204 ''' | a375c6aa78de3f64c0d46db5b23d05e9813e0c9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9939/a375c6aa78de3f64c0d46db5b23d05e9813e0c9b/silmut.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
16282,
13332,
9163,
22791,
16,
358,
1198,
9688,
598,
24475,
18,
225,
26586,
225,
4080,
1357,
273,
296,
8252,
738,
87,
11,
738,
1026,
1105,
18,
1331,
1145,
371,
29909,
87,
5319,
87,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
16282,
13332,
9163,
22791,
16,
358,
1198,
9688,
598,
24475,
18,
225,
26586,
225,
4080,
1357,
273,
296,
8252,
738,
87,
11,
738,
1026,
1105,
18,
1331,
1145,
371,
29909,
87,
5319,
87,... |
return self.graph.nVertices | if self.graph: return self.graph.nVertices | def nVertices(self): return self.graph.nVertices | 61e83ca1d2f0df52497f0a7f3478380de5bc5f60 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/61e83ca1d2f0df52497f0a7f3478380de5bc5f60/orngNetwork.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
13371,
12,
2890,
4672,
327,
365,
18,
4660,
18,
82,
13371,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
13371,
12,
2890,
4672,
327,
365,
18,
4660,
18,
82,
13371,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
_nmtoken_rx = re.compile("[a-z][-._a-z0-9]*", re.IGNORECASE) | _nmtoken_rx = re.compile("[a-z][-._a-z0-9]*$", re.IGNORECASE) | def format_attrs(attrs, xml=0): attrs = attrs.items() attrs.sort() s = '' for name, value in attrs: if xml: s = '%s %s="%s"' % (s, name, escape(value)) else: # this is a little bogus, but should do for now if name == value and isnmtoken(value): s = "%s %s" % (s, value) elif istoken(value): s = "%s %s=%s" % (s, name, value) else: s = '%s %s="%s"' % (s, name, escape(value)) return s | bb8f94c6f346fecdf3230a57d410b799ddf05642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb8f94c6f346fecdf3230a57d410b799ddf05642/esis2sgml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
7039,
12,
7039,
16,
2025,
33,
20,
4672,
3422,
273,
3422,
18,
3319,
1435,
3422,
18,
3804,
1435,
272,
273,
875,
364,
508,
16,
460,
316,
3422,
30,
309,
2025,
30,
272,
273,
1995... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
7039,
12,
7039,
16,
2025,
33,
20,
4672,
3422,
273,
3422,
18,
3319,
1435,
3422,
18,
3804,
1435,
272,
273,
875,
364,
508,
16,
460,
316,
3422,
30,
309,
2025,
30,
272,
273,
1995... |
self.xine.attach(displayName, widget.window.xid, self.driver, int(options.shouldSyncX), | self.xine.attach(displayName, widget.window.xid, self.driver, int(options.shouldSyncX), | def on_realize(self, widget): confirmMainThread() # flush gdk output to ensure that our window is created gtk.gdk.flush() displayName = gtk.gdk.display_get_default().get_name() self.xine.attach(displayName, widget.window.xid, self.driver, int(options.shouldSyncX), int(config.get(options.USE_XINE_XV_HACK))) self.attached = True for func, args in self.attach_queue: try: func(self, *args) except: print "Exception in attach_queue function" traceback.print_exc() self.attach_queue = [] | 5e7d37efa9c8bd129d8ff26c55c93e67eca144ad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/5e7d37efa9c8bd129d8ff26c55c93e67eca144ad/xinerenderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
7688,
554,
12,
2890,
16,
3604,
4672,
6932,
6376,
3830,
1435,
468,
3663,
314,
2883,
876,
358,
3387,
716,
3134,
2742,
353,
2522,
22718,
18,
75,
2883,
18,
11330,
1435,
16218,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
7688,
554,
12,
2890,
16,
3604,
4672,
6932,
6376,
3830,
1435,
468,
3663,
314,
2883,
876,
358,
3387,
716,
3134,
2742,
353,
2522,
22718,
18,
75,
2883,
18,
11330,
1435,
16218,
273,
... |
if field in fields: | if field == 'id': fields['id'] = {'readonly': True, 'type': 'integer', 'string': 'ID'} elif field in fields: | fields_def = self.__view_look_dom(cr, user, node, view_id, context=context) | 247c1972ab541850ec71187ca320e6ddaa2644de /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/247c1972ab541850ec71187ca320e6ddaa2644de/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1466,
67,
536,
273,
365,
16186,
1945,
67,
7330,
67,
9859,
12,
3353,
16,
729,
16,
756,
16,
1476,
67,
350,
16,
819,
33,
2472,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1466,
67,
536,
273,
365,
16186,
1945,
67,
7330,
67,
9859,
12,
3353,
16,
729,
16,
756,
16,
1476,
67,
350,
16,
819,
33,
2472,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
send.clicked = partial(send_msg, to, entry, bus, inwin, win, func_ok, func_err, func_status) | send._callback_add('clicked', partial(send_msg, to, entry, bus, inwin, win, func_ok, func_err, func_status)) | def reply(to, text, bus, win, func_ok, func_err, func_status, *args, **kwargs): inwin = elementary.InnerWindow(win) win.resize_object_add(inwin) inwin.show() | 925033402ecbb94f7bf67b07664d713f2f07039b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11430/925033402ecbb94f7bf67b07664d713f2f07039b/opimd_reply.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4332,
12,
869,
16,
977,
16,
5766,
16,
5657,
16,
1326,
67,
601,
16,
1326,
67,
370,
16,
1326,
67,
2327,
16,
380,
1968,
16,
2826,
4333,
4672,
316,
8082,
273,
930,
814,
18,
2857,
3829,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4332,
12,
869,
16,
977,
16,
5766,
16,
5657,
16,
1326,
67,
601,
16,
1326,
67,
370,
16,
1326,
67,
2327,
16,
380,
1968,
16,
2826,
4333,
4672,
316,
8082,
273,
930,
814,
18,
2857,
3829,
... |
sw.set_size_request(200, -1) self.pack_start(sw, False, False) | sw.set_size_request(230, -1) self.pack_start(sw, False, True) | def __init__(self, parent): gtk.HBox.__init__(self, False, 4) | 41bc55849b10de09bb9ea394bff3654c54fe83a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11468/41bc55849b10de09bb9ea394bff3654c54fe83a8/AttackPage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
22718,
18,
44,
3514,
16186,
2738,
972,
12,
2890,
16,
1083,
16,
1059,
13,
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,
1001,
2738,
972,
12,
2890,
16,
982,
4672,
22718,
18,
44,
3514,
16186,
2738,
972,
12,
2890,
16,
1083,
16,
1059,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
inst.__dict__.update(value) | try: inst.__dict__.update(value) except RuntimeError: for k, v in value.items(): setattr(inst, k, v) | def load_build(self): stack = self.stack value = stack[-1] del stack[-1] inst = stack[-1] try: setstate = inst.__setstate__ except AttributeError: inst.__dict__.update(value) else: setstate(value) | 18acbe9164b1760b898437cf24b5488bd6a8d845 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/18acbe9164b1760b898437cf24b5488bd6a8d845/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
3510,
12,
2890,
4672,
2110,
273,
365,
18,
3772,
460,
273,
2110,
18919,
21,
65,
1464,
2110,
18919,
21,
65,
1804,
273,
2110,
18919,
21,
65,
775,
30,
444,
2019,
273,
1804,
16186... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3510,
12,
2890,
4672,
2110,
273,
365,
18,
3772,
460,
273,
2110,
18919,
21,
65,
1464,
2110,
18919,
21,
65,
1804,
273,
2110,
18919,
21,
65,
775,
30,
444,
2019,
273,
1804,
16186... |
url = NSURL.fileURLWithPath_(__file__) | filePath = __file__ if filePath[-1] == 'c': filePath = filePath[:-1] url = NSURL.fileURLWithPath_(filePath) | def testInitWithURL(self): url = NSURL.fileURLWithPath_(__file__) | 873d3791f60f205e9baa50d4c898050fd5f1dc16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/97/873d3791f60f205e9baa50d4c898050fd5f1dc16/test_nsattributedstring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2570,
1190,
1785,
12,
2890,
4672,
880,
273,
11472,
1785,
18,
768,
1785,
1190,
743,
67,
12,
972,
768,
972,
13,
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,
1842,
2570,
1190,
1785,
12,
2890,
4672,
880,
273,
11472,
1785,
18,
768,
1785,
1190,
743,
67,
12,
972,
768,
972,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
entries = self.get_doclist(title, folder) if not entries: | if folder_entry_list: if len(folder_entry_list) == 1: return self.GetSingleEntry(folder_entry_list[0].content.src, title, converter=gdata.docs.DocumentListFeedFromString) else: entries = self.get_doclist(title, folder_entry_list) return self.GetSingleEntry(entries, title) else: return self.GetSingleEntry(gdata.docs.service.DocumentQuery().ToUri(), title, converter=gdata.docs.DocumentListFeedFromString) GetSingleDoc = get_single_doc def get_folder(self, title): """Return entries for one or more folders. Keyword arguments: title: Title of the folder. Returns: GDataEntry representing a folder, or None of title is None. """ if title: query = gdata.docs.service.DocumentQuery(categories=['folder'], params={'showfolders': 'true'}) folder_entries = self.GetEntries(query.ToUri(), title=title) if not folder_entries: warnings.warn('No folder found that matches ' + title, stacklevel=2) return folder_entries else: | def get_single_doc(self, title=None, folder=None): """Return exactly one file. Uses GetEntries to retrieve the entries, then asks the user to select one of them by entering a number. Keyword arguments: title: Title to match on. See get_doclist. (Default None). folder: Folders to look in. See get_doclist. (Default None). Returns: None if there were no matches, or one entry matching the given title. """ entries = self.get_doclist(title, folder) if not entries: return None elif len(entries) == 1: return entries[0] elif len(entries) > 1: print 'More than one match for title ' + (title or '') for num, entry in enumerate(entries): print '%i) %s' % (num, entry.title.text) selection = -1 while selection < 0 or selection > len(entries)-1: selection = int(raw_input('Please select one of the items by number: ')) return entries[selection] | c39b8a9627de0edfb3d799d2d03eab92d3ba2b20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/c39b8a9627de0edfb3d799d2d03eab92d3ba2b20/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7526,
67,
2434,
12,
2890,
16,
2077,
33,
7036,
16,
3009,
33,
7036,
4672,
3536,
990,
8950,
1245,
585,
18,
225,
14854,
968,
5400,
358,
4614,
326,
3222,
16,
1508,
6827,
87,
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,
336,
67,
7526,
67,
2434,
12,
2890,
16,
2077,
33,
7036,
16,
3009,
33,
7036,
4672,
3536,
990,
8950,
1245,
585,
18,
225,
14854,
968,
5400,
358,
4614,
326,
3222,
16,
1508,
6827,
87,
326,
... |
self.log_error("Could not found an aviable port in the range %s to provide webpublishing of the contents." % [web_portno, web_portno+10]) | self.log_error("Could not find an available port in the range %s to provide webpublishing of the text contents." % [web_portno, web_portno+10]) | def __init__(self, web_service=1): """ At the instanciation create the gui and install the reactor support """ root = Tk() tksupport.install(root) # Install the Reactor support self.body(root) # build the gui self.encoding = "utf-8" # is this standard, sustainable ? self.version = '0.0.1' self.file = None # will keep the file instance self.filename = None # will keep the filename self.saved_version_hash = hash("\n") # used to check changes in the file print "Chalks " + self.version + ", started. Licensed under the GNU GPL. Copyright 2004, Chalks Development Team (http://chalks.berlios.de)\n" #@ << install the web service >> #@+node:<< install the web service >> # install the web service if web_service: site = server.Site(utf8Page(interfaces.IModel(self), templateFile="Chalks.xhtml", templateDirectory="./")) web_portno = pb.portno + 1 for port in xrange(web_portno, web_portno+10): try: web_service = reactor.listenTCP(port, site) #internet.TCPServer(port, site).setParentApp(app) except: # failed continue else: # got it print "Starting web service at http://localhost:%i" % port #print "%s %s" % (web_service, dir(web_service)) self.web_service = web_service break # stop creating web services else: # the range failed self.log_error("Could not found an aviable port in the range %s to provide webpublishing of the contents." % [web_portno, web_portno+10]) #@-node:<< install the web service >> #@nl #@ << install the collaboration service >> #@+node:<< install the collaboration service >> # install the collaboration service self.node = ChalksNode(self) # ChalksNode take care of the rest # local PB classes definitions #@+others #@+node:Chalks realm class ChalksRealm: """ Provide access to a ChalksPerspective """ __implements__ = portal.IRealm def __init__(self, Chalks_instance): self.chalks_instance = Chalks_instance def requestAvatar(self, avatarId, mind, *interfaces): if pb.IPerspective in interfaces: avatar = ChalksPerspective(avatarId, mind, self.chalks_instance) return pb.IPerspective, avatar, avatar.logout else: raise NotImplementedError("no interface") #@-node:Chalks realm #@+node:dummy checker class DummyChecker: """ give access to everyone """ __implements__ = checkers.ICredentialsChecker credentialInterfaces = (credentials.IUsernamePassword, credentials.IUsernameHashedPassword) def requestAvatarId(self, credential): """ give access to everyone that requests it """ if 1: return credential.username else: return failure.Failure(error.UnauthorizedLogin("%s is not listed in the authorized users." % credential.username)) #@-node:dummy checker #@-others t_portal = portal.Portal(ChalksRealm(self)) t_portal.registerChecker(DummyChecker()) pb_factory = pb.PBServerFactory(t_portal) for port in xrange(pb.portno, pb.portno+10): try: pb_service = reactor.listenTCP(port, pb_factory) #internet.TCPServer(port, site).setParentApp(app) except: # failed continue else: # got it print "Starting Chalks service at chalks://localhost:%i" % port print "Knowing your internet address (i.e. your IP) other users can connect themself to your session using the port %i." % port #<<<<< this should be replaced by a friendlier popup or message self.chalks_service = pb_service break # stop creating web services else: # the range failed self.log_error("Unable to find an available port in the range %s to provide the chalks service." % [pb.portno, pb.portno+10] ) self.log_error("This is a fatal error") self.text_widget["state"] = DISABLED # I said fatal error... #@nonl #@-node:<< install the collaboration service >> #@nl return | fcf05c46a9212ed4ae8a7bcf04cadb37e222d315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2639/fcf05c46a9212ed4ae8a7bcf04cadb37e222d315/Chalks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3311,
67,
3278,
33,
21,
4672,
3536,
2380,
326,
316,
27866,
7072,
752,
326,
13238,
471,
3799,
326,
19178,
2865,
3536,
225,
1365,
273,
399,
79,
1435,
13030,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3311,
67,
3278,
33,
21,
4672,
3536,
2380,
326,
316,
27866,
7072,
752,
326,
13238,
471,
3799,
326,
19178,
2865,
3536,
225,
1365,
273,
399,
79,
1435,
13030,
... |
gclient_utils.FileRead(os.path.join(checkout_path, options.deps_file) | gclient.gclient_utils.FileRead( gclient.os.path.join(checkout_path, options.deps_file) | def testRunOnDepsCustomDeps(self): solution_name = 'testRunOnDepsCustomDeps_solution_name' gclient_config = ( "solutions = [ {\n" " 'name': '%s',\n" " 'url': '%s',\n" " 'custom_deps': {\n" " 'src/b': None,\n" " 'src/n': 'svn://custom.n/trunk',\n" " 'src/t': 'svn://custom.t/trunk',\n" " }\n} ]\n" ) % (solution_name, self.url) | 90ba161b70b445eba62b2a376e4fa2f508854e13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/90ba161b70b445eba62b2a376e4fa2f508854e13/gclient_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1997,
1398,
14430,
3802,
14430,
12,
2890,
4672,
6959,
67,
529,
273,
296,
3813,
1997,
1398,
14430,
3802,
14430,
67,
13385,
67,
529,
11,
314,
2625,
67,
1425,
273,
261,
315,
18281,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1997,
1398,
14430,
3802,
14430,
12,
2890,
4672,
6959,
67,
529,
273,
296,
3813,
1997,
1398,
14430,
3802,
14430,
67,
13385,
67,
529,
11,
314,
2625,
67,
1425,
273,
261,
315,
18281,
61... |
if tthis is StringType or tnext is StringType or this is InstanceType or tnext is InstanceType: | if tthis in (StringType, UnicodeType) or \ tnext in (StringType, UnicodeType) or \ this is InstanceType or tnext is InstanceType: | def cleanProgram(self, line): "collapse adjacent spacings" #return line # for debugging result = [] last = 0 from types import FloatType, TupleType, StringType, InstanceType for e in line: if type(e) is FloatType: # switch to expandable space if appropriate if last<0 and e>0: last = -last if e<0 and last>0: e = -e last = float(last)+e else: if abs(last)>TOOSMALLSPACE: result.append(last) result.append(e) last = 0 if last: result.append(last) # now go backwards and delete all floats occurring after all visible elements | 041e2d265f4d145658b08edc02ff501d425029d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/041e2d265f4d145658b08edc02ff501d425029d6/para.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
9459,
12,
2890,
16,
980,
4672,
315,
21405,
16335,
1694,
1077,
899,
6,
468,
2463,
980,
468,
364,
10450,
563,
273,
5378,
1142,
273,
374,
628,
1953,
1930,
5450,
559,
16,
7257,
559,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
9459,
12,
2890,
16,
980,
4672,
315,
21405,
16335,
1694,
1077,
899,
6,
468,
2463,
980,
468,
364,
10450,
563,
273,
5378,
1142,
273,
374,
628,
1953,
1930,
5450,
559,
16,
7257,
559,
... |
if self.rspauth_checked: return Success(self.username,self.realm,self.authzid) else: self._final_challenge(data) | def finish(self,data): """Process success indicator from the server. | 00cbaa447330ec52d7cca990ed8004cc40686fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/00cbaa447330ec52d7cca990ed8004cc40686fbe/digest_md5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
16,
892,
4672,
3536,
2227,
2216,
10664,
628,
326,
1438,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
16,
892,
4672,
3536,
2227,
2216,
10664,
628,
326,
1438,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def get_sidebars(self, pagename): | def add_sidebars(self, pagename, ctx): | def get_sidebars(self, pagename): def has_wildcard(pattern): return any(char in pattern for char in '*?[') sidebars = None matched = None for pattern, patsidebars in self.config.html_sidebars.iteritems(): if patmatch(pagename, pattern): if matched: if has_wildcard(pattern): # warn if both patterns contain wildcards if has_wildcard(matched): self.warn('page %s matches two patterns in ' 'html_sidebars: %r and %r' % (pagename, matched, pattern)) # else the already matched pattern is more specific # than the present one, because it contains no wildcard continue matched = pattern sidebars = patsidebars if sidebars is None: sidebars = self.default_sidebars elif isinstance(sidebars, basestring): # 0.x compatible mode: insert custom sidebar before searchbox sidebars = self.default_sidebars[:-1] + [sidebars] + \ self.default_sidebars[-1:] return sidebars | 11576988481b3318ba3a335df198a2511b2e11b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/11576988481b3318ba3a335df198a2511b2e11b4/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5564,
13518,
12,
2890,
16,
4262,
1069,
16,
1103,
4672,
1652,
711,
67,
22887,
12,
4951,
4672,
327,
1281,
12,
3001,
316,
1936,
364,
1149,
316,
14609,
35,
3292,
13,
4889,
13518,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5564,
13518,
12,
2890,
16,
4262,
1069,
16,
1103,
4672,
1652,
711,
67,
22887,
12,
4951,
4672,
327,
1281,
12,
3001,
316,
1936,
364,
1149,
316,
14609,
35,
3292,
13,
4889,
13518,
... |
def _create_gnulong(self, name, type): """Write a GNU longname/longlink member to the TarFile. It consists of an extended tar header, with the length of the longname as size, followed by data blocks, which contain the longname as a null terminated string. """ name += NUL tarinfo = TarInfo() tarinfo.name = "././@LongLink" tarinfo.type = type tarinfo.mode = 0 tarinfo.size = len(name) self.fileobj.write(tarinfo.tobuf()) self.offset += BLOCKSIZE self.fileobj.write(name) blocks, remainder = divmod(tarinfo.size, BLOCKSIZE) if remainder > 0: self.fileobj.write(NUL * (BLOCKSIZE - remainder)) blocks += 1 self.offset += blocks * BLOCKSIZE | def __iter__(self): """Provide an iterator object. """ if self._loaded: return iter(self.members) else: return TarIter(self) | a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
20632,
392,
2775,
733,
18,
3536,
309,
365,
6315,
4230,
30,
327,
1400,
12,
2890,
18,
7640,
13,
469,
30,
327,
20334,
2360,
12,
2890,
13,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
20632,
392,
2775,
733,
18,
3536,
309,
365,
6315,
4230,
30,
327,
1400,
12,
2890,
18,
7640,
13,
469,
30,
327,
20334,
2360,
12,
2890,
13,
2,
-100,
... | |
def server_lookup(key): | def nat_server_lookup(key): | def server_lookup(key): # Get the proper key, add the prefix key = NAT_SRV_PREFIX + key # Fetch all the keys lst = centralizedadvertise_lookup(key, NAT_MAX_LOOKUP) num = len(lst) # Safety check... assert(num <= 1) if num == 0: raise Exception, "Host could not be found!" # Get the information about the server info = deserialize(lst[0]) # Return a tuple of the forwarder IP port return (info["forwarder"], info["port"]) | 0aaef251c3e67c2a38864652c5dad71dda90cbab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/0aaef251c3e67c2a38864652c5dad71dda90cbab/NAT_advertisement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10535,
67,
3567,
67,
8664,
12,
856,
4672,
468,
968,
326,
5338,
498,
16,
527,
326,
1633,
498,
273,
31395,
67,
10090,
58,
67,
6307,
397,
498,
225,
468,
8065,
777,
326,
1311,
9441,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10535,
67,
3567,
67,
8664,
12,
856,
4672,
468,
968,
326,
5338,
498,
16,
527,
326,
1633,
498,
273,
31395,
67,
10090,
58,
67,
6307,
397,
498,
225,
468,
8065,
777,
326,
1311,
9441,
273,
... |
for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ | for myFile in fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.exists(wikiFilename) and maxCount < 15: sys.stdout.write("File %s already exists.\n"%\ os.path.split(wikiFilename)[1]) wikiFilename=wikiFilename+".wiki" maxCount=maxCount+1 # #Create the wikipage object etc # wikiPage=wiki(wikiFilename) # # Create top two trigger params tables # cTable=wikiPage.wikiTable(2,9) cTable.data=[ ["Trigger Type", "Rank", "FAR", "SNR", "IFOS(Coinc)", "Instruments(Active)", "Coincidence Time (s)", "Total Mass (mSol)", "Chirp Mass (mSol)" ], ["%s"%(wikiCoinc.type), "%s"%(wikiCoinc.rank), "%s"%(wikiCoinc.far), "%s"%(wikiCoinc.snr), "%s"%(wikiCoinc.ifos), "%s"%(wikiCoinc.instruments), "%s"%(wikiCoinc.time), "%s"%(wikiCoinc.mass), "%s"%(wikiCoinc.mchirp) ] ] pTable=wikiPage.wikiTable(len(wikiCoinc.sngls_in_coinc())+1,7) pTable.data[0]=[ "IFO", "GPS Time(s)", "SNR", "CHISQR", "Mass 1", "Mass 2", "Chirp Mass" ] for row,cSngl in enumerate(wikiCoinc.sngls_in_coinc()): pTable.data[row+1]=[ "%s"%(cSngl.ifo), "%s"%(cSngl.time), "%s"%(cSngl.snr), "%s"%(cSngl.chisqr), "%s"%(cSngl.mass1), "%s"%(cSngl.mass2), "%s"%(cSngl.mchirp) ] #Write the tables into the Wiki object wikiPage.putText("Coincident Trigger Event Information: %s\n"\ %(stfu_pipe.gpsTimeToReadableDate(wikiCoinc.time))) wikiPage.insertTable(cTable) wikiPage.putText("Corresponding Coincident Single IFO Trigger Information\n") wikiPage.insertTable(pTable) #Generate a table of contents to appear after candidate params table wikiPage.tableOfContents(3) #Begin including each checklist item as section with subsections wikiPage.section("Follow-up Checklist") #Put each checklist item wikiPage.subsection("Checklist Summary") wikiPage.subsubsection("Does this candidate pass this checklist?") wikiPage.subsubsection("Answer") wikiPage.subsubsection("Relevant Information and Comments") wikiPage.insertHR() # #First real checklist item wikiPage.subsection("#0 False Alarm Probability") wikiPage.subsubsection("Question") wikiPage.putText("What is the false alarm rate associated with this candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") farTable=wikiPage.wikiTable(2,1) farTable.setTableStyle("background-color: yellow; text-align center;") farTable.data[0][0]="False Alarm Rate" farTable.data[1][0]="%s"%(wikiCoinc.far) wikiPage.insertTable(farTable) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#1 Data Quality Flags") wikiPage.subsubsection("Question") wikiPage.putText("Can the data quality flags coincident with this candidate be safely disregarded?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPath=os.path.split(wikiFilename)[0] dqFileList=wikiFileFinder.get_findFlags() if len(dqFileList) != 1: sys.stdout.write("Warning: DQ flags data product import problem.\n") print "Found %i files."%len(dqFileList) for mf in dqFileList: print mf for myFile in dqFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#2 Veto Investigations") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate survive the veto investigations performed at its time?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") vetoFileList=wikiFileFinder.get_findVetos() if len(vetoFileList) != 1: sys.stdout.write("Warning: Veto flags data product import problem.\n") for myFile in vetoFileList:print myFile for myFile in vetoFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#3 IFO Status") wikiPage.subsubsection("Question") wikiPage.putText("Are the interferometers operating normally with a reasonable level of sensitivity around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") #Add link to Daily Stats if wikiCoinc.time <= endOfS5: statsLink=wikiPage.makeExternalLink("http://blue.ligo-wa.caltech.edu/scirun/S5/DailyStatistics/",\ "S5 Daily Stats Page") else: statsLink="This should be a link to S6 Daily Stats!\n" wikiPage.putText(statsLink) #Link figures of merit #Get link for all members of wikiCoinc wikiPage.putText("Figures of Merit\n") if wikiCoinc.time > endOfS5: fomLinks=dict() elems=0 for wikiSngl in wikiCoinc.sngls: if not(wikiSngl.ifo.upper().rstrip().lstrip() == 'V1'): fomLinks[wikiSngl.ifo]=stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo) elems=elems+len(fomLinks[wikiSngl.ifo]) else: for myLabel,myLink,myThumb in stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo): wikiPage.putText("%s\n"%(wikiPage.makeExternalLink(myLink,myLabel))) cols=4 rows=(elems/3)+1 fTable=wikiPage.wikiTable(rows,cols) fTable.data[0]=["IFO,Shift","FOM1","FOM2","FOM3"] currentIndex=0 for myIFOKey in fomLinks.keys(): for label,link,thumb in fomLinks[myIFOKey]: myRow=currentIndex/int(3)+1 myCol=currentIndex%int(3)+1 fTable.data[myRow][0]=label thumbURL=thumb fTable.data[myRow][myCol]="%s"%(wikiPage.linkedRemoteImage(thumb,link)) currentIndex=currentIndex+1 wikiPage.insertTable(fTable) else: wikiPage.putText("Can not automatically fetch S5 FOM links.") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#4 Candidate Appearance") wikiPage.subsubsection("Question") wikiPage.putText("Do the Qscan figures show what we would expect for a gravitational-wave event?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() for sngl in wikiCoinc.sngls: frametype,channelName=stfu_pipe.figure_out_type(sngl.time,sngl.ifo,'hoft') indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*/%s/*/%s/*index.html"%(frametype,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened.png"\ %(sngl.time,channelName)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened?thumb.png"\ %(sngl.time,channelName)) # #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("GW data channel scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >= 1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >= 1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: Candidate appearance plot import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#5 Seismic Plots") wikiPage.subsubsection("Question") wikiPage.putText("Is the seismic activity insignificant around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() # for sngl in wikiCoinc.sngls_in_coinc(): indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*index.html"%(sngl.ifo,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if (len(zValueFiles) > 0): for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Search for analyzeQscan files #/L1-analyseQscan_L1_932797512_687_seis_rds_L1_SEI-ETMX_X_z_scat-unspecified-gpstime.png timeString=str(float(sngl.time)).replace(".","_") zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.txt"%(sngl.ifo,timeString)) indexDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.html"%(sngl.ifo,timeString)) thumbDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime_thumb.png"\ %(sngl.ifo,timeString)) imageDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime.png"\ %(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse keeping SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Seismic scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: Seismic plots product import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#6 Other environmental causes") wikiPage.subsubsection("Question") wikiPage.putText("Were the environmental disturbances (other than seismic) insignificant at the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only PEM channels for sngl in wikiCoinc.sngls_in_coinc(): imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping PEM and not SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) for chan in zValueDictAQ[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(imageDict[sngl.ifo]) < 1: wikiPage.putText("PEM scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: PEM plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#7 Auxiliary degree of freedom") wikiPage.subsubsection("Question") wikiPage.putText("Were the auxiliary channel transients coincident with the candidate insignificant?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only AUX channels for sngl in wikiCoinc.sngls: imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") #H1-analyseQscan_H1_931176926_116_rds-unspecified-gpstime.html for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Other scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: AUX plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#8 Electronic Log Book") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the comments posted by the sci-mons or the operators in the e-log?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiLinkLHOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"H1"), "Hanford eLog") wikiLinkLLOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"L1"), "Livingston eLog") wikiPage.putText("%s\n\n%s\n\n"%(wikiLinkLHOlog,wikiLinkLLOlog)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#9 Glitch Report") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the weekly glitch report?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") if int(wikiCoinc.time) >= endOfS5: wikiLinkGlitch=wikiPage.makeExternalLink( "https://www.lsc-group.phys.uwm.edu/twiki/bin/view/DetChar/GlitchStudies", "Glitch Reports for S6" ) else: wikiLinkGlitch=wikiPage.makeExternalLink( "http://www.lsc-group.phys.uwm.edu/glitch/investigations/s5index.html#shift", "Glitch Reports for S5" ) wikiPage.putText("%s\n"%(wikiLinkGlitch)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#10 Snr versus time") wikiPage.subsubsection("Question") wikiPage.putText("Is this trigger significant in a SNR versus time plot of all triggers in its analysis chunk?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#11 Parameters of the candidate") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate have a high likelihood of being a gravitational-wave according to its parameters?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Effective Distance Ratio Test\n") effDList=wikiFileFinder.get_effDRatio() if len(effDList) != 1: sys.stdout.write("Warning: Effective Distance Test import problem.\n") for myFile in effDList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#12 Snr and Chisq") wikiPage.subsubsection("Question") wikiPage.putText("Are the SNR and CHISQ time series consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") # #Put plots SNR and Chi sqr # indexList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*.html") thumbList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_snr-*thumb.png") thumbList.extend(fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_chisq-*thumb.png")) thumbList.sort() indexList=[file2URL.convert(x) for x in indexList] thumbList=[file2URL.convert(x) for x in thumbList] #Two thumb types possible "_thumb.png" or ".thumb.png" imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] ifoCount=len(wikiCoinc.sngls) rowLabel={"SNR":1,"CHISQ":2} rowCount=len(rowLabel) colCount=ifoCount if len(indexList) >= 1: snrTable=wikiPage.wikiTable(rowCount+1,colCount+1) for i,sngl in enumerate(wikiCoinc.sngls): myIndex="" for indexFile in indexList: if indexFile.__contains__("_pipe_%s_FOLLOWUP_"%sngl.ifo): myIndex=indexFile if myIndex=="": snrTable.data[0][i+1]=" %s "%sngl.ifo else: snrTable.data[0][i+1]=wikiPage.makeExternalLink(myIndex,sngl.ifo) for col,sngl in enumerate(wikiCoinc.sngls): for row,label in enumerate(rowLabel.keys()): snrTable.data[row+1][0]=label for k,image in enumerate(imageList): if (image.__contains__("_%s-"%label.lower()) \ and image.__contains__("pipe_%s_FOLLOWUP"%sngl.ifo)): snrTable.data[row+1][col+1]=" %s "%(wikiPage.linkedRemoteImage(thumbList[k],thumbList[k])) wikiPage.insertTable(snrTable) else: sys.stdout.write("Warning: SNR and CHISQ plots not found.\n") wikiPage.putText("SNR and CHISQ plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#13 Template bank veto") wikiPage.subsubsection("Question") wikiPage.putText("Is the bank veto value consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#14 Coherent studies") wikiPage.subsubsection("Question") wikiPage.putText("Are the triggers found in multiple interferometers coherent with each other?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") indexList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),"*.html") if len(indexList) >= 1: myIndex=file2URL.convert(indexList[0]) wikiPage.putText(wikiPage.makeExternalLink(myIndex,\ "%s Coherence Study Results"%(wikiCoinc.ifos))) thumbList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),\ "PLOT_CHIA_%s_snr-squared*thumb.png"%(wikiCoinc.time)) imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] rowCount=len(imageList) colCount=1 cohSnrTimeTable=wikiPage.wikiTable(rowCount+1,colCount) cohSnrTimeTable.data[0][0]="%s Coherent SNR Squared Times Series"%(wikiCoinc.ifos) for i,image in enumerate(imageList): cohSnrTimeTable.data[i+1][0]=wikiPage.linkedRemoteImage(image,thumbList[i]) wikiPage.insertTable(cohSnrTimeTable) else: sys.stdout.write("Warning: Coherent plotting jobs not found.\n") wikiPage.putText("Coherent Studies plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#15 Segmentation Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in segmentation?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#16 Calibration Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in calibration that are consistent with systematic uncertainties?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # | 481b556f895e5b0b4caf0acaf35400d2993db8e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/481b556f895e5b0b4caf0acaf35400d2993db8e5/makeCheckListWiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... |
if not isinstance(oldMouseObject,NVDAObjects.IAccessible.IAccessible) or x<oldLeft or x>(oldLeft+oldWidth) or y<oldTop or y>(oldTop+oldHeight): | if currentMouseWindow!=oldMouseWindow or not isinstance(oldMouseObject,NVDAObjects.IAccessible.IAccessible) or x<oldLeft or x>(oldLeft+oldWidth) or y<oldTop or y>(oldTop+oldHeight): | def executeMouseMoveEvent(x,y): oldMouseObject=api.getMouseObject() try: (oldLeft,oldTop,oldWidth,oldHeight)=oldMouseObject.location except: oldLeft=oldTop=oldWidth=oldHeight=0 mouseObject=oldMouseObject windowAtPoint=ctypes.windll.user32.WindowFromPoint(x,y) if JABHandler.isRunning and JABHandler.isJavaWindow(windowAtPoint): if not isinstance(oldMouseObject,NVDAObjects.JAB.JAB) or x<oldLeft or x>(oldLeft+oldWidth) or y<oldTop or y>(oldTop+oldHeight): oldJabContext=JABHandler.JABContext(hwnd=windowAtPoint) else: oldJabContext=oldMouseObject.jabContext res=oldJabContext.getAccessibleContextAt(x,y) if res: mouseObject=NVDAObjects.JAB.JAB(jabContext=res) else: #not a java window if not isinstance(oldMouseObject,NVDAObjects.IAccessible.IAccessible) or x<oldLeft or x>(oldLeft+oldWidth) or y<oldTop or y>(oldTop+oldHeight): mouseObject=NVDAObjects.IAccessible.getNVDAObjectFromPoint(x,y) else: res=IAccessibleHandler.accHitTest(oldMouseObject.IAccessibleObject,oldMouseObject.IAccessibleChildID,x,y) if res: mouseObject=NVDAObjects.IAccessible.IAccessible(IAccessibleObject=res[0],IAccessibleChildID=res[1]) if not mouseObject: return try: (left,top,width,height)=mouseObject.location except: left=top=width=height=0 if x<left or x>(left+width) or y<top or y>(top+height): return api.setMouseObject(mouseObject) try: mouseObject.event_mouseMove(x,y) oldMouseObject=mouseObject except: log.error("api.notifyMouseMoved", exc_info=True) | 45f56524c6938af0c61fe19ec25a19d3c9c22eb8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/45f56524c6938af0c61fe19ec25a19d3c9c22eb8/mouseHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
9186,
7607,
1133,
12,
92,
16,
93,
4672,
1592,
9186,
921,
33,
2425,
18,
588,
9186,
921,
1435,
775,
30,
261,
1673,
3910,
16,
1673,
3401,
16,
1673,
2384,
16,
1673,
2686,
13,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
9186,
7607,
1133,
12,
92,
16,
93,
4672,
1592,
9186,
921,
33,
2425,
18,
588,
9186,
921,
1435,
775,
30,
261,
1673,
3910,
16,
1673,
3401,
16,
1673,
2384,
16,
1673,
2686,
13,
33,
1... |
msg = 'HTTP Error %s : %s ' % (self.http_code, self.url) | if self.scheme in ['http', 'https']: msg = 'HTTP Error %s : %s ' % (self.http_code, self.url) elif self.scheme in ['ftp']: msg = 'FTP Error %s : %s ' % (self.http_code, self.url) else: msg = "Unknown Error: URL=%s , scheme=%s" % (self.url, self.scheme) | def _do_perform(self): if self._complete: return try: self.curl_obj.perform() except pycurl.error, e: # XXX - break some of these out a bit more clearly # to other URLGrabErrors from # http://curl.haxx.se/libcurl/c/libcurl-errors.html # this covers e.args[0] == 22 pretty well - which will be common code = self.http_code errcode = e.args[0] if self._error[0]: errcode = self._error[0] if errcode == 23 and code >= 200 and code < 299: err = URLGrabError(15, _('User (or something) called abort %s: %s') % (self.url, e)) err.url = self.url # this is probably wrong but ultimately this is what happens # we have a legit http code and a pycurl 'writer failed' code # which almost always means something aborted it from outside # since we cannot know what it is -I'm banking on it being # a ctrl-c. XXXX - if there's a way of going back two raises to # figure out what aborted the pycurl process FIXME raise KeyboardInterrupt elif errcode == 28: err = URLGrabError(12, _('Timeout on %s: %s') % (self.url, e)) err.url = self.url raise err elif errcode == 35: msg = _("problem making ssl connection") err = URLGrabError(14, msg) err.url = self.url raise err elif errcode == 37: msg = _("Could not open/read %s") % (self.url) err = URLGrabError(14, msg) err.url = self.url raise err elif errcode == 42: err = URLGrabError(15, _('User (or something) called abort %s: %s') % (self.url, e)) err.url = self.url # this is probably wrong but ultimately this is what happens # we have a legit http code and a pycurl 'writer failed' code # which almost always means something aborted it from outside # since we cannot know what it is -I'm banking on it being # a ctrl-c. XXXX - if there's a way of going back two raises to # figure out what aborted the pycurl process FIXME raise KeyboardInterrupt elif errcode == 58: msg = _("problem with the local client certificate") err = URLGrabError(14, msg) err.url = self.url raise err | 179fc2fcb291a7a1951b2bdda94f1ff443e83591 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7001/179fc2fcb291a7a1951b2bdda94f1ff443e83591/grabber.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
16092,
12,
2890,
4672,
309,
365,
6315,
6226,
30,
327,
225,
775,
30,
365,
18,
13504,
67,
2603,
18,
16092,
1435,
1335,
2395,
13504,
18,
1636,
16,
425,
30,
468,
11329,
300,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
16092,
12,
2890,
4672,
309,
365,
6315,
6226,
30,
327,
225,
775,
30,
365,
18,
13504,
67,
2603,
18,
16092,
1435,
1335,
2395,
13504,
18,
1636,
16,
425,
30,
468,
11329,
300,... |
self.saved_dbc_key = c.current(0,0,0)[0] | try: self.saved_dbc_key = c.current(0,0,0)[0] except db.DBError: pass | def _closeCursors(self, save=1): if self.dbc: c = self.dbc self.dbc = None if save: self.saved_dbc_key = c.current(0,0,0)[0] c.close() del c for cref in self._cursor_refs.values(): c = cref() if c is not None: c.close() | cba94f2fe7e40ba1e6434594dbf466d95f4352b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/cba94f2fe7e40ba1e6434594dbf466d95f4352b7/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4412,
2408,
87,
1383,
12,
2890,
16,
1923,
33,
21,
4672,
309,
365,
18,
9137,
30,
276,
273,
365,
18,
9137,
365,
18,
9137,
273,
599,
309,
1923,
30,
775,
30,
365,
18,
14077,
67,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4412,
2408,
87,
1383,
12,
2890,
16,
1923,
33,
21,
4672,
309,
365,
18,
9137,
30,
276,
273,
365,
18,
9137,
365,
18,
9137,
273,
599,
309,
1923,
30,
775,
30,
365,
18,
14077,
67,
9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.