✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python37/lib64/python3.7/site-packages/Cython/Compiler//UtilityCode.py
from __future__ import absolute_import

from .TreeFragment import parse_from_strings, StringParseContext
from . import Symtab
from . import Naming
from . import Code


class NonManglingModuleScope(Symtab.ModuleScope):

    def __init__(self, prefix, *args, **kw):
        self.prefix = prefix
        self.cython_scope = None
        self.cpp = kw.pop('cpp', False)
        Symtab.ModuleScope.__init__(self, *args, **kw)

    def add_imported_entry(self, name, entry, pos):
        entry.used = True
        return super(NonManglingModuleScope, self).add_imported_entry(name, entry, pos)

    def mangle(self, prefix, name=None):
        if name:
            if prefix in (Naming.typeobj_prefix, Naming.func_prefix, Naming.var_prefix, Naming.pyfunc_prefix):
                # Functions, classes etc. gets a manually defined prefix easily
                # manually callable instead (the one passed to CythonUtilityCode)
                prefix = self.prefix
            return "%s%s" % (prefix, name)
        else:
            return Symtab.ModuleScope.mangle(self, prefix)


class CythonUtilityCodeContext(StringParseContext):
    scope = None

    def find_module(self, module_name, relative_to=None, pos=None, need_pxd=True, absolute_fallback=True):
        if relative_to:
            raise AssertionError("Relative imports not supported in utility code.")
        if module_name != self.module_name:
            if module_name not in self.modules:
                raise AssertionError("Only the cython cimport is supported.")
            else:
                return self.modules[module_name]

        if self.scope is None:
            self.scope = NonManglingModuleScope(
                self.prefix, module_name, parent_module=None, context=self, cpp=self.cpp)

        return self.scope


class CythonUtilityCode(Code.UtilityCodeBase):
    """
    Utility code written in the Cython language itself.

    The @cname decorator can set the cname for a function, method of cdef class.
    Functions decorated with @cname('c_func_name') get the given cname.

    For cdef classes the rules are as follows:
        obj struct      -> <cname>_obj
        obj type ptr    -> <cname>_type
        methods         -> <class_cname>_<method_cname>

    For methods the cname decorator is optional, but without the decorator the
    methods will not be prototyped. See Cython.Compiler.CythonScope and
    tests/run/cythonscope.pyx for examples.
    """

    is_cython_utility = True

    def __init__(self, impl, name="__pyxutil", prefix="", requires=None,
                 file=None, from_scope=None, context=None, compiler_directives=None,
                 outer_module_scope=None):
        # 1) We need to delay the parsing/processing, so that all modules can be
        #    imported without import loops
        # 2) The same utility code object can be used for multiple source files;
        #    while the generated node trees can be altered in the compilation of a
        #    single file.
        # Hence, delay any processing until later.
        context_types = {}
        if context is not None:
            from .PyrexTypes import BaseType
            for key, value in context.items():
                if isinstance(value, BaseType):
                    context[key] = key
                    context_types[key] = value
            impl = Code.sub_tempita(impl, context, file, name)
        self.impl = impl
        self.name = name
        self.file = file
        self.prefix = prefix
        self.requires = requires or []
        self.from_scope = from_scope
        self.outer_module_scope = outer_module_scope
        self.compiler_directives = compiler_directives
        self.context_types = context_types

    def __eq__(self, other):
        if isinstance(other, CythonUtilityCode):
            return self._equality_params() == other._equality_params()
        else:
            return False

    def _equality_params(self):
        outer_scope = self.outer_module_scope
        while isinstance(outer_scope, NonManglingModuleScope):
            outer_scope = outer_scope.outer_scope
        return self.impl, outer_scope, self.compiler_directives

    def __hash__(self):
        return hash(self.impl)

    def get_tree(self, entries_only=False, cython_scope=None):
        from .AnalysedTreeTransforms import AutoTestDictTransform
        # The AutoTestDictTransform creates the statement "__test__ = {}",
        # which when copied into the main ModuleNode overwrites
        # any __test__ in user code; not desired
        excludes = [AutoTestDictTransform]

        from . import Pipeline, ParseTreeTransforms
        context = CythonUtilityCodeContext(
            self.name, compiler_directives=self.compiler_directives,
            cpp=cython_scope.is_cpp() if cython_scope else False)
        context.prefix = self.prefix
        context.cython_scope = cython_scope
        #context = StringParseContext(self.name)
        tree = parse_from_strings(
            self.name, self.impl, context=context, allow_struct_enum_decorator=True)
        pipeline = Pipeline.create_pipeline(context, 'pyx', exclude_classes=excludes)

        if entries_only:
            p = []
            for t in pipeline:
                p.append(t)
                if isinstance(p, ParseTreeTransforms.AnalyseDeclarationsTransform):
                    break

            pipeline = p

        transform = ParseTreeTransforms.CnameDirectivesTransform(context)
        # InterpretCompilerDirectives already does a cdef declarator check
        #before = ParseTreeTransforms.DecoratorTransform
        before = ParseTreeTransforms.InterpretCompilerDirectives
        pipeline = Pipeline.insert_into_pipeline(pipeline, transform,
                                                 before=before)

        def merge_scope(scope):
            def merge_scope_transform(module_node):
                module_node.scope.merge_in(scope)
                return module_node
            return merge_scope_transform

        if self.from_scope:
            pipeline = Pipeline.insert_into_pipeline(
                pipeline, merge_scope(self.from_scope),
                before=ParseTreeTransforms.AnalyseDeclarationsTransform)

        for dep in self.requires:
            if isinstance(dep, CythonUtilityCode) and hasattr(dep, 'tree') and not cython_scope:
                pipeline = Pipeline.insert_into_pipeline(
                    pipeline, merge_scope(dep.tree.scope),
                    before=ParseTreeTransforms.AnalyseDeclarationsTransform)

        if self.outer_module_scope:
            # inject outer module between utility code module and builtin module
            def scope_transform(module_node):
                module_node.scope.outer_scope = self.outer_module_scope
                return module_node

            pipeline = Pipeline.insert_into_pipeline(
                pipeline, scope_transform,
                before=ParseTreeTransforms.AnalyseDeclarationsTransform)

        if self.context_types:
            # inject types into module scope
            def scope_transform(module_node):
                for name, type in self.context_types.items():
                    entry = module_node.scope.declare_type(name, type, None, visibility='extern')
                    entry.in_cinclude = True
                return module_node

            pipeline = Pipeline.insert_into_pipeline(
                pipeline, scope_transform,
                before=ParseTreeTransforms.AnalyseDeclarationsTransform)

        (err, tree) = Pipeline.run_pipeline(pipeline, tree, printtree=False)
        assert not err, err
        self.tree = tree
        return tree

    def put_code(self, output):
        pass

    @classmethod
    def load_as_string(cls, util_code_name, from_file=None, **kwargs):
        """
        Load a utility code as a string. Returns (proto, implementation)
        """
        util = cls.load(util_code_name, from_file, **kwargs)
        return util.proto, util.impl # keep line numbers => no lstrip()

    def declare_in_scope(self, dest_scope, used=False, cython_scope=None,
                         whitelist=None):
        """
        Declare all entries from the utility code in dest_scope. Code will only
        be included for used entries. If module_name is given, declare the
        type entries with that name.
        """
        tree = self.get_tree(entries_only=True, cython_scope=cython_scope)

        entries = tree.scope.entries
        entries.pop('__name__')
        entries.pop('__file__')
        entries.pop('__builtins__')
        entries.pop('__doc__')

        for entry in entries.values():
            entry.utility_code_definition = self
            entry.used = used

        original_scope = tree.scope
        dest_scope.merge_in(original_scope, merge_unused=True, whitelist=whitelist)
        tree.scope = dest_scope

        for dep in self.requires:
            if dep.is_cython_utility:
                dep.declare_in_scope(dest_scope, cython_scope=cython_scope)

        return original_scope


def declare_declarations_in_scope(declaration_string, env, private_type=True,
                                  *args, **kwargs):
    """
    Declare some declarations given as Cython code in declaration_string
    in scope env.
    """
    CythonUtilityCode(declaration_string, *args, **kwargs).declare_in_scope(env)


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jul 2024 8.44 AM
root / root
0755
Tests
--
25 Jul 2024 8.44 AM
root / linksafe
0755
__pycache__
--
25 Jul 2024 8.44 AM
root / linksafe
0755
AnalysedTreeTransforms.py
3.736 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Annotate.py
12.646 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
AutoDocTransforms.py
7.341 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Buffer.py
28.228 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Builtin.py
22.345 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
CmdLine.py
8.776 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Code.cpython-37m-x86_64-linux-gnu.so
1.36 MB
24 Apr 2023 6.25 PM
root / linksafe
0755
Code.pxd
2.646 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Code.py
91.734 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
CodeGeneration.py
1.082 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
CythonScope.py
5.886 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
DebugFlags.py
0.608 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Errors.py
7.377 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
ExprNodes.py
526.247 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
FlowControl.cpython-37m-x86_64-linux-gnu.so
645.375 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
FlowControl.pxd
2.908 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
FlowControl.py
44.416 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
FusedNode.cpython-37m-x86_64-linux-gnu.so
456.234 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
FusedNode.py
36.635 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Future.py
0.564 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Interpreter.py
2.057 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Lexicon.cpython-37m-x86_64-linux-gnu.so
188.039 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
Lexicon.py
4.724 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Main.py
30.172 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
MemoryView.py
29.067 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
ModuleNode.py
133.313 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Naming.py
5.964 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Nodes.py
375.373 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Optimize.py
202.788 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Options.py
15.499 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
ParseTreeTransforms.pxd
2.391 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
ParseTreeTransforms.py
132.56 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Parsing.cpython-37m-x86_64-linux-gnu.so
937.57 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
Parsing.pxd
8.63 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Parsing.py
123.406 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Pipeline.py
13.685 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
PyrexTypes.py
169.474 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Pythran.cpython-37m-x86_64-linux-gnu.so
135.461 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
Pythran.py
5.576 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Scanning.cpython-37m-x86_64-linux-gnu.so
237.25 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
Scanning.pxd
1.957 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Scanning.py
17.94 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
StringEncoding.py
9.579 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Symtab.py
107.485 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
TreeFragment.py
9.144 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
TreePath.py
7.135 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
TypeInference.py
21.803 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
TypeSlots.py
35.914 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
UtilNodes.py
11.363 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
UtilityCode.py
9.171 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Version.py
0.177 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Visitor.cpython-37m-x86_64-linux-gnu.so
417.008 KB
24 Apr 2023 6.25 PM
root / linksafe
0755
Visitor.pxd
1.583 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
Visitor.py
28.688 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
__init__.py
0.013 KB
18 Mar 2018 6.52 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF