id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
9,301 | column | def column(self) -> int:
return self.begin[1] | python | Tools/cases_generator/lexer.py | 258 | 259 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,302 | end_line | def end_line(self) -> int:
return self.end[0] | python | Tools/cases_generator/lexer.py | 262 | 263 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,303 | end_column | def end_column(self) -> int:
return self.end[1] | python | Tools/cases_generator/lexer.py | 266 | 267 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,304 | width | def width(self) -> int:
return self.end[1] - self.begin[1] | python | Tools/cases_generator/lexer.py | 270 | 271 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,305 | replaceText | def replaceText(self, txt: str) -> "Token":
assert isinstance(txt, str)
return Token(self.filename, self.kind, txt, self.begin, self.end) | python | Tools/cases_generator/lexer.py | 273 | 275 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,306 | __repr__ | def __repr__(self) -> str:
b0, b1 = self.begin
e0, e1 = self.end
if b0 == e0:
return f"{self.kind}({self.text!r}, {b0}:{b1}:{e1})"
else:
return f"{self.kind}({self.text!r}, {b0}:{b1}, {e0}:{e1})" | python | Tools/cases_generator/lexer.py | 277 | 283 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,307 | tokenize | def tokenize(src: str, line: int = 1, filename: str = "") -> Iterator[Token]:
linestart = -1
for m in matcher.finditer(src):
start, end = m.span()
text = m.group(0)
if text in keywords:
kind = keywords[text]
elif text in annotations:
kind = ANNOTATION
... | python | Tools/cases_generator/lexer.py | 286 | 339 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,308 | to_text | def to_text(tkns: list[Token], dedent: int = 0) -> str:
res: list[str] = []
line, col = -1, 1 + dedent
for tkn in tkns:
if line == -1:
line, _ = tkn.begin
l, c = tkn.begin
# assert(l >= line), (line, txt, start, end)
while l > line:
line += 1
... | python | Tools/cases_generator/lexer.py | 342 | 362 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,309 | get_specialized | def get_specialized(analysis: Analysis) -> set[str]:
specialized: set[str] = set()
for family in analysis.families.values():
for member in family.members:
specialized.add(member.name)
return specialized | python | Tools/cases_generator/py_metadata_generator.py | 26 | 31 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,310 | generate_specializations | def generate_specializations(analysis: Analysis, out: CWriter) -> None:
out.emit("_specializations = {\n")
for family in analysis.families.values():
out.emit(f'"{family.name}": [\n')
for member in family.members:
out.emit(f' "{member.name}",\n')
out.emit("],\n")
out.em... | python | Tools/cases_generator/py_metadata_generator.py | 34 | 41 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,311 | generate_specialized_opmap | def generate_specialized_opmap(analysis: Analysis, out: CWriter) -> None:
out.emit("_specialized_opmap = {\n")
names = []
for family in analysis.families.values():
for member in family.members:
if member.name == family.name:
continue
names.append(member.name)
... | python | Tools/cases_generator/py_metadata_generator.py | 44 | 54 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,312 | generate_opmap | def generate_opmap(analysis: Analysis, out: CWriter) -> None:
specialized = get_specialized(analysis)
out.emit("opmap = {\n")
for inst, op in analysis.opmap.items():
if inst not in specialized:
out.emit(f"'{inst}': {analysis.opmap[inst]},\n")
out.emit("}\n\n") | python | Tools/cases_generator/py_metadata_generator.py | 57 | 63 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,313 | generate_py_metadata | def generate_py_metadata(
filenames: list[str], analysis: Analysis, outfile: TextIO
) -> None:
write_header(__file__, filenames, outfile, "#")
out = CWriter(outfile, 0, False)
generate_specializations(analysis, out)
generate_specialized_opmap(analysis, out)
generate_opmap(analysis, out)
out.... | python | Tools/cases_generator/py_metadata_generator.py | 66 | 75 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,314 | write_opcode_targets | def write_opcode_targets(analysis: Analysis, out: CWriter) -> None:
"""Write header file that defines the jump target table"""
targets = ["&&_unknown_opcode,\n"] * 256
for name, op in analysis.opmap.items():
if op < 256:
targets[op] = f"&&TARGET_{name},\n"
out.emit("static void *opco... | python | Tools/cases_generator/target_generator.py | 23 | 32 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,315 | declare_variable | def declare_variable(
var: StackItem, uop: Uop, variables: set[str], out: CWriter
) -> None:
if var.name in variables:
return
type = var.type if var.type else "PyObject *"
variables.add(var.name)
if var.condition:
out.emit(f"{type}{var.name} = NULL;\n")
if uop.replicates:
... | python | Tools/cases_generator/tier2_generator.py | 36 | 50 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,316 | declare_variables | def declare_variables(uop: Uop, out: CWriter) -> None:
variables = {"unused"}
for var in reversed(uop.stack.inputs):
declare_variable(var, uop, variables, out)
for var in uop.stack.outputs:
declare_variable(var, uop, variables, out) | python | Tools/cases_generator/tier2_generator.py | 53 | 58 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,317 | tier2_replace_error | def tier2_replace_error(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
stack: Stack,
inst: Instruction | None,
) -> None:
out.emit_at("if ", tkn)
out.emit(next(tkn_iter))
emit_to(out, tkn_iter, "COMMA")
label = next(tkn_iter).text
next(tkn_iter) # RPAREN
... | python | Tools/cases_generator/tier2_generator.py | 61 | 75 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,318 | tier2_replace_error_no_pop | def tier2_replace_error_no_pop(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
stack: Stack,
inst: Instruction | None,
) -> None:
next(tkn_iter) # LPAREN
next(tkn_iter) # RPAREN
next(tkn_iter) # Semi colon
out.emit_at("JUMP_TO_ERROR();", tkn) | python | Tools/cases_generator/tier2_generator.py | 78 | 89 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,319 | tier2_replace_deopt | def tier2_replace_deopt(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
unused: Stack,
inst: Instruction | None,
) -> None:
out.emit_at("if ", tkn)
out.emit(next(tkn_iter))
emit_to(out, tkn_iter, "RPAREN")
next(tkn_iter) # Semi colon
out.emit(") {\n")
out... | python | Tools/cases_generator/tier2_generator.py | 91 | 106 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,320 | tier2_replace_exit_if | def tier2_replace_exit_if(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
unused: Stack,
inst: Instruction | None,
) -> None:
out.emit_at("if ", tkn)
out.emit(next(tkn_iter))
emit_to(out, tkn_iter, "RPAREN")
next(tkn_iter) # Semi colon
out.emit(") {\n")
o... | python | Tools/cases_generator/tier2_generator.py | 109 | 124 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,321 | tier2_replace_oparg | def tier2_replace_oparg(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
unused: Stack,
inst: Instruction | None,
) -> None:
if not uop.name.endswith("_0") and not uop.name.endswith("_1"):
out.emit(tkn)
return
amp = next(tkn_iter)
if amp.text != "&":
... | python | Tools/cases_generator/tier2_generator.py | 127 | 145 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,322 | write_uop | def write_uop(uop: Uop, out: CWriter, stack: Stack) -> None:
try:
out.start_line()
if uop.properties.oparg:
out.emit("oparg = CURRENT_OPARG();\n")
assert uop.properties.const_oparg < 0
elif uop.properties.const_oparg >= 0:
out.emit(f"oparg = {uop.propertie... | python | Tools/cases_generator/tier2_generator.py | 156 | 183 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,323 | generate_tier2 | def generate_tier2(
filenames: list[str], analysis: Analysis, outfile: TextIO, lines: bool
) -> None:
write_header(__file__, filenames, outfile)
outfile.write(
"""
#ifdef TIER_ONE
#error "This file is for Tier 2 only"
#endif
#define TIER_TWO 2
"""
)
out = CWriter(outfile, 2, lines)
o... | python | Tools/cases_generator/tier2_generator.py | 189 | 228 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,324 | validate_uop | def validate_uop(override: Uop, uop: Uop) -> None:
# To do
pass | python | Tools/cases_generator/optimizer_generator.py | 33 | 35 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,325 | type_name | def type_name(var: StackItem) -> str:
if var.is_array():
return f"_Py_UopsSymbol **"
if var.type:
return var.type
return f"_Py_UopsSymbol *" | python | Tools/cases_generator/optimizer_generator.py | 38 | 43 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,326 | declare_variables | def declare_variables(uop: Uop, out: CWriter, skip_inputs: bool) -> None:
variables = {"unused"}
if not skip_inputs:
for var in reversed(uop.stack.inputs):
if var.name not in variables:
variables.add(var.name)
if var.condition:
out.emit(f"{... | python | Tools/cases_generator/optimizer_generator.py | 46 | 64 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,327 | decref_inputs | def decref_inputs(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
stack: Stack,
inst: Instruction | None,
) -> None:
next(tkn_iter)
next(tkn_iter)
next(tkn_iter)
out.emit_at("", tkn) | python | Tools/cases_generator/optimizer_generator.py | 67 | 78 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,328 | emit_default | def emit_default(out: CWriter, uop: Uop) -> None:
for i, var in enumerate(uop.stack.outputs):
if var.name != "unused" and not var.peek:
if var.is_array():
out.emit(f"for (int _i = {var.size}; --_i >= 0;) {{\n")
out.emit(f"{var.name}[_i] = sym_new_not_null(ctx);\n"... | python | Tools/cases_generator/optimizer_generator.py | 81 | 94 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,329 | write_uop | def write_uop(
override: Uop | None,
uop: Uop,
out: CWriter,
stack: Stack,
debug: bool,
skip_inputs: bool,
) -> None:
try:
prototype = override if override else uop
is_override = override is not None
out.start_line()
for var in reversed(prototype.stack.inputs)... | python | Tools/cases_generator/optimizer_generator.py | 97 | 149 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,330 | generate_abstract_interpreter | def generate_abstract_interpreter(
filenames: list[str],
abstract: Analysis,
base: Analysis,
outfile: TextIO,
debug: bool,
) -> None:
write_header(__file__, filenames, outfile)
out = CWriter(outfile, 2, False)
out.emit("\n")
base_uop_names = set([uop.name for uop in base.uops.values(... | python | Tools/cases_generator/optimizer_generator.py | 155 | 194 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,331 | generate_tier2_abstract_from_files | def generate_tier2_abstract_from_files(
filenames: list[str], outfilename: str, debug: bool=False
) -> None:
assert len(filenames) == 2, "Need a base file and an abstract cases file."
base = analyze_files([filenames[0]])
abstract = analyze_files([filenames[1]])
with open(outfilename, "w") as outfile... | python | Tools/cases_generator/optimizer_generator.py | 197 | 204 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,332 | _compute_digest | def _compute_digest(self, out: pathlib.Path) -> str:
hasher = hashlib.sha256()
hasher.update(self.triple.encode())
hasher.update(self.debug.to_bytes())
# These dependencies are also reflected in _JITSources in regen.targets:
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
... | python | Tools/jit/_targets.py | 48 | 58 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,333 | _parse | async def _parse(self, path: pathlib.Path) -> _stencils.StencilGroup:
group = _stencils.StencilGroup()
args = ["--disassemble", "--reloc", f"{path}"]
output = await _llvm.maybe_run("llvm-objdump", args, echo=self.verbose)
if output is not None:
group.code.disassembly.extend(
... | python | Tools/jit/_targets.py | 60 | 99 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,334 | _handle_section | def _handle_section(self, section: _S, group: _stencils.StencilGroup) -> None:
raise NotImplementedError(type(self)) | python | Tools/jit/_targets.py | 101 | 102 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,335 | _handle_relocation | def _handle_relocation(
self, base: int, relocation: _R, raw: bytes
) -> _stencils.Hole:
raise NotImplementedError(type(self)) | python | Tools/jit/_targets.py | 104 | 107 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,336 | _compile | async def _compile(
self, opname: str, c: pathlib.Path, tempdir: pathlib.Path
) -> _stencils.StencilGroup:
# "Compile" the trampoline to an empty stencil group if it's not needed:
if opname == "trampoline" and not self.ghccc:
return _stencils.StencilGroup()
o = tempdir / ... | python | Tools/jit/_targets.py | 109 | 181 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,337 | _build_stencils | async def _build_stencils(self) -> dict[str, _stencils.StencilGroup]:
generated_cases = PYTHON_EXECUTOR_CASES_C_H.read_text()
opnames = sorted(re.findall(r"\n {8}case (\w+): \{\n", generated_cases))
tasks = []
with tempfile.TemporaryDirectory() as tempdir:
work = pathlib.Path... | python | Tools/jit/_targets.py | 183 | 195 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,338 | build | def build(
self, out: pathlib.Path, *, comment: str = "", force: bool = False
) -> None:
"""Build jit_stencils.h in the given directory."""
if not self.stable:
warning = f"JIT support for {self.triple} is still experimental!"
request = "Please report any issues you en... | python | Tools/jit/_targets.py | 197 | 221 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,339 | _handle_section | def _handle_section(
self, section: _schema.COFFSection, group: _stencils.StencilGroup
) -> None:
flags = {flag["Name"] for flag in section["Characteristics"]["Flags"]}
if "SectionData" in section:
section_data_bytes = section["SectionData"]["Bytes"]
else:
# Z... | python | Tools/jit/_targets.py | 227 | 257 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,340 | _unwrap_dllimport | def _unwrap_dllimport(self, name: str) -> tuple[_stencils.HoleValue, str | None]:
if name.startswith("__imp_"):
name = name.removeprefix("__imp_")
name = name.removeprefix(self.prefix)
return _stencils.HoleValue.GOT, name
name = name.removeprefix(self.prefix)
... | python | Tools/jit/_targets.py | 259 | 265 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,341 | _handle_relocation | def _handle_relocation(
self, base: int, relocation: _schema.COFFRelocation, raw: bytes
) -> _stencils.Hole:
match relocation:
case {
"Offset": offset,
"Symbol": s,
"Type": {"Name": "IMAGE_REL_I386_DIR32" as kind},
}:
... | python | Tools/jit/_targets.py | 267 | 306 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,342 | _handle_section | def _handle_section(
self, section: _schema.ELFSection, group: _stencils.StencilGroup
) -> None:
section_type = section["Type"]["Name"]
flags = {flag["Name"] for flag in section["Flags"]["Flags"]}
if section_type == "SHT_RELA":
assert "SHF_INFO_LINK" in flags, flags
... | python | Tools/jit/_targets.py | 312 | 355 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,343 | _handle_relocation | def _handle_relocation(
self, base: int, relocation: _schema.ELFRelocation, raw: bytes
) -> _stencils.Hole:
symbol: str | None
match relocation:
case {
"Addend": addend,
"Offset": offset,
"Symbol": {"Name": s},
"Type... | python | Tools/jit/_targets.py | 357 | 388 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,344 | _handle_section | def _handle_section(
self, section: _schema.MachOSection, group: _stencils.StencilGroup
) -> None:
assert section["Address"] >= len(group.code.body)
assert "SectionData" in section
flags = {flag["Name"] for flag in section["Attributes"]["Flags"]}
name = section["Name"]["Value... | python | Tools/jit/_targets.py | 394 | 431 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,345 | _handle_relocation | def _handle_relocation(
self, base: int, relocation: _schema.MachORelocation, raw: bytes
) -> _stencils.Hole:
symbol: str | None
match relocation:
case {
"Offset": offset,
"Symbol": {"Name": s},
"Type": {
"Name":... | python | Tools/jit/_targets.py | 433 | 491 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,346 | get_target | def get_target(host: str) -> _COFF | _ELF | _MachO:
"""Build a _Target for the given host "triple" and options."""
# ghccc currently crashes Clang when combined with musttail on aarch64. :(
target: _COFF | _ELF | _MachO
if re.fullmatch(r"aarch64-apple-darwin.*", host):
target = _MachO(host, alig... | python | Tools/jit/_targets.py | 494 | 519 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,347 | _dump_footer | def _dump_footer(groups: dict[str, _stencils.StencilGroup]) -> typing.Iterator[str]:
yield "typedef struct {"
yield " void (*emit)("
yield " unsigned char *code, unsigned char *data, _PyExecutorObject *executor,"
yield " const _PyUOpInstruction *instruction, uintptr_t instruction_starts... | python | Tools/jit/_writer.py | 9 | 25 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,348 | _dump_stencil | def _dump_stencil(opname: str, group: _stencils.StencilGroup) -> typing.Iterator[str]:
yield "void"
yield f"emit_{opname}("
yield " unsigned char *code, unsigned char *data, _PyExecutorObject *executor,"
yield " const _PyUOpInstruction *instruction, uintptr_t instruction_starts[])"
yield "{"
... | python | Tools/jit/_writer.py | 28 | 58 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,349 | dump | def dump(groups: dict[str, _stencils.StencilGroup]) -> typing.Iterator[str]:
"""Yield a JIT compiler line-by-line as a C header file."""
for opname, group in sorted(groups.items()):
yield from _dump_stencil(opname, group)
yield from _dump_footer(groups) | python | Tools/jit/_writer.py | 61 | 65 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,350 | _async_cache | def _async_cache(f: _C[_P, _R]) -> _C[_P, _R]:
cache = {}
lock = asyncio.Lock()
@functools.wraps(f)
async def wrapper(
*args: _P.args, **kwargs: _P.kwargs # pylint: disable = no-member
) -> _R:
async with lock:
if args not in cache:
cache[args] = await f... | python | Tools/jit/_llvm.py | 19 | 32 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,351 | wrapper | async def wrapper(
*args: _P.args, **kwargs: _P.kwargs # pylint: disable = no-member
) -> _R:
async with lock:
if args not in cache:
cache[args] = await f(*args, **kwargs)
return cache[args] | python | Tools/jit/_llvm.py | 24 | 30 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,352 | _run | async def _run(tool: str, args: typing.Iterable[str], echo: bool = False) -> str | None:
command = [tool, *args]
async with _CORES:
if echo:
print(shlex.join(command))
try:
process = await asyncio.create_subprocess_exec(
*command, stdout=subprocess.PIPE
... | python | Tools/jit/_llvm.py | 38 | 52 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,353 | _check_tool_version | async def _check_tool_version(name: str, *, echo: bool = False) -> bool:
output = await _run(name, ["--version"], echo=echo)
return bool(output and _LLVM_VERSION_PATTERN.search(output)) | python | Tools/jit/_llvm.py | 56 | 58 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,354 | _get_brew_llvm_prefix | async def _get_brew_llvm_prefix(*, echo: bool = False) -> str | None:
output = await _run("brew", ["--prefix", f"llvm@{_LLVM_VERSION}"], echo=echo)
return output and output.removesuffix("\n") | python | Tools/jit/_llvm.py | 62 | 64 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,355 | _find_tool | async def _find_tool(tool: str, *, echo: bool = False) -> str | None:
# Unversioned executables:
path = tool
if await _check_tool_version(path, echo=echo):
return path
# Versioned executables:
path = f"{tool}-{_LLVM_VERSION}"
if await _check_tool_version(path, echo=echo):
return ... | python | Tools/jit/_llvm.py | 68 | 84 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,356 | maybe_run | async def maybe_run(
tool: str, args: typing.Iterable[str], echo: bool = False
) -> str | None:
"""Run an LLVM tool if it can be found. Otherwise, return None."""
path = await _find_tool(tool, echo=echo)
return path and await _run(path, args, echo=echo) | python | Tools/jit/_llvm.py | 87 | 92 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,357 | run | async def run(tool: str, args: typing.Iterable[str], echo: bool = False) -> str:
"""Run an LLVM tool if it can be found. Otherwise, raise RuntimeError."""
output = await maybe_run(tool, args, echo=echo)
if output is None:
raise RuntimeError(f"Can't find {tool}-{_LLVM_VERSION}!")
return output | python | Tools/jit/_llvm.py | 95 | 100 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,358 | __post_init__ | def __post_init__(self) -> None:
self.func = _PATCH_FUNCS[self.kind] | python | Tools/jit/_stencils.py | 138 | 139 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,359 | fold | def fold(self, other: typing.Self) -> typing.Self | None:
"""Combine two holes into a single hole, if possible."""
if (
self.offset + 4 == other.offset
and self.value == other.value
and self.symbol == other.symbol
and self.addend == other.addend
... | python | Tools/jit/_stencils.py | 141 | 156 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,360 | as_c | def as_c(self, where: str) -> str:
"""Dump this hole as a call to a patch_* function."""
location = f"{where} + {self.offset:#x}"
value = _HOLE_EXPRS[self.value]
if self.symbol:
if value:
value += " + "
value += f"(uintptr_t)&{self.symbol}"
... | python | Tools/jit/_stencils.py | 158 | 170 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,361 | pad | def pad(self, alignment: int) -> None:
"""Pad the stencil to the given alignment."""
offset = len(self.body)
padding = -offset % alignment
self.disassembly.append(f"{offset:x}: {' '.join(['00'] * padding)}")
self.body.extend([0] * padding) | python | Tools/jit/_stencils.py | 185 | 190 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,362 | emit_aarch64_trampoline | def emit_aarch64_trampoline(self, hole: Hole) -> None:
"""Even with the large code model, AArch64 Linux insists on 28-bit jumps."""
base = len(self.body)
where = slice(hole.offset, hole.offset + 4)
instruction = int.from_bytes(self.body[where], sys.byteorder)
instruction &= 0xFC0... | python | Tools/jit/_stencils.py | 192 | 227 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,363 | remove_jump | def remove_jump(self, *, alignment: int = 1) -> None:
"""Remove a zero-length continuation jump, if it exists."""
hole = max(self.holes, key=lambda hole: hole.offset)
match hole:
case Hole(
offset=offset,
kind="IMAGE_REL_AMD64_REL32",
v... | python | Tools/jit/_stencils.py | 229 | 277 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,364 | process_relocations | def process_relocations(self, *, alignment: int = 1) -> None:
"""Fix up all GOT and internal relocations for this stencil group."""
for hole in self.code.holes.copy():
if (
hole.kind
in {"R_AARCH64_CALL26", "R_AARCH64_JUMP26", "ARM64_RELOC_BRANCH26"}
... | python | Tools/jit/_stencils.py | 295 | 329 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,365 | _global_offset_table_lookup | def _global_offset_table_lookup(self, symbol: str) -> int:
return len(self.data.body) + self._got.setdefault(symbol, 8 * len(self._got)) | python | Tools/jit/_stencils.py | 331 | 332 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,366 | _emit_global_offset_table | def _emit_global_offset_table(self) -> None:
got = len(self.data.body)
for s, offset in self._got.items():
if s in self.symbols:
value, addend = self.symbols[s]
symbol = None
else:
value, symbol = symbol_to_value(s)
... | python | Tools/jit/_stencils.py | 334 | 358 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,367 | as_c | def as_c(self, opname: str) -> str:
"""Dump this hole as a StencilGroup initializer."""
return f"{{emit_{opname}, {len(self.code.body)}, {len(self.data.body)}}}" | python | Tools/jit/_stencils.py | 360 | 362 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,368 | symbol_to_value | def symbol_to_value(symbol: str) -> tuple[HoleValue, str | None]:
"""
Convert a symbol name to a HoleValue and a symbol name.
Some symbols (starting with "_JIT_") are special and are converted to their
own HoleValues.
"""
if symbol.startswith("_JIT_"):
try:
return HoleValue[... | python | Tools/jit/_stencils.py | 365 | 377 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,369 | _signed | def _signed(value: int) -> int:
value %= 1 << 64
if value & (1 << 63):
value -= 1 << 64
return value | python | Tools/jit/_stencils.py | 380 | 384 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,370 | main | def main():
outofdate = False
for project, version in ensurepip._PROJECTS:
data = json.loads(urllib.request.urlopen(
"https://pypi.org/pypi/{}/json".format(project),
cadefault=True,
).read().decode("utf8"))
upstream_version = data["info"]["version"]
if v... | python | Tools/scripts/checkpip.py | 12 | 28 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,371 | read | def read(fileiter, pat, whilematch):
for line in fileiter:
if bool(pat.match(line)) == whilematch:
yield line
else:
break | python | Tools/scripts/combinerefs.py | 81 | 86 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,372 | combinefile | def combinefile(f):
fi = iter(f)
for line in read(fi, re.compile(r'^Remaining objects:$'), False):
pass
crack = re.compile(r'([a-zA-Z\d]+) \[(\d+)\] (.*)')
addr2rc = {}
addr2guts = {}
before = 0
for line in read(fi, re.compile(r'^Remaining object addresses:$'), False):
m = ... | python | Tools/scripts/combinerefs.py | 88 | 122 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,373 | combine | def combine(fname):
with open(fname) as f:
combinefile(f) | python | Tools/scripts/combinerefs.py | 124 | 126 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,374 | m | def m(self):
pass | python | Tools/scripts/var_access_benchmark.py | 14 | 15 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,375 | __init__ | def __init__(self, x):
self.x = x | python | Tools/scripts/var_access_benchmark.py | 19 | 20 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,376 | __init__ | def __init__(self, x):
self.x = x | python | Tools/scripts/var_access_benchmark.py | 23 | 24 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,377 | read_local | def read_local(trials=trials):
v_local = 1
for t in trials:
v_local; v_local; v_local; v_local; v_local
v_local; v_local; v_local; v_local; v_local
v_local; v_local; v_local; v_local; v_local
v_local; v_local; v_local; v_local; v_lo... | python | Tools/scripts/var_access_benchmark.py | 26 | 33 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,378 | make_nonlocal_reader | def make_nonlocal_reader():
v_nonlocal = 1
def inner(trials=trials):
for t in trials:
v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal
v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal
v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal
... | python | Tools/scripts/var_access_benchmark.py | 35 | 45 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,379 | inner | def inner(trials=trials):
for t in trials:
v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal
v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal
v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal; v_nonlocal
v_nonlocal; v_nonlocal; v_nonlocal; v_nonloc... | python | Tools/scripts/var_access_benchmark.py | 37 | 43 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,380 | read_global | def read_global(trials=trials):
for t in trials:
v_global; v_global; v_global; v_global; v_global
v_global; v_global; v_global; v_global; v_global
v_global; v_global; v_global; v_global; v_global
v_global; v_global; v_global; v_global; v_global
v_global; v_global; v_global; v... | python | Tools/scripts/var_access_benchmark.py | 50 | 56 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,381 | read_builtin | def read_builtin(trials=trials):
for t in trials:
oct; oct; oct; oct; oct
oct; oct; oct; oct; oct
oct; oct; oct; oct; oct
oct; oct; oct; oct; oct
oct; oct; oct; oct; oct | python | Tools/scripts/var_access_benchmark.py | 58 | 64 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,382 | read_classvar_from_class | def read_classvar_from_class(trials=trials, A=A):
A.x = 1
for t in trials:
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x | python | Tools/scripts/var_access_benchmark.py | 66 | 73 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,383 | read_classvar_from_instance | def read_classvar_from_instance(trials=trials, A=A):
A.x = 1
a = A()
for t in trials:
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x | python | Tools/scripts/var_access_benchmark.py | 75 | 83 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,384 | read_instancevar | def read_instancevar(trials=trials, a=C(1)):
for t in trials:
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x | python | Tools/scripts/var_access_benchmark.py | 85 | 91 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,385 | read_instancevar_slots | def read_instancevar_slots(trials=trials, a=B(1)):
for t in trials:
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x | python | Tools/scripts/var_access_benchmark.py | 93 | 99 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,386 | read_namedtuple | def read_namedtuple(trials=trials, D=namedtuple('D', ['x'])):
a = D(1)
for t in trials:
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x | python | Tools/scripts/var_access_benchmark.py | 101 | 108 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,387 | read_boundmethod | def read_boundmethod(trials=trials, a=A()):
for t in trials:
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m | python | Tools/scripts/var_access_benchmark.py | 110 | 116 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,388 | write_local | def write_local(trials=trials):
v_local = 1
for t in trials:
v_local = 1; v_local = 1; v_local = 1; v_local = 1; v_local = 1
v_local = 1; v_local = 1; v_local = 1; v_local = 1; v_local = 1
v_local = 1; v_local = 1; v_local = 1; v_local = 1; v_local = 1
v_local = 1; v_local = 1; v... | python | Tools/scripts/var_access_benchmark.py | 118 | 125 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,389 | make_nonlocal_writer | def make_nonlocal_writer():
v_nonlocal = 1
def inner(trials=trials):
nonlocal v_nonlocal
for t in trials:
v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1
v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1
... | python | Tools/scripts/var_access_benchmark.py | 127 | 138 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,390 | inner | def inner(trials=trials):
nonlocal v_nonlocal
for t in trials:
v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1
v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1
v_nonlocal = 1; v_nonlocal = 1; v_nonlocal = 1;... | python | Tools/scripts/var_access_benchmark.py | 129 | 136 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,391 | write_global | def write_global(trials=trials):
global v_global
for t in trials:
v_global = 1; v_global = 1; v_global = 1; v_global = 1; v_global = 1
v_global = 1; v_global = 1; v_global = 1; v_global = 1; v_global = 1
v_global = 1; v_global = 1; v_global = 1; v_global = 1; v_global = 1
v_globa... | python | Tools/scripts/var_access_benchmark.py | 142 | 149 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,392 | write_classvar | def write_classvar(trials=trials, A=A):
for t in trials:
A.x = 1; A.x = 1; A.x = 1; A.x = 1; A.x = 1
A.x = 1; A.x = 1; A.x = 1; A.x = 1; A.x = 1
A.x = 1; A.x = 1; A.x = 1; A.x = 1; A.x = 1
A.x = 1; A.x = 1; A.x = 1; A.x = 1; A.x = 1
... | python | Tools/scripts/var_access_benchmark.py | 151 | 157 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,393 | write_instancevar | def write_instancevar(trials=trials, a=C(1)):
for t in trials:
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x =... | python | Tools/scripts/var_access_benchmark.py | 159 | 165 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,394 | write_instancevar_slots | def write_instancevar_slots(trials=trials, a=B(1)):
for t in trials:
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; ... | python | Tools/scripts/var_access_benchmark.py | 167 | 173 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,395 | read_list | def read_list(trials=trials, a=[1]):
for t in trials:
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0] | python | Tools/scripts/var_access_benchmark.py | 175 | 181 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,396 | read_deque | def read_deque(trials=trials, a=deque([1])):
for t in trials:
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0] | python | Tools/scripts/var_access_benchmark.py | 183 | 189 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,397 | read_dict | def read_dict(trials=trials, a={0: 1}):
for t in trials:
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0]
a[0]; a[0]; a[0]; a[0]; a[0] | python | Tools/scripts/var_access_benchmark.py | 191 | 197 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,398 | read_strdict | def read_strdict(trials=trials, a={'key': 1}):
for t in trials:
a['key']; a['key']; a['key']; a['key']; a['key']
a['key']; a['key']; a['key']; a['key']; a['key']
a['key']; a['key']; a['key']; a['key']; a['key']
a['key']; a['key']; a['key']; a['key']; a... | python | Tools/scripts/var_access_benchmark.py | 199 | 205 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,399 | list_append_pop | def list_append_pop(trials=trials, a=[1]):
ap, pop = a.append, a.pop
for t in trials:
ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop()
ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop()
ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); p... | python | Tools/scripts/var_access_benchmark.py | 207 | 214 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
9,400 | deque_append_pop | def deque_append_pop(trials=trials, a=deque([1])):
ap, pop = a.append, a.pop
for t in trials:
ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop()
ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop()
ap(1); pop(); ap(1); pop(); ap(1); pop(); ap(1); pop(); ... | python | Tools/scripts/var_access_benchmark.py | 216 | 223 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.