Jinja2 Documentation Release 2.10configured with the policies attribute. Example: env.policies['urlize.rel'] = 'nofollow noopener' compiler.ascii_str: This boolean controls on Python 2 if Jinja2 should store ASCII only literals as bytestring unicode strings is that Python 2.x is not using unicode for exceptions and tracebacks as well as the compiler. This will change with Python 3. exception jinja2.TemplateRuntimeError(message=None) A generic autoescape True or False depending on if autoescaping is active or not. volatile True if the compiler cannot evaluate some expressions at compile time. At runtime this should always be False. 2.160 码力 | 148 页 | 475.08 KB | 1 年前3
理解Python中的AST 何翔宇 ⽬目录 CONTENTS Intro CPython’s Compiler How to Use AST Library Use AST to Solve Problems Suggestion and Reference Intro CPython’s Compiler Intro CPython’s Compiler - From source code to bytecode AST: 对语法的⾼高度抽象,不不会保留留细节 CFG: 记录着程序流程的有向图 bytecode: 能够被 Python 解释器器使⽤用的源码 Intro CPython’s Compiler - parser source code parse tree parse - 解码 - PEP 263 -- Defining Python Source Code Encodings Identifiers - 解析 - 根据词法分析的结果和语法⽂文件,⽣生成解析树 - 分词器器(Tokenize) - keyword - tokenize Intro CPython’s Compiler - transform and emit Transform: - 使⽤用 Python/ast.c 中的 PyAST_FromNode() 从解析树中读取 - 根据转换规则 Parser/Python0 码力 | 39 页 | 6.95 MB | 1 年前3
Python 标准库参考指南 2.7.18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295 32.3 symtable —Access to the compiler’s symbol tables . . . . . . . . . . . . . . . . . . . . . . . . . 1301 vi 32.4 symbol —与 Python pickletools —pickle 开发者工具集 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1320 33 Python compiler package 1321 33.1 The basic interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . compile are ignored. Future 语句使用比特位来指定,多个语句可以通过按位或来指定。具体特性的比特位可以通 过__future__ 模块中的 _Feature 类的实例的 compiler_flag 属性来获得。 7 The Python Library Reference, 发布 2.7.18 This function raises SyntaxError if the0 码力 | 1552 页 | 7.42 MB | 10 月前3
Python 标准库参考指南 2.7.18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295 32.3 symtable —Access to the compiler’s symbol tables . . . . . . . . . . . . . . . . . . . . . . . . . 1301 vi 32.4 symbol —与 Python pickletools —pickle 开发者工具集 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1320 33 Python compiler package 1321 33.1 The basic interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . compile are ignored. Future 语句使用比特位来指定,多个语句可以通过按位或来指定。具体特性的比特位可以通 过__future__ 模块中的 _Feature 类的实例的 compiler_flag 属性来获得。 7 The Python Library Reference, 发布 2.7.18 This function raises SyntaxError if the0 码力 | 1552 页 | 7.42 MB | 10 月前3
Python 标准库参考指南 2.7.18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295 32.3 symtable —Access to the compiler’s symbol tables . . . . . . . . . . . . . . . . . . . . . . . . . 1301 vi 32.4 symbol —与 Python pickletools —pickle 开发者工具集 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1320 33 Python compiler package 1321 33.1 The basic interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . compile are ignored. Future 语句使用比特位来指定,多个语句可以通过按位或来指定。具体特性的比特位可以通 过__future__ 模块中的 _Feature 类的实例的 compiler_flag 属性来获得。 7 The Python Library Reference, 发布 2.7.18 This function raises SyntaxError if the0 码力 | 1552 页 | 7.42 MB | 10 月前3
PyArmor Documentation v8.1.9be comipled to machine instructions directly, then called by obfuscated scripts. It requires c compiler. In Linux and Darwin, gcc and clang is OK. In Windows, only clang.exe works. It could be configured home path of current logon user, check the environment variable HOME to get the real path. After compiler works, using --enable-bcc to enable BCC mode [3]: $ pyarmor gen --enable-bcc foo.py All the source mainly used in some platforms Pyarmor could not tell right but still works. PYARMOR_CC Specify C compiler for bccmode PYARMOR_CLI Only for compatible with old Pyarmor, ignore this if you don’t use old0 码力 | 131 页 | 111.00 KB | 1 年前3
2 使用Python训练和部署低精度模型 张校捷TensorFlow中使用TensorRT 1. SavedModel使用TensorRT import tensorflow as tf from tensorflow.python.compiler.tensorrt import trt_convert as trt converter = trt.TrtGraphConverter( input_saved_model_dir=i TensorFlow模型使用TensorRT 2. Frozen Graph使用TensorRT import tensorflow as tf from tensorflow.python.compiler.tensorrt import trt_convert as trt with tf.Session() as sess: # First deserialize your frozen graph: as_graph_def(), output_node_names=['logits', 'classes']) TensorFlow导出低精度模型 from tensorflow.python.compiler.tensorrt import trt_convert as trt converter = trt.TrtGraphConverter( input_graph_def=frozen_graph0 码力 | 24 页 | 981.45 KB | 1 年前3
PyArmor Documentation v8.5.10be compiled to machine instructions directly, then called by obfuscated scripts. It requires c compiler. In Linux and Darwin, gcc and clang is OK. In Windows, only clang.exe works. It could be configured home path of current logon user, check the environment variable HOME to get the real path. After compiler works, using --enable-bcc to enable BCC mode [3]: $ pyarmor gen --enable-bcc foo.py All the source scripts: $ pyarmor cfg optimize 2 The argument optimize specifies the optimization level of the compiler; the default value of -1 selects the optimization level of the interpreter as given by -O options0 码力 | 193 页 | 154.05 KB | 1 年前3
Django 1.8.x Documentationgettext. You can also run django-admin compilemessages --settings=path.to.settings to make the compiler process all the directories in your LOCALE_PATHS setting. 3.15.2 Format localization Overview NotEqual(Lookup): lookup_name = 'ne' def as_sql(self, compiler, connection): lhs, lhs_params = self.process_lhs(compiler, connection) rhs, rhs_params = self.process_rhs(compiler, connection) params = lhs_params + rhs_params the string __. We then need to define the as_sql method. This takes a SQLCompiler object, called compiler, and the active database connection. SQLCompiler objects are not documented, but the only thing0 码力 | 1685 页 | 6.01 MB | 1 年前3
Django 1.8.x Documentationgettext. You can also run django-admin compilemessages --settings=path.to.settings to make the compiler process all the directories in your LOCALE_PATHS setting. Format localization Overview Django’s lookup_name = 'ne' def as_sql(self, compiler, connection): lhs, lhs_params = self.process_lhs(compiler, connection) rhs, rhs_params = self.process_rhs(compiler, connection) params = lhs_params the string __. We then need to define the as_sql method. This takes a SQLCompiler object, called compiler, and the active database connection. SQLCompiler objects are not documented, but the only thing0 码力 | 2454 页 | 2.85 MB | 1 年前3
共 158 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16













