rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
pattern_file_path = ('data', 'MIT', 'device_user_agent_patterns.json')
pattern_file_path = ('..', '..', '..', 'data', 'MIT', 'device_user_agent_patterns.json')
def __call__(self): try: wurfl_device = \ devices.select_ua(self.user_agent, search=JaroWinkler(accuracy=0.85)) return WDevice(wurfl_device) # this is bad but a weird but makes DeviceNotFound not catched if # except DeviceNotFound is used except Exception: pass return None
aaab8e5c8dc3b6b32362656e9488bc6c9e1c0727 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14931/aaab8e5c8dc3b6b32362656e9488bc6c9e1c0727/classifiers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 4672, 775, 30, 341, 295, 2242, 67, 5964, 273, 521, 7166, 18, 4025, 67, 11886, 12, 2890, 18, 1355, 67, 5629, 16, 1623, 33, 10813, 83, 59, 754, 749, 12, 2501...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 4672, 775, 30, 341, 295, 2242, 67, 5964, 273, 521, 7166, 18, 4025, 67, 11886, 12, 2890, 18, 1355, 67, 5629, 16, 1623, 33, 10813, 83, 59, 754, 749, 12, 2501...
links = []
def getLinksFromOb(self, ob, properties=None): """Return a list of links contained in the properties of ob.
63d183057cbaa159050c3e03a977ab6cc45aaae8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/63d183057cbaa159050c3e03a977ab6cc45aaae8/LinkChecker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 7100, 1265, 10516, 12, 2890, 16, 3768, 16, 1790, 33, 7036, 4672, 3536, 990, 279, 666, 434, 4716, 7542, 316, 326, 1790, 434, 3768, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 7100, 1265, 10516, 12, 2890, 16, 3768, 16, 1790, 33, 7036, 4672, 3536, 990, 279, 666, 434, 4716, 7542, 316, 326, 1790, 434, 3768, 18, 2, -100, -100, -100, -100, -100, -100, -100, ...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 592) else quickfix.StringField.__init__(self, 592, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1381, 9975, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1381, 9975, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, ...
if not cache.dts: cache.dts = [min([ min([ dist(points[x][:-1],points[v][:-1]) for v in simplex if v!=x], 0) for simplex in S[x]], 0)*.1 for x in xrange(npoints)]
if not cache.dts: cache.dts = [min([ min([ dist(points[x][:-1],points[v][:-1]) for v in simplex if v!=x]) for simplex in S[x]])*.1 for x in xrange(npoints)]
def firstTriangle(cache, dimensions, progressCallback = None, **args): if len(cache.contAttributes) == 1: return triangles1D(cache, False) if not cache.points: cache.points = orange.ExampleTable(orange.Domain(cache.contAttributes, cache.data.domain.classVar), cache.data).native(0) points = cache.points npoints = len(points) if not cache.tri: cache.tri = triangulate(cache, points) tri = cache.tri if not cache.stars: cache.stars = [star(x, tri) for x in xrange(npoints)] S = cache.stars if not cache.dts: cache.dts = [min([ min([ dist(points[x][:-1],points[v][:-1]) for v in simplex if v!=x], 0) for simplex in S[x]], 0)*.1 for x in xrange(npoints)] if progressCallback: nPoints = 100.0/npoints for x, (S, xp, dt, deltas) in enumerate(zip(cache.stars, points, cache.dts, cache.deltas)): for d in dimensions: xn = xp[:-1] DBG=0 if xn[0]>16 and xn[1]<44.5 and xn[1]>43: #if xn[0]>4.7 and xn[0]<4.9 and xn[1]<24.5 and xn[1]>23.5: DBG=1 print "DBG" O = numpy.array(xp[:-1]) xn[d] += dt swx = simplex_with_xn(cache, xn, S) if swx: if DBG: print "iskanje cudnih trikotnikov" print swx print [points[k] for k in swx] obrni = 1
45c3545d7cec5ecfb8951397d1a6a5002a7e27f7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/45c3545d7cec5ecfb8951397d1a6a5002a7e27f7/orngPade.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1122, 31506, 12, 2493, 16, 5769, 16, 4007, 2428, 273, 599, 16, 2826, 1968, 4672, 309, 562, 12, 2493, 18, 1213, 2498, 13, 422, 404, 30, 327, 19959, 21, 40, 12, 2493, 16, 1083, 13, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1122, 31506, 12, 2493, 16, 5769, 16, 4007, 2428, 273, 599, 16, 2826, 1968, 4672, 309, 562, 12, 2493, 18, 1213, 2498, 13, 422, 404, 30, 327, 19959, 21, 40, 12, 2493, 16, 1083, 13, 225...
elif address != '' and address == candidate.fullName:
elif name != '' and name == candidate.fullName:
def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName: C{String} @return: C{EmailAddress} or None if not found, and nameOrAddressString is\ not a valid email address. """ import osaf.mail.message as message # avoid circularity
b49ad043cedb1bb6d12fe3f876acb791dd27643e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b49ad043cedb1bb6d12fe3f876acb791dd27643e/Mail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17297, 1887, 261, 6429, 16, 26840, 1887, 780, 16, 12424, 2218, 11, 4672, 3536, 8834, 578, 752, 392, 8166, 1887, 2511, 603, 326, 4580, 533, 18, 632, 891, 26840, 1887, 780, 30, 28748, 533,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17297, 1887, 261, 6429, 16, 26840, 1887, 780, 16, 12424, 2218, 11, 4672, 3536, 8834, 578, 752, 392, 8166, 1887, 2511, 603, 326, 4580, 533, 18, 632, 891, 26840, 1887, 780, 30, 28748, 533,...
def traverse(currentState):
def traverse(currentState,stateList,traversedList):
def traverse(currentState): if currentState.transitions() == {}: return else: for aiState in currentState.transitions().itervalues(): if not aiState in Machine.traversedList: strStruct = currentState.__name__ + "->" + aiState.__name__ Machine.structList.append(strStruct) Machine.traversedList.append(aiState) Machine.traverse(aiState)
ad128d615b289bdead9f03a7028ea4392057eba7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10608/ad128d615b289bdead9f03a7028ea4392057eba7/state.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10080, 12, 2972, 1119, 16, 2019, 682, 16, 2033, 7548, 682, 4672, 309, 17773, 18, 22671, 1435, 422, 16648, 327, 469, 30, 364, 14679, 1119, 316, 17773, 18, 22671, 7675, 2165, 2372, 13332, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10080, 12, 2972, 1119, 16, 2019, 682, 16, 2033, 7548, 682, 4672, 309, 17773, 18, 22671, 1435, 422, 16648, 327, 469, 30, 364, 14679, 1119, 316, 17773, 18, 22671, 7675, 2165, 2372, 13332, ...
('ASPECT_MAX', '16777573' ),
('ASPECT_MAX', '357' ),
def lcp_1(): ds = gdal.Open('data/test_FARSITE_UTM12.LCP') if ds.RasterCount != 8: gdaltest.post_reason('wrong number of bands') return 'fail' metadata = [ ('LATITUDE', '49'), ('LINEAR_UNIT', 'Meters'), ('DESCRIPTION', 'This is a test LCP file created with FARSITE 4.1.054, using data downloaded from the USGS \r\nNational Map for LANDFIRE (2008-05-06). Data were reprojected to UTM zone 12 on NAD83 \r\nusing gdalwarp (GDAL 1.4.2).\r\n') ] md = ds.GetMetadata() for item in metadata: if md[item[0]] != item[1]: gdaltest.post_reason('wrong metadataitem for dataset. md[\'%s\']=\'%s\', expected \'%s\'' % (item[0], md[item[0]], item[1])) return 'fail' check_gt = (285807.932887174887583,30,0,5379230.386217921040952,0,-30) new_gt = ds.GetGeoTransform() for i in range(6): if abs(new_gt[i]-check_gt[i]) > 1e-5: print print 'old = ', check_gt print 'new = ', new_gt gdaltest.post_reason( 'Geotransform differs.' ) return 'fail' dataPerBand = [ ( 18645, [ ('ELEVATION_UNIT', '0' ), ('ELEVATION_UNIT_NAME', 'Meters' ), ('ELEVATION_MIN', '67109928' ), ('ELEVATION_MAX', '83887572' ), ('ELEVATION_NUM_CLASSES', '-1' ), ('ELEVATION_FILE', '' ) ] ), ( 16431, [ ('SLOPE_UNIT', '0' ), ('SLOPE_UNIT_NAME', 'Degrees' ), ('SLOPE_MIN', '0' ), ('SLOPE_MAX', '34' ), ('SLOPE_NUM_CLASSES', '36' ), ('SLOPE_FILE', 'slope.asc' ) ] ), ( 18851, [ ('ASPECT_UNIT', '2' ), ('ASPECT_UNIT_NAME', 'Azimuth degrees' ), ('ASPECT_MIN', '0' ), ('ASPECT_MAX', '16777573' ), ('ASPECT_NUM_CLASSES', '-1' ), ('ASPECT_FILE', 'aspect.asc' ) ] ), ( 26182, [ ('FUEL_MODEL_OPTION', '0' ), ('FUEL_MODEL_OPTION_DESC', 'no custom models AND no conversion file needed' ), ('FUEL_MODEL_MIN', '1' ), ('FUEL_MODEL_MAX', '99' ), ('FUEL_MODEL_NUM_CLASSES', '6' ), ('FUEL_MODEL_VALUES', '1,2,5,8,10,99' ), ('FUEL_MODEL_FILE', 'fbfm13.asc' ) ] ), ( 30038, [ ('CANOPY_COV_UNIT', '0' ), ('CANOPY_COV_UNIT_NAME', 'Categories (0-4)' ), ('CANOPY_COV_MIN', '0' ), ('CANOPY_COV_MAX', '95' ), ('CANOPY_COV_NUM_CLASSES', '10' ), ('CANOPY_COV_FILE', 'cancov.asc' ) ] ), ( 22077, [ ('CANOPY_HT_UNIT', '3' ), ('CANOPY_HT_UNIT_NAME', 'Meters x 10' ), ('CANOPY_HT_MIN', '0' ), ('CANOPY_HT_MAX', '16777591' ), ('CANOPY_HT_NUM_CLASSES', '5' ), ('CANOPY_HT_FILE', 'canht.asc' ) ] ), ( 30388, [ ('CBH_UNIT', '3' ), ('CBH_UNIT_NAME', 'Meters x 10' ), ('CBH_MIN', '0' ), ('CBH_MAX', '100' ), ('CBH_NUM_CLASSES', '33' ), ('CBH_FILE', 'cbh.asc' ) ] ), ( 23249, [ ('CBD_UNIT', '3' ), ('CBD_UNIT_NAME', 'kg/m^3 x 100' ), ('CBD_MIN', '0' ), ('CBD_MAX', '21' ), ('CBD_NUM_CLASSES', '20' ), ('CBD_FILE', 'cbd.asc' ) ] ) ] for i in range(8): band = ds.GetRasterBand(i+1) if band.Checksum() != dataPerBand[i][0]: gdaltest.post_reason('wrong checksum for band %d. Got %d, expected %d' % (i+1, band.Checksum(), dataPerBand[i][0])) return 'fail' md = band.GetMetadata() for item in dataPerBand[i][1]: if md[item[0]] != item[1]: gdaltest.post_reason('wrong metadataitem for band %d. md[\'%s\']=\'%s\', expected \'%s\'' % (i+1, item[0], md[item[0]], item[1])) return 'fail' ds = None return 'success'
a36696c833b65ab5e544361e8bf6514eb8585fe7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10289/a36696c833b65ab5e544361e8bf6514eb8585fe7/lcp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 4057, 67, 21, 13332, 225, 3780, 273, 15551, 287, 18, 3678, 2668, 892, 19, 3813, 67, 42, 985, 20609, 67, 1693, 49, 2138, 18, 48, 4258, 6134, 309, 3780, 18, 18637, 1380, 480, 1725, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 4057, 67, 21, 13332, 225, 3780, 273, 15551, 287, 18, 3678, 2668, 892, 19, 3813, 67, 42, 985, 20609, 67, 1693, 49, 2138, 18, 48, 4258, 6134, 309, 3780, 18, 18637, 1380, 480, 1725, ...
}else if(dims[i-1]==1 && strides[i-1]==0){
}else if(false && dims[i-1]==1 && strides[i-1]==0){
def c_src_callkernel(self, node, nodename): # # This function serves three main goals: # # The first is stride unpacking: # it accepts input and output arguments as # float * , int* # pairs, and it constructs a kernel function call where inputs and arguments are named # like # float *, int, int, int ... # # The second is to recognize when trailing (right-most in numpy) dimensions can be collapsed as # being contiguous... (confusing... read code) # # The thrid is to make a special case for scalar element. We allow the collapsing of them. # In the ccontiguous and not contiguous case, we use registers to lower the number of memory access.
beb886c9507f199a8c6fbc7f585eee1e2ebd8497 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/beb886c9507f199a8c6fbc7f585eee1e2ebd8497/elemwise.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 4816, 67, 1991, 8111, 12, 2890, 16, 756, 16, 14003, 1069, 4672, 468, 468, 1220, 445, 26255, 8925, 2774, 1960, 1031, 30, 468, 468, 1021, 1122, 353, 11084, 6167, 310, 30, 468, 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, 276, 67, 4816, 67, 1991, 8111, 12, 2890, 16, 756, 16, 14003, 1069, 4672, 468, 468, 1220, 445, 26255, 8925, 2774, 1960, 1031, 30, 468, 468, 1021, 1122, 353, 11084, 6167, 310, 30, 468, 5...
_logger.propogate = 0
_logger.propagate = 0
def get_logger(): return _logger
813409531c6d7a24d45b6b747a07958173b4b314 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/813409531c6d7a24d45b6b747a07958173b4b314/mp_distributing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4901, 13332, 327, 389, 4901, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4901, 13332, 327, 389, 4901, 225, 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...
{'apostilb':'Defined to be 10^-4 lamberts.\nEqual to 1/pi*candela/meter^2.', 'lambert':'Defined to be 10^4/pi candela/meter^2.', 'nit':'Equivalent to candela/meter^2.', 'stilb':'CGS unit equal to 10000 candela/meter^2.'},
{'apostilb':'Defined to be 10^-4 lamberts.\nEqual to 1/pi*candela/meter^2.', 'lambert':'Defined to be 10^4/pi candela/meter^2.', 'nit':'Equivalent to candela/meter^2.', 'stilb':'CGS unit equal to 10000 candela/meter^2.'},
def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys()))
d9145e61c2e167a847618a21778e0e532a04af5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d9145e61c2e167a847618a21778e0e532a04af5d/units.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5302, 4873, 1576, 13332, 3536, 6910, 777, 326, 533, 924, 434, 326, 2836, 1576, 2190, 635, 3675, 12697, 10138, 16, 471, 10736, 2690, 1308, 4606, 364, 28769, 434, 999, 18, 1220, 445, 353, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5302, 4873, 1576, 13332, 3536, 6910, 777, 326, 533, 924, 434, 326, 2836, 1576, 2190, 635, 3675, 12697, 10138, 16, 471, 10736, 2690, 1308, 4606, 364, 28769, 434, 999, 18, 1220, 445, 353, ...
return long(str)
return long(float(str))
def _safe_int(str): try: return int(str) except ValueError: # Something went wrong. Try to clean up the string. # Remove all commas from the string str = string.replace(str, ',', '') try: # try again. return int(str) except ValueError: pass # If it fails again, maybe it's too long? return long(str)
f2c8adc950ed95f181ab791383df1f687eab33d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/f2c8adc950ed95f181ab791383df1f687eab33d0/NCBIStandalone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4626, 67, 474, 12, 701, 4672, 775, 30, 327, 509, 12, 701, 13, 1335, 2068, 30, 468, 29116, 16343, 7194, 18, 225, 6161, 358, 2721, 731, 326, 533, 18, 468, 3581, 777, 23528, 628, 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, 4626, 67, 474, 12, 701, 4672, 775, 30, 327, 509, 12, 701, 13, 1335, 2068, 30, 468, 29116, 16343, 7194, 18, 225, 6161, 358, 2721, 731, 326, 533, 18, 468, 3581, 777, 23528, 628, 3...
repos, backup = sys.argv
dummy, repos, backup = sys.argv
def read_options(): """ Read options from command line. """ full = False # Parse options. while len(sys.argv) > 1 and sys.argv[1].startswith("-"): option = sys.argv.pop(1) if option == "--full": full = True else: usage("unknown option %s" % option) if len(sys.argv) != 2: usage() # Normalize path name arguments. repos, backup = sys.argv while repos.endswith("/"): repos = repos[:-1] while backup.endswith("/"): backup = backup[:-1] return full, repos, backup
aed9330cabe615b5ecb34effcf5ad1fa610b0905 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3111/aed9330cabe615b5ecb34effcf5ad1fa610b0905/svn_backup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2116, 13332, 3536, 2720, 702, 628, 1296, 980, 18, 3536, 1983, 273, 1083, 468, 2884, 702, 18, 1323, 562, 12, 9499, 18, 19485, 13, 405, 404, 471, 2589, 18, 19485, 63, 21, 8009, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2116, 13332, 3536, 2720, 702, 628, 1296, 980, 18, 3536, 1983, 273, 1083, 468, 2884, 702, 18, 1323, 562, 12, 9499, 18, 19485, 13, 405, 404, 471, 2589, 18, 19485, 63, 21, 8009, ...
qualifier_data = qualifier_data.replace("\n"," ").replace(" "," ")
if qualifier_data is not None : qualifier_data = qualifier_data.replace("\n"," ").replace(" "," ")
def parse_cds_features(self, handle, alphabet=generic_protein, tags2id=('protein_id','locus_tag','product')) : """Returns SeqRecord object iterator
e21ed88f55b2db9cb281524ce99b8f2e9058e58d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/e21ed88f55b2db9cb281524ce99b8f2e9058e58d/Scanner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 71, 2377, 67, 7139, 12, 2890, 16, 1640, 16, 10877, 33, 13540, 67, 24807, 16, 2342, 22, 350, 33, 2668, 24807, 67, 350, 17023, 1829, 407, 67, 2692, 17023, 5896, 26112, 294, 353...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 71, 2377, 67, 7139, 12, 2890, 16, 1640, 16, 10877, 33, 13540, 67, 24807, 16, 2342, 22, 350, 33, 2668, 24807, 67, 350, 17023, 1829, 407, 67, 2692, 17023, 5896, 26112, 294, 353...
return code
return (code,msg)
def helo(self, name=''): """SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("helo",name) (code,msg)=self.getreply() self.helo_resp=msg return code
53ecf9d0a34d0a10b05db7f05f9837e5aa9ed6d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/53ecf9d0a34d0a10b05db7f05f9837e5aa9ed6d9/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13150, 83, 12, 2890, 16, 508, 2218, 11, 4672, 3536, 55, 14636, 296, 76, 24214, 11, 1296, 18, 17423, 358, 1366, 364, 333, 1296, 3467, 358, 326, 23127, 8609, 434, 326, 1191, 1479, 18, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13150, 83, 12, 2890, 16, 508, 2218, 11, 4672, 3536, 55, 14636, 296, 76, 24214, 11, 1296, 18, 17423, 358, 1366, 364, 333, 1296, 3467, 358, 326, 23127, 8609, 434, 326, 1191, 1479, 18, 35...
SpecializedSetup<%(name)s, 0>();
SpecializedSetup<%(name)s, 0>(false);
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
b112298f642b44d190d201a64cdc60963266551a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/b112298f642b44d190d201a64cdc60963266551a/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 1179, 2802, 4709, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 923, 67, 3813, 273, 3536, 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, 2598, 1179, 2802, 4709, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 923, 67, 3813, 273, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -1...
'lib_opt': cc.lib_opt_flags,
'lib_opt': cc.library_opt_flags(options.debug_build),
def prefix_with_build_dir(path): if options.with_build_dir != None: return os.path.join(options.with_build_dir, path) return path
b37dbf1f1c80168f79bcb59809be5002dc7515b4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9556/b37dbf1f1c80168f79bcb59809be5002dc7515b4/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1633, 67, 1918, 67, 3510, 67, 1214, 12, 803, 4672, 309, 702, 18, 1918, 67, 3510, 67, 1214, 480, 599, 30, 327, 1140, 18, 803, 18, 5701, 12, 2116, 18, 1918, 67, 3510, 67, 1214, 16, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1633, 67, 1918, 67, 3510, 67, 1214, 12, 803, 4672, 309, 702, 18, 1918, 67, 3510, 67, 1214, 480, 599, 30, 327, 1140, 18, 803, 18, 5701, 12, 2116, 18, 1918, 67, 3510, 67, 1214, 16, 5...
self.grid_step = grid_step if(self.grid_step is not None): self.grid_step = min(0.8, self.grid_step) if(gridding_n_real is None):
if (grid_step is not None): grid_step = min(0.8, grid_step) if (gridding_n_real is None):
def __init__(self, xray_structure, gridding_n_real=None, grid_step =None, solvent_radius=1.0, shrink_truncation_radius=1.0): assert [gridding_n_real, grid_step].count(None) == 1 self.xray_structure = xray_structure self.grid_step = grid_step if(self.grid_step is not None): self.grid_step = min(0.8, self.grid_step) if(gridding_n_real is None): gridding_n_real = maptbx.crystal_gridding( unit_cell=xray_structure.unit_cell(), step= self.grid_step).n_real() atom_radii = flex.double() # XXX use scattering dictionary and set_selected selection = flex.size_t() for i_seq, scatterer in enumerate(xray_structure.scatterers()): try: atom_radii.append( van_der_waals_radii.vdw.table[scatterer.element_symbol()]) except: selection.append(i_seq) sites_frac = xray_structure.sites_frac() if(selection.size() > 0): print "WARNING: Number of atoms with unknown van der Waals rad.:", \ selection.size() selection_bool = flex.bool(sites_frac.size(), selection) sites_frac = sites_frac.select(~selection_bool) around_atoms.__init__(self, unit_cell=xray_structure.unit_cell(), space_group_order_z=xray_structure.space_group().order_z(), sites_frac=sites_frac, atom_radii=atom_radii, gridding_n_real=gridding_n_real, solvent_radius=solvent_radius, shrink_truncation_radius=shrink_truncation_radius) introspection.virtual_memory_info().update_max()
7b9609418614018b198da11b1c595c04441a18dd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/7b9609418614018b198da11b1c595c04441a18dd/masks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 619, 435, 67, 7627, 16, 3068, 7459, 67, 82, 67, 7688, 33, 7036, 16, 3068, 67, 4119, 273, 7036, 16, 3704, 616, 67, 11282, 33, 21, 18, 20, 16, 17697, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 619, 435, 67, 7627, 16, 3068, 7459, 67, 82, 67, 7688, 33, 7036, 16, 3068, 67, 4119, 273, 7036, 16, 3704, 616, 67, 11282, 33, 21, 18, 20, 16, 17697, 6...
if line.strip() =='NOT_FOUND': return None
if line == None or line.strip() =='NOT_FOUND': return None
def _incrdecr(self, cmd, key, delta): self.check_key(key) server, key = self._get_server(key) if not server: return 0 self._statlog(cmd) cmd = "%s %s %d" % (cmd, key, delta) try: server.send_cmd(cmd) line = server.readline() if line.strip() =='NOT_FOUND': return None return int(line) except socket.error, msg: if isinstance(msg, tuple): msg = msg[1] server.mark_dead(msg) return None
2e7b170b1d78de44b3ddf9c343e82e69fbd050e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11935/2e7b170b1d78de44b3ddf9c343e82e69fbd050e4/memcache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 267, 3353, 323, 3353, 12, 2890, 16, 1797, 16, 498, 16, 3622, 4672, 365, 18, 1893, 67, 856, 12, 856, 13, 1438, 16, 498, 273, 365, 6315, 588, 67, 3567, 12, 856, 13, 309, 486, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 267, 3353, 323, 3353, 12, 2890, 16, 1797, 16, 498, 16, 3622, 4672, 365, 18, 1893, 67, 856, 12, 856, 13, 1438, 16, 498, 273, 365, 6315, 588, 67, 3567, 12, 856, 13, 309, 486, 14...
return self.lookup_table_cursor_down()
return self.cursor_down()
def __chinese_mode_process_key_event(self, key): # define a condition half to full width translate functions cond_letter_translate = lambda(c): \ self.__convert_to_full_width(c) if self.__full_width_letter [self.__mode] else c cond_punct_translate = lambda(c): \ self.__convert_to_full_width(c) if self.__full_width_punct [self.__mode] else c
5ae43a9abd1775ab09775ef70799832bcce18dd4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/471/5ae43a9abd1775ab09775ef70799832bcce18dd4/pinyin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 343, 25331, 67, 3188, 67, 2567, 67, 856, 67, 2575, 12, 2890, 16, 498, 4672, 468, 4426, 279, 2269, 8816, 358, 1983, 1835, 4204, 4186, 6941, 67, 13449, 67, 13929, 273, 3195, 12, 71...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 343, 25331, 67, 3188, 67, 2567, 67, 856, 67, 2575, 12, 2890, 16, 498, 4672, 468, 4426, 279, 2269, 8816, 358, 1983, 1835, 4204, 4186, 6941, 67, 13449, 67, 13929, 273, 3195, 12, 71...
attrs["type"] = object_type
attrs["type"] = unicode(object_type)
def add_object(self, object_type, parent = None, **attrs): """ Adds an object of type 'object_type' to the database. Parent is a (type, id) tuple which refers to the object's parent. 'object_type' and 'type' is a type name as given to register_object_type_attrs(). attrs kwargs will vary based on object type. ATTR_SIMPLE attributes which a None are not added.
4c55d8b0ab067c38190ced288463af73bbbb032d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11722/4c55d8b0ab067c38190ced288463af73bbbb032d/db.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 1612, 12, 2890, 16, 733, 67, 723, 16, 982, 273, 599, 16, 2826, 7039, 4672, 3536, 15605, 392, 733, 434, 618, 296, 1612, 67, 723, 11, 358, 326, 2063, 18, 225, 9520, 353, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 1612, 12, 2890, 16, 733, 67, 723, 16, 982, 273, 599, 16, 2826, 7039, 4672, 3536, 15605, 392, 733, 434, 618, 296, 1612, 67, 723, 11, 358, 326, 2063, 18, 225, 9520, 353, 279, ...
return data[:-3] + '\n'
return data.replace('\r\r\n', '\n')
def normalize_output(data): # Some operating systems do conversions on newline. We could possibly # fix that by doing the appropriate termios.tcsetattr()s. I couldn't # figure out the right combo on Tru64 and I don't have an IRIX box. # So just normalize the output and doc the problem O/Ses by allowing # certain combinations for some platforms, but avoid allowing other # differences (like extra whitespace, trailing garbage, etc.) # This is about the best we can do without getting some feedback # from someone more knowledgable. # OSF/1 (Tru64) apparently turns \n into \r\r\n. if data.endswith('\r\r\n'): return data[:-3] + '\n' # IRIX apparently turns \n into \r\n. if data.endswith('\r\n'): return data[:-2] + '\n' return data
9cc3b1ccef8f348ebfc36a13ec54e78423e9b4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9cc3b1ccef8f348ebfc36a13ec54e78423e9b4ff/test_pty.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3883, 67, 2844, 12, 892, 4672, 468, 10548, 16929, 14908, 741, 22586, 603, 9472, 18, 225, 1660, 3377, 10016, 468, 2917, 716, 635, 9957, 326, 5505, 2481, 7441, 18, 5111, 542, 1747, 1435, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3883, 67, 2844, 12, 892, 4672, 468, 10548, 16929, 14908, 741, 22586, 603, 9472, 18, 225, 1660, 3377, 10016, 468, 2917, 716, 635, 9957, 326, 5505, 2481, 7441, 18, 5111, 542, 1747, 1435, 8...
self.pack_start(self.treeview, True, True, 0)
self.pack_start(self.scrolledwindow, True, True, 0) self.scrolledwindow.add(self.treeview)
def __init__(self, prnt): gtk.VBox.__init__(self) self.prnt = prnt
17466ef0e62a97384363a1ba189f4b8c03f93b77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4616/17466ef0e62a97384363a1ba189f4b8c03f93b77/gepdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 846, 496, 4672, 22718, 18, 58, 3514, 16186, 2738, 972, 12, 2890, 13, 365, 18, 683, 496, 273, 846, 496, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 846, 496, 4672, 22718, 18, 58, 3514, 16186, 2738, 972, 12, 2890, 13, 365, 18, 683, 496, 273, 846, 496, 2, -100, -100, -100, -100, -100, -100, -100, -100,...
utils = Utils() fname = utils.gen_filename()
fname = Utils().gen_filename()
def write_message(self, folder, message, flags): """Write a message in the given folder of the maildir. """ if not folder.startswith(self.__basedir): folder = os.path.join(self.__basedir, folder) utils = Utils() fname = utils.gen_filename() fname_tmp = os.path.join(folder, 'tmp', fname)
37e720541da9eb3d7c758e4ba3bba9e24328637d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2245/37e720541da9eb3d7c758e4ba3bba9e24328637d/imapbackup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 2150, 12, 2890, 16, 3009, 16, 883, 16, 2943, 4672, 3536, 3067, 279, 883, 316, 326, 864, 3009, 434, 326, 10843, 545, 481, 18, 3536, 309, 486, 3009, 18, 17514, 1918, 12, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 2150, 12, 2890, 16, 3009, 16, 883, 16, 2943, 4672, 3536, 3067, 279, 883, 316, 326, 864, 3009, 434, 326, 10843, 545, 481, 18, 3536, 309, 486, 3009, 18, 17514, 1918, 12, 2890, ...
integers n -1.
integers n >= 1.
def spherical_bessel_J(n, var, algorithm="maxima"): r""" Returns the spherical Bessel function of the first kind for integers n -1. Reference: AS 10.1.8 page 437 and AS 10.1.15 page 439. EXAMPLES:: sage: spherical_bessel_J(2,x) ((3/x^2 - 1)*sin(x) - 3*cos(x)/x)/x """ if algorithm=="scipy": import scipy.special ans = str(scipy.special.sph_jn(int(n),float(var))) ans = ans.replace("(","") ans = ans.replace(")","") ans = ans.replace("j","*I") return sage_eval(ans) elif algorithm == 'maxima': _init() return meval("spherical_bessel_j(%s,%s)"%(ZZ(n),var)) else: raise ValueError, "unknown algorithm '%s'"%algorithm
6274714743f1c89b6ed99f5272785660edc8871f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6274714743f1c89b6ed99f5272785660edc8871f/special.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 21570, 67, 70, 403, 292, 67, 46, 12, 82, 16, 569, 16, 4886, 1546, 1896, 13888, 6, 4672, 436, 8395, 2860, 326, 272, 21570, 605, 403, 292, 445, 434, 326, 1122, 3846, 364, 12321, 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, 272, 21570, 67, 70, 403, 292, 67, 46, 12, 82, 16, 569, 16, 4886, 1546, 1896, 13888, 6, 4672, 436, 8395, 2860, 326, 272, 21570, 605, 403, 292, 445, 434, 326, 1122, 3846, 364, 12321, 2...
cal = HTMLCalendar()
if options.locale: cal = LocaleHTMLCalendar(locale=options.locale) else: cal = HTMLCalendar()
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number of lines for each week (default 1, text only)") parser.add_option("-s", "--spacing", dest="spacing", type="int", default=6, help="spacing between months (default 6, text only)") parser.add_option("-m", "--months", dest="months", type="int", default=3, help="months per row (default 3, text only)") parser.add_option("-c", "--css", dest="css", default="calendar.css", help="CSS to use for page (html only)") parser.add_option("-e", "--encoding", dest="encoding", default=None, help="Encoding to use for CSS output (html only)") parser.add_option("-t", "--type", dest="type", default="text", choices=("text", "html"), help="output type (text or html)") (options, args) = parser.parse_args(args) if options.type == "html": cal = HTMLCalendar() encoding = options.encoding if encoding is None: encoding = sys.getdefaultencoding() optdict = dict(encoding=encoding, css=options.css) if len(args) == 1: print cal.formatyearpage(datetime.date.today().year, **optdict) elif len(args) == 2: print cal.formatyearpage(int(args[1]), **optdict) else: parser.error("incorrect number of arguments") sys.exit(1) else: cal = TextCalendar() optdict = dict(w=options.width, l=options.lines) if len(args) != 3: optdict["c"] = options.spacing optdict["m"] = options.months if len(args) == 1: print cal.formatyear(datetime.date.today().year, **optdict) elif len(args) == 2: print cal.formatyear(int(args[1]), **optdict) elif len(args) == 3: print cal.formatmonth(int(args[1]), int(args[2]), **optdict) else: parser.error("incorrect number of arguments") sys.exit(1)
138ec9a7d26e139421c93bda9f6e6e7a6e88c9d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/138ec9a7d26e139421c93bda9f6e6e7a6e88c9d4/calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 1968, 4672, 1930, 2153, 2670, 2082, 273, 2153, 2670, 18, 1895, 2678, 12, 9167, 1546, 9167, 30, 738, 14654, 306, 2116, 65, 306, 6874, 65, 306, 7496, 4279, 13, 2082, 18, 1289, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 1968, 4672, 1930, 2153, 2670, 2082, 273, 2153, 2670, 18, 1895, 2678, 12, 9167, 1546, 9167, 30, 738, 14654, 306, 2116, 65, 306, 6874, 65, 306, 7496, 4279, 13, 2082, 18, 1289, ...
1. Z = median(y)
1. ``Z = median(y)``
def median(y): """ Performs median/WPGMC linkage. See ``linkage`` for more information on the return structure and algorithm. The following are common calling conventions: 1. Z = median(y) Performs median/WPGMC linkage on the condensed distance matrix ``y``. See ``linkage`` for more information on the return structure and algorithm. 2. Z = median(X) Performs median/WPGMC linkage on the observation matrix ``X`` using Euclidean distance as the distance metric. See linkage for more information on the return structure and algorithm. :Parameters: Q : ndarray A condensed or redundant distance matrix. A condensed distance matrix is a flat array containing the upper triangular of the distance matrix. This is the form that ``pdist`` returns. Alternatively, a collection of m observation vectors in n dimensions may be passed as a m by n array. :Returns: - Z : ndarray The hierarchical clustering encoded as a linkage matrix. :SeeAlso: - linkage: for advanced creation of hierarchical clusterings. """ return linkage(y, method='median', metric='euclidean')
cfdcf17d058d049f899de9ca9e6d013a8ec22d84 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/cfdcf17d058d049f899de9ca9e6d013a8ec22d84/hierarchy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12644, 12, 93, 4672, 3536, 27391, 12644, 19, 59, 18679, 20022, 1692, 410, 18, 2164, 12176, 1232, 410, 10335, 364, 1898, 1779, 603, 326, 327, 3695, 471, 4886, 18, 225, 1021, 3751, 854, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12644, 12, 93, 4672, 3536, 27391, 12644, 19, 59, 18679, 20022, 1692, 410, 18, 2164, 12176, 1232, 410, 10335, 364, 1898, 1779, 603, 326, 327, 3695, 471, 4886, 18, 225, 1021, 3751, 854, 29...
def InstallEups(env, dest, files): """Install a ups directory, setting absolute versions as appropriate"""
def InstallEups(env, dest, files, presetup=""): """Install a ups directory, setting absolute versions as appropriate if presetup is provided, it's expected to be a dictionary with keys prudoct names and values the version that should be installed into the table files, overriding eups expandtable's usual behaviour. E.g. env.InstallEups(env['prefix'] + "/ups", glob.glob("ups/*.table"), dict([("sconsUtils", env['version'])]) ) """
def InstallEups(env, dest, files): """Install a ups directory, setting absolute versions as appropriate""" if CleanFlagIsSet(): print >> sys.stderr, "Removing", dest shutil.rmtree(dest, ignore_errors=True) else: env = env.Clone(ENV = os.environ) obj = env.Install(dest, files) for i in obj: cmd = "eups_expandtable -i %s" % (str(i)) env.AddPostAction(i, Action("%s" %(cmd), cmd, ENV = os.environ)) return dest
801518982d542526c3a829e85618606056f1204d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6561/801518982d542526c3a829e85618606056f1204d/SConsUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 41, 18294, 12, 3074, 16, 1570, 16, 1390, 16, 12313, 416, 1546, 6, 4672, 3536, 6410, 279, 731, 87, 1867, 16, 3637, 4967, 5244, 487, 5505, 309, 12313, 416, 353, 2112, 16, 518, 180...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 41, 18294, 12, 3074, 16, 1570, 16, 1390, 16, 12313, 416, 1546, 6, 4672, 3536, 6410, 279, 731, 87, 1867, 16, 3637, 4967, 5244, 487, 5505, 309, 12313, 416, 353, 2112, 16, 518, 180...
int(self.ticket['id']), modtime, rcpt)
int(self.ticket.id), modtime, rcpt)
def get_message_id(self, rcpt, modtime=0): """Generate a predictable, but sufficiently unique message ID.""" s = '%s.%08d.%d.%s' % (self.config.get('project', 'url'), int(self.ticket['id']), modtime, rcpt) dig = md5.new(s).hexdigest() host = self.from_email[self.from_email.find('@') + 1:] msgid = '<%03d.%s@%s>' % (len(s), dig, host) return msgid
e955cc298b14d4c8585186dd50d2db31c6327444 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e955cc298b14d4c8585186dd50d2db31c6327444/Notify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2150, 67, 350, 12, 2890, 16, 4519, 337, 16, 681, 957, 33, 20, 4672, 3536, 4625, 279, 7810, 429, 16, 1496, 18662, 715, 3089, 883, 1599, 12123, 272, 273, 1995, 87, 7866, 6840, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2150, 67, 350, 12, 2890, 16, 4519, 337, 16, 681, 957, 33, 20, 4672, 3536, 4625, 279, 7810, 429, 16, 1496, 18662, 715, 3089, 883, 1599, 12123, 272, 273, 1995, 87, 7866, 6840, ...
sys.exit(False)
sys.exit(1)
def updateMythVideo(items): '''Add and delete MythVideo records for played Miro Videos. Add and delete symbolic links to Miro Videos, to coverart/Miro icons, banners and Miro screenshots and fanart. NOTE: banner and fanart graphics were provided with the script and are used only if present. Abort if processing failed return True if processing was successful ''' global localhostname, vid_graphics_dirs, storagegroups, channel_id, flat, simulation, verbose global channel_watch_only, statistics global graphic_suffix, graphic_path_suffix, graphic_name_suffix if not items: # There may not be any new items but a clean up of existing records may be required items = [] # Check that a MIRO video directory exists # if not then create the dir and add symbolic link to cover/file or icon createMiroMythVideoDirectory() # Remove any Miro Mythvideo records which the video or graphics paths are broken records = getMiroVideometadataRecords() if records: statistics[u'Total_Miro_MythVideos'] = len(records) for record in records: # Count the Miro-MythVideos that Miro is expiring or has saved if record[u'filename'][0] == u'/': if os.path.islink(record[u'filename']) and os.path.isfile(record[u'filename']): statistics[u'Total_Miro_expiring']+=1 elif record[u'host'] and storagegroups.has_key(u'mythvideo'): if os.path.islink(storagegroups[u'mythvideo']+record[u'filename']) and os.path.isfile(storagegroups[u'mythvideo']+record[u'filename']): statistics[u'Total_Miro_expiring']+=1 for record in records: if checkVideometadataFails(record, flat): delete = False if os.path.islink(record[u'filename']): # Only delete video files if they are symlinks if not record[u'host'] or record[u'filename'][0] == '/': if not os.path.isfile(record[u'filename']): delete = True else: if not os.path.isfile(vid_graphics_dirs[key_trans[field]]+record[u'filename']): delete = True else: if not os.path.isfile(record[u'filename']): delete = True if delete: # Only delete video files if they are symlinks deleteVideometadataRecord(record[u'intid']) deleteOldrecordedForMythVideo(record[u'title'], record[u'subtitle']) removeMythvideoSeekTable(record[u'filename']) statistics[u'Total_Miro_MythVideos']-=1 if record[u'filename'][0] == '/': try: if simulation: logger.info(u"Simulation: Remove video file symlink (%s)" % (record[u'filename'])) else: os.remove(record[u'filename']) statistics[u'Miros_MythVideos_video_removed']+=1 except OSError: pass elif record[u'host'] and storagegroups.has_key(u'mythvideo'): try: if simulation: logger.info(u"Simulation: Remove video file (%s)" % (storagegroups[u'mythvideo']+record[u'filename'])) else: os.remove(storagegroups[u'mythvideo']+record[u'filename']) except OSError: pass if record[u'screenshot']: # Remove any associated Screenshot if record[u'screenshot'][0] == '/': try: if simulation: logger.info(u"Simulation: Remove screenshot symlink (%s)" % (record[u'screenshot'])) else: os.remove(record[u'screenshot']) except OSError: pass elif record[u'host'] and storagegroups.has_key(u'episodeimagedir'): try: if simulation: logger.info(u"Simulation: Remove file (%s)" % (storagegroups[u'episodeimagedir']+record[u'screenshot'])) else: os.remove(storagegroups[u'episodeimagedir']+record[u'screenshot']) except OSError: pass # Remove any unique cover art graphic files if record[u'title'].lower() in channel_icon_override: if record[u'coverfile'][0] == u'/': try: if simulation: logger.info(u"Simulation: Remove item cover art file (%s)" % (record[u'coverfile'])) else: os.remove(record[u'coverfile']) except OSError: pass elif record[u'host'] and storagegroups.has_key(u'posterdir'): try: if simulation: logger.info(u"Simulation: Remove item cover art file (%s)" % (storagegroups[u'posterdir']+record[u'coverfile'])) else: os.remove(storagegroups[u'posterdir']+record[u'coverfile']) except OSError: pass if not items: # There may not be any new items to add to MythVideo return True # Reread Miro Mythvideo videometadata records # Remove the matching videometadata record from array of items items_copy = [] for item in items: items_copy.append(item) records = getMiroVideometadataRecords() if records: for record in records: for item in items: if item[u'channelTitle'] == record[u'title'] and item[u'title'] == record[u'subtitle']: try: items_copy.remove(item) except ValueError: logger.info(u"Video (%s - %s) was found multiple times in list of (watched and/or saved) items from Miro - skipping" % (item[u'channelTitle'], item[u'title'])) pass break for item in items: # Remove any items that are for a Channel that does not get MythVideo records if filter(is_not_punct_char, item[u'channelTitle'].lower()) in channel_watch_only: try: # Some items may have already been removed, let those passed items_copy.remove(item) except ValueError: pass # Add Miro videos that remain in the item list # If not a flat directory check if title directory exists and add icon symbolic link as coverfile for item in items_copy: if not flat and not item.has_key(u'copied'): createMiroChannelSubdirectory(item) if not item[u'screenshot']: # If there is no screen shot then create one screenshot_mythvideo = u"%s%s - %s%s.jpg" % (vid_graphics_dirs[u'episodeimagedir'], item[u'channelTitle'], item[u'title'], graphic_suffix[u'episodeimagedir']) try: result = takeScreenShot(item[u'videoFilename'], screenshot_mythvideo, size_limit=False) except: result = None if result != None: item[u'screenshot'] = screenshot_mythvideo tmp_array = createVideometadataRecord(item) videometadata = tmp_array[0] oldrecorded = tmp_array[1] if simulation: logger.info(u"Simulation: Create videometadata record for (%s - %s)" % (item[u'channelTitle'], item[u'title'])) else: intid = mythvideo.getMetadataId(videometadata[u'filename']) # Check for duplicates if intid == None: intid = mythvideo.setMetadata(videometadata, id=None) if not intid: logger.critical(u"Adding Miro video to MythVideo (%s - %s) failed." % (item[u'channelTitle'], item[u'title'])) sys.exit(False) if not item.has_key(u'copied'): setRecord(u'oldrecorded', oldrecorded, channel_id, delete=False, id=None) if videometadata[u'filename'][0] == u'/': cmd = mythcommflag_videos % videometadata[u'filename'] elif videometadata[u'host'] and storagegroups[u'mythvideo']: cmd = mythcommflag_videos % ((storagegroups[u'mythvideo']+videometadata[u'filename'])) #subprocess.call(u'%s' % cmd, shell=True) # Seek table creation disabled statistics[u'Miros_MythVideos_added']+=1 statistics[u'Total_Miro_expiring']+=1 statistics[u'Total_Miro_MythVideos']+=1 displayMessage(u"Added Miro video to MythVideo (%s - %s)" % (videometadata[u'title'], videometadata[u'subtitle'])) else: sys.stdout.write(u'') displayMessage(u"Skipped adding a duplicate Miro video to MythVideo:\n(%s - %s)\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime.\n" % (videometadata[u'title'], videometadata[u'subtitle'])) return True # end updateMythVideo()
0f178cb606ce1cfb96840e30bd489d420b041e6d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/0f178cb606ce1cfb96840e30bd489d420b041e6d/mirobridge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12062, 451, 10083, 12, 3319, 4672, 9163, 986, 471, 1430, 8005, 451, 10083, 3853, 364, 6599, 329, 490, 11373, 776, 19871, 18, 1436, 471, 1430, 16754, 4716, 358, 490, 11373, 776, 19871...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12062, 451, 10083, 12, 3319, 4672, 9163, 986, 471, 1430, 8005, 451, 10083, 3853, 364, 6599, 329, 490, 11373, 776, 19871, 18, 1436, 471, 1430, 16754, 4716, 358, 490, 11373, 776, 19871...
if inspect.ismethod(object): object = object.im_func
realname = object.__name__ name = name or realname note = '' if inspect.ismethod(object): if not clname: if object.im_self: note = ' method of %s' % self.repr(object.im_self) else: note = ' unbound %s method' % object.im_class.__name__ object = object.im_func if name == realname: title = self.bold(realname) else: title = self.bold(name) + ' = ' + realname
def docroutine(self, object): """Produce text documentation for a function or method object.""" if inspect.ismethod(object): object = object.im_func if inspect.isbuiltin(object): decl = self.bold(object.__name__) + '(...)' else: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec doc = getdoc(object) if doc: return decl + '\n' + rstrip(self.indent(doc)) + '\n' else: return decl + '\n'
2c3f3ddf9452a1f3f228e0d8c7abdbeed214a6b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2c3f3ddf9452a1f3f228e0d8c7abdbeed214a6b7/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 22640, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 445, 578, 707, 733, 12123, 2863, 529, 273, 733, 16186, 529, 972, 508, 273, 508, 578, 2863, 529, 4721, 273, 875, 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, 997, 22640, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 445, 578, 707, 733, 12123, 2863, 529, 273, 733, 16186, 529, 972, 508, 273, 508, 578, 2863, 529, 4721, 273, 875, 3...
main_urls = {} others_urls = {} cern_urls = {}
main_urls = {} others_urls = {} if CFG_CERN_SITE: cern_urls = {}
def format(bfo, style, separator='; '): """ This is the default format for formatting full-text reference. @param separator the separator between urls. @param style CSS class of the link """ urls = bfo.fields("8564_") ret = "" #ret += "%s<br />" % urls bibarchive = BibRecDocs(bfo.recID) old_version_there = False main_urls = {} others_urls = {} cern_urls = {} additionals = False for complete_url in urls: if complete_url.has_key('u'): url = complete_url['u'] descr = '' #ret += "1 descr=%s<br />" % descr if complete_url.has_key('z'): #ret += "2 descr=%s<br />" % descr descr = complete_url['z'] #ret += "3 descr=%s<br />" % descr elif complete_url.has_key('y'): #ret += "2 descr=%s<br />" % descr descr = complete_url['y'] #ret += "3 descr=%s<br />" % descr #ret += "4 descr=%s<br />" % descr if not url.startswith(weburl): #ret += "%s doesn't start with %s<br />" % (url, weburl) #ret += "5 descr=%s<br />" % descr if not descr: if '/setlink?' in url: descr = "Fulltext" else: #ret += "6 descr=%s<br />" % descr descr = url.split('/')[-1] #ret += "7 descr=%s<br />" % descr #ret += "8 descr=%s<br />" % descr if 'cern.ch' in url: cern_urls[url] = descr else: others_urls[url] = descr else: #ret += "%s starts with %s!!!<br />" % (url, weburl) filename = url.split('/')[-1] name = file_strip_ext(filename) format = filename[len(name):] if format and format[0] == '.': format = format[1:] #ret += "%s -> (%s, %s, %s)<br />" % (url, filename, name, format) assigned = False for doc in bibarchive.listBibDocs(): if int(doc.getLatestVersion()) > 1: old_version_there = True #ret += "Sto operando sul file %s" % doc #ret += "%s<br />" % [f.fullname for f in doc.listAllFiles()] if filename in [f.fullname for f in doc.listAllFiles()]: assigned = True #ret += " --> ok!!!<br />" if not doc.type == 'Main': additionals = True #ret += "Additionals?!<br />" else: #ret += "Main!!!<br />" #ret += "9 descr=%s<br />" % descr if not descr: #ret += "10 descr=%s<br />" % descr descr = 'Main file(s)' #ret += "11 descr=%s<br />" % descr #ret += "12 descr=%s<br />" % descr if not main_urls.has_key(descr): main_urls[descr] = [] #ret += "Appendo a %s (%s, %s)<br />" % (descr, url, format) main_urls[descr].append((url, name, format)) if not assigned: if not descr: descr = url.split('/')[-1] others_urls[url] = descr if style != "": style = 'class="'+style+'"' # Build urls list. # Escape special chars for <a> tag value. additional_str = '' if additionals: additional_str = ' <small>(<a '+style+' href="'+weburl+'/record/'+str(bfo.recID)+'/files/">additional files</a>)</small>' versions_str = '' if old_version_there: versions_str = ' <small>(<a '+style+' href="'+weburl+'/record/'+str(bfo.recID)+'/files/">older versions</a>)</small>' if main_urls: last_name = "" for descr, urls in main_urls.items(): ret += "<strong>"+descr+":</strong> " url_list = [] urls.sort(lambda (url1, name1, format1), (url2, name2, format2): url1 < url2 and -1 or url1 > url2 and 1 or 0) for url, name, format in urls: if not name == last_name and len(urls) > 1: print_name = "<em>%s</em> - " % name else: print_name = "" last_name = name url_list.append(print_name + '<a '+style+' href="'+escape(url)+'">'+format.upper()+'</a>') ret += separator.join(url_list) + additional_str + versions_str + '<br />' if cern_urls: ret += '<strong>CERN links</strong>: ' url_list = [] for url,descr in cern_urls.items(): url_list.append('<a '+style+' href="'+escape(url)+'">'+escape(str(descr))+'</a>') ret += separator.join(url_list) + '<br />' if others_urls: ret += '<strong>External links</strong>: ' url_list = [] for url,descr in others_urls.items(): url_list.append('<a '+style+' href="'+escape(url)+'">'+escape(str(descr))+'</a>') ret += separator.join(url_list) + '<br />' if ret.endswith('<br />'): ret = ret[:-len('<br />')] return ret
078f6396e8ebf59ff7f320b6486f57ac2d0b485d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2763/078f6396e8ebf59ff7f320b6486f57ac2d0b485d/bfe_fulltext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 12, 70, 617, 16, 2154, 16, 4182, 2218, 31, 296, 4672, 3536, 1220, 353, 326, 805, 740, 364, 10407, 1983, 17, 955, 2114, 18, 632, 891, 4182, 326, 4182, 3086, 6903, 18, 632, 891, 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, 740, 12, 70, 617, 16, 2154, 16, 4182, 2218, 31, 296, 4672, 3536, 1220, 353, 326, 805, 740, 364, 10407, 1983, 17, 955, 2114, 18, 632, 891, 4182, 326, 4182, 3086, 6903, 18, 632, 891, 2...
title = report_xml.name
def create(self, cr, uid, ids, data, context=None): logo = None if not context: context={} context = context.copy()
6624124758ebd759cd9b4edda57eebdd213305a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/6624124758ebd759cd9b4edda57eebdd213305a8/report_sxw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 501, 16, 819, 33, 7036, 4672, 19128, 273, 599, 309, 486, 819, 30, 819, 12938, 819, 273, 819, 18, 3530, 1435, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 501, 16, 819, 33, 7036, 4672, 19128, 273, 599, 309, 486, 819, 30, 819, 12938, 819, 273, 819, 18, 3530, 1435, 2, -100, -100, -100, -10...
print "imregion -- OptionError: ", e return None retValue={} try: axes=getimaxes(imagename) csys = None ia.open( imagename ) csys=ia.coordsys() axisTypes=csys.axiscoordinatetypes() axisNames=csys.names()
print "imregion -- OptionError: ", e return None retValue={} try: axes=getimaxes(imagename) csys = None ia.open( imagename ) csys=ia.coordsys() axisTypes=csys.axiscoordinatetypes() axisNames=csys.names()
def imregion(imagename='', spectral='', stokes='', box='', poly='', circ='', dropExtra=False): """Helper task for seleting regions in images The end user should never see this task, and this code should move to C++ once a comfortable region selection as been agreed upon. """ a=inspect.stack() stacklevel=0 for k in range(len(a)): if (string.find(a[k][1], 'ipython console') > 0): stacklevel=k myf=sys._getframe(stacklevel).f_globals ####local params ia=myf['ia'] cs=myf['cs'] rg=myf['rg'] casalog=myf['casalog'] ### #Add type/menu/range error checking here arg_names=['imagename','spectral','stokes','box','poly','circ'] arg_values=[imagename,spectral,stokes,box,poly,circ] arg_types=[str,(list,str),str,str,str,str,str] #parameter_printvalues(arg_names,arg_values,arg_types) try: parameter_checktype(arg_names,arg_values,arg_types) except TypeError, e: print "imregion -- TypeError: ", e return None except ValueError, e: print "imregion -- OptionError: ", e return None # Now we get to the heart of the script!!! retValue={} try: # Find where the directional, stokes, and spectral # axies are. axes=getimaxes(imagename) # Initialize the coordinate system for the region # we are about to create csys = None ia.open( imagename ) csys=ia.coordsys() # Find where the directional and channel axies are # Save the internal placement of the axies in a list # (which will be in the following order: # direction1: RA, Longitude # direction2: DEC, Lattitude # spectral: chan~chan;>chan;<chan;chan,chan,chan # stokes: I or V axisTypes=csys.axiscoordinatetypes() axisNames=csys.names() stokesValues=[] if ( len(axes[3][1] ) > 0 ): stokesValues=csys.stokes() # Warn user if they've given a selection for an axis # that doesn't exist. if ( len(stokes) > 0 and axes[3][0]=='' ): casalog.post( 'Image file '+imagename+" doesn't have a stokes axis, but stokes values given.", 'WARN' ) if ( len(spectral) > 0 and axes[2][0]=='' ): casalog.post( 'Image file '+imagename+" doesn't have a spectral axis, but spectral values given.", 'WARN' ) #TODO HANDLE a SINGLE DIRECTIONAL AXIS # Get the min/max values for each axis, in pixels # This will be used as the default value if the user # doesn't supply one. # TODO use world coordiates values, when wbox and wpolygon # work. The min/max values will be in blcf, and trcf fullSize=ia.boundingbox(ia.setboxregion()) mins=fullSize['blc'] maxs=fullSize['trc'] # When extracting the coordinates from the user input # that if no units were given that values given are # pixel values. Also note that a ! at the end of a # region indicates that the region is to be not selected. # Initialize our list of regions to start. regions={} # Loop through the list of boxes selecting the region # as specified by the user. ';' separates box specifiations # ',' separtes the coordinate positions. Boxes are # specified in blc, trc coordinats. boxes=[];pols=[];spects=[]; if ( len(box) > 0 ): boxes=box.split(';') pols=[] if ( len(stokes) > 0 ): if ( stokes.count(',') > 0 ): pols=stokes.split(','); else: # We have a string of values that we want toe # make into a list. pols=_make_pol_list( stokes, stokesValues ) pols=_sort_pol_list( pols, stokesValues ) tmpSpects=[] spects=[] if ( len(spectral) > 0 ): if ( spectral.count( ';' ) < 1 ): tmpSpects=spectral.split(',') else: tmpSpects=spectral.split(';') for i in range( len(tmpSpects) ): chanSet=tmpSpects[i].split(',') if ( len( chanSet ) == 1 ): spects.append( chanSet[0] ) else: for j in range( len( chanSet ) ): spects.append( chanSet[j] ) numNewRegions=1 if ( len(boxes) > 0 ): numNewRegions*=len(boxes) if ( len(pols) > 0 and axes[3][0]!='' ): numNewRegions*=len(pols) if ( len(spects) > 0 and axes[2][0]!='' ) : numNewRegions*=len(spects) for regIndex in range( numNewRegions ): # Initialze the bottom-left and top-right coordinates and indexes blc=[] trc=[] for j in range( len( axes ) ): if axes[j][0]=='': # This axes was not found so keep don't add it continue; blc.append('') trc.append('') if ( len(boxes) > 0 ): boxIndex = regIndex % len(boxes) else: boxIndex = -1; if ( len(spects) > 0 and axes[2][0]!=''): specIndex = regIndex % len(spects) else: specIndex = -1; if ( len(pols) > 0 and axes[3][0]!='' ): polIndex = regIndex % len(pols) else: polIndex = -1; if ( boxIndex >= 0 ): # Strip of any leading/trailing square braces. theBox = boxes[boxIndex]; if ( theBox[0]=='[' ): theBox=theBox[1:] if ( theBox[len(theBox)-1]==']' ): theBox=theBox[0:-1] coords = theBox.split(',') if ( len( coords ) != 4 ) : raise Exception, "Illegal box coordinates: "+box+". Expected four values representing the\n\tbottom-left corner and the top-right corner" continue # If the coord. is an int type then its a pixel value. # and we need to add the units. # TODO add a check that they are all the same units # CURRENTLY ONLY SUPPORT PIXEL VALUES! if ( not _imregion_units_given(coords) ): #for coordIndex in range( len( coords ) ): # coords[coordIndex]+='pix' no_op='noop' else: raise Exception, "Sorry! Coordinates are accepted in pixel values only" if ( int(coords[0]) >= mins[axes[0][0]] and int(coords[0]) <= maxs[axes[0][0]] ) : blc[axes[0][0]]=int(coords[0]) elif( int(coords[0]) == -1 ): blc[axes[0][0]] = mins[axes[0][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[0] + ".\nExpected values in the range " \ + str(mins[axes[0][0]]) + " to " \ + str(maxs[axes[0][0]]) if ( int(coords[1]) >= mins[axes[1][0]] and int(coords[1]) <= maxs[axes[1][0]] ): blc[axes[1][0]]=int(coords[1]) elif( int(coords[1]) == -1 ): blc[axes[1][0]] = mins[axes[1][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[1] + ".\nExpected values in the range " \ + str(mins[axes[1][0]]) + " to " \ + str(maxs[axes[1][0]]) if ( int(coords[2]) >= mins[axes[0][0]] and int(coords[2]) <= maxs[axes[0][0]] ): trc[axes[0][0]]=int(coords[2]) elif( int(coords[2]) == -1 ): trc[axes[0][0]] = maxs[axes[0][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[2] + ".\nExpected values in the range " \ + str(mins[axes[0][0]]) + " to "\ + str(maxs[axes[0][0]]) if ( len(stokesValues) > 0 ): if ( int(coords[3]) >= mins[axes[1][0]] and int(coords[3]) <= maxs[axes[1][0]] ): trc[axes[1][0]]=int(coords[3]) elif( int(coords[2]) == -1 ): trc[axes[1][0]] = maxs[axes[1][0]] else: raise Exception, "Out of range box pixel coordinate: " \ + coords[3] + ".\nExpected values in the range " \ + str(mins[axes[1][0]]) + " to "\ + str(maxs[axes[1][0]]) elif ( not dropExtra ): blc[axes[0][0]]=mins[axes[0][0]] blc[axes[1][0]]=mins[axes[1][0]] trc[axes[0][0]]=maxs[axes[0][0]] trc[axes[1][0]]=maxs[axes[1][0]] else: # We don't want to keep this axis so don't add it. noop='noop' if ( ( specIndex < 0 or axes[2][0]=='' ) and dropExtra): # We don't want to keep this axis so don't add it. noop='noop' elif ( specIndex >= 0 and axes[2][0]!=''): #Parse the spectral values, we are # expecting to get a min and max value. values=__parse_spectral(spects[specIndex],str(mins[axes[2][0]]),str(maxs[axes[2][0]]) ) #print "SPECTRAL VALS: ", values if ( values[0] == -1 ): blc[axes[2][0]]=mins[axes[2][0]] else: blc[axes[2][0]]=values[0] if ( values[1] == -1 ): trc[axes[2][0]]=maxs[axes[2][0]] else: trc[axes[2][0]]=values[1] elif ( axes[2][0]!='' ): blc[axes[2][0]]=mins[axes[2][0]] trc[axes[2][0]]=maxs[axes[2][0]] if ( ( polIndex < 0 or axes[3][0]=='' ) and dropExtra ): # We don't want to keep this axis so don't add it. noop='noop' elif ( polIndex >= 0 and axes[2][0]!='' ): # Parse to get this into a pixel value. # Note that we could do this more efficiently, # we could make a region that inlcudes a range of # polarization/stokes values rather then a single value. polVals=_parse_stokes( stokesValues, pols[polIndex],mins[axes[3][0]],maxs[axes[3][0]] ) if ( len(stokesValues) > 0 and polVals[0] == -1 ): blc[axes[3][0]]=mins[axes[3][0]] else: blc[axes[3][0]]=polVals[0] if ( polVals[1] == -1 ): trc[axes[3][0]]=maxs[axes[3][0]] else: trc[axes[3][0]]=polVals[1] elif ( len(stokesValues) > 0 and axes[3][0]!='' ): blc[axes[3][0]]=mins[axes[3][0]] trc[axes[3][0]]=maxs[axes[3][0]] # Create a strings for the wbox command. # For now we assume they are all pixel values, because # this is all we allow. blcStr='' for i in range( len(blc) ): if ( i > 0 ): blcStr+=',' if ( isinstance( blc[i], str ) ): blcStr+=blc[i]+"pix" else: blcStr+=str(blc[i])+"pix" trcStr='' for i in range( len(trc) ): if ( i > 0 ): trcStr+=',' if ( isinstance( trc[i], str ) ): trcStr+=trc[i]+"pix" else: trcStr+=str(trc[i])+"pix" #print "BLC STR: ", blcStr #print "TRC STR: ", trcStr #tmpRegion=rg.box( blc=blc, trc=trc ) tmpRegion=rg.wbox( blc=blcStr, trc=trcStr, csys=csys.torecord() ) regions["region"+str(len(regions))]=tmpRegion casalog.post( "Created Box at: "+str(blc)+" "+str(trc),'DEBUGGING','imregion') # Loop through the list of boxes selecting the region # as specified by the user. ';' separates box specifiations # ',' separtes the coordinate positions. Boxes are # specified in blc, trc coordinates. polys=[]; if ( len(poly) > 0 ): polys=poly.split(';') if ( len(polys)>0 and (len(pols)>0 or len(spects)>0 ) ): casalog.post( 'Sorry! Polygon region supports selection on the directional axes only', 'WARNING', 'imregion') for regIndex in range( len(polys) ): # Loop through the list of values, breaking them into # a list of x and a list of y values. current=polys[regIndex] xVals='' yVals='' for coord in range( 1, len(current), 2 ): if ( coord > 1 ): xVals+=',' yVals+=',' if ( not current[coord].isdigit() ): xVals+=current[coord]+"pix" else: xVals+=current[coord] if ( not current[coord+1].isdigit() ): yVals+=current[coord+1]+"pix" else: yVals+=current[coord+1] tmpRegion=rg.wpolygon( xVals, yVals, csys=csys.torecord() ) regions["region"+str(len(rgs))]=tmpRegion casalog.post("Created polygon region with: "+xVals+"\n\t"+YVals, 'DEBUGGING', 'imregion' ); # Loop through the list of circles selecting the region # as specified by the user. ';' separates box specifiations # ',' separtes the coordinate positions. Boxes are # specified in blc, trc coordinates. if ( len(circ) > 0 ): casalog.post( "Sorry, circle selection is not supported yet!", "WARNING", 'imregion' ) # Cleanup time if ( csys != None ): del csys if ( ia.isopen() ): ia.close() if ( len(regions) > 1 ): retValue = rg.makeunion( regions ) else: retValue=regions['region0'] return retValue except Exception, instance: print '*** Error ***',instance return
a69d01757f03ee69e74cf5758fa605dd04201481 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/a69d01757f03ee69e74cf5758fa605dd04201481/imregion.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 709, 6858, 12, 15374, 1069, 2218, 2187, 30066, 2218, 2187, 384, 601, 281, 2218, 2187, 3919, 2218, 2187, 7573, 2218, 2187, 18956, 2218, 2187, 3640, 7800, 33, 8381, 4672, 3536, 2276, 1562, 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, 709, 6858, 12, 15374, 1069, 2218, 2187, 30066, 2218, 2187, 384, 601, 281, 2218, 2187, 3919, 2218, 2187, 7573, 2218, 2187, 18956, 2218, 2187, 3640, 7800, 33, 8381, 4672, 3536, 2276, 1562, 3...
self.assert_completion_in_result('SampleClass', 'local', result)
self.assert_completion_in_result('SampleClass', 'imported', result)
code = 'def f():\n from samplemod import SampleClass\n Sample'
6d539fe256ff5d47931d765fcb7729894783cbf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8286/6d539fe256ff5d47931d765fcb7729894783cbf0/codeassisttest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 981, 273, 296, 536, 284, 1435, 5581, 82, 565, 628, 3296, 1711, 1930, 11474, 797, 64, 82, 565, 11474, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 981, 273, 296, 536, 284, 1435, 5581, 82, 565, 628, 3296, 1711, 1930, 11474, 797, 64, 82, 565, 11474, 11, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
urlopen("http://localhost:%s" % server.server_port)
urllib.urlopen("http://localhost:%s" % server.server_port)
def run_server(timeout=10): server = HTTPServer(("", 0), RequestHandler) server.command_queue = Queue() server.result_queue = Queue() t = Thread(target=server.serve_forever) t.daemon = True t.start() start = time() while time() - start < timeout: try: urlopen("http://localhost:%s" % server.server_port) break except IOError: sleep(0.1) else: raise RemoteDriverServerException("Can't open server after %s seconds" % timeout) return server
563075fc312ca81e58d3375ebcf1f0b67220129b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3778/563075fc312ca81e58d3375ebcf1f0b67220129b/driver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3567, 12, 4538, 33, 2163, 4672, 1438, 273, 2239, 2081, 12, 2932, 3113, 374, 3631, 25106, 13, 1438, 18, 3076, 67, 4000, 273, 7530, 1435, 1438, 18, 2088, 67, 4000, 273, 7530, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3567, 12, 4538, 33, 2163, 4672, 1438, 273, 2239, 2081, 12, 2932, 3113, 374, 3631, 25106, 13, 1438, 18, 3076, 67, 4000, 273, 7530, 1435, 1438, 18, 2088, 67, 4000, 273, 7530, 1...
self.local_wm_publish = 1
def __init__(self, queue_name, nst): ntype = nst['node_type'] ctype = nst['combined_type'] if ntype == 'root': self.global_wm_event = 1 elif ntype == 'branch': self.target_queue = queue_name self.process_batch = 1 self.process_events = 1 self.copy_events = 1 self.process_tick_event = 1 self.local_wm_publish = 1 self.keep_event_ids = 1 self.create_tick = 1 elif ntype == 'leaf' and not ctype: self.process_batch = 1 self.process_events = 1 elif ntype == 'leaf' and ctype: self.target_queue = nst['combined_queue'] if ctype == 'root': self.process_batch = 1 self.process_events = 1 self.copy_events = 1 self.filtered_copy = 1 self.send_tick_event = 1 elif ctype == 'branch': self.process_batch = 1 self.wait_behind = 1 else: raise Exception('invalid state 1') else: raise Exception('invalid state 2') if ctype and ntype != 'leaf': raise Exception('invalid state 3')
0801a025297e412cc142680798bdd01d2d887f88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14597/0801a025297e412cc142680798bdd01d2d887f88/worker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2389, 67, 529, 16, 290, 334, 4672, 290, 723, 273, 290, 334, 3292, 2159, 67, 723, 3546, 11920, 273, 290, 334, 3292, 27458, 67, 723, 3546, 309, 290, 723, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2389, 67, 529, 16, 290, 334, 4672, 290, 723, 273, 290, 334, 3292, 2159, 67, 723, 3546, 11920, 273, 290, 334, 3292, 27458, 67, 723, 3546, 309, 290, 723, ...
return ISAPISimpleHandler(test = test)
return ISAPISimpleHandler(test)
def __ExtensionFactory__(): return ISAPISimpleHandler(test = test)
0bd79db0caa8c2755197368497fc476011b31d6f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5367/0bd79db0caa8c2755197368497fc476011b31d6f/isapi_wsgi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3625, 1733, 972, 13332, 327, 4437, 2557, 5784, 1503, 12, 3813, 13, 565, 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, 1001, 3625, 1733, 972, 13332, 327, 4437, 2557, 5784, 1503, 12, 3813, 13, 565, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
full_filename = "%s/%s" % (full_path, filename)
full_filename = "%s/%s" % (config.UPLOADDIR, filename)
def right(path, result): if result.defaults.has_key('select_all'): del result.defaults['select_all'] result.refresh(0,result.defaults, pane='parent')
66ae5088b787b9172e393fc5e5de740e113ca58e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5568/66ae5088b787b9172e393fc5e5de740e113ca58e/UI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2145, 12, 803, 16, 563, 4672, 309, 563, 18, 7606, 18, 5332, 67, 856, 2668, 4025, 67, 454, 11, 4672, 1464, 563, 18, 7606, 3292, 4025, 67, 454, 3546, 563, 18, 9144, 12, 20, 16, 2088, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2145, 12, 803, 16, 563, 4672, 309, 563, 18, 7606, 18, 5332, 67, 856, 2668, 4025, 67, 454, 11, 4672, 1464, 563, 18, 7606, 3292, 4025, 67, 454, 3546, 563, 18, 9144, 12, 20, 16, 2088, ...
parms = { "users" : users, "addUserUrl" : "/admin/addUser" } ]
parms = { "users" : users, "addUserUrl" : "/admin/addUser" }
def index(self): if not self._userIsAdmin(): return self.writeErrorPage("Access denied.")
ddbe99d24e4cd781bba9931758010980e76b7ac9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2223/ddbe99d24e4cd781bba9931758010980e76b7ac9/page_admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 12, 2890, 4672, 309, 486, 365, 6315, 1355, 2520, 4446, 13332, 327, 365, 18, 2626, 668, 1964, 2932, 1862, 15338, 1199, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 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, 770, 12, 2890, 4672, 309, 486, 365, 6315, 1355, 2520, 4446, 13332, 327, 365, 18, 2626, 668, 1964, 2932, 1862, 15338, 1199, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if packet.data is not None:
if packet.data not in [None, packet]:
def chain(self): """Return the packet and its next packets as a chain.""" chain = Chain([]) packet = self done = False while not done: packet._head = chain chain.append(packet) if packet.data is not None: packet = packet.data else: done = True return chain
c8af68eb9444106d89e71081576453b7e04d8bee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5910/c8af68eb9444106d89e71081576453b7e04d8bee/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2687, 12, 2890, 4672, 3536, 990, 326, 4414, 471, 2097, 1024, 12640, 487, 279, 2687, 12123, 2687, 273, 7824, 3816, 5717, 4414, 273, 365, 2731, 273, 1083, 1323, 486, 2731, 30, 4414, 6315, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2687, 12, 2890, 4672, 3536, 990, 326, 4414, 471, 2097, 1024, 12640, 487, 279, 2687, 12123, 2687, 273, 7824, 3816, 5717, 4414, 273, 365, 2731, 273, 1083, 1323, 486, 2731, 30, 4414, 6315, ...
from AccessControl.User import nobody if aq_base(getSecurityManager().getUser()) is aq_base(nobody): raise 'Unauthorized', ( 'You are not authorized to view this object.')
def manage_workspace(self, REQUEST): """Dispatch to first interface in manage_options """ from AccessControl.User import nobody if aq_base(getSecurityManager().getUser()) is aq_base(nobody): # No authentication credentials presented. raise 'Unauthorized', ( 'You are not authorized to view this object.') options=self.filtered_manage_options(REQUEST) try: m=options[0]['action'] if m=='manage_workspace': raise TypeError except: raise 'Unauthorized', ( 'You are not authorized to view this object.<p>')
4ffa7ebb313d6db69f04197aa4804a104044af33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4ffa7ebb313d6db69f04197aa4804a104044af33/Management.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 14915, 12, 2890, 16, 12492, 4672, 3536, 5325, 358, 1122, 1560, 316, 10680, 67, 2116, 3536, 628, 24349, 18, 1299, 1930, 290, 947, 973, 309, 279, 85, 67, 1969, 12, 588, 4368, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 14915, 12, 2890, 16, 12492, 4672, 3536, 5325, 358, 1122, 1560, 316, 10680, 67, 2116, 3536, 628, 24349, 18, 1299, 1930, 290, 947, 973, 309, 279, 85, 67, 1969, 12, 588, 4368, ...
(quote(project_unixname),quote(project_description),quote(project_name)))
(quote(project_unixname or ''),quote(project_description or ''),quote(project_name or '')))
def register(self, project_unixname=None, project_description=None, project_name=None, **kw): require(has_neighborhood_access('create', self.neighborhood), 'Create access required') try: p = self.neighborhood.register_project(project_unixname.lower()) except forge_exc.ProjectConflict: flash( 'A project already exists with that name, please choose another.', 'error') ming.orm.ormsession.ThreadLocalORMSession.close_all() redirect('add_project?project_unixname=%s&project_description=%s&project_name=%s' % (quote(project_unixname),quote(project_description),quote(project_name))) except Exception, ex: c.project = None ming.orm.ormsession.ThreadLocalORMSession.close_all() flash('%s: %s' % (ex.__class__, str(ex)), 'error') redirect('add_project?project_unixname=%s&project_description=%s&project_name=%s' % (quote(project_unixname),quote(project_description),quote(project_name))) if project_name: p.name = project_name if project_description: p.short_description = project_description c.project = p ming.orm.ormsession.ThreadLocalORMSession.flush_all() # require(has_project_access('tool')) for i, tool in enumerate(kw): if kw[tool]: p.install_app(tool, ordinal=i) flash('Welcome to the SourceForge Beta System! ' 'To get started, fill out some information about your project.') redirect(p.script_name + 'admin/overview')
e9d2141cb3c2c4df2ead613c03033b485de27351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/e9d2141cb3c2c4df2ead613c03033b485de27351/project.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 12, 2890, 16, 1984, 67, 21136, 529, 33, 7036, 16, 1984, 67, 3384, 33, 7036, 16, 1984, 67, 529, 33, 7036, 16, 2826, 9987, 4672, 2583, 12, 5332, 67, 18168, 19619, 67, 3860, 2668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 12, 2890, 16, 1984, 67, 21136, 529, 33, 7036, 16, 1984, 67, 3384, 33, 7036, 16, 1984, 67, 529, 33, 7036, 16, 2826, 9987, 4672, 2583, 12, 5332, 67, 18168, 19619, 67, 3860, 2668, ...
logging.shutdown()
sys.stdout.flush() sys.stderr.flush()
def parse_config(file): """Parse the config file into the `config' global variable.""" global config config = ConfigParser.SafeConfigParser() try: config.readfp(open(file)) except Exception, e: print('error parsing %s config file: %s' % (file, e)) logging.shutdown() sys.exit(1)
2b2b5839b23008a8980ab8eeeca606297c51c416 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4157/2b2b5839b23008a8980ab8eeeca606297c51c416/route53d.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1425, 12, 768, 4672, 3536, 3201, 326, 642, 585, 1368, 326, 1375, 1425, 11, 2552, 2190, 12123, 225, 2552, 642, 642, 273, 25076, 18, 9890, 809, 2678, 1435, 225, 775, 30, 642, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1425, 12, 768, 4672, 3536, 3201, 326, 642, 585, 1368, 326, 1375, 1425, 11, 2552, 2190, 12123, 225, 2552, 642, 642, 273, 25076, 18, 9890, 809, 2678, 1435, 225, 775, 30, 642, 1...
vList.append(Violation(self, line.number, "Contains non-leading underscore"))
vList.append(Violation(self, line, "Contains non-leading underscore"))
def apply(self, lines): vList = [] for line in lines: if (self.getFiletype() in self.getTypeList()): for functionName in line.functionNames: # check of upper case start if re.search("^[A-Z]", functionName): vList.append(Violation(self, line.number, "Starts uppercase")) # check for underscores hasUnderscore = re.search("_", functionName) hasNonLeadingUnderscore = re.search("[^_]_", functionName) hasLeadingUnderscore = re.search("^_", functionName) if (not line.inPrivate and hasUnderscore): vList.append(Violation(self, line.number, "Contains underscore")) if (line.inPrivate and hasNonLeadingUnderscore): vList.append(Violation(self, line.number, "Contains non-leading underscore")) return vList
cb6d1c1b9da3a15f55b42e7ffc55f274aee325d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6529/cb6d1c1b9da3a15f55b42e7ffc55f274aee325d2/style.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 12, 2890, 16, 2362, 4672, 331, 682, 273, 5378, 364, 980, 316, 2362, 30, 309, 261, 2890, 18, 588, 25579, 5872, 1435, 316, 365, 18, 588, 559, 682, 1435, 4672, 364, 14117, 316, 980,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 12, 2890, 16, 2362, 4672, 331, 682, 273, 5378, 364, 980, 316, 2362, 30, 309, 261, 2890, 18, 588, 25579, 5872, 1435, 316, 365, 18, 588, 559, 682, 1435, 4672, 364, 14117, 316, 980,...
sub_byte_lookup = dict([(e,self.sub_byte(e)) for e in self._base])
sub_byte_lookup = dict([(e, self.sub_byte(e)) for e in self._base])
def __init__(self,n=1,r=1,c=1,e=4, star=False, **kwargs): """ Small Scale Variants of the AES.
26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 82, 33, 21, 16, 86, 33, 21, 16, 71, 33, 21, 16, 73, 33, 24, 16, 10443, 33, 8381, 16, 2826, 4333, 4672, 3536, 9425, 454, 12591, 11487, 4388, 434, 326,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 82, 33, 21, 16, 86, 33, 21, 16, 71, 33, 21, 16, 73, 33, 24, 16, 10443, 33, 8381, 16, 2826, 4333, 4672, 3536, 9425, 454, 12591, 11487, 4388, 434, 326,...
if not csel.dopipzap: append_when_current_valid(current, menu, (_("play as picture in picture"), self.playPiP), level = 0) else: append_when_current_valid(current, menu, (_("play in mainwindow"), self.playMain), level = 0)
if not config.ParentalControl.configured.value or parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1: if not csel.dopipzap: append_when_current_valid(current, menu, (_("play as picture in picture"), self.playPiP), level = 0) else: append_when_current_valid(current, menu, (_("play in mainwindow"), self.playMain), level = 0)
def __init__(self, session, csel): Screen.__init__(self, session) #raise Exception("we need a better summary screen here") self.csel = csel self.bsel = None
b95d26f80c99a5ac76526dc97665056a64c016e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/b95d26f80c99a5ac76526dc97665056a64c016e2/ChannelSelection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 468, 11628, 1185, 2932, 1814, 1608, 279, 7844, 4916, 5518, 2674, 7923, 365, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 468, 11628, 1185, 2932, 1814, 1608, 279, 7844, 4916, 5518, 2674, 7923, 365, 18,...
os.chown(dst, stats[ST_UID], stats[ST_GID])
chown(dst, stats[ST_UID], stats[ST_GID])
def file(self, file): stats = os.lstat(file) old = re.sub(self.src, self.old, file) dst = re.sub(self.src, self.dst, file) ostats = os.lstat(old) if stats[ST_INO] != ostats[ST_INO]: if self.verbose: print "cp <%s> <%s>" % (file, dst) if not self.dryrun: # Copy file contents from snapshot to destination. shutil.copyfile(file, dst) # Copy the permissions and accessed/modified times. shutil.copystat(file, dst) # Copy the owner/group values to destination. os.chown(dst, stats[ST_UID], stats[ST_GID]) else: odst = re.sub(self.old, self.dst, file) if self.verbose: print "ln <%s> <%s>" % (dst, odst) if not self.dryrun: # Create hard link in destination. os.link(dst, odst)
49fd5edac5f277d9462e3515d4fbc728abe96be9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6391/49fd5edac5f277d9462e3515d4fbc728abe96be9/timecopy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 585, 12, 2890, 16, 585, 4672, 3177, 273, 1140, 18, 80, 5642, 12, 768, 13, 1592, 273, 283, 18, 1717, 12, 2890, 18, 4816, 16, 365, 18, 1673, 16, 585, 13, 3046, 273, 283, 18, 1717, 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, 585, 12, 2890, 16, 585, 4672, 3177, 273, 1140, 18, 80, 5642, 12, 768, 13, 1592, 273, 283, 18, 1717, 12, 2890, 18, 4816, 16, 365, 18, 1673, 16, 585, 13, 3046, 273, 283, 18, 1717, 12...
self.movieResetAction.setIconSet(QIconSet(self.image93))
self.movieResetAction.setIconSet(QIconSet(self.image94))
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
1fffefaa2964961cbc9adc237e2fedcbaf53df97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/1fffefaa2964961cbc9adc237e2fedcbaf53df97/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...
if(header[0] == None): print "File: " + current_file print "Block:\n" + current_block
if header[0] == None: print "File: " + current_file print "Block:\n" + current_block
def process(data): """Processes a wiki block."""
a6feb1e5c52929a2b7bcc20a424e929b737f2517 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9355/a6feb1e5c52929a2b7bcc20a424e929b737f2517/wiki_grabber.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 892, 4672, 3536, 10599, 279, 9050, 1203, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 892, 4672, 3536, 10599, 279, 9050, 1203, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
i = 0 lines = [] while True: n = text.find('\n', i) if n == -1: last = text[i:] if last: lines.append(last) return lines lines.append(text[i:keepends and n+1 or n]) i = n + 1
lines = [l + '\n' for l in text.split('\n')] if lines: if lines[-1] == '\n': lines.pop() else: lines[-1] = lines[-1][:-1] return lines
def splitnewlines(text, keepends=False): '''like str.splitlines, but only split on newlines.''' i = 0 lines = [] while True: n = text.find('\n', i) if n == -1: last = text[i:] if last: lines.append(last) return lines lines.append(text[i:keepends and n+1 or n]) i = n + 1
e99d580fc3edff0d8d094225a948cd03287d7622 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/e99d580fc3edff0d8d094225a948cd03287d7622/mdiff.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 31276, 12, 955, 16, 3455, 5839, 33, 8381, 4672, 9163, 5625, 609, 18, 4939, 3548, 16, 1496, 1338, 1416, 603, 19181, 1093, 6309, 2362, 273, 306, 80, 397, 2337, 82, 11, 364, 328, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 31276, 12, 955, 16, 3455, 5839, 33, 8381, 4672, 9163, 5625, 609, 18, 4939, 3548, 16, 1496, 1338, 1416, 603, 19181, 1093, 6309, 2362, 273, 306, 80, 397, 2337, 82, 11, 364, 328, 31...
group_orig.items -= 1 group_orig.put()
def move_items(self, group_orig, group_dest): group_items = model.GroupItem.all().filter('group', group_orig).fetch(10) counter = 0 for group_item in group_items: item_dest = model.GroupItem.all().filter('group', group_dest).filter('item', group_item.item).get() if item_dest: group_item.delete() else: group_item.group = group_dest group_item.group_title = group_dest.title group_item.group_url_path = group_dest.url_path group_item.put() group_dest.items += 1 group_dest.put() counter +=1 group_orig.items -= 1 group_orig.put() return 'Movidos %s items. Quedan %s en el grupo origen.' % (counter, group_orig.items)
9816502538ebdd78210f5d7567264a742406b25e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2580/9816502538ebdd78210f5d7567264a742406b25e/GroupMove.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 67, 3319, 12, 2890, 16, 1041, 67, 4949, 16, 1041, 67, 10488, 4672, 1041, 67, 3319, 273, 938, 18, 1114, 1180, 18, 454, 7675, 2188, 2668, 1655, 2187, 1041, 67, 4949, 2934, 5754, 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, 3635, 67, 3319, 12, 2890, 16, 1041, 67, 4949, 16, 1041, 67, 10488, 4672, 1041, 67, 3319, 273, 938, 18, 1114, 1180, 18, 454, 7675, 2188, 2668, 1655, 2187, 1041, 67, 4949, 2934, 5754, 12...
"""An AddressList encapsulates a list of parsed RFC822 addresses."""
"""An AddressList encapsulates a list of parsed RFC 2822 addresses."""
def getphraselist(self): """Parse a sequence of RFC-822 phrases.
9ec58aaef2d0124bd42e30e6029fe8a7bdb906e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9ec58aaef2d0124bd42e30e6029fe8a7bdb906e7/rfc822.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 844, 21636, 5449, 12, 2890, 4672, 3536, 3201, 279, 3102, 434, 8372, 17, 24532, 31413, 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, 336, 844, 21636, 5449, 12, 2890, 4672, 3536, 3201, 279, 3102, 434, 8372, 17, 24532, 31413, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
r"""
"""
def maximal_linear_bias_absolute(self): r""" Return maximal linear bias, i.e. how often the linear approximation with the highest bias is true or false minus $2^{n-1}$.
16527da1ddc0ac750f609cd58858c5b45d932696 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/16527da1ddc0ac750f609cd58858c5b45d932696/sbox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 943, 2840, 67, 12379, 67, 13931, 67, 12547, 12, 2890, 4672, 3536, 2000, 943, 2840, 9103, 12005, 16, 277, 18, 73, 18, 3661, 16337, 326, 9103, 24769, 598, 326, 9742, 12005, 353, 638, 578, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 943, 2840, 67, 12379, 67, 13931, 67, 12547, 12, 2890, 4672, 3536, 2000, 943, 2840, 9103, 12005, 16, 277, 18, 73, 18, 3661, 16337, 326, 9103, 24769, 598, 326, 9742, 12005, 353, 638, 578, ...
self.cookieCutterDashboard.setGeometry(QRect(0,0,678,29))
self.cookieCutterDashboard.setGeometry(QRect(0,0,679,29))
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
1fffefaa2964961cbc9adc237e2fedcbaf53df97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/1fffefaa2964961cbc9adc237e2fedcbaf53df97/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...
(True, None)
True
def _normal_label(g, comb_emb, external_face): """ Helper function to schnyder method for computing coordinates in the plane to plot a planar graph with no edge crossings. Constructs a normal labelling of a triangular graph g, given the planar combinatorial embedding of g and a designated external face. Returns labels dictionary. The normal label is constructed by first contracting the graph down to its external face, then expanding the graph back to the original while simultaneously adding angle labels. INPUT: g -- the graph to find the normal labeling of (g must be triangulated) comb_emb -- a planar combinatorial embedding of g external_face -- the list of three edges in the external face of g RETURNS: x -- tuple with entries x[0] = dict of dicts of normal labeling for each vertex of g and each adjacent neighbors u,v (u < v) of vertex: { vertex : { (u,v): angel_label } } x[1] = (v1,v2,v3) tuple of the three vertices of the external face. EXAMPLES: sage: from sage.graphs.schnyder import _triangulate, _normal_label, _realizer sage: g = graphs.CycleGraph(7) sage: g.is_planar(set_embedding=True) (True, None) sage: faces = g.trace_faces(g._embedding) sage: _triangulate(g, g._embedding) [(2, 0), (4, 2), (6, 4), (5, 0), (3, 5), (1, 3), (4, 0), (3, 0)] sage: tn = _normal_label(g, g._embedding, faces[0]) sage: _realizer(g, tn) ({0: [<sage.graphs.schnyder.TreeNode instance at ...>]}, (0, 1, 2)) """ contracted = [] contractible = [] labels = {} external_vertices = [external_face[0][0], external_face[1][0], external_face[2][0]] external_vertices.sort() v1,v2,v3 = external_vertices v1_neighbors = Set(g.neighbors(v1)) neighbor_count = {} for v in g.vertices(): neighbor_count[v] = 0 for v in g.neighbors(v1): neighbor_count[v] = len(v1_neighbors.intersection( Set(g.neighbors(v)))) for v in v1_neighbors: if v in [v1,v2,v3]: continue if neighbor_count[v] == 2: contractible.append(v) # contraction phase: while g.order() > 3: try: v = contractible.pop() except: raise Exception('Contractible list is empty but graph still has %d vertices. (Expected 3.)'%g.order()) break # going to contract v v_neighbors = Set(g.neighbors(v)) contracted.append( (v, v_neighbors, v_neighbors - v1_neighbors - Set([v1])) ) g.delete_vertex(v) v1_neighbors -= Set([v]) for w in v_neighbors - v1_neighbors - Set([v1]): # adding edge (v1, w) g.add_edge( (v1, w) ) if g.order() == 3: break v1_neighbors += v_neighbors - Set([v1]) contractible = [] for w in g.neighbors(v1): if(len(v1_neighbors.intersection( Set(g.neighbors(w))))) == 2 and w not in [v1, v2, v3]: contractible.append(w) # expansion phase: v1, v2, v3 = g.vertices() #always in sorted order labels[v1] = {(v2,v3):1} labels[v2] = {(v1,v3):2} labels[v3] = {(v1,v2):3} while len(contracted) > 0: v, new_neighbors, neighbors_to_delete = contracted.pop() # going to add back vertex v labels[v] = {} for w in neighbors_to_delete: g.delete_edge((v1,w)) if len(neighbors_to_delete) == 0: # we are adding v into the face new_neighbors w1, w2, w3 = sorted(new_neighbors) labels[v] = {(w1, w2): labels[w3].pop((w1,w2)), (w2,w3) : labels[w1].pop((w2,w3)), (w1,w3) : labels[w2].pop((w1,w3))} labels[w1][tuple(sorted((w2,v)))] = labels[v][(w2,w3)] labels[w1][tuple(sorted((w3,v)))] = labels[v][(w2,w3)] labels[w2][tuple(sorted((w1,v)))] = labels[v][(w1,w3)] labels[w2][tuple(sorted((w3,v)))] = labels[v][(w1,w3)] labels[w3][tuple(sorted((w1,v)))] = labels[v][(w1,w2)] labels[w3][tuple(sorted((w2,v)))] = labels[v][(w1,w2)] else: new_neighbors_set = Set(new_neighbors) angles_out_of_v1 = set() vertices_in_order = [] l = [] for angle in labels[v1].keys(): if len(Set(angle).intersection(new_neighbors_set)) == 2: angles_out_of_v1.add(angle) l = l + list(angle) # find a unique element in l l.sort() i = 0 while i < len(l): if l[i] == l[i+1]: i = i + 2 else: break angle_set = Set(angles_out_of_v1) vertices_in_order.append(l[i]) while len(angles_out_of_v1) > 0: for angle in angles_out_of_v1: if vertices_in_order[-1] in angle: break if angle[0] == vertices_in_order[-1]: vertices_in_order.append(angle[1]) else: vertices_in_order.append(angle[0]) angles_out_of_v1.remove(angle) w = vertices_in_order # is w[0] a 2 or a 3? top_label = labels[w[0]][tuple(sorted((v1, w[1])))] if top_label == 3: bottom_label = 2 else: bottom_label = 3 i = 0 while i < len(w) - 1: labels[v][ tuple(sorted((w[i],w[i+1]))) ] = 1 labels[w[i]][ tuple(sorted( (w[i+1], v) )) ] = top_label labels[w[i+1]][ tuple(sorted( (w[i], v) )) ] = bottom_label i = i + 1 labels[v][tuple(sorted( (v1, w[0])))] = bottom_label labels[v][tuple(sorted( (v1, w[-1])))] = top_label labels[w[0]][tuple(sorted((v1,v)))] = top_label labels[w[-1]][tuple(sorted((v1,v)))] = bottom_label labels[v1][tuple(sorted( (w[0],v) ))] = 1 labels[v1][tuple(sorted( (w[-1],v) ))] = 1 #delete all the extra labels for angle in angle_set: labels[v1].pop( angle ) labels[w[0]].pop( tuple (sorted( (v1, w[1]) ) )) labels[w[-1]].pop( tuple (sorted( (v1, w[-2]) ) )) i = 1 while i < len(w) - 1: labels[w[i]].pop(tuple(sorted( (v1, w[i+1])))) labels[w[i]].pop(tuple(sorted( (v1, w[i-1])))) i = i + 1 for w in new_neighbors: g.add_edge((v,w)) return labels, (v1,v2,v3)
f3d1cb40228dc24797e724e331b6ab894dcdf8d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/f3d1cb40228dc24797e724e331b6ab894dcdf8d3/schnyder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6130, 67, 1925, 12, 75, 16, 3894, 67, 351, 70, 16, 3903, 67, 865, 4672, 3536, 9705, 445, 358, 18551, 18538, 765, 707, 364, 20303, 5513, 316, 326, 11017, 358, 3207, 279, 4995, 297,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6130, 67, 1925, 12, 75, 16, 3894, 67, 351, 70, 16, 3903, 67, 865, 4672, 3536, 9705, 445, 358, 18551, 18538, 765, 707, 364, 20303, 5513, 316, 326, 11017, 358, 3207, 279, 4995, 297,...
>>> from fudge.patcher import patch_object
>>> from fudge import patch_object
def patch_object(obj, attr_name, patched_value): """Patches an object and returns an instance of :class:`fudge.patcher.PatchHandler` for later restoration. Note that if *obj* is not an object but a path to a module then it will be imported. You may want to use a more convenient wrapper :func:`with_patched_object` or :func:`patched_context` Example:: >>> from fudge.patcher import patch_object >>> class Session: ... state = 'clean' ... >>> patched_session = patch_object(Session, "state", "dirty") >>> Session.state 'dirty' >>> patched_session.restore() >>> Session.state 'clean' """ if isinstance(obj, (str, unicode)): obj_path = obj obj = __import__(obj_path) for part in obj_path.split('.')[1:]: obj = getattr(obj, part) handle = PatchHandler(obj, attr_name) handle.patch(patched_value) return handle
277a79fe7064dcd0911bd1caba64eaf28f39d0a6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3602/277a79fe7064dcd0911bd1caba64eaf28f39d0a6/patcher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4729, 67, 1612, 12, 2603, 16, 1604, 67, 529, 16, 25786, 67, 1132, 4672, 3536, 23501, 392, 733, 471, 1135, 392, 791, 434, 294, 1106, 28288, 74, 27110, 18, 2272, 264, 18, 7332, 1503, 68,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4729, 67, 1612, 12, 2603, 16, 1604, 67, 529, 16, 25786, 67, 1132, 4672, 3536, 23501, 392, 733, 471, 1135, 392, 791, 434, 294, 1106, 28288, 74, 27110, 18, 2272, 264, 18, 7332, 1503, 68,...
vpaned.pack2(self._editor, True, True)
vpaned.pack2(ebox, True, True)
def _application_window_create(self): application_window = gtk.VBox() #application_window.move(0, 0) #application_window.set_default_size(700, -1) #gtk.window_set_default_icon_from_file(join(pixmaps_dir, # 'gazpacho-icon.png')) #application_window.connect('delete-event', self._delete_event)
fb27a8d79e9392d6a5e605cb552476bad8e3c2be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/fb27a8d79e9392d6a5e605cb552476bad8e3c2be/gazpachembed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3685, 67, 5668, 67, 2640, 12, 2890, 4672, 225, 2521, 67, 5668, 273, 22718, 18, 58, 3514, 1435, 468, 3685, 67, 5668, 18, 8501, 12, 20, 16, 374, 13, 468, 3685, 67, 5668, 18, 542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3685, 67, 5668, 67, 2640, 12, 2890, 4672, 225, 2521, 67, 5668, 273, 22718, 18, 58, 3514, 1435, 468, 3685, 67, 5668, 18, 8501, 12, 20, 16, 374, 13, 468, 3685, 67, 5668, 18, 542, ...
tzinfo = self.canonicalTimeZone(self.default) if tzinfo is not None: PyICU.TimeZone.setDefault(tzinfo.timezone)
default = self.default canonicalDefault = self.canonicalTimeZone(default) if (canonicalDefault is not None and canonicalDefault is not PyICU.ICUtzinfo.floating): PyICU.ICUtzinfo.default = canonicalDefault if canonicalDefault is not default: self.default = canonicalDefault
def onValueChanged(self, name): # Repository hook for attribute changes. if name == 'default': tzinfo = self.canonicalTimeZone(self.default) if tzinfo is not None: PyICU.TimeZone.setDefault(tzinfo.timezone)
0289eb87dd0e2382ea4db95758796d16fb0c787b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/0289eb87dd0e2382ea4db95758796d16fb0c787b/TimeZone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 620, 5033, 12, 2890, 16, 508, 4672, 468, 6281, 3953, 364, 1566, 3478, 18, 309, 508, 422, 296, 1886, 4278, 15732, 273, 365, 18, 18288, 16760, 12, 2890, 18, 1886, 13, 309, 15732, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 620, 5033, 12, 2890, 16, 508, 4672, 468, 6281, 3953, 364, 1566, 3478, 18, 309, 508, 422, 296, 1886, 4278, 15732, 273, 365, 18, 18288, 16760, 12, 2890, 18, 1886, 13, 309, 15732, 35...
import re _userprog = re.compile('^([^@]*)@(.*)$')
import re _userprog = re.compile('^([^@]*)@(.*)$')
def splituser(host): global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host
fcea3a44cb5bc4ca94c174353aba37f481e83a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fcea3a44cb5bc4ca94c174353aba37f481e83a11/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 1355, 12, 2564, 4672, 2552, 389, 1355, 14654, 309, 389, 1355, 14654, 353, 599, 30, 1930, 283, 389, 1355, 14654, 273, 283, 18, 11100, 2668, 66, 8178, 36, 15471, 36, 14361, 8, 6134, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 1355, 12, 2564, 4672, 2552, 389, 1355, 14654, 309, 389, 1355, 14654, 353, 599, 30, 1930, 283, 389, 1355, 14654, 273, 283, 18, 11100, 2668, 66, 8178, 36, 15471, 36, 14361, 8, 6134, ...
self.addAnnotation(annotation, name, addtopage)
self._addAnnotation(annotation, name, addtopage)
def textAnnotation(self, contents, Rect=None, addtopage=1, name=None, **kw): if not Rect: (w,h) = self._pagesize# default to whole page (?) Rect = (0,0,w,h) annotation = apply(pdfdoc.TextAnnotation, (Rect, contents), kw) self.addAnnotation(annotation, name, addtopage)
2424475e071e1c37b73f3c67658b0731bda9a15e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2424475e071e1c37b73f3c67658b0731bda9a15e/canvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 977, 3257, 12, 2890, 16, 2939, 16, 9315, 33, 7036, 16, 527, 3669, 410, 33, 21, 16, 508, 33, 7036, 16, 2826, 9987, 4672, 309, 486, 9315, 30, 261, 91, 16, 76, 13, 273, 365, 6315, 726...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 977, 3257, 12, 2890, 16, 2939, 16, 9315, 33, 7036, 16, 527, 3669, 410, 33, 21, 16, 508, 33, 7036, 16, 2826, 9987, 4672, 309, 486, 9315, 30, 261, 91, 16, 76, 13, 273, 365, 6315, 726...
>>> pik = pickle.dumps(x, 0) >>> dis(pik)
>>> pkl = pickle.dumps(x, 0) >>> dis(pkl)
def dis(pickle, out=None, indentlevel=4): """Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is a file-like object to which the disassembly is printed. It defaults to sys.stdout. Optional arg indentlevel is the number of blanks by which to indent a new MARK level. It defaults to 4. """ markstack = [] indentchunk = ' ' * indentlevel for opcode, arg, pos in genops(pickle): if pos is not None: print >> out, "%5d:" % pos, line = "%s %s%s" % (opcode.code, indentchunk * len(markstack), opcode.name) markmsg = None if markstack and markobject in opcode.stack_before: assert markobject not in opcode.stack_after markpos = markstack.pop() if markpos is not None: markmsg = "(MARK at %d)" % markpos if arg is not None or markmsg: # make a mild effort to align arguments line += ' ' * (10 - len(opcode.name)) if arg is not None: line += ' ' + repr(arg) if markmsg: line += ' ' + markmsg print >> out, line if markobject in opcode.stack_after: assert markobject not in opcode.stack_before markstack.append(pos)
97f381e5bdf86ce48714420f1639833ead016d7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/97f381e5bdf86ce48714420f1639833ead016d7f/pickletools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1015, 12, 20847, 16, 596, 33, 7036, 16, 3504, 2815, 33, 24, 4672, 3536, 25884, 279, 16754, 1015, 28050, 434, 279, 13379, 18, 225, 296, 20847, 11, 353, 279, 585, 17, 5625, 733, 16, 578,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1015, 12, 20847, 16, 596, 33, 7036, 16, 3504, 2815, 33, 24, 4672, 3536, 25884, 279, 16754, 1015, 28050, 434, 279, 13379, 18, 225, 296, 20847, 11, 353, 279, 585, 17, 5625, 733, 16, 578,...
if getConfig()['threads'][tName]['regExTrueOptions']: LTrue = re.compile( downloadDict['localTrue'], getattr(re, getConfig()['threads'][tName]['regExTrueOptions']) )
if getConfig()['threads'][tName]['regExTrueOptions']: LTrue = re.compile( downloadDict['localTrue'], getattr(re, getConfig()['threads'][tName]['regExTrueOptions']) )
def checkRegExDown(tName, itemNode): u"""returns false if nothing found in download<x> to match itemNode. returns DownloadItemConfig instance otherwise""" # Also, it's incredibly inefficient # for every x rss entries and y download items, it runs this xy times. # ( local true, logStatusMsg(u"checking download<x>", 5) for downloadDict in getConfig()['threads'][tName]['downloads']: if getConfig()['threads'][tName]['regExTrueOptions']: LTrue = re.compile( downloadDict['localTrue'], getattr(re, getConfig()['threads'][tName]['regExTrueOptions']) ) else: LTrue = re.compile(downloadDict['localTrue']) if not LTrue.search(itemNode['title'].lower()): continue if type(downloadDict['False']) == type(''): if getConfig()['threads'][tName]['regExFalseOptions']: LFalse = re.compile(downloadDict['False'], getattr( re, getConfig()['threads'][tName]['regExFalseOptions'])) else: LFalse = re.compile(downloadDict['False']) if LFalse.search(itemNode['title'].lower()): continue elif downloadDict['False'] == False: pass elif downloadDict['False'] == True: if not checkRegExGFalse(tName, itemNode): continue if downloadDict['True'] == True: if not checkRegExGTrue(tName, itemNode): continue elif downloadDict['True'] == False: pass return downloadDict return False
633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1617, 424, 4164, 12, 88, 461, 16, 761, 907, 4672, 582, 8395, 6154, 629, 309, 5083, 1392, 316, 4224, 32, 92, 34, 358, 845, 761, 907, 18, 1135, 13059, 1180, 809, 791, 3541, 8395, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1617, 424, 4164, 12, 88, 461, 16, 761, 907, 4672, 582, 8395, 6154, 629, 309, 5083, 1392, 316, 4224, 32, 92, 34, 358, 845, 761, 907, 18, 1135, 13059, 1180, 809, 791, 3541, 8395, ...
re_url = re.compile(r"http://(www\.|)([\w\.\-]+)")
def limit_expire(expire): """ Upper limit on expiry interval. >>> limit_expire('invalid') '0:30' >>> limit_expire('2:00') '2:00' >>> limit_expire('2:61') '3:01' >>> limit_expire('4000:99') '4:00' >>> limit_expire('4:01') '4:00' """ match = expire_match(expire) if not match: return '0:30' hours = int(match.group(1)) minutes = int(match.group(2)) if minutes > 59: hours += 1 minutes -= 60 if hours > 4 or (hours == 4 and minutes > 0): hours = 4 minutes = 0 return '%d:%02d' % (hours, minutes)
392c1d5f2726cc9d5429dc414cf5b3653f8e40ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3111/392c1d5f2726cc9d5429dc414cf5b3653f8e40ae/submitjobs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1800, 67, 14070, 12, 14070, 4672, 3536, 29844, 1800, 603, 10839, 3673, 18, 225, 4080, 1800, 67, 14070, 2668, 5387, 6134, 296, 20, 30, 5082, 11, 4080, 1800, 67, 14070, 2668, 22, 30, 713, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1800, 67, 14070, 12, 14070, 4672, 3536, 29844, 1800, 603, 10839, 3673, 18, 225, 4080, 1800, 67, 14070, 2668, 5387, 6134, 296, 20, 30, 5082, 11, 4080, 1800, 67, 14070, 2668, 22, 30, 713, ...
self.getNewThrottle() self.askChangeThrottle = False if (self.askFinishStartButton) : self.doFinishStartButton() self.askFinishStartButton = False
self.getNewThrottle() self.askChangeThrottle = False if (self.askFinishStartButton) : self.doFinishStartButton() self.askFinishStartButton = False
def handle(self): #print("handle begin:.\n") #self.msgText("handle done\n") self.waitMsec(1000) if (self.askChangeThrottle) : self.getNewThrottle() self.askChangeThrottle = False if (self.askFinishStartButton) : self.doFinishStartButton() self.askFinishStartButton = False return 1 #continue if 1, run once if 0
fca00898a9bb820ed14f77244f4ebea37943bef9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2146/fca00898a9bb820ed14f77244f4ebea37943bef9/RobotThrottle2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 4672, 468, 1188, 2932, 4110, 2376, 30, 8403, 82, 7923, 468, 2890, 18, 3576, 1528, 2932, 4110, 2731, 64, 82, 7923, 365, 18, 7048, 49, 3321, 12, 18088, 13, 309, 261, 2890...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 4672, 468, 1188, 2932, 4110, 2376, 30, 8403, 82, 7923, 468, 2890, 18, 3576, 1528, 2932, 4110, 2731, 64, 82, 7923, 365, 18, 7048, 49, 3321, 12, 18088, 13, 309, 261, 2890...
data += self.sslobj.read(len(data)-size)
data += self.sslobj.read(size-len(data))
def read(self, size): """Read 'size' bytes from remote.""" # sslobj.read() sometimes returns < size bytes data = self.sslobj.read(size) while len(data) < size: data += self.sslobj.read(len(data)-size)
98e512ab8d1e33d881a324f4d059131d194f8614 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/98e512ab8d1e33d881a324f4d059131d194f8614/imaplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 963, 4672, 3536, 1994, 296, 1467, 11, 1731, 628, 2632, 12123, 468, 5202, 383, 441, 18, 896, 1435, 16594, 1135, 411, 963, 1731, 501, 273, 365, 18, 1049, 383, 441, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 963, 4672, 3536, 1994, 296, 1467, 11, 1731, 628, 2632, 12123, 468, 5202, 383, 441, 18, 896, 1435, 16594, 1135, 411, 963, 1731, 501, 273, 365, 18, 1049, 383, 441, 18,...
dateType = dateFormatLength.attrib["type"] for dateFormat in dateFormatLength.findall("dateFormat/pattern"): if dateFormat.attrib.has_key("alt"): continue data['cldr_date_format_%s'% dateType] = dateFormat.text
dateType = dateFormatLength.attrib["type"] for dateFormat in dateFormatLength.findall("dateFormat/pattern"): if dateFormat.attrib.has_key("alt"): continue data['cldr_date_format_%s'% dateType] = dateFormat.text
def extractDateFormat(calendarElement): data = {} for dateFormatLength in calendarElement.findall(".//dateFormatLength"): dateType = dateFormatLength.attrib["type"] for dateFormat in dateFormatLength.findall("dateFormat/pattern"): if dateFormat.attrib.has_key("alt"): continue data['cldr_date_format_%s'% dateType] = dateFormat.text return data
eb1a4b4f96b21cb38ef782a546b34e1e48dfe76d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/eb1a4b4f96b21cb38ef782a546b34e1e48dfe76d/cldr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 11878, 12, 11650, 1046, 4672, 501, 273, 2618, 364, 16996, 1782, 316, 5686, 1046, 18, 4720, 454, 2932, 18, 759, 712, 1630, 1782, 6, 4672, 1509, 559, 273, 16996, 1782, 18, 14588, 961...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 11878, 12, 11650, 1046, 4672, 501, 273, 2618, 364, 16996, 1782, 316, 5686, 1046, 18, 4720, 454, 2932, 18, 759, 712, 1630, 1782, 6, 4672, 1509, 559, 273, 16996, 1782, 18, 14588, 961...
input_stream.Update()
def setInput(self, idx, input_stream): if input_stream == None:
3dcd9cc1da6ee7280c7a1d5cc14dec9dfe592306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/3dcd9cc1da6ee7280c7a1d5cc14dec9dfe592306/slice3d_vwr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21687, 12, 2890, 16, 2067, 16, 810, 67, 3256, 4672, 309, 810, 67, 3256, 422, 599, 30, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21687, 12, 2890, 16, 2067, 16, 810, 67, 3256, 4672, 309, 810, 67, 3256, 422, 599, 30, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
except AttributeError, KeyError: akey = None
except (AttributeError, KeyError): akey = None
def sort(sequence, sort=(), _=None, mapping=0): """ - sequence is a sequence of objects to be sorted - sort is a sequence of tuples (key,func,direction) that define the sort order: - key is the name of an attribute to sort the objects by - func is the name of a comparison function. This parameter is optional allowed values: - "cmp" -- the standard comparison function (default) - "nocase" -- case-insensitive comparison - "strcoll" or "locale" -- locale-aware string comparison - "strcoll_nocase" or "locale_nocase" -- locale-aware case-insensitive string comparison - "xxx" -- a user-defined comparison function - direction -- defines the sort direction for the key (optional). (allowed values: "asc" (default) , "desc") """ need_sortfunc = 0 if sort: for s in sort: if len(s) > 1: # extended sort if there is reference to... # ...comparison function or sort order, even if they are "cmp" and "asc" need_sortfunc = 1 break sortfields = sort # multi sort = key1,key2 multsort = len(sortfields) > 1 # flag: is multiple sort if need_sortfunc: # prepare the list of functions and sort order multipliers sf_list = make_sortfunctions(sortfields, _) # clean the mess a bit if multsort: # More than one sort key. sortfields = map(lambda x: x[0], sf_list) else: sort = sf_list[0][0] elif sort: if multsort: # More than one sort key. sortfields = map(lambda x: x[0], sort) else: sort = sort[0][0] isort=not sort s=[] for client in sequence: k = None if type(client)==TupleType and len(client)==2: if isort: k=client[0] v=client[1] else: if isort: k=client v=client if sort: if multsort: # More than one sort key. k = [] for sk in sortfields: try: if mapping: akey = v[sk] else: akey = getattr(v, sk) except AttributeError, KeyError: akey = None if not basic_type(akey): try: akey = akey() except: pass k.append(akey) else: # One sort key. try: if mapping: k = v[sort] else: k = getattr(v, sort) except AttributeError, KeyError: k = None if not basic_type(type(k)): try: k = k() except: pass s.append((k,client)) if need_sortfunc: by = SortBy(multsort, sf_list) s.sort(by) else: s.sort() sequence=[] for k, client in s: sequence.append(client) return sequence
72ae253aa5ea1704714334b5aa865c18c32840b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/72ae253aa5ea1704714334b5aa865c18c32840b2/SortEx.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1524, 12, 6178, 16, 1524, 33, 9334, 389, 33, 7036, 16, 2874, 33, 20, 4672, 3536, 300, 3102, 353, 279, 3102, 434, 2184, 358, 506, 3115, 225, 300, 1524, 353, 279, 3102, 434, 10384, 261, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1524, 12, 6178, 16, 1524, 33, 9334, 389, 33, 7036, 16, 2874, 33, 20, 4672, 3536, 300, 3102, 353, 279, 3102, 434, 2184, 358, 506, 3115, 225, 300, 1524, 353, 279, 3102, 434, 10384, 261, ...
def desc(*texts): return '\n'.join(texts)
def text(*args, **kwargs): tmp = [] for a in args: if a.endswith('.txt'): f = open(os.path.join(*a.split('/'))) tmp.append(f.read()) f.close() tmp.append('\n\n') else: tmp.append(a) if len(tmp) == 1: res = tmp[0] else: res = ''.join(tmp) report = validateReST(res) if report: print report raise ValueError('ReST validation error') return res
def desc(*texts): return '\n'.join(texts)
9964ec3d4c3d0cea05037e581e51564baf468774 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9906/9964ec3d4c3d0cea05037e581e51564baf468774/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 977, 30857, 1968, 16, 2826, 4333, 4672, 282, 1853, 273, 5378, 364, 279, 316, 833, 30, 309, 279, 18, 5839, 1918, 2668, 18, 5830, 11, 4672, 284, 273, 1696, 12, 538, 18, 803, 18, 5701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 977, 30857, 1968, 16, 2826, 4333, 4672, 282, 1853, 273, 5378, 364, 279, 316, 833, 30, 309, 279, 18, 5839, 1918, 2668, 18, 5830, 11, 4672, 284, 273, 1696, 12, 538, 18, 803, 18, 5701, ...
if not msg.get('precedence'): msg['Precedence'] = 'bulk'
if not msg.has_key('precedence'): msg['Precedence'] = 'list'
def process(mlist, msg, msgdata): # Set the "X-Ack: no" header if noack flag is set. if msgdata.get('noack'): del msg['x-ack'] msg['X-Ack'] = 'no' # Because we're going to modify various important headers in the email # message, we want to save some of the information in the msgdata # dictionary for later. Specifically, the sender header will get waxed, # but we need it for the Acknowledge module later. msgdata['original_sender'] = msg.get_sender() # VirginRunner sets _fasttrack for internally crafted messages. fasttrack = msgdata.get('_fasttrack') if not msgdata.get('isdigest') and not fasttrack: prefix_subject(mlist, msg, msgdata) # Mark message so we know we've been here, but leave any existing # X-BeenThere's intact. msg['X-BeenThere'] = mlist.GetListEmail() # Add Precedence: and other useful headers. None of these are standard # and finding information on some of them are fairly difficult. Some are # just common practice, and we'll add more here as they become necessary. # Good places to look are: # # http://www.dsv.su.se/~jpalme/ietf/jp-ietf-home.html # http://www.faqs.org/rfcs/rfc2076.html # # None of these headers are added if they already exist. BAW: some # consider the advertising of this a security breach. I.e. if there are # known exploits in a particular version of Mailman and we know a site is # using such an old version, they may be vulnerable. It's too easy to # edit the code to add a configuration variable to handle this. if not msg.get('x-mailman-version'): msg['X-Mailman-Version'] = mm_cfg.VERSION # Semi-controversial: some don't want this included at all, others # want the value to be `list'. if not msg.get('precedence'): msg['Precedence'] = 'bulk' # Reply-To: munging. Do not do this if the message is "fast tracked", # meaning it is internally crafted and delivered to a specific user. BAW: # Yuck, I really hate this feature but I've caved under the sheer pressure # of the (very vocal) folks want it. OTOH, RFC 2822 allows Reply-To: to # be a list of addresses, so instead of replacing the original, simply # augment it. RFC 2822 allows max one Reply-To: header so collapse them # if we're adding a value, otherwise don't touch it. (Should we collapse # in all cases?) if not fasttrack: # Set Reply-To: header to point back to this list replyto = [] if mlist.reply_goes_to_list == 1: replyto.append(('', mlist.GetListEmail())) # Set Reply-To: an explicit address, but only if reply_to_address is a # valid email address. BAW: this really should be validated on input. elif mlist.reply_goes_to_list == 2: replyto.append(('', mlist.reply_to_address)) # If we're not first stripping existing Reply-To: then we need to add # the original Reply-To:'s to the list we're building up. In both # cases we'll zap the existing field because RFC 2822 says max one is # allowed. if not mlist.first_strip_reply_to: orig = msg.get_all('reply-to', []) replyto.extend(email.Utils.getaddresses(orig)) del msg['reply-to'] # Get rid of duplicates. BAW: does order matter? It might, because # not all MUAs respect Reply-To: as a list of addresses. Also, note # duplicates are based on case folded email address, which means in # the case of dupes, the last one wins (will mostly affect the real # name clobbering). d = {} for name, addr in replyto: d[addr.lower()] = (name, addr) if d: # Don't add one back if there's nothing to add! msg['Reply-To'] = COMMASPACE.join( [email.Utils.formataddr(pair) for pair in d.values()]) # Add list-specific headers as defined in RFC 2369 and RFC 2919, but only # if the message is being crafted for a specific list (e.g. not for the # password reminders). # # BAW: Some people really hate the List-* headers. It seems that the free # version of Eudora (possibly on for some platforms) does not hide these # headers by default, pissing off their users. Too bad. Fix the MUAs. if msgdata.get('_nolist') or not mlist.include_rfc2369_headers: return # Pre-calculate listid = '<%s.%s>' % (mlist.internal_name(), mlist.host_name) if mlist.description: listid = mlist.description + ' ' + listid requestaddr = mlist.GetRequestEmail() subfieldfmt = '<%s>, <mailto:%s?subject=%ssubscribe>' listinfo = mlist.GetScriptURL('listinfo', absolute=1) # We always add a List-ID: header. For internally crafted messages, we # also add a (nonstandard), "X-List-Administrivia: yes" header. For all # others (i.e. those coming from list posts), we adda a bunch of other RFC # 2369 headers. headers = { 'List-Id' : listid, } if msgdata.get('reduced_list_headers'): headers['X-List-Administrivia'] = 'yes' else: headers.update({ 'List-Help' : '<mailto:%s?subject=help>' % requestaddr, 'List-Unsubscribe': subfieldfmt % (listinfo, requestaddr, 'un'), 'List-Subscribe' : subfieldfmt % (listinfo, requestaddr, ''), }) # List-Post: is controlled by a separate attribute if mlist.include_list_post_header: headers['List-Post'] = '<mailto:%s>' % mlist.GetListEmail() # Add this header if we're archiving if mlist.archive: archiveurl = mlist.GetBaseArchiveURL() if archiveurl.endswith('/'): archiveurl = archiveurl[:-1] headers['List-Archive'] = '<%s>' % archiveurl # First we delete any pre-existing headers because the RFC permits only # one copy of each, and we want to be sure it's ours. for h, v in headers.items(): del msg[h] # Wrap these lines if they are too long. 78 character width probably # shouldn't be hardcoded, but is at least text-MUA friendly. The # adding of 2 is for the colon-space separator. if len(h) + 2 + len(v) > 78: v = CONTINUATION.join(v.split(', ')) msg[h] = v
827dac80874f2f33453aeb2c36e5daa7e2bb406f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/827dac80874f2f33453aeb2c36e5daa7e2bb406f/CookHeaders.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 781, 376, 16, 1234, 16, 1234, 892, 4672, 468, 1000, 326, 315, 60, 17, 11931, 30, 1158, 6, 1446, 309, 1158, 484, 2982, 353, 444, 18, 309, 1234, 892, 18, 588, 2668, 2135, 484...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 781, 376, 16, 1234, 16, 1234, 892, 4672, 468, 1000, 326, 315, 60, 17, 11931, 30, 1158, 6, 1446, 309, 1158, 484, 2982, 353, 444, 18, 309, 1234, 892, 18, 588, 2668, 2135, 484...
return get_instance_metadata('product-codes')
return self.get_instance_metadata('product-codes')
def get_instance_product_codes(self): return get_instance_metadata('product-codes')
029b994f89afc967007ea7d9fd2532df40c08274 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12707/029b994f89afc967007ea7d9fd2532df40c08274/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1336, 67, 5896, 67, 7000, 12, 2890, 4672, 327, 336, 67, 1336, 67, 4165, 2668, 5896, 17, 7000, 6134, 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, 336, 67, 1336, 67, 5896, 67, 7000, 12, 2890, 4672, 327, 336, 67, 1336, 67, 4165, 2668, 5896, 17, 7000, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
enumeratePrincipals = plugin.enumerateUsers local_key = 'userid' principal_type = 'user' title_key = 'login' title_pattern = "%s" else: enumeratePrincipals = plugin.enumerateGroups local_key = 'groupid' principal_type = 'group' title_key = 'groupid' title_pattern = "(Group) %s"
user_info = plugin.enumerateUsers( id=principal_id , exact_match=True ) if user_info: local_key = 'userid' principal_type = 'user' title_key = 'login' title_pattern = "%s" if getattr( aq_base( plugin ), 'enumerateGroups', None ): group_info = plugin.enumerateGroups( id=principal_id , exact_match=True ) if group_info: local_key = 'groupid' principal_type = 'group' title_key = 'groupid' title_pattern = "(Group) %s"
def searchPrincipals(self, groups_first=False, **kw): """ Search for principals (users, groups, or both) """ exact_match = kw.get( 'exact_match', False ) max_results = kw.get( 'max_results', '' )
614e1161e47ef43710a900ca047bf9c4b146dbfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/614e1161e47ef43710a900ca047bf9c4b146dbfb/PluggableAuthService.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 25035, 12, 2890, 16, 3252, 67, 3645, 33, 8381, 16, 2826, 9987, 4672, 3536, 5167, 364, 25160, 261, 5577, 16, 3252, 16, 578, 3937, 13, 3536, 5565, 67, 1916, 273, 5323, 18, 588, 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, 1623, 25035, 12, 2890, 16, 3252, 67, 3645, 33, 8381, 16, 2826, 9987, 4672, 3536, 5167, 364, 25160, 261, 5577, 16, 3252, 16, 578, 3937, 13, 3536, 5565, 67, 1916, 273, 5323, 18, 588, 12,...
return branchToCheck == sourceBranch or \ (branchToCheck != targetBranch and _isUphill(verToCheck, targetBranch))
return branchToCheck == sourceBranch
def _needsRewrite(sourceBranch, targetBranch, verToCheck, kind): # if this version is for a referenced trove, we can be # sure that trove is being cloned as well, and so we always # need to rewrite its version. if kind == V_REFTRV: return True
36dd10917692b5c52193f2ab080798b20e59a906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/36dd10917692b5c52193f2ab080798b20e59a906/clone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 20600, 19618, 12, 3168, 7108, 16, 1018, 7108, 16, 1924, 18126, 16, 3846, 4672, 468, 309, 333, 1177, 353, 364, 279, 8042, 23432, 537, 16, 732, 848, 506, 468, 3071, 716, 23432, 537, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 20600, 19618, 12, 3168, 7108, 16, 1018, 7108, 16, 1924, 18126, 16, 3846, 4672, 468, 309, 333, 1177, 353, 364, 279, 8042, 23432, 537, 16, 732, 848, 506, 468, 3071, 716, 23432, 537, ...
print 'in osc path', child.firstChild.data
def open_rec(self, node, parent_widget):
34016e248ab107f4924918f308190464649d31f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2237/34016e248ab107f4924918f308190464649d31f5/khagan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3927, 12, 2890, 16, 756, 16, 982, 67, 6587, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3927, 12, 2890, 16, 756, 16, 982, 67, 6587, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
'Requirements':None
'Test_method':None
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, ...
depends = ["sage/libs/mwrank/wrap.h"],
depends = ["sage/libs/mwrank/wrap.h"] + [ SAGE_INC + "eclib/" + h for h in ["curve.h","egr.h","descent.h","points.h","isogs.h", "marith.h","htconst.h","interface.h"] ],
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
ed93bd8a578d2e45e5a47391fdcedfc7e8ca2fd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ed93bd8a578d2e45e5a47391fdcedfc7e8ca2fd1/module_list.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31444, 67, 12524, 12, 529, 16, 460, 16, 10355, 4672, 309, 508, 316, 1140, 18, 318, 339, 1435, 63, 20, 14542, 327, 460, 469, 30, 327, 10355, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31444, 67, 12524, 12, 529, 16, 460, 16, 10355, 4672, 309, 508, 316, 1140, 18, 318, 339, 1435, 63, 20, 14542, 327, 460, 469, 30, 327, 10355, 225, 2, -100, -100, -100, -100, -100, -100, ...
if isinstance(selobj, Atom):
if isinstance(selobj, Chunk): dnaStrand = selobj.parent_node_of_class(self.win.assy.DnaStrand) if dnaStrand: chunkList = [dnaStrand] else: chunkList = [selobj] colorList = [hiColor1] elif isinstance(selobj, Atom):
def _get_objects_to_highlight(self, selobj, hiColor1, hiColor2): """ Returns a python dictionary with objects to be drawn highlighted as its keys and highlight color as their corresponding values. The object to be highlighted is determined based the current graphics mode using the glpane.selobj. The subclasses can override this method to return objects to be highlighted in that particular graphics mode. @param selobj: GLPane.selobj (object under cursoe which can be registered as a GLPane.selobj @param hiColor1 : highlight color 1 @paramhiColor2: alternative highlight color. Example: If there are two chunks that need to be highlighted, one chunk gets hiColor1 and other gets hiColor2. @TODO: - may be hiColors should be in a list to make it more general @return: dictionary of objects to be highlighted. @rtype: dict @see: self._is_dnaGroup_highlighting_enabled() @see: self.drawHighlightedChunk() @see : self.drawHighlightedObjectUnderMouse()
b7c7d281e98dfe32a8d9cc5e8f416ef52be47701 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/b7c7d281e98dfe32a8d9cc5e8f416ef52be47701/SelectChunks_GraphicsMode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 6911, 67, 869, 67, 15978, 12, 2890, 16, 357, 2603, 16, 10118, 2957, 21, 16, 10118, 2957, 22, 4672, 3536, 2860, 279, 5790, 3880, 598, 2184, 358, 506, 19377, 24375, 487, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 6911, 67, 869, 67, 15978, 12, 2890, 16, 357, 2603, 16, 10118, 2957, 21, 16, 10118, 2957, 22, 4672, 3536, 2860, 279, 5790, 3880, 598, 2184, 358, 506, 19377, 24375, 487, 20...
self.server.start()
self.server.start(False)
def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start()
0326a9415717bc0500c94f99051c724e9b98c16b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/0326a9415717bc0500c94f99051c724e9b98c16b/servertestcase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 3536, 1477, 1865, 3614, 1842, 648, 12123, 365, 18, 3567, 273, 3224, 1435, 365, 18, 3567, 18, 542, 21806, 12, 20, 13, 365, 18, 3567, 18, 1937, 1435, 2, 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, 24292, 12, 2890, 4672, 3536, 1477, 1865, 3614, 1842, 648, 12123, 365, 18, 3567, 273, 3224, 1435, 365, 18, 3567, 18, 542, 21806, 12, 20, 13, 365, 18, 3567, 18, 1937, 1435, 2, -100, -100...
for value, i in s: print "inserting priority ", value, " ", i
for i, value in enumerate(s):
def setPriorityList(self, s): """Remove all priorities, set them to `s`""" if self.hasTickets(): raise Exception("Will not modify database with existing tickets!") c = self.db().cursor() c.execute("""DELETE FROM enum WHERE type='priority'""") for value, i in s: print "inserting priority ", value, " ", i c.execute("""INSERT INTO enum (type, name, value) VALUES (%s, %s, %s)""", "priority", value, i) self.db().commit()
bdf7574edc4cb2b55e7db1424e146142fbbbc08d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/bdf7574edc4cb2b55e7db1424e146142fbbbc08d/sourceforge2trac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 8183, 682, 12, 2890, 16, 272, 4672, 3536, 3288, 777, 26783, 16, 444, 2182, 358, 1375, 87, 68, 8395, 309, 365, 18, 5332, 6264, 2413, 13332, 1002, 1185, 2932, 13670, 486, 5612, 2063, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8183, 682, 12, 2890, 16, 272, 4672, 3536, 3288, 777, 26783, 16, 444, 2182, 358, 1375, 87, 68, 8395, 309, 365, 18, 5332, 6264, 2413, 13332, 1002, 1185, 2932, 13670, 486, 5612, 2063, ...
'balance': balance_fy[account_id], 'balanceinit': round(balance_fy[account_id]-account['debit']+account['credit'], int(config['price_accuracy'])),
'balance': account['balance'], 'balanceinit': round(account['balance']-account['debit']+account['credit'], int(config['price_accuracy'])),
# def cmp_code(x, y):
cd6bad26b43428cf1ed3e8c02c4f5c2db7f08034 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/cd6bad26b43428cf1ed3e8c02c4f5c2db7f08034/account_balance.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 5411, 1652, 9411, 67, 710, 12, 92, 16, 677, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 5411, 1652, 9411, 67, 710, 12, 92, 16, 677, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
sys.stderr.write('> Error opening file %s: %s\n' % (filename, e))
sys.stderr.write('--- ERROR opening file %s: %s ---\n' % (filename, e))
def writer(self): """loop and copy console->serial until EXITCHARCTER character is found. when MENUCHARACTER is found, interpret the next key locally. """ menu_active = False try: while self.alive: try: c = console.getkey() except KeyboardInterrupt: c = '\x03' if menu_active: if c == MENUCHARACTER or c == EXITCHARCTER: # Menu character again/exit char -> send itself self.serial.write(c) # send character if self.echo: sys.stdout.write(c) elif c == '\x15': # CTRL+U -> upload file sys.stderr.write('\n> File to upload: ') sys.stderr.flush() console.cleanup() filename = sys.stdin.readline().rstrip('\r\n') if filename: try: file = open(filename, 'r') sys.stderr.write('> Sending file %s ' % filename) while True: line = file.readline().rstrip('\r\n') if not line: break self.serial.write(line) self.serial.write('\r\n') # Wait for output buffer to drain. self.serial.flush() sys.stderr.write('.') # Progress indicator. sys.stderr.write('\n> File %s sent.\n' % filename) except IOError, e: sys.stderr.write('> Error opening file %s: %s\n' % (filename, e)) console.setup() elif c in '\x08hH?': # CTRL+H, h, H, ? -> Show help sys.stderr.write(get_help_text()) elif c == '\x12': # CTRL+R -> Toggle RTS self.rts_state = not self.rts_state self.serial.setRTS(self.rts_state) sys.stderr.write('<RTS %s>' % (self.rts_state and 'active' or 'inactive')) elif c == '\x04': # CTRL+D -> Toggle DTR self.dtr_state = not self.dtr_state self.serial.setDTR(self.dtr_state) sys.stderr.write('<DTR %s>' % (self.dtr_state and 'active' or 'inactive')) elif c == '\x02': # CTRL+B -> toggle BREAK condition self.break_state = not self.break_state self.serial.setBreak(self.break_state) sys.stderr.write('<BREAK %s>' % (self.break_state and 'active' or 'inactive')) elif c == '\x05': # CTRL+E -> toggle local echo self.echo = not self.echo sys.stderr.write('<local echo %s>' % (self.echo and 'active' or 'inactive')) elif c == '\x09': # CTRL+I -> info self.dump_port_settings() #~ elif c in 'pP': # P -> change port XXX reader thread would exit elif c in 'bB': # B -> change baudrate sys.stderr.write('\n> Baudrate: ') sys.stderr.flush() console.cleanup() backup = self.serial.baudrate try: self.serial.baudrate = int(sys.stdin.readline().strip()) except ValueError, e: sys.stderr.write('\n> Error setting baudrate: %s' % (e,)) self.serial.baudrate = backup console.setup() self.dump_port_settings() elif c == '8': # 8 -> change to 8 bits self.serial.bytesize = serial.EIGHTBITS self.dump_port_settings() elif c == '7': # 7 -> change to 8 bits self.serial.bytesize = serial.SEVENBITS self.dump_port_settings() elif c in 'eE': # E -> change to even parity self.serial.parity = serial.PARITY_EVEN self.dump_port_settings() elif c in 'oO': # O -> change to odd parity self.serial.parity = serial.PARITY_ODD self.dump_port_settings() elif c in 'mM': # M -> change to mark parity self.serial.parity = serial.PARITY_MARK self.dump_port_settings() elif c in 'sS': # S -> change to space parity self.serial.parity = serial.PARITY_SPACE self.dump_port_settings() elif c in 'nN': # N -> change to no parity self.serial.parity = serial.PARITY_NONE self.dump_port_settings() elif c == '1': # 1 -> change to 1 stop bits self.serial.stopbits = serial.STOPBITS_ONE self.dump_port_settings() elif c == '2': # 2 -> change to 2 stop bits self.serial.stopbits = serial.STOPBITS_TWO self.dump_port_settings() elif c == '3': # 3 -> change to 1.5 stop bits self.serial.stopbits = serial.STOPBITS_ONE_POINT_FIVE self.dump_port_settings() elif c in 'xX': # X -> change software flow control self.serial.xonxoff = (c == 'X') self.dump_port_settings() elif c in 'rR': # R -> change hardware flow control self.serial.rtscts = (c == 'R') self.dump_port_settings() else: sys.stderr.write('<unknown menu character %s>' % key_description(c)) menu_active = False elif c == MENUCHARACTER: # next char will be for menu menu_active = True elif c == EXITCHARCTER: self.stop() break # exit app elif c == '\n': self.serial.write(self.newline) # send newline character(s) if self.echo: sys.stdout.write(c) # local echo is a real newline in any case else: self.serial.write(c) # send character if self.echo: sys.stdout.write(c) except: self.alive = False raise
0f6a48ec722750ef078f74b1aa09e2fb405fc04e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/0f6a48ec722750ef078f74b1aa09e2fb405fc04e/miniterm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2633, 12, 2890, 4672, 3536, 6498, 471, 1610, 2983, 2122, 8818, 3180, 28407, 7305, 1268, 654, 3351, 353, 1392, 18, 1347, 490, 1157, 57, 27858, 353, 1392, 16, 10634, 326, 1024, 498, 13760, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2633, 12, 2890, 4672, 3536, 6498, 471, 1610, 2983, 2122, 8818, 3180, 28407, 7305, 1268, 654, 3351, 353, 1392, 18, 1347, 490, 1157, 57, 27858, 353, 1392, 16, 10634, 326, 1024, 498, 13760, ...
return Matrix(l.base_ring(),l.ncols(), l.nrows()*self.e, ret).transpose()
return Matrix(l.base_ring(), l.ncols(), l.nrows()*self.e, ret).transpose()
def phi(self, l): r""" Projects state arrays to their algebraic representation.
62424369e932ac59629cb4d40b7e47ae2a712293 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/62424369e932ac59629cb4d40b7e47ae2a712293/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7706, 12, 2890, 16, 328, 4672, 436, 8395, 30491, 919, 5352, 358, 3675, 524, 29087, 335, 4335, 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, 7706, 12, 2890, 16, 328, 4672, 436, 8395, 30491, 919, 5352, 358, 3675, 524, 29087, 335, 4335, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
print "Render failed, skipping..."
print 'Render failed, skipping \'%s\'...' % l
def drawstringframed(self, string, x, y, width, height, font, fgcolor=None, bgcolor=None, align_h='left', align_v='top', mode='hard', layer=None, ellipses='...'): """ draws a string (text) in a frame. This tries to fit the string in lines, if it can't, it truncates the text, draw the part that fit and returns the other that doesn't. This is a wrapper to drawstringframedsoft() and -hard()
864e791084b031b6cf2e4fff0b0cc19b52b77ec9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/864e791084b031b6cf2e4fff0b0cc19b52b77ec9/osd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1080, 74, 1940, 329, 12, 2890, 16, 533, 16, 619, 16, 677, 16, 1835, 16, 2072, 16, 3512, 16, 10186, 3266, 33, 7036, 16, 31509, 33, 7036, 16, 5689, 67, 76, 2218, 4482, 2187, 5689...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1080, 74, 1940, 329, 12, 2890, 16, 533, 16, 619, 16, 677, 16, 1835, 16, 2072, 16, 3512, 16, 10186, 3266, 33, 7036, 16, 31509, 33, 7036, 16, 5689, 67, 76, 2218, 4482, 2187, 5689...
self.emitCurrentToken() leavingThisState = False
self.state = self.states["data"] emitToken = True
def attributeNameState(self): data = self.stream.char() leavingThisState = True if data == u"=": self.state = self.states["beforeAttributeValue"] elif data in asciiLetters: self.currentToken["data"][-1][0] += data +\ self.stream.charsUntil(asciiLetters, True) leavingThisState = False elif data == u">": # XXX If we emit here the attributes are converted to a dict # without being checked and when the code below runs we error # because data is a dict not a list pass elif data in spaceCharacters: self.state = self.states["afterAttributeName"] elif data == u"/": self.processSolidusInTag() self.state = self.states["beforeAttributeName"] elif data == EOF: self.tokenQueue.append({"type": "ParseError", "data": _("Unexpected end of file in attribute name.")}) self.emitCurrentToken() leavingThisState = False else: self.currentToken["data"][-1][0] += data leavingThisState = False
ac425cd64d3f7980b4a7a02d1cb68f38a8dbe22b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4487/ac425cd64d3f7980b4a7a02d1cb68f38a8dbe22b/tokenizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9734, 1119, 12, 2890, 4672, 501, 273, 365, 18, 3256, 18, 3001, 1435, 15086, 2503, 1119, 273, 1053, 309, 501, 422, 582, 6, 1546, 30, 365, 18, 2019, 273, 365, 18, 7992, 9614, 5771, 14942...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9734, 1119, 12, 2890, 4672, 501, 273, 365, 18, 3256, 18, 3001, 1435, 15086, 2503, 1119, 273, 1053, 309, 501, 422, 582, 6, 1546, 30, 365, 18, 2019, 273, 365, 18, 7992, 9614, 5771, 14942...
if self.local:
if self.local is not None:
def get(self, key): if isinstance(key, unicode): key = key.encode('utf-8') if self.key_prefix: key = self.key_prefix + key if self.local: if not hasattr(self.local, 'cache'): self.local.cache = {} value = self.local.cache.get(key) if value: return value # memcached doesn't support keys longer than that. Because often # checks for so long keys can occour because it's tested from user # submitted data etc we fail silently for getting. if _test_memcached_key(key): value = self._client.get(key) self.local.cache[key] = value return value
10580ab9bd66e8973a90b1b3c28b21cee92cd1ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14437/10580ab9bd66e8973a90b1b3c28b21cee92cd1ee/cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 498, 4672, 309, 1549, 12, 856, 16, 5252, 4672, 498, 273, 498, 18, 3015, 2668, 3158, 17, 28, 6134, 309, 365, 18, 856, 67, 3239, 30, 498, 273, 365, 18, 856, 67, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 498, 4672, 309, 1549, 12, 856, 16, 5252, 4672, 498, 273, 498, 18, 3015, 2668, 3158, 17, 28, 6134, 309, 365, 18, 856, 67, 3239, 30, 498, 273, 365, 18, 856, 67, 32...
attempdirs = ['/usr/tmp', '/tmp', pwd]
attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd]
def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') elif os.name == 'mac': import macfs, MACFS try: refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kTemporaryFolderType, 1) dirname = macfs.FSSpec((refnum, dirid, '')).as_pathname() attempdirs.insert(0, dirname) except macfs.error: pass for envname in 'TMPDIR', 'TEMP', 'TMP': if os.environ.has_key(envname): attempdirs.insert(0, os.environ[envname]) testfile = gettempprefix() + 'test' for dir in attempdirs: try: filename = os.path.join(dir, testfile) if os.name == 'posix': try: fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700) except OSError: pass else: fp = os.fdopen(fd, 'w') fp.write('blat') fp.close() os.unlink(filename) del fp, fd tempdir = dir break else: fp = open(filename, 'w') fp.write('blat') fp.close() os.unlink(filename) tempdir = dir break except IOError: pass if tempdir is None: msg = "Can't find a usable temporary directory amongst " + `attempdirs` raise IOError, msg return tempdir
7c2f04ab85b94d92a6eb385bac9dd81794496b22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c2f04ab85b94d92a6eb385bac9dd81794496b22/tempfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5814, 1214, 13332, 3536, 2083, 358, 4604, 326, 1867, 358, 999, 12123, 2552, 23101, 309, 23101, 353, 486, 599, 30, 327, 23101, 775, 30, 14720, 273, 1140, 18, 588, 11089, 1435, 1335, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5814, 1214, 13332, 3536, 2083, 358, 4604, 326, 1867, 358, 999, 12123, 2552, 23101, 309, 23101, 353, 486, 599, 30, 327, 23101, 775, 30, 14720, 273, 1140, 18, 588, 11089, 1435, 1335, ...
def applydiff(ui, fp, changed, strip=1, sourcefile=None, eol=None):
def applydiff(ui, fp, changed, strip=1, sourcefile=None, eolmode='strict'):
def applydiff(ui, fp, changed, strip=1, sourcefile=None, eol=None): """ Reads a patch from fp and tries to apply it. The dict 'changed' is filled in with all of the filenames changed by the patch. Returns 0 for a clean patch, -1 if any rejects were found and 1 if there was any fuzz. If 'eol' is None, the patch content and patched file are read in binary mode. Otherwise, line endings are ignored when patching then normalized to 'eol' (usually '\n' or \r\n'). """ rejects = 0 err = 0 current_file = None gitpatches = None opener = util.opener(os.getcwd()) textmode = eol is not None def closefile(): if not current_file: return 0 current_file.close() return len(current_file.rej) for state, values in iterhunks(ui, fp, sourcefile, textmode): if state == 'hunk': if not current_file: continue current_hunk = values ret = current_file.apply(current_hunk) if ret >= 0: changed.setdefault(current_file.fname, None) if ret > 0: err = 1 elif state == 'file': rejects += closefile() afile, bfile, first_hunk = values try: if sourcefile: current_file = patchfile(ui, sourcefile, opener, eol=eol) else: current_file, missing = selectfile(afile, bfile, first_hunk, strip) current_file = patchfile(ui, current_file, opener, missing, eol) except PatchError, err: ui.warn(str(err) + '\n') current_file, current_hunk = None, None rejects += 1 continue elif state == 'git': gitpatches = values cwd = os.getcwd() for gp in gitpatches: if gp.op in ('COPY', 'RENAME'): copyfile(gp.oldpath, gp.path, cwd) changed[gp.path] = gp else: raise util.Abort(_('unsupported parser state: %s') % state) rejects += closefile() if rejects: return -1 return err
e867db56d38702f74798fa1971c33af7f18f5d20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/e867db56d38702f74798fa1971c33af7f18f5d20/patch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 5413, 12, 4881, 16, 4253, 16, 3550, 16, 2569, 33, 21, 16, 1084, 768, 33, 7036, 16, 14775, 3188, 2218, 13948, 11, 4672, 3536, 29185, 279, 4729, 628, 4253, 471, 9327, 358, 2230, 51...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2230, 5413, 12, 4881, 16, 4253, 16, 3550, 16, 2569, 33, 21, 16, 1084, 768, 33, 7036, 16, 14775, 3188, 2218, 13948, 11, 4672, 3536, 29185, 279, 4729, 628, 4253, 471, 9327, 358, 2230, 51...
state = self.pool.get('res.partner').browse(cr, uid, [context['partner_id']])[0].membership_state
state = context['partner_id'].membership_state
def price_get(self, cr, uid, ids, ptype='list_price',context={}): res = {} product_uom_obj = self.pool.get('product.uom') # force_member works for forcing member price if partner is non member, same reasonning for force_non_member for product in self.browse(cr, uid, ids, context=context): if ptype == 'member_price': res[product.id] = product['list_price'] if context and ('partner_id' in context): state = self.pool.get('res.partner').browse(cr, uid, [context['partner_id']])[0].membership_state if (state in ['waiting','associated','free','paid','invoiced']): res[product.id] = product['member_price'] if context and ('force_member' in context): if context['force_member']: res[product.id] = product['member_price'] if context and ('force_non_member' in context): if context['force_non_member']: res[product.id] = product['list_price'] else: res[product.id] = product[ptype] or 0.0 if ptype == 'list_price': res[product.id] = (res[product.id] * (product.price_margin or 1.0) ) + \ product.price_extra if 'uom' in context: uom = product.uos_id or product.uom_id res[product.id] = product_uom_obj._compute_price(cr, uid, uom.id, res[product.id], context['uom'])
bf0ea1c478b5e301d04b87817174f7c488f42081 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/bf0ea1c478b5e301d04b87817174f7c488f42081/cci_mission.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6205, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 24203, 2218, 1098, 67, 8694, 2187, 2472, 12938, 4672, 400, 273, 2618, 3017, 67, 89, 362, 67, 2603, 273, 365, 18, 6011, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6205, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 24203, 2218, 1098, 67, 8694, 2187, 2472, 12938, 4672, 400, 273, 2618, 3017, 67, 89, 362, 67, 2603, 273, 365, 18, 6011, 18, ...
def flushBanList(self):
def flushBanList(self, debug):
def flushBanList(self): iterBanList = self.banList.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip)
c286d568555896e33cade457d870630e35ea16c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/c286d568555896e33cade457d870630e35ea16c4/firewall.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 38, 304, 682, 12, 2890, 16, 1198, 4672, 1400, 38, 304, 682, 273, 365, 18, 21515, 682, 18, 2165, 3319, 1435, 364, 277, 316, 1048, 12, 1897, 12, 2890, 18, 21515, 682, 3719, 30, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 38, 304, 682, 12, 2890, 16, 1198, 4672, 1400, 38, 304, 682, 273, 365, 18, 21515, 682, 18, 2165, 3319, 1435, 364, 277, 316, 1048, 12, 1897, 12, 2890, 18, 21515, 682, 3719, 30, 9...
for length, words in self.__words.items(): for word in words: dictionary.append(word)
map(dictionary.extend, self.__words.values())
def __get_dictionary(self): dictionary = []
bc9d5a1d58b676e7cc6dcf78f4cef02419954da2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3480/bc9d5a1d58b676e7cc6dcf78f4cef02419954da2/lipsum.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 67, 15556, 12, 2890, 4672, 3880, 273, 5378, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 67, 15556, 12, 2890, 4672, 3880, 273, 5378, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
im = Image.open(str(atts['src']))
im = Image.open(str(uri))
def visit_image(self, node): atts = {} atts['src'] = node['uri'] if 'width' in node: atts['width'] = node['width'] if 'height' in node: atts['height'] = node['height'] if 'scale' in node: if Image and not ('width' in node and 'height' in node): try: im = Image.open(str(atts['src'])) except (IOError, # Source image can't be found or opened UnicodeError): # PIL doesn't like Unicode paths. pass else: if 'width' not in atts: atts['width'] = str(im.size[0]) if 'height' not in atts: atts['height'] = str(im.size[1]) del im for att_name in 'width', 'height': if att_name in atts: match = re.match(r'([0-9.]+)(\S*)$', atts[att_name]) assert match atts[att_name] = '%s%s' % ( float(match.group(1)) * (float(node['scale']) / 100), match.group(2)) style = [] for att_name in 'width', 'height': if att_name in atts: if re.match(r'^[0-9.]+$', atts[att_name]): # Interpret unitless values as pixels. atts[att_name] += 'px' style.append('%s: %s;' % (att_name, atts[att_name])) del atts[att_name] if style: atts['style'] = ' '.join(style) atts['alt'] = node.get('alt', atts['src']) if (isinstance(node.parent, nodes.TextElement) or (isinstance(node.parent, nodes.reference) and not isinstance(node.parent.parent, nodes.TextElement))): # Inline context or surrounded by <a>...</a>. suffix = '' else: suffix = '\n' if 'classes' in node and 'align-center' in node['classes']: node['align'] = 'center' if 'align' in node: if node['align'] == 'center': # "align" attribute is set in surrounding "div" element. self.body.append('<div align="center" class="align-center">') self.context.append('</div>\n') suffix = '' else: # "align" attribute is set in "img" element. atts['align'] = node['align'] self.context.append('') atts['class'] = 'align-%s' % node['align'] else: self.context.append('') self.body.append(self.emptytag(node, 'img', suffix, **atts))
767f1f92900ea84d3e8e234d76f0eeefc47ce08a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1278/767f1f92900ea84d3e8e234d76f0eeefc47ce08a/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 2730, 12, 2890, 16, 756, 4672, 15687, 273, 2618, 15687, 3292, 4816, 3546, 273, 756, 3292, 1650, 3546, 309, 296, 2819, 11, 316, 756, 30, 15687, 3292, 2819, 3546, 273, 756, 3292,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 2730, 12, 2890, 16, 756, 4672, 15687, 273, 2618, 15687, 3292, 4816, 3546, 273, 756, 3292, 1650, 3546, 309, 296, 2819, 11, 316, 756, 30, 15687, 3292, 2819, 3546, 273, 756, 3292,...
numerator = float(numerator)
numerator = float(re.search('[0-9.]+', numerator).group())
def divide_num(self, numerator, denominator): try: numerator = float(numerator) except TypeError, msg: if self.__run_level > 3: msg = 'no number to process?\n' msg += 'this indicates that the token ' msg += ' \(\\li\) should have a number and does not\n' msg += 'numerator is "%s"\n' % numerator msg += 'denominator is "%s"\n' % denominator raise self.__bug_handler, msg if 5 > self.__return_code: self.__return_code = 5 return 0 num = '%0.2f' % round(numerator/denominator, 2) return num string_num = str(num) if string_num[-2:] == ".0": string_num = string_num[:-2] return string_num
1a15073b7814ce8afff2ddf90ef05ff5287b52a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/1a15073b7814ce8afff2ddf90ef05ff5287b52a6/process_tokens.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12326, 67, 2107, 12, 2890, 16, 16730, 16, 15030, 4672, 775, 30, 16730, 273, 1431, 12, 266, 18, 3072, 2668, 63, 20, 17, 29, 18, 3737, 2187, 16730, 2934, 1655, 10756, 1335, 3580, 16, 123...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12326, 67, 2107, 12, 2890, 16, 16730, 16, 15030, 4672, 775, 30, 16730, 273, 1431, 12, 266, 18, 3072, 2668, 63, 20, 17, 29, 18, 3737, 2187, 16730, 2934, 1655, 10756, 1335, 3580, 16, 123...
\caption{Absorptance Curve}
\caption{Directional-hemispherical Absorptance}
def latexBody(self): return r""" This is the results of your model run of \textbf{ABM-U} for the Natural Phenomenon Simulation Group (NPSG) at University of Waterloo.
555022dbebc27b8f6bf5d090591867f22554a335 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13808/555022dbebc27b8f6bf5d090591867f22554a335/abmu_c.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25079, 2250, 12, 2890, 4672, 327, 436, 8395, 1220, 353, 326, 1686, 434, 3433, 938, 1086, 434, 521, 955, 17156, 95, 2090, 49, 17, 57, 97, 364, 326, 423, 270, 3766, 4360, 275, 362, 275, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25079, 2250, 12, 2890, 4672, 327, 436, 8395, 1220, 353, 326, 1686, 434, 3433, 938, 1086, 434, 521, 955, 17156, 95, 2090, 49, 17, 57, 97, 364, 326, 423, 270, 3766, 4360, 275, 362, 275, ...
return 0 return rffi.cast(rwin32.LPDWORD, buf)[0]
return space.wrap(0) d = rffi.cast(rwin32.LPDWORD, buf)[0] return space.wrap(d)
def convert_from_regdata(buf, buflen, typ): if typ == rwinreg.REG_DWORD: if not buflen: return 0 return rffi.cast(rwin32.LPDWORD, buf)[0] elif typ == rwinreg.REG_SZ or typ == rwinreg.REG_EXPAND_SZ: if not buflen: return u"" return rffi.charp2strn(rffi.cast(rffi.CCHARP, buf), buflen) elif typ == rwinreg.REG_MULTI_SZ: if not buflen: return [] i = 0 l = [] while i < buflen and buf[i]: s = [] while i < buflen and buf[i] != '\0': s.append(buf[i]) i += 1 if len(s) == 0: break l.append(''.join(s)) i += 1 return l else: # REG_BINARY and all other types return rffi.charpsize2str(buf, buflen)
65a0cb4fb5ecc10e2f370ba1c4260d41630090c7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/65a0cb4fb5ecc10e2f370ba1c4260d41630090c7/interp_winreg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2080, 67, 1574, 892, 12, 4385, 16, 1681, 1897, 16, 3815, 4672, 309, 3815, 422, 7985, 267, 1574, 18, 5937, 67, 40, 7952, 30, 309, 486, 1681, 1897, 30, 327, 3476, 18, 4113, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2080, 67, 1574, 892, 12, 4385, 16, 1681, 1897, 16, 3815, 4672, 309, 3815, 422, 7985, 267, 1574, 18, 5937, 67, 40, 7952, 30, 309, 486, 1681, 1897, 30, 327, 3476, 18, 4113, 1...
bgimage=Image.open(backgroundfilename,"r").resize(screensize) draw=ImageDraw.Draw(bgimage)
overlayimage=Image.new("RGBA",screensize) draw=ImageDraw.Draw(overlayimage)
def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menunode=menunode[0] menuitems=menunode.getElementsByTagName("chapter") #Total number of video items on a single menu page (no less than 1!) itemsperpage = menuitems.length write( "Chapter items per page %s " % itemsperpage) #Get background image filename backgroundfilename = menunode.attributes["background"].value if backgroundfilename=="": fatalError("Background image is not set in theme file") backgroundfilename = getThemeFile(themeName,backgroundfilename) write( "Background image file is %s" % backgroundfilename) if not doesFileExist(backgroundfilename): fatalError("Background image not found (%s)" % backgroundfilename) #Get highlight color highlightcolor = "red" if menunode.hasAttribute("highlightcolor"): highlightcolor = menunode.attributes["highlightcolor"].value #Get menu music menumusic = "menumusic.ac3" if menunode.hasAttribute("music"): menumusic = menunode.attributes["music"].value #Get menu length menulength = 15 if menunode.hasAttribute("length"): menulength = int(menunode.attributes["length"].value) write("Music is %s, length is %s seconds" % (menumusic, menulength)) #Page number counter page=1 write( "Creating DVD sub-menus") while page <= numberofitems: write( "Sub-menu %s " % page) #Default settings for this page #Load background image bgimage=Image.open(backgroundfilename,"r").resize(screensize) draw=ImageDraw.Draw(bgimage) #Create image to hold button masks (same size as background) bgimagemask=Image.new("RGBA",bgimage.size) drawmask=ImageDraw.Draw(bgimagemask) spumuxdom = xml.dom.minidom.parseString('<subpictures><stream><spu force="yes" start="00:00:00.0" highlight="" select="" ></spu></stream></subpictures>') spunode = spumuxdom.documentElement.firstChild.firstChild #Extract the thumbnails chapterlist=createVideoChapters(page,itemsperpage,getLengthOfVideo(page),True) chapterlist=string.split(chapterlist,",") #Loop through all the items on this menu page chapter=0 while chapter < itemsperpage: # and itemsonthispage < itemsperpage: menuitem=menuitems[ chapter ] chapter+=1 drawThemeItem(page, itemsperpage, page, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, 999, chapter, chapterlist) #Save this menu image and its mask bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page)) spumuxdom.documentElement.firstChild.firstChild.setAttribute("highlight",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page)) #Release large amounts of memory ASAP ! del draw del bgimage del drawmask del bgimagemask #write( spumuxdom.toprettyxml()) WriteXMLToFile (spumuxdom,os.path.join(getTempPath(),"chapterspumux-%s.xml" % page)) if chaptermenuAspectRatio == "4:3": aspect_ratio = '2' elif chaptermenuAspectRatio == "16:9": aspect_ratio = '3' else: if getAspectRatioOfVideo(page) > aspectRatioThreshold: aspect_ratio = '3' else: aspect_ratio = '2' write("Encoding Chapter Menu Page %s using aspect ratio '%s'" % (page, chaptermenuAspectRatio)) encodeMenu(os.path.join(getTempPath(),"chaptermenu-%s.png" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"chapterspumux-%s.xml" % page), os.path.join(getTempPath(),"chaptermenu-%s.mpg" % page), aspect_ratio) #Tidy up
b4b3dc0760dd22f26d036660d08e363e0ebf4ef2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13713/b4b3dc0760dd22f26d036660d08e363e0ebf4ef2/mythburn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 782, 2487, 4599, 12, 1017, 266, 773, 554, 16, 888, 266, 409, 7259, 16, 1300, 792, 3319, 4672, 3536, 2729, 777, 326, 4573, 3824, 4602, 471, 1390, 364, 326, 8005, 451, 38, 321, 2137...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 782, 2487, 4599, 12, 1017, 266, 773, 554, 16, 888, 266, 409, 7259, 16, 1300, 792, 3319, 4672, 3536, 2729, 777, 326, 4573, 3824, 4602, 471, 1390, 364, 326, 8005, 451, 38, 321, 2137...
log.warning('table rendering failed for: ', fn) log.info('try safe table rendering') doc = BaseDocTemplate(fn) doc.addPageTemplates(SimplePage(pageSize=A3)) try: doc.build([table]) log.info('safe rendering ok') except LayoutError: log.warning('table rendering failed for: ', fn)
log.warning('table test rendering: reportlab LayoutError') log.info('trying safe table rendering') fail = True pw = printWidth ph = printHeight ar = ph/pw run = 1 while fail: pw += 20 ph += 20*ar if pw > printWidth * 2: break try: log.info('safe render run:', run) doc = BaseDocTemplate(fn) doc.addPageTemplates(SimplePage(pageSize=(pw,ph))) doc.build([table]) fail = False except: log.info('safe rendering fail for width:', pw) if fail: log.warning('error rendering table - removing table')
def renderTable(self, table): """ method that checks if a table can be rendered by reportlab. this is done, b/c large tables cause problems. if a large table is detected, it is rendered on a doublesize canvas and - on success - embedded as an scaled down image. """
442c211dd1dd7d424d7dbd07df420a4df660573f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12390/442c211dd1dd7d424d7dbd07df420a4df660573f/rlwriter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 1388, 12, 2890, 16, 1014, 4672, 3536, 707, 716, 4271, 309, 279, 1014, 848, 506, 7935, 635, 2605, 7411, 18, 333, 353, 2731, 16, 324, 19, 71, 7876, 4606, 4620, 9688, 18, 309, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 1388, 12, 2890, 16, 1014, 4672, 3536, 707, 716, 4271, 309, 279, 1014, 848, 506, 7935, 635, 2605, 7411, 18, 333, 353, 2731, 16, 324, 19, 71, 7876, 4606, 4620, 9688, 18, 309, 279, ...
def FindEnclosingBracketGroup(input): brackets = { '}': '{', ']': '[', ')': '(', } stack = [] count = 0 start = -1 for char in input: if char in brackets.values(): stack.append(char) if start == -1: start = count if char in brackets.keys(): try: last_bracket = stack.pop() except IndexError: return (-1, -1) if last_bracket != brackets[char]: return (-1, -1) if len(stack) == 0: return (start, count + 1) count = count + 1 return (-1, -1)
def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes, depth): # If depth is set, predefine the DEPTH variable to be a relative path from # this build file's directory to the directory identified by depth. if depth: variables['DEPTH'] = \ gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) if sys.platform in ('linux', 'linux2'): # TODO(mmentovai): replace this block with the real fix. build_file_path = os.path.abspath(build_file_path) if build_file_path in data: # Already loaded. return build_file_data = LoadOneBuildFile(build_file_path, data, aux_data, variables, includes, True) # Set up the included_files key indicating which .gyp files contributed to # this target dict. if 'included_files' in build_file_data: raise KeyError, build_file_path + ' must not contain included_files key' included = GetIncludedBuildFiles(build_file_path, aux_data) build_file_data['included_files'] = [] for included_file in included: # included_file is relative to the current directory, but it needs to # be made relative to build_file_path's directory. included_relative = \ gyp.common.RelativePath(included_file, os.path.dirname(build_file_path)) build_file_data['included_files'].append(included_relative) # Apply "pre"/"early" variable expansions and condition evaluations. ProcessVariablesAndConditionsInDict(build_file_data, False, variables.copy(), build_file_path) # Look at each project's target_defaults dict, and merge settings into # targets. if 'target_defaults' in build_file_data: index = 0 while index < len(build_file_data['targets']): # This procedure needs to give the impression that target_defaults is # used as defaults, and the individual targets inherit from that. # The individual targets need to be merged into the defaults. Make # a deep copy of the defaults for each target, merge the target dict # as found in the input file into that copy, and then hook up the # copy with the target-specific data merged into it as the replacement # target dict. old_target_dict = build_file_data['targets'][index] new_target_dict = copy.deepcopy(build_file_data['target_defaults']) MergeDicts(new_target_dict, old_target_dict, build_file_path, build_file_path) build_file_data['targets'][index] = new_target_dict index = index + 1 # No longer needed. del build_file_data['target_defaults'] # Look for dependencies. This means that dependency resolution occurs # after "pre" conditionals and variable expansion, but before "post" - # in other words, you can't put a "dependencies" section inside a "post" # conditional within a target. if 'targets' in build_file_data: for target_dict in build_file_data['targets']: if 'dependencies' not in target_dict: continue for dependency in target_dict['dependencies']: other_build_file = \ gyp.common.BuildFileAndTarget(build_file_path, dependency)[0] LoadTargetBuildFile(other_build_file, data, aux_data, variables, includes, depth) return data
50c3217c7f6c4b58c978f07dfac8b651edb8498f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/50c3217c7f6c4b58c978f07dfac8b651edb8498f/input.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 2326, 3116, 812, 12, 3510, 67, 768, 67, 803, 16, 501, 16, 9397, 67, 892, 16, 3152, 16, 6104, 16, 3598, 4672, 468, 971, 3598, 353, 444, 16, 675, 11255, 326, 2030, 22561, 2190, 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, 4444, 2326, 3116, 812, 12, 3510, 67, 768, 67, 803, 16, 501, 16, 9397, 67, 892, 16, 3152, 16, 6104, 16, 3598, 4672, 468, 971, 3598, 353, 444, 16, 675, 11255, 326, 2030, 22561, 2190, 3...
gcompris.utils.svg_restore("anim", filename, fles.root_anim ) if (len(fles.root_anim.item_list) > 0): last_picture = fles.root_anim.item_list[-1] for item in last_picture.item_list: gcompris.utils.clone_item(item, fles.root_drawingitem) fles.anchorize(fles.root_drawingitem.item_list[-1])
def svg_restore(filename): print "svg_restore", filename global fles gcompris.utils.svg_restore("anim", filename, fles.root_anim ) if (len(fles.root_anim.item_list) > 0): last_picture = fles.root_anim.item_list[-1] for item in last_picture.item_list: gcompris.utils.clone_item(item, fles.root_drawingitem) fles.anchorize(fles.root_drawingitem.item_list[-1]) # unselect object if necessary if (fles.selected != None): fles.selected.item_list[1].hide() fles.selected = None # Deactivate old button fles.old_tool_item.set(pixbuf = gcompris.utils.load_pixmap(fles.tools[fles.current_tool][1])) # Activate new button fles.current_tool = fles.select_tool_number fles.old_tool_item = fles.select_tool fles.old_tool_item.set(pixbuf = gcompris.utils.load_pixmap(fles.tools[fles.current_tool][2])) gcompris.set_cursor(fles.tools[fles.current_tool][3]);
b1c14c9a59e62e367ea62c3c74cab73788521d4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/b1c14c9a59e62e367ea62c3c74cab73788521d4b/anim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9804, 67, 13991, 12, 3459, 4672, 1172, 315, 11451, 67, 13991, 3113, 1544, 225, 2552, 284, 1040, 225, 468, 640, 4025, 733, 309, 4573, 309, 261, 74, 1040, 18, 8109, 480, 599, 4672, 284, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9804, 67, 13991, 12, 3459, 4672, 1172, 315, 11451, 67, 13991, 3113, 1544, 225, 2552, 284, 1040, 225, 468, 640, 4025, 733, 309, 4573, 309, 261, 74, 1040, 18, 8109, 480, 599, 4672, 284, ...
assert(totalSize == 0)
assert totalSize == 0, '%d unexpected trailing bytes fetching args %r' %(totalSize, args)
def _getCsFromRepos(target, cs, server, job, recurse, withFiles, withFileContents, excludeAutoSource, filesNeeded, chgSetList, removedList, changesetVersion, mirrorMode): abortCheck = None if callback: callback.requestingChangeSet() server.setAbortCheck(abortCheck) args = (job, recurse, withFiles, withFileContents, excludeAutoSource) serverVersion = server.getProtocolVersion()
85763fbf3b757bf06a027ab30f2a3c71dac80086 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/85763fbf3b757bf06a027ab30f2a3c71dac80086/netclient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 14272, 1265, 28453, 12, 3299, 16, 2873, 16, 1438, 16, 1719, 16, 11502, 16, 598, 2697, 16, 598, 812, 6323, 16, 4433, 4965, 1830, 16, 1390, 11449, 16, 462, 75, 694, 682, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 14272, 1265, 28453, 12, 3299, 16, 2873, 16, 1438, 16, 1719, 16, 11502, 16, 598, 2697, 16, 598, 812, 6323, 16, 4433, 4965, 1830, 16, 1390, 11449, 16, 462, 75, 694, 682, 16, ...
"on_ok_button_clicked" : self.on_ok_button_clicked,
def __init__(self, xml, partClist): self.xml = xml self.partClist = partClist self.partitionDialog = self.xml.get_widget("partition_dialog") self.partitionDialog.connect ("destroy", self.destroy) self.mountPointCombo = self.xml.get_widget("mountPointCombo") self.fsTypeCombo = self.xml.get_widget("fsTypeCombo") self.sizeCombo = self.xml.get_widget("sizeCombo") self.asPrimaryCheck = self.xml.get_widget("asPrimaryCheck") self.asPrimaryNumCheck = self.xml.get_widget("asPrimaryNumCheck") self.asPrimaryNumCombo = self.xml.get_widget("asPrimaryNumCombo") self.asPrimaryNumBox = self.xml.get_widget("asPrimaryNumBox") self.onDiskCheck = self.xml.get_widget("onDiskCheck") self.onDiskEntry = self.xml.get_widget("onDiskEntry") self.onDiskBox = self.xml.get_widget("onDiskBox") self.onPartCheck = self.xml.get_widget("onPartCheck") self.onPartEntry = self.xml.get_widget("onPartEntry") self.onPartBox = self.xml.get_widget("onPartBox") self.sizeFixedRadio = self.xml.get_widget("sizeFixedRadio") self.sizeSetRadio = self.xml.get_widget("sizeSetRadio") self.sizeMaxRadio = self.xml.get_widget("sizeMaxRadio") self.maxSizeCombo = self.xml.get_widget("maxSizeCombo") self.formatRadio = self.xml.get_widget("formatRadio")
929ed22dc2ac34d175a48b1a35936e1cabfd84f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5376/929ed22dc2ac34d175a48b1a35936e1cabfd84f4/partWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2025, 16, 1087, 39, 1098, 4672, 365, 18, 2902, 273, 2025, 365, 18, 2680, 39, 1098, 273, 1087, 39, 1098, 365, 18, 10534, 6353, 273, 365, 18, 2902, 18, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2025, 16, 1087, 39, 1098, 4672, 365, 18, 2902, 273, 2025, 365, 18, 2680, 39, 1098, 273, 1087, 39, 1098, 365, 18, 10534, 6353, 273, 365, 18, 2902, 18, 5...