bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def p_specification(t): 'specification : opt_defs_and_declares name_decl opt_defs_and_declares decode_block' global_decls1 = t[1] isa_name = t[2] namespace = isa_name + "Inst" global_decls2 = t[3] (inst_decls, code) = t[4] code = indent(code) # grab the last three path components of isa_desc_filename filename = '/'.joi... | def p_specification(t): 'specification : opt_defs_and_declares name_decl opt_defs_and_declares decode_block' global_decls1 = t[1] isa_name = t[2] namespace = isa_name + "Inst" global_decls2 = t[3] (inst_decls, code) = t[4] code = indent(code) # grab the last three path components of isa_desc_filename filename = '/'.joi... | 4,300 |
def get(self, job, stat, system=None): run = self.allRunNames.get(str(job), None) if run is None: return None | def get(self, job, stat, system=None): run = self.allRunNames.get(str(job), None) if run is None: return None | 4,301 |
def find_any(self, ptype): if isinstance(self, ptype): return self, True | def find_any(self, ptype): if isinstance(self, ptype): return self, True | 4,302 |
def display(self): print '[' + self.path + ']' # .ini section header | def display(self): print '[' + self.path + ']' # .ini section header | 4,303 |
def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | def parse_isa_desc(isa_desc_file, output_dir): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = input.read() inpu... | 4,304 |
def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | 4,305 |
def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | 4,306 |
def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | def parse_isa_desc(isa_desc_file, output_dir, include_path): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = inp... | 4,307 |
def clearPCSymbol(option, opt_str, value, parser): objects.ExecutionTrace.pc_symbol = False | def clearPCSymbol(option, opt_str, value, parser): objects.ExecutionTrace.pc_symbol = False | 4,308 |
def statsTextFile(option, opt_str, value, parser): objects.Statistics.text_file = value | def statsTextFile(option, opt_str, value, parser): objects.Statistics.text_file = value | 4,309 |
def changeTiming(self, mode): if isinstance(self, System): self._ccObject.setMemoryMode(mode) for child in self._children.itervalues(): child.changeTiming(mode) | def changeTiming(self, mode): if isinstance(self, m5.objects.System): self._ccObject.setMemoryMode(mode) for child in self._children.itervalues(): child.changeTiming(mode) | 4,310 |
def panic(string): print >>sys.stderr, 'panic:', string sys.exit(1) | def panic(string): print >>sys.stderr, 'panic:', string sys.exit(1) | 4,311 |
def AddToPath(path): path = os.path.realpath(path) if os.path.isdir(path) and path not in sys.path: sys.path.append(path) | def AddToPath(path): path = os.path.realpath(path) sys.path.insert(1, path) | 4,312 |
def AddToPath(path): # if it's a relative path and we know what directory the current # python script is in, make the path relative to that directory. if not os.path.isabs(path) and sys.path[0]: path = os.path.join(sys.path[0], path) path = os.path.realpath(path) # sys.path[0] should always refer to the current script'... | def AddToPath(path): # if it's a relative path and we know what directory the current # python script is in, make the path relative to that directory. if not os.path.isabs(path) and sys.path[0]: path = os.path.join(sys.path[0], path) path = os.path.realpath(path) # sys.path[0] should always refer to the current script'... | 4,313 |
def graphdata(runs, tag, label, value): import info configs = ['std', 'csa', 'ht1', 'ht4', 'htx', 'ocm', 'occ', 'ocp' ] benchmarks = [ 'm', 's' ] dmas = [ 'x', 'd', 'b' ] caches = [ '1', '2', '3', '4', '5' ] systems = [ 'M' ] checkpoints = [ '1' ] names = [] for bench in benchmarks: for dma in dmas: for cache in cache... | def graphdata(runs, tag, label, value): import info configs = ['std', 'csa', 'ht1', 'ht4', 'htx', 'ocm', 'occ', 'ocp' ] benchmarks = [ 'm', 's' ] dmas = [ 'x', 'd', 'b' ] caches = [ '1', '2', '3', '4', '5' ] systems = [ 'M' ] checkpoints = [ '1' ] names = [] for bench in benchmarks: for dma in dmas: for cache in cache... | 4,314 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,315 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,316 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,317 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,318 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,319 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,320 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,321 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,322 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,323 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,324 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,325 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,326 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,327 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,328 |
def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populat... | 4,329 |
def panic(*args, **kwargs): sys.exit(*args, **kwargs) | def panic(*args, **kwargs): print >>sys.stderr, 'panic:', string sys.exit(1) | 4,330 |
def AddToPath(path): path = os.path.realpath(path) if os.path.isdir(path): sys.path.append(path) | def AddToPath(path): path = os.path.realpath(path) if os.path.isdir(path) and path not in sys.path: sys.path.append(path) | 4,331 |
def binpath(app, file=None): # executable has same name as app unless specified otherwise if not file: file = app return os.path.join(test_progs, app, 'bin', isa, opsys, file) | def binpath(app, file=None): # executable has same name as app unless specified otherwise if not file: file = app return os.path.join(test_progs, app, 'bin', isa, opsys, file) | 4,332 |
def wrap_decode_block(self, pre, post = ''): self.decode_block = pre + indent(self.decode_block) + post | def wrap_decode_block(self, pre, post = ''): self.decode_block = pre + indent(self.decode_block) + post | 4,333 |
def subst(self, d): # Start with the template namespace. Make a copy since we're # going to modify it. myDict = templateMap.copy() # if the argument is a dictionary, we just use it. if isinstance(d, dict): myDict.update(d) # if the argument is an object, we use its attribute map. elif hasattr(d, '__dict__'): myDict.up... | def subst(self, d): # Start with the template namespace. Make a copy since we're # going to modify it. myDict = templateMap.copy() # if the argument is a dictionary, we just use it. if isinstance(d, dict): myDict.update(d) # if the argument is an object, we use its attribute map. elif hasattr(d, '__dict__'): myDict.up... | 4,334 |
def makeConstructor(self): c = '' if self.is_src: c += '\n\t_srcRegIdx[%d] = %s;' % \ (self.src_reg_idx, self.reg_spec) if self.is_dest: c += '\n\t_destRegIdx[%d] = %s;' % \ (self.dest_reg_idx, self.reg_spec) return c | def makeConstructor(self): c = '' if self.is_src: c += '\n\t_srcRegIdx[%d] = %s + Ctrl_Base_DepTag;' % \ (self.src_reg_idx, self.reg_spec) if self.is_dest: c += '\n\t_destRegIdx[%d] = %s;' % \ (self.dest_reg_idx, self.reg_spec) return c | 4,335 |
def makeConstructor(self): c = '' if self.is_src: c += '\n\t_srcRegIdx[%d] = %s;' % \ (self.src_reg_idx, self.reg_spec) if self.is_dest: c += '\n\t_destRegIdx[%d] = %s;' % \ (self.dest_reg_idx, self.reg_spec) return c | def makeConstructor(self): c = '' if self.is_src: c += '\n\t_srcRegIdx[%d] = %s;' % \ (self.src_reg_idx, self.reg_spec) if self.is_dest: c += '\n\t_destRegIdx[%d] = %s + Ctrl_Base_DepTag;' % \ (self.dest_reg_idx, self.reg_spec) return c | 4,336 |
def makeRead(self): bit_select = 0 if (self.ctype == 'float' or self.ctype == 'double'): error(0, 'Attempt to read control register as FP') base = 'xc->readMiscReg(%s)' % self.reg_spec if self.size == self.dflt_size: return '%s = %s;\n' % (self.base_name, base) else: return '%s = bits(%s, %d, 0);\n' % \ (self.base_name... | def makeRead(self): bit_select = 0 if (self.ctype == 'float' or self.ctype == 'double'): error(0, 'Attempt to read control register as FP') base = 'xc->readMiscRegOperand(this, %s)' % self.src_reg_idx if self.size == self.dflt_size: return '%s = %s;\n' % (self.base_name, base) else: return '%s = bits(%s, %d, 0);\n' % \... | 4,337 |
def makeWrite(self): if (self.ctype == 'float' or self.ctype == 'double'): error(0, 'Attempt to write control register as FP') wb = 'xc->setMiscRegWithEffect(%s, %s);\n' % (self.reg_spec, self.base_name) wb += 'if (traceData) { traceData->setData(%s); }' % \ self.base_name return wb | def makeWrite(self): if (self.ctype == 'float' or self.ctype == 'double'): error(0, 'Attempt to write control register as FP') wb = 'xc->setMiscRegOperandWithEffect(this, %s, %s);\n' % \ (self.dest_reg_idx, self.base_name) wb += 'if (traceData) { traceData->setData(%s); }' % \ self.base_name return wb | 4,338 |
def makeFlagConstructor(flag_list): if len(flag_list) == 0: return '' # filter out repeated flags flag_list.sort() i = 1 while i < len(flag_list): if flag_list[i] == flag_list[i-1]: del flag_list[i] else: i += 1 pre = '\n\tflags[' post = '] = true;' code = pre + string.join(flag_list, post + pre) + post return code | def makeFlagConstructor(flag_list): if len(flag_list) == 0: return '' # filter out repeated flags flag_list.sort() i = 1 while i < len(flag_list): if flag_list[i] == flag_list[i-1]: del flag_list[i] else: i += 1 pre = '\n\tflags[' post = '] = true;' code = pre + string.join(flag_list, post + pre) + post return code | 4,339 |
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | 4,340 |
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | 4,341 |
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | 4,342 |
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ... | 4,343 |
def usage(exitcode=None): print parser.help if exitcode is not None: sys.exit(exitcode) | def usage(exitcode=None): parser.print_help() if exitcode is not None: sys.exit(exitcode) | 4,344 |
def t_NEWFILE(t): r'^\#\#newfile\s+"[\w/.-]*"' global fileNameStack fileNameStack.append((t.value[11:-1], t.lineno)) t.lineno = 0 | def t_NEWFILE(t): r'^\#\#newfile\s+"[\w/.-]*"' fileNameStack.push((t.value[11:-1], t.lineno)) t.lineno = 0 | 4,345 |
def t_ENDFILE(t): r'^\#\#endfile' (filename, t.lineno) = fileNameStack.pop() | def t_ENDFILE(t): r'^\#\#endfile' (old_filename, t.lineno) = fileNameStack.pop() | 4,346 |
def p_error(t): if t: error(t.lineno, "syntax error at '%s'" % t.value) else: error_bt(0, "unknown syntax error") | def p_error(t): if t: error(t.lineno, "syntax error at '%s'" % t.value) else: error(0, "unknown syntax error", True) | 4,347 |
def fixPythonIndentation(s): # get rid of blank lines first s = re.sub(r'(?m)^\s*\n', '', s); if (s != '' and re.match(r'[ \t]', s[0])): s = 'if 1:\n' + s return s | def fixPythonIndentation(s): # get rid of blank lines first s = re.sub(r'(?m)^\s*\n', '', s); if (s != '' and re.match(r'[ \t]', s[0])): s = 'if 1:\n' + s return s | 4,348 |
def error(lineno, string): spaces = "" for (filename, line) in fileNameStack[0:-1]: print spaces + "In file included from " + filename spaces += " " # Uncomment the following line to get a Python stack backtrace for # these errors too. Can be handy when trying to debug the parser. # traceback.print_exc() sys.exit(spa... | def error(lineno, string): spaces = "" for (filename, line) in fileNameStack[0:-1]: print spaces + "In file included from " + filename + ":" spaces += " " # Uncomment the following line to get a Python stack backtrace for # these errors too. Can be handy when trying to debug the parser. # traceback.print_exc() sys.ex... | 4,349 |
def error(lineno, string): spaces = "" for (filename, line) in fileNameStack[0:-1]: print spaces + "In file included from " + filename spaces += " " # Uncomment the following line to get a Python stack backtrace for # these errors too. Can be handy when trying to debug the parser. # traceback.print_exc() sys.exit(spa... | def error(lineno, string): spaces = "" for (filename, line) in fileNameStack[0:-1]: print spaces + "In file included from " + filename spaces += " " # Uncomment the following line to get a Python stack backtrace for # these errors too. Can be handy when trying to debug the parser. # traceback.print_exc() sys.exit(spa... | 4,350 |
def buildOperandTypeMap(userDict, lineno): global operandTypeMap operandTypeMap = {} for (ext, (desc, size)) in userDict.iteritems(): if desc == 'signed int': ctype = 'int%d_t' % size is_signed = 1 elif desc == 'unsigned int': ctype = 'uint%d_t' % size is_signed = 0 elif desc == 'float': is_signed = 1 # shouldn't reall... | def buildOperandTypeMap(userDict, lineno): global operandTypeMap operandTypeMap = {} for (ext, (desc, size)) in userDict.iteritems(): if desc == 'signed int': ctype = 'int%d_t' % size is_signed = 1 elif desc == 'unsigned int': ctype = 'uint%d_t' % size is_signed = 0 elif desc == 'float': is_signed = 1 # shouldn't reall... | 4,351 |
def update_if_needed(file, contents): update = False if os.access(file, os.R_OK): f = open(file, 'r') old_contents = f.read() f.close() if contents != old_contents: print 'Updating', file os.remove(file) # in case it's write-protected update = True else: print 'File', file, 'is unchanged' else: print 'Generating', file... | def update_if_needed(file, contents): update = False if os.access(file, os.R_OK): f = open(file, 'r') old_contents = f.read() f.close() if contents != old_contents: print 'Updating', file os.remove(file) # in case it's write-protected update = True else: print 'File', file, 'is unchanged' else: print 'Generating', file... | 4,352 |
def preprocess_isa_desc(isa_desc): # Find any includes and include them pos = 0 while 1: m = includeRE.search(isa_desc, pos) if not m: break filename = m.group('filename') print 'Including file "%s"' % filename try: isa_desc = isa_desc[:m.start()] + \ '##newfile "' + filename + '"\n' + \ open(filename).read() + \ '##en... | def replace_include(matchobj, dirname): fname = matchobj.group('filename') full_fname = os.path.normpath(os.path.join(dirname, fname)) contents = ' (full_fname, read_and_flatten(full_fname)) return contents def read_and_flatten(filename): current_dir = os.path.dirname(filename) try: contents = open(filename).rea... | 4,353 |
def preprocess_isa_desc(isa_desc): # Find any includes and include them pos = 0 while 1: m = includeRE.search(isa_desc, pos) if not m: break filename = m.group('filename') print 'Including file "%s"' % filename try: isa_desc = isa_desc[:m.start()] + \ '##newfile "' + filename + '"\n' + \ open(filename).read() + \ '##en... | def preprocess_isa_desc(isa_desc): # Find any includes and include them pos = 0 while 1: m = includeRE.search(isa_desc, pos) if not m: break filename = m.group('filename') print 'Including file "%s"' % filename try: isa_desc = isa_desc[:m.start()] + \ '##newfile "' + filename + '"\n' + \ open(filename).read() + \ '##en... | 4,354 |
def parse_isa_desc(isa_desc_file, output_dir): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = input.read() inpu... | def parse_isa_desc(isa_desc_file, output_dir): # set a global var for the input filename... used in error messages global input_filename input_filename = isa_desc_file global fileNameStack fileNameStack = [(input_filename, 1)] # Suck the ISA description file in. input = open(isa_desc_file) isa_desc = input.read() inpu... | 4,355 |
def process_output(s): # protect any non-substitution '%'s (not followed by '(') s = re.sub(r'%(?!\()', '%%', s) # protects cpu-specific symbols too s = protect_cpu_symbols(s) return substBitOps(s % templateMap) | def process_output(s): # protect any non-substitution '%'s (not followed by '(')s = protect_non_subst_percents(s) # protects cpu-specific symbols too s = protect_cpu_symbols(s) return substBitOps(s % templateMap) | 4,356 |
def subst(self, d): # Start with the template namespace. Make a copy since we're # going to modify it. myDict = templateMap.copy() # if the argument is a dictionary, we just use it. if isinstance(d, dict): myDict.update(d) # if the argument is an object, we use its attribute map. elif hasattr(d, '__dict__'): myDict.up... | def subst(self, d): # Start with the template namespace. Make a copy since we're # going to modify it. myDict = templateMap.copy() # if the argument is a dictionary, we just use it. if isinstance(d, dict): myDict.update(d) # if the argument is an object, we use its attribute map. elif hasattr(d, '__dict__'): myDict.up... | 4,357 |
def panic(*args, **kwargs): print >>sys.stderr, 'panic:', string sys.exit(1) | def panic(string): print >>sys.stderr, 'panic:', string sys.exit(1) | 4,358 |
def load_defaults(): global systemdir, bindir, diskdir, scriptdir if not systemdir: try: path = env['M5_PATH'].split(':') except KeyError: path = [ '/dist/m5/system' ] for systemdir in path: if os.path.isdir(systemdir): break else: raise ImportError, "Can't find a path to system files." if not bindir: bindir = joinpa... | def load_defaults(): global systemdir, bindir, diskdir, scriptdir if not systemdir: try: path = env['M5_PATH'].split(':') except KeyError: path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ] for systemdir in path: if os.path.isdir(systemdir): break else: raise ImportError, "Can't find a path to system files." ... | 4,359 |
def nfspath(dir): if dir.startswith('/.automount/'): dir = '/n/%s' % dir[12:] elif not dir.startswith('/n/'): dir = '/n/%s%s' % (socket.gethostname().split('.')[0], dir) return dir | def nfspath(dir): if dir.startswith('/.automount/'): dir = '/n/%s' % dir[12:] elif not dir.startswith('/n/'): dir = '/n/%s%s' % (socket.gethostname().split('.')[0], dir) return dir | 4,360 |
def instantiate(root): instance = root.instantiate('root') instance.fixup() instance.display() if not noDot: dot = pydot.Dot() instance.outputDot(dot) dot.orientation = "portrait" dot.size = "8.5,11" dot.ranksep="equally" dot.rank="samerank" dot.write("config.dot") dot.write_ps("config.ps") | def instantiate(root): instance = root.instantiate('root') instance.fixup() instance.display() if not noDot: dot = pydot.Dot() instance.outputDot(dot) dot.orientation = "portrait" dot.size = "8.5,11" dot.ranksep="equally" dot.rank="samerank" dot.write("config.dot") dot.write_ps("config.ps") | 4,361 |
def AddToPath(path): # if it's a relative path and we know what directory the current # python script is in, make the path relative to that directory. if not os.path.isabs(path) and sys.path[0]: path = os.path.join(sys.path[0], path) path = os.path.realpath(path) # sys.path[0] should always refer to the current script'... | def AddToPath(path): # if it's a relative path and we know what directory the current # python script is in, make the path relative to that directory. if not os.path.isabs(path) and sys.path[0]: path = os.path.join(sys.path[0], path) path = os.path.realpath(path) # sys.path[0] should always refer to the current script'... | 4,362 |
def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-4]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | 4,363 |
def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-4]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | 4,364 |
def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-4]) * mega elif value.en... | 4,365 |
def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | 4,366 |
def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | def toNetworkBandwidth(value): if not isinstance(value, str): raise TypeError, "wrong type '%s' should be str" % type(value) if value.endswith('Tbps'): return float(value[:-3]) * tera elif value.endswith('Gbps'): return float(value[:-3]) * giga elif value.endswith('Mbps'): return float(value[:-3]) * mega elif value.en... | 4,367 |
def print_ini(self): print '[' + self.path() + ']' # .ini section header | def print_ini(self): print '[' + self.path() + ']' # .ini section header | 4,368 |
def print_ini(self): print '[' + self.path() + ']' # .ini section header | def print_ini(self): print '[' + self.path() + ']' # .ini section header | 4,369 |
def print_ini(self): print '[' + self.path() + ']' # .ini section header | def print_ini(self): print '[' + self.path() + ']' # .ini section header | 4,370 |
def instantiate(root): global ticks_per_sec ticks_per_sec = float(root.clock.frequency) root.print_ini() noDot = True # temporary until we fix dot if not noDot: dot = pydot.Dot() instance.outputDot(dot) dot.orientation = "portrait" dot.size = "8.5,11" dot.ranksep="equally" dot.rank="samerank" dot.write("config.dot") do... | def instantiate(root): global ticks_per_sec ticks_per_sec = float(root.clock.frequency) root.print_ini() noDot = True # temporary until we fix dot if not noDot: dot = pydot.Dot() instance.outputDot(dot) dot.orientation = "portrait" dot.size = "8.5,11" dot.ranksep="equally" dot.rank="samerank" dot.write("config.dot") do... | 4,371 |
def build(self, script, args = []): self.cmd = [ self.qsub ] | def build(self, script, args = []): self.cmd = [ self.qsub ] | 4,372 |
def switchCpus(cpuList): print "switching cpus" if not isinstance(cpuList, list): raise RuntimeError, "Must pass a list to this function" for i in cpuList: if not isinstance(i, tuple): raise RuntimeError, "List must have tuples of (oldCPU,newCPU)" [old_cpus, new_cpus] = zip(*cpuList) for cpu in old_cpus: if not isins... | def switchCpus(cpuList): print "switching cpus" if not isinstance(cpuList, list): raise RuntimeError, "Must pass a list to this function" for i in cpuList: if not isinstance(i, tuple): raise RuntimeError, "List must have tuples of (oldCPU,newCPU)" [old_cpus, new_cpus] = zip(*cpuList) for cpu in old_cpus: if not isins... | 4,373 |
def switchCpus(cpuList): print "switching cpus" if not isinstance(cpuList, list): raise RuntimeError, "Must pass a list to this function" for i in cpuList: if not isinstance(i, tuple): raise RuntimeError, "List must have tuples of (oldCPU,newCPU)" [old_cpus, new_cpus] = zip(*cpuList) for cpu in old_cpus: if not isins... | def switchCpus(cpuList): print "switching cpus" if not isinstance(cpuList, list): raise RuntimeError, "Must pass a list to this function" for i in cpuList: if not isinstance(i, tuple): raise RuntimeError, "List must have tuples of (oldCPU,newCPU)" [old_cpus, new_cpus] = zip(*cpuList) for cpu in old_cpus: if not isins... | 4,374 |
def is_exceptional(fn,exceptions): for x in exceptions: xfn = os.normcase(os.normpath(x)) if fn[-len(xfn):]==xfn: return 1 return 0 | def is_exceptional(fn,exceptions): for x in exceptions: xfn = os.path.normcase(os.path.normpath(x)) if makeabs(fn)[-len(xfn):]==xfn: return 1 return 0 | 4,375 |
def usage(code=0, msg=''): f = code and sys.stderr or sys.stdout if msg is not None: f.write(msg+'\n') f.write(\ | def usage(code=0, msg=''): f = code and sys.stderr or sys.stdout if msg is not None: f.write(msg+'\n') f.write(\ | 4,376 |
def asDrawing(self, width, height): | def asDrawing(self, width, height): | 4,377 |
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | 4,378 |
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | 4,379 |
def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | def test0(self): "Test if pythonpoint.pdf can be created from pythonpoint.xml." | 4,380 |
def processPDF(self, pdfFileName, pageNo): formName = getFormName(pdfFileName, pageNo) storeForms(pdfFileName, formName + '.frm', prefix= formName + '_', pagenumbers=[pageNo]) print 'stored %s.frm' % formName return formName + '.frm' | def processPDF(self, pdfFileName, pageNo): formName = self.getFormName(pdfFileName, pageNo) storeForms(pdfFileName, formName + '.frm', prefix= formName + '_', pagenumbers=[pageNo]) print 'stored %s.frm' % formName return formName + '.frm' | 4,381 |
def getAttributes(self,attr,attrMap): A = {} for k, v in attr.items(): k = string.lower(k) if k in attrMap.keys(): j = attrMap[k] func = j[1] try: A[j[0]] = (func is None) and val or apply(func,(v,)) except: self.syntax_error('%s: invalid value %s'%(k,v)) else: self.syntax_error('invalid attribute name %s'%k) return A | def getAttributes(self,attr,attrMap): A = {} for k, v in attr.items(): k = string.lower(k) if k in attrMap.keys(): j = attrMap[k] func = j[1] try: A[j[0]] = (func is None) and v or apply(func,(v,)) except: self.syntax_error('%s: invalid value %s'%(k,v)) else: self.syntax_error('invalid attribute name %s'%k) return A | 4,382 |
def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """ | def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """ | 4,383 |
def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """ | def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """ | 4,384 |
def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """ | def parse(self, text, style): """Given a formatted string will return a list of ParaFrag objects with their calculated widths. If errors occur None will be returned and the self.errors holds a list of the error messages. """ | 4,385 |
def breakLinesCJK(self, width): """Initially, the dumbest possible wrapping algorithm. Cannot handle font variations.""" | def breakLinesCJK(self, width): """Initially, the dumbest possible wrapping algorithm. Cannot handle font variations.""" | 4,386 |
def __init__(self, file, validate=0): """Loads and parses a TrueType font file. file can be a filename or a file object. If validate is set to a false values, skips checksum validation. This can save time, especially if the font is large. """ | def __init__(self, file, validate=0): """Loads and parses a TrueType font file. file can be a filename or a file object. If validate is set to a false values, skips checksum validation. This can save time, especially if the font is large. """ | 4,387 |
def __init__(self, file, validate=0): """Loads and parses a TrueType font file. file can be a filename or a file object. If validate is set to a false values, skips checksum validation. This can save time, especially if the font is large. """ | def __init__(self, file, validate=0): """Loads and parses a TrueType font file. file can be a filename or a file object. If validate is set to a false values, skips checksum validation. This can save time, especially if the font is large. """ | 4,388 |
def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file. | def extractInfo(self, charInfo=1): """Extract typographic information from the loaded font file. | 4,389 |
def find_cleanable_files(L,d,N): n = os.path.basename(d) for n in filter(lambda n: n[-3:]=='.PYC' or n[-4:]=='.PDF' or n[-4:]=='.A85',map(string.upper,N)): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): os.remove(fn) | def find_cleanable_files(L,d,N): n = os.path.basename(d) for n in filter(lambda n: n[-3:]=='.PYC' or n[-4:]=='.PDF' or n[-4:]=='.A85',map(string.upper,N)): fn = os.path.normcase(os.path.normpath(os.path.join(d,n))) if os.path.isfile(fn): os.remove(fn) | 4,390 |
def start_para(self, args): self._curPara = pythonpoint.PPPara() self._curPara.style = self._arg('para',args,'style') | def start_para(self, args): self._curPara = pythonpoint.PPPara() self._curPara.style = self._arg('para',args,'style') | 4,391 |
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | 4,392 |
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | 4,393 |
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | 4,394 |
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontn... | 4,395 |
def saveToFile(self,fn,fmt=None): im = self.toPIL() if fmt is None: if type(fn) is not StringType: raise ValueError, "Invalid type '%s' for fn when fmt is None" % type(fn) else: fmt = string.upper(fmt) if fmt in ['GIF']: im = _convert2pilp(im) elif fmt in ['PCT','PICT']: return _saveAsPICT(im,fn,fmt) elif fmt in ['PNG'... | def saveToFile(self,fn,fmt=None): im = self.toPIL() if fmt is None: if type(fn) is not StringType: raise ValueError, "Invalid type '%s' for fn when fmt is None" % type(fn) else: fmt = string.upper(fmt) if fmt in ['GIF']: im = _convert2pilp(im) elif fmt in ['PCT','PICT']: return _saveAsPICT(im,fn,fmt) elif fmt in ['PNG'... | 4,396 |
def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','tiff','tif','py'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (getattr(self,'verbose',verbos... | def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','bmp','ppm','tiff','tif','py','pict','pct'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (geta... | 4,397 |
def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','tiff','tif','py'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (getattr(self,'verbose',verbos... | def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','tiff','tif','py'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (getattr(self,'verbose',verbos... | 4,398 |
def asString(self, format, verbose=None): """Converts to an 8 bit string in given format.""" assert format in ['pdf','ps','eps','gif','png','jpg','jpeg','tiff','tif','py'], 'Unknown file format "%s"' % format from reportlab import rl_config #verbose = verbose is not None and (verbose,) or (getattr(self,'verbose',verbos... | defasString(self,format,verbose=None):"""Convertstoan8bitstringingivenformat."""assertformatin['pdf','ps','eps','gif','png','jpg','jpeg','tiff','tif','py'],'Unknownfileformat"%s"'%formatfromreportlabimportrl_config#verbose=verboseisnotNoneand(verbose,)or(getattr(self,'verbose',verbose),)[0]ifformat=='pdf':fromreportlab... | 4,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.