rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
if self.libraries is None: self.libraries = [] if self.library_dirs is None: self.library_dirs = [] if self.rpath is None: self.rpath = []
def run (self):
1c61e1a031e9be08a4b26551f8af6bed4bc07175 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1c61e1a031e9be08a4b26551f8af6bed4bc07175/build_ext.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, ...
expected_migrations = [ ('a', ver, 'up') for ver in range(10) ] assert expected_migrations == test_globals.migrations_run
self._expect_migrations([ ('a', ver, 'up') for ver in range(10) ])
def test_only_a(self): self.cmd.run(self.args + ['a']) expected_migrations = [ ('a', ver, 'up') for ver in range(10) ] assert expected_migrations == test_globals.migrations_run
05b857a036dd4fa753f3443dd985a72b79357fbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/05b857a036dd4fa753f3443dd985a72b79357fbe/test_migrations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3700, 67, 69, 12, 2890, 4672, 365, 18, 4172, 18, 2681, 12, 2890, 18, 1968, 397, 10228, 69, 19486, 2665, 67, 15642, 273, 306, 7707, 69, 2187, 1924, 16, 296, 416, 6134, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3700, 67, 69, 12, 2890, 4672, 365, 18, 4172, 18, 2681, 12, 2890, 18, 1968, 397, 10228, 69, 19486, 2665, 67, 15642, 273, 306, 7707, 69, 2187, 1924, 16, 296, 416, 6134, 364, ...
buffer = "" while "\n" not in buffer:
self.buffer = "" while SERVER_QUIT not in self.buffer:
def run(self): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) global PORT PORT = test_support.bind_port(sock, HOST, PORT) sock.listen(1) conn, client = sock.accept() buffer = "" while "\n" not in buffer: data = conn.recv(1) if not data: break buffer = buffer + data while buffer: n = conn.send(buffer) buffer = buffer[n:] conn.close() sock.close()
0d7d2c9a092ad699c2677e319f3538df2719c720 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/0d7d2c9a092ad699c2677e319f3538df2719c720/test_asynchat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 7313, 273, 2987, 18, 7814, 12, 7814, 18, 6799, 67, 18819, 16, 2987, 18, 3584, 3507, 67, 13693, 13, 7313, 18, 4424, 27844, 12, 7814, 18, 19815, 67, 25699, 16, 2987...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 7313, 273, 2987, 18, 7814, 12, 7814, 18, 6799, 67, 18819, 16, 2987, 18, 3584, 3507, 67, 13693, 13, 7313, 18, 4424, 27844, 12, 7814, 18, 19815, 67, 25699, 16, 2987...
thread.interrupt_main()
if interruptable: thread.interrupt_main()
def interrupt_the_server(self): thread.interrupt_main()
c25d5763b7cc92394d03cfb915d6e37943930eac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/c25d5763b7cc92394d03cfb915d6e37943930eac/run.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13123, 67, 5787, 67, 3567, 12, 2890, 4672, 2650, 18, 31847, 67, 5254, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 13123, 67, 5787, 67, 3567, 12, 2890, 4672, 2650, 18, 31847, 67, 5254, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if type(cmd) == type(''): cmd = ['/bin/sh', '-c', cmd]
_cleanup()
def __init__(self, cmd, capturestderr=0, bufsize=-1): """The parameter 'cmd' is the shell command to execute in a sub-process. The 'capturestderr' flag, if true, specifies that the object should capture standard error output of the child process. The default is false. If the 'bufsize' parameter is specified, it specifies the size of the I/O buffers to/from the child process.""" if type(cmd) == type(''): cmd = ['/bin/sh', '-c', cmd] p2cread, p2cwrite = os.pipe() c2pread, c2pwrite = os.pipe() if capturestderr: errout, errin = os.pipe() self.pid = os.fork() if self.pid == 0: # Child os.close(0) os.close(1) if os.dup(p2cread) <> 0: sys.stderr.write('popen2: bad read dup\n') if os.dup(c2pwrite) <> 1: sys.stderr.write('popen2: bad write dup\n') if capturestderr: os.close(2) if os.dup(errin) <> 2: pass for i in range(3, MAXFD): try: os.close(i) except: pass try: os.execvp(cmd[0], cmd) finally: os._exit(1) # Shouldn't come here, I guess os._exit(1) os.close(p2cread) self.tochild = os.fdopen(p2cwrite, 'w', bufsize) os.close(c2pwrite) self.fromchild = os.fdopen(c2pread, 'r', bufsize) if capturestderr: os.close(errin) self.childerr = os.fdopen(errout, 'r', bufsize) else: self.childerr = None self.sts = -1 # Child not completed yet _active.append(self)
153a739f731cf942200e8506e1610b6782ce3e60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/153a739f731cf942200e8506e1610b6782ce3e60/popen2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1797, 16, 7477, 11241, 33, 20, 16, 1681, 1467, 29711, 21, 4672, 3536, 1986, 1569, 296, 4172, 11, 353, 326, 5972, 1296, 358, 1836, 316, 279, 720, 17, 2567...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1797, 16, 7477, 11241, 33, 20, 16, 1681, 1467, 29711, 21, 4672, 3536, 1986, 1569, 296, 4172, 11, 353, 326, 5972, 1296, 358, 1836, 316, 279, 720, 17, 2567...
raise TypeError, "%s is not of type BaseCPU", cpu
raise TypeError, "%s is not of type BaseCPU" % cpu
def switchCpus(cpuList): print "switching cpus" if not isinstance(cpuList, list): raise RuntimeError, "Must pass a list to this function" for i in cpuList: if not isinstance(i, tuple): raise RuntimeError, "List must have tuples of (oldCPU,newCPU)" [old_cpus, new_cpus] = zip(*cpuList) for cpu in old_cpus: if not isinstance(cpu, objects.BaseCPU): raise TypeError, "%s is not of type BaseCPU", cpu for cpu in new_cpus: if not isinstance(cpu, objects.BaseCPU): raise TypeError, "%s is not of type BaseCPU", cpu # Drain all of the individual CPUs drain_event = cc_main.createCountedDrain() unready_cpus = 0 for old_cpu in old_cpus: unready_cpus += old_cpu.startDrain(drain_event, False) # If we've got some objects that can't drain immediately, then simulate if unready_cpus > 0: drain_event.setCount(unready_cpus) simulate() cc_main.cleanupCountedDrain(drain_event) # Now all of the CPUs are ready to be switched out for old_cpu in old_cpus: old_cpu._ccObject.switchOut() index = 0 for new_cpu in new_cpus: new_cpu.takeOverFrom(old_cpus[index]) new_cpu._ccObject.resume() index += 1
ea5df468820c1c152ecd6932ac6a2a67b3f1725d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/ea5df468820c1c152ecd6932ac6a2a67b3f1725d/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1620, 39, 9861, 12, 11447, 682, 4672, 1172, 315, 9610, 310, 20620, 6, 309, 486, 1549, 12, 11447, 682, 16, 666, 4672, 1002, 7265, 16, 315, 10136, 1342, 279, 666, 358, 333, 445, 6, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1620, 39, 9861, 12, 11447, 682, 4672, 1172, 315, 9610, 310, 20620, 6, 309, 486, 1549, 12, 11447, 682, 16, 666, 4672, 1002, 7265, 16, 315, 10136, 1342, 279, 666, 358, 333, 445, 6, 364, ...
support.verbose = True
def test_main(verbose=False): if skip_expected: raise unittest.SkipTest("No SSL support") if support.verbose: plats = { 'Linux': platform.linux_distribution, 'Mac': platform.mac_ver, 'Windows': platform.win32_ver, } for name, func in plats.items(): plat = func() if plat and plat[0]: plat = '%s %r' % (name, plat) break else: plat = repr(platform.platform()) print("test_ssl: testing with %r %r" % (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO)) print(" under %s" % plat) for filename in [ CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE, ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY, BADCERT, BADKEY, EMPTYCERT]: if not os.path.exists(filename): raise support.TestFailed("Can't read certificate file %r" % filename) tests = [ContextTests, BasicSocketTests] if support.is_resource_enabled('network'): tests.append(NetworkedTests) if _have_threads: thread_info = support.threading_setup() if thread_info and support.is_resource_enabled('network'): tests.append(ThreadedTests) old_verbose = support.verbose try: support.verbose = True support.run_unittest(*tests) finally: support.verbose = old_verbose if _have_threads: support.threading_cleanup(*thread_info)
20134398a364e9042ada060a307fe08dbc538eb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/20134398a364e9042ada060a307fe08dbc538eb3/test_ssl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 12, 11369, 33, 8381, 4672, 309, 2488, 67, 3825, 30, 1002, 2836, 3813, 18, 6368, 4709, 2932, 2279, 7419, 2865, 7923, 225, 309, 2865, 18, 11369, 30, 886, 2323, 273, 288, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 12, 11369, 33, 8381, 4672, 309, 2488, 67, 3825, 30, 1002, 2836, 3813, 18, 6368, 4709, 2932, 2279, 7419, 2865, 7923, 225, 309, 2865, 18, 11369, 30, 886, 2323, 273, 288, ...
requestPath = "%s/%s" % (reqDir,requestName) if os.path.isfile(requestPath): candidateRequests.append(requestName) if not len(candidateRequests) > 0:
requestPath = "%s/%s" % ( reqDir, requestName ) if os.path.isfile( requestPath ): candidateRequests.append( requestName ) if not len( candidateRequests ) > 0:
def getRequest(self,requestType): """ Obtain a request from the database of a certain type """ gLogger.info("RequestDBFile._getRequest: Attempting to get %s type request." % requestType) try: # Determine the request name to be obtained candidateRequests = [] reqDir = '%s/%s/ToDo' % (self.root,requestType) self.getIdLock.acquire() if os.path.exists(reqDir): requestNames = os.listdir(reqDir) for requestName in requestNames: requestPath = "%s/%s" % (reqDir,requestName) if os.path.isfile(requestPath): candidateRequests.append(requestName) if not len(candidateRequests) > 0: self.getIdLock.release() gLogger.info("RequestDBFile._getRequest: No request of type %s found." % requestType) return S_OK()
457151afa0c3cb1200853bb72493b03e8f994fca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/457151afa0c3cb1200853bb72493b03e8f994fca/RequestDBFile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4328, 12, 2890, 16, 2293, 559, 4672, 3536, 24850, 279, 590, 628, 326, 2063, 434, 279, 8626, 618, 3536, 314, 3328, 18, 1376, 2932, 691, 2290, 812, 6315, 588, 691, 30, 12864, 310, 358, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4328, 12, 2890, 16, 2293, 559, 4672, 3536, 24850, 279, 590, 628, 326, 2063, 434, 279, 8626, 618, 3536, 314, 3328, 18, 1376, 2932, 691, 2290, 812, 6315, 588, 691, 30, 12864, 310, 358, 3...
return Popen(["losetup", "-sf", ('%s' % (image_path))], stdout=PIPE).communicate()[0].replace('\n', '')
return Popen(["losetup", "--show", "-f", ('%s' % (image_path))], stdout=PIPE).communicate()[0].replace('\n', '')
def create_loopback(image_path): return Popen(["losetup", "-sf", ('%s' % (image_path))], stdout=PIPE).communicate()[0].replace('\n', '')
3190d22f09f4aec7ce901b63e44de7f33719b6b8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12707/3190d22f09f4aec7ce901b63e44de7f33719b6b8/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 6498, 823, 12, 2730, 67, 803, 4672, 327, 14339, 3816, 6, 383, 8401, 3113, 5238, 4500, 3113, 3701, 74, 3113, 7707, 9, 87, 11, 738, 261, 2730, 67, 803, 3719, 6487, 3909, 33, 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 6498, 823, 12, 2730, 67, 803, 4672, 327, 14339, 3816, 6, 383, 8401, 3113, 5238, 4500, 3113, 3701, 74, 3113, 7707, 9, 87, 11, 738, 261, 2730, 67, 803, 3719, 6487, 3909, 33, 2...
stringtable_offset = self.dword_align(
new_stringtable_offset = self.dword_align(
def parse_version_information(self, version_struct): """Parse version information structure. The date will be made available in three attributes of the PE object. VS_VERSIONINFO will contain the first three fields of the main structure: 'Length', 'ValueLength', and 'Type' VS_FIXEDFILEINFO will hold the rest of the fields, accessible as sub-attributes: 'Signature', 'StrucVersion', 'FileVersionMS', 'FileVersionLS', 'ProductVersionMS', 'ProductVersionLS', 'FileFlagsMask', 'FileFlags', 'FileOS', 'FileType', 'FileSubtype', 'FileDateMS', 'FileDateLS' FileInfo is a list of all StringFileInfo and VarFileInfo structures. StringFileInfo structures will have a list as an attribute named 'StringTable' containing all the StringTable structures. Each of those structures contains a dictionary 'entries' with all the key/value version information string pairs. VarFileInfo structures will have a list as an attribute named 'Var' containing all Var structures. Each Var structure will have a dictionary as an attribute named 'entry' which will contain the name and value of the Var. """ # Retrieve the data for the version info resource # start_offset = self.get_offset_from_rva( version_struct.OffsetToData ) raw_data = self.__data__[ start_offset : start_offset+version_struct.Size ] # Map the main structure and the subsequent string # versioninfo_struct = self.__unpack_data__( self.__VS_VERSIONINFO_format__, raw_data, file_offset = start_offset ) if versioninfo_struct is None: return ustr_offset = version_struct.OffsetToData + versioninfo_struct.sizeof() try: versioninfo_string = self.get_string_u_at_rva( ustr_offset ) except PEFormatError, excp: self.__warnings.append( 'Error parsing the version information, ' + 'attempting to read VS_VERSION_INFO string. Can\'t ' + 'read unicode string at offset 0x%x' % ( ustr_offset ) ) versioninfo_string = None # If the structure does not contain the expected name, it's assumed to be invalid # if versioninfo_string != u'VS_VERSION_INFO': self.__warnings.append('Invalid VS_VERSION_INFO block') return # Set the PE object's VS_VERSIONINFO to this one # self.VS_VERSIONINFO = versioninfo_struct # The the Key attribute to point to the unicode string identifying the structure # self.VS_VERSIONINFO.Key = versioninfo_string # Process the fixed version information, get the offset and structure # fixedfileinfo_offset = self.dword_align( versioninfo_struct.sizeof() + 2 * (len(versioninfo_string) + 1), version_struct.OffsetToData) fixedfileinfo_struct = self.__unpack_data__( self.__VS_FIXEDFILEINFO_format__, raw_data[fixedfileinfo_offset:], file_offset = start_offset+fixedfileinfo_offset ) if not fixedfileinfo_struct: return # Set the PE object's VS_FIXEDFILEINFO to this one # self.VS_FIXEDFILEINFO = fixedfileinfo_struct # Start parsing all the StringFileInfo and VarFileInfo structures # # Get the first one # stringfileinfo_offset = self.dword_align( fixedfileinfo_offset + fixedfileinfo_struct.sizeof(), version_struct.OffsetToData) original_stringfileinfo_offset = stringfileinfo_offset # Set the PE object's attribute that will contain them all. # self.FileInfo = list() while True: # Process the StringFileInfo/VarFileInfo struct # stringfileinfo_struct = self.__unpack_data__( self.__StringFileInfo_format__, raw_data[stringfileinfo_offset:], file_offset = start_offset+stringfileinfo_offset ) if stringfileinfo_struct is None: self.__warnings.append( 'Error parsing StringFileInfo/VarFileInfo struct' ) return None # Get the subsequent string defining the structure. # ustr_offset = ( version_struct.OffsetToData + stringfileinfo_offset + versioninfo_struct.sizeof() ) try: stringfileinfo_string = self.get_string_u_at_rva( ustr_offset ) except PEFormatError, excp: self.__warnings.append( 'Error parsing the version information, ' + 'attempting to read StringFileInfo string. Can\'t ' + 'read unicode string at offset 0x%x' % ( ustr_offset ) ) break # Set such string as the Key attribute # stringfileinfo_struct.Key = stringfileinfo_string # Append the structure to the PE object's list # self.FileInfo.append(stringfileinfo_struct) # Parse a StringFileInfo entry # if stringfileinfo_string.startswith(u'StringFileInfo'): if stringfileinfo_struct.Type == 1 and stringfileinfo_struct.ValueLength == 0: stringtable_offset = self.dword_align( stringfileinfo_offset + stringfileinfo_struct.sizeof() + 2*(len(stringfileinfo_string)+1), version_struct.OffsetToData) stringfileinfo_struct.StringTable = list() # Process the String Table entries # while True: stringtable_struct = self.__unpack_data__( self.__StringTable_format__, raw_data[stringtable_offset:], file_offset = start_offset+stringtable_offset ) if not stringtable_struct: break ustr_offset = ( version_struct.OffsetToData + stringtable_offset + stringtable_struct.sizeof() ) try: stringtable_string = self.get_string_u_at_rva( ustr_offset ) except PEFormatError, excp: self.__warnings.append( 'Error parsing the version information, ' + 'attempting to read StringTable string. Can\'t ' + 'read unicode string at offset 0x%x' % ( ustr_offset ) ) break stringtable_struct.LangID = stringtable_string stringtable_struct.entries = dict() stringtable_struct.entries_offsets = dict() stringtable_struct.entries_lengths = dict() stringfileinfo_struct.StringTable.append(stringtable_struct) entry_offset = self.dword_align( stringtable_offset + stringtable_struct.sizeof() + 2*(len(stringtable_string)+1), version_struct.OffsetToData) # Process all entries in the string table # while entry_offset < stringtable_offset + stringtable_struct.Length: string_struct = self.__unpack_data__( self.__String_format__, raw_data[entry_offset:], file_offset = start_offset+entry_offset ) if not string_struct: break ustr_offset = ( version_struct.OffsetToData + entry_offset + string_struct.sizeof() ) try: key = self.get_string_u_at_rva( ustr_offset ) key_offset = self.get_offset_from_rva( ustr_offset ) except PEFormatError, excp: self.__warnings.append( 'Error parsing the version information, ' + 'attempting to read StringTable Key string. Can\'t ' + 'read unicode string at offset 0x%x' % ( ustr_offset ) ) break value_offset = self.dword_align( 2*(len(key)+1) + entry_offset + string_struct.sizeof(), version_struct.OffsetToData) ustr_offset = version_struct.OffsetToData + value_offset try: value = self.get_string_u_at_rva( ustr_offset, max_length = string_struct.ValueLength ) value_offset = self.get_offset_from_rva( ustr_offset ) except PEFormatError, excp: self.__warnings.append( 'Error parsing the version information, ' + 'attempting to read StringTable Value string. ' + 'Can\'t read unicode string at offset 0x%x' % ( ustr_offset ) ) break if string_struct.Length == 0: entry_offset = stringtable_offset + stringtable_struct.Length else: entry_offset = self.dword_align( string_struct.Length+entry_offset, version_struct.OffsetToData) key_as_char = [] for c in key: if ord(c)>128: key_as_char.append('\\x%02x' %ord(c)) else: key_as_char.append(c) key_as_char = ''.join(key_as_char) setattr(stringtable_struct, key_as_char, value) stringtable_struct.entries[key] = value stringtable_struct.entries_offsets[key] = (key_offset, value_offset) stringtable_struct.entries_lengths[key] = (len(key), len(value)) stringtable_offset = self.dword_align( stringtable_struct.Length + stringtable_offset, version_struct.OffsetToData) if stringtable_offset >= stringfileinfo_struct.Length: break # Parse a VarFileInfo entry # elif stringfileinfo_string.startswith( u'VarFileInfo' ): varfileinfo_struct = stringfileinfo_struct varfileinfo_struct.name = 'VarFileInfo' if varfileinfo_struct.Type == 1 and varfileinfo_struct.ValueLength == 0: var_offset = self.dword_align( stringfileinfo_offset + varfileinfo_struct.sizeof() + 2*(len(stringfileinfo_string)+1), version_struct.OffsetToData) varfileinfo_struct.Var = list() # Process all entries # while True: var_struct = self.__unpack_data__( self.__Var_format__, raw_data[var_offset:], file_offset = start_offset+var_offset ) if not var_struct: break ustr_offset = ( version_struct.OffsetToData + var_offset + var_struct.sizeof() ) try: var_string = self.get_string_u_at_rva( ustr_offset ) except PEFormatError, excp: self.__warnings.append( 'Error parsing the version information, ' + 'attempting to read VarFileInfo Var string. ' + 'Can\'t read unicode string at offset 0x%x' % (ustr_offset)) break varfileinfo_struct.Var.append(var_struct) varword_offset = self.dword_align( 2*(len(var_string)+1) + var_offset + var_struct.sizeof(), version_struct.OffsetToData) orig_varword_offset = varword_offset while varword_offset < orig_varword_offset + var_struct.ValueLength: word1 = self.get_word_from_data( raw_data[varword_offset:varword_offset+2], 0) word2 = self.get_word_from_data( raw_data[varword_offset+2:varword_offset+4], 0) varword_offset += 4 if isinstance(word1, (int, long)) and isinstance(word1, (int, long)): var_struct.entry = {var_string: '0x%04x 0x%04x' % (word1, word2)} var_offset = self.dword_align( var_offset+var_struct.Length, version_struct.OffsetToData) if var_offset <= var_offset+var_struct.Length: break # Increment and align the offset # stringfileinfo_offset = self.dword_align( stringfileinfo_struct.Length+stringfileinfo_offset, version_struct.OffsetToData) # Check if all the StringFileInfo and VarFileInfo items have been processed # if stringfileinfo_struct.Length == 0 or stringfileinfo_offset >= versioninfo_struct.Length: break
2d9ae5118e76681e72e598e9f96b21327af000ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/213/2d9ae5118e76681e72e598e9f96b21327af000ac/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1589, 67, 13117, 12, 2890, 16, 1177, 67, 1697, 4672, 3536, 3201, 1177, 1779, 3695, 18, 225, 1021, 1509, 903, 506, 7165, 2319, 316, 8925, 1677, 434, 326, 16628, 733, 18, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1589, 67, 13117, 12, 2890, 16, 1177, 67, 1697, 4672, 3536, 3201, 1177, 1779, 3695, 18, 225, 1021, 1509, 903, 506, 7165, 2319, 316, 8925, 1677, 434, 326, 16628, 733, 18, 225, ...
def wrapped_openconn(*args, **kwargs):
class TCPServerObj(): def __init__(self,sock): self.sock = sock def getconnection(self, *args,**kwargs): ip,port,conn = traced_call(self.sock,"TCPServerSocket.getconnection",self.sock.getconnection,args,kwargs) return (ip,port, SocketObj(conn)) def close(self, *args, **kwargs): return traced_call(self.sock,"TCPServerSocket.close",self.sock.close,args,kwargs,True) class UDPServerObj(): def __init__(self,sock): self.sock = sock def getmessage(self, *args,**kwargs): return traced_call(self.sock,"UDPServerSocket.getmessage",self.sock.getmessage,args,kwargs) def close(self, *args, **kwargs): return traced_call(self.sock,"UDPServerSocket.close",self.sock.close,args,kwargs,True) def wrapped_openconnection(*args, **kwargs):
def evaluate(self,*args,**kwargs): return traced_call(self.virt,"VirtualNamespace.evaluate",self.virt.evaluate,args,kwargs,print_args=False,print_result=False)
d4d3bf92076e2369dc442814f3f33a0ac55f20cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7279/d4d3bf92076e2369dc442814f3f33a0ac55f20cd/strace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 12, 2890, 16, 14, 1968, 16, 636, 4333, 4672, 327, 2606, 72, 67, 1991, 12, 2890, 18, 14035, 10837, 6466, 3402, 18, 21024, 3113, 2890, 18, 14035, 18, 21024, 16, 1968, 16, 4333, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 12, 2890, 16, 14, 1968, 16, 636, 4333, 4672, 327, 2606, 72, 67, 1991, 12, 2890, 18, 14035, 10837, 6466, 3402, 18, 21024, 3113, 2890, 18, 14035, 18, 21024, 16, 1968, 16, 4333, 16,...
def testLastDownException(): Event = Player.getMouseState() exceptionThrown = False try: pos = Event.lastdownpos except RuntimeError: exceptionRaised = True self.assert_(exceptionRaised)
def testLastDownException(): Event = Player.getMouseState() exceptionThrown = False try: pos = Event.lastdownpos except RuntimeError: exceptionRaised = True self.assert_(exceptionRaised)
256c9348759292b3d2768a243be442a321f0a417 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7300/256c9348759292b3d2768a243be442a321f0a417/Test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 3024, 4164, 503, 13332, 2587, 273, 19185, 18, 588, 9186, 1119, 1435, 1520, 29591, 273, 1083, 775, 30, 949, 273, 2587, 18, 2722, 2378, 917, 1335, 7265, 30, 1520, 12649, 5918, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 3024, 4164, 503, 13332, 2587, 273, 19185, 18, 588, 9186, 1119, 1435, 1520, 29591, 273, 1083, 775, 30, 949, 273, 2587, 18, 2722, 2378, 917, 1335, 7265, 30, 1520, 12649, 5918, 273, 1...
i,_ = first(lambda x: is_jcc(x[1][1].op), enumerate(taken.body)) remaining = set(x.op for _,x in taken.body[i+1:])
i, _ = first(lambda x: is_jcc(x[1][1].op), enumerate(taken.body)) remaining = set(x.op for _, x in taken.body[i+1:])
def get_branch_target(tbs): taken = get_taken_tb(tbs) i,_ = first(lambda x: is_jcc(x[1][1].op), enumerate(taken.body)) remaining = set(x.op for _,x in taken.body[i+1:]) if not remaining <= junk: raise ValueError("Real instructions remain after a branch! TB Split Fail") elif 'IFLO_MOVL_EIP_IM' in remaining: _,eipmov = first(lambda x: x[1].op == 'IFLO_MOVL_EIP_IM', taken.body) return eipmov.args[0] else: return "unknown"
63b309d6f3838e4cb5c2921faf3bb1472f46245c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4260/63b309d6f3838e4cb5c2921faf3bb1472f46245c/newslice.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7500, 67, 3299, 12, 88, 2038, 4672, 9830, 273, 336, 67, 29113, 67, 18587, 12, 88, 2038, 13, 277, 16, 389, 273, 1122, 12, 14661, 619, 30, 353, 67, 78, 952, 12, 92, 63, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7500, 67, 3299, 12, 88, 2038, 4672, 9830, 273, 336, 67, 29113, 67, 18587, 12, 88, 2038, 13, 277, 16, 389, 273, 1122, 12, 14661, 619, 30, 353, 67, 78, 952, 12, 92, 63, 21, ...
query = u"""REPLACE INTO monumenten(objrijksnr, woonplaats, adres, objectnaam, type_obj, oorspr_functie, bouwjaar, architect, cbs_tekst, RD_x, RD_y, lat, lon, source) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')""";
query = u"""REPLACE INTO monumenten(objrijksnr, woonplaats, adres, objectnaam, type_obj, oorspr_functie, bouwjaar, architect, cbs_tekst, RD_x, RD_y, lat, lon, image, source) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')""";
def updateMonument(contents, conn, cursor): query = u"""REPLACE INTO monumenten(objrijksnr, woonplaats, adres, objectnaam, type_obj, oorspr_functie, bouwjaar, architect, cbs_tekst, RD_x, RD_y, lat, lon, source) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')"""; cursor.execute(query % (contents.get(u'objrijksnr'), contents.get(u'woonplaats'), contents.get(u'adres'), contents.get(u'objectnaam'), contents.get(u'type_obj'), contents.get(u'oorspr_functie'), contents.get(u'bouwjaar'), contents.get(u'architect'), contents.get(u'cbs_tekst'), contents.get(u'RD_x'), contents.get(u'RD_y'), contents.get(u'lat'), contents.get(u'lon'), contents.get(u'source'))) #print u'updating!' #time.sleep(5)
3e481197873b9f1acb9c7c4c531c448bcfb35269 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7426/3e481197873b9f1acb9c7c4c531c448bcfb35269/update_database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 11415, 650, 12, 3980, 16, 1487, 16, 3347, 4672, 843, 273, 582, 8395, 21726, 12421, 6921, 650, 275, 12, 2603, 566, 78, 7904, 11611, 16, 341, 83, 265, 412, 69, 2323, 16, 1261, 455,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 11415, 650, 12, 3980, 16, 1487, 16, 3347, 4672, 843, 273, 582, 8395, 21726, 12421, 6921, 650, 275, 12, 2603, 566, 78, 7904, 11611, 16, 341, 83, 265, 412, 69, 2323, 16, 1261, 455,...
module_name = get_containing_module(value) if inspect.ismodule(sys.modules.get(module_name)):
module_name = str(get_containing_module(value)) module = sys.modules.get(module_name) if module is not None and inspect.ismodule(module):
def _get_valuedoc(value): """ If a C{ValueDoc} for the given value exists in the valuedoc cache, then return it; otherwise, create a new C{ValueDoc}, add it to the cache, and return it. When possible, the new C{ValueDoc}'s C{pyval}, C{repr}, and C{canonical_name} attributes will be set appropriately. """ pyid = id(value) val_doc = _valuedoc_cache.get(pyid) if val_doc is None: try: canonical_name = get_canonical_name(value) except DottedName.Invalid: canonical_name = UNKNOWN val_doc = ValueDoc(pyval=value, repr=value_repr(value), canonical_name = canonical_name, docs_extracted_by='introspecter') _valuedoc_cache[pyid] = val_doc # If it's a module, then do some preliminary introspection. # Otherwise, check what the containing module is (used e.g. # to decide what markup language should be used for docstrings) if inspect.ismodule(value): introspect_module(value, val_doc, preliminary=True) val_doc.defining_module = val_doc else: module_name = get_containing_module(value) #if (module_name and module_name in sys.modules and if inspect.ismodule(sys.modules.get(module_name)): val_doc.defining_module = _get_valuedoc(module) return val_doc
2f91f6739b31a4ab0e43cbe279fd91f4e9bb9708 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/2f91f6739b31a4ab0e43cbe279fd91f4e9bb9708/docintrospecter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 4531, 329, 504, 12, 1132, 4672, 3536, 971, 279, 385, 95, 620, 1759, 97, 364, 326, 864, 460, 1704, 316, 326, 31037, 504, 1247, 16, 1508, 327, 518, 31, 3541, 16, 752, 279...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 4531, 329, 504, 12, 1132, 4672, 3536, 971, 279, 385, 95, 620, 1759, 97, 364, 326, 864, 460, 1704, 316, 326, 31037, 504, 1247, 16, 1508, 327, 518, 31, 3541, 16, 752, 279...
'null' : True,
'null' : null_ok,
def query(self, query_string, max_rows=None, query_data=None): """ foo """
47f34379ee083a1c22cf9aa3596ee0adbffbbc22 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6817/47f34379ee083a1c22cf9aa3596ee0adbffbbc22/da.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 12, 2890, 16, 843, 67, 1080, 16, 943, 67, 3870, 33, 7036, 16, 843, 67, 892, 33, 7036, 4672, 3536, 8431, 3536, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 12, 2890, 16, 843, 67, 1080, 16, 943, 67, 3870, 33, 7036, 16, 843, 67, 892, 33, 7036, 4672, 3536, 8431, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
class PersistentObject:
class Options: def __init__(self,*args): libBALLc.sipCallCtor(72,self,args) class String:
def __init__(self,*args): libBALLc.sipCallCtor(73,self,args)
6143cd22f226534836314b76952f50c72ab34763 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5247/6143cd22f226534836314b76952f50c72ab34763/BALL.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 14, 1968, 4672, 2561, 38, 4685, 71, 18, 28477, 1477, 27425, 12, 9036, 16, 2890, 16, 1968, 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, 0, 0, 0, 0, 0, 0, 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, 14, 1968, 4672, 2561, 38, 4685, 71, 18, 28477, 1477, 27425, 12, 9036, 16, 2890, 16, 1968, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
TixWidget.__init__(self,master,'tixNoteBook', ['options'], cnf, kw) self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe', destroy_physically=0)
TixWidget.__init__(self,master,'tixNoteBook', ['options'], cnf, kw) self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe', destroy_physically=0)
def __init__ (self,master=None,cnf={}, **kw):
b0e44d61d9e592e1acd6aa05eac9704ba5776f61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b0e44d61d9e592e1acd6aa05eac9704ba5776f61/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 7525, 33, 7036, 16, 10305, 74, 28793, 2826, 9987, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 7525, 33, 7036, 16, 10305, 74, 28793, 2826, 9987, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
cmd = cmdAndArgs.pop(0) if cmd.count('='): key, value = cmd.split('=', 1)
piece = cmdAndArgs.pop(0) if piece.count('='): key, value = piece.split('=', 1)
def runCommand(self): if not len(self.cmdpending): self.showPrompt() return line = self.cmdpending.pop(0) try: cmdAndArgs = shlex.split(line) except: self.honeypot.writeln( '-bash: syntax error: unexpected end of file') # could run runCommand here, but i'll just clear the list instead self.cmdpending = [] self.showPrompt() return
34a99b876fc0cdda0a3719aa834d94242c2b318c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7245/34a99b876fc0cdda0a3719aa834d94242c2b318c/honeypot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31933, 12, 2890, 4672, 309, 486, 562, 12, 2890, 18, 4172, 9561, 4672, 365, 18, 4500, 15967, 1435, 327, 980, 273, 365, 18, 4172, 9561, 18, 5120, 12, 20, 13, 775, 30, 1797, 1876, 2615, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31933, 12, 2890, 4672, 309, 486, 562, 12, 2890, 18, 4172, 9561, 4672, 365, 18, 4500, 15967, 1435, 327, 980, 273, 365, 18, 4172, 9561, 18, 5120, 12, 20, 13, 775, 30, 1797, 1876, 2615, ...
elif task.info("USER_interactive"):
elif task.default("USER_interactive"):
def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgrp = optparse.OptionGroup(parser, "Selecting target nodes") optgrp.add_option("-w", action="append", dest="nodes", help="nodes where to run the command") optgrp.add_option("-x", action="append", dest="exclude", help="exclude nodes from the node list") optgrp.add_option("-a", "--all", action="store_true", dest="nodes_all", help="run command on all nodes") optgrp.add_option("-g", "--group", action="append", dest="group", help="run command on a group of nodes") optgrp.add_option("-X", action="append", dest="exgroup", help="exclude nodes from this group") parser.add_option_group(optgrp) # Output behaviour optgrp = optparse.OptionGroup(parser, "Output behaviour") optgrp.add_option("-q", "--quiet", action="store_true", dest="quiet", help="be quiet, print essential output only") optgrp.add_option("-v", "--verbose", action="store_true", dest="verbose", help="be verbose, print informative messages") optgrp.add_option("-d", "--debug", action="store_true", dest="debug", help="output more messages for debugging purpose") optgrp.add_option("-N", action="store_false", dest="label", default=True, help="disable labeling of command line") optgrp.add_option("-S", action="store_true", dest="maxrc", help="return the largest of command return codes") optgrp.add_option("-b", "--dshbak", action="store_true", dest="gather", help="display results in a dshbak-like way") parser.add_option_group(optgrp) # Copy optgrp = optparse.OptionGroup(parser, "File copying") optgrp.add_option("-c", "--copy", action="store", dest="source_path", help="copy local file or directory to the nodes") optgrp.add_option("--dest", action="store", dest="dest_path", help="destination file or directory on the nodes") optgrp.add_option("-p", action="store_true", dest="preserve_flag", help="preserve modification times and modes") parser.add_option_group(optgrp) # Ssh options optgrp = optparse.OptionGroup(parser, "Ssh options") optgrp.add_option("-f", "--fanout", action="store", dest="fanout", help="use a specified fanout", type="int") optgrp.add_option("-l", "--user", action="store", dest="user", help="execute remote command as user") optgrp.add_option("-o", "--options", action="store", dest="options", help="can be used to give ssh options") optgrp.add_option("-t", "--connect_timeout", action="store", dest="connect_timeout", help="limit time to connect to a node" ,type="float") optgrp.add_option("-u", "--command_timeout", action="store", dest="command_timeout", help="limit time for command to run on the node", type="float") parser.add_option_group(optgrp) (options, args) = parser.parse_args() # # Load config file # config = ClushConfig(options) # Apply command line overrides if options.quiet: config.set_main("verbosity", VERB_QUIET) if options.verbose: config.set_main("verbosity", VERB_VERB) if options.debug: config.set_main("verbosity", VERB_DEBUG) if options.fanout: config.set_main("fanout", options.fanout) if options.user: config.set_main("ssh_user", options.user) if options.options: config.set_main("ssh_options", options.options) if options.connect_timeout: config.set_main("connect_timeout", options.connect_timeout) if options.command_timeout: config.set_main("command_timeout", options.command_timeout) # # Compute the nodeset # if options.nodes: nodeset_base = NodeSet.fromlist(options.nodes) if options.exclude: nodeset_exclude = NodeSet.fromlist(options.exclude) # Do we have nodes group? task = task_self() task.set_info("debug", config.get_verbosity() > 1) if options.nodes_all: command = config.get_nodes_all_command() task.shell(command, key="all") if options.group: for grp in options.group: command = config.get_nodes_group_command(grp) task.shell(command, key="group") if options.exgroup: for grp in options.exgroup: command = config.get_nodes_group_command(grp) task.shell(command, key="exgroup") # Run needed external commands task.resume() for buf, keys in task.iter_buffers(['all', 'group']): for line in buf.splitlines(): config.verbose_print(VERB_DEBUG, "Adding nodes from option %s: %s" % (','.join(keys), buf)) nodeset_base.add(line) for buf, keys in task.iter_buffers(['exgroup']): for line in buf.splitlines(): config.verbose_print(VERB_DEBUG, "Excluding nodes from option %s: %s" % (','.join(keys), buf)) nodeset_exclude.add(line) # Do we have an exclude list? (-x ...) nodeset_base.difference_update(nodeset_exclude) if len(nodeset_base) < 1: parser.error('No node to run on.') config.verbose_print(VERB_DEBUG, "Final NodeSet is %s" % nodeset_base) # # Task management # user_interaction = sys.stdin.isatty() and sys.stdout.isatty() if user_interaction: # Standard input is a terminal and we want to perform some user # interactions in the main thread (using blocking calls), so # we run cluster commands in a new ClusterShell Task (a new # thread is created). task = Task() signal.signal(signal.SIGHUP, signal_handler) task.set_info("USER_handle_SIGHUP", True) else: # Perform everything in main thread. task.set_info("USER_handle_SIGHUP", False) task.set_info("debug", config.get_verbosity() >= VERB_DEBUG) task.set_info("fanout", config.get_fanout()) ssh_user = config.get_ssh_user() if ssh_user: task.set_info("ssh_user", ssh_user) ssh_path = config.get_ssh_path() if ssh_path: task.set_info("ssh_path", ssh_path) ssh_options = config.get_ssh_options() if ssh_options: task.set_info("ssh_options", ssh_options) # Set detailed timeout values connect_timeout = config.get_connect_timeout() task.set_info("connect_timeout", connect_timeout) command_timeout = config.get_command_timeout() task.set_info("command_timeout", command_timeout) # Enable stdout/stderr separation task.set_default("stderr", True) # Set timeout at worker level when command_timeout is defined. if command_timeout > 0: timeout = command_timeout else: timeout = -1 # Configure custom task related status task.set_info("USER_interactive", len(args) == 0 and not options.source_path) task.set_info("USER_running", False) if options.source_path and not options.dest_path: options.dest_path = options.source_path if options.source_path: if not options.dest_path: options.dest_path = options.source_path op = "copy source=%s dest=%s" % (options.source_path, options.dest_path) else: op = "command=\"%s\"" % ' '.join(args) config.verbose_print(VERB_VERB, "clush: nodeset=%s fanout=%d [timeout conn=%.1f " \ "cmd=%.1f] %s" % (nodeset_base, task.info("fanout"), task.info("connect_timeout"), task.info("command_timeout"), op)) if not task.info("USER_interactive"): if options.source_path: if not options.dest_path: options.dest_path = options.source_path run_copy(task, options.source_path, options.dest_path, nodeset_base, 0, options.preserve_flag) else: run_command(task, ' '.join(args), nodeset_base, options.gather, timeout, options.label, config.get_verbosity()) if user_interaction: ttyloop(task, nodeset_base, options.gather, timeout, options.label, config.get_verbosity()) elif task.info("USER_interactive"): print >>sys.stderr, "ERROR: interactive mode requires a tty" clush_exit(1) rc = 0 if options.maxrc: # Instead of clush return code, return commands retcode rc = task.max_retcode() if task.num_timeout() > 0: rc = 255 clush_exit(rc)
b1a858775a0c2d9702d6d8c6329507066a5d4dd6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11479/b1a858775a0c2d9702d6d8c6329507066a5d4dd6/clush.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 927, 1218, 67, 5254, 12, 1968, 4672, 3536, 6376, 927, 1218, 2728, 445, 8395, 225, 468, 2989, 924, 2199, 278, 67, 1969, 16, 2199, 278, 67, 10157, 273, 2029, 694, 9334, 2029, 694, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 927, 1218, 67, 5254, 12, 1968, 4672, 3536, 6376, 927, 1218, 2728, 445, 8395, 225, 468, 2989, 924, 2199, 278, 67, 1969, 16, 2199, 278, 67, 10157, 273, 2029, 694, 9334, 2029, 694, 1435, ...
self.setupJob(self.__prog__,tag_base=tag_base, dir=dir)
self.name = os.path.split(self.__executable.rstrip('/'))[1] self.setupJob(name=self.name,tag_base=tag_base, dir=dir)
def __init__(self, opts, cp, dir='', tag_base="effDRatioTest"): """ """ self.__conditionalLoadDefaults__(effDRatioJob.defaults,cp) self.__prog__ = 'effDRatioTest' self.__executable = string.strip(cp.get('fu-condor','effDRatio')) self.__universe = string.strip(cp.get('fu-condor','universe')) pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) self.add_condor_cmd('getenv','True') self.setupJob(self.__prog__,tag_base=tag_base, dir=dir)
e7dc96264f8fa6761fca7488785053e6db4d6c14 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/e7dc96264f8fa6761fca7488785053e6db4d6c14/stfu_pipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1500, 16, 3283, 16, 1577, 2218, 2187, 1047, 67, 1969, 1546, 17098, 6331, 4197, 4709, 6, 4672, 3536, 3536, 365, 16186, 22019, 2563, 7019, 972, 12, 17098, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1500, 16, 3283, 16, 1577, 2218, 2187, 1047, 67, 1969, 1546, 17098, 6331, 4197, 4709, 6, 4672, 3536, 3536, 365, 16186, 22019, 2563, 7019, 972, 12, 17098, 63...
self.filename = self.occurrence[0][0]
self.filename = self.occurrence[0]
def __init__(self,occurrence): self.occurrence = occurrence self.filename = self.occurrence[0][0]
d21852a5d175cfafac72e74b2b4724e65f7484f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5109/d21852a5d175cfafac72e74b2b4724e65f7484f2/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 31177, 4672, 365, 18, 31177, 273, 13083, 365, 18, 3459, 273, 365, 18, 31177, 63, 20, 6362, 20, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 31177, 4672, 365, 18, 31177, 273, 13083, 365, 18, 3459, 273, 365, 18, 31177, 63, 20, 6362, 20, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -10...
size = xiso.size
total_size = xiso.size
def extract_xiso(self): # get infos from ui filename = self.ui_entry_xiso.get_text() local_folder = self.ui_entry_folder.get_text() ftp_folder = "/g/tmp" ftp_ip = self.ui_entry_xbox_address.get_text() ftp_login = self.ui_entry_xbox_login.get_text() ftp_password = self.ui_entry_xbox_password.get_text() # init progress dialog progress = DialogProgress() progress.set_current_operation(_("Parsing")) gtk_iteration()
338bdf073aa945bc2e78bd55fb9f2572ce818c0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2692/338bdf073aa945bc2e78bd55fb9f2572ce818c0e/gxiso.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 67, 5674, 83, 12, 2890, 4672, 468, 336, 10626, 628, 5915, 1544, 273, 365, 18, 4881, 67, 4099, 67, 5674, 83, 18, 588, 67, 955, 1435, 1191, 67, 5609, 273, 365, 18, 4881, 67, 4099...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 67, 5674, 83, 12, 2890, 4672, 468, 336, 10626, 628, 5915, 1544, 273, 365, 18, 4881, 67, 4099, 67, 5674, 83, 18, 588, 67, 955, 1435, 1191, 67, 5609, 273, 365, 18, 4881, 67, 4099...
Manufacturer=u"Martin v. L\xf6wis")
Manufacturer=u"Python Software Foundation")
def build_database(): """Generate an empty database, with just the schema and the Summary information stream.""" if snapshot: uc = upgrade_code_snapshot else: uc = upgrade_code # schema represents the installer 2.0 database schema. # sequence is the set of standard sequences # (ui/execute, admin/advt/install) db = msilib.init_database("python-%s%s.msi" % (full_current_version, msilib.arch_ext), schema, ProductName="Python "+full_current_version, ProductCode=product_code, ProductVersion=current_version, Manufacturer=u"Martin v. L\xf6wis") # The default sequencing of the RemoveExistingProducts action causes # removal of files that got just installed. Place it after # InstallInitialize, so we first uninstall everything, but still roll # back in case the installation is interrupted msilib.change_sequence(sequence.InstallExecuteSequence, "RemoveExistingProducts", 1510) msilib.add_tables(db, sequence) # We cannot set ALLUSERS in the property table, as this cannot be # reset if the user choses a per-user installation. Instead, we # maintain WhichUsers, which can be "ALL" or "JUSTME". The UI manages # this property, and when the execution starts, ALLUSERS is set # accordingly. add_data(db, "Property", [("UpgradeCode", uc), ("WhichUsers", "ALL"), ("ProductLine", "Python%s%s" % (major, minor)), ]) db.Commit() return db
8bc77e4b33dce913a13be3ad0f3b11d4292c78ba /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/8bc77e4b33dce913a13be3ad0f3b11d4292c78ba/msi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 6231, 13332, 3536, 4625, 392, 1008, 2063, 16, 598, 2537, 326, 1963, 471, 326, 17967, 1779, 1407, 12123, 309, 4439, 30, 6232, 273, 8400, 67, 710, 67, 11171, 469, 30, 6232, 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, 1361, 67, 6231, 13332, 3536, 4625, 392, 1008, 2063, 16, 598, 2537, 326, 1963, 471, 326, 17967, 1779, 1407, 12123, 309, 4439, 30, 6232, 273, 8400, 67, 710, 67, 11171, 469, 30, 6232, 273, ...
if resourcecount <= 0:
if resourcecount <= 0 and not resource.hastag( 'resource_empty' ): resource.settag( 'resource_empty', 'true' ) resource.addtimer( woodrespawndelay, "skills.lumberjacking.respawnvein", [], True ) socket.clilocmessage( 500488, '', GRAY ) return False elif resource.hastag( 'resource_empty' ):
def hack_logs( char, target, tool, resource ): socket = char.socket pos = target.pos resname = resource.gettag( 'resname' ) amount = resource.gettag( 'resourcecount' ) resourcecount = int(resource.gettag( 'resourcecount' )) # No resource left to harvest? if resourcecount <= 0: socket.clilocmessage( 500488, '', GRAY ) return False # Turn to our lumberjacking position direction = char.directionto( pos ) if char.direction != direction: char.direction = direction char.updateflags() # Let him hack char.action( 0xd ) char.soundeffect( 0x13e ) char.addtimer( 2000, "skills.lumberjacking.chop_tree", [pos] ) char.addtimer( 3500, "skills.lumberjacking.chop_tree", [pos] ) char.addtimer( 4000, "skills.lumberjacking.successlumberjacking", [pos, resource.serial, amount, tool.serial, resname, woodtable ] ) return
51c43553980d27f067d6941661cdfa9a5efc9576 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/51c43553980d27f067d6941661cdfa9a5efc9576/lumberjacking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11769, 67, 10011, 12, 1149, 16, 1018, 16, 5226, 16, 1058, 262, 30, 2987, 273, 1149, 18, 7814, 949, 273, 1018, 18, 917, 225, 400, 529, 273, 1058, 18, 588, 2692, 12, 296, 455, 529, 11,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11769, 67, 10011, 12, 1149, 16, 1018, 16, 5226, 16, 1058, 262, 30, 2987, 273, 1149, 18, 7814, 949, 273, 1018, 18, 917, 225, 400, 529, 273, 1058, 18, 588, 2692, 12, 296, 455, 529, 11,...
eligible, pref_vers = _filterProviders(providers, item, cfgData, dataCache)
eligible = _filterProviders(providers, item, cfgData, dataCache)
def filterProviders(providers, item, cfgData, dataCache): """ Take a list of providers and filter/reorder according to the environment variables and previous build results Takes a "normal" target item """ eligible, pref_vers = _filterProviders(providers, item, cfgData, dataCache) prefervar = bb.data.getVar('PREFERRED_PROVIDER_%s' % item, cfgData, 1) if prefervar: dataCache.preferred[item] = prefervar foundUnique = False if item in dataCache.preferred: for p in eligible: pn = dataCache.pkg_fn[p] if dataCache.preferred[item] == pn: bb.msg.note(2, bb.msg.domain.Provider, "selecting %s to satisfy %s due to PREFERRED_PROVIDERS" % (pn, item)) eligible.remove(p) eligible = [p] + eligible foundUnique = True break return eligible, foundUnique
3d2fa443ab7237256a2f59947e4536e4200a2cec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2672/3d2fa443ab7237256a2f59947e4536e4200a2cec/providers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 10672, 12, 17520, 16, 761, 16, 2776, 751, 16, 501, 1649, 4672, 3536, 17129, 279, 666, 434, 9165, 471, 1034, 19, 266, 1019, 4888, 358, 326, 3330, 3152, 471, 2416, 1361, 1686, 23004,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 10672, 12, 17520, 16, 761, 16, 2776, 751, 16, 501, 1649, 4672, 3536, 17129, 279, 666, 434, 9165, 471, 1034, 19, 266, 1019, 4888, 358, 326, 3330, 3152, 471, 2416, 1361, 1686, 23004,...
'wrk': array([],float), 'iwrk':array([],intc)}
'wrk': array([],float), 'iwrk':array([],int32)}
#def _curfit(x,y,w=None,xb=None,xe=None,k=3,task=0,s=None,t=None,
9a0347e760bcb96ee1fc399da0a604243f75cec4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/9a0347e760bcb96ee1fc399da0a604243f75cec4/fitpack.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 536, 389, 1397, 7216, 12, 92, 16, 93, 16, 91, 33, 7036, 16, 6114, 33, 7036, 16, 6554, 33, 7036, 16, 79, 33, 23, 16, 4146, 33, 20, 16, 87, 33, 7036, 16, 88, 33, 7036, 16, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 536, 389, 1397, 7216, 12, 92, 16, 93, 16, 91, 33, 7036, 16, 6114, 33, 7036, 16, 6554, 33, 7036, 16, 79, 33, 23, 16, 4146, 33, 20, 16, 87, 33, 7036, 16, 88, 33, 7036, 16, 2, -100...
t = s.triple sink.makeStatement(self.extern(t))
sink.makeStatement(self.extern(s.triple))
def _outputStatement(self, sink, s): t = s.triple sink.makeStatement(self.extern(t))
a7d0c800568125609e0fc58e331b9a6f318031c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/a7d0c800568125609e0fc58e331b9a6f318031c6/cwm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2844, 3406, 12, 2890, 16, 9049, 16, 272, 4672, 268, 273, 272, 18, 313, 2444, 9049, 18, 6540, 3406, 12, 2890, 18, 338, 798, 12, 88, 3719, 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, 389, 2844, 3406, 12, 2890, 16, 9049, 16, 272, 4672, 268, 273, 272, 18, 313, 2444, 9049, 18, 6540, 3406, 12, 2890, 18, 338, 798, 12, 88, 3719, 2, -100, -100, -100, -100, -100, -100, -...
print '\t</networkconfig>'
self.addText('\t</networkconfig>\n')
def networkconfig(self): cmd = '/sbin/ifconfig -a'
9190171333e66c6f91c59d77bb2e033ed64a77e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7066/9190171333e66c6f91c59d77bb2e033ed64a77e1/bug.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2483, 1425, 12, 2890, 4672, 1797, 273, 1173, 87, 4757, 19, 430, 1425, 300, 69, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2483, 1425, 12, 2890, 4672, 1797, 273, 1173, 87, 4757, 19, 430, 1425, 300, 69, 11, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
persons = Persons(self.api, person_id_or_email_list)
if 'admin' not in self.caller['roles']: persons = filter(self.caller.can_view, persons)
def call(self, auth, person_id_or_email_list = None, return_fields = None): # Make sure that only valid fields are specified if return_fields is None: return_fields = self.return_fields elif filter(lambda field: field not in self.return_fields, return_fields): raise PLCInvalidArgument, "Invalid return field specified"
b59c1f2352daed8a33f3aad2690d883bf443ff9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/b59c1f2352daed8a33f3aad2690d883bf443ff9b/GetPersons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 1357, 16, 6175, 67, 350, 67, 280, 67, 3652, 67, 1098, 273, 599, 16, 327, 67, 2821, 273, 599, 4672, 468, 4344, 3071, 716, 1338, 923, 1466, 854, 1269, 309, 327, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 1357, 16, 6175, 67, 350, 67, 280, 67, 3652, 67, 1098, 273, 599, 16, 327, 67, 2821, 273, 599, 4672, 468, 4344, 3071, 716, 1338, 923, 1466, 854, 1269, 309, 327, 67, ...
security.declareProtected(Perms.manage_properties, 'get_deliverSettingsByKey')
security.declareProtected(Perms.manage_properties, 'get_deliverySettingsByKey')
def set_disableDigestByKey(self, key): """ Disable the email digest for a given key. The key normally represents a group, but may represent something else in the future. """ digest_property = '%s_digest' % key # we don't create the property if it doesn't exist if self.hasProperty(digest_property): self.manage_changeProperties({digest_property: 0})
fd6593b485d9111c670c7588d47012a405682f36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6270/fd6593b485d9111c670c7588d47012a405682f36/CustomUser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 8394, 9568, 14560, 12, 2890, 16, 498, 4672, 3536, 10639, 326, 2699, 5403, 364, 279, 864, 498, 18, 225, 1021, 498, 15849, 8686, 279, 1041, 16, 1496, 2026, 2406, 5943, 469, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 8394, 9568, 14560, 12, 2890, 16, 498, 4672, 3536, 10639, 326, 2699, 5403, 364, 279, 864, 498, 18, 225, 1021, 498, 15849, 8686, 279, 1041, 16, 1496, 2026, 2406, 5943, 469, 316, ...
'/usr/include/db3',
'/usr/local/include/db3',
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')
ccfdde86eb56b5e24d44e18aa1c276be475aeee2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ccfdde86eb56b5e24d44e18aa1c276be475aeee2/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, ...
buffers.append(data)
def readline(self, size=-1): data = self._rbuf if size < 0: # Read until \n or EOF, whichever comes first if self._rbufsize <= 1: # Speed up unbuffered case assert data == "" buffers = [] recv = self._sock.recv while data != "\n": data = recv(1) if not data: break buffers.append(data) return "".join(buffers) nl = data.find('\n') if nl >= 0: nl += 1 self._rbuf = data[nl:] return data[:nl] buffers = [] if data: buffers.append(data) self._rbuf = "" while True: data = self._sock.recv(self._rbufsize) if not data: break buffers.append(data) nl = data.find('\n') if nl >= 0: nl += 1 self._rbuf = data[nl:] buffers[-1] = data[:nl] break return "".join(buffers) else: # Read until size bytes or \n or EOF seen, whichever comes first nl = data.find('\n', 0, size) if nl >= 0: nl += 1 self._rbuf = data[nl:] return data[:nl] buf_len = len(data) if buf_len >= size: self._rbuf = data[size:] return data[:size] buffers = [] if data: buffers.append(data) self._rbuf = "" while True: data = self._sock.recv(self._rbufsize) if not data: break buffers.append(data) left = size - buf_len nl = data.find('\n', 0, left) if nl >= 0: nl += 1 self._rbuf = data[nl:] buffers[-1] = data[:nl] break n = len(data) if n >= left: self._rbuf = data[left:] buffers[-1] = data[:left] break buf_len += n return "".join(buffers)
8f96b3937325bb2c07511f62915490ab796e078a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/8f96b3937325bb2c07511f62915490ab796e078a/socket.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12023, 12, 2890, 16, 963, 29711, 21, 4672, 501, 273, 365, 6315, 86, 4385, 309, 963, 411, 374, 30, 468, 2720, 3180, 521, 82, 578, 6431, 16, 600, 335, 580, 502, 14535, 1122, 309, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12023, 12, 2890, 16, 963, 29711, 21, 4672, 501, 273, 365, 6315, 86, 4385, 309, 963, 411, 374, 30, 468, 2720, 3180, 521, 82, 578, 6431, 16, 600, 335, 580, 502, 14535, 1122, 309, 365, ...
ret = self.lock.acquire( blocking ) if ret : self.timer = Timer( timeout, self.timeoutFunc ) self.timer.start() return ret def release( self ) : ret = False self.timer.cancel() del self.timer self.timer = None try: ret =self.lock.release() except : print "Error: unlock lock released"
def acquire( self, blocking=1, timeout = CALLWAIT_TIMEOUT-10 ) : #print "Acquire: blocking = ", blocking if blocking : ret = self.lock.acquire() self.timer = Timer( timeout, self.timeoutFunc ) self.timer.start() else : ret = self.lock.acquire( blocking ) if ret : self.timer = Timer( timeout, self.timeoutFunc ) self.timer.start() #print "Acquired: blocking = ", blocking, " retrun = ", ret return ret
cd8008197b677b62a25f3a0a833ab48b6a03ccbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/cd8008197b677b62a25f3a0a833ab48b6a03ccbe/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10533, 12, 365, 16, 9445, 33, 21, 16, 2021, 273, 22753, 19046, 67, 9503, 17, 2163, 262, 294, 468, 1188, 315, 27761, 30, 9445, 273, 3104, 9445, 309, 9445, 294, 325, 273, 365, 18, 739, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10533, 12, 365, 16, 9445, 33, 21, 16, 2021, 273, 22753, 19046, 67, 9503, 17, 2163, 262, 294, 468, 1188, 315, 27761, 30, 9445, 273, 3104, 9445, 309, 9445, 294, 325, 273, 365, 18, 739, ...
self.error()
if self.debug: self.error()
def run(self, input_lines, input_offset=0, context=None, input_source=None): """ Run the state machine on `input_lines`. Return results (a list).
6b98eebdb7235e0fece6d58172ba72cf7c2703f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/6b98eebdb7235e0fece6d58172ba72cf7c2703f3/statemachine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 16, 810, 67, 3548, 16, 810, 67, 3348, 33, 20, 16, 819, 33, 7036, 16, 810, 67, 3168, 33, 7036, 4672, 3536, 1939, 326, 919, 5228, 603, 1375, 2630, 67, 3548, 8338, 2000,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1086, 12, 2890, 16, 810, 67, 3548, 16, 810, 67, 3348, 33, 20, 16, 819, 33, 7036, 16, 810, 67, 3168, 33, 7036, 4672, 3536, 1939, 326, 919, 5228, 603, 1375, 2630, 67, 3548, 8338, 2000,...
continue
continue
def firstTriangle(cache, dimensions, progressCallback = None, **args): if len(cache.contAttributes) == 1: return triangles1D(cache, False) if not cache.points: cache.points = orange.ExampleTable(orange.Domain(cache.contAttributes, cache.data.domain.classVar), cache.data).native(0) points = cache.points npoints = len(points) if not cache.tri: cache.tri = triangulate(cache, points) tri = cache.tri if not cache.stars: cache.stars = [star(x, tri) for x in xrange(npoints)] S = cache.stars if not cache.dts: cache.dts = [min([ min([ dist(points[x][:-1],points[v][:-1]) for v in simplex if v!=x], 0) for simplex in S[x]], 0)*.1 for x in xrange(npoints)] if progressCallback: nPoints = 100.0/npoints for x, (S, xp, dt, deltas) in enumerate(zip(cache.stars, points, cache.dts, cache.deltas)): for d in dimensions: xn = xp[:-1] DBG=0 if xn[0]>16 and xn[1]<44.5 and xn[1]>43: #if xn[0]>4.7 and xn[0]<4.9 and xn[1]<24.5 and xn[1]>23.5: DBG=1 print "DBG" O = numpy.array(xp[:-1]) xn[d] += dt swx = simplex_with_xn(cache, xn, S) if swx: if DBG: print "iskanje cudnih trikotnikov" print swx print [points[k] for k in swx] obrni = 1
45c3545d7cec5ecfb8951397d1a6a5002a7e27f7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/45c3545d7cec5ecfb8951397d1a6a5002a7e27f7/orngPade.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1122, 31506, 12, 2493, 16, 5769, 16, 4007, 2428, 273, 599, 16, 2826, 1968, 4672, 309, 562, 12, 2493, 18, 1213, 2498, 13, 422, 404, 30, 327, 19959, 21, 40, 12, 2493, 16, 1083, 13, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1122, 31506, 12, 2493, 16, 5769, 16, 4007, 2428, 273, 599, 16, 2826, 1968, 4672, 309, 562, 12, 2493, 18, 1213, 2498, 13, 422, 404, 30, 327, 19959, 21, 40, 12, 2493, 16, 1083, 13, 225...
grid_sizer_2.Add(self.tp_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.ta_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.musicspeech_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.monostereo_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.artificialhead_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.compressed_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.staticpty_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
grid_sizer_2.Add(self.tp_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.ta_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.musicspeech_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.monostereo_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.artificialhead_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.compressed_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.staticpty_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
def __do_layout(self): # begin wxGlade: rdsPanel.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) grid_sizer_3 = wx.GridSizer(2, 1, 0, 0) grid_sizer_2 = wx.GridSizer(1, 7, 0, 0) grid_sizer_1 = wx.GridSizer(2, 4, 0, 0) grid_sizer_1.Add(self.label_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.frequency, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.station_name, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.program_type, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.program_information, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0) grid_sizer_2.Add(self.tp_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.ta_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.musicspeech_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.monostereo_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.artificialhead_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.compressed_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_2.Add(self.staticpty_flag, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer_1.Add(grid_sizer_2, 1, wx.EXPAND, 0) grid_sizer_3.Add(self.radiotexta, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) grid_sizer_3.Add(self.radiotextb, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer_1.Add(grid_sizer_3, 1, wx.EXPAND, 0) self.SetAutoLayout(True) self.SetSizer(sizer_1) sizer_1.Fit(self) sizer_1.SetSizeHints(self) # end wxGlade
e675adf4e717575ba70d2b9d8bb182ec4c4b4798 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9733/e675adf4e717575ba70d2b9d8bb182ec4c4b4798/rdspanel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2896, 67, 6741, 12, 2890, 4672, 468, 2376, 7075, 21308, 2486, 30, 30393, 5537, 16186, 2896, 67, 6741, 272, 1824, 67, 21, 273, 7075, 18, 3514, 20512, 12, 27226, 18, 21654, 10109, 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, 1001, 2896, 67, 6741, 12, 2890, 4672, 468, 2376, 7075, 21308, 2486, 30, 30393, 5537, 16186, 2896, 67, 6741, 272, 1824, 67, 21, 273, 7075, 18, 3514, 20512, 12, 27226, 18, 21654, 10109, 13...
print >>sys.stderr, ">>", ranges
def getBuzzForTable(self, table, size, with_freq=True, max_freq=None): """ Retrieves a sample of high, medium and low frequent terms or phrases, paired with their frequencies, depending on the table to be sampled from. @table Table to retrieve the highest frequency from. Must be a key in NetworkBuzzDBHandler.TABLES. @param size Number of terms/phrases to be sampled for each category (high frequent, mid frequent, low frequent). @param with_freq Flag indicating whether the frequency for each term/phrase needs to be returned as well. True by default. @param max_freq Optional. When set, high frequent terms or phrases occurring more than max_freq times are not included. Default: None (i.e., include all). @return Triple containing a sample of high, medium and low frequent terms/phrases (in that order). If with_freq=True, each sample is a list of (term,freq) tuples, otherwise it is a list of terms. """ # Partition using a ln-scale M = self._max(table, max_freq=max_freq) print >>sys.stderr, ">>>>>>> M =", M if M is None: return () lnM = math.log(M) a, b = [int(round(math.exp(boundary*lnM))) for boundary in self.PARTITION_AT] ranges = ( (b, max_freq), (a, b), (self.MIN_FREQ, max(self.MIN_FREQ, a)) ) print >>sys.stderr, ">>", ranges # ...and sample each range return tuple(self._sample(table, range, size, with_freq=with_freq) for range in ranges)
f451aec3f9ebc795a299d1e47ba364b085f8875f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/f451aec3f9ebc795a299d1e47ba364b085f8875f/SqliteCacheDBHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2882, 9510, 1290, 1388, 12, 2890, 16, 1014, 16, 963, 16, 598, 67, 10212, 33, 5510, 16, 943, 67, 10212, 33, 7036, 4672, 3536, 20507, 279, 3296, 434, 3551, 16, 16212, 471, 4587, 13821, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2882, 9510, 1290, 1388, 12, 2890, 16, 1014, 16, 963, 16, 598, 67, 10212, 33, 5510, 16, 943, 67, 10212, 33, 7036, 4672, 3536, 20507, 279, 3296, 434, 3551, 16, 16212, 471, 4587, 13821, 3...
'tp_call', 'tp_str', 'tp_richcompare', 'tp_iter',
'tp_call', 'tp_str', 'tp_as_buffer', 'tp_richcompare', 'tp_iter',
def resetline(self): '''resets line numbering to the original file''' self.setline(self.lineno + 1, self.filename)
f63c95390b4027d2fbdf7e8537435d6a058014a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1020/f63c95390b4027d2fbdf7e8537435d6a058014a9/codegen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 1369, 12, 2890, 4672, 9163, 455, 2413, 980, 1300, 310, 358, 326, 2282, 585, 26418, 365, 18, 542, 1369, 12, 2890, 18, 17782, 397, 404, 16, 365, 18, 3459, 13, 2, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 1369, 12, 2890, 4672, 9163, 455, 2413, 980, 1300, 310, 358, 326, 2282, 585, 26418, 365, 18, 542, 1369, 12, 2890, 18, 17782, 397, 404, 16, 365, 18, 3459, 13, 2, -100, -100, -100, ...
<TEXTAREA COLS=80 ROWS=20 NAME=text>""" % title
<TEXTAREA COLS=80 ROWS=20 NAME=text>""" % self.escape(title)
def showedit(self, name, title, text):
3d3884effac531ca16a492c1e5747d5428f7678b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3d3884effac531ca16a492c1e5747d5428f7678b/faqmain.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 4619, 12, 2890, 16, 508, 16, 2077, 16, 977, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 4619, 12, 2890, 16, 508, 16, 2077, 16, 977, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
property a class-attached descriptor, MapperProperty or string property name attached to the parent instance. \**kwargs all extra keyword arguments are propagated to the constructor of Query.
property a class-attached descriptor, MapperProperty or string property name attached to the parent instance. \**kwargs all extra keyword arguments are propagated to the constructor of Query.
def with_parent(instance, prop): """Return criterion which selects instances with a given parent. instance a parent instance, which should be persistent or detached. property a class-attached descriptor, MapperProperty or string property name attached to the parent instance. \**kwargs all extra keyword arguments are propagated to the constructor of Query. """ if isinstance(prop, basestring): mapper = object_mapper(instance) prop = mapper.get_property(prop, resolve_synonyms=True) elif isinstance(prop, attributes.QueryableAttribute): prop = prop.property return prop.compare(operators.eq, instance, value_is_parent=True)
40b20c680a5fe8ef85b9b99b23769f4dc59f1504 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1074/40b20c680a5fe8ef85b9b99b23769f4dc59f1504/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 598, 67, 2938, 12, 1336, 16, 2270, 4672, 3536, 990, 11498, 1492, 19770, 3884, 598, 279, 864, 982, 18, 225, 791, 279, 982, 791, 16, 1492, 1410, 506, 9195, 578, 22037, 18, 225, 1272, 279...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 598, 67, 2938, 12, 1336, 16, 2270, 4672, 3536, 990, 11498, 1492, 19770, 3884, 598, 279, 864, 982, 18, 225, 791, 279, 982, 791, 16, 1492, 1410, 506, 9195, 578, 22037, 18, 225, 1272, 279...
if not setname:
if not setname and not link_xlog_dir:
def restore_database(self): """Restore the database from backup
f59838c89d9849df13669c624f247cd90ec37269 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14597/f59838c89d9849df13669c624f247cd90ec37269/walmgr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5217, 67, 6231, 12, 2890, 4672, 3536, 10874, 326, 2063, 628, 5114, 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, 5217, 67, 6231, 12, 2890, 4672, 3536, 10874, 326, 2063, 628, 5114, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
trove.troveFailed('Package was committed at the same time as the same package was built in another job. Make sure no one else is building the same packages as you, or that you didn\'t acidentally built the same package twice with the same flavor')
trove.troveFailed('Package was committed at the same time as the same package was built in another job. Make sure no-one else is building the same packages as you, and that you didn\'t accidentally build the same package twice with the same flavor.')
def troveDuplicate(self, trove, troveList): package = trove.getName().split(':')[0] possibleMatches = self.depState.getTrovesByPackage(package) for match in possibleMatches: if match is trove: continue elif match.getBinaryTroves() == set(troveList): self.depState.troveDuplicate(trove, match) return elif set(match.getBinaryTroves()) & set(troveList): trove.troveFailed('Two versions of %s=%s[%s] were built at the same time but resulted in different components. If these packages should have different flavors, then add flavor information to them. Otherwise, try building only one of them.' % trove.getNameVersionFlavor()) return trove.troveFailed('Package was committed at the same time as the same package was built in another job. Make sure no one else is building the same packages as you, or that you didn\'t acidentally built the same package twice with the same flavor')
7416f104c8850e237937a5cfe15df3485c14f224 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8749/7416f104c8850e237937a5cfe15df3485c14f224/dephandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23432, 537, 11826, 12, 2890, 16, 23432, 537, 16, 23432, 537, 682, 4672, 2181, 273, 23432, 537, 18, 17994, 7675, 4939, 2668, 2497, 25146, 20, 65, 3323, 6869, 273, 365, 18, 15037, 1119, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23432, 537, 11826, 12, 2890, 16, 23432, 537, 16, 23432, 537, 682, 4672, 2181, 273, 23432, 537, 18, 17994, 7675, 4939, 2668, 2497, 25146, 20, 65, 3323, 6869, 273, 365, 18, 15037, 1119, 18...
Handler for GStreamer bus messages about the currently reported level
Handles GStreamer bus messages about the currently reported level
def __PipelineBusLevelCb(self, bus, message): """ Handler for GStreamer bus messages about the currently reported level for the project or any of the instruments. """ st = message.structure if st and st.get_name() == "level": if not message.src is self.levelElement: for instr in self.instruments: if message.src is instr.levelElement: instr.SetLevel(DbToFloat(st["decay"][0])) break else: self.SetLevel(DbToFloat(st["decay"][0])) return True
e2b4f4a534dc5054c26a7ac44730cd6e0c158de4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/e2b4f4a534dc5054c26a7ac44730cd6e0c158de4/Project.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 8798, 7086, 2355, 15237, 12, 2890, 16, 5766, 16, 883, 4672, 3536, 27020, 611, 1228, 264, 5766, 2743, 2973, 326, 4551, 14010, 1801, 364, 326, 1984, 578, 1281, 434, 326, 29555, 18, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 8798, 7086, 2355, 15237, 12, 2890, 16, 5766, 16, 883, 4672, 3536, 27020, 611, 1228, 264, 5766, 2743, 2973, 326, 4551, 14010, 1801, 364, 326, 1984, 578, 1281, 434, 326, 29555, 18, 3...
clone = afeElement.cloneNode()
furthestBlock.reparentChildren(clone)
def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" # http://www.whatwg.org/specs/web-apps/current-work/#adoptionAgency # XXX Better parseError messages appreciated. name = token["name"] while True: # Step 1 paragraph 1 afeElement = self.tree.elementInActiveFormattingElements( token["name"]) if not afeElement or (afeElement in self.tree.openElements and not self.tree.elementInScope(afeElement.name)): self.parser.parseError("adoption-agency-1.1", {"name": token["name"]}) return
b77205d5a194b35f9e0d33752c3f0c063ccde4a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10463/b77205d5a194b35f9e0d33752c3f0c063ccde4a3/html5parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 23974, 12, 2890, 16, 1147, 4672, 3536, 1986, 9816, 17, 3030, 2258, 1261, 3482, 1737, 2075, 4886, 8395, 468, 1062, 2207, 5591, 18, 23770, 18197, 18, 3341, 19, 15115, 19, 4875, 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, 29765, 23974, 12, 2890, 16, 1147, 4672, 3536, 1986, 9816, 17, 3030, 2258, 1261, 3482, 1737, 2075, 4886, 8395, 468, 1062, 2207, 5591, 18, 23770, 18197, 18, 3341, 19, 15115, 19, 4875, 17, ...
"""Return the next availible model_id in self.struct
"""Return the next available model_id in self.struct
def next_model_id(self): """Return the next availible model_id in self.struct """ model_id = 0 while True: model_id += 1 model = self.struct.get_model(model_id) if model == None: return model_id
91b5d496727dcc850ede1625a0816b0132fa6297 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/91b5d496727dcc850ede1625a0816b0132fa6297/tls_animate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 2284, 67, 350, 12, 2890, 4672, 3536, 990, 326, 1024, 2319, 938, 67, 350, 316, 365, 18, 1697, 3536, 938, 67, 350, 273, 374, 1323, 1053, 30, 938, 67, 350, 1011, 404, 938, 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, 1024, 67, 2284, 67, 350, 12, 2890, 4672, 3536, 990, 326, 1024, 2319, 938, 67, 350, 316, 365, 18, 1697, 3536, 938, 67, 350, 273, 374, 1323, 1053, 30, 938, 67, 350, 1011, 404, 938, 273...
vars = ", ".join(map(latex, args))
vars = ", ".join(args)
def _latex_(self): args = self.args() if len(args) == 1: return "%s \\ {\mapsto}\\ %s" % (args[0], self._expr._latex_()) else: vars = ", ".join(map(latex, args)) # the weird TeX is to workaround an apparent JsMath bug return "\\left(%s \\right)\\ {\\mapsto}\\ %s" % (args, self._expr._latex_())
9f246a16beb4243491fe642f8c84ad5a1eb13c6c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9f246a16beb4243491fe642f8c84ad5a1eb13c6c/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 26264, 67, 12, 2890, 4672, 833, 273, 365, 18, 1968, 1435, 309, 562, 12, 1968, 13, 422, 404, 30, 327, 2213, 87, 1736, 18890, 1458, 30168, 97, 1695, 738, 87, 6, 738, 261, 1968, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 26264, 67, 12, 2890, 4672, 833, 273, 365, 18, 1968, 1435, 309, 562, 12, 1968, 13, 422, 404, 30, 327, 2213, 87, 1736, 18890, 1458, 30168, 97, 1695, 738, 87, 6, 738, 261, 1968, 63...
if not self.rulestack and \ (not self.javascript or tag!='script'):
if not self.rulestack and not self.javascript:
def startElement (self, tag, attrs): """We get a new start tag. New rules could be appended to the pending rules. No rules can be removed from the list.""" # default data item = [STARTTAG, tag, attrs] if self.state=='wait': return _buf2data([item], self.waitbuf) rulelist = [] filtered = 0 # look for filter rules which apply for rule in self.rules: if rule.match_tag(tag) and rule.match_attrs(attrs): debug(NIGHTMARE, "Filter: matched rule %s on tag %s" % (`rule.title`, `tag`)) if rule.start_sufficient: item = rule.filter_tag(tag, attrs) filtered = "True" # give'em a chance to replace more than one attribute if item[0]==STARTTAG and item[1]==tag: foo,tag,attrs = item continue else: break else: debug(NIGHTMARE, "Filter: put on buffer") rulelist.append(rule) if rulelist: # remember buffer position for end tag matching pos = len(self.buf) self.rulestack.append((pos, rulelist)) # if its not yet filtered, try filter javascript if filtered: self.buf_append_data(item) elif self.javascript: self.jsStartElement(tag, attrs) else: self.buf.append(item) # if rule stack is empty, write out the buffered data if not self.rulestack and \ (not self.javascript or tag!='script'): self.buf2data()
963fe71cee0c18f8415eff13338f105ff2d99ae1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/963fe71cee0c18f8415eff13338f105ff2d99ae1/Rewriter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13591, 261, 2890, 16, 1047, 16, 3422, 4672, 3536, 3218, 336, 279, 394, 787, 1047, 18, 1166, 2931, 3377, 506, 12317, 358, 326, 4634, 2931, 18, 2631, 2931, 848, 506, 3723, 628, 326, 666, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13591, 261, 2890, 16, 1047, 16, 3422, 4672, 3536, 3218, 336, 279, 394, 787, 1047, 18, 1166, 2931, 3377, 506, 12317, 358, 326, 4634, 2931, 18, 2631, 2931, 848, 506, 3723, 628, 326, 666, ...
confirm('did update history.but?' % VERSION)
confirm('did you update history.but?')
def confirm(question): print question if raw_input() != 'y': sys.exit(2)
bf79a2c47c9fa7705ae87215e4ea52d5152bfa6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7064/bf79a2c47c9fa7705ae87215e4ea52d5152bfa6f/release.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6932, 12, 4173, 4672, 1172, 5073, 309, 1831, 67, 2630, 1435, 480, 296, 93, 4278, 2589, 18, 8593, 12, 22, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6932, 12, 4173, 4672, 1172, 5073, 309, 1831, 67, 2630, 1435, 480, 296, 93, 4278, 2589, 18, 8593, 12, 22, 13, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
menu.append((_("remove bouquet"), csel.removeBouquet))
menu.append((_("remove bouquet"), self.removeBouquet))
def __init__(self, session, csel): Screen.__init__(self, session) self.csel = csel
82c3d190f3e20cb8d2473be89c1fb1ed5d98cec3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/82c3d190f3e20cb8d2473be89c1fb1ed5d98cec3/ChannelSelection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 365, 18, 71, 1786, 273, 276, 1786, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 365, 18, 71, 1786, 273, 276, 1786, 2, -100, -100, -100, -100, -100, -100, -10...
if type(bitmap) is type(''):
if type(bitmap) in (type(''),type(u'')):
def add(self,bitmap,handle=None): Damnlog('Adding',bitmap,'to icon list, with handle',handle) while handle is None or handle in self.list.keys(): Damnlog('!Icon conflict found with handle',handle) handle=hashlib.md5(str(random.random())+str(random.random())).hexdigest() if self.init: if type(bitmap) is type(''): bitmap=wx.Bitmap(bitmap) self.list[handle]=self.Add(bitmap) else: self.list[handle]=bitmap return handle
0668135c8e3ea715c0f1b0930afe6c69ea6d8fd4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/0668135c8e3ea715c0f1b0930afe6c69ea6d8fd4/DamnVid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 3682, 1458, 16, 4110, 33, 7036, 4672, 463, 301, 82, 1330, 2668, 13962, 2187, 3682, 1458, 11189, 869, 4126, 666, 16, 598, 1640, 2187, 4110, 13, 1323, 1640, 353, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 3682, 1458, 16, 4110, 33, 7036, 4672, 463, 301, 82, 1330, 2668, 13962, 2187, 3682, 1458, 11189, 869, 4126, 666, 16, 598, 1640, 2187, 4110, 13, 1323, 1640, 353, 599, ...
print "Caught expected NoSectionError:", e
pass
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionError from options()" try: cf.set("foo", "bar", "value") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionError from set()" expect_get_error(cf, ConfigParser.NoSectionError, "foo", "bar") cf.add_section("foo") expect_get_error(cf, ConfigParser.NoOptionError, "foo", "bar")
8dc634b98696d12e0c4314fb0e0c8e5c2afc1666 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/8dc634b98696d12e0c4314fb0e0c8e5c2afc1666/test_cfgparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 67, 4324, 13332, 1172, 1172, 315, 22218, 843, 1560, 7070, 6080, 273, 25076, 18, 809, 2678, 1435, 1172, 6080, 18, 11657, 1435, 1172, 315, 5582, 2442, 296, 42, 5161, 11, 35, 3113, 608...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 843, 67, 4324, 13332, 1172, 1172, 315, 22218, 843, 1560, 7070, 6080, 273, 25076, 18, 809, 2678, 1435, 1172, 6080, 18, 11657, 1435, 1172, 315, 5582, 2442, 296, 42, 5161, 11, 35, 3113, 608...
if 'solution_dict' in kwds and kwds['solution_dict']==True:
if kwds.get('solution_dict', False): if len(sol_list)==0: return []
def solve(f, *args, **kwds): r""" Algebraically solve an equation or system of equations (over the complex numbers) for given variables. Inequalities and systems of inequalities are also supported. INPUT: - ``f`` - equation or system of equations (given by a list or tuple) - ``*args`` - variables to solve for. - ``solution_dict`` - bool (default: False); if True, return a list of dictionaries containing the solutions. EXAMPLES:: sage: x, y = var('x, y') sage: solve([x+y==6, x-y==4], x, y) [[x == 5, y == 1]] sage: solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y) [[x == -1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == -1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(-I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == -1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 1/2*I*sqrt(3) - 1/2, y == 1/2*sqrt(I*sqrt(3) + 3)*sqrt(2)], [x == 0, y == -1], [x == 0, y == 1]] sage: solve([sqrt(x) + sqrt(y) == 5, x + y == 10], x, y) [[x == -5/2*I*sqrt(5) + 5, y == 5/2*I*sqrt(5) + 5], [x == 5/2*I*sqrt(5) + 5, y == -5/2*I*sqrt(5) + 5]] sage: solutions=solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y, solution_dict=True) sage: for solution in solutions: print solution[x].n(digits=3), ",", solution[y].n(digits=3) -0.500 - 0.866*I , -1.27 + 0.341*I -0.500 - 0.866*I , 1.27 - 0.341*I -0.500 + 0.866*I , -1.27 - 0.341*I -0.500 + 0.866*I , 1.27 + 0.341*I 0.000 , -1.00 0.000 , 1.00 Whenever possible, answers will be symbolic, but with systems of equations, at times approximations will be given, due to the underlying algorithm in Maxima:: sage: sols = solve([x^3==y,y^2==x],[x,y]); sols[-1], sols[0] ([x == 0, y == 0], [x == (0.309016994375 + 0.951056516295*I), y == (-0.809016994375 - 0.587785252292*I)]) sage: sols[0][0].rhs().pyobject().parent() Complex Double Field If ``f`` is only one equation or expression, we use the solve method for symbolic expressions, which defaults to exact answers only:: sage: solve([y^6==y],y) [y == e^(2/5*I*pi), y == e^(4/5*I*pi), y == e^(-4/5*I*pi), y == e^(-2/5*I*pi), y == 1, y == 0] sage: solve( [y^6 == y], y)==solve( y^6 == y, y) True .. note:: For more details about solving a single equations, see the documentation for its solve. :: sage: from sage.symbolic.expression import Expression sage: Expression.solve(x^2==1,x) [x == -1, x == 1] We must solve with respect to actual variables:: sage: z = 5 sage: solve([8*z + y == 3, -z +7*y == 0],y,z) Traceback (most recent call last): ... TypeError: 5 is not a valid variable. If we ask for a dictionary for the solutions, we get it:: sage: solve([x^2-1],x,solution_dict=True) [{x: -1}, {x: 1}] sage: solve([x^2-4*x+4],x,solution_dict=True) [{x: 2}] sage: res = solve([x^2 == y, y == 4],x,y,solution_dict=True) sage: for soln in res: print "x: %s, y: %s"%(soln[x], soln[y]) x: 2, y: 4 x: -2, y: 4 If there is a parameter in the answer, that will show up as a new variable. In the following example, ``r1`` is a real free variable (because of the ``r``):: sage: solve([x+y == 3, 2*x+2*y == 6],x,y) [[x == -r1 + 3, y == r1]] Especially with trigonometric functions, the dummy variable may be implicitly an integer (hence the ``z``):: sage: solve([cos(x)*sin(x) == 1/2, x+y == 0],x,y) [[x == 1/4*pi + pi*z38, y == -1/4*pi - pi*z38]] Expressions which are not equations are assumed to be set equal to zero, as with `x` in the following example:: sage: solve([x, y == 2],x,y) [[x == 0, y == 2]] If ``True`` appears in the list of equations it is ignored, and if ``False`` appears in the list then no solutions are returned. E.g., note that the first ``3==3`` evaluates to ``True``, not to a symbolic equation. :: sage: solve([3==3, 1.00000000000000*x^3 == 0], x) [x == 0] sage: solve([1.00000000000000*x^3 == 0], x) [x == 0] Here, the first equation evaluates to ``False``, so there are no solutions:: sage: solve([1==3, 1.00000000000000*x^3 == 0], x) [] Completely symbolic solutions are supported:: sage: var('s,j,b,m,g') (s, j, b, m, g) sage: sys = [ m*(1-s) - b*s*j, b*s*j-g*j ]; sage: solve(sys,s,j) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,(s,j)) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] sage: solve(sys,[s,j]) [[s == 1, j == 0], [s == g/b, j == (b - g)*m/(b*g)]] Inequalities can be also solved:: sage: solve(x^2>8,x) [[x < -2*sqrt(2)], [x > 2*sqrt(2)]] TESTS:: sage: solve([sin(x)==x,y^2==x],x,y) [sin(x) == x, y^2 == x] Use use_grobner if no solution is obtained from to_poly_solve:: sage: x,y=var('x y'); c1(x,y)=(x-5)^2+y^2-16; c2(x,y)=(y-3)^2+x^2-9 sage: solve([c1(x,y),c2(x,y)],[x,y]) [[x == -9/68*sqrt(55) + 135/68, y == -15/68*sqrt(5)*sqrt(11) + 123/68], [x == 9/68*sqrt(55) + 135/68, y == 15/68*sqrt(5)*sqrt(11) + 123/68]] """ from sage.symbolic.expression import is_Expression if is_Expression(f): # f is a single expression ans = f.solve(*args,**kwds) return ans elif len(f)==1 and is_Expression(f[0]): # f is a list with a single expression ans = f[0].solve(*args,**kwds) return ans else: # f is a list of such expressions or equations from sage.symbolic.ring import is_SymbolicVariable if len(args)==0: raise TypeError, "Please input variables to solve for." if is_SymbolicVariable(args[0]): variables = args else: variables = tuple(args[0]) for v in variables: if not is_SymbolicVariable(v): raise TypeError, "%s is not a valid variable."%v try: f = [s for s in f if s is not True] except TypeError: raise ValueError, "Unable to solve %s for %s"%(f, args) if any(s is False for s in f): return [] from sage.calculus.calculus import maxima m = maxima(f) try: s = m.solve(variables) except: # if Maxima gave an error, try its to_poly_solve try: s = m.to_poly_solve(variables) except TypeError, mess: # if that gives an error, raise an error. if "Error executing code in Maxima" in str(mess): raise ValueError, "Sage is unable to determine whether the system %s can be solved for %s"%(f,args) else: raise if len(s)==0: # if Maxima's solve gave no solutions, try its to_poly_solve try: s = m.to_poly_solve(variables) except: # if that gives an error, stick with no solutions s = [] if len(s)==0: # if to_poly_solve gave no solutions, try use_grobner try: s = m.to_poly_solve(variables,'use_grobner=true') except: # if that gives an error, stick with no solutions s = [] sol_list = string_to_list_of_solutions(repr(s)) if 'solution_dict' in kwds and kwds['solution_dict']==True: if isinstance(sol_list[0], list): sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] else: sol_dict=[{eq.left():eq.right()} for eq in sol_list] return sol_dict else: return sol_list
0514bac4c2d7c6b97d01cba8018101be1b18547a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0514bac4c2d7c6b97d01cba8018101be1b18547a/relation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 74, 16, 380, 1968, 16, 2826, 25577, 4672, 436, 8395, 2262, 29087, 6478, 12439, 392, 15778, 578, 2619, 434, 30369, 261, 1643, 326, 7233, 5600, 13, 364, 864, 3152, 18, 657, 9729...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 74, 16, 380, 1968, 16, 2826, 25577, 4672, 436, 8395, 2262, 29087, 6478, 12439, 392, 15778, 578, 2619, 434, 30369, 261, 1643, 326, 7233, 5600, 13, 364, 864, 3152, 18, 657, 9729...
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, fromfile=None, findleaks=0, use_resources=None):
def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False, exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False):
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, fromfile=None, findleaks=0, use_resources=None): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, and use_resources) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=']) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-q', '--quiet'): quiet = 1; verbose = 0 elif o in ('-g', '--generate'): generate = 1 elif o in ('-x', '--exclude'): exclude = 1 elif o in ('-s', '--single'): single = 1 elif o in ('-r', '--randomize'): randomize = 1 elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = 1 elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = 0 else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) sys.exit(len(bad) > 0)
1a5ffc9a430cf54038f88d81f49479e4f301c290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1a5ffc9a430cf54038f88d81f49479e4f301c290/regrtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 16341, 33, 7036, 16, 1842, 1214, 33, 7036, 16, 3988, 33, 20, 16, 10902, 33, 8381, 16, 2103, 33, 8381, 16, 4433, 33, 8381, 16, 2202, 33, 8381, 16, 2744, 554, 33, 8381, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 16341, 33, 7036, 16, 1842, 1214, 33, 7036, 16, 3988, 33, 20, 16, 10902, 33, 8381, 16, 2103, 33, 8381, 16, 4433, 33, 8381, 16, 2202, 33, 8381, 16, 2744, 554, 33, 8381, 16, ...
os.unlink('state')
os.unlink(self.control + '.state')
def complete(self, status): # We are about to exit 'complete' so clean up the control file. try: os.unlink('state') except: pass os.rename(sys.argv[1], sys.argv[1] + '.complete')
1ab90bdc7b43e2a15c2d64fba1ae9d3de333a906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/1ab90bdc7b43e2a15c2d64fba1ae9d3de333a906/job.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3912, 12, 2890, 16, 1267, 4672, 468, 1660, 854, 2973, 358, 2427, 296, 6226, 11, 1427, 2721, 731, 326, 3325, 585, 18, 775, 30, 1140, 18, 318, 1232, 12, 2890, 18, 7098, 397, 2418, 2019, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3912, 12, 2890, 16, 1267, 4672, 468, 1660, 854, 2973, 358, 2427, 296, 6226, 11, 1427, 2721, 731, 326, 3325, 585, 18, 775, 30, 1140, 18, 318, 1232, 12, 2890, 18, 7098, 397, 2418, 2019, ...
while pos_slot_n is not None: pos_slot = 12 + pos_slot_n * 8 position = IO.decode_uint32(posi_rsrc[pos_slot:pos_slot+4]) documents.add(position) pos_slot_n = IO.decode_link(posi_rsrc[pos_slot+4:pos_slot+8])
pos_slot = 12 + pos_slot_n * 4 data = posi_rsrc[pos_slot+4:pos_slot+4+(frequency*4)] i = 0 while i < frequency: documents.add(IO.decode_uint32(data[i:i+4])) i += 1
def load_documents(self): # Initialize data structure self.documents = {}
d27c22daf0630253f4ccf2cc0eb47ee78306f168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d27c22daf0630253f4ccf2cc0eb47ee78306f168/IIndex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 24795, 12, 2890, 4672, 468, 9190, 501, 3695, 365, 18, 24795, 273, 2618, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 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, 1262, 67, 24795, 12, 2890, 4672, 468, 9190, 501, 3695, 365, 18, 24795, 273, 2618, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if not ((basename not in [':info', 'info']) or
if not ((basename in [':info', 'info']) or
def AddEntry(self, name): '''add new file additions for a single cf file''' basename = name.split('/')[-1] rbasename = self.repopath.split('/')[-1] if not ((basename not in [':info', 'info']) or (basename[:len(rbasename)] == rbasename)): logger.error("Confused about file %s; ignoring" % (name)) return if basename in [':info', 'info']: return self.read_info(basename)
a2e93cca6c87142ad777e4e4d46cbdd01f0f4bd9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11867/a2e93cca6c87142ad777e4e4d46cbdd01f0f4bd9/Cfg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1436, 1622, 12, 2890, 16, 508, 4672, 9163, 1289, 394, 585, 26260, 364, 279, 2202, 6080, 585, 26418, 4882, 273, 508, 18, 4939, 2668, 2473, 13, 18919, 21, 65, 7138, 26157, 273, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1436, 1622, 12, 2890, 16, 508, 4672, 9163, 1289, 394, 585, 26260, 364, 279, 2202, 6080, 585, 26418, 4882, 273, 508, 18, 4939, 2668, 2473, 13, 18919, 21, 65, 7138, 26157, 273, 365, 18, ...
"DefaultGroupname=RapidSVN %s\"" % (self.version.str), "DefaultGroupname")
"DefaultGroupName=RapidSVN %s" % (self.version.str), "DefaultGroupName")
def checkRapidsvnIss(self): fname = RAPIDSVN_ISS_FILE replace(fname, "AppVerName=[^\n]*", "AppVerName=RapidSVN %s" % (self.version.str), "AppVerName") replace(fname, "OutputBaseFilename=[^\n]*", \ "OutputBaseFilename=RapidSVN-%s" % (self.version.str), "OutputBaseFilename") replace(fname, "DefaultGroupName=[^\n]*", \ "DefaultGroupname=RapidSVN %s\"" % (self.version.str), "DefaultGroupname") replace(fname, "userdesktop}\\\\RapidSVN[^\"]*\"", \ "userdesktop}\RapidSVN %s\"" % (self.version.str), "[Icons]\\{userdesktop}")
f11ae425869daf5ae5eb0da602578b5109f80c89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9898/f11ae425869daf5ae5eb0da602578b5109f80c89/check-version.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 54, 438, 2232, 25031, 7568, 12, 2890, 4672, 5299, 273, 534, 2203, 19516, 58, 50, 67, 25689, 67, 3776, 1453, 12, 12749, 16, 315, 3371, 3945, 461, 33, 15441, 82, 5772, 3113, 315, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 54, 438, 2232, 25031, 7568, 12, 2890, 4672, 5299, 273, 534, 2203, 19516, 58, 50, 67, 25689, 67, 3776, 1453, 12, 12749, 16, 315, 3371, 3945, 461, 33, 15441, 82, 5772, 3113, 315, 33...
if (self._module is not None and obj not in self._module.value().__dict__.values()): module = _find_builtin_obj_module(obj) if module is not None: self._module = ObjectUID(module)
if self._module is not None: for val in self._module.value().__dict__.values(): if val is obj: break else: module = _find_builtin_obj_module(obj) if module is not None: self._module = ObjectUID(module)
def module(self): if not hasattr(self, '_module'): obj = self._obj typ = type(obj)
f97a620c74baef2285f723ccd22876108cd43774 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/f97a620c74baef2285f723ccd22876108cd43774/uid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1605, 12, 2890, 4672, 309, 486, 3859, 12, 2890, 16, 2070, 2978, 11, 4672, 1081, 273, 365, 6315, 2603, 3815, 273, 618, 12, 2603, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1605, 12, 2890, 4672, 309, 486, 3859, 12, 2890, 16, 2070, 2978, 11, 4672, 1081, 273, 365, 6315, 2603, 3815, 273, 618, 12, 2603, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -...
cb = matplotlib.colorbar.ColorbarBase(cax,cmap=cm,boundaries=realbins)
cb = matplotlib.colorbar.ColorbarBase(cax,cmap=cm,boundaries=realbins,values=binvalues)
def getrange(seriesinfo,axis): range = [None,None] for info in seriesinfo: if axis in info: curmin,curmax = info[axis].min(),info[axis].max() if range[0] is None or curmin<range[0]: range[0] = curmin if range[1] is None or curmax>range[1]: range[1] = curmax return range
4b642934f4556f738480cc22595baae551fa1625 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/4b642934f4556f738480cc22595baae551fa1625/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 3676, 12, 10222, 1376, 16, 4890, 4672, 1048, 273, 306, 7036, 16, 7036, 65, 364, 1123, 316, 4166, 1376, 30, 309, 2654, 316, 1123, 30, 662, 1154, 16, 1397, 1896, 273, 1123, 63, 4890...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3676, 12, 10222, 1376, 16, 4890, 4672, 1048, 273, 306, 7036, 16, 7036, 65, 364, 1123, 316, 4166, 1376, 30, 309, 2654, 316, 1123, 30, 662, 1154, 16, 1397, 1896, 273, 1123, 63, 4890...
cvt_time=lambda v:datetime(2001,1,1) + timedelta(seconds=v)
def cvt_time(v): v=timedelta(seconds=v) epoch2001 = datetime(2001,1,1) epoch1970 = datetime(1970,1,1) if (epoch2001 + v - datetime.today()).days > 5*365: return epoch1970 + v return epoch2001 + v
def createFields(self): yield Enum(Bits(self, "marker_type", 4), {0: "Simple", 1: "Int", 2: "Real", 3: "Date", 4: "Data", 5: "ASCII String", 6: "UTF-16-BE String", 8: "UID", 10: "Array", 13: "Dict",}) markertype = self['marker_type'].value if markertype == 0: # Simple (Null) yield Enum(Bits(self, "value", 4), {0: "Null", 8: "False", 9: "True", 15: "Fill Byte",}) if self['value'].display == "False": self.xml=lambda prefix:prefix + "<false/>" elif self['value'].display == "True": self.xml=lambda prefix:prefix + "<true/>" else: self.xml=lambda prefix:prefix + ""
879aa46a777fb162d538d6b14d159fddff160ba3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9327/879aa46a777fb162d538d6b14d159fddff160ba3/bplist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2314, 12, 2890, 4672, 2824, 6057, 12, 6495, 12, 2890, 16, 315, 11145, 67, 723, 3113, 1059, 3631, 288, 20, 30, 315, 5784, 3113, 404, 30, 315, 1702, 3113, 576, 30, 315, 6955, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2314, 12, 2890, 4672, 2824, 6057, 12, 6495, 12, 2890, 16, 315, 11145, 67, 723, 3113, 1059, 3631, 288, 20, 30, 315, 5784, 3113, 404, 30, 315, 1702, 3113, 576, 30, 315, 6955, 3113, ...
self.unpack('ll', self.data[self.index:self.index+8]),
self.unpack('ii', self.data[self.index:self.index+8]),
def Tag_sint32_xy(self): new_tag = unpack('B', self.data[self.index])[0]
b6246092697acf4603a7a53de2b028120f095743 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/675/b6246092697acf4603a7a53de2b028120f095743/pxldis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4034, 67, 87, 474, 1578, 67, 1698, 12, 2890, 4672, 394, 67, 2692, 273, 6167, 2668, 38, 2187, 365, 18, 892, 63, 2890, 18, 1615, 5717, 63, 20, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4034, 67, 87, 474, 1578, 67, 1698, 12, 2890, 4672, 394, 67, 2692, 273, 6167, 2668, 38, 2187, 365, 18, 892, 63, 2890, 18, 1615, 5717, 63, 20, 65, 2, -100, -100, -100, -100, -100, -100...
for name in vfs.get_names(uri):
for name in vfs.get_names(base):
def get_handlers(self, reference): base = self._resolve_reference(reference) for name in vfs.get_names(uri): ref = resolve_uri2(base, name) yield self.get_handler(ref)
dcfcfecd9a3b39bcb9fc63c2589702249e6ff308 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12681/dcfcfecd9a3b39bcb9fc63c2589702249e6ff308/database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 11046, 12, 2890, 16, 2114, 4672, 1026, 273, 365, 6315, 10828, 67, 6180, 12, 6180, 13, 364, 508, 316, 20682, 18, 588, 67, 1973, 12, 1969, 4672, 1278, 273, 2245, 67, 1650, 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, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 11046, 12, 2890, 16, 2114, 4672, 1026, 273, 365, 6315, 10828, 67, 6180, 12, 6180, 13, 364, 508, 316, 20682, 18, 588, 67, 1973, 12, 1969, 4672, 1278, 273, 2245, 67, 1650, 22, ...
chisqThreshVect = int( duration * 1/squareChisq_tuple[3][0] ) * [chisqThreshold] if(rsqThreshold > 0 & rsqThreshold < 100.): rsqThreshVect = int( duration * 1/squareChisq_tuple[3][0] ) * [rsqThreshold]
chisqThreshVect = lengthChisq * [chisqThreshold] if((rsqThreshold > 0) & (rsqThreshold < 100.)): rsqThreshVect = lengthChisq * [rsqThreshold]
def plotsnrchisq(gpsTime,frameFile,outputPath,inspProcParams,tableFile): rsqThreshold = 0; for row in inspProcParams: if row.param == "--channel-name": chanStringBase = row.value ifoName = str(row.value).split(":",1) if row.param == "--segment-length": segLen = eval(row.value) if row.param == "--sample-rate": sampleRate = eval(row.value) if row.param == "--segment-overlap": segOverlap = eval(row.value) if (row.param == "--chisq-delta") or (row.param == "--minimal-match"): chisqDelta = eval(row.value) if row.param =="--chisq-bins": chisqBins = eval(row.value) if row.param == "--snr-threshold": snrThreshold = eval(row.value) if row.param == "--chisq-threshold": chisqThreshold = eval(row.value) if row.param == "--rsq-veto-threshold": rsqThreshold = eval(row.value) if row.param == "--trig-start-time": trigStart = eval(row.value) segLenSec = segLen / sampleRate segOverlapSec = segOverlap / sampleRate chanString = chanStringBase + "_SNRSQ_0" # find the start time of the first channel # BE CAREFUL ! it is assumed that the sampling frequency is higher than 200 Hz testOnFirstChannel = Fr.frgetvect(frameFile,chanString,-1,0.01,0) gpsStart = testOnFirstChannel[1] if (trigStart): trigPosition = int((trigStart - gpsStart) / (segLenSec -segOverlapSec)) else: trigPosition = 0 position = int((eval(gpsTime) - gpsStart) / (segLenSec -segOverlapSec)) \ - trigPosition chanNumber = str(position) chanNameSnr = chanStringBase + "_SNRSQ_" + chanNumber chanNameChisq = chanStringBase + '_CHISQ_' + chanNumber # now, read the data !! # The window width should be an input argument maybe ? duration = 2.0 # startWindow = float(gpsTime) - duration/2. # squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,startWindow,duration,0) squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) squareChisq_tuple = Fr.frgetvect(frameFile,chanNameChisq,-1,segLenSec,0) snr_position = float(gpsTime) - ( float(squareSnr_tuple[1]) + \ (segLenSec-segOverlapSec)*position ) chisq_position = float(gpsTime) - ( float(squareChisq_tuple[1]) + \ (segLenSec-segOverlapSec)*position ) # compute the snr vector snr_vector = sqrt(squareSnr_tuple[0]) # print squareSnr_tuple snr_time = array(range(0, segLen)) * squareSnr_tuple[3][0] - snr_position # compute the r^2 rsq_vector = squareChisq_tuple[0] chisq_time = array(range(0, segLen)) * squareChisq_tuple[3][0] - chisq_position # compute the normalized chisq chisqNorm_vector = rsq_vector/(1 + chisqDelta/chisqBins*squareSnr_tuple[0]) # define the time boundaries of the plot snr_start = (snr_position - duration/2.) * 1/squareSnr_tuple[3][0] snr_stop = (snr_position + duration/2.) * 1/squareSnr_tuple[3][0] chisq_start = (chisq_position - duration/2.) * 1/squareChisq_tuple[3][0] chisq_stop = (chisq_position + duration/2.) * 1/squareChisq_tuple[3][0] #prepare the thresholds to be plotted snrThreshVect = int( duration * 1/squareSnr_tuple[3][0] ) * [snrThreshold] if(chisqThreshold < 100.): chisqThreshVect = int( duration * 1/squareChisq_tuple[3][0] ) * [chisqThreshold] if(rsqThreshold > 0 & rsqThreshold < 100.): rsqThreshVect = int( duration * 1/squareChisq_tuple[3][0] ) * [rsqThreshold] # Now plot the snr time serie !! figure(1) plot(snr_time[int(snr_start):int(snr_stop)],snr_vector[int(snr_start):int(snr_stop)]) hold(1) plot(snr_time[int(snr_start):int(snr_stop)],snrThreshVect) hold(0) xlim(-duration/2., duration/2.) xlabel('time (s)',size='x-large') ylabel(r'snr',size='x-large') grid() title(ifoName[0] + ' trigger: ' + gpsTime) figName = ifoName[0] + '_' + str(gpsTime).replace(".","_") + '_snr.png' savefig(outputPath +"/" + figName) tableFile = open(container.locallink,'a') table = HTMLTable() table.add_column('<img width=400 src="' + figName +'">','SNR') figure(11) plot(snr_time[int(snr_start):int(snr_stop)],snr_vector[int(snr_start):int(snr_stop)]) hold(1) plot(snr_time[int(snr_start):int(snr_stop)],snrThreshVect) hold(0) xlim(-duration/20., duration/20.) xlabel('time (s)',size='x-large') ylabel(r'snr',size='x-large') grid() title(ifoName[0] + ' trigger: ' + gpsTime + ' Zoom') figName = ifoName[0] + '_' + str(gpsTime).replace(".","_") + '_snr_zoom.png' savefig(outputPath +"/" + figName) table.add_column('<img width=400 src="' + figName +'">','SNR ZOOM') table.write(tableFile) tableFile.close() ### END CHADS CHANGES ### # Now plot the r^2 time serie !! figure(2) plot(chisq_time[int(chisq_start):int(chisq_stop)],rsq_vector[int(chisq_start):int(chisq_stop)]) if(chisqThreshold < 100.): hold(1) plot(rsqThreshVect) hold(0) xlim(-duration/2., duration/2.) xlabel('time (s)',size='x-large') ylabel(r'chisq/p',size='x-large') grid() title(ifoName[0] + ' trigger: ' + gpsTime) savefig(ifoName[0] + '_' + str(gpsTime).replace(".","_") + '_rsq.png') figure(22) plot(chisq_time[int(chisq_start):int(chisq_stop)],rsq_vector[int(chisq_start):int(chisq_stop)]) if(chisqThreshold < 100.): hold(1) plot(rsqThreshVect) hold(0) xlim(-duration/20., duration/20.) xlabel('time (s)',size='x-large') ylabel(r'chisq/p',size='x-large') grid() title(ifoName[0] + ' trigger: ' + gpsTime + ' Zoom') savefig(ifoName[0] + '_' + str(gpsTime).replace(".","_") + '_rsq_zoom.png') # Now plot the normalized chisq time serie !! figure(3) plot(chisq_time[int(chisq_start):int(chisq_stop)],chisqNorm_vector[int(chisq_start):int(chisq_stop)]) if(rsqThreshold > 0 & rsqThreshold < 100.): hold(1) plot(chisqThreshVect) hold(0) xlim(-duration/2., duration/2.) xlabel('time (s)',size='x-large') ylabel(r'chisq / (p + Delta * snrsq)',size='x-large') grid(1) title(ifoName[0] + ' trigger: ' + gpsTime) savefig(ifoName[0] + '_' + str(gpsTime).replace(".","_") + '_chisq.png') figure(33) plot(chisq_time[int(chisq_start):int(chisq_stop)],chisqNorm_vector[int(chisq_start):int(chisq_stop)]) if(rsqThreshold > 0 & rsqThreshold < 100.): hold(1) plot(chisqThreshVect) hold(0) xlim(-duration/20., duration/20.) xlabel('time (s)',size='x-large') ylabel(r'chisq / (p + Delta * snrsq)',size='x-large') grid(1) title(ifoName[0] + ' trigger: ' + gpsTime + ' Zoom') savefig(ifoName[0] + '_' + str(gpsTime).replace(".","_") + '_chisq_zoom.png')
c4d2198cea6ff30c6d5f1aa9bee69af1c499079e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/c4d2198cea6ff30c6d5f1aa9bee69af1c499079e/plotsnrchisq_pipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 8134, 86, 343, 291, 85, 12, 75, 1121, 950, 16, 3789, 812, 16, 2844, 743, 16, 267, 1752, 15417, 1370, 16, 2121, 812, 4672, 225, 3597, 85, 7614, 273, 374, 31, 225, 364, 1027, 316...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 8134, 86, 343, 291, 85, 12, 75, 1121, 950, 16, 3789, 812, 16, 2844, 743, 16, 267, 1752, 15417, 1370, 16, 2121, 812, 4672, 225, 3597, 85, 7614, 273, 374, 31, 225, 364, 1027, 316...
if e.errno == errno.EFTYPE and not self.isdir():
if e.errno == 79 and not self.isdir():
def chmod(self, permissions): """Wrapper around os.chmod""" try: self.conn.os.chmod(self.path, permissions & Globals.permission_mask) except OSError, e: if e.errno == errno.EFTYPE and not self.isdir(): # Some systems throw this error if try to set sticky bit # on a non-directory. Remove sticky bit and try again. log.Log("Unable to set permissions of %s to %o - trying again" "without sticky bit (%o)" % (self.path, permissions, permissions & 06777), 2) self.conn.os.chmod(self.path, permissions & 06777 & Globals.permission_mask) else: raise self.data['perms'] = permissions
5e04c97d5d16b866da6e5809248aeaf1cfe66333 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6202/5e04c97d5d16b866da6e5809248aeaf1cfe66333/rpath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13413, 12, 2890, 16, 4371, 4672, 3536, 3611, 6740, 1140, 18, 343, 1711, 8395, 775, 30, 365, 18, 4646, 18, 538, 18, 343, 1711, 12, 2890, 18, 803, 16, 4371, 473, 18901, 1031, 18, 9827, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13413, 12, 2890, 16, 4371, 4672, 3536, 3611, 6740, 1140, 18, 343, 1711, 8395, 775, 30, 365, 18, 4646, 18, 538, 18, 343, 1711, 12, 2890, 18, 803, 16, 4371, 473, 18901, 1031, 18, 9827, ...
self._stash_rewrite_and_call(EX_PHYLO, ( (ParseTests, [ 'test_read_phylo', 'test_parse_phylo', 'test_shape_phylo']), (TreeTests, [ 'test_Phyloxml', 'test_Other', 'test_Phylogeny', 'test_Clade', 'test_Annotation', 'test_CladeRelation', 'test_Date', 'test_Distribution', 'test_Events', 'test_Property', 'test_Sequence', 'test_SequenceRelation', 'test_Taxonomy', 'test_Uri', ]), ))
global EX_PHYLO orig_fname = EX_PHYLO try: EX_PHYLO = DUMMY self._rewrite_and_call(orig_fname, ( (ParseTests, [ 'test_read_phylo', 'test_parse_phylo', 'test_shape_phylo']), (TreeTests, [ 'test_Phyloxml', 'test_Other', 'test_Phylogeny', 'test_Clade', 'test_Annotation', 'test_CladeRelation', 'test_Date', 'test_Distribution', 'test_Events', 'test_Property', 'test_Sequence', 'test_SequenceRelation', 'test_Taxonomy', 'test_Uri', ]), )) finally: EX_PHYLO = orig_fname
def test_phylo(self): """Round-trip parsing and serialization of phyloxml_examples.xml.""" self._stash_rewrite_and_call(EX_PHYLO, ( (ParseTests, [ 'test_read_phylo', 'test_parse_phylo', 'test_shape_phylo']), (TreeTests, [ 'test_Phyloxml', 'test_Other', 'test_Phylogeny', 'test_Clade', 'test_Annotation', 'test_CladeRelation', 'test_Date', 'test_Distribution', 'test_Events', 'test_Property', 'test_Sequence', 'test_SequenceRelation', 'test_Taxonomy', 'test_Uri', ]), ))
ad1a618def838d98432e9623367cffb595eadecd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/ad1a618def838d98432e9623367cffb595eadecd/test_PhyloXML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 844, 93, 383, 12, 2890, 4672, 3536, 11066, 17, 25125, 5811, 471, 11854, 434, 1844, 93, 383, 2902, 67, 16858, 18, 2902, 12123, 365, 6315, 25915, 67, 21489, 67, 464, 67, 1991, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 844, 93, 383, 12, 2890, 4672, 3536, 11066, 17, 25125, 5811, 471, 11854, 434, 1844, 93, 383, 2902, 67, 16858, 18, 2902, 12123, 365, 6315, 25915, 67, 21489, 67, 464, 67, 1991, ...
break last_failed = False shift //= 2 tests = tests[shift:] + tests[:shift]
else: last_failed = False shift //= 2 tests = tests[shift:] + tests[:shift]
def bisect_tests(): tests = find_tests() write('Found %d tests', len(tests)) shift = len(tests) // 4 last_failed = False while len(tests) > 1 and shift > 0: mid = len(tests) // 2 + 1 left, right = tests[:mid], tests[mid:] if not run_tests(left): last_failed = True tests = left shift = len(tests) // 4 + 1 break if not run_tests(right): last_failed = True tests = right shift = len(tests) // 4 + 1 break last_failed = False shift //= 2 tests = tests[shift:] + tests[:shift] # looks like we can't make the set of tests any smaller return last_failed and tests or []
7a01b99380652cc1e5434c2f8dfb8c7fd88984c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13107/7a01b99380652cc1e5434c2f8dfb8c7fd88984c6/bisect_crashes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27031, 67, 16341, 13332, 7434, 273, 1104, 67, 16341, 1435, 1045, 2668, 2043, 738, 72, 7434, 2187, 562, 12, 16341, 3719, 4654, 273, 562, 12, 16341, 13, 368, 1059, 1142, 67, 7307, 273, 108...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27031, 67, 16341, 13332, 7434, 273, 1104, 67, 16341, 1435, 1045, 2668, 2043, 738, 72, 7434, 2187, 562, 12, 16341, 3719, 4654, 273, 562, 12, 16341, 13, 368, 1059, 1142, 67, 7307, 273, 108...
break else:
if selected == -1:
def _loadConnections(self): connections = storage.connections() def_conn = storage.option('default_connection') for i, el in enumerate(connections): self.list_conn.addItem(el[1], QVariant(el[0])) if el[0] == def_conn: selected = i break else: # if the default connections doesn't exists. selected = 0 storage.setOption('default_connection', selected) def_conn = None
49d8eb348539b6ea9a056ea2298f16f08ee30e20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8560/49d8eb348539b6ea9a056ea2298f16f08ee30e20/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 9314, 12, 2890, 4672, 5921, 273, 2502, 18, 13313, 1435, 1652, 67, 4646, 273, 2502, 18, 3482, 2668, 1886, 67, 4071, 6134, 364, 277, 16, 415, 316, 4241, 12, 13313, 4672, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 945, 9314, 12, 2890, 4672, 5921, 273, 2502, 18, 13313, 1435, 1652, 67, 4646, 273, 2502, 18, 3482, 2668, 1886, 67, 4071, 6134, 364, 277, 16, 415, 316, 4241, 12, 13313, 4672, 365, 1...
return complex(f._approx_(float(g)))
return complex(f._approx_(complex(g)))
def __complex__(self): f = self._operands[0] g = self._operands[1] return complex(f._approx_(float(g)))
f746ec6e60d00a6c987c82ff850d2d3deaefa785 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/f746ec6e60d00a6c987c82ff850d2d3deaefa785/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 14259, 972, 12, 2890, 4672, 284, 273, 365, 6315, 4063, 5708, 63, 20, 65, 314, 273, 365, 6315, 4063, 5708, 63, 21, 65, 327, 7233, 12, 74, 6315, 26742, 67, 12, 5659, 12, 75, 2034...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 14259, 972, 12, 2890, 4672, 284, 273, 365, 6315, 4063, 5708, 63, 20, 65, 314, 273, 365, 6315, 4063, 5708, 63, 21, 65, 327, 7233, 12, 74, 6315, 26742, 67, 12, 5659, 12, 75, 2034...
print "ADDR =", addr print "CLASS =", svrcls
print("ADDR =", addr) print("CLASS =", svrcls)
def run_servers(self, proto, servers, hdlrcls, testfunc): for svrcls in servers: addr = self.pickaddr(proto) if verbose: print "ADDR =", addr print "CLASS =", svrcls t = ServerThread(addr, svrcls, hdlrcls) if verbose: print "server created" t.start() if verbose: print "server running" for i in range(NREQ): t.ready.wait(10*DELAY) self.assert_(t.ready.isSet(), "Server not ready within a reasonable time") if verbose: print "test client", i testfunc(proto, addr) if verbose: print "waiting for server" t.join() if verbose: print "done"
459f06037c9b13cdb3e0f1e070ae33421e222d51 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/459f06037c9b13cdb3e0f1e070ae33421e222d51/test_socketserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 14247, 12, 2890, 16, 3760, 16, 7084, 16, 366, 5761, 86, 6429, 16, 1842, 644, 4672, 364, 5893, 86, 6429, 316, 7084, 30, 3091, 273, 365, 18, 11503, 4793, 12, 9393, 13, 309, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 14247, 12, 2890, 16, 3760, 16, 7084, 16, 366, 5761, 86, 6429, 16, 1842, 644, 4672, 364, 5893, 86, 6429, 316, 7084, 30, 3091, 273, 365, 18, 11503, 4793, 12, 9393, 13, 309, 3...
message['to'] = "%s@conference.%s" %(room, CHATSERVER)
message['to'] = "%s@conference.%s" %(room, secret.CHATSERVER)
def send_groupchat(self, room, mess): message = domish.Element(('jabber:client','message')) message['to'] = "%s@conference.%s" %(room, CHATSERVER) message['type'] = "groupchat" message.addElement('body',None, mess) self.xmlstream.send(message)
24fa6a8a683868db6a24e95e0b656f67ea1dbe8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11180/24fa6a8a683868db6a24e95e0b656f67ea1dbe8d/iemchatbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 1655, 10880, 12, 2890, 16, 7725, 16, 12755, 4672, 883, 273, 4092, 1468, 18, 1046, 12, 2668, 78, 378, 744, 30, 2625, 17023, 2150, 26112, 883, 3292, 869, 3546, 273, 2213, 87, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 1655, 10880, 12, 2890, 16, 7725, 16, 12755, 4672, 883, 273, 4092, 1468, 18, 1046, 12, 2668, 78, 378, 744, 30, 2625, 17023, 2150, 26112, 883, 3292, 869, 3546, 273, 2213, 87, 3...
baudrate=19200, bytesize=EIGHTBITS, parity=PARITY_EVEN, stopbits=STOPBITS_ONE, timeout=3, xonxoff=0, rtscts=0,
baudrate=19200, bytesize=EIGHTBITS, parity=PARITY_EVEN, stopbits=STOPBITS_ONE, timeout=3, xonxoff=0, rtscts=0,
def fileno(self): """For easier use of the serial port instance with select. WARNING: this function is not portable to different platforms!""" if self.fd is None: raise portNotOpenError return self.fd
1f90ac65d3fedcbcbad07f16ea3e6414ab08d398 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/1f90ac65d3fedcbcbad07f16ea3e6414ab08d398/serialposix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24256, 12, 2890, 4672, 3536, 1290, 15857, 999, 434, 326, 2734, 1756, 791, 598, 2027, 18, 9744, 30, 333, 445, 353, 486, 1756, 429, 358, 3775, 17422, 5, 8395, 309, 365, 18, 8313, 353, 59...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24256, 12, 2890, 4672, 3536, 1290, 15857, 999, 434, 326, 2734, 1756, 791, 598, 2027, 18, 9744, 30, 333, 445, 353, 486, 1756, 429, 358, 3775, 17422, 5, 8395, 309, 365, 18, 8313, 353, 59...
- Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph.
- Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph.
def cliques_maximum(self): """ Returns the list of all maximum cliques, with each clique represented by a list of vertices. A clique is an induced complete subgraph, and a maximum clique is one of maximal order. NOTES: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. ALGORITHM: - This function is based on Cliquer, [1]. REFERENCE:
9e5b138b9189031c2c258c6596d3a3b7fdafb7d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9e5b138b9189031c2c258c6596d3a3b7fdafb7d0/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 29896, 67, 15724, 12, 2890, 4672, 3536, 2860, 326, 666, 434, 777, 4207, 4942, 29896, 16, 598, 1517, 31380, 10584, 635, 279, 666, 434, 6928, 18, 432, 31380, 353, 392, 1547, 26372, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 29896, 67, 15724, 12, 2890, 4672, 3536, 2860, 326, 666, 434, 777, 4207, 4942, 29896, 16, 598, 1517, 31380, 10584, 635, 279, 666, 434, 6928, 18, 432, 31380, 353, 392, 1547, 26372, 3...
if varForDifferentiation is not None or isscalar(vars): r = d1
if varForDifferentiation is not None or isscalar(vars) or isinstance(vars, ndarray): r = d1
def get_d1(fun, vars, diffInt=1.5e-8, pointVal = None, args=(), stencil = 3, varForDifferentiation = None, exactShape = False): """ Usage: get_d1(fun, x, diffInt=1.5e-8, pointVal = None, args=(), stencil = 3, varForDifferentiation = None, exactShape = False) fun: R^n -> R^m, x: Python list (not tuple!) or numpy array from R^n: function and point where derivatives should be obtained diffInt - step for stencil pointVal - fun(x) if known (it is used from OpenOpt and FuncDesigner) args - additional args for fun, if not equalk to () then fun(x, *args) will be involved stencil = 1: (f(x+diffInt) - f(x)) / diffInt stencil = 2: (f(x+diffInt) - f(x-diffInt)) / (2*diffInt) stencil = 3: (-f(x+2*diffInt) + 8*f(x+diffInt) - 8*f(x-diffInt) + f(x-2*diffInt)) / (12*diffInt) varForDifferentiation - the parameter is used from FuncDesigner exactShape - set True to forbid possible flattering for 1D arrays """ assert type(vars) in [tuple, list, ndarray, float, dict] #assert asarray(diffInt).size == 1, 'vector diffInt are not implemented for oofuns yet' diffInt = atleast_1d(diffInt) if atleast_1d(diffInt).size > 1: assert type(vars) == ndarray, 'not implemented yet' if type(vars) == tuple: Vars = [asfarray(var) for var in vars] elif type(vars) not in [list, tuple] or isscalar(vars[0]): Vars = [vars, ] else: Vars = list(vars) # TODO: IMPLEMENT CHECK FOR SAME VARIABLES IN INPUT #if len(set(tuple(Vars))) != len(Vars): #raise DerApproximatorException('currently DerApproximator can handle only different input variables') if type(args) != tuple: args = (args, ) Args = list(tuple([asfarray(v) for v in Vars]) + args)#list(tuple(Vars) + args) if pointVal is None: v_0 = atleast_1d(fun(*Args)) else: v_0 = pointVal if v_0.ndim >= 2: raise DerApproximatorException('Currently DerApproximatorx cannot handle functions with (ndim of output) > 1 , only vectors are allowed') M = v_0.size r = [] for i in xrange(len(Vars)): if varForDifferentiation is not None and i != varForDifferentiation: continue if not isscalar(Args[i]): Args[i] = asfarray(Args[i]) S = Args[i] else: S = asfarray([Args[i]]) S = atleast_1d(S) agregate_counter = 0 assert asarray(Args[i]).ndim <= 1, 'derivatives for more than single dimension variables are not implemented yet' if diffInt.size == 1: diff_int = asarray([diffInt[0]]*S.size)# i.e. python list of length inp.size else: diff_int = diffInt cmp = atleast_1d(1e-10 * abs(S)) ind = where(diff_int<cmp)[0] diff_int[ind] = cmp[ind] d1 = empty((M, S.size)) #d1.fill(nan) for j in xrange(S.size): di = float(asscalar(diff_int[j])) tmp = S[j] #if S.ndim > 0 else asscalar(S) di = diff_int[j] di2 = di / 2.0 S[j] += di TMP = fun(*Args) #if not isscalar(TMP): TMP = hstack(TMP) v_right = atleast_1d(TMP)# TODO: fix it for matrices with ndims>1 S[j] = tmp # not Args[i][j] -= di, because it can change primeval Args[i][j] value # and check for key == same value will be failed has_nonfinite = not all(isfinite(v_right.flatten())) if stencil >= 2 or has_nonfinite: S[j] -= di v_left = atleast_1d(fun(*Args)) S[j] = tmp if has_nonfinite: d1[:, agregate_counter] = (v_0-v_left) / di elif stencil == 2: d1[:, agregate_counter] = (v_right-v_left) / (2.0 * di) else: assert stencil == 3 S[j] -= di2 v_subleft = atleast_1d(fun(*Args)) S[j] = tmp S[j] += di2 v_subright = atleast_1d(fun(*Args)) S[j] = tmp d1[:, agregate_counter] = (v_left - v_right + 8.0 * (v_subright-v_subleft)) / (6.0 * di) else: d1[:, agregate_counter] = (v_right-v_0) / di agregate_counter += 1 # TODO: probably other values for n-dim arrays # TODO: fix it for arrays with ndim > 2 if not exactShape and min(d1.shape)==1: d1 = d1.flatten() r.append(asfarray(d1)) if varForDifferentiation is not None or isscalar(vars): r = d1 else: r = tuple(r) return r
b28568f4ff3efc26dccb1b00218630cbc8f8ea7a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6196/b28568f4ff3efc26dccb1b00218630cbc8f8ea7a/DerApproximator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 72, 21, 12, 12125, 16, 4153, 16, 3122, 1702, 33, 21, 18, 25, 73, 17, 28, 16, 1634, 3053, 273, 599, 16, 833, 33, 9334, 30503, 273, 890, 16, 569, 1290, 26270, 7072, 273, 599...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 72, 21, 12, 12125, 16, 4153, 16, 3122, 1702, 33, 21, 18, 25, 73, 17, 28, 16, 1634, 3053, 273, 599, 16, 833, 33, 9334, 30503, 273, 890, 16, 569, 1290, 26270, 7072, 273, 599...
def rtype_getRuntimeTypeInfo(hop): return hop.inputconst(Ptr(RuntimeTypeInfo), hop.s_result.const)
def rtype_cast_pointer(hop): assert hop.args_s[0].is_constant() assert isinstance(hop.args_r[1], rptr.PtrRepr) v_type, v_input = hop.inputargs(Void, hop.args_r[1]) return hop.genop('cast_pointer', [v_input], # v_type implicit in r_result resulttype = hop.r_result.lowleveltype)
a43a8197cad90bf0e029f581153da92afeb11174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/a43a8197cad90bf0e029f581153da92afeb11174/rbuiltin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9328, 67, 4155, 67, 10437, 12, 18444, 4672, 1815, 19055, 18, 1968, 67, 87, 63, 20, 8009, 291, 67, 14384, 1435, 1815, 1549, 12, 18444, 18, 1968, 67, 86, 63, 21, 6487, 436, 6723, 18, 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, 9328, 67, 4155, 67, 10437, 12, 18444, 4672, 1815, 19055, 18, 1968, 67, 87, 63, 20, 8009, 291, 67, 14384, 1435, 1815, 1549, 12, 18444, 18, 1968, 67, 86, 63, 21, 6487, 436, 6723, 18, 5...
return template
return template
def template(**kwargs): return self.template.render(view=view, context=view.context, request=view.request, _context=view.request, options=kwargs)
1d8f4dbce33b9c45b19c779e3ead54b4fcc8a706 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9696/1d8f4dbce33b9c45b19c779e3ead54b4fcc8a706/pagetemplate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1542, 12, 636, 4333, 4672, 327, 365, 18, 3202, 18, 5902, 12, 1945, 33, 1945, 16, 819, 33, 1945, 18, 2472, 16, 590, 33, 1945, 18, 2293, 16, 389, 2472, 33, 1945, 18, 2293, 16, 702, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1542, 12, 636, 4333, 4672, 327, 365, 18, 3202, 18, 5902, 12, 1945, 33, 1945, 16, 819, 33, 1945, 18, 2472, 16, 590, 33, 1945, 18, 2293, 16, 389, 2472, 33, 1945, 18, 2293, 16, 702, 3...
resp = Response.objects.create(poll=self, message=db_message, contact=db_message.contact, time=db_message.date)
resp = Response.objects.create(poll=self, message=db_message, contact=db_message.connection.contact, date=db_message.date)
def process_response(self, message): db_message = None if hasattr(message, 'db_message'): db_message = message.db_message resp = Response.objects.create(poll=self, message=db_message, contact=db_message.contact, time=db_message.date) outgoing_message = self.default_response if (self.type == Poll.TYPE_LOCATION): location_template = STARTSWITH_PATTERN_TEMPLATE % '[a-zA-Z]*' regex = re.compile(location_template) if regex.search(message.text): spn = regex.search(message.text).span() location_str = message.text[spn[0]:spn[1]] area = None area_names = Area.objects.all().values_list('name', flat=True) area_names_lower = [ai.lower() for ai in area_names] area_names_matches = difflib.get_close_matches(location_str.lower(), area_names_lower) if area_names_matches: area = Area.objects.get(name__iexact=area_names_matches[0]) else: area = Area.objects.create(name=location_str, code=generate_tracking_tag()) resp.eav.poll_location_value = area elif (self.type == Poll.TYPE_NUMERIC): try: resp.eav.poll_number_value = float(message.text) except ValueError: pass elif ((self.type == Poll.TYPE_TEXT) or (self.type == Poll.TYPE_REGISTRATION)): resp.eav.poll_text_value = message.text if self.categories: for category in self.categories.all(): for rule in category.rules.all(): regex = re.compile(rule.regex) if regex.search(message.text.lower()): rc = ResponseCategory.objects.create(response = resp, category=category) resp.categories.add(rc) break if not resp.categories.all().count() and self.categories.filter(default=True).count(): resp.categories.add(ResponseCategory.objects.create(response = resp, category=self.categories.get(default=True))) for respcategory in resp.categories.order_by('category__priority'): if respcategory.category.response: outgoing_message = respcategory.category.response break resp.save() if not outgoing_message: return "We have received your response, thank you!" else: return outgoing_message
f78bfa3497ac2d1b26a893c13e12cf8ff792835a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11809/f78bfa3497ac2d1b26a893c13e12cf8ff792835a/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2740, 12, 2890, 16, 883, 4672, 1319, 67, 2150, 273, 599, 309, 3859, 12, 2150, 16, 296, 1966, 67, 2150, 11, 4672, 1319, 67, 2150, 273, 883, 18, 1966, 67, 2150, 1718, 273, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2740, 12, 2890, 16, 883, 4672, 1319, 67, 2150, 273, 599, 309, 3859, 12, 2150, 16, 296, 1966, 67, 2150, 11, 4672, 1319, 67, 2150, 273, 883, 18, 1966, 67, 2150, 1718, 273, 23...
coeff = f.dict().values()[0] / g.dict().values()[0]
coeff = self.base_ring()(f.dict().values()[0] / g.dict().values()[0])
def monomial_quotient(self,f, g, coeff=False): """ Return f/g, where both f and g are treated as monomials. Coefficients are ignored by default.
80b87b684fff1938ac6eef62a66675b75b66dbbb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/80b87b684fff1938ac6eef62a66675b75b66dbbb/multi_polynomial_ring.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 4708, 649, 67, 9270, 1979, 12, 2890, 16, 74, 16, 314, 16, 11943, 33, 8381, 4672, 3536, 2000, 284, 19, 75, 16, 1625, 3937, 284, 471, 314, 854, 13974, 487, 312, 4708, 649, 87, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 4708, 649, 67, 9270, 1979, 12, 2890, 16, 74, 16, 314, 16, 11943, 33, 8381, 4672, 3536, 2000, 284, 19, 75, 16, 1625, 3937, 284, 471, 314, 854, 13974, 487, 312, 4708, 649, 87, 18,...
self._record_member(tarinfo)
self.members.append(tarinfo)
def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. """ self._check("aw")
f3c5611fef7cbd2ac8f0bf4e44bf11fe210817be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3c5611fef7cbd2ac8f0bf4e44bf11fe210817be/tarfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 768, 12, 2890, 16, 8232, 1376, 16, 17041, 33, 7036, 4672, 3536, 986, 326, 20334, 966, 733, 1375, 11718, 1376, 11, 358, 326, 5052, 18, 971, 1375, 768, 2603, 11, 353, 864, 16, 8232,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 768, 12, 2890, 16, 8232, 1376, 16, 17041, 33, 7036, 4672, 3536, 986, 326, 20334, 966, 733, 1375, 11718, 1376, 11, 358, 326, 5052, 18, 971, 1375, 768, 2603, 11, 353, 864, 16, 8232,...
exp_value = locale.atof(new_value) * (10 ** digits[1]) if exp_value - int(exp_value) != 0.0: entry.stop_emission('insert-text')
def sig_insert_text(self, entry, new_text, new_text_length, position): value = entry.get_text() position = entry.get_position() new_value = value[:position] + new_text + value[position:] try: if new_value == '-': return
d8f659740fb3e5e4be215ae95ebd292d7d19fe40 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9151/d8f659740fb3e5e4be215ae95ebd292d7d19fe40/float.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3553, 67, 6387, 67, 955, 12, 2890, 16, 1241, 16, 394, 67, 955, 16, 394, 67, 955, 67, 2469, 16, 1754, 4672, 460, 273, 1241, 18, 588, 67, 955, 1435, 1754, 273, 1241, 18, 588, 67, 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, 3553, 67, 6387, 67, 955, 12, 2890, 16, 1241, 16, 394, 67, 955, 16, 394, 67, 955, 67, 2469, 16, 1754, 4672, 460, 273, 1241, 18, 588, 67, 955, 1435, 1754, 273, 1241, 18, 588, 67, 327...
return urllib.parsequote(component[:31], safe='')
return urllib.parse.quote(component[:31], safe='')
def _pncomp2url(component): # We want to quote slashes return urllib.parsequote(component[:31], safe='')
bad85df6fc58d9616983b3c50d59d26964e54c3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/bad85df6fc58d9616983b3c50d59d26964e54c3f/macurl2path.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7449, 2919, 22, 718, 12, 4652, 4672, 468, 1660, 2545, 358, 3862, 19034, 327, 11527, 18, 2670, 18, 6889, 12, 4652, 10531, 6938, 6487, 4183, 2218, 6134, 225, 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, 0, 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, 7449, 2919, 22, 718, 12, 4652, 4672, 468, 1660, 2545, 358, 3862, 19034, 327, 11527, 18, 2670, 18, 6889, 12, 4652, 10531, 6938, 6487, 4183, 2218, 6134, 225, 2, -100, -100, -100, -100...
if self.selCurve_length/self.o.scale < 0.03:
if self.mouse_within_stickiness_limit(event, DRAG_STICKINESS_LIMIT):
def leftUp(self, event): env.history.flush_saved_transients() # flush any transient message it saved up if self.ignore_next_leftUp_event: # This event is the second leftUp of a double click, so ignore it. self.ignore_next_leftUp_event = False return if self.cursor_over_when_LMB_pressed == 'Empty Space': self.end_selection_curve(event) return self.o.assy.unpickparts() # Fixes bug 1400. mark 060126. #& Should this go further to the top? mark if self.bond_clicked: # Select or unselect the bond's atoms, or delete the bond, based on the current modkey. self.modkeyBond(self.bond_clicked, event) return if not self.dragatom: # No atom or singlet was dragged (or clicked); return. return a = self.dragatom if self.selCurve_length/self.o.scale < 0.03: # didn't move much, call it a click event = self.LMB_press_event if self.dragatom_clicked: # Select, unselect or delete the atom based on the current modkey. self.modkeyAtom(a, event) if a.is_singlet(): # Finish singlet operation. self.modkeySinglet(a, event) self.baggage = [] self.dragatom = None #bruce 041130 fix bug 230 self.o.selatom = None #bruce 041208 for safety in case it's killed #bruce 041130 comment: it forgets selatom, but doesn't repaint, # so selatom is still visible; then the next event will probably # set it again; all this seems ok for now, so I'll leave it alone. #bruce 041206: I changed my mind, since it seems dangerous to leave # it visible (seemingly active) but not active. So I'll repaint here. # In future we can consider first simulating a update_selatom at the # current location (to set selatom again, if appropriate), but it's # not clear this would be good, so *this* is what I won't do for now. #self.o.gl_update() #& Now handled in modkey*() methods. mark 060210.
07fcee8afa6d8aa107e744aeb4ac2e422cc110df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/07fcee8afa6d8aa107e744aeb4ac2e422cc110df/depositMode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2002, 1211, 12, 2890, 16, 871, 4672, 1550, 18, 8189, 18, 11330, 67, 14077, 67, 2338, 5828, 1435, 468, 3663, 1281, 12315, 883, 518, 5198, 731, 225, 309, 365, 18, 6185, 67, 4285, 67, 448...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2002, 1211, 12, 2890, 16, 871, 4672, 1550, 18, 8189, 18, 11330, 67, 14077, 67, 2338, 5828, 1435, 468, 3663, 1281, 12315, 883, 518, 5198, 731, 225, 309, 365, 18, 6185, 67, 4285, 67, 448...
CurrentTheme.DEBUG_CRITICAL_COLOR.name())
CurrentTheme.DEBUG_CRITICAL_COLOR.name() + ';background-color:
def __init__(self, parent = None): QtGui.QDialog.__init__(self, parent) core.debug.DebugPrint.getInstance().set_stream(debugStream(self.write)) self.setWindowTitle('VisTrails Messages') layout = QtGui.QVBoxLayout() self.setLayout(layout)
ee8906c91039ec4223a5bb680b953260096a657f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/ee8906c91039ec4223a5bb680b953260096a657f/debug.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 273, 599, 4672, 23425, 18, 53, 6353, 16186, 2738, 972, 12, 2890, 16, 982, 13, 2922, 18, 4148, 18, 2829, 5108, 18, 588, 1442, 7675, 542, 67, 3256, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 273, 599, 4672, 23425, 18, 53, 6353, 16186, 2738, 972, 12, 2890, 16, 982, 13, 2922, 18, 4148, 18, 2829, 5108, 18, 588, 1442, 7675, 542, 67, 3256, ...
INPUT: - ``ct`` - The Cartan Type OPTIONAL ARGUMENTS: - ``base_ring`` - (default: `\ZZ`) - ``prefix`` (default an automatically generated prefix based on Cartan type) - ``cache`` - (default False) setting cache = True is a substantial speedup at the expense of some memory. - ``style`` - (default "lattice") can be set style = "coroots" to obtain an alternative representation of the elements.
INPUT: - ``ct`` -- The Cartan Type OPTIONAL ARGUMENTS: - ``base_ring`` -- (default: `\ZZ`) - ``prefix`` -- (default: an automatically generated prefix based on Cartan type) - ``cache`` -- (default False) setting cache = True is a substantial speedup at the expense of some memory. - ``style`` -- (default "lattice") can be set style = "coroots" to obtain an alternative representation of the elements.
def WeylCharacterRing(ct, base_ring=ZZ, prefix=None, cache=False, style="lattice"): r""" A class for rings of Weyl characters. The Weyl character is a character of a semisimple (or reductive) Lie group or algebra. They form a ring, in which the addition and multiplication correspond to direct sum and tensor product of representations. INPUT: - ``ct`` - The Cartan Type OPTIONAL ARGUMENTS: - ``base_ring`` - (default: `\ZZ`) - ``prefix`` (default an automatically generated prefix based on Cartan type) - ``cache`` - (default False) setting cache = True is a substantial speedup at the expense of some memory. - ``style`` - (default "lattice") can be set style = "coroots" to obtain an alternative representation of the elements. If no prefix specified, one is generated based on the Cartan type. It is good to name the ring after the prefix, since then it can parse its own output. EXAMPLES:: sage: G2 = WeylCharacterRing(['G',2]) sage: [fw1,fw2] = G2.fundamental_weights() sage: 2*G2(2*fw1+fw2) 2*G2(4,-1,-3) sage: 2*G2(4,-1,-3) 2*G2(4,-1,-3) sage: G2(4,-1,-3).degree() 189 Note that since the ring was named `G_2` after its default prefix, it was able to parse its own output. You do not have to use the default prefix. Thus: EXAMPLES:: sage: R = WeylCharacterRing(['B',3], prefix='R') sage: chi = R(R.fundamental_weights()[3]); chi R(1/2,1/2,1/2) sage: R(1/2,1/2,1/2) == chi True You may choose an alternative style of labeling the elements. If you create the ring with the option style="coroots" then the integers in the label are not the components of the highest weight vector, but rather the coefficients when the highest weight vector is decomposed into a product of irreducibles. These coefficients are the values of the coroots on the highest weight vector. In the coroot style the Lie group or Lie algebra is treated as semisimple, so you lose the distinction between GL(n) and SL(n); you also some information about representations of E6 and E7 for the same reason. The coroot style gives you output that is comparable to that in Tables of Dimensions, Indices and Branching Rules for Representations of Simple Lie Algebras (Marcel Dekker, 1981). EXAMPLES:: sage: B3 = WeylCharacterRing("B3",style="coroots") sage: [fw1,fw2,fw3]=B3.fundamental_weights() sage: fw1+fw3 (3/2, 1/2, 1/2) sage: B3(fw1+fw3) B3(1,0,1) sage: B3(1,0,1) B3(1,0,1) For type ['A',r], the coroot representation carries less information, since elements of the weight lattice that are orthogonal to the coroots are represented as zero. This means that with the default style you can represent the determinant, but not in the coroot style. In the coroot style, elements of the Weyl character ring represent characters of SL(r+1,CC), while in the default style, they represent characters of GL(r+1,CC). EXAMPLES: sage: A2 = WeylCharacterRing("A2") sage: L = A2.space() sage: [A2(L.det()), A2(L(0))] [A2(1,1,1), A2(0,0,0)] sage: A2(L.det()) == A2(L(0)) False sage: A2 = WeylCharacterRing("A2", style="coroots") sage: [A2(L.det()), A2(L(0))] [A2(0,0), A2(0,0)] sage: A2(L.det()) == A2(L(0)) True The multiplication in a Weyl character ring corresponds to the product of characters, which you can use to determine the decomposition of tensor products into irreducibles. For example, let us compute the tensor product of the standard and spin representations of Spin(7). EXAMPLES:: sage: B3 = WeylCharacterRing("B3") sage: [fw1,fw2,fw3]=B3.fundamental_weights() sage: [B3(fw1).degree(),B3(fw3).degree()] [7, 8] sage: B3(fw1)*B3(fw3) B3(1/2,1/2,1/2) + B3(3/2,1/2,1/2) The name of the irreducible representation encodes the highest weight vector. TESTS:: sage: F4 = WeylCharacterRing(['F',4], cache = True) sage: [fw1,fw2,fw3,fw4] = F4.fundamental_weights() sage: chi = F4(fw4); chi, chi.degree() (F4(1,0,0,0), 26) sage: chi^2 F4(0,0,0,0) + F4(1,0,0,0) + F4(1,1,0,0) + F4(3/2,1/2,1/2,1/2) + F4(2,0,0,0) sage: [x.degree() for x in [F4(0,0,0,0), F4(1,0,0,0), F4(1,1,0,0), F4(3/2,1/2,1/2,1/2), F4(2,0,0,0)]] [1, 26, 52, 273, 324] You can produce a list of the irreducible elements of an irreducible character. EXAMPLES:: sage: R = WeylCharacterRing(['A',2], prefix = R) sage: sorted(R([2,1,0]).mlist()) [[(1, 1, 1), 2], [(1, 2, 0), 1], [(1, 0, 2), 1], [(2, 1, 0), 1], [(2, 0, 1), 1], [(0, 1, 2), 1], [(0, 2, 1), 1]] """ ct = cartan_type.CartanType(ct) return cache_wcr(ct, base_ring=base_ring, prefix=prefix, cache=cache, style=style)
67d654215599230a09c5cccc4e460acbf57b6338 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/67d654215599230a09c5cccc4e460acbf57b6338/weyl_characters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 678, 402, 80, 7069, 10369, 12, 299, 16, 1026, 67, 8022, 33, 27096, 16, 1633, 33, 7036, 16, 1247, 33, 8381, 16, 2154, 1546, 80, 24966, 6, 4672, 436, 8395, 432, 667, 364, 26537, 434, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 678, 402, 80, 7069, 10369, 12, 299, 16, 1026, 67, 8022, 33, 27096, 16, 1633, 33, 7036, 16, 1247, 33, 8381, 16, 2154, 1546, 80, 24966, 6, 4672, 436, 8395, 432, 667, 364, 26537, 434, 6...
this = apply(_quickfix.new_RefCompID, args)
this = _quickfix.new_RefCompID(*args)
def __init__(self, *args): this = apply(_quickfix.new_RefCompID, 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, 1957, 2945, 734, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 1957, 2945, 734, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 3...
resDict = {'Successful':lfnReplicas,'Failed':failed} return S_OK(resDict) def __SEActive(self,se):
resDict = {'Successful':lfnReplicas, 'Failed':failed} return S_OK( resDict ) def __SEActive( self, se ):
def getActiveReplicas(self,lfns): """ Get all the replicas for the SEs which are in Active status for reading. """ res = self.getCatalogReplicas(lfns) if not res['OK']: return res failed = res['Value']['Failed'] seReadStatus = {} lfnReplicas = {} for lfn,replicas in res['Value']['Successful'].items(): for se in replicas.keys(): if not seReadStatus.has_key(se): res = self.__SEActive(se) if res['OK']: seReadStatus[se] = res['Value']['Read'] else: seReadStatus[se] = False if not seReadStatus[se]: replicas.pop(se) lfnReplicas[lfn] = replicas resDict = {'Successful':lfnReplicas,'Failed':failed} return S_OK(resDict)
9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11960, 17248, 12, 2890, 16, 20850, 2387, 4672, 3536, 968, 777, 326, 21545, 364, 326, 3174, 87, 1492, 854, 316, 8857, 1267, 364, 6453, 18, 3536, 400, 273, 365, 18, 588, 9769, 17248, 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, 11960, 17248, 12, 2890, 16, 20850, 2387, 4672, 3536, 968, 777, 326, 21545, 364, 326, 3174, 87, 1492, 854, 316, 8857, 1267, 364, 6453, 18, 3536, 400, 273, 365, 18, 588, 9769, 17248, 12, ...
sage: tmp = tmp_dir()
sage: tmp = tmp_dir() + '.sagenb'
def html(self, error_code = None, **kwargs): """ Returns HTML and JavaScript for a reCAPTCHA challenge and response field.
ebba517baa5d548380d9cdacd6fb8b268637f526 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/ebba517baa5d548380d9cdacd6fb8b268637f526/challenge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 12, 2890, 16, 555, 67, 710, 273, 599, 16, 2826, 4333, 4672, 3536, 2860, 3982, 471, 11905, 364, 279, 283, 20053, 1792, 37, 12948, 471, 766, 652, 18, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 12, 2890, 16, 555, 67, 710, 273, 599, 16, 2826, 4333, 4672, 3536, 2860, 3982, 471, 11905, 364, 279, 283, 20053, 1792, 37, 12948, 471, 766, 652, 18, 2, -100, -100, -100, -100, -10...
item.top_link = False
if not hasattr(item,'top_link'): item.top_link = False
def add_props(cls, user, wrapped): from r2.lib.count import incr_counts from r2.lib.media import thumbnail_url
202112bc9dafe29978937e5d7b06f70830a962b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6723/202112bc9dafe29978937e5d7b06f70830a962b8/link.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 9693, 12, 6429, 16, 729, 16, 5805, 4672, 628, 436, 22, 18, 2941, 18, 1883, 1930, 17633, 67, 8008, 628, 436, 22, 18, 2941, 18, 5829, 1930, 9134, 67, 718, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 9693, 12, 6429, 16, 729, 16, 5805, 4672, 628, 436, 22, 18, 2941, 18, 1883, 1930, 17633, 67, 8008, 628, 436, 22, 18, 2941, 18, 5829, 1930, 9134, 67, 718, 2, -100, -100, -100,...
logger.error("Content of config file '%s' is not valid. Correct it!\n%s\n" % (self.CONFIG_FILE, e)) raise SystemExit, 1
logger.error("Content of config file '%s' is not valid. Correct it!\n%s\n" % (self.CONFIG_FILE, e)) raise SystemExit, 1
def read_config_file(self, filename):
6064a7affcbfaa2b1502a77f48b73f48a58111dd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11867/6064a7affcbfaa2b1502a77f48b73f48a58111dd/Settings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 1425, 67, 768, 12, 2890, 16, 1544, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 1425, 67, 768, 12, 2890, 16, 1544, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
return ts.utranslate(None, _(u'Keywords list is empty!'), context=self.context)
return ts.utranslate(domain='quintagroup.seoptimizer', msgid=u'Keywords list is empty!', context=self.context)
def validateKeywords(self, text): """ see interface """ ts = getToolByName(self.context, 'translation_service') # extract keywords from text if text.lower().strip(): keywords = map(lambda x: x.strip(), text.lower().strip().split('\n')) else: return ts.utranslate(None, _(u'Keywords list is empty!'), context=self.context) # request html page of context object url = '%s?without_metatag_keywords=1' % self.context.absolute_url()
1ade0dcce533358bea345a2e24f3e2f83dba590e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10421/1ade0dcce533358bea345a2e24f3e2f83dba590e/keywords.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 14149, 12, 2890, 16, 977, 4672, 3536, 2621, 1560, 3536, 3742, 273, 336, 6364, 5911, 12, 2890, 18, 2472, 16, 296, 10173, 67, 3278, 6134, 468, 2608, 7093, 628, 977, 309, 977, 18, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 14149, 12, 2890, 16, 977, 4672, 3536, 2621, 1560, 3536, 3742, 273, 336, 6364, 5911, 12, 2890, 18, 2472, 16, 296, 10173, 67, 3278, 6134, 468, 2608, 7093, 628, 977, 309, 977, 18, 8...
if self.path.find("/echotitle") != 0:
if not self._ShouldHandleRequest("/echotitle"):
def EchoTitleHandler(self): """This handler is like Echo, but sets the page title to the request."""
41f6cf83747d6ca25a473f2e42d08288be9d7a5d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/41f6cf83747d6ca25a473f2e42d08288be9d7a5d/testserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 28995, 4247, 1503, 12, 2890, 4672, 3536, 2503, 1838, 353, 3007, 28995, 16, 1496, 1678, 326, 1363, 2077, 358, 326, 590, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 28995, 4247, 1503, 12, 2890, 4672, 3536, 2503, 1838, 353, 3007, 28995, 16, 1496, 1678, 326, 1363, 2077, 358, 326, 590, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
d.addCallback(self.__fetchMessages).addCallback(self.__disconnect)
d.addCallbacks(self.__fetchMessages, self.catchErrors)
def __getMessagesFromUIDS(self, msgs):
cd0d773c52b7eb7870b5e37e0d7c668e7d25477c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/cd0d773c52b7eb7870b5e37e0d7c668e7d25477c/imap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 5058, 1265, 3060, 55, 12, 2890, 16, 8733, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 5058, 1265, 3060, 55, 12, 2890, 16, 8733, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
s = NNTP('news')
s = NNTP('news', readermode='reader')
def _test(): """Minimal test function.""" s = NNTP('news') resp, count, first, last, name = s.group('comp.lang.python') print resp print 'Group', name, 'has', count, 'articles, range', first, 'to', last resp, subs = s.xhdr('subject', first + '-' + last) print resp for item in subs: print "%7s %s" % item resp = s.quit() print resp
9dd78729459478023a46401d8f04e2dc3bf974e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9dd78729459478023a46401d8f04e2dc3bf974e5/nntplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 13332, 3536, 2930, 2840, 1842, 445, 12123, 272, 273, 423, 1784, 52, 2668, 18443, 2187, 855, 1035, 390, 2218, 10530, 6134, 1718, 16, 1056, 16, 1122, 16, 1142, 16, 508, 273, 272...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3813, 13332, 3536, 2930, 2840, 1842, 445, 12123, 272, 273, 423, 1784, 52, 2668, 18443, 2187, 855, 1035, 390, 2218, 10530, 6134, 1718, 16, 1056, 16, 1122, 16, 1142, 16, 508, 273, 272...
elif (not info and resolve) and (not cfg.autoResolve or brokenByErase) and suggMap:
elif (not info and cfg.autoResolve) and (not cfg.autoResolve or brokenByErase) and suggMap:
def doUpdate(cfg, pkgList, replaceFiles = False, tagScript = None, keepExisting = False, depCheck = True, depsRecurse = True, test = False, justDatabase = False, recurse = True, info = False, updateByDefault = True, callback = None): if not callback: callback = callbacks.UpdateCallback() client = conaryclient.ConaryClient(cfg) applyList = [] if type(pkgList) is str: pkgList = ( pkgList, ) for pkgStr in pkgList: if os.path.exists(pkgStr) and os.path.isfile(pkgStr): try: cs = changeset.ChangeSetFromFile(pkgStr) except BadContainer, msg: # ensure that it is obvious that a file is being referenced if pkgStr[0] not in './': pkgStr = './' + pkgStr log.error("'%s' is not a valid conary changeset: %s" % (pkgStr, msg)) sys.exit(1) applyList.append(cs) else: applyList.append(parseTroveSpec(pkgStr)) # dedup applyList = set(applyList) if not info: client.checkWriteableRoot() try: (updJob, depFailures, suggMap, brokenByErase) = \ client.updateChangeSet(applyList, depsRecurse = depsRecurse, resolveDeps = depCheck, keepExisting = keepExisting, test = test, recurse = recurse, updateByDefault = updateByDefault, callback = callback, split = True) if depFailures: callback.done() print "The following dependencies could not be resolved:" for (troveName, depSet) in depFailures: print " %s:\n\t%s" % \ (troveName, "\n\t".join(str(depSet).split("\n"))) return elif (not info and resolve) and (not cfg.autoResolve or brokenByErase) and suggMap: callback.done() print "Additional troves are needed:" for (req, suggList) in suggMap.iteritems(): print " %s -> %s" % \ (req, " ".join(["%s(%s)" % (x[0], x[1].trailingRevision().asString()) for x in suggList])) return elif suggMap: callback.done() print "Including extra troves to resolve dependencies:" print " ", items = {} for suggList in suggMap.itervalues(): # remove duplicates items.update(dict.fromkeys([(x[0], x[1]) for x in suggList])) items = items.keys() items.sort() print "%s" % (" ".join(["%s(%s)" % (x[0], x[1].trailingRevision().asString()) for x in items])) if info: return if brokenByErase: print "Troves being removed create unresolved dependencies:" for (troveName, depSet) in brokenByErase: print " %s:\n\t%s" % \ (troveName, "\n\t".join(str(depSet).split("\n"))) return if info: callback.done() new = [] for cs in updJob.getChangeSets(): for x in cs.iterNewTroveList(): oldVersion = x.getOldVersion() newVersion = x.getNewVersion() if oldVersion: oldTVersion = oldVersion.trailingRevision() else: # if there is no oldVersion, this is a new trove new.append(("%s (%s)" % (x.getName(), newVersion.trailingRevision().asString()), 'N')) continue newTVersion = newVersion.trailingRevision() if oldVersion.branch() != newVersion.branch(): kind = 'B' elif oldTVersion.getVersion() != newTVersion.getVersion(): kind = 'V' elif oldTVersion.getSourceCount() != \ newTVersion.getSourceCount(): kind = 'S' else: kind = 'B' new.append(("%s (%s -> %s)" % (x.getName(), oldTVersion.asString(), newTVersion.asString()), kind)) new.sort() new = [ "%s %s" % (x[1], x[0]) for x in new ] old = [] for cs in updJob.getChangeSets(): old += [ "%s (%s)" % (x[0], x[1].trailingRevision().asString()) for x in cs.getOldTroveList() ] old.sort() if not new and not old: print "No troves are affected by this update." if new: print "Versions of the following troves will be updated:" print "\t", "\n\t".join(new) if new and old: print "\n", if old: print "Versions of the following troves will be removed:" print "\t", "\n\t".join(old) return keepExisting = False client.applyUpdate(updJob, replaceFiles, tagScript, test = test, justDatabase = justDatabase, localRollbacks = cfg.localRollbacks, callback = callback) except conaryclient.UpdateError, e: log.error(e) except repository.CommitError, e: log.error(e)
97596823cfe40479a7344d248a798784350cb0eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/97596823cfe40479a7344d248a798784350cb0eb/updatecmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 1891, 12, 7066, 16, 3475, 682, 16, 1453, 2697, 273, 1083, 16, 1047, 3651, 273, 599, 16, 3455, 9895, 273, 1083, 16, 5993, 1564, 273, 1053, 16, 8740, 426, 17682, 273, 1053, 16, 1842...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 1891, 12, 7066, 16, 3475, 682, 16, 1453, 2697, 273, 1083, 16, 1047, 3651, 273, 599, 16, 3455, 9895, 273, 1083, 16, 5993, 1564, 273, 1053, 16, 8740, 426, 17682, 273, 1053, 16, 1842...
tunermask |= (1 << self.linked[slotid])
for slot in self.linked[slotid]: tunermask |= (1 << slot)
def addLNBSimple(self, sec, slotid, diseqcmode, toneburstmode = diseqcParam.NO, diseqcpos = diseqcParam.SENDNO, orbpos = 0, longitude = 0, latitude = 0, loDirection = 0, laDirection = 0, turningSpeed = rotorParam.FAST, useInputPower=True, inputPowerDelta=50): if orbpos is None: return #simple defaults sec.addLNB() tunermask = 1 << slotid if self.equal.has_key(slotid): tunermask |= (1 << self.equal[slotid]) elif self.linked.has_key(slotid): tunermask |= (1 << self.linked[slotid]) sec.setLNBLOFL(9750000) sec.setLNBLOFH(10600000) sec.setLNBThreshold(11700000) sec.setLNBIncreasedVoltage(lnbParam.OFF) sec.setRepeats(0) sec.setFastDiSEqC(0) sec.setSeqRepeat(0) sec.setVoltageMode(switchParam.HV) sec.setToneMode(switchParam.HILO) sec.setCommandOrder(0)
9063d6049a81d8945126c66e0a12ce8b5a64b4a1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/9063d6049a81d8945126c66e0a12ce8b5a64b4a1/NimManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 48, 20626, 5784, 12, 2890, 16, 1428, 16, 4694, 350, 16, 302, 784, 30675, 3188, 16, 30600, 70, 18593, 3188, 273, 302, 784, 30675, 786, 18, 3417, 16, 302, 784, 30675, 917, 273, 302,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 48, 20626, 5784, 12, 2890, 16, 1428, 16, 4694, 350, 16, 302, 784, 30675, 3188, 16, 30600, 70, 18593, 3188, 273, 302, 784, 30675, 786, 18, 3417, 16, 302, 784, 30675, 917, 273, 302,...
def setdiag(self, values, k=0): M, N = self.shape assert len(values) >= max(M, N) for i in xrange(min(M, N-k)): self[i, i+k] = values[i] return
def setdiag(self, values, k=0): M, N = self.shape assert len(values) >= max(M, N) for i in xrange(min(M, N-k)): self[i, i+k] = values[i] return
ea0c6885c65a199b29ef216ee91e52a46b3ef770 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ea0c6885c65a199b29ef216ee91e52a46b3ef770/sparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12264, 12, 2890, 16, 924, 16, 417, 33, 20, 4672, 490, 16, 423, 273, 365, 18, 4867, 1815, 562, 12, 2372, 13, 1545, 943, 12, 49, 16, 423, 13, 364, 277, 316, 12314, 12, 1154, 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, 444, 12264, 12, 2890, 16, 924, 16, 417, 33, 20, 4672, 490, 16, 423, 273, 365, 18, 4867, 1815, 562, 12, 2372, 13, 1545, 943, 12, 49, 16, 423, 13, 364, 277, 316, 12314, 12, 1154, 12,...
if not ssl: ssl = config.get('smtp_ssl', False)
def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, openobject_id=False, ssl=False, debug=False, subtype='plain', x_headers=None, priority='3'): """Send an email. Arguments: `email_from`: A string used to fill the `From` header, if falsy, config['email_from'] is used instead. Also used for the `Reply-To` header if `reply_to` is not provided `email_to`: a sequence of addresses to send the mail to. """ if x_headers is None: x_headers = {} if not ssl: ssl = config.get('smtp_ssl', False) if not (email_from or config['email_from']): raise ValueError("Sending an email requires either providing a sender " "address or having configured one") if not email_from: email_from = config.get('email_from', False) if not email_cc: email_cc = [] if not email_bcc: email_bcc = [] if not body: body = u'' try: email_body = body.encode('utf-8') except (UnicodeEncodeError, UnicodeDecodeError): email_body = body try: email_text = MIMEText(email_body.encode('utf8') or '',_subtype=subtype,_charset='utf-8') except: email_text = MIMEText(email_body or '',_subtype=subtype,_charset='utf-8') if attach: msg = MIMEMultipart() else: msg = email_text 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) msg['X-Priority'] = priorities.get(priority, '3 (Normal)') # Add dynamic X Header for key, value in x_headers.iteritems(): msg['%s' % key] = str(value) if attach: msg.attach(email_text) 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) class WriteToLogger(object): def __init__(self): self.logger = netsvc.Logger() def write(self, s): self.logger.notifyChannel('email_send', netsvc.LOG_DEBUG, s) smtp_server = config['smtp_server'] if smtp_server.startswith('maildir:/'): from mailbox import Maildir maildir_path = smtp_server[8:] try: mdir = Maildir(maildir_path,factory=None, create = True) mdir.add(msg.as_string(True)) return True except Exception,e: netsvc.Logger().notifyChannel('email_send (maildir)', netsvc.LOG_ERROR, e) return False return _email_send(msg, openobject_id=openobject_id, debug=debug)
478ab1c86d3d35f3b5c2e40276f5574c62d56543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/478ab1c86d3d35f3b5c2e40276f5574c62d56543/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...
if self.options[0][1] and not self.grouped_options[0][0]:
if len(self.options) > 0 and self.options[0][1] and not self.grouped_options[0][0]:
def prepare(self): super(SingleSelectField, self).prepare() if self.options[0][1] and not self.grouped_options[0][0]: self.options = [(None, self.null_text)] + self.options self.grouped_options = [(None, self.options)]
ccc28c34f89dd5d5ca0f28012ac1a777beb75278 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11476/ccc28c34f89dd5d5ca0f28012ac1a777beb75278/widgets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2911, 12, 2890, 4672, 2240, 12, 5281, 3391, 974, 16, 365, 2934, 9366, 1435, 309, 562, 12, 2890, 18, 2116, 13, 405, 374, 471, 365, 18, 2116, 63, 20, 6362, 21, 65, 471, 486, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2911, 12, 2890, 4672, 2240, 12, 5281, 3391, 974, 16, 365, 2934, 9366, 1435, 309, 562, 12, 2890, 18, 2116, 13, 405, 374, 471, 365, 18, 2116, 63, 20, 6362, 21, 65, 471, 486, 365, 18, ...
netsvc.Logger().notifyChannel("web-services", netsvc.LOG_WARNING, "Netrpc: closing because of exception %s" % str(e))
import logging logging.getLogger('web-services').warning("Netrpc: closing because of exception %s" % str(e))
def run(self): # import select try: self.running = True while self.running: (clientsocket, address) = self.socket.accept() ct = TinySocketClientThread(clientsocket, self.threads) clientsocket = None self.threads.append(ct) ct.start() lt = len(self.threads) if (lt > 10) and (lt % 10 == 0): # Not many threads should be serving at the same time, so log # their abuse. netsvc.Logger().notifyChannel("web-services", netsvc.LOG_DEBUG, "Netrpc: %d threads" % len(self.threads)) self.socket.close() except Exception, e: netsvc.Logger().notifyChannel("web-services", netsvc.LOG_WARNING, "Netrpc: closing because of exception %s" % str(e)) self.socket.close() return False
d4d1302faeb9c691a71d4e014d8b13d85815ae34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d4d1302faeb9c691a71d4e014d8b13d85815ae34/netrpc_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 1930, 2027, 775, 30, 365, 18, 8704, 273, 1053, 1323, 365, 18, 8704, 30, 261, 2625, 7814, 16, 1758, 13, 273, 365, 18, 7814, 18, 9436, 1435, 5691, 273, 399, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 468, 1930, 2027, 775, 30, 365, 18, 8704, 273, 1053, 1323, 365, 18, 8704, 30, 261, 2625, 7814, 16, 1758, 13, 273, 365, 18, 7814, 18, 9436, 1435, 5691, 273, 399, ...
if (ext.traditional_convergence_test(target_evaluator.n)(x, g)):
if (ext.traditional_convergence_test(n)(x, g)):
def filter(self, msg, x, g): if (msg.find("Rounding errors prevent further progress.") >= 0): if (self.ignore_line_search_failed_rounding_errors): return 0 elif (msg.find("The step is at the lower bound stpmax().") >= 0): if (ext.traditional_convergence_test(target_evaluator.n)(x, g)): return 0 if (self.ignore_line_search_failed_step_at_lower_bound): return -1 elif (msg.find("The step is at the upper bound stpmax().") >= 0): if (self.ignore_line_search_failed_step_at_upper_bound): return -1 elif (msg.find("Number of function evaluations has reached" + " maxfev().") >= 0): if (self.ignore_line_search_failed_maxfev): return -1 elif (msg.find("Relative width of the interval of uncertainty" + " is at most xtol().") >= 0): if (self.ignore_line_search_failed_xtol): return -1 elif (msg.find("The search direction is not a descent direction.") >= 0): if (ext.traditional_convergence_test(target_evaluator.n)(x, g)): return 0 if (self.ignore_search_direction_not_descent): return -1 return 1
b6340e7824d345c7845a3712377185848fbb42fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/b6340e7824d345c7845a3712377185848fbb42fd/lbfgs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 12, 2890, 16, 1234, 16, 619, 16, 314, 4672, 309, 261, 3576, 18, 4720, 2932, 11066, 310, 1334, 5309, 9271, 4007, 1199, 13, 1545, 374, 4672, 309, 261, 2890, 18, 6185, 67, 1369, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 12, 2890, 16, 1234, 16, 619, 16, 314, 4672, 309, 261, 3576, 18, 4720, 2932, 11066, 310, 1334, 5309, 9271, 4007, 1199, 13, 1545, 374, 4672, 309, 261, 2890, 18, 6185, 67, 1369, 67,...