rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return self.decode(self.stream.read())[0]
return self.decode(self.stream.read(), self.errors)[0]
def read(self, size=-1):
c6c283840316dec54244b311657511e95e742eb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c6c283840316dec54244b311657511e95e742eb0/codecs.py
object, decodedbytes = decode(data)
object, decodedbytes = decode(data, self.errors)
def read(self, size=-1):
c6c283840316dec54244b311657511e95e742eb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c6c283840316dec54244b311657511e95e742eb0/codecs.py
return self.decode(line)[0]
return self.decode(line,self.errors)[0]
def readline(self, size=None):
c6c283840316dec54244b311657511e95e742eb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c6c283840316dec54244b311657511e95e742eb0/codecs.py
return self.decode(data)[0].splitlines(1)
return self.decode(data,self.errors)[0].splitlines(1)
def readlines(self, sizehint=0):
c6c283840316dec54244b311657511e95e742eb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c6c283840316dec54244b311657511e95e742eb0/codecs.py
def __init__(self, *args): apply(URLopener.__init__, (self,) + args)
def __init__(self, *args, **kwargs): apply(URLopener.__init__, (self,) + args, kwargs)
def __init__(self, *args): apply(URLopener.__init__, (self,) + args) self.auth_cache = {} self.tries = 0 self.maxtries = 10
60e04cd317201f43b612e99444eac297fae0ea40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60e04cd317201f43b612e99444eac297fae0ea40/urllib.py
elif 'r' in how: l_type = FCNTL.F_WRLCK
elif 'r' in how: l_type = FCNTL.F_RDLCK
def lock(self, how, *args):
ba3e46b9ce8c02c0215cc45bffa36b8500351f5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba3e46b9ce8c02c0215cc45bffa36b8500351f5b/posixfile.py
if sys.platform[:4] != 'java': value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} else: value = u"%(x)s, %()s" % {'x':u"abc", u'':"def"}
value = u"%(x)s, %()s" % {'x':u"abc", u'':"def"}
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
72f8213ba4b960bdf540a1cc494ac699170c9dec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/72f8213ba4b960bdf540a1cc494ac699170c9dec/test_unicode.py
def seval(item): """ Strips parens from item prior to calling eval in an attempt to make it safer """ return eval(item.replace('(', '').replace(')', ''))
def seval(item): """ Strips parens from item prior to calling eval in an attempt to make it safer """ return eval(item.replace('(', '').replace(')', ''))
39a55920018ef19cc01b53063a2f090fe05d4982 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39a55920018ef19cc01b53063a2f090fe05d4982/csv.py
try:
for thisType in [int, long, float, complex]:
def seval(item): """ Strips parens from item prior to calling eval in an attempt to make it safer """ return eval(item.replace('(', '').replace(')', ''))
39a55920018ef19cc01b53063a2f090fe05d4982 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39a55920018ef19cc01b53063a2f090fe05d4982/csv.py
thisType = type(seval(row[col])) except OverflowError: thisType = type(seval(row[col] + 'L')) thisType = type(0) except:
thisType(row[col]) break except ValueError, OverflowError: pass else:
def seval(item): """ Strips parens from item prior to calling eval in an attempt to make it safer """ return eval(item.replace('(', '').replace(')', ''))
39a55920018ef19cc01b53063a2f090fe05d4982 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39a55920018ef19cc01b53063a2f090fe05d4982/csv.py
eval("%s(%s)" % (colType.__name__, header[col])) except:
colType(header[col]) except ValueError, TypeError:
def seval(item): """ Strips parens from item prior to calling eval in an attempt to make it safer """ return eval(item.replace('(', '').replace(')', ''))
39a55920018ef19cc01b53063a2f090fe05d4982 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39a55920018ef19cc01b53063a2f090fe05d4982/csv.py
pass
def __str__(self): return repr(self)
def _stringify(string): return string
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
(repr(self.faultCode), repr(self.faultString))
(self.faultCode, repr(self.faultString))
def __repr__(self): return ( "<Fault %s: %s>" % (repr(self.faultCode), repr(self.faultString)) )
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
xmllib.XMLParser.__init__(self)
try: xmllib.XMLParser.__init__(self, accept_utf8=1) except TypeError: xmllib.XMLParser.__init__(self)
def __init__(self, target): import xmllib # lazy subclassing (!) if xmllib.XMLParser not in SlowParser.__bases__: SlowParser.__bases__ = (xmllib.XMLParser,) self.handle_xml = target.xml self.unknown_starttag = target.start self.handle_data = target.data self.unknown_endtag = target.end xmllib.XMLParser.__init__(self)
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
messages (start, data, end). Call close to get the resulting
messages (start, data, end). Call close() to get the resulting
def dump_instance(self, value): # check for special wrappers if value.__class__ in WRAPPERS: value.encode(self) else: # store instance attributes as a struct (really?) self.dump_struct(value.__dict__)
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
Note that this reader is fairly tolerant, and gladly accepts bogus XML-RPC data without complaining (but not bogus XML).
Note that this reader is fairly tolerant, and gladly accepts bogus XML-RPC data without complaining (but not bogus XML).
def dump_instance(self, value): # check for special wrappers if value.__class__ in WRAPPERS: value.encode(self) else: # store instance attributes as a struct (really?) self.dump_struct(value.__dict__)
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects.
Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects.
def getparser(): """getparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects. """ if FastParser and FastUnmarshaller: target = FastUnmarshaller(True, False, binary, datetime) parser = FastParser(target) else: target = Unmarsh...
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
In addition to the data object, the following options can be given as keyword arguments:
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...
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
as necessary.
where necessary.
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...
b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a/xmlrpclib.py
if 'Host' in (headers or [k for k in headers.iterkeys() if k.lower() == "host"]):
if 'host' in [k.lower() for k in headers]:
def _send_request(self, method, url, body, headers): # If headers already contains a host header, then define the # optional skip_host argument to putrequest(). The check is # harder because field names are case insensitive. if 'Host' in (headers or [k for k in headers.iterkeys() if k.lower() == "host"]): self.putrequ...
0c5b4ad8f2c83b8c7731731ae0ed48b95da9515e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c5b4ad8f2c83b8c7731731ae0ed48b95da9515e/httplib.py
Keywords are width, height, startx and starty
Keywords are width, height, startx and starty:
def setup(**geometry): """ Sets the size and position of the main window. Keywords are width, height, startx and starty width: either a size in pixels or a fraction of the screen. Default is 50% of screen. height: either the height in pixels or a fraction of the screen. Default is 75% of screen. Setting either width...
e2222a083b434b582d7b7f8d1e7155b55b769323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e2222a083b434b582d7b7f8d1e7155b55b769323/turtle.py
""" set the window title.
"""Set the window title.
def title(title): """ set the window title. By default this is set to 'Turtle Graphics' Example: >>> title("My Window") """ global _title _title = title
e2222a083b434b582d7b7f8d1e7155b55b769323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e2222a083b434b582d7b7f8d1e7155b55b769323/turtle.py
home = os.environ['HOME']
home = os.environ.get('HOME')
def addpackage(sitedir, name): global _dirs_in_sys_path if _dirs_in_sys_path is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exe...
470b0c0e1f7247539210cb5c13f8cb0f28894714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470b0c0e1f7247539210cb5c13f8cb0f28894714/site.py
tests = [Signed_TestCase, Unsigned_TestCase]
tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase]
def test_main(): tests = [Signed_TestCase, Unsigned_TestCase] try: from _testcapi import getargs_L, getargs_K except ImportError: pass # PY_LONG_LONG not available else: tests.append(LongLong_TestCase) test_support.run_unittest(*tests)
5f135787ec4040bfbeb16f2944086028635151db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f135787ec4040bfbeb16f2944086028635151db/test_getargs2.py
import traceback
def formatException(self, ei): """ Format and return the specified exception information as a string.
b89e7c9bc97d3f9332ecc94c88a055c0fe947625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b89e7c9bc97d3f9332ecc94c88a055c0fe947625/__init__.py
import traceback
def handleError(self, record): """ Handle errors which occur during an emit() call.
b89e7c9bc97d3f9332ecc94c88a055c0fe947625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b89e7c9bc97d3f9332ecc94c88a055c0fe947625/__init__.py
def __init__(self, filename, mode="a"):
def __init__(self, filename, mode='a', encoding=None):
def __init__(self, filename, mode="a"): """ Open the specified file and use it as the stream for logging. """ StreamHandler.__init__(self, open(filename, mode)) #keep the absolute path, otherwise derived classes which use this #may come a cropper when the current directory changes self.baseFilename = os.path.abspath(fi...
b89e7c9bc97d3f9332ecc94c88a055c0fe947625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b89e7c9bc97d3f9332ecc94c88a055c0fe947625/__init__.py
StreamHandler.__init__(self, open(filename, mode))
if codecs is None: encoding = None if encoding is None: stream = open(filename, mode) else: stream = codecs.open(filename, mode, encoding) StreamHandler.__init__(self, stream)
def __init__(self, filename, mode="a"): """ Open the specified file and use it as the stream for logging. """ StreamHandler.__init__(self, open(filename, mode)) #keep the absolute path, otherwise derived classes which use this #may come a cropper when the current directory changes self.baseFilename = os.path.abspath(fi...
b89e7c9bc97d3f9332ecc94c88a055c0fe947625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b89e7c9bc97d3f9332ecc94c88a055c0fe947625/__init__.py
(if filemode is unspecified, it defaults to "a").
(if filemode is unspecified, it defaults to 'a').
def basicConfig(**kwargs): """ Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHan...
b89e7c9bc97d3f9332ecc94c88a055c0fe947625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b89e7c9bc97d3f9332ecc94c88a055c0fe947625/__init__.py
mode = kwargs.get("filemode", "a")
mode = kwargs.get("filemode", 'a')
def basicConfig(**kwargs): """ Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHan...
b89e7c9bc97d3f9332ecc94c88a055c0fe947625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b89e7c9bc97d3f9332ecc94c88a055c0fe947625/__init__.py
if not str:
if not s:
def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # # Open the input file, if needed. # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): in_file = open(in_file) # # Read until a begin is encountered or we've exhausted the file # while 1: hdr = in_file.readline() if not hdr...
79c8671c7aee3dfaeb3aa9ce14abe08cc30ecc54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/79c8671c7aee3dfaeb3aa9ce14abe08cc30ecc54/uu.py
self.assertEqual(stderr, "pineapple")
self.assert_(stderr.startswith("pineapple"))
def test_communicate_stderr(self): p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("pineapple")'], stderr=subprocess.PIPE) (stdout, stderr) = p.communicate() self.assertEqual(stdout, None) self.assertEqual(stderr, "pineapple")
653a5adcca68d445b21dd2a640627f0f0185204a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/653a5adcca68d445b21dd2a640627f0f0185204a/test_subprocess.py
self._lookup()
assert self._toc is not None self._file.seek(0, 2) cur_len = self._file.tell() if cur_len != self._file_length: raise ExternalClashError('Size of mailbox file changed ' '(expected %i, found %i)' % (self._file_length, cur_len))
def flush(self): """Write any pending changes to disk.""" if not self._pending: return self._lookup() new_file = _create_temporary(self._path) try: new_toc = {} self._pre_mailbox_hook(new_file) for key in sorted(self._toc.keys()): start, stop = self._toc[key] self._file.seek(start) self._pre_message_hook(new_file) new_...
eca4c31267526dffe471bc78712dd884c4f04c34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eca4c31267526dffe471bc78712dd884c4f04c34/mailbox.py
self._file.seek(0, 2) self._file_length = self._file.tell()
def _generate_toc(self): """Generate key-to-(start, stop) table of contents.""" starts, stops = [], [] self._file.seek(0) next_pos = 0 label_lists = [] while True: line_pos = next_pos line = self._file.readline() next_pos = self._file.tell() if line == '\037\014' + os.linesep: if len(stops) < len(starts): stops.append(...
eca4c31267526dffe471bc78712dd884c4f04c34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eca4c31267526dffe471bc78712dd884c4f04c34/mailbox.py
print 'Deleted breakpoint %s ' % (i,)
print 'Deleted breakpoint', i
def do_clear(self, arg): """Three possibilities, tried in this order: clear -> clear all breaks, ask for confirmation clear file:lineno -> clear all breaks at file:lineno clear bpno bpno ... -> clear breakpoints by number""" if not arg: try: reply = raw_input('Clear all breaks? ') except EOFError: reply = 'no' reply = ...
6d2b346140ed0f3bc4c67fc33bf69a60c496e6a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6d2b346140ed0f3bc4c67fc33bf69a60c496e6a4/pdb.py
res = [] for c in s: if c in safe: res.append(c) else: res.append('%%%02x' % ord(c))
res = list(s) for i in range(len(res)): c = res[i] if c not in safe: res[i] = '%%%02x' % ord(c)
def quote(s, safe = '/'): safe = always_safe + safe res = [] for c in s: if c in safe: res.append(c) else: res.append('%%%02x' % ord(c)) return string.joinfields(res, '')
810a3396d130eda7d3e2be08966b40949757598e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/810a3396d130eda7d3e2be08966b40949757598e/urllib.py
s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+')
l = string.split(s, ' ') for i in range(len(l)): l[i] = quote(l[i], safe) return string.join(l, '+')
def quote_plus(s, safe = '/'): if ' ' in s: # replace ' ' with '+' s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe)
810a3396d130eda7d3e2be08966b40949757598e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/810a3396d130eda7d3e2be08966b40949757598e/urllib.py
* any RCS or CVS directories
* any RCS, CVS and .svn directories
def prune_file_list (self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS or CVS directories ""...
2f50e90818f17dd20760c9eb0854b603634f157d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2f50e90818f17dd20760c9eb0854b603634f157d/sdist.py
self.filelist.exclude_pattern(r'/(RCS|CVS)/.*', is_regex=1)
self.filelist.exclude_pattern(r'/(RCS|CVS|\.svn)/.*', is_regex=1)
def prune_file_list (self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS or CVS directories ""...
2f50e90818f17dd20760c9eb0854b603634f157d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2f50e90818f17dd20760c9eb0854b603634f157d/sdist.py
fp.write("%s = %s\n" % (key, value))
fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
def write(self, fp): """Write an .ini-format representation of the configuration state.""" if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, value)) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n") sectdict = self.__sectio...
00824ed733a5bd9cd94227fdfbf33b98f1ae900a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/00824ed733a5bd9cd94227fdfbf33b98f1ae900a/ConfigParser.py
fp.write("%s = %s\n" % (key, value))
fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
def write(self, fp): """Write an .ini-format representation of the configuration state.""" if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, value)) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n") sectdict = self.__sectio...
00824ed733a5bd9cd94227fdfbf33b98f1ae900a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/00824ed733a5bd9cd94227fdfbf33b98f1ae900a/ConfigParser.py
print '--Call--' self.interaction(frame, None)
if self.stop_here(frame): print '--Call--' self.interaction(frame, None)
def user_call(self, frame, argument_list): """This method is called when there is the remote possibility that we ever need to stop in this function.""" print '--Call--' self.interaction(frame, None)
01eb85cc0324a42160b676ee31a1a707bda579ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01eb85cc0324a42160b676ee31a1a707bda579ee/pdb.py
if not modname:
if not modname or '.' in modname:
def search_function(encoding): # Cache lookup entry = _cache.get(encoding, _unknown) if entry is not _unknown: return entry # Import the module: # # First try to find an alias for the normalized encoding # name and lookup the module using the aliased name, then try to # lookup the module using the standard import sch...
a92979a1db11ca42e78390fead218afbefb61587 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a92979a1db11ca42e78390fead218afbefb61587/__init__.py
f = open('/dev/null', 'wb')
if sys.platform[:3]=="win": f = open('nul', 'wb') else: f = open('/dev/null', 'wb')
def main(): VERBOSE = 0 opts, args = getopt.getopt(sys.argv[1:], 'vq') for k, v in opts: if k == '-v': VERBOSE = 1 visitor.ASTVisitor.VERBOSE = visitor.ASTVisitor.VERBOSE + 1 if k == '-q': f = open('/dev/null', 'wb') sys.stdout = f if not args: print "no files to compile" else: for filename in args: if VERBOSE: print f...
0a4f1ff64eeb50cdf0b81bd4cff5b2e1d159daa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a4f1ff64eeb50cdf0b81bd4cff5b2e1d159daa5/compile.py
print dom
confirm(isinstance(dom,Document))
def testParseFromFile(): from StringIO import StringIO dom=parse( StringIO( open( tstfile ).read() ) ) print dom
89c528b02d5fad6a211f3f9e6915677e1baa7806 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/89c528b02d5fad6a211f3f9e6915677e1baa7806/test_minidom.py
print Node.allnodes.items()[0:10]
if verbose: print Node.allnodes.items()[0:10] else: print len(Node.allnodes)
def testClonePIDeep(): pass
89c528b02d5fad6a211f3f9e6915677e1baa7806 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/89c528b02d5fad6a211f3f9e6915677e1baa7806/test_minidom.py
def message_from_string(s, _class=_Message): return _Parser(_class).parsestr(s)
def message_from_string(s, _class=_Message, strict=1): return _Parser(_class, strict=strict).parsestr(s)
def message_from_string(s, _class=_Message): return _Parser(_class).parsestr(s)
2d2fc229a05ae4bb65a8d0c1f7a588b73539d361 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d2fc229a05ae4bb65a8d0c1f7a588b73539d361/__init__.py
testtar = path("testtar" + os.extsep + "tar") tempdir = path("testtar" + os.extsep + "dir") tempname = path("testtar" + os.extsep + "tmp")
testtar = path("testtar.tar") tempdir = os.path.join(tempfile.gettempdir(), "testtar" + os.extsep + "dir") tempname = test_support.TESTFN
def path(path): return test_support.findfile(path)
455ea53d0e7a21af210eef71644700b3979badce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/455ea53d0e7a21af210eef71644700b3979badce/test_tarfile.py
if os.path.exists(tempdir): shutil.rmtree(tempdir) if os.path.exists(tempname): os.remove(tempname)
if os.path.exists(dirname()): shutil.rmtree(dirname()) if os.path.exists(tmpname()): os.remove(tmpname())
def test_main(): if gzip: # create testtar.tar.gz gzip.open(tarname("gz"), "wb").write(file(tarname(), "rb").read()) if bz2: # create testtar.tar.bz2 bz2.BZ2File(tarname("bz2"), "wb").write(file(tarname(), "rb").read()) tests = [ ReadTest, ReadStreamTest, WriteTest, WriteStreamTest ] if gzip: tests.extend([ ReadTestG...
455ea53d0e7a21af210eef71644700b3979badce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/455ea53d0e7a21af210eef71644700b3979badce/test_tarfile.py
if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if verbose: print 'overflow (this is fine)' else: if output and result != output: if verbose: print 'n...
if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if not overflowok: raise if verbose: print 'overflow (this is fine)' else: if output and result != out...
def testformat(formatstr, args, output=None): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if verbose: print 'overflow (this is fine)' else: if out...
38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a/test_format.py
testformat(formatstr, *args) testformat(unicode(formatstr), *args)
testformat(formatstr, *args) testformat(unicode(formatstr), *args)
def testboth(formatstr, *args): testformat(formatstr, *args) testformat(unicode(formatstr), *args)
38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a/test_format.py
else: boundary = ""
if not valid_boundary(boundary): raise ValueError, ('Invalid boundary in multipart form: %s' % `ib`)
def parse_multipart(fp, pdict): """Parse multipart input. Arguments: fp : input file pdict: dictionary containing other parameters of conten-type header Returns a dictionary just like parse_qs(): keys are the field names, each value is a list of values for that field. This is easy to use but not much good if you a...
2e441f7836134c475e35eea4a005f19699703a9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e441f7836134c475e35eea4a005f19699703a9b/cgi.py
part = klass(self.fp, {}, self.innerboundary,
part = klass(self.fp, {}, ib,
def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" self.list = [] klass = self.FieldStorageClass or self.__class__ part = klass(self.fp, {}, self.innerboundary, environ, keep_blank_values, strict_parsing) # Throw first part away while not part.done: h...
2e441f7836134c475e35eea4a005f19699703a9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e441f7836134c475e35eea4a005f19699703a9b/cgi.py
part = klass(self.fp, headers, self.innerboundary,
part = klass(self.fp, headers, ib,
def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" self.list = [] klass = self.FieldStorageClass or self.__class__ part = klass(self.fp, {}, self.innerboundary, environ, keep_blank_values, strict_parsing) # Throw first part away while not part.done: h...
2e441f7836134c475e35eea4a005f19699703a9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e441f7836134c475e35eea4a005f19699703a9b/cgi.py
if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]:
if not sys.argv[1:]: if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else:
def main(): if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: print 'Usage: zappyc dir ...' sys.exit(1) for dir in sys.argv[1:]: zappyc(dir)
f1148f0bb3b227baac1708221cbf818427365c09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1148f0bb3b227baac1708221cbf818427365c09/zappycfiles.py
for dir in sys.argv[1:]: zappyc(dir)
for dir in sys.argv[1:]: zappyc(dir)
def main(): if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: print 'Usage: zappyc dir ...' sys.exit(1) for dir in sys.argv[1:]: zappyc(dir)
f1148f0bb3b227baac1708221cbf818427365c09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1148f0bb3b227baac1708221cbf818427365c09/zappycfiles.py
if n > self.maxlist: s = s + ', ...'
if n > self.maxdict: s = s + ', ...'
def repr_dictionary(self, x, level): n = len(x) if n == 0: return '{}' if level <= 0: return '{...}' s = '' keys = x.keys() keys.sort() for i in range(min(n, self.maxdict)): if s: s = s + ', ' key = keys[i] s = s + self.repr1(key, level-1) s = s + ': ' + self.repr1(x[key], level-1) if n > self.maxlist: s = s + ', ...' ...
ff3a278d3be871942e8fe14c01a70d03cdac752d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ff3a278d3be871942e8fe14c01a70d03cdac752d/repr.py
sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) sys.stderr = sys.__stderr__
save_stderr = sys.stderr try: sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) finally: sys.stderr = save_stderr
def assertParseFail(self, cmdline_args, expected_output): """Assert the parser fails with the expected message.""" sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) sys.stderr = sys.__stderr__
579f7355fe2c90b3f7001135c0ec0766dad6d244 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/579f7355fe2c90b3f7001135c0ec0766dad6d244/test_optparse.py
sys.stdout = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stdout) sys.stdout = sys.__stdout__
save_stdout = sys.stdout try: sys.stdout = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stdout) finally: sys.stdout = save_stdout
def assertStdoutEquals(self, cmdline_args, expected_output): """Assert the parser prints the expected output on stdout.""" sys.stdout = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stdout) sys.stdout = sys.__stdout__
579f7355fe2c90b3f7001135c0ec0766dad6d244 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/579f7355fe2c90b3f7001135c0ec0766dad6d244/test_optparse.py
sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version show program's version numbe...
save_argv = sys.argv[:] try: sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version ...
def test_default_progname(self): # Make sure that program name taken from sys.argv[0] by default. sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.a...
579f7355fe2c90b3f7001135c0ec0766dad6d244 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/579f7355fe2c90b3f7001135c0ec0766dad6d244/test_optparse.py
onoff = 0 else: onoff = 255 if self.barx: self.barx.HiliteControl(onoff) if self.bary: self.bary.HiliteControl(onoff)
if self.barx and self.barx_enabled: self.barx.HiliteControl(0) if self.bary and self.bary_enabled: self.bary.HiliteControl(0) else: if self.barx: self.barx.HiliteControl(255) if self.bary: self.bary.HiliteControl(255)
def do_activate(self, onoff, event): if onoff: onoff = 0 else: onoff = 255 if self.barx: self.barx.HiliteControl(onoff) if self.bary: self.bary.HiliteControl(onoff)
7bfc875270587bd6819702ab51d0a6a41aaec0cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7bfc875270587bd6819702ab51d0a6a41aaec0cb/FrameWork.py
self.barx.SetControlValue(vx)
if vx == None: self.barx.HiliteControl(255) self.barx_enabled = 0 else: if not self.barx_enabled: self.barx_enabled = 1 if self.activated: self.barx.HiliteControl(0) self.barx.SetControlValue(vx)
def updatescrollbars(self): SetPort(self.wid) vx, vy = self.getscrollbarvalues() if self.barx: self.barx.SetControlValue(vx) if self.bary: self.bary.SetControlValue(vy)
7bfc875270587bd6819702ab51d0a6a41aaec0cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7bfc875270587bd6819702ab51d0a6a41aaec0cb/FrameWork.py
self.bary.SetControlValue(vy)
if vy == None: self.bary.HiliteControl(255) self.bary_enabled = 0 else: if not self.bary_enabled: self.bary_enabled = 1 if self.activated: self.bary.HiliteControl(0) self.bary.SetControlValue(vy) def scalebarvalue(self, absmin, absmax, curmin, curmax): if curmin <= absmin and curmax >= absmax: return None if curmin ...
def updatescrollbars(self): SetPort(self.wid) vx, vy = self.getscrollbarvalues() if self.barx: self.barx.SetControlValue(vx) if self.bary: self.bary.SetControlValue(vy)
7bfc875270587bd6819702ab51d0a6a41aaec0cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7bfc875270587bd6819702ab51d0a6a41aaec0cb/FrameWork.py
incomment = ''
instr = '' brackets = 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."""
e85c93f52109711f415e860ba41609ae22984d92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e85c93f52109711f415e860ba41609ae22984d92/pdb.py
if incomment: if len(line) < 3: continue if (line[-3:] == incomment): incomment = '' continue
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."""
e85c93f52109711f415e860ba41609ae22984d92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e85c93f52109711f415e860ba41609ae22984d92/pdb.py
if len(line) >= 3: if (line[:3] == '"""' or line[:3] == "'''"): if line[-3:] == line[:3]: continue incomment = line[:3] continue if line[0] != '
if brackets <= 0 and line[0] not in (' break
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."""
e85c93f52109711f415e860ba41609ae22984d92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e85c93f52109711f415e860ba41609ae22984d92/pdb.py
dict = readmodule_ex(module, path)
dict = _readmodule(module, path)
def readmodule(module, path=[]): '''Backwards compatible interface. Call readmodule_ex() and then only keep Class objects from the resulting dictionary.''' dict = readmodule_ex(module, path) res = {} for key, value in dict.items(): if isinstance(value, Class): res[key] = value return res
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
def readmodule_ex(module, path=[], inpackage=None):
def readmodule_ex(module, path=[]):
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
return _readmodule(module, path) def _readmodule(module, path, inpackage=None): '''Do the hard work for readmodule[_ex].'''
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
parent = readmodule_ex(package, path, inpackage)
parent = _readmodule(package, path, inpackage)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
return readmodule_ex(submodule, parent['__path__'], package)
return _readmodule(submodule, parent['__path__'], package)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
classstack = []
stack = []
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
if token == 'def':
if tokentype == DEDENT:
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno)
if stack: cur_class = stack[-1][0] if isinstance(cur_class, Class): cur_class._addmethod(meth_name, lineno)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1]
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
dict[class_name] = cur_class classstack.append((cur_class, thisindent))
if not stack: dict[class_name] = cur_class stack.append((cur_class, thisindent))
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
readmodule_ex(mod, path)
_readmodule(mod, path)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
readmodule_ex(mod, path, inpackage)
_readmodule(mod, path, inpackage)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
readmodule_ex(mod)
_readmodule(mod, [])
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
d = readmodule_ex(mod, path, inpackage)
d = _readmodule(mod, path, inpackage)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
if n[0] != '_' and not n in dict:
if n[0] != '_':
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in ...
0a6f954766cd091b117a1c5b16bdb0d2a837c2a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a6f954766cd091b117a1c5b16bdb0d2a837c2a8/pyclbr.py
input_charset = input_charset.lower()
input_charset = unicode(input_charset, 'ascii').lower()
def __init__(self, input_charset=DEFAULT_CHARSET): # RFC 2046, $4.1.2 says charsets are not case sensitive input_charset = input_charset.lower() # Set the input charset after filtering through the aliases self.input_charset = ALIASES.get(input_charset, input_charset) # We can try to guess which encoding and conversion ...
ea7c7af10b72ec4f3c5ad2bb6beb1d3667ff978e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea7c7af10b72ec4f3c5ad2bb6beb1d3667ff978e/Charset.py
return _float(s)
return _float(s)
def atof(s): """atof(s) -> float Return the floating point number represented by the string s. """ if type(s) == _StringType: return _float(s) else: raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
def atof(s): """atof(s) -> float Return the floating point number represented by the string s. """ if type(s) == _StringType: return _float(s) else: raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
s = args[0]
s = args[0]
def atoi(*args): """atoi(s [,base]) -> int Return the integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
raise TypeError('function requires at least 1 argument: %d given' % len(args))
raise TypeError('function requires at least 1 argument: %d given' % len(args))
def atoi(*args): """atoi(s [,base]) -> int Return the integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
return _apply(_int, args)
return _apply(_int, args)
def atoi(*args): """atoi(s [,base]) -> int Return the integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
def atoi(*args): """atoi(s [,base]) -> int Return the integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
s = args[0]
s = args[0]
def atol(*args): """atol(s [,base]) -> long Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. I...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
raise TypeError('function requires at least 1 argument: %d given' % len(args))
raise TypeError('function requires at least 1 argument: %d given' % len(args))
def atol(*args): """atol(s [,base]) -> long Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. I...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
return _apply(_long, args)
return _apply(_long, args)
def atol(*args): """atol(s [,base]) -> long Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. I...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
raise TypeError('argument 1: expected string, %s found' % type(s).__name__)
def atol(*args): """atol(s [,base]) -> long Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. I...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
half = half+1
half = half+1
def center(s, width): """center(s, width) -> string Return a center version of s, in a field of the specified width. padded with spaces as needed. The string is never truncated. """ n = width - len(s) if n <= 0: return s half = n/2 if n%2 and width%2: # This ensures that center(center(s, i), j) = center(s, j) half =...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
sign, s = s[0], s[1:]
sign, s = s[0], s[1:]
def zfill(x, width): """zfill(x, width) -> string Pad a numeric string x with zeros on the left, to fill a field of the specified width. The string x is never truncated. """ if type(x) == type(''): s = x else: s = `x` n = len(s) if n >= width: return s sign = '' if s[0] in ('-', '+'): sign, s = s[0], s[1:] return si...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
if c == '\t': c = ' '*(tabsize - len(line) % tabsize) line = line + c if c == '\n': res = res + line line = ''
if c == '\t': c = ' '*(tabsize - len(line) % tabsize) line = line + c if c == '\n': res = res + line line = ''
def expandtabs(s, tabsize=8): """expandtabs(s [,tabsize]) -> string Return a copy of the string s with all tab characters replaced by the appropriate number of spaces, depending on the current column, and the tabsize (default 8). """ res = line = '' for c in s: if c == '\t': c = ' '*(tabsize - len(line) % tabsize) li...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
raise ValueError, "maketrans arguments must have same length"
raise ValueError, "maketrans arguments must have same length"
def maketrans(fromstr, tostr): """maketrans(frm, to) -> string Return a translation table (a string of 256 bytes long) suitable for use in string.translate. The strings frm and to must be of the same length. """ if len(fromstr) != len(tostr): raise ValueError, "maketrans arguments must have same length" global _idma...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
_idmapL = map(None, _idmap)
_idmapL = map(None, _idmap)
def maketrans(fromstr, tostr): """maketrans(frm, to) -> string Return a translation table (a string of 256 bytes long) suitable for use in string.translate. The strings frm and to must be of the same length. """ if len(fromstr) != len(tostr): raise ValueError, "maketrans arguments must have same length" global _idma...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
L[fromstr[i]] = tostr[i]
L[fromstr[i]] = tostr[i]
def maketrans(fromstr, tostr): """maketrans(frm, to) -> string Return a translation table (a string of 256 bytes long) suitable for use in string.translate. The strings frm and to must be of the same length. """ if len(fromstr) != len(tostr): raise ValueError, "maketrans arguments must have same length" global _idma...
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py
pass
pass
def replace(s, old, new, maxsplit=0): """replace (str, old, new[, maxsplit]) -> string Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced. """ return s.replace(old, new, maxsplit)
857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py