path stringlengths 14 112 | content stringlengths 0 6.32M | size int64 0 6.32M | max_lines int64 1 100k | repo_name stringclasses 2
values | autogenerated bool 1
class |
|---|---|---|---|---|---|
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_debugger_r.py | "Test debugger_r, coverage 30%."
from idlelib import debugger_r
import unittest
from test.support import requires
from tkinter import Tk
class Test(unittest.TestCase):
## @classmethod
## def setUpClass(cls):
## requires('gui')
## cls.root = Tk()
##
## @classmethod
## def tearDownClass(cls)... | 631 | 30 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_help_about.py | """Test help_about, coverage 100%.
help_about.build_bits branches on sys.platform='darwin'.
'100% combines coverage on Mac and others.
"""
from idlelib import help_about
import unittest
from test.support import requires, findfile
from tkinter import Tk, TclError
from idlelib.idle_test.mock_idle import Func
from idleli... | 5,821 | 181 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_config_key.py | "Test config_key, coverage 75%"
from idlelib import config_key
from test.support import requires
import unittest
from tkinter import Tk
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox_func
class ValidationTest(unittest.TestCase):
"Test validation methods: OK, KeysOK, bind_... | 3,700 | 100 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_calltip.py | "Test calltip, coverage 60%"
from idlelib import calltip
import unittest
import textwrap
import types
default_tip = calltip._default_callable_argspec
# Test Class TC is used in multiple get_argspec test methods
class TC():
'doc'
tip = "(ai=None, *b)"
def __init__(self, ai=None, *b): 'doc'
__init__.t... | 7,785 | 217 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_tooltip.py | from idlelib.tooltip import TooltipBase, Hovertip
from test.support import requires
requires('gui')
from functools import wraps
import time
from tkinter import Button, Tk, Toplevel
import unittest
def setUpModule():
global root
root = Tk()
def root_update():
global root
root.update()
def tearDownMo... | 5,130 | 147 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_editmenu.py | '''Test (selected) IDLE Edit menu items.
Edit modules have their own test files
'''
from test.support import requires
requires('gui')
import tkinter as tk
from tkinter import ttk
import unittest
from idlelib import pyshell
class PasteTest(unittest.TestCase):
'''Test pasting into widgets that allow pasting.
O... | 2,564 | 75 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_autoexpand.py | "Test autoexpand, coverage 100%."
from idlelib.autoexpand import AutoExpand
import unittest
from test.support import requires
from tkinter import Text, Tk
class Dummy_Editwin:
# AutoExpand.__init__ only needs .text
def __init__(self, text):
self.text = text
class AutoExpandTest(unittest.TestCase):
... | 4,640 | 156 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_window.py | "Test window, coverage 47%."
from idlelib import window
import unittest
from test.support import requires
from tkinter import Tk
class WindowListTest(unittest.TestCase):
def test_init(self):
wl = window.WindowList()
self.assertEqual(wl.dict, {})
self.assertEqual(wl.callbacks, [])
# ... | 1,075 | 46 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_configdialog.py | """Test configdialog, coverage 94%.
Half the class creates dialog, half works with user customizations.
"""
from idlelib import configdialog
from test.support import requires
requires('gui')
import unittest
from unittest import mock
from idlelib.idle_test.mock_idle import Func
from tkinter import Tk, StringVar, IntVar... | 49,767 | 1,419 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_mainmenu.py | "Test mainmenu, coverage 100%."
# Reported as 88%; mocking turtledemo absence would have no point.
from idlelib import mainmenu
import unittest
class MainMenuTest(unittest.TestCase):
def test_menudefs(self):
actual = [item[0] for item in mainmenu.menudefs]
expect = ['file', 'edit', 'format', 'ru... | 594 | 22 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_multicall.py | "Test multicall, coverage 33%."
from idlelib import multicall
import unittest
from test.support import requires
from tkinter import Tk, Text
class MultiCallTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
cls.root = Tk()
cls.root.withdraw()
cls.mc = ... | 1,042 | 41 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_debugobj_r.py | "Test debugobj_r, coverage 56%."
from idlelib import debugobj_r
import unittest
class WrappedObjectTreeItemTest(unittest.TestCase):
def test_getattr(self):
ti = debugobj_r.WrappedObjectTreeItem(list)
self.assertEqual(ti.append, list.append)
class StubObjectTreeItemTest(unittest.TestCase):
... | 545 | 23 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_pyshell.py | "Test pyshell, coverage 12%."
# Plus coverage of test_warning. Was 20% with test_openshell.
from idlelib import pyshell
import unittest
from test.support import requires
from tkinter import Tk
class PyShellFileListTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
cl... | 1,307 | 43 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_undo.py | "Test undo, coverage 77%."
# Only test UndoDelegator so far.
from idlelib.undo import UndoDelegator
import unittest
from test.support import requires
requires('gui')
from unittest.mock import Mock
from tkinter import Text, Tk
from idlelib.percolator import Percolator
class UndoDelegatorTest(unittest.TestCase):
... | 4,228 | 136 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_query.py | """Test query, coverage 91%).
Non-gui tests for Query, SectionName, ModuleName, and HelpSource use
dummy versions that extract the non-gui methods and add other needed
attributes. GUI tests create an instance of each class and simulate
entries and button clicks. Subclass tests only target the new code in
the subclas... | 11,768 | 353 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_search.py | "Test search, coverage 69%."
from idlelib import search
import unittest
from test.support import requires
requires('gui')
from tkinter import Tk, Text, BooleanVar
from idlelib import searchengine
# Does not currently test the event handler wrappers.
# A usage test should simulate clicks and check highlighting.
# Test... | 2,459 | 81 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_iomenu.py | "Test , coverage 16%."
from idlelib import iomenu
import unittest
from test.support import requires
from tkinter import Tk
from idlelib.editor import EditorWindow
class IOBindigTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
cls.root = Tk()
cls.root.withdr... | 870 | 38 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_statusbar.py | "Test statusbar, coverage 100%."
from idlelib import statusbar
import unittest
from test.support import requires
from tkinter import Tk
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
cls.root = Tk()
cls.root.withdraw()
@classmethod
def tearD... | 1,133 | 42 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/__init__.py | '''idlelib.idle_test is a private implementation of test.test_idle,
which tests the IDLE application as part of the stdlib test suite.
Run IDLE tests alone with "python -m test.test_idle".
Starting with Python 3.6, IDLE requires tcl/tk 8.5 or later.
This package and its contained modules are subject to change and
any ... | 712 | 18 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_macosx.py | "Test macosx, coverage 45% on Windows."
from idlelib import macosx
import unittest
from test.support import requires
import tkinter as tk
import unittest.mock as mock
from idlelib.filelist import FileList
mactypes = {'carbon', 'cocoa', 'xquartz'}
nontypes = {'other'}
alltypes = mactypes | nontypes
class InitTktypeT... | 3,309 | 105 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/idlelib/idle_test/test_textview.py | """Test textview, coverage 100%.
Since all methods and functions create (or destroy) a ViewWindow, which
is a widget containing a widget, etcetera, all tests must be gui tests.
Using mock Text would not change this. Other mocks are used to retrieve
information about calls.
"""
from idlelib import textview as tv
impor... | 5,634 | 182 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/html/entities.py | """HTML character entity references."""
__all__ = ['html5', 'name2codepoint', 'codepoint2name', 'entitydefs']
# maps the HTML entity name to the Unicode code point
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital ... | 75,315 | 2,510 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/html/parser.py | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... | 17,729 | 471 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/html/__init__.py | """
General functions for HTML manipulation.
"""
import re as _re
from html.entities import html5 as _html5
__all__ = ['escape', 'unescape']
def escape(s, quote=True):
"""
Replace special characters "&", "<" and ">" to HTML-safe sequences.
If the optional flag quote is true (the default), the quotation... | 4,756 | 133 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/pydoc_data/topics.py | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Mon Jun 28 12:38:05 2021
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
'Assert statements are a convenient way to insert debugging '
'assertions\n'
'into a program:\n'
... | 644,588 | 13,127 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/pydoc_data/_pydoc.css | /*
CSS file for pydoc.
Contents of this file are subject to change without notice.
*/
| 94 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/pydoc_data/__init__.py | 0 | 1 | jart/cosmopolitan | false | |
cosmopolitan/third_party/python/Lib/venv/__main__.py | import sys
from . import main
rc = 1
try:
main()
rc = 0
except Exception as e:
print('Error: %s' % e, file=sys.stderr)
sys.exit(rc)
| 145 | 11 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/__init__.py | """
Virtual environment (venv) package for Python. Based on PEP 405.
Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
"""
import logging
import os
import shutil
import subprocess
import sys
import types
logger = logging.getLogger(__name__)
class EnvBuilder:
"""
This cl... | 18,651 | 426 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/scripts/nt/deactivate.bat | @echo off
if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
)
set _OLD_VIRTUAL_PROMPT=
if defined _OLD_VIRTUAL_PYTHONHOME (
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
set _OLD_VIRTUAL_PYTHONHOME=
)
if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
)
set _OLD_VIRTUAL_PAT... | 347 | 22 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/scripts/nt/Activate.ps1 | function global:deactivate ([switch]$NonDestructive) {
# Revert to original values
if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
remove-item function:_OLD_VIRTUAL_PROMPT
}
if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
copy-it... | 1,447 | 52 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/scripts/nt/activate.bat | @echo off
rem This file is UTF-8 encoded, so we need to update the current code page while executing it
for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do (
set "_OLD_CODEPAGE=%%a"
)
if defined _OLD_CODEPAGE (
"%SystemRoot%\System32\chcp.com" 65001 > nul
)
set "VIRTUAL_ENV=__VENV_DIR__"... | 982 | 46 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/scripts/posix/activate.csh | # This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD... | 1,276 | 38 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/scripts/posix/activate.fish | # This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
# you cannot run it directly
function deactivate -d "Exit virtualenv and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
... | 2,438 | 76 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/venv/scripts/common/activate | # This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_P... | 2,218 | 77 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/pool.py | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool', 'ThreadPool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import os
import tim... | 26,059 | 804 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/managers.py | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import threading
import ar... | 38,151 | 1,164 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/popen_forkserver.py | import io
import os
from .context import reduction, set_spawning_popen
if not reduction.HAVE_SEND_HANDLE:
raise ImportError('No support for sending fds between processes')
from . import forkserver
from . import popen_fork
from . import spawn
from . import util
__all__ = ['Popen']
#
# Wrapper for an fd used whil... | 1,956 | 69 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/connection.py | #
# A higher level module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ]
import io
import os
import sys
import socket
import struct
import time
imp... | 30,891 | 954 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/resource_sharer.py | #
# We use a background thread for sharing fds on Unix, and for sharing sockets on
# Windows.
#
# A client which wants to pickle a resource registers it with the resource
# sharer and gets an identifier in return. The unpickling process will connect
# to the resource sharer, sends the identifier and its pid, and then ... | 5,325 | 159 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/popen_spawn_win32.py | import os
import msvcrt
import signal
import sys
import _winapi
from .context import reduction, get_spawning_popen, set_spawning_popen
from . import spawn
from . import util
__all__ = ['Popen']
#
#
#
TERMINATE = 0x10000
WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False))
WINSERVICE = sys.executable... | 2,999 | 99 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/heap.py | #
# Module which supports allocation of memory from an mmap
#
# multiprocessing/heap.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import bisect
import mmap
import os
import sys
import tempfile
import threading
from .context import reduction, assert_spawning
from . impor... | 8,319 | 255 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/sharedctypes.py | #
# Module which supports allocation of ctypes objects from shared memory
#
# multiprocessing/sharedctypes.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import ctypes
import weakref
from . import heap
from . import get_context
from .context import reduction, assert_spaw... | 6,245 | 240 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/popen_fork.py | import os
import sys
import signal
from . import util
__all__ = ['Popen']
#
# Start child process using fork
#
class Popen(object):
method = 'fork'
def __init__(self, process_obj):
util._flush_std_streams()
self.returncode = None
self._launch(process_obj)
def duplicate_for_chil... | 2,307 | 80 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/semaphore_tracker.py | #
# On Unix we run a server process which keeps track of unlinked
# semaphores. The server ignores SIGINT and SIGTERM and reads from a
# pipe. Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any remai... | 5,394 | 158 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/forkserver.py | import errno
import os
import selectors
import signal
import socket
import struct
import sys
import threading
from . import connection
from . import process
from .context import reduction
from . import semaphore_tracker
from . import spawn
from . import util
__all__ = ['ensure_running', 'get_inherited_fds', 'connect_... | 8,694 | 267 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/queues.py | #
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']
import sys
import os
import threading
import collections
import time
import weakref
import errno
from queue import... | 10,763 | 348 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/reduction.py | #
# Module which deals with pickling of objects.
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from abc import ABCMeta, abstractmethod
import copyreg
import functools
import io
import os
import pickle
import socket
import sys
from . import c... | 9,226 | 275 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/context.py | import os
import sys
import threading
from . import process
from . import reduction
__all__ = [] # things are copied from here to __init__.py
#
# Exceptions
#
class ProcessError(Exception):
pass
class BufferTooShort(ProcessError):
pass
class TimeoutError(ProcessError):
pass
class Authentic... | 10,298 | 338 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/util.py | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import os
import itertools
import sys
import weakref
import atexit
import threading # we want threading to install it's
... | 11,886 | 421 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/synchronize.py | #
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event'
]
import threading
import sys
import tempfile
impor... | 12,050 | 406 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/process.py | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['BaseProcess', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import i... | 9,211 | 336 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/popen_spawn_posix.py | import io
import os
from .context import reduction, set_spawning_popen
from . import popen_fork
from . import spawn
from . import util
__all__ = ['Popen']
#
# Wrapper for an fd used while launching a process
#
class _DupFd(object):
def __init__(self, fd):
self.fd = fd
def detach(self):
retu... | 1,904 | 69 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/spawn.py | #
# Code used to start processes when using the spawn or forkserver
# start methods.
#
# multiprocessing/spawn.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import os
import sys
import runpy
import types
from . import get_start_method, set_start_method
from . import proc... | 8,863 | 287 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/__init__.py | #
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... | 2,590 | 72 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/dummy/connection.py | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'Client', 'Listener', 'Pipe' ]
from queue import Queue
families = [None]
class Listener(ob... | 1,583 | 74 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/multiprocessing/dummy/__init__.py | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [
'Process', 'current_process', 'active_children', 'freeze_support',
'Lock', 'RLock', 'Semaphore', 'Boun... | 2,896 | 120 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/dbm/ndbm.py | """Provide the _dbm module as a dbm submodule."""
from _dbm import *
| 70 | 4 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/dbm/gnu.py | """Provide the _gdbm module as a dbm submodule."""
from _gdbm import *
| 72 | 4 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/dbm/dumb.py | """A dumb and slow but simple dbm clone.
For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).
XXX TO DO:
- seems to contain a bug when updating...
- reclaim free space (currently, space once o... | 11,989 | 325 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/dbm/__init__.py | """Generic interface to all dbm clones.
Use
import dbm
d = dbm.open(file, 'w', 0o666)
The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the cr... | 5,783 | 189 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/urllib/parse.py | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | 39,023 | 1,079 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/urllib/response.py | """Response classes used by urllib.
The base class, addbase, defines a minimal file-like interface,
including read() and readline(). The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
"""
import tempfile
__all__ = ['... | 2,299 | 81 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/urllib/robotparser.py | """ robotparser.py
Copyright (C) 2000 Bastian Kleineidam
You can choose between two licenses when using this package:
1) GNU GPLv2
2) PSF license for Python 2.2
The robots.txt Exclusion Protocol is implemented as specified in
http://www.robotstxt.org/norobots-rfc.txt
"""
import collections
... | 8,832 | 259 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/urllib/request.py | """An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... | 95,206 | 2,618 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/urllib/__init__.py | 0 | 1 | jart/cosmopolitan | false | |
cosmopolitan/third_party/python/Lib/urllib/error.py | """Exception classes raised by urllib.
The base exception class is URLError, which inherits from OSError. It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.
HTTPError is an exception class that is also a valid HTTP response
instance. It behaves this way beca... | 2,641 | 78 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/EUC-JISX0213.TXT | 00 0000
01 0001
02 0002
03 0003
04 0004
05 0005
06 0006
07 0007
08 0008
09 0009
0A 000A
0B 000B
0C 000C
0D 000D
0E 000E
0F 000F
10 0010
11 0011
12 0012
13 0013
14 0014
15 0015
16 0016
17 0017
18 0018
19 0019
1A 001A
1B 001B
1C 001C
1D 001D
1E 001E
1F 001F
20 0020
21 0021
22 0022
23 0023
24 0024
25 0025
26 0026
27 0027
... | 119,169 | 11,414 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/datetimetester.py | """Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
from test.support import is_resource_enabled
import itertools
import bisect
import copy
import decimal
import sys
import os
import pickle
import random
import struct
import unittest
from array import array
from operator impor... | 201,562 | 5,081 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/keycert4.pem | -----BEGIN PRIVATE KEY-----
MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQDGjpiHzq7ghxhM
ZzrnRsGBC/cmw8EREIdbqlrz/l8BFaWeipvO5Hb/MyU8xs2zLUrqIr2JNf+Eii8Y
m4bYmZclFra4jomaiSlxTZOe3dMV8m4vAq4eT2mSfZZC1+XAutqdz7WhHxhMVEm3
AyTWvTC3qCbnlbX5VIoQUwFrsSWqDiHyaGdK3rrOTKFUKM8YPiq/BZkm6A4eiFci
5wd/SPD+w0pIscZbQW1MUr5bs54uylWa... | 9,454 | 165 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test__locale.py | from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, localeconv, Error)
try:
from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
except ImportError:
nl_langinfo = None
import locale
import sys
import unittest
from platform import uname
if uname().system == "Darwin":
maj, min, mic = [int(part) f... | 7,895 | 194 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_tokenize.py | from test import support
from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP,
STRING, ENDMARKER, ENCODING, tok_name, detect_encoding,
open as tokenize_open, Untokenizer, generate_tokens,
NEWLINE)
from io import BytesIO
import unittest
fr... | 63,484 | 1,625 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/testtar.tar | ustar/conttype 0000644 0001750 0000144 00000015543 07606136617 015171 7 ustar 00tarfile tarfile ... | 435,200 | 2,379 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_timeout.py | """Unit tests for socket timeout feature."""
import functools
import unittest
from test import support
# This requires the 'network' resource as given on the regrtest command line.
skip_expected = not support.is_resource_enabled('network')
import time
import errno
import socket
@functools.lru_cache()
def resolve_a... | 11,406 | 304 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_xmlrpc_net.py | import collections.abc
import unittest
from test import support
import xmlrpc.client as xmlrpclib
@unittest.skip('XXX: buildbot.python.org/all/xmlrpc/ is gone')
class PythonBuildersTest(unittest.TestCase):
def test_python_builders(self):
# Get the list of builders from the XMLRPC buildbot interface at
... | 1,015 | 33 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_calendar.py | import calendar
import unittest
from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
import time
import locale
import sys
import datetime
import os
result_2004_01_text = """\
January 2004
Mo Tu We Th Fr Sa Su
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 ... | 45,064 | 850 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_struct.py | from collections import abc
import array
import math
import operator
import unittest
import struct
import sys
from test import support
ISBIGENDIAN = sys.byteorder == "big"
integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'n', 'N'
byteorders = '', '@', '=', '<', '>', '!'
def iter_integer_formats(byt... | 31,979 | 757 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_sndhdr.py | import sndhdr
import pickle
import unittest
from test.support import findfile
class TestFormats(unittest.TestCase):
def test_data(self):
for filename, expected in (
('sndhdr.8svx', ('8svx', 0, 1, 0, 8)),
('sndhdr.aifc', ('aifc', 44100, 2, 5, 16)),
('sndhdr.aiff', ('aiff'... | 1,460 | 38 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/BIG5HKSCS-2004.TXT | 8740 43F0
8741 4C32
8742 4603
8743 45A6
8744 4578
8745 27267
8746 4D77
8747 45B3
8748 27CB1
8749 4CE2
874A 27CC5
874B 3B95
874C 4736
874D 4744
874E 4C47
874F 4C40
8750 242BF
8751 23617
8752 27352
8753 26E8B
8754 270D2
8755 4C57
8756 2A351
8757 474F
8758 45DA
8759 4C85
875A 27C6C
875B 4D07
875C 4AA4
875D 46A1
875E 26B23... | 51,063 | 4,938 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_profile.py | """Test suite for the profile module."""
import sys
import pstats
import unittest
import os
from difflib import unified_diff
from io import StringIO
from test.support import TESTFN, run_unittest, unlink
from contextlib import contextmanager
import profile
from test.profilee import testfunc, timer
class ProfileTest(... | 7,892 | 193 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_super.py | """Unit tests for zero-argument super() & related machinery."""
import sys
import unittest
import warnings
from test.support import check_warnings
class A:
def f(self):
return 'A'
@classmethod
def cm(cls):
return (cls, 'A')
class B(A):
def f(self):
return super().f() + 'B'
... | 10,919 | 348 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_support.py | import errno
import importlib
import os
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import textwrap
import unittest
from test import support
from test.support import script_helper
TESTFN = support.TESTFN
class TestSupport(unittest.TestCase):
def test_import_module(self):... | 19,608 | 559 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_winreg.py | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys, errno
import unittest
from test import support
threading = support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module doesn't exist
... | 21,708 | 499 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_compile.py | import os
import dis
import math
import cosmo
import unittest
import sys
import _ast
import tempfile
import types
from test import support
from test.support import script_helper, FakePath
class TestSpecifics(unittest.TestCase):
def compile_single(self, source):
compile(source, "<single>", "single")
d... | 28,871 | 747 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_mmap.py | from test.support import (TESTFN, run_unittest, import_module, unlink,
requires, _2G, _4G, gc_collect, cpython_only)
import unittest
import os
import re
import itertools
import socket
import sys
import weakref
# Skip test if we can't import mmap.
mmap = import_module('mmap')
if __name__ == 'P... | 28,471 | 812 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_getopt.py | # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.support import verbose, run_doctest, EnvironmentVarGuard
import unittest
import getopt
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
self.env = EnvironmentVarGuard()
if "POSIXLY_CORRECT" in ... | 6,910 | 185 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_kqueue.py | """
Tests for kqueue wrapper.
"""
import errno
import os
import select
import socket
import time
import unittest
if not hasattr(select, "kqueue"):
raise unittest.SkipTest("test works only on BSD")
class TestKQueue(unittest.TestCase):
def test_create_queue(self):
kq = select.kqueue()
self.asser... | 9,017 | 264 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_tk.py | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
# Skip test if tk cannot be initialized.
support.requires('gui')
from tkinter.test import runtktests
def test_main():
support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_tkinter']))
i... | 362 | 16 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_pkg.py | # Test packages (dotted-name import)
import sys
import os
import tempfile
import textwrap
import unittest
# Helpers to create and destroy hierarchies.
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.isdir(fullname) and not os.pat... | 9,824 | 297 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_script_helper.py | """Unittests for test.support.script_helper. Who tests the test helper?"""
import subprocess
import sys
import os
from test.support import script_helper
import unittest
from unittest import mock
class TestScriptHelper(unittest.TestCase):
def test_assert_python_ok(self):
t = script_helper.assert_python_... | 5,916 | 126 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/mailcap.txt | # Mailcap file for test_mailcap; based on RFC 1524
# Referred to by test_mailcap.py
#
# This is a comment.
#
application/frame; showframe %s; print="cat %s | lp"
application/postscript; ps-to-terminal %s;\
needsterminal
application/postscript; ps-to-terminal %s; \
compose=idraw %s
application/x-dvi; xdvi %s
a... | 1,270 | 39 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_zipapp.py | """Test harness for the zipapp module."""
import io
import pathlib
import stat
import sys
import tempfile
import unittest
import zipapp
import zipfile
from unittest.mock import patch
class ZipAppTest(unittest.TestCase):
"""Test zipapp module functionality."""
def setUp(self):
tmpdir = tempfile.Temp... | 14,070 | 350 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_pkgutil.py | from test.support import run_unittest, unload, check_warnings, CleanImport
import unittest
import sys
import importlib
from importlib.util import spec_from_file_location
import pkgutil
import os
import os.path
import tempfile
import shutil
import zipfile
# Note: pkgutil.walk_packages is currently tested in test_runpy.... | 17,684 | 492 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_doctest.py | """
Test script for doctest.
"""
from test import support
import doctest
import functools
import os
import sys
# NOTE: There are some additional tests relating to interaction with
# zipimport in the test_zipimport_support test module.
######################################################################
## S... | 95,613 | 2,970 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/Python.asdl | -- ASDL's 7 builtin types are:
-- identifier, int, string, bytes, object, singleton, constant
--
-- singleton: None, True or False
-- constant can be None, whereas None means "no value" for object.
module Python
{
mod = Module(stmt* body)
| Interactive(stmt* body)
| Expression(expr body)
-... | 5,169 | 133 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_docxmlrpc.py | from xmlrpc.server import DocXMLRPCServer
import http.client
import re
import sys
from test import support
threading = support.import_module('threading')
import unittest
def make_request_and_skipIf(condition, reason):
# If we skip the test, we have to make a request because
# the server created in setUp blocks... | 8,936 | 215 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/allsans.pem | -----BEGIN PRIVATE KEY-----
MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCg/pM6dP7BTFNc
qe6wIJIBB7HjwL42bp0vjcCVl4Z3MRWFswYpfxy+o+8+PguMp4K6zndA5fwNkK/H
3HmtanncUfPqnV0usN0NHQGh/f9xRoNmB1q2L7kTuO99o0KLQgvonRT2snf8rq9n
tPRzhHUGYhog7zzNxetYV309PHpPr19BcKepDtM5RMk2aBnoN5vtItorjXiDosFm
6o5wQHrcupcVydszba6P75BEbc1XIWvq... | 5,037 | 82 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/outstanding_bugs.py | #
# This file is for everybody to add tests for bugs that aren't
# fixed yet. Please add a test case and appropriate bug description.
#
# When you fix one of the bugs, please move the test to the correct
# test_ module.
#
import unittest
from test import support
#
# No test cases for outstanding bugs at the moment.
#... | 370 | 19 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_multiprocessing_fork.py | import unittest
import test._test_multiprocessing
import sys
from test import support
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
if sys.platform == "win32":
raise unittest.SkipTest("fork is not available on Windows")
if sys.platform == 'darwin':
raise unittest.SkipTest("test ... | 477 | 20 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_shelve.py | import unittest
import shelve
import glob
from test import support
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
de... | 6,389 | 229 | jart/cosmopolitan | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.