bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def bibtex_needed (self): """ Return true if BibTeX must be run. """ if self.run_needed: return 1 self.msg(2, _("checking if BibTeX must be run..."))
def bibtex_needed (self): """ Return true if BibTeX must be run. """ if self.run_needed: return 1 self.msg(2, _("checking if BibTeX must be run..."))
6,300
def update_file (self, line, stack): """ Parse the given line of log file for file openings and closings and update the list `stack'. Newly opened files are at the end, therefore stack[0] is the main source while stack[-1] is the current one. """ m = re_file.search(line) if not m: return while m: file = m.group("file")...
def update_file (self, line, stack): """ Parse the given line of log file for file openings and closings and update the list `stack'. Newly opened files are at the end, therefore stack[0] is the main source while stack[-1] is the current one. """ m = re_file.search(line) if not m: return while m: if line[m.start()] == ...
6,301
def load_module (self, name, package=None): """ Attempt to register a module with the specified name. If an appropriate module is found, load it and store it in the object's dictionary. Return 0 if no module was found, 1 if a module was found and loaded, and 2 if the module was found but already loaded. """ if self.mod...
def load_module (self, name, package=None): """ Attempt to register a module with the specified name. If an appropriate module is found, load it and store it in the object's dictionary. Return 0 if no module was found, 1 if a module was found and loaded, and 2 if the module was found but already loaded. """ if self.mod...
6,302
def __init__ (self, level=1, write=None): """ Initialize the object with the specified verbosity level and an optional writing function. If no such function is specified, no message will be output until the 'write' field is changed. """ self.level = level self.write = write self.short = 0 self.path = "" self.cwd = join...
def __init__ (self, level=1, write=None): """ Initialize the object with the specified verbosity level and an optional writing function. If no such function is specified, no message will be output until the 'write' field is changed. """ self.level = level self.write = write self.short = 0 self.path = "" self.cwd = join...
6,303
def read_ini (self, filename): """ Read a set of rules from a file. See the texinfo documentation for the expected format of this file. """ from ConfigParser import ConfigParser cp = ConfigParser() cp.read(filename) for name in cp.sections(): rule = dict(cp.items(name)) rule["cost"] = cost = cp.getint(name, "cost") exp...
def read_ini (self, filename): """ Read a set of rules from a file. See the texinfo documentation for the expected format of this file. """ from ConfigParser import ConfigParser cp = ConfigParser() cp.read(filename) for name in cp.sections(): rule = {} for key in cp.options(name): rule[key] = cp.get(name, key) rule["co...
6,304
def __init__ (self, message): """ Initialize the environment. This prepares the processing steps for the given file (all steps are initialized empty) and sets the regular expressions and the hook dictionary. """ self.msg = message self.msg(2, _("initializing Rubber..."))
def __init__ (self, message): """ Initialize the environment. This prepares the processing steps for the given file (all steps are initialized empty) and sets the regular expressions and the hook dictionary. """ self.msg = message self.msg(2, _("initializing Rubber..."))
6,305
def restart (self): """ Reinitialize the environment, in order to process a new document. This resets the process and the hook dictionary and unloads modules. """ self.msg(1, _("initializing...")) self.modules.clear() self.initialize()
def restart (self): """ Reinitialize the environment, in order to process a new document. This resets the process and the hook dictionary and unloads modules. """ self.msg(1, _("reinitializing...")) self.modules.clear() self.initialize()
6,306
def set_style (self, style): """ Define the bibliography style used. This method is called when \\bibliographystyle is found. If the style file is found in the current directory, it is considered a dependency. """ old_bst = self.style + ".bst" if exists(old_bst) and self.env.depends.has_key(old_bst): del self.env.depen...
def set_style (self, style): """ Define the bibliography style used. This method is called when \\bibliographystyle is found. If the style file is found in the current directory, it is considered a dependency. """ old_bst = self.style + ".bst" if exists(old_bst) and self.env.depends.has_key(old_bst): del self.env.depen...
6,307
def clean (self): """ Remove all generated files related to the index. """ for file in self.source, self.target: if exists(file): self.env.msg(1, _("removing %s") % file) os.unlink(file)
def clean (self): """ Remove all generated files related to the index. """ for file in self.source, self.target, self.pbase + ".ilg": if exists(file): self.env.msg(1, _("removing %s") % file) os.unlink(file)
6,308
def __init__ (self, env, dict): self.env = env env.add_hook("verbatimtabinput", self.input) env.add_hook("listinginput", self.input)
def __init__ (self, env, dict): self.env = env env.add_hook("verbatimtabinput", self.input) env.add_hook("listinginput", self.input)
6,309
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": return 1 return 0
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": return string.find(line, "warning:") != -1 return 0
6,310
def command (self, cmd, arg): """ Execute the rubber command 'cmd' with argument 'arg'. This is called when a command is found in the source file or in a configuration file. A command name of the form 'foo.bar' is considered to be a command 'bar' for module 'foo'. """ if cmd == "depend": file = self.conf.find_input(arg...
def command (self, cmd, arg): """ Execute the rubber command 'cmd' with argument 'arg'. This is called when a command is found in the source file or in a configuration file. A command name of the form 'foo.bar' is considered to be a command 'bar' for module 'foo'. """ if cmd == "clean": self.removed_files.append(arg) ...
6,311
def h_tableofcontents (self, dict): self.watch_file(self.base + ".toc")
def h_tableofcontents (self, dict): self.watch_file(self.base + ".toc")
6,312
def h_listoffigures (self, dict): self.watch_file(self.base + ".lof")
def h_listoffigures (self, dict): self.watch_file(self.base + ".lof")
6,313
def h_listoftables (self, dict): self.watch_file(self.base + ".lot")
def h_listoftables (self, dict): self.watch_file(self.base + ".lot")
6,314
def parse (self, errors=0, boxes=0, refs=0, warnings=0): """ Parse the log file for relevant information. The named arguments are booleans that indicate which information should be extracted: - errors: all errors - boxes: bad boxes - refs: warnings about references - warnings: all other warnings The function returns a ...
def parse (self, errors=0, boxes=0, refs=0, warnings=0): """ Parse the log file for relevant information. The named arguments are booleans that indicate which information should be extracted: - errors: all errors - boxes: bad boxes - refs: warnings about references - warnings: all other warnings The function returns a ...
6,315
def __init__ (self, env, dict):
def __init__ (self, env, dict):
6,316
def run (self): if not self.expand_needed(): return 0 self.msg(0, _("writing %s...") % (self.out)) self.out_stream = open(self.out, "w") try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1
def run (self): self.msg(0, _("writing %s...") % (self.out)) self.out_stream = open(self.out, "w") try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1
6,317
def run (self): if not self.expand_needed(): return 0 self.msg(0, _("writing %s...") % (self.out)) self.out_stream = open(self.out, "w") try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1
def run (self): if not self.expand_needed(): return 0 self.msg(0, _("writing %s...") % (self.out)) self.out_stream = open(self.out, "w") try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1
6,318
def expand_path (self, path): # self.out_stream.write("%%--- beginning of file %s\n" % path) file = open(path)
def expand_path (self, path): # self.out_stream.write("%%--- beginning of file %s\n" % path) file = open(path)
6,319
def x_usepackage (self, dict): if not dict["arg"]: return remaining = []
def x_usepackage (self, dict): if not dict["arg"]: return remaining = []
6,320
def main (self, cmdline): """ Run Rubber for the specified command line. This processes each specified source in order (for making or cleaning). If an error happens while making one of the documents, the whole process stops. The method returns the program's exit code. """ self.prologue = [] self.epilogue = [] self.clea...
def main (self, cmdline): """ Run Rubber for the specified command line. This processes each specified source in order (for making or cleaning). If an error happens while making one of the documents, the whole process stops. The method returns the program's exit code. """ self.prologue = [] self.epilogue = [] self.clea...
6,321
def compile_needed (self): """ Returns true if a first compilation is needed. This method supposes that no compilatin was done (by the script) yet. """ if self.must_compile: return 1 self.msg(3, _("checking if compiling is necessary...")) if not exists(self.src_base + self.out_ext): self.msg(3, _("the output file doesn...
def compile_needed (self): """ Returns true if a first compilation is needed. This method supposes that no compilation was done (by the script) yet. """ if self.must_compile: return 1 self.msg(3, _("checking if compiling is necessary...")) if not exists(self.src_base + self.out_ext): self.msg(3, _("the output file does...
6,322
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors...
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors...
6,323
# default suffixes for each device driver (taken from the .def files)
# default suffixes for each device driver (taken from the .def files)
6,324
def compile_needed (self): """ Returns true if a first compilation is needed. This method supposes that no compilatin was done (by the script) yet. """ if self.must_compile: return 1 self.msg(3, _("checking if compiling is necessary...")) if not exists(self.src_base + self.out_ext): self.msg(3, _("the output file doesn...
def compile_needed (self): """ Returns true if a first compilation is needed. This method supposes that no compilation was done (by the script) yet. """ if self.must_compile: return 1 self.msg(3, _("checking if compiling is necessary...")) if not exists(self.src_base + self.out_ext): self.msg(3, _("the output file does...
6,325
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors...
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors...
6,326
def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = {} for (key, val) in dict.items(): saved[key] = self.vars[key] self.vars[key] = val self.vars_stack.append(saved)
def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = self.vars.copy() for (key, val) in dict.items(): saved[key] = self.vars[key] self.vars[key] = val self.vars_stack.append(saved)
6,327
def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = {} for (key, val) in dict.items(): saved[key] = self.vars[key] self.vars[key] = val self.vars_stack.append(saved)
def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = {} for (key, val) in dict.items(): self.vars[key] = val self.vars_stack.append(saved)
6,328
def pop_vars (self): """ Restore the last set of variables saved using "push_vars". """ self.vars.update(self.vars_stack[-1]) del self.vars_stack[-1]
def pop_vars (self): """ Restore the last set of variables saved using "push_vars". """ self.vars = self.vars_stack[-1] del self.vars_stack[-1]
6,329
def update_seq (self): """ Update the regular expression used to match macro calls using the keys in the `hook' dictionary. We don't match all control sequences for obvious efficiency reasons. """ self.seq = re.compile("\
def update_seq (self): """ Update the regular expression used to match macro calls using the keys in the `hook' dictionary. We don't match all control sequences for obvious efficiency reasons. """ self.seq = re.compile("\
6,330
def execute (self, prog, env={}, pwd=None, out=None): """ Silently execute an external program. The `prog' argument is the list of arguments for the program, `prog[0]' is the program name. The `env' argument is a dictionary with definitions that should be added to the environment when running the program. The standard ...
def execute (self, prog, env={}, pwd=None, out=None): """ Silently execute an external program. The `prog' argument is the list of arguments for the program, `prog[0]' is the program name. The `env' argument is a dictionary with definitions that should be added to the environment when running the program. The standard ...
6,331
def execute (self, prog, env={}, pwd=None, out=None): """ Silently execute an external program. The `prog' argument is the list of arguments for the program, `prog[0]' is the program name. The `env' argument is a dictionary with definitions that should be added to the environment when running the program. The standard ...
def execute (self, prog, env={}, pwd=None, out=None): """ Silently execute an external program. The `prog' argument is the list of arguments for the program, `prog[0]' is the program name. The `env' argument is a dictionary with definitions that should be added to the environment when running the program. The standard ...
6,332
def h_include (self, dict): """ Called when an \\include macro is found. This includes files into the source in a way very similar to \\input, except that LaTeX also creates .aux files for them, so we have to notice this. """ if not dict["arg"]: return if self.include_only and not self.include_only.has_key(dict["arg"])...
def h_include (self, dict): """ Called when an \\include macro is found. This includes files into the source in a way very similar to \\input, except that LaTeX also creates .aux files for them, so we have to notice this. """ if not dict["arg"]: return if self.include_only and not self.include_only.has_key(dict["arg"])...
6,333
def canonicalize(args): """ BootAuth canonicalization method. Parameter values are collected, sorted, converted to strings, then hashed with the node key. """
def canonicalize(args): """ BootAuth canonicalization method. Parameter values are collected, sorted, converted to strings, then hashed with the node key. """
6,334
def canonicalize(args): """ BootAuth canonicalization method. Parameter values are collected, sorted, converted to strings, then hashed with the node key. """
def canonicalize(args): """ BootAuth canonicalization method. Parameter values are collected, sorted, converted to strings, then hashed with the node key. """
6,335
def deliver_record(self, rec): """A record is simply a dictionary with 'name' and 'timestamp' keys. We keep some persistent private data in the records under keys that start with '_'; thus record updates should not displace such keys.""" name = rec['name'] old_rec = self.get(name) if old_rec != None and rec['timestamp...
def deliver_record(self, rec): """A record is simply a dictionary with 'name' and 'timestamp' keys. We keep some persistent private data in the records under keys that start with '_'; thus record updates should not displace such keys.""" name = rec['name'] old_rec = self.get(name) if old_rec == None: self[name] = rec ...
6,336
def deliver_record(self, rec): """A record is simply a dictionary with 'name' and 'timestamp' keys. We keep some persistent private data in the records under keys that start with '_'; thus record updates should not displace such keys.""" name = rec['name'] old_rec = self.get(name) if old_rec != None and rec['timestamp...
def deliver_record(self, rec): """A record is simply a dictionary with 'name' and 'timestamp' keys. We keep some persistent private data in the records under keys that start with '_'; thus record updates should not displace such keys.""" name = rec['name'] old_rec = self.get(name) if old_rec != None and rec['timestamp...
6,337
def update_conf_file(self, cf_rec): if not cf_rec['enabled']: return dest = cf_rec['dest'] logger.log('conf_files: considering file %s' % dest) err_cmd = cf_rec['error_cmd'] mode = string.atoi(cf_rec['file_permissions'], base=8) uid = pwd.getpwnam(cf_rec['file_owner'])[2] gid = grp.getgrnam(cf_rec['file_group'])[2] url...
def update_conf_file(self, cf_rec): if not cf_rec['enabled']: return dest = cf_rec['dest'] logger.log('conf_files: considering file %s' % dest) err_cmd = cf_rec['error_cmd'] mode = string.atoi(cf_rec['file_permissions'], base=8) uid = pwd.getpwnam(cf_rec['file_owner'])[2] gid = grp.getgrnam(cf_rec['file_group'])[2] url...
6,338
def processInputs(self): 'See IPublisherRequest'
def processInputs(self): 'See IPublisherRequest'
6,339
def processInputs(self): 'See IPublisherRequest'
def processInputs(self): 'See IPublisherRequest'
6,340
def setBody(self, body): """Sets the body of the response
def setBody(self, body): """Sets the body of the response
6,341
def handleException(self, exc_info): """Handle Errors during publsihing and wrap it in XML-RPC XML""" t, value = exc_info[:2]
def handleException(self, exc_info): """Handle Errors during publsihing and wrap it in XML-RPC XML""" t, value = exc_info[:2]
6,342
def _encode(self, text): if self._charset is not None and isinstance(text, unicode): return text.encode(self._charset) return text
def _encode(self, text): if isinstance(text, unicode): return text.encode(self._charset or 'UTF-8') return text
6,343
def processInputs(self): 'See IPublisherRequest'
defprocessInputs(self):'SeeIPublisherRequest'
6,344
def processInputs(self): 'See IPublisherRequest'
def processInputs(self): 'See IPublisherRequest'
6,345
def __str__(self): return 'Location: %s' % self.location
def __str__(self): return 'Location: %s' % self.location
6,346
def retry(): """Return a retry request
def retry(): """Return a retry request
6,347
def processInputs(): """Do any input processing that needs to bve done before traversing
def processInputs(): """Do any input processing that needs to bve done before traversing
6,348
def __getitem__(key): """Return request data
def __getitem__(key): """Return request data
6,349
def readline(self, size=None): data = self.stream.readline(size) self.cacheStream.write(data) return data
def readline(self, size=None): data = self.stream.readline() self.cacheStream.write(data) return data
6,350
def testHaveCustomTestsForIApplicationRequest(self): # Make sure that tests are defined for things we can't test here self.test_IApplicationRequest_bodyStream
def testHaveCustomTestsForIApplicationRequest(self): # Make sure that tests are defined for things we can't test here self.test_IApplicationRequest_bodyStream
6,351
def _authUserPW(self): 'See IHTTPCredentials' global base64 auth=self._auth if auth: if auth.lower().startswith('basic '): if base64 is None: import base64 name, password = base64.decodestring( auth.split()[-1]).split(':') return name, password
def _authUserPW(self): 'See IHTTPCredentials' global base64 if self._auth: if self._auth.lower().startswith('basic '): if base64 is None: import base64 name, password = base64.decodestring( auth.split()[-1]).split(':') return name, password
6,352
def _authUserPW(self): 'See IHTTPCredentials' global base64 auth=self._auth if auth: if auth.lower().startswith('basic '): if base64 is None: import base64 name, password = base64.decodestring( auth.split()[-1]).split(':') return name, password
def _authUserPW(self): 'See IHTTPCredentials' global base64 auth=self._auth if auth: if auth.lower().startswith('basic '): if base64 is None: import base64 name, password = base64.decodestring( self._auth.split()[-1]).split(':') return name, password
6,353
def _createResponse(self): """Create a specific XML-RPC response object.""" return FTPResponse()
def _createResponse(self): """Create a specific FTP response object.""" return FTPResponse()
6,354
def _updateContentLength(self): blen = str(len(self._body)) if blen.endswith('L'): blen = blen[:-1] self.setHeader('content-length', blen)
def _updateContentLength(self, data=None): if data is None: blen = str(len(self._body)) else: blen = str(len(data)) if blen.endswith('L'): blen = blen[:-1] self.setHeader('content-length', blen)
6,355
def write(self, string): """See IApplicationResponse
def write(self, string): """See IApplicationResponse
6,356
def output(self, data): """Output the data to the world. There are a couple of steps we have to do:
def if self.getHeader('content-type', '').startswith('text'): data = self._encode(data) self._updateContentLength(data) output(self, if self.getHeader('content-type', '').startswith('text'): data = self._encode(data) self._updateContentLength(data) data): if self.getHeader('content-type', '').startswith('text'): da...
6,357
def output(self, data): """Output the data to the world. There are a couple of steps we have to do:
def output(self, data): """Output the data to the world. There are a couple of steps we have to do:
6,358
def setUp(self): self.pres = Presentation()
def setUp(self): self.pres = Presentation()
6,359
def __init__(self, aFieldStorage):
def __init__(self, aFieldStorage):
6,360
def getDefaultTraversal(request, ob): """Get the default published object for the request
def getDefaultTraversal(request, ob): """Get the default published object for the request
6,361
def processInputs(self): 'See IPublisherRequest'
def processInputs(self): 'See IPublisherRequest'
6,362
def testRequestLocale(self): eq = self.assertEqual unless = self.failUnless for httplang in ('it', 'it-ch', 'it-CH', 'IT', 'IT-CH', 'IT-ch'): req = self._createRequest({'HTTP_ACCEPT_LANGUAGE': httplang}) locale = req.getLocale() unless(ILocale.isImplementedBy(locale)) parts = httplang.split('-') lang = parts.pop(0).low...
def testRequestLocale(self): eq = self.assertEqual unless = self.failUnless for httplang in ('it', 'it-ch', 'it-CH', 'IT', 'IT-CH', 'IT-ch'): req = self._createRequest({'HTTP_ACCEPT_LANGUAGE': httplang}) locale = req.getLocale() unless(ILocale.isImplementedBy(locale)) parts = httplang.split('-') lang = parts.pop(0).low...
6,363
def testRequestLocale(self): eq = self.assertEqual unless = self.failUnless for httplang in ('it', 'it-ch', 'it-CH', 'IT', 'IT-CH', 'IT-ch'): req = self._createRequest({'HTTP_ACCEPT_LANGUAGE': httplang}) locale = req.getLocale() unless(ILocale.isImplementedBy(locale)) parts = httplang.split('-') lang = parts.pop(0).low...
def testRequestLocale(self): eq = self.assertEqual unless = self.failUnless for httplang in ('it', 'it-ch', 'it-CH', 'IT', 'IT-CH', 'IT-ch'): req = self._createRequest({'HTTP_ACCEPT_LANGUAGE': httplang}) locale = req.getLocale() unless(ILocale.isImplementedBy(locale)) parts = httplang.split('-') lang = parts.pop(0).low...
6,364
def __setupPath(self): # The recommendation states that: # # Unless there is some compelling reason for a # particular scheme to do otherwise, translating character sequences # into UTF-8 (RFC 2279) [3] and then subsequently using the %HH # encoding for unsafe octets is recommended. # # See: http://www.ietf.org/rfc/rfc...
def __setupPath(self): # The recommendation states that: # # Unless there is some compelling reason for a # particular scheme to do otherwise, translating character sequences # into UTF-8 (RFC 2279) [3] and then subsequently using the %HH # encoding for unsafe octets is recommended. # # See: http://www.ietf.org/rfc/rfc...
6,365
def mapply(object, positional=(), request={}): __traceback_info__ = object # we need deep access for intrspection. Waaa. unwrapped = removeAllProxies(object) unwrapped, wrapperCount = unwrapMethod(unwrapped) code = unwrapped.func_code defaults = unwrapped.func_defaults names = code.co_varnames[wrapperCount:code.co_a...
def mapply(object, positional=(), request={}): __traceback_info__ = object# we need deep access for intrspection. Waaa. unwrapped = removeAllProxies(object)unwrapped, wrapperCount = unwrapMethod(unwrapped)code = unwrapped.func_code defaults = unwrapped.func_defaults names = code.co_varnames[wrapperCount:code.co_argcoun...
6,366
def IPublisher(Interface): def publish(request): """Publish a request The request must be an IPublisherRequest. """
class IPublisher(Interface): def publish(request): """Publish a request The request must be an IPublisherRequest. """
6,367
def _getResultFromResponse(self, body, charset=None, headers=None): response, stream = self._createResponse() if charset is not None: response.setCharset() if headers is not None: for hdr, val in headers.iteritems(): response.setHeader(hdr, val) response.setBody(body) response.outputBody() return self._parseResult(stre...
def _getResultFromResponse(self, body, charset=None, headers=None): response, stream = self._createResponse() if charset is not None: response.setCharset(charset) if headers is not None: for hdr, val in headers.iteritems(): response.setHeader(hdr, val) response.setBody(body) response.outputBody() return self._parseResu...
6,368
def processInputs(): """Do any input processing that needs to bve done before traversing
def processInputs(): """Do any input processing that needs to bve done before traversing
6,369
def traverseName(self, request, ob, name, check_auth=1): if name.startswith('_'): raise Unauthorized("Name %s begins with an underscore" % `name`) if hasattr(ob, name): subob = getattr(ob, name) else: try: subob = ob[name] except (KeyError, IndexError, TypeError, AttributeError): raise NotFound(ob, name, request) if se...
def traverseName(self, request, ob, name, check_auth=1): if name.startswith('_'): raise Unauthorized, name if hasattr(ob, name): subob = getattr(ob, name) else: try: subob = ob[name] except (KeyError, IndexError, TypeError, AttributeError): raise NotFound(ob, name, request) if self.require_docstrings and not getattr(su...
6,370
def getOriginalException(): 'Returns the original exception object.'
def getOriginalException(): 'Returns the original exception object.'
6,371
def __str__(self): return repr(self.orig_exc)
def __str__(self): return repr(self.orig_exc)
6,372
def __call__(obj, request, exc_info): '''Effect persistent side-effects.
def __call__(obj, request, exc_info): '''Effect persistent side-effects.
6,373
def __call__(obj, request, exc_info): '''Effect persistent side-effects.
def __call__(obj, request, exc_info): '''Effect persistent side-effects.
6,374
def getobsc(snum,stime,observables,zerotime=0.0): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() try: if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) if i % 1024 == 0: lasttime = ...
def getobsc(snum,stime,observables,zerotime=0.0): fullinittime = time() inittime = int(fullinittime) lasttime = 0 print "Processing...", sys.stdout.flush() try: if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) i...
6,375
def getobsc(snum,stime,observables,zerotime=0.0): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() try: if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) if i % 1024 == 0: lasttime = ...
def getobsc(snum,stime,observables,zerotime=0.0): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() try: if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) if i % 1024 == 0: lasttime = ...
6,376
def getobsc(snum,stime,observables,zerotime=0.0): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() try: if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) if i % 1024 == 0: lasttime = ...
def getobsc(snum,stime,observables,zerotime=0.0): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() try: if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) if i % 1024 == 0: lasttime = ...
6,377
def dotime(i,snum,inittime,lasttime): currenttime = int(time()) - inittime if currenttime - lasttime > 2: percdone = int((100.0*i)/snum) timeleft = int(((1.0 * currenttime) / i) * (snum-i)) vel = ((1.0*i)/currenttime) minleft = timeleft / 60 secleft = timeleft - minleft*60 print "\r...%d/%d (%d%%) done [%d (multi)s...
def dotime(i,snum,inittime,lasttime): currenttime = int(time()) - inittime if currenttime - lasttime > 2 and i > 0: percdone = int((100.0*i)/snum) timeleft = int(((1.0 * currenttime) / i) * (snum-i)) vel = ((1.0*i)/currenttime) minleft = timeleft / 60 secleft = timeleft - minleft*60 print "\r...%d/%d (%d%%) done [%...
6,378
def spect(series,sampling,patches=1,detrend=0): nyquistf = 0.5 / sampling if patches==0: period = pdg(series) elif patches==1: period = wpdg(series,detrend) else: period = opwpdg(series,patches,detrend) pdlen = shape(period)[0]-1 freqs = arange(0,pdlen+1,typecode='d') * (nyquistf / pdlen) deltaf = nyquistf / pdlen ...
def spect(series,sampling,patches=1,detrend=0,overlap=1): nyquistf = 0.5 / sampling if patches==0: period = pdg(series) elif patches==1: period = wpdg(series,detrend) else: period = opwpdg(series,patches,detrend) pdlen = shape(period)[0]-1 freqs = arange(0,pdlen+1,typecode='d') * (nyquistf / pdlen) deltaf = nyquist...
6,379
def spect(series,sampling,patches=1,detrend=0): nyquistf = 0.5 / sampling if patches==0: period = pdg(series) elif patches==1: period = wpdg(series,detrend) else: period = opwpdg(series,patches,detrend) pdlen = shape(period)[0]-1 freqs = arange(0,pdlen+1,typecode='d') * (nyquistf / pdlen) deltaf = nyquistf / pdlen ...
def spect(series,sampling,patches=1,detrend=0): nyquistf = 0.5 / sampling if patches==0: period = pdg(series) elif patches==1: period = wpdg(series,detrend) else: if overlap==0: period = nopwpdg(series,patches,detrend) else: period = opwpdg(series,patches,detrend) pdlen = shape(period)[0]-1 freqs = arange(0,pdlen+1,...
6,380
def wpdg(series,detrend=0): samples = shape(series)[0] pdlen = samples/2 window = 1.0 - abs(arange(0,samples,typecode='d') - pdlen) / (pdlen) weight = samples * sum(window ** 2) # detrending if detrend==0: mean = 0.0 else: mean = sum(series) / (1.0*samples) wseries = window * (series - mean) wpdgram = pdg(wseries) ...
def wpdg(series,detrend=0): samples = shape(series)[0] pdlen = (samples-1)/2.0 window = 1.0 - abs(arange(0,samples,typecode='d') - pdlen) / (pdlen) weight = samples * sum(window ** 2) # detrending if detrend==0: mean = 0.0 else: mean = sum(series) / (1.0*samples) wseries = window * (series - mean) wpdgram = pdg(wse...
6,381
def opwpdg(series,patches,detrend=0): samples = shape(series)[0] serlen = samples - (samples % (4*patches)) patlen = serlen/patches pdlen = patlen/2 opwpdgram = zeros(pdlen+1,typecode='d') for cnt in range(0,2*patches-1): opwpdgram[:] += wpdg(series[cnt*pdlen:(cnt+2)*pdlen],detrend) opwpdgram[:] /= (2.0*patches - 1...
def def nopwpdg(series,patches,detrend=0): samples = shape(series)[0] serlen = samples - (samples % (4*patches)) patlen = serlen/patches pdlen = patlen/2 opwpdgram = zeros(pdlen+1,typecode='d') for cnt in range(0,patches): opwpdgram[:] += wpdg(series[cnt*patlen:(cnt+1)*patlen],detrend) opwpdgram[:] /= 1.0*patches...
6,382
def getobs(snum,stime,observables): if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) else: obslen = shape(observables)[0] array = zeros((snum,obslen),typecode='d') for i in arange(0,snum): for j in range(0,obslen): array[i,j] = observables[j](i*s...
def getobs(snum,stime,observables,zerotime=0.0): if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) else: obslen = shape(observables)[0] array = zeros((snum,obslen),typecode='d') for i in arange(0,snum): for j in range(0,obslen): array[i,j] = obser...
6,383
def getobs(snum,stime,observables): if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) else: obslen = shape(observables)[0] array = zeros((snum,obslen),typecode='d') for i in arange(0,snum): for j in range(0,obslen): array[i,j] = observables[j](i*s...
def getobs(snum,stime,observables): if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(zerotime+i*stime) else: obslen = shape(observables)[0] array = zeros((snum,obslen),typecode='d') for i in arange(0,snum): for j in range(0,obslen): array[i,j] = observabl...
6,384
def getobs(snum,stime,observables): if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) else: obslen = shape(observables)[0] array = zeros((snum,obslen),typecode='d') for i in arange(0,snum): for j in range(0,obslen): array[i,j] = observables[j](i*s...
def getobs(snum,stime,observables): if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) else: obslen = shape(observables)[0] array = zeros((snum,obslen),typecode='d') for i in arange(0,snum): for j in range(0,obslen): array[i,j] = observables[j](zer...
6,385
def getobsc(snum,stime,observables): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) if i % 1024 == 0: lasttime = dotime(i,snum,inittime,lasttime) else: obslen = sha...
def getobsc(snum,stime,observables,zerotime=0.0): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) if i % 1024 == 0: lasttime = dotime(i,snum,inittime,lasttime) else:...
6,386
def getobsc(snum,stime,observables): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) if i % 1024 == 0: lasttime = dotime(i,snum,inittime,lasttime) else: obslen = sha...
def getobsc(snum,stime,observables): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(zerotime+i*stime) if i % 1024 == 0: lasttime = dotime(i,snum,inittime,lasttime) else: obs...
6,387
def getobsc(snum,stime,observables): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) if i % 1024 == 0: lasttime = dotime(i,snum,inittime,lasttime) else: obslen = sha...
def getobsc(snum,stime,observables): inittime = int(time()) lasttime = 0 print "Processing...", sys.stdout.flush() if len(shape(observables)) == 0: array = zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(i*stime) if i % 1024 == 0: lasttime = dotime(i,snum,inittime,lasttime) else: obslen = sha...
6,388
def getobs(snum,stime,observables,zerotime=0.0): if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in arange(0,snum): array[i] = observables(zerotime+i*stime) else: obslen = Numeric.shape(observables)[0] array = Numeric.zeros((snum,obslen),typecode='d') for i in Numeric.arange(0,sn...
def getobs(snum,stime,observables,zerotime=0.0): if len(Numeric.shape(observables)) == 0: array = Numeric.zeros(snum,typecode='d') for i in Numeric.arange(0,snum): array[i] = observables(zerotime+i*stime) else: obslen = Numeric.shape(observables)[0] array = Numeric.zeros((snum,obslen),typecode='d') for i in Numeric.ara...
6,389
def stdLISApositions(): """Returns four Numeric arrays corresponding to times [in seconds] along
def stdLISApositions(): """Returns four Numeric arrays corresponding to times [in seconds] along
6,390
def stdSampledLISA(interp=1):
def stdSampledLISA(interp=1):
6,391
def stdSampledLISA(interp=1):
def stdSampledLISA(interp=1):
6,392
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,393
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,394
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,395
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,396
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,397
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,398
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
def findpackage(packagename,dirname): packagetargz = glob.glob(packagename + '-*.tar.gz') packagetgz = glob.glob(packagename + '-*.tgz') packagetar = glob.glob(packagename + '-*.tar') packagezip = glob.glob(packagename + '-*.zip') if packagetargz: print "Unpacking " + packagetargz[-1] os.system('tar zxvf ' + pac...
6,399