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
11,301
register
def register(name, klass, instance=None, *, preferred=False): """Register a browser connector.""" with _lock: if _tryorder is None: register_standard_browsers() _browsers[name.lower()] = [klass, instance] # Preferred browsers go to the front of the list. # Need to ma...
python
Lib/webbrowser.py
25
38
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,302
get
def get(using=None): """Return a browser launcher instance appropriate for the environment.""" if _tryorder is None: with _lock: if _tryorder is None: register_standard_browsers() if using is not None: alternatives = [using] else: alternatives = _tryor...
python
Lib/webbrowser.py
41
69
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,303
open
def open(url, new=0, autoraise=True): """Display url using the default browser. If possible, open url in a location determined by new. - 0: the same browser window (the default). - 1: a new browser window. - 2: a new browser page ("tab"). If possible, autoraise raises the window (the default) o...
python
Lib/webbrowser.py
76
93
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,304
open_new
def open_new(url): """Open url in a new window of the default browser. If not possible, then open url in the only browser window. """ return open(url, 1)
python
Lib/webbrowser.py
96
101
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,305
open_new_tab
def open_new_tab(url): """Open url in a new page ("tab") of the default browser. If not possible, then the behavior becomes equivalent to open_new(). """ return open(url, 2)
python
Lib/webbrowser.py
104
109
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,306
_synthesize
def _synthesize(browser, *, preferred=False): """Attempt to synthesize a controller based on existing controllers. This is useful to create a controller when a user specifies a path to an entry in the BROWSER environment variable -- we can copy a general controller to operate using a specific installat...
python
Lib/webbrowser.py
112
141
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,307
__init__
def __init__(self, name=""): self.name = name self.basename = name
python
Lib/webbrowser.py
151
153
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,308
open
def open(self, url, new=0, autoraise=True): raise NotImplementedError
python
Lib/webbrowser.py
155
156
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,309
open_new
def open_new(self, url): return self.open(url, 1)
python
Lib/webbrowser.py
158
159
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,310
open_new_tab
def open_new_tab(self, url): return self.open(url, 2)
python
Lib/webbrowser.py
161
162
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,311
__init__
def __init__(self, name): if isinstance(name, str): self.name = name self.args = ["%s"] else: # name should be a list with arguments self.name = name[0] self.args = name[1:] self.basename = os.path.basename(self.name)
python
Lib/webbrowser.py
169
177
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,312
open
def open(self, url, new=0, autoraise=True): sys.audit("webbrowser.open", url) cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] try: if sys.platform[:3] == 'win': p = subprocess.Popen(cmdline) else: ...
python
Lib/webbrowser.py
179
190
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,313
open
def open(self, url, new=0, autoraise=True): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] sys.audit("webbrowser.open", url) try: if sys.platform[:3] == 'win': p = subprocess.Popen(cmdline) else: ...
python
Lib/webbrowser.py
197
209
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,314
_invoke
def _invoke(self, args, remote, autoraise, url=None): raise_opt = [] if remote and self.raise_opts: # use autoraise argument only for remote invocation autoraise = int(autoraise) opt = self.raise_opts[autoraise] if opt: raise_opt = [opt] ...
python
Lib/webbrowser.py
229
263
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,315
open
def open(self, url, new=0, autoraise=True): sys.audit("webbrowser.open", url) if new == 0: action = self.remote_action elif new == 1: action = self.remote_action_newwin elif new == 2: if self.remote_action_newtab is None: action = self....
python
Lib/webbrowser.py
265
289
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,316
open
def open(self, url, new=0, autoraise=True): sys.audit("webbrowser.open", url) # XXX Currently I know no way to prevent KFM from opening a new win. if new == 2: action = "newTab" else: action = "openURL" devnull = subprocess.DEVNULL try: ...
python
Lib/webbrowser.py
356
399
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,317
register_X_browsers
def register_X_browsers(): # use xdg-open if around if shutil.which("xdg-open"): register("xdg-open", None, BackgroundBrowser("xdg-open")) # Opens an appropriate browser for the URL scheme according to # freedesktop.org settings (GNOME, KDE, XFCE, etc.) if shutil.which("gio"): regi...
python
Lib/webbrowser.py
419
474
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,318
register_standard_browsers
def register_standard_browsers(): global _tryorder _tryorder = [] if sys.platform == 'darwin': register("MacOSX", None, MacOSXOSAScript('default')) register("chrome", None, MacOSXOSAScript('chrome')) register("firefox", None, MacOSXOSAScript('firefox')) register("safari", No...
python
Lib/webbrowser.py
477
565
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,319
open
def open(self, url, new=0, autoraise=True): sys.audit("webbrowser.open", url) try: os.startfile(url) except OSError: # [Error 22] No application is associated with the specified # file for this operation: '<URL>' return ...
python
Lib/webbrowser.py
574
583
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,320
__init__
def __init__(self, name='default'): super().__init__(name)
python
Lib/webbrowser.py
591
592
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,321
open
def open(self, url, new=0, autoraise=True): sys.audit("webbrowser.open", url) url = url.replace('"', '%22') if self.name == 'default': script = f'open location "{url}"' # opens in default browser else: script = f''' tell...
python
Lib/webbrowser.py
594
613
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,322
open
def open(self, url, new=0, autoraise=True): sys.audit("webbrowser.open", url) # If ctypes isn't available, we can't open a browser if objc is None: return False # All the messages in this call return object references. objc.objc_msgSend.restyp...
python
Lib/webbrowser.py
625
677
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,323
parse_args
def parse_args(arg_list: list[str] | None): import argparse parser = argparse.ArgumentParser(description="Open URL in a web browser.") parser.add_argument("url", help="URL to open") group = parser.add_mutually_exclusive_group() group.add_argument("-n", "--new-window", action="store_const", ...
python
Lib/webbrowser.py
680
695
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,324
main
def main(arg_list: list[str] | None = None): args = parse_args(arg_list) open(args.url, args.new_win) print("\a")
python
Lib/webbrowser.py
698
703
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,325
_try_compile
def _try_compile(source, name): """Attempts to compile the given source, first as an expression and then as a statement if the first approach fails. Utility function to accept strings in functions that otherwise expect code objects """ try: return compile(source, name, 'eval') ...
python
Lib/dis.py
65
76
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,326
dis
def dis(x=None, *, file=None, depth=None, show_caches=False, adaptive=False, show_offsets=False): """Disassemble classes, methods, functions, and other compiled objects. With no argument, disassemble the last traceback. Compiled objects currently include generator objects, async generator obje...
python
Lib/dis.py
78
130
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,327
distb
def distb(tb=None, *, file=None, show_caches=False, adaptive=False, show_offsets=False): """Disassemble a traceback (default: last traceback).""" if tb is None: try: if hasattr(sys, 'last_exc'): tb = sys.last_exc.__traceback__ else: tb = sys.last_t...
python
Lib/dis.py
132
143
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,328
pretty_flags
def pretty_flags(flags): """Return pretty representation of code flags.""" names = [] for i in range(32): flag = 1<<i if flags & flag: names.append(COMPILER_FLAG_NAMES.get(flag, hex(flag))) flags ^= flag if not flags: break else: ...
python
Lib/dis.py
161
173
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,329
__repr__
def __repr__(self): return "<unknown>"
python
Lib/dis.py
176
177
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,330
_get_code_object
def _get_code_object(x): """Helper to handle methods, compiled or raw code objects, and strings.""" # Extract functions from methods. if hasattr(x, '__func__'): x = x.__func__ # Extract compiled code objects from... if hasattr(x, '__code__'): # ...a function, or x = x.__code__ e...
python
Lib/dis.py
182
203
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,331
_deoptop
def _deoptop(op): name = _all_opname[op] return _all_opmap[deoptmap[name]] if name in deoptmap else op
python
Lib/dis.py
205
207
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,332
_get_code_array
def _get_code_array(co, adaptive): if adaptive: code = co._co_code_adaptive res = [] found = False for i in range(0, len(code), 2): op, arg = code[i], code[i+1] if op == ENTER_EXECUTOR: try: ex = get_executor(co, i) ...
python
Lib/dis.py
209
230
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,333
code_info
def code_info(x): """Formatted details of methods, functions, or code.""" return _format_code_info(_get_code_object(x))
python
Lib/dis.py
232
234
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,334
_format_code_info
def _format_code_info(co): lines = [] lines.append("Name: %s" % co.co_name) lines.append("Filename: %s" % co.co_filename) lines.append("Argument count: %s" % co.co_argcount) lines.append("Positional-only arguments: %s" % co.co_posonlyargcount) lines.append("Kw-only argum...
python
Lib/dis.py
236
266
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,335
show_code
def show_code(co, *, file=None): """Print details of methods, functions, or code to *file*. If *file* is not provided, the output is printed on stdout. """ print(code_info(co), file=file)
python
Lib/dis.py
268
273
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,336
_get_cache_size
def _get_cache_size(opname): return _inline_cache_entries.get(opname, 0)
python
Lib/dis.py
330
331
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,337
_get_jump_target
def _get_jump_target(op, arg, offset): """Gets the bytecode offset of the jump target if this is a jump instruction. Otherwise return None. """ deop = _deoptop(op) caches = _get_cache_size(_all_opname[deop]) if deop in hasjrel: if _is_backward_jump(deop): arg = -arg ...
python
Lib/dis.py
333
349
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,338
oparg
def oparg(self): """Alias for Instruction.arg.""" return self.arg
python
Lib/dis.py
373
375
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,339
baseopcode
def baseopcode(self): """Numeric code for the base operation if operation is specialized. Otherwise equal to Instruction.opcode. """ return _deoptop(self.opcode)
python
Lib/dis.py
378
383
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,340
baseopname
def baseopname(self): """Human readable name for the base operation if operation is specialized. Otherwise equal to Instruction.opname. """ return opname[self.baseopcode]
python
Lib/dis.py
386
391
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,341
cache_offset
def cache_offset(self): """Start index of the cache entries following the operation.""" return self.offset + 2
python
Lib/dis.py
394
396
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,342
end_offset
def end_offset(self): """End index of the cache entries following the operation.""" return self.cache_offset + _get_cache_size(_all_opname[self.opcode])*2
python
Lib/dis.py
399
401
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,343
jump_target
def jump_target(self): """Bytecode index of the jump target if this is a jump operation. Otherwise return None. """ return _get_jump_target(self.opcode, self.arg, self.offset)
python
Lib/dis.py
404
409
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,344
is_jump_target
def is_jump_target(self): """True if other code jumps to here, otherwise False""" return self.label is not None
python
Lib/dis.py
412
414
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,345
__str__
def __str__(self): output = io.StringIO() formatter = Formatter(file=output) formatter.print_instruction(self, False) return output.getvalue()
python
Lib/dis.py
416
420
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,346
__init__
def __init__(self, file=None, lineno_width=0, offset_width=0, label_width=0, line_offset=0, show_caches=False): """Create a Formatter *file* where to write the output *lineno_width* sets the width of the line number field (0 omits it) *offset_width* sets the width...
python
Lib/dis.py
425
440
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,347
print_instruction
def print_instruction(self, instr, mark_as_current=False): self.print_instruction_line(instr, mark_as_current) if self.show_caches and instr.cache_info: offset = instr.offset for name, size, data in instr.cache_info: for i in range(size): offse...
python
Lib/dis.py
442
458
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,348
print_instruction_line
def print_instruction_line(self, instr, mark_as_current): """Format instruction details for inclusion in disassembly output.""" lineno_width = self.lineno_width offset_width = self.offset_width label_width = self.label_width new_source_line = (lineno_width > 0 and ...
python
Lib/dis.py
460
509
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,349
print_exception_table
def print_exception_table(self, exception_entries): file = self.file if exception_entries: print("ExceptionTable:", file=file) for entry in exception_entries: lasti = " lasti" if entry.lasti else "" start = entry.start_label end = e...
python
Lib/dis.py
511
520
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,350
__init__
def __init__(self, co_consts=None, names=None, varname_from_oparg=None, labels_map=None): self.co_consts = co_consts self.names = names self.varname_from_oparg = varname_from_oparg self.labels_map = labels_map or {}
python
Lib/dis.py
524
528
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,351
offset_from_jump_arg
def offset_from_jump_arg(self, op, arg, offset): deop = _deoptop(op) if deop in hasjabs: return arg * 2 elif deop in hasjrel: signed_arg = -arg if _is_backward_jump(deop) else arg argval = offset + 2 + signed_arg*2 caches = _get_cache_size(_all_opn...
python
Lib/dis.py
530
540
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,352
get_label_for_offset
def get_label_for_offset(self, offset): return self.labels_map.get(offset, None)
python
Lib/dis.py
542
543
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,353
get_argval_argrepr
def get_argval_argrepr(self, op, arg, offset): get_name = None if self.names is None else self.names.__getitem__ argval = None argrepr = '' deop = _deoptop(op) if arg is not None: # Set argval to the dereferenced value of the argument when # available, a...
python
Lib/dis.py
545
604
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,354
get_instructions
def get_instructions(x, *, first_line=None, show_caches=None, adaptive=False): """Iterator for the opcodes in methods, functions or code Generates a series of Instruction named tuples giving the details of each operations in the supplied code. If *first_line* is not None, it indicates the line number ...
python
Lib/dis.py
606
634
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,355
_get_const_value
def _get_const_value(op, arg, co_consts): """Helper to get the value of the const in a hasconst op. Returns the dereferenced constant if this is possible. Otherwise (if it is a LOAD_CONST and co_consts is not provided) returns the dis.UNKNOWN sentinel. """ assert op in hasconst ar...
python
Lib/dis.py
636
648
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,356
_get_const_info
def _get_const_info(op, arg, co_consts): """Helper to get optional details about const references Returns the dereferenced constant and its repr if the value can be calculated. Otherwise returns the sentinel value dis.UNKNOWN for the value and an empty string for its repr. """ a...
python
Lib/dis.py
650
660
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,357
_get_name_info
def _get_name_info(name_index, get_name, **extrainfo): """Helper to get optional details about named references Returns the dereferenced name as both value and repr if the name list is defined. Otherwise returns the sentinel value dis.UNKNOWN for the value and an empty string for its re...
python
Lib/dis.py
662
674
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,358
_parse_varint
def _parse_varint(iterator): b = next(iterator) val = b & 63 while b&64: val <<= 6 b = next(iterator) val |= b&63 return val
python
Lib/dis.py
676
683
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,359
_parse_exception_table
def _parse_exception_table(code): iterator = iter(code.co_exceptiontable) entries = [] try: while True: start = _parse_varint(iterator)*2 length = _parse_varint(iterator)*2 end = start + length target = _parse_varint(iterator)*2 dl = _parse...
python
Lib/dis.py
685
699
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,360
_is_backward_jump
def _is_backward_jump(op): return opname[op] in ('JUMP_BACKWARD', 'JUMP_BACKWARD_NO_INTERRUPT')
python
Lib/dis.py
701
703
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,361
_get_instructions_bytes
def _get_instructions_bytes(code, linestarts=None, line_offset=0, co_positions=None, original_code=None, arg_resolver=None): """Iterate over the instructions in a bytecode string. Generates a sequence of Instruction namedtuples giving the details of each opcode. """ # U...
python
Lib/dis.py
705
756
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,362
disassemble
def disassemble(co, lasti=-1, *, file=None, show_caches=False, adaptive=False, show_offsets=False): """Disassemble a code object.""" linestarts = dict(findlinestarts(co)) exception_entries = _parse_exception_table(co) labels_map = _make_labels_map(co.co_code, exception_entries=exception_...
python
Lib/dis.py
759
777
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,363
_disassemble_recursive
def _disassemble_recursive(co, *, file=None, depth=None, show_caches=False, adaptive=False, show_offsets=False): disassemble(co, file=file, show_caches=show_caches, adaptive=adaptive, show_offsets=show_offsets) if depth is None or depth > 0: if depth is not None: depth = depth - 1 fo...
python
Lib/dis.py
779
791
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,364
_make_labels_map
def _make_labels_map(original_code, exception_entries=()): jump_targets = set(findlabels(original_code)) labels = set(jump_targets) for start, end, target, _, _ in exception_entries: labels.add(start) labels.add(end) labels.add(target) labels = sorted(labels) labels_map = {of...
python
Lib/dis.py
794
807
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,365
_get_lineno_width
def _get_lineno_width(linestarts): if linestarts is None: return 0 maxlineno = max(filter(None, linestarts.values()), default=-1) if maxlineno == -1: # Omit the line number column entirely if we have no line number info return 0 lineno_width = max(3, len(str(maxlineno))) if l...
python
Lib/dis.py
811
821
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,366
_disassemble_bytes
def _disassemble_bytes(code, lasti=-1, linestarts=None, *, line_offset=0, exception_entries=(), co_positions=None, original_code=None, arg_resolver=None, formatter=None): assert formatter is not None assert arg_resolver is not None instr...
python
Lib/dis.py
824
838
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,367
print_instructions
def print_instructions(instrs, exception_entries, formatter, lasti=-1): for instr in instrs: # Each CACHE takes 2 bytes is_current_instr = instr.offset <= lasti \ <= instr.offset + 2 * _get_cache_size(_all_opname[_deoptop(instr.opcode)]) formatter.print_instruction(instr, is_curr...
python
Lib/dis.py
841
848
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,368
_disassemble_str
def _disassemble_str(source, **kwargs): """Compile the source string, then disassemble the code object.""" _disassemble_recursive(_try_compile(source, '<dis>'), **kwargs)
python
Lib/dis.py
850
852
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,369
_unpack_opargs
def _unpack_opargs(code): extended_arg = 0 extended_args_offset = 0 # Number of EXTENDED_ARG instructions preceding the current instruction caches = 0 for i in range(0, len(code), 2): # Skip inline CACHE entries: if caches: caches -= 1 continue op = code[...
python
Lib/dis.py
862
891
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,370
findlabels
def findlabels(code): """Detect all offsets in a byte code which are jump targets. Return the list of offsets. """ labels = [] for offset, _, op, arg in _unpack_opargs(code): if arg is not None: label = _get_jump_target(op, arg, offset) if label is None: ...
python
Lib/dis.py
893
907
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,371
findlinestarts
def findlinestarts(code): """Find the offsets in a byte code which are start of lines in the source. Generate pairs (offset, lineno) lineno will be an integer or None the offset does not have a source line. """ lastline = False # None is a valid line number for start, end, line in code.co_line...
python
Lib/dis.py
909
921
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,372
_find_imports
def _find_imports(co): """Find import statements in the code Generate triplets (name, level, fromlist) where name is the imported module and level, fromlist are the corresponding args to __import__. """ IMPORT_NAME = opmap['IMPORT_NAME'] consts = co.co_consts names = co.co_names op...
python
Lib/dis.py
923
943
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,373
_find_store_names
def _find_store_names(co): """Find names of variables which are written in the code Generate sequence of strings """ STORE_OPS = { opmap['STORE_NAME'], opmap['STORE_GLOBAL'] } names = co.co_names for _, _, op, arg in _unpack_opargs(co.co_code): if op in STORE_OPS: ...
python
Lib/dis.py
945
958
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,374
__init__
def __init__(self, x, *, first_line=None, current_offset=None, show_caches=False, adaptive=False, show_offsets=False): self.codeobj = co = _get_code_object(x) if first_line is None: self.first_line = co.co_firstlineno self._line_offset = 0 else: self.first_lin...
python
Lib/dis.py
969
983
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,375
__iter__
def __iter__(self): co = self.codeobj original_code = co.co_code labels_map = _make_labels_map(original_code, self.exception_entries) arg_resolver = ArgResolver(co_consts=co.co_consts, names=co.co_names, varname_from_o...
python
Lib/dis.py
985
998
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,376
__repr__
def __repr__(self): return "{}({!r})".format(self.__class__.__name__, self._original_object)
python
Lib/dis.py
1,000
1,002
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,377
from_traceback
def from_traceback(cls, tb, *, show_caches=False, adaptive=False): """ Construct a Bytecode from the given traceback """ while tb.tb_next: tb = tb.tb_next return cls( tb.tb_frame.f_code, current_offset=tb.tb_lasti, show_caches=show_caches, adaptive=adaptive )
python
Lib/dis.py
1,005
1,011
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,378
info
def info(self): """Return formatted information about the code object.""" return _format_code_info(self.codeobj)
python
Lib/dis.py
1,013
1,015
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,379
dis
def dis(self): """Return a formatted view of the bytecode operations.""" co = self.codeobj if self.current_offset is not None: offset = self.current_offset else: offset = -1 with io.StringIO() as output: code = _get_code_array(co, self.adaptive...
python
Lib/dis.py
1,017
1,051
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,380
main
def main(): import argparse parser = argparse.ArgumentParser() parser.add_argument('-C', '--show-caches', action='store_true', help='show inline caches') parser.add_argument('-O', '--show-offsets', action='store_true', help='show instruction offsets') ...
python
Lib/dis.py
1,054
1,072
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,381
__init__
def __init__(self, skip=None): self.skip = set(skip) if skip else None self.breaks = {} self.fncache = {} self.frame_trace_lines_opcodes = {} self.frame_returning = None self.trace_opcodes = False self.enterframe = None self._load_breaks()
python
Lib/bdb.py
31
40
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,382
canonic
def canonic(self, filename): """Return canonical form of filename. For real filenames, the canonical form is a case-normalized (on case insensitive filesystems) absolute path. 'Filenames' with angle brackets, such as "<stdin>", generated in interactive mode, are returned unchan...
python
Lib/bdb.py
42
57
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,383
reset
def reset(self): """Set values of attributes as ready to start debugging.""" import linecache linecache.checkcache() self.botframe = None self._set_stopinfo(None, None)
python
Lib/bdb.py
59
64
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,384
trace_dispatch
def trace_dispatch(self, frame, event, arg): """Dispatch a trace function for debugged frames based on the event. This function is installed as the trace function for debugged frames. Its return value is the new trace function, which is usually itself. The default implementation decides...
python
Lib/bdb.py
66
112
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,385
dispatch_line
def dispatch_line(self, frame): """Invoke user function and return trace function for line event. If the debugger stops on the current line, invoke self.user_line(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. """ ...
python
Lib/bdb.py
114
124
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,386
dispatch_call
def dispatch_call(self, frame, arg): """Invoke user function and return trace function for call event. If the debugger stops on this function call, invoke self.user_call(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. """ ...
python
Lib/bdb.py
126
146
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,387
dispatch_return
def dispatch_return(self, frame, arg): """Invoke user function and return trace function for return event. If the debugger stops on this function return, invoke self.user_return(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. ...
python
Lib/bdb.py
148
168
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,388
dispatch_exception
def dispatch_exception(self, frame, arg): """Invoke user function and return trace function for exception event. If the debugger stops on this exception, invoke self.user_exception(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. ...
python
Lib/bdb.py
170
195
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,389
dispatch_opcode
def dispatch_opcode(self, frame, arg): """Invoke user function and return trace function for opcode event. If the debugger stops on the current opcode, invoke self.user_opcode(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. ...
python
Lib/bdb.py
197
206
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,390
is_skipped_module
def is_skipped_module(self, module_name): "Return True if module_name matches any skip pattern." if module_name is None: # some modules do not have names return False for pattern in self.skip: if fnmatch.fnmatch(module_name, pattern): return True ...
python
Lib/bdb.py
212
219
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,391
stop_here
def stop_here(self, frame): "Return True if frame is below the starting frame in the stack." # (CT) stopframe may now also be None, see dispatch_call. # (CT) the former test for None is therefore removed from here. if self.skip and \ self.is_skipped_module(frame.f_globals....
python
Lib/bdb.py
221
234
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,392
break_here
def break_here(self, frame): """Return True if there is an effective breakpoint for this line. Check for line or function breakpoint and if in effect. Delete temporary breakpoints if effective() says to. """ filename = self.canonic(frame.f_code.co_filename) if filename n...
python
Lib/bdb.py
236
261
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,393
do_clear
def do_clear(self, arg): """Remove temporary breakpoint. Must implement in derived classes or get NotImplementedError. """ raise NotImplementedError("subclass of bdb must implement do_clear()")
python
Lib/bdb.py
263
268
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,394
break_anywhere
def break_anywhere(self, frame): """Return True if there is any breakpoint for frame's filename. """ return self.canonic(frame.f_code.co_filename) in self.breaks
python
Lib/bdb.py
270
273
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,395
user_call
def user_call(self, frame, argument_list): """Called if we might stop in a function.""" pass
python
Lib/bdb.py
278
280
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,396
user_line
def user_line(self, frame): """Called when we stop or break at a line.""" pass
python
Lib/bdb.py
282
284
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,397
user_return
def user_return(self, frame, return_value): """Called when a return trap is set here.""" pass
python
Lib/bdb.py
286
288
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,398
user_exception
def user_exception(self, frame, exc_info): """Called when we stop on an exception.""" pass
python
Lib/bdb.py
290
292
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,399
user_opcode
def user_opcode(self, frame): """Called when we are about to execute an opcode.""" pass
python
Lib/bdb.py
294
296
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
11,400
_set_trace_opcodes
def _set_trace_opcodes(self, trace_opcodes): if trace_opcodes != self.trace_opcodes: self.trace_opcodes = trace_opcodes frame = self.enterframe while frame is not None: frame.f_trace_opcodes = trace_opcodes if frame is self.botframe: ...
python
Lib/bdb.py
298
306
{ "name": "PublicHealthInformationTechnology/cpython", "url": "https://github.com/PublicHealthInformationTechnology/cpython.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }