Download Pytorch/include/internal/pycore_symtable.h from RayTBRP/codellama-CodeLlama-7b-Python-hf: direct link, hf CLI and curl.
- Browser
- Download file 5.58 kB
-
https://huggingface.co/RayTBRP/codellama-CodeLlama-7b-Python-hf/resolve/c0c5506eba15c7ab03ff4f59bbe251ee2db72517/Pytorch/include/internal/pycore_symtable.h
- Command line
-
hf download hf://RayTBRP/codellama-CodeLlama-7b-Python-hf@c0c5506eba15c7ab03ff4f59bbe251ee2db72517/Pytorch/include/internal/pycore_symtable.h
-
curl -L -o pycore_symtable.h https://huggingface.co/RayTBRP/codellama-CodeLlama-7b-Python-hf/resolve/c0c5506eba15c7ab03ff4f59bbe251ee2db72517/Pytorch/include/internal/pycore_symtable.h
5.58 kB
| extern "C" { | |
| struct _mod; // Type defined in pycore_ast.h | |
| typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock, AnnotationBlock } | |
| _Py_block_ty; | |
| typedef enum _comprehension_type { | |
| NoComprehension = 0, | |
| ListComprehension = 1, | |
| DictComprehension = 2, | |
| SetComprehension = 3, | |
| GeneratorExpression = 4 } _Py_comprehension_ty; | |
| struct _symtable_entry; | |
| struct symtable { | |
| PyObject *st_filename; /* name of file being compiled, | |
| decoded from the filesystem encoding */ | |
| struct _symtable_entry *st_cur; /* current symbol table entry */ | |
| struct _symtable_entry *st_top; /* symbol table entry for module */ | |
| PyObject *st_blocks; /* dict: map AST node addresses | |
| * to symbol table entries */ | |
| PyObject *st_stack; /* list: stack of namespace info */ | |
| PyObject *st_global; /* borrowed ref to st_top->ste_symbols */ | |
| int st_nblocks; /* number of blocks used. kept for | |
| consistency with the corresponding | |
| compiler structure */ | |
| PyObject *st_private; /* name of current class or NULL */ | |
| PyFutureFeatures *st_future; /* module's future features that affect | |
| the symbol table */ | |
| int recursion_depth; /* current recursion depth */ | |
| int recursion_limit; /* recursion limit */ | |
| }; | |
| typedef struct _symtable_entry { | |
| PyObject_HEAD | |
| PyObject *ste_id; /* int: key in ste_table->st_blocks */ | |
| PyObject *ste_symbols; /* dict: variable names to flags */ | |
| PyObject *ste_name; /* string: name of current block */ | |
| PyObject *ste_varnames; /* list of function parameters */ | |
| PyObject *ste_children; /* list of child blocks */ | |
| PyObject *ste_directives;/* locations of global and nonlocal statements */ | |
| _Py_block_ty ste_type; /* module, class or function */ | |
| int ste_nested; /* true if block is nested */ | |
| unsigned ste_free : 1; /* true if block has free variables */ | |
| unsigned ste_child_free : 1; /* true if a child block has free vars, | |
| including free refs to globals */ | |
| unsigned ste_generator : 1; /* true if namespace is a generator */ | |
| unsigned ste_coroutine : 1; /* true if namespace is a coroutine */ | |
| _Py_comprehension_ty ste_comprehension; /* Kind of comprehension (if any) */ | |
| unsigned ste_varargs : 1; /* true if block has varargs */ | |
| unsigned ste_varkeywords : 1; /* true if block has varkeywords */ | |
| unsigned ste_returns_value : 1; /* true if namespace uses return with | |
| an argument */ | |
| unsigned ste_needs_class_closure : 1; /* for class scopes, true if a | |
| closure over __class__ | |
| should be created */ | |
| unsigned ste_comp_iter_target : 1; /* true if visiting comprehension target */ | |
| int ste_comp_iter_expr; /* non-zero if visiting a comprehension range expression */ | |
| int ste_lineno; /* first line of block */ | |
| int ste_col_offset; /* offset of first line of block */ | |
| int ste_end_lineno; /* end line of block */ | |
| int ste_end_col_offset; /* end offset of first line of block */ | |
| int ste_opt_lineno; /* lineno of last exec or import * */ | |
| int ste_opt_col_offset; /* offset of last exec or import * */ | |
| struct symtable *ste_table; | |
| } PySTEntryObject; | |
| extern PyTypeObject PySTEntry_Type; | |
| extern int _PyST_GetScope(PySTEntryObject *, PyObject *); | |
| extern struct symtable* _PySymtable_Build( | |
| struct _mod *mod, | |
| PyObject *filename, | |
| PyFutureFeatures *future); | |
| PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); | |
| extern void _PySymtable_Free(struct symtable *); | |
| /* Flags for def-use information */ | |
| /* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol | |
| table. GLOBAL is returned from PyST_GetScope() for either of them. | |
| It is stored in ste_symbols at bits 12-15. | |
| */ | |
| // Used by symtablemodule.c | |
| extern struct symtable* _Py_SymtableStringObjectFlags( | |
| const char *str, | |
| PyObject *filename, | |
| int start, | |
| PyCompilerFlags *flags); | |
| } | |