rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
if self.cur[5]: return
if self.cur[-1]: return
def set_cmd(self, cmd): if self.cur[5]: return # already set self.cmd = cmd self.simulate_call(cmd)
9ebcb42f5913b3bc74aa94442c2ef4852fc24231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9ebcb42f5913b3bc74aa94442c2ef4852fc24231/profile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 4172, 12, 2890, 16, 1797, 4672, 309, 365, 18, 1397, 18919, 21, 14542, 327, 282, 468, 1818, 444, 365, 18, 4172, 273, 1797, 365, 18, 9812, 6243, 67, 1991, 12, 4172, 13, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 4172, 12, 2890, 16, 1797, 4672, 309, 365, 18, 1397, 18919, 21, 14542, 327, 282, 468, 1818, 444, 365, 18, 4172, 273, 1797, 365, 18, 9812, 6243, 67, 1991, 12, 4172, 13, 2, -10...
outer_hbox.pack_start(_align_middle(popin_image, right_pad=15))
outer_hbox.pack_start(_align_middle(popin_image))
def rebuild_video_details(self): # this removes the child widget if there is one self.remove()
db1d0acddfcfc83a843d818e177045b6e76299dc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/db1d0acddfcfc83a843d818e177045b6e76299dc/video.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13419, 67, 9115, 67, 6395, 12, 2890, 4672, 468, 333, 7157, 326, 1151, 3604, 309, 1915, 353, 1245, 365, 18, 4479, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13419, 67, 9115, 67, 6395, 12, 2890, 4672, 468, 333, 7157, 326, 1151, 3604, 309, 1915, 353, 1245, 365, 18, 4479, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if gotSession: return sf else: log.info("Reason: %s", str(excpt)) raise Exception
time.sleep(interval) log.warn("Reason: %s", str(excpt)) raise excpt
def internal_service_factory(self, communicator, user="root", group=None, retries=6, interval=10, client_uuid=None): """ Try to return a ServiceFactory from the grid. Try a number of times then give up and raise the last exception returned. This method will only work internally to the grid, i.e. behind the Glacier2 firewall. It is intended for internal servers to be able to create sessions for accessing the database. communicator := Ice.Communicator used to find the registry user := Username which should have a session created group := Group into which the session should be logged retries := Number of session creation retries before throwing interval := Seconds between retries client_uuid := Uuid of the client which should be used """ log = logging.getLogger("omero.utils") gotSession = False tryCount = 0 excpt = None query = communicator.stringToProxy("IceGrid/Query") query = IceGrid.QueryPrx.checkedCast(query) if client_uuid is None: client_uuid = str(uuid.uuid4()) while (not gotSession) and (tryCount < retries): try: time.sleep(interval) blitz = query.findAllObjectsByType("::Glacier2::SessionManager")[0] blitz = Glacier2.SessionManagerPrx.checkedCast(blitz) sf = blitz.create(user, None, {"omero.client.uuid":client_uuid}) # Group currently unused. sf = omero.api.ServiceFactoryPrx.checkedCast(sf) gotSession = True except Exception, e: tryCount += 1 log.info("Failed to get session on attempt %s", str(tryCount)) excpt = e if gotSession: return sf else: log.info("Reason: %s", str(excpt)) raise Exception
3d21ac5dbe1104b4cabef36f2e9a9730d15fae19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/3d21ac5dbe1104b4cabef36f2e9a9730d15fae19/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2713, 67, 3278, 67, 6848, 12, 2890, 16, 8391, 8844, 16, 729, 1546, 3085, 3113, 1041, 33, 7036, 16, 9453, 33, 26, 16, 3673, 33, 2163, 16, 1004, 67, 7080, 33, 7036, 4672, 3536, 6161, 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, 2713, 67, 3278, 67, 6848, 12, 2890, 16, 8391, 8844, 16, 729, 1546, 3085, 3113, 1041, 33, 7036, 16, 9453, 33, 26, 16, 3673, 33, 2163, 16, 1004, 67, 7080, 33, 7036, 4672, 3536, 6161, 3...
class ExecTransType(CharField): __swig_setmethods__ = {} for _s in [CharField]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, ExecTransType, name, value) __swig_getmethods__ = {} for _s in [CharField]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, ExecTransType, name) __repr__ = _swig_repr def __init__(self, *args): this = _quickfix.new_ExecTransType(*args) try: self.this.append(this) except: self.this = this __swig_destroy__ = _quickfix.delete_ExecTransType __del__ = lambda self : None; ExecTransType_swigregister = _quickfix.ExecTransType_swigregister ExecTransType_swigregister(ExecTransType)
def hasGroup(*args): return _quickfix.Group_hasGroup(*args)
b195a30ce1679e0269bc776f2f6e3591488def1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/b195a30ce1679e0269bc776f2f6e3591488def1f/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 1114, 30857, 1968, 4672, 327, 389, 19525, 904, 18, 1114, 67, 5332, 1114, 30857, 1968, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 1114, 30857, 1968, 4672, 327, 389, 19525, 904, 18, 1114, 67, 5332, 1114, 30857, 1968, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print "stopping read thread for client: "+client_address+" to server: "+server_address break
print "stopping read thread for: "+client_address+" to: "+server_address return
def read_from_client(client_address,server_address): while (True): # if this client or server is not connected break try: this_client = client[client_address][server_address] this_server = server[server_address] except KeyError: print "stopping read thread for client: "+client_address+" to server: "+server_address break # read from the client the amount specified in server_buff_size buffer_avialable = this_client['server_buff_size'] data='' try: data = this_client['socket'].recv(buffer_avialable) except Exception, e: if "socket" not in str(type(e)) and "Socket" not in str(e): raise print "SocketError occured reading from client: "+client_address drop_client(client_address,server_address) print "Dropped client: "+client_address break #stops this thread # if data is non null send it to the to_server_buffer if (len(data) != 0): frame = NATFrame() frame.initAsDataFrame(client_address,data) if TRACE: print "recived "+data+" from client" # send the frame as a string to the outgoing buffer this_server['to_server_buff'].append(frame.toString()) #decrement server_buf_size by len(data) (make atomic) this_client['buff_size_lock'].acquire() this_client['server_buff_size'] -= len(data) this_client['buff_size_lock'].release() sleep(SAMPLE_TIME)
af7b0bcb583945cc32ce1e6ac1cd2acbd599a1e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/af7b0bcb583945cc32ce1e6ac1cd2acbd599a1e9/forwarder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2080, 67, 2625, 12, 2625, 67, 2867, 16, 3567, 67, 2867, 4672, 1323, 261, 5510, 4672, 225, 468, 309, 333, 1004, 578, 1438, 353, 486, 5840, 898, 775, 30, 333, 67, 2625, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2080, 67, 2625, 12, 2625, 67, 2867, 16, 3567, 67, 2867, 4672, 1323, 261, 5510, 4672, 225, 468, 309, 333, 1004, 578, 1438, 353, 486, 5840, 898, 775, 30, 333, 67, 2625, 273, 1...
'Test_method':None
'Test_method':getattr(self,"gps_processor")
def __init__(self): self.attr = {
08e4c95267b2490d8ad400cc6c685442327a1a9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/08e4c95267b2490d8ad400cc6c685442327a1a9a/LSCfileAdd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 1747, 273, 288, 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, 2738, 972, 12, 2890, 4672, 365, 18, 1747, 273, 288, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url)
if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url)
def open_file(self, url): if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 768, 12, 2890, 16, 880, 4672, 309, 880, 10531, 22, 65, 422, 19696, 471, 880, 63, 22, 30, 23, 65, 480, 2023, 30, 327, 365, 18, 3190, 67, 11727, 12, 718, 13, 469, 30, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 768, 12, 2890, 16, 880, 4672, 309, 880, 10531, 22, 65, 422, 19696, 471, 880, 63, 22, 30, 23, 65, 480, 2023, 30, 327, 365, 18, 3190, 67, 11727, 12, 718, 13, 469, 30, 327, ...
print " * structuring..."
def parseStream(content, uniqueId): # make global variables available global parseLine global parseUniqueId # reset global stuff parseLine = 1 parseUniqueId = uniqueId # prepare storage tokens = [] content = protectEscape(content) print " * searching for patterns..." all = R_ALL.findall(content) print " * structuring..." for item in all: fragment = item[0] if R_MULTICOMMENT.match(fragment): # print "Type:MultiComment" content = parseFragmentLead(content, fragment, tokens) tokens.append({ "type" : "comment", "detail" : "multi", "source" : recoverEscape(fragment), "id" : parseUniqueId, "line" : parseLine }) parseLine += len(fragment.split("\n")) - 1 elif R_SINGLECOMMENT.match(fragment): # print "Type:SingleComment" content = parseFragmentLead(content, fragment, tokens) tokens.append({ "type" : "comment", "detail" : "single", "source" : recoverEscape(fragment), "id" : parseUniqueId, "line" : parseLine }) elif R_STRING_A.match(fragment): # print "Type:StringA: %s" % fragment content = parseFragmentLead(content, fragment, tokens) tokens.append({ "type" : "string", "detail" : "singlequotes", "source" : recoverEscape(fragment)[1:-1], "id" : parseUniqueId, "line" : parseLine }) elif R_STRING_B.match(fragment): # print "Type:StringB: %s" % fragment content = parseFragmentLead(content, fragment, tokens) tokens.append({ "type" : "string", "detail" : "doublequotes", "source" : recoverEscape(fragment)[1:-1], "id" : parseUniqueId, "line" : parseLine }) elif R_FLOAT.match(fragment): # print "Type:Float: %s" % fragment content = parseFragmentLead(content, fragment, tokens) tokens.append({ "type" : "number", "detail" : "float", "source" : fragment, "id" : parseUniqueId, "line" : parseLine }) elif R_OPERATORS.match(fragment): # print "Type:Operator: %s" % fragment content = parseFragmentLead(content, fragment, tokens) tokens.append({ "type" : "token", "detail" : config.JSTOKENS[fragment], "source" : fragment, "id" : parseUniqueId, "line" : parseLine }) else: fragresult = R_REGEXP.search(fragment) if fragresult: # print "Type:RegExp: %s" % fragresult.group(0) content = parseFragmentLead(content, fragresult.group(0), tokens) tokens.append({ "type" : "regexp", "detail" : "", "source" : recoverEscape(fragresult.group(0)), "id" : parseUniqueId, "line" : parseLine }) else: print "Type:None!" tokens.extend(parsePart(recoverEscape(content))) tokens.append({ "type" : "eof", "source" : "", "detail" : "", "line" : parseLine, "id" : parseUniqueId }) return tokens
9ece971d3078f234faa537711efcbfa0a7b3ccdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/9ece971d3078f234faa537711efcbfa0a7b3ccdb/tokenizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 1228, 12, 1745, 16, 22345, 4672, 468, 1221, 2552, 3152, 2319, 2552, 1109, 1670, 2552, 1109, 24174, 225, 468, 2715, 2552, 10769, 1109, 1670, 273, 404, 1109, 24174, 273, 22345, 225, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 1228, 12, 1745, 16, 22345, 4672, 468, 1221, 2552, 3152, 2319, 2552, 1109, 1670, 2552, 1109, 24174, 225, 468, 2715, 2552, 10769, 1109, 1670, 273, 404, 1109, 24174, 273, 22345, 225, 46...
self.medium)
self.medium)
def setup(self): print "Starting unattended install setup"
d245408f9a2fd5877bf4770afc7b97ad08147815 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/d245408f9a2fd5877bf4770afc7b97ad08147815/unattended.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 4672, 1172, 315, 11715, 640, 270, 8140, 3799, 3875, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 4672, 1172, 315, 11715, 640, 270, 8140, 3799, 3875, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if filename=='':
if override=='':
def writeDQtable(self,padding=0,filename=''): """ Invoking this method creates a file FILENAME or default ext with name in structure of candidateList with extension DQFlag. """ if filename=='': sourceFile=self.filename[0] else: sourceFile=override outRoot,outExt=os.path.splitext(sourceFile) outFile=outRoot+'.dqList' dqListOrig=[] propertyList=["t","d"] for lineSummary in self.traitSummary: dqListOrig.append(self.__getKurveProperty__(lineSummary,propertyList)) oldList=[[x[0],x[0]+x[1]] for x in dqListOrig] oldList.sort() if self.verboseMode: sys.stdout.write("Creating DQ list from %i triggers.\n"%(oldList.__len__()))
5a37cbd4e04daeffaaf5eed0d7d06e8bb42089a7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/5a37cbd4e04daeffaaf5eed0d7d06e8bb42089a7/tracksearchutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 40, 53, 2121, 12, 2890, 16, 9598, 33, 20, 16, 3459, 2218, 11, 4672, 3536, 17602, 310, 333, 707, 3414, 279, 585, 7527, 1985, 578, 805, 1110, 598, 508, 316, 3695, 434, 5500, 682, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 40, 53, 2121, 12, 2890, 16, 9598, 33, 20, 16, 3459, 2218, 11, 4672, 3536, 17602, 310, 333, 707, 3414, 279, 585, 7527, 1985, 578, 805, 1110, 598, 508, 316, 3695, 434, 5500, 682, ...
nextKey = self.nextKey(key)
def clear(self): """ Remove all references from this ref collection. """
bfe6edd8ff6988c54fe174639ee1bd3b10c40de7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/bfe6edd8ff6988c54fe174639ee1bd3b10c40de7/ItemRef.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2424, 12, 2890, 4672, 3536, 3581, 777, 5351, 628, 333, 1278, 1849, 18, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 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, 2424, 12, 2890, 4672, 3536, 3581, 777, 5351, 628, 333, 1278, 1849, 18, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
warnings.showwarning = self._showwarning
warnings.showwarning = _showwarning
def capture_warnings(self, enable=True): # FIXME warning capture on multiple processors
bbe78d78149a72a617e206aa2e0750a78ffa74e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12871/bbe78d78149a72a617e206aa2e0750a78ffa74e3/log.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7477, 67, 12103, 12, 2890, 16, 4237, 33, 5510, 4672, 468, 9852, 3436, 7477, 603, 3229, 13399, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7477, 67, 12103, 12, 2890, 16, 4237, 33, 5510, 4672, 468, 9852, 3436, 7477, 603, 3229, 13399, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
result['group_%i'%group.id] = {'string': 'Group %s'%group.name,'type': 'char','size': 7}
result['group_%i'%group.id] = {'string': '%s'%group.name,'type': 'char','size': 7}
def fields_get(self, cr, user, fields=None, context=None, read_access=True): result = super(osv.osv, self).fields_get(cr, user, fields, context) if 'advanced' in context: groups = self.pool.get('res.groups').search(cr, user, []) groups_br = self.pool.get('res.groups').browse(cr, user, groups) for group in groups_br: result['group_%i'%group.id] = {'string': 'Group %s'%group.name,'type': 'char','size': 7} return result
41b1850f46a6beaf2bf84207f36116461124c3f2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/41b1850f46a6beaf2bf84207f36116461124c3f2/ir_model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1466, 67, 588, 12, 2890, 16, 4422, 16, 729, 16, 1466, 33, 7036, 16, 819, 33, 7036, 16, 855, 67, 3860, 33, 5510, 4672, 563, 273, 2240, 12, 538, 90, 18, 538, 90, 16, 365, 2934, 2821,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1466, 67, 588, 12, 2890, 16, 4422, 16, 729, 16, 1466, 33, 7036, 16, 819, 33, 7036, 16, 855, 67, 3860, 33, 5510, 4672, 563, 273, 2240, 12, 538, 90, 18, 538, 90, 16, 365, 2934, 2821,...
info.update(utilities.getPermissionIds( 'PUT', checker=reg.value.checker))
checker = getattr(reg.value, 'checker', None) if checker: info.update(utilities.getPermissionIds('PUT', checker=checker))
def getPUTInfo(self): """Get the info dictionary of the PUT RESTive view.
ba2bad1f0132b51748576e98556f43a2a7d725a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/ba2bad1f0132b51748576e98556f43a2a7d725a6/restdoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1689, 1693, 966, 12, 2890, 4672, 3536, 967, 326, 1123, 3880, 434, 326, 11443, 8392, 688, 1476, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1689, 1693, 966, 12, 2890, 4672, 3536, 967, 326, 1123, 3880, 434, 326, 11443, 8392, 688, 1476, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if len(root.handlers) == 0: filename = kwargs.get("filename") if filename: mode = kwargs.get("filemode", 'a') hdlr = FileHandler(filename, mode) else: stream = kwargs.get("stream") hdlr = StreamHandler(stream) fs = kwargs.get("format", BASIC_FORMAT) dfs = kwargs.get("datefmt", None) fmt = Formatter(fs, dfs) hdlr.setFormatter(fmt) root.addHandler(hdlr) level = kwargs.get("level") if level is not None: if str(level) == level: if level not in _levelNames: raise ValueError("Unknown level: %r" % level) level = _levelNames[level] root.setLevel(level)
_acquireLock() try: if len(root.handlers) == 0: filename = kwargs.get("filename") if filename: mode = kwargs.get("filemode", 'a') hdlr = FileHandler(filename, mode) else: stream = kwargs.get("stream") hdlr = StreamHandler(stream) fs = kwargs.get("format", BASIC_FORMAT) dfs = kwargs.get("datefmt", None) fmt = Formatter(fs, dfs) hdlr.setFormatter(fmt) root.addHandler(hdlr) level = kwargs.get("level") if level is not None: root.setLevel(level) finally: _releaseLock()
def basicConfig(**kwargs): """ Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT format string, and add the handler to the root logger. A number of optional keyword arguments may be specified, which can alter the default behaviour. filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler. filemode Specifies the mode to open the file, if filename is specified (if filemode is unspecified, it defaults to 'a'). format Use the specified format string for the handler. datefmt Use the specified date/time format. level Set the root logger level to the specified level. stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with 'filename' - if both are present, 'stream' is ignored. Note that you could specify a stream created using open(filename, mode) rather than passing the filename and mode in. However, it should be remembered that StreamHandler does not close its stream (since it may be using sys.stdout or sys.stderr), whereas FileHandler closes its stream when the handler is closed. """ if len(root.handlers) == 0: filename = kwargs.get("filename") if filename: mode = kwargs.get("filemode", 'a') hdlr = FileHandler(filename, mode) else: stream = kwargs.get("stream") hdlr = StreamHandler(stream) fs = kwargs.get("format", BASIC_FORMAT) dfs = kwargs.get("datefmt", None) fmt = Formatter(fs, dfs) hdlr.setFormatter(fmt) root.addHandler(hdlr) level = kwargs.get("level") if level is not None: if str(level) == level: # If a string was passed, do more checks if level not in _levelNames: raise ValueError("Unknown level: %r" % level) level = _levelNames[level] root.setLevel(level)
8b5468867b7a5198ce87918cf384848a3d101c70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/8b5468867b7a5198ce87918cf384848a3d101c70/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30736, 12, 636, 4333, 4672, 3536, 2256, 5337, 1664, 364, 326, 2907, 2619, 18, 225, 1220, 445, 1552, 5083, 309, 326, 1365, 1194, 1818, 711, 4919, 4351, 18, 2597, 353, 279, 13553, 707, 126...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30736, 12, 636, 4333, 4672, 3536, 2256, 5337, 1664, 364, 326, 2907, 2619, 18, 225, 1220, 445, 1552, 5083, 309, 326, 1365, 1194, 1818, 711, 4919, 4351, 18, 2597, 353, 279, 13553, 707, 126...
def reset_adps(fmodels, b_min, b_max, set_min, set_max):
def reset_adps(fmodels, selection, b_min, b_max, set_min, set_max):
def reset_adps(fmodels, b_min, b_max, set_min, set_max): xrs = fmodels.fmodel_xray().xray_structure b = xrs.extract_u_iso_or_u_equiv()*adptbx.u_as_b(1.) sel = b > b_max b = b.set_selected(sel, set_max) sel = b < b_min b = b.set_selected(sel, set_min) xrs = xrs.set_b_iso(values=b) fmodels.update_xray_structure(xray_structure = xrs, update_f_calc=True, update_f_mask=False)
92e312eb37350a68e2c73fd77a47e63caf098692 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/92e312eb37350a68e2c73fd77a47e63caf098692/grow_density.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 67, 361, 1121, 12, 74, 7665, 16, 4421, 16, 324, 67, 1154, 16, 324, 67, 1896, 16, 444, 67, 1154, 16, 444, 67, 1896, 4672, 619, 5453, 273, 284, 7665, 18, 74, 2284, 67, 92, 435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 67, 361, 1121, 12, 74, 7665, 16, 4421, 16, 324, 67, 1154, 16, 324, 67, 1896, 16, 444, 67, 1154, 16, 444, 67, 1896, 4672, 619, 5453, 273, 284, 7665, 18, 74, 2284, 67, 92, 435,...
self.server, self.port, self.factory, contextFactory)
self.server, self.port, self.factory, contextFactory)
def connect(self): """ This methods establishes the conection to the remote server.
57b5287fb19d6adb9c34bf4c582c55ec9e5260e1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/57b5287fb19d6adb9c34bf4c582c55ec9e5260e1/dsage_interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 4672, 3536, 1220, 2590, 18312, 281, 326, 356, 794, 358, 326, 2632, 1438, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 4672, 3536, 1220, 2590, 18312, 281, 326, 356, 794, 358, 326, 2632, 1438, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return stack[0]
if(isinstance(stack = stack[0],PropertyValue )): stack = stack.base[stack.name]; return stack
def evaluate(tokens, context): stack=[] _evaluate(stack, tokens, context) return stack[0]
1d85396df67d442e980329eb1c59526c71bf537c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1592/1d85396df67d442e980329eb1c59526c71bf537c/Expression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 12, 7860, 16, 819, 4672, 2110, 33, 8526, 389, 21024, 12, 3772, 16, 2430, 16, 819, 13, 327, 2110, 63, 20, 65, 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, 5956, 12, 7860, 16, 819, 4672, 2110, 33, 8526, 389, 21024, 12, 3772, 16, 2430, 16, 819, 13, 327, 2110, 63, 20, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
while bracketCounter > 0 and end < len(expr)-1: end += 1
while bracketCounter > 0 and end < len(expr):
def buildCleanExpr(self, expr): self.recursionLevel += 1 expr = expr.replace(" ", "") print(self.getDebugPrefix() + " * buildCleanExpr: " + expr) # For every operator level for opLevel in self.operatorLevels: # For every operator in the current level for op in opLevel.operators: lastOccurence = expr.find(op.text) while lastOccurence is not -1: if lastOccurence == len(expr) - 1: raise CompilerException("Missing operand") if isVarChar(expr[lastOccurence + len(op.text)]) or expr[lastOccurence + len(op.text)] == '(' or op.text == '(': if op.type == Operator.BINARY: # Left operand start = lastOccurence - 1 while start >= 0 and (isVarChar(expr[start]) or (expr[start] == ')' and start == lastOccurence - 1)): if expr[start] == ')': bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and start > 0: start -= 1 if expr[start] == ')': bracketCounter += 1 elif expr[start] == '(': bracketCounter -= 1 start -= 1 operandLeft = expr[start+1:lastOccurence]; # Right operand end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or (expr[end] == '(' and end == lastOccurence + 1)): if op.text == '[' or op.text == '(' or (expr[end] == '(' and end == lastOccurence + 1): bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and end < len(expr)-1: end += 1 if expr[end] == '(' or expr[end] == '[': bracketCounter += 1 elif expr[end] == ')' or expr[end] == ']': bracketCounter -= 1 if bracketCounter == 0: end -= 1 end += 1 operandRight = expr[lastOccurence + op.textLen:end]; print(self.getDebugPrefix() + " * buildCleanExpr.operators: " + operandLeft + " [" + op.text + "] " + operandRight) # Bind #=================================================== # #======================================================= # print(expr) # if start >= 0: # print("START[" + str(start) + "]: " + expr[start]) # else: # print("START: " + "OUT OF STRING") # # if end < len(expr): # print("END[" + str(end) + "]: " + expr[end]) # else: # print("END: " + "OUT OF STRING") # #======================================================= #=================================================== if operandLeft and (operandRight and ((start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')')) or op.text == "("): if op.text == "(": newOpText = "#" expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + ")" + newOpText + "(" + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight) + 1:] elif op.text == "[": newOpText = "@" expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + ")" + newOpText + "(" + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight) + 1:] else: expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] print(self.getDebugPrefix() + " * Expression changed: " + expr) else: pass print(self.getDebugPrefix() + " * Expression change denied for operator: [" + op.text + "]") elif op.type == Operator.UNARY and (lastOccurence <= 0 or (isVarChar(expr[lastOccurence - 1]) == False and expr[lastOccurence - 1] != ')')): #print("Unary check for operator [" + op.text + "]") #print(" Unary.lastOccurence: " + str(lastOccurence)) #print(" Unary.expr[lastOccurence - 1]: " + expr[lastOccurence - 1]) #print(" Unary.isVarChar(expr[lastOccurence - 1]): " + str(isVarChar(expr[lastOccurence - 1]))) # Right operand end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or (expr[end] == '(' and end == lastOccurence + 1)): if expr[end] == '(' and end == lastOccurence + 1: bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and end < len(expr)-1: end += 1 if expr[end] == '(': bracketCounter += 1 elif expr[end] == ')': bracketCounter -= 1 end += 1 operandRight = expr[lastOccurence+op.textLen:end]; #print("[" + op.text + "] " + operandRight) start = lastOccurence - 1 if (start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')'): expr = expr[:lastOccurence] + "(" + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] lastOccurence += 1 #print("EX.UNARY: " + expr) else: pass #print("EX.UNARY expression change denied: [" + op.text + "]") else: # If a binary version does not exist it means the operator has been used incorrectly if not self.similarOperatorExists(op): raise CompilerException("Syntax error concerning the unary operator [" + op.text + "]") elif expr[lastOccurence + len(op.text)] != '(': if self.similarOperatorExists(op): pass else: raise CompilerException("Operator [" + op.text + "] expects a valid expression (encountered '" + expr[lastOccurence + len(op.text)] + "')") lastOccurence = expr.find(op.text, lastOccurence + len(op.text)) self.recursionLevel -= 1 return expr
4c217d7807466cdefe0b561d5d9163c266360b72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14498/4c217d7807466cdefe0b561d5d9163c266360b72/ExpressionParser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 7605, 4742, 12, 2890, 16, 3065, 4672, 365, 18, 31347, 2355, 1011, 404, 225, 3065, 273, 3065, 18, 2079, 2932, 3104, 1408, 13, 225, 1172, 12, 2890, 18, 588, 2829, 2244, 1435, 397, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7605, 4742, 12, 2890, 16, 3065, 4672, 365, 18, 31347, 2355, 1011, 404, 225, 3065, 273, 3065, 18, 2079, 2932, 3104, 1408, 13, 225, 1172, 12, 2890, 18, 588, 2829, 2244, 1435, 397, ...
except:
except KeyError:
def setVar(self, var, value): self.expand_cache = {} match = __setvar_regexp__.match(var) if match and match.group("keyword") in __setvar_keyword__: base = match.group('base') keyword = match.group("keyword") override = match.group('add') l = self.getVarFlag(base, keyword) or [] l.append([value, override]) self.setVarFlag(base, keyword, l)
cbc8140c77d927f0b15234e46f4c61d1bb5376ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/cbc8140c77d927f0b15234e46f4c61d1bb5376ef/data_smart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 1537, 12, 2890, 16, 569, 16, 460, 4672, 365, 18, 12320, 67, 2493, 273, 2618, 845, 225, 273, 1001, 542, 1401, 67, 17745, 25648, 1916, 12, 1401, 13, 309, 845, 471, 845, 18, 1655, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1537, 12, 2890, 16, 569, 16, 460, 4672, 365, 18, 12320, 67, 2493, 273, 2618, 845, 225, 273, 1001, 542, 1401, 67, 17745, 25648, 1916, 12, 1401, 13, 309, 845, 471, 845, 18, 1655, ...
sys.exit(-1)
return False
def cli_startup(self): """Checks whether the repository is dirty and reports options.""" import cli import sys
75dd02deff169211a987397f0d479d7f99ad426c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/966/75dd02deff169211a987397f0d479d7f99ad426c/standardpso.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 67, 23939, 12, 2890, 4672, 3536, 4081, 2856, 326, 3352, 353, 9603, 471, 10557, 702, 12123, 1930, 4942, 1930, 2589, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 4942, 67, 23939, 12, 2890, 4672, 3536, 4081, 2856, 326, 3352, 353, 9603, 471, 10557, 702, 12123, 1930, 4942, 1930, 2589, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sel = string.strip(str(activeChild.GetSelectedText()))
if not activeChild == self.logWin: sel = string.strip(str(activeChild.GetSelectedText())) else : sel = ""
def GoToHelpFile(self): # TODO : test this : most help files don't open. remove trailing and leading spaces from sel, too, since wxTextCtrl is behaving strangely activeChild = self.GetActiveChild() sel = string.strip(str(activeChild.GetSelectedText())) foundFilePath = "" filePath = "" if sel != "": for helpFolder in [gAppHelpFolder,gHelpFolder]: for folderPath, foldersInPath, fileNamesInFolder in os.walk(helpFolder): # don't visit CVS directories if 'CVS' in foldersInPath: foldersInPath.remove('CVS') for fileName in fileNamesInFolder: filePath = os.path.join(folderPath, fileName) if fileName == sel + ".help.rtf": foundFilePath = filePath break if fileName == sel + ".rtf": foundFilePath = filePath break # for fileName # if file is found, let's break if foundFilePath != "": break # for folderPath, .... # if file is found, let's break if foundFilePath != "": break if foundFilePath == "": foundFilePath = os.path.join(gAppHelpFolder,"Help.help.rtf") self.OpenFile(foundFilePath)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4220, 774, 6696, 812, 12, 2890, 4672, 468, 2660, 294, 1842, 333, 294, 4486, 2809, 1390, 2727, 1404, 1696, 18, 1206, 7341, 471, 7676, 7292, 628, 357, 16, 4885, 16, 3241, 7075, 1528, 12418...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4220, 774, 6696, 812, 12, 2890, 4672, 468, 2660, 294, 1842, 333, 294, 4486, 2809, 1390, 2727, 1404, 1696, 18, 1206, 7341, 471, 7676, 7292, 628, 357, 16, 4885, 16, 3241, 7075, 1528, 12418...
def get_fs_layout_content(self, metatype, skin_id, scheme_id, file_id, rtype='r'):
def get_fs_layout_content(self, portal, skin_id, scheme_id, file_id, rtype='r'):
def get_fs_layout_content(self, metatype, skin_id, scheme_id, file_id, rtype='r'): """ return the content of the filesystem layout file """ portal_path = self.get_portal_path(metatype) skel_handler, error = skel_parser().parse(readFile(join(portal_path, 'skel', 'skel.xml'), 'r')) if skel_handler.root.layout is not None: if scheme_id: file_ext = '' if rtype == 'r': file_ext = '.css' return readFile(join(portal_path, 'skel', 'layout', skin_id, scheme_id, '%s%s' % (file_id, file_ext)), rtype) else: return readFile(join(portal_path, 'skel', 'layout', skin_id, '%s.zpt' % file_id), 'r')
0116da894b0fd06e2befe1c4b6331ce460957cbc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/0116da894b0fd06e2befe1c4b6331ce460957cbc/NaayaUpdater.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2556, 67, 6741, 67, 1745, 12, 2890, 16, 11899, 16, 18705, 67, 350, 16, 4355, 67, 350, 16, 585, 67, 350, 16, 9328, 2218, 86, 11, 4672, 3536, 327, 326, 913, 434, 326, 6496, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2556, 67, 6741, 67, 1745, 12, 2890, 16, 11899, 16, 18705, 67, 350, 16, 4355, 67, 350, 16, 585, 67, 350, 16, 9328, 2218, 86, 11, 4672, 3536, 327, 326, 913, 434, 326, 6496, ...
avg_max_query = avg_max_query + " GROUP BY name ORDER BY foo DESC"
avg_max_query = avg_max_query + "ORDER BY virus_"+self.__vendor_name+"_detected DESC"
def get_key_statistics(self, end_date, report_days, host=None, user=None, email=None): if host or user: return None
105b5e27bf63d007da247194879b178db12c5076 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/87/105b5e27bf63d007da247194879b178db12c5076/untangle_base_virus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 856, 67, 14438, 12, 2890, 16, 679, 67, 712, 16, 2605, 67, 9810, 16, 1479, 33, 7036, 16, 729, 33, 7036, 16, 2699, 33, 7036, 4672, 309, 1479, 578, 729, 30, 327, 599, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 856, 67, 14438, 12, 2890, 16, 679, 67, 712, 16, 2605, 67, 9810, 16, 1479, 33, 7036, 16, 729, 33, 7036, 16, 2699, 33, 7036, 4672, 309, 1479, 578, 729, 30, 327, 599, 2, -100...
print "nextPktNum: New Time"
LOG.debug( "nextPktNum: New Time" )
def nextPktNum(self):
f899ea488d0fb3cf67e370d92f3f2890bfe0d05e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12372/f899ea488d0fb3cf67e370d92f3f2890bfe0d05e/dtella_bridgeserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 7789, 88, 2578, 12, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 7789, 88, 2578, 12, 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, -10...
s = [(depth[n], self.commitcache[n].date, n) for n in s]
s = [(depth[n], util.parsedate(self.commitcache[n].date), n) for n in s]
def toposort(self, parents): '''Return an ordering such that every uncommitted changeset is preceeded by all its uncommitted ancestors.''' visit = parents.keys() seen = {} children = {}
54099c4cce65db04b560adb4438eee0029fc8f8c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/54099c4cce65db04b560adb4438eee0029fc8f8c/convcmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 917, 499, 12, 2890, 16, 6298, 4672, 9163, 990, 392, 9543, 4123, 716, 3614, 12704, 7948, 22463, 353, 675, 5816, 635, 777, 2097, 12704, 7948, 14322, 1093, 6309, 3757, 273, 6298, 18, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 917, 499, 12, 2890, 16, 6298, 4672, 9163, 990, 392, 9543, 4123, 716, 3614, 12704, 7948, 22463, 353, 675, 5816, 635, 777, 2097, 12704, 7948, 14322, 1093, 6309, 3757, 273, 6298, 18, 2...
if not depassembly: continue
if depassembly: ident = assembly.FirstChildElement("assemblyIdentity") if ident: name = ident.Attribute("name") if name: filenames.append(name + ".manifest")
def __parseManifest(self, tempFile): """ Reads the indicated application manifest file, to determine the list of dependent assemblies this executable file depends on. """
ac9412d8f610150a5694e6aa07c2411dbcdc503d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7242/ac9412d8f610150a5694e6aa07c2411dbcdc503d/Packager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2670, 9121, 12, 2890, 16, 18286, 4672, 3536, 29185, 326, 17710, 2521, 5643, 585, 16, 358, 4199, 326, 666, 434, 10460, 20489, 549, 281, 333, 9070, 585, 10935, 603, 18, 3536, 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, 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, 2670, 9121, 12, 2890, 16, 18286, 4672, 3536, 29185, 326, 17710, 2521, 5643, 585, 16, 358, 4199, 326, 666, 434, 10460, 20489, 549, 281, 333, 9070, 585, 10935, 603, 18, 3536, 2, -100...
print "system.hash:",self.hash
def _getSystemstate(self):
20134c300eec98412932f4c1217a532195a26851 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/20134c300eec98412932f4c1217a532195a26851/system.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 3163, 2019, 12, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 3163, 2019, 12, 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, -10...
st = colData.find('(') en = colData.find(')') colData = colData[:st] + colData[en+1:]
start = colData.find('(') end = colData.find(')', start) colData = colData[:start] + colData[end+1:]
def _columnsFromSchemaParse(self, tableName, soClass): colData = self.queryOne("SELECT sql FROM sqlite_master WHERE type='table' AND name='%s'" % tableName) if not colData: raise ValueError('The table %s ws not found in the database. Load failed.' % tableName) colData = colData[0].split('(', 1)[1].strip()[:-2] while colData.find('(') > -1: st = colData.find('(') en = colData.find(')') colData = colData[:st] + colData[en+1:] results = [] for colDesc in colData.split(','): parts = colDesc.strip().split(' ', 2) field = parts[0].strip() # skip comments if field.startswith('--'): continue # get rid of enclosing quotes if field[0] == field[-1] == '"': field = field[1:-1] if field == getattr(soClass.sqlmeta, 'idName', 'id'): continue colClass, kw = self.guessClass(parts[1].strip()) if len(parts) == 2: index_info = '' else: index_info = parts[2].strip().upper() kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field) kw['dbName'] = field import re nullble = re.search(r'(\b\S*)\sNULL', index_info) default = re.search(r"DEFAULT\s((?:\d[\dA-FX.]*)|(?:'[^']*')|(?:#[^#]*#))", index_info) kw['notNone'] = nullble and nullble.group(1) == 'NOT' kw['default'] = default and default.group(1) # @@ skip key... # @@ skip extra... results.append(colClass(**kw)) return results
f0c24e487931cbd2f37066ba3d67ce1cf0021404 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8798/f0c24e487931cbd2f37066ba3d67ce1cf0021404/sqliteconnection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5112, 1265, 3078, 3201, 12, 2890, 16, 4775, 16, 1427, 797, 4672, 645, 751, 273, 365, 18, 2271, 3335, 2932, 4803, 1847, 4571, 16184, 67, 7525, 4852, 618, 2218, 2121, 11, 4116, 508, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5112, 1265, 3078, 3201, 12, 2890, 16, 4775, 16, 1427, 797, 4672, 645, 751, 273, 365, 18, 2271, 3335, 2932, 4803, 1847, 4571, 16184, 67, 7525, 4852, 618, 2218, 2121, 11, 4116, 508, ...
if verbosity >= 1:
if verbosity >= 2:
def scrapeCourt(courtID, result, verbosity, daemonmode): if verbosity >= 1: result += "NOW SCRAPING COURT: " + str(courtID) + "\n" if verbosity >= 2: print "NOW SCRAPING COURT: " + str(courtID) if (courtID == 1): """ PDFs are available from the first circuit if you go to their RSS feed. So go to their RSS feed we shall. """ urls = ("http://www.ca1.uscourts.gov/opinions/opinionrss.php",) ct = Court.objects.get(courtUUID='ca1') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " &amp; ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNamesAndNumbers = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-.*?\W)(.*)$") # incredibly, this RSS feed is in cron order, so new stuff is at the # end. Mind blowing. i = len(caseLinks)-1 if verbosity >= 2: print str(i) dupCount = 0 while i > 0: # First: docType, since we don't support them all... docType = docTypes[i].text.strip() if verbosity >= 2: print docType if "unpublished" in docType.lower(): documentType = "Unpublished" elif "published" in docType.lower(): documentType = "Published" elif "errata" in docType.lower(): documentType = "Errata" else: # something weird we don't know about, punt i -= 1 continue # next, we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) # then we download the PDF, make the hash and document myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i -= 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 8: # eighth dup in a a row. BREAK! # this is 8 here b/c this court has tech problems. break i -= 1 continue else: dupCount = 0 # otherwise, we continue doc.documentType = documentType # next: caseDate caseDate = caseDateRegex.search(descriptions[i].text).group(1) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next: caseNumber caseNumber = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(1) # next: caseNameShort caseNameShort = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(2) # check for dups, make the object if necessary, otherwise, get it cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i -= 1 return result elif (courtID == 2): """ URL hacking FTW. """ urls = ( "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=OPN&IW_FIELD_TEXT=OPN&IW_SORT=-Date&IW_BATCHSIZE=100", "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=SUM&IW_FIELD_TEXT=SUM&IW_SORT=-Date&IW_BATCHSIZE=100", ) ct = Court.objects.get(courtUUID='ca2') for url in urls: html = urllib2.urlopen(url).read() soup = BeautifulSoup(html) aTagsRegex = re.compile('(.*?.pdf).*?', re.IGNORECASE) caseNumRegex = re.compile('.*/(\d{1,2}-\d{3,4})(.*).pdf') aTags = soup.findAll(attrs={'href' : aTagsRegex}) if daemonmode: # this mess is necessary because the court puts random # (literally) numbers throughout their links. No idea why, # but the solution is to figure out the caselinks here, and to hand # those to the sha1 generator. aTagsEncoded = [] for i in aTags: caseLink = i.get('href') caseLink = aTagsRegex.search(caseLink).group(1) try: caseNumbers = caseNumRegex.search(caseLink).group(1) except: caseNumbers = "" aTagsEncoded.append(caseNumbers) # if it's daemonmode, see if the court has changed changed = courtChanged(url, str(aTagsEncoded)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = aTagsRegex.search(caseLink).group(1) caseLink = urljoin(url, caseLink) if verbosity >= 2: print str(i) + ": " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNum = caseNumRegex.search(caseLink).group(1) if verbosity >= 2: print "caseNum: " + str(caseNum) # and the docType documentType = caseNumRegex.search(caseLink).group(2) if 'opn' in documentType: # it's unpublished doc.documentType = "Published" elif 'so' in documentType: doc.documentType = "Unpublished" # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.contents[0] # next, we can do the caseDate caseDate = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.nextSibling.contents[0]\ .replace('&nbsp;', ' ').strip() # some caseDate cleanup splitDate = caseDate.split('-') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # check for duplicates, make the object in their absence cite, created = hasDuplicate(caseNum, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 3): """ This URL provides the latest 25 cases, so I need to pick out the new ones and only get those. I can do this efficiently by trying to do each, and then giving up once I hit one that I've done before. This will work because they are in reverse chronological order. """ # if these URLs change, the docType identification (below) will need # to be updated. It's lazy, but effective. urls = ("http://www.ca3.uscourts.gov/recentop/week/recprec.htm", "http://www.ca3.uscourts.gov/recentop/week/recnon2day.htm",) ct = Court.objects.get(courtUUID='ca3') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) # we will use these vars in our while loop, better not to compile them # each time regexII = re.compile('\d{2}/\d{2}/\d{2}') regexIII = re.compile('\d{2}-\d{4}') i = 0 dupCount = 0 while i < len(aTags): # caseLink and caseNameShort caseLink = aTags[i].get('href') myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 caseNameShort = aTags[i].contents[0] # caseDate and caseNumber junk = aTags[i].previous.previous.previous try: # this error seems to happen upon dups...not sure why yet caseDate = regexII.search(junk).group(0) caseNumber = regexIII.search(junk).group(0) except: i = i+1 continue # next up is the caseDate splitDate = caseDate.split('/') caseDate = datetime.date(int("20" + splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # Make a decision about the docType. if "recprec.htm" in str(url): doc.documentType = "Published" elif "recnon2day.htm" in str(url): doc.documentType = "Unpublished" cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 4): """The fourth circuit is THE worst form of HTML I've ever seen. It's going to break a lot, but I've done my best to clean it up, and make it reliable.""" urls = ("http://pacer.ca4.uscourts.gov/opinions_today.htm",) ct = Court.objects.get(courtUUID='ca4') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # sadly, beautifulsoup chokes on the lines lines of this file because # the HTML is so bad. Stop laughing - the HTML IS awful, but it's not # funny. Anyway, to make this thing work, we must pull out the target # attributes. And so we do. regex = re.compile("target.*>", re.IGNORECASE) html = re.sub(regex, ">", html) soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) i = 0 dupCount = 0 regexII = re.compile('\d{2}/\d{2}/\d{4}') regexIII = re.compile('\d{4}(.*)') while i < len(aTags): # caseLink field, and save it caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caselink, we can get the caseNumber and documentType fileName = caseLink.split('/')[-1] caseNumber, documentType = fileName.split('.')[0:2] # the caseNumber needs a hyphen inserted after the second digit caseNumber = caseNumber[0:2] + "-" + caseNumber[2:] if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' else: doc.documentType = "" # next, we do the caseDate and caseNameShort, so we can quit before # we get too far along. junk = aTags[i].contents[0].replace('&nbsp;', ' ').strip() try: # this error seems to happen upon dups...not sure why yet caseDate = cleanString(regexII.search(junk).group(0)) caseNameShort = regexIII.search(junk).group(1) except: i += 1 continue # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # let's check for duplicates before we proceed cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 5): """New fifth circuit scraper, which can get back versions all the way to 1992! This is exciting, but be warned, the search is not reliable on recent dates. It has been known not to bring back results that are definitely within the set. Watch closely. """ urls = ("http://www.ca5.uscourts.gov/Opinions.aspx",) ct = Court.objects.get(courtUUID='ca5') for url in urls: # Use just one date, it seems to work better this way. todayObject = datetime.date.today() if verbosity >= 2: print "start date: " + str(todayObject) startDate = time.strftime('%m/%d/%Y', todayObject.timetuple()) if verbosity >= 2: print "Start date is: " + startDate # these are a mess because the court has a security check. postValues = { '__EVENTTARGET' : '', '__EVENTARGUMENT' : '', '__VIEWSTATE' : '/wEPDwULLTEwOTU2NTA2NDMPZBYCAgEPZBYKAgEPDxYIHgtDZWxsUGFkZGluZ2YeC0NlbGxTcGFjaW5nZh4JQmFja0NvbG9yCRcQJ/8eBF8hU0ICiIAYZGQCAw8PFggfAGYfAWYfAgmZzP//HwMCiIAYZGQCGQ9kFgYCAg8PFgQfAgqHAR8DAghkZAIEDw8WBB8CCocBHwMCCGRkAgYPDxYEHwIKhwEfAwIIZGQCGw9kFooBAgIPDxYEHwIKhwEfAwIIZGQCBA8PFgQfAgqHAR8DAghkZAIGDw8WBB8CCocBHwMCCGRkAggPDxYEHwIKhwEfAwIIZGQCCg8PFgQfAgqHAR8DAghkZAIMDw8WBB8CCocBHwMCCGRkAg4PDxYEHwIKhwEfAwIIZGQCEA8PFgQfAgqHAR8DAghkZAISDw8WBB8CCocBHwMCCGRkAhQPDxYEHwIKhwEfAwIIZGQCFg8PFgQfAgqHAR8DAghkZAIYDw8WBB8CCocBHwMCCGRkAhoPDxYEHwIKhwEfAwIIZGQCHA8PFgQfAgqHAR8DAghkZAIeDw8WBB8CCocBHwMCCGRkAiAPDxYEHwIKhwEfAwIIZGQCIg8PFgQfAgqHAR8DAghkZAIkDw8WBB8CCocBHwMCCGRkAiYPDxYEHwIKhwEfAwIIZGQCKA8PFgQfAgqHAR8DAghkZAIqDw8WBB8CCocBHwMCCGRkAiwPDxYEHwIKhwEfAwIIZGQCLg8PFgQfAgqHAR8DAghkZAIwDw8WBB8CCocBHwMCCGRkAjIPDxYEHwIKhwEfAwIIZGQCNA8PFgQfAgqHAR8DAghkZAI2Dw8WBB8CCocBHwMCCGRkAjgPDxYEHwIKhwEfAwIIZGQCOg8PFgQfAgqHAR8DAghkZAI8Dw8WBB8CCocBHwMCCGRkAj4PDxYEHwIKhwEfAwIIZGQCQA8PFgQfAgqHAR8DAghkZAJCDw8WBB8CCocBHwMCCGRkAkQPDxYEHwIKhwEfAwIIZGQCRg8PFgQfAgqHAR8DAghkZAJIDw8WBB8CCocBHwMCCGRkAkoPDxYEHwIKhwEfAwIIZGQCTA8PFgQfAgqHAR8DAghkZAJODw8WBB8CCocBHwMCCGRkAlAPDxYEHwIKhwEfAwIIZGQCUg8PFgQfAgqHAR8DAghkZAJUDw8WBB8CCocBHwMCCGRkAlYPDxYEHwIKhwEfAwIIZGQCWA8PFgQfAgqHAR8DAghkZAJaDw8WBB8CCocBHwMCCGRkAlwPDxYEHwIKhwEfAwIIZGQCXg8PFgQfAgqHAR8DAghkZAJgDw8WBB8CCocBHwMCCGRkAmIPDxYEHwIKhwEfAwIIZGQCZA8PFgQfAgqHAR8DAghkZAJmDw8WBB8CCocBHwMCCGRkAmgPDxYEHwIKhwEfAwIIZGQCag8PFgQfAgqHAR8DAghkZAJsDw8WBB8CCocBHwMCCGRkAm4PDxYEHwIKhwEfAwIIZGQCcA8PFgQfAgqHAR8DAghkZAJyDw8WBB8CCocBHwMCCGRkAnQPDxYEHwIKhwEfAwIIZGQCdg8PFgQfAgqHAR8DAghkZAJ4Dw8WBB8CCocBHwMCCGRkAnoPDxYEHwIKhwEfAwIIZGQCfA8PFgQfAgqHAR8DAghkZAJ+Dw8WBB8CCocBHwMCCGRkAoABDw8WBB8CCocBHwMCCGRkAoIBDw8WBB8CCocBHwMCCGRkAoQBDw8WBB8CCocBHwMCCGRkAoYBDw8WBB8CCocBHwMCCGRkAogBDw8WBB8CCocBHwMCCGRkAooBDw8WBB8CCocBHwMCCGRkAh0PEGRkFgECAmRkcx2JRvTiy039dck7+vdOCUS6J5s=', 'txtBeginDate' : startDate, 'txtEndDate' : '', 'txtDocketNumber' : '', 'txtTitle=' : '', 'btnSearch' : 'Search', '__EVENTVALIDATION' : '/wEWCALd2o3pAgLH8d2nDwKAzfnNDgLChrRGAr2b+P4BAvnknLMEAqWf8+4KAqC3sP0KVcw25xdB1YPfbcUwUCqEYjQqaqM=', } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) #if verbosity >= 2: print soup #all links ending in pdf, case insensitive aTagRegex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": aTagRegex}) unpubRegex = re.compile(r"pinions.*unpub") i = 0 dupCount = 0 numP = 0 numQ = 0 while i < len(aTags): # this page has PDFs that aren't cases, we must filter them out if 'pinion' not in str(aTags[i]): # it's not an opinion, increment and punt if verbosity >= 2: print "Punting non-opinion URL: " + str(aTags[i]) i += 1 continue # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue # next, we do the docStatus field, b/c we need to include it in # the dup check. This is because we need to abort after we have # three non-precedential and three precedential from this court. if unpubRegex.search(str(aTags[i])) == None: # it's published, else it's unpublished documentType = "Published" numP += 1 else: documentType = "Unpublished" numQ += 1 if verbosity >= 2: print "documentType: " + documentType doc.documentType = documentType if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount >= 3 and numP >= 3 and numQ >= 3: # third dup in a a row for both U and P. break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].contents[0] # next, we do the caseDate caseDate = aTags[i].next.next.contents[0].contents[0] # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next, we do the caseNameShort caseNameShort = aTags[i].next.next.next.next.next.contents[0]\ .contents[0] # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 6): """Results are available without an HTML POST, but those results lack a date field. Hence, we must do an HTML POST. Missing a day == OK. Just need to monkey with the date POSTed. """ urls = ("http://www.ca6.uscourts.gov/cgi-bin/opinions.pl",) ct = Court.objects.get(courtUUID = 'ca6') for url in urls: today = datetime.date.today() formattedToday = str(today.month) + '/' + str(today.day) + '/' +\ str(today.year) postValues = { 'CASENUM' : '', 'TITLE' : '', 'FROMDATE' : formattedToday, 'TODATE' : formattedToday, 'OPINNUM' : '' } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].next.next.next.next.next.contents[0] # using the filename, we can determine the documentType... fileName = aTags[i].contents[0] if 'n' in fileName: # it's unpublished doc.documentType = "Unpublished" elif 'p' in fileName: doc.documentType = "Published" # next, we can do the caseDate caseDate = aTags[i].next.next.next.next.next.next.next.next\ .contents[0] caseDate = cleanString(caseDate) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[0]),int(splitDate[1]), int(splitDate[2])) doc.dateFiled = caseDate # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].next.next.next.next.next.next.next.next\ .next.next.next # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 7): """another court where we need to do a post. This will be a good starting place for getting the judge field, when we're ready for that. Missing a day == OK. Queries return cases for the past week. """ urls = ("http://www.ca7.uscourts.gov/fdocs/docs.fwx",) ct = Court.objects.get(courtUUID = 'ca7') for url in urls: # if these strings change, check that documentType still gets set correctly. dataStrings = ("yr=&num=&Submit=Past+Week&dtype=Opinion&scrid=Select+a+Case", "yr=&num=&Submit=Past+Week&dtype=Nonprecedential+Disposition&scrid=Select+a+Case",) for dataString in dataStrings: req = urllib2.Request(url, dataString) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url+dataString, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get("href") caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].previous.previous.previous.previous.previous\ .previous.previous.previous.previous.previous # next up: caseDate caseDate = aTags[i].previous.previous.previous.contents[0] caseDate = cleanString(caseDate) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next up: caseNameShort caseNameShort = aTags[i].previous.previous.previous.previous\ .previous.previous.previous # next up: docStatus if "type=Opinion" in dataString: doc.documentType = "Published" elif "type=Nonprecedential+Disposition" in dataString: doc.documentType = "Unpublished" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 8): urls = ("http://www.ca8.uscourts.gov/cgi-bin/new/today2.pl",) ct = Court.objects.get(courtUUID = 'ca8') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) caseNumRegex = re.compile('(\d{2})(\d{4})(u|p)', re.IGNORECASE) caseDateRegex = re.compile('(\d{2}/\d{2}/\d{4})(.*)(</b>)') i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType junk = aTags[i].contents[0] caseNumber = caseNumRegex.search(junk).group(1) + "-" +\ caseNumRegex.search(junk).group(2) documentType = caseNumRegex.search(junk).group(3).upper() if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' # caseDate is next on the block junk = str(aTags[i].next.next.next) caseDate = caseDateRegex.search(junk).group(1) caseDate = cleanString(caseDate) caseNameShort = caseDateRegex.search(junk).group(2) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 9): """This court, by virtue of having a javascript laden website, was very hard to parse properly. BeautifulSoup couldn't handle it at all, so lxml has to be used. lxml seems pretty useful, but it was a pain to learn.""" # these URLs redirect now. So much for hacking them. A new approach can probably be done using POST data. urls = ( "http://www.ca9.uscourts.gov/opinions/?o_mode=view&amp;o_sort_field=19&amp;o_sort_type=DESC&o_page_size=100", "http://www.ca9.uscourts.gov/memoranda/?o_mode=view&amp;o_sort_field=21&amp;o_sort_type=DESC&o_page_size=100",) ct = Court.objects.get(courtUUID = 'ca9') for url in urls: if verbosity >= 2: print "Link is now: " + url html = urllib2.urlopen(url).read() tree = fromstring(html) if url == urls[0]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[6]/label') elif url == urls[1]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[7]/label') if daemonmode: # if it's daemonmode, see if the court has changed # this is necessary because the 9th circuit puts random numbers # in their HTML. This gets rid of those, so SHA1 can be generated. listofLinks = [] for i in caseLinks: listofLinks.append(i.get('href')) changed = courtChanged(url, str(listofLinks)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) if verbosity >= 2: print "CaseLink is: " + caseLink # special case if 'no memos filed' in caseLink.lower(): i += 1 continue myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 2: print "Error creating file. Punting..." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next, we'll do the caseNumber caseNumber = caseNumbers[i].text if verbosity >= 2: print "CaseNumber is: " + caseNumber # next up: document type (static for now) if 'memoranda' in url: doc.documentType = "Unpublished" elif 'opinions' in url: doc.documentType = "Published" if verbosity >= 2: print "Document type is: " + doc.documentType # next up: caseDate splitDate = caseDates[i].text.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "CaseDate is: " + str(caseDate) #next up: caseNameShort caseNameShort = titlecase(caseLinks[i].text.lower()) if verbosity >= 2: print "CaseNameShort is: " + caseNameShort + "\n\n" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 10): # a daily feed of all the items posted THAT day. Missing a day == bad. urls = ("http://www.ck10.uscourts.gov/opinions/new/daily_decisions.rss",) ct = Court.objects.get(courtUUID = 'ca10') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " &amp; ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNames = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-\d{4})(.*)$") i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) if verbosity >= 2: print "Link: " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 1: print "Error creating file, punting." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next: docType (this order of if statements IS correct) docType = docTypes[i].text.strip() if "unpublished" in docType.lower(): doc.documentType = "Unpublished" elif "published" in docType.lower(): doc.documentType = "Published" else: # it's an errata, or something else we don't care about i += 1 continue # next: caseDate caseDate = caseDateRegex.search(descriptions[i].text).group(1) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "Case date is: " + str(caseDate) # next: caseNumber caseNumber = caseNumberRegex.search(descriptions[i].text)\ .group(1) if verbosity >= 2: print "Case number is: " + caseNumber # next: caseNameShort caseNameShort = caseNames[i].text if verbosity >= 2: print "Case name is: " + caseNameShort # check for dups, make the object if necessary, otherwise, get it cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 11): """Prior to rev 313 (2010-04-27), this got published documents only, using the court's RSS feed. Currently, it uses lxml to parse the HTML on the published and unpublished feeds. It can be set to do any date range desired, however such modifications should likely go in back_scrape.py.""" # Missing a day == OK. urls = ( "http://www.ca11.uscourts.gov/unpub/searchdate.php", "http://www.ca11.uscourts.gov/opinions/searchdate.php", ) ct = Court.objects.get(courtUUID = 'ca11') for url in urls: date = time.strftime('%Y-%m', datetime.date.today().timetuple()) if verbosity >= 2: print "date: " + str(date) postValues = { 'date' : date, } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) html = urllib2.urlopen(req).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result tree = fromstring(html) if 'unpub' in url: caseNumbers = tree.xpath('//table[3]//table//table/tr[1]/td[2]') caseLinks = tree.xpath('//table[3]//table//table/tr[3]/td[2]/a') caseDates = tree.xpath('//table[3]//table//table/tr[4]/td[2]') caseNames = tree.xpath('//table[3]//table//table/tr[6]/td[2]') elif 'opinion' in url: caseNumbers = tree.xpath('//table[3]//td[3]//table/tr[1]/td[2]') caseLinks = tree.xpath('//table[3]//td[3]//table/tr[3]/td[2]/a') caseDates = tree.xpath('//table[3]//td[3]//table/tr[4]/td[2]') caseNames = tree.xpath('//table[3]//td[3]//table/tr[6]/td[2]') ''' # for debugging print "length: " + str(len(caseNames)) for foo in caseNames: print str(foo.text) return result''' i = 0 dupCount = 0 while i < len(caseNumbers): caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" if verbosity >= 2: print "Duplicate found at " + str(i) dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 if 'unpub' in url: doc.documentType = "Unpublished" elif 'opinion' in url: doc.documentType = "Published" if verbosity >= 2: print "documentType: " + str(doc.documentType) cleanDate = cleanString(caseDates[i].text) doc.dateFiled = datetime.datetime(*time.strptime(cleanDate, "%m-%d-%Y")[0:5]) if verbosity >= 2: print "dateFiled: " + str(doc.dateFiled) caseNameShort = caseNames[i].text caseNumber = caseNumbers[i].text cite, created = hasDuplicate(caseNumber, caseNameShort) if verbosity >= 2: print "caseNameShort: " + cite.caseNameShort print "caseNumber: " + cite.caseNumber + "\n" doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 12): # terrible site. Code assumes that we download the opinion on the day # it is released. If we miss a day, that could cause a problem. urls = ("http://www.cadc.uscourts.gov/bin/opinions/allopinions.asp",) ct = Court.objects.get(courtUUID = 'cadc') for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) caseNumRegex = re.compile("(\d{2}-\d{4})") i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber caseNumber = caseNumRegex.search(caseLink).group(1) # we can hard-code this b/c the D.C. Court paywalls all # unpublished opinions. doc.documentType = "Published" # caseDate is next on the block caseDate = datetime.date.today() doc.dateFiled = caseDate caseNameShort = aTags[i].next.next.next # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # if that goes well, we save to the DB doc.citation = cite # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result elif (courtID == 13): # running log of all opinions urls = ("http://www.cafc.uscourts.gov/dailylog.html",) ct = Court.objects.get(courtUUID = "cafc") for url in urls: html = urllib2.urlopen(url).read() if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) trTags = soup.findAll('tr') # start on the second row, since the first is headers. i = 1 dupCount = 0 while i <= 50: #stop at 50, if no triple dups first. try: caseLink = trTags[i].td.nextSibling.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.a.get('href').strip('.') caseLink = urljoin(url, caseLink) if 'opinion' not in caseLink: # we have a non-case PDF. punt i += 1 continue except: # the above fails when things get funky, in that case, we punt i += 1 continue myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next: caseNumber caseNumber = trTags[i].td.nextSibling.nextSibling.contents[0]\ .strip('.pdf') # next: dateFiled dateFiled = trTags[i].td.contents splitDate = dateFiled[0].split("/") dateFiled = datetime.date(int(splitDate[0]), int(splitDate[1]), int(splitDate[2])) doc.dateFiled = dateFiled # next: caseNameShort caseNameShort = trTags[i].td.nextSibling.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.a.contents[0] # next: documentType documentType = trTags[i].td.nextSibling.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.nextSibling.nextSibling\ .contents[0].contents[0] # normalize the result for our internal purposes... if documentType == "N": documentType = "Unpublished" elif documentType == "P": documentType = "Published" doc.documentType = documentType # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result if (courtID == 14): # we do SCOTUS urls = ("http://www.supremecourt.gov/opinions/slipopinions.aspx", "http://www.supremecourt.gov/opinions/in-chambers.aspx", "http://www.supremecourt.gov/opinions/relatingtoorders.aspx",) ct = Court.objects.get(courtUUID = 'scotus') for url in urls: if verbosity >= 2: print "Scraping URL: " + url html = urllib2.urlopen(url).read() tree = fromstring(html) if 'slipopinion' in url: caseLinks = tree.xpath('//table/tr/td[4]/a') caseNumbers = tree.xpath('//table/tr/td[3]') caseDates = tree.xpath('//table/tr/td[2]') elif 'in-chambers' in url: caseLinks = tree.xpath('//table/tr/td[3]/a') caseNumbers = tree.xpath('//table/tr/td[2]') caseDates = tree.xpath('//table/tr/td[1]') elif 'relatingtoorders' in url: caseLinks = tree.xpath('//table/tr/td[3]/a') caseNumbers = tree.xpath('//table/tr/td[2]') caseDates = tree.xpath('//table/tr/td[1]') if daemonmode: # if it's daemonmode, see if the court has changed # this is necessary because the SCOTUS puts random numbers # in their HTML. This gets rid of those, so SHA1 can be generated. listofLinks = [] for i in caseLinks: listofLinks.append(i.get('href')) changed = courtChanged(url, str(listofLinks)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) if verbosity >= 2: print "caseLink: " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 1: result += "Duplicate found at " + str(i) + "\n" if verbosity >= 2: print "Duplicate found at " + str(i) + '\n' dupCount += 1 if dupCount == 3: # third dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 caseNumber = caseNumbers[i].text if verbosity >= 2: print "caseNumber: " + caseNumber caseNameShort = caseLinks[i].text if verbosity >= 2: print "caseNameShort: " + caseNameShort if 'slipopinion' in url: doc.documentType = "Published" elif 'in-chambers' in url: doc.documentType = "In-chambers" elif 'relatingtoorders' in url: doc.documentType = "Relating-to" if verbosity >= 2: print "documentType: " + doc.documentType if '/' in caseDates[i].text: splitDate = caseDates[i].text.split('/') elif '-' in caseDates[i].text: splitDate = caseDates[i].text.split('-') year = int("20" + splitDate[2]) caseDate = datetime.date(year, int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "caseDate: " + str(caseDate) # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) doc.save() i += 1 return result
5f8ab0dce527e0f00d170a17505b959be1785525 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6762/5f8ab0dce527e0f00d170a17505b959be1785525/scrape_and_parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 888, 25360, 29328, 88, 12, 71, 477, 88, 734, 16, 563, 16, 11561, 16, 8131, 3188, 4672, 309, 11561, 1545, 576, 30, 563, 1011, 315, 27091, 348, 5093, 2203, 1360, 7910, 1099, 56, 30, 315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 888, 25360, 29328, 88, 12, 71, 477, 88, 734, 16, 563, 16, 11561, 16, 8131, 3188, 4672, 309, 11561, 1545, 576, 30, 563, 1011, 315, 27091, 348, 5093, 2203, 1360, 7910, 1099, 56, 30, 315,...
self.s = self.rl_hist[-self.h_i]
self.s = self.rl_hist[-self.h_i].rstrip('\n')
def fwd(self): """Same as back() but, well, forward"""
0bf852f1469bcc5deffcca06f413e9a7133d44b4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/0bf852f1469bcc5deffcca06f413e9a7133d44b4/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18943, 12, 2890, 4672, 3536, 8650, 487, 1473, 1435, 1496, 16, 5492, 16, 5104, 8395, 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, 18943, 12, 2890, 4672, 3536, 8650, 487, 1473, 1435, 1496, 16, 5492, 16, 5104, 8395, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self.image108 = QPixmap(image108_data) self.image109 = QPixmap(image109_data) self.image110 = QPixmap(image110_data)
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
e48e859515237593d94b403a9c0a7295e08c31f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e48e859515237593d94b403a9c0a7295e08c31f2/MainWindowUI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2938, 273, 599, 16, 529, 273, 599, 16, 2242, 273, 374, 4672, 2238, 6376, 3829, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 2242, 13, 365, 18, 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, 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, 2938, 273, 599, 16, 529, 273, 599, 16, 2242, 273, 374, 4672, 2238, 6376, 3829, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 2242, 13, 365, 18, 23...
"A <b>Measure Distance</b> jig functions as a dimension to display the "\ "distance between two atoms.</p>"\ "<p>To create the Measure Distance jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance jig is "\
"A <b>Measure Distance Jig</b> functions as a dimension to display the "\ "distance between two atoms."\ "</p>"\ "<p>To create the Measure Distance Jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance Jig is "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "fileopen", self.fileOpenAction.iconSet().pixmap() ) self.fileOpenAction.setWhatsThis( fileOpenText ) #### Save File #### fileSaveText = "<u><b>Save File</b></u> (Ctrl + S)</b></p><br> "\ "<p><img source=\"filesave\"><br> "\ "Saves the current file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "filesave", self.fileSaveAction.iconSet().pixmap() ) self.fileSaveAction.setWhatsThis( fileSaveText ) ############################################## # Edit Toolbar ############################################## #### Undo #### editUndoText = "<u><b>Undo</b></u> (Ctrl + Z)</b></p><br> "\ "<p><img source=\"editUndo\"><br> "\ "Reverses the last edit or command to the active part. "\ "<b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editUndo", self.editUndoAction.iconSet().pixmap() ) self.editUndoAction.setWhatsThis( editUndoText ) #### Redo #### editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\ "<p><img source=\"editRedo\"> <br>"\ "Re-applies the actions or commands on which you have used "\ "the Undo command. <b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editRedo", self.editRedoAction.iconSet().pixmap() ) self.editRedoAction.setWhatsThis( editRedoText ) #### Cut #### editCutText = "<u><b>Cut</b></u> (Ctrl + X)</b></p><br> "\ "<p><img source=\"editCut\"><br> "\ "Removes the selected object(s) and stores the cut data on the"\ "clipboard."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCut", self.editCutAction.iconSet().pixmap() ) self.editCutAction.setWhatsThis( editCutText ) #### Copy #### editCopyText = "<u><b>Copy</b></u> (Ctrl + C)</b></p><br> "\ "<p><img source=\"editCopy\"><br> "\ "Places a copy of the selected chunk(s) on the clipboard "\ "while leaving the original chunk(s) unaffected."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCopy", self.editCopyAction.iconSet().pixmap() ) self.editCopyAction.setWhatsThis( editCopyText ) #### Paste #### editPasteText = "<u><b>Paste</b></u> (Ctrl + V)</b></p><br> "\ "<p><img source=\"editPaste\"><br> "\ "When selecting this feature, you are placed in "\ "<b>Build Atom</b> mode where you may paste copies "\ "of clipboard objects into the model where ever you click."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editPaste", self.editPasteAction.iconSet().pixmap() ) self.editPasteAction.setWhatsThis( editPasteText ) #### Delete #### editDeleteText = "<u><b>Delete</b></u> (DEL)</b></p><br> "\ "<p><img source=\"editDelete\"><br> "\ "Deletes the selected object(s). "\ "For this Alpha release, deleted objects are permanantly lost.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editDelete", self.editDeleteAction.iconSet().pixmap() ) self.editDeleteAction.setWhatsThis( editDeleteText ) ############################################## # View Toolbar ############################################## #### Home View #### setViewHomeActionText = "<u><b>Home</b></u> (Home)<br>"\ "<p><img source=\"setViewHome\"><br> "\ "When you create a new model, it appears in a default view orientation (FRONT view). When you open an existing model, it appears in the orientation it was last saved. You can change the default orientation by selecting <b>Set Home View to Current View</b> from the <b>View</b> menu.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewHome", self.setViewHomeAction.iconSet().pixmap() ) self.setViewHomeAction.setWhatsThis( setViewHomeActionText ) #### Fit to Window #### setViewFitToWindowActionText = "<u><b>Fit To Window</b></u><br>"\ "<p><img source=\"setViewFitToWindow\"><br> "\ "Refits the model to the screen so you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFitToWindow", self.setViewFitToWindowAction.iconSet().pixmap() ) self.setViewFitToWindowAction.setWhatsThis( setViewFitToWindowActionText ) #### Recenter #### setViewRecenterActionText = "<u><b>Recenter</b></u><br>"\ "<p><img source=\"setViewRecenter\"><br> "\ "Changes the view center and zoom factor so that the origin is in the "\ "center of the view and you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRecenter", self.setViewRecenterAction.iconSet().pixmap() ) self.setViewRecenterAction.setWhatsThis( setViewRecenterActionText ) #### Zoom Tool #### setzoomToolActionText = "<u><b>Zoom Tool</b></u><br>"\ "<p><img source=\"setzoomTool\"><br> "\ "Allows the user to zoom into a specific area of the model by specifying a rectangular area. "\ "This is done by holding down the left button and dragging the mouse.</p>"\ "<p>A mouse with a mouse wheel can also be used to zoom in and out "\ "at any time, without using the Zoom Tool.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setzoomTool", self.zoomToolAction.iconSet().pixmap() ) self.zoomToolAction.setWhatsThis( setzoomToolActionText ) #### Pan Tool #### setpanToolActionText = "<u><b>Pan Tool</b></u><br>"\ "<p><img source=\"setpanTool\"><br> "\ "Allows X-Y panning using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can pan the model at any time by pressing "\ "the middle mouse button while holding down the Shift key.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setpanTool", self.panToolAction.iconSet().pixmap() ) self.panToolAction.setWhatsThis( setpanToolActionText ) #### Rotate Tool #### setrotateToolActionText = "<u><b>Rotate Tool</b></u><br>"\ "<p><img source=\"setrotateTool\"><br> "\ "Allows free rotation using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can rotate the model at any time by pressing "\ "the middle mouse button and dragging the mouse.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setrotateTool", self.rotateToolAction.iconSet().pixmap() ) self.rotateToolAction.setWhatsThis( setrotateToolActionText ) #### Orthographic Projection #### setViewOrthoActionText = "<u><b>Orthographic Projection</b></u><br>"\ "<p><img source=\"setViewOrtho\"><br> "\ "Sets nonperspective (or parallel) projection, with no foreshortening."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOrtho", self.setViewOrthoAction.iconSet().pixmap() ) self.setViewOrthoAction.setWhatsThis( setViewOrthoActionText ) #### Perspective Projection #### setViewPerspecActionText = "<u><b>Perspective Projection</b></u><br>"\ "<p><img source=\"setViewPerspec\"><br> "\ "Set perspective projection, drawing objects slightly larger "\ "that are closer to the viewer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPerspec", self.setViewPerspecAction.iconSet().pixmap() ) self.setViewPerspecAction.setWhatsThis( setViewPerspecActionText ) #### Normal To #### setViewNormalToActionText = "<u><b>Normal To</b></u><br>"\ "<p><img source=\"setViewNormalTo\"><br> "\ "Orients view to the normal vector of the plane defined by "\ "3 or more selected atoms, or a jig's axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewNormalTo", self.setViewNormalToAction.iconSet().pixmap() ) self.setViewNormalToAction.setWhatsThis( setViewNormalToActionText ) #### Parallel To #### setViewParallelToActionText = "<u><b>Parallel To</b></u><br>"\ "<p><img source=\"setViewParallelTo\"><br> "\ "Orients view parallel to the vector defined by 2 selected atoms."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewParallelTo", self.setViewParallelToAction.iconSet().pixmap() ) self.setViewParallelToAction.setWhatsThis( setViewParallelToActionText ) #### Front View #### setViewFrontActionText = "<u><b>Front View</b></u><br>"\ "<p><img source=\"setViewFront\"><br> "\ "Orients the view to the Front View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFront", self.setViewFrontAction.iconSet().pixmap() ) self.setViewFrontAction.setWhatsThis( setViewFrontActionText ) #### Back View #### setViewBackActionText = "<u><b>Back View</b></u><br>"\ "<p><img source=\"setViewBack\"><br> "\ "Orients the view to the Back View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBack", self.setViewBackAction.iconSet().pixmap() ) self.setViewBackAction.setWhatsThis( setViewBackActionText ) #### Top View #### setViewTopActionText = "<u><b>Top View</b></u><br>"\ "<p><img source=\"setViewTop\"><br> "\ "Orients the view to the Top View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewTop", self.setViewTopAction.iconSet().pixmap() ) self.setViewTopAction.setWhatsThis( setViewTopActionText ) #### Bottom View #### setViewBottomActionText = "<u><b>Bottom View</b></u><br>"\ "<p><img source=\"setViewBottom\"><br> "\ "Orients the view to the Bottom View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBottom", self.setViewBottomAction.iconSet().pixmap() ) self.setViewBottomAction.setWhatsThis( setViewBottomActionText ) #### Left View #### setViewLeftActionText = "<u><b>Left View</b></u><br>"\ "<p><img source=\"setViewLeft\"><br> "\ "Orients the view to the Left View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewLeft", self.setViewLeftAction.iconSet().pixmap() ) self.setViewLeftAction.setWhatsThis( setViewLeftActionText ) #### Right View #### setViewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"setViewRight\"><br> "\ "Orients the view to the Right View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRight", self.setViewRightAction.iconSet().pixmap() ) self.setViewRightAction.setWhatsThis( setViewRightActionText ) #### Opposite View #### setViewOppositeActionText = "<u><b>Opposite View</b></u><br>"\ "<p><img source=\"setViewOpposite\"><br> "\ "Rotates the view 180 degrees."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOpposite", self.setViewOppositeAction.iconSet().pixmap() ) self.setViewOppositeAction.setWhatsThis( setViewOppositeActionText ) #### Rotate +90 #### setViewPlus90ActionText = "<u><b>Rotate +90</b></u><br>"\ "<p><img source=\"setViewPlus90\"><br> "\ "Increment the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPlus90", self.setViewPlus90Action.iconSet().pixmap() ) self.setViewPlus90Action.setWhatsThis( setViewPlus90ActionText ) #### Rotate -90 #### setViewMinus90ActionText = "<u><b>Rotate -90</b></u><br>"\ "<p><img source=\"setViewMinus90\"><br> "\ "Decrement the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewMinus90", self.setViewMinus90Action.iconSet().pixmap() ) self.setViewMinus90Action.setWhatsThis( setViewMinus90ActionText ) ############################################## # Grids Toolbar ############################################## #### Surface 100 #### orient100ActionText = "<u><b>Surface 100</b></u><br>"\ "<p><img source=\"orient100Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,0,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient100Action", self.orient100Action.iconSet().pixmap() ) self.orient100Action.setWhatsThis(orient100ActionText ) #### Surface 110 #### orient110ActionText = "<u><b>Surface 110</b></u><br>"\ "<p><img source=\"orient110Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient110Action", self.orient110Action.iconSet().pixmap() ) self.orient110Action.setWhatsThis(orient110ActionText ) #### Surface 111 #### orient111ActionText = "<u><b>Surface 111</b></u><br>"\ "<p><img source=\"orient111Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,1) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient111Action", self.orient111Action.iconSet().pixmap() ) self.orient111Action.setWhatsThis(orient111ActionText ) ############################################## # Molecular Display toolbar ############################################## #### Display Default #### dispDefaultActionText = "<u><b>Display Default</b></u><br>"\ "<p><img source=\"dispDefaultAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Default</b> , rendering them in the <b>Current Display Mode</b>."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to the <b>Default Display Mode</b>. " \ "All chunks with their display setting set to <b>Default</b> will be rendered in the "\ "<b>Default Display Mode</b>."\ "</p>"\ "<p>The <b>Default Display Mode</b> can be changed via the "\ "<b>Edit > Preferences</b> menu and selecting the <b>General</b> tab."\ "</p>"\ "<p>The <b>Current or Default Display Mode</b> is displayed in the status bar in the "\ "lower right corner of the main window."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDefaultAction", self.dispDefaultAction.iconSet().pixmap() ) self.dispDefaultAction.setWhatsThis(dispDefaultActionText ) #### Display Invisible #### dispInvisActionText = "<u><b>Display Invisible</b></u><br>"\ "<p><img source=\"dispInvisAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Invisible</b>, making them invisible."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Invisible</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispInvisAction", self.dispInvisAction.iconSet().pixmap() ) self.dispInvisAction.setWhatsThis(dispInvisActionText ) #### Display Lines #### dispLinesActionText = "<u><b>Display Lines</b></u><br>"\ "<p><img source=\"dispLinesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ " <b>Lines</b>. Only bonds are rendered as colored lines."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Lines</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispLinesAction", self.dispLinesAction.iconSet().pixmap() ) self.dispLinesAction.setWhatsThis(dispLinesActionText ) #### Display Tubes #### dispTubesActionText = "<u><b>Display Tubes</b></u><br>"\ "<p><img source=\"dispTubesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Tubes</b>. Atoms and bonds are rendered as colored tubes."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Tubes</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTubesAction", self.dispTubesAction.iconSet().pixmap() ) self.dispTubesAction.setWhatsThis(dispTubesActionText ) #### Display CPK #### dispCPKActionText = "<u><b>Display CPK</b></u><br>"\ "<p><img source=\"dispCPKAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>CPK</b> mode, also known as <b>\"Ball and Sticks\"</b> mode. Atoms are rendered "\ "as spheres and bonds are rendered as narrow cylinders."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>CPK</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCPKAction", self.dispCPKAction.iconSet().pixmap() ) self.dispCPKAction.setWhatsThis(dispCPKActionText ) #### Display VdW #### dispVdWActionText = "<u><b>Display VdW</b></u><br>"\ "<p><img source=\"dispVdWAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Van der Waals</b> mode. Atoms are rendered as spheres with "\ "a size equal to the VdW radius. Bonds are not rendered."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>VdW</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispVdWAction", self.dispVdWAction.iconSet().pixmap() ) self.dispVdWAction.setWhatsThis(dispVdWActionText ) ############################################## # Select toolbar ############################################## #### Select All #### selectAllActionText = "<u><b>Select All</b></u> (Ctrl + A)</b></p><br>"\ "<p><img source=\"selectAllAction\"><br> "\ "During <b>Select Atoms</b> mode, this will select all the atoms in "\ "the model. Otherwise, this will select all the chunks in the model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectAllAction", self.selectAllAction.iconSet().pixmap() ) self.selectAllAction.setWhatsThis(selectAllActionText ) #### Select None #### selectNoneActionText = "<u><b>Select None</b></u></p><br>"\ "<p><img source=\"selectNoneAction\"><br> "\ "Unselects everything currently selected.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectNoneAction", self.selectNoneAction.iconSet().pixmap() ) self.selectNoneAction.setWhatsThis(selectNoneActionText ) #### Invert Selection #### selectInvertActionText = "<u><b>Invert Selection</b></u> <br> (Ctrl + Shift + I)</b></p><br>"\ "<p><img source=\"selectInvertAction\"><br> "\ "Inverts the current selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectInvertAction", self.selectInvertAction.iconSet().pixmap() ) self.selectInvertAction.setWhatsThis(selectInvertActionText ) #### Select Connected #### selectConnectedActionText = "<u><b>Select Connected</b></u> (Ctrl + Shift + C)</b></p><br>"\ "<p><img source=\"selectConnectedAction\"><br> "\ "Selects all the atoms that can be reached by the currently selected atom "\ "via an unbroken chain of bonds. </p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectConnectedAction", self.selectConnectedAction.iconSet().pixmap() ) self.selectConnectedAction.setWhatsThis(selectConnectedActionText ) #### Select Doubly #### selectDoublyActionText = "<u><b>Select Doubly</b></u></b></p><br>"\ "<p><img source=\"selectDoublyAction\"><br> "\ "Selects all the atoms that can be reached from a currently selected "\ "atom through two disjoint unbroken chains of bonds. Atoms singly "\ "connected to this group and unconnected to anything else are also "\ "included in the selection.</p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectDoublyAction", self.selectDoublyAction.iconSet().pixmap() ) self.selectDoublyAction.setWhatsThis(selectDoublyActionText ) #### Expand Selection #### selectExpandActionText = "<u><b>Expand Selection</b></u> (Ctrl + D)</b></p><br>"\ "<p><img source=\"selectExpandAction\"><br> "\ "Selects any atom that is a neighbor of a currently selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectExpandAction", self.selectExpandAction.iconSet().pixmap() ) self.selectExpandAction.setWhatsThis(selectExpandActionText ) #### Contract Selection #### selectContractActionText = "<u><b>Contract Selection</b></u> (Ctrl + Shift + D)</b></p><br>"\ "<p><img source=\"selectContractAction\"><br> "\ "Unselects any atom that has an open bond."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectContractAction", self.selectContractAction.iconSet().pixmap() ) self.selectContractAction.setWhatsThis(selectContractActionText ) ############################################## # Modify Toolbar ############################################## #### Minimize Selection #### modifyMinimizeSelActionText = "<u><b>Minimize Selection</b></u> (Ctrl + M)</b></p><br>"\ "<p><img source=\"modifyMinimizeSelAction\"><br> "\ "Arranges the atoms (<i>of the current selection</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeSelAction", self.modifyMinimizeSelAction.iconSet().pixmap() ) self.modifyMinimizeSelAction.setWhatsThis(modifyMinimizeSelActionText ) #### Minimize All #### modifyMinimizeAllActionText = "<u><b>Minimize All</b></u></p><br>"\ "<p><img source=\"modifyMinimizeAllAction\"><br> "\ "Arranges the atoms (<i>of the entire part</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeAllAction", self.modifyMinimizeAllAction.iconSet().pixmap() ) self.modifyMinimizeAllAction.setWhatsThis(modifyMinimizeAllActionText ) #### Hydrogenate #### modifyHydrogenateActionText = "<u><b>Hydrogenate</b></u> </b></p><br>"\ "<p><img source=\"modifyHydrogenateAction\"><br> "\ "Adds hydrogen atoms to all the open bonds in the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyHydrogenateAction", self.modifyHydrogenateAction.iconSet().pixmap() ) self.modifyHydrogenateAction.setWhatsThis(modifyHydrogenateActionText ) #### Dehydrogenate #### modifyDehydrogenateActionText = "<u><b>Dehydrogenate</b></u><br>"\ "<p><img source=\"modifyDehydrogenateAction\"><br> "\ "Removes all hydrogen atoms from the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDehydrogenateAction", self.modifyDehydrogenateAction.iconSet().pixmap() ) self.modifyDehydrogenateAction.setWhatsThis(modifyDehydrogenateActionText ) #### Passivate #### modifyPassivateActionText = "<u><b>Passivate</b></u> (Ctrl + P)</b></p><br>"\ "<p><img source=\"modifyPassivateAction\"><br> "\ "Changes the types of incompletely bonded atoms to atoms with the "\ "right number of bonds, using atoms with the best atomic radius."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyPassivateAction", self.modifyPassivateAction.iconSet().pixmap() ) self.modifyPassivateAction.setWhatsThis(modifyPassivateActionText ) #### Stretch #### modifyStretchActionText = "<u><b>Stretch</b></u><br>"\ "<p><img source=\"modifyStretchAction\"><br> "\ "Stretches the bonds of the selected chunk(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyStretchAction", self.modifyStretchAction.iconSet().pixmap() ) self.modifyStretchAction.setWhatsThis(modifyStretchActionText ) #### Delete Bonds #### modifyDeleteBondsActionText = "<u><b>Delete Bonds</b></u><br>"\ "<p><img source=\"modifyDeleteBondsAction\"><br> "\ "Delete all bonds between selected and unselected atoms or chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDeleteBondsAction", self.modifyDeleteBondsAction.iconSet().pixmap() ) self.modifyDeleteBondsAction.setWhatsThis(modifyDeleteBondsActionText ) #### Separate #### modifySeparateActionText = "<u><b>Separate</b></u><br>"\ "<p><img source=\"modifySeparateAction\"><br> "\ "Creates a new chunk from the currently selected atoms.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifySeparateAction", self.modifySeparateAction.iconSet().pixmap() ) self.modifySeparateAction.setWhatsThis(modifySeparateActionText ) #### Merge Chunks #### modifyMergeActionText = "<u><b>Merge Chunks</b></u><br>"\ "<p><img source=\"modifyMergeAction\"><br> "\ "Merges two or more chunks into a single chunk.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMergeAction", self.modifyMergeAction.iconSet().pixmap() ) self.modifyMergeAction.setWhatsThis(modifyMergeActionText ) #### Invert Chunks #### modifyInvertActionText = "<u><b>Invert</b></u><br>"\ "<p><img source=\"modifyInvertAction\"><br> "\ "Inverts the atoms of the selected chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyInvertAction", self.modifyInvertAction.iconSet().pixmap() ) self.modifyInvertAction.setWhatsThis(modifyInvertActionText ) #### Align to Common Axis #### modifyAlignCommonAxisActionText = "<u><b>Align To Common Axis</b></u><br>"\ "<p><img source=\"modifyAlignCommonAxis\"><br> "\ "Aligns one or more chunks to the axis of the first selected chunk."\ "You must select two or more chunks before using this feature."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyAlignCommonAxis", self. modifyAlignCommonAxisAction.iconSet().pixmap() ) self. modifyAlignCommonAxisAction.setWhatsThis( modifyAlignCommonAxisActionText ) ############################################## # Tools Toolbar ############################################## #### Select Chunks #### toolsSelectMoleculesActionText = "<u><b>Select Chunks</b></u><!-- [[Feature:Select Chunks Mode]] --><br>"\ "<p><img source=\" toolsSelectMoleculesAction\"><br> "\ "<b>Select Chunks</b> allows you to select/unselect chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects a chunk(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes chunk(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds chunk(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectMoleculesAction", self. toolsSelectMoleculesAction.iconSet().pixmap() ) self. toolsSelectMoleculesAction.setWhatsThis( toolsSelectMoleculesActionText ) #### Select Atoms #### toolsSelectAtomsActionText = "<u><b>Select Atoms</b></u><!-- [[Feature:Select Atoms Mode]] --><br>"\ "<p><img source=\" toolsSelectAtomsAction\"><br> "\ "<b>Select Atoms</b> allows you to select/unselect atoms with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects an atom(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes atom(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds atom(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectAtomsAction", self. toolsSelectAtomsAction.iconSet().pixmap() ) self. toolsSelectAtomsAction.setWhatsThis( toolsSelectAtomsActionText ) #### Move Chunks #### toolsMoveMoleculeActionText = "<u><b>Move Chunks</b></u><!-- [[Feature:Move Chunks Mode]] --><br>"\ "<p><img source=\" toolsMoveMoleculeAction\"><br> "\ "Activates <b>Move Chunks</b> mode, allowing you to select, "\ "move and rotate one of more chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Drag</b> - moves the selected chunk(s).</p>"\ "<p><b>Ctrl+Left Drag</b> - freely rotates selected chunk(s).</p>"\ "<p><b>Shift+Left Drag</b> - constrained movement and rotation of a chunk about its own axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsMoveMoleculeAction", self. toolsMoveMoleculeAction.iconSet().pixmap() ) self. toolsMoveMoleculeAction.setWhatsThis( toolsMoveMoleculeActionText ) #### Build Atoms Tool #### toolsDepositAtomActionText = "<u><b>Build Tool</b></u><!-- [[Feature:Build Mode]] --><br>"\ "<p><img source=\" toolsDepositAtomAction\"><br> "\ "<b>Build Tool</b> allows you to deposit individual atoms or add/move/delete "\ "atoms from an existing chunk. Build Tool can also be used to paste "\ "copies of chunks from the clipboard into the part.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click</b> - adds an atom or pastes a chunk from the clipboard. "\ "New atoms can be connected to an existing chunk if an open bond is highlighted "\ "during a left click.</p>"\ "<p><b>Ctrl+Left Click</b> - deletes a highlighted atom or bond.</p>"\ "<p><b>Shift+Left Drag</b> - moves an atom or open bond. An open bond will be "\ "connected to another open bond if the mouse button is released over a different "\ "open bond."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDepositAtomAction", self. toolsDepositAtomAction.iconSet().pixmap() ) self. toolsDepositAtomAction.setWhatsThis( toolsDepositAtomActionText ) #### Cookie Cutter #### toolsCookieCutActionText = "<u><b>Cookie Cutter Tool</b></u><!-- [[Feature:Cookie Cutter Mode]] --><br>"\ "<p><><img source=\" toolsCookieCutAction\"><br> "\ "Activates <b>Cookie Cutter</b> mode, allowing you to cut out 3-D shapes from a "\ "slab of diamond or lonsdaleite lattice.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCookieCutAction", self. toolsCookieCutAction.iconSet().pixmap() ) self. toolsCookieCutAction.setWhatsThis( toolsCookieCutActionText ) #### Extrude Tool #### toolsExtrudeActionText = "<u><b>Extrude Tool</b></u><!-- [[Feature:Extrude Mode]] --><br>"\ "<p><img source=\" toolsExtrudeAction\"><br> "\ "Activates <b>Extrude</b> mode, allowing you to create a rod or ring using a chunk as "\ "a repeating unit.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsExtrudeAction", self. toolsExtrudeAction.iconSet().pixmap() ) self. toolsExtrudeAction.setWhatsThis( toolsExtrudeActionText ) #### Fuse Chunks Tool #### toolsFuseChunksActionText = "<u><b>Fuse Chunks Tool</b></u><!-- [[Feature:Fuse Chunks Mode]] --><br>"\ "<p><img source=\" toolsFuseChunksAction\"><br> "\ "<b>Fuse Chunks</b> can be used to interactively join two or more "\ "chunks by dragging chunks around and fusing them together. "\ "Two types of fusing are supported:<br><br>"\ "<b>Make Bonds</b> creates bonds between the existing open bonds) "\ "of two or more chunks. Bonds are drawn (and undrawn) as chunks "\ "are moved together (and apart).<br><br>"\ "<b>Fuse Atoms</b> fuses overlapping atoms between chunks. Overlapping "\ "pairs of atoms are highlighted in green and blue to indicate which atoms "\ "will be fused.<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseChunksAction", self. toolsFuseChunksAction.iconSet().pixmap() ) self.toolsFuseChunksAction.setWhatsThis( toolsFuseChunksActionText ) #### Fuse Atoms Tool #### toolsFuseAtomsActionText = "<u><b>Fuse Atoms Tool</b></u><!-- [[Feature:Fuse Atoms Mode]] (nim?) --><br>"\ "<p><img source=\" toolsFuseAtomsAction\"><br> "\ "<b>Fuse Atoms</b> fuses the overlapping atoms between two or more chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseAtomsAction", self. toolsFuseAtomsAction.iconSet().pixmap() ) self.toolsFuseAtomsAction.setWhatsThis( toolsFuseAtomsActionText ) #### Movie Player #### simMoviePlayerActionText = "<u><b>Movie Player</b></u><br>"\ "<p><img source=\" simMoviePlayerAction\"><br> "\ "Plays the most recent trajectory (movie) file created by the <b>Simulator</b>.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simMoviePlayerAction", self. simMoviePlayerAction.iconSet().pixmap() ) self. simMoviePlayerAction.setWhatsThis( simMoviePlayerActionText ) #### Simulator #### simSetupActionText = "<u><b>Simulator</b></u><br>"\ "<p><img source=\" simSetupAction\"><br> "\ "Creates a trajectory (movie) file by calculating the inter-atomic potentials and bonding "\ "of the entire model. The user determines the number of frames in the movie, the time step, "\ "and the temperature for the simulation.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simSetupAction", self. simSetupAction.iconSet().pixmap() ) self. simSetupAction.setWhatsThis( simSetupActionText ) #### Plot Tool #### simPlotToolActionText = "<u><b>Plot Tool</b></u><br>"\ "<p><img source=\" simPlotToolAction\"><br> "\ "Plots a simulator trace file using GNUplot. A simulation must be run to create "\ "the trace file, and the part must have a jig that writes output to the trace file. <br><br>"\ "The following list of jigs write data to the trace file:<br>"\ "<b>Rotary Motors:</b> speed (GHz) and torque (nn-nm)<br>"\ "<b>Linear Motors:</b> displacement (pm)<br>"\ "<b>Anchors:</b> torque (nn-nm)<br>"\ "<b>Thermostats:</b> energy added (zJ)<br>"\ "<b>Thermometer:</b> temperature (K)<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simPlotToolAction", self. simPlotToolAction.iconSet().pixmap() ) self. simPlotToolAction.setWhatsThis( simPlotToolActionText ) ############################################## # Dashboard Buttons ############################################## #### Done #### toolsDoneActionText = "<u><b>Done</b></u><br>"\ "<p><img source=\" toolsDoneAction\"><br> "\ "Completes the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDoneAction", self. toolsDoneAction.iconSet().pixmap() ) self. toolsDoneAction.setWhatsThis( toolsDoneActionText ) #### Cancel #### toolsCancelActionText = "<u><b>Cancel</b></u><br>"\ "<p><img source=\" toolsCancelAction\"><br> "\ "Cancels the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCancelAction", self.toolsCancelAction.iconSet().pixmap() ) self. toolsCancelAction.setWhatsThis( toolsCancelActionText ) #### Back up #### toolsBackUpActionText = "<u><b>Back Up</b></u><br>"\ "<p><img source=\" toolsBackUpAction\"><br> "\ "Undoes the previous operation."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsBackUpAction", self.toolsBackUpAction.iconSet().pixmap() ) self. toolsBackUpAction.setWhatsThis( toolsBackUpActionText ) #### Start Over #### toolsStartOverActionText = "<u><b>Start Over</b></u><br>"\ "<p><img source=\"toolsStartOverAction\"><br> "\ "Cancels the current operation, leaving the user in the current mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "toolsStartOverAction", self.toolsStartOverAction.iconSet().pixmap() ) self.toolsStartOverAction.setWhatsThis(toolsStartOverActionText ) #### Add Layers #### ccAddLayerActionText = "<u><b>Add Layer</b></u><br>"\ "<p><img source=\"ccAddLayerAction\"><br> "\ "Adds a new layer of diamond lattice to the existing layer.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "ccAddLayerAction", self.ccAddLayerAction.iconSet().pixmap() ) self.ccAddLayerAction.setWhatsThis(ccAddLayerActionText ) ############################################## # Jigs ############################################## #### Anchor #### jigsAnchorActionText = "<u><b>Anchor</b></u><br>"\ "<p><img source=\"jigsAnchorAction\"><br> "\ "Attaches a <b>Anchor</b> to the selected atom(s), which "\ "constrains its motion during a minimization or simulation.</p>"\ "<p>To create an Anchor, enter <b>Select Atoms</b> mode, "\ "select the atom(s) you want to anchor and then select this action. "\ "Anchors are drawn as a black wireframe box around each selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAnchorAction", self.jigsAnchorAction.iconSet().pixmap() ) self.jigsAnchorAction.setWhatsThis(jigsAnchorActionText ) #### Rotary Motor #### jigsMotorActionText = "<u><b>Rotary Motor</b></u><br>"\ "<p><img source=\"jigsMotorAction\"><br> "\ "Attaches a <b>Rotary Motor</b> to the selected atoms. The Rotary Motor is used by "\ "the simulator to apply rotary motion to a set of atoms during a simulation run. You may "\ "specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor.</p>"\ "<p>To create a Rotary Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsMotorAction", self.jigsMotorAction.iconSet().pixmap() ) self.jigsMotorAction.setWhatsThis(jigsMotorActionText ) #### Linear Motor #### jigsLinearMotorActionText = "<u><b>Linear Motor</b></u><br>"\ "<p><img source=\"jigsLinearMotorAction\"><br> "\ "Attaches a <b>Linear Motor</b> to the selected atoms. The Linear Motor is used by "\ "the simulator to apply linear motion to a set of atoms during a simulation run. You may "\ "specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor.</p>"\ "<p>To create a Linear Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsLinearMotorAction", self.jigsLinearMotorAction.iconSet().pixmap() ) self.jigsLinearMotorAction.setWhatsThis(jigsLinearMotorActionText ) #### Thermostat #### jigsStatActionText = "<u><b>Thermostat</b></u><br>"\ "<p><img source=\"jigsStatAction\"><br> "\ "Attaches a <b>Langevin Thermostat</b> to a single selected atom, thereby associating "\ "the themostat to the entire molecule of which the selected atom is a member. The user "\ "specifies the temperature (in Kelvin).</p>"\ "<p>The Langevin Thermostat is used to set and hold the temperature "\ "of a molecule during a simulation run.</p>"\ "<p>To create a Langevin Thermostat, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermostat is drawn as a "\ "blue wireframe box around the selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsStatAction", self.jigsStatAction.iconSet().pixmap() ) self.jigsStatAction.setWhatsThis(jigsStatActionText ) #### Thermometer #### jigsThermoActionText = "<u><b>Thermometer</b></u><br>"\ "<p><img source=\"jigsThermoAction\"><br> "\ "Attaches a <b>Thermometer</b> to a single selected atom, thereby associating "\ "the themometer to the entire molecule of which the selected atom is a member. "\ "<p>The temperature of the molecule will be recorded and written to a trace file "\ "during a simulation run.</p>"\ "<p>To create a Thermometer, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermometer is drawn as a "\ "dark red wireframe box around the selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsThermoAction", self.jigsThermoAction.iconSet().pixmap() ) self.jigsThermoAction.setWhatsThis(jigsThermoActionText ) #### ESP Image #### jigsESPImageActionText = "<u><b>ESP Image</b></u></b></p><br>"\ "<p><img source=\"jigsESPImageAction\"><br> "\ "An <b>ESP Image</b> allows the user to visualize the electrostatic potential "\ "of points on the face of a square 2D surface. Nano-Hive's MPQC ESP Plane plug-in "\ "is used to calculate the electrostatic potential.</p>"\ "<p>To create an ESP Image, enter <b>Select Atoms</b> mode, "\ "select three or more atoms and then select this jig. The ESP Image is drawn as a "\ "plane with a bounding volume."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsESPImageAction", self.jigsESPImageAction.iconSet().pixmap() ) self.jigsESPImageAction.setWhatsThis(jigsESPImageActionText ) #### Atom Set #### jigsAtomSetActionText = "<u><b>Atom Set</b></u></b></p><br>"\ "<p><img source=\"jigsAtomSetAction\"><br> "\ "An <b>Atom Set</b> jig provides a convienient way to save an atom "\ "selection which can be reselected later.</p>"\ "<p>To create an Atom Set, enter <b>Select Atoms</b> mode, "\ "select any number of atoms and then select this jig. The Atom Set is "\ "drawn as a set of wireframe boxes around each atom in the selection.</p>"\ "<p>To reselect the atoms in an Atom Set, select it's context "\ "menu in the Model Tree and click the menu item that states "\ "<b>Select this jig's atoms</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAtomSetAction", self.jigsAtomSetAction.iconSet().pixmap() ) self.jigsAtomSetAction.setWhatsThis(jigsAtomSetActionText ) #### Measure Distance #### jigsDistanceActionText = "<u><b>Measure Distance</b></u></b></p><br>"\ "<p><img source=\"jigsDistanceAction\"><br> "\ "A <b>Measure Distance</b> jig functions as a dimension to display the "\ "distance between two atoms.</p>"\ "<p>To create the Measure Distance jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance jig is "\ "drawn as a pair of wireframe boxes around each atom connected by "\ "a line and a pair of numbers. The first number is the distance between the "\ "VdW radii (this can be a negative number for atoms that are close together). "\ "The second number is the distance between the nuclei.</p>"\ "<p>The Measure Distance jig will write the two distance values to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDistanceAction", self.jigsDistanceAction.iconSet().pixmap() ) self.jigsDistanceAction.setWhatsThis(jigsDistanceActionText ) #### Measure Angle #### jigsAngleActionText = "<u><b>Measure Angle</b></u></b></p><br>"\ "<p><img source=\"jigsAngleAction\"><br> "\ "A <b>Measure Angle</b> jig functions as a dimension to display the "\ "angle between three atoms.</p>"\ "<p>To create the Measure Angle jig, enter <b>Select Atoms</b> mode, "\ "select three atoms and then select this jig. The Measure Angle jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the angle between the three atoms.</p>"\ "<p>The Measure Angle jig will write the angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAngleAction", self.jigsAngleAction.iconSet().pixmap() ) self.jigsAngleAction.setWhatsThis(jigsAngleActionText ) #### Measure Dihedral #### jigsDihedralActionText = "<u><b>Measure Dihedral</b></u></b></p><br>"\ "<p><img source=\"jigsDihedralAction\"><br> "\ "A <b>Measure Dihedral</b> jig functions as a dimension to display the "\ "dihedral angle of a four atom sequence.</p>"\ "<p>To create the Measure Dihedral jig, enter <b>Select Atoms</b> mode, "\ "select four atoms and then select this jig. The Measure Dihedral jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the dihedral angle value.</p>"\ "<p>The Measure Dihedral jig will write the dihedral angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDihedralAction", self.jigsDihedralAction.iconSet().pixmap() ) self.jigsDihedralAction.setWhatsThis(jigsDihedralActionText ) ############################################## # Display ############################################## #### Display Object Color #### dispObjectColorActionText = "<u><b>Object Color</b></u><br>"\ "<p><img source=\"dispObjectColorAction\"><br> "\ "Allows you to change the color of the selected object(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispObjectColorAction", self.dispObjectColorAction.iconSet().pixmap() ) self.dispObjectColorAction.setWhatsThis(dispObjectColorActionText ) #### Display Background Color #### dispBGColorActionText = "<u><b>Background Color</b></u><br>"\ "<p><img source=\"dispBGColorAction\"><br> "\ "Allows you to change the background color of the main window.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispBGColorAction", self.dispBGColorAction.iconSet().pixmap() ) self.dispBGColorAction.setWhatsThis(dispBGColorActionText ) ############################################## # Help Toolbar ############################################## #### What's This #### helpWhatsThisText = "<u><b>What's This</b></u><br>"\ "<p><img source=\"helpWhatsThis\"><br> "\ "Click this option to invoke a small question mark that is attached to the mouse pointer. "\ "Click on a feature which you would like more information about. "\ "A popup box appears with information about the feature.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "helpWhatsThis", self.helpWhatsThisAction.iconSet().pixmap() ) self.helpWhatsThisAction.setWhatsThis( helpWhatsThisText ) ############################################## # Datum Display Toolbar ############################################## #### Display Trihedron #### dispTrihedronText = "<u><b>Display Trihedron</b></u><br>"\ "<p><img source=\"dispTrihedron\"><br> "\ "Toggles the trihedron on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTrihedron", self.dispTrihedronAction.iconSet().pixmap() ) self.dispTrihedronAction.setWhatsThis(dispTrihedronText ) #### Display Csys #### dispCsysText = "<u><b>Display Csys Axis</b></u><br>"\ "<p><img source=\"dispCsys\"><br> "\ "Toggles the coordinate system axis on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCsys", self.dispCsysAction.iconSet().pixmap() ) self.dispCsysAction.setWhatsThis(dispCsysText ) #### Display Datum Lines #### dispDatumLinesText = "<u><b>Display Datum Lines</b></u><br>"\ "<p><img source=\"dispDatumLines\"><br> "\ "Toggles Datum Lines on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumLines", self.dispDatumLinesAction.iconSet().pixmap() ) self.dispDatumLinesAction.setWhatsThis(dispDatumLinesText ) #### Display Datum Planes #### dispDatumPlanesText = "<u><b>Display Datum Planes</b></u><br>"\ "<p><img source=\"dispDatumPlanes\"><br> "\ "Toggles Datum Planes on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumPlanes", self.dispDatumPlanesAction.iconSet().pixmap() ) self.dispDatumPlanesAction.setWhatsThis(dispDatumPlanesText ) #### Display Grid #### dispGridText = "<u><b>Display 3-D Grid</b></u><br>"\ "<p><img source=\"dispGrid\"><br> "\ "Toggles the 3-D grid on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispGrid", self.dispGridAction.iconSet().pixmap() ) self.dispGridAction.setWhatsThis(dispGridText ) #### Display Open Bonds #### dispOpenBondsText = "<u><b>Display Singlets</b></u><br>"\ "<p><img source=\"dispOpenBonds\"><br> "\ "Toggles Singlets on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispOpenBonds", self.dispOpenBondsAction.iconSet().pixmap() ) self.dispOpenBondsAction.setWhatsThis(dispOpenBondsText )
c9a25d437341caa5f0c88a4ab02c54ebb7627482 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/c9a25d437341caa5f0c88a4ab02c54ebb7627482/whatsthis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2888, 2323, 2503, 12, 2890, 4672, 225, 19709, 26487, 7, 468, 1387, 13288, 3215, 19709, 26487, 7, 225, 11849, 7, 3502, 1387, 11849, 7, 225, 585, 3678, 1528, 273, 3532, 89, 4438, 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, 752, 2888, 2323, 2503, 12, 2890, 4672, 225, 19709, 26487, 7, 468, 1387, 13288, 3215, 19709, 26487, 7, 225, 11849, 7, 3502, 1387, 11849, 7, 225, 585, 3678, 1528, 273, 3532, 89, 4438, 70, ...
RunCommand(['repo', 'sync', '--jobs=%d' % (num_procs)], cwd=buildroot)
RunCommand(['repo', '--trace', 'sync'], cwd=buildroot)
def RepoSync(buildroot, rw_checkout=False, retries=_DEFAULT_RETRIES): """Uses repo to checkout the source code. Keyword arguments: rw_checkout -- Reconfigure repo after sync'ing to read-write. retries -- Number of retries to try before failing on the sync. """ # Get the number of processors to use with repo sync. num_procs = int(RunCommand('grep -c processor /proc/cpuinfo'.split(), print_cmd=False, redirect_stdout=True)) while retries > 0: try: RunCommand(['repo', 'sync', '--jobs=%d' % (num_procs)], cwd=buildroot) if rw_checkout: # Always re-run in case of new git repos or repo sync # failed in a previous run because of a forced Stop Build. RunCommand(['repo', 'forall', '-c', 'git', 'config', 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof', 'http://git.chromium.org/git'], cwd=buildroot) retries = 0 except: retries -= 1 if retries > 0: Warning('CBUILDBOT -- Repo Sync Failed, retrying') else: Warning('CBUILDBOT -- Retries exhausted') raise
7bf8d2715edc720c64adccd5c08347bee1aa56b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/7bf8d2715edc720c64adccd5c08347bee1aa56b2/cbuildbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15118, 4047, 12, 3510, 3085, 16, 7985, 67, 17300, 33, 8381, 16, 9453, 33, 67, 5280, 67, 862, 6566, 3991, 4672, 3536, 15128, 3538, 358, 13926, 326, 1084, 981, 18, 225, 18317, 1775, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15118, 4047, 12, 3510, 3085, 16, 7985, 67, 17300, 33, 8381, 16, 9453, 33, 67, 5280, 67, 862, 6566, 3991, 4672, 3536, 15128, 3538, 358, 13926, 326, 1084, 981, 18, 225, 18317, 1775, 30, ...
tmphbox=wx.BoxSizer(wx.HORIZONTAL)
tmphbox = wx.BoxSizer(wx.HORIZONTAL)
def __init__(self, content, aborted=False, main=None): Damnlog('Done dialog opening with parameters content =',content,'; aborted?',aborted) dirs=[] files={} icons={} for i in content: if i[1] not in dirs: dirs.append(i[1]) files[i[1]]=[] files[i[1]].append(i[0]) icons[i[1]+i[0]]=i[2] dirs.sort() for i in dirs: files[i].sort() Damnlog('Done dialog parsed content; dirs =',dirs,'; files =',files) self.parent=main title='Processing done.' if aborted: title='Processing aborted.' wx.Dialog.__init__(self, None, -1, DV.l(title)) absbox1 = wx.BoxSizer(wx.VERTICAL) absbox2 = wx.BoxSizer(wx.HORIZONTAL) self.SetSizer(absbox1) absbox1.Add((0, DV.border_padding)) absbox1.Add(absbox2) absbox1.Add((0, DV.border_padding)) topvbox = wx.BoxSizer(wx.VERTICAL) absbox2.Add((DV.border_padding, 0)) absbox2.Add(topvbox) absbox2.Add((DV.border_padding, 0)) panel = wx.Panel(self, -1) topvbox.Add(panel, 1, wx.EXPAND) mainvbox=wx.BoxSizer(wx.VERTICAL) panel.SetSizer(mainvbox) self.underlined=wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) self.underlined.SetUnderlined(True) # Build UI Damnlog('Building center UI of done dialog.') if aborted: title = wx.StaticText(panel, -1, DV.l('Video conversion aborted.')) title.SetFont(wx.Font(14, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) else: title = wx.StaticText(panel, -1, DV.l('Video conversion successful.')) title.SetFont(wx.Font(14, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) mainvbox.Add(title) mainvbox.Add((0,DV.border_padding*2)) if len(content): Damnlog('There is content, so we\'re gonna build tree.') mainvbox.Add(wx.StaticText(panel,-1,DV.l('The following videos have been processed:'))) foldericon=wx.Bitmap(DV.images_path + 'foldermovie.png') for d in dirs: Damnlog('Building videos list for directory',d) tmpvbox=wx.BoxSizer(wx.VERTICAL) mainvbox.Add(tmpvbox) tmphbox=wx.BoxSizer(wx.HORIZONTAL) tmpvbox.Add(tmphbox) tmphbox.Add(self.bindAndCursor(wx.StaticBitmap(panel, -1, foldericon), launchdir=d), 0, wx.ALIGN_CENTER_VERTICAL) tmphbox.Add((DV.border_padding/2,0)) tmphbox.Add(self.makeLabel(panel, d, launchdir=d)) tmpinnerhbox=wx.BoxSizer(wx.HORIZONTAL) tmpvbox.Add(tmpinnerhbox) tmpinnerhbox.Add((foldericon.GetWidth()+DV.border_padding,0)) tmpinnervbox=wx.BoxSizer(wx.VERTICAL) tmpinnerhbox.Add(tmpinnervbox,1) for f in files[d]: tmphbox2=wx.BoxSizer(wx.HORIZONTAL) tmpinnervbox.Add(tmphbox2) tmphbox2.Add(self.bindAndCursor(wx.StaticBitmap(panel, -1, DV.listicons.getRawBitmap(icons[d+f])), launchfile=d+f), 0, wx.ALIGN_CENTER_VERTICAL) tmphbox2.Add((DV.border_padding/2,0)) tmphbox2.Add(self.makeLabel(panel, f, launchfile=d+f)) mainvbox.Add((0,DV.border_padding)) else: Damnlog('There\'s no content, so we\'re not gonna build much.') mainvbox.Add(wx.StaticText(panel,-1,DV.l('No videos were processed.'))) mainvbox.Add((0,DV.border_padding)) mainvbox.Add((0,DV.border_padding)) # Again! okhbox=wx.BoxSizer(wx.HORIZONTAL) mainvbox.Add(okhbox,0,wx.ALIGN_RIGHT) okButton = wx.Button(panel,-1,DV.l('OK')) okhbox.Add(okButton) self.Bind(wx.EVT_BUTTON, self.onOK, okButton) Damnlog('Finished building done dialog UI, displaying it.') # Finished building UI self.SetClientSize(self.GetBestSize()) self.Center() Damnlog('Done dialog displayed and centered.')
2e4d33b2a8b84c7e2a1d15176545dae986a39d07 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/2e4d33b2a8b84c7e2a1d15176545dae986a39d07/DamnVid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 913, 16, 18166, 33, 8381, 16, 2774, 33, 7036, 4672, 463, 301, 82, 1330, 2668, 7387, 6176, 10890, 598, 1472, 913, 273, 2187, 1745, 11189, 31, 18166, 35, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 913, 16, 18166, 33, 8381, 16, 2774, 33, 7036, 4672, 463, 301, 82, 1330, 2668, 7387, 6176, 10890, 598, 1472, 913, 273, 2187, 1745, 11189, 31, 18166, 35, 2...
if op is operator.neg: return '-%s' % s[0] lop = ops[0] rop = ops[1]
rop = ops[0] if self._binary: lop = rop rop = ops[1]
def _repr_(self, simplify=True): """ TESTS: sage: a = (1-1/r)^(-1); a 1/(1 - 1/r) sage: a.derivative(r) -1/((1 - 1/r)^2*r^2)
b2c455b8e585ade22b0fb1919e933859d587da58 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/b2c455b8e585ade22b0fb1919e933859d587da58/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12715, 67, 12, 2890, 16, 16499, 33, 5510, 4672, 3536, 22130, 55, 30, 272, 410, 30, 279, 273, 261, 21, 17, 21, 19, 86, 13, 66, 19236, 21, 1769, 279, 404, 19, 12, 21, 300, 404, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12715, 67, 12, 2890, 16, 16499, 33, 5510, 4672, 3536, 22130, 55, 30, 272, 410, 30, 279, 273, 261, 21, 17, 21, 19, 86, 13, 66, 19236, 21, 1769, 279, 404, 19, 12, 21, 300, 404, ...
if arch.type == "x86" and nomigrate is not None and long(nomigrate) != 0:
if nomigrate is not None and long(nomigrate) != 0:
def _constructDomain(self): """Construct the domain.
100f5291a17e051801c8c27b83613c6eba497eae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6195/100f5291a17e051801c8c27b83613c6eba497eae/XendDomainInfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10062, 3748, 12, 2890, 4672, 3536, 7249, 326, 2461, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 389, 10062, 3748, 12, 2890, 4672, 3536, 7249, 326, 2461, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overflowok = True)
overflowok=True)
def test_format(self): testboth("%.1d", (1,), "1") testboth("%.*d", (sys.maxint,1), overflowok = True) # expect overflow testboth("%.100d", (1,), '00000000000000000000000000000000000000' '000000000000000000000000000000000000000000000000000000' '00000001', overflowok = True) testboth("%#.117x", (1,), '0x00000000000000000000000000000000000' '000000000000000000000000000000000000000000000000000000' '0000000000000000000000000001', overflowok = True) testboth("%#.118x", (1,), '0x00000000000000000000000000000000000' '000000000000000000000000000000000000000000000000000000' '00000000000000000000000000001', overflowok = True)
b3e97e9ec80c149f89ca3a9c29670efa0dca6803 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/b3e97e9ec80c149f89ca3a9c29670efa0dca6803/test_format.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2139, 12, 2890, 4672, 1842, 18237, 27188, 18, 21, 72, 3113, 261, 21, 16, 3631, 315, 21, 7923, 1842, 18237, 27188, 4509, 72, 3113, 261, 9499, 18, 1896, 474, 16, 21, 3631, 9391...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2139, 12, 2890, 4672, 1842, 18237, 27188, 18, 21, 72, 3113, 261, 21, 16, 3631, 315, 21, 7923, 1842, 18237, 27188, 4509, 72, 3113, 261, 9499, 18, 1896, 474, 16, 21, 3631, 9391...
meths = [":py:func:`%s`" % x for x in meths]
meths = [fixmeth(x) for x in meths]
def append_doc(fun, keyword, meths): if keyword == "feature": pass else: meths = [":py:func:`%s`" % x for x in meths] dc = ", ".join(meths) fun.__doc__ += '\n\t:%s: %s' % (keyword, dc)
37ed8fe750989e519512ed40c97a44a41c9bb2bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/37ed8fe750989e519512ed40c97a44a41c9bb2bb/conf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 67, 2434, 12, 12125, 16, 4932, 16, 7917, 87, 4672, 225, 309, 4932, 422, 315, 7238, 6877, 1342, 469, 30, 7917, 87, 273, 306, 904, 27305, 12, 92, 13, 364, 619, 316, 7917, 87, 65, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 67, 2434, 12, 12125, 16, 4932, 16, 7917, 87, 4672, 225, 309, 4932, 422, 315, 7238, 6877, 1342, 469, 30, 7917, 87, 273, 306, 904, 27305, 12, 92, 13, 364, 619, 316, 7917, 87, 65, ...
args : tuple
args : tuple
def expect(self, func=None, args=(), loc=0, lb=None, ub=None, conditional=False): """calculate expected value of a function with respect to the distribution for discrete distribution
8b3a4224a0eebc7cef8c46d42fde0301ea131ef1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/8b3a4224a0eebc7cef8c46d42fde0301ea131ef1/distributions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4489, 12, 2890, 16, 1326, 33, 7036, 16, 833, 33, 9334, 1515, 33, 20, 16, 7831, 33, 7036, 16, 13910, 33, 7036, 16, 11139, 33, 8381, 4672, 3536, 11162, 2665, 460, 434, 279, 445, 598, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4489, 12, 2890, 16, 1326, 33, 7036, 16, 833, 33, 9334, 1515, 33, 20, 16, 7831, 33, 7036, 16, 13910, 33, 7036, 16, 11139, 33, 8381, 4672, 3536, 11162, 2665, 460, 434, 279, 445, 598, 8...
shutil.copy(myfile[1], "./")
vetodict[myfile[0]]=myfile[1] shutil.copy( vetodict["h1vetofile"], "./h1veto.list" ) shutil.copy( vetodict["h2vetofile"], "./h2veto.list" ) shutil.copy( vetodict["l1vetofile"], "./l1veto.list" )
def symlinksafe( target, linkname ): """ Creates a link, does not nag about when it already exists """ try: os.symlink( target, linkname ) except OSError, (errno, strerror): if errno==17: print "WARNING: link %s already exist" % (linkname) else: raise
623611710246191401b40bd8d7ea90c97f95fae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/623611710246191401b40bd8d7ea90c97f95fae5/upperlimit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10563, 4626, 12, 1018, 16, 1692, 529, 262, 30, 3536, 10210, 279, 1692, 16, 1552, 486, 290, 346, 2973, 1347, 518, 1818, 1704, 3536, 775, 30, 1140, 18, 21278, 12, 1018, 16, 1692, 529, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10563, 4626, 12, 1018, 16, 1692, 529, 262, 30, 3536, 10210, 279, 1692, 16, 1552, 486, 290, 346, 2973, 1347, 518, 1818, 1704, 3536, 775, 30, 1140, 18, 21278, 12, 1018, 16, 1692, 529, 26...
return v.ordered(1)
return view.ordered(1)
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
8a26f1933d2876e464fe11a666ad363c83f287dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8a26f1933d2876e464fe11a666ad363c83f287dd/back_metakit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1945, 12, 2890, 4672, 9163, 4163, 326, 1560, 364, 279, 2923, 1659, 316, 326, 9512, 1966, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1945, 12, 2890, 4672, 9163, 4163, 326, 1560, 364, 279, 2923, 1659, 316, 326, 9512, 1966, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
force=False):
force=False, sysop=False):
def put(self, newtext, comment=None, watchArticle=None, minorEdit=True, force=False): """Save the page with the contents of the first argument as the text.
9855a1fc765982ea933f4bce604c637424cab899 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/9855a1fc765982ea933f4bce604c637424cab899/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 12, 2890, 16, 394, 955, 16, 2879, 33, 7036, 16, 4267, 7880, 33, 7036, 16, 8439, 4666, 33, 5510, 16, 2944, 33, 8381, 16, 2589, 556, 33, 8381, 4672, 3536, 4755, 326, 1363, 598, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 12, 2890, 16, 394, 955, 16, 2879, 33, 7036, 16, 4267, 7880, 33, 7036, 16, 8439, 4666, 33, 5510, 16, 2944, 33, 8381, 16, 2589, 556, 33, 8381, 4672, 3536, 4755, 326, 1363, 598, 3...
for storageElement in sortList(storageElements): res = self.__removeStorageDirectory(dir,storageElement)
for storageElement in sortList( storageElements ): res = self.__removeStorageDirectory( dir, storageElement )
def __cleanDirectory(self,dir): res = self.__verifyOperationPermission(dir) if not res['OK']: return res if not res['Value']: errStr = "ReplicaManager.__cleanDirectory: Write access not permitted for this credential." gLogger.error(errStr,dir) return S_ERROR(errStr) res = self.__getCatalogDirectoryContents([dir]) if not res['OK']: return res filesFound = res['Value'].keys() if filesFound: gLogger.info("Attempting to remove %d files from the catalog and storage" % len(filesFound)) res = self.removeFile(filesFound) if not res['OK']: return res for lfn,reason in res['Value']['Failed'].items(): gLogger.error("Failed to remove file found in the catalog","%s %s" % (lfn,reason)) if res['Value']['Failed']: return S_ERROR("Failed to remove all files found in the catalog") storageElements = gConfig.getValue('Resources/StorageElementGroups/Tier1_MC_M-DST',[]) # Have to add some additional storage elements because: # 1: CNAF has to use two different SE types # 2: CNAF has to use different namespace for different rentention storageElements.extend(['CNAF_MC-DST','CNAF-RAW']) failed = False for storageElement in sortList(storageElements): res = self.__removeStorageDirectory(dir,storageElement) if not res['OK']: failed = True if failed: return S_ERROR("Failed to clean storage directory at all SEs") return S_OK()
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, 1001, 6200, 2853, 12, 2890, 16, 1214, 4672, 400, 273, 365, 16186, 8705, 2988, 5041, 12, 1214, 13, 309, 486, 400, 3292, 3141, 3546, 30, 327, 400, 309, 486, 400, 3292, 620, 3546, 30, 393...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6200, 2853, 12, 2890, 16, 1214, 4672, 400, 273, 365, 16186, 8705, 2988, 5041, 12, 1214, 13, 309, 486, 400, 3292, 3141, 3546, 30, 327, 400, 309, 486, 400, 3292, 620, 3546, 30, 393...
content_type='application/octet-stream'
type='application/octet-stream'
def PUT(self, REQUEST, RESPONSE): """Create a new non-collection resource.""" self.dav__init(REQUEST, RESPONSE) type=REQUEST.get_header('content-type', None) body=REQUEST.get('BODY', '') name=self.__name__ if type is None: type, enc=mimetypes.guess_type(name) if type is None: if OFS.content_types.find_binary(body) >= 0: content_type='application/octet-stream' else: type=OFS.content_types.text_type(body) type=string.lower(type) from OFS.Image import Image, File if type in ('text/html', 'text/xml', 'text/plain'): self.__parent__.manage_addDTMLDocument(name, '', body) elif type[:6]=='image/': ob=Image(name, '', body, content_type=type) self.__parent__._setObject(name, ob) else: ob=File(name, '', body, content_type=type) self.__parent__._setObject(name, ob) RESPONSE.setStatus(201) RESPONSE.setBody('') return RESPONSE
79743a2892a5b1d854846283c84f9d8f867706fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/79743a2892a5b1d854846283c84f9d8f867706fd/NullResource.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11443, 12, 2890, 16, 12492, 16, 20645, 4672, 3536, 1684, 279, 394, 1661, 17, 5548, 1058, 12123, 365, 18, 20752, 972, 2738, 12, 5519, 16, 20645, 13, 618, 33, 5519, 18, 588, 67, 3374, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11443, 12, 2890, 16, 12492, 16, 20645, 4672, 3536, 1684, 279, 394, 1661, 17, 5548, 1058, 12123, 365, 18, 20752, 972, 2738, 12, 5519, 16, 20645, 13, 618, 33, 5519, 18, 588, 67, 3374, 26...
for i, d in enumerate(t.dims): if i != 0: self.write(': ') self.dispatch(d)
interleave(lambda: self.write(', '), self.dispatch, t.dims)
def _ExtSlice(self, t): for i, d in enumerate(t.dims): if i != 0: self.write(': ') self.dispatch(d)
370480032ecec8ec7718f276ca463670a69ead37 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/370480032ecec8ec7718f276ca463670a69ead37/unparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2482, 5959, 12, 2890, 16, 268, 4672, 364, 277, 16, 302, 316, 4241, 12, 88, 18, 8550, 4672, 309, 277, 480, 374, 30, 365, 18, 2626, 2668, 30, 8624, 365, 18, 10739, 12, 72, 13, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 2482, 5959, 12, 2890, 16, 268, 4672, 364, 277, 16, 302, 316, 4241, 12, 88, 18, 8550, 4672, 309, 277, 480, 374, 30, 365, 18, 2626, 2668, 30, 8624, 365, 18, 10739, 12, 72, 13, 2...
res = start_isrc.resolve(relative, base)
res = resolver.resolve(relative, base)
def shift_scheme_handler(uri, base=None): if base: uri = base+uri uri = uri[6:] return ''.join([ chr(ord(c)+1) for c in uri])
e94b1b8a021f867b7746a43d9d0cf735d5c5c8e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14078/e94b1b8a021f867b7746a43d9d0cf735d5c5c8e5/test_irihelpers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4654, 67, 9068, 67, 4176, 12, 1650, 16, 1026, 33, 7036, 4672, 309, 1026, 30, 2003, 273, 1026, 15, 1650, 2003, 273, 2003, 63, 26, 26894, 327, 875, 18, 5701, 3816, 4513, 12, 517, 12, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4654, 67, 9068, 67, 4176, 12, 1650, 16, 1026, 33, 7036, 4672, 309, 1026, 30, 2003, 273, 1026, 15, 1650, 2003, 273, 2003, 63, 26, 26894, 327, 875, 18, 5701, 3816, 4513, 12, 517, 12, 7...
if os.path.exists(srcDir):
projectName = srcDir[len(srcTop) + 1:] if projectName: reps = [ projectName ] else:
def pubUpdate(args): '''update Update projects installed in the workspace ''' global log log = LogFile(context.logname(),nolog) reps = args recurse = False if 'recurse' in args: recurse = True reps.remove('recurse') if len(reps) == 0: # We try to derive project names from the current directory whever # it is a subdirectory of buildTop or srcTop. cwd = os.path.realpath(os.getcwd()) buildTop = os.path.realpath(context.value('buildTop')) srcTop = os.path.realpath(context.value('srcTop')) srcDir = srcTop srcPrefix = os.path.commonprefix([ cwd,srcTop ]) buildPrefix = os.path.commonprefix([ cwd, buildTop ]) if srcPrefix == srcTop: srcDir = cwd elif buildPrefix == buildTop: srcDir = cwd.replace(buildTop,srcTop) if os.path.exists(srcDir): for repdir in findFiles(srcDir,'\.git'): reps += [ os.path.dirname(repdir.replace(srcTop + os.sep,'')) ] else: reps = [ context.cwdProject() ] if recurse: names, projects = validateControls(reps,force=True) else: update(reps,force=True)
4a9bbf3c5ea7429f402e63ad28ed48a40972ea00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/4a9bbf3c5ea7429f402e63ad28ed48a40972ea00/dws.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5634, 1891, 12, 1968, 4672, 9163, 2725, 1171, 2315, 10137, 5876, 316, 326, 6003, 9163, 2552, 613, 613, 273, 1827, 812, 12, 2472, 18, 1330, 529, 9334, 82, 3966, 13, 283, 1121, 273, 833, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5634, 1891, 12, 1968, 4672, 9163, 2725, 1171, 2315, 10137, 5876, 316, 326, 6003, 9163, 2552, 613, 613, 273, 1827, 812, 12, 2472, 18, 1330, 529, 9334, 82, 3966, 13, 283, 1121, 273, 833, ...
def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15, ):
def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15):
def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15,
9376c7db5895d2451fb358ccc8f545d1e5dc3f7a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8186/9376c7db5895d2451fb358ccc8f545d1e5dc3f7a/distribute_setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 67, 542, 30693, 12, 1177, 33, 5280, 67, 5757, 16, 4224, 67, 1969, 33, 5280, 67, 1785, 16, 358, 67, 1214, 33, 538, 18, 1397, 1214, 16, 4624, 33, 3600, 16, 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, 4224, 67, 542, 30693, 12, 1177, 33, 5280, 67, 5757, 16, 4224, 67, 1969, 33, 5280, 67, 1785, 16, 358, 67, 1214, 33, 538, 18, 1397, 1214, 16, 4624, 33, 3600, 16, 2, -100, -100, -100, ...
from pypy.translator.translator import Translator t = Translator(demo)
from pypy.translator.interactive import Translation t = Translation(demo)
def demo(): # Teach network XOR function pat = [ [[0,0], [0]], [[0,1], [1]], [[1,0], [1]], [[1,1], [0]] ] # create a network with two input, two hidden, and two output nodes n = NN(2, 3, 1) # train it with some patterns n.train(pat, 2000) # test it n.test(pat)
ed02c36023b464c29743382b96a179109e1976ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/ed02c36023b464c29743382b96a179109e1976ba/bpnn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21477, 13332, 468, 399, 13798, 2483, 28086, 445, 9670, 273, 306, 12167, 20, 16, 20, 6487, 306, 20, 65, 6487, 12167, 20, 16, 21, 6487, 306, 21, 65, 6487, 12167, 21, 16, 20, 6487, 306, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21477, 13332, 468, 399, 13798, 2483, 28086, 445, 9670, 273, 306, 12167, 20, 16, 20, 6487, 306, 20, 65, 6487, 12167, 20, 16, 21, 6487, 306, 21, 65, 6487, 12167, 21, 16, 20, 6487, 306, ...
errStr = "ReplicaManager.replicateAndRegister: LFN does not exist at supplied source SE."
errStr = "ReplicaManager.__initializeReplication: LFN does not exist at supplied source SE."
def __initializeReplication(self,lfn,destSE,): ########################################################### # Check that the destination storage element is sane and resolve its name destStorageElement = StorageElement(destSE) if not destStorageElement.isValid()['Value']: errStr = "ReplicaManager.replicateAndRegister: Failed to instantiate destination StorageElement." gLogger.error(errStr,destSE) return S_ERROR(errStr) destSE = storageElement.getStorageElementName()['Value'] ########################################################### # Get the LFN replicas from the file catalogue res = self.fileCatalogue.getReplicas(lfn) if not res['OK']: return res if not res['Value']['Successful'].has_key(lfn): errStr = "ReplicaManager.replicateAndRegister: Failed to get replicas for LFN." gLogger.error(errStr,"%s %s" % (lfn,res['Value']['Failed'][lfn])) return S_ERROR("%s %s" % (errStr,res['Value']['Failed'][lfn])) lfnReplicas = res['Value']['Successful'][lfn] ########################################################### # If the file catalogue size is zero fail the transfer res = self.fileCatalogue.getFileSize(lfn) if not res['OK']: return res if not res['Value']['Successful'].has_key(lfn): errStr = "ReplicaManager.replicateAndRegister: Failed to get size registered for LFN." gLogger.error(errStr,"%s %s" % (lfn,res['Value']['Failed'][lfn])) return S_ERROR("%s %s" % (errStr,res['Value']['Failed'][lfn])) catalogueSize = res['Value']['Successful'][lfn] if catalogueSize == 0: errStr = "ReplicaManager.replicateAndRegister: Registered file size is 0." gLogger.error(errStr,lfn) return S_ERROR(errStr) ########################################################### # Check whether the destination storage element is banned configStr = '/Resources/StorageElements/BannedTarget' bannedTargets = gConfig.getValue(configStr,[]) if destSE in bannedTargets: infoStr = "ReplicaManager.replicateAndRegister: Destination Storage Element is currently banned." gLogger.info(infoStr,destSE) return S_ERROR(infoStr) ########################################################### # Check whether the supplied source SE is sane configStr = '/Resources/StorageElements/BannedSource' bannedSources = gConfig.getValue(configStr,[]) if sourceSE: if not lfnReplicas.has_key(sourceSE): errStr = "ReplicaManager.replicateAndRegister: LFN does not exist at supplied source SE." gLogger.error(errStr,"%s %s" % (lfn,sourceSE)) return S_ERROR(errStr) elif sourceSE in bannedSources: infoStr = "ReplicaManager.replicateAndRegister: Supplied source Storage Element is currently banned." gLogger.info(infoStr,sourceSE) return S_ERROR(errStr) resDict = {'DestStorage':destStorageElement,'DestSE':destSE,'Replicas':lfnReplicas,'CatalogueSize':catalogueSize} return S_OK(resDict)
e8a6375e5f8805958dacbec0f1a4c6f0cfc1b690 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/e8a6375e5f8805958dacbec0f1a4c6f0cfc1b690/ReplicaManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11160, 8309, 12, 2890, 16, 80, 4293, 16, 10488, 1090, 16, 4672, 19709, 5516, 3228, 1189, 468, 2073, 716, 326, 2929, 2502, 930, 353, 30426, 471, 2245, 2097, 508, 1570, 3245, 1046, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11160, 8309, 12, 2890, 16, 80, 4293, 16, 10488, 1090, 16, 4672, 19709, 5516, 3228, 1189, 468, 2073, 716, 326, 2929, 2502, 930, 353, 30426, 471, 2245, 2097, 508, 1570, 3245, 1046, 2...
print "import sys"
print >> stream, "import sys"
def WriteClass(self, generator): generator.checkWriteCoClassBaseClass() doc = self.doc if generator.generate_type == GEN_DEMAND_CHILD: # Some special imports we must setup. referenced_items = [] for ref, flag in self.sources: referenced_items.append(ref) for ref, flag in self.interfaces: referenced_items.append(ref) print "import sys" for ref in referenced_items: print "__import__('%s.%s')" % (generator.base_mod_name, ref.python_name) print "%s = sys.modules['%s.%s'].%s" % (ref.python_name, generator.base_mod_name, ref.python_name, ref.python_name) try: progId = pythoncom.ProgIDFromCLSID(self.clsid) print "# This CoClass is known by the name '%s'" % (progId) except pythoncom.com_error: pass print 'class %s(CoClassBaseClass): # A CoClass' % (self.python_name) if doc and doc[1]: print '\t# ' + doc[1] print '\tCLSID = %r' % (self.clsid,) print '\tcoclass_sources = [' defItem = None for item, flag in self.sources: if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: defItem = item # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print '\t\t%s,' % (key) print '\t]' if defItem: if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print '\tdefault_source = %s' % (defName,) print '\tcoclass_interfaces = [' defItem = None for item, flag in self.interfaces: if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: # and dual: defItem = item # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print '\t\t%s,' % (key,) print '\t]' if defItem: if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print '\tdefault_interface = %s' % (defName,) self.bWritten = 1 print
cfd84d318292d699ca53899ee423b08bfb797445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/cfd84d318292d699ca53899ee423b08bfb797445/genpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 797, 12, 2890, 16, 4456, 4672, 4456, 18, 1893, 3067, 4249, 797, 2171, 797, 1435, 997, 273, 365, 18, 2434, 309, 4456, 18, 7163, 67, 723, 422, 611, 1157, 67, 1639, 11712, 67, 27043...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 797, 12, 2890, 16, 4456, 4672, 4456, 18, 1893, 3067, 4249, 797, 2171, 797, 1435, 997, 273, 365, 18, 2434, 309, 4456, 18, 7163, 67, 723, 422, 611, 1157, 67, 1639, 11712, 67, 27043...
Calling ``Digraph`` on a graph returns the original graph in which every edge is replaced by two different edges going toward opposite directions. In order to obtain more information about these degraph constructors, access the documentation as follows:: sage: digraphs.RandomDirectedGNP? Once you have defined the digraph you want, you can begin to work on it by using the almost 200 functions on graphs and digraphs in the Sage library ! If your digraph is named ``g``, you can list these functions as previously this way * Type in Sage : ``g.`` ( do not press "Enter", and do not forget the final "." ) * Hit "tab". As usual, you can get some information about what these functions do by typing (e.g. if you want to know about the ``diameter()`` method):: sage: g.diameter? If you have defined a digraph ``g`` having several connected components ( i.e. ``g.is_connected()`` returns False ), you can print each one of its
Calling ``Digraph`` on a graph returns the original graph in which every edge is replaced by two different edges going toward opposite directions. In order to obtain more information about these digraph constructors, access the documentation by typing ``digraphs.RandomDirectedGNP?``. Once you have defined the digraph you want, you can begin to work on it by using the almost 200 functions on graphs and digraphs in the Sage library! If your digraph is named ``g``, you can list these functions as previously this way * Within a Sage session, type ``g.`` (Do not press "Enter", and do not forget the final period "." ) * Hit "tab". As usual, you can get some information about what these functions do by typing (e.g. if you want to know about the ``diameter()`` method) ``g.diameter?``. If you have defined a digraph ``g`` having several connected components ( i.e. ``g.is_connected()`` returns False ), you can print each one of its
def min_spanning_tree(self, weight_function=lambda e: 1, algorithm='Kruskal', starting_vertex=None ): """ Returns the edges of a minimum spanning tree, if one exists, otherwise returns False. INPUT: - ``weight_function`` - A function that takes an edge and returns a numeric weight. Defaults to assigning each edge a weight of 1. - ``algorithm`` - Three variants of algorithms are implemented: 'Kruskal', 'Prim fringe', and 'Prim edge' (the last two are variants of Prim's algorithm). Defaults to 'Kruskal'. Currently, 'Prim fringe' ignores the labels on the edges. - ``starting_vertex`` - The vertex with which to start Prim's algorithm. OUTPUT: the edges of a minimum spanning tree. EXAMPLES:: sage: g=graphs.CompleteGraph(5) sage: len(g.min_spanning_tree()) 4 sage: weight = lambda e: 1/( (e[0]+1)*(e[1]+1) ) sage: g.min_spanning_tree(weight_function=weight) [(3, 4, None), (2, 4, None), (1, 4, None), (0, 4, None)] sage: g.min_spanning_tree(algorithm='Prim edge', starting_vertex=2, weight_function=weight) [(2, 4, None), (3, 4, None), (1, 3, None), (0, 4, None)] sage: g.min_spanning_tree(algorithm='Prim fringe', starting_vertex=2, weight_function=weight) [(4, 2), (3, 4), (1, 4), (0, 4)] """ if self.is_connected()==False: return False
ed981e55ab1e450a7a93415d1a6c2e8a67d3eaa9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ed981e55ab1e450a7a93415d1a6c2e8a67d3eaa9/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1131, 67, 1752, 10903, 67, 3413, 12, 2890, 16, 3119, 67, 915, 33, 14661, 425, 30, 404, 16, 4886, 2218, 47, 8010, 79, 287, 2187, 5023, 67, 15281, 33, 7036, 262, 30, 3536, 2860, 326, 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, 1131, 67, 1752, 10903, 67, 3413, 12, 2890, 16, 3119, 67, 915, 33, 14661, 425, 30, 404, 16, 4886, 2218, 47, 8010, 79, 287, 2187, 5023, 67, 15281, 33, 7036, 262, 30, 3536, 2860, 326, 5...
self.tp_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.ta_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.musicspeech_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.monostereo_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.artificialhead_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.compressed_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.staticpty_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
self.tp_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.ta_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.musicspeech_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.monostereo_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.artificialhead_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.compressed_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.staticpty_flag.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
def __set_properties(self): # begin wxGlade: rdsPanel.__set_properties self.frequency.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) self.station_name.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) self.program_type.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) self.program_information.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) self.tp_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.ta_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.musicspeech_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.monostereo_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.artificialhead_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.compressed_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.staticpty_flag.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) # 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, 542, 67, 4738, 12, 2890, 4672, 468, 2376, 7075, 21308, 2486, 30, 30393, 5537, 16186, 542, 67, 4738, 365, 18, 14092, 18, 694, 5711, 12, 27226, 18, 5711, 12, 2313, 16, 7075, 18, 52...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 67, 4738, 12, 2890, 4672, 468, 2376, 7075, 21308, 2486, 30, 30393, 5537, 16186, 542, 67, 4738, 365, 18, 14092, 18, 694, 5711, 12, 27226, 18, 5711, 12, 2313, 16, 7075, 18, 52...
filepath = os.path.join(env.ARCHIVE_OUTPUT_DIR, "eagle3d_"+version_to_filename(version)+".zip")
filepath = os.path.join(env.ARCHIVE_OUTPUT_DIR, "eagle3d_"+release_safename+".zip")
def release(self): quiet = config._get('quiet') version = config._get('version')
19b8707cde98af788d5e11f7d04282c581983f66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13644/19b8707cde98af788d5e11f7d04282c581983f66/eagle3d.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3992, 12, 2890, 4672, 10902, 273, 642, 6315, 588, 2668, 20380, 6134, 1177, 273, 642, 6315, 588, 2668, 1589, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3992, 12, 2890, 4672, 10902, 273, 642, 6315, 588, 2668, 20380, 6134, 1177, 273, 642, 6315, 588, 2668, 1589, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if (right is False or right is None):
import orm if (right is False or right is None or isinstance(right, orm.browse_null)):
def __leaf_to_sql(self, leaf, table): if leaf == self.__DUMMY_LEAF: return ('(1=1)', []) left, operator, right = leaf
b9dddd4279d4b0c881d076f67c710474e5d4f555 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/b9dddd4279d4b0c881d076f67c710474e5d4f555/expression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12070, 67, 869, 67, 4669, 12, 2890, 16, 7839, 16, 1014, 4672, 309, 7839, 422, 365, 16186, 40, 2799, 22114, 67, 900, 6799, 30, 327, 7707, 12, 21, 33, 21, 13, 2187, 5378, 13, 200...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12070, 67, 869, 67, 4669, 12, 2890, 16, 7839, 16, 1014, 4672, 309, 7839, 422, 365, 16186, 40, 2799, 22114, 67, 900, 6799, 30, 327, 7707, 12, 21, 33, 21, 13, 2187, 5378, 13, 200...
self.addFile(path, version)
self.addFile(path[6:], version)
def read(self, dataFile):
5c259165b6ac1e7d5127d3fa110b076cccfcc43c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/5c259165b6ac1e7d5127d3fa110b076cccfcc43c/trove.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 501, 812, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 501, 812, 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, ...
print " Detected type ",filetype
def general_restore(filename, filetype): print "general_restore : ", filename, " type ",filetype if filetype == None: filetype = filename.split('.')[-1] # Determine the file format by reading the first line file = open(filename, 'r') line = file.read(24) file.close(); filetype = "" if(line == "UGCompris draw 2 cPikle" or line == "UGCompris anim 2 cPikle"): filetype = 'image/gcompris+anim' elif(line == "<?xml version='1.0' enco"): filetype = 'image/svg+xml' print " Detected type ",filetype if (filetype in ['image/svg+xml+javascript','image/svg+xml']): svg_to_anim2(filename) return if (filetype in ['image/gcompris+anim','image/gcompris+draw']): file_to_anim2(filename) return print "Error File selector return unknown filetype :",'|' + filetype + '|', "!!!"
0f71000645566dbe734440e44a39b9a57c6972bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/0f71000645566dbe734440e44a39b9a57c6972bd/anim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7470, 67, 13991, 12, 3459, 16, 18902, 4672, 1172, 315, 12259, 67, 13991, 294, 3104, 1544, 16, 315, 618, 3104, 7540, 5872, 309, 18902, 422, 599, 30, 18902, 273, 1544, 18, 4939, 2668, 1093...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7470, 67, 13991, 12, 3459, 16, 18902, 4672, 1172, 315, 12259, 67, 13991, 294, 3104, 1544, 16, 315, 618, 3104, 7540, 5872, 309, 18902, 422, 599, 30, 18902, 273, 1544, 18, 4939, 2668, 1093...
@classmethod def to_clade_relation(cls, elem):
def clade_relation(self, elem):
def bc_getter(elem): return get_children_text(elem, 'bc')
5f38465441061de22d67bc9df2281f70d7ac37ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/5f38465441061de22d67bc9df2281f70d7ac37ce/PhyloXMLIO.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6533, 67, 11990, 12, 10037, 4672, 327, 336, 67, 5906, 67, 955, 12, 10037, 16, 296, 13459, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6533, 67, 11990, 12, 10037, 4672, 327, 336, 67, 5906, 67, 955, 12, 10037, 16, 296, 13459, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.doclist.DownloadDocument('non_existent_doc', path)
self.client.Export('non_existent_doc', path)
def testExportNonExistentDocument(self): path = './ned.txt' exception_raised = False try: self.doclist.DownloadDocument('non_existent_doc', path) except Exception, e: # expected exception_raised = True self.assert_(exception_raised) self.assert_(not os.path.exists(path))
dcc46816af19bac967f4b588353a3ee4514dd5d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/dcc46816af19bac967f4b588353a3ee4514dd5d2/service_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 6144, 3989, 4786, 319, 2519, 12, 2890, 4672, 589, 273, 12871, 11748, 18, 5830, 11, 1520, 67, 354, 5918, 273, 1083, 775, 30, 365, 18, 2625, 18, 6144, 2668, 5836, 67, 19041, 67, 24...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6144, 3989, 4786, 319, 2519, 12, 2890, 4672, 589, 273, 12871, 11748, 18, 5830, 11, 1520, 67, 354, 5918, 273, 1083, 775, 30, 365, 18, 2625, 18, 6144, 2668, 5836, 67, 19041, 67, 24...
while cseq <= last_cseq and method == last_method: request, src_addr = dlg.wait_msg_from(10)
call_id = last_call_id while cseq <= last_cseq and method == last_method and call_id == last_call_id: request, src_addr = dlg.wait_msg_from(30)
def test_func(test): pjsua = test.process[0] dlg = sip.Dialog("127.0.0.1", pjsua.inst_param.sip_port, local_port=srv_port, tcp=cfg_file.recvfrom_cfg.tcp) last_cseq = 0 last_method = "" for t in cfg_file.recvfrom_cfg.transaction: # Print transaction title if t.title != "": dlg.trace(t.title) # Run command and expect patterns for c in t.cmds: if c[0] and c[0] != "": pjsua.send(c[0]) if len(c)>1 and c[1] and c[1] != "": pjsua.expect(c[1]) # Wait for request if t.check_cseq: # Absorbs retransmissions cseq = 0 method = last_method while cseq <= last_cseq and method == last_method: request, src_addr = dlg.wait_msg_from(10) if request==None or request=="": raise TestError("Timeout waiting for request") method = request.split(" ", 1)[0] cseq_hval = sip.get_header(request, "CSeq") cseq_hval = cseq_hval.split(" ")[0] cseq = int(cseq_hval) last_cseq = cseq last_method = method else: request, src_addr = dlg.wait_msg_from(10) if request==None or request=="": raise TestError("Timeout waiting for request") # Check for include patterns for pat in t.include: if re.search(pat, request, re.M | re.I)==None: if t.title: tname = " in " + t.title + " transaction" else: tname = "" raise TestError("Pattern " + pat + " not found" + tname) # Check for exclude patterns for pat in t.exclude: if re.search(pat, request, re.M | re.I)!=None: if t.title: tname = " in " + t.title + " transaction" else: tname = "" raise TestError("Excluded pattern " + pat + " found" + tname) # Create response if t.resp_code!=0: response = dlg.create_response(request, t.resp_code, "Status reason") # Add headers to response for h in t.resp_hdr: response = response + h + "\r\n" # Add message body if required if t.body: response = response + t.body # Send response dlg.send_msg(response, src_addr) # Expect something to happen in pjsua if t.expect != "": pjsua.expect(t.expect) # Sync pjsua.sync_stdout()
100a380d2ad937011127ff124c3d220ce81e19b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8531/100a380d2ad937011127ff124c3d220ce81e19b5/mod_recvfrom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 644, 12, 3813, 4672, 293, 2924, 11886, 273, 1842, 18, 2567, 63, 20, 65, 25840, 273, 10341, 18, 6353, 2932, 14260, 18, 20, 18, 20, 18, 21, 3113, 293, 2924, 11886, 18, 8591, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 644, 12, 3813, 4672, 293, 2924, 11886, 273, 1842, 18, 2567, 63, 20, 65, 25840, 273, 10341, 18, 6353, 2932, 14260, 18, 20, 18, 20, 18, 21, 3113, 293, 2924, 11886, 18, 8591, ...
etree.SubElement(root, 'manifest:file-entry', attrib={
SubElement(root, 'manifest:file-entry', attrib={
def create_manifest(self): root = etree.Element('manifest:manifest', attrib=MANIFEST_NAMESPACE_DICT) doc = etree.ElementTree(root) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'application/vnd.oasis.opendocument.text', 'manifest:full-path': '/', }) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'text/xml', 'manifest:full-path': 'content.xml', }) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'text/xml', 'manifest:full-path': 'styles.xml', }) etree.SubElement(root, 'manifest:file-entry', attrib={ 'manifest:media-type': 'text/xml', 'manifest:full-path': 'meta.xml', }) s1 = etree.tostring(doc) doc = minidom.parseString(s1) s1 = doc.toprettyxml(' ') return s1
277ba1af817dc725b8179dbbf649a815fdff5939 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/277ba1af817dc725b8179dbbf649a815fdff5939/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 14357, 12, 2890, 4672, 1365, 273, 12031, 18, 1046, 2668, 14357, 30, 14357, 2187, 5885, 33, 9560, 30050, 67, 11368, 67, 31456, 13, 997, 273, 12031, 18, 1046, 2471, 12, 3085, 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, 752, 67, 14357, 12, 2890, 4672, 1365, 273, 12031, 18, 1046, 2668, 14357, 30, 14357, 2187, 5885, 33, 9560, 30050, 67, 11368, 67, 31456, 13, 997, 273, 12031, 18, 1046, 2471, 12, 3085, 13, ...
_in_subset = lambda subset, node: not subset or node in subset
def _inclusiveNamespacePrefixes(node, context, unsuppressedPrefixes): '''http://www.w3.org/TR/xml-exc-c14n/ InclusiveNamespaces PrefixList parameter, which lists namespace prefixes that are handled in the manner described by the Canonical XML Recommendation''' inclusive = [] if node.prefix: usedPrefixes = ['xmlns:%s' %node.prefix] else: usedPrefixes = ['xmlns'] for a in _attrs(node): if a.nodeName.startswith('xmlns') or not a.prefix: continue usedPrefixes.append('xmlns:%s' %a.prefix) for attr in context: n = attr.nodeName if n in unsuppressedPrefixes: inclusive.append(attr) elif n.startswith('xmlns:') and n[6:] in unsuppressedPrefixes: inclusive.append(attr) elif n.startswith('xmlns') and n[5:] in unsuppressedPrefixes: inclusive.append(attr) elif attr.nodeName in usedPrefixes: inclusive.append(attr) return inclusive _in_subset = lambda subset, node: subset is None or node in subset
def _utilized(n, node, other_attrs, unsuppressedPrefixes): '''_utilized(n, node, other_attrs, unsuppressedPrefixes) -> boolean Return true if that nodespace is utilized within the node''' if n.startswith('xmlns:'): n = n[6:] elif n.startswith('xmlns'): n = n[5:] if n == node.prefix or n in unsuppressedPrefixes: return 1 for attr in other_attrs: if n == attr.prefix: return 1 return 0
6df2d566784161a533c97fa1bd11ec1e27489fcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6df2d566784161a533c97fa1bd11ec1e27489fcb/c14n.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 4672, 9163, 67, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 13, 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, 389, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 4672, 9163, 67, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 13, 3...
raise CompressionError, "unsupported compression method"
raise CompressionError("unsupported compression method")
def _init_read_gz(self): """Initialize for reading a gzip compressed fileobj. """ self.cmp = self.zlib.decompressobj(-self.zlib.MAX_WBITS) self.dbuf = ""
9d576e732e0c14bd37ecb65d8001d6f596cc8566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/9d576e732e0c14bd37ecb65d8001d6f596cc8566/tarfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2738, 67, 896, 67, 9764, 12, 2890, 4672, 3536, 7520, 364, 6453, 279, 10331, 8968, 17041, 18, 3536, 365, 18, 9625, 273, 365, 18, 94, 2941, 18, 323, 14706, 2603, 19236, 2890, 18, 94...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2738, 67, 896, 67, 9764, 12, 2890, 4672, 3536, 7520, 364, 6453, 279, 10331, 8968, 17041, 18, 3536, 365, 18, 9625, 273, 365, 18, 94, 2941, 18, 323, 14706, 2603, 19236, 2890, 18, 94...
if n == node.prefix or n in unsuppressedPrefixes: return 1
if (n=="" and node.prefix in [" n == node.prefix or n in unsuppressedPrefixes: return 1
def _utilized(n, node, other_attrs, unsuppressedPrefixes): '''_utilized(n, node, other_attrs, unsuppressedPrefixes) -> boolean Return true if that nodespace is utilized within the node''' if n.startswith('xmlns:'): n = n[6:] elif n.startswith('xmlns'): n = n[5:] if n == node.prefix or n in unsuppressedPrefixes: return 1 for attr in other_attrs: if n == attr.prefix: return 1 return 0
6df2d566784161a533c97fa1bd11ec1e27489fcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6df2d566784161a533c97fa1bd11ec1e27489fcb/c14n.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 4672, 9163, 67, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 13, 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, 389, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 4672, 9163, 67, 1367, 1235, 12, 82, 16, 756, 16, 1308, 67, 7039, 16, 640, 2859, 10906, 11700, 13, 3...
def theor_beta_prod(alpha, n, x): norm = float((alpha + 1) ** n) for i in xrange(1, n): norm /= i return norm * x ** alpha * log(1.0 / x) ** (n - 1) for alpha in [0.2, 1, 2, 4]: for n in [2, 3, 5]: d = BetaDistr(alpha + 1, 1) for i in xrange(n - 1): d *= BetaDistr(alpha + 1, 1) figure() demo_distr(d, theoretical = partial(theor_beta_prod, alpha, n)) def theor_quot_power(alpha, x): return (x > 0) * (x <= 1) * (alpha + 1.0) / 2 * x**alpha + (x > 1) * (alpha + 1.0) / 2 * x**(-alpha-2) for alpha in [0.1, 1, 10]:
def theor_quot_power2(a, b, m_plus_1, x): m = m_plus_1 - 1 Ay = m_plus_1**2*x**m / ((b1*b2)**m_plus_1) for a1, b1, a2, b2, m in [(1.1, 4, 1, 3, 1)]: assert a1 >= 0 and a2 >= 0 assert b1 > b2 > a1 > a2 assert b1*b2 > b1*a2 > b2*a1 > a1*a2 m += 1 d1 = FunDistr(lambda x: (m+1)*x / (b1**m_plus_1 - a1**m_plus_1), breakPoints=[a1, b1])
def theor_beta_prod(alpha, n, x): norm = float((alpha + 1) ** n) for i in xrange(1, n): norm /= i return norm * x ** alpha * log(1.0 / x) ** (n - 1)
eda2304714f887cf55dfe1cce5c89f7827470dc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1985/eda2304714f887cf55dfe1cce5c89f7827470dc0/springer_book.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 326, 280, 67, 5758, 67, 17672, 12, 5429, 16, 290, 16, 619, 4672, 4651, 273, 1431, 12443, 5429, 397, 404, 13, 2826, 290, 13, 364, 277, 316, 12314, 12, 21, 16, 290, 4672, 4651, 9531, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 326, 280, 67, 5758, 67, 17672, 12, 5429, 16, 290, 16, 619, 4672, 4651, 273, 1431, 12443, 5429, 397, 404, 13, 2826, 290, 13, 364, 277, 316, 12314, 12, 21, 16, 290, 4672, 4651, 9531, 2...
logs = 1)
)
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
78d6aa9fe1f4c381e2dfd234dfd8813dc62bd488 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14755/78d6aa9fe1f4c381e2dfd234dfd8813dc62bd488/tasks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 3072, 12, 2890, 16, 5949, 28793, 2826, 9987, 4672, 309, 296, 3927, 3151, 67, 350, 11, 316, 5323, 30, 468, 10329, 10374, 732, 854, 19283, 2674, 628, 279, 4048, 5169, 2083, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 3072, 12, 2890, 16, 5949, 28793, 2826, 9987, 4672, 309, 296, 3927, 3151, 67, 350, 11, 316, 5323, 30, 468, 10329, 10374, 732, 854, 19283, 2674, 628, 279, 4048, 5169, 2083, ...
self._exper = exper
def _guess_elog(self): import glob, elogapi
3488c251fef83a64e82ed33a8707c234302690e4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5701/3488c251fef83a64e82ed33a8707c234302690e4/pype.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 20885, 67, 12970, 12, 2890, 4672, 1930, 4715, 16, 415, 717, 2425, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 20885, 67, 12970, 12, 2890, 4672, 1930, 4715, 16, 415, 717, 2425, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if pointingErr[0] >= 0:
if doPutProbeLabelOnRight: anchor = "w" textPos = stampInfo.decImCtrPos + (probeRadius, 0) else:
def showImage(self, imObj, forceCurr=None): """Display an image. Inputs: - imObj image to display - forceCurr force guide params to be set to current value? if None then automatically set based on the Current button """
747172d59452ec47b0547bcc7d2743b6afc3b16c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6236/747172d59452ec47b0547bcc7d2743b6afc3b16c/GuideWdg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 2040, 12, 2890, 16, 709, 2675, 16, 2944, 20143, 33, 7036, 4672, 3536, 4236, 392, 1316, 18, 24472, 30, 300, 709, 2675, 1316, 358, 2562, 300, 2944, 20143, 2944, 7343, 859, 358, 506, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 2040, 12, 2890, 16, 709, 2675, 16, 2944, 20143, 33, 7036, 4672, 3536, 4236, 392, 1316, 18, 24472, 30, 300, 709, 2675, 1316, 358, 2562, 300, 2944, 20143, 2944, 7343, 859, 358, 506, ...
def XXXtestDeletes(self):
def testDeletes(self):
def XXXtestDeletes(self): # Delete keys in all possible orders, checking each tree along # the way.
84ace7a5da26eedb2f0248f43425c3f18cc59bcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/84ace7a5da26eedb2f0248f43425c3f18cc59bcd/testBTrees.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 7551, 12, 2890, 4672, 468, 2504, 1311, 316, 777, 3323, 11077, 16, 6728, 1517, 2151, 7563, 468, 326, 4031, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 7551, 12, 2890, 4672, 468, 2504, 1311, 316, 777, 3323, 11077, 16, 6728, 1517, 2151, 7563, 468, 326, 4031, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
utils.system('./configure')
if 'CBUILD' in os.environ and 'CHOST' in os.environ: config_params = '--build=%s --host=%s' % (os.environ['CBUILD'], os.environ['CHOST']) else: config_params = '' utils.system('./configure %s' % config_params)
def setup(self, tarball='dbench-3.04.tar.gz'): tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir)
35d9eabfd762c30168dbaeda3cf45b6997f0d686 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/35d9eabfd762c30168dbaeda3cf45b6997f0d686/dbench.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 16, 29441, 2218, 1966, 7382, 17, 23, 18, 3028, 18, 11718, 18, 9764, 11, 4672, 29441, 273, 2990, 18, 318, 1458, 67, 718, 12, 2890, 18, 4376, 481, 16, 29441, 16, 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, 3875, 12, 2890, 16, 29441, 2218, 1966, 7382, 17, 23, 18, 3028, 18, 11718, 18, 9764, 11, 4672, 29441, 273, 2990, 18, 318, 1458, 67, 718, 12, 2890, 18, 4376, 481, 16, 29441, 16, 365, 1...
GtkDialog.__init__ (self)
gtk.Dialog.__init__ (self)
def __init__ (self, title, message, buttons = ["OK"], callback = None, modal = TRUE): """ Constructor. """ GtkDialog.__init__ (self) if mainWindow: self.set_transient_for (mainWindow) self.callback = callback self.set_title (title) first = None for name in buttons: button = GtkButton (name) button.set_flags (CAN_DEFAULT) button.connect ("clicked", self.clickedSignal, name) button.show() self.action_area.pack_start (button, TRUE, FALSE, 10) if not first: first = button hbox = GtkHBox() label = GtkLabel (message) label.set_justify (JUSTIFY_LEFT) label.set_line_wrap (TRUE) label.show() hbox.pack_start (label, TRUE, TRUE, 20) hbox.show() self.vbox.pack_start (hbox, TRUE, TRUE, 10) first.grab_default() self.set_modal (modal) self.show()
ec17e2ee5c945ddc11ff8bcc0cdc586ae535e76d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/ec17e2ee5c945ddc11ff8bcc0cdc586ae535e76d/driconf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 2077, 16, 883, 16, 9502, 273, 8247, 3141, 6, 6487, 1348, 273, 599, 16, 13010, 273, 5383, 4672, 3536, 11417, 18, 3536, 22718, 18, 6353, 16186, 2738, 972, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 2077, 16, 883, 16, 9502, 273, 8247, 3141, 6, 6487, 1348, 273, 599, 16, 13010, 273, 5383, 4672, 3536, 11417, 18, 3536, 22718, 18, 6353, 16186, 2738, 972, ...
pos = int(round(data[self.key]['deg'] * 16 / 360.0))
pos = int(round(data[self.key]['deg'] * 16 / 360.0)) if pos == 16: pos = 0
def render(self,data={}, context={}):
a9a74184366868ab193c62c135c3b07be5978bb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3323/a9a74184366868ab193c62c135c3b07be5978bb0/chart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 892, 28793, 819, 12938, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 892, 28793, 819, 12938, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
return self.canonical_name.get(user, '-')
value = self.canonical_name.get(user, '-') if isinstance(value, str): value = value.decode(self.default_encoding) return value
def getUserCanonicalName(self, user): return self.canonical_name.get(user, '-')
b131f408aa7da27063a573c7dcef94b39d0f1857 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/b131f408aa7da27063a573c7dcef94b39d0f1857/plugLDAPUserFolder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4735, 15512, 461, 12, 2890, 16, 729, 4672, 327, 365, 18, 18288, 67, 529, 18, 588, 12, 1355, 16, 4014, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4735, 15512, 461, 12, 2890, 16, 729, 4672, 327, 365, 18, 18288, 67, 529, 18, 588, 12, 1355, 16, 4014, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
elif aq_base(current_ob) is portal: break start_here = False current_ob = aq_inner(aq_parent(current_ob))
chain = None
def getChainFor(self, ob): """Monkey-patched by CMFPlacefulWorkflow to look for placeful workflow configurations. Goal: find a workflow chain in a policy Steps: 1. ask the object if it contains a policy 2. if it does, ask him for a chain 3. if there's no chain for the type the we loop on the parent 4. if the parent is the portal object or None we stop and we ask to portal_workflow Hint: If ob was a string, ask directly portal_worlfow\n\n""" cbt = self._chains_by_type if type(ob) == type(''): # We are not in an object, then we can only get default from portal_workflow portal_type = ob if cbt is not None: chain = cbt.get(portal_type, None) # Note that if chain is not in cbt or has a value of None, we use a default chain. if chain is None: chain = self.getDefaultChainFor(ob) if chain is None: # CMFCore default return () elif hasattr(aq_base(ob), '_getPortalTypeName'): portal_type = ob._getPortalTypeName() else: portal_type = None if portal_type is None or not ob: return () # Take some extra care when ob is a string is_policy_container = False objectids = [] try: objectids = ob.objectIds() except AttributeError, TypeError: pass if WorkflowPolicyConfig_id in objectids: is_policy_container = True # Inspired by implementation in CPSWorkflowTool.py of CPSCore 3.9.0 # Workflow needs to be determined by true containment not context # so we loop over the actual containers chain = None wfpolicyconfig = None current_ob = aq_inner(ob) start_here = True portal = aq_base(getToolByName(self, 'portal_url').getPortalObject()) while chain is None and current_ob is not None: if base_hasattr(current_ob, WorkflowPolicyConfig_id): wfpolicyconfig = getattr(current_ob, WorkflowPolicyConfig_id) chain = wfpolicyconfig.getPlacefulChainFor(portal_type, start_here=start_here) if chain is not None: return chain elif aq_base(current_ob) is portal: break start_here = False current_ob = aq_inner(aq_parent(current_ob)) # Note that if chain is not in cbt or has a value of None, we use a default chain. if cbt is not None: chain = cbt.get(portal_type, None) if chain is None: chain = self.getDefaultChainFor(ob) if chain is None: # CMFCore default return () return chain
2b483ef04777424d8050dd2846f158bac24fd51c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11955/2b483ef04777424d8050dd2846f158bac24fd51c/workflowtoolPatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30170, 1290, 12, 2890, 16, 3768, 4672, 3536, 11415, 856, 17, 2272, 329, 635, 385, 13542, 6029, 2706, 8484, 358, 2324, 364, 3166, 2706, 6095, 10459, 18, 225, 4220, 287, 30, 1104, 279, 609...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30170, 1290, 12, 2890, 16, 3768, 4672, 3536, 11415, 856, 17, 2272, 329, 635, 385, 13542, 6029, 2706, 8484, 358, 2324, 364, 3166, 2706, 6095, 10459, 18, 225, 4220, 287, 30, 1104, 279, 609...
name, master_addrinfo, db_file = self._do_parse()
name, rrclass, master_addrinfo, db_file = self._do_parse()
def test_parse_cmd_params(self): name, master_addrinfo, db_file = self._do_parse() self.assertEqual(master_addrinfo[4][1], int(TEST_MASTER_PORT)) self.assertEqual(name, TEST_ZONE_NAME) self.assertEqual(master_addrinfo[4][0], TEST_MASTER_IPV4_ADDRESS) self.assertEqual(db_file, TEST_DB_FILE)
0cfe69f9b12b062289babb7733706bf1a507a0a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6792/0cfe69f9b12b062289babb7733706bf1a507a0a0/xfrin_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2670, 67, 4172, 67, 2010, 12, 2890, 4672, 508, 16, 8354, 1106, 16, 4171, 67, 4793, 1376, 16, 1319, 67, 768, 273, 365, 6315, 2896, 67, 2670, 1435, 365, 18, 11231, 5812, 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, 1842, 67, 2670, 67, 4172, 67, 2010, 12, 2890, 4672, 508, 16, 8354, 1106, 16, 4171, 67, 4793, 1376, 16, 1319, 67, 768, 273, 365, 6315, 2896, 67, 2670, 1435, 365, 18, 11231, 5812, 12, ...
sage: print L.is_empty_row(0)
sage: L.is_empty_row(0)
def is_empty_row(self, r): """ Checks if row r of the partial latin square self is empty.
9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 5531, 67, 492, 12, 2890, 16, 436, 4672, 3536, 13074, 309, 1027, 436, 434, 326, 4702, 30486, 8576, 365, 353, 1008, 18, 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, 353, 67, 5531, 67, 492, 12, 2890, 16, 436, 4672, 3536, 13074, 309, 1027, 436, 434, 326, 4702, 30486, 8576, 365, 353, 1008, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
note.setText(compress(note.getText()))
note.setText(compress(note.getText().encode('utf-8')))
def saveNote(self,note):
62a0f24bf5f186dba5f11a3f04a472552e754f85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2701/62a0f24bf5f186dba5f11a3f04a472552e754f85/notes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 8067, 12, 2890, 16, 7652, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 8067, 12, 2890, 16, 7652, 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, -10...
output.write(" now: %s\n" % (self.eval_nuninst(nuninst_new)))
output.write(" now: %s\n" % (self.eval_nuninst(nuninst)))
def iter_packages(self, packages, output): extra = [] nuninst_comp = self.get_nuninst()
fa6c1b506f7548b5fdf29486ef79b23c7680b1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/fa6c1b506f7548b5fdf29486ef79b23c7680b1a2/britney.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 67, 10308, 12, 2890, 16, 5907, 16, 876, 4672, 2870, 273, 5378, 290, 318, 8591, 67, 2919, 273, 365, 18, 588, 67, 82, 318, 8591, 1435, 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, 1400, 67, 10308, 12, 2890, 16, 5907, 16, 876, 4672, 2870, 273, 5378, 290, 318, 8591, 67, 2919, 273, 365, 18, 588, 67, 82, 318, 8591, 1435, 2, -100, -100, -100, -100, -100, -100, -100, ...
except: print 'Unable to found the nodes: %s'%value pass
except Exception, e: print e try: self[str(id(key))].add_name(remain, value) except Exception, e: print 'Unable to found the nodes: %s'%value print e pass
def add_name(self, name, value): """ Add a value in the structure with the key name_tuple """
5274dc62ab40cf4a4bcd865a88ed22e26d93b9c9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11338/5274dc62ab40cf4a4bcd865a88ed22e26d93b9c9/pkgmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 529, 12, 2890, 16, 508, 16, 460, 4672, 3536, 1436, 279, 460, 316, 326, 3695, 598, 326, 498, 508, 67, 8052, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 529, 12, 2890, 16, 508, 16, 460, 4672, 3536, 1436, 279, 460, 316, 326, 3695, 598, 326, 498, 508, 67, 8052, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
path = os.path.dirname(lfn)
path = os.path.dirname( lfn )
def put(self,lfn,file,diracSE,path=None): """ Put a local file to a Storage Element
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, 1378, 12, 2890, 16, 80, 4293, 16, 768, 16, 3211, 8836, 1090, 16, 803, 33, 7036, 4672, 3536, 4399, 279, 1191, 585, 358, 279, 5235, 3010, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 12, 2890, 16, 80, 4293, 16, 768, 16, 3211, 8836, 1090, 16, 803, 33, 7036, 4672, 3536, 4399, 279, 1191, 585, 358, 279, 5235, 3010, 2, -100, -100, -100, -100, -100, -100, -100, -10...
self.version = version self.catapultPath = catapultPath self.buildFlavor = self.platform + '-VC-' + self.configuration self.buildPath = os.path.join('derived', self.buildFlavor) self.installPath = os.path.join(self.buildPath, 'install') self.sourcePath = 'src' self.codecPath = 'Contrib\\codec\\Win32' self.packageWindowsPath = 'build\\package-windows' self.packagePath = os.path.join(self.buildPath, 'package-windows') self.makeInstallPath = os.path.join(self.packagePath, 'install') self.installerFileName = 'openmsx-debugger-' + version + '-VC-' + self.architecture
print 'Generating ' + zipFilePath zip = zipfile.ZipFile(zipFilePath, 'w') AddFile(zip, os.path.join(info.installPath, 'openmsx-debugger.pdb'), 'openmsx-debugger.pdb') zip.close()
def __init__(self, platform, configuration, version, catapultPath): self.platform = platform.lower() if self.platform == 'win32': self.architecture = 'x86' self.platform = 'Win32' self.win64 = False elif self.platform == 'x64': self.architecture = 'x64' self.platform = 'x64' self.win64 = True else: raise ValueError, 'Wrong platform: ' + platform self.configuration = configuration.lower() if self.configuration == 'release': self.configuration = 'Release' self.catapultConfiguration = 'Unicode Release' elif self.configuration == 'Developer': self.configuration = 'Developer' self.catapultConfiguration = 'Unicode Debug' elif self.configuration == 'Debug': self.configuration = 'Debug' self.catapultConfiguration = 'Unicode Debug' else: raise ValueError, 'Wrong configuration: ' + architecture
7f3312f1643157a93dee00ef14734ec6d030fbd5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3612/7f3312f1643157a93dee00ef14734ec6d030fbd5/packagezip.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4072, 16, 1664, 16, 1177, 16, 276, 396, 84, 406, 743, 4672, 225, 365, 18, 9898, 273, 4072, 18, 8167, 1435, 309, 365, 18, 9898, 422, 296, 8082, 1578, 42...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4072, 16, 1664, 16, 1177, 16, 276, 396, 84, 406, 743, 4672, 225, 365, 18, 9898, 273, 4072, 18, 8167, 1435, 309, 365, 18, 9898, 422, 296, 8082, 1578, 42...
eventlet.sleep(.5)
evt.wait()
def server(): # accept the connection in another greenlet sock, addr = listener.accept()
017d7871a7559eeb90cb911e57dd5974ec41f4ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10078/017d7871a7559eeb90cb911e57dd5974ec41f4ed/greenio_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1438, 13332, 468, 2791, 326, 1459, 316, 4042, 10004, 1810, 7313, 16, 3091, 273, 2991, 18, 9436, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1438, 13332, 468, 2791, 326, 1459, 316, 4042, 10004, 1810, 7313, 16, 3091, 273, 2991, 18, 9436, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if jobAttributes is None: jobAttributes = {}
def loadTask( self, taskId, jobAttributes=None ) : """ retrieve task information from db using task id and defined jobAttributes """
b0987f7106dca9822b75a8daae54ea6eedd4a1d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/b0987f7106dca9822b75a8daae54ea6eedd4a1d0/BossLiteAPI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2174, 12, 365, 16, 15321, 16, 1719, 2498, 33, 7036, 262, 294, 3536, 4614, 1562, 1779, 628, 1319, 1450, 1562, 612, 471, 2553, 1719, 2498, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2174, 12, 365, 16, 15321, 16, 1719, 2498, 33, 7036, 262, 294, 3536, 4614, 1562, 1779, 628, 1319, 1450, 1562, 612, 471, 2553, 1719, 2498, 3536, 2, -100, -100, -100, -100, -100, -100...
gc.collect()
test_support.gc_collect()
def __getattr__(self, name): if name in ("spam", "foo", "bar"): return "hello" raise AttributeError, name
21f6aac633a78271e762d6cd4b709e6a91d0c42a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/21f6aac633a78271e762d6cd4b709e6a91d0c42a/test_descr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 508, 4672, 309, 508, 316, 7566, 1752, 301, 3113, 315, 11351, 3113, 315, 3215, 6, 4672, 327, 315, 23711, 6, 1002, 6394, 16, 508, 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, 1001, 588, 1747, 972, 12, 2890, 16, 508, 4672, 309, 508, 316, 7566, 1752, 301, 3113, 315, 11351, 3113, 315, 3215, 6, 4672, 327, 315, 23711, 6, 1002, 6394, 16, 508, 2, -100, -100, -100,...
def dump(self, file_name, page_size=10, vtimeout=10, sep='\n'):
def dump_(self, file_name, page_size=10, vtimeout=10, sep='\n'):
def dump(self, file_name, page_size=10, vtimeout=10, sep='\n'): """Utility function to dump the messages in a queue to a file NOTE: Page size must be < 10 else SQS errors""" fp = open(file_name, 'wb') n = 0 l = self.get_messages(page_size, vtimeout) while l: for m in l: fp.write(m.get_body()) if sep: fp.write(sep) n += 1 l = self.get_messages(page_size, vtimeout) fp.close() return n
2499569215bd3df216e2970c974e4a60b732af0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/2499569215bd3df216e2970c974e4a60b732af0d/queue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 12, 2890, 16, 585, 67, 529, 16, 1363, 67, 1467, 33, 2163, 16, 331, 4538, 33, 2163, 16, 5478, 2218, 64, 82, 11, 4672, 3536, 6497, 445, 358, 4657, 326, 2743, 316, 279, 2389, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 12, 2890, 16, 585, 67, 529, 16, 1363, 67, 1467, 33, 2163, 16, 331, 4538, 33, 2163, 16, 5478, 2218, 64, 82, 11, 4672, 3536, 6497, 445, 358, 4657, 326, 2743, 316, 279, 2389, ...
'rlineto' : 'rlineto'}[c]
'rlineto': 'rlineto'}[c]
def potrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x, off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '0 setgray\n': ls = ls[1:] if ls == []: return (bbox, '') ls = ls[1:] commands = [] while ls and ls[0] <> 'grestore\n': l = ls[0] ls = ls[1:] if l == 'fill\n': continue toks = string.split (l) if len(toks) < 1: continue cmd= toks[-1] args = map (lambda m, s=inv_scale : s * string.atof (m), toks[:-1]) args = zip_to_pairs (args) commands.append ((cmd,args)) # t1asm seems to fuck up when using sbw. Oh well. t1_outline = ' %d %d hsbw\n' % (- off_x, tfm_wid) bbox = (10000,10000,-10000,-10000) # Type1 fonts have relative coordinates (doubly relative for # rrcurveto), so must convert moveto and rcurveto. z = (0.0, size_y - off_y - 1.0) nc = [] for (c, args) in commands: args = map (lambda x: (x[0] * (1.0 / potrace_scale), x[1] * (1.0/potrace_scale)), args) if c == 'moveto': args = [(args[0][0]-z[0], args[0][1] - z[1])] zs = [] for a in args: lz= (z[0] + a[0], z[1] + a[1]) bbox = update_bbox_with_point (bbox, lz) zs.append (lz) if round_to_int: last_discr_z = (int (round (z[0])), int (round (z[1]))) else : last_discr_z = (z[0], z[1]) args = [] for a in zs: if round_to_int: a = (int (round (a[0])), int (round (a[1]))) else : a = (a[0], a[1]) args.append ( (a[0] - last_discr_z[0], a[1] - last_discr_z[1])) last_discr_z = a if zs: z = zs[-1] c = { 'rcurveto': 'rrcurveto', 'moveto': 'rmoveto', 'closepath': 'closepath', 'rlineto' : 'rlineto'}[c] if c == 'rmoveto': t1_outline += ' closepath ' if round_to_int: args = map (lambda x: '%d' % int (round (x)), unzip_pairs (args)) else : args = map (lambda x: '%d %d div' % (int (round (x * potrace_scale/inv_scale)), int( round (potrace_scale/inv_scale))), unzip_pairs (args)) t1_outline = t1_outline + ' %s %s\n' % (string.join (args),c) t1_outline = t1_outline + ' endchar ' t1_outline = '{\n %s } |- \n' % t1_outline return (bbox, t1_outline)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8275, 5129, 67, 803, 67, 869, 67, 723, 21, 67, 4473, 261, 270, 67, 768, 16, 9389, 67, 9597, 16, 3253, 81, 67, 30902, 4672, 2198, 67, 5864, 273, 4336, 18, 20, 19, 4527, 82, 1480, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8275, 5129, 67, 803, 67, 869, 67, 723, 21, 67, 4473, 261, 270, 67, 768, 16, 9389, 67, 9597, 16, 3253, 81, 67, 30902, 4672, 2198, 67, 5864, 273, 4336, 18, 20, 19, 4527, 82, 1480, 22...
assert value == lastWidgetValue, "widget's value doesn't match the value when the script was recorded"
assert value == lastWidgetValue, ( "widget's value, \"" + str(value) + "\", doesn't match the value when the script was recorded: \"" + str (lastWidgetValue) + '"' )
def NameToWidget (name): """ Given a name, returns the corresponding widget. """ sentTo = None if type (name) is str: if name == "MainFrame": sentTo = application.mainFrame elif name == "__FocusWindow__": sentTo = wx.Window_FindFocus() else: sentTo = Block.findBlockByName (name) if sentTo is not None: sentTo = sentTo.widget if isinstance (sentTo, wx.grid.Grid): sentTo = sentTo.GetGridWindow() elif isinstance (sentTo, AETypeOverTextCtrl): firstChild = sentTo.GetChildren()[0] if isinstance (firstChild, wx.TextCtrl): sentTo = firstChild else: name = stringToId [name] if sentTo is None: sentTo = wx.FindWindowById (name) return sentTo
b7f6dce76fe65904b94b3e4da5e396211189caca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/b7f6dce76fe65904b94b3e4da5e396211189caca/script_lib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1770, 774, 4609, 261, 529, 4672, 3536, 16803, 279, 508, 16, 1135, 326, 4656, 3604, 18, 3536, 3271, 774, 273, 599, 309, 618, 261, 529, 13, 353, 609, 30, 309, 508, 422, 315, 6376, 3219, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1770, 774, 4609, 261, 529, 4672, 3536, 16803, 279, 508, 16, 1135, 326, 4656, 3604, 18, 3536, 3271, 774, 273, 599, 309, 618, 261, 529, 13, 353, 609, 30, 309, 508, 422, 315, 6376, 3219, ...
print "warning: specified build_dir '%s' does not exist or is " \
print "warning: specified build_dir '%s' does not exist " \
def configure_build_dir(build_dir=None): # make sure build_dir exists and is writable if build_dir and (not os.path.exists(build_dir) or not os.access(build_dir,os.W_OK)): print "warning: specified build_dir '%s' does not exist or is " \ "or is not writable. Trying default locations" % build_dir build_dir = None if build_dir is None: #default to building in the home directory of the given module. build_dir = os.curdir # if it doesn't work use the current directory. This should always # be writable. if not os.access(build_dir,os.W_OK): print "warning:, neither the module's directory nor the "\ "current directory are writable. Using the temporary"\ "directory." build_dir = tempfile.gettempdir() # final check that that directories are writable. if not os.access(build_dir,os.W_OK): msg = "The build directory wasn't writable. Check" \ " this location: '%s'" % build_dir raise ValueError, msg return os.path.abspath(build_dir)
74944fabc1dcaf0a42418029366eae8af23316bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/74944fabc1dcaf0a42418029366eae8af23316bc/build_tools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 67, 3510, 67, 1214, 12, 3510, 67, 1214, 33, 7036, 4672, 468, 1221, 3071, 1361, 67, 1214, 1704, 471, 353, 9691, 309, 1361, 67, 1214, 471, 261, 902, 1140, 18, 803, 18, 1808, 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, 5068, 67, 3510, 67, 1214, 12, 3510, 67, 1214, 33, 7036, 4672, 468, 1221, 3071, 1361, 67, 1214, 1704, 471, 353, 9691, 309, 1361, 67, 1214, 471, 261, 902, 1140, 18, 803, 18, 1808, 12, ...
return is_manager
return is_manager
def transcoding_rights(self): mtool = getToolByName(self.context, "portal_membership") member = mtool.getAuthenticatedMember() mb_id = member.getUserName() is_manager = 'Manager' in member.getRoles() is_owner = mb_id in self.context.users_with_local_role('Owner')
a9a1ab96b8603a35c1b38d3b3c87bb1133c2f4a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12334/a9a1ab96b8603a35c1b38d3b3c87bb1133c2f4a3/video.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 906, 2014, 67, 23700, 12, 2890, 4672, 312, 6738, 225, 273, 336, 6364, 5911, 12, 2890, 18, 2472, 16, 315, 24386, 67, 19679, 7923, 3140, 273, 312, 6738, 18, 588, 15606, 4419, 1435, 4903, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 906, 2014, 67, 23700, 12, 2890, 4672, 312, 6738, 225, 273, 336, 6364, 5911, 12, 2890, 18, 2472, 16, 315, 24386, 67, 19679, 7923, 3140, 273, 312, 6738, 18, 588, 15606, 4419, 1435, 4903, ...
def E_0_t(x_r, x_r_prime, w_n_1, d_h, d_prev):
def E_0_t(x_r, x_r_prime, w_n_1, candidate, d_prev):
def E_0_t(x_r, x_r_prime, w_n_1, d_h, d_prev): """E_0_t - Temporal smoothness (equation 9) x_r: a rig site occlusion: o_n,n-1 binary matrix. 1 indicates data that that point in the frame n does not exist in the frame n-1. 0 indicates no discontinuity w_n_1: w_n-1 continuous matrix. 1 indicates data available, 0 indicates data missing. in the rig area w(x_r) = 0, i.e. this is the "not-rig" matrix d_h: d^h_n,n-1 vector matrix estimating the motion of the hidden area d_prev: d_n-1,n-2 vector matrix with the motion mapping from frame n-1 to frame n-2 """ temp = (1. / SIGMA_V ** 2.) * \ w_n_1[x_r_prime] * \ linalg.norm(d_h[x_r] - d_prev[x_r_prime]) ** 2. return temp
741a3e319c3cb092bf112078d20fa7d697cd6aed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1656/741a3e319c3cb092bf112078d20fa7d697cd6aed/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 512, 67, 20, 67, 88, 12, 92, 67, 86, 16, 619, 67, 86, 67, 16382, 16, 341, 67, 82, 67, 21, 16, 5500, 16, 302, 67, 10001, 4672, 3536, 41, 67, 20, 67, 88, 300, 15793, 11957, 4496, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 512, 67, 20, 67, 88, 12, 92, 67, 86, 16, 619, 67, 86, 67, 16382, 16, 341, 67, 82, 67, 21, 16, 5500, 16, 302, 67, 10001, 4672, 3536, 41, 67, 20, 67, 88, 300, 15793, 11957, 4496, ...
elif f[-8:] == "-install":
elif f[-8:] == "_install":
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
3bd8d0fb9c153552cd2593ecdeb80023b7776930 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3bd8d0fb9c153552cd2593ecdeb80023b7776930/buildpkg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 3805, 12, 2890, 4672, 315, 986, 678, 16312, 19, 1994, 4667, 19, 13211, 1390, 16, 263, 80, 17995, 9907, 471, 8873, 1199, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 3805, 12, 2890, 4672, 315, 986, 678, 16312, 19, 1994, 4667, 19, 13211, 1390, 16, 263, 80, 17995, 9907, 471, 8873, 1199, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100...
unquote(password)))
unquote(password))).strip()
def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) if ':' in user_pass: user, password = user_pass.split(':', 1) user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))) req.add_header('Proxy-authorization', 'Basic ' + user_pass) host = unquote(host) req.set_proxy(host, type) if orig_type == type: # let other handlers take care of it # XXX this only makes sense if the proxy is before the # other handlers return None else: # need to start over, because the other handlers don't # grok the proxy's URL type return self.parent.open(req)
a5a2088dd7ea5f4434a4266995b194da91b28b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a5a2088dd7ea5f4434a4266995b194da91b28b77/urllib2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2889, 67, 3190, 12, 2890, 16, 1111, 16, 2889, 16, 618, 4672, 1647, 67, 723, 273, 1111, 18, 588, 67, 723, 1435, 618, 16, 436, 67, 723, 273, 1416, 723, 12, 5656, 13, 1479, 16, 11329, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2889, 67, 3190, 12, 2890, 16, 1111, 16, 2889, 16, 618, 4672, 1647, 67, 723, 273, 1111, 18, 588, 67, 723, 1435, 618, 16, 436, 67, 723, 273, 1416, 723, 12, 5656, 13, 1479, 16, 11329, ...
self.sage._expect.expect(self.sage._prompt, timeout=timeout)
e.expect(self.sage._prompt, timeout=timeout)
def stop(self): """ Stops the current worker and resets it's internal state.
89c6445a82ab743d68a2da94350f6632099882be /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/89c6445a82ab743d68a2da94350f6632099882be/dsage_worker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2132, 12, 2890, 4672, 3536, 934, 4473, 326, 783, 4322, 471, 20063, 518, 1807, 2713, 919, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2132, 12, 2890, 4672, 3536, 934, 4473, 326, 783, 4322, 471, 20063, 518, 1807, 2713, 919, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings. Given a list of pairs (string, charset), return a MIME-encoded string suitable for use in a header field. Each pair may have different charsets and/or encodings, and the resulting header will accurately reflect each setting. Each encoding can be email.Utils.QP (quoted-printable, for ASCII-like character sets like iso-8859-1), email.Utils.BASE64 (Base64, for non-ASCII like character sets like KOI8-R and iso-2022-jp), or None (no encoding). Each pair will be represented on a separate line; the resulting string will be in the format: "=?charset1?q?Mar=EDa_Gonz=E1lez_Alonso?=\n =?charset2?b?SvxyZ2VuIEL2aW5n?=" """
def _encode_chunks(self, newchunks):
def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings.
34ce2bfa48747b0a7f527c61ad82dcfa08c73636 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/34ce2bfa48747b0a7f527c61ad82dcfa08c73636/Header.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3015, 67, 14691, 12, 2890, 4672, 3536, 18178, 17, 3015, 279, 1446, 598, 4906, 3775, 1149, 4424, 471, 19, 280, 24118, 18, 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, 0, 0, 0, 0, 0, 0, 0, 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, 3015, 67, 14691, 12, 2890, 4672, 3536, 18178, 17, 3015, 279, 1446, 598, 4906, 3775, 1149, 4424, 471, 19, 280, 24118, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
for lib in module.LibraryClasses.values(): if lib not in platform.Libraries: platform.Libraries.append(lib)
stack = [module] while len(stack) > 0: m = self.Build[arch].ModuleDatabase[stack.pop()] if m != module: platform.Libraries.append(m) for lib in m.LibraryClasses.values(): if lib not in platform.Libraries: platform.Libraries.append(lib) stack.append(lib)
def __init__(self, ActivePlatform = None): self.Workspace = EdkIIWorkspace() self.PrintRunTime = True self.PlatformBuild = True self.TargetTxt = TargetTxtClassObject() self.ToolDef = ToolDefClassObject()
a8de183b919aec2d70ecd7a51ec655ba274386e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/a8de183b919aec2d70ecd7a51ec655ba274386e0/EdkIIWorkspaceBuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8857, 8201, 273, 599, 4672, 365, 18, 8241, 9079, 273, 512, 2883, 6954, 8241, 1435, 365, 18, 5108, 1997, 950, 5411, 273, 1053, 365, 18, 8201, 3116, 6647, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8857, 8201, 273, 599, 4672, 365, 18, 8241, 9079, 273, 512, 2883, 6954, 8241, 1435, 365, 18, 5108, 1997, 950, 5411, 273, 1053, 365, 18, 8201, 3116, 6647, ...
module_elts.insert(-2, 'raw')
module_elts.insert(-1, 'raw')
def modulePathData (self, module): # file system path to where the bindings are written # module path from which the bindings are normally imported # file object into which bindings are written module_path = None if isinstance(module, NamespaceModule): ns = module.namespace() ns.validateComponentModel() module_path = ns.modulePath() if (module_path is None) or ns.isLoadedNamespace() or (ns.isBuiltinNamespace() and not self.allowBuiltinGeneration()): return ('/dev/null', None, None) module_elts = module_path.split('.') import_file_path = self.__directoryForModulePath(module_elts) if self.writeForCustomization(): module_elts.insert(-2, 'raw') if self.writeForCustomization() and (not os.path.exists(import_file_path)): raw_module_path = '.'.join(module_elts) file(import_file_path, 'w').write("from %s import *\n" % (raw_module_path,)) binding_file_path = self.__directoryForModulePath(module_elts) try: binding_file = pyxb.utils.utility.OpenOrCreate(binding_file_path, tag=module.moduleUID()) except OSError, e: if errno.EEXIST == e.errno: raise pyxb.BindingGenerationError('Target file %s for namespace %s bindings exists with other content' % (binding_file_path, ns)) elif isinstance(module, NamespaceGroupModule): module_elts = [] if self.modulePrefix(): module_elts.extend(self.modulePrefix().split('.')) in_use = set() while True: module_elts.append(pyxb.utils.utility.PrepareIdentifier('nsgroup', in_use, protected=True)) try: binding_file_path = self.__directoryForModulePath(module_elts) print 'Attempting group at %s' % (binding_file_path,) binding_file = pyxb.utils.utility.OpenOrCreate(binding_file_path, tag=module.moduleUID()) break except OSError, e: if errno.EEXIST != e.errno: raise module_elts.pop() module_path = '.'.join(module_elts) else: assert False for n in range(len(module_elts)-1): sub_path = os.path.join(*module_elts[:1+n]) init_path = os.path.join(sub_path, '__init__.py') if not os.path.exists(init_path): file(init_path, 'w') return (binding_file_path, binding_file, module_path)
e04eaab240f45266e86bdbb16064ee9ef599d27d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/e04eaab240f45266e86bdbb16064ee9ef599d27d/generate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18164, 751, 261, 2890, 16, 1605, 4672, 468, 585, 2619, 589, 358, 1625, 326, 7394, 854, 5941, 468, 1605, 589, 628, 1492, 326, 7394, 854, 15849, 9101, 468, 585, 733, 1368, 1492, 7394, 854,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18164, 751, 261, 2890, 16, 1605, 4672, 468, 585, 2619, 589, 358, 1625, 326, 7394, 854, 5941, 468, 1605, 589, 628, 1492, 326, 7394, 854, 15849, 9101, 468, 585, 733, 1368, 1492, 7394, 854,...
license_line = open( license_path ).readlines()[0]
license_line = open( license_path ).readlines()[0].strip()
def filter_path( path ): if not options.gpl: return True else: license_path = None if os.path.exists( path + ".license" ): license_path = path + ".license" elif os.path.exists( os.path.join( path, "license" ) ): license_path = os.path.join( path, "license" ) if not license_path: return True else: license_line = open( license_path ).readlines()[0] if license_line in GPL_COMPATIBLE_LICENSES: return True return False
89599aae131b375ea90cae8a96d126c50171ddca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2545/89599aae131b375ea90cae8a96d126c50171ddca/export_nix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 67, 803, 12, 589, 262, 30, 309, 486, 702, 18, 75, 412, 30, 327, 1053, 469, 30, 8630, 67, 803, 273, 599, 309, 1140, 18, 803, 18, 1808, 12, 589, 397, 3552, 12687, 6, 262, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 67, 803, 12, 589, 262, 30, 309, 486, 702, 18, 75, 412, 30, 327, 1053, 469, 30, 8630, 67, 803, 273, 599, 309, 1140, 18, 803, 18, 1808, 12, 589, 397, 3552, 12687, 6, 262, 30, ...
try: target = open(targetpath, "wb") except IOError: targetpath = sanitize_file_name(targetpath) target = open(targetpath, "wb") shutil.copyfileobj(source, target) source.close() target.close()
with closing(self.open(member, pwd=pwd)) as source: with open(targetpath, 'wb') as target: shutil.copyfileobj(source, target)
def _extract_member(self, member, targetpath, pwd): """Extract the ZipInfo object 'member' to a physical file on the path targetpath. """ # build the destination pathname, replacing # forward slashes to platform specific separators. if targetpath[-1:] == "/": targetpath = targetpath[:-1]
90bf890e10e1b94de2516aed57e6ff57395a5843 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/90bf890e10e1b94de2516aed57e6ff57395a5843/zipfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8004, 67, 5990, 12, 2890, 16, 3140, 16, 1018, 803, 16, 14720, 4672, 3536, 4976, 326, 8603, 966, 733, 296, 5990, 11, 358, 279, 11640, 585, 603, 326, 589, 1018, 803, 18, 3536, 468, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8004, 67, 5990, 12, 2890, 16, 3140, 16, 1018, 803, 16, 14720, 4672, 3536, 4976, 326, 8603, 966, 733, 296, 5990, 11, 358, 279, 11640, 585, 603, 326, 589, 1018, 803, 18, 3536, 468, ...
acqEra=None acqEra=spec.parameters["AcquisitionEra"]
acqEra = spec.parameters.get("AcquisitionEra", None)
def buildWorkflowSpecFile(self, jobId, fileList, dataset, targetDataset, outputFile, properties, seList): """ _buildWorkflowSpecFile_ Build a workflow specification for the merge job. The xml file is stored in the control directory, with name: <jobId>--WorkflowSpec.xml Arguments: jobId -- the name of the job fileList -- the list of files to be merged dataset -- the name of the dataset targetDataset -- the target dataset name outputFile -- the name of the merged file properties -- dataset properties seList -- storage element lists associated to file block Return: merge job spec (or None if there are problems) """
7d121343e5223903b3ab81a54bb04d71217793b4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/7d121343e5223903b3ab81a54bb04d71217793b4/MergeSensorComponent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 8484, 1990, 812, 12, 2890, 16, 13845, 16, 18645, 16, 3709, 16, 1018, 10656, 16, 15047, 16, 1790, 16, 695, 682, 4672, 3536, 389, 3510, 8484, 1990, 812, 67, 225, 3998, 279, 6095, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 8484, 1990, 812, 12, 2890, 16, 13845, 16, 18645, 16, 3709, 16, 1018, 10656, 16, 15047, 16, 1790, 16, 695, 682, 4672, 3536, 389, 3510, 8484, 1990, 812, 67, 225, 3998, 279, 6095, 7...