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 |
|---|---|---|---|---|---|---|---|
10,601 | useOldTk | def useOldTk():
return getBuildTuple() < (10, 15) | python | Mac/BuildScript/build-installer.py | 208 | 209 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,602 | tweak_tcl_build | def tweak_tcl_build(basedir, archList):
with open("Makefile", "r") as fp:
contents = fp.readlines()
# For reasons I don't understand the tcl configure script
# decides that some stdlib symbols aren't present, before
# deciding that strtod is broken.
new_contents = []
for line in content... | python | Mac/BuildScript/build-installer.py | 212 | 230 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,603 | library_recipes | def library_recipes():
result = []
# Since Apple removed the header files for the deprecated system
# OpenSSL as of the Xcode 7 release (for OS X 10.10+), we do not
# have much choice but to build our own copy here, too.
result.extend([
dict(
name="OpenSSL 3.0.13",
... | python | Mac/BuildScript/build-installer.py | 240 | 406 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,604 | compilerCanOptimize | def compilerCanOptimize():
"""
Return True iff the default Xcode version can use PGO and LTO
"""
# bpo-42235: The version check is pretty conservative, can be
# adjusted after testing
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
return mac_ver >= (10, 15) | python | Mac/BuildScript/build-installer.py | 408 | 415 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,605 | pkg_recipes | def pkg_recipes():
unselected_for_python3 = ('selected', 'unselected')[PYTHON_3]
result = [
dict(
name="PythonFramework",
long_name="Python Framework",
source="/Library/Frameworks/Python.framework",
readme="""\
This package installs Python.... | python | Mac/BuildScript/build-installer.py | 418 | 504 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,606 | fatal | def fatal(msg):
"""
A fatal error, bail out.
"""
sys.stderr.write('FATAL: ')
sys.stderr.write(msg)
sys.stderr.write('\n')
sys.exit(1) | python | Mac/BuildScript/build-installer.py | 506 | 513 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,607 | fileContents | def fileContents(fn):
"""
Return the contents of the named file
"""
return open(fn, 'r').read() | python | Mac/BuildScript/build-installer.py | 515 | 519 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,608 | runCommand | def runCommand(commandline):
"""
Run a command and raise RuntimeError if it fails. Output is suppressed
unless the command fails.
"""
fd = os.popen(commandline, 'r')
data = fd.read()
xit = fd.close()
if xit is not None:
sys.stdout.write(data)
raise RuntimeError("command f... | python | Mac/BuildScript/build-installer.py | 521 | 534 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,609 | captureCommand | def captureCommand(commandline):
fd = os.popen(commandline, 'r')
data = fd.read()
xit = fd.close()
if xit is not None:
sys.stdout.write(data)
raise RuntimeError("command failed: %s"%(commandline,))
return data | python | Mac/BuildScript/build-installer.py | 536 | 544 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,610 | getTclTkVersion | def getTclTkVersion(configfile, versionline):
"""
search Tcl or Tk configuration file for version line
"""
try:
f = open(configfile, "r")
except OSError:
fatal("Framework configuration file not found: %s" % configfile)
for l in f:
if l.startswith(versionline):
... | python | Mac/BuildScript/build-installer.py | 546 | 561 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,611 | checkEnvironment | def checkEnvironment():
"""
Check that we're running on a supported system.
"""
if sys.version_info[0:2] < (2, 7):
fatal("This script must be run with Python 2.7 (or later)")
if platform.system() != 'Darwin':
fatal("This script should be run on a macOS 10.5 (or later) system")
... | python | Mac/BuildScript/build-installer.py | 563 | 636 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,612 | parseOptions | def parseOptions(args=None):
"""
Parse arguments and update global settings.
"""
global WORKDIR, DEPSRC, SRCDIR, DEPTARGET
global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX
global FW_VERSION_PREFIX
global FW_SSL_DIRECTORY
if args is None:
args = sys.argv[1:]
try:
... | python | Mac/BuildScript/build-installer.py | 638 | 718 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,613 | extractArchive | def extractArchive(builddir, archiveName):
"""
Extract a source archive into 'builddir'. Returns the path of the
extracted archive.
XXX: This function assumes that archives contain a toplevel directory
that is has the same name as the basename of the archive. This is
safe enough for almost anyt... | python | Mac/BuildScript/build-installer.py | 720 | 775 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,614 | downloadURL | def downloadURL(url, fname):
"""
Download the contents of the url into the file.
"""
fpIn = urllib_request.urlopen(url)
fpOut = open(fname, 'wb')
block = fpIn.read(10240)
try:
while block:
fpOut.write(block)
block = fpIn.read(10240)
fpIn.close()
... | python | Mac/BuildScript/build-installer.py | 777 | 794 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,615 | verifyThirdPartyFile | def verifyThirdPartyFile(url, checksum, fname):
"""
Download file from url to filename fname if it does not already exist.
Abort if file contents does not match supplied md5 checksum.
"""
name = os.path.basename(fname)
if os.path.exists(fname):
print("Using local copy of %s"%(name,))
... | python | Mac/BuildScript/build-installer.py | 796 | 818 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,616 | build_universal_openssl | def build_universal_openssl(basedir, archList):
"""
Special case build recipe for universal build of openssl.
The upstream OpenSSL build system does not directly support
OS X universal builds. We need to build each architecture
separately then lipo them together into fat libraries.
"""
# ... | python | Mac/BuildScript/build-installer.py | 820 | 950 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,617 | build_openssl_arch | def build_openssl_arch(archbase, arch):
"Build one architecture of openssl"
arch_opts = {
"i386": ["darwin-i386-cc"],
"x86_64": ["darwin64-x86_64-cc", "enable-ec_nistp_64_gcc_128"],
"arm64": ["darwin64-arm64-cc"],
"ppc": ["darwin-ppc-cc"],
"ppc... | python | Mac/BuildScript/build-installer.py | 834 | 872 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,618 | buildRecipe | def buildRecipe(recipe, basedir, archList):
"""
Build software using a recipe. This function does the
'configure;make;make install' dance for C software, with a possibility
to customize this process, basically a poor-mans DarwinPorts.
"""
curdir = os.getcwd()
name = recipe['name']
THIRD... | python | Mac/BuildScript/build-installer.py | 952 | 1,070 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,619 | buildLibraries | def buildLibraries():
"""
Build our dependencies into $WORKDIR/libraries/usr/local
"""
print("")
print("Building required libraries")
print("")
universal = os.path.join(WORKDIR, 'libraries')
os.mkdir(universal)
os.makedirs(os.path.join(universal, 'usr', 'local', 'lib'))
os.makedi... | python | Mac/BuildScript/build-installer.py | 1,072 | 1,085 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,620 | buildPythonDocs | def buildPythonDocs():
# This stores the documentation as Resources/English.lproj/Documentation
# inside the framework. pydoc and IDLE will pick it up there.
print("Install python documentation")
rootDir = os.path.join(WORKDIR, '_root')
buildDir = os.path.join('../../Doc')
docdir = os.path.join(... | python | Mac/BuildScript/build-installer.py | 1,089 | 1,131 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,621 | buildPython | def buildPython():
print("Building a universal python for %s architectures" % UNIVERSALARCHS)
buildDir = os.path.join(WORKDIR, '_bld', 'python')
rootDir = os.path.join(WORKDIR, '_root')
if os.path.exists(buildDir):
shutil.rmtree(buildDir)
if os.path.exists(rootDir):
shutil.rmtree(r... | python | Mac/BuildScript/build-installer.py | 1,134 | 1,399 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,622 | patchFile | def patchFile(inPath, outPath):
data = fileContents(inPath)
data = data.replace('$FULL_VERSION', getFullVersion())
data = data.replace('$VERSION', getVersion())
data = data.replace('$MACOSX_DEPLOYMENT_TARGET', ''.join((DEPTARGET, ' or later')))
data = data.replace('$ARCHITECTURES', ", ".join(univers... | python | Mac/BuildScript/build-installer.py | 1,401 | 1,414 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,623 | patchScript | def patchScript(inPath, outPath):
major, minor = getVersionMajorMinor()
data = fileContents(inPath)
data = data.replace('@PYMAJOR@', str(major))
data = data.replace('@PYVER@', getVersion())
fp = open(outPath, 'w')
fp.write(data)
fp.close()
os.chmod(outPath, STAT_0o755) | python | Mac/BuildScript/build-installer.py | 1,416 | 1,424 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,624 | packageFromRecipe | def packageFromRecipe(targetDir, recipe):
curdir = os.getcwd()
try:
# The major version (such as 2.5) is included in the package name
# because having two version of python installed at the same time is
# common.
pkgname = '%s-%s'%(recipe['name'], getVersion())
srcdir = ... | python | Mac/BuildScript/build-installer.py | 1,428 | 1,517 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,625 | makeMpkgPlist | def makeMpkgPlist(path):
vers = getFullVersion()
major, minor = getVersionMajorMinor()
pl = dict(
CFBundleGetInfoString="Python %s"%(vers,),
CFBundleIdentifier='org.python.Python',
CFBundleName='Python',
CFBundleShortVersionString=vers,
IFMajorVe... | python | Mac/BuildScript/build-installer.py | 1,520 | 1,546 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,626 | buildInstaller | def buildInstaller():
# Zap all compiled files
for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')):
for fn in filenames:
if fn.endswith('.pyc') or fn.endswith('.pyo'):
os.unlink(os.path.join(dirpath, fn))
outdir = os.path.join(WORKDIR, 'installer')
... | python | Mac/BuildScript/build-installer.py | 1,549 | 1,589 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,627 | installSize | def installSize(clear=False, _saved=[]):
if clear:
del _saved[:]
if not _saved:
data = captureCommand("du -ks %s"%(
shellQuote(os.path.join(WORKDIR, '_root'))))
_saved.append("%d"%((0.5 + (int(data.split()[0]) / 1024.0)),))
return _saved[0] | python | Mac/BuildScript/build-installer.py | 1,592 | 1,599 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,628 | buildDMG | def buildDMG():
"""
Create DMG containing the rootDir.
"""
outdir = os.path.join(WORKDIR, 'diskimage')
if os.path.exists(outdir):
shutil.rmtree(outdir)
# We used to use the deployment target as the last characters of the
# installer file name. With the introduction of weaklinked ins... | python | Mac/BuildScript/build-installer.py | 1,602 | 1,690 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,629 | setIcon | def setIcon(filePath, icnsPath):
"""
Set the custom icon for the specified file or directory.
"""
dirPath = os.path.normpath(os.path.dirname(__file__))
toolPath = os.path.join(dirPath, "seticon.app/Contents/MacOS/seticon")
if not os.path.exists(toolPath) or os.stat(toolPath).st_mtime < os.stat(... | python | Mac/BuildScript/build-installer.py | 1,693 | 1,710 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,630 | main | def main():
# First parse options and check if we can perform our work
parseOptions()
checkEnvironment()
os.environ['MACOSX_DEPLOYMENT_TARGET'] = DEPTARGET
os.environ['CC'] = CC
os.environ['CXX'] = CXX
if os.path.exists(WORKDIR):
shutil.rmtree(WORKDIR)
os.mkdir(WORKDIR)
os... | python | Mac/BuildScript/build-installer.py | 1,712 | 1,775 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,631 | writecode | def writecode(fp, mod, data):
print('unsigned char M_%s[] = {' % mod, file=fp)
indent = ' ' * 4
for i in range(0, len(data), 16):
print(indent, file=fp, end='')
for c in bytes(data[i:i+16]):
print('%d,' % c, file=fp, end='')
print('', file=fp)
print('};', file=fp) | python | Programs/freeze_test_frozenmain.py | 10 | 18 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,632 | dump | def dump(fp, filename, name):
# Strip the directory to get reproducible marshal dump
code_filename = os.path.basename(filename)
with tokenize.open(filename) as source_fp:
source = source_fp.read()
code = compile(source, code_filename, 'exec')
data = marshal.dumps(code)
writecode(fp... | python | Programs/freeze_test_frozenmain.py | 21 | 30 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,633 | main | def main():
if len(sys.argv) < 2:
print(f"usage: {sys.argv[0]} filename")
sys.exit(1)
filename = sys.argv[1]
with open(filename, "w") as fp:
print("// Auto-generated by Programs/freeze_test_frozenmain.py", file=fp)
frozenmain = os.path.join(PROGRAM_DIR, 'test_frozenmain.py')... | python | Programs/freeze_test_frozenmain.py | 33 | 44 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,634 | read_text | def read_text(inpath: str) -> bytes:
with open(inpath, "rb") as f:
return f.read() | python | Programs/_freeze_module.py | 18 | 20 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,635 | compile_and_marshal | def compile_and_marshal(name: str, text: bytes) -> bytes:
filename = f"<frozen {name}>"
# exec == Py_file_input
code = compile(text, filename, "exec", optimize=0, dont_inherit=True)
return marshal.dumps(code) | python | Programs/_freeze_module.py | 23 | 27 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,636 | get_varname | def get_varname(name: str, prefix: str) -> str:
return f"{prefix}{name.replace('.', '_')}" | python | Programs/_freeze_module.py | 30 | 31 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,637 | write_code | def write_code(outfile, marshalled: bytes, varname: str) -> None:
data_size = len(marshalled)
outfile.write(f"const unsigned char {varname}[] = {{\n")
for n in range(0, data_size, 16):
outfile.write(" ")
outfile.write(",".join(str(i) for i in marshalled[n : n + 16]))
outfile.wri... | python | Programs/_freeze_module.py | 34 | 43 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,638 | write_frozen | def write_frozen(outpath: str, inpath: str, name: str, marshalled: bytes) -> None:
with open(outpath, "w") as outfile:
outfile.write(header)
outfile.write("\n")
arrayname = get_varname(name, "_Py_M__")
write_code(outfile, marshalled, arrayname) | python | Programs/_freeze_module.py | 46 | 51 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,639 | main | def main():
if len(sys.argv) != 4:
sys.exit("need to specify the name, input and output paths\n")
name = sys.argv[1]
inpath = sys.argv[2]
outpath = sys.argv[3]
text = read_text(inpath)
marshalled = compile_and_marshal(name, text)
write_frozen(outpath, inpath, name, marshalled) | python | Programs/_freeze_module.py | 54 | 64 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,640 | urlretrieve | def urlretrieve(url, filename):
r = get(url, stream=True)
r.raise_for_status()
with open(filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
f.write(chunk)
return filename | python | PCbuild/urlretrieve.py | 24 | 30 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,641 | fix | def fix(p):
with open(p, 'r', encoding='utf-8-sig') as f:
data = f.read()
with open(p, 'w', encoding='utf-8-sig') as f:
f.write(data) | python | PCbuild/fix_encoding.py | 16 | 20 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,642 | fetch_zip | def fetch_zip(commit_hash, zip_dir, *, org='python', binary=False, verbose):
repo = f'cpython-{"bin" if binary else "source"}-deps'
url = f'https://github.com/{org}/{repo}/archive/{commit_hash}.zip'
reporthook = None
if verbose:
reporthook = print
zip_dir.mkdir(parents=True, exist_ok=True)
... | python | PCbuild/get_external.py | 12 | 24 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,643 | extract_zip | def extract_zip(externals_dir, zip_path):
with zipfile.ZipFile(os.fspath(zip_path)) as zf:
zf.extractall(os.fspath(externals_dir))
return externals_dir / zf.namelist()[0].split('/')[0] | python | PCbuild/get_external.py | 27 | 30 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,644 | parse_args | def parse_args():
p = argparse.ArgumentParser()
p.add_argument('-v', '--verbose', action='store_true')
p.add_argument('-b', '--binary', action='store_true',
help='Is the dependency in the binary repo?')
p.add_argument('-O', '--organization',
help='Organization ownin... | python | PCbuild/get_external.py | 33 | 45 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,645 | main | def main():
args = parse_args()
zip_path = fetch_zip(
args.tag,
args.externals_dir / 'zips',
org=args.organization,
binary=args.binary,
verbose=args.verbose,
)
final_name = args.externals_dir / args.tag
extracted = extract_zip(args.externals_dir, zip_path)
... | python | PCbuild/get_external.py | 48 | 73 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,646 | deltree | def deltree(root):
import os
from os.path import join
npyc = 0
for root, dirs, files in os.walk(root):
for name in files:
# to be thorough
if name.endswith(('.pyc', '.pyo')):
npyc += 1
os.remove(join(root, name))
return npyc | python | PCbuild/rmpyc.py | 4 | 16 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,647 | find_all_on_path | def find_all_on_path(filename, extras=None):
entries = os.environ["PATH"].split(os.pathsep)
ret = []
for p in entries:
fname = os.path.abspath(os.path.join(p, filename))
if os.path.isfile(fname) and fname not in ret:
ret.append(fname)
if extras:
for p in extras:
... | python | PCbuild/prepare_ssl.py | 30 | 42 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,648 | find_working_perl | def find_working_perl(perls):
for perl in perls:
try:
subprocess.check_output([perl, "-e", "use Win32;"])
except subprocess.CalledProcessError:
continue
else:
return perl
if perls:
print("The following perl interpreters were found:")
f... | python | PCbuild/prepare_ssl.py | 49 | 65 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,649 | copy_includes | def copy_includes(makefile, suffix):
dir = 'inc'+suffix+'\\openssl'
try:
os.makedirs(dir)
except OSError:
pass
copy_if_different = r'$(PERL) $(SRC_D)\util\copy-if-different.pl'
with open(makefile) as fin:
for line in fin:
if copy_if_different in line:
... | python | PCbuild/prepare_ssl.py | 68 | 85 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,650 | run_configure | def run_configure(configure, do_script):
print("perl Configure "+configure+" no-idea no-mdc2")
os.system("perl Configure "+configure+" no-idea no-mdc2")
print(do_script)
os.system(do_script) | python | PCbuild/prepare_ssl.py | 88 | 92 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,651 | fix_uplink | def fix_uplink():
# uplink.c tries to find the OPENSSL_Applink function exported from the current
# executable. However, we export it from _ssl[_d].pyd instead. So we update the
# module name here before building.
with open('ms\\uplink.c', 'r', encoding='utf-8') as f1:
code = list(f1)
os.rep... | python | PCbuild/prepare_ssl.py | 94 | 113 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,652 | prep | def prep(arch):
makefile_template = "ms\\ntdll{}.mak"
generated_makefile = makefile_template.format('')
if arch == "x86":
configure = "VC-WIN32"
do_script = "ms\\do_nasm"
suffix = "32"
elif arch == "amd64":
configure = "VC-WIN64A"
do_script = "ms\\do_win64a"
... | python | PCbuild/prepare_ssl.py | 115 | 142 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,653 | main | def main():
if len(sys.argv) == 1:
print("Not enough arguments: directory containing OpenSSL",
"sources must be supplied")
sys.exit(1)
if len(sys.argv) == 3 and sys.argv[2] not in ('x86', 'amd64'):
print("Second argument must be x86 or amd64")
sys.exit(1)
if l... | python | PCbuild/prepare_ssl.py | 144 | 200 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,654 | delete_if_exists | def delete_if_exists(path):
if path.exists():
print(f"Deleting {path} ...")
shutil.rmtree(path) | python | Android/android.py | 19 | 22 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,655 | subdir | def subdir(name, *, clean=None):
path = CROSS_BUILD_DIR / name
if clean:
delete_if_exists(path)
if not path.exists():
if clean is None:
sys.exit(
f"{path} does not exist. Create it by running the appropriate "
f"`configure` subcommand of {SCRIPT_NA... | python | Android/android.py | 25 | 36 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,656 | run | def run(command, *, host=None, **kwargs):
env = os.environ.copy()
if host:
env_script = CHECKOUT / "Android/android-env.sh"
env_output = subprocess.run(
f"set -eu; "
f"HOST={host}; "
f"PREFIX={subdir(host)}/prefix; "
f". {env_script}; "
... | python | Android/android.py | 39 | 71 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,657 | build_python_path | def build_python_path():
"""The path to the build Python binary."""
build_dir = subdir("build")
binary = build_dir / "python"
if not binary.is_file():
binary = binary.with_suffix(".exe")
if not binary.is_file():
raise FileNotFoundError("Unable to find `python(.exe)` in "
... | python | Android/android.py | 74 | 84 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,658 | configure_build_python | def configure_build_python(context):
os.chdir(subdir("build", clean=context.clean))
command = [relpath(CHECKOUT / "configure")]
if context.args:
command.extend(context.args)
run(command) | python | Android/android.py | 87 | 93 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,659 | make_build_python | def make_build_python(context):
os.chdir(subdir("build"))
run(["make", "-j", str(os.cpu_count())]) | python | Android/android.py | 96 | 98 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,660 | unpack_deps | def unpack_deps(host):
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
for name_ver in ["bzip2-1.0.8-1", "libffi-3.4.4-2", "openssl-3.0.13-1",
"sqlite-3.45.1-0", "xz-5.4.6-0"]:
filename = f"{name_ver}-{host}.tar.gz"
download(f"{deps_url}... | python | Android/android.py | 101 | 108 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,661 | download | def download(url, target_dir="."):
out_path = f"{target_dir}/{basename(url)}"
run(["curl", "-Lf", "-o", out_path, url])
return out_path | python | Android/android.py | 111 | 114 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,662 | configure_host_python | def configure_host_python(context):
host_dir = subdir(context.host, clean=context.clean)
prefix_dir = host_dir / "prefix"
if not prefix_dir.exists():
prefix_dir.mkdir()
os.chdir(prefix_dir)
unpack_deps(context.host)
build_dir = host_dir / "build"
build_dir.mkdir(exist_ok=Tr... | python | Android/android.py | 117 | 149 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,663 | make_host_python | def make_host_python(context):
host_dir = subdir(context.host)
os.chdir(host_dir / "build")
run(["make", "-j", str(os.cpu_count())], host=context.host)
run(["make", "install", f"prefix={host_dir}/prefix"], host=context.host) | python | Android/android.py | 152 | 156 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,664 | build_all | def build_all(context):
steps = [configure_build_python, make_build_python, configure_host_python,
make_host_python]
for step in steps:
step(context) | python | Android/android.py | 159 | 163 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,665 | clean_all | def clean_all(context):
delete_if_exists(CROSS_BUILD_DIR) | python | Android/android.py | 166 | 167 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,666 | setup_testbed | def setup_testbed(context):
ver_long = "8.7.0"
ver_short = ver_long.removesuffix(".0")
testbed_dir = CHECKOUT / "Android/testbed"
for filename in ["gradlew", "gradlew.bat"]:
out_path = download(
f"https://raw.githubusercontent.com/gradle/gradle/v{ver_long}/{filename}",
t... | python | Android/android.py | 173 | 191 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,667 | main | def main():
parser = argparse.ArgumentParser()
subcommands = parser.add_subparsers(dest="subcommand")
build = subcommands.add_parser("build", help="Build everything")
configure_build = subcommands.add_parser("configure-build",
help="Run `configure` for the "
... | python | Android/android.py | 194 | 233 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,668 | _fastcopy_fcopyfile | def _fastcopy_fcopyfile(fsrc, fdst, flags):
"""Copy a regular file content or metadata by using high-performance
fcopyfile(3) syscall (macOS).
"""
try:
infd = fsrc.fileno()
outfd = fdst.fileno()
except Exception as err:
raise _GiveupOnFastCopy(err) # not a regular file
... | python | Lib/shutil.py | 92 | 110 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,669 | _fastcopy_sendfile | def _fastcopy_sendfile(fsrc, fdst):
"""Copy data from one regular mmap-like fd to another by using
high-performance sendfile(2) syscall.
This should work on Linux >= 2.6.33 only.
"""
# Note: copyfileobj() is left alone in order to not introduce any
# unexpected breakage. Possible risks by using ... | python | Lib/shutil.py | 112 | 174 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,670 | _copyfileobj_readinto | def _copyfileobj_readinto(fsrc, fdst, length=COPY_BUFSIZE):
"""readinto()/memoryview() based variant of copyfileobj().
*fsrc* must support readinto() method and both files must be
open in binary mode.
"""
# Localize variable access to minimize overhead.
fsrc_readinto = fsrc.readinto
fdst_wri... | python | Lib/shutil.py | 176 | 194 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,671 | copyfileobj | def copyfileobj(fsrc, fdst, length=0):
"""copy data from file-like object fsrc to file-like object fdst"""
if not length:
length = COPY_BUFSIZE
# Localize variable access to minimize overhead.
fsrc_read = fsrc.read
fdst_write = fdst.write
while buf := fsrc_read(length):
fdst_writ... | python | Lib/shutil.py | 196 | 204 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,672 | _samefile | def _samefile(src, dst):
# Macintosh, Unix.
if isinstance(src, os.DirEntry) and hasattr(os.path, 'samestat'):
try:
return os.path.samestat(src.stat(), os.stat(dst))
except OSError:
return False
if hasattr(os.path, 'samefile'):
try:
return os.path.... | python | Lib/shutil.py | 206 | 222 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,673 | _stat | def _stat(fn):
return fn.stat() if isinstance(fn, os.DirEntry) else os.stat(fn) | python | Lib/shutil.py | 224 | 225 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,674 | _islink | def _islink(fn):
return fn.is_symlink() if isinstance(fn, os.DirEntry) else os.path.islink(fn) | python | Lib/shutil.py | 227 | 228 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,675 | copyfile | def copyfile(src, dst, *, follow_symlinks=True):
"""Copy data from src to dst in the most efficient way possible.
If follow_symlinks is not set and src is a symbolic link, a new
symlink will be created instead of copying the file it points to.
"""
sys.audit("shutil.copyfile", src, dst)
if _sa... | python | Lib/shutil.py | 230 | 292 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,676 | copymode | def copymode(src, dst, *, follow_symlinks=True):
"""Copy mode bits from src to dst.
If follow_symlinks is not set, symlinks aren't followed if and only
if both `src` and `dst` are symlinks. If `lchmod` isn't available
(e.g. Linux) this method does nothing.
"""
sys.audit("shutil.copymode", src... | python | Lib/shutil.py | 294 | 318 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,677 | chmod_func | def chmod_func(*args):
os.chmod(*args, follow_symlinks=True) | python | Lib/shutil.py | 312 | 313 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,678 | _copyxattr | def _copyxattr(src, dst, *, follow_symlinks=True):
"""Copy extended filesystem attributes from `src` to `dst`.
Overwrite existing attributes.
If `follow_symlinks` is false, symlinks won't be followed.
"""
try:
names = os.listxattr(src, follow_symlinks=follow_symli... | python | Lib/shutil.py | 321 | 343 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,679 | _copyxattr | def _copyxattr(*args, **kwargs):
pass | python | Lib/shutil.py | 345 | 346 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,680 | copystat | def copystat(src, dst, *, follow_symlinks=True):
"""Copy file metadata
Copy the permission bits, last access time, last modification time, and
flags from `src` to `dst`. On Linux, copystat() also copies the "extended
attributes" where possible. The file contents, owner, and group are
unaffected. `s... | python | Lib/shutil.py | 348 | 412 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,681 | _nop | def _nop(*args, ns=None, follow_symlinks=None):
pass | python | Lib/shutil.py | 362 | 363 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,682 | lookup | def lookup(name):
return getattr(os, name, _nop) | python | Lib/shutil.py | 369 | 370 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,683 | lookup | def lookup(name):
fn = getattr(os, name, _nop)
if fn in os.supports_follow_symlinks:
return fn
return _nop | python | Lib/shutil.py | 374 | 378 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,684 | copy | def copy(src, dst, *, follow_symlinks=True):
"""Copy data and mode bits ("cp src dst"). Return the file's destination.
The destination may be a directory.
If follow_symlinks is false, symlinks won't be followed. This
resembles GNU's "cp -P src dst".
If source and destination are the same file, a ... | python | Lib/shutil.py | 414 | 430 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,685 | copy2 | def copy2(src, dst, *, follow_symlinks=True):
"""Copy data and metadata. Return the file's destination.
Metadata is copied with copystat(). Please see the copystat function
for more information.
The destination may be a directory.
If follow_symlinks is false, symlinks won't be followed. This
... | python | Lib/shutil.py | 432 | 470 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,686 | ignore_patterns | def ignore_patterns(*patterns):
"""Function that can be used as copytree() ignore parameter.
Patterns is a sequence of glob-style patterns
that are used to exclude files"""
def _ignore_patterns(path, names):
ignored_names = []
for pattern in patterns:
ignored_names.extend(fn... | python | Lib/shutil.py | 472 | 482 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,687 | _ignore_patterns | def _ignore_patterns(path, names):
ignored_names = []
for pattern in patterns:
ignored_names.extend(fnmatch.filter(names, pattern))
return set(ignored_names) | python | Lib/shutil.py | 477 | 481 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,688 | _copytree | def _copytree(entries, src, dst, symlinks, ignore, copy_function,
ignore_dangling_symlinks, dirs_exist_ok=False):
if ignore is not None:
ignored_names = ignore(os.fspath(src), [x.name for x in entries])
else:
ignored_names = ()
os.makedirs(dst, exist_ok=dirs_exist_ok)
erro... | python | Lib/shutil.py | 484 | 548 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,689 | copytree | def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
ignore_dangling_symlinks=False, dirs_exist_ok=False):
"""Recursively copy a directory tree and return the destination directory.
If exception(s) occur, an Error is raised with a list of reasons.
If the optional symlinks ... | python | Lib/shutil.py | 550 | 596 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,690 | _rmtree_islink | def _rmtree_islink(st):
return (stat.S_ISLNK(st.st_mode) or
(st.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT
and st.st_reparse_tag == stat.IO_REPARSE_TAG_MOUNT_POINT)) | python | Lib/shutil.py | 599 | 602 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,691 | _rmtree_islink | def _rmtree_islink(st):
return stat.S_ISLNK(st.st_mode) | python | Lib/shutil.py | 604 | 605 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,692 | _rmtree_unsafe | def _rmtree_unsafe(path, onexc):
try:
with os.scandir(path) as scandir_it:
entries = list(scandir_it)
except FileNotFoundError:
return
except OSError as err:
onexc(os.scandir, path, err)
entries = []
for entry in entries:
fullname = entry.path
... | python | Lib/shutil.py | 608 | 651 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,693 | _rmtree_safe_fd | def _rmtree_safe_fd(topfd, path, onexc):
try:
with os.scandir(topfd) as scandir_it:
entries = list(scandir_it)
except FileNotFoundError:
return
except OSError as err:
err.filename = path
onexc(os.scandir, path, err)
return
for entry in entries:
... | python | Lib/shutil.py | 654 | 728 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,694 | rmtree | def rmtree(path, ignore_errors=False, onerror=None, *, onexc=None, dir_fd=None):
"""Recursively delete a directory tree.
If dir_fd is not None, it should be a file descriptor open to a directory;
path will then be relative to that directory.
dir_fd may not be implemented on your platform.
If it is ... | python | Lib/shutil.py | 735 | 836 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,695 | onexc | def onexc(*args):
pass | python | Lib/shutil.py | 758 | 759 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,696 | onexc | def onexc(*args):
raise | python | Lib/shutil.py | 761 | 762 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,697 | onexc | def onexc(*args):
raise | python | Lib/shutil.py | 765 | 766 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,698 | onexc | def onexc(*args):
func, path, exc = args
if exc is None:
exc_info = None, None, None
else:
exc_info = type(exc), exc, exc.__traceback__
return onerror(func, path, exc_info) | python | Lib/shutil.py | 769 | 775 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,699 | _basename | def _basename(path):
"""A basename() variant which first strips the trailing slash, if present.
Thus we always get the last component of the path, even for directories.
path: Union[PathLike, str]
e.g.
>>> os.path.basename('/bar/foo')
'foo'
>>> os.path.basename('/bar/foo/')
''
>>> _... | python | Lib/shutil.py | 842 | 858 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
10,700 | move | def move(src, dst, copy_function=copy2):
"""Recursively move a file or directory to another location. This is
similar to the Unix "mv" command. Return the file or directory's
destination.
If dst is an existing directory or a symlink to a directory, then src is
moved inside that directory. The desti... | python | Lib/shutil.py | 860 | 924 | {
"name": "PublicHealthInformationTechnology/cpython",
"url": "https://github.com/PublicHealthInformationTechnology/cpython.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.