rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
EXAMPLE: | EXAMPLE:: | def __len__(self): """ Return the length of input bit strings. | dd81b4a97db8b232434d8623d237dba45e418834 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/dd81b4a97db8b232434d8623d237dba45e418834/sbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
12,
2890,
4672,
3536,
2000,
326,
769,
434,
810,
2831,
2064,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1897,
972,
12,
2890,
4672,
3536,
2000,
326,
769,
434,
810,
2831,
2064,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
postlaunch = [ 'From sfu-scmprocess-1 so the following:\n' ] + postlaunch | postlaunch = [ 'From sfu-scmprocess-1 do the following:\n' ] + postlaunch | def make_ticket_text(engineer): tag_prefix = date.today().strftime('release_%Y%m%d') # get release tag existing_tags_today = command('git tag -l %s*' % tag_prefix) if existing_tags_today: tag = '%s.%.2d' % (tag_prefix, len(existing_tags_today)) else: tag = tag_prefix last_release = command('git tag -l release_*') if last_release: last_release = last_release[-1] else: last_release = '' changes = command( 'git', 'log', "--format=* %h %s", last_release.strip() + '..') changes = ''.join(changes) prelaunch = [] postlaunch = [] needs_reactor_setup = raw_input('Does this release require a reactor_setup? [n]') needs_flyway = raw_input('Does this release require a migration? [y]') if needs_reactor_setup[:1].lower() in ('y', '1'): postlaunch.append('* service reactor stop') postlaunch.append('* paster reactor_setup /var/local/config/production.ini') postlaunch.append('* service reactor start') if needs_flyway[:1].lower() in ('', 'y', '1'): prelaunch.append('* dump the database in case we need to roll back') postlaunch.append('* paster flyway --url mongo://sfn-mongo-1:27017/') if postlaunch: postlaunch = [ 'From sfu-scmprocess-1 so the following:\n' ] + postlaunch postlaunch = '\n'.join(postlaunch) else: postlaunch = '-none-' if prelaunch: prelaunch = [ 'From sfu-scmprocess-1 so the following:\n' ] + prelaunch prelaunch = '\n'.join(prelaunch) else: prelaunch = '-none-' return TICKET_TEMPLATE.substitute(locals()), tag | 9e8f1938c74897f25a3a5b9ef73931cdf2e405d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/9e8f1938c74897f25a3a5b9ef73931cdf2e405d0/push_re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16282,
67,
955,
12,
8944,
264,
4672,
1047,
67,
3239,
273,
1509,
18,
30064,
7675,
701,
9982,
2668,
9340,
10185,
61,
9,
81,
9,
72,
6134,
468,
336,
3992,
1047,
2062,
67,
4156,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16282,
67,
955,
12,
8944,
264,
4672,
1047,
67,
3239,
273,
1509,
18,
30064,
7675,
701,
9982,
2668,
9340,
10185,
61,
9,
81,
9,
72,
6134,
468,
336,
3992,
1047,
2062,
67,
4156,
... |
if self.foundTitleTag: | if self.inTitleTag: | def handle_entityref (self, ref, *args): if self.foundTitleTag: # TODO: set the correct encoding self.title+= unicode ("&%s;" % ref, 'iso-8859-1') | 7c75257e75d4263cbfee9c20448d9532e16b54d6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5759/7c75257e75d4263cbfee9c20448d9532e16b54d6/url.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1096,
1734,
261,
2890,
16,
1278,
16,
380,
1968,
4672,
309,
365,
18,
267,
4247,
1805,
30,
468,
2660,
30,
444,
326,
3434,
2688,
365,
18,
2649,
15,
33,
5252,
7566,
10,
9,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1096,
1734,
261,
2890,
16,
1278,
16,
380,
1968,
4672,
309,
365,
18,
267,
4247,
1805,
30,
468,
2660,
30,
444,
326,
3434,
2688,
365,
18,
2649,
15,
33,
5252,
7566,
10,
9,
87,
... |
class TubFailures(ShouldFailMixin, unittest.TestCase): | class TubFailures(ExamineFailuresMixin, ShouldFailMixin, unittest.TestCase): | def test_local_return_violation_default(self): rr, target = self.setupTarget(Target(), True) d = self.shouldFail(Violation, "one", None, rr.callRemote, "add", a=1, b=2, _resultConstraint=str) d.addCallback(self._examine_local_return_violation) return d | 5ebf7776b3da378747b0706368a030e68866a6d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13646/5ebf7776b3da378747b0706368a030e68866a6d7/test_call.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3729,
67,
2463,
67,
522,
12255,
67,
1886,
12,
2890,
4672,
8354,
16,
1018,
273,
365,
18,
8401,
2326,
12,
2326,
9334,
1053,
13,
302,
273,
365,
18,
13139,
3754,
12,
11683,
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,
1842,
67,
3729,
67,
2463,
67,
522,
12255,
67,
1886,
12,
2890,
4672,
8354,
16,
1018,
273,
365,
18,
8401,
2326,
12,
2326,
9334,
1053,
13,
302,
273,
365,
18,
13139,
3754,
12,
11683,
16,
... |
def __init__(self, id=getuuid(), host='localhost', port=5672): | def __init__(self, id=None, host='localhost', port=5672): | def __init__(self, id=getuuid(), host='localhost', port=5672): """ @param host: The broker fqdn or IP. @type host: str @param port: The broker port. @type port: str """ self.id = id self.host = host self.port = port self.__session = None self.connect() self.open() | be6c0e407002d905c369299383e27819ac3afd88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/be6c0e407002d905c369299383e27819ac3afd88/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
612,
33,
7036,
16,
1479,
2218,
13014,
2187,
1756,
33,
4313,
9060,
4672,
3536,
632,
891,
1479,
30,
1021,
8625,
19897,
578,
2971,
18,
632,
723,
1479,
30,
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,
612,
33,
7036,
16,
1479,
2218,
13014,
2187,
1756,
33,
4313,
9060,
4672,
3536,
632,
891,
1479,
30,
1021,
8625,
19897,
578,
2971,
18,
632,
723,
1479,
30,
6... |
r" *use +(?P<module>[a-zA-Z_][a-zA-Z_0-9]*)(?P<only> *, *only:)? *(?P<imports>.*)$", | r" *use +(?P<module>[a-zA-Z_][a-zA-Z_0-9]*)(?P<only> *, *only *:)? *(?P<imports>.*)$", | def parseUse(inFile): """Parses the use statements in inFile The parsing stops at the first non use statement. Returns something like: ([{'module':'module1','only':['el1',el2=>el3']},...], '! comment1\\n!comment2...\\n', 'last line (the line that stopped the parsing)') """ useStartRe=re.compile( r" *(?P<use>use[^&!]*)(?P<continue>&?) *(?P<comment>!.*)?$", flags=re.IGNORECASE) commentRe=re.compile(r" *!.*$") contLineRe=re.compile( r"(?P<contLine>[^&!]*)(?P<continue>&?) *(?P<comment>!.*)?$") useParseRe=re.compile( r" *use +(?P<module>[a-zA-Z_][a-zA-Z_0-9]*)(?P<only> *, *only:)? *(?P<imports>.*)$", flags=re.IGNORECASE) lineNr=0 comments="" modules=[] line="" while 1: line=inFile.readline() lineNr=lineNr+1 if not line: break m=useStartRe.match(line) if m: # read whole use compactedUse=m.group('use') useComments="" if m.group('comment'): useComments=m.group('comment')+'\n' while m.group('continue'): lineNr=lineNr+1 m=contLineRe.match(inFile.readline()) compactedUse=compactedUse+m.group('contLine') if m.group('comment'): useComments=useComments+m.group('comment')+'\n' # parse use m=useParseRe.match(compactedUse) if not m: raise SyntaxError("could not parse use ending at line "+ str(lineNr)+" (compactedUse="+compactedUse+ ")") useAtt={'module':m.group('module')} if m.group('only'): useAtt['only']=map(string.strip, string.split(m.group('imports'),',')) else: useAtt['renames']=map(string.strip, string.split(m.group('imports'),',')) if useComments : useAtt['comments']=useComments # add use to modules modules.append(useAtt) elif commentRe.match(line): comments=comments+line elif line and not line.isspace(): break return (modules,comments,line) | 7d204ee385d3314605c55eb04b0437db277fe8b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2834/7d204ee385d3314605c55eb04b0437db277fe8b6/normalizeUse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
3727,
12,
267,
812,
4672,
3536,
6656,
326,
999,
6317,
316,
316,
812,
1021,
5811,
12349,
622,
326,
1122,
1661,
999,
3021,
18,
2860,
5943,
3007,
30,
23265,
27828,
2978,
11,
2497,
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,
1109,
3727,
12,
267,
812,
4672,
3536,
6656,
326,
999,
6317,
316,
316,
812,
1021,
5811,
12349,
622,
326,
1122,
1661,
999,
3021,
18,
2860,
5943,
3007,
30,
23265,
27828,
2978,
11,
2497,
297... |
'cvv' : str(data.credit_card.ccv), | 'cvv' : data.credit_card.ccv, | def prepareData(self, data): self.order = data # See tclink developer's guide for additional fields and info # convert amount to cents, no decimal point amount = str(data.balance).replace ('.', '') | 61512a3da045e7727e74347eadb4063ee34eb780 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13656/61512a3da045e7727e74347eadb4063ee34eb780/processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
16... |
session.__remote_http_address = request.get_environ("REMOTE_HTTP_ADDR") | session.set_remote_http_address(request.get_environ("REMOTE_ADDR")) | def get_session (self, request): """get_session(request : HTTPRequest) -> Session | 365cdecd4696d76e5bed36445d15d1f5505338a9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/365cdecd4696d76e5bed36445d15d1f5505338a9/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3184,
261,
2890,
16,
590,
4672,
3536,
588,
67,
3184,
12,
2293,
294,
25238,
13,
317,
3877,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3184,
261,
2890,
16,
590,
4672,
3536,
588,
67,
3184,
12,
2293,
294,
25238,
13,
317,
3877,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
OWGUI.lineEdit(gbox, self, 'GroupText', label='Subset sizes (e.g. "0.1, 0.2, 0.5"):', callback=self.changeCombo) | OWGUI.lineEdit(gbox, self, 'GroupText', label='Subset sizes (e.g. "0.1, 0.2, 0.5"):', callback=self.multipleChanged) | def __init__(self, parent=None, signalManager=None): OWWidget.__init__(self, parent, signalManager, 'SampleData') self.inputs = [("Data", ExampleTable, self.cdata)] self.outputs = [("Examples", ExampleTable), ("Classified Examples", ExampleTableWithClass), ("Remaining Examples", ExampleTable), ("Remaining Classified Examples", ExampleTableWithClass)] | 72ac0f7f2c55faee600e57efcc7b624d6ae3d6d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/72ac0f7f2c55faee600e57efcc7b624d6ae3d6d0/OWDataSampler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
33,
7036,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
296,
8504,
751,
6134,
225,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
33,
7036,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
296,
8504,
751,
6134,
225,
365,
18,
... |
opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wWM:j:', | opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:FwWM:j:', | def main(tests=None, testdir=None, verbose=0, quiet=False, exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, random_seed=None, use_mp=None, verbose3=False): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, exclude, single, randomize, findleaks, use_resources, trace, coverdir, print_slow and random_seed) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wWM:j:', ['help', 'verbose', 'verbose2', 'verbose3', 'quiet', 'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=', 'multiprocess=', 'slaveargs=']) except getopt.error, msg: usage(2, msg) # Defaults if random_seed is None: random_seed = random.randrange(10000000) if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-w', '--verbose2'): verbose2 = True elif o in ('-W', '--verbose3'): verbose3 = True elif o in ('-q', '--quiet'): quiet = True; verbose = 0 elif o in ('-x', '--exclude'): exclude = True elif o in ('-s', '--single'): single = True elif o in ('-S', '--slow'): print_slow = True elif o in ('-r', '--randomize'): randomize = True elif o == '--randseed': random_seed = int(a) elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = True elif o in ('-L', '--runleaks'): runleaks = True elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-T', '--coverage'): trace = True elif o in ('-D', '--coverdir'): coverdir = os.path.join(os.getcwd(), a) elif o in ('-N', '--nocoverdir'): coverdir = None elif o in ('-R', '--huntrleaks'): huntrleaks = a.split(':') if len(huntrleaks) != 3: print a, huntrleaks usage(2, '-R takes three colon-separated arguments') if len(huntrleaks[0]) == 0: huntrleaks[0] = 5 else: huntrleaks[0] = int(huntrleaks[0]) if len(huntrleaks[1]) == 0: huntrleaks[1] = 4 else: huntrleaks[1] = int(huntrleaks[1]) if len(huntrleaks[2]) == 0: huntrleaks[2] = "reflog.txt" elif o in ('-M', '--memlimit'): test_support.set_memlimit(a) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) elif o in ('-j', '--multiprocess'): use_mp = int(a) elif o == '--slaveargs': args, kwargs = json.loads(a) try: result = runtest(*args, **kwargs) except BaseException, e: result = INTERRUPTED, e.__class__.__name__ print # Force a newline (just in case) print json.dumps(result) sys.exit(0) if single and fromfile: usage(2, "-s and -f don't go together!") if use_mp and trace: usage(2, "-T and -j don't go together!") if use_mp and findleaks: usage(2, "-l and -j don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] environment_changed = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = False else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.seed(random_seed) print "Using random seed", random_seed random.shuffle(tests) if trace: import trace tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=False, count=True) test_times = [] test_support.use_resources = use_resources save_modules = sys.modules.keys() def accumulate_result(test, result): ok, test_time = result test_times.append((test_time, test)) if ok == PASSED: good.append(test) elif ok == FAILED: bad.append(test) elif ok == ENV_CHANGED: bad.append(test) environment_changed.append(test) elif ok == SKIPPED: skipped.append(test) elif ok == RESOURCE_DENIED: skipped.append(test) resource_denieds.append(test) if use_mp: from threading import Thread from Queue import Queue, Empty from subprocess import Popen, PIPE, STDOUT from collections import deque debug_output_pat = re.compile(r"\[\d+ refs\]$") pending = deque() output = Queue() for test in tests: args_tuple = ( (test, verbose, quiet, testdir), dict(huntrleaks=huntrleaks, use_resources=use_resources) ) pending.append((test, args_tuple)) def work(): # A worker thread. try: while True: try: test, args_tuple = pending.popleft() except IndexError: output.put((None, None, None, None)) return # -E is needed by some tests, e.g. test_import popen = Popen([sys.executable, '-E', '-m', 'test.regrtest', '--slaveargs', json.dumps(args_tuple)], stdout=PIPE, stderr=PIPE, universal_newlines=True, close_fds=True) stdout, stderr = popen.communicate() # Strip last refcount output line if it exists, since it # comes from the shutdown of the interpreter in the subcommand. stderr = debug_output_pat.sub("", stderr) stdout, _, result = stdout.strip().rpartition("\n") result = json.loads(result) if not quiet: stdout = test+'\n'+stdout output.put((test, stdout.rstrip(), stderr.rstrip(), result)) except BaseException: output.put((None, None, None, None)) raise workers = [Thread(target=work) for i in range(use_mp)] for worker in workers: worker.start() finished = 0 while finished < use_mp: test, stdout, stderr, result = output.get() if test is None: finished += 1 continue if stdout: print stdout if stderr: print >>sys.stderr, stderr if result[0] == INTERRUPTED: assert result[1] == 'KeyboardInterrupt' pending.clear() raise KeyboardInterrupt # What else? accumulate_result(test, result) for worker in workers: worker.join() else: for test in tests: if not quiet: print test sys.stdout.flush() if trace: # If we're tracing code coverage, then we don't exit with status # if on a false return value from main. tracer.runctx('runtest(test, verbose, quiet, testdir)', globals=globals(), locals=vars()) else: try: result = runtest(test, verbose, quiet, testdir, huntrleaks) accumulate_result(test, result) if verbose3 and result[0] == FAILED: print "Re-running test %r in verbose mode" % test runtest(test, True, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() environment_changed.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if print_slow: test_times.sort(reverse=True) print "10 slowest tests:" for time, test in test_times[:10]: print "%s: %.1fs" % (test, time) if bad: bad = set(bad) - set(environment_changed) if bad: print count(len(bad), "test"), "failed:" printlist(bad) if environment_changed: print "{} altered the execution environment:".format( count(len(environment_changed), "test")) printlist(environment_changed) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if verbose2 and bad: print "Re-running failed tests in verbose mode" for test in bad: print "Re-running test %r in verbose mode" % test sys.stdout.flush() try: test_support.verbose = True ok = runtest(test, True, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) if trace: r = tracer.results() r.write_results(show_missing=True, summary=True, coverdir=coverdir) if runleaks: os.system("leaks %d" % os.getpid()) sys.exit(len(bad) > 0) | 105f0d7e51a424a7529837f5f84b9f0110141e58 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/105f0d7e51a424a7529837f5f84b9f0110141e58/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
8381,
16,
4433,
33,
8381,
16,
2202,
33,
8381,
16,
2744,
554,
33,
8381,
16,
628,
768,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
8381,
16,
4433,
33,
8381,
16,
2202,
33,
8381,
16,
2744,
554,
33,
8381,
16,
628,
768,
33,
7036,
... |
def _moveMessage(self, old_msg, dest): msg = IMAPMessage(dest.uid, dest.folder_name, None) msg.setId(msg.extractTime()) msg.copy(old_msg) msg.Append() old_msg.Delete() def _filterMessage(self, msg): if msg.isClsfdHam(): print "untouched" pass elif msg.isClsfdSpam(): self._moveMessage(msg, self.spam_folder) else: self._moveMessage(msg, self.unsure_folder) | def Logout(self): # sign off if options.imap_expunge: imap.expunge() imap.logout() | 78562f294fdc412cde22daf1b88e62102ccf5c10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/78562f294fdc412cde22daf1b88e62102ccf5c10/imapfilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29381,
12,
2890,
4672,
468,
1573,
3397,
309,
702,
18,
12161,
67,
2749,
25561,
30,
20226,
18,
2749,
25561,
1435,
20226,
18,
21229,
1435,
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,
0,
0,
0,
0,
0,
0,
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,
29381,
12,
2890,
4672,
468,
1573,
3397,
309,
702,
18,
12161,
67,
2749,
25561,
30,
20226,
18,
2749,
25561,
1435,
20226,
18,
21229,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
else: try: config = omero.config.ConfigXml(str(cfg_xml)) config.save() except portalocker.LockException: self.ctx.die(111, "Could not acquire lock on %s" % cfg_xml) | try: config = omero.config.ConfigXml(str(cfg_xml)) config.save() except portalocker.LockException: self.ctx.die(111, "Could not acquire lock on %s" % cfg_xml) | def open_config(self, unused): """ Callers are responsible for closing the returned ConfigXml object. """ cfg_xml = self.ctx.dir / "etc" / "grid" / "config.xml" cfg_tmp = self.ctx.dir / "etc" / "grid" / "config.xml.tmp" if not cfg_xml.exists(): if cfg_tmp.exists(): self.ctx.dbg("Removing old config.xml.tmp") cfg_tmp.remove() config = omero.config.ConfigXml(str(cfg_tmp)) try: self.ctx.controls["config"].upgrade(None, config) finally: config.save() self.ctx.err("Creating %s" % cfg_xml) cfg_tmp.rename(str(cfg_xml)) else: # File exists, but we create it for updating. try: config = omero.config.ConfigXml(str(cfg_xml)) config.save() except portalocker.LockException: self.ctx.die(111, "Could not acquire lock on %s" % cfg_xml) return config | 9ea0cb6ceee9761b067b7476edb2248df207c4d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/9ea0cb6ceee9761b067b7476edb2248df207c4d3/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
1425,
12,
2890,
16,
10197,
4672,
3536,
3049,
414,
854,
14549,
364,
7647,
326,
2106,
1903,
4432,
733,
18,
3536,
2776,
67,
2902,
273,
365,
18,
5900,
18,
1214,
342,
315,
14175,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
1425,
12,
2890,
16,
10197,
4672,
3536,
3049,
414,
854,
14549,
364,
7647,
326,
2106,
1903,
4432,
733,
18,
3536,
2776,
67,
2902,
273,
365,
18,
5900,
18,
1214,
342,
315,
14175,
... |
from Bio.config.DBRegistry import db | def __init__(self, database, format, parser = None): """Initialize an NCBI dictionary to retrieve sequences. | 217f7ac2b50a03689165ce526b2ff39532621d4b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/217f7ac2b50a03689165ce526b2ff39532621d4b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2063,
16,
740,
16,
2082,
273,
599,
4672,
3536,
7520,
392,
423,
8876,
45,
3880,
358,
4614,
8463,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2063,
16,
740,
16,
2082,
273,
599,
4672,
3536,
7520,
392,
423,
8876,
45,
3880,
358,
4614,
8463,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
'en': u'Uncyclopedia talk', | def __init__(self): family.Family.__init__(self) self.name = 'uncyclopedia' | 5291e54d99c50e05679c62b06fbab03ab3f57e0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/5291e54d99c50e05679c62b06fbab03ab3f57e0d/uncyclopedia_family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
551,
93,
7550,
1845,
1155,
11,
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,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
551,
93,
7550,
1845,
1155,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
build(file, work) | build(file, work, hgloc) | def rebuild(file, work): print "Rebuild...." clean(file, work) build(file, work) | 28fabf177fb94b1161310db40dd45aa975737292 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6977/28fabf177fb94b1161310db40dd45aa975737292/version.cpp.maker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13419,
12,
768,
16,
1440,
4672,
1172,
315,
426,
3510,
6265,
6,
2721,
12,
768,
16,
1440,
13,
1361,
12,
768,
16,
1440,
16,
22576,
1829,
13,
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,
13419,
12,
768,
16,
1440,
4672,
1172,
315,
426,
3510,
6265,
6,
2721,
12,
768,
16,
1440,
13,
1361,
12,
768,
16,
1440,
16,
22576,
1829,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
outputFile.write("\tstatic float fA[STATE_NO];\n") outputFile.write("\tstatic float fA1[STATE_NO];\n") outputFile.write("\tstatic float fA2[STATE_NO];\n") | outputFile.write("\t float fA[STATE_NO];\n") outputFile.write("\t float fA1[STATE_NO];\n") outputFile.write("\t float fA2[STATE_NO];\n") | def writeCModel(outputFile, primaryParameterList, parameterList, cParameters, forwardModel, silentModel, subModel): """This function writes the .c file. """ outputFile = open(outputFile, 'w') #Write header lines outputFile.write("#include <stdio.h>\n") outputFile.write("#include <assert.h>\n") outputFile.write('#include "fastCMaths.h"\n') outputFile.write('#include "substitutionC.h"\n') outputFile.write('#include "sequenceGraphC.h"\n') outputFile.write('#include "xyzModelC.h"\n\n') #Number of states outputFile.write("#define STATE_NO %i\n\n" % (len(forwardModel.getStateNames())-2)) #Now write out states. stateIndex = 0 for state in forwardModel.getStateNames(): i = forwardModel.getStateType(state) if i != START and i != END: outputFile.write("const int32_t %s = %i;\n" %(state, stateIndex)) stateIndex += 1 outputFile.write("\n") #Now write state check functions. l = [ (SILENT, "Silent"), (DELETE_XZ, "XYDelete"),\ (INSERT_X, "XInsert"), (INSERT_Z, "YInsert"),\ (DELETE_X, "XDelete"), (DELETE_Z, "YDelete"),\ (MATCH, "Match") ] for stateType, functionName in l: outputFile.write("inline int32_t is%s(int32_t state) {\n" % functionName) for state in forwardModel.getStateNames(stateType): outputFile.write("\tif(state == %s) return TRUE;\n" % state) outputFile.write("\treturn FALSE; \n}\n\n") outputFile.write("struct CombinedTransitionModel *constructCombinedTransitionModel(float DX, float DZ, int32_t includeRoot, struct ParameterStruct *pS) {\n") outputFile.write("\tstruct CombinedTransitionModel *temp = mallocLocal(sizeof(struct CombinedTransitionModel));\n\n") outputFile.write('\tlogInfo("Building combined transition model, DX: %%f, DY %%f\\n", DX, DZ);\n') #Are we including the root in these probs. outputFile.write("\ttemp->includeRoot = includeRoot;\n") outputFile.write('\tlogInfo("Is root? " INT_STRING " \\n", temp->includeRoot);\n') #Write out submodel subModel.writeCFile(outputFile) #Write out C parameters. outputFile.write('\tint32_t i;\n\tint32_t j;\n') outputFile.write('\tfor(i=0; i<ALPHABET_SIZE; i++) {\n') outputFile.write('\t\tlogInfo("Stationary frequency %i value %%f \\n", i, temp->subModelX->stationaryDistribution[i]);\n\t}\n') outputFile.write('\tfor(i=0; i<ALPHABET_SIZE; i++) {\n') outputFile.write('\t\tfor(j=0; j<ALPHABET_SIZE; j++) {\n') outputFile.write('\t\t\tlogInfo("Substitition probability (X Branch) %i %i, forward value %%f, backward value %%f\\n", i, j, temp->subModelX->forward[i*ALPHABET_SIZE + j], temp->subModelX->backward[i*ALPHABET_SIZE + j]);\n\t\t}\n\t}\n') outputFile.write('\tfor(i=0; i<ALPHABET_SIZE; i++) {\n') outputFile.write('\t\tfor(j=0; j<ALPHABET_SIZE; j++) {\n') outputFile.write('\t\t\tlogInfo("Substitition probability (Z Branch) %i %i, forward value %%f, backward value %%f\\n", i, j, temp->subModelY->forward[i*ALPHABET_SIZE + j], temp->subModelY->backward[i*ALPHABET_SIZE + j]);\n\t\t}\n\t}\n') for parameterName, value in primaryParameterList: outputFile.write("\tfloat %s = pS->%s;\n" % (parameterName, parameterName)) outputFile.write('\tlogInfo("Parameter %s, value %%f\\n", %s);\n' % (parameterName, parameterName)) #Now write out parameters. for parameterName, value in parameterList: if (parameterName, value) not in primaryParameterList: outputFile.write("\tfloat %s = %s;\n" % (parameterName, value)) outputFile.write('\tlogInfo("Parameter %s, value %%f\\n", %s);\n' % (parameterName, parameterName)) #Now write out all transitions for toState in forwardModel.getStateNames(): i = forwardModel.getTransitionsTo(toState) for fromState in i.keys(): #print "This is", fromState, toState, i[fromState] outputFile.write("\ttemp->ft%s_%s = LOG(%s);\n" % (fromState, toState, i[fromState])) outputFile.write("\ttemp->tbt%s_%s = LOG(%s);\n" % (fromState, toState, replaceCParameters(i[fromState], cParameters))) outputFile.write('\tlogInfo("From state %s, To state %s, Forward Parameter %%f Traceback parameter %%f \\n", temp->ft%s_%s, temp->tbt%s_%s);\n' % (fromState, toState, fromState, toState, fromState, toState)) outputFile.write("\n") #States already organised into correct order. #Write out non-log parameters. for toState in silentModel.getStateNames(): i = silentModel.getTransitionsTo(toState) for fromState in i.keys(): #print "This is", fromState, toState, i[fromState] outputFile.write("\tfloat tlt%s_%s = %s;\n" % (fromState, toState, i[fromState])) outputFile.write("\tstatic float fA[STATE_NO];\n") outputFile.write("\tstatic float fA1[STATE_NO];\n") outputFile.write("\tstatic float fA2[STATE_NO];\n") outputFile.write("\tfloat *l1;\n\tfloat *l2;\n\tfloat *l3;\n") outputFile.write("\tl1 = fA1;\n") outputFile.write("\tl2 = fA2;\n") for fromState in silentModel.getStateNames(): #Initialise level 0 and 1 and output-matrix outputFile.write("\tfor(i=0; i<STATE_NO; i++) {\n\t\tl1[i] = 0.0;\n\t\tl2[i] = 0.0;\n\t\tfA[i] = 0.0;\n\t}\n") i = silentModel.getStateType(fromState) if i == SILENT: outputFile.write("\tl1[%s] = 1.0;\n" % fromState) else: outputFile.write("\tl2[%s] = 1.0;\n" % fromState) #Do levels outputFile.write("\tfor(i=0; i<1000; i++) {\n") #Do silent transitions for toState in silentModel.getStateNames(SILENT): for fromState2 in silentModel.getTransitionsTo(toState): outputFile.write("\t\tl1[%s] += l1[%s] * tlt%s_%s;\n" % (toState, fromState2, fromState2, toState)) #Add level to output for state in silentModel.getStateNames(): outputFile.write("\t\tfA[%s] += l1[%s];\n" % (state, state)) #Do delete-XZ transitions for toState in silentModel.getStateNames(DELETE_XZ): for fromState2 in silentModel.getTransitionsTo(toState): outputFile.write("\t\tl2[%s] += l1[%s] * tlt%s_%s;\n" % (toState, fromState2, fromState2, toState)) #Make level 2 level 1 and initialise level 2 with 0.0s outputFile.write("\t\tl3 = l1;\n") outputFile.write("\t\tl1 = l2;\n") outputFile.write("\t\tl2 = l3;\n") outputFile.write("\t\tfor(j=0; j<STATE_NO; j++)\n\t\t\tl2[j] = 0.0;\n\t}\n") #Now write out these computed transitions for toState in silentModel.getStateNames(): outputFile.write("\ttemp->lt%s_%s = LOG(fA[%s]);\n" % (fromState, toState, toState)) outputFile.write('\tlogInfo("From state %s, To state %s, LOOP PARAMETER %%f \\n", temp->lt%s_%s);\n' % (fromState, toState, fromState, toState)) outputFile.write("\treturn temp; \n}\n\n") l = [ (INSERT_X, "insertX"), (INSERT_Z, "insertY"), (DELETE_X, "deleteX"), (DELETE_Z, "deleteY") ] for stateType, functionName in l: #Forward function outputFile.write("inline void %sFn(struct AlignmentDataStructures *aDS, struct CombinedTransitionModel *model, struct Edge *edge," % functionName) outputFile.write("void (*assignFn)(struct AlignmentDataStructures *aDS, int32_t, int32_t, float)) {\n") for toState in forwardModel.getStateNames(stateType): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\tassignFn(aDS, %s, %s, model->ft%s_%s + edge->edgeScore + edge->subScore);\n" \ % (fromState, toState, fromState, toState)) outputFile.write("}\n\n") #Traceback function outputFile.write("inline void %sFn_TraceBack(struct AlignmentDataStructures *aDS, struct CombinedTransitionModel *model, struct Edge *edge," % functionName) outputFile.write("void (*assignFn)(struct AlignmentDataStructures *aDS, int32_t, int32_t, float, float)) {\n") outputFile.write("\tif (model->includeRoot) {\n\t\tfloat i;\n") for toState in forwardModel.getStateNames(stateType): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\t\ti = model->ft%s_%s + edge->edgeScore + edge->subScore;\n" % (fromState, toState)) outputFile.write("\t\tassignFn(aDS, %s, %s, i, i);\n" % (fromState, toState)) outputFile.write("\t}\n") outputFile.write("\telse {\n") for toState in forwardModel.getStateNames(stateType): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\t\tassignFn(aDS, %s, %s, model->ft%s_%s + edge->edgeScore + edge->subScore, model->tbt%s_%s + edge->edgeScore);\n" \ % (fromState, toState, fromState, toState, fromState, toState)) outputFile.write("\t}\n") outputFile.write("}\n\n") #Forward match function outputFile.write("inline void matchFn(struct AlignmentDataStructures *aDS, struct CombinedTransitionModel *model,") outputFile.write("struct Edge *edgeX, struct Edge *edgeY, void (*assignFn)(struct AlignmentDataStructures *aDS, int32_t, int32_t, float)) {\n") outputFile.write("\tstatic float m[ALPHABET_SIZE];\n") outputFile.write("\tstatic float i;\n") outputFile.write("\tstatic float j;\n") outputFile.write("\tmultiplyWV(edgeX->wV, edgeY->wV, m, ALPHABET_SIZE);\n") outputFile.write("\ti = LOG(combineWV(m, model->ancestorProbs, ALPHABET_SIZE));\n") for toState in forwardModel.getStateNames(MATCH): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\tj = model->ft%s_%s + edgeX->edgeScore + edgeY->edgeScore + i;\n" % (fromState, toState)) outputFile.write("\tassignFn(aDS, %s, %s, j);\n" % (fromState, toState)) outputFile.write("}\n\n") #Traceback match function outputFile.write("inline void matchFn_TraceBack(struct AlignmentDataStructures *aDS, struct CombinedTransitionModel *model,") outputFile.write("struct Edge *edgeX, struct Edge *edgeY, void (*assignFn)(struct AlignmentDataStructures *aDS, int32_t, int32_t, float, float)) {\n") outputFile.write("\tstatic float m[ALPHABET_SIZE];\n") outputFile.write("\tstatic float i;\n") outputFile.write("\tstatic float j;\n") outputFile.write("\tstatic float k;\n") outputFile.write("\tstatic float l;\n") outputFile.write("\tmultiplyWV(edgeX->wV, edgeY->wV, m, ALPHABET_SIZE);\n") outputFile.write("\ti = LOG(sumWV(m, ALPHABET_SIZE));\n") outputFile.write("\tj = LOG(combineWV(m, model->ancestorProbs, ALPHABET_SIZE));\n") outputFile.write("\tif (model->includeRoot) {\n") for toState in forwardModel.getStateNames(MATCH): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\t\tl = model->ft%s_%s + edgeX->edgeScore + edgeY->edgeScore + j;\n" % (fromState, toState)) outputFile.write("\t\tassignFn(aDS, %s, %s, l, l);\n" % (fromState, toState)) outputFile.write("\t}\n") outputFile.write("\telse {\n") for toState in forwardModel.getStateNames(MATCH): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\t\tk = model->tbt%s_%s + edgeX->edgeScore + edgeY->edgeScore + i;\n" % (fromState, toState)) outputFile.write("\t\tl = model->ft%s_%s + edgeX->edgeScore + edgeY->edgeScore + j;\n" % (fromState, toState)) outputFile.write("\t\tassignFn(aDS, %s, %s, l, k);\n" % (fromState, toState)) outputFile.write("\t}\n") outputFile.write("}\n\n") #Forward silent/delete_xz function outputFile.write("inline void silentFn(struct AlignmentDataStructures *aDS, struct CombinedTransitionModel *model, float *cell,") outputFile.write("void (*assignFn)(struct AlignmentDataStructures *aDS, int32_t, int32_t, float)) {\n") for toState in silentModel.getStateNames(): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): i = forwardModel.getStateType(fromState) if i != SILENT and i != DELETE_XZ: outputFile.write("\tassignFn(aDS, %s, %s, model->ft%s_%s);\n" % (fromState, toState, fromState, toState)) outputFile.write("\tstatic float fA[STATE_NO];\n\tfloat i;\n") for state in silentModel.getStateNames(): outputFile.write("\tfA[%s] = cell[%s];\n" % (state, state)) for toState in silentModel.getStateNames(): outputFile.write("\ti = LOG_ZERO;\n") for fromState in silentModel.getStateNames(): outputFile.write("\tLOG_PLUS_EQUALS(&i, fA[%s] + model->lt%s_%s);\n" % (fromState, fromState, toState)) outputFile.write("\tcell[%s] = i;\n" % toState) outputFile.write("}\n\n") #Traceback silent/delete_xz functions l = [ (SILENT, "silent"), (DELETE_XZ, "delete") ] for stateType, functionName in l: outputFile.write("inline void %sFn_TraceBack(struct AlignmentDataStructures *aDS, struct CombinedTransitionModel *model, void (*assignFn)(struct AlignmentDataStructures *aDS, int32_t, int32_t, float, float)) {\n" % functionName) outputFile.write("\tif (model->includeRoot) {\n") for toState in forwardModel.getStateNames(stateType): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\t\tassignFn(aDS, %s, %s, model->ft%s_%s, model->ft%s_%s);\n" \ % (fromState, toState, fromState, toState, fromState, toState)) outputFile.write("\t}\n") outputFile.write("\telse {\n") for toState in forwardModel.getStateNames(stateType): for fromState in forwardModel.getTransitionsTo(toState).keys(): if not forwardModel.isStart(fromState): outputFile.write("\t\tassignFn(aDS, %s, %s, model->ft%s_%s, model->tbt%s_%s);\n" \ % (fromState, toState, fromState, toState, fromState, toState)) outputFile.write("\t}\n}\n\n") #Destructor outputFile.write("void destructCombinedTransitionModel(struct CombinedTransitionModel *model) { free(model); }\n\n") #State no outputFile.write("int32_t stateNo() { return STATE_NO; }\n\n") #Start states outputFile.write("float *startStates(struct CombinedTransitionModel *model) {\n") outputFile.write("\tfloat *i; int32_t j; i = mallocLocal(sizeof(float)*STATE_NO);\n") outputFile.write("\tfor (j=0;j<STATE_NO; j++) i[j] = LOG_ZERO;\n") i = forwardModel.getStateNames(START) assert len(i) == 1, "More than one start state" startState = list(i)[0] for toState in forwardModel.getTransitionsFrom(startState).keys(): if forwardModel.getStateType(toState) != END: outputFile.write("\ti[%s] = model->ft%s_%s;\n" % (toState, startState, toState)) outputFile.write("\treturn i; \n}\n\n") #End states outputFile.write("float *endStates(struct CombinedTransitionModel *model) {\n") outputFile.write("\tfloat *i; int32_t j; i = mallocLocal(sizeof(float)*STATE_NO);\n") outputFile.write("\tfor (j=0;j<STATE_NO; j++) i[j] = LOG_ZERO;\n\n") i = forwardModel.getStateNames(END) assert len(i) == 1, "More than one end state" endState = list(i)[0] for fromState in forwardModel.getTransitionsTo(endState).keys(): if forwardModel.getStateType(fromState) != START: outputFile.write("\ti[%s] = model->ft%s_%s;\n" % (fromState, fromState, endState)) outputFile.write("\treturn i; \n}\n\n") #Paramaeter struct constructor outputFile.write("struct ParameterStruct *constructParamStruct(int argc, char *argv[]) {\n") outputFile.write("\tint32_t i;\n\tchar *mod;\n\tstruct ParameterStruct *pM = mallocLocal(sizeof(struct ParameterStruct));\n") outputFile.write("\tfloat floatParser;\n") for parameterName, value in primaryParameterList: outputFile.write("\tpM->%s = %s;\n" % (parameterName, value)) outputFile.write("\tfor(i=1; i<argc; i++) {\n") outputFile.write("\t\tmod = argv[i];\n") outputFile.write("\t\tif(mod[0] != '-') {\n\t\t\tcontinue;\n\t\t}\n\t\tassert(mod[0] == '-');\n") outputFile.write("\t\tswitch(mod[1]) {\n") characterNo = 65 for parameterName, value in primaryParameterList: outputFile.write("\t\t\tcase '%s':\n" % chr(characterNo)) characterNo += 1 outputFile.write('\t\t\t\tsscanf(argv[++i], "%f", &floatParser);\n') outputFile.write("\t\t\t\tpM->%s = floatParser;\n\t\t\tbreak;\n" % parameterName) outputFile.write("\t\t}\n\t}\n") outputFile.write("\treturn pM; \n}\n\n") #Parameter struct destructor. outputFile.write("void destructParamStruct(struct ParameterStruct *pM) {\n\tfree(pM);\n}\n\n") #Parameter reporter outputFile.write("void printParamStruct() {\n") characterNo = 65 for parameterName, value in primaryParameterList: outputFile.write('\tfprintf(stderr, "\t-%s [FLOAT] value of parameter %s , default: %s \\n");\n' % (chr(characterNo), parameterName, value)) characterNo += 1 outputFile.write("}\n\n") outputFile.close() | dbf974b4b00751e489af56722464025f38edde42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13140/dbf974b4b00751e489af56722464025f38edde42/TransducerCompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
39,
1488,
12,
2844,
812,
16,
3354,
1662,
682,
16,
1569,
682,
16,
276,
2402,
16,
5104,
1488,
16,
10404,
1488,
16,
720,
1488,
4672,
3536,
2503,
445,
7262,
326,
263,
71,
585,
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,
1045,
39,
1488,
12,
2844,
812,
16,
3354,
1662,
682,
16,
1569,
682,
16,
276,
2402,
16,
5104,
1488,
16,
10404,
1488,
16,
720,
1488,
4672,
3536,
2503,
445,
7262,
326,
263,
71,
585,
18,
... |
raise TypeError, "type %s of %s not understood"%(type(d),d) | raise TypeError, "type %s of %s not understood"%(type(d), d) | def polynomial_system(self, P=None, K=None): """ Return a MPolynomialSystem for self for a given plaintext-key pair. | 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,
16991,
67,
4299,
12,
2890,
16,
453,
33,
7036,
16,
1475,
33,
7036,
4672,
3536,
2000,
279,
490,
5850,
13602,
3163,
364,
365,
364,
279,
864,
11917,
17,
856,
3082,
18,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16991,
67,
4299,
12,
2890,
16,
453,
33,
7036,
16,
1475,
33,
7036,
4672,
3536,
2000,
279,
490,
5850,
13602,
3163,
364,
365,
364,
279,
864,
11917,
17,
856,
3082,
18,
2,
-100,
-100,
-100,... |
__file__ + ":TestSimplSMS.test_residual_synthesis"] | __file__ + ":TestSimplSMS.test_harmonic_synthesis"] | def test_residual_synthesis(self): """test_residual_synthesis Compare pysms residual signal with SMS residual""" audio, sampling_rate = self.get_audio() pysms.sms_init() snd_header = pysms.SMS_SndHeader() # Try to open the input file to fill snd_header if(pysms.sms_openSF(self.input_file, snd_header)): raise NameError("error opening sound file: " + pysms.sms_errorString()) analysis_params = self.pysms_analysis_params(sampling_rate) analysis_params.nFrames = self.num_frames analysis_params.nStochasticCoeff = 128 analysis_params.iStochasticType = pysms.SMS_STOC_APPROX analysis_params.preEmphasis = 0 if pysms.sms_initAnalysis(analysis_params, snd_header) != 0: raise Exception("Error allocating memory for analysis_params") analysis_params.iSizeSound = self.num_samples sms_header = pysms.SMS_Header() pysms.sms_fillHeader(sms_header, analysis_params, "pysms") | 0fc0718e4e06f3ffc8518b3a3672ede08369617a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10871/0fc0718e4e06f3ffc8518b3a3672ede08369617a/sms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
455,
5557,
67,
11982,
20432,
12,
2890,
4672,
3536,
3813,
67,
455,
5557,
67,
11982,
20432,
11051,
21027,
959,
20690,
4277,
598,
21297,
20690,
8395,
7447,
16,
11558,
67,
5141,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
455,
5557,
67,
11982,
20432,
12,
2890,
4672,
3536,
3813,
67,
455,
5557,
67,
11982,
20432,
11051,
21027,
959,
20690,
4277,
598,
21297,
20690,
8395,
7447,
16,
11558,
67,
5141,
273,... |
self.size = int(pkg["signature"]["payloadsize"][0]) | self.size = int(self["signature"]["payloadsize"][0]) | def read(self, tags=None, ntags=None): """Open and read the package. | f1f30747463529bf8b9217a5f9d86f95818a234e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1143/f1f30747463529bf8b9217a5f9d86f95818a234e/package.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
2342,
33,
7036,
16,
290,
4156,
33,
7036,
4672,
3536,
3678,
471,
855,
326,
2181,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
2342,
33,
7036,
16,
290,
4156,
33,
7036,
4672,
3536,
3678,
471,
855,
326,
2181,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
MethodHashCodeTestCase) | MethodHashCodeTestCase, SingleMethodInterfaceTestCase) | def test_main(): test_support.run_unittest(FunctionTypeTestCase, MethodHashCodeTestCase) | ccf09d7dbab0d69662a7869fec3abc2a0e53d7f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6753/ccf09d7dbab0d69662a7869fec3abc2a0e53d7f0/test_func_jy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
1842,
67,
13261,
18,
2681,
67,
4873,
3813,
12,
2083,
559,
4709,
2449,
16,
2985,
21952,
4709,
2449,
16,
10326,
1305,
1358,
4709,
2449,
13,
225,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
1842,
67,
13261,
18,
2681,
67,
4873,
3813,
12,
2083,
559,
4709,
2449,
16,
2985,
21952,
4709,
2449,
16,
10326,
1305,
1358,
4709,
2449,
13,
225,
2,
-100,
-100,
-100,... |
return Klass.__getattr__(self,name) | return self.__class__.__bases__[0].__getattr__(self,name) | def __getattr__(self,name): try: return Klass.__getattr__(self,name) except: return getattr(self._parent,name) | 788a8c96bd22dff11691769d93c9f8b1445d36f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/788a8c96bd22dff11691769d93c9f8b1445d36f8/widgetbase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
529,
4672,
775,
30,
327,
365,
16186,
1106,
972,
16186,
18602,
972,
63,
20,
8009,
972,
588,
1747,
972,
12,
2890,
16,
529,
13,
1335,
30,
327,
3869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
529,
4672,
775,
30,
327,
365,
16186,
1106,
972,
16186,
18602,
972,
63,
20,
8009,
972,
588,
1747,
972,
12,
2890,
16,
529,
13,
1335,
30,
327,
3869,
... |
print 'svn -N up %s/trunk/l10n-kde4' % localsvnroot os.system('svn -N up %s/trunk/l10n-kde4' % localsvnroot) | print 'svn -N up "%s/trunk/l10n-kde4"' % localsvnroot os.system('svn -N up "%s/trunk/l10n-kde4"' % localsvnroot) | def validatePage(self): if self.existing.isChecked(): return True if os.system('which svn')!=0: KMessageBox.error(self,i18n("Please install 'subversion' package\nto have Lokalize download KDE translation files."),i18n("Subversion client not found")) return False | 8656db64abbfe8e85055d82856dd6d64c5e780fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1688/8656db64abbfe8e85055d82856dd6d64c5e780fd/newprojectwizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
1964,
12,
2890,
4672,
309,
365,
18,
11711,
18,
291,
11454,
13332,
327,
1053,
309,
1140,
18,
4299,
2668,
12784,
5893,
82,
6134,
5,
33,
20,
30,
1475,
27647,
18,
1636,
12,
2890,
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,
1954,
1964,
12,
2890,
4672,
309,
365,
18,
11711,
18,
291,
11454,
13332,
327,
1053,
309,
1140,
18,
4299,
2668,
12784,
5893,
82,
6134,
5,
33,
20,
30,
1475,
27647,
18,
1636,
12,
2890,
16,... |
self.buf.write('</'+tag_name+'>') | self.buf.write(u''.join(('</', tag_name, '>')).encode('utf-8')) | def binary_to_text(self, base=0, depth=0): tag_name = current_map = None dynamic_tag = errors = 0 in_censorship = is_goingdown = False state = 'text' index = base flags = 0 while index < len(self.bin): c, index = read_utf8_char(self.bin, index) oc = ord(c) if state == 'text': if oc == 0: state = 'get flags' continue elif c == '\v': c = '\n' elif c == '&': self.ampersands.append(self.buf.tell()-1) self.buf.write(c.encode('utf-8')) elif state == 'get flags': if oc == 0: state = 'text' continue flags = oc state = 'get tag' elif state == 'get tag': state = 'text' if oc == 0 else 'get attr' if flags & FLAG_OPENING: tag = oc self.buf.write('<') if not (flags & FLAG_CLOSING): is_goingdown = True if tag == 0x8000: state = 'get custom length' continue if flags & FLAG_ATOM: raise LitError('TODO: Atoms not yet implemented') elif tag < len(self.tag_map): tag_name = self.tag_map[tag] current_map = self.tag_to_attr_map[tag] else: dynamic_tag += 1 errors += 1 tag_name = '?'+unichr(tag)+'?' current_map = self.tag_to_attr_map[tag] print 'WARNING: tag %s unknown' % unichr(tag) self.buf.write(unicode(tag_name).encode('utf-8')) elif flags & FLAG_CLOSING: if depth == 0: raise LitError('Extra closing tag') return index elif state == 'get attr': in_censorship = False if oc == 0: if not is_goingdown: tag_name = None dynamic_tag = 0 self.buf.write(' />') else: self.buf.write('>') index = self.binary_to_text(base=index, depth=depth+1) is_goingdown = False if not tag_name: raise LitError('Tag ends before it begins.') self.buf.write('</'+tag_name+'>') dynamic_tag = 0 tag_name = None state = 'text' else: if oc == 0x8000: state = 'get attr length' continue attr = None if oc in current_map and current_map[oc]: attr = current_map[oc] elif oc in self.attr_map: attr = self.attr_map[oc] if not attr or not isinstance(attr, basestring): raise LitError( 'Unknown attribute %d in tag %s' % (oc, tag_name)) if attr.startswith('%'): in_censorship = True state = 'get value length' continue self.buf.write(' ' + unicode(attr).encode('utf-8') + '=') if attr in ['href', 'src']: state = 'get href length' else: state = 'get value length' elif state == 'get value length': if not in_censorship: self.buf.write('"') count = oc - 1 if count == 0: if not in_censorship: self.buf.write('"') in_censorship = False state = 'get attr' continue state = 'get value' if oc == 0xffff: continue if count < 0 or count > (len(self.bin) - index): raise LitError('Invalid character count %d' % count) elif state == 'get value': if count == 0xfffe: if not in_censorship: self.buf.write('%s"' % (oc - 1)) in_censorship = False state = 'get attr' elif count > 0: if not in_censorship: self.buf.write(c) count -= 1 if count == 0: if not in_censorship: self.buf.write('"') in_censorship = False state = 'get attr' elif state == 'get custom length': count = oc - 1 if count <= 0 or count > len(self.bin)-index: raise LitError('Invalid character count %d' % count) dynamic_tag += 1 state = 'get custom' tag_name = '' elif state == 'get custom': tag_name += c count -= 1 if count == 0: self.buf.write(tag_name) state = 'get attr' elif state == 'get attr length': count = oc - 1 if count <= 0 or count > (len(self.bin) - index): raise LitError('Invalid character count %d' % count) self.buf.write(' ') state = 'get custom attr' elif state == 'get custom attr': self.buf.write(c) count -= 1 if count == 0: self.buf.write('=') state = 'get value length' | a349d763791c48d47cea1f32778b244aef794b5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/a349d763791c48d47cea1f32778b244aef794b5c/reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3112,
67,
869,
67,
955,
12,
2890,
16,
1026,
33,
20,
16,
3598,
33,
20,
4672,
1047,
67,
529,
273,
783,
67,
1458,
273,
599,
5976,
67,
2692,
273,
1334,
273,
374,
316,
67,
71,
3975,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3112,
67,
869,
67,
955,
12,
2890,
16,
1026,
33,
20,
16,
3598,
33,
20,
4672,
1047,
67,
529,
273,
783,
67,
1458,
273,
599,
5976,
67,
2692,
273,
1334,
273,
374,
316,
67,
71,
3975,
326... |
outgrids[3], fieldnames[3], field_descriptions[3], format='f') | outgrids[3], field_names[3], field_descriptions[3], format='f') | def grid_h5flashfiles(h5_filenames, start_time, end_time, frame_interval=120.0, dx=4.0e3, dy=4.0e3, x_bnd = (-100e3, 100e3), y_bnd = (-100e3, 100e3), z_bnd = (-20e3, 20e3), ctr_lat = 35.23833, ctr_lon = -97.46028, min_points_per_flash=10, outpath = '' ): from math import ceil """ Create 2D plan-view density grids for events, flash origins, flash extents, and mean flash footprint frame_interval: Frame time-step in seconds dx, dy: horizontal grid size in m {x,y,z}_bnd: horizontal grid edges in m ctr_lat, ctr_lon: coordinate center Uses an azimuthal equidistant map projection on the WGS84 ellipsoid. read_flashes filter_flash extract_events flash_to_frame frame0_broadcast, frame1_broadcast, ... each broadcaster above sends events and flashes to: projection( event_location), projection(flash_init_location), projection(event_location) which map respectively to: point_density->accum_on_grid(event density), point_density->accum_on_grid(flash init density), extent_density->accum_on_grid(flash_extent_density) grids are in an HDF5 file. how to handle flushing? """ # reference time is the date part of the start_time ref_date = start_time.date() t_ref = datetime(ref_date.year, ref_date.month, ref_date.day) frame_dt = timedelta(0, frame_interval, 0) duration = end_time - start_time n_frames = int(ceil(to_seconds(duration) / to_seconds(frame_dt))) t_edges = [start_time + i*frame_dt for i in range(n_frames+1)] t_edges_seconds = [to_seconds(edge - t_ref) for edge in t_edges] xedge=np.arange(x_bnd[0], x_bnd[1]+dx, dx) yedge=np.arange(y_bnd[0], y_bnd[1]+dy, dy) x0 = xedge[0] y0 = yedge[0] mapProj = MapProjection(projection='aeqd', ctrLat=ctr_lat, ctrLon=ctr_lon, lat_ts=ctr_lat, lon_0=ctr_lon, lat_0=ctr_lat) geoProj = GeographicSystem() event_density_grid = np.zeros((xedge.shape[0]-1, yedge.shape[0]-1, n_frames), dtype='int32') init_density_grid = np.zeros((xedge.shape[0]-1, yedge.shape[0]-1, n_frames), dtype='int32') extent_density_grid = np.zeros((xedge.shape[0]-1, yedge.shape[0]-1, n_frames), dtype='int32') footprint_grid = np.zeros((xedge.shape[0]-1, yedge.shape[0]-1, n_frames), dtype='float32') all_frames = [] extent_frames = [] init_frames = [] event_frames = [] for i in range(n_frames): extent_out = {'name':'extent'} init_out = {'name':'init'} event_out = {'name':'event'} accum_event_density = density_to_files.accumulate_points_on_grid(event_density_grid[:,:,i], xedge, yedge, out=event_out, label='event') accum_init_density = density_to_files.accumulate_points_on_grid(init_density_grid[:,:,i], xedge, yedge, out=init_out, label='init') accum_extent_density = density_to_files.accumulate_points_on_grid(extent_density_grid[:,:,i], xedge, yedge, out=extent_out,label='extent') accum_footprint = density_to_files.accumulate_points_on_grid(footprint_grid[:,:,i], xedge, yedge, label='footprint') extent_out['func'] = accum_extent_density init_out['func'] = accum_init_density event_out['func'] = accum_event_density extent_frames.append(extent_out) init_frames.append(init_out) event_frames.append(event_out) event_density_target = density_to_files.point_density(accum_event_density) init_density_target = density_to_files.point_density(accum_init_density) extent_density_target = density_to_files.extent_density(x0, y0, dx, dy, accum_extent_density) mean_footprint_target = density_to_files.extent_density(x0, y0, dx, dy, accum_footprint, weight_key='area') spew_to_density_types = density_to_files.broadcast( ( density_to_files.project('lon', 'lat', 'alt', mapProj, geoProj, event_density_target, use_flashes=False), density_to_files.project('init_lon', 'init_lat', 'init_alt', mapProj, geoProj, init_density_target, use_flashes=True), density_to_files.project('lon', 'lat', 'alt', mapProj, geoProj, extent_density_target, use_flashes=False), density_to_files.project('lon', 'lat', 'alt', mapProj, geoProj, mean_footprint_target, use_flashes=False), ) ) all_frames.append( density_to_files.extract_events_for_flashes( spew_to_density_types ) ) framer = density_to_files.flashes_to_frames(t_edges_seconds, all_frames, time_key='start') read_flashes( h5_filenames, framer, base_date=t_ref, min_points=min_points_per_flash) # print 'event_density_grid ', id(event_density_grid[:,:,-1]) # print 'extent_density_grid', id(extent_density_grid[:,:,-1]) # print 'init_density_grid ', id(init_density_grid[:,:,-1]) x_coord = (xedge[:-1] + xedge[1:])/2.0 y_coord = (yedge[:-1] + yedge[1:])/2.0 nx = x_coord.shape[0] ny = y_coord.shape[0] x_all, y_all = (a.T for a in np.meshgrid(x_coord, y_coord)) assert x_all.shape == y_all.shape z_all = np.zeros_like(x_all) lons, lats, alts = x,y,z = geoProj.fromECEF( *mapProj.toECEF(x_all, y_all, z_all) ) lons.shape=x_all.shape lats.shape=y_all.shape outflile_basename = os.path.join(outpath,'LMA_%s_%d_' % (start_time.strftime('%Y%m%d_%H%M%S'), to_seconds(duration))) outfiles = (outflile_basename+'flash_extent.nc', outflile_basename+'flash_init.nc', outflile_basename+'source.nc', outflile_basename+'footprint.nc', ) outgrids = (extent_density_grid, init_density_grid, event_density_grid, footprint_grid ) field_names = ('flash_extent', 'flash_initiation', 'lma_source', 'flash_footprint') field_descriptions = ('LMA flash extent density', 'LMA flash initiation density', 'LMA source density', 'LMA per-flash footprint') write_cf_netcdf(outfiles[0], t_ref, np.asarray(t_edges_seconds[:-1]), x_coord/1.0e3, y_coord/1.0e3, lons, lats, ctr_lat, ctr_lon, outgrids[0], fieldnames[0], field_descriptions[0]) write_cf_netcdf(outfiles[1], t_ref, np.asarray(t_edges_seconds[:-1]), x_coord/1.0e3, y_coord/1.0e3, lons, lats, ctr_lat, ctr_lon, outgrids[1], fieldnames[1], field_descriptions[1]) write_cf_netcdf(outfiles[2], t_ref, np.asarray(t_edges_seconds[:-1]), x_coord/1.0e3, y_coord/1.0e3, lons, lats, ctr_lat, ctr_lon, outgrids[2], fieldnames[2], field_descriptions[2]) write_cf_netcdf(outfiles[3], t_ref, np.asarray(t_edges_seconds[:-1]), x_coord/1.0e3, y_coord/1.0e3, lons, lats, ctr_lat, ctr_lon, outgrids[3], fieldnames[3], field_descriptions[3], format='f') print 'max extent is', extent_density_grid.max() return x_coord, y_coord, lons, lats, extent_density_grid, outfiles, field_names | e3157d63bf4824dff010de4bde23e648710fb2f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7619/e3157d63bf4824dff010de4bde23e648710fb2f0/make_grids.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3068,
67,
76,
25,
13440,
2354,
12,
76,
25,
67,
19875,
16,
787,
67,
957,
16,
679,
67,
957,
16,
2623,
67,
6624,
33,
22343,
18,
20,
16,
6633,
33,
24,
18,
20,
73,
23,
16,
7732,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3068,
67,
76,
25,
13440,
2354,
12,
76,
25,
67,
19875,
16,
787,
67,
957,
16,
679,
67,
957,
16,
2623,
67,
6624,
33,
22343,
18,
20,
16,
6633,
33,
24,
18,
20,
73,
23,
16,
7732,
33,
... |
self.cmd_channel.dtp_ready = False | self.close() | def handle_accept(self): sock_obj, addr = self.accept() # PASV connection theft protection: check the origin of data connection. # We have to drop the incoming data connection if remote IP address # does not match the client's IP address. if self.cmd_channel.remote_ip != addr[0]: log("info: PASV connection theft attempt occurred from %s:%s." %(addr[0], addr[1])) try: # sock_obj.send('500 Go hack someone else, dude.') sock_obj.close() except: pass else: debug("PassiveDTP.handle_accept()") self.cmd_channel.dtp_ready = False handler = DTPHandler(sock_obj, self.cmd_channel) self.cmd_channel.data_channel = handler self.cmd_channel.on_dtp_connection() # self.close() | 7facddac0efdba70e4066097f47661a10642808f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/7facddac0efdba70e4066097f47661a10642808f/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
9436,
12,
2890,
4672,
7313,
67,
2603,
16,
3091,
273,
365,
18,
9436,
1435,
225,
468,
453,
3033,
58,
1459,
326,
1222,
17862,
30,
866,
326,
4026,
434,
501,
1459,
18,
468,
1660,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
9436,
12,
2890,
4672,
7313,
67,
2603,
16,
3091,
273,
365,
18,
9436,
1435,
225,
468,
453,
3033,
58,
1459,
326,
1222,
17862,
30,
866,
326,
4026,
434,
501,
1459,
18,
468,
1660,
... |
def _precompute(self, how_many=10): try: f = self._f except AttributeError: self._f = recur_gen2(1786772701928802632268715130455793,1059683225053915111058165141686995,1,1) f = self._f self._b += [f.next() for i in range(how_many)] def _eval(self, n): if len(self._b) <= n: self._precompute(n - len(self._b) + 1) return self._b[n] def list(self, n): self._eval(n) return self._b[:n] class A083104(SloaneSequence): r""" Second-order linear recurrence sequence with $a(n) = a(n-1) + a(n-2)$. $a(0) = 331635635998274737472200656430763$, $a(1) = 1510028911088401971189590305498785$. This is the second-order linear recurrence sequence with $a(0)$ and $a(1)$ co-prime. It was found by Ronald Graham in 1990. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A083104;a Second-order linear recurrence sequence with a(n) = a(n-1) + a(n-2). sage: a(3) 3351693458175078679851381267428333 sage: a.offset 0 sage: a(8) 36021870400834012982120004949074404 sage: a(20) 11601914177621826012468849361236300628 AUTHOR: -- Jaap Spies (2007-01-23) """ def __init__(self): | class A083104(RecurrenceSequence2): def __init__(self): r""" Second-order linear recurrence sequence with $a(n) = a(n-1) + a(n-2)$. $a(0) = 331635635998274737472200656430763$, $a(1) = 1510028911088401971189590305498785$. This is the second-order linear recurrence sequence with $a(0)$ and $a(1)$ co-prime. It was found by Ronald Graham in 1990. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A083104;a Second-order linear recurrence sequence with a(n) = a(n-1) + a(n-2). sage: a(3) 3351693458175078679851381267428333 sage: a.offset 0 sage: a(8) 36021870400834012982120004949074404 sage: a(20) 11601914177621826012468849361236300628 AUTHOR: -- Jaap Spies (2007-01-23) """ | def _precompute(self, how_many=10): try: f = self._f except AttributeError: self._f = recur_gen2(1786772701928802632268715130455793,1059683225053915111058165141686995,1,1) f = self._f self._b += [f.next() for i in range(how_many)] | 8b300fed02e947af57b58146f62dccfc715cf0b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8b300fed02e947af57b58146f62dccfc715cf0b9/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1484,
9200,
12,
2890,
16,
3661,
67,
9353,
33,
2163,
4672,
775,
30,
284,
273,
365,
6315,
74,
1335,
6394,
30,
365,
6315,
74,
273,
8112,
67,
4507,
22,
12,
4033,
5292,
4700,
5324,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1484,
9200,
12,
2890,
16,
3661,
67,
9353,
33,
2163,
4672,
775,
30,
284,
273,
365,
6315,
74,
1335,
6394,
30,
365,
6315,
74,
273,
8112,
67,
4507,
22,
12,
4033,
5292,
4700,
5324,
1... |
n,v,f = job[0], job[2][0], job[2][1] | if job[2][0]: n,v,f = job[0], job[2][0], job[2][1] else: n,v,f = job[0], job[1][0], job[1][1] | def setUpdateJob(self, jobs): descriptions = [] jobs.sort() for job in jobs: n,v,f = job[0], job[2][0], job[2][1] v = '%s/%s' % (v.trailingLabel(), v.trailingRevision()) archDeps = [x.name for x in f.iterDepsByClass(deps.InstructionSetDependency)] if archDeps: f = '[is: %s]' % ' '.join(archDeps) else: f = '' descriptions.append('%s=%s%s' % (n,v,f)) if self.hunk[1] > 1: self._message("installing %d of %d:\n %s" % \ (self.hunk[0], self.hunk[1], '\n '.join(descriptions))) else: self._message("installing: \n %s" % \ ('\n '.join(descriptions),)) | 598f08bb27edb07137a680f612e3090a7502974d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8749/598f08bb27edb07137a680f612e3090a7502974d/rootfactory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1891,
2278,
12,
2890,
16,
6550,
4672,
15550,
273,
5378,
6550,
18,
3804,
1435,
364,
1719,
316,
6550,
30,
309,
1719,
63,
22,
6362,
20,
14542,
290,
16,
90,
16,
74,
273,
1719,
63,
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,
444,
1891,
2278,
12,
2890,
16,
6550,
4672,
15550,
273,
5378,
6550,
18,
3804,
1435,
364,
1719,
316,
6550,
30,
309,
1719,
63,
22,
6362,
20,
14542,
290,
16,
90,
16,
74,
273,
1719,
63,
2... |
c = curve(self, ptlist, point, logic, **xx) | c = curve(self, ptlist, origin, logic, **xx) | def pickline(self, ptlist, point, logic, **xx): """Add a new curve to the shape. Args define the curve (see curve) and the logic operator for the curve telling whether it adds or removes material. """ self.havelist = 0 c = curve(self, ptlist, point, logic, **xx) self.bbox.merge(c.bbox) self.curves += [c] | e55864700cb47a43fd0848009d3f1957e082ccc8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e55864700cb47a43fd0848009d3f1957e082ccc8/shape.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
1369,
12,
2890,
16,
5818,
1098,
16,
1634,
16,
4058,
16,
2826,
5279,
4672,
3536,
986,
279,
394,
8882,
358,
326,
2179,
18,
6634,
4426,
326,
8882,
261,
5946,
8882,
13,
471,
326,
405... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
1369,
12,
2890,
16,
5818,
1098,
16,
1634,
16,
4058,
16,
2826,
5279,
4672,
3536,
986,
279,
394,
8882,
358,
326,
2179,
18,
6634,
4426,
326,
8882,
261,
5946,
8882,
13,
471,
326,
405... |
Collection all units of units: acceleration ... volume | Collection of units of all units: acceleration ... volume | def __init__(self, data, name=''): """ EXAMPLES:: | 4a7f8e846ab20476d1219a326ba1d0012a65c6c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4a7f8e846ab20476d1219a326ba1d0012a65c6c6/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
508,
2218,
11,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
508,
2218,
11,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if hasattr(self, "hidden_file_prefixes") and self.hidden_file_prefixes: filePrefixesSkipList = split(self.hidden_file_prefixes,',') else: filePrefixesSkipList = [] if hasattr(self, "hidden_file_suffixes") and self.hidden_file_suffixes: fileSuffixesSkipList = split(self.hidden_file_suffixes,',') else: fileSuffixesSkipList = [] if hasattr(self, "hidden_file_names") and self.hidden_file_names: fileNamesSkipList = split(self.hidden_file_names,',') else: fileNamesSkipList = [] if hasattr(self, "hidden_folder_prefixes") and \ self.hidden_folder_prefixes: folderPrefixesSkipList = split(self.hidden_folder_prefixes,',') else: folderPrefixesSkipList = [] if hasattr(self, "hidden_folder_suffixes") and \ self.hidden_folder_suffixes: folderSuffixesSkipList = split(self.hidden_folder_suffixes,',') else: folderSuffixesSkipList = [] if hasattr(self, "hidden_folder_names") and self.hidden_folder_names: folderNamesSkipList = split(self.hidden_folder_names,',') else: folderNamesSkipList = [] | filePrefixesSkip = self._getAttribute('hidden_file_prefixes') fileSuffixesSkip = self._getAttribute('hidden_file_suffixes') fileNamesSkip = self._getAttribute('hidden_file_names') folderPrefixesSkip = self._getAttribute('hidden_folder_prefixes') folderSuffixesSkip = self._getAttribute('hidden_folder_suffixes') folderNamesSkip = self._getAttribute('hidden_folder_names') | def getFilteredContents(self,rel_dir=None): """ list filtered content of local filesystem """ | 986267974a25fceea33e15da2a6f7317243ba92b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/986267974a25fceea33e15da2a6f7317243ba92b/PloneLocalFolderNG.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12267,
329,
6323,
12,
2890,
16,
2878,
67,
1214,
33,
7036,
4672,
3536,
666,
5105,
913,
434,
1191,
6496,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12267,
329,
6323,
12,
2890,
16,
2878,
67,
1214,
33,
7036,
4672,
3536,
666,
5105,
913,
434,
1191,
6496,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return MPolynomialRoundSystem(R, self.field_polynomials("k",i, r*c)) | return MPolynomialRoundSystem(R, self.field_polynomials("k", i, r*c)) | def key_schedule_polynomials(self, i): """ Return polynomials for the $i$-th round of the key schedule. | 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,
498,
67,
10676,
67,
3915,
13602,
87,
12,
2890,
16,
277,
4672,
3536,
2000,
16991,
87,
364,
326,
271,
77,
8,
17,
451,
3643,
434,
326,
498,
4788,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
67,
10676,
67,
3915,
13602,
87,
12,
2890,
16,
277,
4672,
3536,
2000,
16991,
87,
364,
326,
271,
77,
8,
17,
451,
3643,
434,
326,
498,
4788,
18,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
elif order == 1: if isinstance(w, (tuple,str,list)): length = 'finite' elif isinstance(w, FiniteWord_class): length = sum(self._morph[a].length() * b for (a,b) in w.evaluation_dict().iteritems()) elif hasattr(w, '__iter__'): length = Infinity datatype = 'iter' elif w in self._domain.alphabet(): w = [w] length = 'finite' else: raise TypeError, "Don't know how to handle an input (=%s) that is not iterable or not in the domain alphabet."%w return self.codomain()((x for y in w for x in self._morph[y]), length=length, datatype=datatype) elif order > 1: return self(self(w, order-1),datatype=datatype) | else: raise TypeError, "order (%s) must be a positive integer or plus Infinity" % order | def __call__(self, w, order=1, datatype='iter'): r""" Returns the image of ``w`` under self to the given order. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
341,
16,
1353,
33,
21,
16,
11172,
2218,
2165,
11,
4672,
436,
8395,
2860,
326,
1316,
434,
12176,
91,
10335,
3613,
365,
358,
326,
864,
1353,
18,
225,
12943... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
341,
16,
1353,
33,
21,
16,
11172,
2218,
2165,
11,
4672,
436,
8395,
2860,
326,
1316,
434,
12176,
91,
10335,
3613,
365,
358,
326,
864,
1353,
18,
225,
12943... |
elif tnexte is StringType: | elif tnexte in (StringType, UnicodeType): | def shrinkWrap(self, line): # for non justified text, collapse adjacent text/shift's into single operations #return line # for testing result = [] index = 0 maxindex = len(line) from types import FloatType, StringType, InstanceType from string import join while index<maxindex: e = line[index] te = type(e) if te is StringType and index<maxindex-1: # collect strings and floats thestrings = [e] thefloats = 0.0 index = index+1 nexte = line[index] tnexte = type(nexte) while index<maxindex and (tnexte is FloatType or tnexte is StringType): # switch to expandable space if appropriate if tnexte is FloatType: if thefloats<0 and nexte>0: thefloats = -thefloats if nexte<0 and thefloats>0: nexte = -nexte thefloats = thefloats + nexte elif tnexte is StringType: thestrings.append(nexte) index = index+1 if index<maxindex: nexte = line[index] tnexte = type(nexte) # wrap up the result s = string.join(thestrings) result.append(s) result.append(float(thefloats)) # back up for unhandled element index = index-1 else: result.append(e) index = index+1 | a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17697,
2964,
12,
2890,
16,
980,
4672,
468,
364,
1661,
2537,
939,
977,
16,
13627,
16335,
977,
19,
4012,
1807,
1368,
2202,
5295,
468,
2463,
980,
468,
364,
7769,
563,
273,
5378,
770,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17697,
2964,
12,
2890,
16,
980,
4672,
468,
364,
1661,
2537,
939,
977,
16,
13627,
16335,
977,
19,
4012,
1807,
1368,
2202,
5295,
468,
2463,
980,
468,
364,
7769,
563,
273,
5378,
770,
273,
... |
if not name.contains('"'): | if '"' not in name: | def item_by_name(self,name): if not name: raise ValueError,"name is None" name=to_utf8(name) if not name.contains('"'): expr='r:item[@name="%s"]' % name elif not name.contains("'"): expr="r:item[@name='%s']" % name else: raise RosterError,"Unsupported roster item name format" l=self.xpath_ctxt.xpathEval(expr) if not l: raise KeyError,name ret=[] for i in l: ret.append(RosterItem(self,i)) return ret | c5c9bc0fda36b704982068c3cb9177aefedd9b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/c5c9bc0fda36b704982068c3cb9177aefedd9b10/roster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
761,
67,
1637,
67,
529,
12,
2890,
16,
529,
4672,
309,
486,
508,
30,
1002,
2068,
10837,
529,
353,
599,
6,
508,
33,
869,
67,
3158,
28,
12,
529,
13,
309,
4754,
486,
316,
508,
30,
3065... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
761,
67,
1637,
67,
529,
12,
2890,
16,
529,
4672,
309,
486,
508,
30,
1002,
2068,
10837,
529,
353,
599,
6,
508,
33,
869,
67,
3158,
28,
12,
529,
13,
309,
4754,
486,
316,
508,
30,
3065... |
ServerClass = SocketServer.TCPServer): | ServerClass = BaseHTTPServer.HTTPServer): | def test(HandlerClass = SimpleHTTPRequestHandler, ServerClass = SocketServer.TCPServer): BaseHTTPServer.test(HandlerClass, ServerClass) | df999c2e6d4dd2e564b7400e2368888bdb89b20d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df999c2e6d4dd2e564b7400e2368888bdb89b20d/SimpleHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
1503,
797,
273,
4477,
23891,
1503,
16,
3224,
797,
273,
3360,
3693,
2081,
18,
3693,
2081,
4672,
3360,
3693,
2081,
18,
3813,
12,
1503,
797,
16,
3224,
797,
13,
282,
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,
1842,
12,
1503,
797,
273,
4477,
23891,
1503,
16,
3224,
797,
273,
3360,
3693,
2081,
18,
3693,
2081,
4672,
3360,
3693,
2081,
18,
3813,
12,
1503,
797,
16,
3224,
797,
13,
282,
2,
-100,
-10... |
valatask.vapi_path = getattr(self, 'vapi_path', None) valatask.header_path = None | valatask.vapi_path = getattr(self, 'vapi_path', '${DATAROOTDIR}/vala/vapi') valatask.pkg_name = getattr(self, 'pkg_name', self.env['PACKAGE']) valatask.header_path = getattr(self, 'header_path', '${INCLUDEDIR}/%s-%s' % (valatask.pkg_name, _get_api_version())) valatask.is_lib = False if not 'cprogram' in self.features: valatask.is_lib = True | def _get_api_version(): api_version = getattr (Utils.g_module, 'API_VERSION', None) if api_version == None: version = Utils.g_module.VERSION.split(".") if version[0] == "0": api_version = "0." + version[1] else: api_version = version[0] + ".0" return api_version | b969a4f7f6e647e7510f68a125719920d67b013b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/b969a4f7f6e647e7510f68a125719920d67b013b/vala.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2425,
67,
1589,
13332,
1536,
67,
1589,
273,
3869,
261,
1989,
18,
75,
67,
2978,
16,
296,
2557,
67,
5757,
2187,
599,
13,
309,
1536,
67,
1589,
422,
599,
30,
1177,
273,
609... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2425,
67,
1589,
13332,
1536,
67,
1589,
273,
3869,
261,
1989,
18,
75,
67,
2978,
16,
296,
2557,
67,
5757,
2187,
599,
13,
309,
1536,
67,
1589,
422,
599,
30,
1177,
273,
609... |
def close_request(self, request): """Called to clean up an individual request.""" | def shutdown_request(self, request): """Called to shutdown and close an individual request.""" | def close_request(self, request): """Called to clean up an individual request.""" try: #explicitly shutdown. socket.close() merely releases #the socket and waits for GC to perform the actual close. request.shutdown(socket.SHUT_WR) except socket.error: pass #some platforms may raise ENOTCONN here request.close() | be384c5e24adab105c55b98acb56ec64e5ffd106 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/be384c5e24adab105c55b98acb56ec64e5ffd106/SocketServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
67,
2293,
12,
2890,
16,
590,
4672,
3536,
8185,
358,
5731,
471,
1746,
392,
7327,
590,
12123,
775,
30,
468,
16511,
715,
5731,
18,
225,
2987,
18,
4412,
1435,
4045,
2357,
14824,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
67,
2293,
12,
2890,
16,
590,
4672,
3536,
8185,
358,
5731,
471,
1746,
392,
7327,
590,
12123,
775,
30,
468,
16511,
715,
5731,
18,
225,
2987,
18,
4412,
1435,
4045,
2357,
14824,
468,
... |
'in': ('in', 'SEQUENCEMETHODS2'), | 'in': ('in', 'SEQUENCEMETHODS'), | def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" if done is None: done = {} for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath): writedoc(modname) return | d46665cc2e0fa20ac234cdc9750bad012c8f0589 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/d46665cc2e0fa20ac234cdc9750bad012c8f0589/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
273,... |
{'action': 'store_true', 'validator': validate_boolean}), | {'action': 'store_true', 'validator': frontend.validate_boolean}), | def find_theme(name): # Where else to look for a theme? # Check working dir? Destination dir? Config dir? Plugins dir? path = os.path.join(themes_dir_path, name) if not os.path.isdir(path): raise docutils.ApplicationError( 'Theme directory not found: %r (path: %r)' % (name, path)) return path | f82b81ce6cb22b15791191504f4878697792a0f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/f82b81ce6cb22b15791191504f4878697792a0f4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
7997,
12,
529,
4672,
468,
12177,
469,
358,
2324,
364,
279,
5006,
35,
468,
2073,
5960,
1577,
35,
225,
10691,
1577,
35,
225,
1903,
1577,
35,
225,
26849,
1577,
35,
589,
273,
114... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
7997,
12,
529,
4672,
468,
12177,
469,
358,
2324,
364,
279,
5006,
35,
468,
2073,
5960,
1577,
35,
225,
10691,
1577,
35,
225,
1903,
1577,
35,
225,
26849,
1577,
35,
589,
273,
114... |
g = Graphics() | g = Graphics(xmin=min(xdata), xmax=max(xdata), ymin=min(ydata), ymax=max(ydata)) | def _from_xdata_ydata(self, xdata, ydata, coerce, options): if coerce: xdata, ydata = self._coerce(xdata, ydata) g = Graphics() g._Graphics__objects.append(GraphicPrimitive_Point(xdata, ydata, options)) try: g._extend_axes(min(xdata), max(xdata), min(ydata), max(ydata)) except ValueError: pass return g | 04a6df69dc4131eb63863357d3630867f997c0b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/04a6df69dc4131eb63863357d3630867f997c0b8/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2080,
67,
92,
892,
67,
93,
892,
12,
2890,
16,
25363,
16,
29175,
16,
12270,
16,
702,
4672,
309,
12270,
30,
25363,
16,
29175,
273,
365,
6315,
2894,
2765,
12,
92,
892,
16,
29175,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2080,
67,
92,
892,
67,
93,
892,
12,
2890,
16,
25363,
16,
29175,
16,
12270,
16,
702,
4672,
309,
12270,
30,
25363,
16,
29175,
273,
365,
6315,
2894,
2765,
12,
92,
892,
16,
29175,
1... |
None,phil_xs, [pdb_xs],[hkl_xs]) | None,phil_xs, [pdb_xs],[hkl_xs]) | def outlier_utils(args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots = StringIO() log.register(label="log_buffer", file_object=string_buffer) phil_objects = [] argument_interpreter = libtbx.phil.command_line.argument_interpreter( master_params=master_params, home_scope="outlier_detection") for arg in args: command_line_params = None arg_is_processed = False # is it a file? if arg=="--quiet": arg_is_processed = True if (os.path.isfile(arg)): ## is this a file name? # check if it is a phil file try: command_line_params = iotbx.phil.parse(file_name=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass else: try: command_line_params = argument_interpreter.process(arg=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass if not arg_is_processed: print >> log, "##----------------------------------------------##" print >> log, "## Unknown file or keyword:", arg print >> log, "##----------------------------------------------##" print >> log raise Sorry("Unknown file or keyword: %s" % arg) effective_params = master_params.fetch(sources=phil_objects) params = effective_params.extract() # now get the unit cell from the pdb file hkl_xs = None if params.outlier_utils.input.xray_data.file_name is not None: hkl_xs = crystal_symmetry_from_any.extract_from( file_name=params.outlier_utils.input.xray_data.file_name) pdb_xs = None if params.outlier_utils.input.model.file_name is not None: pdb_xs = crystal_symmetry_from_any.extract_from( file_name=params.outlier_utils.input.model.file_name) phil_xs = crystal.symmetry( unit_cell=params.outlier_utils.input.unit_cell, space_group_info=params.outlier_utils.input.space_group ) combined_xs = select_crystal_symmetry( None,phil_xs, [pdb_xs],[hkl_xs]) # inject the unit cell and symmetry in the phil scope please params.outlier_utils.input.unit_cell = combined_xs.unit_cell() params.outlier_utils.input.space_group = \ sgtbx.space_group_info( group = combined_xs.space_group() ) new_params = master_params.format(python_object=params) new_params.show(out=log) if params.outlier_utils.input.unit_cell is None: raise Sorry("unit cell not specified") if params.outlier_utils.input.space_group is None: raise Sorry("space group not specified") if params.outlier_utils.input.xray_data.file_name is None: raise Sorry("Xray data not specified") if params.outlier_utils.input.model.file_name is None: print "PDB file not specified. Basic wilson outlier rejections only." #----------------------------------------------------------- # # step 1: read in the reflection file # phil_xs = crystal.symmetry( unit_cell=params.outlier_utils.input.unit_cell, space_group_info=params.outlier_utils.input.space_group ) xray_data_server = reflection_file_utils.reflection_file_server( crystal_symmetry = phil_xs, force_symmetry = True, reflection_files=[]) miller_array = None miller_array = xray_data_server.get_xray_data( file_name = params.outlier_utils.input.xray_data.file_name, labels = params.outlier_utils.input.xray_data.obs_labels, ignore_all_zeros = True, parameter_scope = 'outlier_utils.input.xray_data', parameter_name = 'obs_labels' ) info = miller_array.info() miller_array = miller_array.map_to_asu() miller_array = miller_array.select( miller_array.indices() != (0,0,0)) miller_array = miller_array.select( miller_array.data() > 0 ) if miller_array.sigmas() is not None: miller_array = miller_array.select( miller_array.sigmas() > 0 ) if (miller_array.is_xray_intensity_array()): miller_array = miller_array.f_sq_as_f() elif (miller_array.is_complex_array()): miller_array = abs(miller_array) miller_array.set_info(info) merged_anomalous=False if miller_array.anomalous_flag(): miller_array = miller_array.average_bijvoet_mates().set_observation_type( miller_array ) merged_anomalous=True miller_array = miller_array.map_to_asu() # get the free reflections please free_flags = None if params.outlier_utils.input.xray_data.free_flags is None: free_flags = miller_array.generate_r_free_flags( fraction=params.outlier_utils.\ additional_parameters.free_flag_generation.fraction, max_free=params.outlier_utils.\ additional_parameters.free_flag_generation.max_number, lattice_symmetry_max_delta=params.outlier_utils.\ additional_parameters.free_flag_generation.lattice_symmetry_max_delta, use_lattice_symmetry=params.outlier_utils.\ additional_parameters.free_flag_generation.use_lattice_symmetry ) else: free_flags = xray_data_server.get_xray_data( file_name = params.outlier_utils.input.xray_data.file_name, labels = params.outlier_utils.input.xray_data.free_flags, ignore_all_zeros = True, parameter_scope = 'outlier_utils.input.xray_data', parameter_name = 'free_flags' ) if miller_array.anomalous_flag(): free_flags = free_flags.miller_array.average_bijvoet_mates() merged_anomalous=True free_flags = free_flags.common_set( miller_array ) free_flags = free_flags.customized_copy( data = flex.bool( free_flags.data()== 1 )) free_flags = free_flags.common_set( miller_array ).map_to_asu() free_flags, miller_array = free_flags.common_sets( miller_array ) print >> log print >> log, "Summary info of observed data" print >> log, "=============================" miller_array.show_summary(f=log) if merged_anomalous: print >> log, "For outlier detection purposes, the Bijvoet pairs have been merged." print >> log print >> log, "Constructing an outlier manager" print >> log, "===============================" print >> log outlier_manager = outlier_rejection.outlier_manager( miller_array, out=log) basic_array = None extreme_array = None model_based_array = None basic_array = outlier_manager.basic_wilson_outliers( p_basic_wilson = params.outlier_utils.outlier_detection.\ parameters.basic_wilson.level, return_array = True) extreme_array = outlier_manager.extreme_wilson_outliers( p_extreme_wilson = params.outlier_utils.outlier_detection.parameters.\ extreme_wilson.level, return_array = True) #---------------------------------------------------------------- # Step 2: get an xray structure from the PDB file # if params.outlier_utils.input.model.file_name is not None: model = xray_structure.from_pdb( file_name=params.outlier_utils.input.model.file_name, crystal_symmetry=phil_xs, force_symmetry=True) print >> log, "Atomic model summary" print >> log, "====================" model.show_summary(f=log) print >> log # please make an f_model object for bulk solvent scaling etc etc f_model_object = f_model.manager( f_obs = miller_array, r_free_flags = free_flags, xray_structure = model ) print >> log, "Bulk solvent scaling of the data" print >> log, "================================" print >> log, "Maximum likelihood bulk solvent scaling." print >> log f_model_object.update_solvent_and_scale(out=log) b_cart = f_model_object.b_cart() k_sol = f_model_object.k_sol() b_sol = f_model_object.b_sol() ls_scale = 1.0/f_model_object.scale_k1() print >> log print >> log, "The observed data is scaled by a multiplier" print >> log, "equal to %5.2e"%(ls_scale) print >> log, "This brings the data to an approximate absolute scale." # update the outlier object please outlier_manager.apply_scale_to_original_data( ls_scale) free_flags = free_flags.common_set( outlier_manager.miller_obs ) # redo the f model object please f_model_object = f_model.manager( f_obs = outlier_manager.miller_obs, r_free_flags = free_flags, xray_structure = model) # reset the bulk solvent parameters please f_model_object.update_core(b_cart=b_cart, k_sol=k_sol, b_sol=b_sol) f_model_data = f_model_object.f_model() plot_out = StringIO() # get alphas and betas please alpha,beta = f_model_object.alpha_beta() # get suspected outliers model_based_array = outlier_manager.model_based_outliers( f_model_data, alpha, beta, level=params.outlier_utils.outlier_detection.parameters.model_based.level, return_array=True, plot_out=plot_out) #check what needs to be put out please if params.outlier_utils.output.hklout is not None: if params.outlier_utils.outlier_detection.protocol == "model": if params.outlier_utils.input.model.file_name == None: print >> log, "Model based rejections requested. No model was supplied." print >> log, "Switching to writing out rejections based on extreme value Wilson statistics." params.outlier_utils.outlier_detection.protocol="extreme" output_array = None print >> log if params.outlier_utils.outlier_detection.protocol == "basic": print >> log, "Outliers found by the basic wilson statistics" print >> log, "protocol will be written out." output_array = basic_array new_set_of_free_flags = free_flags.common_set( basic_array ) if params.outlier_utils.outlier_detection.protocol == "extreme": print >> log, "Outliers found by the extreme value wilson statistics" print >> log, "protocol will be written out." output_array = extreme_array new_set_of_free_flags = free_flags.common_set( extreme_array ) if params.outlier_utils.outlier_detection.protocol == "model": print >> log, "Outliers found by the model based" print >> log, "protocol will be written out to the file:" print >> log, params.outlier_utils.output.hklout print >> log output_array = model_based_array new_set_of_free_flags = free_flags.common_set( model_based_array ) mtz_dataset = output_array.as_mtz_dataset( column_root_label="FOBS") mtz_dataset = mtz_dataset.add_miller_array( miller_array = new_set_of_free_flags, column_root_label = "Free_R_Flag" ) mtz_dataset.mtz_object().write( file_name=params.outlier_utils.output.hklout) if params.outlier_utils.output.logfile is not None: final_log = StringIO() print >> final_log, string_buffer.getvalue() print >> final_log print >> final_log, plot_out.getvalue() outfile = open( params.outlier_utils.output.logfile, 'w' ) outfile.write( final_log.getvalue() ) print >> log print >> log, "A logfile named %s was created."%( params.outlier_utils.output.logfile) print >> log, "This logfile contains the screen output and" print >> log, "(possibly) some ccp4 style loggraph plots" | 95ea40706150efdd497c59bd7453515caa13e6e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/95ea40706150efdd497c59bd7453515caa13e6e4/remove_outliers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
9800,
67,
5471,
12,
1968,
4672,
309,
562,
12,
1968,
13,
631,
20,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
5201,
6,
316,
833,
262,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
9800,
67,
5471,
12,
1968,
4672,
309,
562,
12,
1968,
13,
631,
20,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
5201,
6,
316,
833,
262,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
76... |
setexecutable = setExecutableTemplate % os.path.basename(self.executable) else: setexecutable = "" | def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.append(execpath) self.execpath = execpath # For execve wrapper setexecutable = setExecutableTemplate % os.path.basename(self.executable) else: setexecutable = "" # XXX for locals() call | d94b247eb725c755f5411f64e9596f2244e51f3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d94b247eb725c755f5411f64e9596f2244e51f3a/bundlebuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
2227,
12,
2890,
4672,
400,
1214,
273,
315,
6323,
19,
3805,
6,
309,
365,
18,
17751,
353,
486,
599,
30,
309,
365,
18,
5254,
12890,
353,
599,
30,
1196,
803,
273,
589,
5701,
12,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
2227,
12,
2890,
4672,
400,
1214,
273,
315,
6323,
19,
3805,
6,
309,
365,
18,
17751,
353,
486,
599,
30,
309,
365,
18,
5254,
12890,
353,
599,
30,
1196,
803,
273,
589,
5701,
12,
289... | |
full_name = self._child_name(name, subname) | full_name = self._child_name(formname, subname) | def show(self, item, name, template_type, template_getter, global_namespace={}): value = getattr(item, name) subfields = [] for subname, field_type in self.fields: full_name = self._child_name(name, subname) proxied_item = self._Proxy(item, {full_name: value[subname]}) subfields.append(field_type.show(proxied_item, full_name, template_type, template_getter, global_namespace)) namespace = global_namespace.copy() namespace['subfields'] = subfields return FieldType.show(self, item, name, template_type, template_getter, namespace) | 50795e5758d888a3615e83aa958b5a732826abe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1871/50795e5758d888a3615e83aa958b5a732826abe4/qFieldTypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
16,
761,
16,
508,
16,
1542,
67,
723,
16,
1542,
67,
11990,
16,
2552,
67,
4937,
12938,
4672,
460,
273,
3869,
12,
1726,
16,
508,
13,
720,
2821,
273,
5378,
364,
720,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
16,
761,
16,
508,
16,
1542,
67,
723,
16,
1542,
67,
11990,
16,
2552,
67,
4937,
12938,
4672,
460,
273,
3869,
12,
1726,
16,
508,
13,
720,
2821,
273,
5378,
364,
720,
529,... |
if request.GET['next']: response = HttpResponseRedirect(request.GET['next']) | next = request.GET.get('next', '') if next: response = HttpResponseRedirect(next) | def user_profile(request): profile, created = UserProfile.objects.get_or_create(user=request.user) if request.method == 'POST': user_form = UserForm(request.POST,instance=request.user) profile_form = UserProfileForm(request.POST,instance=profile) password_form = PasswordChangeForm(request.user,request.POST) if user_form.is_valid() and profile_form.is_valid(): user_form.save() profile_form.save() if request.GET['next']: response = HttpResponseRedirect(request.GET['next']) else: response = HttpResponseRedirect(reverse('reviewapp.submissionlist')) if password_form.changed_data: if password_form.is_valid(): password_form.save() return response else: return response else: user_form = UserForm(instance=request.user) profile_form = UserProfileForm(instance=profile) password_form = PasswordChangeForm(request.user) return render_to_response('reviewapp/user_profile.html', locals(), context_instance=RequestContext(request)) | 53d55a9f450ebe98b9838f22fe824ecd43c4685e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12441/53d55a9f450ebe98b9838f22fe824ecd43c4685e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
5040,
12,
2293,
4672,
3042,
16,
2522,
273,
2177,
4029,
18,
6911,
18,
588,
67,
280,
67,
2640,
12,
1355,
33,
2293,
18,
1355,
13,
309,
590,
18,
2039,
422,
296,
3798,
4278,
729,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
5040,
12,
2293,
4672,
3042,
16,
2522,
273,
2177,
4029,
18,
6911,
18,
588,
67,
280,
67,
2640,
12,
1355,
33,
2293,
18,
1355,
13,
309,
590,
18,
2039,
422,
296,
3798,
4278,
729,... |
if self.scheme != 'https': | if scheme != 'https': | def is_allowed (self, method, scheme, port): if not self.method(method): wc.log.warn(wc.LOG_PROXY, "illegal method %s", method) return False if scheme not in self.schemes: wc.log.warn(wc.LOG_PROXY, "illegal scheme %s", scheme) return False if method == 'CONNECT': # CONNECT method sanity if port not in self.connect_ports: wc.log.warn(wc.LOG_PROXY, "illegal CONNECT port %d", port) return False if self.scheme != 'https': wc.log.warn(wc.LOG_PROXY, "illegal CONNECT scheme %d", scheme) return False else: # all other methods if port not in self.http_ports: wc.log.warn(wc.LOG_PROXY, "illegal port %d", port) return False return True | 681d37a2d61f13067f3a8870599c19392f8de763 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/681d37a2d61f13067f3a8870599c19392f8de763/Allowed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
8151,
261,
2890,
16,
707,
16,
4355,
16,
1756,
4672,
309,
486,
365,
18,
2039,
12,
2039,
4672,
14310,
18,
1330,
18,
8935,
12,
27594,
18,
4842,
67,
16085,
16,
315,
31751,
707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
8151,
261,
2890,
16,
707,
16,
4355,
16,
1756,
4672,
309,
486,
365,
18,
2039,
12,
2039,
4672,
14310,
18,
1330,
18,
8935,
12,
27594,
18,
4842,
67,
16085,
16,
315,
31751,
707,
... |
total_vessels_free = geni_user.vessel_credit_limit() | total_vessels_free = geni_user.vessel_credit_remaining() | def share_compare(a, b): return cmp(a['percent'], b['percent']) | f44bab71f297fd5d7938d719c53acb5cec1c2537 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/f44bab71f297fd5d7938d719c53acb5cec1c2537/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7433,
67,
9877,
12,
69,
16,
324,
4672,
327,
9411,
12,
69,
3292,
8849,
17337,
324,
3292,
8849,
19486,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7433,
67,
9877,
12,
69,
16,
324,
4672,
327,
9411,
12,
69,
3292,
8849,
17337,
324,
3292,
8849,
19486,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
test(r"""pat.match(p) != None""", 1) | test(r"""pat.match(p) is not None""", 1) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | ec47d67f7e38555348764543458e5e6016584e10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/ec47d67f7e38555348764543458e5e6016584e10/test_sre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23559,
67,
2107,
12,
1916,
2603,
4672,
509,
67,
1132,
273,
509,
12,
1916,
2603,
18,
1655,
12,
20,
3719,
327,
609,
12,
474,
67,
1132,
397,
404,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23559,
67,
2107,
12,
1916,
2603,
4672,
509,
67,
1132,
273,
509,
12,
1916,
2603,
18,
1655,
12,
20,
3719,
327,
609,
12,
474,
67,
1132,
397,
404,
13,
225,
2,
-100,
-100,
-100,
-100,
-10... |
debug(" third-party Netscape cookie during " | _debug(" third-party Netscape cookie during " | def set_ok_verifiability(self, cookie, request): if request.is_unverifiable() and is_third_party(request): if cookie.version > 0 and self.strict_rfc2965_unverifiable: debug(" third-party RFC 2965 cookie during " "unverifiable transaction") return False elif cookie.version == 0 and self.strict_ns_unverifiable: debug(" third-party Netscape cookie during " "unverifiable transaction") return False return True | 15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
601,
67,
502,
704,
2967,
12,
2890,
16,
3878,
16,
590,
4672,
309,
590,
18,
291,
67,
318,
502,
8424,
1435,
471,
353,
67,
451,
6909,
67,
21214,
12,
2293,
4672,
309,
3878,
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,
444,
67,
601,
67,
502,
704,
2967,
12,
2890,
16,
3878,
16,
590,
4672,
309,
590,
18,
291,
67,
318,
502,
8424,
1435,
471,
353,
67,
451,
6909,
67,
21214,
12,
2293,
4672,
309,
3878,
18,
... |
[[1.1892071150027208 .. 1.1892071150027213], [-1.1892071150027213 .. -1.1892071150027208], [1.1892071150027208 .. 1.1892071150027213]*I, [-1.1892071150027213 .. -1.1892071150027208]*I] | [[1.1892071150027208 .. 1.1892071150027213], [-1.1892071150027213 .. -1.18920711500272...], [1.1892071150027208 .. 1.1892071150027213]*I, [-1.1892071150027213 .. -1.1892071150027208]*I] | def complex_roots(self, prec, multiplicity): """ EXAMPLES: sage: x = polygen(ZZ) sage: cp = AA.common_polynomial(x^4 - 2) sage: cp.complex_roots(30, 1) [[1.1892071150027208 .. 1.1892071150027213], [-1.1892071150027213 .. -1.1892071150027208], [1.1892071150027208 .. 1.1892071150027213]*I, [-1.1892071150027213 .. -1.1892071150027208]*I] """ if self._roots_cache.has_key(multiplicity): roots = self._roots_cache[multiplicity] if roots[0] >= prec: return roots[1] | 09997aeddb3843d400f397ba91ab366c4a8af1c7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/09997aeddb3843d400f397ba91ab366c4a8af1c7/qqbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7233,
67,
22078,
12,
2890,
16,
13382,
16,
3309,
20458,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
619,
273,
2952,
4338,
275,
12,
27096,
13,
272,
410,
30,
3283,
273,
27343,
18,
60... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7233,
67,
22078,
12,
2890,
16,
13382,
16,
3309,
20458,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
619,
273,
2952,
4338,
275,
12,
27096,
13,
272,
410,
30,
3283,
273,
27343,
18,
60... |
"m3-libs/m3core/src/C/" + Common + "/m3makefile" ]: | "m3-libs/m3core/src/C/" + Common + "/m3makefile" ]: | def Boot(): global BuildLocal BuildLocal += " -boot -keep " Version = "1" # This information is duplicated from the config files. # TBD: put it only in one place. # The older bootstraping method does get that right. Compile = ("gcc -g -fPIC " + ({ "AMD64_LINUX" : " -m64 -mno-align-double ", "LINUXLIBC6" : " -m32 -mno-align-double ", "MIPS64_OPENBSD" : " -mabi=64 ", "SPARC32_LINUX" : " -m32 -munaligned-doubles ", "SPARC64_LINUX" : " -m64 -munaligned-doubles ", }.get(Target) or "")) Link = (Compile + " " + ({ "MIPS64_OPENBSD" : " -lm -lpthread ", "PPC32_OPENBSD" : " -lm -lpthread ", "SPARC64_OPENBSD" : " -lm -lpthread ", }.get(Target) or "")) Compile = { "SPARC64_SOLARIS" : "cc -g -mt -xarch=v9 -xcode=pic32 -xldscope=symbolic", }.get(Target) or Compile Link = { "SPARC64_SOLARIS" : Compile + " -lrt -lm -lnsl -lsocket " }.get(Target) or Link # not in Link Compile += " -c " Assemble = ("as " + ({ "AMD64_LINUX" : " --64 ", "LINUXLIBC6" : " --32 ", "SPARC32_LINUX" : " -32 ", "SPARC64_LINUX" : " -64 ", "SPARC64_SOLARIS" : " -s -K PIC -xarch=v9 ", }.get(Target) or "")) Compile = re.sub(" +", " ", Compile) Link = re.sub(" +", " ", Link) Assemble = re.sub(" +", " ", Assemble) BootDir = "/cm3-boot-POSIX-" + Target + "-" + Version P = [ "import-libs", "m3core", "libm3", "sysutils", "m3middle", "m3quake", "m3objfile", "m3linker", "m3back", "m3front", "cm3" ] if Target == "NT386": P += ["mklib"] #DoPackage(["", "realclean"] + P) or sys.exit(1) DoPackage(["", "buildlocal"] + P) or sys.exit(1) try: shutil.rmtree(BootDir) except: pass try: os.mkdir(BootDir) except: pass # # This would probably be a good use of XSL (xml style sheets) # Make = open(os.path.join(BootDir, "make.sh"), "wb") Makefile = open(os.path.join(BootDir, "Makefile"), "wb") UpdateSource = open(os.path.join(BootDir, "updatesource.sh"), "wb") Makefile.write("all: cm3\n\n") for a in [UpdateSource, Make]: a.write("#!/bin/sh\n\nset -e\nset -x\n\n") for a in [Makefile]: a.write("Assemble=" + Assemble + "\nCompile=" + Compile + "\nLink=" + Link + "\n") for a in [Make]: a.write("Assemble=\"" + Assemble + "\"\nCompile=\"" + Compile + "\"\nLink=\"" + Link + "\"\n") for q in P: dir = GetPackagePath(q) for a in os.listdir(os.path.join(Root, dir, Config)): if (a.endswith(".ms") or a.endswith(".is") or a.endswith(".c")): CopyFile(os.path.join(Root, dir, Config, a), BootDir) Makefile.write("Objects += " + a + ".o\n" + a + ".o: " + a + "\n\t") if a.endswith(".c"): Command = "Compile" else: Command = "Assemble" for b in [Make, Makefile]: b.write("${" + Command + "} " + a + " -o " + a + ".o\n") if a.endswith(".h"): CopyFile(os.path.join(Root, dir, Config, a), BootDir) Makefile.write("cm3: $(Objects)\n\t") for a in [Make, Makefile]: a.write("$(Link) -o cm3 *.o\n") Common = "Common" for a in [ # # Add to this list as needed. # Adding more than necessary is ok -- assume the target system has no changes, # so we can replace whatever is there. # "m3-libs/libm3/src/os/POSIX/OSConfigPosix.m3", "m3-libs/libm3/src/random/m3makefile", "m3-libs/m3core/src/C/m3makefile", "m3-libs/m3core/src/C/" + Target + "/m3makefile", "m3-libs/m3core/src/C/" + Common + "/m3makefile", "m3-libs/m3core/src/Csupport/m3makefile", "m3-libs/m3core/src/float/m3makefile", "m3-libs/m3core/src/runtime/m3makefile", "m3-libs/m3core/src/runtime/common/Compiler.tmpl", "m3-libs/m3core/src/text/TextLiteral.i3", "m3-libs/m3core/src/thread/m3makefile", "m3-libs/m3core/src/time/POSIX/m3makefile", "m3-libs/m3core/src/unix/m3makefile", "m3-sys/cminstall/src/config-no-install/SOLgnu", "m3-sys/cminstall/src/config-no-install/SOLsun", "m3-sys/cminstall/src/config-no-install/Unix.common", "m3-sys/cminstall/src/config-no-install/Solaris.common", "m3-sys/cminstall/src/config-no-install/" + Target, "m3-sys/m3cc/src/m3makefile", "m3-sys/m3middle/src/Target.i3", "m3-sys/m3middle/src/Target.m3", "scripts/python/pylib.py", "m3-libs/m3core/src/C/" + Target + "/Csetjmp.i3", "m3-libs/m3core/src/C/" + Target + "/Csignal.i3", "m3-libs/m3core/src/C/" + Target + "/Cstdio.i3", "m3-libs/m3core/src/C/" + Target + "/Cstring.i3", "m3-libs/m3core/src/C/" + Target + "/m3makefile", "m3-libs/m3core/src/C/" + Common + "/Csetjmp.i3", "m3-libs/m3core/src/C/" + Common + "/Csignal.i3", "m3-libs/m3core/src/C/" + Common + "/Cstdio.i3", "m3-libs/m3core/src/C/" + Common + "/Cstring.i3", "m3-libs/m3core/src/C/" + Common + "/m3makefile" ]: source = os.path.join(Root, a) if FileExists(source): name = GetLastPathElement(a) reldir = RemoveLastPathElement(a) destdir = os.path.join(BootDir, reldir) dest = os.path.join(destdir, name) try: os.makedirs(destdir) except: pass CopyFile(source, dest) for b in [UpdateSource, Make]: b.write("mkdir -p /dev2/cm3/" + reldir + "\n") b.write("cp " + a + " /dev2/cm3/" + a + "\n") for a in [UpdateSource, Make, Makefile]: a.close() os.chdir("/") _MakeArchive(BootDir[1:]) | 384b3cc05fcedf4307f077f49cde3d6675b039c6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/384b3cc05fcedf4307f077f49cde3d6675b039c6/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
315,
225,
4049,
273,
315,
21,
6,
225,
468,
1220,
1779,
353,
16975,
628,
326,
642,
1390,
18,
468,
399,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
315,
225,
4049,
273,
315,
21,
6,
225,
468,
1220,
1779,
353,
16975,
628,
326,
642,
1390,
18,
468,
399,
... |
if op is r_operator: if self._r_assoc: | if rop._binary: if op is r_operator: if self._r_assoc: rparens = False elif self._precedence == rop._precedence: if self._r_assoc: rparens = False elif self._precedence < rop._precedence: | def _repr_(self, simplify=True): """ TESTS: sage: a = (1-1/r)^(-1); a 1/(1 - 1/r) sage: a.derivative(r) -1/((1 - 1/r)^2*r^2) | 0f3b3d44db8e1b86009e89bdac564fa5d50b9989 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0f3b3d44db8e1b86009e89bdac564fa5d50b9989/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
16,
16499,
33,
5510,
4672,
3536,
22130,
55,
30,
272,
410,
30,
279,
273,
261,
21,
17,
21,
19,
86,
13,
66,
19236,
21,
1769,
279,
404,
19,
12,
21,
300,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
16,
16499,
33,
5510,
4672,
3536,
22130,
55,
30,
272,
410,
30,
279,
273,
261,
21,
17,
21,
19,
86,
13,
66,
19236,
21,
1769,
279,
404,
19,
12,
21,
300,
404,
... |
os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d'] if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "install"], "Building UUID Extension" ) os.chdir("../../..") | if not ((buildenv['os'] == 'win') and (buildenv['version'] == 'debug')): os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d'] if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "install"], "Building UUID Extension" ) os.chdir("../../..") | def build(buildenv): if buildenv['os'] == 'posix': os.chdir("distrib/linux/launcher") hardhatlib.executeCommand( buildenv, info['name'], [buildenv['make']], "Making launcher programs") if buildenv['version'] == 'release': hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "release") hardhatlib.copyFile("chandler", buildenv['root'] + \ os.sep + "release") if buildenv['version'] == 'debug': hardhatlib.copyFile("chandler_bin", buildenv['root'] + \ os.sep + "debug") hardhatlib.copyFile("chandler", buildenv['root'] + \ os.sep + "debug") os.chdir("../../..") # Build UUID Extension and install it os.chdir(os.path.join("model","util","ext")) if buildenv['version'] == 'debug': python = buildenv['python_d'] if buildenv['version'] == 'release': python = buildenv['python'] hardhatlib.executeCommand( buildenv, info['name'], [python, "setup.py", "install"], "Building UUID Extension" ) os.chdir("../../..") os.chdir("distrib") if buildenv['os'] == 'posix' or buildenv['os'] == 'osx': if buildenv['os'] == 'posix': os.chdir("linux") if buildenv['os'] == 'osx': os.chdir("osx") if buildenv['version'] == 'release': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunRelease to release") hardhatlib.copyFile("RunRelease", buildenv['root'] + \ os.sep + "release") if buildenv['version'] == 'debug': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunDebug to debug") hardhatlib.copyFile("RunDebug", buildenv['root'] + \ os.sep + "debug") if buildenv['os'] == 'win': os.chdir("win") if buildenv['version'] == 'release': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCR70.DLL to release/bin") hardhatlib.copyFile("msvcr70.dll", buildenv['root'] + \ os.sep + "release" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunRelease.bat to release") hardhatlib.copyFile("RunRelease.bat", buildenv['root'] + \ os.sep + "release") if buildenv['version'] == 'debug': hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCR70D.DLL to debug/bin") hardhatlib.copyFile("msvcr70d.dll", buildenv['root'] + \ os.sep + "debug" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying MSVCRTD.DLL to debug/bin") hardhatlib.copyFile("msvcrtd.dll", buildenv['root'] + \ os.sep + "debug" + os.sep + "bin") hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Copying RunDebug.bat to debug") hardhatlib.copyFile("RunDebug.bat", buildenv['root'] + \ os.sep + "debug") | 40fafd6086daf0d72d8a6933b25fb8aa807a0dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/40fafd6086daf0d72d8a6933b25fb8aa807a0dfe/__hardhat__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
3510,
3074,
4672,
225,
309,
1361,
3074,
3292,
538,
3546,
422,
296,
24463,
4278,
1140,
18,
343,
1214,
2932,
2251,
665,
19,
20132,
19,
20738,
264,
7923,
7877,
11304,
2941,
18,
88... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
3510,
3074,
4672,
225,
309,
1361,
3074,
3292,
538,
3546,
422,
296,
24463,
4278,
1140,
18,
343,
1214,
2932,
2251,
665,
19,
20132,
19,
20738,
264,
7923,
7877,
11304,
2941,
18,
88... |
def createCompositeRecordDefinition(d, name): | def createRecordDefinition(d, name): | def createCompositeRecordDefinition(d, name): oe = outputEngine() oe.add("type %s =\n" % recordName(name)) oe.increaseIndent() oe.add("{\n") oe.increaseIndent() zs = [] for x in compositeGetElements(d, name): t = getType(d, x) if t == 'composite': zs.append('%s : %s' % (x, recordName(x))) elif t == 'array': zs.append('%s : %s' % (x, recordName(x))) elif t == 'int': zs.append('%s : int' % x) elif t == 'string': zs.append('%s : string' % x) else: sys.exit('invalid type in a record: %s' % t) oe.interleave(zs, ',\n') oe.add('\n') oe.decreaseIndent() oe.add("}\n") oe.decreaseIndent() return oe.dump() | f0756bf03379af6ffd3d749c4a54f5bbaeea78e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7546/f0756bf03379af6ffd3d749c4a54f5bbaeea78e6/marshallgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
752,
2115,
1852,
12,
72,
16,
508,
4672,
320,
73,
273,
876,
4410,
1435,
320,
73,
18,
1289,
2932,
723,
738,
87,
273,
64,
82,
6,
738,
1409,
461,
12,
529,
3719,
320,
73,
18,
267,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
752,
2115,
1852,
12,
72,
16,
508,
4672,
320,
73,
273,
876,
4410,
1435,
320,
73,
18,
1289,
2932,
723,
738,
87,
273,
64,
82,
6,
738,
1409,
461,
12,
529,
3719,
320,
73,
18,
267,
... |
for opatch in other.patch_set: if patch.filename == opatch.filename: if not patch.no_base_file and patch.text != opatch.text: delta.append(other.key().id()) opatch.text = None | query = models.Patch.all() query.filter("filename =", patch.filename) query.filter("patchset =", other.key()) other_patches = query.fetch(100) if other_patches and len(other_patches) > 1: logging.info("Got %s patches with the same filename for a patchset", len(other_patches)) for op in other_patches: if op.text != patch.text: delta.append(other.key().id()) | def _calculate_delta(patch, patchset_id, patchsets): """Calculates which files in earlier patchsets this file differs from. Args: patch: The file to compare. patchset_id: The file's patchset's key id. patchsets: A list of existing patchsets. Returns: A list of patchset ids. """ delta = [] if patch.no_base_file: return delta for other in patchsets: if patchset_id == other.key().id(): break if other.data or other.parsed_patches: # Loading all the Patch entities in every PatchSet takes too long # (DeadLineExceeded) and consumes a lot of memory (MemoryError) so instead # just parse the patchset's data. Note we can only do this if the # patchset was small enough to fit in the data property. if other.parsed_patches is None: other.parsed_patches = engine.SplitPatch(other.data) other.data = None # Reduce memory usage. for filename, text in other.parsed_patches: if filename == patch.filename: if text != patch.text: delta.append(other.key().id()) break else: # Note: calling list(other.patch_set) would consume too much memory and # sometimes fail with MemoryError. So do this even if it's slower. for opatch in other.patch_set: if patch.filename == opatch.filename: if not patch.no_base_file and patch.text != opatch.text: delta.append(other.key().id()) opatch.text = None # Reduce memory usage. break return delta | 0d606bd81c11563d38153f3f12d2260a3ee48e68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/476/0d606bd81c11563d38153f3f12d2260a3ee48e68/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
67,
9878,
12,
2272,
16,
4729,
542,
67,
350,
16,
4729,
4424,
4672,
3536,
10587,
1492,
1390,
316,
13805,
4729,
4424,
333,
585,
21944,
628,
18,
225,
6634,
30,
4729,
30,
1021,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11162,
67,
9878,
12,
2272,
16,
4729,
542,
67,
350,
16,
4729,
4424,
4672,
3536,
10587,
1492,
1390,
316,
13805,
4729,
4424,
333,
585,
21944,
628,
18,
225,
6634,
30,
4729,
30,
1021,
... |
info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2:] | if (info_prefix is None): info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2:] | def as_miller_arrays(self, crystal_symmetry=None, force_symmetry=False): if (self.file_type() is None): return [] if (self.file_type() == "cctbx.miller.array"): return self.file_content() info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2:] return self._file_content.as_miller_arrays( crystal_symmetry=crystal_symmetry, force_symmetry=force_symmetry, info_prefix=info_prefix) | 5c4ea9bd3e27e5ce1c5eddc4641bf53c4c50bbf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/5c4ea9bd3e27e5ce1c5eddc4641bf53c4c50bbf0/reflection_file_reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
81,
24462,
67,
16223,
12,
2890,
16,
4422,
31365,
67,
8117,
18042,
33,
7036,
16,
2944,
67,
8117,
18042,
33,
8381,
4672,
309,
261,
2890,
18,
768,
67,
723,
1435,
353,
599,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
81,
24462,
67,
16223,
12,
2890,
16,
4422,
31365,
67,
8117,
18042,
33,
7036,
16,
2944,
67,
8117,
18042,
33,
8381,
4672,
309,
261,
2890,
18,
768,
67,
723,
1435,
353,
599,
4672,
... |
if certFile and keyFile: h = httplib.HTTPSConnection(server, key_file = keyFile, cert_file = certFile) | if cert and key: h = httplib.HTTPSConnection(server, key_file = key, cert_file = cert) | def get_output(self): """ Return the output file, i.e. the file containing the frame cache data. or the files itself as tuple (for DAX) """ if self.__dax: # we are a dax running in grid mode so we need to resolve the # frame file metadata into LFNs so pegasus can query the RLS if self.__lfn_list is None: | 24b81d2ec6995782c831003011aff6c9c31e0e57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/24b81d2ec6995782c831003011aff6c9c31e0e57/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2844,
12,
2890,
4672,
3536,
2000,
326,
876,
585,
16,
277,
18,
73,
18,
326,
585,
4191,
326,
2623,
1247,
501,
18,
578,
326,
1390,
6174,
487,
3193,
261,
1884,
463,
2501,
13,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2844,
12,
2890,
4672,
3536,
2000,
326,
876,
585,
16,
277,
18,
73,
18,
326,
585,
4191,
326,
2623,
1247,
501,
18,
578,
326,
1390,
6174,
487,
3193,
261,
1884,
463,
2501,
13,
35... |
def write(self, text='', nl=True, first=False): indent = self.indentation * ' ' if first: self.result.write(indent[:self.indentfirstline or None] + text) self.indentfirstline = 0 elif text: self.result.write(indent + text) if nl: self.result.write('\n') | def flush_par(self, noskip=False, force=False, nowrap=False): """Format and write the current paragraph.""" if nowrap: par = self.get_par(wrap=False).splitlines() else: par = self.get_par(wrap=True) if par or force: for i, line in enumerate(par): self.write(line, first=(i==0)) if not noskip: self.write() | def write(self, text='', nl=True, first=False): indent = self.indentation * ' ' if first: self.result.write(indent[:self.indentfirstline or None] + text) self.indentfirstline = 0 elif text: # don't write indentation only self.result.write(indent + text) if nl: self.result.write('\n') | 6ce8d3660b7cb8ebd5dc9b1be5e810f62dbf72d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12815/6ce8d3660b7cb8ebd5dc9b1be5e810f62dbf72d3/zeml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
977,
2218,
2187,
7741,
33,
5510,
16,
1122,
33,
8381,
4672,
3504,
273,
365,
18,
9355,
367,
380,
296,
296,
309,
1122,
30,
365,
18,
2088,
18,
2626,
12,
9355,
10531,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
977,
2218,
2187,
7741,
33,
5510,
16,
1122,
33,
8381,
4672,
3504,
273,
365,
18,
9355,
367,
380,
296,
296,
309,
1122,
30,
365,
18,
2088,
18,
2626,
12,
9355,
10531,
... |
if context is None: context = getcontext() ans = self._check_nans(exp, context) if ans: return ans if exp._isinfinity() or self._isinfinity(): if exp._isinfinity() and self._isinfinity(): return self return context._raise_error(InvalidOperation, 'quantize with one INF') | if self._is_special or exp._is_special: ans = self._check_nans(exp, context) if ans: return ans if exp._isinfinity() or self._isinfinity(): if exp._isinfinity() and self._isinfinity(): return self if context is None: context = getcontext() return context._raise_error(InvalidOperation, 'quantize with one INF') | def quantize(self, exp, rounding = None, context=None, watchexp = 1): """Quantize self so its exponent is the same as that of exp. | 1a63da64df2af26e1f050749c19281f1de9084fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a63da64df2af26e1f050749c19281f1de9084fa/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10251,
554,
12,
2890,
16,
1329,
16,
13885,
273,
599,
16,
819,
33,
7036,
16,
4267,
2749,
273,
404,
4672,
3536,
19471,
554,
365,
1427,
2097,
9100,
353,
326,
1967,
487,
716,
434,
1329,
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,
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,
10251,
554,
12,
2890,
16,
1329,
16,
13885,
273,
599,
16,
819,
33,
7036,
16,
4267,
2749,
273,
404,
4672,
3536,
19471,
554,
365,
1427,
2097,
9100,
353,
326,
1967,
487,
716,
434,
1329,
18... |
run_module.__name__ = '.'.join(module) functions.append(run_module) | name = '.'.join(module) run_module.__name__ = name names_to_functions[name] = run_module functions[run_module] = set() for fn, deps in DEPENDENCIES.iteritems(): if fn in names_to_functions: functions[names_to_functions[fn]] = set( names_to_functions[dep] for dep in deps) | def run_tests(start, full=False): os.path.walk(start, lister, full) functions = [] for module in modules: # Create a function that'll test a particular module. module=module # is a hack to force python to evaluate the params now. We then # rename the function to make error reporting nicer. run_module = lambda module=module: run_test(module) run_module.__name__ = '.'.join(module) functions.append(run_module) try: dargs = {} if debug: dargs['max_simultaneous_procs'] = 1 pe = parallel.ParallelExecute(functions, **dargs) pe.run_until_completion() except parallel.ParallelError, err: return err.errors return [] | 78d5a60a153b05fd0a0657beaee98eab5069b074 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/78d5a60a153b05fd0a0657beaee98eab5069b074/unittest_suite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
1937,
16,
1983,
33,
8381,
4672,
1140,
18,
803,
18,
11348,
12,
1937,
16,
666,
264,
16,
1983,
13,
225,
4186,
273,
5378,
364,
1605,
316,
4381,
30,
468,
1788,
279,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16341,
12,
1937,
16,
1983,
33,
8381,
4672,
1140,
18,
803,
18,
11348,
12,
1937,
16,
666,
264,
16,
1983,
13,
225,
4186,
273,
5378,
364,
1605,
316,
4381,
30,
468,
1788,
279,
4... |
if verbose: print 'Creating local directory', localdir | if verbose: print 'Creating local directory', `localdir` | def mirrorsubdir(f, localdir): pwd = f.pwd() if localdir and not os.path.isdir(localdir): if verbose: print 'Creating local directory', localdir try: makedir(localdir) except os.error, msg: print "Failed to establish local directory", localdir return infofilename = os.path.join(localdir, '.mirrorinfo') try: text = open(infofilename, 'r').read() except IOError, msg: text = '{}' try: info = eval(text) except (SyntaxError, NameError): print 'Bad mirror info in %s' % infofilename info = {} subdirs = [] listing = [] if verbose: print 'Listing remote directory %s...' % pwd f.retrlines('LIST', listing.append) filesfound = [] for line in listing: if verbose > 1: print '-->', `line` if mac: # Mac listing has just filenames; # trailing / means subdirectory filename = string.strip(line) mode = '-' if filename[-1:] == '/': filename = filename[:-1] mode = 'd' infostuff = '' else: # Parse, assuming a UNIX listing words = string.split(line, None, 8) if len(words) < 6: if verbose > 1: print 'Skipping short line' continue filename = words[-1] if string.find(filename, " -> ") >= 0: if verbose > 1: print 'Skipping symbolic link %s' % \ filename continue infostuff = words[-5:-1] mode = words[0] skip = 0 for pat in skippats: if fnmatch(filename, pat): if verbose > 1: print 'Skip pattern', pat, print 'matches', filename skip = 1 break if skip: continue if mode[0] == 'd': if verbose > 1: print 'Remembering subdirectory', filename subdirs.append(filename) continue filesfound.append(filename) if info.has_key(filename) and info[filename] == infostuff: if verbose > 1: print 'Already have this version of', filename continue fullname = os.path.join(localdir, filename) tempname = os.path.join(localdir, '@'+filename) if interactive: doit = askabout('file', filename, pwd) if not doit: if not info.has_key(filename): info[filename] = 'Not retrieved' continue try: os.unlink(tempname) except os.error: pass try: fp = open(tempname, 'wb') except IOError, msg: print "Can't create %s: %s" % (tempname, str(msg)) continue if verbose: print 'Retrieving %s from %s as %s...' % \ (filename, pwd, fullname) if verbose: fp1 = LoggingFile(fp, 1024, sys.stdout) else: fp1 = fp t0 = time.time() try: f.retrbinary('RETR ' + filename, fp1.write, 8*1024) except ftplib.error_perm, msg: print msg t1 = time.time() bytes = fp.tell() fp.close() if fp1 != fp: fp1.close() try: os.unlink(fullname) except os.error: pass # Ignore the error try: os.rename(tempname, fullname) except os.error, msg: print "Can't rename %s to %s: %s" % (tempname, fullname, str(msg)) continue info[filename] = infostuff writedict(info, infofilename) if verbose: dt = t1 - t0 kbytes = bytes / 1024.0 print int(round(kbytes)), print 'Kbytes in', print int(round(dt)), print 'seconds', if t1 > t0: print '(~%d Kbytes/sec)' % \ int(round(kbytes/dt),) print # # Remove files from info that are no longer remote deletions = 0 for filename in info.keys(): if filename not in filesfound: if verbose: print "Removing obsolete info entry for", print filename, "in", localdir or "." del info[filename] deletions = deletions + 1 if deletions: writedict(info, infofilename) # # Remove local files that are no longer in the remote directory try: if not localdir: names = os.listdir(os.curdir) else: names = os.listdir(localdir) except os.error: names = [] for name in names: if name[0] == '.' or info.has_key(name) or name in subdirs: continue skip = 0 for pat in skippats: if fnmatch(name, pat): if verbose > 1: print 'Skip pattern', pat, print 'matches', name skip = 1 break if skip: continue fullname = os.path.join(localdir, name) if not rmok: if verbose: print 'Local file', fullname, print 'is no longer pertinent' continue if verbose: print 'Removing local file/dir', fullname remove(fullname) # # Recursively mirror subdirectories for subdir in subdirs: if interactive: doit = askabout('subdirectory', subdir, pwd) if not doit: continue if verbose: print 'Processing subdirectory', subdir localsubdir = os.path.join(localdir, subdir) pwd = f.pwd() if verbose > 1: print 'Remote directory now:', pwd print 'Remote cwd', subdir try: f.cwd(subdir) except ftplib.error_perm, msg: print "Can't chdir to", subdir, ":", msg else: if verbose: print 'Mirroring as', localsubdir mirrorsubdir(f, localsubdir) if verbose > 1: print 'Remote cwd ..' f.cwd('..') newpwd = f.pwd() if newpwd != pwd: print 'Ended up in wrong directory after cd + cd ..' print 'Giving up now.' break else: if verbose > 1: print 'OK.' | 177e24029a050d5f78171d466185e2fd80d527b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/177e24029a050d5f78171d466185e2fd80d527b6/ftpmirror.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
27026,
373,
1214,
12,
74,
16,
1191,
1214,
4672,
14720,
273,
284,
18,
27487,
1435,
309,
1191,
1214,
471,
486,
1140,
18,
803,
18,
291,
1214,
12,
3729,
1214,
4672,
309,
3988,
30,
117... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
27026,
373,
1214,
12,
74,
16,
1191,
1214,
4672,
14720,
273,
284,
18,
27487,
1435,
309,
1191,
1214,
471,
486,
1140,
18,
803,
18,
291,
1214,
12,
3729,
1214,
4672,
309,
3988,
30,
117... |
def __init__(self, func=None, abortable=False, frame=None): super(InProgressCallback, self).__init__(abortable, frame=frame or traceback.extract_stack()[-2]) | def __init__(self, func=None, abortable=False, frame=0): super(InProgressCallback, self).__init__(abortable, frame=frame-1) | def __init__(self, func=None, abortable=False, frame=None): super(InProgressCallback, self).__init__(abortable, frame=frame or traceback.extract_stack()[-2]) if func is not None: # connect self as callback func(self) | 528ac341939c8c61d82deee44475112f47554e9e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11722/528ac341939c8c61d82deee44475112f47554e9e/async.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1326,
33,
7036,
16,
6263,
429,
33,
8381,
16,
2623,
33,
20,
4672,
2240,
12,
13434,
2428,
16,
365,
2934,
972,
2738,
972,
12,
18623,
429,
16,
2623,
33,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1326,
33,
7036,
16,
6263,
429,
33,
8381,
16,
2623,
33,
20,
4672,
2240,
12,
13434,
2428,
16,
365,
2934,
972,
2738,
972,
12,
18623,
429,
16,
2623,
33,
37... |
if timestamp is not None and not isinstance(timestamp, datetime.datetime): raise TypeError("Timestamp must be None or datetime.datetime() instance") | if timestamp is not None and not isinstance(timestamp, datetime.datetime): raise TypeError("Timestamp must be None or datetime.datetime() " "instance") | def _set_timestamp(self, timestamp): if timestamp is not None and not isinstance(timestamp, datetime.datetime): raise TypeError("Timestamp must be None or datetime.datetime() instance") self._timestamp = timestamp | 5f80e7bee5e15c983e3441763b57884dc4714023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7382/5f80e7bee5e15c983e3441763b57884dc4714023/sample.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
5508,
12,
2890,
16,
2858,
4672,
309,
2858,
353,
486,
599,
471,
486,
1549,
12,
5508,
16,
3314,
18,
6585,
4672,
1002,
3580,
2932,
4921,
1297,
506,
599,
578,
3314,
18,
6585,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
542,
67,
5508,
12,
2890,
16,
2858,
4672,
309,
2858,
353,
486,
599,
471,
486,
1549,
12,
5508,
16,
3314,
18,
6585,
4672,
1002,
3580,
2932,
4921,
1297,
506,
599,
578,
3314,
18,
6585,... |
x = param['10'] y = param['20'] r = param['40'] | cx = param['10'] cy = param['20'] rx = ry = param['40'] | def arc(self): param={ '10': None, # X coordinat center '20': None, # Y coordinat center #'30': None, # Z coordinat center '40': 0.0, # radius '50': 0.0, # Start angle '51': 0.0 # End angle } param.update(self.general_param) param = self.read_param(param) x = param['10'] y = param['20'] r = param['40'] start_angle = param['50'] * degrees end_angle = param['51'] * degrees t = self.trafo(Trafo(r,0,0,r,x,y)) r, w1, w2, r, x, y = t.coeff() style = self.get_line_style(**param) self.prop_stack.AddStyle(style.Duplicate()) apply(self.ellipse, (r, w1, w2, r, x, y, start_angle, end_angle, ArcArc)) | 02df12c26818fd938357920396a246a253220885 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/02df12c26818fd938357920396a246a253220885/dxfloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8028,
12,
2890,
4672,
579,
5899,
202,
11,
2163,
4278,
599,
16,
468,
1139,
2745,
267,
270,
4617,
296,
3462,
4278,
599,
16,
468,
1624,
2745,
267,
270,
4617,
25767,
5082,
4278,
599,
16,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8028,
12,
2890,
4672,
579,
5899,
202,
11,
2163,
4278,
599,
16,
468,
1139,
2745,
267,
270,
4617,
296,
3462,
4278,
599,
16,
468,
1624,
2745,
267,
270,
4617,
25767,
5082,
4278,
599,
16,
4... |
Deletes vertex, removing all incident edges. | Deletes vertex, removing all incident edges. Deleting a non-existant vertex will raise an exception. | def delete_vertex(self, vertex): """ Deletes vertex, removing all incident edges. EXAMPLES: sage: G = graphs.WheelGraph(9) sage: G.delete_vertex(0); G.save('sage.png') | 9e67aea9ccb2516f92465824d3e63b16494101b3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9e67aea9ccb2516f92465824d3e63b16494101b3/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
15281,
12,
2890,
16,
5253,
4672,
3536,
17973,
5253,
16,
9427,
777,
22933,
5231,
18,
225,
20988,
310,
279,
1661,
17,
7398,
970,
5253,
903,
1002,
392,
1520,
18,
225,
5675,
8900,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
15281,
12,
2890,
16,
5253,
4672,
3536,
17973,
5253,
16,
9427,
777,
22933,
5231,
18,
225,
20988,
310,
279,
1661,
17,
7398,
970,
5253,
903,
1002,
392,
1520,
18,
225,
5675,
8900,
... |
bar_box.x1 = box_width/2 | bar_box.x1 = box_width/2 -bar_width/2 | def do_allocate(self, box, flags): box_width = box.x2 - box.x1 box_height = box.y2 - box.y1 margin = box_width/8 scroller_width = box_width - 2*margin bar_width = box_width/4 bar_height = box_height - 2*margin - scroller_width bar_box = clutter.ActorBox() bar_box.x1 = box_width/2 bar_box.y1 = margin + scroller_width/2 bar_box.x2 = bar_box.x1 + bar_width bar_box.y2 = bar_box.y1 + bar_height self.scrollbar_background.allocate(bar_box, flags) scroller_box=clutter.ActorBox() scroller_box.x1 = margin scroller_box.x2 = scroller_box.x1 + box_width if self.scroller_position >= box_height-scroller_width -2*margin: self.scroller_position = box_height-scroller_width -2*margin scroller_box.y1 = self.scroller_position scroller_box.y2 = scroller_box.y1 + box_width self.scroller.allocate(scroller_box,flags) scroll_position_percent=self.scroller_position/(box_height-scroller_width -2*margin) self.emit("scroll_position",scroll_position_percent) clutter.Actor.do_allocate(self, box, flags) | 086e51a16537993aa8c24c5cf5cba88573b4a720 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5279/086e51a16537993aa8c24c5cf5cba88573b4a720/scrollbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
16247,
12,
2890,
16,
3919,
16,
2943,
4672,
3919,
67,
2819,
273,
3919,
18,
92,
22,
300,
3919,
18,
92,
21,
3919,
67,
4210,
273,
3919,
18,
93,
22,
300,
3919,
18,
93,
21,
7333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
16247,
12,
2890,
16,
3919,
16,
2943,
4672,
3919,
67,
2819,
273,
3919,
18,
92,
22,
300,
3919,
18,
92,
21,
3919,
67,
4210,
273,
3919,
18,
93,
22,
300,
3919,
18,
93,
21,
7333... |
f.seek(0, 2) expect(f.tell(), size+1) newsize = size - 10 f.seek(newsize) f.truncate() expect(f.tell(), newsize) f.seek(0, 2) expect(f.tell(), newsize) newsize -= 1 f.seek(42) f.truncate(newsize) expect(f.tell(), 42) f.seek(0, 2) expect(f.tell(), newsize) | try: f.seek(0, 2) expect(f.tell(), size+1) newsize = size - 10 f.seek(newsize) f.truncate() expect(f.tell(), newsize) f.seek(0, 2) expect(f.tell(), newsize) newsize -= 1 f.seek(42) f.truncate(newsize) expect(f.tell(), 42) f.seek(0, 2) expect(f.tell(), newsize) | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | 063606a0d5302d8a5530297a70494a9cad334e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/063606a0d5302d8a5530297a70494a9cad334e83/test_largefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4489,
12,
13212,
67,
2211,
16,
4489,
67,
2211,
4672,
309,
1842,
67,
13261,
18,
11369,
30,
1172,
1995,
86,
273,
35,
33,
738,
86,
25956,
738,
261,
13212,
67,
2211,
16,
4489,
67,
2211,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4489,
12,
13212,
67,
2211,
16,
4489,
67,
2211,
4672,
309,
1842,
67,
13261,
18,
11369,
30,
1172,
1995,
86,
273,
35,
33,
738,
86,
25956,
738,
261,
13212,
67,
2211,
16,
4489,
67,
2211,
... |
"path": os.path.join(path, f), | "path": os.path.join(abspath, f), | def dirlist(**map): parity = 0 fl = files.keys() fl.sort() for f in fl: full, fnode = files[f] if fnode: continue | 8cd3bcd6805318c02bbc054a6543b549daaf60a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/8cd3bcd6805318c02bbc054a6543b549daaf60a9/hgweb_mod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1577,
1098,
12,
636,
1458,
4672,
19904,
273,
374,
1183,
273,
1390,
18,
2452,
1435,
1183,
18,
3804,
1435,
364,
284,
316,
1183,
30,
1983,
16,
284,
2159,
273,
1390,
63,
74,
65,
309,
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,
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,
1577,
1098,
12,
636,
1458,
4672,
19904,
273,
374,
1183,
273,
1390,
18,
2452,
1435,
1183,
18,
3804,
1435,
364,
284,
316,
1183,
30,
1983,
16,
284,
2159,
273,
1390,
63,
74,
65,
309,
284,
... |
Abelian variety factor of dimension 2 of J0(33) | Simple abelian subvariety 11a(3,33) of dimension 1 of J0(33) | def rank(self): """ Return the rank of the underlying lattice of self. | 231a556974015ed454b20c5783447e82495d8183 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/231a556974015ed454b20c5783447e82495d8183/abvar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6171,
12,
2890,
4672,
3536,
2000,
326,
6171,
434,
326,
6808,
16690,
434,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6171,
12,
2890,
4672,
3536,
2000,
326,
6171,
434,
326,
6808,
16690,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
pickSample = ev.xdata * samp_rate | pickSample = (ev.xdata - t[0]) * samp_rate | def __mpl_keyPressEvent(self, ev): if self.widgets.qToolButton_showMap.isChecked(): return keys = self.keys phase_type = str(self.widgets.qComboBox_phaseType.currentText()) dict = self.dicts[self.stPt] st = self.streams[self.stPt] ####################################################################### # Start of key events related to picking # ####################################################################### # For some key events (picking events) we need information on the x/y # position of the cursor: if ev.key in [keys['setPick'], keys['setPickError'], keys['setMagMin'], keys['setMagMax']]: # some keyPress events only make sense inside our matplotlib axes if ev.inaxes not in self.axs: return #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = st[0].stats.sampling_rate pickSample = ev.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need the position of the cursor location # in the seismogram array: xpos = pickSample * samp_rate | bef65c6713ba88a6ae2e560428b5b3789948b15e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/bef65c6713ba88a6ae2e560428b5b3789948b15e/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
10514,
67,
856,
11840,
1133,
12,
2890,
16,
2113,
4672,
309,
365,
18,
18148,
18,
85,
6364,
3616,
67,
4500,
863,
18,
291,
11454,
13332,
327,
1311,
273,
365,
18,
2452,
6855,
67,
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,
10514,
67,
856,
11840,
1133,
12,
2890,
16,
2113,
4672,
309,
365,
18,
18148,
18,
85,
6364,
3616,
67,
4500,
863,
18,
291,
11454,
13332,
327,
1311,
273,
365,
18,
2452,
6855,
67,
723... |
r.play() self.assertStateEmpty(s) s.freeze_while(work) self.assertState(s) def test_freeze_thaw__not_buffering(self): s = State() r = ev_snapshot(s) s.freeze(buffer=False) self.assertFalse(s._buffering) r.play() s.thaw(replay=True) self.assertFalse(s.buffer) self.assertStateEmpty(s) | pass s.freeze_while(work, clear_after=True) self.assertFalse(s.event_count) | def work(): r.play() self.assertStateEmpty(s) | 22b5dd710c73b6077ac592dbe5b55fdc263f37b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/22b5dd710c73b6077ac592dbe5b55fdc263f37b4/test_events_state.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1440,
13332,
436,
18,
1601,
1435,
365,
18,
11231,
1119,
1921,
12,
87,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
1440,
13332,
436,
18,
1601,
1435,
365,
18,
11231,
1119,
1921,
12,
87,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.ptmp.r += (atoms.du * self.dR) | self.ptmp.r += (self.du * self.dR) | def step(self, f): atoms = self.atoms self.ni = atoms.nimages-2 # try: atoms.imax # except: atoms.imax=0 # if(not self.ni):atoms.imax=1 g = open('out','w') atoms.r = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.r[i-1] = atoms.images[i].get_positions() print >> g,'atoms.r',atoms.r atoms.f = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.f[i-1] = atoms.images[i].get_forces() print >> g,'atoms.f',atoms.f try: atoms.start except:atoms.start=0 if(not atoms.start): atoms.start = 1 atoms.a = npy.zeros(self.memory+1, 'd') self.ptmp = atoms self.maxstep = npy.sqrt(self.maxstep * self.ni) atoms.lbfgsinit = 0 try: atoms.lbfgsinit except:atoms.lbfgsinit=0 if(not atoms.lbfgsinit): atoms.lbfgsinit = 1 atoms.Ho = npy.ones((self.ni, atoms.natoms, self.dim), 'd') if (not self.min=='line'):atoms.Ho = atoms.Ho * self.alpha atoms.ITR = 1 atoms.s = [1.] atoms.y = [1.] atoms.rho = [1.] else: a1 = abs (npy.vdot(atoms.f, atoms.f_old)) a2 = npy.vdot(atoms.f_old, atoms.f_old) print 'a1,a2 created',a1,a2 if(self.min=='line'): if(a1<=0.5* a2 and a2!=0): reset_flag = 0 else: reset_flag = 1 else: reset_flag = 0 if(reset_flag==0): g1 = open('out1','w') g2 = open('out2','w') print >> g1,'atoms.r',atoms.r print >> g2,'atoms.r_old',atoms.r_old ITR = atoms.ITR#correctly generated if(ITR > self.memory): atoms.s.pop(1) atoms.y.pop(1) atoms.rho.pop(1) ITR=self.memory atoms.s.append(atoms.r - atoms.r_old)#!!atoms.r is not updating # boundry cond # for i in range(atoms.ni): # if(method=='min'):i=0 # try: # DBC(atoms.s[ITR][i],atoms.p[i].Box) #need to make matrix for box # except: # print "Box not found." # if(method=='min'):break atoms.y.append(-(atoms.f-atoms.f_old)) atoms.rho.append(1/npy.vdot(atoms.y[ITR],atoms.s[ITR])) atoms.ITR += 1 else: | 1a55a570d87917cc147bfa837a3336109417cb92 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/1a55a570d87917cc147bfa837a3336109417cb92/glbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... |
return res | return res | def delete(self, cursor, user, ids, context=None): sale_obj = self.pool.get('sale.sale') sale_line_obj = self.pool.get('sale.line') | 15dc5890ce3b8bcd29e7acb0c9f8e05dc597cb53 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9306/15dc5890ce3b8bcd29e7acb0c9f8e05dc597cb53/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
272,
5349,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
87,
5349,
18,
87,
5349,
6134,
272,
5349,
67,
1369,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
272,
5349,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
87,
5349,
18,
87,
5349,
6134,
272,
5349,
67,
1369,
67,
... |
crc = -1808088941 | crc = 2486878355 | def test_same_as_binascii_crc32(self): foo = 'abcdefghijklmnop' crc = -1808088941 self.assertEqual(binascii.crc32(foo), crc) self.assertEqual(zlib.crc32(foo), crc) self.assertEqual(binascii.crc32('spam'), zlib.crc32('spam')) | ca15bf29c9e503be48ad41c00ea50d5474fbcf08 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/ca15bf29c9e503be48ad41c00ea50d5474fbcf08/test_zlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14307,
67,
345,
67,
4757,
9184,
67,
22988,
1578,
12,
2890,
4672,
8431,
273,
296,
28953,
17680,
8302,
16391,
13607,
556,
11,
10619,
273,
4248,
5292,
28,
8285,
23,
2539,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14307,
67,
345,
67,
4757,
9184,
67,
22988,
1578,
12,
2890,
4672,
8431,
273,
296,
28953,
17680,
8302,
16391,
13607,
556,
11,
10619,
273,
4248,
5292,
28,
8285,
23,
2539,
365,
18,... |
if self.__version == 7: key = (r"%s\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" % (self.__root,)) | if self.__version >= 7: key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" % (self.__root, self.__version)) | def get_msvc_paths(self, path, platform='x86'): """Get a list of devstudio directories (include, lib or path). | e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
959,
4227,
67,
4481,
12,
2890,
16,
589,
16,
4072,
2218,
92,
5292,
11,
4672,
3536,
967,
279,
666,
434,
4461,
334,
4484,
6402,
261,
6702,
16,
2561,
578,
589,
2934,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
959,
4227,
67,
4481,
12,
2890,
16,
589,
16,
4072,
2218,
92,
5292,
11,
4672,
3536,
967,
279,
666,
434,
4461,
334,
4484,
6402,
261,
6702,
16,
2561,
578,
589,
2934,
2,
-100,
-1... |
def moveOne(self, page, newPageTitle, delete): | def moveOne(self, page, newPageTitle): | def moveOne(self, page, newPageTitle, delete): try: msg = wikipedia.translate(wikipedia.getSite(), summary) wikipedia.output(u'Moving page %s to [[%s]]' % (page.aslink(), newPageTitle)) if page.move(newPageTitle, msg, throttle=True): if delete: deletemsg = wikipedia.translate(wikipedia.getSite(), deletesummary) page.delete(deletemsg, mark=True) except wikipedia.NoPage: wikipedia.output(u'Page %s does not exist!' % page.title()) except wikipedia.IsRedirectPage: wikipedia.output(u'Page %s is a redirect; skipping.' % page.title()) except wikipedia.LockedPage: wikipedia.output(u'Page %s is locked!' % page.title()) | fdaa4fded7058caed04ad186ca8423116740a471 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/fdaa4fded7058caed04ad186ca8423116740a471/movepages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
3335,
12,
2890,
16,
1363,
16,
394,
1964,
4247,
4672,
775,
30,
1234,
273,
21137,
18,
13929,
12,
11999,
13744,
18,
588,
4956,
9334,
4916,
13,
21137,
18,
2844,
12,
89,
11,
49,
13767... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3335,
12,
2890,
16,
1363,
16,
394,
1964,
4247,
4672,
775,
30,
1234,
273,
21137,
18,
13929,
12,
11999,
13744,
18,
588,
4956,
9334,
4916,
13,
21137,
18,
2844,
12,
89,
11,
49,
13767... |
for i in range(1,atoms.nimages-1): | for i in range(0,atoms.nimages): | def step(self, f): atoms = self.atoms self.ni = atoms.nimages-2 # try: atoms.imax # except: atoms.imax=0 # if(not self.ni):atoms.imax=1 g = open('out','w') atoms.r = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.r[i-1] = atoms.images[i].get_positions() print >> g,'atoms.r',atoms.r atoms.f = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.f[i-1] = atoms.images[i].get_forces() print >> g,'atoms.f',atoms.f try: atoms.start except:atoms.start=0 if(not atoms.start): atoms.start = 1 atoms.a = npy.zeros(self.memory+1, 'd') self.ptmp = atoms self.maxstep = npy.sqrt(self.maxstep * self.ni) atoms.lbfgsinit = 0 try: atoms.lbfgsinit except:atoms.lbfgsinit=0 if(not atoms.lbfgsinit): atoms.lbfgsinit = 1 atoms.Ho = npy.ones((self.ni, atoms.natoms, self.dim), 'd') if (not self.min=='line'):atoms.Ho = atoms.Ho * self.alpha atoms.ITR = 1 atoms.s = [1.] atoms.y = [1.] atoms.rho = [1.] else: a1 = abs (npy.vdot(atoms.f, atoms.f_old)) a2 = npy.vdot(atoms.f_old, atoms.f_old) print 'a1,a2 created',a1,a2 if(self.min=='line'): if(a1<=0.5* a2 and a2!=0): reset_flag = 0 else: reset_flag = 1 else: reset_flag = 0 if(reset_flag==0): g1 = open('out1','w') g2 = open('out2','w') print >> g1,'atoms.r',atoms.r print >> g2,'atoms.r_old',atoms.r_old ITR = atoms.ITR#correctly generated if(ITR > self.memory): atoms.s.pop(1) atoms.y.pop(1) atoms.rho.pop(1) ITR=self.memory atoms.s.append(atoms.r - atoms.r_old)#!!atoms.r is not updating # boundry cond # for i in range(atoms.ni): # if(method=='min'):i=0 # try: # DBC(atoms.s[ITR][i],atoms.p[i].Box) #need to make matrix for box # except: # print "Box not found." # if(method=='min'):break atoms.y.append(-(atoms.f-atoms.f_old)) atoms.rho.append(1/npy.vdot(atoms.y[ITR],atoms.s[ITR])) atoms.ITR += 1 else: | 689ed3715e535adf898039f50971002aa6c5a5e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/689ed3715e535adf898039f50971002aa6c5a5e9/glbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... |
p.solve(solver = solver, log = verbose) | p.solve(solver=solver, log=verbose) | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | fbdfc46fda1150428e37faef1f31cd5518ab4374 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/fbdfc46fda1150428e37faef1f31cd5518ab4374/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... |
return self.context.context.absolute_url() | return self.context.aq_parent.absolute_url() | def nextURL(self): return self.context.context.absolute_url() | 7de436e56a40c2ae809e91c778f6da62afbc333a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12259/7de436e56a40c2ae809e91c778f6da62afbc333a/clone_type.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
1785,
12,
2890,
4672,
327,
365,
18,
2472,
18,
2472,
18,
12547,
67,
718,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
1785,
12,
2890,
4672,
327,
365,
18,
2472,
18,
2472,
18,
12547,
67,
718,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
sage: print g.next().is_latin_square() | sage: g.next().is_latin_square() | def LatinSquare_generator(L_start, check_assertions = False): """ Generator for a sequence of uniformly distributed latin squares, given L_start as the initial latin square. This code implements the Markov chain algorithm of Jacobson and Matthews (1996), see below for the BibTex entry. This generator will never throw the StopIteration exception, so it provides an infinite sequence of latin squares. EXAMPLES: Use the back circulant latin square of order 4 as the initial square and print the next two latin squares given by the Markov chain: sage: from sage.combinat.matrices.latin import * sage: g = LatinSquare_generator(back_circulant(4)) sage: print g.next().is_latin_square() True REFERENCE: @article{MR1410617, AUTHOR = {Jacobson, Mark T. and Matthews, Peter}, TITLE = {Generating uniformly distributed random {L}atin squares}, JOURNAL = {J. Combin. Des.}, FJOURNAL = {Journal of Combinatorial Designs}, VOLUME = {4}, YEAR = {1996}, NUMBER = {6}, PAGES = {405--437}, ISSN = {1063-8539}, MRCLASS = {05B15 (60J10)}, MRNUMBER = {MR1410617 (98b:05021)}, MRREVIEWER = {Lars D{\o}vling Andersen}, } """ if check_assertions: assert L_start.is_latin_square() n = L_start.nrows() r1 = r2 = c1 = c2 = x = y = z = -1 proper = True L = L_start.copy() L_rce = L L_cer = LatinSquare(n, n) L_erc = LatinSquare(n, n) while True: if proper: if check_assertions: assert L.is_latin_square() ################################# # Update the other two conjugates for r in range(n): for c in range(n): e = L[r, c] L_cer[c, e] = r L_erc[e, r] = c ################################# yield L r1 = ZZ.random_element(n) c1 = ZZ.random_element(n) x = L[r1, c1] y = x while y == x: y = ZZ.random_element(n) # Now find y in row r1 and column c1. if check_assertions: r2 = 0 c2 = 0 while L[r1, c2] != y: c2 += 1 while L[r2, c1] != y: r2 += 1 assert L_erc[y, r1] == c2 assert L_cer[c1, y] == r2 c2 = L_erc[y, r1] r2 = L_cer[c1, y] if check_assertions: assert L[r1, c2] == y if check_assertions: assert L[r2, c1] == y L[r1, c1] = y L[r1, c2] = x L[r2, c1] = x # Now deal with the unknown point. # We want to form z + (y - x) z = L[r2, c2] if z == x: L[r2, c2] = y else: # z and y have positive coefficients # x is the improper term with a negative coefficient proper = False else: # improper square, # L[r2, c2] = y + z - x # y and z are proper while x is the # improper symbol in the cell L[r2, c2]. r1 = row_containing_sym(L, c2, x) c1 = column_containing_sym(L, r2, x) if check_assertions: assert L[r1, c2] == x if check_assertions: assert L[r2, c1] == x # choose one of the proper symbols # uniformly at random (we will use whatever # lands in variable y). if coin(): y, z = z, y # Add/subtract the symbolic difference (y - x) L[r2, c2] = z L[r1, c2] = y L[r2, c1] = y if L[r1, c1] == y: L[r1, c1] = x proper = True else: # got another improper square z = L[r1, c1] x, y = y, x r2 = r1 c2 = c1 # Now we have L[r2, c2] = z+y-x as # usual proper = False # for emphasis | 79588eb9f6225f31a0fe90ef3cb590193d4561c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/79588eb9f6225f31a0fe90ef3cb590193d4561c1/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11134,
267,
22255,
67,
8812,
12,
48,
67,
1937,
16,
866,
67,
11231,
1115,
273,
1083,
4672,
3536,
10159,
364,
279,
3102,
434,
10823,
715,
16859,
30486,
31206,
16,
864,
511,
67,
1937,
487,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11134,
267,
22255,
67,
8812,
12,
48,
67,
1937,
16,
866,
67,
11231,
1115,
273,
1083,
4672,
3536,
10159,
364,
279,
3102,
434,
10823,
715,
16859,
30486,
31206,
16,
864,
511,
67,
1937,
487,
... |
functions = self._fmiCallbackFunctions(self._fmiCallbackLogger(self.fmiCallbackLogger),self._fmiCallbackAllocateMemory(self.fmiCallbackAllocateMemory), self._fmiCallbackFreeMemory(self.fmiCallbackFreeMemory)) | functions = self._fmiCallbackFunctions functions.logger = self.fmiCallbackLogger functions.allocateMemory = self.fmiCallbackAllocateMemory functions.freeMemory = self.fmiCallbackFreeMemory | def instantiate(self, name='Model', logging='0'): """ Instantiate the model. """ instance = self._fmiString(name) guid = self._fmiString(self._GUID) logging = self._fmiBoolean(logging) functions = self._fmiCallbackFunctions(self._fmiCallbackLogger(self.fmiCallbackLogger),self._fmiCallbackAllocateMemory(self.fmiCallbackAllocateMemory), self._fmiCallbackFreeMemory(self.fmiCallbackFreeMemory)) self._model = self._fmiInstantiateModel(instance,guid,functions,logging) | 3dd5da86a1b141eb432677907f6a34c96e5144ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7711/3dd5da86a1b141eb432677907f6a34c96e5144ef/fmi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10275,
12,
2890,
16,
508,
2218,
1488,
2187,
2907,
2218,
20,
11,
4672,
3536,
26492,
326,
938,
18,
3536,
791,
273,
365,
6315,
74,
9197,
780,
12,
529,
13,
9875,
273,
365,
6315,
74,
9197,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10275,
12,
2890,
16,
508,
2218,
1488,
2187,
2907,
2218,
20,
11,
4672,
3536,
26492,
326,
938,
18,
3536,
791,
273,
365,
6315,
74,
9197,
780,
12,
529,
13,
9875,
273,
365,
6315,
74,
9197,
... |
status = os.system(guava_bin_dir + "leon/wtdist " + input + "::code > " + output) | status = os.system(guava_bin_dir + "wtdist " + input + "::code > " + output) | def spectrum(self, method=None): r""" The default method (gap) uses a GAP kernel function (in C) written by Steve Linton. | 95a649f73ccf1026718989e9baf7742ec5ebd1ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/95a649f73ccf1026718989e9baf7742ec5ebd1ab/linear_code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17970,
12,
2890,
16,
707,
33,
7036,
4672,
436,
8395,
1021,
805,
707,
261,
14048,
13,
4692,
279,
611,
2203,
5536,
445,
261,
267,
385,
13,
5941,
635,
7780,
537,
511,
474,
265,
18,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17970,
12,
2890,
16,
707,
33,
7036,
4672,
436,
8395,
1021,
805,
707,
261,
14048,
13,
4692,
279,
611,
2203,
5536,
445,
261,
267,
385,
13,
5941,
635,
7780,
537,
511,
474,
265,
18,
2,
-... |
[(123, "a"), (456, "b")]) | [(123, "a"), (456, "b")], None) | def __init__(self): pass | 7514103f0069f231f572fbedb931da44a8fecdde /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/7514103f0069f231f572fbedb931da44a8fecdde/test_pyjitpl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
for folder in extract_folder_names(client.list_sub_folders()): | for folder in extract_normal_folders(client.list_sub_folders()): | def test_subscriptions(client): # Start with a clean slate clear_folders(client) for folder in extract_folder_names(client.list_sub_folders()): client.unsubscribe_folder(folder) test_folders = ['foobar', 'stuff & things', u'test & \u2622'] for folder in test_folders: client.create_folder(folder) all_folders = sorted(extract_folder_names(client.list_folders())) for folder in all_folders: client.subscribe_folder(folder) assert all_folders == sorted(extract_folder_names(client.list_sub_folders())) for folder in all_folders: client.unsubscribe_folder(folder) assert extract_folder_names(client.list_sub_folders()) == [] assert_raises(imapclient.IMAPClient.Error, client.subscribe_folder, 'this folder is not likely to exist') | 882c0fc011701dc48ddf39dc2b95c9d09d8fd22c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9352/882c0fc011701dc48ddf39dc2b95c9d09d8fd22c/livetest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
19964,
12,
2625,
4672,
468,
3603,
598,
279,
2721,
2020,
340,
2424,
67,
16064,
12,
2625,
13,
225,
364,
3009,
316,
2608,
67,
6130,
67,
16064,
12,
2625,
18,
1098,
67,
1717,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
19964,
12,
2625,
4672,
468,
3603,
598,
279,
2721,
2020,
340,
2424,
67,
16064,
12,
2625,
13,
225,
364,
3009,
316,
2608,
67,
6130,
67,
16064,
12,
2625,
18,
1098,
67,
1717,
67,
... |
os.fsync(file.fileno()) | os.fsync(fd) | def savemessage(self, uid, content, flags, rtime): # This function only ever saves to tmp/, # but it calls savemessageflags() to actually save to cur/ or new/. ui = UIBase.getglobalui() ui.debug('maildir', 'savemessage: called to write with flags %s and content %s' % \ (repr(flags), repr(content))) if uid < 0: # We cannot assign a new uid. return uid if uid in self.messagelist: # We already have it. self.savemessageflags(uid, flags) return uid | 6caaea36e03b9fd74b68ca43e7f4dec91f1ff7f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5335/6caaea36e03b9fd74b68ca43e7f4dec91f1ff7f9/Maildir.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4087,
351,
615,
12,
2890,
16,
4555,
16,
913,
16,
2943,
16,
436,
957,
4672,
468,
1220,
445,
1338,
14103,
14649,
358,
1853,
19,
16,
468,
1496,
518,
4097,
4087,
351,
615,
7133,
1435,
358,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4087,
351,
615,
12,
2890,
16,
4555,
16,
913,
16,
2943,
16,
436,
957,
4672,
468,
1220,
445,
1338,
14103,
14649,
358,
1853,
19,
16,
468,
1496,
518,
4097,
4087,
351,
615,
7133,
1435,
358,... |
boto.log.info('Method: %s' % method) boto.log.info('Path: %s' % path) boto.log.info('Data: %s' % data) boto.log.info('Headers: %s' % headers) boto.log.info('Host: %s' % host) | boto.log.debug('Method: %s' % method) boto.log.debug('Path: %s' % path) boto.log.debug('Data: %s' % data) boto.log.debug('Headers: %s' % headers) boto.log.debug('Host: %s' % host) | def _mexe(self, method, path, data, headers, host=None, sender=None): """ mexe - Multi-execute inside a loop, retrying multiple times to handle transient Internet errors by simply trying again. Also handles redirects. | bd4d38e5c3e2c6a146b1f0e8528d0fff3ecf566c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1098/bd4d38e5c3e2c6a146b1f0e8528d0fff3ecf566c/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
81,
14880,
12,
2890,
16,
707,
16,
589,
16,
501,
16,
1607,
16,
1479,
33,
7036,
16,
5793,
33,
7036,
4672,
3536,
312,
14880,
300,
5991,
17,
8837,
4832,
279,
2798,
16,
21081,
3229,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
81,
14880,
12,
2890,
16,
707,
16,
589,
16,
501,
16,
1607,
16,
1479,
33,
7036,
16,
5793,
33,
7036,
4672,
3536,
312,
14880,
300,
5991,
17,
8837,
4832,
279,
2798,
16,
21081,
3229,
... |
id = cameraGeom.Id("R:2,3 S:1,1 C:0,0", ix=0, iy=0) | """Pipeline test case.""" | def testPipe(self): id = cameraGeom.Id("R:2,3 S:1,1 C:0,0", ix=0, iy=0) clipboard = pexClipboard.Clipboard() clipboard.put("ampId", id) clipboard.put("cameraPolicy", self.cameraPolicy ) clipboard.put("Exposure", self.exposure) clipboard.put("fwhm", 5.) file = pexPolicy.DefaultPolicyFile("ip_pipeline", "MakeCameraGeomStageDictionary.paf", "policy") p1 = pexPolicy.Policy.createPolicy(file) s1 = ipPipe.MakeCameraStage(p1) t1 = SimpleStageTester(s1) file = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrSaturationStageDictionary.paf", "policy") p2 = pexPolicy.Policy.createPolicy(file) s2 = ipPipe.IsrSaturationStage(p2) t2 = SimpleStageTester(s2) file = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrOverscanStageDictionary.paf", "policy") p3 = pexPolicy.Policy.createPolicy(file) clipboard.put(p3.get("inputKeys.overscanfittype"), "MEDIAN") s3 = ipPipe.IsrOverscanStage(p3) t3 = SimpleStageTester(s3) file = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrBiasStageDictionary.paf", "policy") p4 = pexPolicy.Policy.createPolicy(file) s4 = ipPipe.IsrBiasStage(p4) t4 = SimpleStageTester(s4) file = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrDarkStageDictionary.paf", "policy") p5 = pexPolicy.Policy.createPolicy(file) s5 = ipPipe.IsrDarkStage(p5) t5 = SimpleStageTester(s5) bias = afwImage.ExposureF(self.biasfile) clipboard.put(p4.get("inputKeys.biasexposure"), bias) | ad7027ba56a8a82f8d09f2d890b33f54d3ea8847 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6525/ad7027ba56a8a82f8d09f2d890b33f54d3ea8847/isrPipelineUnitTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
11546,
12,
2890,
4672,
3536,
8798,
1842,
648,
12123,
225,
20304,
273,
293,
338,
15339,
3752,
18,
15339,
3752,
1435,
20304,
18,
458,
2932,
931,
548,
3113,
612,
13,
20304,
18,
458,
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,
1842,
11546,
12,
2890,
4672,
3536,
8798,
1842,
648,
12123,
225,
20304,
273,
293,
338,
15339,
3752,
18,
15339,
3752,
1435,
20304,
18,
458,
2932,
931,
548,
3113,
612,
13,
20304,
18,
458,
2... |
if bytes_recv >= 524288: if not rein_sent: self.client.sendcmd('user ' + USER) self.assertRaises(ftplib.error_perm, self.client.dir) rein_sent = 1 | def test_user_on_transfer(self): # Test USER while already authenticated and a transfer is # in progress. self.client.login(user=USER, passwd=PASSWD) data = 'abcde12345' * 100000 self.f1.write(data) self.f1.close() | 08be9d0ff55d04c1e20c062b48af2c54c427a77d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7236/08be9d0ff55d04c1e20c062b48af2c54c427a77d/test_ftpd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1355,
67,
265,
67,
13866,
12,
2890,
4672,
468,
7766,
7443,
1323,
1818,
9370,
471,
279,
7412,
353,
468,
316,
4007,
18,
365,
18,
2625,
18,
5819,
12,
1355,
33,
4714,
16,
19093,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1355,
67,
265,
67,
13866,
12,
2890,
4672,
468,
7766,
7443,
1323,
1818,
9370,
471,
279,
7412,
353,
468,
316,
4007,
18,
365,
18,
2625,
18,
5819,
12,
1355,
33,
4714,
16,
19093,
... | |
res2 = run_sql("DELETE FROM user WHERE id=%s" % userID) | res2 = run_sql("DELETE FROM user WHERE id=%s", (userID, )) | def perform_rejectaccount(req, userID, email_user_pattern, limit_to, maxpage, page, callback='yes', confirm=0): """Delete account and send an email to the owner.""" (auth_code, auth_message) = is_adminuser(req) if auth_code != 0: return mustloginpage(req, auth_message) res = run_sql("SELECT id, email, note FROM user WHERE id=%s" % userID) output = "" subtitle = "" if res: res2 = run_sql("DELETE FROM user WHERE id=%s" % userID) output += '<b><span class="info">Account rejected and deleted.</span></b>' if CFG_ACCESS_CONTROL_NOTIFY_USER_ABOUT_DELETION == 1: if not res[0][2] or res[0][2] == "0": emailsent = sendAccountRejectedMessage(res[0][1], res[0][1]) elif res[0][2] == "1": emailsent = sendAccountDeletedMessage(res[0][1], res[0][1]) if emailsent: output += """<br><b><span class="info">An email has been sent to the owner of the account.</span></b>""" else: output += """<br><b><span class="info">Could not send an email to the owner of the account.</span></b>""" else: output += '<b><span class="info">The account id given does not exist.</span></b>' body = [output] if callback: return perform_modifyaccounts(req, email_user_pattern, limit_to, maxpage, page, content=output, callback='yes') else: return addadminbox(subtitle, body) | 6ea5d72a403945bb48459d4ea7eed6856c3451fb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1931/6ea5d72a403945bb48459d4ea7eed6856c3451fb/webaccessadmin_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
24163,
4631,
12,
3658,
16,
16299,
16,
2699,
67,
1355,
67,
4951,
16,
1800,
67,
869,
16,
943,
2433,
16,
1363,
16,
1348,
2218,
9707,
2187,
6932,
33,
20,
4672,
3536,
2613,
2236,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
24163,
4631,
12,
3658,
16,
16299,
16,
2699,
67,
1355,
67,
4951,
16,
1800,
67,
869,
16,
943,
2433,
16,
1363,
16,
1348,
2218,
9707,
2187,
6932,
33,
20,
4672,
3536,
2613,
2236,
... |
'keywords': keywords or '', | 'keywords': kw or '', | def perform_query(self, req, query, changeset, tickets, wiki, page=0): if not query: return ([], 0) keywords = query.split(' ') | cd1b1b32cec26187b1c9fa71e55a76888f1c342e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/cd1b1b32cec26187b1c9fa71e55a76888f1c342e/Search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2271,
12,
2890,
16,
1111,
16,
843,
16,
22463,
16,
24475,
16,
9050,
16,
1363,
33,
20,
4672,
309,
486,
843,
30,
327,
23265,
6487,
374,
13,
7093,
273,
843,
18,
4939,
2668,
862... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2271,
12,
2890,
16,
1111,
16,
843,
16,
22463,
16,
24475,
16,
9050,
16,
1363,
33,
20,
4672,
309,
486,
843,
30,
327,
23265,
6487,
374,
13,
7093,
273,
843,
18,
4939,
2668,
862... |
self.sections.clear() | def delete(self, adminoverride = False): from esp.qsdmedia.models import Media anchor = self.anchor if self.num_students() > 0 and not adminoverride: return False teachers = self.teachers() for teacher in self.teachers(): self.removeTeacher(teacher) self.removeAdmin(teacher) | 2e24b87e2c110f15faa2a04785142f1f70154d13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/2e24b87e2c110f15faa2a04785142f1f70154d13/class_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
16,
3981,
10601,
273,
1083,
4672,
628,
5001,
84,
18,
85,
6427,
5829,
18,
7665,
1930,
6128,
225,
6984,
273,
365,
18,
16215,
309,
365,
18,
2107,
67,
16120,
4877,
1435,
40... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
16,
3981,
10601,
273,
1083,
4672,
628,
5001,
84,
18,
85,
6427,
5829,
18,
7665,
1930,
6128,
225,
6984,
273,
365,
18,
16215,
309,
365,
18,
2107,
67,
16120,
4877,
1435,
40... | |
attr = Option( type, optional default value) Order probably doesn't matter. The index of the instance made from this optional argument | attr = Option( type, optional default value) Order probably doesn't matter. The index of the instance made from this optional argument | def Option( type_expr, dflt_expr = _E_DFLT_FROM_TYPE_, **moreopts): """To declare a named optional argument in an expr class, use an assignment like this, directly in the class namespace, and (by convention only?) after all the Arg macros: attr = Option( type, optional default value) Order probably doesn't matter. The index of the instance made from this optional argument will be attr (the attribute name). If the default value is needed and not supplied, it comes from the type. """ global _E_ATTR # fyi argpos_expr = None attr_expr = _E_ATTR return _ArgOption_helper( attr_expr, argpos_expr, type_expr, dflt_expr, **moreopts) | d0ffa4ebc7f1e32fb807fce132593cfedae374b0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/d0ffa4ebc7f1e32fb807fce132593cfedae374b0/attr_decl_macros.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2698,
12,
618,
67,
8638,
16,
302,
31864,
67,
8638,
273,
389,
41,
67,
4577,
12050,
67,
11249,
67,
2399,
67,
16,
2826,
10161,
4952,
4672,
3536,
774,
14196,
279,
4141,
3129,
1237,
316,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2698,
12,
618,
67,
8638,
16,
302,
31864,
67,
8638,
273,
389,
41,
67,
4577,
12050,
67,
11249,
67,
2399,
67,
16,
2826,
10161,
4952,
4672,
3536,
774,
14196,
279,
4141,
3129,
1237,
316,
39... |
item.password.delete() | if hasattr(item, 'password'): item.password.delete() | def __ApplyDeletions(self): # Since we don't delete items right away, we need to do it here: | 473f35a08caa151e3ec9aca6ea5653d20585d0e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/473f35a08caa151e3ec9aca6ea5653d20585d0e0/AccountPreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
7001,
9019,
1115,
12,
2890,
4672,
468,
7897,
732,
2727,
1404,
1430,
1516,
2145,
10804,
16,
732,
1608,
358,
741,
518,
2674,
30,
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,
1001,
7001,
9019,
1115,
12,
2890,
4672,
468,
7897,
732,
2727,
1404,
1430,
1516,
2145,
10804,
16,
732,
1608,
358,
741,
518,
2674,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def fl_get_choice_item_mode(ob, item): """ fl_get_choice_item_mode(ob, item) -> mode num. """ retval = _fl_get_choice_item_mode(ob, item) return retval _fl_set_choice_item_mode = cfuncproto(so_libforms, "fl_set_choice_item_mode", None, [cty.POINTER(FL_OBJECT), cty.c_int, cty.c_uint], | def fl_get_choice_item_mode(pObject, item): """ fl_get_choice_item_mode(pObject, item) -> mode num. """ retval = _fl_get_choice_item_mode(pObject, item) return retval _fl_set_choice_item_mode = cfuncproto(so_libforms, "fl_set_choice_item_mode", None, [cty.POINTER(FL_OBJECT), cty.c_int, cty.c_uint], | def fl_get_choice_item_mode(ob, item): """ fl_get_choice_item_mode(ob, item) -> mode num. """ retval = _fl_get_choice_item_mode(ob, item) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11569,
67,
1726,
67,
3188,
12,
947,
16,
761,
4672,
3536,
1183,
67,
588,
67,
11569,
67,
1726,
67,
3188,
12,
947,
16,
761,
13,
317,
1965,
818,
18,
3536,
225,
5221,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11569,
67,
1726,
67,
3188,
12,
947,
16,
761,
4672,
3536,
1183,
67,
588,
67,
11569,
67,
1726,
67,
3188,
12,
947,
16,
761,
13,
317,
1965,
818,
18,
3536,
225,
5221,
... |
"""TList - Hierarchy display. | """TList - Hierarchy display widget which can be used to display data in a tabular format. The list entries of a TList widget are similar to the entries in the Tk listbox widget. The main differences are (1) the TList widget can display the list entries in a two dimensional format and (2) you can use graphical images as well as multiple colors and fonts for the list entries. | def invoke(self, name): if self.subwidget_list.has_key(name): self.tk.call(self._w, 'invoke', name) | f5d050d1e124f0e400f34e9a2a31237ae6ccf7e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f5d050d1e124f0e400f34e9a2a31237ae6ccf7e1/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
508,
4672,
309,
365,
18,
1717,
6587,
67,
1098,
18,
5332,
67,
856,
12,
529,
4672,
365,
18,
16099,
18,
1991,
12,
2890,
6315,
91,
16,
296,
14407,
2187,
508,
13,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4356,
12,
2890,
16,
508,
4672,
309,
365,
18,
1717,
6587,
67,
1098,
18,
5332,
67,
856,
12,
529,
4672,
365,
18,
16099,
18,
1991,
12,
2890,
6315,
91,
16,
296,
14407,
2187,
508,
13,
2,
... |
""" Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the python PID is used as identifier for the script[PID].py file.""" | ''' Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the python PID is used as identifier for the script[PID].py file. ''' | def execute_external_dynamics(self,nc=None,txt=None,stoppfile='stop',stopprogram=None): """ Implementation of the stay alive functionality with socket communication between dacapo and python. Known limitations: It is not possible to start 2 independent Dacapo calculators from the same python process, since the python PID is used as identifier for the script[PID].py file.""" from socket import socket,AF_INET,SOCK_STREAM,timeout import tempfile import os | 7e71a476e77343664c84904ceaeb03355477091f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5735/7e71a476e77343664c84904ceaeb03355477091f/jacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
9375,
67,
31129,
2102,
12,
2890,
16,
14202,
33,
7036,
16,
5830,
33,
7036,
16,
5681,
84,
768,
2218,
5681,
2187,
5681,
12890,
33,
7036,
4672,
9163,
25379,
434,
326,
23449,
13714,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
9375,
67,
31129,
2102,
12,
2890,
16,
14202,
33,
7036,
16,
5830,
33,
7036,
16,
5681,
84,
768,
2218,
5681,
2187,
5681,
12890,
33,
7036,
4672,
9163,
25379,
434,
326,
23449,
13714,... |
filePath = os.path.abspath(executableFile) cmd = filePath | cmd = os.path.abspath(executableFile) | def submitJob(self,executableFile,jdl,localID): """ Method to submit job, should be overridden in sub-class. """ if not os.access(executableFile, 5): os.chmod(executableFile,0755) filePath = os.path.abspath(executableFile) | 8c41511d01a2d8300e9d92e92578d9732367df7f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/8c41511d01a2d8300e9d92e92578d9732367df7f/InProcessComputingElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
2278,
12,
2890,
16,
17751,
812,
16,
78,
5761,
16,
3729,
734,
4672,
3536,
2985,
358,
4879,
1719,
16,
1410,
506,
11000,
316,
720,
17,
1106,
18,
3536,
309,
486,
1140,
18,
3860,
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,
4879,
2278,
12,
2890,
16,
17751,
812,
16,
78,
5761,
16,
3729,
734,
4672,
3536,
2985,
358,
4879,
1719,
16,
1410,
506,
11000,
316,
720,
17,
1106,
18,
3536,
309,
486,
1140,
18,
3860,
12,
... |
self.GL.acquire(locking.LEVEL_INSTANCE, ['i3']) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i3', 1)).start() self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.GL.release(locking.LEVEL_INSTANCE) self.assertEqual(self.done.get(True, 1), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i2'], shared=1) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 0)).start() self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.GL.release(locking.LEVEL_INSTANCE) self.assertEqual(self.done.get(True, 1), 'DONE') | self.GL.release(locking.LEVEL_CLUSTER, ['BGL']) | def testConcurrency(self): self.GL.acquire(locking.LEVEL_CLUSTER, ['BGL'], shared=1) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i3']) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i3', 1)).start() self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.GL.release(locking.LEVEL_INSTANCE) self.assertEqual(self.done.get(True, 1), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i2'], shared=1) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 0)).start() self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.GL.release(locking.LEVEL_INSTANCE) self.assertEqual(self.done.get(True, 1), 'DONE') | 4607c978b8f973b63c49547f1b8d6061fdbd78d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/4607c978b8f973b63c49547f1b8d6061fdbd78d3/ganeti.locking_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18273,
12,
2890,
4672,
365,
18,
11261,
18,
1077,
1039,
12,
739,
310,
18,
10398,
67,
5017,
23069,
16,
10228,
38,
11261,
17337,
5116,
33,
21,
13,
4884,
12,
3299,
33,
2890,
6315,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18273,
12,
2890,
4672,
365,
18,
11261,
18,
1077,
1039,
12,
739,
310,
18,
10398,
67,
5017,
23069,
16,
10228,
38,
11261,
17337,
5116,
33,
21,
13,
4884,
12,
3299,
33,
2890,
6315,
28... |
return attrdict, k | return attrdict, i | def parse_attributes(self, tag, k, j, attributes = None): rawdata = self.rawdata # Now parse the data between k and j into a tag and attrs attrdict = {} try: # convert attributes list to dictionary d = {} for a in attributes: d[a] = None attributes = d except TypeError: pass while k < j: res = attrfind.match(rawdata, k) if not res: break attrname, attrvalue = res.group('name', 'value') if attrvalue is None: self.syntax_error('no attribute value specified') attrvalue = attrname elif attrvalue[:1] == "'" == attrvalue[-1:] or \ attrvalue[:1] == '"' == attrvalue[-1:]: attrvalue = attrvalue[1:-1] else: self.syntax_error('attribute value not quoted') if attributes is not None and not attributes.has_key(attrname): self.syntax_error('unknown attribute %s of element %s' % (attrname, tag)) if attrdict.has_key(attrname): self.syntax_error('attribute specified twice') attrvalue = string.translate(attrvalue, attrtrans) attrdict[attrname] = self.translate_references(attrvalue) k = res.end(0) if attributes is not None: # fill in with default attributes for key, val in attributes.items(): if val is not None and not attrdict.has_key(key): attrdict[key] = val return attrdict, k | 66deea208f1331393577924315dda6e767e376e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66deea208f1331393577924315dda6e767e376e1/xmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4350,
12,
2890,
16,
1047,
16,
417,
16,
525,
16,
1677,
273,
599,
4672,
1831,
892,
273,
365,
18,
1899,
892,
468,
4494,
1109,
326,
501,
3086,
417,
471,
525,
1368,
279,
1047,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4350,
12,
2890,
16,
1047,
16,
417,
16,
525,
16,
1677,
273,
599,
4672,
1831,
892,
273,
365,
18,
1899,
892,
468,
4494,
1109,
326,
501,
3086,
417,
471,
525,
1368,
279,
1047,
4... |
while self.parser.openElements[:-1].name in ("tr", "html"): | while self.parser.openElements[-1].name in ("tr", "html"): | def clearStackToTableRowContext(self): while self.parser.openElements[:-1].name in ("tr", "html"): self.parser.openElements.pop() self.parser.parseError() | 2fb2cbabda22a54e217122e4450a295370d06019 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/2fb2cbabda22a54e217122e4450a295370d06019/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
2624,
774,
30650,
1042,
12,
2890,
4672,
1323,
365,
18,
4288,
18,
3190,
3471,
18919,
21,
8009,
529,
316,
7566,
313,
3113,
315,
2620,
6,
4672,
365,
18,
4288,
18,
3190,
3471,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
2624,
774,
30650,
1042,
12,
2890,
4672,
1323,
365,
18,
4288,
18,
3190,
3471,
18919,
21,
8009,
529,
316,
7566,
313,
3113,
315,
2620,
6,
4672,
365,
18,
4288,
18,
3190,
3471,
18,
51... |
message = 'The collectionId you were linked to, %s, does' \ | message = 'The collection_id you were linked to, %s, does' \ | def id(self, collectionId): # pylint: disable-msg=C0103 '''Return a page with information on a particular Collection ''' try: collectionId = int(collectionId) except ValueError: error = dict(status = False, title = self.app_title + ' -- Invalid Collection Id', message = 'The collectionId you were linked to is not a' \ ' valid id. If you received this error from a' \ ' link on the fedoraproject.org website, please' \ ' report it.') if request.params.get('tg_format', 'html') != 'json': error['tg_template'] = 'pkgdb.templates.errors' return error | d0ea7754e4b0eb9d223e9b48c71f42ad0c5ab68c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/d0ea7754e4b0eb9d223e9b48c71f42ad0c5ab68c/collections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
12,
2890,
16,
1849,
548,
4672,
468,
7601,
30,
4056,
17,
3576,
33,
39,
1611,
4630,
9163,
990,
279,
1363,
598,
1779,
603,
279,
6826,
2200,
9163,
775,
30,
1849,
548,
273,
509,
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,
612,
12,
2890,
16,
1849,
548,
4672,
468,
7601,
30,
4056,
17,
3576,
33,
39,
1611,
4630,
9163,
990,
279,
1363,
598,
1779,
603,
279,
6826,
2200,
9163,
775,
30,
1849,
548,
273,
509,
12,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.