bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def testStruct2(self): obj = OC_TestClass1.new() | def testStruct2(self): obj = OC_TestClass1.new() | 30,600 |
def testStruct2(self): self.assertEquals(self.obj.dummy2Arg_(((1,2,3,4),)), ((8,6,4,2),)) | def testStruct2(self): self.assertEquals(self.obj.dummy2Arg_(((1,2,3,4),)), ((8,6,4,2),)) | 30,601 |
def testPropertyList2(self): d = NSMutableDictionary.dictionary() | def testPropertyList2(self): d = NSMutableDictionary.dictionary() | 30,602 |
def testPropertyList2(self): d = NSMutableDictionary.dictionary() | def testPropertyList2(self): d = NSMutableDictionary.dictionary() | 30,603 |
def testProxy (self): o = NSDecimalNumber.decimalNumberWithString_(u"1.00") | def testProxy (self): o = NSDecimalNumber.decimalNumberWithString_(u"1.00") | 30,604 |
def testProxy (self): o = NSDecimalNumber.decimalNumberWithString_(u"1.00") | def testProxy (self): o = NSDecimalNumber.decimalNumberWithString_(u"1.00") | 30,605 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,606 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,607 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,608 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,609 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,610 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,611 |
def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | def is_id(typestr): # Remove protocol 'declarations' (id <NSObject, NSString>) typestr = PROT_MATCHER.sub('', typestr).strip() if typestr == 'id': return 1 elif typestr[-1] != '*': return 0 try: objc.lookup_class(typestr[:-1]) return 1 except: return 0 | 30,612 |
def process_list(fp, lst): ok_count = 0 total_count = 0 funcs=[] fp.write(HDR) for l in lst: l = l.strip() if not l: continue if l[0] == '#': continue total_count += 1 try: sys.stderr.write("Converting '%s' ..."%l.strip()) sys.stderr.flush() funcs.append((process_function(fp, l), l)) sys.stderr.write("done\n") sys.s... | def process_list(fp, lst): ok_count = 0 total_count = 0 funcs=[] fp.write(HDR) for l in lst: l = l.strip() if not l: continue if l[0] == '#': continue total_count += 1 try: sys.stderr.write("Converting '%s' ..."%l.strip()) sys.stderr.flush() funcs.append((process_function(fp, l), l)) sys.stderr.write("done\n") sys.s... | 30,613 |
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | 30,614 |
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | 30,615 |
def popitem_setObject_forKey_(self): try: k = self[iter(self).next()] except StopIteration: raise KeyError, "popitem on an empty %s" % (type(self).__name__,) else: return (k, self[k]) | def popitem_setObject_forKey_(self): try: k = self[iter(self).next()] except StopIteration: raise KeyError, "popitem on an empty %s" % (type(self).__name__,) else: return (k, self[k]) | 30,616 |
def importExternalTestCases(pathPattern="test_*.py", root=".", package=None): """ Import all unittests in the PyObjC tree starting at 'root' """ testFiles = recursiveGlob(root, pathPattern) testModules = map(lambda x:x[len(root)+1:-3].replace('/', '.'), testFiles) if package is not None: testModules = [(package + '.' ... | def importExternalTestCases(pathPattern="test_*.py", root=".", package=None): """ Import all unittests in the PyObjC tree starting at 'root' """ testFiles = recursiveGlob(root, pathPattern) testModules = map(lambda x:x[len(root)+1:-3].replace('/', '.'), testFiles) if package is not None: testModules = [(package + '.' ... | 30,617 |
def test (self): if not os.path.isdir(self.build_dir): self.warn("'%s' does not exist -- cannot test" % self.build_dir) return | def test (self): if not os.path.isdir(self.build_dir): self.warn("'%s' does not exist -- cannot test" % self.build_dir) return | 30,618 |
def initWithURL_cachePolicy_timeoutInterval_(self, theURL, cachePolicy, timeoutInterval): print 'checking', theURL, cachePolicy, timeoutInterval try: theURL = idnSnitch.checkURL_(theURL) except Exception, e: import traceback traceback.print_exc() NSLog(u"%s: %s" % (e.__class__.__name__, e)) print 'checked' self.retain(... | def initWithURL_cachePolicy_timeoutInterval_(self, theURL, cachePolicy, timeoutInterval): try: theURL = idnSnitch.checkURL_(theURL) except Exception, e: import traceback traceback.print_exc() NSLog(u"%s: %s" % (e.__class__.__name__, e)) print 'checked' self.retain() res = oldIMP(self, theURL, cachePolicy, timeoutInterv... | 30,619 |
def initWithURL_cachePolicy_timeoutInterval_(self, theURL, cachePolicy, timeoutInterval): print 'checking', theURL, cachePolicy, timeoutInterval try: theURL = idnSnitch.checkURL_(theURL) except Exception, e: import traceback traceback.print_exc() NSLog(u"%s: %s" % (e.__class__.__name__, e)) print 'checked' self.retain(... | def initWithURL_cachePolicy_timeoutInterval_(self, theURL, cachePolicy, timeoutInterval): print 'checking', theURL, cachePolicy, timeoutInterval try: theURL = idnSnitch.checkURL_(theURL) except Exception, e: import traceback traceback.print_exc() NSLog(u"%s: %s" % (e.__class__.__name__, e)) self.retain() res = oldIMP(s... | 30,620 |
def initWithURL_cachePolicy_timeoutInterval_(self, theURL, cachePolicy, timeoutInterval): print 'checking', theURL, cachePolicy, timeoutInterval try: theURL = idnSnitch.checkURL_(theURL) except Exception, e: import traceback traceback.print_exc() NSLog(u"%s: %s" % (e.__class__.__name__, e)) print 'checked' self.retain(... | def initWithURL_cachePolicy_timeoutInterval_(self, theURL, cachePolicy, timeoutInterval): print 'checking', theURL, cachePolicy, timeoutInterval try: theURL = idnSnitch.checkURL_(theURL) except Exception, e: import traceback traceback.print_exc() NSLog(u"%s: %s" % (e.__class__.__name__, e)) print 'checked' self.retain(... | 30,621 |
def checkURL_(self, anURL): print 'checkURL', self, anURL if anURL is None: return anURL host = anURL.host() if host is None: return anURL if encodings.idna.uace_prefix in host: uni = u'.'.join([encodings.idna.ToUnicode(part) for part in host.split(u'.')]) shouldDeny = self.HOSTS.get(uni) if shouldDeny is None: res = [... | def checkURL_(self, anURL): if anURL is None: return anURL host = anURL.host() if host is None: return anURL if encodings.idna.uace_prefix in host: uni = u'.'.join([encodings.idna.ToUnicode(part) for part in host.split(u'.')]) shouldDeny = self.HOSTS.get(uni) if shouldDeny is None: res = [] self.performSelectorOnMainTh... | 30,622 |
def dumpHandler(signum, frame): resetFatalSignals() print "*** Handling fatal signal '%d'." % signum traceback.print_stack(frame) print "*** Restored handlers and resignaling." % signum os.kill(os.getpid(), signum) | def dumpHandler(signum, frame): resetFatalSignals() print "*** Handling fatal signal '%d'." % signum traceback.print_stack(frame) print "*** Restored handlers and resignaling." os.kill(os.getpid(), signum) | 30,623 |
def testNSFileTypeForHFSTypeCode(self): self.assertEquals("'rtfx'", Foundation.NSFileTypeForHFSTypeCode('rtfx')) | def testNSFileTypeForHFSTypeCode(self): self.assertEquals("'rtfx'", Foundation.NSFileTypeForHFSTypeCode('rtfx')) | 30,624 |
def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Accessor or attribute 'key' - Accessor or attribute 'isKey' - Attr... | 30,625 |
def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | 30,626 |
def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | 30,627 |
def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | 30,628 |
def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | def getKey(obj, key): """ Get the attribute referenced by 'key'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accesors at tried (in this order): - Accessor 'getKey' - Accesoor 'get_key' - Attribute or accessor 'key' - Attribute '_key' If none of these e... | 30,629 |
def setKey(obj, key, value): """ Set the attribute referenced by 'key' to 'value'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accessors are tried (in this order): - Accessor 'setKey' - Accessor 'set_key' - Attribute '_key' - Attribute 'key' Raises Key... | def setKey(obj, key, value): """ Set the attribute referenced by 'key' to 'value'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accessors are tried (in this order): - Accessor 'setKey' - Accessor 'set_key' - Attribute '_key' - Attribute 'key' Raises Key... | 30,630 |
def setKey(obj, key, value): """ Set the attribute referenced by 'key' to 'value'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accessors are tried (in this order): - Accessor 'setKey' - Accessor 'set_key' - Attribute '_key' - Attribute 'key' Raises Key... | def setKey(obj, key, value): """ Set the attribute referenced by 'key' to 'value'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accessors are tried (in this order): - Accessor 'setKey' - Accessor 'set_key' - Attribute '_key' - Attribute 'key' Raises Key... | 30,631 |
def setKey(obj, key, value): """ Set the attribute referenced by 'key' to 'value'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accessors are tried (in this order): - Accessor 'setKey' - Accessor 'set_key' - Attribute '_key' - Attribute 'key' Raises Key... | def setKey(obj, key, value): """ Set the attribute referenced by 'key' to 'value'. The key is used to build the name of an attribute, or attribute accessor method. The following attributes and accessors are tried (in this order): - Accessor 'setKey' - Accessor 'set_key' - Attribute '_key' - Attribute 'key' Raises Key... | 30,632 |
def dataRepresentationOfType_(self, aType): # return an NSData containing the document's data represented as # the type identified by aType. return nil | def dataRepresentationOfType_(self, aType): # return an NSData containing the document's data represented as # the type identified by aType. return nil | 30,633 |
def unexpectedErrorAlert(): import traceback exceptionInfo = traceback.format_exception_only( *sys.exc_info()[:2])[0].strip() return NSRunAlertPanel("An unexpected error has occurred", "(%s)" % exceptionInfo, "Continue", "Quit", None) | def unexpectedErrorAlert(): exceptionInfo = traceback.format_exception_only( *sys.exc_info()[:2])[0].strip() return NSRunAlertPanel("An unexpected error has occurred", "(%s)" % exceptionInfo, "Continue", "Quit", None) | 30,634 |
def init(self): self = super(ProgressCell, self).init() if self is None: return None | def init(self): self = super(ProgressCell, self).init() if self is None: return None | 30,635 |
def drawInteriorWithFrame_inView_(self, cellFrame, view): super(ProgressCell, self).drawInteriorWithFrame_inView_( cellFrame, controlView) self.setControlView_(view) NSColor.controlColor().set() NSRectFill(cellFrame) | def drawInteriorWithFrame_inView_(self, cellFrame, view): super(ProgressCell, self).drawInteriorWithFrame_inView_( cellFrame, view) self.setControlView_(view) NSColor.controlColor().set() NSRectFill(cellFrame) | 30,636 |
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path.... | def"-DPYOBJC_NEW_INITIALIZER_PATTERN", IfFrameWork(name,"-DPYOBJC_NEW_INITIALIZER_PATTERN", packages,"-DPYOBJC_NEW_INITIALIZER_PATTERN", extensions,"-DPYOBJC_NEW_INITIALIZER_PATTERN", headername=None):"-DPYOBJC_NEW_INITIALIZER_PATTERN", """"-DPYOBJC_NEW_INITIALIZER_PATTERN", Return"-DPYOBJC_NEW_INITIALIZER_PATTERN", th... | 30,637 |
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path.... | def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path.... | 30,638 |
def testObserving(self): observer = PyObjCTestObserver.alloc().init() | deftestObserving(self):observer=PyObjCTestObserver.alloc().init() | 30,639 |
def run(self): # Save self.compiler, we need to reset it when we have to rebuild # the extensions. compiler_saved = self.compiler | def run(self): # Save self.compiler, we need to reset it when we have to rebuild # the extensions. compiler_saved = self.compiler | 30,640 |
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | 30,641 |
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | 30,642 |
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path) | 30,643 |
def pathjoin(*args): """Safe wrapper for os.path.join: asserts that all but the first argument are relative paths.""" for seg in args[1:]: assert seg[0] != "/" return os.path.join(*args) | def pathjoin(*args): """Safe wrapper for os.path.join: asserts that all but the first argument are relative paths.""" for seg in args[1:]: assert seg[0] != "/" return os.path.join(*args) | 30,644 |
def runTestCase(self): os.environ['DYLD_BIND_AT_LAUNCH'] = '1' fp = os.popen('/tmp/test.bin', 'r') del os.environ['DYLD_BIND_AT_LAUNCH'] data = fp.read() xit = fp.close() if xit != None: self.fail("Running failed[%s]"%(xit,)) return data | def runTestCase(self): fp = os.popen('/tmp/test.bin', 'r') del os.environ['DYLD_BIND_AT_LAUNCH'] data = fp.read() xit = fp.close() if xit != None: self.fail("Running failed[%s]"%(xit,)) return data | 30,645 |
def runTestCase(self): os.environ['DYLD_BIND_AT_LAUNCH'] = '1' fp = os.popen('/tmp/test.bin', 'r') del os.environ['DYLD_BIND_AT_LAUNCH'] data = fp.read() xit = fp.close() if xit != None: self.fail("Running failed[%s]"%(xit,)) return data | def runTestCase(self): os.environ['DYLD_BIND_AT_LAUNCH'] = '1' fp = os.popen('/tmp/test.bin', 'r') data = fp.read() xit = fp.close() if xit != None: self.fail("Running failed[%s]"%(xit,)) return data | 30,646 |
def propertyListFromPythonCollection(aPyCollection, conversionHelper=None): """Convert a Python collection (dictionary, array, tuple, string) into an Objective-C collection. If conversionHelper is defined, it must be a callable. It will be called for any object encountered for which propertyListFromPythonCollection()... | def propertyListFromPythonCollection(aPyCollection, conversionHelper=None): """Convert a Python collection (dictionary, array, tuple, string) into an Objective-C collection. If conversionHelper is defined, it must be a callable. It will be called for any object encountered for which propertyListFromPythonCollection()... | 30,647 |
def propertyListFromPythonCollection(aPyCollection, conversionHelper=None): """Convert a Python collection (dictionary, array, tuple, string) into an Objective-C collection. If conversionHelper is defined, it must be a callable. It will be called for any object encountered for which propertyListFromPythonCollection()... | def propertyListFromPythonCollection(aPyCollection, conversionHelper=None): """Convert a Python collection (dictionary, array, tuple, string) into an Objective-C collection. If conversionHelper is defined, it must be a callable. It will be called for any object encountered for which propertyListFromPythonCollection()... | 30,648 |
def run(self): task_build_libffi() | def run(self): task_build_libffi() | 30,649 |
def run(self): task_build_libffi() | def run(self): task_build_libffi() | 30,650 |
def bundleForClass(cls): return cb | def bundleForClass(cls): return cb | 30,651 |
def init(self): self = super(PyObjCDebuggingDelegate, self).init() self.setVerbosity_(DEFAULTVERBOSITY) return self | def init(self): self = super(PyObjCDebuggingDelegate, self).init() self.setVerbosity_(DEFAULTVERBOSITY) return self | 30,652 |
def initWithVerbosity_(self, verbosity): self = self.init() self.setVerbosity_(verbosity) return self | def initWithVerbosity_(self, verbosity): self = self.init() self.verbosity = verbosity return self | 30,653 |
def initWithVerbosity_(self, verbosity): self = self.init() self.setVerbosity_(verbosity) return self | def initWithVerbosity_(self, verbosity): self = self.init() self.setVerbosity_(verbosity) return self | 30,654 |
def exceptionHandler_shouldLogException_mask_(self, sender, exception, aMask): try: if isPythonException(exception): if self.verbosity() & LOGSTACKTRACE: nsLogObjCException(exception) return nsLogPythonException(exception) elif self.verbosity() & LOGSTACKTRACE: return nsLogObjCException(exception) else: return False ex... | def exceptionHandler_shouldLogException_mask_(self, sender, exception, aMask): try: if isPythonException(exception): if self.verbosity & LOGSTACKTRACE: nsLogObjCException(exception) return nsLogPythonException(exception) elif self.verbosity & LOGSTACKTRACE: return nsLogObjCException(exception) else: return False except... | 30,655 |
def exceptionHandler_shouldLogException_mask_(self, sender, exception, aMask): try: if isPythonException(exception): if self.verbosity() & LOGSTACKTRACE: nsLogObjCException(exception) return nsLogPythonException(exception) elif self.verbosity() & LOGSTACKTRACE: return nsLogObjCException(exception) else: return False ex... | def exceptionHandler_shouldLogException_mask_(self, sender, exception, aMask): try: if isPythonException(exception): if self.verbosity() & LOGSTACKTRACE: nsLogObjCException(exception) return nsLogPythonException(exception) elif self.verbosity & LOGSTACKTRACE: return nsLogObjCException(exception) else: return False exce... | 30,656 |
def stopObservingGraphics_(self, graphics): if graphics is None: return for graphic in graphics: for key in graphic.class__.keysForNonBoundsProperties(): graphic.removeObserver_forKeyPath_(self, key) graphic.removeObserver_forKeyPath_(self, u"drawingBounds") | def stopObservingGraphics_(self, graphics): if graphics is None: return for graphic in graphics: for key in graphic.class__().keysForNonBoundsProperties(): graphic.removeObserver_forKeyPath_(self, key) graphic.removeObserver_forKeyPath_(self, u"drawingBounds") | 30,657 |
def testSimple(self): for obj in [ ['a',], 'hello', 2, ]: self.assertEquals(repr(obj), PyObjC_TestClass4.fetchObjectDescription_(obj)) | def testSimple(self): for obj in [ ['a',], 'hello', 2, ]: self.assertEquals(repr(obj), PyObjC_TestClass4.fetchObjectDescription_(obj)) | 30,658 |
def accessor(func, typeSignature='@'): """ Return an Objective-C method object that is conformant with key-value coding and key-value observing. """ from inspect import getargspec args, varargs, varkw, defaults = getargspec(func) funcName = func.__name__ maxArgs = len(args) minArgs = maxArgs - len(defaults or ()) # im... | def accessor(func, typeSignature='@'): """ Return an Objective-C method object that is conformant with key-value coding and key-value observing. """ from inspect import getargspec args, varargs, varkw, defaults = getargspec(func) funcName = func.__name__ maxArgs = len(args) minArgs = maxArgs - len(defaults or ()) # im... | 30,659 |
def accessor(func, typeSignature='@'): """ Return an Objective-C method object that is conformant with key-value coding and key-value observing. """ from inspect import getargspec args, varargs, varkw, defaults = getargspec(func) funcName = func.__name__ maxArgs = len(args) minArgs = maxArgs - len(defaults or ()) # im... | def accessor(func, typeSignature='@'): """ Return an Objective-C method object that is conformant with key-value coding and key-value observing. """ from inspect import getargspec args, varargs, varkw, defaults = getargspec(func) funcName = func.__name__ maxArgs = len(args) minArgs = maxArgs - len(defaults or ()) # im... | 30,660 |
def add_convenience_methods(super_class, name, type_dict): """ Add additional methods to the type-dict of subclass 'name' of 'super_class'. CONVENIENCE_METHODS is a global variable containing a mapping from an Objective-C selector to a Python method name and implementation. CLASS_METHODS is a global variable containi... | def add_convenience_methods(super_class, name, type_dict): """ Add additional methods to the type-dict of subclass 'name' of 'super_class'. CONVENIENCE_METHODS is a global variable containing a mapping from an Objective-C selector to a Python method name and implementation. CLASS_METHODS is a global variable containi... | 30,661 |
def killNasties(irrelevant, dirName, names): for aName in names: if aName in nastyFiles: os.remove( os.path.join(dirName, aName) ) if dirName.find(".pbproj") > 0: for aName in names: if aName.find(".pbxuser") > 0: os.remove( os.path.join(dirName, aName) ) if dirName[-3:] == 'CVS': while len(names): del names[0] shutil.... | def killNasties(irrelevant, dirName, names): for aName in names: if aName in nastyFiles: os.remove( os.path.join(dirName, aName) ) if dirName.find(".pbproj") > 0: for aName in names: if aName.find(".pbxuser") > 0: os.remove( os.path.join(dirName, aName) ) if dirName[-3:] == 'CVS': while len(names): del names[0] shutil.... | 30,662 |
def killNasties(irrelevant, dirName, names): for aName in names: if aName in nastyFiles: os.remove( os.path.join(dirName, aName) ) if dirName.find(".pbproj") > 0: for aName in names: if aName.find(".pbxuser") > 0: os.remove( os.path.join(dirName, aName) ) if dirName[-3:] == 'CVS': while len(names): del names[0] shutil.... | def killNasties(irrelevant, dirName, names): for aName in names: if aName in nastyFiles: os.remove( os.path.join(dirName, aName) ) if dirName.find(".pbproj") > 0: for aName in names: if aName.find(".pbxuser") > 0: os.remove( os.path.join(dirName, aName) ) if dirName[-3:] == 'CVS': while len(names): del names[0] shutil.... | 30,663 |
def _xcodeFiles(base): for fn in os.listdir(base): base, ext = os.path.splitext(fn) if ext == '.xcode': yield XCODE_20, os.path.join(base, fn, 'project.pbxproj') elif ext == '.xcodeproj': yield XCODE_21, os.path.join(base, fn, 'project.pbxproj') | def _xcodeFiles(base): for fn in os.listdir(base): ext = os.path.splitext(fn)[1] if ext == '.xcode': yield XCODE_20, os.path.join(base, fn, 'project.pbxproj') elif ext == '.xcodeproj': yield XCODE_21, os.path.join(base, fn, 'project.pbxproj') | 30,664 |
def NSMutableData__setitem__(self, item, value): self.mutableBytes()[item] = value | def NSMutableData__setitem__(self, item, value): self.mutableBytes()[item] = value | 30,665 |
typedef baz wibble fun* SomethingGreat; | typedef baz wibble fun* SomethingGreat; | 30,666 |
fd.write('typedef void* PYOBJC_VOIDPTR;\n') | fd.write('typedef void* PYOBJC_VOIDPTR;\n') | 30,667 |
fd.write('typedef void* PYOBJC_VOIDPTR;\n') | fd.write('typedef void* PYOBJC_VOIDPTR;\n') | 30,668 |
def testInitWithURL(self): url = NSURL.fileURLWithPath_(__file__) | def testInitWithURL(self): url = NSURL.fileURLWithPath_(__file__) | 30,669 |
def testInitWithURL(self): url = NSURL.fileURLWithPath_(__file__) | def testInitWithURL(self): url = NSURL.fileURLWithPath_(__file__) | 30,670 |
def enumeratorGenerator(anEnumerator): nextObject = anEnumerator.nextObject() while (nextObject is not None): yield nextObject nextObject = anEnumerator.nextObject() | def enumeratorGenerator(anEnumerator): nextObject = anEnumerator.nextObject() while nextObject is not None: yield nextObject nextObject = anEnumerator.nextObject() | 30,671 |
def setup(self): | def setup(self): | 30,672 |
def setup(self): | def setup(self): | 30,673 |
def setup(self): | def setup(self): | 30,674 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,675 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,676 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,677 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,678 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,679 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,680 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,681 |
def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | def subdivideHex(model, elem, refinenodes): """subdivide a Hex8 element |elem| around the nodes |lnodes| remove |elem| from the model |model| and insert the subelements """ assert(elem.shape.name == 'Hex8') # swap the element corners depending on the refine node / edge swapcorners = [ [0, 1, 2, 3, 4, 5, 6, 7], # u 0... | 30,682 |
def removeDir(topDir) | defos.remove(os.path.join(root, name)) removeDir(topDir) | 30,683 |
def removeDir(topDir) | defos.rmdir(os.path.join(root, name)) removeDir(topDir) | 30,684 |
def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | def __init__(self, project, workDir = None, startRevision = None, endRevision = None): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | 30,685 |
def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == None: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | 30,686 |
def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | 30,687 |
def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | def __init__(self, project, workDir = null, startRevision = null, endRevision = null): self.project = project if workDir == null: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | 30,688 |
def extract_revision_data(self, revision) destDir = os.path.join(self.workDir, revision) project.repository.export(destDir, revision) filename = os.path.join(self.workDir, "stats.%s" % revision) sys.execlp("sloccount --duplicates --autogen --addlangall %s > %s" % (destDir, filename)) removeDir(destDir) | def extract_revision_data(self, revision): destDir = os.path.join(self.workDir, revision) project.repository.export(destDir, revision) filename = os.path.join(self.workDir, "stats.%s" % revision) sys.execlp("sloccount --duplicates --autogen --addlangall %s > %s" % (destDir, filename)) removeDir(destDir) | 30,689 |
def collectMetrics(self) metrics = MetricsCollector(self) metrics.run() print "\n\nData is available at %" % (metrics.workDir) | def collectMetrics(self): metrics = MetricsCollector(self) metrics.run() print "\n\nData is available at %" % (metrics.workDir) | 30,690 |
def build_re_list(self, expressions_list): re_list = [] for expression in expressions_list: re_list.append(re.compile(expression)) return re_list | def build_re_list(expressions_list): re_list = [] for expression in expressions_list: re_list.append(re.compile(expression)) return re_list | 30,691 |
def string_matches_re_list(self, string, re_list): for expression in re_list: if expression.match(string): return True return False | def string_matches_re_list(string, re_list): for expression in re_list: if expression.match(string): return True return False | 30,692 |
def __init__(self, url): assert(core.SVN_VER_MAJOR, core.SVN_VER_MINOR) >= (1, 3), "Subversion 1.3 or later required" self.url = url | def __init__(self, url): assert(svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR) >= (1, 3), "Subversion 1.3 or later required" self.url = url | 30,693 |
def getRevisionRange(self, startRevision, endRevision): if type(startRevision) == str: startRevision = convertRevisionStringToInt(startRevision) if type(endRevision) == str: endRevision = convertRevisionStringToInt(endRevision) return range(startRevision, endRevision) | def getRevisionRange(self, startRevision, endRevision): if type(startRevision) == str: startRevision = self.convertRevisionStringToInt(startRevision) if type(endRevision) == str: endRevision = convertRevisionStringToInt(endRevision) return range(startRevision, endRevision) | 30,694 |
def getRevisionRange(self, startRevision, endRevision): if type(startRevision) == str: startRevision = convertRevisionStringToInt(startRevision) if type(endRevision) == str: endRevision = convertRevisionStringToInt(endRevision) return range(startRevision, endRevision) | def getRevisionRange(self, startRevision, endRevision): if type(startRevision) == str: startRevision = convertRevisionStringToInt(startRevision) if type(endRevision) == str: endRevision = self.convertRevisionStringToInt(endRevision) return range(startRevision, endRevision) | 30,695 |
def __init__(self, project, workDir = None, startRevision = None, endRevision = None): self.project = project if workDir == None: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | def __init__(self, project, workDir = None, startRevision = None, endRevision = None): self.project = project if workDir == None: self.workDir = tempfile.mkdtemp() else: self.workDir = workDir | 30,696 |
def __init__(self, project, workDir = None, startRevision = None, endRevision = None): self.project = project if workDir == None: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | def __init__(self, project, workDir = None, startRevision = None, endRevision = None): self.project = project if workDir == None: self.workDir = tempfile.mkstemp() else: self.workDir = workDir | 30,697 |
def collectData(self): locHistory = {} | def collectData(self): locHistory = {} | 30,698 |
def run(self): print "Compiling data for project %s, from version %s to %s" % (self.project.name, self.startRevision, self.endRevision) print "Directories to be ignored: ", for i in self.project.tagXfile["VendorCode"]: print i, print "" | def run(self): print "Compiling data for project %s, from version %s to %s" % (self.project.name, self.startRevision, self.endRevision) print "Directories to be ignored: ", for i in self.project.getFilesTaggedAs("VendorCode"): print i, print "" | 30,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.