bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def parseFullID( fullid ): if string.count( fullid, ':' ) != 2: raise ValueError( "FullID must have 2 ':'s." ) return string.split( fullid, ':' ) | def parseFullID( fullid ): aList = string.split( fullid, ':' ) aLength = len( aList ) if aLength != 3: raise ValueError( "FullID must have 2 ':'s. ( %d given ) " % aLength - 1 ) return aList | 35,100 |
def parseFullPropertyName( fullpropertyname ): if string.count( fullpropertyname, ':' ) != 3: raise ValueError( "FullPropertyName must have 3 ':'s." ) return string.split( fullpropertyname, ':' ) | def parseFullPropertyName( fullpropertyname ): aList = string.split( fullpropertyname, ':' ) aLength = len( aList ) if aLength != 4: raise ValueError( "FullPropertyName must have 3 ':'s. ( %d given ) " % aLength - 1 ) return aList | 35,101 |
def constructFullID( words ): aLength = len( words ) if aLength != 3: raise ValueError( "FullID has 3 parts. ( %d given )" % aLength ) return string.join( words, ':' ) | def constructFullID( words ): aLength = len( words ) if aLength != 3: raise ValueError( "FullID has 3 fields. ( %d given )" % aLength ) return string.join( words, ':' ) | 35,102 |
def constructFullPropertyName( words ): aLength = len( words ) if aLength != 4: raise ValueError( "FullPropertyName has 4 parts. ( %d given )" % aLength ) return string.join( words, ':' ) | def constructFullPropertyName( words ): aLength = len( words ) if aLength != 4: raise ValueError( "FullPropertyName has 4 fields. ( %d given )" % aLength ) return string.join( words, ':' ) | 35,103 |
def getReaction( aSBMLmodel, aSBMLDocument ): " [[ Id , Name , [ Formula , String , TimeUnit , SubstanceUnit , [[ ParameterId , ParameterName , ParameterValue , ParameterUnit , ParameterConstant ]] ] , Reversible , Fast , [[ ReactantSpecies , ( ReactantStoichiometry , ReactantStoichiometryMath ) , ReactantDenominator ... | def getReaction( aSBMLmodel, aSBMLDocument ): " [[ Id , Name , [ Formula , String , TimeUnit , SubstanceUnit , [[ ParameterId , ParameterName , ParameterValue , ParameterUnit , ParameterConstant ]] ] , Reversible , Fast , [[ ReactantSpecies , ( ReactantStoichiometry , ReactantStoichiometryMath ) , ReactantDenominator ... | 35,104 |
def checkMultiplicity(self): processes = {} my_pid = 1 count = 0 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -... | def checkMultiplicity(self): processes = {} my_pid = 1 count = 1 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -... | 35,105 |
def checkMultiplicity(self): processes = {} my_pid = 1 count = 0 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -... | def checkMultiplicity(self): processes = {} my_pid = 1 count = 0 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -... | 35,106 |
def edit(self): """Edit the page using the editor. It returns two strings: the old version and the new version.""" ofn = tempfile.mktemp() ofp = open(ofn, 'w') try: oldcontent = self.pagelink.get() except wikipedia.NoPage: oldcontent = "" except wikipedia.IsRedirectPage: if self.options.redirect: oldcontent = self.pag... | def edit(self): """Edit the page using the editor. It returns two strings: the old version and the new version.""" ofn = tempfile.mktemp() ofp = open(ofn, 'w') try: oldcontent = self.pagelink.get() except wikipedia.NoPage: oldcontent = "" except wikipedia.IsRedirectPage: if self.options.redirect: oldcontent = self.pag... | 35,107 |
def assemble(self): # No errors have been seen so far nerr = 0 # Build up a dictionary of all links found, with the site as key. # Each value will be a list. mysite = wikipedia.getSite() new = {} for pl in self.done.keys(): site = pl.site() if site == mysite and pl.exists() and not pl.isRedirectPage() and not pl.isEmp... | def assemble(self): # No errors have been seen so far nerr = 0 # Build up a dictionary of all links found, with the site as key. # Each value will be a list. mysite = wikipedia.getSite() new = {} for pl in self.done.keys(): site = pl.site() if site == mysite and pl.exists() and not pl.isRedirectPage(): if pl != self.i... | 35,108 |
def getEditPage(self, get_redirect=False, throttle = True, sysop = False): """ Get the contents of the Page via the edit page. Do not use this directly, use get() instead. Arguments: get_redirect - Get the contents, even if it is a redirect page This routine returns a unicode string containing the wiki text. """ isW... | def getEditPage(self, get_redirect=False, throttle = True, sysop = False): """ Get the contents of the Page via the edit page. Do not use this directly, use get() instead. Arguments: get_redirect - Get the contents, even if it is a redirect page This routine returns a unicode string containing the wiki text. """ isW... | 35,109 |
def __init__(self): family.Family.__init__(self) self.name = 'wikipedia' | def __init__(self): family.Family.__init__(self) self.name = 'wikipedia' | 35,110 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,111 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,112 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,113 |
def url2link(percentname,incode,code): """Convert a url-name of a page into a proper name for an interwiki link the optional argument 'into' specifies the encoding of the target wikipedia """ result=underline2space(percentname) x=url2unicode(result,language=code) if code2encoding(incode)==code2encoding(code): #print "u... | def url2link(percentname,incode,code): """Convert a url-name of a page into a proper name for an interwiki link the argument 'incode' specifies the encoding of the target wikipedia """ result=underline2space(percentname) x=url2unicode(result,language=code) if code2encoding(incode)==code2encoding(code): #print "url2link... | 35,114 |
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() host = site.hostname() url = site.family.version_history_address(site, self.urlname(... | def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() host = site.hostname() url = site.family.version_history_address(site, self.urlname(... | 35,115 |
def generator(source, replacements, exceptions, regex, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by the user. ... | def generator(source, replacements, exceptions, regex, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by the user. ... | 35,116 |
def generator(source, replacements, exceptions, regex, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by the user. ... | def generator(source, replacements, exceptions, regex, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by the user. ... | 35,117 |
def convertTable(self, table): ''' Converts an HTML table to wiki syntax. If the table already is a wiki table or contains a nested wiki table, tries to beautify it. Returns the converted table, the number of warnings that occured and a list containing these warnings. | def convertTable(self, table): ''' Converts an HTML table to wiki syntax. If the table already is a wiki table or contains a nested wiki table, tries to beautify it. Returns the converted table, the number of warnings that occured and a list containing these warnings. | 35,118 |
def convertTable(self, table): ''' Converts an HTML table to wiki syntax. If the table already is a wiki table or contains a nested wiki table, tries to beautify it. Returns the converted table, the number of warnings that occured and a list containing these warnings. | def convertTable(self, table): ''' Converts an HTML table to wiki syntax. If the table already is a wiki table or contains a nested wiki table, tries to beautify it. Returns the converted table, the number of warnings that occured and a list containing these warnings. | 35,119 |
def _make_catlist(self, recurse = False, site = None): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and subcategories of any subcategories are also retrieved. | def _make_catlist(self, recurse = False, site = None): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and subcategories of any subcategories are also retrieved. | 35,120 |
def _make_catlist(self, recurse = False, site = None): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and subcategories of any subcategories are also retrieved. | def _make_catlist(self, recurse = False, site = None): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and subcategories of any subcategories are also retrieved. | 35,121 |
def _make_catlist(self, recurse = False, site = None): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and subcategories of any subcategories are also retrieved. | def _make_catlist(self, recurse = False, site = None): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and subcategories of any subcategories are also retrieved. | 35,122 |
def url2unicode(title, site): title = title.encode(site.encoding()) title = urllib.unquote(title) return unicode(title, site.encoding()) | def url2unicode(title, site): try: t = title.encode(site.encoding()) t = urllib.unquote(t) return unicode(t, site.encoding()) except UnicodeError: for enc in site.encodings(): try: t = title.encode(enc) t = urllib.unquote(t) return unicode(t, enc) except UnicodeError: pass raise | 35,123 |
def fix_double_redirects(source): mysite = wikipedia.getSite() for redir_name in retrieve_double_redirects(source): print '' redir = wikipedia.PageLink(mysite, redir_name) try: target = redir.getRedirectTo() except wikipedia.IsNotRedirectPage: wikipedia.output(u'%s is not a redirect.' % redir.linkname()) except wikiped... | def fix_double_redirects(source): mysite = wikipedia.getSite() for redir_name in retrieve_double_redirects(source): print '' redir = wikipedia.PageLink(mysite, redir_name) try: target = redir.getRedirectTo() except wikipedia.IsNotRedirectPage: wikipedia.output(u'%s is not a redirect.' % redir.linkname()) except wikiped... | 35,124 |
def main(): # read command line parameters # what the bot should do (either resolve double redirs, or delete broken redirs) action = None # where the bot should get his infos from (either None to load the maintenance # special page from the live wiki, the filename of a local sql dump file) source = None # Which namespa... | def main(): # read command line parameters # what the bot should do (either resolve double redirs, or delete broken redirs) action = None # where the bot should get his infos from (either None to load the maintenance # special page from the live wiki, the filename of a local sql dump file) source = None # Which namespa... | 35,125 |
def checkMultiplicity(self): processes = {} my_pid = 1 count = 0 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -... | def checkMultiplicity(self): processes = {} my_pid = 1 count = 0 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -... | 35,126 |
def drop(self): """Remove me from the list of running bots processes.""" self.checktime = 0 processes = {} try: f = open('throttle.log','r') except IOError: return else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.dropd... | def drop(self): """Remove me from the list of running bots processes.""" self.checktime = 0 processes = {} try: f = open('throttle.log','r') except IOError: return else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.relea... | 35,127 |
def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat) # TODO: cre... | def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat) # TODO: cre... | 35,128 |
def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat) # TODO: cre... | def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat) # TODO: cre... | 35,129 |
def titleWithoutNamespace(self): """The name of the page without the namespace part. Returns the sectionFreeTitle if the page is from the main namespace. Note that this is a raw way of doing things - it simply looks for a : in the name.""" t=self.sectionFreeTitle() p=t.split(':', 1) if len(p) == 1: # page is in the mai... | def titleWithoutNamespace(self): """The name of the page without the namespace part. Returns the sectionFreeTitle if the page is from the main namespace. Note that this is a raw way of doing things - it simply looks for a : in the name.""" t=self.sectionFreeTitle() p=t.split(':', 1) if len(p) == 1: # page is in the mai... | 35,130 |
def treesearch(pl): arr = {pl:None} # First make one step based on the language itself try: n = treestep(arr, pl, abort_on_redirect = 1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n == 0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr) > 1: print "Already has tr... | def treesearch(pl): arr = {pl:None} # First make one step based on the language itself try: n = treestep(arr, pl, abort_on_redirect = 1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n == 0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr) > 1: print "Already has tr... | 35,131 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,132 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,133 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,134 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,135 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,136 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,137 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,138 |
def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | def getreferences(pl): host = wikipedia.langs[pl.code()] url="/w/wiki.phtml?title=Speciaal:Whatlinkshere&target=%s"%(pl.urlname()) txt,charset=wikipedia.getUrl(host,url) Rref=re.compile('<li><a href.* title="([^"]*)"') return Rref.findall(txt) | 35,139 |
def getReferences(pl, follow_redirects = True): host = family.hostname(pl.code()) url = family.references_address(mylang, pl.urlname()) output('Getting references to %s:%s' % (pl.code(), pl.linkname())) txt, charset = getUrl(host,url) # remove brackets which would disturb the regular expression cascadedListR txt = txt.... | def getReferences(pl, follow_redirects = True): host = family.hostname(pl.code()) url = family.references_address(mylang, pl.urlname()) output('Getting references to %s:%s' % (pl.code(), pl.linkname())) txt, charset = getUrl(host,url) # remove brackets which would disturb the regular expression cascadedListR txt = txt.... | 35,140 |
def hasdisambig(self,site): # Returns TRUE if a link to a disambiguation page on site site has been found for pl in self.pending + self.done.keys(): if pl.site() == site: if pl.isDisambig(): return pl return False | def hasdisambig(self,site): # Returns TRUE if a link to a disambiguation page on site site has been found for pl in self.pending + self.done.keys(): if pl.site() == site: try: if pl.isDisambig(): return pl except wikipedia.NoPage: pass return False | 35,141 |
def hasnondisambig(self,site): # Returns TRUE if a link to a disambiguation page on site site has been found for pl in self.pending + self.done.keys(): if pl.site() == site: if not pl.isDisambig(): return pl return False | def hasnondisambig(self,site): # Returns TRUE if a link to a disambiguation page on site site has been found for pl in self.pending + self.done.keys(): if pl.site() == site: try: if not pl.isDisambig(): return pl except wikipedia.NoPage: pass return False | 35,142 |
def getRedirectTarget(self): """ If the page is a redirect page, gives the title of the page it redirects to. Otherwise it will raise an IsNotRedirectPage exception. This function can raise a NoPage exception. """ try: self.get() except NoPage: raise NoPage(self) except IsRedirectPage, arg: if '|' in arg: warnings.war... | def getRedirectTarget(self): """ If the page is a redirect page, gives the title of the page it redirects to. Otherwise it will raise an IsNotRedirectPage exception. This function can raise a NoPage exception. """ try: self.get() except NoPage: raise NoPage(self) except IsRedirectPage, arg: if '|' in arg: warnings.war... | 35,143 |
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname()) | def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. Defaults to getting the first 500 edits. """ site = self.site() path = site.family.version_history_address... | 35,144 |
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname()) | def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname()) | 35,145 |
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname()) | def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname()) | 35,146 |
def getVersionHistoryTable(self, forceReload = False): """ Returns the version history as a wiki table. """ result = '{| border="1"\n' result += '! date/time || username || edit summary\n' for time, username, summary in self.getVersionHistory(forceReload = forceReload): result += '|----\n' result += '| %s || %s || <now... | def getVersionHistoryTable(self, forceReload = False): """ Returns the version history as a wiki table. """ result = '{| border="1"\n' result += '! date/time || username || edit summary\n' for time, username, summary in self.getVersionHistory(forceReload = forceReload, reverseOrder = reverseOrder, getAll = getAll): res... | 35,147 |
def delete(pl, reason = None, prompt = True): """Deletes the page from the wiki. Requires administrator status. If reason is None, asks for a reason. If prompt is True, asks the user if he wants to delete the page. """ # TODO: Find out if bot is logged in with an admin account, raise exception # or show error message o... | def delete(self, reason = None, prompt = True): """Deletes the page from the wiki. Requires administrator status. If reason is None, asks for a reason. If prompt is True, asks the user if he wants to delete the page. """ # TODO: Find out if bot is logged in with an admin account, raise exception # or show error message... | 35,148 |
def delete(pl, reason = None, prompt = True): """Deletes the page from the wiki. Requires administrator status. If reason is None, asks for a reason. If prompt is True, asks the user if he wants to delete the page. """ # TODO: Find out if bot is logged in with an admin account, raise exception # or show error message o... | def delete(pl, reason = None, prompt = True): """Deletes the page from the wiki. Requires administrator status. If reason is None, asks for a reason. If prompt is True, asks the user if he wants to delete the page. """ # TODO: Find out if bot is logged in with an admin account, raise exception # or show error message o... | 35,149 |
def encode_multipart_formdata(fields): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF =... | def encode_multipart_formdata(fields): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF =... | 35,150 |
def encode_multipart_formdata(fields): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF =... | def encode_multipart_formdata(fields): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF =... | 35,151 |
def encode_multipart_formdata(fields): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF =... | def encode_multipart_formdata(fields): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF =... | 35,152 |
def __iter__(self): site = wikipedia.getSite() f = codecs.open(self.filename, 'r', config.textfile_encoding) R = re.compile(r'\[\[(.+?)\]\]') for pageTitle in R.findall(f.read()): parts = pageTitle.split(':') i = 0 try: fam = wikipedia.Family(parts[i], fatal = False) i += 1 except: fam = site.family if parts[i] in fam.... | def __iter__(self): site = wikipedia.getSite() f = codecs.open(self.filename, 'r', config.textfile_encoding) R = re.compile(ur'\[\[(.+?)\]\]') for pageTitle in R.findall(f.read()): parts = pageTitle.split(':') i = 0 try: fam = wikipedia.Family(parts[i], fatal = False) i += 1 except: fam = site.family if parts[i] in fam... | 35,153 |
def getSite(code = None, fam = None, user=None): if code == None: code = default_code if fam == None: fam == default_family key = '%s:%s'%(fam,code) if not _sites.has_key(key): _sites[key] = Site(code=code, fam=fam, user=user) return _sites[key] | def getSite(code = None, fam = None, user=None): if code == None: code = default_code if fam == None: fam = default_family key = '%s:%s'%(fam,code) if not _sites.has_key(key): _sites[key] = Site(code=code, fam=fam, user=user) return _sites[key] | 35,154 |
def report(self, url, errorReport, containingPage): """ Tries to add an error report to the talk page belonging to the page containing the dead link. """ if config.report_dead_links_on_talk and not containingPage.isTalkPage(): wikipedia.output(u"** Reporting dead link on talk page...") talk = containingPage.switchTalkP... | def report(self, url, errorReport, containingPage): """ Tries to add an error report to the talk page belonging to the page containing the dead link. """ if config.report_dead_links_on_talk and not containingPage.isTalkPage(): wikipedia.output(u"** Reporting dead link on talk page...") talk = containingPage.switchTalkP... | 35,155 |
def declare_alternative(self,alt): if not alt in knownwords[self.word]: knownwords[self.word].append(word) newwords.append(self.word) return self.alternatives | def declare_alternative(self,alt): if not alt in knownwords[self.word]: knownwords[self.word].append(word) newwords.append(self.word) return self.alternatives | 35,156 |
def run(self): articles = self.oldCat.articles(recurse = 0) | def run(self): articles = self.oldCat.articles(recurse = 0) | 35,157 |
def run(self): articles = self.cat.articles(recurse = 0) if len(articles) == 0: wikipedia.output(u'There are no articles in category %s' % self.cat.title()) else: for article in articles: catlib.change_category(article, self.cat, None) # Also removes the category tag from subcategories' pages subcategories = self.cat.s... | def run(self): articles = self.cat.articles(recurse = 0) if len(articles) == 0: wikipedia.output(u'There are no articles in category %s' % self.cat.title()) else: for article in articles: catlib.change_category(article, self.cat, None) # Also removes the category tag from subcategories' pages subcategories = self.cat.s... | 35,158 |
def sametranslate(pl, arr, same): site = pl.site() for newcode in site.family.seriouslangs: # Put as suggestion into array newname = pl.linkname() if newcode in ['eo','cs'] and same == 'name': newname = newname.split(' ') newname[-1] = newname[-1].upper() newname = ' '.join(newname) x=wikipedia.PageLink(wikipedia.getSi... | def sametranslate(pl, arr, same): site = pl.site() for newcode in site.family.seriouslangs: # Put as suggestion into array newname = pl.linkname() if newcode in ['eo','cs'] and same == 'name': newname = newname.split(' ') newname[-1] = newname[-1].upper() newname = ' '.join(newname) x=wikipedia.PageLink(wikipedia.getSi... | 35,159 |
def sametranslate(pl, arr, same): site = pl.site() for newcode in site.family.seriouslangs: # Put as suggestion into array newname = pl.linkname() if newcode in ['eo','cs'] and same == 'name': newname = newname.split(' ') newname[-1] = newname[-1].upper() newname = ' '.join(newname) x=wikipedia.PageLink(wikipedia.getSi... | def sametranslate(pl, arr, same): site = pl.site() for newcode in site.family.seriouslangs: # Put as suggestion into array newname = pl.linkname() if newcode in ['eo','cs'] and same == 'name': newname = newname.split(' ') newname[-1] = newname[-1].upper() newname = ' '.join(newname) x=wikipedia.PageLink(wikipedia.getSi... | 35,160 |
def get(self, read_only = False, force = False, get_redirect=False, throttle = True): """The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code: | def get(self, read_only = False, force = False, get_redirect=False, throttle = True): """The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code: | 35,161 |
def get(self, read_only = False, force = False, get_redirect=False, throttle = True): """The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code: | def get(self, read_only = False, force = False, get_redirect=False, throttle = True): """The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code: | 35,162 |
def removeLanguageLinks(text): """Given the wiki-text of a page, return that page with all interwiki links removed. If a link to an unknown language is encountered, a warning is printed.""" for code in langs: text=re.sub(r'\[\['+code+':([^\]]*)\]\]', '', text) m=re.search(r'\[\[([a-z][a-z]):([^\]]*)\]\]', text) if m: p... | def removeLanguageLinks(text): """Given the wiki-text of a page, return that page with all interwiki links removed. If a link to an unknown language is encountered, a warning is printed.""" for code in langs: text=re.sub(r'\[\['+code+':([^\]]*)\]\]', '', text) m=re.search(r'\[\[([a-z][a-z]):([^\]]*)\]\]', text) if m: p... | 35,163 |
def removeLanguageLinks(text): """Given the wiki-text of a page, return that page with all interwiki links removed. If a link to an unknown language is encountered, a warning is printed.""" for code in langs: text=re.sub(r'\[\['+code+':([^\]]*)\]\]', '', text) m=re.search(r'\[\[([a-z][a-z]):([^\]]*)\]\]', text) if m: p... | def removeLanguageLinks(text): """Given the wiki-text of a page, return that page with all interwiki links removed. If a link to an unknown language is encountered, a warning is printed.""" for code in langs: text=re.sub(r'\[\['+code+':([^\]]*)\]\]', '', text) m=re.search(r'\[\[([a-z][a-z]):([^\]]*)\]\]', text) if m: p... | 35,164 |
def removeLanguageLinks(text): """Given the wiki-text of a page, return that page with all interwiki links removed. If a link to an unknown language is encountered, a warning is printed.""" for code in langs: text=re.sub(r'\[\['+code+':([^\]]*)\]\]', '', text) m=re.search(r'\[\[([a-z][a-z]):([^\]]*)\]\]', text) if m: p... | def removeLanguageLinks(text): """Given the wiki-text of a page, return that page with all interwiki links removed. If a link to an unknown language is encountered, a warning is printed.""" for code in langs: text=re.sub(r'\[\['+code+':([^\]]*)\]\]', '', text) m=re.search(r'\[\[([a-z][a-z]):([^\]]*)\]\]', text) if m: p... | 35,165 |
def __iter__(self): """ Yield page objects until the entire XML dump has been read. """ import xmlreader mysite = wikipedia.getSite() dump = xmlreader.XmlDump(self.xmlfilename) # regular expression to find the original template. # {{vfd}} does the same thing as {{Vfd}}, so both will be found. # The old syntax, {{msg:vf... | def __iter__(self): """ Yield page objects until the entire XML dump has been read. """ import xmlreader mysite = wikipedia.getSite() dump = xmlreader.XmlDump(self.xmlfilename) # regular expression to find the original template. # {{vfd}} does the same thing as {{Vfd}}, so both will be found. # The old syntax, {{msg:vf... | 35,166 |
def __init__(self, generator, old, new = None, remove = False, editSummary = '', acceptAll = False, extras = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want to subs... | def __init__(self, generator, old, new = None, remove = False, editSummary = '', acceptAll = False, extras = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want to subs... | 35,167 |
def run(self): """ Starts the robot's action. """ # regular expression to find the original template. # {{vfd}} does the same thing as {{Vfd}}, so both will be found. # The old syntax, {{msg:vfd}}, will also be found. # The group 'parameters' will either match the parameters, or an # empty string if there are none. | def run(self): """ Starts the robot's action. """ # regular expression to find the original template. # {{vfd}} does the same thing as {{Vfd}}, so both will be found. # The old syntax, {{msg:vfd}}, will also be found. # The group 'parameters' will either match the parameters, or an # empty string if there are none. | 35,168 |
def main(): template_names = [] resolve = False remove = False namespaces = [] editSummary = '' acceptAll = False pageTitles = [] extras = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg ... | def main(): template_names = [] resolve = False remove = False namespaces = [] editSummary = '' acceptAll = False pageTitles = [] extras = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg ... | 35,169 |
def getFileLinks(self): """ Yield all pages that link to the page. If you need a full list of referring pages, use this: | def getFileLinks(self): """ Yield all pages that link to the page. If you need a full list of referring pages, use this: | 35,170 |
def __init__(self, oldCatTitle, newCatTitle, batchMode = False, editSummary = '', inPlace = False): self.editSummary = editSummary self.inPlace = inPlace self.oldCat = catlib.Category(wikipedia.getSite(), 'Category:' + oldCatTitle) self.newCatTitle = newCatTitle # set edit summary message | def __init__(self, oldCatTitle, newCatTitle, batchMode = False, editSummary = '', inPlace = False, moveCatPage = True): self.editSummary = editSummary self.inPlace = inPlace self.oldCat = catlib.Category(wikipedia.getSite(), 'Category:' + oldCatTitle) self.newCatTitle = newCatTitle # set edit summary message | 35,171 |
def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=self... | 35,172 |
def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | 35,173 |
def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | 35,174 |
def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | def run(self): newCat = catlib.Category(wikipedia.getSite(), 'Category:' + self.newCatTitle) gen = pagegenerators.CategorizedPageGenerator(self.oldCat, recurse = False) preloadingGen = pagegenerators.PreloadingGenerator(gen) for article in preloadingGen: catlib.change_category(article, self.oldCat, newCat, inPlace=inPl... | 35,175 |
def oneDone(self, entry): title = entry.title username = entry.username ipedit = entry.ipedit timestamp = entry.timestamp text = entry.text editRestriction = entry.editRestriction moveRestriction = entry.moveRestriction pl = Page(self.site, title) for pl2 in self.pages: if pl2.sectionFreeTitle() == pl.sectionFreeTitle(... | def oneDone(self, entry): title = entry.title username = entry.username ipedit = entry.ipedit timestamp = entry.timestamp text = entry.text editRestriction = entry.editRestriction moveRestriction = entry.moveRestriction pl = Page(self.site, title) for pl2 in self.pages: if pl2.sectionFreeTitle() == pl.sectionFreeTitle(... | 35,176 |
def __init__(self): | def __init__(self): | 35,177 |
def __init__(self): | def __init__(self): | 35,178 |
def __init__(self): | def __init__(self): | 35,179 |
def __init__(self): | def __init__(self): | 35,180 |
def main(): # if -file is not used, this temporary array is used to read the page title. pageTitle = [] page = None gen = None imagelist = [] interwiki = False for arg in sys.argv[1:]: #for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'imagetransfer') if arg: if arg == '-interwiki': interwiki = True elif arg.s... | def main(): # if -file is not used, this temporary array is used to read the page title. pageTitle = [] page = None gen = None interwiki = False for arg in sys.argv[1:]: #for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'imagetransfer') if arg: if arg == '-interwiki': interwiki = True elif arg.startswith('-fil... | 35,181 |
def main(): # if -file is not used, this temporary array is used to read the page title. pageTitle = [] page = None gen = None imagelist = [] interwiki = False for arg in sys.argv[1:]: #for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'imagetransfer') if arg: if arg == '-interwiki': interwiki = True elif arg.s... | def main(): # if -file is not used, this temporary array is used to read the page title. pageTitle = [] page = None gen = None imagelist = [] interwiki = False for arg in sys.argv[1:]: #for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'imagetransfer') if arg: if arg == '-interwiki': interwiki = True elif arg.s... | 35,182 |
def get_image(original_url, source_wiki, original_description, keep=False, debug=False): # work with a copy of argument variables so we can reuse the # original ones if the upload fails fn = original_url description = original_description # Get file contents uo = wikipedia.MyURLopener() file = uo.open(fn) contents = fi... | def get_image(original_url, source_wiki, original_description, keep=False, debug=False): # work with a copy of argument variables so we can reuse the # original ones if the upload fails fn = original_url description = original_description # Get file contents uo = wikipedia.MyURLopener() file = uo.open(fn) contents = fi... | 35,183 |
def treat(page_title, site = None): ''' Loads a page, converts all HTML tables in its text to wiki syntax, and saves the converted text. Returns True if the converted table was successfully saved, otherwise returns False. ''' if site is None: site = wikipedia.getSite() pl = wikipedia.PageLink(site, page_title) try: tex... | def treat(page_title, site = None): ''' Loads a page, converts all HTML tables in its text to wiki syntax, and saves the converted text. Returns True if the converted table was successfully saved, otherwise returns False. ''' if site is None: site = wikipedia.getSite() pl = wikipedia.PageLink(site, page_title) try: tex... | 35,184 |
def treat(page_title, site = None): ''' Loads a page, converts all HTML tables in its text to wiki syntax, and saves the converted text. Returns True if the converted table was successfully saved, otherwise returns False. ''' if site is None: site = wikipedia.getSite() pl = wikipedia.PageLink(site, page_title) try: tex... | def treat(page_title, site = None): ''' Loads a page, converts all HTML tables in its text to wiki syntax, and saves the converted text. Returns True if the converted table was successfully saved, otherwise returns False. ''' if site is None: site = wikipedia.getSite() pl = wikipedia.PageLink(site, page_title) try: tex... | 35,185 |
def __init__(self, generator, old, new = None, remove = False, customSummary = False, editSummary = '', acceptAll = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want ... | def __init__(self, generator, old, new = None, remove = False, editSummary = '', acceptAll = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want to substitute the templ... | 35,186 |
def __init__(self, generator, old, new = None, remove = False, customSummary = False, editSummary = '', acceptAll = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want ... | def __init__(self, generator, old, new = None, remove = False, customSummary = False, editSummary = '', acceptAll = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want ... | 35,187 |
def __init__(self, generator, old, new = None, remove = False, customSummary = False, editSummary = '', acceptAll = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want ... | def __init__(self, generator, old, new = None, remove = False, customSummary = False, editSummary = '', acceptAll = False): """ Arguments: * generator - A page generator. * old - The title of the old template (without namespace) * new - The title of the new template (without namespace), or None if you want ... | 35,188 |
def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | def main(): template_names = [] resolve = False remove = False namespaces = [] editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remove': remove = True eli... | 35,189 |
def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | 35,190 |
def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | 35,191 |
def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | def main(): template_names = [] resolve = False remove = False namespaces = [] customSummary = False editSummary = '' acceptAll = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-remo... | 35,192 |
def _compare(self,p1,p2): # Compare two pagelinks. True iff p1 <= p2 | def_compare(self,p1,p2):#Comparetwopagelinks.Trueiffp1<=p2 | 35,193 |
def _addall(self,l1,l2): l=l1 for i in l2: self._add(l,i) return l | def _addall(self,l1,l2): l=l1 for i in l2: l = self._add(l,i) return l | 35,194 |
def __init__(self): | deffamily.Family.__init__(self) __init__(self): | 35,195 |
def __init__(self): | def __init__(self): | 35,196 |
def __init__(self): | def __init__(self): | 35,197 |
def treat(refpl, thispl): """ Parameters: thispl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to thispl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ try: include = False text=refpl.get(throttle=False) include = True ex... | def treat(refpl, thispl): """ Parameters: thispl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to thispl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ try: include = False text=refpl.get(throttle=False) include = True ex... | 35,198 |
def treat(refpl, thispl): """ Parameters: thispl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to thispl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ try: include = False text=refpl.get(throttle=False) include = True ex... | def treat(refpl, thispl): """ Parameters: thispl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to thispl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ try: include = False text=refpl.get(throttle=False) include = True ex... | 35,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.