rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
add_error_message(doc, _('Invalid options to CGI script.')) | doc.addError(_('Invalid options to CGI script.')) | def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) parts = Utils.GetPathPieces() lenparts = parts and len(parts) if not parts or lenparts < 1: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('Invalid options to CGI script.')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() return # get the list and user's name listname = parts[0].lower() # open list try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: # Avoid cross-site scripting attacks safelistname = cgi.escape(listname) title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('No such list <em>%(safelistname)s</em>')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() syslog('error', 'No such list "%s": %s\n', listname, e) return # The total contents of the user's response cgidata = cgi.FieldStorage(keep_blank_values=1) # Set the language for the page. If we're coming from the listinfo cgi, # we might have a 'language' key in the cgi data. That was an explicit # preference to view the page in, so we should honor that here. If that's # not available, use the list's default language. language = cgidata.getvalue('language', mlist.preferred_language) i18n.set_language(language) doc.set_language(language) if lenparts < 2: user = cgidata.getvalue('email') if not user: loginpage(mlist, doc, None, cgidata) print doc.Format() return else: user = Utils.LCDomain(Utils.UnobscureEmail(SLASH.join(parts[1:]))) # Sanity check the user, but be careful about leaking membership # information when we're using private rosters. if not mlist.isMember(user) and mlist.private_roster == 0: # Avoid cross-site scripting attacks safeuser = cgi.escape(user) add_error_message(doc, _('No such member: %(safeuser)s.')) loginpage(mlist, doc, None, cgidata) print doc.Format() return # Find the case preserved email address (the one the user subscribed with) lcuser = user.lower() try: cpuser = mlist.getMemberCPAddress(lcuser) except Errors.NotAMemberError: # This happens if the user isn't a member but we've got private rosters cpuser = None if lcuser == cpuser: cpuser = None # And now we know the user making the request, so set things up to for the # user's stored preferred language, overridden by any form settings for # their new language preference. userlang = cgidata.getvalue('language', mlist.getMemberLanguage(user)) doc.set_language(userlang) i18n.set_language(userlang) # See if this is VARHELP on topics. varhelp = None if cgidata.has_key('VARHELP'): varhelp = cgidata['VARHELP'].value elif os.environ.get('QUERY_STRING'): # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( qs = cgi.parse_qs(os.environ['QUERY_STRING']).get('VARHELP') if qs and type(qs) == types.ListType: varhelp = qs[0] if varhelp: topic_details(mlist, doc, user, cpuser, userlang, varhelp) return # Are we processing an unsubscription request from the login screen? if cgidata.has_key('login-unsub'): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. if mlist.isMember(user): mlist.ConfirmUnsubscription(user, userlang) else: syslog('mischief', 'Unsubscribe attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('The confirmation email has been sent.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Are we processing a password reminder from the login screen? if cgidata.has_key('login-remind'): if mlist.isMember(user): mlist.MailUserPassword(user) else: syslog('mischief', 'Reminder attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('A reminder of your password has been emailed to you.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Authenticate, possibly using the password supplied in the login page password = cgidata.getvalue('password', '').strip() if not mlist.WebAuthenticate((mm_cfg.AuthUser, mm_cfg.AuthListAdmin, mm_cfg.AuthSiteAdmin), password, user): # Not authenticated, so throw up the login page again. If they tried # to authenticate via cgi (instead of cookie), then print an error # message. if cgidata.has_key('password'): add_error_message(doc, _('Authentication failed.')) # So as not to allow membership leakage, prompt for the email # address and the password here. if mlist.private_roster <> 0: syslog('mischief', 'Login failure with private rosters: %s', user) user = None loginpage(mlist, doc, user, cgidata) print doc.Format() return # From here on out, the user is okay to view and modify their membership # options. The first set of checks does not require the list to be # locked. if cgidata.has_key('logout'): print mlist.ZapCookie(mm_cfg.AuthUser, user) loginpage(mlist, doc, user, cgidata) print doc.Format() return if cgidata.has_key('emailpw'): mlist.MailUserPassword(user) options_page( mlist, doc, user, cpuser, userlang, _('A reminder of your password has been emailed to you.')) print doc.Format() return if cgidata.has_key('othersubs'): hostname = mlist.host_name title = _('List subscriptions for %(user)s on %(hostname)s') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_('''Click on a link to visit your options page for the requested mailing list.''')) # Troll through all the mailing lists that match host_name and see if # the user is a member. If so, add it to the list. onlists = [] for gmlist in lists_of_member(mlist, user) + [mlist]: url = gmlist.GetOptionsURL(user) link = Link(url, gmlist.real_name) onlists.append((gmlist.real_name, link)) onlists.sort() items = OrderedList(*[link for name, link in onlists]) doc.AddItem(items) print doc.Format() return if cgidata.has_key('change-of-address'): # We could be changing the user's full name, email address, or both membername = cgidata.getvalue('fullname') newaddr = cgidata.getvalue('new-address') confirmaddr = cgidata.getvalue('confirm-address') oldname = mlist.getMemberName(user) set_address = set_membername = 0 # We will change the member's name under the following conditions: # - membername has a value # - membername has no value, but they /used/ to have a membername if membername and membername <> oldname: # Setting it to a new value set_membername = 1 if not membername and oldname: # Unsetting it set_membername = 1 # We will change the user's address if both newaddr and confirmaddr # are non-blank, have the same value, and aren't the currently # subscribed email address (when compared case-sensitively). If both # are blank, but membername is set, we ignore it, otherwise we print # an error. if newaddr and confirmaddr: if newaddr <> confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses did not match!')) print doc.Format() return if newaddr == user: options_page(mlist, doc, user, cpuser, userlang, _('You are already using that email address')) print doc.Format() return set_address = 1 elif (newaddr or confirmaddr) and not set_membername: options_page(mlist, doc, user, cpuser, userlang, _('Addresses may not be blank')) print doc.Format() return # See if the user wants to change their email address globally globally = cgidata.getvalue('changeaddr-globally') # Standard sigterm handler. def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) signal.signal(signal.SIGTERM, sigterm_handler) msg = '' if set_address: # Register the pending change after the list is locked msg = _('A confirmation message has been sent to %(newaddr)s') mlist.Lock() try: try: mlist.ChangeMemberAddress(user, newaddr, globally) mlist.Save() finally: mlist.Unlock() except Errors.MMBadEmailError: msg = _('Bad email address provided') except Errors.MMHostileAddress: msg = _('Illegal email address provided') except Errors.MMAlreadyAMember: msg = _('%(newaddr)s is already a member of the list.') if set_membername: mlist.Lock() try: mlist.ChangeMemberName(user, membername, globally) mlist.Save() finally: mlist.Unlock() msg += _('Member name successfully changed.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return if cgidata.has_key('changepw'): newpw = cgidata.getvalue('newpw') confirmpw = cgidata.getvalue('confpw') if not newpw or not confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords may not be blank')) print doc.Format() return if newpw <> confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords did not match!')) print doc.Format() return # See if the user wants to change their passwords globally mlists = [mlist] if cgidata.getvalue('pw-globally'): mlists.extend(lists_of_member(mlist, user)) for gmlist in mlists: change_password(gmlist, user, newpw, confirmpw) # Regenerate the cookie so a re-authorization isn't necessary print mlist.MakeCookie(mm_cfg.AuthUser, user) options_page(mlist, doc, user, cpuser, userlang, _('Password successfully changed.')) print doc.Format() return if cgidata.has_key('unsub'): # Was the confirming check box turned on? if not cgidata.getvalue('unsubconfirm'): options_page( mlist, doc, user, cpuser, userlang, _('''You must confirm your unsubscription request by turning on the checkbox below the <em>Unsubscribe</em> button. You have not been unsubscribed!''')) print doc.Format() return # Standard signal handler def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Okay, zap them. Leave them sitting at the list's listinfo page. We # must own the list lock, and we want to make sure the user (BAW: and # list admin?) is informed of the removal. signal.signal(signal.SIGTERM, sigterm_handler) mlist.Lock() needapproval = 0 try: try: mlist.DeleteMember( user, _('via the member options page'), userack=1) except Errors.MMNeedApproval: needapproval = 1 mlist.Save() finally: mlist.Unlock() # Now throw up some results page, with appropriate links. We can't # drop them back into their options page, because that's gone now! fqdn_listname = mlist.GetListEmail() owneraddr = mlist.GetOwnerEmail() url = mlist.GetScriptURL('listinfo', absolute=1) title = _('Unsubscription results') doc.SetTitle(title) doc.AddItem(Header(2, title)) if needapproval: doc.AddItem(_("""Your unsubscription request has been received and forwarded on to the list moderators for approval. You will receive notification once the list moderators have made their decision.""")) else: doc.AddItem(_("""You have been successfully unsubscribed from the mailing list %(fqdn_listname)s. If you were receiving digest deliveries you may get one more digest. If you have any questions about your unsubscription, please contact the list owners at %(owneraddr)s.""")) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format() return if cgidata.has_key('options-submit'): # Digest action flags digestwarn = 0 cantdigest = 0 mustdigest = 0 newvals = [] # First figure out which options have changed. The item names come # from FormatOptionButton() in HTMLFormatter.py for item, flag in (('digest', mm_cfg.Digests), ('mime', mm_cfg.DisableMime), ('dontreceive', mm_cfg.DontReceiveOwnPosts), ('ackposts', mm_cfg.AcknowledgePosts), ('disablemail', mm_cfg.DisableDelivery), ('conceal', mm_cfg.ConcealSubscription), ('remind', mm_cfg.SuppressPasswordReminder), ('rcvtopic', mm_cfg.ReceiveNonmatchingTopics), ): try: newval = int(cgidata.getvalue(item)) except (TypeError, ValueError): newval = None # Skip this option if there was a problem or it wasn't changed. # Note that delivery status is handled separate from the options # flags. if newval is None: continue elif flag == mm_cfg.DisableDelivery: status = mlist.getDeliveryStatus(user) # Here, newval == 0 means enable, newval == 1 means disable if not newval and status <> MemberAdaptor.ENABLED: newval = MemberAdaptor.ENABLED elif newval and status == MemberAdaptor.ENABLED: newval = MemberAdaptor.BYUSER else: continue elif newval == mlist.getMemberOption(user, flag): continue newvals.append((flag, newval)) # The user language is handled a little differently if userlang not in mlist.GetAvailableLanguages(): newvals.append((SETLANGUAGE, mlist.preferred_language)) else: newvals.append((SETLANGUAGE, userlang)) # Process user selected topics, but don't make the changes to the # MailList object; we must do that down below when the list is # locked. topicnames = cgidata.getvalue('usertopic') if topicnames: # Some topics were selected. topicnames can actually be a string # or a list of strings depending on whether more than one topic # was selected or not. if not isinstance(topicnames, ListType): # Assume it was a bare string, so listify it topicnames = [topicnames] # unquote the topic names topicnames = [urllib.unquote_plus(n) for n in topicnames] # The standard sigterm handler (see above) def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Now, lock the list and perform the changes mlist.Lock() try: signal.signal(signal.SIGTERM, sigterm_handler) # `values' is a tuple of flags and the web values for flag, newval in newvals: # Handle language settings differently if flag == SETLANGUAGE: mlist.setMemberLanguage(user, newval) # Handle delivery status separately elif flag == mm_cfg.DisableDelivery: mlist.setDeliveryStatus(user, newval) else: mlist.setMemberOption(user, flag, newval) # Set the topics information. mlist.setMemberTopics(user, topicnames) mlist.Save() finally: mlist.Unlock() # The enable/disable option and the password remind option may have # their global flags sets. global_enable = None if cgidata.getvalue('deliver-globally'): # Yes, this is inefficient, but the list is so small it shouldn't # make much of a difference. for flag, newval in newvals: if flag == mm_cfg.DisableDelivery: global_enable = newval break global_remind = None if cgidata.getvalue('remind-globally'): for flag, newval in newvals: if flag == mm_cfg.SuppressPasswordReminder: global_remind = newval break if global_enable is not None or global_remind is not None: for gmlist in lists_of_member(mlist, user): global_options(gmlist, user, global_enable, global_remind) # Now print the results if cantdigest: msg = _('''The list administrator has disabled digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') elif mustdigest: msg = _('''The list administrator has disabled non-digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') else: msg = _('You have successfully set your options.') if digestwarn: msg += _('You may get one last digest.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return options_page(mlist, doc, user, cpuser, userlang) print doc.Format() | 1b0a7186ef948b504ed35356bdee74957c65566d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/1b0a7186ef948b504ed35356bdee74957c65566d/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
562,
6019,
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,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
562,
6019,
273,... |
con = sqlite.connect(":memory:") cur = con.cursor() | cur = self.con.cursor() | def CheckPragmaAutocommit(self): """ Verifies that running a PRAGMA statement that does an autocommit does work. This did not work in 2.5.3/2.5.4. """ con = sqlite.connect(":memory:") cur = con.cursor() cur.execute("create table foo(bar)") cur.execute("insert into foo(bar) values (5)") | 6e055d78e16c0af28a35fbad53b99d8be59e1ea3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/6e055d78e16c0af28a35fbad53b99d8be59e1ea3/regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
2050,
9454,
7150,
27159,
12,
2890,
4672,
3536,
6160,
5032,
716,
3549,
279,
11770,
1781,
5535,
3021,
716,
1552,
392,
2059,
27159,
1552,
1440,
18,
1220,
5061,
486,
1440,
316,
576,
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,
2073,
2050,
9454,
7150,
27159,
12,
2890,
4672,
3536,
6160,
5032,
716,
3549,
279,
11770,
1781,
5535,
3021,
716,
1552,
392,
2059,
27159,
1552,
1440,
18,
1220,
5061,
486,
1440,
316,
576,
18,
... |
If mode >= 0, the frontPart geometry is placed in the 'fixed' | If mode > 0, the frontPart geometry is placed in the 'fixed' | def drawInFront(self, frontPartName, backPartName, mode, root=None, lodName=None): """drawInFront(self, string, int, string=None, key=None) | e133fae4373b335b8a846b9d1fcd4c39ab9ec7f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/e133fae4373b335b8a846b9d1fcd4c39ab9ec7f4/Actor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
382,
9580,
12,
2890,
16,
6641,
1988,
461,
16,
1473,
1988,
461,
16,
1965,
16,
1365,
33,
7036,
16,
328,
369,
461,
33,
7036,
4672,
3536,
9446,
382,
9580,
12,
2890,
16,
533,
16,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
382,
9580,
12,
2890,
16,
6641,
1988,
461,
16,
1473,
1988,
461,
16,
1965,
16,
1365,
33,
7036,
16,
328,
369,
461,
33,
7036,
4672,
3536,
9446,
382,
9580,
12,
2890,
16,
533,
16,
50... |
kw['dbName'] = field.strip() | kw['dbName'] = field | def columnsFromSchema(self, tableName, soClass): """ Look at the given table and create Col instances (or subclasses of Col) for the fields it finds in that table. """ | bbbe7c0d337ab5bb0da6c3945d8cd21fc6705490 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8798/bbbe7c0d337ab5bb0da6c3945d8cd21fc6705490/firebirdconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2168,
1265,
3078,
12,
2890,
16,
4775,
16,
1427,
797,
4672,
3536,
10176,
622,
326,
864,
1014,
471,
752,
1558,
3884,
261,
280,
15320,
434,
1558,
13,
364,
326,
1466,
518,
13094,
316,
716,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2168,
1265,
3078,
12,
2890,
16,
4775,
16,
1427,
797,
4672,
3536,
10176,
622,
326,
864,
1014,
471,
752,
1558,
3884,
261,
280,
15320,
434,
1558,
13,
364,
326,
1466,
518,
13094,
316,
716,
... |
import mdiff | def blocks(a, b): an = mdiff.splitnewlines(a) bn = mdiff.splitnewlines(b) d = difflib.SequenceMatcher(None, an, bn).get_matching_blocks() d = _normalizeblocks(an, bn, d) return [(i, i + n, j, j + n) for (i, j, n) in d] | 7613af0bfcba92ebe270913fc8072e6cf3b2a146 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/7613af0bfcba92ebe270913fc8072e6cf3b2a146/bdiff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4398,
12,
69,
16,
324,
4672,
392,
273,
3481,
3048,
18,
4939,
31276,
12,
69,
13,
18254,
273,
3481,
3048,
18,
4939,
31276,
12,
70,
13,
302,
273,
1901,
12678,
18,
4021,
6286,
12,
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,
4398,
12,
69,
16,
324,
4672,
392,
273,
3481,
3048,
18,
4939,
31276,
12,
69,
13,
18254,
273,
3481,
3048,
18,
4939,
31276,
12,
70,
13,
302,
273,
1901,
12678,
18,
4021,
6286,
12,
7036,
... | |
category=DeprecationWarning) | category=DeprecationWarning, stacklevel=2) | def new_func(*args, **kwargs): warnings.warn("Call to deprecated function %s." % func.__name__, category=DeprecationWarning) return func(*args, **kwargs) | f6cf34e30b3576000aa52411c113527304a94e68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/f6cf34e30b3576000aa52411c113527304a94e68/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
644,
30857,
1968,
16,
2826,
4333,
4672,
5599,
18,
8935,
2932,
1477,
358,
6849,
445,
738,
87,
1199,
738,
1326,
16186,
529,
972,
16,
3150,
33,
758,
13643,
6210,
16,
26847,
33,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
644,
30857,
1968,
16,
2826,
4333,
4672,
5599,
18,
8935,
2932,
1477,
358,
6849,
445,
738,
87,
1199,
738,
1326,
16186,
529,
972,
16,
3150,
33,
758,
13643,
6210,
16,
26847,
33,
2... |
sourcefile.write(' int len = 0;\n') | sourcefile.write(' int len;\n') | headerfile.write('#ifndef XDR_DECODE\n') | 750a27e78aefa8bd56a04cfb45dea1d3bec3307d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3566/750a27e78aefa8bd56a04cfb45dea1d3bec3307d/parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1446,
768,
18,
2626,
2668,
7,
430,
82,
536,
1139,
6331,
67,
1639,
5572,
64,
82,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1446,
768,
18,
2626,
2668,
7,
430,
82,
536,
1139,
6331,
67,
1639,
5572,
64,
82,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assert test.run( local=1 ) == test.expected_result() | assert test.run( local=0 ) == test.expected_result() | def expected_result( self ): """ Precalculated result to check for consistent performance. | 89f83a1e05ec50c4d02162b365a74970175bef3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/89f83a1e05ec50c4d02162b365a74970175bef3c/ComplexRandomizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2665,
67,
2088,
12,
365,
262,
30,
3536,
2962,
22113,
563,
358,
866,
364,
11071,
9239,
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,
... | [
1,
1,
1,
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,
2665,
67,
2088,
12,
365,
262,
30,
3536,
2962,
22113,
563,
358,
866,
364,
11071,
9239,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print " Set", k, v, sheet | def setMemberProperties(self, mapping, force_local = 0): # Sets the properties given in the MemberDataTool. tool = self.getTool() print "setMemberProperties" # we could pay attention to force_local here... if IPluggableAuthService.isImplementedBy(self.acl_users): user = self.getUser() sheets = getattr(user, 'getOrderedPropertySheets', lambda: None)() print " PAS present. user is:", user.__class__ # we won't always have PlonePAS users, due to acquisition, nor are guaranteed property sheets if sheets: print " sheets present" # -- # xxx track values set to defer to default impl # property routing for k,v in mapping.items(): for sheet in sheets: print " looking at", k, "=", v, "on", sheet #import pdb; pdb.set_trace() if sheet.hasProperty(k): print ' hasProperty', k, 'sheet', sheet if IMutablePropertySheet.isImplementedBy(sheet): sheet.setProperty( k, v ) print " Set", k, v, sheet else: raise RuntimeError("mutable property provider shadowed by read only provider") self.notifyModified() return print " PAS fails, using MemberData" # defer to base impl in absence of PAS, a PAS user, or property sheets return BaseMemberData.setMemberProperties(self, mapping, force_local) | 90f3ba5c455c21bca62a60a26a661ef024c55991 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12230/90f3ba5c455c21bca62a60a26a661ef024c55991/memberdata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4419,
2297,
12,
2890,
16,
2874,
16,
2944,
67,
3729,
273,
374,
4672,
468,
11511,
326,
1790,
864,
316,
326,
8596,
751,
6364,
18,
5226,
273,
365,
18,
588,
6364,
1435,
1172,
315,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4419,
2297,
12,
2890,
16,
2874,
16,
2944,
67,
3729,
273,
374,
4672,
468,
11511,
326,
1790,
864,
316,
326,
8596,
751,
6364,
18,
5226,
273,
365,
18,
588,
6364,
1435,
1172,
315,
542,... | |
name = AvailableRNGs()[0] | name = ModuleInfo()['availableRNGs'][0] | def testSeed(self): 'Testing RNG::seed() and RNG::setSeed()' import random seed = [] name = AvailableRNGs()[0] for i in range(100): SetRNG(name) sd = GetRNG().seed() self.assertFalse(sd in seed) seed.append(sd) # test set seed sd = random.randint(100, 10000) SetRNG(name, sd) self.assertEqual(GetRNG().seed(), sd) # test if sequences are the same once the seed is set sd = random.randint(100, 10000) SetRNG(name, sd) seq = [GetRNG().randInt(10000) for x in range(100)] SetRNG(name, sd) seq1 = [GetRNG().randInt(10000) for x in range(100)] self.assertEqual(seq, seq1) # randBit need to be treated separately because it uses # global variable of RNG(). sd = random.randint(100, 10000) SetRNG(name, sd) seq = [GetRNG().randBit() for x in range(100)] SetRNG(name, sd) seq1 = [GetRNG().randBit() for x in range(100)] self.assertEqual(seq, seq1) | 6f488c0cd54f00878cc0f2a25ad46d16995db127 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/401/6f488c0cd54f00878cc0f2a25ad46d16995db127/test_19_utility.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12702,
12,
2890,
4672,
296,
22218,
534,
4960,
2866,
12407,
1435,
471,
534,
4960,
2866,
542,
12702,
11866,
1930,
2744,
5009,
273,
5378,
508,
273,
5924,
966,
1435,
3292,
5699,
54,
4960... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12702,
12,
2890,
4672,
296,
22218,
534,
4960,
2866,
12407,
1435,
471,
534,
4960,
2866,
542,
12702,
11866,
1930,
2744,
5009,
273,
5378,
508,
273,
5924,
966,
1435,
3292,
5699,
54,
4960... |
('Electrostatics For Dna During Minimize', 'boolean', electrostaticsForDnaDuringMinimize_prefs_key, True), ('Electrostatics For Dna During Simulation', 'boolean', electrostaticsForDnaDuringDynamics_prefs_key, True), | ('Electrostatics For Dna During Minimize', 'boolean', electrostaticsForDnaDuringMinimize_prefs_key, True), ('Electrostatics For Dna During Simulation', 'boolean', electrostaticsForDnaDuringDynamics_prefs_key, True), ('', 'boolean', neighborSearchingInGromacs_prefs_key, True), | def getDefaultWorkingDirectory(): """ Get the default Working Directory. @return: The default working directory, which is platform dependent: - Windows: $HOME\My Documents - MacOS and Linux: $HOME If the default working directory doesn't exist, return ".". @rtype: string """ wd = "" if sys.platform == 'win32': # Windows # e.g. "C:\Documents and Settings\Mark\My Documents" wd = os.path.normpath(os.path.expanduser("~/My Documents")) # Check <wd> since some Windows OSes (i.e. Win95) may not have "~\My Documents". if not os.path.isdir(wd): wd = os.path.normpath(os.path.expanduser("~")) else: # Linux and MacOS # e.g. "/usr/mark" wd = os.path.normpath(os.path.expanduser("~")) if os.path.isdir(wd): return wd else: print "getDefaultWorkingDirectory(): default working directory [", \ wd , "] does not exist. Setting default working directory to [.]" return "." | f9fc23ff75d12ace400b3d03264908b482583cb1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/f9fc23ff75d12ace400b3d03264908b482583cb1/prefs_constants.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4829,
14836,
2853,
13332,
3536,
968,
326,
805,
22732,
8930,
18,
225,
632,
2463,
30,
1021,
805,
5960,
1867,
16,
1492,
353,
4072,
10460,
30,
300,
8202,
30,
271,
14209,
64,
12062,
4319,
87,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4829,
14836,
2853,
13332,
3536,
968,
326,
805,
22732,
8930,
18,
225,
632,
2463,
30,
1021,
805,
5960,
1867,
16,
1492,
353,
4072,
10460,
30,
300,
8202,
30,
271,
14209,
64,
12062,
4319,
87,... |
self.assert_(not os.path.isdir(result['path'])) | path = result['path'] self.assert_(not os.path.isdir(path), \ "%s is a directory" % path) results += 1 self.assert_(results > 0) | def test_walk_files(self): """Unit test for walk.files""" import Cleaner if 'posix' == os.name: path = '/usr/var/log' elif 'nt' == os.name: path = '$WINDIR\\system32' action_str = '<action command="delete" search="walk.files" path="%s" />' % path for cmd in self._action_str_to_commands(action_str): result = cmd.execute(False) Cleaner.TestCleaner.validate_result(self, result) self.assert_(not os.path.isdir(result['path'])) | 0b04c114276cb44971f600e6e5f3c1bb2c55c135 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/0b04c114276cb44971f600e6e5f3c1bb2c55c135/Action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11348,
67,
2354,
12,
2890,
4672,
3536,
2802,
1842,
364,
5442,
18,
2354,
8395,
1930,
9645,
264,
309,
296,
24463,
11,
422,
1140,
18,
529,
30,
589,
273,
1173,
13640,
19,
1401,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11348,
67,
2354,
12,
2890,
4672,
3536,
2802,
1842,
364,
5442,
18,
2354,
8395,
1930,
9645,
264,
309,
296,
24463,
11,
422,
1140,
18,
529,
30,
589,
273,
1173,
13640,
19,
1401,
1... |
Returns a list of edges (u,v,l) with u in vertices1 and v in vertices2. If vertices2 is None, then it is set to the complement of vertices1. In a digraph, the external boundary of a vertex v are those vertices u with an arc (v, u). | Returns a list of edges `(u,v,l)` with `u` in ``vertices1`` and `v` in ``vertices2``. If ``vertices2`` is ``None``, then it is set to the complement of ``vertices1``. In a digraph, the external boundary of a vertex `v` are those vertices `u` with an arc `(v, u)`. | def edge_boundary(self, vertices1, vertices2=None, labels=True): """ Returns a list of edges (u,v,l) with u in vertices1 and v in vertices2. If vertices2 is None, then it is set to the complement of vertices1. | abc7c82c21e5482072ca507c6b1b4c8cb722723e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/abc7c82c21e5482072ca507c6b1b4c8cb722723e/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
16604,
12,
2890,
16,
6928,
21,
16,
6928,
22,
33,
7036,
16,
3249,
33,
5510,
4672,
3536,
2860,
279,
666,
434,
5231,
261,
89,
16,
90,
16,
80,
13,
598,
582,
316,
6928,
21,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
16604,
12,
2890,
16,
6928,
21,
16,
6928,
22,
33,
7036,
16,
3249,
33,
5510,
4672,
3536,
2860,
279,
666,
434,
5231,
261,
89,
16,
90,
16,
80,
13,
598,
582,
316,
6928,
21,
47... |
node.parent = self | self.setup_child(node) | def __iadd__(self, other): """Append a node or a list of nodes to `self.children`.""" if isinstance(other, Node): other.parent = self self.children.append(other) elif other is not None: for node in other: node.parent = self self.children.extend(other) return self | 15f0677b9e2a7853acb68d231866daa3c3d2a8f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/15f0677b9e2a7853acb68d231866daa3c3d2a8f4/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
77,
1289,
972,
12,
2890,
16,
1308,
4672,
3536,
5736,
279,
756,
578,
279,
666,
434,
2199,
358,
1375,
2890,
18,
5906,
68,
12123,
309,
1549,
12,
3011,
16,
2029,
4672,
1308,
18,
2938... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
77,
1289,
972,
12,
2890,
16,
1308,
4672,
3536,
5736,
279,
756,
578,
279,
666,
434,
2199,
358,
1375,
2890,
18,
5906,
68,
12123,
309,
1549,
12,
3011,
16,
2029,
4672,
1308,
18,
2938... |
req.redirect(self.env.href.wiki(pagename, version, action='diff')) | req.redirect(self.env.href.wiki(pagename, version=version, action='diff')) | def _render_diff(self, req, pagename, version): # Stores the diff-style in the session if it has been changed, and adds # diff-style related item to the HDF self.perm.assert_permission(perm.WIKI_VIEW) | 9f54a79e1a283bb0c37d378445f9b54f000c392e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/9f54a79e1a283bb0c37d378445f9b54f000c392e/Wiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
5413,
12,
2890,
16,
1111,
16,
4262,
1069,
16,
1177,
4672,
468,
20296,
455,
326,
3122,
17,
4060,
316,
326,
1339,
309,
518,
711,
2118,
3550,
16,
471,
4831,
468,
3122,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
5413,
12,
2890,
16,
1111,
16,
4262,
1069,
16,
1177,
4672,
468,
20296,
455,
326,
3122,
17,
4060,
316,
326,
1339,
309,
518,
711,
2118,
3550,
16,
471,
4831,
468,
3122,
17,
... |
if mode == 1: | if whence == 1: | def seek(self, pos, mode = 0): """Seek to specified position into the chunk. Default position is 0 (start of chunk). If the file is not seekable, this will result in an error. | 4189f986fb2e64e2e0dddd0a9c4435c7892c94b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4189f986fb2e64e2e0dddd0a9c4435c7892c94b6/chunk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
949,
16,
1965,
273,
374,
4672,
3536,
16134,
358,
1269,
1754,
1368,
326,
2441,
18,
2989,
1754,
353,
374,
261,
1937,
434,
2441,
2934,
971,
326,
585,
353,
486,
6520,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
949,
16,
1965,
273,
374,
4672,
3536,
16134,
358,
1269,
1754,
1368,
326,
2441,
18,
2989,
1754,
353,
374,
261,
1937,
434,
2441,
2934,
971,
326,
585,
353,
486,
6520,
4... |
env = dict(conf.environ) | env = dict(os.environ) | def find_msvc(conf): # due to path format limitations, limit operation only to native Win32. Yeah it sucks. if sys.platform != 'win32': conf.fatal('MSVC module only works under native Win32 Python! cygwin is not supported yet') v = conf.env compiler = v['MSVC_COMPILER'] or 'msvc' path = v['PATH'] if compiler=='msvc': compiler_name = 'CL' linker_name = 'LINK' lib_name = 'LIB' else: compiler_name = 'ICL' linker_name = 'XILINK' lib_name = 'XILIB' # compiler cxx = None if v['CXX']: cxx = v['CXX'] elif 'CXX' in conf.environ: cxx = conf.environ['CXX'] if not cxx: cxx = conf.find_program(compiler_name, var='CXX', path_list=path) if not cxx: conf.fatal('%s was not found (compiler)' % compiler_name) cxx = conf.cmd_to_list(cxx) # before setting anything, check if the compiler is really msvc env = dict(conf.environ) env.update(PATH = ';'.join(path)) if not Utils.cmd_output([cxx, '/nologo', '/?'], silent=True, env=env): conf.fatal('the msvc compiler could not be identified') # c/c++ compiler v['CC'] = v['CXX'] = cxx v['CC_NAME'] = v['CXX_NAME'] = 'msvc' # environment flags v.prepend_value('CPPPATH', conf.environ['INCLUDE']) v.prepend_value('LIBPATH', conf.environ['LIB']) # linker if not v['LINK_CXX']: link = conf.find_program(linker_name, path_list=path) if link: v['LINK_CXX'] = link else: conf.fatal('%s was not found (linker)' % linker_name) v['LINK'] = link if not v['LINK_CC']: v['LINK_CC'] = v['LINK_CXX'] # staticlib linker if not v['STLIBLINK']: stliblink = conf.find_program(lib_name, path_list=path) if not stliblink: return v['STLIBLINK'] = stliblink v['STLINKFLAGS'] = ['/NOLOGO'] # manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later manifesttool = conf.find_program('MT', path_list=path) if manifesttool: v['MT'] = manifesttool v['MTFLAGS'] = ['/NOLOGO'] conf.check_tool('winres') if not conf.env['WINRC']: warn('Resource compiler not found. Compiling resource file is disabled') | ec4bfaec0f2ea9e6b7e203e2cbde2de37419f6cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7302/ec4bfaec0f2ea9e6b7e203e2cbde2de37419f6cd/msvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
959,
4227,
12,
3923,
4672,
468,
6541,
358,
589,
740,
31810,
16,
1800,
1674,
1338,
358,
6448,
21628,
1578,
18,
1624,
73,
9795,
518,
1597,
363,
87,
18,
309,
2589,
18,
9898,
480... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
959,
4227,
12,
3923,
4672,
468,
6541,
358,
589,
740,
31810,
16,
1800,
1674,
1338,
358,
6448,
21628,
1578,
18,
1624,
73,
9795,
518,
1597,
363,
87,
18,
309,
2589,
18,
9898,
480... |
def reset_occupancies(fmodels, selection, occ_min, occ_max, set_min, set_max): | def reset_occupancies(fmodels, selection, params): | def reset_occupancies(fmodels, selection, occ_min, occ_max, set_min, set_max): xrs = fmodels.fmodel_xray().xray_structure occ = xrs.scatterers().extract_occupancies() sel = occ < occ_min sel &= selection occ = occ.set_selected(sel, set_min) sel = occ > occ_max sel &= selection occ = occ.set_selected(sel, set_max) xrs.set_occupancies(occ) fmodels.update_xray_structure(xray_structure = xrs, update_f_calc=True, update_f_mask=False) | c83e5aaf0a98a33f9afd742b631944b224553620 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/c83e5aaf0a98a33f9afd742b631944b224553620/grow_density.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
67,
25049,
416,
304,
13689,
12,
74,
7665,
16,
4421,
16,
859,
4672,
619,
5453,
273,
284,
7665,
18,
74,
2284,
67,
92,
435,
7675,
92,
435,
67,
7627,
9145,
273,
619,
5453,
18,
3132... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
67,
25049,
416,
304,
13689,
12,
74,
7665,
16,
4421,
16,
859,
4672,
619,
5453,
273,
284,
7665,
18,
74,
2284,
67,
92,
435,
7675,
92,
435,
67,
7627,
9145,
273,
619,
5453,
18,
3132... |
d = (np.dot(q.reshape(-1), self.Ho)).reshape(-1,3) | d = (q.reshape(-1)* self.Ho).reshape(-1,3) | def update(self, r, f, r_old, f_old): a = np.zeros(self.memory + 1, 'd') self.tmp = self.atoms if not self.ITR: self.ITR = 1 self.s = [1.] # The 0'th element is not actually used # The point is to use 1-indexation self.y = [1.] self.rho = [1.] else: a1 = abs (np.vdot(f, f_old)) a2 = np.vdot(f_old, f_old) reset_flag = self.check_for_reset(a1, a2) if not reset_flag: ITR = self.ITR if(ITR > self.memory): self.s.pop(1) self.y.pop(1) self.rho.pop(1) ITR = self.memory self.s.append(r - r_old) self.y.append(-(f - f_old)) self.rho.append(1 / np.vdot(self.y[ITR],self.s[ITR])) self.ITR += 1 else: self.ITR = 1 self.s = [1.] self.y = [1.] self.rho = [1.] self.dump((self.ITR, self.s, self.y, self.rho, r_old, f_old)) r_old = r.copy() f_old = f.copy() if self.ITR <= self.memory: BOUND = self.ITR else: BOUND = self.memory q = -1.0 * f for j in range(1,BOUND): k = (BOUND - j) a[k] = self.rho[k] * np.vdot(self.s[k], q) q -= a[k] * self.y[k] d = (np.dot(q.reshape(-1), self.Ho)).reshape(-1,3) #d = self.Ho * q for j in range(1,BOUND): B = self.rho[j] * np.vdot(self.y[j], d) d = d + self.s[j] * (a[j] - B) self.d = -1.0 * d | bc3efb9267548f28c85bf11e1c0f7d7bcda39eea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/bc3efb9267548f28c85bf11e1c0f7d7bcda39eea/lbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
436,
16,
284,
16,
436,
67,
1673,
16,
284,
67,
1673,
4672,
279,
273,
1130,
18,
22008,
12,
2890,
18,
7858,
397,
404,
16,
296,
72,
6134,
365,
18,
5645,
273,
365,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
436,
16,
284,
16,
436,
67,
1673,
16,
284,
67,
1673,
4672,
279,
273,
1130,
18,
22008,
12,
2890,
18,
7858,
397,
404,
16,
296,
72,
6134,
365,
18,
5645,
273,
365,
1... |
self.reasons[r] = [] | self.reasons.setdefault(r, []) | def on_import(self, env, node): #print 'NEW NODE', node, id(node) assert node not in self.active_nodes self.active_nodes.add(node) | 4ee753811d1b035ebd9f0fe712a2d5a2e9771c55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/4ee753811d1b035ebd9f0fe712a2d5a2e9771c55/debugmode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
5666,
12,
2890,
16,
1550,
16,
756,
4672,
468,
1188,
296,
12917,
11922,
2187,
756,
16,
612,
12,
2159,
13,
1815,
756,
486,
316,
365,
18,
3535,
67,
4690,
365,
18,
3535,
67,
469... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
5666,
12,
2890,
16,
1550,
16,
756,
4672,
468,
1188,
296,
12917,
11922,
2187,
756,
16,
612,
12,
2159,
13,
1815,
756,
486,
316,
365,
18,
3535,
67,
4690,
365,
18,
3535,
67,
469... |
labelEmail.grid(row=6,column=0,columnspan=2,sticky=W,padx=10,pady=0) | labelEmail.grid(row=6, column=0, columnspan=2, sticky=W, padx=10, pady=0) | def CreateWidgets(self): frameMain = Frame(self, borderwidth=2, relief=SUNKEN) frameButtons = Frame(self) frameButtons.pack(side=BOTTOM, fill=X) frameMain.pack(side=TOP, expand=TRUE, fill=BOTH) self.buttonOk = Button(frameButtons, text='Close', command=self.Ok) self.buttonOk.pack(padx=5, pady=5) #self.picture = Image('photo', data=self.pictureData) frameBg = Frame(frameMain, bg=self.bg) frameBg.pack(expand=TRUE, fill=BOTH) labelTitle = Label(frameBg, text='IDLE', fg=self.fg, bg=self.bg, font=('courier', 24, 'bold')) labelTitle.grid(row=0, column=0, sticky=W, padx=10, pady=10) #labelPicture = Label(frameBg, text='[picture]') #image=self.picture, bg=self.bg) #labelPicture.grid(row=1, column=1, sticky=W, rowspan=2, # padx=0, pady=3) byline = "Python's Integrated DeveLopment Environment" + 5*'\n' labelDesc = Label(frameBg, text=byline, justify=LEFT, fg=self.fg, bg=self.bg) labelDesc.grid(row=2, column=0, sticky=W, columnspan=3, padx=10, pady=5) labelEmail = Label(frameBg, text='email: idle-dev@python.org', justify=LEFT, fg=self.fg, bg=self.bg) labelEmail.grid(row=6,column=0,columnspan=2,sticky=W,padx=10,pady=0) labelWWW = Label(frameBg, text='www: http://www.python.org/idle/', justify=LEFT, fg=self.fg, bg=self.bg) labelWWW.grid(row=7, column=0, columnspan=2, sticky=W, padx=10, pady=0) Frame(frameBg, borderwidth=1, relief=SUNKEN, height=2, bg=self.bg).grid(row=8, column=0, sticky=EW, columnspan=3, padx=5, pady=5) labelPythonVer = Label(frameBg, text='Python version: ' + \ sys.version.split()[0], fg=self.fg, bg=self.bg) labelPythonVer.grid(row=9, column=0, sticky=W, padx=10, pady=0) # handle weird tk version num in windoze python >= 1.6 (?!?) tkVer = `TkVersion`.split('.') tkVer[len(tkVer)-1] = str('%.3g' % (float('.'+tkVer[len(tkVer)-1])))[2:] if tkVer[len(tkVer)-1] == '': tkVer[len(tkVer)-1] = '0' tkVer = string.join(tkVer,'.') labelTkVer = Label(frameBg, text='Tk version: '+ tkVer, fg=self.fg, bg=self.bg) labelTkVer.grid(row=9, column=1, sticky=W, padx=2, pady=0) py_button_f = Frame(frameBg, bg=self.bg) py_button_f.grid(row=10, column=0, columnspan=2, sticky=NSEW) buttonLicense = Button(py_button_f, text='License', width=8, highlightbackground=self.bg, command=self.ShowLicense) buttonLicense.pack(side=LEFT, padx=10, pady=10) buttonCopyright = Button(py_button_f, text='Copyright', width=8, highlightbackground=self.bg, command=self.ShowCopyright) buttonCopyright.pack(side=LEFT, padx=10, pady=10) buttonCredits = Button(py_button_f, text='Credits', width=8, highlightbackground=self.bg, command=self.ShowPythonCredits) buttonCredits.pack(side=LEFT, padx=10, pady=10) Frame(frameBg, borderwidth=1, relief=SUNKEN, height=2, bg=self.bg).grid(row=11, column=0, sticky=EW, columnspan=3, padx=5, pady=5) idle_v = Label(frameBg, text='IDLE version ' + idlever.IDLE_VERSION, fg=self.fg, bg=self.bg) idle_v.grid(row=12, column=0, sticky=W, padx=10, pady=0) idle_button_f = Frame(frameBg, bg=self.bg) idle_button_f.grid(row=13, column=0, columnspan=3, sticky=NSEW) idle_about_b = Button(idle_button_f, text='README', width=8, highlightbackground=self.bg, command=self.ShowIDLEAbout) idle_about_b.pack(side=LEFT, padx=10, pady=10) idle_news_b = Button(idle_button_f, text='NEWS', width=8, highlightbackground=self.bg, command=self.ShowIDLENEWS) idle_news_b.pack(side=LEFT, padx=10, pady=10) idle_credits_b = Button(idle_button_f, text='Credits', width=8, highlightbackground=self.bg, command=self.ShowIDLECredits) idle_credits_b.pack(side=LEFT, padx=10, pady=10) | 4e4da51b025878e84436c56679b325fb24465147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4e4da51b025878e84436c56679b325fb24465147/aboutDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
16166,
12,
2890,
4672,
2623,
6376,
273,
8058,
12,
2890,
16,
5795,
2819,
33,
22,
16,
14719,
10241,
33,
55,
16141,
1157,
13,
2623,
14388,
273,
8058,
12,
2890,
13,
2623,
14388,
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,
1788,
16166,
12,
2890,
4672,
2623,
6376,
273,
8058,
12,
2890,
16,
5795,
2819,
33,
22,
16,
14719,
10241,
33,
55,
16141,
1157,
13,
2623,
14388,
273,
8058,
12,
2890,
13,
2623,
14388,
18,
... |
keys = [k for k in keys if wildcard(k.name)] | keys = ((nm,k) for (nm,k) in keys if wildcard(nm)) | def _filter_keys(self,path,keys,wildcard,full,absolute,dirs_only,files_only): """Filter out keys not matching the given criteria. | 8ef6d26a6a9b6416ad98420a072855a138f4fecc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/8ef6d26a6a9b6416ad98420a072855a138f4fecc/s3fs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
67,
2452,
12,
2890,
16,
803,
16,
2452,
16,
22887,
16,
2854,
16,
12547,
16,
8291,
67,
3700,
16,
2354,
67,
3700,
4672,
3536,
1586,
596,
1311,
486,
3607,
326,
864,
3582,
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,
389,
2188,
67,
2452,
12,
2890,
16,
803,
16,
2452,
16,
22887,
16,
2854,
16,
12547,
16,
8291,
67,
3700,
16,
2354,
67,
3700,
4672,
3536,
1586,
596,
1311,
486,
3607,
326,
864,
3582,
18,
... |
else: self.colormapper.set_norm(Norm(*self.colormapper.get_clim())) | def set_vscale(self, scale='linear'): """Alternate between log and linear colormap""" if scale == 'linear': self.colormapper.set_norm(LogNorm(*self.colormapper.get_clim())) else: self.colormapper.set_norm(Norm(*self.colormapper.get_clim())) self.vscale = scale | 636880d26039268a45f2f72b4fdda12c46f0b191 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13135/636880d26039268a45f2f72b4fdda12c46f0b191/polplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
90,
5864,
12,
2890,
16,
3159,
2218,
12379,
11,
4672,
3536,
25265,
3086,
613,
471,
9103,
24806,
8395,
309,
3159,
422,
296,
12379,
4278,
365,
18,
1293,
18804,
457,
18,
542,
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,
444,
67,
90,
5864,
12,
2890,
16,
3159,
2218,
12379,
11,
4672,
3536,
25265,
3086,
613,
471,
9103,
24806,
8395,
309,
3159,
422,
296,
12379,
4278,
365,
18,
1293,
18804,
457,
18,
542,
67,
... | |
return '%s = %s' % (tag, str (value)) def get_ids_or_fail (query, db): | return '%s = %s' % (tag, str(value)) def get_ids_or_fail(query, db): | def formatted_tag_value (tag, value): if value == None: return tag elif type (value) in types.StringTypes: return '%s = "%s"' % (tag, value) else: return '%s = %s' % (tag, str (value)) | e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4955,
67,
2692,
67,
1132,
261,
2692,
16,
460,
4672,
309,
460,
422,
599,
30,
327,
1047,
1327,
618,
261,
1132,
13,
316,
1953,
18,
780,
2016,
30,
327,
1995,
87,
273,
2213,
87,
5187,
738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4955,
67,
2692,
67,
1132,
261,
2692,
16,
460,
4672,
309,
460,
422,
599,
30,
327,
1047,
1327,
618,
261,
1132,
13,
316,
1953,
18,
780,
2016,
30,
327,
1995,
87,
273,
2213,
87,
5187,
738... |
def test_default_configuration__release(self): self.assertConfiguration('Release', 'Release') | def _read_configuration(self): configuration_path = os.path.join(self.build_directory(None), "Configuration") if not os.path.exists(configuration_path): return None | def test_default_configuration__release(self): self.assertConfiguration('Release', 'Release') | 25feeb24a1118a6fb28d036358303ac956f0d038 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/25feeb24a1118a6fb28d036358303ac956f0d038/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1886,
67,
7025,
972,
9340,
12,
2890,
4672,
365,
18,
11231,
1750,
2668,
7391,
2187,
296,
7391,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1886,
67,
7025,
972,
9340,
12,
2890,
4672,
365,
18,
11231,
1750,
2668,
7391,
2187,
296,
7391,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
- resp: server response if succesful | - resp: server response if successful | def stat(self, id): """Process a STAT command. Argument: - id: article number or message id Returns: - resp: server response if succesful - nr: the article number - id: the article id""" | 2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
610,
12,
2890,
16,
612,
4672,
3536,
2227,
279,
2347,
789,
1296,
18,
225,
5067,
30,
300,
612,
30,
7559,
1300,
578,
883,
612,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
300,
9884,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
610,
12,
2890,
16,
612,
4672,
3536,
2227,
279,
2347,
789,
1296,
18,
225,
5067,
30,
300,
612,
30,
7559,
1300,
578,
883,
612,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
300,
9884,
... |
self.failIf('design' in [c.name for c in self.linter.needed_checkers()]) | self.failIf('design' in [c.name for c in self.linter.prepare_checkers()]) | def test_enable_checkers(self): self.linter.disable('design') self.failIf('design' in [c.name for c in self.linter.needed_checkers()]) self.linter.enable('design') self.failUnless('design' in [c.name for c in self.linter.needed_checkers()]) | 7a63f9b28bade89d2c46e6e763455173ab562536 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/928/7a63f9b28bade89d2c46e6e763455173ab562536/unittest_lint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7589,
67,
1893,
414,
12,
2890,
4672,
365,
18,
80,
2761,
18,
8394,
2668,
16934,
6134,
365,
18,
6870,
2047,
2668,
16934,
11,
316,
306,
71,
18,
529,
364,
276,
316,
365,
18,
80... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7589,
67,
1893,
414,
12,
2890,
4672,
365,
18,
80,
2761,
18,
8394,
2668,
16934,
6134,
365,
18,
6870,
2047,
2668,
16934,
11,
316,
306,
71,
18,
529,
364,
276,
316,
365,
18,
80... |
'en': u'Undictionary', 'ja': u'Undictionary', | 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... | |
def proxy_bypass(host): | def proxy_bypass_registry(host): | def proxy_bypass(host): try: import _winreg import re except ImportError: # Std modules, so should be around - but you never know! return 0 try: internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') proxyEnable = _winreg.QueryValueEx(internetSettings, 'ProxyEnable')[0] proxyOverride = str(_winreg.QueryValueEx(internetSettings, 'ProxyOverride')[0]) # ^^^^ Returned as Unicode but problems if not converted to ASCII except WindowsError: return 0 if not proxyEnable or not proxyOverride: return 0 # try to make a host list from name and IP address. rawHost, port = splitport(host) host = [rawHost] try: addr = socket.gethostbyname(rawHost) if addr != rawHost: host.append(addr) except socket.error: pass try: fqdn = socket.getfqdn(rawHost) if fqdn != rawHost: host.append(fqdn) except socket.error: pass # make a check value list from the registry entry: replace the # '<local>' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(';') i = 0 while i < len(proxyOverride): if proxyOverride[i] == '<local>': proxyOverride[i:i+1] = ['localhost', '127.0.0.1', socket.gethostname(), socket.gethostbyname( socket.gethostname())] i += 1 # print proxyOverride # now check if we match one of the registry values. for test in proxyOverride: test = test.replace(".", r"\.") # mask dots test = test.replace("*", r".*") # change glob sequence test = test.replace("?", r".") # change glob char for val in host: # print "%s <--> %s" %( test, val ) if re.match(test, val, re.I): return 1 return 0 | 2235011d49bc543ced855804ac9b87c0e98a7b19 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/2235011d49bc543ced855804ac9b87c0e98a7b19/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2889,
67,
29604,
67,
9893,
12,
2564,
4672,
775,
30,
1930,
389,
8082,
1574,
1930,
283,
1335,
11308,
30,
468,
6276,
4381,
16,
1427,
1410,
506,
6740,
300,
1496,
1846,
5903,
5055,
5,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2889,
67,
29604,
67,
9893,
12,
2564,
4672,
775,
30,
1930,
389,
8082,
1574,
1930,
283,
1335,
11308,
30,
468,
6276,
4381,
16,
1427,
1410,
506,
6740,
300,
1496,
1846,
5903,
5055,
5,
327,
... |
from calibre.utils.icu import sort_key self.conn.create_collation('icucollate', partial(icu_collator, func=sort_key)) | self.conn.create_collation('icucollate', icu_collator) | def connect(self): self.conn = sqlite.connect(self.path, factory=Connection, detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES) self.conn.execute('pragma cache_size=5000') encoding = self.conn.execute('pragma encoding').fetchone()[0] c_ext_loaded = load_c_extensions(self.conn) self.conn.row_factory = sqlite.Row if self.row_factory else lambda cursor, row : list(row) self.conn.create_aggregate('concat', 1, Concatenate) if not c_ext_loaded: self.conn.create_aggregate('sortconcat', 2, SortedConcatenate) self.conn.create_aggregate('sort_concat', 2, SafeSortedConcatenate) self.conn.create_collation('PYNOCASE', partial(pynocase, encoding=encoding)) if tweaks['title_series_sorting'] == 'strictly_alphabetic': self.conn.create_function('title_sort', 1, lambda x:x) else: self.conn.create_function('title_sort', 1, title_sort) self.conn.create_function('author_to_author_sort', 1, _author_to_author_sort) self.conn.create_function('uuid4', 0, lambda : str(uuid.uuid4())) # Dummy functions for dynamically created filters self.conn.create_function('books_list_filter', 1, lambda x: 1) from calibre.utils.icu import sort_key self.conn.create_collation('icucollate', partial(icu_collator, func=sort_key)) | 7ff5842e713d50772e0e7b7a99138b802f9ac1c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7ff5842e713d50772e0e7b7a99138b802f9ac1c9/sqlite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
4672,
365,
18,
4646,
273,
16184,
18,
3612,
12,
2890,
18,
803,
16,
3272,
33,
1952,
16,
5966,
67,
2352,
33,
19460,
18,
21045,
67,
23956,
10564,
96,
19460,
18,
21045,
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,
3077,
12,
2890,
4672,
365,
18,
4646,
273,
16184,
18,
3612,
12,
2890,
18,
803,
16,
3272,
33,
1952,
16,
5966,
67,
2352,
33,
19460,
18,
21045,
67,
23956,
10564,
96,
19460,
18,
21045,
67,
... |
fp = open(os.path.join(config_dir, "Makefile")) | undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n") | bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
640,
536,
67,
20122,
273,
283,
18,
11100,
2932,
19,
63,
14,
65,
468,
318,
536,
23265,
37,
17,
62,
6362,
37,
17,
62,
20,
17,
29,
67,
7941,
306,
14,
18537,
64,
82,
7923,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
640,
536,
67,
20122,
273,
283,
18,
11100,
2932,
19,
63,
14,
65,
468,
318,
536,
23265,
37,
17,
62,
6362,
37,
17,
62,
20,
17,
29,
67,
7941,
306,
14,
18537,
64,
82,
7923,
2,
-100,
-100,
-... | |
print tag[1] | def map_chunk_slice(x, z, y = 64): map_directory = "D:\\Minemap\\!CURRENT\\dev\\shm\\rsync\\smp2\\smp\\World10\\" chunkname = map_directory + getchunkname(x, z) chunk = gzip.open(chunkname, 'r') output = read_tag(chunk) print output[0] try: for level in output[2]: # skip end tags if (level[0] == 0): continue for tag in level[2]: if (tag[0] == 0): continue print tag[1] if tag[1] == "Blocks": blocks = tag[2] print "Blocks retrieved" print "Blocks count: %d" % len(blocks) except: print "No blocks found" return Image.new("RGB", (256, 256)) #exit(0) # y = 77 # Print map by block ID | 085d2e65d6c70e23a4d1c9d5c5373fe9db845f1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13883/085d2e65d6c70e23a4d1c9d5c5373fe9db845f1a/read_chunk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
67,
6551,
67,
6665,
12,
92,
16,
998,
16,
677,
273,
5178,
4672,
852,
67,
5149,
273,
315,
40,
31027,
2930,
25248,
1695,
5,
15487,
1695,
5206,
1695,
674,
81,
1695,
5453,
1209,
1695,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
67,
6551,
67,
6665,
12,
92,
16,
998,
16,
677,
273,
5178,
4672,
852,
67,
5149,
273,
315,
40,
31027,
2930,
25248,
1695,
5,
15487,
1695,
5206,
1695,
674,
81,
1695,
5453,
1209,
1695,
... | |
return self.qexp()._pari_() | return self.q_expansion()._pari_() | def _pari_(self): r""" Return the Pari object corresponding to self, which is just the q-expansion of self as a formal power series. At present conversion of power series to Pari is only implemented if the base ring is `\QQ`. | 838a498abee29f10814d0a05c45a15fbb11d024c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/838a498abee29f10814d0a05c45a15fbb11d024c/genus0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1065,
77,
67,
12,
2890,
4672,
436,
8395,
2000,
326,
2280,
77,
733,
4656,
358,
365,
16,
1492,
353,
2537,
326,
1043,
17,
2749,
12162,
434,
365,
487,
279,
25739,
7212,
4166,
18,
2380... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1065,
77,
67,
12,
2890,
4672,
436,
8395,
2000,
326,
2280,
77,
733,
4656,
358,
365,
16,
1492,
353,
2537,
326,
1043,
17,
2749,
12162,
434,
365,
487,
279,
25739,
7212,
4166,
18,
2380... |
frame['fft'] = fft2(frame['lpt'][::-1,::-1], fft_shape) | frame['fft'] = fft2(frame['lpt']) | def _prepare_varmap(ref_img): vm_filter_mask = [[0, 1, 0], [1, -2, 1], [0, 1, 0]] | cc3c399ed2f306cdf02d244f317c4793f63d5a0c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12843/cc3c399ed2f306cdf02d244f317c4793f63d5a0c/logpolar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
67,
1401,
1458,
12,
1734,
67,
6081,
4672,
4268,
67,
2188,
67,
4455,
273,
12167,
20,
16,
225,
404,
16,
374,
6487,
306,
21,
16,
300,
22,
16,
404,
6487,
306,
20,
16,
225,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
67,
1401,
1458,
12,
1734,
67,
6081,
4672,
4268,
67,
2188,
67,
4455,
273,
12167,
20,
16,
225,
404,
16,
374,
6487,
306,
21,
16,
300,
22,
16,
404,
6487,
306,
20,
16,
225,
4... |
self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | pass | def __init__(self, about=None, meta=None, label=None, id=None, otus=None, valueOf_=None, mixedclass_=None, content_=None): super(TaxaLinked, self).__init__(about, meta, label, id, valueOf_, mixedclass_, content_, ) self.otus = _cast(None, otus) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
15835,
407,
33,
7036,
16,
4323,
67,
33,
7036,
16,
7826,
1106,
67,
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,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
15835,
407,
33,
7036,
16,
4323,
67,
33,
7036,
16,
7826,
1106,
67,
33,
... |
mtr = queryUtility(IMimetypesRegistryTool) | mtr = getToolByName(instance, 'mimetypes_registry', None) | def _process_input(self, value, file=None, default=None, mimetype=None, instance=None, filename='', **kwargs): if file is None: file = self._make_file(self.getName(), title='', file='', instance=instance) if IBaseUnit.isImplementedBy(value): mimetype = value.getContentType() or mimetype filename = value.getFilename() or filename value = value.getRaw() elif isinstance(value, self.content_class): filename = getattr(value, 'filename', value.getId()) mimetype = getattr(value, 'content_type', mimetype) return value, mimetype, filename elif isinstance(value, File): # In case someone changes the 'content_class' filename = getattr(value, 'filename', value.getId()) mimetype = getattr(value, 'content_type', mimetype) value = value.data elif isinstance(value, FileUpload) or shasattr(value, 'filename'): filename = value.filename elif isinstance(value, FileType) or shasattr(value, 'name'): # In this case, give preference to a filename that has # been detected before. Usually happens when coming from PUT(). if not filename: filename = value.name # Should we really special case here? for v in (filename, repr(value)): # Windows unnamed temporary file has '<fdopen>' in # repr() and full path in 'file.name' if '<fdopen>' in v: filename = '' elif isinstance(value, basestring): # Let it go, mimetypes_registry will be used below if available pass elif (isinstance(value, Pdata) or (shasattr(value, 'read') and shasattr(value, 'seek'))): # Can't get filename from those. pass elif value is None: # Special case for setDefault value = '' else: klass = getattr(value, '__class__', None) raise FileFieldException('Value is not File or String (%s - %s)' % (type(value), klass)) filename = filename[max(filename.rfind('/'), filename.rfind('\\'), filename.rfind(':'), )+1:] file.manage_upload(value) if mimetype is None or mimetype == 'text/x-unknown-content-type': body = file.data if not isinstance(body, basestring): body = body.data mtr = queryUtility(IMimetypesRegistryTool) if mtr is not None: kw = {'mimetype':None, 'filename':filename} # this may split the encoded file inside a multibyte character try: d, f, mimetype = mtr(body[:8096], **kw) except UnicodeDecodeError: d, f, mimetype = mtr(len(body) < 8096 and body or '', **kw) else: mimetype = getattr(file, 'content_type', None) if mimetype is None: mimetype, enc = guess_content_type(filename, body, mimetype) # mimetype, if coming from request can be like: # text/plain; charset='utf-8' mimetype = str(mimetype).split(';')[0].strip() setattr(file, 'content_type', mimetype) setattr(file, 'filename', filename) return file, mimetype, filename | 7ceff8c470eae33b4a063061230f3f8948cfaf8b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12165/7ceff8c470eae33b4a063061230f3f8948cfaf8b/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
2630,
12,
2890,
16,
460,
16,
585,
33,
7036,
16,
805,
33,
7036,
16,
12595,
33,
7036,
16,
791,
33,
7036,
16,
1544,
2218,
2187,
2826,
4333,
4672,
309,
585,
353,
599,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
2630,
12,
2890,
16,
460,
16,
585,
33,
7036,
16,
805,
33,
7036,
16,
12595,
33,
7036,
16,
791,
33,
7036,
16,
1544,
2218,
2187,
2826,
4333,
4672,
309,
585,
353,
599,
30,
... |
self.unixPath=unixpath | self.unixPath=unixPath | def __init__(self, uri=None, host=None, unixPath=None, port=None, skunkPort=None, ip=None, ): self.uri=uri self.host=host self.unixPath=unixpath self.port=port self.skunkPort=skunkPort self.ip=ip | 5531b0ee200ddd0c3cf4c5e4ac2d6496e6a978a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5832/5531b0ee200ddd0c3cf4c5e4ac2d6496e6a978a5/rewrite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2003,
33,
7036,
16,
1479,
33,
7036,
16,
9753,
743,
33,
7036,
16,
1756,
33,
7036,
16,
4343,
1683,
2617,
33,
7036,
16,
2359,
33,
7036,
16,
262,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2003,
33,
7036,
16,
1479,
33,
7036,
16,
9753,
743,
33,
7036,
16,
1756,
33,
7036,
16,
4343,
1683,
2617,
33,
7036,
16,
2359,
33,
7036,
16,
262,
30,
365,
... |
u = get_or_create_user(student_uni.encode('utf8')) course.add_students([u.uni]) message("'" + u.fullname() + "' has been added") raise cherrypy.HTTPRedirect("/course/%s/students" % course.id) | try: u = get_or_create_user(student_uni.encode('utf8')) course.add_students([u.uni]) message("'" + u.fullname() + "' has been added") except InvalidUNI: message("The provided UNI is empty or invalid.") raise cherrypy.HTTPRedirect("/course/%s/students" % course.id) | def update_students(self,course,**kwargs): if kwargs.get('action_delete',False): removed = course.remove_students([Ecouser.get(id) for id in ensure_list(kwargs.get('student_id',None))]) the_verb = "has" if len(removed) > 1: the_verb = "have" message("'" + ", ".join(removed) + "' " + the_verb + " been deleted.") raise cherrypy.HTTPRedirect("/course/%s/students" % course.id) elif kwargs.get('action_add',False): student_uni = kwargs.get('student_uni',None) u = get_or_create_user(student_uni.encode('utf8')) course.add_students([u.uni]) message("'" + u.fullname() + "' has been added") raise cherrypy.HTTPRedirect("/course/%s/students" % course.id) else: # unknown action raise cherrypy.HTTPRedirect("/course/%s/" % course.id) | 89695e2663021b8894b2f00223dee5447867e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5854/89695e2663021b8894b2f00223dee5447867e4b1/controllers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
16120,
4877,
12,
2890,
16,
5566,
16,
636,
4333,
4672,
309,
1205,
18,
588,
2668,
1128,
67,
3733,
2187,
8381,
4672,
3723,
273,
4362,
18,
4479,
67,
16120,
4877,
3816,
41,
2894,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
16120,
4877,
12,
2890,
16,
5566,
16,
636,
4333,
4672,
309,
1205,
18,
588,
2668,
1128,
67,
3733,
2187,
8381,
4672,
3723,
273,
4362,
18,
4479,
67,
16120,
4877,
3816,
41,
2894,
... |
line = "%define DANCEVER " + comp_versions["DAnCE_version"] + "\n" | line = "%define DANCEVER " + comp_versions["DANCE_version"] + "\n" | def update_spec_file (): global comp_versions, opts with open (doc_root + "/ACE/rpmbuild/ace-tao.spec", 'r+') as spec_file: new_spec = "" for line in spec_file.readlines (): if line.find ("define ACEVER ") is not -1: line = "%define ACEVER " + comp_versions["ACE_version"] + "\n" if line.find ("define TAOVER ") is not -1: line = "%define TAOVER " + comp_versions["TAO_version"] + "\n" if line.find ("define CIAOVER ") is not -1: line = "%define CIAOVER " + comp_versions["CIAO_version"] + "\n" if line.find ("define DANCEVER ") is not -1: line = "%define DANCEVER " + comp_versions["DAnCE_version"] + "\n" if line.find ("define is_major_ver") is not -1: if opts.release_type == "beta": line = "%define is_major_ver 0\n" else: line = "%define is_major_ver 1\n" new_spec += line if opts.take_action: spec_file.seek (0) spec_file.truncate (0) spec_file.writelines (new_spec) else: print "New spec file:" print "".join (new_spec) return [doc_root + "/ACE/rpmbuild/ace-tao.spec"] | d0eac4652192d58cd5ad32e32078fca191518d5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5660/d0eac4652192d58cd5ad32e32078fca191518d5c/make_release.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2793,
67,
768,
1832,
30,
225,
2552,
1161,
67,
10169,
16,
1500,
225,
598,
1696,
261,
2434,
67,
3085,
397,
2206,
6312,
19,
13832,
1627,
680,
19,
623,
17,
2351,
83,
18,
2793,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2793,
67,
768,
1832,
30,
225,
2552,
1161,
67,
10169,
16,
1500,
225,
598,
1696,
261,
2434,
67,
3085,
397,
2206,
6312,
19,
13832,
1627,
680,
19,
623,
17,
2351,
83,
18,
2793,
... |
that no compilatin was done (by the script) yet. | that no compilation was done (by the script) yet. | def compile_needed (self): """ Returns true if a first compilation is needed. This method supposes that no compilatin was done (by the script) yet. """ if self.must_compile: return 1 self.msg(3, _("checking if compiling is necessary...")) if not exists(self.src_base + self.out_ext): self.msg(3, _("the output file doesn't exist")) return 1 if not exists(self.src_base + ".log"): self.msg(3, _("the log file does not exist")) return 1 if getmtime(self.src_base + ".log") < getmtime(self.source()): self.msg(3, _("the source is younger than the log file")) return 1 if self.log.read(self.src_base + ".log"): self.msg(3, _("the log file is not produced by %s") % self.conf.tex) return 1 return self.recompile_needed() | d84841c62293ae7ecdbb22ccea845dfa5faaa5e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/d84841c62293ae7ecdbb22ccea845dfa5faaa5e8/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
17471,
261,
2890,
4672,
3536,
2860,
638,
309,
279,
1122,
8916,
353,
3577,
18,
1220,
707,
1169,
10522,
716,
1158,
8916,
1703,
2731,
261,
1637,
326,
2728,
13,
4671,
18,
3536,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
17471,
261,
2890,
4672,
3536,
2860,
638,
309,
279,
1122,
8916,
353,
3577,
18,
1220,
707,
1169,
10522,
716,
1158,
8916,
1703,
2731,
261,
1637,
326,
2728,
13,
4671,
18,
3536,
309... |
size = self.size_scale.get_value() self.set_size_new(self.__get_extents(size)) self.update_remaining_space_label() | if self.user_changing_scale: size = self.size_scale.get_value() self.set_size_new(self.__get_extents(size)) else: self.user_changing_scale = True | def on_size_change_scale(self, obj): size = self.size_scale.get_value() self.set_size_new(self.__get_extents(size)) self.update_remaining_space_label() | 9853486877ffa9129d0f5ea9d5bb5e86f67600dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3880/9853486877ffa9129d0f5ea9d5bb5e86f67600dd/InputController.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1467,
67,
3427,
67,
5864,
12,
2890,
16,
1081,
4672,
963,
273,
365,
18,
1467,
67,
5864,
18,
588,
67,
1132,
1435,
365,
18,
542,
67,
1467,
67,
2704,
12,
2890,
16186,
588,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1467,
67,
3427,
67,
5864,
12,
2890,
16,
1081,
4672,
963,
273,
365,
18,
1467,
67,
5864,
18,
588,
67,
1132,
1435,
365,
18,
542,
67,
1467,
67,
2704,
12,
2890,
16186,
588,
67,
... |
self.assertRaises(ValueError, time.strftime, '', | self.assertRaises(ValueError, func, | def test_strftime_bounds_checking(self): # Make sure that strftime() checks the bounds of the various parts #of the time tuple (0 is valid for *all* values). | 38e299615270e2a4a9b223b789924e899847f3cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/38e299615270e2a4a9b223b789924e899847f3cc/test_time.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
701,
9982,
67,
10576,
67,
24609,
12,
2890,
4672,
468,
4344,
3071,
716,
10405,
1435,
4271,
326,
4972,
434,
326,
11191,
2140,
468,
792,
326,
813,
3193,
261,
20,
353,
923,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
701,
9982,
67,
10576,
67,
24609,
12,
2890,
4672,
468,
4344,
3071,
716,
10405,
1435,
4271,
326,
4972,
434,
326,
11191,
2140,
468,
792,
326,
813,
3193,
261,
20,
353,
923,
364,
... |
err = hr | err = exc.winerror | def HandleCommandLine(cls, serviceClassString = None, argv = None, customInstallOptions = "", customOptionHandler = None): """Utility function allowing services to process the command line. Allows standard commands such as 'start', 'stop', 'debug', 'install' etc. Install supports 'standard' command line options prefixed with '--', such as --username, --password, etc. In addition, the function allows custom command line options to be handled by the calling function. """ err = 0 if argv is None: argv = sys.argv if len(argv)<=1: usage() serviceName = cls._svc_name_ serviceDisplayName = cls._svc_display_name_ if serviceClassString is None: serviceClassString = GetServiceClassString(cls) # Pull apart the command line import getopt try: opts, args = getopt.getopt(argv[1:], customInstallOptions,["password=","username=","startup=","perfmonini=", "perfmondll=", "interactive", "wait="]) except getopt.error, details: print details usage() userName = None password = None perfMonIni = perfMonDll = None startup = None interactive = None waitSecs = 0 for opt, val in opts: if opt=='--username': userName = val elif opt=='--password': password = val elif opt=='--perfmonini': perfMonIni = val elif opt=='--perfmondll': perfMonDll = val elif opt=='--interactive': interactive = 1 elif opt=='--startup': map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} try: startup = map[string.lower(val)] except KeyError: print "'%s' is not a valid startup option" % val elif opt=='--wait': try: waitSecs = int(val) except ValueError: print "--wait must specify an integer number of seconds." usage() arg=args[0] knownArg = 0 # First we process all arguments which pass additional args on if arg=="start": knownArg = 1 print "Starting service %s" % (serviceName) try: StartService(serviceName, args[1:]) if waitSecs: WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) except win32service.error, exc: print "Error starting service: %s" % exc.strerror elif arg=="restart": knownArg = 1 print "Restarting service %s" % (serviceName) RestartService(serviceName, args[1:]) if waitSecs: WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) elif arg=="debug": knownArg = 1 if not hasattr(sys, "frozen"): # non-frozen services use pythonservice.exe which handles a # -debug option svcArgs = string.join(args[1:]) try: exeName = LocateSpecificServiceExe(serviceName) except win32api.error, exc: if exc[0] == winerror.ERROR_FILE_NOT_FOUND: print "The service does not appear to be installed." print "Please install the service before debugging it." sys.exit(1) raise try: os.system("%s -debug %s %s" % (exeName, serviceName, svcArgs)) # ^C is used to kill the debug service. Sometimes Python also gets # interrupted - ignore it... except KeyboardInterrupt: pass else: # py2exe services don't use pythonservice - so we simulate # debugging here. DebugService(cls, args) if not knownArg and len(args)!=1: usage() # the rest of the cmds don't take addn args if arg=="install": knownArg = 1 try: serviceDeps = cls._svc_deps_ except AttributeError: serviceDeps = None try: exeName = cls._exe_name_ except AttributeError: exeName = None # Default to PythonService.exe try: exeArgs = cls._exe_args_ except AttributeError: exeArgs = None try: description = cls._svc_description_ except AttributeError: description = None print "Installing service %s" % (serviceName,) # Note that we install the service before calling the custom option # handler, so if the custom handler fails, we have an installed service (from NT's POV) # but is unlikely to work, as the Python code controlling it failed. Therefore # we remove the service if the first bit works, but the second doesnt! try: InstallService(serviceClassString, serviceName, serviceDisplayName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs,description=description) if customOptionHandler: customOptionHandler(*(opts,)) print "Service installed" except win32service.error, exc: if exc.winerror==winerror.ERROR_SERVICE_EXISTS: arg = "update" # Fall through to the "update" param! else: print "Error installing service: %s (%d)" % (exc.strerror, exc.winerror) err = hr except ValueError, msg: # Can be raised by custom option handler. print "Error installing service: %s" % str(msg) err = -1 # xxx - maybe I should remove after _any_ failed install - however, # xxx - it may be useful to help debug to leave the service as it failed. # xxx - We really _must_ remove as per the comments above... # As we failed here, remove the service, so the next installation # attempt works. try: RemoveService(serviceName) except win32api.error: print "Warning - could not remove the partially installed service." if arg == "update": knownArg = 1 try: serviceDeps = cls._svc_deps_ except AttributeError: serviceDeps = None try: exeName = cls._exe_name_ except AttributeError: exeName = None # Default to PythonService.exe try: exeArgs = cls._exe_args_ except AttributeError: exeArgs = None try: description=cls._svc_description_ except AttributeError: description=None print "Changing service configuration" try: ChangeServiceConfig(serviceClassString, serviceName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, displayName = serviceDisplayName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs,description=description) if customOptionHandler: customOptionHandler(*(opts,)) print "Service updated" except win32service.error, exc: print "Error changing service configuration: %s (%d)" % (exc.strerror,exc.winerror) err = hr elif arg=="remove": knownArg = 1 print "Removing service %s" % (serviceName) try: RemoveService(serviceName) print "Service removed" except win32service.error, exc: print "Error removing service: %s (%d)" % (exc.strerror,exc.winerror) err = hr elif arg=="stop": knownArg = 1 print "Stopping service %s" % (serviceName) try: if waitSecs: StopServiceWithDeps(serviceName, waitSecs = waitSecs) else: StopService(serviceName) except win32service.error, exc: print "Error stopping service: %s (%d)" % (exc.strerror,exc.winerror) err = hr if not knownArg: err = -1 print "Unknown command - '%s'" % arg usage() return err | fbd8d4fd61408af6605030a3bee01f3edf61da43 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/992/fbd8d4fd61408af6605030a3bee01f3edf61da43/win32serviceutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
21391,
12,
6429,
16,
1156,
797,
780,
273,
599,
16,
5261,
273,
599,
16,
1679,
6410,
1320,
273,
23453,
1679,
1895,
1503,
273,
599,
4672,
3536,
6497,
445,
15632,
4028,
358,
1207,
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,
5004,
21391,
12,
6429,
16,
1156,
797,
780,
273,
599,
16,
5261,
273,
599,
16,
1679,
6410,
1320,
273,
23453,
1679,
1895,
1503,
273,
599,
4672,
3536,
6497,
445,
15632,
4028,
358,
1207,
326,... |
run() | run(*args, **kargs) | def NewLineAfter(): """Insert newline after current line""" line = self.LineFromPosition(self.GetCurrentPos()) self.GotoPos(self.GetLineEndPosition(line)) self.AutoIndent() | be43c077f19ad88c63e5e2f8aa6305f97b701c5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/be43c077f19ad88c63e5e2f8aa6305f97b701c5e/ed_stc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1166,
1670,
4436,
13332,
3536,
4600,
9472,
1839,
783,
980,
8395,
980,
273,
365,
18,
1670,
1265,
2555,
12,
2890,
18,
967,
3935,
1616,
10756,
365,
18,
43,
6302,
1616,
12,
2890,
18,
967,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1166,
1670,
4436,
13332,
3536,
4600,
9472,
1839,
783,
980,
8395,
980,
273,
365,
18,
1670,
1265,
2555,
12,
2890,
18,
967,
3935,
1616,
10756,
365,
18,
43,
6302,
1616,
12,
2890,
18,
967,
... |
game.quad[w.x][w.y] = IHWEB | game.quad[w.i][w.j] = IHWEB | def torpedo(origin, course, dispersion, number, nburst): "Let a photon torpedo fly" shoved = False ac = course + 0.25*dispersion angle = (15.0-ac)*0.5235988 bullseye = (15.0 - course)*0.5235988 delta = coord(-math.sin(angle), math.cos(angle)) bigger = max(abs(delta.x), abs(delta.y)) delta /= bigger x = origin.x; y = origin.y w = coord(0, 0); jw = coord(0, 0) if not damaged(DSRSENS) or game.condition=="docked": setwnd(srscan_window) else: setwnd(message_window) # Loop to move a single torpedo for step in range(1, 15+1): x += delta.x y += delta.y w = coord(x, y).snaptogrid() if not VALID_SECTOR(w.x, w.y): break iquad=game.quad[w.x][w.y] tracktorpedo(origin, w, step, number, nburst, iquad) if iquad==IHDOT: continue # hit something setwnd(message_window) if damaged(DSRSENS) and not game.condition=="docked": skip(1); # start new line after text track if iquad in (IHE, IHF): # Hit our ship skip(1) prout(_("Torpedo hits %s.") % crmshp()) hit = 700.0 + randreal(100) - \ 1000.0 * (w-origin).distance() * math.fabs(math.sin(bullseye-angle)) newcnd(); # we're blown out of dock # We may be displaced. if game.landed or game.condition=="docked": return hit # Cheat if on a planet ang = angle + 2.5*(randreal()-0.5) temp = math.fabs(math.sin(ang)) if math.fabs(math.cos(ang)) > temp: temp = math.fabs(math.cos(ang)) xx = -math.sin(ang)/temp yy = math.cos(ang)/temp jw.x = int(w.x+xx+0.5) jw.y = int(w.y+yy+0.5) if not VALID_SECTOR(jw.x, jw.y): return hit if game.quad[jw.x][jw.y]==IHBLANK: finish(FHOLE) return hit if game.quad[jw.x][jw.y]!=IHDOT: # can't move into object return hit game.sector = jw proutn(crmshp()) shoved = True elif iquad in (IHC, IHS): # Hit a commander if withprob(0.05): prout(crmena(True, iquad, "sector", w) + _(" uses anti-photon device;")) prout(_(" torpedo neutralized.")) return None elif iquad in (IHR, IHK): # Hit a regular enemy # find the enemy for enemy in game.enemies: if w == enemy.kloc: break kp = math.fabs(enemy.kpower) h1 = 700.0 + randrange(100) - \ 1000.0 * (w-origin).distance() * math.fabs(math.sin(bullseye-angle)) h1 = math.fabs(h1) if kp < h1: h1 = kp if enemy.kpower < 0: enemy.kpower -= -h1 else: enemy.kpower -= h1 if enemy.kpower == 0: deadkl(w, iquad, w) return None proutn(crmena(True, iquad, "sector", w)) # If enemy damaged but not destroyed, try to displace ang = angle + 2.5*(randreal()-0.5) temp = math.fabs(math.sin(ang)) if math.fabs(math.cos(ang)) > temp: temp = math.fabs(math.cos(ang)) xx = -math.sin(ang)/temp yy = math.cos(ang)/temp jw.x = int(w.x+xx+0.5) jw.y = int(w.y+yy+0.5) if not VALID_SECTOR(jw.x, jw.y): prout(_(" damaged but not destroyed.")) return if game.quad[jw.x][jw.y]==IHBLANK: prout(_(" buffeted into black hole.")) deadkl(w, iquad, jw) return None if game.quad[jw.x][jw.y]!=IHDOT: # can't move into object prout(_(" damaged but not destroyed.")) return None proutn(_(" damaged--")) enemy.kloc = jw shoved = True break elif iquad == IHB: # Hit a base skip(1) prout(_("***STARBASE DESTROYED..")) game.state.baseq = filter(lambda x: x != game.quadrant, game.state.baseq) game.quad[w.x][w.y]=IHDOT game.base.invalidate() game.state.galaxy[game.quadrant.x][game.quadrant.y].starbase -= 1 game.state.chart[game.quadrant.x][game.quadrant.y].starbase -= 1 game.state.basekl += 1 newcnd() return None elif iquad == IHP: # Hit a planet prout(crmena(True, iquad, "sector", w) + _(" destroyed.")) game.state.nplankl += 1 game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = None game.iplnet.pclass = "destroyed" game.iplnet = None game.plnet.invalidate() game.quad[w.x][w.y] = IHDOT if game.landed: # captain perishes on planet finish(FDPLANET) return None elif iquad == IHW: # Hit an inhabited world -- very bad! prout(crmena(True, iquad, "sector", w) + _(" destroyed.")) game.state.nworldkl += 1 game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = None game.iplnet.pclass = "destroyed" game.iplnet = None game.plnet.invalidate() game.quad[w.x][w.y] = IHDOT if game.landed: # captain perishes on planet finish(FDPLANET) prout(_("You have just destroyed an inhabited planet.")) prout(_("Celebratory rallies are being held on the Klingon homeworld.")) return None elif iquad == IHSTAR: # Hit a star if withprob(0.9): nova(w) else: prout(crmena(True, IHSTAR, "sector", w) + _(" unaffected by photon blast.")) return None elif iquad == IHQUEST: # Hit a thingy if not (game.options & OPTION_THINGY) or withprob(0.3): skip(1) prouts(_("AAAAIIIIEEEEEEEEAAAAAAAAUUUUUGGGGGHHHHHHHHHHHH!!!")) skip(1) prouts(_(" HACK! HACK! HACK! *CHOKE!* ")) skip(1) proutn(_("Mr. Spock-")) prouts(_(" \"Fascinating!\"")) skip(1) deadkl(w, iquad, w) else: # Stas Sergeev added the possibility that # you can shove the Thingy and piss it off. # It then becomes an enemy and may fire at you. thing.angry = True shoved = True return None elif iquad == IHBLANK: # Black hole skip(1) prout(crmena(True, IHBLANK, "sector", w) + _(" swallows torpedo.")) return None elif iquad == IHWEB: # hit the web skip(1) prout(_("***Torpedo absorbed by Tholian web.")) return None elif iquad == IHT: # Hit a Tholian h1 = 700.0 + randrange(100) - \ 1000.0 * (w-origin).distance() * math.fabs(math.sin(bullseye-angle)) h1 = math.fabs(h1) if h1 >= 600: game.quad[w.x][w.y] = IHDOT deadkl(w, iquad, w) game.tholian = None return None skip(1) proutn(crmena(True, IHT, "sector", w)) if withprob(0.05): prout(_(" survives photon blast.")) return None prout(_(" disappears.")) game.tholian.move(None) game.quad[w.x][w.y] = IHWEB dropin(IHBLANK) return None else: # Problem! skip(1) proutn("Don't know how to handle torpedo collision with ") proutn(crmena(True, iquad, "sector", w)) skip(1) return None break if curwnd!=message_window: setwnd(message_window) if shoved: game.quad[w.x][w.y]=IHDOT game.quad[jw.x][jw.y]=iquad prout(_(" displaced by blast to Sector %s ") % jw) for ll in range(len(game.enemies)): game.enemies[ll].kdist = game.enemies[ll].kavgd = (game.sector-game.enemies[ll].kloc).distance() game.enemies.sort(lambda x, y: cmp(x.kdist, y.kdist)) return None skip(1) prout(_("Torpedo missed.")) return None; | e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8934,
1845,
83,
12,
10012,
16,
4362,
16,
16232,
722,
16,
1300,
16,
4264,
18593,
4672,
315,
24181,
279,
24542,
265,
8934,
1845,
83,
21434,
6,
699,
9952,
273,
1083,
1721,
273,
4362,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8934,
1845,
83,
12,
10012,
16,
4362,
16,
16232,
722,
16,
1300,
16,
4264,
18593,
4672,
315,
24181,
279,
24542,
265,
8934,
1845,
83,
21434,
6,
699,
9952,
273,
1083,
1721,
273,
4362,
397,
... |
out2_ = f2(img2d, filtersflipped) out2__ = out2_ | out2_ = f2(img2d, filtersflipped.reshape(nkern,1,*kshp)) out2__ = out2_ | def test_convolution(self): print '\n\n*************************************************' print ' TEST CONVOLUTION' print '*************************************************' from scipy.signal import convolve2d | 9982dc5c65f804e1270b071fb87f3004cf725394 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/9982dc5c65f804e1270b071fb87f3004cf725394/test_conv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4896,
5889,
12,
2890,
4672,
1172,
2337,
82,
64,
82,
5021,
2751,
4035,
1172,
296,
6647,
22130,
3492,
19971,
13269,
11,
1172,
296,
5021,
2751,
4035,
628,
10966,
18,
10420,
1930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4896,
5889,
12,
2890,
4672,
1172,
2337,
82,
64,
82,
5021,
2751,
4035,
1172,
296,
6647,
22130,
3492,
19971,
13269,
11,
1172,
296,
5021,
2751,
4035,
628,
10966,
18,
10420,
1930,
... |
header = 'Authorization' | auth_header = 'Authorization' | def get_entity_digest(self, data, chal): # XXX not implemented yet return None | 2caa503c43fe13ad97f11fb7b1d004793e3b72f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2caa503c43fe13ad97f11fb7b1d004793e3b72f8/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1096,
67,
10171,
12,
2890,
16,
501,
16,
462,
287,
4672,
468,
11329,
486,
8249,
4671,
327,
599,
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,
336,
67,
1096,
67,
10171,
12,
2890,
16,
501,
16,
462,
287,
4672,
468,
11329,
486,
8249,
4671,
327,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for key in substs.keys(): | for key in logSubstitutions.keys(): | def prepareLogMessage(template, message): result = "" substs = logSubstitutions for k in substs.keys(): substs[k] = substs[k].replace("%log%", message) for line in template.split("\n"): if line.startswith("#"): result += line + "\n" continue substituted = False for key in substs.keys(): if line.find(key) != -1: value = substs[key] if value != "@remove@": result += line.replace(key, value) + "\n" substituted = True break if not substituted: result += line + "\n" return result | 80a53a93c8d64c8c3d568353e9e95ef6fe8bc3af /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12824/80a53a93c8d64c8c3d568353e9e95ef6fe8bc3af/p4-git-sync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1343,
1079,
12,
3202,
16,
883,
4672,
563,
273,
1408,
225,
27750,
87,
273,
613,
1676,
30892,
364,
417,
316,
27750,
87,
18,
2452,
13332,
27750,
87,
63,
79,
65,
273,
27750,
87,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1343,
1079,
12,
3202,
16,
883,
4672,
563,
273,
1408,
225,
27750,
87,
273,
613,
1676,
30892,
364,
417,
316,
27750,
87,
18,
2452,
13332,
27750,
87,
63,
79,
65,
273,
27750,
87,
63,
... |
attrib = {'text:style-name': 'rststyle-textbody'} el1 = SubElement(self.current_element, 'text:p', attrib=attrib) | def generate_figure(self, node, source, destination): caption = None for node1 in node.parent.children: if node1.tagname == 'caption': caption = node1.astext() self.image_style_count += 1 style_name = 'rstframestyle%d' % self.image_style_count if 'scale' in node.attributes: try: scale = int(node.attributes['scale']) if scale < 1 or scale > 100: raise ValueError scale = scale * 0.01 except ValueError, e: print 'Error: Invalid scale for image: "%s"' % ( node.attributes['scale'], ) else: scale = 1.0 width = None if 'width' in node.attributes: try: width = int(node.attributes['width']) width = width * (35.278 / 1000.0) width *= scale #attrib['svg:width'] = '%.2fcm' % (width, ) except ValueError, e: print 'Error: Invalid width for image: "%s"' % ( node.attributes['width'], ) height = None if 'height' in node.attributes: try: height = int(node.attributes['height']) height = height * (35.278 / 1000.0) height *= scale #attrib['svg:height'] = '%.2fcm' % (height, ) except ValueError, e: print 'Error: Invalid height for image: "%s"' % ( node.attributes['height'], ) # Add the styles attrib = { 'style:name': style_name, 'style:family': 'graphic', 'style:parent-style-name': 'Frame', } el1 = SubElement(self.automatic_styles, 'style:style', attrib=attrib, nsdict=SNSD) halign = 'center' valign = 'top' if 'align' in node.attributes: align = node.attributes['align'].split() for val in align: if val in ('left', 'center', 'right'): halign = val elif val in ('top', 'middle', 'bottom'): valign = val attrib = { 'fo:margin-left': '0cm', 'fo:margin-right': '0cm', 'fo:margin-top': '0cm', 'fo:margin-bottom': '0cm', 'style:wrap': 'dynamic', 'style:number-wrapped-paragraphs': 'no-limit', 'style:vertical-pos': valign, 'style:vertical-rel': 'paragraph', 'style:horizontal-pos': halign, 'style:horizontal-rel': 'paragraph', 'fo:padding': '0cm', 'fo:border': 'none', } #ipshell('At generate_figure') el2 = SubElement(el1, 'style:graphic-properties', attrib=attrib, nsdict=SNSD) # Add the content attrib = {'text:style-name': 'rststyle-textbody'} el1 = SubElement(self.current_element, 'text:p', attrib=attrib) attrib = { 'draw:style-name': style_name, 'draw:name': 'Frame1', 'text:anchor-type': 'paragraph', 'draw:z-index': '1', } if width is not None: attrib['svg:width'] = '%.2fcm' % (width, ) el1 = SubElement(el1, 'draw:frame', attrib=attrib) attrib = {} if height is not None: attrib['fo:min-height'] = '%.2fcm' % (height, ) el1 = SubElement(el1, 'draw:text-box', attrib=attrib) attrib = {'text:style-name': 'rststyle-caption', } el1 = SubElement(el1, 'text:p', attrib=attrib) # Add the image (frame) inside the figure/caption frame. #ipshell('At visit_image #1') el2 = self.generate_image(node, source, destination, el1) if caption: el2.tail = caption | 8f9c74628116346d2f6e669c6a41a3e179d554cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/8f9c74628116346d2f6e669c6a41a3e179d554cb/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... | |
full_filename = os.path.join(sugar.env.get_bundle_path(), 'share', filename) | full_filename = os.path.join(activity.get_bundle_path(), 'share', filename) | def find_path(self, filename): if HAVE_SUGAR: full_filename = os.path.join(sugar.env.get_bundle_path(), 'share', filename) else: if os.path.exists(os.path.join(sys.prefix, 'share', 'pixmaps', filename)): full_filename = os.path.join(sys.prefix, 'share', 'pixmaps', filename) elif os.path.exists(os.path.join(os.path.split(__file__)[0], filename)): full_filename = os.path.join(os.path.split(__file__)[0], filename) elif os.path.exists(os.path.join(os.path.split(__file__)[0], 'pixmaps', filename)): full_filename = os.path.join(os.path.split(__file__)[0], 'pixmaps', filename) elif os.path.exists(os.path.join(os.path.split(__file__)[0], 'share', filename)): full_filename = os.path.join(os.path.split(__file__)[0], 'share', filename) elif os.path.exists(os.path.join(__file__.split('/lib')[0], 'share', 'pixmaps', filename)): full_filename = os.path.join(__file__.split('/lib')[0], 'share', 'pixmaps', filename) return full_filename def on_edittag_click(self, widget): mpdpath = self.songinfo.file self.edit_tags(widget, mpdpath) | 0744f296cd3c975fa6e9935ee5c4a3d8e5c3e3ea /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/0744f296cd3c975fa6e9935ee5c4a3d8e5c3e3ea/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
803,
12,
2890,
16,
1544,
4672,
309,
21926,
3412,
67,
6639,
43,
985,
30,
1983,
67,
3459,
273,
1140,
18,
803,
18,
5701,
12,
9653,
18,
588,
67,
9991,
67,
803,
9334,
296,
14419... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
803,
12,
2890,
16,
1544,
4672,
309,
21926,
3412,
67,
6639,
43,
985,
30,
1983,
67,
3459,
273,
1140,
18,
803,
18,
5701,
12,
9653,
18,
588,
67,
9991,
67,
803,
9334,
296,
14419... |
while line.startswith(' if line.startswith(' | if line.startswith(' | def unquote(str): return str[1:-1].replace("\\n", "\n") \ .replace('\\"', '"') | a2fddb8b40a66f5155eece653bb5eee568d627dc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/a2fddb8b40a66f5155eece653bb5eee568d627dc/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25611,
12,
701,
4672,
327,
609,
63,
21,
30,
17,
21,
8009,
2079,
2932,
1695,
82,
3113,
1548,
82,
7923,
282,
521,
263,
2079,
2668,
27576,
2187,
4754,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25611,
12,
701,
4672,
327,
609,
63,
21,
30,
17,
21,
8009,
2079,
2932,
1695,
82,
3113,
1548,
82,
7923,
282,
521,
263,
2079,
2668,
27576,
2187,
4754,
13,
2,
-100,
-100,
-100,
-100,
-100,... |
if child.tail: | cur_text = child.tail or '' if chunk == '' or (cur_text and cur_text[-1] != ' '): | def write(self, text, add_p_style=True, add_t_style=True): """ see mixed content http://effbot.org/zone/element-infoset.htm#mixed-content Writing is complicated by requirements of odp to ignore duplicate spaces together. Deal with this by splitting on white spaces then dealing with the '' (empty strings) which would be the extra spaces """ | 4356c80136aeb20e594322879b901dff6120fed0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/4356c80136aeb20e594322879b901dff6120fed0/preso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
977,
16,
527,
67,
84,
67,
4060,
33,
5510,
16,
527,
67,
88,
67,
4060,
33,
5510,
4672,
3536,
2621,
7826,
913,
1062,
2207,
17098,
4819,
18,
3341,
19,
3486,
19,
2956,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
527,
67,
84,
67,
4060,
33,
5510,
16,
527,
67,
88,
67,
4060,
33,
5510,
4672,
3536,
2621,
7826,
913,
1062,
2207,
17098,
4819,
18,
3341,
19,
3486,
19,
2956,... |
for d in self.pth_file.get(dist.key,()): | for d in self.pth_file[dist.key]: | def update_pth(self,dist): if self.pth_file is None: return | 98ab5c9053b781fccb6b5d69bb1fe88580d4941a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/495/98ab5c9053b781fccb6b5d69bb1fe88580d4941a/easy_install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2397,
12,
2890,
16,
4413,
4672,
309,
365,
18,
2397,
67,
768,
353,
599,
30,
327,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2397,
12,
2890,
16,
4413,
4672,
309,
365,
18,
2397,
67,
768,
353,
599,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print "PC AF entry: %s"%entry | def setFileNames(self, *fileNames): """set fileNames vector""" print "PC AF: %s"%fileNames self.data.fileNames = CfgTypes.untracked(CfgTypes.vstring()) for entry in fileNames: print "PC AF entry: %s"%entry #self.data.fileNames.append(CfgTypes.untracked(CfgTypes.string(entry))) self.data.fileNames.append(entry) | 9e08c9d9fd3bf62a5f44bb53b98102e93e6c4b68 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8886/9e08c9d9fd3bf62a5f44bb53b98102e93e6c4b68/InputSource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19658,
1557,
12,
2890,
16,
380,
768,
1557,
4672,
3536,
542,
27375,
3806,
8395,
1172,
315,
3513,
10888,
30,
738,
87,
28385,
768,
1557,
365,
18,
892,
18,
768,
1557,
273,
24631,
2016,
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,
19658,
1557,
12,
2890,
16,
380,
768,
1557,
4672,
3536,
542,
27375,
3806,
8395,
1172,
315,
3513,
10888,
30,
738,
87,
28385,
768,
1557,
365,
18,
892,
18,
768,
1557,
273,
24631,
2016,
18,
... | |
if obj.windowClassName == VsTextEditPaneClassName: | if obj.windowClassName == VsTextEditPaneClassName and self._getDTE(): | def chooseNVDAObjectOverlayClasses(self, obj, clsList): if obj.windowClassName == VsTextEditPaneClassName: try: clsList.remove(DisplayModelEditableText) except ValueError: pass clsList.insert(0, VsTextEditPane) | 7a75ff20a8852614e2ae169a7fbdf840b2db91c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/7a75ff20a8852614e2ae169a7fbdf840b2db91c0/devenv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9876,
11679,
9793,
921,
11627,
4818,
12,
2890,
16,
1081,
16,
2028,
682,
4672,
282,
309,
1081,
18,
5668,
3834,
422,
776,
87,
1528,
4666,
8485,
3834,
471,
365,
6315,
588,
40,
1448,
13332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9876,
11679,
9793,
921,
11627,
4818,
12,
2890,
16,
1081,
16,
2028,
682,
4672,
282,
309,
1081,
18,
5668,
3834,
422,
776,
87,
1528,
4666,
8485,
3834,
471,
365,
6315,
588,
40,
1448,
13332,
... |
p0 = [2.4E-10, 2.4E-10, 1, 2, 1, 2, 3, 4, 1, 2] | def fit_pot(p0, x, y, x_len, func): from scipy import optimize opt_p, cov_x, infodict, mesg, s = optimize.leastsq(pot_error, p0, args=(x, y, x_len, func), full_output=1, maxfev=0) print mesg return opt_p | 68f88e915b783e3df9e9c6e12b56526e76554943 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1255/68f88e915b783e3df9e9c6e12b56526e76554943/peierls_pot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4845,
67,
13130,
12,
84,
20,
16,
619,
16,
677,
16,
619,
67,
1897,
16,
1326,
4672,
628,
10966,
1930,
10979,
2153,
67,
84,
16,
10613,
67,
92,
16,
8286,
369,
933,
16,
15216,
75,
16,
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,
4845,
67,
13130,
12,
84,
20,
16,
619,
16,
677,
16,
619,
67,
1897,
16,
1326,
4672,
628,
10966,
1930,
10979,
2153,
67,
84,
16,
10613,
67,
92,
16,
8286,
369,
933,
16,
15216,
75,
16,
2... | |
for package in replacePackages: if package in subViewContent: toIndex = subViewContent.index(package) subViewContent[toIndex] = collapsePackage | for package in replacePackages: if package in subViewContent: toIndex = subViewContent.index(package) subViewContent[toIndex] = collapsePackage | def processViews(viewDefs, loadDeps, runDeps, collapseViews, outputFile): global classes # Build bitmask ids for views viewBits = {} viewPos = 0 for viewId in viewDefs: viewBits[viewId] = 1<<viewPos viewPos += 1 # Find all used classes # Used to reduce loop size for further iterations (not using huge 'classes') print ">>> Analysing %s views..." % len(viewDefs) combinedDefs = [] for viewId in viewDefs: combinedDefs.extend(viewDefs[viewId]) combinedClasses = resolveDependencies(combinedDefs, [], loadDeps, runDeps) print " - Number of classes: %s" % len(combinedClasses) # Caching dependencies of each view viewDeps = {} for viewId in viewDefs: # Exclude all features of other views # and handle dependencies the smart way => # also exclude classes only needed by the # already excluded features viewExcludes = [] for subViewId in viewDefs: if subViewId != viewId: viewExcludes.extend(viewDefs[subViewId]) # Finally resolve the dependencies viewDeps[viewId] = resolveDependencies(viewDefs[viewId], viewExcludes, loadDeps, runDeps) print " - %s[#%s] needs %s classes" % (viewId, viewBits[viewId], len(viewDeps[viewId])) # Assign classes to packages packageClasses = {} for classId in combinedClasses: packageId = 0 # Iterate through the views use needs this class for viewId in viewDefs: if classId in viewDeps[viewId]: packageId += viewBits[viewId] # Create missing data structure if not packageClasses.has_key(packageId): packageClasses[packageId] = [] # Finally store the class to the package packageClasses[packageId].append(classId) # Assign packages to views viewPackages = {} for viewId in viewDefs: viewBit = viewBits[viewId] for packageId in packageClasses: if packageId&viewBit: if not viewPackages.has_key(viewId): viewPackages[viewId] = [] viewPackages[viewId].insert(0, packageId) print ">>> Package content:" for packageId in packageClasses: print " - package #%s contains %s classes" % (packageId, len(packageClasses[packageId])) print ">>> View content:" for viewId in viewPackages: print " - view '%s' uses these packages %s" % (viewId, viewPackages[viewId]) for viewId in collapseViews: print ">>> Collapsing view '%s'..." % viewId collapsePackage = viewPackages[viewId][0] replacePackages = viewPackages[viewId][1:] print " - Modifying other views..." # Replace other package content for subViewId in viewDefs: subViewContent = viewPackages[subViewId] for package in replacePackages: if package in subViewContent: toIndex = subViewContent.index(package) subViewContent[toIndex] = collapsePackage # Remove duplicate if subViewContent.count(collapsePackage) > 1: subViewContent.reverse() subViewContent.remove(collapsePackage) subViewContent.reverse() print " - Merging collapsed packages..." for packageId in replacePackages: packageClasses[collapsePackage].extend(packageClasses[packageId]) del packageClasses[packageId] print ">>> Package content:" for packageId in packageClasses: print " - package #%s contains %s classes" % (packageId, len(packageClasses[packageId])) print ">>> View content:" for viewId in viewPackages: print " - view '%s' uses these packages %s" % (viewId, viewPackages[viewId]) # Compile files... revertedPackages = [] for packageId in packageClasses: revertedPackages.insert(0, packageId) packageLoaderContent = "" for packageId in revertedPackages: packageFile = outputFile.replace(".js", "_%s.js" % packageId) print ">>> Compiling classes of package #%s..." % packageId compiledContent = compileClasses(sortClasses(packageClasses[packageId], loadDeps, runDeps)) print " - Storing result (%s KB) to %s" % ((len(compiledContent) / 1024), packageFile) filetool.save(packageFile, compiledContent) # TODO: Make configurable prefix = "script/" packageLoaderContent += "document.write('<script type=\"text/javascript\" src=\"%s\"></script>');\n" % (prefix + packageFile) print ">>> Creating package loader..." filetool.save(outputFile, packageLoaderContent) | 978820638d4273f641ce423ff1160600bf29af2f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/978820638d4273f641ce423ff1160600bf29af2f/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
9959,
12,
1945,
14554,
16,
1262,
14430,
16,
1086,
14430,
16,
13627,
9959,
16,
15047,
4672,
2552,
3318,
282,
468,
3998,
24941,
3258,
364,
7361,
1476,
6495,
273,
2618,
1476,
1616,
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,
1207,
9959,
12,
1945,
14554,
16,
1262,
14430,
16,
1086,
14430,
16,
13627,
9959,
16,
15047,
4672,
2552,
3318,
282,
468,
3998,
24941,
3258,
364,
7361,
1476,
6495,
273,
2618,
1476,
1616,
273,... |
price_type_id=self.pool.get('res.users').browse(cr,users,users).company_id.property_valuation_price_type.id pricetype=self.pool.get('product.price.type').browse(cr,uid,price_type_id) context['currency_id']=move_line.company_id.currency_id.id amount_unit=move_line.product_id.price_get(pricetype.field, context)[move_line.product_id.id] | price_type_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.property_valuation_price_type.id pricetype = self.pool.get('product.price.type').browse(cr, uid, price_type_id) context['currency_id'] = move_line.company_id.currency_id.id amount_unit = move_line.product_id.price_get(pricetype.field, context)[move_line.product_id.id] | def _get_price_unit_invoice(self, cursor, user, move_line, type): '''Return the price unit for the move line''' if type in ('in_invoice', 'in_refund'): # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,users,users).company_id.property_valuation_price_type.id pricetype=self.pool.get('product.price.type').browse(cr,uid,price_type_id) context['currency_id']=move_line.company_id.currency_id.id amount_unit=move_line.product_id.price_get(pricetype.field, context)[move_line.product_id.id] return amount_unit else: return move_line.product_id.list_price | 18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
8694,
67,
4873,
67,
16119,
12,
2890,
16,
3347,
16,
729,
16,
3635,
67,
1369,
16,
618,
4672,
9163,
990,
326,
6205,
2836,
364,
326,
3635,
980,
26418,
309,
618,
316,
7707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8694,
67,
4873,
67,
16119,
12,
2890,
16,
3347,
16,
729,
16,
3635,
67,
1369,
16,
618,
4672,
9163,
990,
326,
6205,
2836,
364,
326,
3635,
980,
26418,
309,
618,
316,
7707,
... |
self.assert_(not debugger.enabled) | self.assert_(not debugger.enabled) | def testEventDispatch(self): global debugger self.assert_(not debugger.enabled) debugger.onBreak = lambda evt: self.processDebugEvent(evt) debugger.onException = lambda evt: self.processDebugEvent(evt) debugger.onNewFunction = lambda evt: self.processDebugEvent(evt) debugger.onBeforeCompile = lambda evt: self.processDebugEvent(evt) debugger.onAfterCompile = lambda evt: self.processDebugEvent(evt) with JSContext() as ctxt: debugger.enabled = True self.assertEquals(3, int(ctxt.eval("function test() { text = \"1+2\"; return eval(text) } test()"))) debugger.enabled = False self.assertRaises(JSError, JSContext.eval, ctxt, "throw 1") self.assert_(not debugger.enabled) self.assertEquals(4, len(self.events)) | 550f86f8e1997ee990877076421feaf1936da8eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5451/550f86f8e1997ee990877076421feaf1936da8eb/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1133,
5325,
12,
2890,
4672,
2552,
19977,
225,
365,
18,
11231,
67,
12,
902,
19977,
18,
5745,
13,
225,
19977,
18,
265,
7634,
273,
3195,
6324,
30,
365,
18,
2567,
2829,
1133,
12,
73,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1133,
5325,
12,
2890,
4672,
2552,
19977,
225,
365,
18,
11231,
67,
12,
902,
19977,
18,
5745,
13,
225,
19977,
18,
265,
7634,
273,
3195,
6324,
30,
365,
18,
2567,
2829,
1133,
12,
73,... |
), resolved_A_PTR) | ), resolved_A_PTR, servers) | def resolved_A_PTR (request_A_PTR): try: iprev = request_A_PTR.dns_resources[0] except: reversed (None) return if iprev == ip: reversed (ip) else: reversed (None) | 31878e3cb55b5a8f9908c961bc29c9d5d10b55b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/31878e3cb55b5a8f9908c961bc29c9d5d10b55b4/dns_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4640,
67,
37,
67,
1856,
54,
261,
2293,
67,
37,
67,
1856,
54,
4672,
775,
30,
277,
10001,
273,
590,
67,
37,
67,
1856,
54,
18,
14926,
67,
4683,
63,
20,
65,
1335,
30,
9553,
261,
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,
4640,
67,
37,
67,
1856,
54,
261,
2293,
67,
37,
67,
1856,
54,
4672,
775,
30,
277,
10001,
273,
590,
67,
37,
67,
1856,
54,
18,
14926,
67,
4683,
63,
20,
65,
1335,
30,
9553,
261,
7036,
... |
def getFileSummary(self,lfns,connection=False): | def getFileSummary( self, lfns, connection = False ): | def getFileSummary(self,lfns,connection=False): """ Get file status summary in all the transformations """ connection = self.__getConnection(connection) condDict = {'LFN':lfns} res = self.getTransformationFiles(self,condDict=condDict,connection=connection) if not res['OK']: return res resDict = {} for fileDict in res['Value']: lfn = fileDict['LFN'] transID = fileDict['TransformationID'] if not resDict.has_key(lfn): resDict[lfn] = {} if not resDict[lfn].has_key(transID): resDict[lfn][transID] = {} resDict[lfn][transID] = fileDict failedDict = {} for lfn in lfns: if not resDict.has_key(lfn): failedDict[lfn] = 'Did not exist in the Transformation database' return S_OK({'Successful':resDict,'Failed':failedDict}) | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
4733,
12,
365,
16,
18594,
2387,
16,
1459,
273,
1083,
262,
30,
3536,
968,
585,
1267,
4916,
316,
777,
326,
19245,
3536,
1459,
273,
365,
16186,
588,
1952,
12,
4071,
13,
6941,
5014,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
4733,
12,
365,
16,
18594,
2387,
16,
1459,
273,
1083,
262,
30,
3536,
968,
585,
1267,
4916,
316,
777,
326,
19245,
3536,
1459,
273,
365,
16186,
588,
1952,
12,
4071,
13,
6941,
5014,
... |
d = defer.Deferred() d.addCallback(self.loginClient) d.addErrback(self.catchErrors) factory = ChandlerIMAP4Factory(d, self.log, useSSL) | d = defer.Deferred().addCallbacks(self.loginClient, self.catchErrors) self.factory = ChandlerIMAP4Factory(d, self.log, useSSL) | def __getMail(self): | cd0d773c52b7eb7870b5e37e0d7c668e7d25477c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/cd0d773c52b7eb7870b5e37e0d7c668e7d25477c/imap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
6759,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
6759,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
readonly = readonly or access_pool.check_groups(cr, user, group) if not readonly: | can_see = can_see or access_pool.check_groups(cr, user, group) if can_see: break if not can_see: | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') readonly = False access_pool = self.pool.get('ir.model.access') for group in groups: readonly = readonly or access_pool.check_groups(cr, user, group) if not readonly: node.set('invisible', '1') del(node.attrib['groups']) | da17e9c16111f90886f68e1db761e6673b89fa21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/da17e9c16111f90886f68e1db761e6673b89fa21/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
17102,
273,
1083,
2006,
67,
6011,
273,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
17102,
273,
1083,
2006,
67,
6011,
273,
365,
18... |
return addinfo(open(file, 'r'), noheaders()) | return addinfo(open(_fixpath(file), 'r'), noheaders()) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfo(open(file, 'r'), noheaders()) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfo(open(file, 'r'), noheaders()) raise IOError, ('local file error', 'not on local host') | dc3e3f69db6a6aa5aed1d604d53c0b4cf156add8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc3e3f69db6a6aa5aed1d604d53c0b4cf156add8/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1479,
16,
585,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
327,
527,
1376,
12,
3190,
24899,
904,
803,
12,
768,
3631,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3729,
67,
768,
12,
2890,
16,
880,
4672,
1479,
16,
585,
273,
6121,
483,
669,
12,
718,
13,
309,
486,
1479,
30,
327,
527,
1376,
12,
3190,
24899,
904,
803,
12,
768,
3631,
296,
... |
return Session.query(SpecialRegistration).order_by(SpecialRegistration.display_order).order_by(SpecialRegistration.name).all() | return Session.query(SpecialRegistration).all() | def find_all(self): return Session.query(SpecialRegistration).order_by(SpecialRegistration.display_order).order_by(SpecialRegistration.name).all() | 0fe1524dae44f66fd3f5387149abc63629129ba6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12856/0fe1524dae44f66fd3f5387149abc63629129ba6/special_registration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
454,
12,
2890,
4672,
327,
3877,
18,
2271,
12,
12193,
7843,
2934,
1019,
67,
1637,
12,
12193,
7843,
18,
5417,
67,
1019,
2934,
1019,
67,
1637,
12,
12193,
7843,
18,
529,
2934,
45... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1104,
67,
454,
12,
2890,
4672,
327,
3877,
18,
2271,
12,
12193,
7843,
2934,
1019,
67,
1637,
12,
12193,
7843,
18,
5417,
67,
1019,
2934,
1019,
67,
1637,
12,
12193,
7843,
18,
529,
2934,
45... |
if is_instvar: if self.comments_include_docstring(comments): self.set_variable(lhs_parent, var_doc) else: | if not is_instvar or self.comments_include_docstring(comments): | def process_assignment(self, line, parent_docs, prev_line_doc, lineno, comments, decorators): # If we're not in a namespace, then ignore it. if not (isinstance(parent_docs[-1], NamespaceDoc) or (isinstance(parent_docs[-1], InstanceMethodDoc) and parent_docs[-1].canonical_name != UNKNOWN and parent_docs[-1].canonical_name[-1] == '__init__')): return None | 8aea11fb7527a8766f178e72bab2db07263bf944 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/8aea11fb7527a8766f178e72bab2db07263bf944/docparser_quick.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
12960,
12,
2890,
16,
980,
16,
982,
67,
8532,
16,
2807,
67,
1369,
67,
2434,
16,
7586,
16,
5678,
16,
19423,
4672,
468,
971,
732,
4565,
486,
316,
279,
1981,
16,
1508,
2305,
51... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
12960,
12,
2890,
16,
980,
16,
982,
67,
8532,
16,
2807,
67,
1369,
67,
2434,
16,
7586,
16,
5678,
16,
19423,
4672,
468,
971,
732,
4565,
486,
316,
279,
1981,
16,
1508,
2305,
51... |
return apply(SaveAs, (), options).show() | return SaveAs(**options).show() | def asksaveasfilename(**options): "Ask for a filename to save as" return apply(SaveAs, (), options).show() | 25ee87cc50ab99a1342091b5067c074878c9b212 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/25ee87cc50ab99a1342091b5067c074878c9b212/tkFileDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6827,
5688,
345,
3459,
12,
636,
2116,
4672,
315,
23663,
364,
279,
1544,
358,
1923,
487,
6,
225,
327,
7074,
1463,
12,
636,
2116,
2934,
4500,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
6827,
5688,
345,
3459,
12,
636,
2116,
4672,
315,
23663,
364,
279,
1544,
358,
1923,
487,
6,
225,
327,
7074,
1463,
12,
636,
2116,
2934,
4500,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
... |
self.hamster=dbus.SessionBus().get_object(tmp_dbus[0], tmp_dbus[1]) | dbus.SessionBus().get_object(tmp_dbus[0], tmp_dbus[1]) | def recheckPluginsErrors(self, plugins, plugin_api): for plugin in plugins: if plugin['error']: error = False missing = [] missing_dbus = [] | 6ee3bd6ad88495bc7319b4d9345f2c1b25932dec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/6ee3bd6ad88495bc7319b4d9345f2c1b25932dec/engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1893,
9461,
4229,
12,
2890,
16,
4799,
16,
1909,
67,
2425,
4672,
364,
1909,
316,
4799,
30,
309,
1909,
3292,
1636,
3546,
30,
555,
273,
1083,
3315,
273,
5378,
3315,
67,
1966,
407,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
283,
1893,
9461,
4229,
12,
2890,
16,
4799,
16,
1909,
67,
2425,
4672,
364,
1909,
316,
4799,
30,
309,
1909,
3292,
1636,
3546,
30,
555,
273,
1083,
3315,
273,
5378,
3315,
67,
1966,
407,
27... |
__metaclass__ = _dufus | __metaclass__ = _StaticBase | def __new__(self, name, bases, dict): return object.__new__(_StaticBase) | 5066ef74c572a607472dda13463c4b587e2a0f3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/5066ef74c572a607472dda13463c4b587e2a0f3e/static.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
2890,
16,
508,
16,
8337,
16,
2065,
4672,
327,
733,
16186,
2704,
972,
24899,
5788,
2171,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
2890,
16,
508,
16,
8337,
16,
2065,
4672,
327,
733,
16186,
2704,
972,
24899,
5788,
2171,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rsp = self.apiGet("groups/invalidgroup/star") | rsp = self.apiGet("groups/invalidgroup/star", expected_status=404) | def testGroupStarDoesNotExist(self): """Testing the groups/star API with Does Not Exist error""" rsp = self.apiGet("groups/invalidgroup/star") self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], webapi.DOES_NOT_EXIST.code) | 21b56ac1dbc418157976dcd64bb81c1d6995a975 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/21b56ac1dbc418157976dcd64bb81c1d6995a975/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1114,
18379,
15264,
12,
2890,
4672,
3536,
22218,
326,
3252,
19,
10983,
1491,
598,
9637,
2288,
22558,
555,
8395,
12049,
273,
365,
18,
2425,
967,
2932,
4650,
19,
5387,
1655,
19,
10983,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1114,
18379,
15264,
12,
2890,
4672,
3536,
22218,
326,
3252,
19,
10983,
1491,
598,
9637,
2288,
22558,
555,
8395,
12049,
273,
365,
18,
2425,
967,
2932,
4650,
19,
5387,
1655,
19,
10983,... |
if not self.toolong: | if not toolong: if v1 and v2 and (not color1 != color2): drawcylinder(color1, a1pos, a2pos, TubeRadius) else: if v1: drawcylinder(color1, a1pos, center, TubeRadius) if v2: drawcylinder(color2, a2pos, center, TubeRadius) if not (v1 and v2): drawsphere(black, center, TubeRadius, level) else: drawcylinder(red, c1, c2, TubeRadius) | via dispdef from the calling molecule -- this might cause bugs if some | 8458fbfe4c9e599a4e7092a28b468082d5fe6e91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/8458fbfe4c9e599a4e7092a28b468082d5fe6e91/bonds.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3970,
16232,
536,
628,
326,
4440,
13661,
1493,
333,
4825,
4620,
22398,
309,
2690,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3970,
16232,
536,
628,
326,
4440,
13661,
1493,
333,
4825,
4620,
22398,
309,
2690,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
execute_command('sudo', '-u', CFG_OPENOFFICE_USER, CFG_PATH_OPENOFFICE_PYTHON, 'import os; open(os.path.join(%s, "test"), "w").write(%s)' % (repr(CFG_OPENOFFICE_TMPDIR), repr(now))) | execute_command('sudo', '-u', CFG_OPENOFFICE_USER, CFG_PATH_OPENOFFICE_PYTHON, '-c', 'import os; open(os.path.join(%s, "test"), "w").write(%s)' % (repr(CFG_OPENOFFICE_TMPDIR), repr(now))) | def check_openoffice_tmpdir(): """Return True if OpenOffice tmpdir do exists and OpenOffice can successfully create file there.""" if not os.path.exists(CFG_OPENOFFICE_TMPDIR): raise InvenioWebSubmitFileConverterError('%s does not exists' % CFG_OPENOFFICE_TMPDIR) if not os.path.isdir(CFG_OPENOFFICE_TMPDIR): raise InvenioWebSubmitFileConverterError('%s is not a directory' % CFG_OPENOFFICE_TMPDIR) now = str(time.time()) execute_command('sudo', '-u', CFG_OPENOFFICE_USER, CFG_PATH_OPENOFFICE_PYTHON, 'import os; open(os.path.join(%s, "test"), "w").write(%s)' % (repr(CFG_OPENOFFICE_TMPDIR), repr(now))) try: test = open(os.path.join(CFG_OPENOFFICE_TMPDIR, 'test')).read() if test != now: raise IOError except: raise InvenioWebSubmitFileConverterError("%s can't be properly written by OpenOffice.org or read by Apache" % CFG_OPENOFFICE_TMPDIR) | 01f02957ef0b32e2b1626199461ef6962e8d2a98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/01f02957ef0b32e2b1626199461ef6962e8d2a98/websubmit_file_converter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
3190,
19789,
67,
5645,
1214,
13332,
3536,
990,
1053,
309,
3502,
30126,
20213,
741,
1704,
471,
3502,
30126,
848,
4985,
752,
585,
1915,
12123,
309,
486,
1140,
18,
803,
18,
1808,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
3190,
19789,
67,
5645,
1214,
13332,
3536,
990,
1053,
309,
3502,
30126,
20213,
741,
1704,
471,
3502,
30126,
848,
4985,
752,
585,
1915,
12123,
309,
486,
1140,
18,
803,
18,
1808,
1... |
dispatcher.add_message_handler(self.form_pattern, self.form) | if self.form_pattern: dispatcher.add_message_handler(self.form_pattern, self.form) else: self.warning("add_message_handler_to was called with no form_patterns. Have you loaded your fixtures?") | def add_message_handler_to(self, dispatcher): dispatcher.add_message_handler(self.form_pattern, self.form) | e6c75b55ef361c584aaefb6fe3c5ef5506aad945 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/e6c75b55ef361c584aaefb6fe3c5ef5506aad945/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2150,
67,
4176,
67,
869,
12,
2890,
16,
7393,
4672,
309,
365,
18,
687,
67,
4951,
30,
7393,
18,
1289,
67,
2150,
67,
4176,
12,
2890,
18,
687,
67,
4951,
16,
365,
18,
687,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2150,
67,
4176,
67,
869,
12,
2890,
16,
7393,
4672,
309,
365,
18,
687,
67,
4951,
30,
7393,
18,
1289,
67,
2150,
67,
4176,
12,
2890,
18,
687,
67,
4951,
16,
365,
18,
687,
13,
... |
j = i.name.find('/') dir = '%s/%s/%s' % (path,buildtarget,i.name[:j]) | tmpname = i.name j = tmpname.find('/') if j != -1: tmpname = tmpname[:j] dir = '%s/%s/%s' % (path,buildtarget,tmpname) | def build_action(source, target, env): '''Perform the build''' debug(1, 'build_action') if len(source) != 1: raise 'Builder only supports a single source file.' buildtarget = env.Dictionary().get('buildtarget','') patches = env.Dictionary().get('patches',[]) path = env.Dictionary().get('builddir','') cross = env.Dictionary().get('cross','') prefix = env.Dictionary().get('prefix','') cmd = env.Dictionary().get('command','') flagfile = '%s/%s/flag_keep_buildtree' % (path,buildtarget) src = str(source[0]) i = src.rfind('.') + 1 ext = src[i:] tar = tarfile.open(src, 'r:%s' % ext) for i in tar: j = i.name.find('/') dir = '%s/%s/%s' % (path,buildtarget,i.name[:j]) break if os.path.exists(dir): os.system('rm -rf %s' % dir) for i in tar: tar.extract(i,'%s/%s' % (path,buildtarget)) tar.close() for i in patches: os.system('cd %s && patch -p1 < ../../%s' % (dir,i)) cc = cross + 'gcc' command = 'CROSS=%s CROSS_PREFIX=%s CC=%s INSTALL_PREFIX=%s sh -c "cd %s' % (cross,cross,cc,prefix,dir) for i in cmd: command += ' && %s' % i command += '"' debug(2, command) build = os.system(command) #Delete directory full of intermediary files, it'll be deleted if this is #ever rebuilt anyway, so there's no reason to keep it around if (build == 0) and os.path.exists(dir) and not os.path.exists(flagfile): os.system('rm -rf %s' % dir) return None | 34acf86f46ad70d0f72fcd5be0547d300efdbc55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11786/34acf86f46ad70d0f72fcd5be0547d300efdbc55/oss.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1128,
12,
3168,
16,
1018,
16,
1550,
4672,
9163,
4990,
326,
1361,
26418,
1198,
12,
21,
16,
296,
3510,
67,
1128,
6134,
309,
562,
12,
3168,
13,
480,
404,
30,
1002,
296,
1263,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1128,
12,
3168,
16,
1018,
16,
1550,
4672,
9163,
4990,
326,
1361,
26418,
1198,
12,
21,
16,
296,
3510,
67,
1128,
6134,
309,
562,
12,
3168,
13,
480,
404,
30,
1002,
296,
1263,
... |
if yflip: def fy(y): return self.SCALE * (self.HEIGHT - 1 - y) else: def fy(y): return self.SCALE * y | def fx(x): return self.SCALE * x | f3eeb04707884fb7833f737347fd9735848b706e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/f3eeb04707884fb7833f737347fd9735848b706e/dimensions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12661,
12,
92,
4672,
327,
365,
18,
19378,
380,
619,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12661,
12,
92,
4672,
327,
365,
18,
19378,
380,
619,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
for name in os.listdir(dir): spec = os.path.join(dir, name, name + '.devhelp') if os.path.isfile(spec): self._path_hash[name] = spec enum.append(name) | if os.path.isdir(dir): for name in os.listdir(dir): spec = os.path.join(dir, name, name + '.devhelp') if os.path.isfile(spec): self._path_hash[name] = spec enum.append(name) | def enumerate_uncached(self): enum = Book.List() self._path_hash = {} for dir in self._search_path: for name in os.listdir(dir): spec = os.path.join(dir, name, name + '.devhelp') if os.path.isfile(spec): self._path_hash[name] = spec enum.append(name) | a25bd38bd619231e6d4b473db100ff0a20d46438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/a25bd38bd619231e6d4b473db100ff0a20d46438/DevHelp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4241,
67,
551,
2004,
12,
2890,
4672,
2792,
273,
20258,
18,
682,
1435,
225,
365,
6315,
803,
67,
2816,
273,
2618,
364,
1577,
316,
365,
6315,
3072,
67,
803,
30,
364,
508,
316,
1140,
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,
4241,
67,
551,
2004,
12,
2890,
4672,
2792,
273,
20258,
18,
682,
1435,
225,
365,
6315,
803,
67,
2816,
273,
2618,
364,
1577,
316,
365,
6315,
3072,
67,
803,
30,
364,
508,
316,
1140,
18,
... |
Returns boolean value of "item in self" | Returns boolean value of ``item`` in ``self``. | def __contains__(self, item): """ Returns boolean value of "item in self" EXAMPLES:: sage: G = SymmetricGroup(16) sage: g = G.gen(0) sage: h = G.gen(1) sage: g^7*h*g*h in G True sage: G = SymmetricGroup(4) sage: g = G((1,2,3,4)) sage: h = G((1,2)) sage: H = PermutationGroup([[(1,2,3,4)], [(1,2),(3,4)]]) sage: g in H True sage: h in H False """ try: item = self(item, check=True) except: return False return True | 1a05983ebb3835bbd44e7ffd0287f6bbaee2ac36 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/1a05983ebb3835bbd44e7ffd0287f6bbaee2ac36/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12298,
972,
12,
2890,
16,
761,
4672,
3536,
2860,
1250,
460,
434,
12176,
1726,
10335,
316,
12176,
2890,
68,
8338,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
611,
273,
10042,
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,
12298,
972,
12,
2890,
16,
761,
4672,
3536,
2860,
1250,
460,
434,
12176,
1726,
10335,
316,
12176,
2890,
68,
8338,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
611,
273,
10042,
6... |
ord = 1 computes the largest row sum ord = -1 computes the smallest row sum ord = Inf computes the largest column sum ord = -Inf computes the smallest column sum | ord = 1 computes the largest column sum of absolute values ord = -1 computes the smallest column sum of absolute values ord = Inf computes the largest row sum of absolute values ord = -Inf computes the smallest row sum of absolute values | def norm(x, ord=2): """ norm(x, ord=2) -> n Matrix and vector norm. Inputs: x -- a rank-1 (vector) or rank-2 (matrix) array ord -- the order of norm. Comments: For vectors ord can be any real number including Inf or -Inf. ord = Inf, computes the maximum of the magnitudes ord = -Inf, computes minimum of the magnitudes ord is finite, computes sum(abs(x)**ord)**(1.0/ord) For matrices ord can only be + or - 1, 2, Inf. ord = 2 computes the largest singular value ord = -2 computes the smallest singular value ord = 1 computes the largest row sum ord = -1 computes the smallest row sum ord = Inf computes the largest column sum ord = -Inf computes the smallest column sum """ x = asarray(x) nd = len(x.shape) Inf = scipy_base.Inf if nd == 1: if ord == Inf: return scipy_base.amax(abs(x)) elif ord == -Inf: return scipy_base.amin(abs(x)) else: return scipy_base.sum(abs(x)**ord)**(1.0/ord) elif nd == 2: if ord == 2: return scipy_base.amax(decomp.svd(x)[1]) elif ord == -2: return scipy_base.amin(decomp.svd(x)[1]) elif ord == 1: return scipy_base.amax(scipy_base.sum(abs(x))) elif ord == Inf: return scipy_base.amax(scipy_base.sum(abs(x),axis=1)) elif ord == -1: return scipy_base.amin(scipy_base.sum(abs(x))) elif ord == -Inf: return scipy_base.amin(scipy_base.sum(abs(x),axis=1)) else: raise ValueError, "Invalid norm order for matrices." else: raise ValueError, "Improper number of dimensions to norm." | 452748c71b17d9f7d20ea4ccaf500e7805c8bcf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/452748c71b17d9f7d20ea4ccaf500e7805c8bcf7/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4651,
12,
92,
16,
4642,
33,
22,
4672,
3536,
4651,
12,
92,
16,
4642,
33,
22,
13,
317,
290,
225,
7298,
471,
3806,
4651,
18,
225,
24472,
30,
225,
619,
1493,
279,
6171,
17,
21,
261,
77... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4651,
12,
92,
16,
4642,
33,
22,
4672,
3536,
4651,
12,
92,
16,
4642,
33,
22,
13,
317,
290,
225,
7298,
471,
3806,
4651,
18,
225,
24472,
30,
225,
619,
1493,
279,
6171,
17,
21,
261,
77... |
layer.setUp() | if hasattr(layer, 'setUp'): layer.setUp() | def setup_layer(layer, setup_layers): if layer not in setup_layers: for base in layer.__bases__: setup_layer(base, setup_layers) print " Set up %s" % name_from_layer(layer), t = time.time() layer.setUp() print "in %.3f seconds." % (time.time() - t) setup_layers[layer] = 1 | 692d69b46acadd02ecc0810f85282f5a7aec22ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10007/692d69b46acadd02ecc0810f85282f5a7aec22ad/testrunner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
6363,
12,
6363,
16,
3875,
67,
10396,
4672,
309,
3018,
486,
316,
3875,
67,
10396,
30,
364,
1026,
316,
3018,
16186,
18602,
972,
30,
3875,
67,
6363,
12,
1969,
16,
3875,
67,
1039... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
6363,
12,
6363,
16,
3875,
67,
10396,
4672,
309,
3018,
486,
316,
3875,
67,
10396,
30,
364,
1026,
316,
3018,
16186,
18602,
972,
30,
3875,
67,
6363,
12,
1969,
16,
3875,
67,
1039... |
cls.add_method('WifiLogComponentEnable', 'void', [], is_const=True) | cls.add_method('EnableLogComponents', 'void', [], is_static=True) | def register_Ns3WifiHelper_methods(root_module, cls): ## wifi-helper.h: ns3::WifiHelper::WifiHelper(ns3::WifiHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiHelper const &', 'arg0')]) ## wifi-helper.h: ns3::WifiHelper::WifiHelper() [constructor] cls.add_constructor([]) ## wifi-helper.h: static ns3::WifiHelper ns3::WifiHelper::Default() [member function] cls.add_method('Default', 'ns3::WifiHelper', [], is_static=True) ## wifi-helper.h: void ns3::WifiHelper::SetRemoteStationManager(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] cls.add_method('SetRemoteStationManager', 'void', [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')]) ## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::WifiPhyHelper const & phy, ns3::WifiMacHelper const & mac, ns3::NodeContainer c) const [member function] cls.add_method('Install', 'ns3::NetDeviceContainer', [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('ns3::NodeContainer', 'c')], is_const=True) ## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::WifiPhyHelper const & phy, ns3::WifiMacHelper const & mac, ns3::Ptr<ns3::Node> node) const [member function] cls.add_method('Install', 'ns3::NetDeviceContainer', [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) ## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::WifiPhyHelper const & phy, ns3::WifiMacHelper const & mac, std::string nodeName) const [member function] cls.add_method('Install', 'ns3::NetDeviceContainer', [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('std::string', 'nodeName')], is_const=True) ## wifi-helper.h: void ns3::WifiHelper::WifiLogComponentEnable() const [member function] cls.add_method('WifiLogComponentEnable', 'void', [], is_const=True) return | e42fb69415b006dc5bd4713027300f20fd7e7125 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7746/e42fb69415b006dc5bd4713027300f20fd7e7125/ns3_module_helper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
67,
10386,
23,
59,
704,
2276,
67,
5163,
12,
3085,
67,
2978,
16,
2028,
4672,
7541,
341,
704,
17,
4759,
18,
76,
30,
3153,
23,
2866,
59,
704,
2276,
2866,
59,
704,
2276,
12,
2387,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
67,
10386,
23,
59,
704,
2276,
67,
5163,
12,
3085,
67,
2978,
16,
2028,
4672,
7541,
341,
704,
17,
4759,
18,
76,
30,
3153,
23,
2866,
59,
704,
2276,
2866,
59,
704,
2276,
12,
2387,
... |
group0.setTexture(texture1) group1.setTexture(texture1) group2.setTexture(texture2) group3.setTexture(texture2) | kickers[0].setTexture(texture1) kickers[1].setTexture(texture1) kickers[2].setTexture(texture2) kickers[3].setTexture(texture2) | def resetGameColours(group0, group1, group2, group3, texture1, texture2): #TODO: make this callable at any point in time to "turn" the table if role == ROLE_SERVER or MY_POSITION==1: group0.setTexture(texture1) group1.setTexture(texture1) group2.setTexture(texture2) group3.setTexture(texture2) else: group0.setTexture(texture2) group1.setTexture(texture2) group2.setTexture(texture1) group3.setTexture(texture1) | 73d04275d5aecffbeaa4958b270fc22e07a236dc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12834/73d04275d5aecffbeaa4958b270fc22e07a236dc/kickern.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
12496,
914,
4390,
12,
1655,
20,
16,
1041,
21,
16,
1041,
22,
16,
1041,
23,
16,
11428,
21,
16,
11428,
22,
4672,
468,
6241,
30,
1221,
333,
4140,
622,
1281,
1634,
316,
813,
358,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
12496,
914,
4390,
12,
1655,
20,
16,
1041,
21,
16,
1041,
22,
16,
1041,
23,
16,
11428,
21,
16,
11428,
22,
4672,
468,
6241,
30,
1221,
333,
4140,
622,
1281,
1634,
316,
813,
358,
31... |
sf = COA_MARKER_SF * coaDist * math.tan(deg2Rad(direct.drList.getCurrentDr().fovV)) | sf = COA_MARKER_SF * coaDist * (direct.drList.getCurrentDr().fovV/30.0) | def updateCoaMarkerSize(self, coaDist = None): if not coaDist: coaDist = Vec3(self.coaMarker.getPos(direct.camera)).length() # KEH: use current display region for fov # sf = COA_MARKER_SF * coaDist * math.tan(deg2Rad(direct.dr.fovV)) sf = COA_MARKER_SF * coaDist * math.tan(deg2Rad(direct.drList.getCurrentDr().fovV)) if sf == 0.0: sf = 0.1 self.coaMarker.setScale(sf) # Lerp color to fade out self.coaMarker.lerpColor(VBase4(1,0,0,1), VBase4(1,0,0,0), 3.0, task = 'fadeAway') | ae4e0deb32f6306e4672ab5e5851f3a368146d50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/ae4e0deb32f6306e4672ab5e5851f3a368146d50/DirectCameraControl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
4249,
69,
7078,
1225,
12,
2890,
16,
1825,
69,
5133,
273,
599,
4672,
309,
486,
1825,
69,
5133,
30,
1825,
69,
5133,
273,
12969,
23,
12,
2890,
18,
2894,
69,
7078,
18,
588,
1616,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
4249,
69,
7078,
1225,
12,
2890,
16,
1825,
69,
5133,
273,
599,
4672,
309,
486,
1825,
69,
5133,
30,
1825,
69,
5133,
273,
12969,
23,
12,
2890,
18,
2894,
69,
7078,
18,
588,
1616,
1... |
m = bounded[0] b_min_x = m.x b_min_y = m.y b_max_x = m.x + m.px_width b_max_y = m.y + m.px_height for m in bounded[1:]: b_min_x = min(b_min_x, m.x) b_min_y = min(b_min_y, m.y) b_max_x = min(b_max_x, m.x + m.px_width) b_max_y = min(b_max_y, m.y + m.px_height) | first = bounded_layers[0] b_min_x = first.origin_x b_min_y = first.origin_y b_max_x = first.origin_x + first.px_width b_max_y = first.origin_y + first.px_height for layer in bounded_layers[1:]: b_min_x = min(b_min_x, layer.origin_x) b_min_y = min(b_min_y, layer.origin_y) b_max_x = min(b_max_x, layer.origin_x + layer.px_width) b_max_y = min(b_max_y, layer.origin_y + layer.px_height) | def set_focus(self, fx, fy): '''Determine the focal point of the view based on focus (fx, fy), and registered layers. | f4cd0dff11905c45ca19857990c8b67fb0643e8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7473/f4cd0dff11905c45ca19857990c8b67fb0643e8d/tiles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
13923,
12,
2890,
16,
12661,
16,
28356,
4672,
9163,
8519,
326,
284,
23735,
1634,
434,
326,
1476,
2511,
603,
7155,
261,
19595,
16,
28356,
3631,
471,
4104,
6623,
18,
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,
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,
444,
67,
13923,
12,
2890,
16,
12661,
16,
28356,
4672,
9163,
8519,
326,
284,
23735,
1634,
434,
326,
1476,
2511,
603,
7155,
261,
19595,
16,
28356,
3631,
471,
4104,
6623,
18,
2,
-100,
-100,... |
classes.append(JsClass(filePath, relPath, self.session)) | classObj = JsClass(filePath, relPath, self.session) className = classObj.getName() classes[className] = classObj | def getClasses(self): try: return self.classes except AttributeError: classPath = os.path.join(self.path, "source", "class") classes = [] classPathLen = len(classPath) + 1 for dirPath, dirNames, fileNames in os.walk(classPath): for dirName in dirNames: if dirName in self.dirFilter: dirNames.remove(dirName) | ce6ddc5dd5613bc0ee91ffee09cb076c12f6397b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/ce6ddc5dd5613bc0ee91ffee09cb076c12f6397b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30561,
12,
2890,
4672,
775,
30,
327,
365,
18,
4701,
225,
1335,
6394,
30,
22503,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
803,
16,
315,
3168,
3113,
315,
1106,
7923,
3318,
273,
5378,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30561,
12,
2890,
4672,
775,
30,
327,
365,
18,
4701,
225,
1335,
6394,
30,
22503,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
803,
16,
315,
3168,
3113,
315,
1106,
7923,
3318,
273,
5378,
... |
c.bookmarkPage("P3_XYZ",fitType="XYZ",top=7*inch,left=3*inch,zoom=0) | c.bookmarkPage("P3_XYZ",fit="XYZ",top=7*inch,left=3*inch,zoom=0) | def test1(self): | b3e8a12158cd0879ec0ae788465c6732c3f6ea3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b3e8a12158cd0879ec0ae788465c6732c3f6ea3f/test_pdfgen_links.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
21,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
21,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
Generally, the returned socket will be passed to tcp_server, | Generally, the returned socket will be passed to ``tcp_server()``, | def ssl_listener(address, certificate, private_key): """Listen on the given (ip, port) address with a TCP socket that can do SSL. Returns a socket object which one should call accept() on to accept a connection on the newly bound socket. Generally, the returned socket will be passed to tcp_server, which accepts connections forever and spawns greenlets for each incoming connection. """ from eventlet import util socket = util.wrap_ssl(util.tcp_socket(), certificate, private_key) util.socket_bind_and_listen(socket, address) socket.is_secure = True return socket | 124e84e88ce31b3c12d0eb9eb3d6a099ef028bc8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/124e84e88ce31b3c12d0eb9eb3d6a099ef028bc8/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5832,
67,
12757,
12,
2867,
16,
4944,
16,
3238,
67,
856,
4672,
3536,
14750,
603,
326,
864,
261,
625,
16,
1756,
13,
1758,
598,
279,
9911,
2987,
716,
848,
741,
7419,
18,
225,
2860,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5832,
67,
12757,
12,
2867,
16,
4944,
16,
3238,
67,
856,
4672,
3536,
14750,
603,
326,
864,
261,
625,
16,
1756,
13,
1758,
598,
279,
9911,
2987,
716,
848,
741,
7419,
18,
225,
2860,
279,
... |
self.typecode += '\n%sZSI.TC.Struct.__init__(self, %s, [%s], pname=name, aname="%%s" %% name, oname=oname )' %( ID3, message.getName(), tcs ) | self.typecode += '\n%sZSI.TC.Struct.__init__(self, %s, [%s], pname=name, aname="%s" %% name, oname=oname )' %( ID3, message.getName(), tcs, self.aname_func("%s") ) | self.typecode += '\n%sdef __init__(self, name=None, ns=None):'\ %(ID1) | f062f4cd5d2c50539a63020b5dfd9d6370b8a9a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/f062f4cd5d2c50539a63020b5dfd9d6370b8a9a7/wsdl2python.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
723,
710,
1011,
2337,
82,
9,
87,
536,
1001,
2738,
972,
12,
2890,
16,
508,
33,
7036,
16,
3153,
33,
7036,
13,
2497,
64,
8975,
734,
21,
13,
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,
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,
365,
18,
723,
710,
1011,
2337,
82,
9,
87,
536,
1001,
2738,
972,
12,
2890,
16,
508,
33,
7036,
16,
3153,
33,
7036,
13,
2497,
64,
8975,
734,
21,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
str = self._table_header(heading, 'details')+'</TABLE>' | str = self._table_header(heading, 'details')+'</table>' | def _func_details(self, functions, cls, heading='Function Details'): """## Return a detailed description of the functions in a class or module.""" functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'details')+'</TABLE>' | 89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
1189,
2000,
279,
6864,
2477,
434,
326,
4186,
316,
279,
667,
578,
1605,
12123,
4186,
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,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
1189,
2000,
279,
6864,
2477,
434,
326,
4186,
316,
279,
667,
578,
1605,
12123,
4186,
273,
... |
>>> root = parse_zeml("1 <b>2</b> 3") | >>> root = parse_zeml("1 <b>2</b> 3", 'system') | def walk(self): yield self for child in _iter_all(self.children): yield child | abf36430eefef44bdd8b82c89e851bdd22c47e4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12815/abf36430eefef44bdd8b82c89e851bdd22c47e4e/zeml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5442,
12,
2890,
4672,
2824,
365,
364,
1151,
316,
389,
2165,
67,
454,
12,
2890,
18,
5906,
4672,
2824,
1151,
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,
5442,
12,
2890,
4672,
2824,
365,
364,
1151,
316,
389,
2165,
67,
454,
12,
2890,
18,
5906,
4672,
2824,
1151,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
filename = "<console | filename = "<pyshell | def runsource(self, source): # Extend base class to stuff the source in the line cache filename = "<console#%d>" % self.gid self.gid = self.gid + 1 lines = string.split(source, "\n") linecache.cache[filename] = len(source)+1, 0, lines, filename self.more = 0 return InteractiveInterpreter.runsource(self, source, filename) | a84175ca990d1123b67751ad21dc0e7edcc8970e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a84175ca990d1123b67751ad21dc0e7edcc8970e/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3168,
12,
2890,
16,
1084,
4672,
468,
27686,
1026,
667,
358,
10769,
326,
1084,
316,
326,
980,
1247,
1544,
273,
3532,
8698,
7,
9,
72,
2984,
738,
365,
18,
15780,
365,
18,
15780,
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,
1086,
3168,
12,
2890,
16,
1084,
4672,
468,
27686,
1026,
667,
358,
10769,
326,
1084,
316,
326,
980,
1247,
1544,
273,
3532,
8698,
7,
9,
72,
2984,
738,
365,
18,
15780,
365,
18,
15780,
273... |
(title, extension) = os.path.splitext(os.path.basename(filename)) | title = filetitle | def get_all_tracks(self): tracks = [] | ac0552b294bca63b2578fcfac92494948fd4037f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/ac0552b294bca63b2578fcfac92494948fd4037f/sync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
454,
67,
21499,
12,
2890,
4672,
13933,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
454,
67,
21499,
12,
2890,
4672,
13933,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
https, Basic, Digest, etc. | HTTPS, Basic, Digest, WSSE, etc. | def request(self, method, request_uri, headers, content): """Modify the request headers to add the appropriate Authorization header.""" headers['Authorization'] = 'WSSE profile="UsernameToken"' iso_now = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) cnonce = _cnonce() password_digest = _wsse_username_token(cnonce, iso_now, self.credentials[1]) headers['X-WSSE'] = 'UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"' % ( self.credentials[0], password_digest, cnonce, iso_now) | 57af8aa0511c03b19b66143584d69a1f7dadec10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13138/57af8aa0511c03b19b66143584d69a1f7dadec10/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
707,
16,
590,
67,
1650,
16,
1607,
16,
913,
4672,
3536,
11047,
326,
590,
1607,
358,
527,
326,
5505,
10234,
1446,
12123,
1607,
3292,
6063,
3546,
273,
296,
2651,
1090,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
707,
16,
590,
67,
1650,
16,
1607,
16,
913,
4672,
3536,
11047,
326,
590,
1607,
358,
527,
326,
5505,
10234,
1446,
12123,
1607,
3292,
6063,
3546,
273,
296,
2651,
1090,
... |
ext = "_%s." % self.ext | ext = "_%sX." % self.ext | def createAsteriskConfig(self): needModule("res_crypto") needModule("chan_sip") | ec6f0737918e61b65379df924529af68293a982b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2627/ec6f0737918e61b65379df924529af68293a982b/cfg_trunk_sip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
37,
8190,
10175,
809,
12,
2890,
4672,
1608,
3120,
2932,
455,
67,
18489,
7923,
1608,
3120,
2932,
7472,
67,
28477,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
37,
8190,
10175,
809,
12,
2890,
4672,
1608,
3120,
2932,
455,
67,
18489,
7923,
1608,
3120,
2932,
7472,
67,
28477,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
((test_module)*3 + (level,)) | ((test_module,)*3 + (level,)) | def module_test(mod_name,mod_file,level=10): """* *""" import os,sys,string #print 'testing', mod_name d,f = os.path.split(mod_file) # add the tests directory to the python path test_dir = os.path.join(d,'tests') sys.path.append(test_dir) # call the "test_xxx.test()" function for the appropriate # module. # This should deal with package naming issues correctly short_mod_name = string.split(mod_name,'.')[-1] test_module = 'test_' + short_mod_name test_string = 'import %s;reload(%s);%s.test(%d)' % \ ((test_module)*3 + (level,)) # This would be better cause it forces a reload of the orginal # module. It doesn't behave with packages however. #test_string = 'reload(%s);import %s;reload(%s);%s.test(%d)' % \ # ((mod_name,) + (test_module,)*3) exec(test_string) # remove test directory from python path. sys.path = sys.path[:-1] | a66dce587128e0df7b614a22fcaca701a449dc90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/a66dce587128e0df7b614a22fcaca701a449dc90/scipy_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1605,
67,
3813,
12,
1711,
67,
529,
16,
1711,
67,
768,
16,
2815,
33,
2163,
4672,
3536,
14,
225,
380,
8395,
1930,
1140,
16,
9499,
16,
1080,
468,
1188,
296,
3813,
310,
2187,
681,
67,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1605,
67,
3813,
12,
1711,
67,
529,
16,
1711,
67,
768,
16,
2815,
33,
2163,
4672,
3536,
14,
225,
380,
8395,
1930,
1140,
16,
9499,
16,
1080,
468,
1188,
296,
3813,
310,
2187,
681,
67,
52... |
ans = self.max_class_capacity | return self.max_class_capacity | def _get_capacity(self, ignore_changes=False): ans = None if self.max_class_capacity is not None: ans = self.max_class_capacity | 9c4484c502f974bdd2c4ae79319c1b3b098f2538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/9c4484c502f974bdd2c4ae79319c1b3b098f2538/class_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
16017,
12,
2890,
16,
2305,
67,
6329,
33,
8381,
4672,
225,
4152,
273,
599,
309,
365,
18,
1896,
67,
1106,
67,
16017,
353,
486,
599,
30,
4152,
273,
365,
18,
1896,
67,
1106... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
588,
67,
16017,
12,
2890,
16,
2305,
67,
6329,
33,
8381,
4672,
225,
4152,
273,
599,
309,
365,
18,
1896,
67,
1106,
67,
16017,
353,
486,
599,
30,
4152,
273,
365,
18,
1896,
67,
1106... |
if startVal <= testVal: | if startVal < testVal: | def mEnd(key): # gets the first item starting after startVal testVal = getattr(view[key], endAttrName) if testVal is None: return 0 # interpret None as positive infinity, thus, a match if useTZ: if startVal <= testVal: return 0 else: if startVal.replace(tzinfo=None) <= testVal.replace(tzinfo=None): return 0 return 1 | 8282e0248b7ab050aed15fce803a39d90ee3bab3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/8282e0248b7ab050aed15fce803a39d90ee3bab3/Calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
1638,
12,
856,
4672,
468,
5571,
326,
1122,
761,
5023,
1839,
787,
3053,
1842,
3053,
273,
3869,
12,
1945,
63,
856,
6487,
679,
28973,
13,
309,
1842,
3053,
353,
599,
30,
327,
374,
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,
312,
1638,
12,
856,
4672,
468,
5571,
326,
1122,
761,
5023,
1839,
787,
3053,
1842,
3053,
273,
3869,
12,
1945,
63,
856,
6487,
679,
28973,
13,
309,
1842,
3053,
353,
599,
30,
327,
374,
468... |
tags, notag_only = self.get_selected_tags() | tags, notag_only = self.intended_tags | def on_colorchooser_activate(self, widget): #TODO: Color chooser should be refactorized in its own class. Well, in #fact we should have a TagPropertiesEditor (like for project) Also, #color change should be immediate. There's no reason for a Ok/Cancel dialog = gtk.ColorSelectionDialog('Choose color') colorsel = dialog.colorsel colorsel.connect("color_changed", self.on_color_changed) # Get previous color tags, notag_only = self.get_selected_tags() init_color = None if len(tags) == 1: color = tags[0].get_attribute("color") if color != None: colorspec = gtk.gdk.color_parse(color) colorsel.set_previous_color(colorspec) colorsel.set_current_color(colorspec) init_color = colorsel.get_current_color() response = dialog.run() # Check response and set color if required if response != gtk.RESPONSE_OK and init_color: strcolor = gtk.color_selection_palette_to_string([init_color]) tags, notag_only = self.get_selected_tags() for t in tags: t.set_attribute("color", strcolor) self.task_tv.refresh() dialog.destroy() | f18a90ed1f96430110b88e448fc2cdc6d6584463 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/f18a90ed1f96430110b88e448fc2cdc6d6584463/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3266,
2599,
13164,
67,
10014,
12,
2890,
16,
3604,
4672,
468,
6241,
30,
5563,
5011,
13164,
1410,
506,
26627,
1235,
316,
2097,
4953,
667,
18,
678,
1165,
16,
316,
468,
3493,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3266,
2599,
13164,
67,
10014,
12,
2890,
16,
3604,
4672,
468,
6241,
30,
5563,
5011,
13164,
1410,
506,
26627,
1235,
316,
2097,
4953,
667,
18,
678,
1165,
16,
316,
468,
3493,
732,
... |
class IOINaturalFlag(quickfix.BoolField): def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 130) else: quickfix.BoolField.__init__(self, 130, data) class QuoteReqID(quickfix.StringField): def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 131) else: quickfix.StringField.__init__(self, 131, data) class BidPx(quickfix.DoubleField): def __init__(self, data = None): if data == None: quickfix.DoubleField.__init__(self, 132) else: quickfix.DoubleField.__init__(self, 132, data) class OfferPx(quickfix.DoubleField): def __init__(self, data = None): if data == None: quickfix.DoubleField.__init__(self, 133) else: quickfix.DoubleField.__init__(self, 133, data) class BidSize(quickfix.DoubleField): def __init__(self, data = None): if data == None: quickfix.DoubleField.__init__(self, 134) else: quickfix.DoubleField.__init__(self, 134, data) class OfferSize(quickfix.DoubleField): def __init__(self, data = None): if data == None: quickfix.DoubleField.__init__(self, 135) else: quickfix.DoubleField.__init__(self, 135, data) class NoMiscFees(quickfix.IntField): def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 136) else: quickfix.IntField.__init__(self, 136, data) class MiscFeeAmt(quickfix.DoubleField): def __init__(self, data = None): if data == None: quickfix.DoubleField.__init__(self, 137) else: quickfix.DoubleField.__init__(self, 137, data) class MiscFeeCurr(quickfix.StringField): def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 138) else: quickfix.StringField.__init__(self, 138, data) class MiscFeeType(quickfix.CharField): def __init__(self, data = None): if data == None: quickfix.CharField.__init__(self, 139) else: quickfix.CharField.__init__(self, 139, data) class PrevClosePx(quickfix.DoubleField): def __init__(self, data = None): if data == None: quickfix.DoubleField.__init__(self, 140) else: quickfix.DoubleField.__init__(self, 140, data) | def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 129) else: quickfix.StringField.__init__(self, 129, data) | b195a30ce1679e0269bc776f2f6e3591488def1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/b195a30ce1679e0269bc776f2f6e3591488def1f/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2593,
29,
13,
469,
30,
9549,
904,
18,
780,
974,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
501,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2593,
29,
13,
469,
30,
9549,
904,
18,
780,
974,
... | |
axisAndAxisAtomPairsToBond.append((atm_to_keep, | axis_and_axis_atomPairs_to_bond.append((atm_to_keep, | def _replace_overlapping_axisAtoms_of_new_dna(self, new_endBaseAtomList): """ Checks if the new dna (which is a single strand in this class) has any axis atoms that overlap the axis atoms of the original dna. If it finds such atoms, the such overlapping atoms of the new dna are replaced with that on the original dna. Because of this operation, the strand atoms of the new dna are left without axis atoms. So, this method then calls appropriate method to create bonds between new strand atoms and corresponding axis atoms of the original dna. Also, the replacement operation could leave out some neighboring axis atoms of the *new dna* without bonds. So those need to be bonded with the axis atom of the original dna which replaced their neighbor. This is done by calling self._bond_axisNeighbors_with_orig_axisAtoms() @see self._fuse_new_dna_with_original_duplex() for a detail example @see: self._bond_bare_strandAtoms_with_orig_axisAtoms() @see self._bond_axisNeighbors_with_orig_axisAtoms() @BUG: Bug or unsupported feature: If the axis atoms of the original dna have a broken bond in between, then the wholechain will stop at the broken bond and thus, overlapping axis atoms of new dna after that bond won't be removed --- in short, the extended strand won't be properly fused. We need to come up with well defined rules ..example -- when the strand should decide it needs to remove overlapping atoms? ...even when it is overlapping with a different dna? (not the one we are resizing ) etc. """ #new dna generated by self.modify endAxisAtom_new_dna = new_endBaseAtomList[1] axis_wholechain_new_dna = endAxisAtom_new_dna.molecule.wholechain atomlist_with_overlapping_atoms = axis_wholechain_new_dna.get_all_baseatoms() #dna being resized (the original structure which is being resized) axis_wholechain_orig_dna = self._resizeEndAxisAtom.molecule.wholechain atomlist_to_keep = axis_wholechain_orig_dna.get_all_baseatoms() axisEndBaseAtoms_orig_dna = axis_wholechain_orig_dna.end_baseatoms() overlapping_atoms = \ self._find_overlapping_axisAtomPairs(atomlist_to_keep, atomlist_with_overlapping_atoms) axisAndStrandAtomPairsToBond = [] axisAndAxisAtomPairsToBond = [] fusableAxisAtomPairsDict = {} for atm_to_keep, atm_to_delete in overlapping_atoms: #Make sure that atm_to_keep (the axis atom on original dna) #has only one strand neighbor, OTHERWISE , if we delete #the overlapping axis atoms on the new dna, the bare strand of #the new dna can not be bonded with the old dna axis! and we #will endup having a bare strand with no axis atom! #-Ninad 2008-04-04 strand_neighbors_of_atm_to_keep = atm_to_keep.strand_neighbors() #Before deleting the overlapping axis atom of the new dna, #make sure that the corresponding old axis atom has only #one strand neighbor. Otherwise, there will be no axis atom #available for the bare strand atom that will result because #of this delete operation! if len(strand_neighbors_of_atm_to_keep) == 1 and atm_to_delete: #We know that the new dna is a single strand. So the #axis atom will ONLY have a single strand atom atatched. #If not, it will be a bug! strand_atom_new_dna = atm_to_delete.strand_neighbors()[0] #We will fuse this strand atom to the old axis atom axisAndStrandAtomPairsToBond.append((atm_to_keep, strand_atom_new_dna)) fusableAxisAtomPairsDict[atm_to_keep] = atm_to_delete ##fusableAxisAtomPairs.append((atm_to_keep, atm_to_delete)) for atm_to_keep in axisEndBaseAtoms_orig_dna: #This means that we are at the end of the chain of the #original dna. There could be some more axis atoms on the #new dna that go beyond the original dna axis chain -- [A] #Thus, after we replace the overlapping axis atoms of the #new dna with the original axis atoms, we should make sure #to bond them with the atoms [A] mentioned above if fusableAxisAtomPairsDict.has_key(atm_to_keep): atm_to_delete = fusableAxisAtomPairsDict[atm_to_keep] for neighbor in atm_to_delete.axis_neighbors(): if neighbor is not None and \ neighbor not in fusableAxisAtomPairsDict.values(): axisAndAxisAtomPairsToBond.append((atm_to_keep, neighbor)) for atm_to_delete in fusableAxisAtomPairsDict.values(): try: #Now delete the overlapping axis atom on new dna atm_to_delete.kill() except: print_compact_stack("Strand resizing: Error killing axis atom") self._bond_bare_strandAtoms_with_orig_axisAtoms(axisAndStrandAtomPairsToBond) self._bond_axisNeighbors_with_orig_axisAtoms(axisAndAxisAtomPairsToBond) | 0f66720dc7592e697b0246deb3b5551a198d4c93 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/0f66720dc7592e697b0246deb3b5551a198d4c93/B_Dna_PAM3_SingleStrand.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2079,
67,
17946,
1382,
67,
4890,
14280,
67,
792,
67,
2704,
67,
5176,
69,
12,
2890,
16,
394,
67,
409,
2171,
3641,
682,
4672,
3536,
13074,
309,
326,
394,
31702,
261,
12784,
353,
279... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2079,
67,
17946,
1382,
67,
4890,
14280,
67,
792,
67,
2704,
67,
5176,
69,
12,
2890,
16,
394,
67,
409,
2171,
3641,
682,
4672,
3536,
13074,
309,
326,
394,
31702,
261,
12784,
353,
279... |
"""Maintain highlighting of possible drop points, which should exist whenever | """ Maintain highlighting of possible drop points, which should exist whenever | def update_drop_point_highlighting(self, undo_only = False): #k undo_only might not be needed once a clipping issue is solved -- see call that uses/used it, comments near it """Maintain highlighting of possible drop points, which should exist whenever self.last_dragMove_cpos and self.last_dragMove_ok, based on a drag position determined by several last_xxx variables as explained in a comment near them. Do new highlighting and undo old highlighting, by direct drawing and/or invalidation (QWidget.update). Note that some of the same drawing also needs to be done by our custom viewportPaintEvent on top of whatever our superclass would draw, even if we draw in the same place here -- this routine's drawing works for things already visible, viewportPaintEvent's for things uncovered by scrolling, and we're not always sure which is which, nor would it be practical to fully divide the work even if we were. So, this routine records what drawing needs to happen (of the "do" type, not the "undo" type), and calls a common routine to do it, also called by viewportPaintEvent if its rect might overlap that drawing (which is always small in vertical extent, since near the drop point -- at least for now). But for "undo" drawing it's different... I guess viewportPaintEvent needn't do any "undo drawing" since what its super method draws is "fully undone" already. Oh, one more thing -- the "original nodes" also look different (during a move), and this is "do" drawing which changes less often, is done even when the dragged point is outside the widget, and has a large vertical extent -- so don't do it in this routine! It too needs doing when it happens and in viewportPaintEvent, and undoing when that happens (but not in viewportPaintEvent), but is done by some other routine. ####@@@@ write it! If in the future we highlight all inactive drop points as well as the one active one, that too (the inactive ones) would be done separately for the same reasons. """ undo_true_dragMove_cpos = self.true_dragMove_cpos # undo whatever was done for this pos # that only works if we're sure the items have not moved, # otherwise we'd need to record not just this position # but whatever drawing we did due to it; should be ok for now if self.last_dragMove_cpos and self.last_dragMove_ok: # some drop-point highlighting is wanted; figure out where. # if we felt like importing Numeric (and even VQT) we could do something like this: ## correction = self.last_scrollpos - self.last_dragMove_scrollpos ## self.true_dragMove_cpos = self.last_dragMove_cpos + correction # but instead: correction = pair_minus( self.last_scrollpos, self.last_dragMove_scrollpos ) self.true_dragMove_cpos = pair_plus( self.last_dragMove_cpos, correction ) | 8e76c375339a6ae063e685fcb0b4bee3c03d78cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/8e76c375339a6ae063e685fcb0b4bee3c03d78cd/TreeWidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
7285,
67,
1153,
67,
15978,
310,
12,
2890,
16,
15436,
67,
3700,
273,
1083,
4672,
468,
79,
15436,
67,
3700,
4825,
486,
506,
3577,
3647,
279,
31686,
5672,
353,
3704,
2155,
1493,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
7285,
67,
1153,
67,
15978,
310,
12,
2890,
16,
15436,
67,
3700,
273,
1083,
4672,
468,
79,
15436,
67,
3700,
4825,
486,
506,
3577,
3647,
279,
31686,
5672,
353,
3704,
2155,
1493,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.