bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def parse_error(self, mess, tag, text, start): raise ParseError, "%s, for tag %s, on line %s of %s<p>" % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) | def parse_error(self, mess, tag, text, start): raise ParseError, "%s, for tag %s, on line %s of %s" % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__)) | 2,400 |
def query(self, ignored): | def query(self, ignored): | 2,401 |
def marshal_tuple(n,l): return join(map(lambda v, n=n: "%s:tuple=%s" % (n,quote(v)),l),'&') | def marshal_tuple(n,l): return join(map(lambda v, n=n: "%s:tuple=%s" % (n,quote(v)),l),'&') | 2,402 |
def ErrorTypes(code): if code >= 400 && code < 500: return NotFound if code >= 500 && code < 600: return ServerError return 'HTTP_Error_%s' % code | def ErrorTypes(code): if code >= 400 and code < 500: return NotFound if code >= 500 and code < 600: return ServerError return 'HTTP_Error_%s' % code | 2,403 |
def __bobo_traverse__(self, REQUEST, name): if name[-9:]=='__draft__': return getattr(self, name) | def __bobo_traverse__(self, REQUEST, name): if name[-9:]=='__draft__': return getattr(self, name) | 2,404 |
def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=self.folderClass()() i.i... | def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=self.folderClass()() i.i... | 2,405 |
def manage_importObject(self,file,REQUEST=None): "Import an object from a file" if find(file,'..') != -1: raise ValueError, 'Bad file name %s' % file f=os.path.join(INSTANCE_HOME,'Import',file) o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) if REQUEST is not None: return Me... | def manage_importObject(self, file, REQUEST=None): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise 'Bad Request', 'Invalid file name %s' % file file=os.path.join(INSTANCE_HOME, 'import', file) if not os.path.exists(file): raise 'Bad Request', 'File does not exist: %s' % file ob=se... | 2,406 |
def manage_importObject(self,file,REQUEST=None): "Import an object from a file" if find(file,'..') != -1: raise ValueError, 'Bad file name %s' % file f=os.path.join(INSTANCE_HOME,'Import',file) o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) if REQUEST is not None: return Me... | def manage_importObject(self,file,REQUEST=None): "Import an object from a file" if find(file,'..') != -1: raise ValueError, 'Bad file name %s' % file f=os.path.join(INSTANCE_HOME,'Import',file) o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) if REQUEST is not None: return Me... | 2,407 |
def doc_strong(self, s, expr = re.compile(r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)).search #expr = re.compile(r'\s*\*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*\*(?!\*|-)' % letters).search, # old expr, inconsistent punc, failed to cross newlines. ): | def doc_strong(self, s, expr = re.compile(r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)).search #expr = re.compile(r'\s*\*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*\*(?!\*|-)' % letters).search, # old expr, inconsistent punc, failed to cross newlines. ): | 2,408 |
def doc_href(self, s, expr1 = re.compile(_DQUOTEDTEXT + "(:)" + _URL_AND_PUNC + _SPACES).search, expr2 = re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _URL_AND_PUNC + _SPACES).search): punctuation = re.compile(r"[\,\.\?\!\;]+").match r=expr1(s) or expr2(s) | def doc_href(self, s, expr1 = re.compile(_DQUOTEDTEXT + "(:)" + _ABS_AND_RELATIVE_URL + _SPACES).search, expr2 = re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _ABSOLUTE_URL + _SPACES).search): punctuation = re.compile(r"[\,\.\?\!\;]+").match r=expr1(s) or expr2(s) | 2,409 |
def install_product(app, product_dir, product_name, meta_types, folder_permissions, raise_exc=0, log_exc=1): path_join=os.path.join isdir=os.path.isdir exists=os.path.exists global_dict=globals() silly=('__doc__',) if 1: # Preserve indentation for diff :-) package_dir=path_join(product_dir, product_name) __traceback... | def install_product(app, product_dir, product_name, meta_types, folder_permissions, raise_exc=0, log_exc=1): path_join=os.path.join isdir=os.path.isdir exists=os.path.exists global_dict=globals() silly=('__doc__',) if 1: # Preserve indentation for diff :-) package_dir=path_join(product_dir, product_name) __traceback... | 2,410 |
def save(self, object, pers_save = 0): memo = self.memo | def save(self, object, pers_save = 0): memo = self.memo | 2,411 |
def save(self, object, pers_save = 0): memo = self.memo | def save(self, object, pers_save = 0): memo = self.memo | 2,412 |
def load_float(self): self.append(string.atof(self.readline()[:-1])) | def load_float(self): self.append(string.atof(self.readline()[:-1])) | 2,413 |
def html_quote(s): """ Convert characters that have special meaning in HTML to HTML character entities. See Also "Python 'cgi' module':http://www.python.org/doc/current/lib/Functions_in_cgi_module.html 'escape' function. """ | def html_quote(s): """ Convert characters that have special meaning in HTML to HTML character entities. See Also "Python 'cgi' module":http://www.python.org/doc/current/lib/Functions_in_cgi_module.html 'escape' function. """ | 2,414 |
def _er(self,data,title,SUBMIT,dtpref_cols,dtpref_rows,REQUEST): dr,dc = self._size_changes[SUBMIT] rows=max(1,int(dtpref_rows)+dr) cols=max(40,int(dtpref_cols)+dc) e=(DateTime('GMT') + 365).rfc822() resp=REQUEST['RESPONSE'] resp.setCookie('dtpref_rows',str(rows),path='/',expires=e) resp.setCookie('dtpref_cols',str(co... | def _er(self,data,title,SUBMIT,dtpref_cols,dtpref_rows,REQUEST): dr,dc = self._size_changes[SUBMIT] rows=max(1,int(dtpref_rows)+dr) cols=max(35,int(dtpref_cols)+dc) e=(DateTime('GMT') + 365).rfc822() resp=REQUEST['RESPONSE'] resp.setCookie('dtpref_rows',str(rows),path='/',expires=e) resp.setCookie('dtpref_cols',str(co... | 2,415 |
def manage_edit(self,data,title,SUBMIT='Change',dtpref_cols='50', dtpref_rows='20',REQUEST=None): """ Replaces a Documents contents with Data, Title with Title. | def manage_edit(self,data,title,SUBMIT='Change',dtpref_cols='70', dtpref_rows='20',REQUEST=None): """ Replaces a Documents contents with Data, Title with Title. | 2,416 |
def __nonzero__(self): return 0 | def __nonzero__(self): return 0 | 2,417 |
def evaluate(self, expression, isinstance=isinstance, StringType=StringType): if isinstance(expression, StringType): expression = self._engine.compile(expression) try: v = expression(self) if isinstance(v, Exception): if isinstance(v, TALESError): raise v, None, v.takeTraceback() raise v except TALESError, err: err.set... | def evaluate(self, expression, isinstance=isinstance, StringType=StringType): if isinstance(expression, StringType): expression = self._engine.compile(expression) try: v = expression(self) except TALESError, err: err.setPosition(self.position) raise err, None, sys.exc_info()[2] except self._nocatch: raise except: raise... | 2,418 |
def severity_string(severity, mapping={ -100: 'BLATHER', 0: 'INFO', 100: 'PROBLEM', 200: 'ERROR', 300: 'PANIC', }): """Convert a severity code to a string """ s=int(severity) if mapping.has_key(s): s=mapping[s] else: s='' return "%s(%s)" % (s, severity) | def severity_string(severity, mapping={ -100: 'BLATHER', 0: 'INFO', 100: 'PROBLEM', 200: 'ERROR', 300: 'PANIC', }): """Convert a severity code to a string """ s=int(severity) if mapping.has_key(s): s=mapping[s] else: s='' return "%s(%s)" % (s, severity) | 2,419 |
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stu... | def stupid_log_write(subsystem, severity, summary, detail, error): global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stupid_log if _stupid_dest ... | 2,420 |
def setRoles(self, roles): | def setRoles(self, roles): | 2,421 |
def setRoles(self, roles): | def setRoles(self, roles): | 2,422 |
def setRoles(self, roles): | def setRoles(self, roles): | 2,423 |
def __call__(self, *args): return Inst(self, args) | def __call__(self, *args): return Inst(self, args) | 2,424 |
def __setstate__(self, state): self._state=state | def __setstate__(self, state): self._state=state | 2,425 |
def save_inst(self, object): d = id(object) cls = object.__class__ | def save_inst(self, object): d = id(object) cls = object.__class__ | 2,426 |
def save_inst(self, object): d = id(object) cls = object.__class__ | def save_inst(self, object): d = id(object) cls = object.__class__ | 2,427 |
def save_inst(self, object): d = id(object) cls = object.__class__ | def save_inst(self, object): d = id(object) cls = object.__class__ | 2,428 |
def query(self,REQUEST,RESPONSE): | def query(self,REQUEST,RESPONSE): | 2,429 |
def test(self, *args): l=len(args) for i in range(1, l, 2): if args[i-1]: return args[i] if l%2: return args[-1] | def test(self, *args): l=len(args) for i in range(1, l, 2): if args[i-1]: return args[i] if l%2: return args[-1] | 2,430 |
def validate(self,request,auth='',roles=None): | def validate(self,request,auth='',roles=None): | 2,431 |
def timeTime(): """ | deftimeTime():""" | 2,432 |
def toZone(z): """ | deftoZone(z):""" | 2,433 |
def isFuture(): """ | defisFuture():""" | 2,434 |
def isPast(): """ | defisPast():""" | 2,435 |
def isCurrentYear(): """ | defisCurrentYear():""" | 2,436 |
def isCurrentMonth(): """ | defisCurrentMonth():""" | 2,437 |
def isCurrentDay(): """ | defisCurrentDay():""" | 2,438 |
def isCurrentHour(): """ | defisCurrentHour():""" | 2,439 |
def isCurrentMinute(): """ | defisCurrentMinute():""" | 2,440 |
def earliestTime(): """ | defearliestTime():""" | 2,441 |
def earliestTime(): """ | def earliestTime(): """ | 2,442 |
def latestTime(): """ | deflatestTime():""" | 2,443 |
def latestTime(): """ | def latestTime(): """ | 2,444 |
def greaterThan(self,t): """ | defgreaterThan(self,t):""" | 2,445 |
def greaterThanEqualTo(self,t): """ | defgreaterThanEqualTo(self,t):""" | 2,446 |
def equalTo(self,t): """ | defequalTo(self,t):""" | 2,447 |
def notEqualTo(self,t): """ | defnotEqualTo(self,t):""" | 2,448 |
def lessThan(self,t): """ | deflessThan(self,t):""" | 2,449 |
def lessThanEqualTo(self,t): """ | deflessThanEqualTo(self,t):""" | 2,450 |
def isLeapYear(): """ | defisLeapYear():""" | 2,451 |
def isLeapYear(): """ | def isLeapYear(): """ | 2,452 |
def dayOfYear(): """ | defdayOfYear():""" | 2,453 |
def parts(): """ | defparts():""" | 2,454 |
def timezone(): """ | deftimezone():""" | 2,455 |
def year(): """ | defyear():""" | 2,456 |
def year(): """ | def year(): """ | 2,457 |
def month(): """ | defmonth():""" | 2,458 |
def Month(): """ | defMonth():""" | 2,459 |
def aMonth(): """ | defaMonth():""" | 2,460 |
def Mon(): """ | defMon():""" | 2,461 |
def pMonth(): """ | defpMonth():""" | 2,462 |
def Mon_(): """ | defMon_():""" | 2,463 |
def day(): """ | defday():""" | 2,464 |
def Day(): """ | defDay():""" | 2,465 |
def DayOfWeek(): """ | defDayOfWeek():""" | 2,466 |
def aDay(): """ | defaDay():""" | 2,467 |
def aDay(): """ | def aDay(): """ | 2,468 |
def pDay(): """ | defpDay():""" | 2,469 |
def pDay(): """ | def pDay(): """ | 2,470 |
def Day_(): """ | defDay_():""" | 2,471 |
def Day_(): """ | def Day_(): """ | 2,472 |
def dow(): """ | defdow():""" | 2,473 |
def dow(): """ | def dow(): """ | 2,474 |
def dow_1(): """ | defdow_1():""" | 2,475 |
def h_12(): """ | defh_12():""" | 2,476 |
def h_24(): """ | defh_24():""" | 2,477 |
def ampm(): """ | defampm():""" | 2,478 |
def hour(): """ | defhour():""" | 2,479 |
def minute(): """ | defminute():""" | 2,480 |
def second(): """ | defsecond():""" | 2,481 |
def millis(): """ | defmillis():""" | 2,482 |
def Date(): """ | defDate():""" | 2,483 |
def Time(): """ | defTime():""" | 2,484 |
def TimeMinutes(): """ | defTimeMinutes():""" | 2,485 |
def AMPM(): """ | defAMPM():""" | 2,486 |
def AMPMMinutes(): """ | defAMPMMinutes():""" | 2,487 |
def PreciseTime(): """ | defPreciseTime():""" | 2,488 |
def PreciseAMPM(): """Return the time string for the object.""" | def PreciseAMPM(): """Return the time string for the object.""" | 2,489 |
def yy(): """Return calendar year as a 2 digit string""" | def yy(): """Return calendar year as a 2 digit string""" | 2,490 |
def mm(): """Return month as a 2 digit string""" | def mm(): """Return month as a 2 digit string""" | 2,491 |
def dd(): """Return day as a 2 digit string""" | def dd(): """Return day as a 2 digit string""" | 2,492 |
def rfc822(): """Return the date in RFC 822 format""" | def rfc822(): """Return the date in RFC 822 format""" | 2,493 |
def fCommon(): """Return a string representing the object\'s value in the format: March 1, 1997 1:45 pm""" | def fCommon(): """Return a string representing the object\'s value in the format: March 1, 1997 1:45 pm""" | 2,494 |
def fCommonZ(): """Return a string representing the object\'s value in the format: March 1, 1997 1:45 pm US/Eastern""" | def fCommonZ(): """Return a string representing the object\'s value in the format: March 1, 1997 1:45 pm US/Eastern""" | 2,495 |
def aCommon(): """Return a string representing the object\'s value in the format: Mar 1, 1997 1:45 pm""" | def aCommon(): """Return a string representing the object\'s value in the format: Mar 1, 1997 1:45 pm""" | 2,496 |
def aCommonZ(): """Return a string representing the object\'s value in the format: Mar 1, 1997 1:45 pm US/Eastern""" | def aCommonZ(): """Return a string representing the object\'s value in the format: Mar 1, 1997 1:45 pm US/Eastern""" | 2,497 |
def pCommon(): """Return a string representing the object\'s value in the format: Mar. 1, 1997 1:45 pm""" | def pCommon(): """Return a string representing the object\'s value in the format: Mar. 1, 1997 1:45 pm""" | 2,498 |
def pCommonZ(): """Return a string representing the object\'s value in the format: Mar. 1, 1997 1:45 pm US/Eastern""" | def pCommonZ(): """Return a string representing the object\'s value in the format: Mar. 1, 1997 1:45 pm US/Eastern""" | 2,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.