bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def constant_green_generator(numchips, rgbtuple): green = rgbtuple[1] seq = constant(numchips) return map(None, seq, [green] * numchips, seq) | def constant_green_generator(numchips, rgbtuple): green = rgbtuple[1] seq = constant(numchips) return map(None, [red] * numchips, seq, [blue] * numchips) | 12,600 |
def constant_blue_generator(numchips, rgbtuple): blue = rgbtuple[2] seq = constant(numchips) return map(None, seq, seq, [blue] * numchips) | def constant_yellow_generator(numchips, rgbtuple): red, green, blue = rgbtuple seq = constant(numchips) return map(None, seq, seq, [blue] * numchips) | 12,601 |
def constant_blue_generator(numchips, rgbtuple): blue = rgbtuple[2] seq = constant(numchips) return map(None, seq, seq, [blue] * numchips) | def constant_blue_generator(numchips, rgbtuple): blue = rgbtuple[2] seq = constant(numchips) return map(None, [red] * numchips, [green] * numchips, seq) | 12,602 |
def __init__(self, colordb, parent=None, **kw): | def __init__(self, colordb, parent=None, **kw): | 12,603 |
def __init__(self, colordb, parent=None, **kw): | def __init__(self, colordb, parent=None, **kw): | 12,604 |
def __init__(self, colordb, parent=None, **kw): | def __init__(self, colordb, parent=None, **kw): | 12,605 |
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r... | def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r... | 12,606 |
def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is g... | def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1, sync=0, use=None): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without exten... | 12,607 |
def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is g... | def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is g... | 12,608 |
def opendbm(filename, mode, perm): return Dbm().init(filename, mode, perm) | def opendbm(filename, mode, perm): return Dbm().init(filename, mode, perm) | 12,609 |
def init(self, filename, mode, perm): import dbm self.db = dbm.open(filename, mode, perm) return self | def __init__(self, filename, mode, perm): import dbm self.db = dbm.open(filename, mode, perm) return self | 12,610 |
def init(self, filename, mode, perm): import dbm self.db = dbm.open(filename, mode, perm) return self | def init(self, filename, mode, perm): import dbm self.db = dbm.open(filename, mode, perm) return self | 12,611 |
def __repr__(self): s = '' for key in self.keys(): t = `key` + ': ' + `self[key]` if s: t = t + ', ' s = s + t return '{' + s + '}' | def __repr__(self): s = '' for key in self.keys(): t = `key` + ': ' + `self[key]` if s: t = ', ' + t s = s + t return '{' + s + '}' | 12,612 |
def __init__(self, master=None, cnf={}): Canvas.__init__(self, master, {'width': 100, 'height': 100}) Canvas.config(self, cnf) self.create_rectangle(30, 30, 70, 70, {'fill': 'red', 'tags': 'box'}) Canvas.bind(self, 'box', '<Enter>', self.enter) Canvas.bind(self, 'box', '<Leave>', self.leave) | def __init__(self, master=None, cnf={}): Canvas.__init__(self, master, {'width': 100, 'height': 100}) Canvas.config(self, cnf) self.create_rectangle(30, 30, 70, 70, {'fill': 'blue', 'tags': 'box'}) Canvas.bind(self, 'box', '<Enter>', self.enter) Canvas.bind(self, 'box', '<Leave>', self.leave) | 12,613 |
def _pickle_statvfs_result(sr): (type, args) = sr.__reduce__() return (_make_statvfs_result, args) | def _pickle_statvfs_result(sr): (type, args) = sr.__reduce__() return (_make_statvfs_result, args) | 12,614 |
def urandom(n): """urandom(n) -> str | def urandom(n): """urandom(n) -> str | 12,615 |
def check_metadata (self): | def check_metadata (self): | 12,616 |
def check_metadata (self): | def check_metadata (self): | 12,617 |
def check_metadata (self): | def check_metadata (self): | 12,618 |
def check_metadata (self): | def check_metadata (self): | 12,619 |
def open(self, url, new=0): ic.launcurl(url) | def open(self, url, new=0): ic.launcurl(url) | 12,620 |
def _mac_ver_lookup(selectors,default=None): from gestalt import gestalt l = [] append = l.append for selector in selectors: try: append(gestalt(selector)) except RuntimeError: append(default) return l | def _mac_ver_lookup(selectors,default=None): from gestalt import gestalt l = [] append = l.append for selector in selectors: try: append(gestalt(selector)) except (RuntimeError, MacOS.Error): append(default) return l | 12,621 |
def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) if ':' in user_pass: user, password = user_pass.split(':', 1) user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))... | def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) if ':' in user_pass: user, password = user_pass.split(':', 1) user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))... | 12,622 |
def __repr__(self): return '<Coerce %s>' % self.arg | def __repr__(self): return '<Coerce %s>' % self.arg | 12,623 |
def __coerce__(self, other): if isinstance(other, Coerce): return self.arg, other.arg else: return (self.arg, other) | def __coerce__(self, other): if isinstance(other, CoerceNumber): return self.arg, other.arg else: return (self.arg, other) | 12,624 |
def __coerce__(self, other): if isinstance(other, Coerce): return self.arg, other.arg else: return (self.arg, other) | def __coerce__(self, other): if isinstance(other, Coerce): return self.arg, other.arg else: return (self.arg, other) | 12,625 |
def __repr__(self): return '<Cmp %s>' % self.arg | def __repr__(self): return '<Cmp %s>' % self.arg | 12,626 |
def __cmp__(self, other): return cmp(self.arg, other) | def __cmp__(self, other): return cmp(self.arg, other) | 12,627 |
def __repr__(self): return '<RCmp %s>' % self.arg | def __repr__(self): return '<RCmp %s>' % self.arg | 12,628 |
def __rcmp__(self, other): return cmp(other, self.arg) | def __rcmp__(self, other): return cmp(other, self.arg) | 12,629 |
def __rcmp__(self, other): return cmp(other, self.arg) | def __rcmp__(self, other): return cmp(other, self.arg) | 12,630 |
def __del__(self): self._file_.close() | def __del__(self): self._file_.close() | 12,631 |
def __init__(self, filename, when='h', interval=1, backupCount=0): BaseRotatingHandler.__init__(self, filename, 'a') self.when = string.upper(when) self.backupCount = backupCount # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a ... | def __init__(self, filename, when='h', interval=1, backupCount=0): BaseRotatingHandler.__init__(self, filename, 'a') self.when = string.upper(when) self.backupCount = backupCount # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a ... | 12,632 |
def shouldRollover(self, record): """ Determine if rollover should occur | def shouldRollover(self, record): """ Determine if rollover should occur | 12,633 |
def doRollover(self): """ do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove... | def doRollover(self): """ do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove... | 12,634 |
def __del__(self): if self._file: self.close() | def __del__(self): if self._file: self.close() | 12,635 |
def close(self): self._ensure_header_written(0) if self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None | def close(self): self._ensure_header_written(0) if self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None | 12,636 |
def test_nonrecursive_deep(self): a = [] for i in range(100): a = [a] b = self.loads(self.dumps(a)) self.assertEqual(a, b) | def test_nonrecursive_deep(self): a = [] for i in range(60): a = [a] b = self.loads(self.dumps(a)) self.assertEqual(a, b) | 12,637 |
def test_values(self): entries = pwd.getpwall() | def test_values(self): entries = pwd.getpwall() | 12,638 |
def gammavariate(self, alpha, beta): # beta times standard gamma ainv = _sqrt(2.0 * alpha - 1.0) return beta * self.stdgamma(alpha, ainv, alpha - LOG4, alpha + ainv) | def gammavariate(self, alpha, beta): # beta times standard gamma ainv = _sqrt(2.0 * alpha - 1.0) return beta * self.stdgamma(alpha, ainv, alpha - LOG4, alpha + ainv) | 12,639 |
def inroots(self, url): | def inroots(self, url): | 12,640 |
def getpage(self, url): | def getpage(self, url): | 12,641 |
def copy_scripts (self): """Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy. """ self.mkpath(self.build_dir) fo... | def copy_scripts (self): """Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy. """ self.mkpath(self.build_dir) fo... | 12,642 |
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 12,643 |
def addpackage(sitedir, name, known_paths): """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'""" if known_paths is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = file(fullname, "rU") except IOError: return try... | def addpackage(sitedir, name, known_paths): """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'""" if known_paths is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname, "rU") except IOError: return try... | 12,644 |
def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" if known_paths is None: d = _init_pathinfo() reset = 1 else: reset = 0 sitedir, sitedircase = makepath(sitedir) if not sitedircase in known_paths: sys.path.append(sitedir) # Add path ... | def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" if known_paths is None: known_paths = _init_pathinfo() reset = 1 else: reset = 0 sitedir, sitedircase = makepath(sitedir) if not sitedircase in known_paths: sys.path.append(sitedir) #... | 12,645 |
def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" if known_paths is None: d = _init_pathinfo() reset = 1 else: reset = 0 sitedir, sitedircase = makepath(sitedir) if not sitedircase in known_paths: sys.path.append(sitedir) # Add path ... | def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" if known_paths is None: d = _init_pathinfo() reset = 1 else: reset = 0 sitedir, sitedircase = makepath(sitedir) if not sitedircase in known_paths: sys.path.append(sitedir) # Add path ... | 12,646 |
def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra): """Process arguments and decide which source files to compile. | def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra): """Process arguments and decide which source files to compile. | 12,647 |
def _prep_compile(self, sources, output_dir, depends=None): """Decide which souce files must be recompiled. | def _prep_compile(self, sources, output_dir, depends=None): """Decide which souce files must be recompiled. | 12,648 |
def execRcLines(self): if self.rcLines: # Make local copy because of recursion rcLines = self.rcLines # executed only once self.rcLines = [] for line in rcLines: line = line[:-1] if len (line) > 0 and line[0] != '#': self.onecmd (line) | def execRcLines(self): if self.rcLines: # Make local copy because of recursion rcLines = self.rcLines # executed only once self.rcLines = [] for line in rcLines: line = line[:-1] if len (line) > 0 and line[0] != '#': self.onecmd (line) | 12,649 |
def precmd(self, line): """Handle alias expansion and ';;' separator.""" if not line: return line args = line.split() while args[0] in self.aliases: line = self.aliases[args[0]] ii = 1 for tmpArg in args[1:]: line = line.replace("%" + str(ii), tmpArg) ii = ii + 1 line = line.replace("%*", ' '.join(args[1:])) args = lin... | def precmd(self, line): """Handle alias expansion and ';;' separator.""" if not line.strip(): return line args = line.split() while args[0] in self.aliases: line = self.aliases[args[0]] ii = 1 for tmpArg in args[1:]: line = line.replace("%" + str(ii), tmpArg) ii = ii + 1 line = line.replace("%*", ' '.join(args[1:])) ar... | 12,650 |
def checkline(self, filename, lineno): """Return line number of first line at or after input argument such that if the input points to a 'def', the returned line number is the first non-blank/non-comment line to follow. If the input points to a blank or comment line, return 0. At end of file, also return 0.""" | def checkline(self, filename, lineno): """Return line number of first line at or after input argument such that if the input points to a 'def', the returned line number is the first non-blank/non-comment line to follow. If the input points to a blank or comment line, return 0. At end of file, also return 0.""" | 12,651 |
def do_ignore(self,arg): """arg is bp number followed by ignore count.""" args = arg.split() bpnum = int(args[0].strip()) try: count = int(args[1].strip()) except: count = 0 bp = bdb.Breakpoint.bpbynumber[bpnum] if bp: bp.ignore = count if (count > 0): reply = 'Will ignore next ' if (count > 1): reply = reply + '%d cro... | def do_ignore(self,arg): """arg is bp number followed by ignore count.""" args = arg.split() bpnum = int(args[0].strip()) try: count = int(args[1].strip()) except: count = 0 bp = bdb.Breakpoint.bpbynumber[bpnum] if bp: bp.ignore = count if count > 0: reply = 'Will ignore next ' if (count > 1): reply = reply + '%d cross... | 12,652 |
def do_ignore(self,arg): """arg is bp number followed by ignore count.""" args = arg.split() bpnum = int(args[0].strip()) try: count = int(args[1].strip()) except: count = 0 bp = bdb.Breakpoint.bpbynumber[bpnum] if bp: bp.ignore = count if (count > 0): reply = 'Will ignore next ' if (count > 1): reply = reply + '%d cro... | def do_ignore(self,arg): """arg is bp number followed by ignore count.""" args = arg.split() bpnum = int(args[0].strip()) try: count = int(args[1].strip()) except: count = 0 bp = bdb.Breakpoint.bpbynumber[bpnum] if bp: bp.ignore = count if (count > 0): reply = 'Will ignore next ' if count > 1: reply = reply + '%d cross... | 12,653 |
def do_alias(self, arg): args = arg.split() if len(args) == 0: keys = self.aliases.keys() keys.sort() for alias in keys: print "%s = %s" % (alias, self.aliases[alias]) return if args[0] in self.aliases and len (args) == 1: print "%s = %s" % (args[0], self.aliases[args[0]]) else: self.aliases[args[0]] = ' '.join(args[1:... | def do_alias(self, arg): args = arg.split() if len(args) == 0: keys = self.aliases.keys() keys.sort() for alias in keys: print "%s = %s" % (alias, self.aliases[alias]) return if args[0] in self.aliases and len(args) == 1: print "%s = %s" % (args[0], self.aliases[args[0]]) else: self.aliases[args[0]] = ' '.join(args[1:]... | 12,654 |
def open_http(self, url): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'http': realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_p... | def open_http(self, url): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'http': realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_p... | 12,655 |
def repr1(self, x, level): typename = `type(x)`[7:-2] # "<type '......'>" if ' ' in typename: parts = string.split(typename) typename = string.joinfields(parts, '_') try: f = eval('self.repr_' + typename) except AttributeError: s = `x` if len(s) > self.maxother: i = max(0, (self.maxother-3)/2) j = max(0, self.maxother-... | def repr1(self, x, level): typename = `type(x)`[7:-2] # "<type '......'>" if ' ' in typename: parts = string.split(typename) typename = string.joinfields(parts, '_') if hasattr(self, 'repr_' + typename): return getattr(self, 'repr_' + typename)(x, level) else: s = `x` if len(s) > self.maxother: i = max(0, (self.maxothe... | 12,656 |
def repr1(self, x, level): typename = `type(x)`[7:-2] # "<type '......'>" if ' ' in typename: parts = string.split(typename) typename = string.joinfields(parts, '_') try: f = eval('self.repr_' + typename) except AttributeError: s = `x` if len(s) > self.maxother: i = max(0, (self.maxother-3)/2) j = max(0, self.maxother-... | def repr1(self, x, level): typename = `type(x)`[7:-2] # "<type '......'>" if ' ' in typename: parts = string.split(typename) typename = string.joinfields(parts, '_') try: f = eval('self.repr_' + typename) except AttributeError: s = `x` if len(s) > self.maxother: i = max(0, (self.maxother-3)/2) j = max(0, self.maxother-... | 12,657 |
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction. | def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction. | 12,658 |
>>> def f(n): | >>> def f(n): | 12,659 |
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 12,660 |
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 12,661 |
def s_exec(self, *args): self.s_apply(self.r_exec, args) | def s_exec(self, *args): self.s_apply(self.r_exec, args) | 12,662 |
def s_eval(self, *args): self.s_apply(self.r_eval, args) | def s_eval(self, *args): self.s_apply(self.r_eval, args) | 12,663 |
def s_execfile(self, *args): self.s_apply(self.r_execfile, args) | def s_execfile(self, *args): self.s_apply(self.r_execfile, args) | 12,664 |
def s_import(self, *args): self.s_apply(self.r_import, args) | def s_import(self, *args): self.s_apply(self.r_import, args) | 12,665 |
def s_reload(self, *args): self.s_apply(self.r_reload, args) | def s_reload(self, *args): self.s_apply(self.r_reload, args) | 12,666 |
def s_unload(self, *args): self.s_apply(self.r_unload, args) | def s_unload(self, *args): self.s_apply(self.r_unload, args) | 12,667 |
def __init__(self, encoding=None): self.memo = {} self.data = None self.encoding = encoding | def __init__(self, encoding=None, allow_none=0): self.memo = {} self.data = None self.encoding = encoding | 12,668 |
def __init__(self, encoding=None): self.memo = {} self.data = None self.encoding = encoding | defself.allow_none = allow_none __init__(self,self.allow_none = allow_none encoding=None):self.allow_none = allow_none self.memoself.allow_none = allow_none =self.allow_none = allow_none {}self.allow_none = allow_none self.dataself.allow_none = allow_none =self.allow_none = allow_none Noneself.allow_none = allo... | 12,669 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments... | def dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as key... | 12,670 |
def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments... | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments... | 12,671 |
def __init__(self, uri, transport=None, encoding=None, verbose=0): # establish a "logical" server connection | def __init__(self, uri, transport=None, encoding=None, verbose=0, allow_none=0): # establish a "logical" server connection | 12,672 |
def __init__(self, uri, transport=None, encoding=None, verbose=0): # establish a "logical" server connection | defself.__allow_none = allow_none __init__(self,self.__allow_none = allow_none uri,self.__allow_none = allow_none transport=None,self.__allow_none = allow_none encoding=None,self.__allow_none = allow_none verbose=0):self.__allow_none = allow_none #self.__allow_none = allow_none establishself.__allow_none = allow... | 12,673 |
def __request(self, methodname, params): # call a method on the remote server | def __request(self, methodname, params): # call a method on the remote server | 12,674 |
def __getattr__(self, name): # magic method dispatcher return _Method(self.__request, name) | def __getattr__(self, name): # magic method dispatcher return _Method(self.__request, name) | 12,675 |
def run (self): if not self.skip_build: self.run_command('build_scripts') self.outfiles = self.copy_tree(self.build_dir, self.install_dir) if os.name == 'posix': # Set the executable bits (owner, group, and world) on # all the scripts we just installed. for file in self.get_outputs(): if self.dry_run: log.info("changin... | def run (self): if not self.skip_build: self.run_command('build_scripts') self.outfiles = self.copy_tree(self.build_dir, self.install_dir) if os.name == 'posix': # Set the executable bits (owner, group, and world) on # all the scripts we just installed. for file in self.get_outputs(): if self.dry_run: log.info("changin... | 12,676 |
def test_methods(): h = sha.sha() for i in range(65536): char = unichr(i) data = [ # Predicates (single char) char.isalnum() and u'1' or u'0', char.isalpha() and u'1' or u'0', char.isdecimal() and u'1' or u'0', char.isdigit() and u'1' or u'0', char.islower() and u'1' or u'0', char.isnumeric() and u'1' or u'0', char.i... | def test_methods(): h = sha.sha() for i in range(65536): char = unichr(i) data = [ # Predicates (single char) char.isalnum() and u'1' or u'0', char.isalpha() and u'1' or u'0', char.isdecimal() and u'1' or u'0', char.isdigit() and u'1' or u'0', char.islower() and u'1' or u'0', char.isnumeric() and u'1' or u'0', char.i... | 12,677 |
def __init__(self, master=None, cnf={}, **kw): if kw: cnf = _cnfmerge((cnf, kw)) fcnf = {} for k in cnf.keys(): if type(k) == ClassType or k == 'name': fcnf[k] = cnf[k] del cnf[k] self.frame = apply(Frame, (master,), fcnf) self.vbar = Scrollbar(self.frame, name='vbar') self.vbar.pack(side=RIGHT, fill=Y) cnf['name'] = '... | def __init__(self, master=None, cnf=None, **kw): if cnf is None: cnf = {} if kw: cnf = _cnfmerge((cnf, kw)) fcnf = {} for k in cnf.keys(): if type(k) == ClassType or k == 'name': fcnf[k] = cnf[k] del cnf[k] self.frame = apply(Frame, (master,), fcnf) self.vbar = Scrollbar(self.frame, name='vbar') self.vbar.pack(side=RIG... | 12,678 |
def urlcleanup(): if _urlopener: _urlopener.cleanup() | def urlcleanup(): if _urlopener: _urlopener.cleanup() | 12,679 |
def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | def cleanup(self): if self.__tempfiles: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 12,680 |
def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | def cleanup(self): if self.tempcache: import os for file in self.__tempfiles: try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 12,681 |
def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(file) except os.error: pass del self.tempcache[url] | 12,682 |
def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 12,683 |
def basejoin(base, url): type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, just inherit type if type: return type + '://' + host + path else: #... | def basejoin(base, url): type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, just inherit type if type: return type + '://' + host + path else: #... | 12,684 |
def basejoin(base, url): type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, just inherit type if type: return type + '://' + host + path else: #... | def basejoin(base, url): type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, just inherit type if type: return type + '://' + host + path else: #... | 12,685 |
def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance. | def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance. | 12,686 |
def test_one(self, x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): if verbose: print "trying std", self.formatpair, "on", x, "==", hex(x) | def test_one(self, x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): if verbose: print "trying std", self.formatpair, "on", x, "==", hex(x) | 12,687 |
def test_1229380(): for endian in ('', '>', '<'): for cls in (int, long): for fmt in ('B', 'H', 'I', 'L'): any_err(struct.pack, endian + fmt, cls(-1)) any_err(struct.pack, endian + 'B', cls(300)) any_err(struct.pack, endian + 'H', cls(70000)) any_err(struct.pack, endian + 'I', sys.maxint * 4L) any_err(struct.pack, en... | def test_1229380(): for endian in ('', '>', '<'): for cls in (int, long): for fmt in ('B', 'H', 'I', 'L'): any_err(struct.pack, endian + fmt, cls(-1)) any_err(struct.pack, endian + 'B', cls(300)) any_err(struct.pack, endian + 'H', cls(70000)) any_err(struct.pack, endian + 'I', sys.maxint * 4L) any_err(struct.pack, en... | 12,688 |
def test_lang(self): # Make sure lang is set self.failUnless(self.LT_ins.lang in (locale.getdefaultlocale()[0], locale.getlocale(locale.LC_TIME), ''), "Setting of lang failed") | def test_lang(self): # Make sure lang is set self.failUnless(self.LT_ins.lang in (locale.getdefaultlocale()[0], locale.getlocale(locale.LC_TIME)[0], ''), "Setting of lang failed") | 12,689 |
def add_module(self, mname): if mname in self.modules: return self.modules[mname] self.modules[mname] = m = self.hooks.new_module(mname) m.__builtins__ = self.modules['__builtin__'] return m | def add_module(self, mname): m = self.modules.get(mname) if m is None: self.modules[mname] = m = self.hooks.new_module(mname) m.__builtins__ = self.modules['__builtin__'] return m | 12,690 |
def test(): import getopt, traceback opts, args = getopt.getopt(sys.argv[1:], 'vt:') verbose = 0 trusted = [] for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-t': trusted.append(a) r = RExec(verbose=verbose) if trusted: r.ok_builtin_modules = r.ok_builtin_modules + tuple(trusted) if args: r.modules['sys'].... | def test(): import getopt, traceback opts, args = getopt.getopt(sys.argv[1:], 'vt:') verbose = 0 trusted = [] for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-t': trusted.append(a) r = RExec(verbose=verbose) if trusted: r.ok_builtin_modules = r.ok_builtin_modules + tuple(trusted) if args: r.modules['sys'].... | 12,691 |
def search_function(encoding): # Cache lookup entry = _cache.get(encoding, _unknown) if entry is not _unknown: return entry # Import the module: # # First look in the encodings package, then try to lookup the # encoding in the aliases mapping and retry the import using the # default import module lookup scheme with t... | def search_function(encoding): # Cache lookup entry = _cache.get(encoding, _unknown) if entry is not _unknown: return entry # Import the module: # # First look in the encodings package, then try to lookup the # encoding in the aliases mapping and retry the import using the # default import module lookup scheme with t... | 12,692 |
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | 12,693 |
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | 12,694 |
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | 12,695 |
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return | 12,696 |
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files.... | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files.... | 12,697 |
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files.... | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files.... | 12,698 |
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files.... | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files.... | 12,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.