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
6,067,601
visit_break_stmt
def visit_break_stmt(self, o: mypy.nodes.BreakStmt) -> str: return self.dump([], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
253
254
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,602
visit_continue_stmt
def visit_continue_stmt(self, o: mypy.nodes.ContinueStmt) -> str: return self.dump([], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
256
257
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,603
visit_pass_stmt
def visit_pass_stmt(self, o: mypy.nodes.PassStmt) -> str: return self.dump([], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
259
260
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,604
visit_raise_stmt
def visit_raise_stmt(self, o: mypy.nodes.RaiseStmt) -> str: return self.dump([o.expr, o.from_expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
262
263
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,605
visit_assert_stmt
def visit_assert_stmt(self, o: mypy.nodes.AssertStmt) -> str: if o.msg is not None: return self.dump([o.expr, o.msg], o) else: return self.dump([o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
265
269
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,606
visit_await_expr
def visit_await_expr(self, o: mypy.nodes.AwaitExpr) -> str: return self.dump([o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
271
272
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,607
visit_del_stmt
def visit_del_stmt(self, o: mypy.nodes.DelStmt) -> str: return self.dump([o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
274
275
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,608
visit_try_stmt
def visit_try_stmt(self, o: mypy.nodes.TryStmt) -> str: a: list[Any] = [o.body] for i in range(len(o.vars)): a.append(o.types[i]) if o.vars[i]: a.append(o.vars[i]) a.append(o.handlers[i]) if o.else_body: a.append(("Else", o.else_b...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
277
291
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,609
visit_with_stmt
def visit_with_stmt(self, o: mypy.nodes.WithStmt) -> str: a: list[Any] = [] if o.is_async: a.append(("Async", "")) for i in range(len(o.expr)): a.append(("Expr", [o.expr[i]])) if o.target[i]: a.append(("Target", [o.target[i]])) if o.una...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
293
303
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,610
visit_match_stmt
def visit_match_stmt(self, o: mypy.nodes.MatchStmt) -> str: a: list[Any] = [o.subject] for i in range(len(o.patterns)): a.append(("Pattern", [o.patterns[i]])) if o.guards[i] is not None: a.append(("Guard", [o.guards[i]])) a.append(("Body", o.bodies[i]....
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
305
312
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,611
visit_int_expr
def visit_int_expr(self, o: mypy.nodes.IntExpr) -> str: return f"IntExpr({o.value})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
318
319
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,612
visit_str_expr
def visit_str_expr(self, o: mypy.nodes.StrExpr) -> str: return f"StrExpr({self.str_repr(o.value)})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
321
322
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,613
visit_bytes_expr
def visit_bytes_expr(self, o: mypy.nodes.BytesExpr) -> str: return f"BytesExpr({self.str_repr(o.value)})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
324
325
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,614
str_repr
def str_repr(self, s: str) -> str: s = re.sub(r"\\u[0-9a-fA-F]{4}", lambda m: "\\" + m.group(0), s) return re.sub("[^\\x20-\\x7e]", lambda m: r"\u%.4x" % ord(m.group(0)), s)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
327
329
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,615
visit_float_expr
def visit_float_expr(self, o: mypy.nodes.FloatExpr) -> str: return f"FloatExpr({o.value})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
331
332
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,616
visit_complex_expr
def visit_complex_expr(self, o: mypy.nodes.ComplexExpr) -> str: return f"ComplexExpr({o.value})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
334
335
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,617
visit_ellipsis
def visit_ellipsis(self, o: mypy.nodes.EllipsisExpr) -> str: return "Ellipsis"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
337
338
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,618
visit_star_expr
def visit_star_expr(self, o: mypy.nodes.StarExpr) -> str: return self.dump([o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
340
341
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,619
visit_name_expr
def visit_name_expr(self, o: mypy.nodes.NameExpr) -> str: pretty = self.pretty_name( o.name, o.kind, o.fullname, o.is_inferred_def or o.is_special_form, o.node ) if isinstance(o.node, mypy.nodes.Var) and o.node.is_final: pretty += f" = {o.node.final_value}" return...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
343
349
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,620
pretty_name
def pretty_name( self, name: str, kind: int | None, fullname: str | None, is_inferred_def: bool, target_node: mypy.nodes.Node | None = None, ) -> str: n = name if is_inferred_def: n += "*" if target_node: id = self.forma...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
351
379
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,621
visit_member_expr
def visit_member_expr(self, o: mypy.nodes.MemberExpr) -> str: pretty = self.pretty_name(o.name, o.kind, o.fullname, o.is_inferred_def, o.node) return self.dump([o.expr, pretty], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
381
383
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,622
visit_yield_expr
def visit_yield_expr(self, o: mypy.nodes.YieldExpr) -> str: return self.dump([o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
385
386
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,623
visit_yield_from_expr
def visit_yield_from_expr(self, o: mypy.nodes.YieldFromExpr) -> str: if o.expr: return self.dump([o.expr.accept(self)], o) else: return self.dump([], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
388
392
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,624
visit_call_expr
def visit_call_expr(self, o: mypy.nodes.CallExpr) -> str: if o.analyzed: return o.analyzed.accept(self) args: list[mypy.nodes.Expression] = [] extra: list[str | tuple[str, list[Any]]] = [] for i, kind in enumerate(o.arg_kinds): if kind in [mypy.nodes.ARG_POS, mypy...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
394
411
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,625
visit_op_expr
def visit_op_expr(self, o: mypy.nodes.OpExpr) -> str: return self.dump([o.op, o.left, o.right], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
413
414
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,626
visit_comparison_expr
def visit_comparison_expr(self, o: mypy.nodes.ComparisonExpr) -> str: return self.dump([o.operators, o.operands], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
416
417
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,627
visit_cast_expr
def visit_cast_expr(self, o: mypy.nodes.CastExpr) -> str: return self.dump([o.expr, o.type], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
419
420
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,628
visit_assert_type_expr
def visit_assert_type_expr(self, o: mypy.nodes.AssertTypeExpr) -> str: return self.dump([o.expr, o.type], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
422
423
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,629
visit_reveal_expr
def visit_reveal_expr(self, o: mypy.nodes.RevealExpr) -> str: if o.kind == mypy.nodes.REVEAL_TYPE: return self.dump([o.expr], o) else: # REVEAL_LOCALS return self.dump([o.local_nodes], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
425
430
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,630
visit_assignment_expr
def visit_assignment_expr(self, o: mypy.nodes.AssignmentExpr) -> str: return self.dump([o.target, o.value], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
432
433
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,631
visit_unary_expr
def visit_unary_expr(self, o: mypy.nodes.UnaryExpr) -> str: return self.dump([o.op, o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
435
436
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,632
visit_list_expr
def visit_list_expr(self, o: mypy.nodes.ListExpr) -> str: return self.dump(o.items, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
438
439
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,633
visit_dict_expr
def visit_dict_expr(self, o: mypy.nodes.DictExpr) -> str: return self.dump([[k, v] for k, v in o.items], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
441
442
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,634
visit_set_expr
def visit_set_expr(self, o: mypy.nodes.SetExpr) -> str: return self.dump(o.items, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
444
445
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,635
visit_tuple_expr
def visit_tuple_expr(self, o: mypy.nodes.TupleExpr) -> str: return self.dump(o.items, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
447
448
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,636
visit_index_expr
def visit_index_expr(self, o: mypy.nodes.IndexExpr) -> str: if o.analyzed: return o.analyzed.accept(self) return self.dump([o.base, o.index], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
450
453
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,637
visit_super_expr
def visit_super_expr(self, o: mypy.nodes.SuperExpr) -> str: return self.dump([o.name, o.call], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
455
456
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,638
visit_type_application
def visit_type_application(self, o: mypy.nodes.TypeApplication) -> str: return self.dump([o.expr, ("Types", o.types)], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
458
459
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,639
visit_type_var_expr
def visit_type_var_expr(self, o: mypy.nodes.TypeVarExpr) -> str: import mypy.types a: list[Any] = [] if o.variance == mypy.nodes.COVARIANT: a += ["Variance(COVARIANT)"] if o.variance == mypy.nodes.CONTRAVARIANT: a += ["Variance(CONTRAVARIANT)"] if o.value...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
461
473
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,640
visit_paramspec_expr
def visit_paramspec_expr(self, o: mypy.nodes.ParamSpecExpr) -> str: import mypy.types a: list[Any] = [] if o.variance == mypy.nodes.COVARIANT: a += ["Variance(COVARIANT)"] if o.variance == mypy.nodes.CONTRAVARIANT: a += ["Variance(CONTRAVARIANT)"] if not ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
475
485
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,641
visit_type_var_tuple_expr
def visit_type_var_tuple_expr(self, o: mypy.nodes.TypeVarTupleExpr) -> str: import mypy.types a: list[Any] = [] if o.variance == mypy.nodes.COVARIANT: a += ["Variance(COVARIANT)"] if o.variance == mypy.nodes.CONTRAVARIANT: a += ["Variance(CONTRAVARIANT)"] ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
487
497
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,642
visit_type_alias_expr
def visit_type_alias_expr(self, o: mypy.nodes.TypeAliasExpr) -> str: return f"TypeAliasExpr({o.type})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
499
500
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,643
visit_namedtuple_expr
def visit_namedtuple_expr(self, o: mypy.nodes.NamedTupleExpr) -> str: return f"NamedTupleExpr:{o.line}({o.info.name}, {o.info.tuple_type})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
502
503
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,644
visit_enum_call_expr
def visit_enum_call_expr(self, o: mypy.nodes.EnumCallExpr) -> str: return f"EnumCallExpr:{o.line}({o.info.name}, {o.items})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
505
506
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,645
visit_typeddict_expr
def visit_typeddict_expr(self, o: mypy.nodes.TypedDictExpr) -> str: return f"TypedDictExpr:{o.line}({o.info.name})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
508
509
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,646
visit__promote_expr
def visit__promote_expr(self, o: mypy.nodes.PromoteExpr) -> str: return f"PromoteExpr:{o.line}({o.type})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
511
512
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,647
visit_newtype_expr
def visit_newtype_expr(self, o: mypy.nodes.NewTypeExpr) -> str: return f"NewTypeExpr:{o.line}({o.name}, {self.dump([o.old_type], o)})"
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
514
515
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,648
visit_lambda_expr
def visit_lambda_expr(self, o: mypy.nodes.LambdaExpr) -> str: a = self.func_helper(o) return self.dump(a, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
517
519
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,649
visit_generator_expr
def visit_generator_expr(self, o: mypy.nodes.GeneratorExpr) -> str: condlists = o.condlists if any(o.condlists) else None return self.dump([o.left_expr, o.indices, o.sequences, condlists], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
521
523
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,650
visit_list_comprehension
def visit_list_comprehension(self, o: mypy.nodes.ListComprehension) -> str: return self.dump([o.generator], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
525
526
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,651
visit_set_comprehension
def visit_set_comprehension(self, o: mypy.nodes.SetComprehension) -> str: return self.dump([o.generator], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
528
529
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,652
visit_dictionary_comprehension
def visit_dictionary_comprehension(self, o: mypy.nodes.DictionaryComprehension) -> str: condlists = o.condlists if any(o.condlists) else None return self.dump([o.key, o.value, o.indices, o.sequences, condlists], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
531
533
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,653
visit_conditional_expr
def visit_conditional_expr(self, o: mypy.nodes.ConditionalExpr) -> str: return self.dump([("Condition", [o.cond]), o.if_expr, o.else_expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
535
536
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,654
visit_slice_expr
def visit_slice_expr(self, o: mypy.nodes.SliceExpr) -> str: a: list[Any] = [o.begin_index, o.end_index, o.stride] if not a[0]: a[0] = "<empty>" if not a[1]: a[1] = "<empty>" return self.dump(a, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
538
544
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,655
visit_temp_node
def visit_temp_node(self, o: mypy.nodes.TempNode) -> str: return self.dump([o.type], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
546
547
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,656
visit_as_pattern
def visit_as_pattern(self, o: mypy.patterns.AsPattern) -> str: return self.dump([o.pattern, o.name], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
549
550
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,657
visit_or_pattern
def visit_or_pattern(self, o: mypy.patterns.OrPattern) -> str: return self.dump(o.patterns, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
552
553
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,658
visit_value_pattern
def visit_value_pattern(self, o: mypy.patterns.ValuePattern) -> str: return self.dump([o.expr], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
555
556
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,659
visit_singleton_pattern
def visit_singleton_pattern(self, o: mypy.patterns.SingletonPattern) -> str: return self.dump([o.value], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
558
559
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,660
visit_sequence_pattern
def visit_sequence_pattern(self, o: mypy.patterns.SequencePattern) -> str: return self.dump(o.patterns, o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
561
562
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,661
visit_starred_pattern
def visit_starred_pattern(self, o: mypy.patterns.StarredPattern) -> str: return self.dump([o.capture], o)
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
564
565
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,662
visit_mapping_pattern
def visit_mapping_pattern(self, o: mypy.patterns.MappingPattern) -> str: a: list[Any] = [] for i in range(len(o.keys)): a.append(("Key", [o.keys[i]])) a.append(("Value", [o.values[i]])) if o.rest is not None: a.append(("Rest", [o.rest])) return self.du...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
567
574
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,663
visit_class_pattern
def visit_class_pattern(self, o: mypy.patterns.ClassPattern) -> str: a: list[Any] = [o.class_ref] if len(o.positionals) > 0: a.append(("Positionals", o.positionals)) for i in range(len(o.keyword_keys)): a.append(("Keyword", [o.keyword_keys[i], o.keyword_values[i]])) ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
576
583
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,664
dump_tagged
def dump_tagged(nodes: Sequence[object], tag: str | None, str_conv: StrConv) -> str: """Convert an array into a pretty-printed multiline string representation. The format is tag( item1.. itemN) Individual items are formatted like this: - arrays are flattened - pairs (str, ar...
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
586
618
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,665
indent
def indent(s: str, n: int) -> str: """Indent all the lines in s (separated by newlines) by n spaces.""" s = " " * n + s s = s.replace("\n", "\n" + " " * n) return s
python
python-3.10.8.amd64/Lib/site-packages/mypy/strconv.py
621
625
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,666
console_entry
def console_entry() -> None: try: main() sys.stdout.flush() sys.stderr.flush() except BrokenPipeError: # Python flushes standard streams on exit; redirect remaining output # to devnull to avoid another BrokenPipeError at shutdown devnull = os.open(os.devnull, os.O...
python
python-3.10.8.amd64/Lib/site-packages/mypy/__main__.py
13
33
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,667
__init__
def __init__(self) -> None: self.module: str | None = None self.classes: list[TypeInfo] = [] self.function: FuncBase | None = None # Number of nested scopes ignored (that don't get their own separate targets) self.ignored = 0
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
20
25
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,668
current_module_id
def current_module_id(self) -> str: assert self.module return self.module
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
27
29
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,669
current_target
def current_target(self) -> str: """Return the current target (non-class; for a class return enclosing module).""" assert self.module if self.function: fullname = self.function.fullname return fullname or "" return self.module
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
31
37
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,670
current_full_target
def current_full_target(self) -> str: """Return the current target (may be a class).""" assert self.module if self.function: return self.function.fullname if self.classes: return self.classes[-1].fullname return self.module
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
39
46
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,671
current_type_name
def current_type_name(self) -> str | None: """Return the current type's short name if it exists""" return self.classes[-1].name if self.classes else None
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
48
50
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,672
current_function_name
def current_function_name(self) -> str | None: """Return the current function's short name if it exists""" return self.function.name if self.function else None
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
52
54
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,673
module_scope
def module_scope(self, prefix: str) -> Iterator[None]: self.module = prefix self.classes = [] self.function = None self.ignored = 0 yield assert self.module self.module = None
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
57
64
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,674
function_scope
def function_scope(self, fdef: FuncBase) -> Iterator[None]: if not self.function: self.function = fdef else: # Nested functions are part of the topmost function target. self.ignored += 1 yield if self.ignored: # Leave a scope that's include...
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
67
79
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,675
enter_class
def enter_class(self, info: TypeInfo) -> None: """Enter a class target scope.""" if not self.function: self.classes.append(info) else: # Classes within functions are part of the enclosing function target. self.ignored += 1
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
81
87
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,676
leave_class
def leave_class(self) -> None: """Leave a class target scope.""" if self.ignored: # Leave a scope that's included in the enclosing target. self.ignored -= 1 else: assert self.classes # Leave the innermost class. self.classes.pop()
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
89
97
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,677
class_scope
def class_scope(self, info: TypeInfo) -> Iterator[None]: self.enter_class(info) yield self.leave_class()
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
100
103
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,678
save
def save(self) -> SavedScope: """Produce a saved scope that can be entered with saved_scope()""" assert self.module # We only save the innermost class, which is sufficient since # the rest are only needed for when classes are left. cls = self.classes[-1] if self.classes else None...
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
105
111
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,679
saved_scope
def saved_scope(self, saved: SavedScope) -> Iterator[None]: module, info, function = saved with self.module_scope(module): with self.class_scope(info) if info else nullcontext(): with self.function_scope(function) if function else nullcontext(): yield
python
python-3.10.8.amd64/Lib/site-packages/mypy/scope.py
114
119
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,680
__init__
def __init__(self, data_dir: str, report_dirs: dict[str, str]) -> None: self.data_dir = data_dir self.reporters: list[AbstractReporter] = [] self.named_reporters: dict[str, AbstractReporter] = {} for report_type, report_dir in sorted(report_dirs.items()): self.add_report(rep...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
55
61
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,681
add_report
def add_report(self, report_type: str, report_dir: str) -> AbstractReporter: try: return self.named_reporters[report_type] except KeyError: pass reporter_cls, needs_lxml = reporter_classes[report_type] if needs_lxml and not LXML_INSTALLED: print( ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
63
82
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,682
file
def file( self, tree: MypyFile, modules: dict[str, MypyFile], type_map: dict[Expression, Type], options: Options, ) -> None: for reporter in self.reporters: reporter.on_file(tree, modules, type_map, options)
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
84
92
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,683
finish
def finish(self) -> None: for reporter in self.reporters: reporter.on_finish()
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
94
96
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,684
__init__
def __init__(self, reports: Reports, output_dir: str) -> None: self.output_dir = output_dir if output_dir != "<memory>": stats.ensure_dir_exists(output_dir)
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
100
103
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,685
on_file
def on_file( self, tree: MypyFile, modules: dict[str, MypyFile], type_map: dict[Expression, Type], options: Options, ) -> None: pass
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
106
113
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,686
on_finish
def on_finish(self) -> None: pass
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
116
117
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,687
register_reporter
def register_reporter( report_name: str, reporter: Callable[[Reports, str], AbstractReporter], needs_lxml: bool = False, ) -> None: reporter_classes[report_name] = (reporter, needs_lxml)
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
120
125
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,688
alias_reporter
def alias_reporter(source_reporter: str, target_reporter: str) -> None: reporter_classes[target_reporter] = reporter_classes[source_reporter]
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
128
129
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,689
should_skip_path
def should_skip_path(path: str) -> bool: if stats.is_special_module(path): return True if path.startswith(".."): return True if "stubs" in path.split("/") or "stubs" in path.split(os.sep): return True return False
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
132
139
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,690
iterate_python_lines
def iterate_python_lines(path: str) -> Iterator[tuple[int, str]]: """Return an iterator over (line number, line text) from a Python file.""" with tokenize.open(path) as input_file: yield from enumerate(input_file, 1)
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
142
145
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,691
__init__
def __init__(self) -> None: super().__init__() self.counts = [0, 0]
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
149
151
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,692
visit_func_def
def visit_func_def(self, defn: FuncDef) -> None: self.counts[defn.type is not None] += 1
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
153
154
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,693
__init__
def __init__(self, reports: Reports, output_dir: str) -> None: super().__init__(reports, output_dir) self.counts: dict[str, tuple[int, int, int, int]] = {}
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
158
160
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,694
on_file
def on_file( self, tree: MypyFile, modules: dict[str, MypyFile], type_map: dict[Expression, Type], options: Options, ) -> None: # Count physical lines. This assumes the file's encoding is a # superset of ASCII (or at least uses \n in its line endings). ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
162
192
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,695
on_finish
def on_finish(self) -> None: counts: list[tuple[tuple[int, int, int, int], str]] = sorted( ((c, p) for p, c in self.counts.items()), reverse=True ) total_counts = tuple(sum(c[i] for c, p in counts) for i in range(4)) with open(os.path.join(self.output_dir, "linecount.txt"), "...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
194
202
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,696
__init__
def __init__(self, reports: Reports, output_dir: str) -> None: super().__init__(reports, output_dir) self.counts: dict[str, tuple[int, int]] = {} self.any_types_counter: dict[str, typing.Counter[int]] = {}
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
211
214
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,697
on_file
def on_file( self, tree: MypyFile, modules: dict[str, MypyFile], type_map: dict[Expression, Type], options: Options, ) -> None: visitor = stats.StatisticsVisitor( inferred=True, filename=tree.fullname, modules=modules, t...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
216
238
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,698
on_finish
def on_finish(self) -> None: self._report_any_exprs() self._report_types_of_anys()
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
240
242
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,699
_write_out_report
def _write_out_report( self, filename: str, header: list[str], rows: list[list[str]], footer: list[str] ) -> None: row_len = len(header) assert all(len(row) == row_len for row in rows + [header, footer]) min_column_distance = 3 # minimum distance between numbers in two columns ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
244
268
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,067,700
_report_any_exprs
def _report_any_exprs(self) -> None: total_any = sum(num_any for num_any, _ in self.counts.values()) total_expr = sum(total for _, total in self.counts.values()) total_coverage = 100.0 if total_expr > 0: total_coverage = (float(total_expr - total_any) / float(total_expr)) * 1...
python
python-3.10.8.amd64/Lib/site-packages/mypy/report.py
270
286
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }