code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# no longer there, sorry
# XXX fix all these imports
from pypy.tool.pairtype import *
| Python |
import types
from pypy.annotation.model import SomeBool, SomeInteger, SomeString,\
SomeFloat, SomeList, SomeDict, s_None, SomeExternalObject,\
SomeObject, SomeInstance, SomeTuple, lltype_to_annotation
from pypy.annotation.classdef import ClassDef, InstanceSource
from pypy.annotation.listdef import ListDef, M... | Python |
"""
This file defines the 'subset' SomeValue classes.
An instance of a SomeValue class stands for a Python object that has some
known properties, for example that is known to be a list of non-negative
integers. Each instance can be considered as an object that is only
'partially defined'. Another point of view is th... | Python |
"""
The Bookkeeper class.
"""
from __future__ import generators
import sys, types, inspect
from pypy.objspace.flow.model import Constant
from pypy.annotation.model import SomeString, SomeChar, SomeFloat, \
SomePtr, unionof, SomeInstance, SomeDict, SomeBuiltin, SomePBC, \
SomeInteger, SomeExternalObject, Som... | Python |
# base annotation policy for overrides and specialization
from pypy.annotation.specialize import default_specialize as default
from pypy.annotation.specialize import specialize_argvalue, specialize_argtype, specialize_arglistitemtype
from pypy.annotation.specialize import memo
# for some reason, model must be imported ... | Python |
from pypy.annotation.model import SomeObject, s_ImpossibleValue
from pypy.annotation.model import SomeInteger, s_Bool, unionof
from pypy.annotation.model import SomeInstance
from pypy.annotation.listdef import ListItem
class DictKey(ListItem):
custom_eq_hash = False
def __init__(self, bookkeeper, s_value, is... | Python |
from pypy.annotation.model import SomeObject, s_ImpossibleValue
from pypy.annotation.model import SomeList, SomeString
from pypy.annotation.model import unionof, TLS, UnionError, isdegenerated
class TooLateForChange(Exception):
pass
class ListItem:
mutated = False # True for lists mutated after creation
... | Python |
"""
Binary operations between SomeValues.
"""
import py
import operator
from pypy.annotation.pairtype import pair, pairtype
from pypy.annotation.model import SomeObject, SomeInteger, SomeBool, s_Bool
from pypy.annotation.model import SomeString, SomeChar, SomeList, SomeDict
from pypy.annotation.model import SomeUnicod... | Python |
# workaround for a circular imports problem
# e.g. if you import pypy.annotation.listdef first
import pypy.annotation.model
| Python |
from __future__ import generators
from types import ClassType, FunctionType
from pypy.tool.ansi_print import ansi_log, raise_nicer_exception
from pypy.annotation import model as annmodel
from pypy.annotation.pairtype import pair
from pypy.annotation.bookkeeper import Bookkeeper, getbookkeeper
from pypy.annotation impo... | Python |
"""
Unary operations on SomeValues.
"""
from pypy.annotation.model import \
SomeObject, SomeInteger, SomeBool, SomeString, SomeChar, SomeList, \
SomeDict, SomeUnicodeCodePoint, SomeTuple, SomeImpossibleValue, \
SomeInstance, SomeBuiltin, SomeFloat, SomeIterator, SomePBC, \
SomeExternalObject, SomeT... | Python |
"""
Built-in functions.
"""
import sys
from pypy.annotation.model import SomeInteger, SomeObject, SomeChar, SomeBool
from pypy.annotation.model import SomeString, SomeTuple, SomeSlice, s_Bool
from pypy.annotation.model import SomeUnicodeCodePoint, SomeAddress
from pypy.annotation.model import SomeFloat, SomeWeakGcAddr... | Python |
"""
Type inference for user-defined classes.
"""
from __future__ import generators
from pypy.annotation.model import SomePBC, s_ImpossibleValue, unionof
from pypy.annotation.model import SomeInteger, isdegenerated, SomeTuple,\
SomeString
from pypy.annotation import description
# The main purpose of a ClassDef i... | Python |
"""
self cloning, automatic path configuration
copy this into any subdirectory of pypy from which scripts need
to be run, typically all of the test subdirs.
The idea is that any such script simply issues
import autopath
and this will make sure that the parent directory containing "pypy"
is in sys.path.
If y... | Python |
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.rpython.lltypesystem.lltype import typeOf
from pypy.objspace.flow.model import Constant
from pypy.annotation.model import unionof
from pypy.annotation.signature import annotation
import py
class genericcallable(object):
""" A way to specify the calla... | Python |
from pypy.annotation.pairtype import pairtype, pair
from pypy.objspace.flow.model import Constant
from pypy.annotation import model as annmodel
from pypy.rpython.error import TyperError
from pypy.rpython.rmodel import Repr, IteratorRepr, IntegerRepr, inputconst
from pypy.rpython.rslice import AbstractSliceRepr
from pyp... | Python |
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rlib.objectmodel import CDefinedIntSymbolic
from pypy.objspace.flow.model import Constant, Variable
from pypy.objspace.flow.model import FunctionG... | Python |
import types
import sys
from pypy.annotation.pairtype import pair, pairtype
from pypy.annotation import model as annmodel
from pypy.annotation import description
from pypy.objspace.flow.model import Constant
from pypy.rpython.lltypesystem.lltype import \
typeOf, Void, Bool, nullptr, frozendict, Ptr, Struct, malloc... | Python |
class TyperError(Exception):
def __str__(self):
result = Exception.__str__(self)
if hasattr(self, 'where'):
result += '\n.. %r\n.. %r' % self.where
return result
class MissingRTypeOperation(TyperError):
pass
| Python |
from pypy.annotation.annrpython import RPythonAnnotator
from pypy.rpython.rtyper import RPythonTyper
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.memory.support import get_address_linked_list, INT_SIZE
from pypy.rpython.memory.lladdress import raw_malloc, raw_free, NULL
from pypy.rpython.mem... | Python |
import py
from pypy.rpython.memory.lltypelayout import get_layout, get_fixed_size
from pypy.rpython.memory.lltypelayout import get_variable_size, sizeof
from pypy.rpython.memory.lltypelayout import primitive_to_fmt
from pypy.rpython.memory import lladdress
from pypy.rpython.lltypesystem import lltype, llmemory
log = ... | Python |
import weakref
from pypy.rpython.lltypesystem import lltype, llmemory
# this is global because a header cannot be a header of more than one GcObj
header2obj = weakref.WeakKeyDictionary()
class GCHeaderBuilder(object):
def __init__(self, HDR):
"""NOT_RPYTHON"""
self.HDR = HDR
self.obj2he... | Python |
from pypy.rpython.memory import lladdress, lltypelayout
from pypy.rpython.memory.lltypesimulation import simulatorptr, sizeof
from pypy.rpython.memory.lltypesimulation import nullptr, malloc
from pypy.rpython.memory.lltypesimulation import init_object_on_address
from pypy.objspace.flow.model import traverse, Link, Cons... | Python |
import struct
from pypy.rpython.memory.simulator import MemorySimulator, MemorySimulatorError
from pypy.rlib.rarithmetic import r_uint
from pypy.rpython.lltypesystem import llmemory
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.memory.lltypelayout import convert_offset_to_int
from pypy.rlib.objectmodel... | Python |
import py
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.objspace.flow.model import SpaceOperation, Variable, Constant, \
c_last_exception, checkgraph
from pypy.translator.unsimplify import insert_empty_block
from pypy.translator.unsimplify import insert_empty_startblock
from pypy.translator.unsi... | Python |
from pypy.rpython.memory.gctransform.transform import GCTransformer
from pypy.rpython.memory.gctransform.support import type_contains_pyobjs, \
get_rtti, _static_deallocator_body_for_type, LLTransformerOp, ll_call_destructor
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.lltypesystem.llop... | Python |
# calculate some statistics about the number of variables that need
# to be cared for across a call
from pypy.rpython.lltypesystem import lltype
relevant_ops = ["direct_call", "indirect_call", "malloc", "malloc_varsize"]
def filter_for_ptr(arg):
return isinstance(arg.concretetype, lltype.Ptr)
def filter_for_no... | Python |
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.annotation import model as annmodel
import os
def var_ispyobj(var):
if hasattr(var, 'concretetype'):
if isinstance(var.concretetype, lltype.Ptr):
return var.concretetype.TO._gckind == 'c... | Python |
from pypy.rpython.memory.gctransform.transform import \
MinimalGCTransformer, var_ispyobj
from pypy.rpython.memory.gctransform.framework import \
FrameworkGCTransformer
from pypy.rpython.lltypesystem import lltype, llmemory
class StacklessFrameworkMinimalGCTransformer(MinimalGCTransformer):
def gct_flavo... | Python |
import py
from pypy.rpython.memory.gctransform.transform import GCTransformer
from pypy.rpython.memory.gctransform.support import find_gc_ptrs_in_type, \
get_rtti, _static_deallocator_body_for_type, LLTransformerOp, ll_call_destructor
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.lltypes... | Python |
#
| Python |
from pypy.rpython.memory.gctransform.transform import GCTransformer, var_ispyobj
from pypy.rpython.memory.gctransform.support import find_gc_ptrs_in_type, \
get_rtti, ll_call_destructor, type_contains_pyobjs
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython import rmodel
from pypy.rpython.me... | Python |
#
| Python |
from pypy.rpython.memory.lladdress import raw_malloc, raw_free, raw_memcopy, raw_memclear
from pypy.rpython.memory.lladdress import NULL, _address, raw_malloc_usage
from pypy.rpython.memory.support import get_address_linked_list
from pypy.rpython.memory.gcheader import GCHeaderBuilder
from pypy.rpython.memory import ll... | Python |
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.memory.lltypelayout import sizeof
from pypy.rlib.objectmodel import free_non_gc_object
INT_SIZE = sizeof(lltype.Signed)
DEFAULT_CHUNK_SIZE = 1019
def get_address_linked_list(chunk_size=DEFAULT_CHUNK_SIZE, hackishpop=False):
CHUNK = lltype.... | Python |
from pypy.rpython.lltypesystem import lltype, llmemory
import struct
primitive_to_fmt = {lltype.Signed: "l",
lltype.Unsigned: "L",
lltype.Char: "c",
lltype.UniChar: "H", # maybe
lltype.Bool: ... | Python |
#
| Python |
import array
import struct
# all addresses in the simulator are just ints
# possible chars in status are:
# 'u': uninitialized
# 'i': initialized
class MemorySimulatorError(Exception):
pass
class MemoryBlock(object):
def __init__(self, baseaddress, size):
self.baseaddress = baseaddress
self... | Python |
from pypy.rpython.memory.convertlltype import FlowGraphConstantConverter
from pypy.rpython.memory.lltypesimulation import free
from pypy.rpython.memory.lltypesimulation import simulatorptr as _ptr
from pypy.rpython.memory.lltypesimulation import malloc, functionptr, nullptr
from pypy.rpython.memory.lltypesimulation imp... | Python |
#
| Python |
import operator
from pypy.annotation.pairtype import pairtype
from pypy.annotation import model as annmodel
from pypy.objspace.flow.model import Constant
from pypy.rpython.error import TyperError
from pypy.rpython.rmodel import Repr, IntegerRepr, inputconst
from pypy.rpython.rmodel import IteratorRepr
from pypy.rpython... | Python |
import sys
from pypy.annotation.pairtype import pairtype
from pypy.annotation import model as annmodel
from pypy.objspace.flow.objspace import op_appendices
from pypy.rpython.lltypesystem.lltype import Signed, Unsigned, Bool, Float, \
Void, Char, UniChar, malloc, pyobjectptr, UnsignedLongLong, \
SignedLongLon... | Python |
from pypy.annotation.pairtype import pairtype
from pypy.annotation import model as annmodel
from pypy.rpython.lltypesystem.lltype import \
Signed, Unsigned, SignedLongLong, Bool, Float, Void, pyobjectptr
from pypy.rpython.error import TyperError
from pypy.rpython.rmodel import FloatRepr
from pypy.rpython.rmodel im... | Python |
# this registry use the new interface for external functions
# all the above declarations in extfunctable should be moved here at some point.
from extfunc import register_external
# ___________________________
# math functions
import math
from pypy.rpython.lltypesystem.module import ll_math
from pypy.rpython.ootypes... | Python |
from pypy.rpython import rclass
from pypy.rpython.extfunctable import standardexceptions
from pypy.annotation import model as annmodel
class AbstractExceptionData:
"""Public information for the code generators to help with exceptions."""
standardexceptions = standardexceptions
def __init__(self, rtyper):
... | Python |
import py
import types, sys
import inspect
from pypy.objspace.flow.model import Variable, Constant, Block, Link
from pypy.objspace.flow.model import checkgraph, FunctionGraph, SpaceOperation
from pypy.annotation import model as annmodel
from pypy.annotation import description
from pypy.tool.sourcetools import has_varar... | Python |
import sys
from pypy.rlib.rarithmetic import r_longlong, r_uint, intmask
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rpython.lltypesystem.lltype import Signed
#XXX original SIGNED_RIGHT_SHIFT_ZERO_FILLS not taken into account
#XXX assuming HAVE_LONG_LONG (int_mul_ovf)
#XXX should int_mod and int_f... | Python |
from pypy.rpython.microbench.microbench import MetaBench
class str_dict__set_item:
__metaclass__ = MetaBench
def init():
return {}
args = ['obj', 'i']
def loop(obj, i):
obj['foo'] = i
obj['bar'] = i
class str_dict__get_item:
__metaclass__ = MetaBench
def init():
... | Python |
#!/usr/bin/env python
import sys
import autopath
from time import clock
from py.compat import subprocess
from pypy.translator.interactive import Translation
LOOPS = 10000000
class MetaBench(type):
def __new__(self, cls_name, bases, cls_dict):
loop = cls_dict['loop']
loop.dont_inline = True
... | Python |
from pypy.rpython.microbench.microbench import MetaBench
class list__append:
__metaclass__ = MetaBench
def init():
return []
args = ['obj', 'i']
def loop(obj, i):
obj.append(i)
class list__get_item:
__metaclass__ = MetaBench
LOOPS = 100000000
def init():
obj = [... | Python |
#!/usr/bin/env python
import sys
import autopath
from time import clock
from py.compat import subprocess
from pypy.translator.interactive import Translation
LOOPS = 10000000
class MetaBench(type):
def __new__(self, cls_name, bases, cls_dict):
loop = cls_dict['loop']
loop.dont_inline = True
... | Python |
"""
self cloning, automatic path configuration
copy this into any subdirectory of pypy from which scripts need
to be run, typically all of the test subdirs.
The idea is that any such script simply issues
import autopath
and this will make sure that the parent directory containing "pypy"
is in sys.path.
If y... | Python |
from pypy.rlib.objectmodel import r_dict
from pypy.rpython.microbench.microbench import MetaBench
class Obj:
def __init__(self, x):
self.x = x
def myhash(obj):
return obj.x
def mycmp(obj1, obj2):
return obj1.x == obj2.x
class Space:
def myhash(self, obj):
return obj.x
def mycmp(... | Python |
from pypy.rpython.microbench.microbench import MetaBench
def f1(x):
return x
def f2(x):
return x+1
def f3(x):
return x+2
def f4(x):
return x+3
FUNCS = [f1, f2, f3, f4]
class indirect__call:
__metaclass__ = MetaBench
def init():
return FUNCS
args = ['obj', 'i']
def loop(obj... | Python |
"""typesystem.py -- Typesystem-specific operations for RTyper."""
from pypy.annotation.pairtype import extendabletype
from pypy.rpython.ootypesystem import ootype
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.error import TyperError
class TypeSystem(object):
__metaclass__ = extendabletype
... | Python |
from pypy.annotation import model as annmodel
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.ootypesystem import ootype
from pypy.rpython.rmodel import Repr, HalfConcreteWrapper
from pypy.rpython.extfunctable import typetable
from pypy.rpython import rbuiltin
from pypy.rpython.module.support import init... | Python |
from pypy.annotation.pairtype import pairtype, pair
from pypy.annotation import model as annmodel
from pypy.rpython.error import TyperError
from pypy.rpython.rmodel import Repr, IntegerRepr, inputconst
from pypy.rpython.rmodel import externalvsinternal
from pypy.rpython.rlist import AbstractBaseListRepr, AbstractListRe... | Python |
import types
import sys
from pypy.annotation.pairtype import pairtype, pair
from pypy.annotation import model as annmodel
from pypy.annotation import description
from pypy.objspace.flow.model import Constant, Variable
from pypy.rpython.lltypesystem.lltype import \
typeOf, Void, ForwardReference, Struct, Bool, Char... | Python |
from pypy.rpython.error import TyperError
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.rmodel import inputconst
from pypy.rpython.lltypesystem.rclass import OBJECTPTR, InstanceRepr
from pypy.rpython.annlowlevel import cachedtype
VABLERTIPTR = OBJECTPTR
class VirtualizableInstanceRepr(Insta... | Python |
""" This file creates and maintains _cache/stdtypes.py, which
keeps information about C type sizes
"""
import py
import os
from pypy.translator.tool.cbuild import build_executable
from pypy.tool.udir import udir
def sizeof_c_type(c_typename, includes={}, compiler_exe=None):
from py.compat.subprocess import PIPE,... | Python |
# this file contains the definitions and most extremely faked
# implementations of things relating to the description of the layout
# of objects in memeory.
# sizeof, offsetof
import weakref
from pypy.rlib.objectmodel import Symbolic
from pypy.rpython.lltypesystem import lltype
class AddressOffset(Symbolic):
de... | Python |
# only for the LLInterpreter. Don't use directly.
from pypy.rpython.lltypesystem.lltype import pyobjectptr, malloc, free
from pypy.rpython.lltypesystem.llmemory import raw_malloc, raw_free
from pypy.rpython.lltypesystem.llmemory import raw_memclear, raw_memcopy
from pypy.rpython.lltypesystem.llmemory import raw_mallo... | Python |
from pypy.annotation.pairtype import pairtype
from pypy.rpython.rmodel import inputconst
from pypy.rpython.robject import PyObjRepr, pyobj_repr
from pypy.rpython.rtuple import AbstractTupleRepr, AbstractTupleIteratorRepr
from pypy.rpython.lltypesystem.lltype import \
Ptr, GcStruct, Void, Signed, malloc, typeOf, nu... | Python |
# Helper to build the lowleveltype corresponding to an RPython tuple.
# This is not in rtuple.py so that it can be imported without bringing
# the whole rtyper in.
from pypy.rpython.lltypesystem.lltype import Void, Ptr, GcStruct
def TUPLE_TYPE(field_lltypes):
if len(field_lltypes) == 0:
return Void ... | Python |
from pypy.objspace.flow.model import Constant
from pypy.rpython.rclass import getclassrepr, getinstancerepr, get_type_repr
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem.rclass import InstanceRepr, CLASSTYPE
from pypy.rpython.lltypesystem.rclass import MissingRTypeAttribute
from pypy.rpytho... | Python |
from pypy.annotation import model as annmodel
from pypy.rpython.lltypesystem import rclass
from pypy.rpython.lltypesystem.lltype import \
Array, malloc, Ptr, PyObject, pyobjectptr, \
FuncType, functionptr, Signed
from pypy.rpython.exceptiondata import AbstractExceptionData
from pypy.rpython.extfunctable impor... | Python |
import py
from pypy.rlib.rarithmetic import r_int, r_uint, intmask
from pypy.rlib.rarithmetic import r_ulonglong, r_longlong, base_int
from pypy.rlib.rarithmetic import normalizedinttype
from pypy.rlib.objectmodel import Symbolic
from pypy.tool.uid import Hashable
from pypy.tool.tls import tlsobject
from types import N... | Python |
import sys
import math
from pypy.tool.sourcetools import func_with_new_name
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.lltypesystem.lloperation import opimpls
# ____________________________________________________________
# Implementation of the 'canfold' operations
# implementations of... | Python |
from pypy.rpython.lltypesystem.lltype import GcArray, Array, Char, malloc
from pypy.rlib.rarithmetic import r_uint
CHAR_ARRAY = GcArray(Char)
def ll_int_str(repr, i):
return ll_int2dec(i)
def ll_int2dec(i):
from pypy.rpython.lltypesystem.rstr import mallocstr
temp = malloc(CHAR_ARRAY, 20)
len = 0
... | Python |
import sys
import ctypes
import ctypes.util
from pypy.rpython.lltypesystem import lltype
from pypy.tool.uid import fixid
def uaddressof(obj):
return fixid(ctypes.addressof(obj))
_ctypes_cache = {
lltype.Signed: ctypes.c_long,
lltype.Char: ctypes.c_ubyte,
}
def build_ctypes_struct(S, max_n=None):
... | Python |
import sys
import types
from pypy.annotation.pairtype import pairtype, pair
from pypy.objspace.flow.model import Constant
from pypy.rpython.error import TyperError
from pypy.rpython.rmodel import Repr, inputconst, warning, mangle
from pypy.rpython.rclass import AbstractClassRepr,\
Abstra... | Python |
from pypy.annotation.pairtype import pairtype
from pypy.annotation import model as annmodel
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem import rclass
from pypy.rpython.lltypesystem.rdict import rtype_r_dict
from pypy.rlib import objectmodel
from pypy.rpython.rmodel import TyperError, Con... | Python |
"""
The table of all LL operations.
"""
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.objspace.flow.model import roproperty
class LLOp(object):
def __init__(self, sideeffects=True, canfold=False, canraise=(),
pyobj=False, canunwindgc=False, canrun=False, oo=False,
... | Python |
from pypy.annotation.pairtype import pairtype
from pypy.annotation import model as annmodel
from pypy.objspace.flow.model import Constant
from pypy.rpython.rdict import AbstractDictRepr, AbstractDictIteratorRepr,\
rtype_newdict, dum_variant, dum_keys, dum_values, dum_items
from pypy.rpython.lltypesystem import llt... | Python |
import math
from pypy.rpython.lltypesystem import lltype, rtupletype
FREXP_RESULT = rtupletype.TUPLE_TYPE([lltype.Float, lltype.Signed]).TO
MODF_RESULT = rtupletype.TUPLE_TYPE([lltype.Float, lltype.Float]).TO
def ll_frexp_result(mantissa, exponent):
tup = lltype.malloc(FREXP_RESULT)
tup.item0 = mantissa
t... | Python |
from pypy.rlib import rarithmetic
from pypy.rpython.module.support import LLSupport
from pypy.tool.staticmethods import ClassMethods
class Implementation:
def ll_strtod_formatd(fmt, x):
return LLSupport.to_rstr(rarithmetic.formatd(LLSupport.from_rstr(fmt), x))
ll_strtod_formatd.suggested_primitive = Tr... | Python |
from pypy.rpython.module.support import LLSupport
from pypy.rpython.module.ll_os_path import BaseOsPath
class Implementation(BaseOsPath, LLSupport):
pass
| Python |
import os, errno
from pypy.rpython.module.support import LLSupport
from pypy.rpython.module.support import ll_strcpy
from pypy.rpython.module.ll_os import BaseOS
from pypy.rpython.lltypesystem import lltype, rtupletype
from pypy.rlib.rarithmetic import intmask
STAT_RESULT = rtupletype.TUPLE_TYPE([lltype.Signed]*10).TO... | Python |
from pypy.rpython.rslice import AbstractSliceRepr
from pypy.rpython.lltypesystem.lltype import \
GcStruct, Signed, Ptr, Void, malloc, PyObject, nullptr
from pypy.annotation.pairtype import pairtype
from pypy.rpython.robject import PyObjRepr, pyobj_repr
from pypy.rpython.rmodel import inputconst, PyObjPtr, IntegerR... | Python |
from pypy.rpython.lltypesystem.lltype import Ptr, GcStruct, Signed, malloc, Void
from pypy.rpython.rrange import AbstractRangeRepr, AbstractRangeIteratorRepr
# ____________________________________________________________
#
# Concrete implementation of RPython lists that are returned by range()
# and never mutated af... | Python |
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.annotation.model import lltype_to_annotation
from pypy.rlib.objectmodel import Symbolic, CDefinedIntSymbolic
from pypy.rlib import rarithmetic
class CConstant(Symbolic):
""" A C-level constant, maybe #def... | Python |
from weakref import WeakValueDictionary
from pypy.annotation.pairtype import pairtype
from pypy.rpython.error import TyperError
from pypy.rlib.objectmodel import malloc_zero_filled, we_are_translated
from pypy.rlib.objectmodel import debug_assert
from pypy.rpython.robject import PyObjRepr, pyobj_repr
from pypy.rlib.rar... | Python |
from pypy.rpython.rgeneric import AbstractGenericCallableRepr
from pypy.rpython.lltypesystem.lltype import Ptr, FuncType
class GenericCallableRepr(AbstractGenericCallableRepr):
def create_low_leveltype(self):
l_args = [r_arg.lowleveltype for r_arg in self.args_r]
l_retval = self.r_result.lowlevelt... | Python |
from pypy.interpreter.argument import Arguments, ArgErr
from pypy.annotation import model as annmodel
from pypy.rpython import rtuple
from pypy.rpython.error import TyperError
from pypy.rpython.lltypesystem import lltype
class CallPatternTooComplex(TyperError):
pass
def getrinputs(rtyper, graph):
"""Return t... | Python |
from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry
from pypy.annotation.model import SomeString
from ctypes import c_char_p
class CallEntry(CTypesCallEntry):
"Annotation and rtyping of calls to c_char_p."
_about_ = c_char_p
def specialize_call(self, hop):
string_repr... | Python |
from pypy.objspace.flow.model import Constant
from pypy.annotation.pairtype import pairtype
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.rmodel import Repr, IntegerRepr, inputconst
from pypy.rpython.error import TyperError
from pypy.rpython.rbuiltin import BuiltinFunctionRepr
class TypeRepr(BuiltinF... | Python |
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry
from pypy.annotation.model import SomeCTypesObject
from pypy.rpython.lltypesystem import lltype
from ctypes import pointer, POINTER, byref, c_int
PointerType = type(POINTER(c_int))
c... | Python |
from pypy.rpython.lltypesystem import lltype
from pypy.annotation.pairtype import pairtype
from pypy.rpython.rmodel import IntegerRepr, inputconst
from pypy.rpython.rctypes.rmodel import CTypesRefRepr
from pypy.objspace.flow.model import Constant
from pypy.rpython.rslice import AbstractSliceRepr
from pypy.rpython.lltyp... | Python |
from ctypes import Structure, Union
from pypy.annotation.model import SomeCTypesObject, SomeInteger
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry
from pypy.rpython.lltypesystem import lltype
StructType = type(Structure)
UnionType =... | Python |
"""
Helpers to access the C-level 'errno' variable.
"""
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.annotation import model as annmodel
from ctypes import pythonapi, py_object
##def setfromerrno(exc=OSError):
## """Raise an exception of the given class with the last failed C library
## funct... | Python |
from pypy.annotation.model import SomeCTypesObject
from pypy.annotation import model as annmodel
from pypy.annotation.pairtype import pairtype
from pypy.rpython.error import TyperError
from pypy.rpython.rctypes.implementation import CTypesEntry
from pypy.rpython.lltypesystem import lltype
import ctypes
CFuncPtrType ... | Python |
from ctypes import ARRAY, c_int
from pypy.rpython.error import TyperError
from pypy.rpython.lltypesystem.rstr import string_repr, emptystr
from pypy.rpython.rmodel import IntegerRepr, inputconst
from pypy.rpython.rslice import AbstractSliceRepr
from pypy.rpython.lltypesystem import lltype
from pypy.annotation.pairtype ... | Python |
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry
from pypy.annotation.model import SomeInteger, SomeCTypesObject
from ctypes import c_void_p, c_int, POINTER, cast, c_char, c_char_p
from pypy.rpython.rctypes.astringbuf import StringBuf... | Python |
from pypy.rpython.rmodel import Repr, inputconst
from pypy.rpython.error import TyperError
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.annotation.model import SomeCTypesObject
from pypy.annotation.pairtype import pairtype
class CTypesRepr(Repr):
"Base class for the Reprs representing ctypes o... | Python |
from pypy.rpython.rmodel import inputconst
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem.rstr import CharRepr, UniCharRepr
from pypy.annotation.pairtype import pairtype
from pypy.rpython.rmodel import IntegerRepr, FloatRepr
from pypy.rpython.error import TyperError
from pypy.rpython.rctype... | Python |
from pypy.rpython.rmodel import inputconst
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.rstr import AbstractStringRepr
from pypy.rpython.lltypesystem.rstr import string_repr
from pypy.rpython.rctypes.rmodel import CTypesValueRepr, C_ZERO
from pypy.rpython.rctypes.rarray import ArrayRepr
from pypy.rpyt... | Python |
from pypy.rpython.rmodel import inputconst
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.rctypes.rmodel import CTypesRefRepr, CTypesValueRepr
from pypy.rpython.rctypes.rmodel import genreccopy_structfield, reccopy
from pypy.rpython.rctypes.rprimitive import PrimitiveRepr
from pypy.annotation.model impo... | Python |
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.rpython.rctypes.implementation import CTypesObjEntry
from pypy.annotation.model import SomeCTypesObject, SomeString, SomeInteger
from pypy.rlib.rarithmetic import r_uint
from ctypes import create_string_buffer, c_char, sizeof
#############################... | Python |
from pypy.rpython.rmodel import IntegerRepr, inputconst
from pypy.rpython.error import TyperError
from pypy.rpython.lltypesystem import lltype
from pypy.annotation.pairtype import pairtype
from pypy.rpython.rctypes.rmodel import CTypesValueRepr, genreccopy
from pypy.annotation.model import SomeCTypesObject
from pypy.ob... | Python |
from pypy.annotation.pairtype import pairtype
from pypy.rpython.rmodel import inputconst
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.rctypes.rmodel import CTypesValueRepr
from pypy.rpython.robject import PyObjRepr, pyobj_repr
from pypy.rpython import extregistry
class CTypesPyObjRepr(CTypesValueRep... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.