' %
+ (' ', link, call)]
+ if index is not None:
+ i = lnum - index
+ for line in lines:
+ num = small(' ' * (5-len(str(i))) + str(i)) + ' '
+ if i in highlight:
+ line = '=>%s%s' % (num, pydoc.html.preformat(line))
+ rows.append('
' % grey(line))
+ i += 1
+
+ done, dump = {}, []
+ for name, where, value in vars:
+ if name in done: continue
+ done[name] = 1
+ if value is not __UNDEF__:
+ if where in ('global', 'builtin'):
+ name = ('%s ' % where) + strong(name)
+ elif where == 'local':
+ name = strong(name)
+ else:
+ name = where + strong(name.split('.')[-1])
+ dump.append('%s = %s' % (name, pydoc.html.repr(value)))
+ else:
+ dump.append(name + ' undefined')
+
+ rows.append('
A problem occurred in a Python script.\n')
+
+ if self.logdir is not None:
+ suffix = ['.txt', '.html'][self.format=="html"]
+ (fd, path) = tempfile.mkstemp(suffix=suffix, dir=self.logdir)
+
+ try:
+ with os.fdopen(fd, 'w') as file:
+ file.write(doc)
+ msg = '%s contains the description of this error.' % path
+ except:
+ msg = 'Tried to save traceback to %s, but failed.' % path
+
+ if self.format == 'html':
+ self.file.write('
%s
\n' % msg)
+ else:
+ self.file.write(msg + '\n')
+ try:
+ self.file.flush()
+ except: pass
+
+handler = Hook().handle
+def enable(display=1, logdir=None, context=5, format="html"):
+ """Install an exception handler that formats tracebacks as HTML.
+
+ The optional argument 'display' can be set to 0 to suppress sending the
+ traceback to the browser, and 'logdir' can be set to a directory to cause
+ tracebacks to be written to files there."""
+ sys.excepthook = Hook(display=display, logdir=logdir,
+ context=context, format=format)
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/chunk.py b/physworld_p1_20261018/envs/p1/lib/python3.11/chunk.py
new file mode 100644
index 0000000000000000000000000000000000000000..618781efd11e71593ac94032c101aa4038100029
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/chunk.py
@@ -0,0 +1,173 @@
+"""Simple class to read IFF chunks.
+
+An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
+Format)) has the following structure:
+
++----------------+
+| ID (4 bytes) |
++----------------+
+| size (4 bytes) |
++----------------+
+| data |
+| ... |
++----------------+
+
+The ID is a 4-byte string which identifies the type of chunk.
+
+The size field (a 32-bit value, encoded using big-endian byte order)
+gives the size of the whole chunk, including the 8-byte header.
+
+Usually an IFF-type file consists of one or more chunks. The proposed
+usage of the Chunk class defined here is to instantiate an instance at
+the start of each chunk and read from the instance until it reaches
+the end, after which a new instance can be instantiated. At the end
+of the file, creating a new instance will fail with an EOFError
+exception.
+
+Usage:
+while True:
+ try:
+ chunk = Chunk(file)
+ except EOFError:
+ break
+ chunktype = chunk.getname()
+ while True:
+ data = chunk.read(nbytes)
+ if not data:
+ pass
+ # do something with data
+
+The interface is file-like. The implemented methods are:
+read, close, seek, tell, isatty.
+Extra methods are: skip() (called by close, skips to the end of the chunk),
+getname() (returns the name (ID) of the chunk)
+
+The __init__ method has one required argument, a file-like object
+(including a chunk instance), and one optional argument, a flag which
+specifies whether or not chunks are aligned on 2-byte boundaries. The
+default is 1, i.e. aligned.
+"""
+
+import warnings
+
+warnings._deprecated(__name__, remove=(3, 13))
+
+class Chunk:
+ def __init__(self, file, align=True, bigendian=True, inclheader=False):
+ import struct
+ self.closed = False
+ self.align = align # whether to align to word (2-byte) boundaries
+ if bigendian:
+ strflag = '>'
+ else:
+ strflag = '<'
+ self.file = file
+ self.chunkname = file.read(4)
+ if len(self.chunkname) < 4:
+ raise EOFError
+ try:
+ self.chunksize = struct.unpack_from(strflag+'L', file.read(4))[0]
+ except struct.error:
+ raise EOFError from None
+ if inclheader:
+ self.chunksize = self.chunksize - 8 # subtract header
+ self.size_read = 0
+ try:
+ self.offset = self.file.tell()
+ except (AttributeError, OSError):
+ self.seekable = False
+ else:
+ self.seekable = True
+
+ def getname(self):
+ """Return the name (ID) of the current chunk."""
+ return self.chunkname
+
+ def getsize(self):
+ """Return the size of the current chunk."""
+ return self.chunksize
+
+ def close(self):
+ if not self.closed:
+ try:
+ self.skip()
+ finally:
+ self.closed = True
+
+ def isatty(self):
+ if self.closed:
+ raise ValueError("I/O operation on closed file")
+ return False
+
+ def seek(self, pos, whence=0):
+ """Seek to specified position into the chunk.
+ Default position is 0 (start of chunk).
+ If the file is not seekable, this will result in an error.
+ """
+
+ if self.closed:
+ raise ValueError("I/O operation on closed file")
+ if not self.seekable:
+ raise OSError("cannot seek")
+ if whence == 1:
+ pos = pos + self.size_read
+ elif whence == 2:
+ pos = pos + self.chunksize
+ if pos < 0 or pos > self.chunksize:
+ raise RuntimeError
+ self.file.seek(self.offset + pos, 0)
+ self.size_read = pos
+
+ def tell(self):
+ if self.closed:
+ raise ValueError("I/O operation on closed file")
+ return self.size_read
+
+ def read(self, size=-1):
+ """Read at most size bytes from the chunk.
+ If size is omitted or negative, read until the end
+ of the chunk.
+ """
+
+ if self.closed:
+ raise ValueError("I/O operation on closed file")
+ if self.size_read >= self.chunksize:
+ return b''
+ if size < 0:
+ size = self.chunksize - self.size_read
+ if size > self.chunksize - self.size_read:
+ size = self.chunksize - self.size_read
+ data = self.file.read(size)
+ self.size_read = self.size_read + len(data)
+ if self.size_read == self.chunksize and \
+ self.align and \
+ (self.chunksize & 1):
+ dummy = self.file.read(1)
+ self.size_read = self.size_read + len(dummy)
+ return data
+
+ def skip(self):
+ """Skip the rest of the chunk.
+ If you are not interested in the contents of the chunk,
+ this method should be called so that the file points to
+ the start of the next chunk.
+ """
+
+ if self.closed:
+ raise ValueError("I/O operation on closed file")
+ if self.seekable:
+ try:
+ n = self.chunksize - self.size_read
+ # maybe fix alignment
+ if self.align and (self.chunksize & 1):
+ n = n + 1
+ self.file.seek(n, 1)
+ self.size_read = self.size_read + n
+ return
+ except OSError:
+ pass
+ while self.size_read < self.chunksize:
+ n = min(8192, self.chunksize - self.size_read)
+ dummy = self.read(n)
+ if not dummy:
+ raise EOFError
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/cmd.py b/physworld_p1_20261018/envs/p1/lib/python3.11/cmd.py
new file mode 100644
index 0000000000000000000000000000000000000000..88ee7d3ddc46944a7232128cfa8b4fa6223769db
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/cmd.py
@@ -0,0 +1,401 @@
+"""A generic class to build line-oriented command interpreters.
+
+Interpreters constructed with this class obey the following conventions:
+
+1. End of file on input is processed as the command 'EOF'.
+2. A command is parsed out of each line by collecting the prefix composed
+ of characters in the identchars member.
+3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
+ is passed a single argument consisting of the remainder of the line.
+4. Typing an empty line repeats the last command. (Actually, it calls the
+ method `emptyline', which may be overridden in a subclass.)
+5. There is a predefined `help' method. Given an argument `topic', it
+ calls the command `help_topic'. With no arguments, it lists all topics
+ with defined help_ functions, broken into up to three topics; documented
+ commands, miscellaneous help topics, and undocumented commands.
+6. The command '?' is a synonym for `help'. The command '!' is a synonym
+ for `shell', if a do_shell method exists.
+7. If completion is enabled, completing commands will be done automatically,
+ and completing of commands args is done by calling complete_foo() with
+ arguments text, line, begidx, endidx. text is string we are matching
+ against, all returned matches must begin with it. line is the current
+ input line (lstripped), begidx and endidx are the beginning and end
+ indexes of the text being matched, which could be used to provide
+ different completion depending upon which position the argument is in.
+
+The `default' method may be overridden to intercept commands for which there
+is no do_ method.
+
+The `completedefault' method may be overridden to intercept completions for
+commands that have no complete_ method.
+
+The data member `self.ruler' sets the character used to draw separator lines
+in the help messages. If empty, no ruler line is drawn. It defaults to "=".
+
+If the value of `self.intro' is nonempty when the cmdloop method is called,
+it is printed out on interpreter startup. This value may be overridden
+via an optional argument to the cmdloop() method.
+
+The data members `self.doc_header', `self.misc_header', and
+`self.undoc_header' set the headers used for the help function's
+listings of documented functions, miscellaneous topics, and undocumented
+functions respectively.
+"""
+
+import string, sys
+
+__all__ = ["Cmd"]
+
+PROMPT = '(Cmd) '
+IDENTCHARS = string.ascii_letters + string.digits + '_'
+
+class Cmd:
+ """A simple framework for writing line-oriented command interpreters.
+
+ These are often useful for test harnesses, administrative tools, and
+ prototypes that will later be wrapped in a more sophisticated interface.
+
+ A Cmd instance or subclass instance is a line-oriented interpreter
+ framework. There is no good reason to instantiate Cmd itself; rather,
+ it's useful as a superclass of an interpreter class you define yourself
+ in order to inherit Cmd's methods and encapsulate action methods.
+
+ """
+ prompt = PROMPT
+ identchars = IDENTCHARS
+ ruler = '='
+ lastcmd = ''
+ intro = None
+ doc_leader = ""
+ doc_header = "Documented commands (type help ):"
+ misc_header = "Miscellaneous help topics:"
+ undoc_header = "Undocumented commands:"
+ nohelp = "*** No help on %s"
+ use_rawinput = 1
+
+ def __init__(self, completekey='tab', stdin=None, stdout=None):
+ """Instantiate a line-oriented interpreter framework.
+
+ The optional argument 'completekey' is the readline name of a
+ completion key; it defaults to the Tab key. If completekey is
+ not None and the readline module is available, command completion
+ is done automatically. The optional arguments stdin and stdout
+ specify alternate input and output file objects; if not specified,
+ sys.stdin and sys.stdout are used.
+
+ """
+ if stdin is not None:
+ self.stdin = stdin
+ else:
+ self.stdin = sys.stdin
+ if stdout is not None:
+ self.stdout = stdout
+ else:
+ self.stdout = sys.stdout
+ self.cmdqueue = []
+ self.completekey = completekey
+
+ def cmdloop(self, intro=None):
+ """Repeatedly issue a prompt, accept input, parse an initial prefix
+ off the received input, and dispatch to action methods, passing them
+ the remainder of the line as argument.
+
+ """
+
+ self.preloop()
+ if self.use_rawinput and self.completekey:
+ try:
+ import readline
+ self.old_completer = readline.get_completer()
+ readline.set_completer(self.complete)
+ readline.parse_and_bind(self.completekey+": complete")
+ except ImportError:
+ pass
+ try:
+ if intro is not None:
+ self.intro = intro
+ if self.intro:
+ self.stdout.write(str(self.intro)+"\n")
+ stop = None
+ while not stop:
+ if self.cmdqueue:
+ line = self.cmdqueue.pop(0)
+ else:
+ if self.use_rawinput:
+ try:
+ line = input(self.prompt)
+ except EOFError:
+ line = 'EOF'
+ else:
+ self.stdout.write(self.prompt)
+ self.stdout.flush()
+ line = self.stdin.readline()
+ if not len(line):
+ line = 'EOF'
+ else:
+ line = line.rstrip('\r\n')
+ line = self.precmd(line)
+ stop = self.onecmd(line)
+ stop = self.postcmd(stop, line)
+ self.postloop()
+ finally:
+ if self.use_rawinput and self.completekey:
+ try:
+ import readline
+ readline.set_completer(self.old_completer)
+ except ImportError:
+ pass
+
+
+ def precmd(self, line):
+ """Hook method executed just before the command line is
+ interpreted, but after the input prompt is generated and issued.
+
+ """
+ return line
+
+ def postcmd(self, stop, line):
+ """Hook method executed just after a command dispatch is finished."""
+ return stop
+
+ def preloop(self):
+ """Hook method executed once when the cmdloop() method is called."""
+ pass
+
+ def postloop(self):
+ """Hook method executed once when the cmdloop() method is about to
+ return.
+
+ """
+ pass
+
+ def parseline(self, line):
+ """Parse the line into a command name and a string containing
+ the arguments. Returns a tuple containing (command, args, line).
+ 'command' and 'args' may be None if the line couldn't be parsed.
+ """
+ line = line.strip()
+ if not line:
+ return None, None, line
+ elif line[0] == '?':
+ line = 'help ' + line[1:]
+ elif line[0] == '!':
+ if hasattr(self, 'do_shell'):
+ line = 'shell ' + line[1:]
+ else:
+ return None, None, line
+ i, n = 0, len(line)
+ while i < n and line[i] in self.identchars: i = i+1
+ cmd, arg = line[:i], line[i:].strip()
+ return cmd, arg, line
+
+ def onecmd(self, line):
+ """Interpret the argument as though it had been typed in response
+ to the prompt.
+
+ This may be overridden, but should not normally need to be;
+ see the precmd() and postcmd() methods for useful execution hooks.
+ The return value is a flag indicating whether interpretation of
+ commands by the interpreter should stop.
+
+ """
+ cmd, arg, line = self.parseline(line)
+ if not line:
+ return self.emptyline()
+ if cmd is None:
+ return self.default(line)
+ self.lastcmd = line
+ if line == 'EOF' :
+ self.lastcmd = ''
+ if cmd == '':
+ return self.default(line)
+ else:
+ try:
+ func = getattr(self, 'do_' + cmd)
+ except AttributeError:
+ return self.default(line)
+ return func(arg)
+
+ def emptyline(self):
+ """Called when an empty line is entered in response to the prompt.
+
+ If this method is not overridden, it repeats the last nonempty
+ command entered.
+
+ """
+ if self.lastcmd:
+ return self.onecmd(self.lastcmd)
+
+ def default(self, line):
+ """Called on an input line when the command prefix is not recognized.
+
+ If this method is not overridden, it prints an error message and
+ returns.
+
+ """
+ self.stdout.write('*** Unknown syntax: %s\n'%line)
+
+ def completedefault(self, *ignored):
+ """Method called to complete an input line when no command-specific
+ complete_*() method is available.
+
+ By default, it returns an empty list.
+
+ """
+ return []
+
+ def completenames(self, text, *ignored):
+ dotext = 'do_'+text
+ return [a[3:] for a in self.get_names() if a.startswith(dotext)]
+
+ def complete(self, text, state):
+ """Return the next possible completion for 'text'.
+
+ If a command has not been entered, then complete against command list.
+ Otherwise try to call complete_ to get list of completions.
+ """
+ if state == 0:
+ import readline
+ origline = readline.get_line_buffer()
+ line = origline.lstrip()
+ stripped = len(origline) - len(line)
+ begidx = readline.get_begidx() - stripped
+ endidx = readline.get_endidx() - stripped
+ if begidx>0:
+ cmd, args, foo = self.parseline(line)
+ if cmd == '':
+ compfunc = self.completedefault
+ else:
+ try:
+ compfunc = getattr(self, 'complete_' + cmd)
+ except AttributeError:
+ compfunc = self.completedefault
+ else:
+ compfunc = self.completenames
+ self.completion_matches = compfunc(text, line, begidx, endidx)
+ try:
+ return self.completion_matches[state]
+ except IndexError:
+ return None
+
+ def get_names(self):
+ # This method used to pull in base class attributes
+ # at a time dir() didn't do it yet.
+ return dir(self.__class__)
+
+ def complete_help(self, *args):
+ commands = set(self.completenames(*args))
+ topics = set(a[5:] for a in self.get_names()
+ if a.startswith('help_' + args[0]))
+ return list(commands | topics)
+
+ def do_help(self, arg):
+ 'List available commands with "help" or detailed help with "help cmd".'
+ if arg:
+ # XXX check arg syntax
+ try:
+ func = getattr(self, 'help_' + arg)
+ except AttributeError:
+ try:
+ doc=getattr(self, 'do_' + arg).__doc__
+ if doc:
+ self.stdout.write("%s\n"%str(doc))
+ return
+ except AttributeError:
+ pass
+ self.stdout.write("%s\n"%str(self.nohelp % (arg,)))
+ return
+ func()
+ else:
+ names = self.get_names()
+ cmds_doc = []
+ cmds_undoc = []
+ topics = set()
+ for name in names:
+ if name[:5] == 'help_':
+ topics.add(name[5:])
+ names.sort()
+ # There can be duplicates if routines overridden
+ prevname = ''
+ for name in names:
+ if name[:3] == 'do_':
+ if name == prevname:
+ continue
+ prevname = name
+ cmd=name[3:]
+ if cmd in topics:
+ cmds_doc.append(cmd)
+ topics.remove(cmd)
+ elif getattr(self, name).__doc__:
+ cmds_doc.append(cmd)
+ else:
+ cmds_undoc.append(cmd)
+ self.stdout.write("%s\n"%str(self.doc_leader))
+ self.print_topics(self.doc_header, cmds_doc, 15,80)
+ self.print_topics(self.misc_header, sorted(topics),15,80)
+ self.print_topics(self.undoc_header, cmds_undoc, 15,80)
+
+ def print_topics(self, header, cmds, cmdlen, maxcol):
+ if cmds:
+ self.stdout.write("%s\n"%str(header))
+ if self.ruler:
+ self.stdout.write("%s\n"%str(self.ruler * len(header)))
+ self.columnize(cmds, maxcol-1)
+ self.stdout.write("\n")
+
+ def columnize(self, list, displaywidth=80):
+ """Display a list of strings as a compact set of columns.
+
+ Each column is only as wide as necessary.
+ Columns are separated by two spaces (one was not legible enough).
+ """
+ if not list:
+ self.stdout.write("\n")
+ return
+
+ nonstrings = [i for i in range(len(list))
+ if not isinstance(list[i], str)]
+ if nonstrings:
+ raise TypeError("list[i] not a string for i in %s"
+ % ", ".join(map(str, nonstrings)))
+ size = len(list)
+ if size == 1:
+ self.stdout.write('%s\n'%str(list[0]))
+ return
+ # Try every row count from 1 upwards
+ for nrows in range(1, len(list)):
+ ncols = (size+nrows-1) // nrows
+ colwidths = []
+ totwidth = -2
+ for col in range(ncols):
+ colwidth = 0
+ for row in range(nrows):
+ i = row + nrows*col
+ if i >= size:
+ break
+ x = list[i]
+ colwidth = max(colwidth, len(x))
+ colwidths.append(colwidth)
+ totwidth += colwidth + 2
+ if totwidth > displaywidth:
+ break
+ if totwidth <= displaywidth:
+ break
+ else:
+ nrows = len(list)
+ ncols = 1
+ colwidths = [0]
+ for row in range(nrows):
+ texts = []
+ for col in range(ncols):
+ i = row + nrows*col
+ if i >= size:
+ x = ""
+ else:
+ x = list[i]
+ texts.append(x)
+ while texts and not texts[-1]:
+ del texts[-1]
+ for col in range(len(texts)):
+ texts[col] = texts[col].ljust(colwidths[col])
+ self.stdout.write("%s\n"%str(" ".join(texts)))
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/code.py b/physworld_p1_20261018/envs/p1/lib/python3.11/code.py
new file mode 100644
index 0000000000000000000000000000000000000000..76000f8c8b2c1e1c98f8fb4c831c2ea3e2de268d
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/code.py
@@ -0,0 +1,315 @@
+"""Utilities needed to emulate Python's interactive interpreter.
+
+"""
+
+# Inspired by similar code by Jeff Epler and Fredrik Lundh.
+
+
+import sys
+import traceback
+from codeop import CommandCompiler, compile_command
+
+__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact",
+ "compile_command"]
+
+class InteractiveInterpreter:
+ """Base class for InteractiveConsole.
+
+ This class deals with parsing and interpreter state (the user's
+ namespace); it doesn't deal with input buffering or prompting or
+ input file naming (the filename is always passed in explicitly).
+
+ """
+
+ def __init__(self, locals=None):
+ """Constructor.
+
+ The optional 'locals' argument specifies the dictionary in
+ which code will be executed; it defaults to a newly created
+ dictionary with key "__name__" set to "__console__" and key
+ "__doc__" set to None.
+
+ """
+ if locals is None:
+ locals = {"__name__": "__console__", "__doc__": None}
+ self.locals = locals
+ self.compile = CommandCompiler()
+
+ def runsource(self, source, filename="", symbol="single"):
+ """Compile and run some source in the interpreter.
+
+ Arguments are as for compile_command().
+
+ One of several things can happen:
+
+ 1) The input is incorrect; compile_command() raised an
+ exception (SyntaxError or OverflowError). A syntax traceback
+ will be printed by calling the showsyntaxerror() method.
+
+ 2) The input is incomplete, and more input is required;
+ compile_command() returned None. Nothing happens.
+
+ 3) The input is complete; compile_command() returned a code
+ object. The code is executed by calling self.runcode() (which
+ also handles run-time exceptions, except for SystemExit).
+
+ The return value is True in case 2, False in the other cases (unless
+ an exception is raised). The return value can be used to
+ decide whether to use sys.ps1 or sys.ps2 to prompt the next
+ line.
+
+ """
+ try:
+ code = self.compile(source, filename, symbol)
+ except (OverflowError, SyntaxError, ValueError):
+ # Case 1
+ self.showsyntaxerror(filename)
+ return False
+
+ if code is None:
+ # Case 2
+ return True
+
+ # Case 3
+ self.runcode(code)
+ return False
+
+ def runcode(self, code):
+ """Execute a code object.
+
+ When an exception occurs, self.showtraceback() is called to
+ display a traceback. All exceptions are caught except
+ SystemExit, which is reraised.
+
+ A note about KeyboardInterrupt: this exception may occur
+ elsewhere in this code, and may not always be caught. The
+ caller should be prepared to deal with it.
+
+ """
+ try:
+ exec(code, self.locals)
+ except SystemExit:
+ raise
+ except:
+ self.showtraceback()
+
+ def showsyntaxerror(self, filename=None):
+ """Display the syntax error that just occurred.
+
+ This doesn't display a stack trace because there isn't one.
+
+ If a filename is given, it is stuffed in the exception instead
+ of what was there before (because Python's parser always uses
+ "" when reading from a string).
+
+ The output is written by self.write(), below.
+
+ """
+ type, value, tb = sys.exc_info()
+ sys.last_type = type
+ sys.last_value = value
+ sys.last_traceback = tb
+ if filename and type is SyntaxError:
+ # Work hard to stuff the correct filename in the exception
+ try:
+ msg, (dummy_filename, lineno, offset, line) = value.args
+ except ValueError:
+ # Not the format we expect; leave it alone
+ pass
+ else:
+ # Stuff in the right filename
+ value = SyntaxError(msg, (filename, lineno, offset, line))
+ sys.last_value = value
+ if sys.excepthook is sys.__excepthook__:
+ lines = traceback.format_exception_only(type, value)
+ self.write(''.join(lines))
+ else:
+ # If someone has set sys.excepthook, we let that take precedence
+ # over self.write
+ sys.excepthook(type, value, tb)
+
+ def showtraceback(self):
+ """Display the exception that just occurred.
+
+ We remove the first stack item because it is our own code.
+
+ The output is written by self.write(), below.
+
+ """
+ sys.last_type, sys.last_value, last_tb = ei = sys.exc_info()
+ sys.last_traceback = last_tb
+ try:
+ lines = traceback.format_exception(ei[0], ei[1], last_tb.tb_next)
+ if sys.excepthook is sys.__excepthook__:
+ self.write(''.join(lines))
+ else:
+ # If someone has set sys.excepthook, we let that take precedence
+ # over self.write
+ sys.excepthook(ei[0], ei[1], last_tb)
+ finally:
+ last_tb = ei = None
+
+ def write(self, data):
+ """Write a string.
+
+ The base implementation writes to sys.stderr; a subclass may
+ replace this with a different implementation.
+
+ """
+ sys.stderr.write(data)
+
+
+class InteractiveConsole(InteractiveInterpreter):
+ """Closely emulate the behavior of the interactive Python interpreter.
+
+ This class builds on InteractiveInterpreter and adds prompting
+ using the familiar sys.ps1 and sys.ps2, and input buffering.
+
+ """
+
+ def __init__(self, locals=None, filename=""):
+ """Constructor.
+
+ The optional locals argument will be passed to the
+ InteractiveInterpreter base class.
+
+ The optional filename argument should specify the (file)name
+ of the input stream; it will show up in tracebacks.
+
+ """
+ InteractiveInterpreter.__init__(self, locals)
+ self.filename = filename
+ self.resetbuffer()
+
+ def resetbuffer(self):
+ """Reset the input buffer."""
+ self.buffer = []
+
+ def interact(self, banner=None, exitmsg=None):
+ """Closely emulate the interactive Python console.
+
+ The optional banner argument specifies the banner to print
+ before the first interaction; by default it prints a banner
+ similar to the one printed by the real Python interpreter,
+ followed by the current class name in parentheses (so as not
+ to confuse this with the real interpreter -- since it's so
+ close!).
+
+ The optional exitmsg argument specifies the exit message
+ printed when exiting. Pass the empty string to suppress
+ printing an exit message. If exitmsg is not given or None,
+ a default message is printed.
+
+ """
+ try:
+ sys.ps1
+ except AttributeError:
+ sys.ps1 = ">>> "
+ try:
+ sys.ps2
+ except AttributeError:
+ sys.ps2 = "... "
+ cprt = 'Type "help", "copyright", "credits" or "license" for more information.'
+ if banner is None:
+ self.write("Python %s on %s\n%s\n(%s)\n" %
+ (sys.version, sys.platform, cprt,
+ self.__class__.__name__))
+ elif banner:
+ self.write("%s\n" % str(banner))
+ more = 0
+ while 1:
+ try:
+ if more:
+ prompt = sys.ps2
+ else:
+ prompt = sys.ps1
+ try:
+ line = self.raw_input(prompt)
+ except EOFError:
+ self.write("\n")
+ break
+ else:
+ more = self.push(line)
+ except KeyboardInterrupt:
+ self.write("\nKeyboardInterrupt\n")
+ self.resetbuffer()
+ more = 0
+ if exitmsg is None:
+ self.write('now exiting %s...\n' % self.__class__.__name__)
+ elif exitmsg != '':
+ self.write('%s\n' % exitmsg)
+
+ def push(self, line):
+ """Push a line to the interpreter.
+
+ The line should not have a trailing newline; it may have
+ internal newlines. The line is appended to a buffer and the
+ interpreter's runsource() method is called with the
+ concatenated contents of the buffer as source. If this
+ indicates that the command was executed or invalid, the buffer
+ is reset; otherwise, the command is incomplete, and the buffer
+ is left as it was after the line was appended. The return
+ value is 1 if more input is required, 0 if the line was dealt
+ with in some way (this is the same as runsource()).
+
+ """
+ self.buffer.append(line)
+ source = "\n".join(self.buffer)
+ more = self.runsource(source, self.filename)
+ if not more:
+ self.resetbuffer()
+ return more
+
+ def raw_input(self, prompt=""):
+ """Write a prompt and read a line.
+
+ The returned line does not include the trailing newline.
+ When the user enters the EOF key sequence, EOFError is raised.
+
+ The base implementation uses the built-in function
+ input(); a subclass may replace this with a different
+ implementation.
+
+ """
+ return input(prompt)
+
+
+
+def interact(banner=None, readfunc=None, local=None, exitmsg=None):
+ """Closely emulate the interactive Python interpreter.
+
+ This is a backwards compatible interface to the InteractiveConsole
+ class. When readfunc is not specified, it attempts to import the
+ readline module to enable GNU readline if it is available.
+
+ Arguments (all optional, all default to None):
+
+ banner -- passed to InteractiveConsole.interact()
+ readfunc -- if not None, replaces InteractiveConsole.raw_input()
+ local -- passed to InteractiveInterpreter.__init__()
+ exitmsg -- passed to InteractiveConsole.interact()
+
+ """
+ console = InteractiveConsole(local)
+ if readfunc is not None:
+ console.raw_input = readfunc
+ else:
+ try:
+ import readline
+ except ImportError:
+ pass
+ console.interact(banner, exitmsg)
+
+
+if __name__ == "__main__":
+ import argparse
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-q', action='store_true',
+ help="don't print version and copyright messages")
+ args = parser.parse_args()
+ if args.q or sys.flags.quiet:
+ banner = ''
+ else:
+ banner = None
+ interact(banner)
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/codecs.py b/physworld_p1_20261018/envs/p1/lib/python3.11/codecs.py
new file mode 100644
index 0000000000000000000000000000000000000000..c6165fcb142a7f01104cee86a5a5ae1f3b995e1e
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/codecs.py
@@ -0,0 +1,1139 @@
+""" codecs -- Python Codec Registry, API and helpers.
+
+
+Written by Marc-Andre Lemburg (mal@lemburg.com).
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+
+"""
+
+import builtins
+import sys
+
+### Registry and builtin stateless codec functions
+
+try:
+ from _codecs import *
+except ImportError as why:
+ raise SystemError('Failed to load the builtin codecs: %s' % why)
+
+__all__ = ["register", "lookup", "open", "EncodedFile", "BOM", "BOM_BE",
+ "BOM_LE", "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",
+ "BOM_UTF8", "BOM_UTF16", "BOM_UTF16_LE", "BOM_UTF16_BE",
+ "BOM_UTF32", "BOM_UTF32_LE", "BOM_UTF32_BE",
+ "CodecInfo", "Codec", "IncrementalEncoder", "IncrementalDecoder",
+ "StreamReader", "StreamWriter",
+ "StreamReaderWriter", "StreamRecoder",
+ "getencoder", "getdecoder", "getincrementalencoder",
+ "getincrementaldecoder", "getreader", "getwriter",
+ "encode", "decode", "iterencode", "iterdecode",
+ "strict_errors", "ignore_errors", "replace_errors",
+ "xmlcharrefreplace_errors",
+ "backslashreplace_errors", "namereplace_errors",
+ "register_error", "lookup_error"]
+
+### Constants
+
+#
+# Byte Order Mark (BOM = ZERO WIDTH NO-BREAK SPACE = U+FEFF)
+# and its possible byte string values
+# for UTF8/UTF16/UTF32 output and little/big endian machines
+#
+
+# UTF-8
+BOM_UTF8 = b'\xef\xbb\xbf'
+
+# UTF-16, little endian
+BOM_LE = BOM_UTF16_LE = b'\xff\xfe'
+
+# UTF-16, big endian
+BOM_BE = BOM_UTF16_BE = b'\xfe\xff'
+
+# UTF-32, little endian
+BOM_UTF32_LE = b'\xff\xfe\x00\x00'
+
+# UTF-32, big endian
+BOM_UTF32_BE = b'\x00\x00\xfe\xff'
+
+if sys.byteorder == 'little':
+
+ # UTF-16, native endianness
+ BOM = BOM_UTF16 = BOM_UTF16_LE
+
+ # UTF-32, native endianness
+ BOM_UTF32 = BOM_UTF32_LE
+
+else:
+
+ # UTF-16, native endianness
+ BOM = BOM_UTF16 = BOM_UTF16_BE
+
+ # UTF-32, native endianness
+ BOM_UTF32 = BOM_UTF32_BE
+
+# Old broken names (don't use in new code)
+BOM32_LE = BOM_UTF16_LE
+BOM32_BE = BOM_UTF16_BE
+BOM64_LE = BOM_UTF32_LE
+BOM64_BE = BOM_UTF32_BE
+
+
+### Codec base classes (defining the API)
+
+class CodecInfo(tuple):
+ """Codec details when looking up the codec registry"""
+
+ # Private API to allow Python 3.4 to denylist the known non-Unicode
+ # codecs in the standard library. A more general mechanism to
+ # reliably distinguish test encodings from other codecs will hopefully
+ # be defined for Python 3.5
+ #
+ # See http://bugs.python.org/issue19619
+ _is_text_encoding = True # Assume codecs are text encodings by default
+
+ def __new__(cls, encode, decode, streamreader=None, streamwriter=None,
+ incrementalencoder=None, incrementaldecoder=None, name=None,
+ *, _is_text_encoding=None):
+ self = tuple.__new__(cls, (encode, decode, streamreader, streamwriter))
+ self.name = name
+ self.encode = encode
+ self.decode = decode
+ self.incrementalencoder = incrementalencoder
+ self.incrementaldecoder = incrementaldecoder
+ self.streamwriter = streamwriter
+ self.streamreader = streamreader
+ if _is_text_encoding is not None:
+ self._is_text_encoding = _is_text_encoding
+ return self
+
+ def __repr__(self):
+ return "<%s.%s object for encoding %s at %#x>" % \
+ (self.__class__.__module__, self.__class__.__qualname__,
+ self.name, id(self))
+
+class Codec:
+
+ """ Defines the interface for stateless encoders/decoders.
+
+ The .encode()/.decode() methods may use different error
+ handling schemes by providing the errors argument. These
+ string values are predefined:
+
+ 'strict' - raise a ValueError error (or a subclass)
+ 'ignore' - ignore the character and continue with the next
+ 'replace' - replace with a suitable replacement character;
+ Python will use the official U+FFFD REPLACEMENT
+ CHARACTER for the builtin Unicode codecs on
+ decoding and '?' on encoding.
+ 'surrogateescape' - replace with private code points U+DCnn.
+ 'xmlcharrefreplace' - Replace with the appropriate XML
+ character reference (only for encoding).
+ 'backslashreplace' - Replace with backslashed escape sequences.
+ 'namereplace' - Replace with \\N{...} escape sequences
+ (only for encoding).
+
+ The set of allowed values can be extended via register_error.
+
+ """
+ def encode(self, input, errors='strict'):
+
+ """ Encodes the object input and returns a tuple (output
+ object, length consumed).
+
+ errors defines the error handling to apply. It defaults to
+ 'strict' handling.
+
+ The method may not store state in the Codec instance. Use
+ StreamWriter for codecs which have to keep state in order to
+ make encoding efficient.
+
+ The encoder must be able to handle zero length input and
+ return an empty object of the output object type in this
+ situation.
+
+ """
+ raise NotImplementedError
+
+ def decode(self, input, errors='strict'):
+
+ """ Decodes the object input and returns a tuple (output
+ object, length consumed).
+
+ input must be an object which provides the bf_getreadbuf
+ buffer slot. Python strings, buffer objects and memory
+ mapped files are examples of objects providing this slot.
+
+ errors defines the error handling to apply. It defaults to
+ 'strict' handling.
+
+ The method may not store state in the Codec instance. Use
+ StreamReader for codecs which have to keep state in order to
+ make decoding efficient.
+
+ The decoder must be able to handle zero length input and
+ return an empty object of the output object type in this
+ situation.
+
+ """
+ raise NotImplementedError
+
+class IncrementalEncoder(object):
+ """
+ An IncrementalEncoder encodes an input in multiple steps. The input can
+ be passed piece by piece to the encode() method. The IncrementalEncoder
+ remembers the state of the encoding process between calls to encode().
+ """
+ def __init__(self, errors='strict'):
+ """
+ Creates an IncrementalEncoder instance.
+
+ The IncrementalEncoder may use different error handling schemes by
+ providing the errors keyword argument. See the module docstring
+ for a list of possible values.
+ """
+ self.errors = errors
+ self.buffer = ""
+
+ def encode(self, input, final=False):
+ """
+ Encodes input and returns the resulting object.
+ """
+ raise NotImplementedError
+
+ def reset(self):
+ """
+ Resets the encoder to the initial state.
+ """
+
+ def getstate(self):
+ """
+ Return the current state of the encoder.
+ """
+ return 0
+
+ def setstate(self, state):
+ """
+ Set the current state of the encoder. state must have been
+ returned by getstate().
+ """
+
+class BufferedIncrementalEncoder(IncrementalEncoder):
+ """
+ This subclass of IncrementalEncoder can be used as the baseclass for an
+ incremental encoder if the encoder must keep some of the output in a
+ buffer between calls to encode().
+ """
+ def __init__(self, errors='strict'):
+ IncrementalEncoder.__init__(self, errors)
+ # unencoded input that is kept between calls to encode()
+ self.buffer = ""
+
+ def _buffer_encode(self, input, errors, final):
+ # Overwrite this method in subclasses: It must encode input
+ # and return an (output, length consumed) tuple
+ raise NotImplementedError
+
+ def encode(self, input, final=False):
+ # encode input (taking the buffer into account)
+ data = self.buffer + input
+ (result, consumed) = self._buffer_encode(data, self.errors, final)
+ # keep unencoded input until the next call
+ self.buffer = data[consumed:]
+ return result
+
+ def reset(self):
+ IncrementalEncoder.reset(self)
+ self.buffer = ""
+
+ def getstate(self):
+ return self.buffer or 0
+
+ def setstate(self, state):
+ self.buffer = state or ""
+
+class IncrementalDecoder(object):
+ """
+ An IncrementalDecoder decodes an input in multiple steps. The input can
+ be passed piece by piece to the decode() method. The IncrementalDecoder
+ remembers the state of the decoding process between calls to decode().
+ """
+ def __init__(self, errors='strict'):
+ """
+ Create an IncrementalDecoder instance.
+
+ The IncrementalDecoder may use different error handling schemes by
+ providing the errors keyword argument. See the module docstring
+ for a list of possible values.
+ """
+ self.errors = errors
+
+ def decode(self, input, final=False):
+ """
+ Decode input and returns the resulting object.
+ """
+ raise NotImplementedError
+
+ def reset(self):
+ """
+ Reset the decoder to the initial state.
+ """
+
+ def getstate(self):
+ """
+ Return the current state of the decoder.
+
+ This must be a (buffered_input, additional_state_info) tuple.
+ buffered_input must be a bytes object containing bytes that
+ were passed to decode() that have not yet been converted.
+ additional_state_info must be a non-negative integer
+ representing the state of the decoder WITHOUT yet having
+ processed the contents of buffered_input. In the initial state
+ and after reset(), getstate() must return (b"", 0).
+ """
+ return (b"", 0)
+
+ def setstate(self, state):
+ """
+ Set the current state of the decoder.
+
+ state must have been returned by getstate(). The effect of
+ setstate((b"", 0)) must be equivalent to reset().
+ """
+
+class BufferedIncrementalDecoder(IncrementalDecoder):
+ """
+ This subclass of IncrementalDecoder can be used as the baseclass for an
+ incremental decoder if the decoder must be able to handle incomplete
+ byte sequences.
+ """
+ def __init__(self, errors='strict'):
+ IncrementalDecoder.__init__(self, errors)
+ # undecoded input that is kept between calls to decode()
+ self.buffer = b""
+
+ def _buffer_decode(self, input, errors, final):
+ # Overwrite this method in subclasses: It must decode input
+ # and return an (output, length consumed) tuple
+ raise NotImplementedError
+
+ def decode(self, input, final=False):
+ # decode input (taking the buffer into account)
+ data = self.buffer + input
+ (result, consumed) = self._buffer_decode(data, self.errors, final)
+ # keep undecoded input until the next call
+ self.buffer = data[consumed:]
+ return result
+
+ def reset(self):
+ IncrementalDecoder.reset(self)
+ self.buffer = b""
+
+ def getstate(self):
+ # additional state info is always 0
+ return (self.buffer, 0)
+
+ def setstate(self, state):
+ # ignore additional state info
+ self.buffer = state[0]
+
+#
+# The StreamWriter and StreamReader class provide generic working
+# interfaces which can be used to implement new encoding submodules
+# very easily. See encodings/utf_8.py for an example on how this is
+# done.
+#
+
+class StreamWriter(Codec):
+
+ def __init__(self, stream, errors='strict'):
+
+ """ Creates a StreamWriter instance.
+
+ stream must be a file-like object open for writing.
+
+ The StreamWriter may use different error handling
+ schemes by providing the errors keyword argument. These
+ parameters are predefined:
+
+ 'strict' - raise a ValueError (or a subclass)
+ 'ignore' - ignore the character and continue with the next
+ 'replace'- replace with a suitable replacement character
+ 'xmlcharrefreplace' - Replace with the appropriate XML
+ character reference.
+ 'backslashreplace' - Replace with backslashed escape
+ sequences.
+ 'namereplace' - Replace with \\N{...} escape sequences.
+
+ The set of allowed parameter values can be extended via
+ register_error.
+ """
+ self.stream = stream
+ self.errors = errors
+
+ def write(self, object):
+
+ """ Writes the object's contents encoded to self.stream.
+ """
+ data, consumed = self.encode(object, self.errors)
+ self.stream.write(data)
+
+ def writelines(self, list):
+
+ """ Writes the concatenated list of strings to the stream
+ using .write().
+ """
+ self.write(''.join(list))
+
+ def reset(self):
+
+ """ Resets the codec buffers used for keeping internal state.
+
+ Calling this method should ensure that the data on the
+ output is put into a clean state, that allows appending
+ of new fresh data without having to rescan the whole
+ stream to recover state.
+
+ """
+ pass
+
+ def seek(self, offset, whence=0):
+ self.stream.seek(offset, whence)
+ if whence == 0 and offset == 0:
+ self.reset()
+
+ def __getattr__(self, name,
+ getattr=getattr):
+
+ """ Inherit all other methods from the underlying stream.
+ """
+ return getattr(self.stream, name)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, tb):
+ self.stream.close()
+
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
+###
+
+class StreamReader(Codec):
+
+ charbuffertype = str
+
+ def __init__(self, stream, errors='strict'):
+
+ """ Creates a StreamReader instance.
+
+ stream must be a file-like object open for reading.
+
+ The StreamReader may use different error handling
+ schemes by providing the errors keyword argument. These
+ parameters are predefined:
+
+ 'strict' - raise a ValueError (or a subclass)
+ 'ignore' - ignore the character and continue with the next
+ 'replace'- replace with a suitable replacement character
+ 'backslashreplace' - Replace with backslashed escape sequences;
+
+ The set of allowed parameter values can be extended via
+ register_error.
+ """
+ self.stream = stream
+ self.errors = errors
+ self.bytebuffer = b""
+ self._empty_charbuffer = self.charbuffertype()
+ self.charbuffer = self._empty_charbuffer
+ self.linebuffer = None
+
+ def decode(self, input, errors='strict'):
+ raise NotImplementedError
+
+ def read(self, size=-1, chars=-1, firstline=False):
+
+ """ Decodes data from the stream self.stream and returns the
+ resulting object.
+
+ chars indicates the number of decoded code points or bytes to
+ return. read() will never return more data than requested,
+ but it might return less, if there is not enough available.
+
+ size indicates the approximate maximum number of decoded
+ bytes or code points to read for decoding. The decoder
+ can modify this setting as appropriate. The default value
+ -1 indicates to read and decode as much as possible. size
+ is intended to prevent having to decode huge files in one
+ step.
+
+ If firstline is true, and a UnicodeDecodeError happens
+ after the first line terminator in the input only the first line
+ will be returned, the rest of the input will be kept until the
+ next call to read().
+
+ The method should use a greedy read strategy, meaning that
+ it should read as much data as is allowed within the
+ definition of the encoding and the given size, e.g. if
+ optional encoding endings or state markers are available
+ on the stream, these should be read too.
+ """
+ # If we have lines cached, first merge them back into characters
+ if self.linebuffer:
+ self.charbuffer = self._empty_charbuffer.join(self.linebuffer)
+ self.linebuffer = None
+
+ if chars < 0:
+ # For compatibility with other read() methods that take a
+ # single argument
+ chars = size
+
+ # read until we get the required number of characters (if available)
+ while True:
+ # can the request be satisfied from the character buffer?
+ if chars >= 0:
+ if len(self.charbuffer) >= chars:
+ break
+ # we need more data
+ if size < 0:
+ newdata = self.stream.read()
+ else:
+ newdata = self.stream.read(size)
+ # decode bytes (those remaining from the last call included)
+ data = self.bytebuffer + newdata
+ if not data:
+ break
+ try:
+ newchars, decodedbytes = self.decode(data, self.errors)
+ except UnicodeDecodeError as exc:
+ if firstline:
+ newchars, decodedbytes = \
+ self.decode(data[:exc.start], self.errors)
+ lines = newchars.splitlines(keepends=True)
+ if len(lines)<=1:
+ raise
+ else:
+ raise
+ # keep undecoded bytes until the next call
+ self.bytebuffer = data[decodedbytes:]
+ # put new characters in the character buffer
+ self.charbuffer += newchars
+ # there was no data available
+ if not newdata:
+ break
+ if chars < 0:
+ # Return everything we've got
+ result = self.charbuffer
+ self.charbuffer = self._empty_charbuffer
+ else:
+ # Return the first chars characters
+ result = self.charbuffer[:chars]
+ self.charbuffer = self.charbuffer[chars:]
+ return result
+
+ def readline(self, size=None, keepends=True):
+
+ """ Read one line from the input stream and return the
+ decoded data.
+
+ size, if given, is passed as size argument to the
+ read() method.
+
+ """
+ # If we have lines cached from an earlier read, return
+ # them unconditionally
+ if self.linebuffer:
+ line = self.linebuffer[0]
+ del self.linebuffer[0]
+ if len(self.linebuffer) == 1:
+ # revert to charbuffer mode; we might need more data
+ # next time
+ self.charbuffer = self.linebuffer[0]
+ self.linebuffer = None
+ if not keepends:
+ line = line.splitlines(keepends=False)[0]
+ return line
+
+ readsize = size or 72
+ line = self._empty_charbuffer
+ # If size is given, we call read() only once
+ while True:
+ data = self.read(readsize, firstline=True)
+ if data:
+ # If we're at a "\r" read one extra character (which might
+ # be a "\n") to get a proper line ending. If the stream is
+ # temporarily exhausted we return the wrong line ending.
+ if (isinstance(data, str) and data.endswith("\r")) or \
+ (isinstance(data, bytes) and data.endswith(b"\r")):
+ data += self.read(size=1, chars=1)
+
+ line += data
+ lines = line.splitlines(keepends=True)
+ if lines:
+ if len(lines) > 1:
+ # More than one line result; the first line is a full line
+ # to return
+ line = lines[0]
+ del lines[0]
+ if len(lines) > 1:
+ # cache the remaining lines
+ lines[-1] += self.charbuffer
+ self.linebuffer = lines
+ self.charbuffer = None
+ else:
+ # only one remaining line, put it back into charbuffer
+ self.charbuffer = lines[0] + self.charbuffer
+ if not keepends:
+ line = line.splitlines(keepends=False)[0]
+ break
+ line0withend = lines[0]
+ line0withoutend = lines[0].splitlines(keepends=False)[0]
+ if line0withend != line0withoutend: # We really have a line end
+ # Put the rest back together and keep it until the next call
+ self.charbuffer = self._empty_charbuffer.join(lines[1:]) + \
+ self.charbuffer
+ if keepends:
+ line = line0withend
+ else:
+ line = line0withoutend
+ break
+ # we didn't get anything or this was our only try
+ if not data or size is not None:
+ if line and not keepends:
+ line = line.splitlines(keepends=False)[0]
+ break
+ if readsize < 8000:
+ readsize *= 2
+ return line
+
+ def readlines(self, sizehint=None, keepends=True):
+
+ """ Read all lines available on the input stream
+ and return them as a list.
+
+ Line breaks are implemented using the codec's decoder
+ method and are included in the list entries.
+
+ sizehint, if given, is ignored since there is no efficient
+ way to finding the true end-of-line.
+
+ """
+ data = self.read()
+ return data.splitlines(keepends)
+
+ def reset(self):
+
+ """ Resets the codec buffers used for keeping internal state.
+
+ Note that no stream repositioning should take place.
+ This method is primarily intended to be able to recover
+ from decoding errors.
+
+ """
+ self.bytebuffer = b""
+ self.charbuffer = self._empty_charbuffer
+ self.linebuffer = None
+
+ def seek(self, offset, whence=0):
+ """ Set the input stream's current position.
+
+ Resets the codec buffers used for keeping state.
+ """
+ self.stream.seek(offset, whence)
+ self.reset()
+
+ def __next__(self):
+
+ """ Return the next decoded line from the input stream."""
+ line = self.readline()
+ if line:
+ return line
+ raise StopIteration
+
+ def __iter__(self):
+ return self
+
+ def __getattr__(self, name,
+ getattr=getattr):
+
+ """ Inherit all other methods from the underlying stream.
+ """
+ return getattr(self.stream, name)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, tb):
+ self.stream.close()
+
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
+###
+
+class StreamReaderWriter:
+
+ """ StreamReaderWriter instances allow wrapping streams which
+ work in both read and write modes.
+
+ The design is such that one can use the factory functions
+ returned by the codec.lookup() function to construct the
+ instance.
+
+ """
+ # Optional attributes set by the file wrappers below
+ encoding = 'unknown'
+
+ def __init__(self, stream, Reader, Writer, errors='strict'):
+
+ """ Creates a StreamReaderWriter instance.
+
+ stream must be a Stream-like object.
+
+ Reader, Writer must be factory functions or classes
+ providing the StreamReader, StreamWriter interface resp.
+
+ Error handling is done in the same way as defined for the
+ StreamWriter/Readers.
+
+ """
+ self.stream = stream
+ self.reader = Reader(stream, errors)
+ self.writer = Writer(stream, errors)
+ self.errors = errors
+
+ def read(self, size=-1):
+
+ return self.reader.read(size)
+
+ def readline(self, size=None):
+
+ return self.reader.readline(size)
+
+ def readlines(self, sizehint=None):
+
+ return self.reader.readlines(sizehint)
+
+ def __next__(self):
+
+ """ Return the next decoded line from the input stream."""
+ return next(self.reader)
+
+ def __iter__(self):
+ return self
+
+ def write(self, data):
+
+ return self.writer.write(data)
+
+ def writelines(self, list):
+
+ return self.writer.writelines(list)
+
+ def reset(self):
+
+ self.reader.reset()
+ self.writer.reset()
+
+ def seek(self, offset, whence=0):
+ self.stream.seek(offset, whence)
+ self.reader.reset()
+ if whence == 0 and offset == 0:
+ self.writer.reset()
+
+ def __getattr__(self, name,
+ getattr=getattr):
+
+ """ Inherit all other methods from the underlying stream.
+ """
+ return getattr(self.stream, name)
+
+ # these are needed to make "with StreamReaderWriter(...)" work properly
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, tb):
+ self.stream.close()
+
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
+###
+
+class StreamRecoder:
+
+ """ StreamRecoder instances translate data from one encoding to another.
+
+ They use the complete set of APIs returned by the
+ codecs.lookup() function to implement their task.
+
+ Data written to the StreamRecoder is first decoded into an
+ intermediate format (depending on the "decode" codec) and then
+ written to the underlying stream using an instance of the provided
+ Writer class.
+
+ In the other direction, data is read from the underlying stream using
+ a Reader instance and then encoded and returned to the caller.
+
+ """
+ # Optional attributes set by the file wrappers below
+ data_encoding = 'unknown'
+ file_encoding = 'unknown'
+
+ def __init__(self, stream, encode, decode, Reader, Writer,
+ errors='strict'):
+
+ """ Creates a StreamRecoder instance which implements a two-way
+ conversion: encode and decode work on the frontend (the
+ data visible to .read() and .write()) while Reader and Writer
+ work on the backend (the data in stream).
+
+ You can use these objects to do transparent
+ transcodings from e.g. latin-1 to utf-8 and back.
+
+ stream must be a file-like object.
+
+ encode and decode must adhere to the Codec interface; Reader and
+ Writer must be factory functions or classes providing the
+ StreamReader and StreamWriter interfaces resp.
+
+ Error handling is done in the same way as defined for the
+ StreamWriter/Readers.
+
+ """
+ self.stream = stream
+ self.encode = encode
+ self.decode = decode
+ self.reader = Reader(stream, errors)
+ self.writer = Writer(stream, errors)
+ self.errors = errors
+
+ def read(self, size=-1):
+
+ data = self.reader.read(size)
+ data, bytesencoded = self.encode(data, self.errors)
+ return data
+
+ def readline(self, size=None):
+
+ if size is None:
+ data = self.reader.readline()
+ else:
+ data = self.reader.readline(size)
+ data, bytesencoded = self.encode(data, self.errors)
+ return data
+
+ def readlines(self, sizehint=None):
+
+ data = self.reader.read()
+ data, bytesencoded = self.encode(data, self.errors)
+ return data.splitlines(keepends=True)
+
+ def __next__(self):
+
+ """ Return the next decoded line from the input stream."""
+ data = next(self.reader)
+ data, bytesencoded = self.encode(data, self.errors)
+ return data
+
+ def __iter__(self):
+ return self
+
+ def write(self, data):
+
+ data, bytesdecoded = self.decode(data, self.errors)
+ return self.writer.write(data)
+
+ def writelines(self, list):
+
+ data = b''.join(list)
+ data, bytesdecoded = self.decode(data, self.errors)
+ return self.writer.write(data)
+
+ def reset(self):
+
+ self.reader.reset()
+ self.writer.reset()
+
+ def seek(self, offset, whence=0):
+ # Seeks must be propagated to both the readers and writers
+ # as they might need to reset their internal buffers.
+ self.reader.seek(offset, whence)
+ self.writer.seek(offset, whence)
+
+ def __getattr__(self, name,
+ getattr=getattr):
+
+ """ Inherit all other methods from the underlying stream.
+ """
+ return getattr(self.stream, name)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, tb):
+ self.stream.close()
+
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
+### Shortcuts
+
+def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
+
+ """ Open an encoded file using the given mode and return
+ a wrapped version providing transparent encoding/decoding.
+
+ Note: The wrapped version will only accept the object format
+ defined by the codecs, i.e. Unicode objects for most builtin
+ codecs. Output is also codec dependent and will usually be
+ Unicode as well.
+
+ If encoding is not None, then the
+ underlying encoded files are always opened in binary mode.
+ The default file mode is 'r', meaning to open the file in read mode.
+
+ encoding specifies the encoding which is to be used for the
+ file.
+
+ errors may be given to define the error handling. It defaults
+ to 'strict' which causes ValueErrors to be raised in case an
+ encoding error occurs.
+
+ buffering has the same meaning as for the builtin open() API.
+ It defaults to -1 which means that the default buffer size will
+ be used.
+
+ The returned wrapped file object provides an extra attribute
+ .encoding which allows querying the used encoding. This
+ attribute is only available if an encoding was specified as
+ parameter.
+
+ """
+ if encoding is not None and \
+ 'b' not in mode:
+ # Force opening of the file in binary mode
+ mode = mode + 'b'
+ file = builtins.open(filename, mode, buffering)
+ if encoding is None:
+ return file
+
+ try:
+ info = lookup(encoding)
+ srw = StreamReaderWriter(file, info.streamreader, info.streamwriter, errors)
+ # Add attributes to simplify introspection
+ srw.encoding = encoding
+ return srw
+ except:
+ file.close()
+ raise
+
+def EncodedFile(file, data_encoding, file_encoding=None, errors='strict'):
+
+ """ Return a wrapped version of file which provides transparent
+ encoding translation.
+
+ Data written to the wrapped file is decoded according
+ to the given data_encoding and then encoded to the underlying
+ file using file_encoding. The intermediate data type
+ will usually be Unicode but depends on the specified codecs.
+
+ Bytes read from the file are decoded using file_encoding and then
+ passed back to the caller encoded using data_encoding.
+
+ If file_encoding is not given, it defaults to data_encoding.
+
+ errors may be given to define the error handling. It defaults
+ to 'strict' which causes ValueErrors to be raised in case an
+ encoding error occurs.
+
+ The returned wrapped file object provides two extra attributes
+ .data_encoding and .file_encoding which reflect the given
+ parameters of the same name. The attributes can be used for
+ introspection by Python programs.
+
+ """
+ if file_encoding is None:
+ file_encoding = data_encoding
+ data_info = lookup(data_encoding)
+ file_info = lookup(file_encoding)
+ sr = StreamRecoder(file, data_info.encode, data_info.decode,
+ file_info.streamreader, file_info.streamwriter, errors)
+ # Add attributes to simplify introspection
+ sr.data_encoding = data_encoding
+ sr.file_encoding = file_encoding
+ return sr
+
+### Helpers for codec lookup
+
+def getencoder(encoding):
+
+ """ Lookup up the codec for the given encoding and return
+ its encoder function.
+
+ Raises a LookupError in case the encoding cannot be found.
+
+ """
+ return lookup(encoding).encode
+
+def getdecoder(encoding):
+
+ """ Lookup up the codec for the given encoding and return
+ its decoder function.
+
+ Raises a LookupError in case the encoding cannot be found.
+
+ """
+ return lookup(encoding).decode
+
+def getincrementalencoder(encoding):
+
+ """ Lookup up the codec for the given encoding and return
+ its IncrementalEncoder class or factory function.
+
+ Raises a LookupError in case the encoding cannot be found
+ or the codecs doesn't provide an incremental encoder.
+
+ """
+ encoder = lookup(encoding).incrementalencoder
+ if encoder is None:
+ raise LookupError(encoding)
+ return encoder
+
+def getincrementaldecoder(encoding):
+
+ """ Lookup up the codec for the given encoding and return
+ its IncrementalDecoder class or factory function.
+
+ Raises a LookupError in case the encoding cannot be found
+ or the codecs doesn't provide an incremental decoder.
+
+ """
+ decoder = lookup(encoding).incrementaldecoder
+ if decoder is None:
+ raise LookupError(encoding)
+ return decoder
+
+def getreader(encoding):
+
+ """ Lookup up the codec for the given encoding and return
+ its StreamReader class or factory function.
+
+ Raises a LookupError in case the encoding cannot be found.
+
+ """
+ return lookup(encoding).streamreader
+
+def getwriter(encoding):
+
+ """ Lookup up the codec for the given encoding and return
+ its StreamWriter class or factory function.
+
+ Raises a LookupError in case the encoding cannot be found.
+
+ """
+ return lookup(encoding).streamwriter
+
+def iterencode(iterator, encoding, errors='strict', **kwargs):
+ """
+ Encoding iterator.
+
+ Encodes the input strings from the iterator using an IncrementalEncoder.
+
+ errors and kwargs are passed through to the IncrementalEncoder
+ constructor.
+ """
+ encoder = getincrementalencoder(encoding)(errors, **kwargs)
+ for input in iterator:
+ output = encoder.encode(input)
+ if output:
+ yield output
+ output = encoder.encode("", True)
+ if output:
+ yield output
+
+def iterdecode(iterator, encoding, errors='strict', **kwargs):
+ """
+ Decoding iterator.
+
+ Decodes the input strings from the iterator using an IncrementalDecoder.
+
+ errors and kwargs are passed through to the IncrementalDecoder
+ constructor.
+ """
+ decoder = getincrementaldecoder(encoding)(errors, **kwargs)
+ for input in iterator:
+ output = decoder.decode(input)
+ if output:
+ yield output
+ output = decoder.decode(b"", True)
+ if output:
+ yield output
+
+### Helpers for charmap-based codecs
+
+def make_identity_dict(rng):
+
+ """ make_identity_dict(rng) -> dict
+
+ Return a dictionary where elements of the rng sequence are
+ mapped to themselves.
+
+ """
+ return {i:i for i in rng}
+
+def make_encoding_map(decoding_map):
+
+ """ Creates an encoding map from a decoding map.
+
+ If a target mapping in the decoding map occurs multiple
+ times, then that target is mapped to None (undefined mapping),
+ causing an exception when encountered by the charmap codec
+ during translation.
+
+ One example where this happens is cp875.py which decodes
+ multiple character to \\u001a.
+
+ """
+ m = {}
+ for k,v in decoding_map.items():
+ if not v in m:
+ m[v] = k
+ else:
+ m[v] = None
+ return m
+
+### error handlers
+
+try:
+ strict_errors = lookup_error("strict")
+ ignore_errors = lookup_error("ignore")
+ replace_errors = lookup_error("replace")
+ xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace")
+ backslashreplace_errors = lookup_error("backslashreplace")
+ namereplace_errors = lookup_error("namereplace")
+except LookupError:
+ # In --disable-unicode builds, these error handler are missing
+ strict_errors = None
+ ignore_errors = None
+ replace_errors = None
+ xmlcharrefreplace_errors = None
+ backslashreplace_errors = None
+ namereplace_errors = None
+
+# Tell modulefinder that using codecs probably needs the encodings
+# package
+_false = 0
+if _false:
+ import encodings
+
+### Tests
+
+if __name__ == '__main__':
+
+ # Make stdout translate Latin-1 output into UTF-8 output
+ sys.stdout = EncodedFile(sys.stdout, 'latin-1', 'utf-8')
+
+ # Have stdin translate Latin-1 input into UTF-8 input
+ sys.stdin = EncodedFile(sys.stdin, 'utf-8', 'latin-1')
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/codeop.py b/physworld_p1_20261018/envs/p1/lib/python3.11/codeop.py
new file mode 100644
index 0000000000000000000000000000000000000000..e64911ee5ad4170e69a93b5510f0a077623744a0
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/codeop.py
@@ -0,0 +1,160 @@
+r"""Utilities to compile possibly incomplete Python source code.
+
+This module provides two interfaces, broadly similar to the builtin
+function compile(), which take program text, a filename and a 'mode'
+and:
+
+- Return code object if the command is complete and valid
+- Return None if the command is incomplete
+- Raise SyntaxError, ValueError or OverflowError if the command is a
+ syntax error (OverflowError and ValueError can be produced by
+ malformed literals).
+
+The two interfaces are:
+
+compile_command(source, filename, symbol):
+
+ Compiles a single command in the manner described above.
+
+CommandCompiler():
+
+ Instances of this class have __call__ methods identical in
+ signature to compile_command; the difference is that if the
+ instance compiles program text containing a __future__ statement,
+ the instance 'remembers' and compiles all subsequent program texts
+ with the statement in force.
+
+The module also provides another class:
+
+Compile():
+
+ Instances of this class act like the built-in function compile,
+ but with 'memory' in the sense described above.
+"""
+
+import __future__
+import warnings
+
+_features = [getattr(__future__, fname)
+ for fname in __future__.all_feature_names]
+
+__all__ = ["compile_command", "Compile", "CommandCompiler"]
+
+# The following flags match the values from Include/cpython/compile.h
+# Caveat emptor: These flags are undocumented on purpose and depending
+# on their effect outside the standard library is **unsupported**.
+PyCF_DONT_IMPLY_DEDENT = 0x200
+PyCF_ALLOW_INCOMPLETE_INPUT = 0x4000
+
+def _maybe_compile(compiler, source, filename, symbol):
+ # Check for source consisting of only blank lines and comments.
+ for line in source.split("\n"):
+ line = line.strip()
+ if line and line[0] != '#':
+ break # Leave it alone.
+ else:
+ if symbol != "eval":
+ source = "pass" # Replace it with a 'pass' statement
+
+ # Disable compiler warnings when checking for incomplete input.
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", (SyntaxWarning, DeprecationWarning))
+ try:
+ compiler(source, filename, symbol)
+ except SyntaxError: # Let other compile() errors propagate.
+ try:
+ compiler(source + "\n", filename, symbol)
+ return None
+ except SyntaxError as e:
+ if "incomplete input" in str(e):
+ return None
+ # fallthrough
+
+ return compiler(source, filename, symbol, incomplete_input=False)
+
+def _is_syntax_error(err1, err2):
+ rep1 = repr(err1)
+ rep2 = repr(err2)
+ if "was never closed" in rep1 and "was never closed" in rep2:
+ return False
+ if rep1 == rep2:
+ return True
+ return False
+
+def _compile(source, filename, symbol, incomplete_input=True):
+ flags = 0
+ if incomplete_input:
+ flags |= PyCF_ALLOW_INCOMPLETE_INPUT
+ flags |= PyCF_DONT_IMPLY_DEDENT
+ return compile(source, filename, symbol, flags)
+
+def compile_command(source, filename="", symbol="single"):
+ r"""Compile a command and determine whether it is incomplete.
+
+ Arguments:
+
+ source -- the source string; may contain \n characters
+ filename -- optional filename from which source was read; default
+ ""
+ symbol -- optional grammar start symbol; "single" (default), "exec"
+ or "eval"
+
+ Return value / exceptions raised:
+
+ - Return a code object if the command is complete and valid
+ - Return None if the command is incomplete
+ - Raise SyntaxError, ValueError or OverflowError if the command is a
+ syntax error (OverflowError and ValueError can be produced by
+ malformed literals).
+ """
+ return _maybe_compile(_compile, source, filename, symbol)
+
+class Compile:
+ """Instances of this class behave much like the built-in compile
+ function, but if one is used to compile text containing a future
+ statement, it "remembers" and compiles all subsequent program texts
+ with the statement in force."""
+ def __init__(self):
+ self.flags = PyCF_DONT_IMPLY_DEDENT | PyCF_ALLOW_INCOMPLETE_INPUT
+
+ def __call__(self, source, filename, symbol, **kwargs):
+ flags = self.flags
+ if kwargs.get('incomplete_input', True) is False:
+ flags &= ~PyCF_DONT_IMPLY_DEDENT
+ flags &= ~PyCF_ALLOW_INCOMPLETE_INPUT
+ codeob = compile(source, filename, symbol, flags, True)
+ for feature in _features:
+ if codeob.co_flags & feature.compiler_flag:
+ self.flags |= feature.compiler_flag
+ return codeob
+
+class CommandCompiler:
+ """Instances of this class have __call__ methods identical in
+ signature to compile_command; the difference is that if the
+ instance compiles program text containing a __future__ statement,
+ the instance 'remembers' and compiles all subsequent program texts
+ with the statement in force."""
+
+ def __init__(self,):
+ self.compiler = Compile()
+
+ def __call__(self, source, filename="", symbol="single"):
+ r"""Compile a command and determine whether it is incomplete.
+
+ Arguments:
+
+ source -- the source string; may contain \n characters
+ filename -- optional filename from which source was read;
+ default ""
+ symbol -- optional grammar start symbol; "single" (default) or
+ "eval"
+
+ Return value / exceptions raised:
+
+ - Return a code object if the command is complete and valid
+ - Return None if the command is incomplete
+ - Raise SyntaxError, ValueError or OverflowError if the command is a
+ syntax error (OverflowError and ValueError can be produced by
+ malformed literals).
+ """
+ return _maybe_compile(self.compiler, source, filename, symbol)
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__init__.py b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..05a1a73cf4a41b46788de0bafe884cd8e8bf0364
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__init__.py
@@ -0,0 +1,1576 @@
+'''This module implements specialized container datatypes providing
+alternatives to Python's general purpose built-in containers, dict,
+list, set, and tuple.
+
+* namedtuple factory function for creating tuple subclasses with named fields
+* deque list-like container with fast appends and pops on either end
+* ChainMap dict-like class for creating a single view of multiple mappings
+* Counter dict subclass for counting hashable objects
+* OrderedDict dict subclass that remembers the order entries were added
+* defaultdict dict subclass that calls a factory function to supply missing values
+* UserDict wrapper around dictionary objects for easier dict subclassing
+* UserList wrapper around list objects for easier list subclassing
+* UserString wrapper around string objects for easier string subclassing
+
+'''
+
+__all__ = [
+ 'ChainMap',
+ 'Counter',
+ 'OrderedDict',
+ 'UserDict',
+ 'UserList',
+ 'UserString',
+ 'defaultdict',
+ 'deque',
+ 'namedtuple',
+]
+
+import _collections_abc
+import sys as _sys
+
+from itertools import chain as _chain
+from itertools import repeat as _repeat
+from itertools import starmap as _starmap
+from keyword import iskeyword as _iskeyword
+from operator import eq as _eq
+from operator import itemgetter as _itemgetter
+from reprlib import recursive_repr as _recursive_repr
+from _weakref import proxy as _proxy
+
+try:
+ from _collections import deque
+except ImportError:
+ pass
+else:
+ _collections_abc.MutableSequence.register(deque)
+
+try:
+ from _collections import defaultdict
+except ImportError:
+ pass
+
+
+################################################################################
+### OrderedDict
+################################################################################
+
+class _OrderedDictKeysView(_collections_abc.KeysView):
+
+ def __reversed__(self):
+ yield from reversed(self._mapping)
+
+class _OrderedDictItemsView(_collections_abc.ItemsView):
+
+ def __reversed__(self):
+ for key in reversed(self._mapping):
+ yield (key, self._mapping[key])
+
+class _OrderedDictValuesView(_collections_abc.ValuesView):
+
+ def __reversed__(self):
+ for key in reversed(self._mapping):
+ yield self._mapping[key]
+
+class _Link(object):
+ __slots__ = 'prev', 'next', 'key', '__weakref__'
+
+class OrderedDict(dict):
+ 'Dictionary that remembers insertion order'
+ # An inherited dict maps keys to values.
+ # The inherited dict provides __getitem__, __len__, __contains__, and get.
+ # The remaining methods are order-aware.
+ # Big-O running times for all methods are the same as regular dictionaries.
+
+ # The internal self.__map dict maps keys to links in a doubly linked list.
+ # The circular doubly linked list starts and ends with a sentinel element.
+ # The sentinel element never gets deleted (this simplifies the algorithm).
+ # The sentinel is in self.__hardroot with a weakref proxy in self.__root.
+ # The prev links are weakref proxies (to prevent circular references).
+ # Individual links are kept alive by the hard reference in self.__map.
+ # Those hard references disappear when a key is deleted from an OrderedDict.
+
+ def __new__(cls, /, *args, **kwds):
+ "Create the ordered dict object and set up the underlying structures."
+ self = dict.__new__(cls)
+ self.__hardroot = _Link()
+ self.__root = root = _proxy(self.__hardroot)
+ root.prev = root.next = root
+ self.__map = {}
+ return self
+
+ def __init__(self, other=(), /, **kwds):
+ '''Initialize an ordered dictionary. The signature is the same as
+ regular dictionaries. Keyword argument order is preserved.
+ '''
+ self.__update(other, **kwds)
+
+ def __setitem__(self, key, value,
+ dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
+ 'od.__setitem__(i, y) <==> od[i]=y'
+ # Setting a new item creates a new link at the end of the linked list,
+ # and the inherited dictionary is updated with the new key/value pair.
+ if key not in self:
+ self.__map[key] = link = Link()
+ root = self.__root
+ last = root.prev
+ link.prev, link.next, link.key = last, root, key
+ last.next = link
+ root.prev = proxy(link)
+ dict_setitem(self, key, value)
+
+ def __delitem__(self, key, dict_delitem=dict.__delitem__):
+ 'od.__delitem__(y) <==> del od[y]'
+ # Deleting an existing item uses self.__map to find the link which gets
+ # removed by updating the links in the predecessor and successor nodes.
+ dict_delitem(self, key)
+ link = self.__map.pop(key)
+ link_prev = link.prev
+ link_next = link.next
+ link_prev.next = link_next
+ link_next.prev = link_prev
+ link.prev = None
+ link.next = None
+
+ def __iter__(self):
+ 'od.__iter__() <==> iter(od)'
+ # Traverse the linked list in order.
+ root = self.__root
+ curr = root.next
+ while curr is not root:
+ yield curr.key
+ curr = curr.next
+
+ def __reversed__(self):
+ 'od.__reversed__() <==> reversed(od)'
+ # Traverse the linked list in reverse order.
+ root = self.__root
+ curr = root.prev
+ while curr is not root:
+ yield curr.key
+ curr = curr.prev
+
+ def clear(self):
+ 'od.clear() -> None. Remove all items from od.'
+ root = self.__root
+ root.prev = root.next = root
+ self.__map.clear()
+ dict.clear(self)
+
+ def popitem(self, last=True):
+ '''Remove and return a (key, value) pair from the dictionary.
+
+ Pairs are returned in LIFO order if last is true or FIFO order if false.
+ '''
+ if not self:
+ raise KeyError('dictionary is empty')
+ root = self.__root
+ if last:
+ link = root.prev
+ link_prev = link.prev
+ link_prev.next = root
+ root.prev = link_prev
+ else:
+ link = root.next
+ link_next = link.next
+ root.next = link_next
+ link_next.prev = root
+ key = link.key
+ del self.__map[key]
+ value = dict.pop(self, key)
+ return key, value
+
+ def move_to_end(self, key, last=True):
+ '''Move an existing element to the end (or beginning if last is false).
+
+ Raise KeyError if the element does not exist.
+ '''
+ link = self.__map[key]
+ link_prev = link.prev
+ link_next = link.next
+ soft_link = link_next.prev
+ link_prev.next = link_next
+ link_next.prev = link_prev
+ root = self.__root
+ if last:
+ last = root.prev
+ link.prev = last
+ link.next = root
+ root.prev = soft_link
+ last.next = link
+ else:
+ first = root.next
+ link.prev = root
+ link.next = first
+ first.prev = soft_link
+ root.next = link
+
+ def __sizeof__(self):
+ sizeof = _sys.getsizeof
+ n = len(self) + 1 # number of links including root
+ size = sizeof(self.__dict__) # instance dictionary
+ size += sizeof(self.__map) * 2 # internal dict and inherited dict
+ size += sizeof(self.__hardroot) * n # link objects
+ size += sizeof(self.__root) * n # proxy objects
+ return size
+
+ update = __update = _collections_abc.MutableMapping.update
+
+ def keys(self):
+ "D.keys() -> a set-like object providing a view on D's keys"
+ return _OrderedDictKeysView(self)
+
+ def items(self):
+ "D.items() -> a set-like object providing a view on D's items"
+ return _OrderedDictItemsView(self)
+
+ def values(self):
+ "D.values() -> an object providing a view on D's values"
+ return _OrderedDictValuesView(self)
+
+ __ne__ = _collections_abc.MutableMapping.__ne__
+
+ __marker = object()
+
+ def pop(self, key, default=__marker):
+ '''od.pop(k[,d]) -> v, remove specified key and return the corresponding
+ value. If key is not found, d is returned if given, otherwise KeyError
+ is raised.
+
+ '''
+ marker = self.__marker
+ result = dict.pop(self, key, marker)
+ if result is not marker:
+ # The same as in __delitem__().
+ link = self.__map.pop(key)
+ link_prev = link.prev
+ link_next = link.next
+ link_prev.next = link_next
+ link_next.prev = link_prev
+ link.prev = None
+ link.next = None
+ return result
+ if default is marker:
+ raise KeyError(key)
+ return default
+
+ def setdefault(self, key, default=None):
+ '''Insert key with a value of default if key is not in the dictionary.
+
+ Return the value for key if key is in the dictionary, else default.
+ '''
+ if key in self:
+ return self[key]
+ self[key] = default
+ return default
+
+ @_recursive_repr()
+ def __repr__(self):
+ 'od.__repr__() <==> repr(od)'
+ if not self:
+ return '%s()' % (self.__class__.__name__,)
+ return '%s(%r)' % (self.__class__.__name__, list(self.items()))
+
+ def __reduce__(self):
+ 'Return state information for pickling'
+ state = self.__getstate__()
+ if state:
+ if isinstance(state, tuple):
+ state, slots = state
+ else:
+ slots = {}
+ state = state.copy()
+ slots = slots.copy()
+ for k in vars(OrderedDict()):
+ state.pop(k, None)
+ slots.pop(k, None)
+ if slots:
+ state = state, slots
+ else:
+ state = state or None
+ return self.__class__, (), state, None, iter(self.items())
+
+ def copy(self):
+ 'od.copy() -> a shallow copy of od'
+ return self.__class__(self)
+
+ @classmethod
+ def fromkeys(cls, iterable, value=None):
+ '''Create a new ordered dictionary with keys from iterable and values set to value.
+ '''
+ self = cls()
+ for key in iterable:
+ self[key] = value
+ return self
+
+ def __eq__(self, other):
+ '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive
+ while comparison to a regular mapping is order-insensitive.
+
+ '''
+ if isinstance(other, OrderedDict):
+ return dict.__eq__(self, other) and all(map(_eq, self, other))
+ return dict.__eq__(self, other)
+
+ def __ior__(self, other):
+ self.update(other)
+ return self
+
+ def __or__(self, other):
+ if not isinstance(other, dict):
+ return NotImplemented
+ new = self.__class__(self)
+ new.update(other)
+ return new
+
+ def __ror__(self, other):
+ if not isinstance(other, dict):
+ return NotImplemented
+ new = self.__class__(other)
+ new.update(self)
+ return new
+
+
+try:
+ from _collections import OrderedDict
+except ImportError:
+ # Leave the pure Python version in place.
+ pass
+
+
+################################################################################
+### namedtuple
+################################################################################
+
+try:
+ from _collections import _tuplegetter
+except ImportError:
+ _tuplegetter = lambda index, doc: property(_itemgetter(index), doc=doc)
+
+def namedtuple(typename, field_names, *, rename=False, defaults=None, module=None):
+ """Returns a new subclass of tuple with named fields.
+
+ >>> Point = namedtuple('Point', ['x', 'y'])
+ >>> Point.__doc__ # docstring for the new class
+ 'Point(x, y)'
+ >>> p = Point(11, y=22) # instantiate with positional args or keywords
+ >>> p[0] + p[1] # indexable like a plain tuple
+ 33
+ >>> x, y = p # unpack like a regular tuple
+ >>> x, y
+ (11, 22)
+ >>> p.x + p.y # fields also accessible by name
+ 33
+ >>> d = p._asdict() # convert to a dictionary
+ >>> d['x']
+ 11
+ >>> Point(**d) # convert from a dictionary
+ Point(x=11, y=22)
+ >>> p._replace(x=100) # _replace() is like str.replace() but targets named fields
+ Point(x=100, y=22)
+
+ """
+
+ # Validate the field names. At the user's option, either generate an error
+ # message or automatically replace the field name with a valid name.
+ if isinstance(field_names, str):
+ field_names = field_names.replace(',', ' ').split()
+ field_names = list(map(str, field_names))
+ typename = _sys.intern(str(typename))
+
+ if rename:
+ seen = set()
+ for index, name in enumerate(field_names):
+ if (not name.isidentifier()
+ or _iskeyword(name)
+ or name.startswith('_')
+ or name in seen):
+ field_names[index] = f'_{index}'
+ seen.add(name)
+
+ for name in [typename] + field_names:
+ if type(name) is not str:
+ raise TypeError('Type names and field names must be strings')
+ if not name.isidentifier():
+ raise ValueError('Type names and field names must be valid '
+ f'identifiers: {name!r}')
+ if _iskeyword(name):
+ raise ValueError('Type names and field names cannot be a '
+ f'keyword: {name!r}')
+
+ seen = set()
+ for name in field_names:
+ if name.startswith('_') and not rename:
+ raise ValueError('Field names cannot start with an underscore: '
+ f'{name!r}')
+ if name in seen:
+ raise ValueError(f'Encountered duplicate field name: {name!r}')
+ seen.add(name)
+
+ field_defaults = {}
+ if defaults is not None:
+ defaults = tuple(defaults)
+ if len(defaults) > len(field_names):
+ raise TypeError('Got more default values than field names')
+ field_defaults = dict(reversed(list(zip(reversed(field_names),
+ reversed(defaults)))))
+
+ # Variables used in the methods and docstrings
+ field_names = tuple(map(_sys.intern, field_names))
+ num_fields = len(field_names)
+ arg_list = ', '.join(field_names)
+ if num_fields == 1:
+ arg_list += ','
+ repr_fmt = '(' + ', '.join(f'{name}=%r' for name in field_names) + ')'
+ tuple_new = tuple.__new__
+ _dict, _tuple, _len, _map, _zip = dict, tuple, len, map, zip
+
+ # Create all the named tuple methods to be added to the class namespace
+
+ namespace = {
+ '_tuple_new': tuple_new,
+ '__builtins__': {},
+ '__name__': f'namedtuple_{typename}',
+ }
+ code = f'lambda _cls, {arg_list}: _tuple_new(_cls, ({arg_list}))'
+ __new__ = eval(code, namespace)
+ __new__.__name__ = '__new__'
+ __new__.__doc__ = f'Create new instance of {typename}({arg_list})'
+ if defaults is not None:
+ __new__.__defaults__ = defaults
+
+ @classmethod
+ def _make(cls, iterable):
+ result = tuple_new(cls, iterable)
+ if _len(result) != num_fields:
+ raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
+ return result
+
+ _make.__func__.__doc__ = (f'Make a new {typename} object from a sequence '
+ 'or iterable')
+
+ def _replace(self, /, **kwds):
+ result = self._make(_map(kwds.pop, field_names, self))
+ if kwds:
+ raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
+ return result
+
+ _replace.__doc__ = (f'Return a new {typename} object replacing specified '
+ 'fields with new values')
+
+ def __repr__(self):
+ 'Return a nicely formatted representation string'
+ return self.__class__.__name__ + repr_fmt % self
+
+ def _asdict(self):
+ 'Return a new dict which maps field names to their values.'
+ return _dict(_zip(self._fields, self))
+
+ def __getnewargs__(self):
+ 'Return self as a plain tuple. Used by copy and pickle.'
+ return _tuple(self)
+
+ # Modify function metadata to help with introspection and debugging
+ for method in (
+ __new__,
+ _make.__func__,
+ _replace,
+ __repr__,
+ _asdict,
+ __getnewargs__,
+ ):
+ method.__qualname__ = f'{typename}.{method.__name__}'
+
+ # Build-up the class namespace dictionary
+ # and use type() to build the result class
+ class_namespace = {
+ '__doc__': f'{typename}({arg_list})',
+ '__slots__': (),
+ '_fields': field_names,
+ '_field_defaults': field_defaults,
+ '__new__': __new__,
+ '_make': _make,
+ '_replace': _replace,
+ '__repr__': __repr__,
+ '_asdict': _asdict,
+ '__getnewargs__': __getnewargs__,
+ '__match_args__': field_names,
+ }
+ for index, name in enumerate(field_names):
+ doc = _sys.intern(f'Alias for field number {index}')
+ class_namespace[name] = _tuplegetter(index, doc)
+
+ result = type(typename, (tuple,), class_namespace)
+
+ # For pickling to work, the __module__ variable needs to be set to the frame
+ # where the named tuple is created. Bypass this step in environments where
+ # sys._getframe is not defined (Jython for example) or sys._getframe is not
+ # defined for arguments greater than 0 (IronPython), or where the user has
+ # specified a particular module.
+ if module is None:
+ try:
+ module = _sys._getframe(1).f_globals.get('__name__', '__main__')
+ except (AttributeError, ValueError):
+ pass
+ if module is not None:
+ result.__module__ = module
+
+ return result
+
+
+########################################################################
+### Counter
+########################################################################
+
+def _count_elements(mapping, iterable):
+ 'Tally elements from the iterable.'
+ mapping_get = mapping.get
+ for elem in iterable:
+ mapping[elem] = mapping_get(elem, 0) + 1
+
+try: # Load C helper function if available
+ from _collections import _count_elements
+except ImportError:
+ pass
+
+class Counter(dict):
+ '''Dict subclass for counting hashable items. Sometimes called a bag
+ or multiset. Elements are stored as dictionary keys and their counts
+ are stored as dictionary values.
+
+ >>> c = Counter('abcdeabcdabcaba') # count elements from a string
+
+ >>> c.most_common(3) # three most common elements
+ [('a', 5), ('b', 4), ('c', 3)]
+ >>> sorted(c) # list all unique elements
+ ['a', 'b', 'c', 'd', 'e']
+ >>> ''.join(sorted(c.elements())) # list elements with repetitions
+ 'aaaaabbbbcccdde'
+ >>> sum(c.values()) # total of all counts
+ 15
+
+ >>> c['a'] # count of letter 'a'
+ 5
+ >>> for elem in 'shazam': # update counts from an iterable
+ ... c[elem] += 1 # by adding 1 to each element's count
+ >>> c['a'] # now there are seven 'a'
+ 7
+ >>> del c['b'] # remove all 'b'
+ >>> c['b'] # now there are zero 'b'
+ 0
+
+ >>> d = Counter('simsalabim') # make another counter
+ >>> c.update(d) # add in the second counter
+ >>> c['a'] # now there are nine 'a'
+ 9
+
+ >>> c.clear() # empty the counter
+ >>> c
+ Counter()
+
+ Note: If a count is set to zero or reduced to zero, it will remain
+ in the counter until the entry is deleted or the counter is cleared:
+
+ >>> c = Counter('aaabbc')
+ >>> c['b'] -= 2 # reduce the count of 'b' by two
+ >>> c.most_common() # 'b' is still in, but its count is zero
+ [('a', 3), ('c', 1), ('b', 0)]
+
+ '''
+ # References:
+ # http://en.wikipedia.org/wiki/Multiset
+ # http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
+ # http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm
+ # http://code.activestate.com/recipes/259174/
+ # Knuth, TAOCP Vol. II section 4.6.3
+
+ def __init__(self, iterable=None, /, **kwds):
+ '''Create a new, empty Counter object. And if given, count elements
+ from an input iterable. Or, initialize the count from another mapping
+ of elements to their counts.
+
+ >>> c = Counter() # a new, empty counter
+ >>> c = Counter('gallahad') # a new counter from an iterable
+ >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping
+ >>> c = Counter(a=4, b=2) # a new counter from keyword args
+
+ '''
+ super().__init__()
+ self.update(iterable, **kwds)
+
+ def __missing__(self, key):
+ 'The count of elements not in the Counter is zero.'
+ # Needed so that self[missing_item] does not raise KeyError
+ return 0
+
+ def total(self):
+ 'Sum of the counts'
+ return sum(self.values())
+
+ def most_common(self, n=None):
+ '''List the n most common elements and their counts from the most
+ common to the least. If n is None, then list all element counts.
+
+ >>> Counter('abracadabra').most_common(3)
+ [('a', 5), ('b', 2), ('r', 2)]
+
+ '''
+ # Emulate Bag.sortedByCount from Smalltalk
+ if n is None:
+ return sorted(self.items(), key=_itemgetter(1), reverse=True)
+
+ # Lazy import to speedup Python startup time
+ import heapq
+ return heapq.nlargest(n, self.items(), key=_itemgetter(1))
+
+ def elements(self):
+ '''Iterator over elements repeating each as many times as its count.
+
+ >>> c = Counter('ABCABC')
+ >>> sorted(c.elements())
+ ['A', 'A', 'B', 'B', 'C', 'C']
+
+ # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1
+ >>> import math
+ >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
+ >>> math.prod(prime_factors.elements())
+ 1836
+
+ Note, if an element's count has been set to zero or is a negative
+ number, elements() will ignore it.
+
+ '''
+ # Emulate Bag.do from Smalltalk and Multiset.begin from C++.
+ return _chain.from_iterable(_starmap(_repeat, self.items()))
+
+ # Override dict methods where necessary
+
+ @classmethod
+ def fromkeys(cls, iterable, v=None):
+ # There is no equivalent method for counters because the semantics
+ # would be ambiguous in cases such as Counter.fromkeys('aaabbc', v=2).
+ # Initializing counters to zero values isn't necessary because zero
+ # is already the default value for counter lookups. Initializing
+ # to one is easily accomplished with Counter(set(iterable)). For
+ # more exotic cases, create a dictionary first using a dictionary
+ # comprehension or dict.fromkeys().
+ raise NotImplementedError(
+ 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.')
+
+ def update(self, iterable=None, /, **kwds):
+ '''Like dict.update() but add counts instead of replacing them.
+
+ Source can be an iterable, a dictionary, or another Counter instance.
+
+ >>> c = Counter('which')
+ >>> c.update('witch') # add elements from another iterable
+ >>> d = Counter('watch')
+ >>> c.update(d) # add elements from another counter
+ >>> c['h'] # four 'h' in which, witch, and watch
+ 4
+
+ '''
+ # The regular dict.update() operation makes no sense here because the
+ # replace behavior results in some of the original untouched counts
+ # being mixed-in with all of the other counts for a mismash that
+ # doesn't have a straight-forward interpretation in most counting
+ # contexts. Instead, we implement straight-addition. Both the inputs
+ # and outputs are allowed to contain zero and negative counts.
+
+ if iterable is not None:
+ if isinstance(iterable, _collections_abc.Mapping):
+ if self:
+ self_get = self.get
+ for elem, count in iterable.items():
+ self[elem] = count + self_get(elem, 0)
+ else:
+ # fast path when counter is empty
+ super().update(iterable)
+ else:
+ _count_elements(self, iterable)
+ if kwds:
+ self.update(kwds)
+
+ def subtract(self, iterable=None, /, **kwds):
+ '''Like dict.update() but subtracts counts instead of replacing them.
+ Counts can be reduced below zero. Both the inputs and outputs are
+ allowed to contain zero and negative counts.
+
+ Source can be an iterable, a dictionary, or another Counter instance.
+
+ >>> c = Counter('which')
+ >>> c.subtract('witch') # subtract elements from another iterable
+ >>> c.subtract(Counter('watch')) # subtract elements from another counter
+ >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch
+ 0
+ >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch
+ -1
+
+ '''
+ if iterable is not None:
+ self_get = self.get
+ if isinstance(iterable, _collections_abc.Mapping):
+ for elem, count in iterable.items():
+ self[elem] = self_get(elem, 0) - count
+ else:
+ for elem in iterable:
+ self[elem] = self_get(elem, 0) - 1
+ if kwds:
+ self.subtract(kwds)
+
+ def copy(self):
+ 'Return a shallow copy.'
+ return self.__class__(self)
+
+ def __reduce__(self):
+ return self.__class__, (dict(self),)
+
+ def __delitem__(self, elem):
+ 'Like dict.__delitem__() but does not raise KeyError for missing values.'
+ if elem in self:
+ super().__delitem__(elem)
+
+ def __repr__(self):
+ if not self:
+ return f'{self.__class__.__name__}()'
+ try:
+ # dict() preserves the ordering returned by most_common()
+ d = dict(self.most_common())
+ except TypeError:
+ # handle case where values are not orderable
+ d = dict(self)
+ return f'{self.__class__.__name__}({d!r})'
+
+ # Multiset-style mathematical operations discussed in:
+ # Knuth TAOCP Volume II section 4.6.3 exercise 19
+ # and at http://en.wikipedia.org/wiki/Multiset
+ #
+ # Outputs guaranteed to only include positive counts.
+ #
+ # To strip negative and zero counts, add-in an empty counter:
+ # c += Counter()
+ #
+ # Results are ordered according to when an element is first
+ # encountered in the left operand and then by the order
+ # encountered in the right operand.
+ #
+ # When the multiplicities are all zero or one, multiset operations
+ # are guaranteed to be equivalent to the corresponding operations
+ # for regular sets.
+ # Given counter multisets such as:
+ # cp = Counter(a=1, b=0, c=1)
+ # cq = Counter(c=1, d=0, e=1)
+ # The corresponding regular sets would be:
+ # sp = {'a', 'c'}
+ # sq = {'c', 'e'}
+ # All of the following relations would hold:
+ # set(cp + cq) == sp | sq
+ # set(cp - cq) == sp - sq
+ # set(cp | cq) == sp | sq
+ # set(cp & cq) == sp & sq
+ # (cp == cq) == (sp == sq)
+ # (cp != cq) == (sp != sq)
+ # (cp <= cq) == (sp <= sq)
+ # (cp < cq) == (sp < sq)
+ # (cp >= cq) == (sp >= sq)
+ # (cp > cq) == (sp > sq)
+
+ def __eq__(self, other):
+ 'True if all counts agree. Missing counts are treated as zero.'
+ if not isinstance(other, Counter):
+ return NotImplemented
+ return all(self[e] == other[e] for c in (self, other) for e in c)
+
+ def __ne__(self, other):
+ 'True if any counts disagree. Missing counts are treated as zero.'
+ if not isinstance(other, Counter):
+ return NotImplemented
+ return not self == other
+
+ def __le__(self, other):
+ 'True if all counts in self are a subset of those in other.'
+ if not isinstance(other, Counter):
+ return NotImplemented
+ return all(self[e] <= other[e] for c in (self, other) for e in c)
+
+ def __lt__(self, other):
+ 'True if all counts in self are a proper subset of those in other.'
+ if not isinstance(other, Counter):
+ return NotImplemented
+ return self <= other and self != other
+
+ def __ge__(self, other):
+ 'True if all counts in self are a superset of those in other.'
+ if not isinstance(other, Counter):
+ return NotImplemented
+ return all(self[e] >= other[e] for c in (self, other) for e in c)
+
+ def __gt__(self, other):
+ 'True if all counts in self are a proper superset of those in other.'
+ if not isinstance(other, Counter):
+ return NotImplemented
+ return self >= other and self != other
+
+ def __add__(self, other):
+ '''Add counts from two counters.
+
+ >>> Counter('abbb') + Counter('bcc')
+ Counter({'b': 4, 'c': 2, 'a': 1})
+
+ '''
+ if not isinstance(other, Counter):
+ return NotImplemented
+ result = Counter()
+ for elem, count in self.items():
+ newcount = count + other[elem]
+ if newcount > 0:
+ result[elem] = newcount
+ for elem, count in other.items():
+ if elem not in self and count > 0:
+ result[elem] = count
+ return result
+
+ def __sub__(self, other):
+ ''' Subtract count, but keep only results with positive counts.
+
+ >>> Counter('abbbc') - Counter('bccd')
+ Counter({'b': 2, 'a': 1})
+
+ '''
+ if not isinstance(other, Counter):
+ return NotImplemented
+ result = Counter()
+ for elem, count in self.items():
+ newcount = count - other[elem]
+ if newcount > 0:
+ result[elem] = newcount
+ for elem, count in other.items():
+ if elem not in self and count < 0:
+ result[elem] = 0 - count
+ return result
+
+ def __or__(self, other):
+ '''Union is the maximum of value in either of the input counters.
+
+ >>> Counter('abbb') | Counter('bcc')
+ Counter({'b': 3, 'c': 2, 'a': 1})
+
+ '''
+ if not isinstance(other, Counter):
+ return NotImplemented
+ result = Counter()
+ for elem, count in self.items():
+ other_count = other[elem]
+ newcount = other_count if count < other_count else count
+ if newcount > 0:
+ result[elem] = newcount
+ for elem, count in other.items():
+ if elem not in self and count > 0:
+ result[elem] = count
+ return result
+
+ def __and__(self, other):
+ ''' Intersection is the minimum of corresponding counts.
+
+ >>> Counter('abbb') & Counter('bcc')
+ Counter({'b': 1})
+
+ '''
+ if not isinstance(other, Counter):
+ return NotImplemented
+ result = Counter()
+ for elem, count in self.items():
+ other_count = other[elem]
+ newcount = count if count < other_count else other_count
+ if newcount > 0:
+ result[elem] = newcount
+ return result
+
+ def __pos__(self):
+ 'Adds an empty counter, effectively stripping negative and zero counts'
+ result = Counter()
+ for elem, count in self.items():
+ if count > 0:
+ result[elem] = count
+ return result
+
+ def __neg__(self):
+ '''Subtracts from an empty counter. Strips positive and zero counts,
+ and flips the sign on negative counts.
+
+ '''
+ result = Counter()
+ for elem, count in self.items():
+ if count < 0:
+ result[elem] = 0 - count
+ return result
+
+ def _keep_positive(self):
+ '''Internal method to strip elements with a negative or zero count'''
+ nonpositive = [elem for elem, count in self.items() if not count > 0]
+ for elem in nonpositive:
+ del self[elem]
+ return self
+
+ def __iadd__(self, other):
+ '''Inplace add from another counter, keeping only positive counts.
+
+ >>> c = Counter('abbb')
+ >>> c += Counter('bcc')
+ >>> c
+ Counter({'b': 4, 'c': 2, 'a': 1})
+
+ '''
+ for elem, count in other.items():
+ self[elem] += count
+ return self._keep_positive()
+
+ def __isub__(self, other):
+ '''Inplace subtract counter, but keep only results with positive counts.
+
+ >>> c = Counter('abbbc')
+ >>> c -= Counter('bccd')
+ >>> c
+ Counter({'b': 2, 'a': 1})
+
+ '''
+ for elem, count in other.items():
+ self[elem] -= count
+ return self._keep_positive()
+
+ def __ior__(self, other):
+ '''Inplace union is the maximum of value from either counter.
+
+ >>> c = Counter('abbb')
+ >>> c |= Counter('bcc')
+ >>> c
+ Counter({'b': 3, 'c': 2, 'a': 1})
+
+ '''
+ for elem, other_count in other.items():
+ count = self[elem]
+ if other_count > count:
+ self[elem] = other_count
+ return self._keep_positive()
+
+ def __iand__(self, other):
+ '''Inplace intersection is the minimum of corresponding counts.
+
+ >>> c = Counter('abbb')
+ >>> c &= Counter('bcc')
+ >>> c
+ Counter({'b': 1})
+
+ '''
+ for elem, count in self.items():
+ other_count = other[elem]
+ if other_count < count:
+ self[elem] = other_count
+ return self._keep_positive()
+
+
+########################################################################
+### ChainMap
+########################################################################
+
+class ChainMap(_collections_abc.MutableMapping):
+ ''' A ChainMap groups multiple dicts (or other mappings) together
+ to create a single, updateable view.
+
+ The underlying mappings are stored in a list. That list is public and can
+ be accessed or updated using the *maps* attribute. There is no other
+ state.
+
+ Lookups search the underlying mappings successively until a key is found.
+ In contrast, writes, updates, and deletions only operate on the first
+ mapping.
+
+ '''
+
+ def __init__(self, *maps):
+ '''Initialize a ChainMap by setting *maps* to the given mappings.
+ If no mappings are provided, a single empty dictionary is used.
+
+ '''
+ self.maps = list(maps) or [{}] # always at least one map
+
+ def __missing__(self, key):
+ raise KeyError(key)
+
+ def __getitem__(self, key):
+ for mapping in self.maps:
+ try:
+ return mapping[key] # can't use 'key in mapping' with defaultdict
+ except KeyError:
+ pass
+ return self.__missing__(key) # support subclasses that define __missing__
+
+ def get(self, key, default=None):
+ return self[key] if key in self else default
+
+ def __len__(self):
+ return len(set().union(*self.maps)) # reuses stored hash values if possible
+
+ def __iter__(self):
+ d = {}
+ for mapping in reversed(self.maps):
+ d.update(dict.fromkeys(mapping)) # reuses stored hash values if possible
+ return iter(d)
+
+ def __contains__(self, key):
+ return any(key in m for m in self.maps)
+
+ def __bool__(self):
+ return any(self.maps)
+
+ @_recursive_repr()
+ def __repr__(self):
+ return f'{self.__class__.__name__}({", ".join(map(repr, self.maps))})'
+
+ @classmethod
+ def fromkeys(cls, iterable, *args):
+ 'Create a ChainMap with a single dict created from the iterable.'
+ return cls(dict.fromkeys(iterable, *args))
+
+ def copy(self):
+ 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'
+ return self.__class__(self.maps[0].copy(), *self.maps[1:])
+
+ __copy__ = copy
+
+ def new_child(self, m=None, **kwargs): # like Django's Context.push()
+ '''New ChainMap with a new map followed by all previous maps.
+ If no map is provided, an empty dict is used.
+ Keyword arguments update the map or new empty dict.
+ '''
+ if m is None:
+ m = kwargs
+ elif kwargs:
+ m.update(kwargs)
+ return self.__class__(m, *self.maps)
+
+ @property
+ def parents(self): # like Django's Context.pop()
+ 'New ChainMap from maps[1:].'
+ return self.__class__(*self.maps[1:])
+
+ def __setitem__(self, key, value):
+ self.maps[0][key] = value
+
+ def __delitem__(self, key):
+ try:
+ del self.maps[0][key]
+ except KeyError:
+ raise KeyError(f'Key not found in the first mapping: {key!r}')
+
+ def popitem(self):
+ 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
+ try:
+ return self.maps[0].popitem()
+ except KeyError:
+ raise KeyError('No keys found in the first mapping.')
+
+ def pop(self, key, *args):
+ 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'
+ try:
+ return self.maps[0].pop(key, *args)
+ except KeyError:
+ raise KeyError(f'Key not found in the first mapping: {key!r}')
+
+ def clear(self):
+ 'Clear maps[0], leaving maps[1:] intact.'
+ self.maps[0].clear()
+
+ def __ior__(self, other):
+ self.maps[0].update(other)
+ return self
+
+ def __or__(self, other):
+ if not isinstance(other, _collections_abc.Mapping):
+ return NotImplemented
+ m = self.copy()
+ m.maps[0].update(other)
+ return m
+
+ def __ror__(self, other):
+ if not isinstance(other, _collections_abc.Mapping):
+ return NotImplemented
+ m = dict(other)
+ for child in reversed(self.maps):
+ m.update(child)
+ return self.__class__(m)
+
+
+################################################################################
+### UserDict
+################################################################################
+
+class UserDict(_collections_abc.MutableMapping):
+
+ # Start by filling-out the abstract methods
+ def __init__(self, dict=None, /, **kwargs):
+ self.data = {}
+ if dict is not None:
+ self.update(dict)
+ if kwargs:
+ self.update(kwargs)
+
+ def __len__(self):
+ return len(self.data)
+
+ def __getitem__(self, key):
+ if key in self.data:
+ return self.data[key]
+ if hasattr(self.__class__, "__missing__"):
+ return self.__class__.__missing__(self, key)
+ raise KeyError(key)
+
+ def __setitem__(self, key, item):
+ self.data[key] = item
+
+ def __delitem__(self, key):
+ del self.data[key]
+
+ def __iter__(self):
+ return iter(self.data)
+
+ # Modify __contains__ to work correctly when __missing__ is present
+ def __contains__(self, key):
+ return key in self.data
+
+ # Now, add the methods in dicts but not in MutableMapping
+ def __repr__(self):
+ return repr(self.data)
+
+ def __or__(self, other):
+ if isinstance(other, UserDict):
+ return self.__class__(self.data | other.data)
+ if isinstance(other, dict):
+ return self.__class__(self.data | other)
+ return NotImplemented
+
+ def __ror__(self, other):
+ if isinstance(other, UserDict):
+ return self.__class__(other.data | self.data)
+ if isinstance(other, dict):
+ return self.__class__(other | self.data)
+ return NotImplemented
+
+ def __ior__(self, other):
+ if isinstance(other, UserDict):
+ self.data |= other.data
+ else:
+ self.data |= other
+ return self
+
+ def __copy__(self):
+ inst = self.__class__.__new__(self.__class__)
+ inst.__dict__.update(self.__dict__)
+ # Create a copy and avoid triggering descriptors
+ inst.__dict__["data"] = self.__dict__["data"].copy()
+ return inst
+
+ def copy(self):
+ if self.__class__ is UserDict:
+ return UserDict(self.data.copy())
+ import copy
+ data = self.data
+ try:
+ self.data = {}
+ c = copy.copy(self)
+ finally:
+ self.data = data
+ c.update(self)
+ return c
+
+ @classmethod
+ def fromkeys(cls, iterable, value=None):
+ d = cls()
+ for key in iterable:
+ d[key] = value
+ return d
+
+
+################################################################################
+### UserList
+################################################################################
+
+class UserList(_collections_abc.MutableSequence):
+ """A more or less complete user-defined wrapper around list objects."""
+
+ def __init__(self, initlist=None):
+ self.data = []
+ if initlist is not None:
+ # XXX should this accept an arbitrary sequence?
+ if type(initlist) == type(self.data):
+ self.data[:] = initlist
+ elif isinstance(initlist, UserList):
+ self.data[:] = initlist.data[:]
+ else:
+ self.data = list(initlist)
+
+ def __repr__(self):
+ return repr(self.data)
+
+ def __lt__(self, other):
+ return self.data < self.__cast(other)
+
+ def __le__(self, other):
+ return self.data <= self.__cast(other)
+
+ def __eq__(self, other):
+ return self.data == self.__cast(other)
+
+ def __gt__(self, other):
+ return self.data > self.__cast(other)
+
+ def __ge__(self, other):
+ return self.data >= self.__cast(other)
+
+ def __cast(self, other):
+ return other.data if isinstance(other, UserList) else other
+
+ def __contains__(self, item):
+ return item in self.data
+
+ def __len__(self):
+ return len(self.data)
+
+ def __getitem__(self, i):
+ if isinstance(i, slice):
+ return self.__class__(self.data[i])
+ else:
+ return self.data[i]
+
+ def __setitem__(self, i, item):
+ self.data[i] = item
+
+ def __delitem__(self, i):
+ del self.data[i]
+
+ def __add__(self, other):
+ if isinstance(other, UserList):
+ return self.__class__(self.data + other.data)
+ elif isinstance(other, type(self.data)):
+ return self.__class__(self.data + other)
+ return self.__class__(self.data + list(other))
+
+ def __radd__(self, other):
+ if isinstance(other, UserList):
+ return self.__class__(other.data + self.data)
+ elif isinstance(other, type(self.data)):
+ return self.__class__(other + self.data)
+ return self.__class__(list(other) + self.data)
+
+ def __iadd__(self, other):
+ if isinstance(other, UserList):
+ self.data += other.data
+ elif isinstance(other, type(self.data)):
+ self.data += other
+ else:
+ self.data += list(other)
+ return self
+
+ def __mul__(self, n):
+ return self.__class__(self.data * n)
+
+ __rmul__ = __mul__
+
+ def __imul__(self, n):
+ self.data *= n
+ return self
+
+ def __copy__(self):
+ inst = self.__class__.__new__(self.__class__)
+ inst.__dict__.update(self.__dict__)
+ # Create a copy and avoid triggering descriptors
+ inst.__dict__["data"] = self.__dict__["data"][:]
+ return inst
+
+ def append(self, item):
+ self.data.append(item)
+
+ def insert(self, i, item):
+ self.data.insert(i, item)
+
+ def pop(self, i=-1):
+ return self.data.pop(i)
+
+ def remove(self, item):
+ self.data.remove(item)
+
+ def clear(self):
+ self.data.clear()
+
+ def copy(self):
+ return self.__class__(self)
+
+ def count(self, item):
+ return self.data.count(item)
+
+ def index(self, item, *args):
+ return self.data.index(item, *args)
+
+ def reverse(self):
+ self.data.reverse()
+
+ def sort(self, /, *args, **kwds):
+ self.data.sort(*args, **kwds)
+
+ def extend(self, other):
+ if isinstance(other, UserList):
+ self.data.extend(other.data)
+ else:
+ self.data.extend(other)
+
+
+################################################################################
+### UserString
+################################################################################
+
+class UserString(_collections_abc.Sequence):
+
+ def __init__(self, seq):
+ if isinstance(seq, str):
+ self.data = seq
+ elif isinstance(seq, UserString):
+ self.data = seq.data[:]
+ else:
+ self.data = str(seq)
+
+ def __str__(self):
+ return str(self.data)
+
+ def __repr__(self):
+ return repr(self.data)
+
+ def __int__(self):
+ return int(self.data)
+
+ def __float__(self):
+ return float(self.data)
+
+ def __complex__(self):
+ return complex(self.data)
+
+ def __hash__(self):
+ return hash(self.data)
+
+ def __getnewargs__(self):
+ return (self.data[:],)
+
+ def __eq__(self, string):
+ if isinstance(string, UserString):
+ return self.data == string.data
+ return self.data == string
+
+ def __lt__(self, string):
+ if isinstance(string, UserString):
+ return self.data < string.data
+ return self.data < string
+
+ def __le__(self, string):
+ if isinstance(string, UserString):
+ return self.data <= string.data
+ return self.data <= string
+
+ def __gt__(self, string):
+ if isinstance(string, UserString):
+ return self.data > string.data
+ return self.data > string
+
+ def __ge__(self, string):
+ if isinstance(string, UserString):
+ return self.data >= string.data
+ return self.data >= string
+
+ def __contains__(self, char):
+ if isinstance(char, UserString):
+ char = char.data
+ return char in self.data
+
+ def __len__(self):
+ return len(self.data)
+
+ def __getitem__(self, index):
+ return self.__class__(self.data[index])
+
+ def __add__(self, other):
+ if isinstance(other, UserString):
+ return self.__class__(self.data + other.data)
+ elif isinstance(other, str):
+ return self.__class__(self.data + other)
+ return self.__class__(self.data + str(other))
+
+ def __radd__(self, other):
+ if isinstance(other, str):
+ return self.__class__(other + self.data)
+ return self.__class__(str(other) + self.data)
+
+ def __mul__(self, n):
+ return self.__class__(self.data * n)
+
+ __rmul__ = __mul__
+
+ def __mod__(self, args):
+ return self.__class__(self.data % args)
+
+ def __rmod__(self, template):
+ return self.__class__(str(template) % self)
+
+ # the following methods are defined in alphabetical order:
+ def capitalize(self):
+ return self.__class__(self.data.capitalize())
+
+ def casefold(self):
+ return self.__class__(self.data.casefold())
+
+ def center(self, width, *args):
+ return self.__class__(self.data.center(width, *args))
+
+ def count(self, sub, start=0, end=_sys.maxsize):
+ if isinstance(sub, UserString):
+ sub = sub.data
+ return self.data.count(sub, start, end)
+
+ def removeprefix(self, prefix, /):
+ if isinstance(prefix, UserString):
+ prefix = prefix.data
+ return self.__class__(self.data.removeprefix(prefix))
+
+ def removesuffix(self, suffix, /):
+ if isinstance(suffix, UserString):
+ suffix = suffix.data
+ return self.__class__(self.data.removesuffix(suffix))
+
+ def encode(self, encoding='utf-8', errors='strict'):
+ encoding = 'utf-8' if encoding is None else encoding
+ errors = 'strict' if errors is None else errors
+ return self.data.encode(encoding, errors)
+
+ def endswith(self, suffix, start=0, end=_sys.maxsize):
+ return self.data.endswith(suffix, start, end)
+
+ def expandtabs(self, tabsize=8):
+ return self.__class__(self.data.expandtabs(tabsize))
+
+ def find(self, sub, start=0, end=_sys.maxsize):
+ if isinstance(sub, UserString):
+ sub = sub.data
+ return self.data.find(sub, start, end)
+
+ def format(self, /, *args, **kwds):
+ return self.data.format(*args, **kwds)
+
+ def format_map(self, mapping):
+ return self.data.format_map(mapping)
+
+ def index(self, sub, start=0, end=_sys.maxsize):
+ return self.data.index(sub, start, end)
+
+ def isalpha(self):
+ return self.data.isalpha()
+
+ def isalnum(self):
+ return self.data.isalnum()
+
+ def isascii(self):
+ return self.data.isascii()
+
+ def isdecimal(self):
+ return self.data.isdecimal()
+
+ def isdigit(self):
+ return self.data.isdigit()
+
+ def isidentifier(self):
+ return self.data.isidentifier()
+
+ def islower(self):
+ return self.data.islower()
+
+ def isnumeric(self):
+ return self.data.isnumeric()
+
+ def isprintable(self):
+ return self.data.isprintable()
+
+ def isspace(self):
+ return self.data.isspace()
+
+ def istitle(self):
+ return self.data.istitle()
+
+ def isupper(self):
+ return self.data.isupper()
+
+ def join(self, seq):
+ return self.data.join(seq)
+
+ def ljust(self, width, *args):
+ return self.__class__(self.data.ljust(width, *args))
+
+ def lower(self):
+ return self.__class__(self.data.lower())
+
+ def lstrip(self, chars=None):
+ return self.__class__(self.data.lstrip(chars))
+
+ maketrans = str.maketrans
+
+ def partition(self, sep):
+ return self.data.partition(sep)
+
+ def replace(self, old, new, maxsplit=-1):
+ if isinstance(old, UserString):
+ old = old.data
+ if isinstance(new, UserString):
+ new = new.data
+ return self.__class__(self.data.replace(old, new, maxsplit))
+
+ def rfind(self, sub, start=0, end=_sys.maxsize):
+ if isinstance(sub, UserString):
+ sub = sub.data
+ return self.data.rfind(sub, start, end)
+
+ def rindex(self, sub, start=0, end=_sys.maxsize):
+ return self.data.rindex(sub, start, end)
+
+ def rjust(self, width, *args):
+ return self.__class__(self.data.rjust(width, *args))
+
+ def rpartition(self, sep):
+ return self.data.rpartition(sep)
+
+ def rstrip(self, chars=None):
+ return self.__class__(self.data.rstrip(chars))
+
+ def split(self, sep=None, maxsplit=-1):
+ return self.data.split(sep, maxsplit)
+
+ def rsplit(self, sep=None, maxsplit=-1):
+ return self.data.rsplit(sep, maxsplit)
+
+ def splitlines(self, keepends=False):
+ return self.data.splitlines(keepends)
+
+ def startswith(self, prefix, start=0, end=_sys.maxsize):
+ return self.data.startswith(prefix, start, end)
+
+ def strip(self, chars=None):
+ return self.__class__(self.data.strip(chars))
+
+ def swapcase(self):
+ return self.__class__(self.data.swapcase())
+
+ def title(self):
+ return self.__class__(self.data.title())
+
+ def translate(self, *args):
+ return self.__class__(self.data.translate(*args))
+
+ def upper(self):
+ return self.__class__(self.data.upper())
+
+ def zfill(self, width):
+ return self.__class__(self.data.zfill(width))
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__pycache__/__init__.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..62058952dc624e95647cd29a7c0c1a7ddd79f99f
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__pycache__/__init__.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__pycache__/abc.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__pycache__/abc.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..62dc64fefb15b60e2f567c0fc22d760f6dc39aa6
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/__pycache__/abc.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/collections/abc.py b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/abc.py
new file mode 100644
index 0000000000000000000000000000000000000000..86ca8b8a8414b3860aa80599394e806e156f4b5b
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/collections/abc.py
@@ -0,0 +1,3 @@
+from _collections_abc import *
+from _collections_abc import __all__
+from _collections_abc import _CallableGenericAlias
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/colorsys.py b/physworld_p1_20261018/envs/p1/lib/python3.11/colorsys.py
new file mode 100644
index 0000000000000000000000000000000000000000..bc897bd0f9929828a4a826879b7274b18a442b81
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/colorsys.py
@@ -0,0 +1,166 @@
+"""Conversion functions between RGB and other color systems.
+
+This modules provides two functions for each color system ABC:
+
+ rgb_to_abc(r, g, b) --> a, b, c
+ abc_to_rgb(a, b, c) --> r, g, b
+
+All inputs and outputs are triples of floats in the range [0.0...1.0]
+(with the exception of I and Q, which covers a slightly larger range).
+Inputs outside the valid range may cause exceptions or invalid outputs.
+
+Supported color systems:
+RGB: Red, Green, Blue components
+YIQ: Luminance, Chrominance (used by composite video signals)
+HLS: Hue, Luminance, Saturation
+HSV: Hue, Saturation, Value
+"""
+
+# References:
+# http://en.wikipedia.org/wiki/YIQ
+# http://en.wikipedia.org/wiki/HLS_color_space
+# http://en.wikipedia.org/wiki/HSV_color_space
+
+__all__ = ["rgb_to_yiq","yiq_to_rgb","rgb_to_hls","hls_to_rgb",
+ "rgb_to_hsv","hsv_to_rgb"]
+
+# Some floating point constants
+
+ONE_THIRD = 1.0/3.0
+ONE_SIXTH = 1.0/6.0
+TWO_THIRD = 2.0/3.0
+
+# YIQ: used by composite video signals (linear combinations of RGB)
+# Y: perceived grey level (0.0 == black, 1.0 == white)
+# I, Q: color components
+#
+# There are a great many versions of the constants used in these formulae.
+# The ones in this library uses constants from the FCC version of NTSC.
+
+def rgb_to_yiq(r, g, b):
+ y = 0.30*r + 0.59*g + 0.11*b
+ i = 0.74*(r-y) - 0.27*(b-y)
+ q = 0.48*(r-y) + 0.41*(b-y)
+ return (y, i, q)
+
+def yiq_to_rgb(y, i, q):
+ # r = y + (0.27*q + 0.41*i) / (0.74*0.41 + 0.27*0.48)
+ # b = y + (0.74*q - 0.48*i) / (0.74*0.41 + 0.27*0.48)
+ # g = y - (0.30*(r-y) + 0.11*(b-y)) / 0.59
+
+ r = y + 0.9468822170900693*i + 0.6235565819861433*q
+ g = y - 0.27478764629897834*i - 0.6356910791873801*q
+ b = y - 1.1085450346420322*i + 1.7090069284064666*q
+
+ if r < 0.0:
+ r = 0.0
+ if g < 0.0:
+ g = 0.0
+ if b < 0.0:
+ b = 0.0
+ if r > 1.0:
+ r = 1.0
+ if g > 1.0:
+ g = 1.0
+ if b > 1.0:
+ b = 1.0
+ return (r, g, b)
+
+
+# HLS: Hue, Luminance, Saturation
+# H: position in the spectrum
+# L: color lightness
+# S: color saturation
+
+def rgb_to_hls(r, g, b):
+ maxc = max(r, g, b)
+ minc = min(r, g, b)
+ sumc = (maxc+minc)
+ rangec = (maxc-minc)
+ l = sumc/2.0
+ if minc == maxc:
+ return 0.0, l, 0.0
+ if l <= 0.5:
+ s = rangec / sumc
+ else:
+ s = rangec / (2.0-maxc-minc) # Not always 2.0-sumc: gh-106498.
+ rc = (maxc-r) / rangec
+ gc = (maxc-g) / rangec
+ bc = (maxc-b) / rangec
+ if r == maxc:
+ h = bc-gc
+ elif g == maxc:
+ h = 2.0+rc-bc
+ else:
+ h = 4.0+gc-rc
+ h = (h/6.0) % 1.0
+ return h, l, s
+
+def hls_to_rgb(h, l, s):
+ if s == 0.0:
+ return l, l, l
+ if l <= 0.5:
+ m2 = l * (1.0+s)
+ else:
+ m2 = l+s-(l*s)
+ m1 = 2.0*l - m2
+ return (_v(m1, m2, h+ONE_THIRD), _v(m1, m2, h), _v(m1, m2, h-ONE_THIRD))
+
+def _v(m1, m2, hue):
+ hue = hue % 1.0
+ if hue < ONE_SIXTH:
+ return m1 + (m2-m1)*hue*6.0
+ if hue < 0.5:
+ return m2
+ if hue < TWO_THIRD:
+ return m1 + (m2-m1)*(TWO_THIRD-hue)*6.0
+ return m1
+
+
+# HSV: Hue, Saturation, Value
+# H: position in the spectrum
+# S: color saturation ("purity")
+# V: color brightness
+
+def rgb_to_hsv(r, g, b):
+ maxc = max(r, g, b)
+ minc = min(r, g, b)
+ rangec = (maxc-minc)
+ v = maxc
+ if minc == maxc:
+ return 0.0, 0.0, v
+ s = rangec / maxc
+ rc = (maxc-r) / rangec
+ gc = (maxc-g) / rangec
+ bc = (maxc-b) / rangec
+ if r == maxc:
+ h = bc-gc
+ elif g == maxc:
+ h = 2.0+rc-bc
+ else:
+ h = 4.0+gc-rc
+ h = (h/6.0) % 1.0
+ return h, s, v
+
+def hsv_to_rgb(h, s, v):
+ if s == 0.0:
+ return v, v, v
+ i = int(h*6.0) # XXX assume int() truncates!
+ f = (h*6.0) - i
+ p = v*(1.0 - s)
+ q = v*(1.0 - s*f)
+ t = v*(1.0 - s*(1.0-f))
+ i = i%6
+ if i == 0:
+ return v, t, p
+ if i == 1:
+ return q, v, p
+ if i == 2:
+ return p, v, t
+ if i == 3:
+ return p, q, v
+ if i == 4:
+ return t, p, v
+ if i == 5:
+ return v, p, q
+ # Cannot get here
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/compileall.py b/physworld_p1_20261018/envs/p1/lib/python3.11/compileall.py
new file mode 100644
index 0000000000000000000000000000000000000000..a388931fb5a99da63f517a09b61683fd33d7d0de
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/compileall.py
@@ -0,0 +1,463 @@
+"""Module/script to byte-compile all .py files to .pyc files.
+
+When called as a script with arguments, this compiles the directories
+given as arguments recursively; the -l option prevents it from
+recursing into directories.
+
+Without arguments, it compiles all modules on sys.path, without
+recursing into subdirectories. (Even though it should do so for
+packages -- for now, you'll have to deal with packages separately.)
+
+See module py_compile for details of the actual byte-compilation.
+"""
+import os
+import sys
+import importlib.util
+import py_compile
+import struct
+import filecmp
+
+from functools import partial
+from pathlib import Path
+
+__all__ = ["compile_dir","compile_file","compile_path"]
+
+def _walk_dir(dir, maxlevels, quiet=0):
+ if quiet < 2 and isinstance(dir, os.PathLike):
+ dir = os.fspath(dir)
+ if not quiet:
+ print('Listing {!r}...'.format(dir))
+ try:
+ names = os.listdir(dir)
+ except OSError:
+ if quiet < 2:
+ print("Can't list {!r}".format(dir))
+ names = []
+ names.sort()
+ for name in names:
+ if name == '__pycache__':
+ continue
+ fullname = os.path.join(dir, name)
+ if not os.path.isdir(fullname):
+ yield fullname
+ elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
+ os.path.isdir(fullname) and not os.path.islink(fullname)):
+ yield from _walk_dir(fullname, maxlevels=maxlevels - 1,
+ quiet=quiet)
+
+def compile_dir(dir, maxlevels=None, ddir=None, force=False,
+ rx=None, quiet=0, legacy=False, optimize=-1, workers=1,
+ invalidation_mode=None, *, stripdir=None,
+ prependdir=None, limit_sl_dest=None, hardlink_dupes=False):
+ """Byte-compile all modules in the given directory tree.
+
+ Arguments (only dir is required):
+
+ dir: the directory to byte-compile
+ maxlevels: maximum recursion level (default `sys.getrecursionlimit()`)
+ ddir: the directory that will be prepended to the path to the
+ file as it is compiled into each byte-code file.
+ force: if True, force compilation, even if timestamps are up-to-date
+ quiet: full output with False or 0, errors only with 1,
+ no output with 2
+ legacy: if True, produce legacy pyc paths instead of PEP 3147 paths
+ optimize: int or list of optimization levels or -1 for level of
+ the interpreter. Multiple levels leads to multiple compiled
+ files each with one optimization level.
+ workers: maximum number of parallel workers
+ invalidation_mode: how the up-to-dateness of the pyc will be checked
+ stripdir: part of path to left-strip from source file path
+ prependdir: path to prepend to beginning of original file path, applied
+ after stripdir
+ limit_sl_dest: ignore symlinks if they are pointing outside of
+ the defined path
+ hardlink_dupes: hardlink duplicated pyc files
+ """
+ ProcessPoolExecutor = None
+ if ddir is not None and (stripdir is not None or prependdir is not None):
+ raise ValueError(("Destination dir (ddir) cannot be used "
+ "in combination with stripdir or prependdir"))
+ if ddir is not None:
+ stripdir = dir
+ prependdir = ddir
+ ddir = None
+ if workers < 0:
+ raise ValueError('workers must be greater or equal to 0')
+ if workers != 1:
+ # Check if this is a system where ProcessPoolExecutor can function.
+ from concurrent.futures.process import _check_system_limits
+ try:
+ _check_system_limits()
+ except NotImplementedError:
+ workers = 1
+ else:
+ from concurrent.futures import ProcessPoolExecutor
+ if maxlevels is None:
+ maxlevels = sys.getrecursionlimit()
+ files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels)
+ success = True
+ if workers != 1 and ProcessPoolExecutor is not None:
+ # If workers == 0, let ProcessPoolExecutor choose
+ workers = workers or None
+ with ProcessPoolExecutor(max_workers=workers) as executor:
+ results = executor.map(partial(compile_file,
+ ddir=ddir, force=force,
+ rx=rx, quiet=quiet,
+ legacy=legacy,
+ optimize=optimize,
+ invalidation_mode=invalidation_mode,
+ stripdir=stripdir,
+ prependdir=prependdir,
+ limit_sl_dest=limit_sl_dest,
+ hardlink_dupes=hardlink_dupes),
+ files)
+ success = min(results, default=True)
+ else:
+ for file in files:
+ if not compile_file(file, ddir, force, rx, quiet,
+ legacy, optimize, invalidation_mode,
+ stripdir=stripdir, prependdir=prependdir,
+ limit_sl_dest=limit_sl_dest,
+ hardlink_dupes=hardlink_dupes):
+ success = False
+ return success
+
+def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
+ legacy=False, optimize=-1,
+ invalidation_mode=None, *, stripdir=None, prependdir=None,
+ limit_sl_dest=None, hardlink_dupes=False):
+ """Byte-compile one file.
+
+ Arguments (only fullname is required):
+
+ fullname: the file to byte-compile
+ ddir: if given, the directory name compiled in to the
+ byte-code file.
+ force: if True, force compilation, even if timestamps are up-to-date
+ quiet: full output with False or 0, errors only with 1,
+ no output with 2
+ legacy: if True, produce legacy pyc paths instead of PEP 3147 paths
+ optimize: int or list of optimization levels or -1 for level of
+ the interpreter. Multiple levels leads to multiple compiled
+ files each with one optimization level.
+ invalidation_mode: how the up-to-dateness of the pyc will be checked
+ stripdir: part of path to left-strip from source file path
+ prependdir: path to prepend to beginning of original file path, applied
+ after stripdir
+ limit_sl_dest: ignore symlinks if they are pointing outside of
+ the defined path.
+ hardlink_dupes: hardlink duplicated pyc files
+ """
+
+ if ddir is not None and (stripdir is not None or prependdir is not None):
+ raise ValueError(("Destination dir (ddir) cannot be used "
+ "in combination with stripdir or prependdir"))
+
+ success = True
+ fullname = os.fspath(fullname)
+ stripdir = os.fspath(stripdir) if stripdir is not None else None
+ name = os.path.basename(fullname)
+
+ dfile = None
+
+ if ddir is not None:
+ dfile = os.path.join(ddir, name)
+
+ if stripdir is not None:
+ fullname_parts = fullname.split(os.path.sep)
+ stripdir_parts = stripdir.split(os.path.sep)
+ ddir_parts = list(fullname_parts)
+
+ for spart, opart in zip(stripdir_parts, fullname_parts):
+ if spart == opart:
+ ddir_parts.remove(spart)
+
+ dfile = os.path.join(*ddir_parts)
+
+ if prependdir is not None:
+ if dfile is None:
+ dfile = os.path.join(prependdir, fullname)
+ else:
+ dfile = os.path.join(prependdir, dfile)
+
+ if isinstance(optimize, int):
+ optimize = [optimize]
+
+ # Use set() to remove duplicates.
+ # Use sorted() to create pyc files in a deterministic order.
+ optimize = sorted(set(optimize))
+
+ if hardlink_dupes and len(optimize) < 2:
+ raise ValueError("Hardlinking of duplicated bytecode makes sense "
+ "only for more than one optimization level")
+
+ if rx is not None:
+ mo = rx.search(fullname)
+ if mo:
+ return success
+
+ if limit_sl_dest is not None and os.path.islink(fullname):
+ if Path(limit_sl_dest).resolve() not in Path(fullname).resolve().parents:
+ return success
+
+ opt_cfiles = {}
+
+ if os.path.isfile(fullname):
+ for opt_level in optimize:
+ if legacy:
+ opt_cfiles[opt_level] = fullname + 'c'
+ else:
+ if opt_level >= 0:
+ opt = opt_level if opt_level >= 1 else ''
+ cfile = (importlib.util.cache_from_source(
+ fullname, optimization=opt))
+ opt_cfiles[opt_level] = cfile
+ else:
+ cfile = importlib.util.cache_from_source(fullname)
+ opt_cfiles[opt_level] = cfile
+
+ head, tail = name[:-3], name[-3:]
+ if tail == '.py':
+ if not force:
+ try:
+ mtime = int(os.stat(fullname).st_mtime)
+ expect = struct.pack('<4sLL', importlib.util.MAGIC_NUMBER,
+ 0, mtime & 0xFFFF_FFFF)
+ for cfile in opt_cfiles.values():
+ with open(cfile, 'rb') as chandle:
+ actual = chandle.read(12)
+ if expect != actual:
+ break
+ else:
+ return success
+ except OSError:
+ pass
+ if not quiet:
+ print('Compiling {!r}...'.format(fullname))
+ try:
+ for index, opt_level in enumerate(optimize):
+ cfile = opt_cfiles[opt_level]
+ ok = py_compile.compile(fullname, cfile, dfile, True,
+ optimize=opt_level,
+ invalidation_mode=invalidation_mode)
+ if index > 0 and hardlink_dupes:
+ previous_cfile = opt_cfiles[optimize[index - 1]]
+ if filecmp.cmp(cfile, previous_cfile, shallow=False):
+ os.unlink(cfile)
+ os.link(previous_cfile, cfile)
+ except py_compile.PyCompileError as err:
+ success = False
+ if quiet >= 2:
+ return success
+ elif quiet:
+ print('*** Error compiling {!r}...'.format(fullname))
+ else:
+ print('*** ', end='')
+ # escape non-printable characters in msg
+ encoding = sys.stdout.encoding or sys.getdefaultencoding()
+ msg = err.msg.encode(encoding, errors='backslashreplace').decode(encoding)
+ print(msg)
+ except (SyntaxError, UnicodeError, OSError) as e:
+ success = False
+ if quiet >= 2:
+ return success
+ elif quiet:
+ print('*** Error compiling {!r}...'.format(fullname))
+ else:
+ print('*** ', end='')
+ print(e.__class__.__name__ + ':', e)
+ else:
+ if ok == 0:
+ success = False
+ return success
+
+def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0,
+ legacy=False, optimize=-1,
+ invalidation_mode=None):
+ """Byte-compile all module on sys.path.
+
+ Arguments (all optional):
+
+ skip_curdir: if true, skip current directory (default True)
+ maxlevels: max recursion level (default 0)
+ force: as for compile_dir() (default False)
+ quiet: as for compile_dir() (default 0)
+ legacy: as for compile_dir() (default False)
+ optimize: as for compile_dir() (default -1)
+ invalidation_mode: as for compiler_dir()
+ """
+ success = True
+ for dir in sys.path:
+ if (not dir or dir == os.curdir) and skip_curdir:
+ if quiet < 2:
+ print('Skipping current directory')
+ else:
+ success = success and compile_dir(
+ dir,
+ maxlevels,
+ None,
+ force,
+ quiet=quiet,
+ legacy=legacy,
+ optimize=optimize,
+ invalidation_mode=invalidation_mode,
+ )
+ return success
+
+
+def main():
+ """Script main program."""
+ import argparse
+
+ parser = argparse.ArgumentParser(
+ description='Utilities to support installing Python libraries.')
+ parser.add_argument('-l', action='store_const', const=0,
+ default=None, dest='maxlevels',
+ help="don't recurse into subdirectories")
+ parser.add_argument('-r', type=int, dest='recursion',
+ help=('control the maximum recursion level. '
+ 'if `-l` and `-r` options are specified, '
+ 'then `-r` takes precedence.'))
+ parser.add_argument('-f', action='store_true', dest='force',
+ help='force rebuild even if timestamps are up to date')
+ parser.add_argument('-q', action='count', dest='quiet', default=0,
+ help='output only error messages; -qq will suppress '
+ 'the error messages as well.')
+ parser.add_argument('-b', action='store_true', dest='legacy',
+ help='use legacy (pre-PEP3147) compiled file locations')
+ parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
+ help=('directory to prepend to file paths for use in '
+ 'compile-time tracebacks and in runtime '
+ 'tracebacks in cases where the source file is '
+ 'unavailable'))
+ parser.add_argument('-s', metavar='STRIPDIR', dest='stripdir',
+ default=None,
+ help=('part of path to left-strip from path '
+ 'to source file - for example buildroot. '
+ '`-d` and `-s` options cannot be '
+ 'specified together.'))
+ parser.add_argument('-p', metavar='PREPENDDIR', dest='prependdir',
+ default=None,
+ help=('path to add as prefix to path '
+ 'to source file - for example / to make '
+ 'it absolute when some part is removed '
+ 'by `-s` option. '
+ '`-d` and `-p` options cannot be '
+ 'specified together.'))
+ parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
+ help=('skip files matching the regular expression; '
+ 'the regexp is searched for in the full path '
+ 'of each file considered for compilation'))
+ parser.add_argument('-i', metavar='FILE', dest='flist',
+ help=('add all the files and directories listed in '
+ 'FILE to the list considered for compilation; '
+ 'if "-", names are read from stdin'))
+ parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
+ help=('zero or more file and directory names '
+ 'to compile; if no arguments given, defaults '
+ 'to the equivalent of -l sys.path'))
+ parser.add_argument('-j', '--workers', default=1,
+ type=int, help='Run compileall concurrently')
+ invalidation_modes = [mode.name.lower().replace('_', '-')
+ for mode in py_compile.PycInvalidationMode]
+ parser.add_argument('--invalidation-mode',
+ choices=sorted(invalidation_modes),
+ help=('set .pyc invalidation mode; defaults to '
+ '"checked-hash" if the SOURCE_DATE_EPOCH '
+ 'environment variable is set, and '
+ '"timestamp" otherwise.'))
+ parser.add_argument('-o', action='append', type=int, dest='opt_levels',
+ help=('Optimization levels to run compilation with. '
+ 'Default is -1 which uses the optimization level '
+ 'of the Python interpreter itself (see -O).'))
+ parser.add_argument('-e', metavar='DIR', dest='limit_sl_dest',
+ help='Ignore symlinks pointing outsite of the DIR')
+ parser.add_argument('--hardlink-dupes', action='store_true',
+ dest='hardlink_dupes',
+ help='Hardlink duplicated pyc files')
+
+ args = parser.parse_args()
+ compile_dests = args.compile_dest
+
+ if args.rx:
+ import re
+ args.rx = re.compile(args.rx)
+
+ if args.limit_sl_dest == "":
+ args.limit_sl_dest = None
+
+ if args.recursion is not None:
+ maxlevels = args.recursion
+ else:
+ maxlevels = args.maxlevels
+
+ if args.opt_levels is None:
+ args.opt_levels = [-1]
+
+ if len(args.opt_levels) == 1 and args.hardlink_dupes:
+ parser.error(("Hardlinking of duplicated bytecode makes sense "
+ "only for more than one optimization level."))
+
+ if args.ddir is not None and (
+ args.stripdir is not None or args.prependdir is not None
+ ):
+ parser.error("-d cannot be used in combination with -s or -p")
+
+ # if flist is provided then load it
+ if args.flist:
+ try:
+ with (sys.stdin if args.flist=='-' else
+ open(args.flist, encoding="utf-8")) as f:
+ for line in f:
+ compile_dests.append(line.strip())
+ except OSError:
+ if args.quiet < 2:
+ print("Error reading file list {}".format(args.flist))
+ return False
+
+ if args.invalidation_mode:
+ ivl_mode = args.invalidation_mode.replace('-', '_').upper()
+ invalidation_mode = py_compile.PycInvalidationMode[ivl_mode]
+ else:
+ invalidation_mode = None
+
+ success = True
+ try:
+ if compile_dests:
+ for dest in compile_dests:
+ if os.path.isfile(dest):
+ if not compile_file(dest, args.ddir, args.force, args.rx,
+ args.quiet, args.legacy,
+ invalidation_mode=invalidation_mode,
+ stripdir=args.stripdir,
+ prependdir=args.prependdir,
+ optimize=args.opt_levels,
+ limit_sl_dest=args.limit_sl_dest,
+ hardlink_dupes=args.hardlink_dupes):
+ success = False
+ else:
+ if not compile_dir(dest, maxlevels, args.ddir,
+ args.force, args.rx, args.quiet,
+ args.legacy, workers=args.workers,
+ invalidation_mode=invalidation_mode,
+ stripdir=args.stripdir,
+ prependdir=args.prependdir,
+ optimize=args.opt_levels,
+ limit_sl_dest=args.limit_sl_dest,
+ hardlink_dupes=args.hardlink_dupes):
+ success = False
+ return success
+ else:
+ return compile_path(legacy=args.legacy, force=args.force,
+ quiet=args.quiet,
+ invalidation_mode=invalidation_mode)
+ except KeyboardInterrupt:
+ if args.quiet < 2:
+ print("\n[interrupted]")
+ return False
+ return True
+
+
+if __name__ == '__main__':
+ exit_status = int(not main())
+ sys.exit(exit_status)
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/__init__.py b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..196d3788575993eb403588b01ac6b0a3fbba13da
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/__init__.py
@@ -0,0 +1 @@
+# This directory is a Python package.
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/__pycache__/__init__.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a208157db30c239d8be5f6ab25edb2fb3c60bbb7
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/__pycache__/__init__.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__init__.py b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..292e886d5a88ac90b41f998702c5dbf11e44ce9b
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__init__.py
@@ -0,0 +1,53 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Execute computations asynchronously using threads or processes."""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+from concurrent.futures._base import (FIRST_COMPLETED,
+ FIRST_EXCEPTION,
+ ALL_COMPLETED,
+ CancelledError,
+ TimeoutError,
+ InvalidStateError,
+ BrokenExecutor,
+ Future,
+ Executor,
+ wait,
+ as_completed)
+
+__all__ = (
+ 'FIRST_COMPLETED',
+ 'FIRST_EXCEPTION',
+ 'ALL_COMPLETED',
+ 'CancelledError',
+ 'TimeoutError',
+ 'BrokenExecutor',
+ 'Future',
+ 'Executor',
+ 'wait',
+ 'as_completed',
+ 'ProcessPoolExecutor',
+ 'ThreadPoolExecutor',
+)
+
+
+def __dir__():
+ return __all__ + ('__author__', '__doc__')
+
+
+def __getattr__(name):
+ global ProcessPoolExecutor, ThreadPoolExecutor
+
+ if name == 'ProcessPoolExecutor':
+ from .process import ProcessPoolExecutor as pe
+ ProcessPoolExecutor = pe
+ return pe
+
+ if name == 'ThreadPoolExecutor':
+ from .thread import ThreadPoolExecutor as te
+ ThreadPoolExecutor = te
+ return te
+
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/__init__.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b0bef15d1ff164f9fe38c8bbb4a8931149f470cb
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/__init__.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/_base.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/_base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..dab7f5d1e3ff19a1c97ab53b89144f934b081d3a
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/_base.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/process.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/process.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c26aba34ffb87fbdd1de85647bc84caec620740c
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/process.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/thread.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/thread.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a108e80d14bae868aea5b0a5bacfdd9889176a71
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/__pycache__/thread.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/_base.py b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/_base.py
new file mode 100644
index 0000000000000000000000000000000000000000..6742a07753c9217802f8a267f20e7fe6ffc28fb6
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/_base.py
@@ -0,0 +1,654 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+import collections
+import logging
+import threading
+import time
+import types
+
+FIRST_COMPLETED = 'FIRST_COMPLETED'
+FIRST_EXCEPTION = 'FIRST_EXCEPTION'
+ALL_COMPLETED = 'ALL_COMPLETED'
+_AS_COMPLETED = '_AS_COMPLETED'
+
+# Possible future states (for internal use by the futures package).
+PENDING = 'PENDING'
+RUNNING = 'RUNNING'
+# The future was cancelled by the user...
+CANCELLED = 'CANCELLED'
+# ...and _Waiter.add_cancelled() was called by a worker.
+CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED'
+FINISHED = 'FINISHED'
+
+_FUTURE_STATES = [
+ PENDING,
+ RUNNING,
+ CANCELLED,
+ CANCELLED_AND_NOTIFIED,
+ FINISHED
+]
+
+_STATE_TO_DESCRIPTION_MAP = {
+ PENDING: "pending",
+ RUNNING: "running",
+ CANCELLED: "cancelled",
+ CANCELLED_AND_NOTIFIED: "cancelled",
+ FINISHED: "finished"
+}
+
+# Logger for internal use by the futures package.
+LOGGER = logging.getLogger("concurrent.futures")
+
+class Error(Exception):
+ """Base class for all future-related exceptions."""
+ pass
+
+class CancelledError(Error):
+ """The Future was cancelled."""
+ pass
+
+TimeoutError = TimeoutError # make local alias for the standard exception
+
+class InvalidStateError(Error):
+ """The operation is not allowed in this state."""
+ pass
+
+class _Waiter(object):
+ """Provides the event that wait() and as_completed() block on."""
+ def __init__(self):
+ self.event = threading.Event()
+ self.finished_futures = []
+
+ def add_result(self, future):
+ self.finished_futures.append(future)
+
+ def add_exception(self, future):
+ self.finished_futures.append(future)
+
+ def add_cancelled(self, future):
+ self.finished_futures.append(future)
+
+class _AsCompletedWaiter(_Waiter):
+ """Used by as_completed()."""
+
+ def __init__(self):
+ super(_AsCompletedWaiter, self).__init__()
+ self.lock = threading.Lock()
+
+ def add_result(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_result(future)
+ self.event.set()
+
+ def add_exception(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_exception(future)
+ self.event.set()
+
+ def add_cancelled(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_cancelled(future)
+ self.event.set()
+
+class _FirstCompletedWaiter(_Waiter):
+ """Used by wait(return_when=FIRST_COMPLETED)."""
+
+ def add_result(self, future):
+ super().add_result(future)
+ self.event.set()
+
+ def add_exception(self, future):
+ super().add_exception(future)
+ self.event.set()
+
+ def add_cancelled(self, future):
+ super().add_cancelled(future)
+ self.event.set()
+
+class _AllCompletedWaiter(_Waiter):
+ """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED)."""
+
+ def __init__(self, num_pending_calls, stop_on_exception):
+ self.num_pending_calls = num_pending_calls
+ self.stop_on_exception = stop_on_exception
+ self.lock = threading.Lock()
+ super().__init__()
+
+ def _decrement_pending_calls(self):
+ with self.lock:
+ self.num_pending_calls -= 1
+ if not self.num_pending_calls:
+ self.event.set()
+
+ def add_result(self, future):
+ super().add_result(future)
+ self._decrement_pending_calls()
+
+ def add_exception(self, future):
+ super().add_exception(future)
+ if self.stop_on_exception:
+ self.event.set()
+ else:
+ self._decrement_pending_calls()
+
+ def add_cancelled(self, future):
+ super().add_cancelled(future)
+ self._decrement_pending_calls()
+
+class _AcquireFutures(object):
+ """A context manager that does an ordered acquire of Future conditions."""
+
+ def __init__(self, futures):
+ self.futures = sorted(futures, key=id)
+
+ def __enter__(self):
+ for future in self.futures:
+ future._condition.acquire()
+
+ def __exit__(self, *args):
+ for future in self.futures:
+ future._condition.release()
+
+def _create_and_install_waiters(fs, return_when):
+ if return_when == _AS_COMPLETED:
+ waiter = _AsCompletedWaiter()
+ elif return_when == FIRST_COMPLETED:
+ waiter = _FirstCompletedWaiter()
+ else:
+ pending_count = sum(
+ f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs)
+
+ if return_when == FIRST_EXCEPTION:
+ waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True)
+ elif return_when == ALL_COMPLETED:
+ waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False)
+ else:
+ raise ValueError("Invalid return condition: %r" % return_when)
+
+ for f in fs:
+ f._waiters.append(waiter)
+
+ return waiter
+
+
+def _yield_finished_futures(fs, waiter, ref_collect):
+ """
+ Iterate on the list *fs*, yielding finished futures one by one in
+ reverse order.
+ Before yielding a future, *waiter* is removed from its waiters
+ and the future is removed from each set in the collection of sets
+ *ref_collect*.
+
+ The aim of this function is to avoid keeping stale references after
+ the future is yielded and before the iterator resumes.
+ """
+ while fs:
+ f = fs[-1]
+ for futures_set in ref_collect:
+ futures_set.remove(f)
+ with f._condition:
+ f._waiters.remove(waiter)
+ del f
+ # Careful not to keep a reference to the popped value
+ yield fs.pop()
+
+
+def as_completed(fs, timeout=None):
+ """An iterator over the given futures that yields each as it completes.
+
+ Args:
+ fs: The sequence of Futures (possibly created by different Executors) to
+ iterate over.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+
+ Returns:
+ An iterator that yields the given Futures as they complete (finished or
+ cancelled). If any given Futures are duplicated, they will be returned
+ once.
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ """
+ if timeout is not None:
+ end_time = timeout + time.monotonic()
+
+ fs = set(fs)
+ total_futures = len(fs)
+ with _AcquireFutures(fs):
+ finished = set(
+ f for f in fs
+ if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
+ pending = fs - finished
+ waiter = _create_and_install_waiters(fs, _AS_COMPLETED)
+ finished = list(finished)
+ try:
+ yield from _yield_finished_futures(finished, waiter,
+ ref_collect=(fs,))
+
+ while pending:
+ if timeout is None:
+ wait_timeout = None
+ else:
+ wait_timeout = end_time - time.monotonic()
+ if wait_timeout < 0:
+ raise TimeoutError(
+ '%d (of %d) futures unfinished' % (
+ len(pending), total_futures))
+
+ waiter.event.wait(wait_timeout)
+
+ with waiter.lock:
+ finished = waiter.finished_futures
+ waiter.finished_futures = []
+ waiter.event.clear()
+
+ # reverse to keep finishing order
+ finished.reverse()
+ yield from _yield_finished_futures(finished, waiter,
+ ref_collect=(fs, pending))
+
+ finally:
+ # Remove waiter from unfinished futures
+ for f in fs:
+ with f._condition:
+ f._waiters.remove(waiter)
+
+DoneAndNotDoneFutures = collections.namedtuple(
+ 'DoneAndNotDoneFutures', 'done not_done')
+def wait(fs, timeout=None, return_when=ALL_COMPLETED):
+ """Wait for the futures in the given sequence to complete.
+
+ Args:
+ fs: The sequence of Futures (possibly created by different Executors) to
+ wait upon.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+ return_when: Indicates when this function should return. The options
+ are:
+
+ FIRST_COMPLETED - Return when any future finishes or is
+ cancelled.
+ FIRST_EXCEPTION - Return when any future finishes by raising an
+ exception. If no future raises an exception
+ then it is equivalent to ALL_COMPLETED.
+ ALL_COMPLETED - Return when all futures finish or are cancelled.
+
+ Returns:
+ A named 2-tuple of sets. The first set, named 'done', contains the
+ futures that completed (is finished or cancelled) before the wait
+ completed. The second set, named 'not_done', contains uncompleted
+ futures. Duplicate futures given to *fs* are removed and will be
+ returned only once.
+ """
+ fs = set(fs)
+ with _AcquireFutures(fs):
+ done = {f for f in fs
+ if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]}
+ not_done = fs - done
+ if (return_when == FIRST_COMPLETED) and done:
+ return DoneAndNotDoneFutures(done, not_done)
+ elif (return_when == FIRST_EXCEPTION) and done:
+ if any(f for f in done
+ if not f.cancelled() and f.exception() is not None):
+ return DoneAndNotDoneFutures(done, not_done)
+
+ if len(done) == len(fs):
+ return DoneAndNotDoneFutures(done, not_done)
+
+ waiter = _create_and_install_waiters(fs, return_when)
+
+ waiter.event.wait(timeout)
+ for f in fs:
+ with f._condition:
+ f._waiters.remove(waiter)
+
+ done.update(waiter.finished_futures)
+ return DoneAndNotDoneFutures(done, fs - done)
+
+
+def _result_or_cancel(fut, timeout=None):
+ try:
+ try:
+ return fut.result(timeout)
+ finally:
+ fut.cancel()
+ finally:
+ # Break a reference cycle with the exception in self._exception
+ del fut
+
+
+class Future(object):
+ """Represents the result of an asynchronous computation."""
+
+ def __init__(self):
+ """Initializes the future. Should not be called by clients."""
+ self._condition = threading.Condition()
+ self._state = PENDING
+ self._result = None
+ self._exception = None
+ self._waiters = []
+ self._done_callbacks = []
+
+ def _invoke_callbacks(self):
+ for callback in self._done_callbacks:
+ try:
+ callback(self)
+ except Exception:
+ LOGGER.exception('exception calling callback for %r', self)
+
+ def __repr__(self):
+ with self._condition:
+ if self._state == FINISHED:
+ if self._exception:
+ return '<%s at %#x state=%s raised %s>' % (
+ self.__class__.__name__,
+ id(self),
+ _STATE_TO_DESCRIPTION_MAP[self._state],
+ self._exception.__class__.__name__)
+ else:
+ return '<%s at %#x state=%s returned %s>' % (
+ self.__class__.__name__,
+ id(self),
+ _STATE_TO_DESCRIPTION_MAP[self._state],
+ self._result.__class__.__name__)
+ return '<%s at %#x state=%s>' % (
+ self.__class__.__name__,
+ id(self),
+ _STATE_TO_DESCRIPTION_MAP[self._state])
+
+ def cancel(self):
+ """Cancel the future if possible.
+
+ Returns True if the future was cancelled, False otherwise. A future
+ cannot be cancelled if it is running or has already completed.
+ """
+ with self._condition:
+ if self._state in [RUNNING, FINISHED]:
+ return False
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ return True
+
+ self._state = CANCELLED
+ self._condition.notify_all()
+
+ self._invoke_callbacks()
+ return True
+
+ def cancelled(self):
+ """Return True if the future was cancelled."""
+ with self._condition:
+ return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]
+
+ def running(self):
+ """Return True if the future is currently executing."""
+ with self._condition:
+ return self._state == RUNNING
+
+ def done(self):
+ """Return True if the future was cancelled or finished executing."""
+ with self._condition:
+ return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]
+
+ def __get_result(self):
+ if self._exception:
+ try:
+ raise self._exception
+ finally:
+ # Break a reference cycle with the exception in self._exception
+ self = None
+ else:
+ return self._result
+
+ def add_done_callback(self, fn):
+ """Attaches a callable that will be called when the future finishes.
+
+ Args:
+ fn: A callable that will be called with this future as its only
+ argument when the future completes or is cancelled. The callable
+ will always be called by a thread in the same process in which
+ it was added. If the future has already completed or been
+ cancelled then the callable will be called immediately. These
+ callables are called in the order that they were added.
+ """
+ with self._condition:
+ if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:
+ self._done_callbacks.append(fn)
+ return
+ try:
+ fn(self)
+ except Exception:
+ LOGGER.exception('exception calling callback for %r', self)
+
+ def result(self, timeout=None):
+ """Return the result of the call that the future represents.
+
+ Args:
+ timeout: The number of seconds to wait for the result if the future
+ isn't done. If None, then there is no limit on the wait time.
+
+ Returns:
+ The result of the call that the future represents.
+
+ Raises:
+ CancelledError: If the future was cancelled.
+ TimeoutError: If the future didn't finish executing before the given
+ timeout.
+ Exception: If the call raised then that exception will be raised.
+ """
+ try:
+ with self._condition:
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self.__get_result()
+
+ self._condition.wait(timeout)
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self.__get_result()
+ else:
+ raise TimeoutError()
+ finally:
+ # Break a reference cycle with the exception in self._exception
+ self = None
+
+ def exception(self, timeout=None):
+ """Return the exception raised by the call that the future represents.
+
+ Args:
+ timeout: The number of seconds to wait for the exception if the
+ future isn't done. If None, then there is no limit on the wait
+ time.
+
+ Returns:
+ The exception raised by the call that the future represents or None
+ if the call completed without raising.
+
+ Raises:
+ CancelledError: If the future was cancelled.
+ TimeoutError: If the future didn't finish executing before the given
+ timeout.
+ """
+
+ with self._condition:
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self._exception
+
+ self._condition.wait(timeout)
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self._exception
+ else:
+ raise TimeoutError()
+
+ # The following methods should only be used by Executors and in tests.
+ def set_running_or_notify_cancel(self):
+ """Mark the future as running or process any cancel notifications.
+
+ Should only be used by Executor implementations and unit tests.
+
+ If the future has been cancelled (cancel() was called and returned
+ True) then any threads waiting on the future completing (though calls
+ to as_completed() or wait()) are notified and False is returned.
+
+ If the future was not cancelled then it is put in the running state
+ (future calls to running() will return True) and True is returned.
+
+ This method should be called by Executor implementations before
+ executing the work associated with this future. If this method returns
+ False then the work should not be executed.
+
+ Returns:
+ False if the Future was cancelled, True otherwise.
+
+ Raises:
+ RuntimeError: if this method was already called or if set_result()
+ or set_exception() was called.
+ """
+ with self._condition:
+ if self._state == CANCELLED:
+ self._state = CANCELLED_AND_NOTIFIED
+ for waiter in self._waiters:
+ waiter.add_cancelled(self)
+ # self._condition.notify_all() is not necessary because
+ # self.cancel() triggers a notification.
+ return False
+ elif self._state == PENDING:
+ self._state = RUNNING
+ return True
+ else:
+ LOGGER.critical('Future %s in unexpected state: %s',
+ id(self),
+ self._state)
+ raise RuntimeError('Future in unexpected state')
+
+ def set_result(self, result):
+ """Sets the return value of work associated with the future.
+
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
+ if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
+ raise InvalidStateError('{}: {!r}'.format(self._state, self))
+ self._result = result
+ self._state = FINISHED
+ for waiter in self._waiters:
+ waiter.add_result(self)
+ self._condition.notify_all()
+ self._invoke_callbacks()
+
+ def set_exception(self, exception):
+ """Sets the result of the future as being the given exception.
+
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
+ if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
+ raise InvalidStateError('{}: {!r}'.format(self._state, self))
+ self._exception = exception
+ self._state = FINISHED
+ for waiter in self._waiters:
+ waiter.add_exception(self)
+ self._condition.notify_all()
+ self._invoke_callbacks()
+
+ __class_getitem__ = classmethod(types.GenericAlias)
+
+class Executor(object):
+ """This is an abstract base class for concrete asynchronous executors."""
+
+ def submit(self, fn, /, *args, **kwargs):
+ """Submits a callable to be executed with the given arguments.
+
+ Schedules the callable to be executed as fn(*args, **kwargs) and returns
+ a Future instance representing the execution of the callable.
+
+ Returns:
+ A Future representing the given call.
+ """
+ raise NotImplementedError()
+
+ def map(self, fn, *iterables, timeout=None, chunksize=1):
+ """Returns an iterator equivalent to map(fn, iter).
+
+ Args:
+ fn: A callable that will take as many arguments as there are
+ passed iterables.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+ chunksize: The size of the chunks the iterable will be broken into
+ before being passed to a child process. This argument is only
+ used by ProcessPoolExecutor; it is ignored by
+ ThreadPoolExecutor.
+
+ Returns:
+ An iterator equivalent to: map(func, *iterables) but the calls may
+ be evaluated out-of-order.
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ Exception: If fn(*args) raises for any values.
+ """
+ if timeout is not None:
+ end_time = timeout + time.monotonic()
+
+ fs = [self.submit(fn, *args) for args in zip(*iterables)]
+
+ # Yield must be hidden in closure so that the futures are submitted
+ # before the first iterator value is required.
+ def result_iterator():
+ try:
+ # reverse to keep finishing order
+ fs.reverse()
+ while fs:
+ # Careful not to keep a reference to the popped future
+ if timeout is None:
+ yield _result_or_cancel(fs.pop())
+ else:
+ yield _result_or_cancel(fs.pop(), end_time - time.monotonic())
+ finally:
+ for future in fs:
+ future.cancel()
+ return result_iterator()
+
+ def shutdown(self, wait=True, *, cancel_futures=False):
+ """Clean-up the resources associated with the Executor.
+
+ It is safe to call this method several times. Otherwise, no other
+ methods can be called after this one.
+
+ Args:
+ wait: If True then shutdown will not return until all running
+ futures have finished executing and the resources used by the
+ executor have been reclaimed.
+ cancel_futures: If True then shutdown will cancel all pending
+ futures. Futures that are completed or running will not be
+ cancelled.
+ """
+ pass
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.shutdown(wait=True)
+ return False
+
+
+class BrokenExecutor(RuntimeError):
+ """
+ Raised when a executor has become non-functional after a severe failure.
+ """
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/process.py b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/process.py
new file mode 100644
index 0000000000000000000000000000000000000000..952fa9034574bc1b2566d843a7da3b06fec2836d
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/process.py
@@ -0,0 +1,862 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Implements ProcessPoolExecutor.
+
+The following diagram and text describe the data-flow through the system:
+
+|======================= In-process =====================|== Out-of-process ==|
+
++----------+ +----------+ +--------+ +-----------+ +---------+
+| | => | Work Ids | | | | Call Q | | Process |
+| | +----------+ | | +-----------+ | Pool |
+| | | ... | | | | ... | +---------+
+| | | 6 | => | | => | 5, call() | => | |
+| | | 7 | | | | ... | | |
+| Process | | ... | | Local | +-----------+ | Process |
+| Pool | +----------+ | Worker | | #1..n |
+| Executor | | Thread | | |
+| | +----------- + | | +-----------+ | |
+| | <=> | Work Items | <=> | | <= | Result Q | <= | |
+| | +------------+ | | +-----------+ | |
+| | | 6: call() | | | | ... | | |
+| | | future | | | | 4, result | | |
+| | | ... | | | | 3, except | | |
++----------+ +------------+ +--------+ +-----------+ +---------+
+
+Executor.submit() called:
+- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict
+- adds the id of the _WorkItem to the "Work Ids" queue
+
+Local worker thread:
+- reads work ids from the "Work Ids" queue and looks up the corresponding
+ WorkItem from the "Work Items" dict: if the work item has been cancelled then
+ it is simply removed from the dict, otherwise it is repackaged as a
+ _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
+ until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
+ calls placed in the "Call Q" can no longer be cancelled with Future.cancel().
+- reads _ResultItems from "Result Q", updates the future stored in the
+ "Work Items" dict and deletes the dict entry
+
+Process #1..n:
+- reads _CallItems from "Call Q", executes the calls, and puts the resulting
+ _ResultItems in "Result Q"
+"""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+import os
+from concurrent.futures import _base
+import queue
+import multiprocessing as mp
+import multiprocessing.connection
+from multiprocessing.queues import Queue
+import threading
+import weakref
+from functools import partial
+import itertools
+import sys
+from traceback import format_exception
+
+
+_threads_wakeups = weakref.WeakKeyDictionary()
+_global_shutdown = False
+
+
+class _ThreadWakeup:
+ def __init__(self):
+ self._closed = False
+ self._reader, self._writer = mp.Pipe(duplex=False)
+
+ def close(self):
+ # Please note that we do not take the shutdown lock when
+ # calling clear() (to avoid deadlocking) so this method can
+ # only be called safely from the same thread as all calls to
+ # clear() even if you hold the shutdown lock. Otherwise we
+ # might try to read from the closed pipe.
+ if not self._closed:
+ self._closed = True
+ self._writer.close()
+ self._reader.close()
+
+ def wakeup(self):
+ if not self._closed:
+ self._writer.send_bytes(b"")
+
+ def clear(self):
+ if not self._closed:
+ while self._reader.poll():
+ self._reader.recv_bytes()
+
+
+def _python_exit():
+ global _global_shutdown
+ _global_shutdown = True
+ items = list(_threads_wakeups.items())
+ for _, thread_wakeup in items:
+ # call not protected by ProcessPoolExecutor._shutdown_lock
+ thread_wakeup.wakeup()
+ for t, _ in items:
+ t.join()
+
+# Register for `_python_exit()` to be called just before joining all
+# non-daemon threads. This is used instead of `atexit.register()` for
+# compatibility with subinterpreters, which no longer support daemon threads.
+# See bpo-39812 for context.
+threading._register_atexit(_python_exit)
+
+# Controls how many more calls than processes will be queued in the call queue.
+# A smaller number will mean that processes spend more time idle waiting for
+# work while a larger number will make Future.cancel() succeed less frequently
+# (Futures in the call queue cannot be cancelled).
+EXTRA_QUEUED_CALLS = 1
+
+
+# On Windows, WaitForMultipleObjects is used to wait for processes to finish.
+# It can wait on, at most, 63 objects. There is an overhead of two objects:
+# - the result queue reader
+# - the thread wakeup reader
+_MAX_WINDOWS_WORKERS = 63 - 2
+
+# Hack to embed stringification of remote traceback in local traceback
+
+class _RemoteTraceback(Exception):
+ def __init__(self, tb):
+ self.tb = tb
+ def __str__(self):
+ return self.tb
+
+class _ExceptionWithTraceback:
+ def __init__(self, exc, tb):
+ tb = ''.join(format_exception(type(exc), exc, tb))
+ self.exc = exc
+ # Traceback object needs to be garbage-collected as its frames
+ # contain references to all the objects in the exception scope
+ self.exc.__traceback__ = None
+ self.tb = '\n"""\n%s"""' % tb
+ def __reduce__(self):
+ return _rebuild_exc, (self.exc, self.tb)
+
+def _rebuild_exc(exc, tb):
+ exc.__cause__ = _RemoteTraceback(tb)
+ return exc
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+class _ResultItem(object):
+ def __init__(self, work_id, exception=None, result=None, exit_pid=None):
+ self.work_id = work_id
+ self.exception = exception
+ self.result = result
+ self.exit_pid = exit_pid
+
+class _CallItem(object):
+ def __init__(self, work_id, fn, args, kwargs):
+ self.work_id = work_id
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+
+class _SafeQueue(Queue):
+ """Safe Queue set exception to the future object linked to a job"""
+ def __init__(self, max_size=0, *, ctx, pending_work_items, shutdown_lock,
+ thread_wakeup):
+ self.pending_work_items = pending_work_items
+ self.shutdown_lock = shutdown_lock
+ self.thread_wakeup = thread_wakeup
+ super().__init__(max_size, ctx=ctx)
+
+ def _on_queue_feeder_error(self, e, obj):
+ if isinstance(obj, _CallItem):
+ tb = format_exception(type(e), e, e.__traceback__)
+ e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb)))
+ work_item = self.pending_work_items.pop(obj.work_id, None)
+ with self.shutdown_lock:
+ self.thread_wakeup.wakeup()
+ # work_item can be None if another process terminated. In this
+ # case, the executor_manager_thread fails all work_items
+ # with BrokenProcessPool
+ if work_item is not None:
+ work_item.future.set_exception(e)
+ else:
+ super()._on_queue_feeder_error(e, obj)
+
+
+def _get_chunks(*iterables, chunksize):
+ """ Iterates over zip()ed iterables in chunks. """
+ it = zip(*iterables)
+ while True:
+ chunk = tuple(itertools.islice(it, chunksize))
+ if not chunk:
+ return
+ yield chunk
+
+
+def _process_chunk(fn, chunk):
+ """ Processes a chunk of an iterable passed to map.
+
+ Runs the function passed to map() on a chunk of the
+ iterable passed to map.
+
+ This function is run in a separate process.
+
+ """
+ return [fn(*args) for args in chunk]
+
+
+def _sendback_result(result_queue, work_id, result=None, exception=None,
+ exit_pid=None):
+ """Safely send back the given result or exception"""
+ try:
+ result_queue.put(_ResultItem(work_id, result=result,
+ exception=exception, exit_pid=exit_pid))
+ except BaseException as e:
+ exc = _ExceptionWithTraceback(e, e.__traceback__)
+ result_queue.put(_ResultItem(work_id, exception=exc,
+ exit_pid=exit_pid))
+
+
+def _process_worker(call_queue, result_queue, initializer, initargs, max_tasks=None):
+ """Evaluates calls from call_queue and places the results in result_queue.
+
+ This worker is run in a separate process.
+
+ Args:
+ call_queue: A ctx.Queue of _CallItems that will be read and
+ evaluated by the worker.
+ result_queue: A ctx.Queue of _ResultItems that will written
+ to by the worker.
+ initializer: A callable initializer, or None
+ initargs: A tuple of args for the initializer
+ """
+ if initializer is not None:
+ try:
+ initializer(*initargs)
+ except BaseException:
+ _base.LOGGER.critical('Exception in initializer:', exc_info=True)
+ # The parent will notice that the process stopped and
+ # mark the pool broken
+ return
+ num_tasks = 0
+ exit_pid = None
+ while True:
+ call_item = call_queue.get(block=True)
+ if call_item is None:
+ # Wake up queue management thread
+ result_queue.put(os.getpid())
+ return
+
+ if max_tasks is not None:
+ num_tasks += 1
+ if num_tasks >= max_tasks:
+ exit_pid = os.getpid()
+
+ try:
+ r = call_item.fn(*call_item.args, **call_item.kwargs)
+ except BaseException as e:
+ exc = _ExceptionWithTraceback(e, e.__traceback__)
+ _sendback_result(result_queue, call_item.work_id, exception=exc,
+ exit_pid=exit_pid)
+ else:
+ _sendback_result(result_queue, call_item.work_id, result=r,
+ exit_pid=exit_pid)
+ del r
+
+ # Liberate the resource as soon as possible, to avoid holding onto
+ # open files or shared memory that is not needed anymore
+ del call_item
+
+ if exit_pid is not None:
+ return
+
+
+class _ExecutorManagerThread(threading.Thread):
+ """Manages the communication between this process and the worker processes.
+
+ The manager is run in a local thread.
+
+ Args:
+ executor: A reference to the ProcessPoolExecutor that owns
+ this thread. A weakref will be own by the manager as well as
+ references to internal objects used to introspect the state of
+ the executor.
+ """
+
+ def __init__(self, executor):
+ # Store references to necessary internals of the executor.
+
+ # A _ThreadWakeup to allow waking up the queue_manager_thread from the
+ # main Thread and avoid deadlocks caused by permanently locked queues.
+ self.thread_wakeup = executor._executor_manager_thread_wakeup
+ self.shutdown_lock = executor._shutdown_lock
+
+ # A weakref.ref to the ProcessPoolExecutor that owns this thread. Used
+ # to determine if the ProcessPoolExecutor has been garbage collected
+ # and that the manager can exit.
+ # When the executor gets garbage collected, the weakref callback
+ # will wake up the queue management thread so that it can terminate
+ # if there is no pending work item.
+ def weakref_cb(_,
+ thread_wakeup=self.thread_wakeup,
+ shutdown_lock=self.shutdown_lock):
+ mp.util.debug('Executor collected: triggering callback for'
+ ' QueueManager wakeup')
+ with shutdown_lock:
+ thread_wakeup.wakeup()
+
+ self.executor_reference = weakref.ref(executor, weakref_cb)
+
+ # A list of the ctx.Process instances used as workers.
+ self.processes = executor._processes
+
+ # A ctx.Queue that will be filled with _CallItems derived from
+ # _WorkItems for processing by the process workers.
+ self.call_queue = executor._call_queue
+
+ # A ctx.SimpleQueue of _ResultItems generated by the process workers.
+ self.result_queue = executor._result_queue
+
+ # A queue.Queue of work ids e.g. Queue([5, 6, ...]).
+ self.work_ids_queue = executor._work_ids
+
+ # Maximum number of tasks a worker process can execute before
+ # exiting safely
+ self.max_tasks_per_child = executor._max_tasks_per_child
+
+ # A dict mapping work ids to _WorkItems e.g.
+ # {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
+ self.pending_work_items = executor._pending_work_items
+
+ super().__init__()
+
+ def run(self):
+ # Main loop for the executor manager thread.
+
+ while True:
+ self.add_call_item_to_queue()
+
+ result_item, is_broken, cause = self.wait_result_broken_or_wakeup()
+
+ if is_broken:
+ self.terminate_broken(cause)
+ return
+ if result_item is not None:
+ self.process_result_item(result_item)
+
+ process_exited = result_item.exit_pid is not None
+ if process_exited:
+ p = self.processes.pop(result_item.exit_pid)
+ p.join()
+
+ # Delete reference to result_item to avoid keeping references
+ # while waiting on new results.
+ del result_item
+
+ if executor := self.executor_reference():
+ if process_exited:
+ with self.shutdown_lock:
+ executor._adjust_process_count()
+ else:
+ executor._idle_worker_semaphore.release()
+ del executor
+
+ if self.is_shutting_down():
+ self.flag_executor_shutting_down()
+
+ # When only canceled futures remain in pending_work_items, our
+ # next call to wait_result_broken_or_wakeup would hang forever.
+ # This makes sure we have some running futures or none at all.
+ self.add_call_item_to_queue()
+
+ # Since no new work items can be added, it is safe to shutdown
+ # this thread if there are no pending work items.
+ if not self.pending_work_items:
+ self.join_executor_internals()
+ return
+
+ def add_call_item_to_queue(self):
+ # Fills call_queue with _WorkItems from pending_work_items.
+ # This function never blocks.
+ while True:
+ if self.call_queue.full():
+ return
+ try:
+ work_id = self.work_ids_queue.get(block=False)
+ except queue.Empty:
+ return
+ else:
+ work_item = self.pending_work_items[work_id]
+
+ if work_item.future.set_running_or_notify_cancel():
+ self.call_queue.put(_CallItem(work_id,
+ work_item.fn,
+ work_item.args,
+ work_item.kwargs),
+ block=True)
+ else:
+ del self.pending_work_items[work_id]
+ continue
+
+ def wait_result_broken_or_wakeup(self):
+ # Wait for a result to be ready in the result_queue while checking
+ # that all worker processes are still running, or for a wake up
+ # signal send. The wake up signals come either from new tasks being
+ # submitted, from the executor being shutdown/gc-ed, or from the
+ # shutdown of the python interpreter.
+ result_reader = self.result_queue._reader
+ assert not self.thread_wakeup._closed
+ wakeup_reader = self.thread_wakeup._reader
+ readers = [result_reader, wakeup_reader]
+ worker_sentinels = [p.sentinel for p in list(self.processes.values())]
+ ready = mp.connection.wait(readers + worker_sentinels)
+
+ cause = None
+ is_broken = True
+ result_item = None
+ if result_reader in ready:
+ try:
+ result_item = result_reader.recv()
+ is_broken = False
+ except BaseException as e:
+ cause = format_exception(type(e), e, e.__traceback__)
+
+ elif wakeup_reader in ready:
+ is_broken = False
+
+ # No need to hold the _shutdown_lock here because:
+ # 1. we're the only thread to use the wakeup reader
+ # 2. we're also the only thread to call thread_wakeup.close()
+ # 3. we want to avoid a possible deadlock when both reader and writer
+ # would block (gh-105829)
+ self.thread_wakeup.clear()
+
+ return result_item, is_broken, cause
+
+ def process_result_item(self, result_item):
+ # Process the received a result_item. This can be either the PID of a
+ # worker that exited gracefully or a _ResultItem
+
+ if isinstance(result_item, int):
+ # Clean shutdown of a worker using its PID
+ # (avoids marking the executor broken)
+ assert self.is_shutting_down()
+ p = self.processes.pop(result_item)
+ p.join()
+ if not self.processes:
+ self.join_executor_internals()
+ return
+ else:
+ # Received a _ResultItem so mark the future as completed.
+ work_item = self.pending_work_items.pop(result_item.work_id, None)
+ # work_item can be None if another process terminated (see above)
+ if work_item is not None:
+ if result_item.exception:
+ work_item.future.set_exception(result_item.exception)
+ else:
+ work_item.future.set_result(result_item.result)
+
+ def is_shutting_down(self):
+ # Check whether we should start shutting down the executor.
+ executor = self.executor_reference()
+ # No more work items can be added if:
+ # - The interpreter is shutting down OR
+ # - The executor that owns this worker has been collected OR
+ # - The executor that owns this worker has been shutdown.
+ return (_global_shutdown or executor is None
+ or executor._shutdown_thread)
+
+ def terminate_broken(self, cause):
+ # Terminate the executor because it is in a broken state. The cause
+ # argument can be used to display more information on the error that
+ # lead the executor into becoming broken.
+
+ # Mark the process pool broken so that submits fail right now.
+ executor = self.executor_reference()
+ if executor is not None:
+ executor._broken = ('A child process terminated '
+ 'abruptly, the process pool is not '
+ 'usable anymore')
+ executor._shutdown_thread = True
+ executor = None
+
+ # All pending tasks are to be marked failed with the following
+ # BrokenProcessPool error
+ bpe = BrokenProcessPool("A process in the process pool was "
+ "terminated abruptly while the future was "
+ "running or pending.")
+ if cause is not None:
+ bpe.__cause__ = _RemoteTraceback(
+ f"\n'''\n{''.join(cause)}'''")
+
+ # Mark pending tasks as failed.
+ for work_id, work_item in self.pending_work_items.items():
+ work_item.future.set_exception(bpe)
+ # Delete references to object. See issue16284
+ del work_item
+ self.pending_work_items.clear()
+
+ # Terminate remaining workers forcibly: the queues or their
+ # locks may be in a dirty state and block forever.
+ for p in self.processes.values():
+ p.terminate()
+
+ # Prevent queue writing to a pipe which is no longer read.
+ # https://github.com/python/cpython/issues/94777
+ self.call_queue._reader.close()
+
+ # gh-107219: Close the connection writer which can unblock
+ # Queue._feed() if it was stuck in send_bytes().
+ if sys.platform == 'win32':
+ self.call_queue._writer.close()
+
+ # clean up resources
+ self.join_executor_internals()
+
+ def flag_executor_shutting_down(self):
+ # Flag the executor as shutting down and cancel remaining tasks if
+ # requested as early as possible if it is not gc-ed yet.
+ executor = self.executor_reference()
+ if executor is not None:
+ executor._shutdown_thread = True
+ # Cancel pending work items if requested.
+ if executor._cancel_pending_futures:
+ # Cancel all pending futures and update pending_work_items
+ # to only have futures that are currently running.
+ new_pending_work_items = {}
+ for work_id, work_item in self.pending_work_items.items():
+ if not work_item.future.cancel():
+ new_pending_work_items[work_id] = work_item
+ self.pending_work_items = new_pending_work_items
+ # Drain work_ids_queue since we no longer need to
+ # add items to the call queue.
+ while True:
+ try:
+ self.work_ids_queue.get_nowait()
+ except queue.Empty:
+ break
+ # Make sure we do this only once to not waste time looping
+ # on running processes over and over.
+ executor._cancel_pending_futures = False
+
+ def shutdown_workers(self):
+ n_children_to_stop = self.get_n_children_alive()
+ n_sentinels_sent = 0
+ # Send the right number of sentinels, to make sure all children are
+ # properly terminated.
+ while (n_sentinels_sent < n_children_to_stop
+ and self.get_n_children_alive() > 0):
+ for i in range(n_children_to_stop - n_sentinels_sent):
+ try:
+ self.call_queue.put_nowait(None)
+ n_sentinels_sent += 1
+ except queue.Full:
+ break
+
+ def join_executor_internals(self):
+ self.shutdown_workers()
+ # Release the queue's resources as soon as possible.
+ self.call_queue.close()
+ self.call_queue.join_thread()
+ with self.shutdown_lock:
+ self.thread_wakeup.close()
+ # If .join() is not called on the created processes then
+ # some ctx.Queue methods may deadlock on Mac OS X.
+ for p in self.processes.values():
+ p.join()
+
+ def get_n_children_alive(self):
+ # This is an upper bound on the number of children alive.
+ return sum(p.is_alive() for p in self.processes.values())
+
+
+_system_limits_checked = False
+_system_limited = None
+
+
+def _check_system_limits():
+ global _system_limits_checked, _system_limited
+ if _system_limits_checked:
+ if _system_limited:
+ raise NotImplementedError(_system_limited)
+ _system_limits_checked = True
+ try:
+ import multiprocessing.synchronize
+ except ImportError:
+ _system_limited = (
+ "This Python build lacks multiprocessing.synchronize, usually due "
+ "to named semaphores being unavailable on this platform."
+ )
+ raise NotImplementedError(_system_limited)
+ try:
+ nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
+ except (AttributeError, ValueError):
+ # sysconf not available or setting not available
+ return
+ if nsems_max == -1:
+ # indetermined limit, assume that limit is determined
+ # by available memory only
+ return
+ if nsems_max >= 256:
+ # minimum number of semaphores available
+ # according to POSIX
+ return
+ _system_limited = ("system provides too few semaphores (%d"
+ " available, 256 necessary)" % nsems_max)
+ raise NotImplementedError(_system_limited)
+
+
+def _chain_from_iterable_of_lists(iterable):
+ """
+ Specialized implementation of itertools.chain.from_iterable.
+ Each item in *iterable* should be a list. This function is
+ careful not to keep references to yielded objects.
+ """
+ for element in iterable:
+ element.reverse()
+ while element:
+ yield element.pop()
+
+
+class BrokenProcessPool(_base.BrokenExecutor):
+ """
+ Raised when a process in a ProcessPoolExecutor terminated abruptly
+ while a future was in the running state.
+ """
+
+
+class ProcessPoolExecutor(_base.Executor):
+ def __init__(self, max_workers=None, mp_context=None,
+ initializer=None, initargs=(), *, max_tasks_per_child=None):
+ """Initializes a new ProcessPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of processes that can be used to
+ execute the given calls. If None or not given then as many
+ worker processes will be created as the machine has processors.
+ mp_context: A multiprocessing context to launch the workers. This
+ object should provide SimpleQueue, Queue and Process. Useful
+ to allow specific multiprocessing start methods.
+ initializer: A callable used to initialize worker processes.
+ initargs: A tuple of arguments to pass to the initializer.
+ max_tasks_per_child: The maximum number of tasks a worker process
+ can complete before it will exit and be replaced with a fresh
+ worker process. The default of None means worker process will
+ live as long as the executor. Requires a non-'fork' mp_context
+ start method. When given, we default to using 'spawn' if no
+ mp_context is supplied.
+ """
+ _check_system_limits()
+
+ if max_workers is None:
+ self._max_workers = os.cpu_count() or 1
+ if sys.platform == 'win32':
+ self._max_workers = min(_MAX_WINDOWS_WORKERS,
+ self._max_workers)
+ else:
+ if max_workers <= 0:
+ raise ValueError("max_workers must be greater than 0")
+ elif (sys.platform == 'win32' and
+ max_workers > _MAX_WINDOWS_WORKERS):
+ raise ValueError(
+ f"max_workers must be <= {_MAX_WINDOWS_WORKERS}")
+
+ self._max_workers = max_workers
+
+ if mp_context is None:
+ if max_tasks_per_child is not None:
+ mp_context = mp.get_context("spawn")
+ else:
+ mp_context = mp.get_context()
+ self._mp_context = mp_context
+
+ # https://github.com/python/cpython/issues/90622
+ self._safe_to_dynamically_spawn_children = (
+ self._mp_context.get_start_method(allow_none=False) != "fork")
+
+ if initializer is not None and not callable(initializer):
+ raise TypeError("initializer must be a callable")
+ self._initializer = initializer
+ self._initargs = initargs
+
+ if max_tasks_per_child is not None:
+ if not isinstance(max_tasks_per_child, int):
+ raise TypeError("max_tasks_per_child must be an integer")
+ elif max_tasks_per_child <= 0:
+ raise ValueError("max_tasks_per_child must be >= 1")
+ if self._mp_context.get_start_method(allow_none=False) == "fork":
+ # https://github.com/python/cpython/issues/90622
+ raise ValueError("max_tasks_per_child is incompatible with"
+ " the 'fork' multiprocessing start method;"
+ " supply a different mp_context.")
+ self._max_tasks_per_child = max_tasks_per_child
+
+ # Management thread
+ self._executor_manager_thread = None
+
+ # Map of pids to processes
+ self._processes = {}
+
+ # Shutdown is a two-step process.
+ self._shutdown_thread = False
+ self._shutdown_lock = threading.Lock()
+ self._idle_worker_semaphore = threading.Semaphore(0)
+ self._broken = False
+ self._queue_count = 0
+ self._pending_work_items = {}
+ self._cancel_pending_futures = False
+
+ # _ThreadWakeup is a communication channel used to interrupt the wait
+ # of the main loop of executor_manager_thread from another thread (e.g.
+ # when calling executor.submit or executor.shutdown). We do not use the
+ # _result_queue to send wakeup signals to the executor_manager_thread
+ # as it could result in a deadlock if a worker process dies with the
+ # _result_queue write lock still acquired.
+ #
+ # _shutdown_lock must be locked to access _ThreadWakeup.close() and
+ # .wakeup(). Care must also be taken to not call clear or close from
+ # more than one thread since _ThreadWakeup.clear() is not protected by
+ # the _shutdown_lock
+ self._executor_manager_thread_wakeup = _ThreadWakeup()
+
+ # Create communication channels for the executor
+ # Make the call queue slightly larger than the number of processes to
+ # prevent the worker processes from idling. But don't make it too big
+ # because futures in the call queue cannot be cancelled.
+ queue_size = self._max_workers + EXTRA_QUEUED_CALLS
+ self._call_queue = _SafeQueue(
+ max_size=queue_size, ctx=self._mp_context,
+ pending_work_items=self._pending_work_items,
+ shutdown_lock=self._shutdown_lock,
+ thread_wakeup=self._executor_manager_thread_wakeup)
+ # Killed worker processes can produce spurious "broken pipe"
+ # tracebacks in the queue's own worker thread. But we detect killed
+ # processes anyway, so silence the tracebacks.
+ self._call_queue._ignore_epipe = True
+ self._result_queue = mp_context.SimpleQueue()
+ self._work_ids = queue.Queue()
+
+ def _start_executor_manager_thread(self):
+ if self._executor_manager_thread is None:
+ # Start the processes so that their sentinels are known.
+ if not self._safe_to_dynamically_spawn_children: # ie, using fork.
+ self._launch_processes()
+ self._executor_manager_thread = _ExecutorManagerThread(self)
+ self._executor_manager_thread.start()
+ _threads_wakeups[self._executor_manager_thread] = \
+ self._executor_manager_thread_wakeup
+
+ def _adjust_process_count(self):
+ # if there's an idle process, we don't need to spawn a new one.
+ if self._idle_worker_semaphore.acquire(blocking=False):
+ return
+
+ process_count = len(self._processes)
+ if process_count < self._max_workers:
+ # Assertion disabled as this codepath is also used to replace a
+ # worker that unexpectedly dies, even when using the 'fork' start
+ # method. That means there is still a potential deadlock bug. If a
+ # 'fork' mp_context worker dies, we'll be forking a new one when
+ # we know a thread is running (self._executor_manager_thread).
+ #assert self._safe_to_dynamically_spawn_children or not self._executor_manager_thread, 'https://github.com/python/cpython/issues/90622'
+ self._spawn_process()
+
+ def _launch_processes(self):
+ # https://github.com/python/cpython/issues/90622
+ assert not self._executor_manager_thread, (
+ 'Processes cannot be fork()ed after the thread has started, '
+ 'deadlock in the child processes could result.')
+ for _ in range(len(self._processes), self._max_workers):
+ self._spawn_process()
+
+ def _spawn_process(self):
+ p = self._mp_context.Process(
+ target=_process_worker,
+ args=(self._call_queue,
+ self._result_queue,
+ self._initializer,
+ self._initargs,
+ self._max_tasks_per_child))
+ p.start()
+ self._processes[p.pid] = p
+
+ def submit(self, fn, /, *args, **kwargs):
+ with self._shutdown_lock:
+ if self._broken:
+ raise BrokenProcessPool(self._broken)
+ if self._shutdown_thread:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+ if _global_shutdown:
+ raise RuntimeError('cannot schedule new futures after '
+ 'interpreter shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._pending_work_items[self._queue_count] = w
+ self._work_ids.put(self._queue_count)
+ self._queue_count += 1
+ # Wake up queue management thread
+ self._executor_manager_thread_wakeup.wakeup()
+
+ if self._safe_to_dynamically_spawn_children:
+ self._adjust_process_count()
+ self._start_executor_manager_thread()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def map(self, fn, *iterables, timeout=None, chunksize=1):
+ """Returns an iterator equivalent to map(fn, iter).
+
+ Args:
+ fn: A callable that will take as many arguments as there are
+ passed iterables.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+ chunksize: If greater than one, the iterables will be chopped into
+ chunks of size chunksize and submitted to the process pool.
+ If set to one, the items in the list will be sent one at a time.
+
+ Returns:
+ An iterator equivalent to: map(func, *iterables) but the calls may
+ be evaluated out-of-order.
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ Exception: If fn(*args) raises for any values.
+ """
+ if chunksize < 1:
+ raise ValueError("chunksize must be >= 1.")
+
+ results = super().map(partial(_process_chunk, fn),
+ _get_chunks(*iterables, chunksize=chunksize),
+ timeout=timeout)
+ return _chain_from_iterable_of_lists(results)
+
+ def shutdown(self, wait=True, *, cancel_futures=False):
+ with self._shutdown_lock:
+ self._cancel_pending_futures = cancel_futures
+ self._shutdown_thread = True
+ if self._executor_manager_thread_wakeup is not None:
+ # Wake up queue management thread
+ self._executor_manager_thread_wakeup.wakeup()
+
+ if self._executor_manager_thread is not None and wait:
+ self._executor_manager_thread.join()
+ # To reduce the risk of opening too many files, remove references to
+ # objects that use file descriptors.
+ self._executor_manager_thread = None
+ self._call_queue = None
+ if self._result_queue is not None and wait:
+ self._result_queue.close()
+ self._result_queue = None
+ self._processes = None
+ self._executor_manager_thread_wakeup = None
+
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/thread.py b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/thread.py
new file mode 100644
index 0000000000000000000000000000000000000000..51c942f51abd371e80ffa07c2b212336afb8eae2
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/concurrent/futures/thread.py
@@ -0,0 +1,236 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Implements ThreadPoolExecutor."""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+from concurrent.futures import _base
+import itertools
+import queue
+import threading
+import types
+import weakref
+import os
+
+
+_threads_queues = weakref.WeakKeyDictionary()
+_shutdown = False
+# Lock that ensures that new workers are not created while the interpreter is
+# shutting down. Must be held while mutating _threads_queues and _shutdown.
+_global_shutdown_lock = threading.Lock()
+
+def _python_exit():
+ global _shutdown
+ with _global_shutdown_lock:
+ _shutdown = True
+ items = list(_threads_queues.items())
+ for t, q in items:
+ q.put(None)
+ for t, q in items:
+ t.join()
+
+# Register for `_python_exit()` to be called just before joining all
+# non-daemon threads. This is used instead of `atexit.register()` for
+# compatibility with subinterpreters, which no longer support daemon threads.
+# See bpo-39812 for context.
+threading._register_atexit(_python_exit)
+
+# At fork, reinitialize the `_global_shutdown_lock` lock in the child process
+if hasattr(os, 'register_at_fork'):
+ os.register_at_fork(before=_global_shutdown_lock.acquire,
+ after_in_child=_global_shutdown_lock._at_fork_reinit,
+ after_in_parent=_global_shutdown_lock.release)
+
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+ def run(self):
+ if not self.future.set_running_or_notify_cancel():
+ return
+
+ try:
+ result = self.fn(*self.args, **self.kwargs)
+ except BaseException as exc:
+ self.future.set_exception(exc)
+ # Break a reference cycle with the exception 'exc'
+ self = None
+ else:
+ self.future.set_result(result)
+
+ __class_getitem__ = classmethod(types.GenericAlias)
+
+
+def _worker(executor_reference, work_queue, initializer, initargs):
+ if initializer is not None:
+ try:
+ initializer(*initargs)
+ except BaseException:
+ _base.LOGGER.critical('Exception in initializer:', exc_info=True)
+ executor = executor_reference()
+ if executor is not None:
+ executor._initializer_failed()
+ return
+ try:
+ while True:
+ work_item = work_queue.get(block=True)
+ if work_item is not None:
+ work_item.run()
+ # Delete references to object. See issue16284
+ del work_item
+
+ # attempt to increment idle count
+ executor = executor_reference()
+ if executor is not None:
+ executor._idle_semaphore.release()
+ del executor
+ continue
+
+ executor = executor_reference()
+ # Exit if:
+ # - The interpreter is shutting down OR
+ # - The executor that owns the worker has been collected OR
+ # - The executor that owns the worker has been shutdown.
+ if _shutdown or executor is None or executor._shutdown:
+ # Flag the executor as shutting down as early as possible if it
+ # is not gc-ed yet.
+ if executor is not None:
+ executor._shutdown = True
+ # Notice other workers
+ work_queue.put(None)
+ return
+ del executor
+ except BaseException:
+ _base.LOGGER.critical('Exception in worker', exc_info=True)
+
+
+class BrokenThreadPool(_base.BrokenExecutor):
+ """
+ Raised when a worker thread in a ThreadPoolExecutor failed initializing.
+ """
+
+
+class ThreadPoolExecutor(_base.Executor):
+
+ # Used to assign unique thread names when thread_name_prefix is not supplied.
+ _counter = itertools.count().__next__
+
+ def __init__(self, max_workers=None, thread_name_prefix='',
+ initializer=None, initargs=()):
+ """Initializes a new ThreadPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of threads that can be used to
+ execute the given calls.
+ thread_name_prefix: An optional name prefix to give our threads.
+ initializer: A callable used to initialize worker threads.
+ initargs: A tuple of arguments to pass to the initializer.
+ """
+ if max_workers is None:
+ # ThreadPoolExecutor is often used to:
+ # * CPU bound task which releases GIL
+ # * I/O bound task (which releases GIL, of course)
+ #
+ # We use cpu_count + 4 for both types of tasks.
+ # But we limit it to 32 to avoid consuming surprisingly large resource
+ # on many core machine.
+ max_workers = min(32, (os.cpu_count() or 1) + 4)
+ if max_workers <= 0:
+ raise ValueError("max_workers must be greater than 0")
+
+ if initializer is not None and not callable(initializer):
+ raise TypeError("initializer must be a callable")
+
+ self._max_workers = max_workers
+ self._work_queue = queue.SimpleQueue()
+ self._idle_semaphore = threading.Semaphore(0)
+ self._threads = set()
+ self._broken = False
+ self._shutdown = False
+ self._shutdown_lock = threading.Lock()
+ self._thread_name_prefix = (thread_name_prefix or
+ ("ThreadPoolExecutor-%d" % self._counter()))
+ self._initializer = initializer
+ self._initargs = initargs
+
+ def submit(self, fn, /, *args, **kwargs):
+ with self._shutdown_lock, _global_shutdown_lock:
+ if self._broken:
+ raise BrokenThreadPool(self._broken)
+
+ if self._shutdown:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+ if _shutdown:
+ raise RuntimeError('cannot schedule new futures after '
+ 'interpreter shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._work_queue.put(w)
+ self._adjust_thread_count()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def _adjust_thread_count(self):
+ # if idle threads are available, don't spin new threads
+ if self._idle_semaphore.acquire(timeout=0):
+ return
+
+ # When the executor gets lost, the weakref callback will wake up
+ # the worker threads.
+ def weakref_cb(_, q=self._work_queue):
+ q.put(None)
+
+ num_threads = len(self._threads)
+ if num_threads < self._max_workers:
+ thread_name = '%s_%d' % (self._thread_name_prefix or self,
+ num_threads)
+ t = threading.Thread(name=thread_name, target=_worker,
+ args=(weakref.ref(self, weakref_cb),
+ self._work_queue,
+ self._initializer,
+ self._initargs))
+ t.start()
+ self._threads.add(t)
+ _threads_queues[t] = self._work_queue
+
+ def _initializer_failed(self):
+ with self._shutdown_lock:
+ self._broken = ('A thread initializer failed, the thread pool '
+ 'is not usable anymore')
+ # Drain work queue and mark pending futures failed
+ while True:
+ try:
+ work_item = self._work_queue.get_nowait()
+ except queue.Empty:
+ break
+ if work_item is not None:
+ work_item.future.set_exception(BrokenThreadPool(self._broken))
+
+ def shutdown(self, wait=True, *, cancel_futures=False):
+ with self._shutdown_lock:
+ self._shutdown = True
+ if cancel_futures:
+ # Drain all work items from the queue, and then cancel their
+ # associated futures.
+ while True:
+ try:
+ work_item = self._work_queue.get_nowait()
+ except queue.Empty:
+ break
+ if work_item is not None:
+ work_item.future.cancel()
+
+ # Send a wake-up to prevent threads calling
+ # _work_queue.get(block=True) from permanently blocking.
+ self._work_queue.put(None)
+ if wait:
+ for t in self._threads:
+ t.join()
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Makefile b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..b7a4b0cee1e2e7e877827daa555f9cb4040980dc
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Makefile
@@ -0,0 +1,2806 @@
+# Generated automatically from Makefile.pre by makesetup.
+# Top-level Makefile for Python
+#
+# As distributed, this file is called Makefile.pre.in; it is processed
+# into the real Makefile by running the script ./configure, which
+# replaces things like @spam@ with values appropriate for your system.
+# This means that if you edit Makefile, your changes get lost the next
+# time you run the configure script. Ideally, you can do:
+#
+# ./configure
+# make
+# make test
+# make install
+#
+# If you have a previous version of Python installed that you don't
+# want to overwrite, you can use "make altinstall" instead of "make
+# install". Refer to the "Installing" section in the README file for
+# additional details.
+#
+# See also the section "Build instructions" in the README file.
+
+# === Variables set by makesetup ===
+
+MODBUILT_NAMES= atexit faulthandler posix _signal _tracemalloc _codecs _collections errno _io itertools _sre _thread time _weakref _abc _functools _locale _operator _stat _symtable pwd xxsubtype
+MODSHARED_NAMES=
+MODDISABLED_NAMES=
+MODOBJS= Modules/atexitmodule.o Modules/faulthandler.o Modules/posixmodule.o Modules/signalmodule.o Modules/_tracemalloc.o Modules/_codecsmodule.o Modules/_collectionsmodule.o Modules/errnomodule.o Modules/_io/_iomodule.o Modules/_io/iobase.o Modules/_io/fileio.o Modules/_io/bytesio.o Modules/_io/bufferedio.o Modules/_io/textio.o Modules/_io/stringio.o Modules/itertoolsmodule.o Modules/_sre/sre.o Modules/_threadmodule.o Modules/timemodule.o Modules/_weakref.o Modules/_abc.o Modules/_functoolsmodule.o Modules/_localemodule.o Modules/_operator.o Modules/_stat.o Modules/symtablemodule.o Modules/pwdmodule.o Modules/xxsubtype.o
+MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS)
+
+# === Variables set by configure
+VERSION= 3.11
+srcdir= /home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work
+VPATH= /home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work
+abs_srcdir= /home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work
+abs_builddir= /home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work/build-static
+
+
+CC= x86_64-conda-linux-gnu-gcc -pthread
+CXX= x86_64-conda-linux-gnu-c++ -pthread
+MAINCC= $(CC)
+LINKCC= $(PURIFY) $(MAINCC)
+AR= x86_64-conda-linux-gnu-ar
+READELF= x86_64-conda-linux-gnu-readelf
+SOABI= cpython-311-x86_64-linux-gnu
+LDVERSION= $(VERSION)$(ABIFLAGS)
+LIBPYTHON=
+GITVERSION=
+GITTAG=
+GITBRANCH=
+PGO_PROF_GEN_FLAG=-fprofile-generate
+PGO_PROF_USE_FLAG=
+LLVM_PROF_MERGER=true
+LLVM_PROF_FILE=
+LLVM_PROF_ERR=no
+DTRACE=
+DFLAGS=
+DTRACE_HEADERS=
+DTRACE_OBJS=
+
+GNULD= yes
+
+# Shell used by make (some versions default to the login shell, which is bad)
+SHELL= /bin/sh
+
+# Use this to make a link between python$(VERSION) and python in $(BINDIR)
+LN= ln
+
+# Portable install script (configure doesn't always guess right)
+INSTALL= /usr/bin/install -c
+INSTALL_PROGRAM=${INSTALL}
+INSTALL_SCRIPT= ${INSTALL}
+INSTALL_DATA= ${INSTALL} -m 644
+# Shared libraries must be installed with executable mode on some systems;
+# rather than figuring out exactly which, we always give them executable mode.
+INSTALL_SHARED= ${INSTALL} -m 755
+
+MKDIR_P= /usr/bin/mkdir -p
+
+MAKESETUP= $(srcdir)/Modules/makesetup
+
+# Compiler options
+OPT= -DNDEBUG -fwrapv -O2 -Wall
+BASECFLAGS=
+BASECPPFLAGS= -IObjects -IInclude -IPython
+CONFIGURE_CFLAGS= -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -fno-merge-constants -isystem /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work=/usr/local/src/conda/python-split-3.11.17 -fdebug-prefix-map=/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1=/usr/local/src/conda-prefix
+# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
+# Use it when a compiler flag should _not_ be part of the distutils CFLAGS
+# once Python is installed (Issue #21121).
+CONFIGURE_CFLAGS_NODIST= -fno-semantic-interposition -g -std=c11 -Werror=implicit-function-declaration -fvisibility=hidden
+# LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST.
+# Use it when a linker flag should _not_ be part of the distutils LDFLAGS
+# once Python is installed (bpo-35257)
+CONFIGURE_LDFLAGS_NODIST= -fno-semantic-interposition -g
+# LDFLAGS_NOLTO is an extra flag to disable lto. It is used to speed up building
+# of _bootstrap_python and _freeze_module tools, which don't need LTO.
+CONFIGURE_LDFLAGS_NOLTO=-fno-lto
+CONFIGURE_CPPFLAGS= -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include -I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+CONFIGURE_LDFLAGS= -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -Wl,-rpath-link,/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib
+# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
+# command line to append to these values without stomping the pre-set
+# values.
+PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
+PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal
+# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
+# be able to build extension modules using the directories specified in the
+# environment variables
+PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
+PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
+PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
+PY_LDFLAGS_NOLTO=$(PY_LDFLAGS) $(CONFIGURE_LDFLAGS_NOLTO) $(LDFLAGS_NODIST)
+NO_AS_NEEDED= -Wl,--no-as-needed
+CCSHARED= -fPIC
+# LINKFORSHARED are the flags passed to the $(CC) command that links
+# the python executable -- this is only needed for a few systems
+LINKFORSHARED= -Xlinker -export-dynamic
+ARFLAGS= rcs
+# Extra C flags added for building the interpreter object files.
+CFLAGSFORSHARED=
+# C flags used for building the interpreter object files
+PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
+PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
+PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
+# Linker flags used for building the interpreter object files
+PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST)
+# Strict or non-strict aliasing flags used to compile dtoa.c, see above
+CFLAGS_ALIASING=
+
+
+# Machine-dependent subdirectories
+MACHDEP= linux
+
+# Multiarch directory (may be empty)
+MULTIARCH= x86_64-linux-gnu
+MULTIARCH_CPPFLAGS = -DMULTIARCH=\"x86_64-linux-gnu\"
+
+# Install prefix for architecture-independent files
+prefix= /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1
+
+# Install prefix for architecture-dependent files
+exec_prefix= ${prefix}
+
+# Install prefix for data files
+datarootdir= ${prefix}/share
+
+# Expanded directories
+BINDIR= ${exec_prefix}/bin
+LIBDIR= ${exec_prefix}/lib
+MANDIR= ${datarootdir}/man
+INCLUDEDIR= ${prefix}/include
+CONFINCLUDEDIR= $(exec_prefix)/include
+PLATLIBDIR= lib
+SCRIPTDIR= $(prefix)/$(PLATLIBDIR)
+ABIFLAGS=
+# Variable used by ensurepip
+WHEEL_PKG_DIR=
+
+# Detailed destination directories
+BINLIBDEST= ${exec_prefix}/${PLATLIBDIR}/python$(VERSION)
+LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
+
+# Symbols used for using shared libraries
+SHLIB_SUFFIX= .so
+EXT_SUFFIX= .cpython-311-x86_64-linux-gnu.so
+LDSHARED= $(CC) -shared $(PY_LDFLAGS)
+BLDSHARED= $(CC) -shared $(PY_CORE_LDFLAGS)
+LDCXXSHARED= $(CXX) -shared
+DESTSHARED= $(BINLIBDEST)/lib-dynload
+
+# List of exported symbols for AIX
+EXPORTSYMS=
+EXPORTSFROM=
+
+# Executable suffix (.exe on Windows and Mac OS X)
+EXE=
+BUILDEXE=
+
+# Short name and location for Mac OS X Python framework
+UNIVERSALSDK=
+PYTHONFRAMEWORK=
+PYTHONFRAMEWORKDIR= no-framework
+PYTHONFRAMEWORKPREFIX=
+PYTHONFRAMEWORKINSTALLDIR=
+# Deployment target selected during configure, to be checked
+# by distutils. The export statement is needed to ensure that the
+# deployment target is active during build.
+MACOSX_DEPLOYMENT_TARGET=
+#export MACOSX_DEPLOYMENT_TARGET
+
+# Option to install to strip binaries
+STRIPFLAG=-s
+
+# Flags to lipo to produce a 32-bit-only universal executable
+LIPO_32BIT_FLAGS=
+
+# Flags to lipo to produce an intel-64-only universal executable
+LIPO_INTEL64_FLAGS=
+
+# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
+OTHER_LIBTOOL_OPT=
+
+# Environment to run shared python without installed libraries
+RUNSHARED=
+
+# ensurepip options
+ENSUREPIP= no
+
+# Internal static libraries
+LIBMPDEC_A= Modules/_decimal/libmpdec/libmpdec.a
+LIBEXPAT_A= Modules/expat/libexpat.a
+
+# OpenSSL options for setup.py so sysconfig can pick up AC_SUBST() vars.
+OPENSSL_INCLUDES=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+OPENSSL_LIBS=-lssl -lcrypto
+OPENSSL_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib
+OPENSSL_RPATH=
+
+# Module state, compiler flags and linker flags
+# Empty CFLAGS and LDFLAGS are omitted.
+# states:
+# * yes: module is available
+# * missing: build dependency is missing
+# * disabled: module is disabled
+# * n/a: module is not available on the current platform
+# MODULE_EGG_STATE=yes # yes, missing, disabled, n/a
+# MODULE_EGG_CFLAGS=
+# MODULE_EGG_LDFLAGS=
+MODULE__IO_STATE=yes
+MODULE__IO_CFLAGS=-I$(srcdir)/Modules/_io
+MODULE_TIME_STATE=yes
+MODULE_TIME_LDFLAGS=
+MODULE_ARRAY_STATE=yes
+MODULE__ASYNCIO_STATE=yes
+MODULE__BISECT_STATE=yes
+MODULE__CONTEXTVARS_STATE=yes
+MODULE__CSV_STATE=yes
+MODULE__HEAPQ_STATE=yes
+MODULE__JSON_STATE=yes
+MODULE__LSPROF_STATE=yes
+MODULE__OPCODE_STATE=yes
+MODULE__PICKLE_STATE=yes
+MODULE__POSIXSUBPROCESS_STATE=yes
+MODULE__QUEUE_STATE=yes
+MODULE__RANDOM_STATE=yes
+MODULE_SELECT_STATE=yes
+MODULE__STRUCT_STATE=yes
+MODULE__TYPING_STATE=yes
+MODULE__XXSUBINTERPRETERS_STATE=yes
+MODULE__ZONEINFO_STATE=yes
+MODULE__MULTIPROCESSING_STATE=yes
+MODULE__MULTIPROCESSING_CFLAGS=-I$(srcdir)/Modules/_multiprocessing
+MODULE__POSIXSHMEM_STATE=yes
+MODULE__POSIXSHMEM_CFLAGS=-I$(srcdir)/Modules/_multiprocessing
+MODULE__POSIXSHMEM_LDFLAGS=-lrt
+MODULE_AUDIOOP_STATE=yes
+MODULE_AUDIOOP_LDFLAGS=-lm
+MODULE__STATISTICS_STATE=yes
+MODULE__STATISTICS_LDFLAGS=-lm
+MODULE_CMATH_STATE=yes
+MODULE_CMATH_LDFLAGS=-lm
+MODULE_MATH_STATE=yes
+MODULE_MATH_LDFLAGS=-lm
+MODULE__DATETIME_STATE=yes
+MODULE__DATETIME_LDFLAGS= -lm
+MODULE_FCNTL_STATE=yes
+MODULE_FCNTL_LDFLAGS=
+MODULE_MMAP_STATE=yes
+MODULE__SOCKET_STATE=yes
+MODULE_GRP_STATE=yes
+MODULE_OSSAUDIODEV_STATE=yes
+MODULE_OSSAUDIODEV_LDFLAGS=
+MODULE_PWD_STATE=yes
+MODULE_RESOURCE_STATE=yes
+MODULE__SCPROXY_STATE=n/a
+MODULE_SPWD_STATE=yes
+MODULE_SYSLOG_STATE=yes
+MODULE_TERMIOS_STATE=yes
+MODULE_PYEXPAT_STATE=yes
+MODULE_PYEXPAT_CFLAGS=
+MODULE_PYEXPAT_LDFLAGS=-lexpat
+MODULE__ELEMENTTREE_STATE=yes
+MODULE__ELEMENTTREE_CFLAGS=
+MODULE__CODECS_CN_STATE=yes
+MODULE__CODECS_HK_STATE=yes
+MODULE__CODECS_ISO2022_STATE=yes
+MODULE__CODECS_JP_STATE=yes
+MODULE__CODECS_KR_STATE=yes
+MODULE__CODECS_TW_STATE=yes
+MODULE__MULTIBYTECODEC_STATE=yes
+MODULE_UNICODEDATA_STATE=yes
+MODULE__MD5_STATE=yes
+MODULE__SHA1_STATE=yes
+MODULE__SHA256_STATE=yes
+MODULE__SHA512_STATE=yes
+MODULE__SHA3_STATE=yes
+MODULE__BLAKE2_STATE=yes
+MODULE__BLAKE2_CFLAGS=
+MODULE__BLAKE2_LDFLAGS=
+MODULE__CRYPT_STATE=yes
+MODULE__CRYPT_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+MODULE__CRYPT_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -lcrypt
+MODULE__DECIMAL_STATE=yes
+MODULE__DECIMAL_CFLAGS=-I$(srcdir)/Modules/_decimal/libmpdec -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1
+MODULE__DECIMAL_LDFLAGS=-lm $(LIBMPDEC_A)
+MODULE__GDBM_STATE=missing
+MODULE_NIS_STATE=yes
+MODULE_NIS_CFLAGS=
+MODULE_NIS_LDFLAGS=-lnsl
+MODULE__SQLITE3_STATE=yes
+MODULE__SQLITE3_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include -I$(srcdir)/Modules/_sqlite
+MODULE__SQLITE3_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -lsqlite3
+MODULE__TKINTER_STATE=yes
+MODULE__TKINTER_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include -Wno-strict-prototypes -DWITH_APPINIT=1
+MODULE__TKINTER_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6
+MODULE__UUID_STATE=yes
+MODULE__UUID_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include/uuid
+MODULE__UUID_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -luuid
+MODULE_ZLIB_STATE=yes
+MODULE_ZLIB_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+MODULE_ZLIB_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -lz
+MODULE_BINASCII_STATE=yes
+MODULE_BINASCII_CFLAGS=-DUSE_ZLIB_CRC32 -I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+MODULE_BINASCII_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -lz
+MODULE__BZ2_STATE=yes
+MODULE__BZ2_CFLAGS=
+MODULE__BZ2_LDFLAGS=-lbz2
+MODULE__LZMA_STATE=yes
+MODULE__LZMA_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+MODULE__LZMA_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -llzma
+MODULE__SSL_STATE=yes
+MODULE__SSL_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+MODULE__SSL_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -lssl -lcrypto
+MODULE__HASHLIB_STATE=yes
+MODULE__HASHLIB_CFLAGS=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+MODULE__HASHLIB_LDFLAGS=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -lcrypto
+MODULE__TESTCAPI_STATE=yes
+MODULE__TESTCLINIC_STATE=yes
+MODULE__TESTINTERNALCAPI_STATE=yes
+MODULE__TESTBUFFER_STATE=yes
+MODULE__TESTIMPORTMULTIPLE_STATE=yes
+MODULE__TESTMULTIPHASE_STATE=yes
+MODULE__XXTESTFUZZ_STATE=yes
+MODULE__CTYPES_TEST_STATE=yes
+MODULE__CTYPES_TEST_LDFLAGS=-lm
+MODULE_XXLIMITED_STATE=yes
+MODULE_XXLIMITED_35_STATE=yes
+
+
+# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
+TZPATH=/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/share/zoneinfo
+
+# Modes for directories, executables and data files created by the
+# install process. Default to user-only-writable for all file types.
+DIRMODE= 755
+EXEMODE= 755
+FILEMODE= 644
+
+# configure script arguments
+CONFIG_ARGS= '--prefix=/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1' '--build=x86_64-conda-linux-gnu' '--host=x86_64-conda-linux-gnu' '--enable-ipv6' '--with-ensurepip=no' '--with-tzpath=/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/share/zoneinfo' '--with-computed-gotos' '--with-system-ffi' '--with-system-expat' '--enable-loadable-sqlite-extensions' '--with-tcltk-includes=-I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include' '--with-tcltk-libs=-L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -ltcl8.6 -ltk8.6' '--with-platlibdir=lib' '--with-lto' '--enable-optimizations' '-oldincludedir=/home/conda/feedstock_root/build_artifacts/python-split_1791909181428/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include' '--disable-shared' 'PROFILE_TASK=-m test --pgo' 'build_alias=x86_64-conda-linux-gnu' 'host_alias=x86_64-conda-linux-gnu' 'PKG_CONFIG_PATH=/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib/pkgconfig' 'MACHDEP=linux' 'CC=x86_64-conda-linux-gnu-gcc' 'CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -fno-merge-constants -isystem /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work=/usr/local/src/conda/python-split-3.11.17 -fdebug-prefix-map=/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1=/usr/local/src/conda-prefix ' 'LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -Wl,-rpath-link,/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib -L/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/lib' 'CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include -I/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include' 'CPP=x86_64-conda-linux-gnu-cpp'
+
+
+# Subdirectories with code
+SRCDIRS= Modules Modules/_blake2 Modules/_ctypes Modules/_decimal Modules/_decimal/libmpdec Modules/_io Modules/_multiprocessing Modules/_sha3 Modules/_sqlite Modules/_sre Modules/_xxtestfuzz Modules/cjkcodecs Modules/expat Objects Parser Programs Python Python/frozen_modules Python/deepfreeze
+
+# Other subdirectories
+SUBDIRSTOO= Include Lib Misc
+
+# assets for Emscripten browser builds
+WASM_ASSETS_DIR=.$(prefix)
+WASM_STDLIB=$(WASM_ASSETS_DIR)/lib/python$(VERSION)/os.py
+
+# Files and directories to be distributed
+CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
+DISTFILES= README.rst ChangeLog $(CONFIGFILES)
+DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
+DIST= $(DISTFILES) $(DISTDIRS)
+
+
+LIBRARY= libpython$(VERSION)$(ABIFLAGS).a
+LDLIBRARY= libpython$(VERSION)$(ABIFLAGS).a
+BLDLIBRARY= $(LDLIBRARY)
+PY3LIBRARY=
+DLLLIBRARY=
+LDLIBRARYDIR=
+INSTSONAME= $(LDLIBRARY)
+LIBRARY_DEPS= $(LIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
+LINK_PYTHON_DEPS=$(LIBRARY_DEPS)
+PY_ENABLE_SHARED= 0
+STATIC_LIBPYTHON= 1
+
+
+LIBS= -lpthread -ldl -lutil
+LIBM= -lm
+LIBC=
+SYSLIBS= $(LIBM) $(LIBC)
+SHLIBS= $(LIBS)
+
+DLINCLDIR= .
+DYNLOADFILE= dynload_shlib.o
+MACHDEP_OBJS=
+LIBOBJDIR= Python/
+LIBOBJS=
+
+PYTHON= python$(EXE)
+BUILDPYTHON= python$(BUILDEXE)
+
+HOSTRUNNER=
+
+PYTHON_FOR_REGEN?=python3
+UPDATE_FILE=$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/update_file.py
+PYTHON_FOR_BUILD=./$(BUILDPYTHON) -E
+# Single-platform builds depend on $(BUILDPYTHON). Cross builds use an
+# external "build Python" and have an empty PYTHON_FOR_BUILD_DEPS.
+PYTHON_FOR_BUILD_DEPS=$(BUILDPYTHON)
+
+# Single-platform builds use Programs/_freeze_module.c for bootstrapping and
+# ./_bootstrap_python Programs/_freeze_module.py for remaining modules
+# Cross builds use an external "build Python" for all modules.
+PYTHON_FOR_FREEZE=./_bootstrap_python
+FREEZE_MODULE_BOOTSTRAP=./Programs/_freeze_module
+FREEZE_MODULE_BOOTSTRAP_DEPS=Programs/_freeze_module
+FREEZE_MODULE=$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py
+FREEZE_MODULE_DEPS=_bootstrap_python $(srcdir)/Programs/_freeze_module.py
+
+_PYTHON_HOST_PLATFORM=linux-x86_64
+BUILD_GNU_TYPE= x86_64-conda-linux-gnu
+HOST_GNU_TYPE= x86_64-conda-linux-gnu
+
+# The task to run while instrumented when building the profile-opt target.
+# To speed up profile generation, we don't run the full unit test suite
+# by default. The default is "-m test --pgo". To run more tests, use
+# PROFILE_TASK="-m test --pgo-extended"
+PROFILE_TASK= -m test --pgo
+
+# report files for gcov / lcov coverage report
+COVERAGE_INFO= $(abs_builddir)/coverage.info
+COVERAGE_REPORT=$(abs_builddir)/lcov-report
+COVERAGE_LCOV_OPTIONS=--rc lcov_branch_coverage=1
+COVERAGE_REPORT_OPTIONS=--rc lcov_branch_coverage=1 --branch-coverage --title "CPython $(VERSION) LCOV report [commit $(shell $(GITVERSION))]"
+
+
+# === Definitions added by makesetup ===
+
+
+LOCALMODLIBS= $(MODULE_ATEXIT_LDFLAGS) $(MODULE_FAULTHANDLER_LDFLAGS) $(MODULE_POSIX_LDFLAGS) $(MODULE__SIGNAL_LDFLAGS) $(MODULE__TRACEMALLOC_LDFLAGS) $(MODULE__CODECS_LDFLAGS) $(MODULE__COLLECTIONS_LDFLAGS) $(MODULE_ERRNO_LDFLAGS) $(MODULE__IO_LDFLAGS) $(MODULE_ITERTOOLS_LDFLAGS) $(MODULE__SRE_LDFLAGS) $(MODULE__THREAD_LDFLAGS) $(MODULE_TIME_LDFLAGS) $(MODULE__WEAKREF_LDFLAGS) $(MODULE__ABC_LDFLAGS) $(MODULE__FUNCTOOLS_LDFLAGS) $(MODULE__LOCALE_LDFLAGS) $(MODULE__OPERATOR_LDFLAGS) $(MODULE__STAT_LDFLAGS) $(MODULE__SYMTABLE_LDFLAGS) $(MODULE_PWD_LDFLAGS) $(MODULE_XXSUBTYPE_LDFLAGS)
+BASEMODLIBS=
+PYTHONPATH=$(COREPYTHONPATH)
+COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
+TESTPATH=
+SITEPATH=
+DESTPATH=
+MACHDESTLIB=$(BINLIBDEST)
+DESTLIB=$(LIBDEST)
+
+
+
+##########################################################################
+# Modules
+MODULE_OBJS= \
+ Modules/config.o \
+ Modules/main.o \
+ Modules/gcmodule.o
+
+IO_H= Modules/_io/_iomodule.h
+
+IO_OBJS= \
+ Modules/_io/_iomodule.o \
+ Modules/_io/iobase.o \
+ Modules/_io/fileio.o \
+ Modules/_io/bufferedio.o \
+ Modules/_io/textio.o \
+ Modules/_io/bytesio.o \
+ Modules/_io/stringio.o
+
+##########################################################################
+
+LIBFFI_INCLUDEDIR= /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/include
+
+##########################################################################
+# Parser
+
+PEGEN_OBJS= \
+ Parser/pegen.o \
+ Parser/pegen_errors.o \
+ Parser/action_helpers.o \
+ Parser/parser.o \
+ Parser/string_parser.o \
+ Parser/peg_api.o
+
+
+PEGEN_HEADERS= \
+ $(srcdir)/Include/internal/pycore_parser.h \
+ $(srcdir)/Parser/pegen.h \
+ $(srcdir)/Parser/string_parser.h
+
+POBJS= \
+ Parser/token.o \
+
+PARSER_OBJS= $(POBJS) $(PEGEN_OBJS) Parser/myreadline.o Parser/tokenizer.o
+
+PARSER_HEADERS= \
+ $(PEGEN_HEADERS) \
+ $(srcdir)/Parser/tokenizer.h
+
+##########################################################################
+# Python
+
+PYTHON_OBJS= \
+ Python/_warnings.o \
+ Python/Python-ast.o \
+ Python/Python-tokenize.o \
+ Python/asdl.o \
+ Python/ast.o \
+ Python/ast_opt.o \
+ Python/ast_unparse.o \
+ Python/bltinmodule.o \
+ Python/ceval.o \
+ Python/codecs.o \
+ Python/compile.o \
+ Python/context.o \
+ Python/dynamic_annotations.o \
+ Python/errors.o \
+ Python/frame.o \
+ Python/frozenmain.o \
+ Python/future.o \
+ Python/getargs.o \
+ Python/getcompiler.o \
+ Python/getcopyright.o \
+ Python/getplatform.o \
+ Python/getversion.o \
+ Python/hamt.o \
+ Python/hashtable.o \
+ Python/import.o \
+ Python/importdl.o \
+ Python/initconfig.o \
+ Python/marshal.o \
+ Python/modsupport.o \
+ Python/mysnprintf.o \
+ Python/mystrtoul.o \
+ Python/pathconfig.o \
+ Python/preconfig.o \
+ Python/pyarena.o \
+ Python/pyctype.o \
+ Python/pyfpe.o \
+ Python/pyhash.o \
+ Python/pylifecycle.o \
+ Python/pymath.o \
+ Python/pystate.o \
+ Python/pythonrun.o \
+ Python/pytime.o \
+ Python/bootstrap_hash.o \
+ Python/specialize.o \
+ Python/structmember.o \
+ Python/symtable.o \
+ Python/sysmodule.o \
+ Python/thread.o \
+ Python/traceback.o \
+ Python/getopt.o \
+ Python/pystrcmp.o \
+ Python/pystrtod.o \
+ Python/pystrhex.o \
+ Python/dtoa.o \
+ Python/formatter_unicode.o \
+ Python/fileutils.o \
+ Python/suggestions.o \
+ Python/$(DYNLOADFILE) \
+ $(LIBOBJS) \
+ $(MACHDEP_OBJS) \
+ $(DTRACE_OBJS) \
+
+
+
+##########################################################################
+# Objects
+OBJECT_OBJS= \
+ Objects/abstract.o \
+ Objects/accu.o \
+ Objects/boolobject.o \
+ Objects/bytes_methods.o \
+ Objects/bytearrayobject.o \
+ Objects/bytesobject.o \
+ Objects/call.o \
+ Objects/capsule.o \
+ Objects/cellobject.o \
+ Objects/classobject.o \
+ Objects/codeobject.o \
+ Objects/complexobject.o \
+ Objects/descrobject.o \
+ Objects/enumobject.o \
+ Objects/exceptions.o \
+ Objects/genericaliasobject.o \
+ Objects/genobject.o \
+ Objects/fileobject.o \
+ Objects/floatobject.o \
+ Objects/frameobject.o \
+ Objects/funcobject.o \
+ Objects/interpreteridobject.o \
+ Objects/iterobject.o \
+ Objects/listobject.o \
+ Objects/longobject.o \
+ Objects/dictobject.o \
+ Objects/odictobject.o \
+ Objects/memoryobject.o \
+ Objects/methodobject.o \
+ Objects/moduleobject.o \
+ Objects/namespaceobject.o \
+ Objects/object.o \
+ Objects/obmalloc.o \
+ Objects/picklebufobject.o \
+ Objects/rangeobject.o \
+ Objects/setobject.o \
+ Objects/sliceobject.o \
+ Objects/structseq.o \
+ Objects/tupleobject.o \
+ Objects/typeobject.o \
+ Objects/unicodeobject.o \
+ Objects/unicodectype.o \
+ Objects/unionobject.o \
+ Objects/weakrefobject.o
+
+DEEPFREEZE_C = Python/deepfreeze/deepfreeze.c
+DEEPFREEZE_OBJS = Python/deepfreeze/deepfreeze.o
+
+##########################################################################
+# objects that get linked into the Python library
+LIBRARY_OBJS_OMIT_FROZEN= \
+ Modules/getbuildinfo.o \
+ $(PARSER_OBJS) \
+ $(OBJECT_OBJS) \
+ $(PYTHON_OBJS) \
+ $(MODULE_OBJS) \
+ $(MODOBJS)
+
+LIBRARY_OBJS= \
+ $(LIBRARY_OBJS_OMIT_FROZEN) \
+ $(DEEPFREEZE_OBJS) \
+ Modules/getpath.o \
+ Python/frozen.o
+
+LINK_PYTHON_OBJS=$(LIBRARY_OBJS)
+
+##########################################################################
+# DTrace
+
+# On some systems, object files that reference DTrace probes need to be modified
+# in-place by dtrace(1).
+DTRACE_DEPS = \
+ Python/ceval.o Python/import.o Python/sysmodule.o Modules/gcmodule.o
+
+##########################################################################
+# decimal's libmpdec
+
+LIBMPDEC_OBJS= \
+ Modules/_decimal/libmpdec/basearith.o \
+ Modules/_decimal/libmpdec/constants.o \
+ Modules/_decimal/libmpdec/context.o \
+ Modules/_decimal/libmpdec/convolute.o \
+ Modules/_decimal/libmpdec/crt.o \
+ Modules/_decimal/libmpdec/difradix2.o \
+ Modules/_decimal/libmpdec/fnt.o \
+ Modules/_decimal/libmpdec/fourstep.o \
+ Modules/_decimal/libmpdec/io.o \
+ Modules/_decimal/libmpdec/mpalloc.o \
+ Modules/_decimal/libmpdec/mpdecimal.o \
+ Modules/_decimal/libmpdec/numbertheory.o \
+ Modules/_decimal/libmpdec/sixstep.o \
+ Modules/_decimal/libmpdec/transpose.o
+ # _decimal does not use signaling API
+ # Modules/_decimal/libmpdec/mpsignal.o
+
+LIBMPDEC_HEADERS= \
+ $(srcdir)/Modules/_decimal/libmpdec/basearith.h \
+ $(srcdir)/Modules/_decimal/libmpdec/bits.h \
+ $(srcdir)/Modules/_decimal/libmpdec/constants.h \
+ $(srcdir)/Modules/_decimal/libmpdec/convolute.h \
+ $(srcdir)/Modules/_decimal/libmpdec/crt.h \
+ $(srcdir)/Modules/_decimal/libmpdec/difradix2.h \
+ $(srcdir)/Modules/_decimal/libmpdec/fnt.h \
+ $(srcdir)/Modules/_decimal/libmpdec/fourstep.h \
+ $(srcdir)/Modules/_decimal/libmpdec/io.h \
+ $(srcdir)/Modules/_decimal/libmpdec/mpalloc.h \
+ $(srcdir)/Modules/_decimal/libmpdec/mpdecimal.h \
+ $(srcdir)/Modules/_decimal/libmpdec/numbertheory.h \
+ $(srcdir)/Modules/_decimal/libmpdec/sixstep.h \
+ $(srcdir)/Modules/_decimal/libmpdec/transpose.h \
+ $(srcdir)/Modules/_decimal/libmpdec/typearith.h \
+ $(srcdir)/Modules/_decimal/libmpdec/umodarith.h
+
+##########################################################################
+# pyexpat's expat library
+
+LIBEXPAT_OBJS= \
+ Modules/expat/xmlparse.o \
+ Modules/expat/xmlrole.o \
+ Modules/expat/xmltok.o
+
+LIBEXPAT_HEADERS= \
+ Modules/expat/ascii.h \
+ Modules/expat/asciitab.h \
+ Modules/expat/expat.h \
+ Modules/expat/expat_config.h \
+ Modules/expat/expat_external.h \
+ Modules/expat/fallthrough.h \
+ Modules/expat/hash_table.h \
+ Modules/expat/iasciitab.h \
+ Modules/expat/internal.h \
+ Modules/expat/latin1tab.h \
+ Modules/expat/memory_sanitizer.h \
+ Modules/expat/nametab.h \
+ Modules/expat/pyexpatns.h \
+ Modules/expat/siphash.h \
+ Modules/expat/utf8tab.h \
+ Modules/expat/xcsinc.c \
+ Modules/expat/xmlrole.h \
+ Modules/expat/xmltok.h \
+ Modules/expat/xmltok_impl.h
+
+#########################################################################
+# Rules
+
+# Default target
+all: profile-opt
+build_all: check-clean-src $(BUILDPYTHON) platform oldsharedmods sharedmods \
+ gdbhooks Programs/_testembed python-config
+build_wasm: check-clean-src $(BUILDPYTHON) platform oldsharedmods python-config
+
+# Check that the source is clean when building out of source.
+check-clean-src:
+ @if test -n "$(VPATH)" -a \( \
+ -f "$(srcdir)/$(BUILDPYTHON)" \
+ -o -f "$(srcdir)/Programs/python.o" \
+ -o -f "$(srcdir)/Python/frozen_modules/importlib._bootstrap.h" \
+ \); then \
+ echo "Error: The source directory ($(srcdir)) is not clean" ; \
+ echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
+ echo "Build artifacts such as .o files, executables, and Python/frozen_modules/*.h must not exist within $(srcdir)." ; \
+ echo "Try to run:" ; \
+ echo " (cd \"$(srcdir)\" && make clean || git clean -fdx -e Doc/venv)" ; \
+ exit 1; \
+ fi
+
+# Profile generation build must start from a clean tree.
+profile-clean-stamp:
+ $(MAKE) clean
+ touch $@
+
+# Compile with profile generation enabled.
+profile-gen-stamp: profile-clean-stamp
+ @if [ $(LLVM_PROF_ERR) = yes ]; then \
+ echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\
+ echo "Please add it to PATH and run ./configure again" ;\
+ exit 1;\
+ fi
+ @echo "Building with support for profile generation:"
+ $(MAKE) build_all_generate_profile
+ touch $@
+
+# Run task with profile generation build to create profile information.
+profile-run-stamp:
+ @echo "Running code to generate profile data (this can take a while):"
+ # First, we need to create a clean build with profile generation
+ # enabled.
+ $(MAKE) profile-gen-stamp
+ # Next, run the profile task to generate the profile information.
+ $(MAKE) run_profile_task
+ $(MAKE) build_all_merge_profile
+ # Remove profile generation binary since we are done with it.
+ $(MAKE) clean-retain-profile
+ # This is an expensive target to build and it does not have proper
+ # makefile dependency information. So, we create a "stamp" file
+ # to record its completion and avoid re-running it.
+ touch $@
+
+build_all_generate_profile:
+ $(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
+
+run_profile_task:
+ @ # FIXME: can't run for a cross build
+ $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
+
+build_all_merge_profile:
+ $(LLVM_PROF_MERGER)
+
+# Compile Python binary with profile guided optimization.
+# To force re-running of the profile task, remove the profile-run-stamp file.
+profile-opt: profile-run-stamp
+ @echo "Rebuilding with profile guided optimizations:"
+ -rm -f profile-clean-stamp
+ $(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)"
+
+# Compile and run with gcov
+.PHONY=coverage coverage-lcov coverage-report
+coverage:
+ @echo "Building with support for coverage checking:"
+ $(MAKE) clean
+ $(MAKE) build_all CFLAGS="$(CFLAGS) -O0 -pg --coverage" LDFLAGS="$(LDFLAGS) --coverage"
+
+coverage-lcov:
+ @echo "Creating Coverage HTML report with LCOV:"
+ @rm -f $(COVERAGE_INFO)
+ @rm -rf $(COVERAGE_REPORT)
+ @lcov $(COVERAGE_LCOV_OPTIONS) --capture \
+ --directory $(abs_builddir) \
+ --base-directory $(realpath $(abs_builddir)) \
+ --path $(realpath $(abs_srcdir)) \
+ --output-file $(COVERAGE_INFO)
+ @ # remove 3rd party modules, system headers and internal files with
+ @ # debug, test or dummy functions.
+ @lcov $(COVERAGE_LCOV_OPTIONS) --remove $(COVERAGE_INFO) \
+ '*/Modules/_blake2/impl/*' \
+ '*/Modules/_ctypes/libffi*/*' \
+ '*/Modules/_decimal/libmpdec/*' \
+ '*/Modules/expat/*' \
+ '*/Modules/xx*.c' \
+ '*/Python/pyfpe.c' \
+ '*/Python/pystrcmp.c' \
+ '/usr/include/*' \
+ '/usr/local/include/*' \
+ '/usr/lib/gcc/*' \
+ --output-file $(COVERAGE_INFO)
+ @genhtml $(COVERAGE_INFO) \
+ --output-directory $(COVERAGE_REPORT) \
+ $(COVERAGE_REPORT_OPTIONS)
+ @echo
+ @echo "lcov report at $(COVERAGE_REPORT)/index.html"
+ @echo
+
+# Force regeneration of parser and frozen modules
+coverage-report: regen-token regen-frozen
+ @ # build with coverage info
+ $(MAKE) coverage
+ @ # run tests, ignore failures
+ $(TESTRUNNER) $(TESTOPTS) || true
+ @ # build lcov report
+ $(MAKE) coverage-lcov
+
+# Run "Argument Clinic" over all source files
+.PHONY=clinic
+clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
+
+# Build the interpreter
+$(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS)
+ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
+
+platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
+
+# Create build directory and generate the sysconfig build-time data there.
+# pybuilddir.txt contains the name of the build dir and is used for
+# sys.path fixup -- see Modules/getpath.c.
+# Since this step runs before shared modules are built, try to avoid bootstrap
+# problems by creating a dummy pybuilddir.txt just to allow interpreter
+# initialization to succeed. It will be overwritten by generate-posix-vars
+# or removed in case of failure.
+pybuilddir.txt: $(PYTHON_FOR_BUILD_DEPS)
+ @echo "none" > ./pybuilddir.txt
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
+ if test $$? -ne 0 ; then \
+ echo "generate-posix-vars failed" ; \
+ rm -f ./pybuilddir.txt ; \
+ exit 1 ; \
+ fi
+
+# blake2s is auto-generated from blake2b
+$(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Modules/_blake2/blake2b2s.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $@
+
+# Build the shared modules
+# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
+# -s, --silent or --quiet is always the first char.
+# Under BSD make, MAKEFLAGS might be " -s -v x=y".
+# Ignore macros passed by GNU make, passed after --
+sharedmods: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(LIBMPDEC_HEADERS) $(LIBMPDEC_A)
+ @case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \
+ *\ -s*|s*) quiet="-q";; \
+ *) quiet="";; \
+ esac; \
+ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+
+# Build static library
+$(LIBRARY): $(LIBRARY_OBJS)
+ -rm -f $@
+ $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
+
+libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
+ $(LN) -f $(INSTSONAME) $@; \
+ else \
+ $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
+ fi
+
+libpython3.so: libpython$(LDVERSION).so
+ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
+
+libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
+ $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
+
+
+libpython$(VERSION).sl: $(LIBRARY_OBJS)
+ $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM)
+
+# List of exported symbols for AIX
+Modules/python.exp: $(LIBRARY)
+ $(srcdir)/Modules/makexp_aix $@ "$(EXPORTSFROM)" $?
+
+# Copy up the gdb python hooks into a position where they can be automatically
+# loaded by gdb during Lib/test/test_gdb.py
+#
+# Distributors are likely to want to install this somewhere else e.g. relative
+# to the stripped DWARF data for the shared library.
+gdbhooks: $(BUILDPYTHON)-gdb.py
+
+SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
+$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
+ $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
+
+# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
+# minimal framework (not including the Lib directory and such) in the current
+# directory.
+RESSRCDIR=Mac/Resources/framework
+$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
+ $(LIBRARY) \
+ $(RESSRCDIR)/Info.plist
+ $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
+ $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
+ -all_load $(LIBRARY) -Wl,-single_module \
+ -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
+ -compatibility_version $(VERSION) \
+ -current_version $(VERSION) \
+ -framework CoreFoundation $(LIBS);
+ $(INSTALL) -d -m $(DIRMODE) \
+ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
+ $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
+ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
+ $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
+ $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
+ $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
+
+# This rule builds the Cygwin Python DLL and import library if configured
+# for a shared core library; otherwise, this rule is a noop.
+$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
+ if test -n "$(DLLLIBRARY)"; then \
+ $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
+ $(LIBS) $(MODLIBS) $(SYSLIBS); \
+ else true; \
+ fi
+
+# wasm32-emscripten browser build
+# wasm assets directory is relative to current build dir, e.g. "./usr/local".
+# --preload-file turns a relative asset path into an absolute path.
+
+.PHONY: wasm_stdlib
+wasm_stdlib: $(WASM_STDLIB)
+$(WASM_STDLIB): $(srcdir)/Lib/*.py $(srcdir)/Lib/*/*.py \
+ $(srcdir)/Tools/wasm/wasm_assets.py \
+ Makefile pybuilddir.txt Modules/Setup.local
+ $(PYTHON_FOR_BUILD) $(srcdir)/Tools/wasm/wasm_assets.py \
+ --buildroot . --prefix $(prefix)
+
+python.html: $(srcdir)/Tools/wasm/python.html python.worker.js
+ @cp $(srcdir)/Tools/wasm/python.html $@
+
+python.worker.js: $(srcdir)/Tools/wasm/python.worker.js
+ @cp $(srcdir)/Tools/wasm/python.worker.js $@
+
+##########################################################################
+# Build static libmpdec.a
+LIBMPDEC_CFLAGS=-I$(srcdir)/Modules/_decimal/libmpdec -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1 $(PY_STDMODULE_CFLAGS) $(CCSHARED)
+
+# for setup.py
+DECIMAL_CFLAGS=-I$(srcdir)/Modules/_decimal/libmpdec -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1
+DECIMAL_LDFLAGS=-lm $(LIBMPDEC_A)
+
+# "%.o: %c" is not portable
+Modules/_decimal/libmpdec/basearith.o: $(srcdir)/Modules/_decimal/libmpdec/basearith.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/basearith.c
+
+Modules/_decimal/libmpdec/constants.o: $(srcdir)/Modules/_decimal/libmpdec/constants.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/constants.c
+
+Modules/_decimal/libmpdec/context.o: $(srcdir)/Modules/_decimal/libmpdec/context.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/context.c
+
+Modules/_decimal/libmpdec/convolute.o: $(srcdir)/Modules/_decimal/libmpdec/convolute.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/convolute.c
+
+Modules/_decimal/libmpdec/crt.o: $(srcdir)/Modules/_decimal/libmpdec/crt.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/crt.c
+
+Modules/_decimal/libmpdec/difradix2.o: $(srcdir)/Modules/_decimal/libmpdec/difradix2.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/difradix2.c
+
+Modules/_decimal/libmpdec/fnt.o: $(srcdir)/Modules/_decimal/libmpdec/fnt.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/fnt.c
+
+Modules/_decimal/libmpdec/fourstep.o: $(srcdir)/Modules/_decimal/libmpdec/fourstep.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/fourstep.c
+
+Modules/_decimal/libmpdec/io.o: $(srcdir)/Modules/_decimal/libmpdec/io.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/io.c
+
+Modules/_decimal/libmpdec/mpalloc.o: $(srcdir)/Modules/_decimal/libmpdec/mpalloc.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/mpalloc.c
+
+Modules/_decimal/libmpdec/mpdecimal.o: $(srcdir)/Modules/_decimal/libmpdec/mpdecimal.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/mpdecimal.c
+
+Modules/_decimal/libmpdec/mpsignal.o: $(srcdir)/Modules/_decimal/libmpdec/mpsignal.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/mpsignal.c
+
+Modules/_decimal/libmpdec/numbertheory.o: $(srcdir)/Modules/_decimal/libmpdec/numbertheory.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/numbertheory.c
+
+Modules/_decimal/libmpdec/sixstep.o: $(srcdir)/Modules/_decimal/libmpdec/sixstep.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/sixstep.c
+
+Modules/_decimal/libmpdec/transpose.o: $(srcdir)/Modules/_decimal/libmpdec/transpose.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/transpose.c
+
+$(LIBMPDEC_A): $(LIBMPDEC_OBJS)
+ -rm -f $@
+ $(AR) $(ARFLAGS) $@ $(LIBMPDEC_OBJS)
+
+##########################################################################
+# Build static libexpat.a
+LIBEXPAT_CFLAGS= $(PY_STDMODULE_CFLAGS) $(CCSHARED)
+
+# for setup.py
+EXPAT_CFLAGS=
+EXPAT_LDFLAGS=-lexpat
+
+Modules/expat/xmlparse.o: $(srcdir)/Modules/expat/xmlparse.c $(LIBEXPAT_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBEXPAT_CFLAGS) -o $@ $(srcdir)/Modules/expat/xmlparse.c
+
+Modules/expat/xmlrole.o: $(srcdir)/Modules/expat/xmlrole.c $(LIBEXPAT_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBEXPAT_CFLAGS) -o $@ $(srcdir)/Modules/expat/xmlrole.c
+
+Modules/expat/xmltok.o: $(srcdir)/Modules/expat/xmltok.c $(LIBEXPAT_HEADERS) $(PYTHON_HEADERS)
+ $(CC) -c $(LIBEXPAT_CFLAGS) -o $@ $(srcdir)/Modules/expat/xmltok.c
+
+$(LIBEXPAT_A): $(LIBEXPAT_OBJS)
+ -rm -f $@
+ $(AR) $(ARFLAGS) $@ $(LIBEXPAT_OBJS)
+
+# create relative links from build/lib.platform/egg.so to Modules/egg.so
+# pybuilddir.txt is created too late. We cannot use it in Makefile
+# targets. ln --relative is not portable.
+oldsharedmods: $(SHAREDMODS) pybuilddir.txt
+ @target=`cat pybuilddir.txt`; \
+ $(MKDIR_P) $$target; \
+ for mod in X $(SHAREDMODS); do \
+ if test $$mod != X; then \
+ $(LN) -sf ../../$$mod $$target/`basename $$mod`; \
+ fi; \
+ done
+
+Modules/Setup.local:
+ @# Create empty Setup.local when file was deleted by user
+ echo "# Edit this file for local setup changes" > $@
+
+Modules/Setup.bootstrap: $(srcdir)/Modules/Setup.bootstrap.in config.status
+ ./config.status $@
+
+Modules/Setup.stdlib: $(srcdir)/Modules/Setup.stdlib.in config.status
+ ./config.status $@
+
+Makefile Modules/config.c: Makefile.pre \
+ $(srcdir)/Modules/config.c.in \
+ $(MAKESETUP) \
+ $(srcdir)/Modules/Setup \
+ Modules/Setup.local \
+ Modules/Setup.bootstrap \
+ Modules/Setup.stdlib
+ $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
+ -s Modules \
+ Modules/Setup.local \
+ \
+ Modules/Setup.bootstrap \
+ $(srcdir)/Modules/Setup
+ @mv config.c Modules
+ @echo "The Makefile was updated, you may need to re-run make."
+
+.PHONY: regen-test-frozenmain
+regen-test-frozenmain: $(BUILDPYTHON)
+ # Regenerate Programs/test_frozenmain.h
+ # from Programs/test_frozenmain.py
+ # using Programs/freeze_test_frozenmain.py
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Programs/freeze_test_frozenmain.py Programs/test_frozenmain.h
+
+.PHONY: regen-re
+regen-re: $(BUILDPYTHON)
+ # Regenerate Lib/re/_casefix.py
+ # using Tools/scripts/generate_re_casefix.py
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/generate_re_casefix.py $(srcdir)/Lib/re/_casefix.py
+
+Programs/_testembed: Programs/_testembed.o $(LINK_PYTHON_DEPS)
+ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
+
+############################################################################
+# "Bootstrap Python" used to run deepfreeze.py
+
+BOOTSTRAP_HEADERS = \
+ Python/frozen_modules/importlib._bootstrap.h \
+ Python/frozen_modules/importlib._bootstrap_external.h
+
+Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) $(PYTHON_HEADERS)
+
+_bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local
+ $(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ $(LIBRARY_OBJS_OMIT_FROZEN) \
+ Programs/_bootstrap_python.o Modules/getpath.o $(LIBS) $(MODLIBS) $(SYSLIBS)
+ # Dummy pybuilddir.txt is needed for _bootstrap_python to be runnable
+ @echo "none" > ./pybuilddir.txt
+
+
+############################################################################
+# frozen modules (including importlib)
+#
+# Freezing is a multi step process. It works differently for standard builds
+# and cross builds. Standard builds use Programs/_freeze_module and
+# _bootstrap_python for freezing and deepfreezing, so users can build Python
+# without an existing Python installation. Cross builds cannot execute
+# compiled binaries and therefore rely on an external build Python
+# interpreter. The build interpreter must have same version and same bytecode
+# as the host (target) binary.
+#
+# Standard build process:
+# 1) compile minimal core objects for Py_Compile*() and PyMarshal_Write*().
+# 2) build Programs/_freeze_module binary.
+# 3) create frozen module headers for importlib and getpath.
+# 4) build _bootstrap_python binary.
+# 5) create remaining frozen module headers with
+# ``./_bootstrap_python Programs/_freeze_module.py``. The pure Python
+# script is used to test the cross compile code path.
+# 6) deepfreeze modules with _bootstrap_python
+#
+# Cross compile process:
+# 1) create all frozen module headers with external build Python and
+# Programs/_freeze_module.py script.
+# 2) deepfreeze modules with external build Python.
+#
+
+# FROZEN_FILES_* are auto-generated by Tools/scripts/freeze_modules.py.
+FROZEN_FILES_IN = \
+ Lib/importlib/_bootstrap.py \
+ Lib/importlib/_bootstrap_external.py \
+ Lib/zipimport.py \
+ Lib/abc.py \
+ Lib/codecs.py \
+ Lib/io.py \
+ Lib/_collections_abc.py \
+ Lib/_sitebuiltins.py \
+ Lib/genericpath.py \
+ Lib/ntpath.py \
+ Lib/posixpath.py \
+ Lib/os.py \
+ Lib/site.py \
+ Lib/stat.py \
+ Lib/importlib/util.py \
+ Lib/importlib/machinery.py \
+ Lib/runpy.py \
+ Lib/__hello__.py \
+ Lib/__phello__/__init__.py \
+ Lib/__phello__/ham/__init__.py \
+ Lib/__phello__/ham/eggs.py \
+ Lib/__phello__/spam.py \
+ Tools/freeze/flag.py
+# End FROZEN_FILES_IN
+FROZEN_FILES_OUT = \
+ Python/frozen_modules/importlib._bootstrap.h \
+ Python/frozen_modules/importlib._bootstrap_external.h \
+ Python/frozen_modules/zipimport.h \
+ Python/frozen_modules/abc.h \
+ Python/frozen_modules/codecs.h \
+ Python/frozen_modules/io.h \
+ Python/frozen_modules/_collections_abc.h \
+ Python/frozen_modules/_sitebuiltins.h \
+ Python/frozen_modules/genericpath.h \
+ Python/frozen_modules/ntpath.h \
+ Python/frozen_modules/posixpath.h \
+ Python/frozen_modules/os.h \
+ Python/frozen_modules/site.h \
+ Python/frozen_modules/stat.h \
+ Python/frozen_modules/importlib.util.h \
+ Python/frozen_modules/importlib.machinery.h \
+ Python/frozen_modules/runpy.h \
+ Python/frozen_modules/__hello__.h \
+ Python/frozen_modules/__phello__.h \
+ Python/frozen_modules/__phello__.ham.h \
+ Python/frozen_modules/__phello__.ham.eggs.h \
+ Python/frozen_modules/__phello__.spam.h \
+ Python/frozen_modules/frozen_only.h
+# End FROZEN_FILES_OUT
+
+Programs/_freeze_module.o: Programs/_freeze_module.c Makefile
+
+Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile
+
+Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN)
+ $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
+
+# We manually freeze getpath.py rather than through freeze_modules
+Python/frozen_modules/getpath.h: Modules/getpath.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
+ $(FREEZE_MODULE_BOOTSTRAP) getpath $(srcdir)/Modules/getpath.py Python/frozen_modules/getpath.h
+
+# BEGIN: freezing modules
+
+Python/frozen_modules/importlib._bootstrap.h: Lib/importlib/_bootstrap.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
+ $(FREEZE_MODULE_BOOTSTRAP) importlib._bootstrap $(srcdir)/Lib/importlib/_bootstrap.py Python/frozen_modules/importlib._bootstrap.h
+
+Python/frozen_modules/importlib._bootstrap_external.h: Lib/importlib/_bootstrap_external.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
+ $(FREEZE_MODULE_BOOTSTRAP) importlib._bootstrap_external $(srcdir)/Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
+
+Python/frozen_modules/zipimport.h: Lib/zipimport.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
+ $(FREEZE_MODULE_BOOTSTRAP) zipimport $(srcdir)/Lib/zipimport.py Python/frozen_modules/zipimport.h
+
+Python/frozen_modules/abc.h: Lib/abc.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) abc $(srcdir)/Lib/abc.py Python/frozen_modules/abc.h
+
+Python/frozen_modules/codecs.h: Lib/codecs.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) codecs $(srcdir)/Lib/codecs.py Python/frozen_modules/codecs.h
+
+Python/frozen_modules/io.h: Lib/io.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) io $(srcdir)/Lib/io.py Python/frozen_modules/io.h
+
+Python/frozen_modules/_collections_abc.h: Lib/_collections_abc.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) _collections_abc $(srcdir)/Lib/_collections_abc.py Python/frozen_modules/_collections_abc.h
+
+Python/frozen_modules/_sitebuiltins.h: Lib/_sitebuiltins.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) _sitebuiltins $(srcdir)/Lib/_sitebuiltins.py Python/frozen_modules/_sitebuiltins.h
+
+Python/frozen_modules/genericpath.h: Lib/genericpath.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) genericpath $(srcdir)/Lib/genericpath.py Python/frozen_modules/genericpath.h
+
+Python/frozen_modules/ntpath.h: Lib/ntpath.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) ntpath $(srcdir)/Lib/ntpath.py Python/frozen_modules/ntpath.h
+
+Python/frozen_modules/posixpath.h: Lib/posixpath.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) posixpath $(srcdir)/Lib/posixpath.py Python/frozen_modules/posixpath.h
+
+Python/frozen_modules/os.h: Lib/os.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) os $(srcdir)/Lib/os.py Python/frozen_modules/os.h
+
+Python/frozen_modules/site.h: Lib/site.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) site $(srcdir)/Lib/site.py Python/frozen_modules/site.h
+
+Python/frozen_modules/stat.h: Lib/stat.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) stat $(srcdir)/Lib/stat.py Python/frozen_modules/stat.h
+
+Python/frozen_modules/importlib.util.h: Lib/importlib/util.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) importlib.util $(srcdir)/Lib/importlib/util.py Python/frozen_modules/importlib.util.h
+
+Python/frozen_modules/importlib.machinery.h: Lib/importlib/machinery.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) importlib.machinery $(srcdir)/Lib/importlib/machinery.py Python/frozen_modules/importlib.machinery.h
+
+Python/frozen_modules/runpy.h: Lib/runpy.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) runpy $(srcdir)/Lib/runpy.py Python/frozen_modules/runpy.h
+
+Python/frozen_modules/__hello__.h: Lib/__hello__.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) __hello__ $(srcdir)/Lib/__hello__.py Python/frozen_modules/__hello__.h
+
+Python/frozen_modules/__phello__.h: Lib/__phello__/__init__.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) __phello__ $(srcdir)/Lib/__phello__/__init__.py Python/frozen_modules/__phello__.h
+
+Python/frozen_modules/__phello__.ham.h: Lib/__phello__/ham/__init__.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) __phello__.ham $(srcdir)/Lib/__phello__/ham/__init__.py Python/frozen_modules/__phello__.ham.h
+
+Python/frozen_modules/__phello__.ham.eggs.h: Lib/__phello__/ham/eggs.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) __phello__.ham.eggs $(srcdir)/Lib/__phello__/ham/eggs.py Python/frozen_modules/__phello__.ham.eggs.h
+
+Python/frozen_modules/__phello__.spam.h: Lib/__phello__/spam.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) __phello__.spam $(srcdir)/Lib/__phello__/spam.py Python/frozen_modules/__phello__.spam.h
+
+Python/frozen_modules/frozen_only.h: Tools/freeze/flag.py $(FREEZE_MODULE_DEPS)
+ $(FREEZE_MODULE) frozen_only $(srcdir)/Tools/freeze/flag.py Python/frozen_modules/frozen_only.h
+
+# END: freezing modules
+
+Tools/scripts/freeze_modules.py: $(FREEZE_MODULE)
+
+.PHONY: regen-frozen
+regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES_IN)
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/freeze_modules.py
+ @echo "The Makefile was updated, you may need to re-run make."
+
+############################################################################
+# Deepfreeze targets
+
+.PHONY: regen-deepfreeze
+regen-deepfreeze: $(DEEPFREEZE_C)
+
+DEEPFREEZE_DEPS=$(srcdir)/Tools/scripts/deepfreeze.py $(FREEZE_MODULE_DEPS) $(FROZEN_FILES_OUT)
+
+# BEGIN: deepfreeze modules
+$(DEEPFREEZE_C): $(DEEPFREEZE_DEPS)
+ $(PYTHON_FOR_FREEZE) $(srcdir)/Tools/scripts/deepfreeze.py \
+ Python/frozen_modules/importlib._bootstrap.h:importlib._bootstrap \
+ Python/frozen_modules/importlib._bootstrap_external.h:importlib._bootstrap_external \
+ Python/frozen_modules/zipimport.h:zipimport \
+ Python/frozen_modules/abc.h:abc \
+ Python/frozen_modules/codecs.h:codecs \
+ Python/frozen_modules/io.h:io \
+ Python/frozen_modules/_collections_abc.h:_collections_abc \
+ Python/frozen_modules/_sitebuiltins.h:_sitebuiltins \
+ Python/frozen_modules/genericpath.h:genericpath \
+ Python/frozen_modules/ntpath.h:ntpath \
+ Python/frozen_modules/posixpath.h:posixpath \
+ Python/frozen_modules/os.h:os \
+ Python/frozen_modules/site.h:site \
+ Python/frozen_modules/stat.h:stat \
+ Python/frozen_modules/importlib.util.h:importlib.util \
+ Python/frozen_modules/importlib.machinery.h:importlib.machinery \
+ Python/frozen_modules/runpy.h:runpy \
+ Python/frozen_modules/__hello__.h:__hello__ \
+ Python/frozen_modules/__phello__.h:__phello__ \
+ Python/frozen_modules/__phello__.ham.h:__phello__.ham \
+ Python/frozen_modules/__phello__.ham.eggs.h:__phello__.ham.eggs \
+ Python/frozen_modules/__phello__.spam.h:__phello__.spam \
+ Python/frozen_modules/frozen_only.h:frozen_only \
+ -o Python/deepfreeze/deepfreeze.c
+# END: deepfreeze modules
+
+# We keep this renamed target around for folks with muscle memory.
+.PHONY: regen-importlib
+regen-importlib: regen-frozen
+
+############################################################################
+# Global objects
+
+# Dependencies which can add and/or remove _Py_ID() identifiers:
+# - deepfreeze.c
+# - "make clinic"
+.PHONY: regen-global-objects
+regen-global-objects: $(srcdir)/Tools/scripts/generate_global_objects.py $(DEEPFREEZE_C) clinic
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_global_objects.py
+
+############################################################################
+# ABI
+
+regen-abidump: all
+ @$(MKDIR_P) $(srcdir)/Doc/data/
+ abidw "libpython$(LDVERSION).so" --no-architecture --out-file $(srcdir)/Doc/data/python$(LDVERSION).abi.new
+ @$(UPDATE_FILE) $(srcdir)/Doc/data/python$(LDVERSION).abi $(srcdir)/Doc/data/python$(LDVERSION).abi.new
+
+check-abidump: all
+ abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi "libpython$(LDVERSION).so" --drop-private-types --no-architecture --no-added-syms
+
+regen-limited-abi: all
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --generate-all $(srcdir)/Misc/stable_abi.toml
+
+############################################################################
+# Regenerate all generated files
+
+# "clinic" is regenerated implicitly via "regen-global-objects".
+.PHONY: regen-all
+regen-all: regen-opcode regen-opcode-targets regen-typeslots \
+ regen-token regen-ast regen-keyword regen-sre regen-frozen \
+ regen-pegen-metaparser regen-pegen regen-test-frozenmain \
+ regen-global-objects
+ @echo
+ @echo "Note: make regen-stdlib-module-names and make regen-configure should be run manually"
+
+############################################################################
+# Special rules for object files
+
+Modules/getbuildinfo.o: $(PARSER_OBJS) \
+ $(OBJECT_OBJS) \
+ $(PYTHON_OBJS) \
+ $(MODULE_OBJS) \
+ $(MODOBJS) \
+ $(DTRACE_OBJS) \
+ $(srcdir)/Modules/getbuildinfo.c
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
+ -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
+ -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
+ -o $@ $(srcdir)/Modules/getbuildinfo.c
+
+Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS)
+ $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
+ -DPREFIX='"$(prefix)"' \
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
+ -DPLATLIBDIR='"$(PLATLIBDIR)"' \
+ -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+Programs/python.o: $(srcdir)/Programs/python.c
+ $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c
+
+Programs/_testembed.o: $(srcdir)/Programs/_testembed.c Programs/test_frozenmain.h
+ $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
+
+Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h
+
+Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
+
+Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
+
+Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
+
+Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h
+
+Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DSOABI='"$(SOABI)"' \
+ -o $@ $(srcdir)/Python/dynload_shlib.c
+
+Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DSHLIB_EXT='"$(EXT_SUFFIX)"' \
+ -o $@ $(srcdir)/Python/dynload_hpux.c
+
+Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DABIFLAGS='"$(ABIFLAGS)"' \
+ $(MULTIARCH_CPPFLAGS) \
+ -o $@ $(srcdir)/Python/sysmodule.c
+
+$(IO_OBJS): $(IO_H)
+
+.PHONY: regen-pegen-metaparser
+regen-pegen-metaparser:
+ @$(MKDIR_P) $(srcdir)/Tools/peg_generator/pegen
+ PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q python \
+ $(srcdir)/Tools/peg_generator/pegen/metagrammar.gram \
+ -o $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
+ $(UPDATE_FILE) $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py \
+ $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
+
+.PHONY: regen-pegen
+regen-pegen:
+ @$(MKDIR_P) $(srcdir)/Parser
+ PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \
+ $(srcdir)/Grammar/python.gram \
+ $(srcdir)/Grammar/Tokens \
+ -o $(srcdir)/Parser/parser.c.new
+ $(UPDATE_FILE) $(srcdir)/Parser/parser.c $(srcdir)/Parser/parser.c.new
+
+.PHONY=regen-ast
+regen-ast:
+ # Regenerate 3 files using using Parser/asdl_c.py:
+ # - Include/internal/pycore_ast.h
+ # - Include/internal/pycore_ast_state.h
+ # - Python/Python-ast.c
+ $(MKDIR_P) $(srcdir)/Include
+ $(MKDIR_P) $(srcdir)/Python
+ $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
+ $(srcdir)/Parser/Python.asdl \
+ -H $(srcdir)/Include/internal/pycore_ast.h.new \
+ -I $(srcdir)/Include/internal/pycore_ast_state.h.new \
+ -C $(srcdir)/Python/Python-ast.c.new
+
+ $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new
+ $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
+
+.PHONY: regen-opcode
+regen-opcode:
+ # Regenerate Include/opcode.h from Lib/opcode.py
+ # using Tools/scripts/generate_opcode_h.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_opcode_h.py \
+ $(srcdir)/Lib/opcode.py \
+ $(srcdir)/Include/opcode.h.new \
+ $(srcdir)/Include/internal/pycore_opcode.h.new
+ $(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new
+ $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode.h $(srcdir)/Include/internal/pycore_opcode.h.new
+
+.PHONY: regen-token
+regen-token:
+ # Regenerate Doc/library/token-list.inc from Grammar/Tokens
+ # using Tools/scripts/generate_token.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py rst \
+ $(srcdir)/Grammar/Tokens \
+ $(srcdir)/Doc/library/token-list.inc
+ # Regenerate Include/token.h from Grammar/Tokens
+ # using Tools/scripts/generate_token.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py h \
+ $(srcdir)/Grammar/Tokens \
+ $(srcdir)/Include/token.h
+ # Regenerate Parser/token.c from Grammar/Tokens
+ # using Tools/scripts/generate_token.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py c \
+ $(srcdir)/Grammar/Tokens \
+ $(srcdir)/Parser/token.c
+ # Regenerate Lib/token.py from Grammar/Tokens
+ # using Tools/scripts/generate_token.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py py \
+ $(srcdir)/Grammar/Tokens \
+ $(srcdir)/Lib/token.py
+
+.PHONY: regen-keyword
+regen-keyword:
+ # Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens
+ # using Tools/peg_generator/pegen
+ PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen.keywordgen \
+ $(srcdir)/Grammar/python.gram \
+ $(srcdir)/Grammar/Tokens \
+ $(srcdir)/Lib/keyword.py.new
+ $(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new
+
+.PHONY: regen-stdlib-module-names
+regen-stdlib-module-names: all Programs/_testembed
+ # Regenerate Python/stdlib_module_names.h
+ # using Tools/scripts/generate_stdlib_module_names.py
+ $(RUNSHARED) ./$(BUILDPYTHON) \
+ $(srcdir)/Tools/scripts/generate_stdlib_module_names.py \
+ > $(srcdir)/Python/stdlib_module_names.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new
+
+regen-sre:
+ # Regenerate Modules/_sre/sre_constants.h and Modules/_sre/sre_targets.h
+ # from Lib/re/_constants.py using Tools/scripts/generate_sre_constants.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_sre_constants.py \
+ $(srcdir)/Lib/re/_constants.py \
+ $(srcdir)/Modules/_sre/sre_constants.h \
+ $(srcdir)/Modules/_sre/sre_targets.h
+
+Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h
+
+Python/getplatform.o: $(srcdir)/Python/getplatform.c
+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
+
+Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+
+Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
+ $(srcdir)/Objects/unicodetype_db.h
+
+BYTESTR_DEPS = \
+ $(srcdir)/Objects/stringlib/count.h \
+ $(srcdir)/Objects/stringlib/ctype.h \
+ $(srcdir)/Objects/stringlib/fastsearch.h \
+ $(srcdir)/Objects/stringlib/find.h \
+ $(srcdir)/Objects/stringlib/join.h \
+ $(srcdir)/Objects/stringlib/partition.h \
+ $(srcdir)/Objects/stringlib/split.h \
+ $(srcdir)/Objects/stringlib/stringdefs.h \
+ $(srcdir)/Objects/stringlib/transmogrify.h
+
+UNICODE_DEPS = \
+ $(srcdir)/Objects/stringlib/asciilib.h \
+ $(srcdir)/Objects/stringlib/codecs.h \
+ $(srcdir)/Objects/stringlib/count.h \
+ $(srcdir)/Objects/stringlib/fastsearch.h \
+ $(srcdir)/Objects/stringlib/find.h \
+ $(srcdir)/Objects/stringlib/find_max_char.h \
+ $(srcdir)/Objects/stringlib/localeutil.h \
+ $(srcdir)/Objects/stringlib/partition.h \
+ $(srcdir)/Objects/stringlib/replace.h \
+ $(srcdir)/Objects/stringlib/split.h \
+ $(srcdir)/Objects/stringlib/ucs1lib.h \
+ $(srcdir)/Objects/stringlib/ucs2lib.h \
+ $(srcdir)/Objects/stringlib/ucs4lib.h \
+ $(srcdir)/Objects/stringlib/undef.h \
+ $(srcdir)/Objects/stringlib/unicode_format.h \
+ $(srcdir)/Objects/stringlib/unicodedefs.h
+
+Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS)
+Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
+Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)
+
+Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)
+
+Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h
+Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
+
+.PHONY: regen-opcode-targets
+regen-opcode-targets:
+ # Regenerate Python/opcode_targets.h from Lib/opcode.py
+ # using Python/makeopcodetargets.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
+ $(srcdir)/Python/opcode_targets.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
+
+Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
+ $(srcdir)/Python/condvar.h
+
+Python/frozen.o: $(FROZEN_FILES_OUT)
+
+# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to
+# follow our naming conventions. dtrace(1) uses the output filename to generate
+# an include guard, so we can't use a pipeline to transform its output.
+Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
+ $(MKDIR_P) Include
+ $(DTRACE) $(DFLAGS) -o $@ -h -s $<
+ : sed in-place edit with POSIX-only tools
+ sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
+ mv $@.tmp $@
+
+Python/ceval.o: $(srcdir)/Include/pydtrace.h
+Python/import.o: $(srcdir)/Include/pydtrace.h
+Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h
+
+Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
+ $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
+
+Objects/typeobject.o: Objects/typeslots.inc
+
+.PHONY: regen-typeslots
+regen-typeslots:
+ # Regenerate Objects/typeslots.inc from Include/typeslotsh
+ # using Objects/typeslots.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \
+ < $(srcdir)/Include/typeslots.h \
+ $(srcdir)/Objects/typeslots.inc.new
+ $(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new
+
+############################################################################
+# Header files
+
+PYTHON_HEADERS= \
+ $(srcdir)/Include/Python.h \
+ $(srcdir)/Include/abstract.h \
+ $(srcdir)/Include/bltinmodule.h \
+ $(srcdir)/Include/boolobject.h \
+ $(srcdir)/Include/bytearrayobject.h \
+ $(srcdir)/Include/bytesobject.h \
+ $(srcdir)/Include/ceval.h \
+ $(srcdir)/Include/codecs.h \
+ $(srcdir)/Include/compile.h \
+ $(srcdir)/Include/complexobject.h \
+ $(srcdir)/Include/descrobject.h \
+ $(srcdir)/Include/dictobject.h \
+ $(srcdir)/Include/dynamic_annotations.h \
+ $(srcdir)/Include/enumobject.h \
+ $(srcdir)/Include/errcode.h \
+ $(srcdir)/Include/fileobject.h \
+ $(srcdir)/Include/fileutils.h \
+ $(srcdir)/Include/floatobject.h \
+ $(srcdir)/Include/frameobject.h \
+ $(srcdir)/Include/import.h \
+ $(srcdir)/Include/intrcheck.h \
+ $(srcdir)/Include/iterobject.h \
+ $(srcdir)/Include/listobject.h \
+ $(srcdir)/Include/longobject.h \
+ $(srcdir)/Include/marshal.h \
+ $(srcdir)/Include/memoryobject.h \
+ $(srcdir)/Include/methodobject.h \
+ $(srcdir)/Include/modsupport.h \
+ $(srcdir)/Include/moduleobject.h \
+ $(srcdir)/Include/object.h \
+ $(srcdir)/Include/objimpl.h \
+ $(srcdir)/Include/opcode.h \
+ $(srcdir)/Include/osdefs.h \
+ $(srcdir)/Include/osmodule.h \
+ $(srcdir)/Include/patchlevel.h \
+ $(srcdir)/Include/pybuffer.h \
+ $(srcdir)/Include/pycapsule.h \
+ $(srcdir)/Include/pydtrace.h \
+ $(srcdir)/Include/pyerrors.h \
+ $(srcdir)/Include/pyframe.h \
+ $(srcdir)/Include/pyhash.h \
+ $(srcdir)/Include/pylifecycle.h \
+ $(srcdir)/Include/pymacconfig.h \
+ $(srcdir)/Include/pymacro.h \
+ $(srcdir)/Include/pymath.h \
+ $(srcdir)/Include/pymem.h \
+ $(srcdir)/Include/pyport.h \
+ $(srcdir)/Include/pystate.h \
+ $(srcdir)/Include/pystrcmp.h \
+ $(srcdir)/Include/pystrtod.h \
+ $(srcdir)/Include/pythonrun.h \
+ $(srcdir)/Include/pythread.h \
+ $(srcdir)/Include/pytypedefs.h \
+ $(srcdir)/Include/rangeobject.h \
+ $(srcdir)/Include/setobject.h \
+ $(srcdir)/Include/sliceobject.h \
+ $(srcdir)/Include/structmember.h \
+ $(srcdir)/Include/structseq.h \
+ $(srcdir)/Include/sysmodule.h \
+ $(srcdir)/Include/token.h \
+ $(srcdir)/Include/traceback.h \
+ $(srcdir)/Include/tracemalloc.h \
+ $(srcdir)/Include/tupleobject.h \
+ $(srcdir)/Include/unicodeobject.h \
+ $(srcdir)/Include/warnings.h \
+ $(srcdir)/Include/weakrefobject.h \
+ \
+ pyconfig.h \
+ $(PARSER_HEADERS) \
+ \
+ $(srcdir)/Include/cpython/abstract.h \
+ $(srcdir)/Include/cpython/bytearrayobject.h \
+ $(srcdir)/Include/cpython/bytesobject.h \
+ $(srcdir)/Include/cpython/cellobject.h \
+ $(srcdir)/Include/cpython/ceval.h \
+ $(srcdir)/Include/cpython/classobject.h \
+ $(srcdir)/Include/cpython/code.h \
+ $(srcdir)/Include/cpython/compile.h \
+ $(srcdir)/Include/cpython/complexobject.h \
+ $(srcdir)/Include/cpython/context.h \
+ $(srcdir)/Include/cpython/descrobject.h \
+ $(srcdir)/Include/cpython/dictobject.h \
+ $(srcdir)/Include/cpython/fileobject.h \
+ $(srcdir)/Include/cpython/fileutils.h \
+ $(srcdir)/Include/cpython/floatobject.h \
+ $(srcdir)/Include/cpython/frameobject.h \
+ $(srcdir)/Include/cpython/funcobject.h \
+ $(srcdir)/Include/cpython/genobject.h \
+ $(srcdir)/Include/cpython/import.h \
+ $(srcdir)/Include/cpython/initconfig.h \
+ $(srcdir)/Include/cpython/listobject.h \
+ $(srcdir)/Include/cpython/longintrepr.h \
+ $(srcdir)/Include/cpython/longobject.h \
+ $(srcdir)/Include/cpython/methodobject.h \
+ $(srcdir)/Include/cpython/modsupport.h \
+ $(srcdir)/Include/cpython/object.h \
+ $(srcdir)/Include/cpython/objimpl.h \
+ $(srcdir)/Include/cpython/odictobject.h \
+ $(srcdir)/Include/cpython/picklebufobject.h \
+ $(srcdir)/Include/cpython/pthread_stubs.h \
+ $(srcdir)/Include/cpython/pyctype.h \
+ $(srcdir)/Include/cpython/pydebug.h \
+ $(srcdir)/Include/cpython/pyerrors.h \
+ $(srcdir)/Include/cpython/pyfpe.h \
+ $(srcdir)/Include/cpython/pyframe.h \
+ $(srcdir)/Include/cpython/pylifecycle.h \
+ $(srcdir)/Include/cpython/pymem.h \
+ $(srcdir)/Include/cpython/pystate.h \
+ $(srcdir)/Include/cpython/pythonrun.h \
+ $(srcdir)/Include/cpython/pythread.h \
+ $(srcdir)/Include/cpython/pytime.h \
+ $(srcdir)/Include/cpython/setobject.h \
+ $(srcdir)/Include/cpython/sysmodule.h \
+ $(srcdir)/Include/cpython/traceback.h \
+ $(srcdir)/Include/cpython/tupleobject.h \
+ $(srcdir)/Include/cpython/unicodeobject.h \
+ $(srcdir)/Include/cpython/warnings.h \
+ $(srcdir)/Include/cpython/weakrefobject.h \
+ \
+ $(srcdir)/Include/internal/pycore_abstract.h \
+ $(srcdir)/Include/internal/pycore_accu.h \
+ $(srcdir)/Include/internal/pycore_asdl.h \
+ $(srcdir)/Include/internal/pycore_ast.h \
+ $(srcdir)/Include/internal/pycore_ast_state.h \
+ $(srcdir)/Include/internal/pycore_atomic.h \
+ $(srcdir)/Include/internal/pycore_atomic_funcs.h \
+ $(srcdir)/Include/internal/pycore_bitutils.h \
+ $(srcdir)/Include/internal/pycore_bytes_methods.h \
+ $(srcdir)/Include/internal/pycore_bytesobject.h \
+ $(srcdir)/Include/internal/pycore_call.h \
+ $(srcdir)/Include/internal/pycore_ceval.h \
+ $(srcdir)/Include/internal/pycore_code.h \
+ $(srcdir)/Include/internal/pycore_compile.h \
+ $(srcdir)/Include/internal/pycore_condvar.h \
+ $(srcdir)/Include/internal/pycore_context.h \
+ $(srcdir)/Include/internal/pycore_dict.h \
+ $(srcdir)/Include/internal/pycore_dtoa.h \
+ $(srcdir)/Include/internal/pycore_exceptions.h \
+ $(srcdir)/Include/internal/pycore_fileutils.h \
+ $(srcdir)/Include/internal/pycore_floatobject.h \
+ $(srcdir)/Include/internal/pycore_format.h \
+ $(srcdir)/Include/internal/pycore_function.h \
+ $(srcdir)/Include/internal/pycore_genobject.h \
+ $(srcdir)/Include/internal/pycore_getopt.h \
+ $(srcdir)/Include/internal/pycore_gil.h \
+ $(srcdir)/Include/internal/pycore_global_objects.h \
+ $(srcdir)/Include/internal/pycore_hamt.h \
+ $(srcdir)/Include/internal/pycore_hashtable.h \
+ $(srcdir)/Include/internal/pycore_import.h \
+ $(srcdir)/Include/internal/pycore_initconfig.h \
+ $(srcdir)/Include/internal/pycore_interp.h \
+ $(srcdir)/Include/internal/pycore_interpreteridobject.h \
+ $(srcdir)/Include/internal/pycore_list.h \
+ $(srcdir)/Include/internal/pycore_long.h \
+ $(srcdir)/Include/internal/pycore_moduleobject.h \
+ $(srcdir)/Include/internal/pycore_namespace.h \
+ $(srcdir)/Include/internal/pycore_object.h \
+ $(srcdir)/Include/internal/pycore_pathconfig.h \
+ $(srcdir)/Include/internal/pycore_pyarena.h \
+ $(srcdir)/Include/internal/pycore_pyerrors.h \
+ $(srcdir)/Include/internal/pycore_pyhash.h \
+ $(srcdir)/Include/internal/pycore_pylifecycle.h \
+ $(srcdir)/Include/internal/pycore_pymem.h \
+ $(srcdir)/Include/internal/pycore_pystate.h \
+ $(srcdir)/Include/internal/pycore_runtime.h \
+ $(srcdir)/Include/internal/pycore_runtime_init.h \
+ $(srcdir)/Include/internal/pycore_signal.h \
+ $(srcdir)/Include/internal/pycore_sliceobject.h \
+ $(srcdir)/Include/internal/pycore_strhex.h \
+ $(srcdir)/Include/internal/pycore_structseq.h \
+ $(srcdir)/Include/internal/pycore_symtable.h \
+ $(srcdir)/Include/internal/pycore_sysmodule.h \
+ $(srcdir)/Include/internal/pycore_traceback.h \
+ $(srcdir)/Include/internal/pycore_tuple.h \
+ $(srcdir)/Include/internal/pycore_typeobject.h \
+ $(srcdir)/Include/internal/pycore_ucnhash.h \
+ $(srcdir)/Include/internal/pycore_unionobject.h \
+ $(srcdir)/Include/internal/pycore_unicodeobject.h \
+ $(srcdir)/Include/internal/pycore_warnings.h \
+ $(DTRACE_HEADERS) \
+ \
+ \
+ $(srcdir)/Python/stdlib_module_names.h
+
+$(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
+
+
+######################################################################
+
+TESTOPTS= $(EXTRATESTOPTS)
+TESTPYTHON= $(RUNSHARED) $(PYTHON_FOR_BUILD) $(TESTPYTHONOPTS)
+TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
+TESTTIMEOUT= 1200
+
+.PHONY: test testall testuniversal buildbottest pythoninfo
+
+# Remove "test_python_*" directories of previous failed test jobs.
+# Pass TESTOPTS options because it can contain --tempdir option.
+cleantest: all
+ $(TESTRUNNER) $(TESTOPTS) --cleanup
+
+# Run a basic set of regression tests.
+# This excludes some tests that are particularly resource-intensive.
+test: all
+ $(TESTRUNNER) $(TESTOPTS)
+
+# Run the full test suite twice - once without .pyc files, and once with.
+# In the past, we've had problems where bugs in the marshalling or
+# elsewhere caused bytecode read from .pyc files to behave differently
+# than bytecode generated directly from a .py source file. Sometimes
+# the bytecode read from a .pyc file had the bug, sometimes the directly
+# generated bytecode. This is sometimes a very shy bug needing a lot of
+# sample data.
+testall: all
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ $(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ -$(TESTRUNNER) -u all $(TESTOPTS)
+ $(TESTRUNNER) -u all $(TESTOPTS)
+
+# Run the test suite for both architectures in a Universal build on OSX.
+# Must be run on an Intel box.
+testuniversal: all
+ @if [ `arch` != 'i386' ]; then \
+ echo "This can only be used on OSX/i386" ;\
+ exit 1 ;\
+ fi
+ $(TESTRUNNER) -u all $(TESTOPTS)
+ $(RUNSHARED) /usr/libexec/oah/translate \
+ ./$(BUILDPYTHON) -E -m test -j 0 -u all $(TESTOPTS)
+
+# Like testall, but with only one pass and without multiple processes.
+# Run an optional script to include information about the build environment.
+buildbottest: all
+ -@if which pybuildbot.identify >/dev/null 2>&1; then \
+ pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
+ fi
+ $(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS)
+
+# Like testall, but run Python tests with HOSTRUNNER directly.
+hostrunnertest: all
+ $(RUNSHARED) $(HOSTRUNNER) ./$(BUILDPYTHON) -m test -u all $(TESTOPTS)
+
+pythoninfo: all
+ $(RUNSHARED) $(HOSTRUNNER) ./$(BUILDPYTHON) -m test.pythoninfo
+
+QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
+ test_multibytecodec test_urllib2_localnet test_itertools \
+ test_multiprocessing_fork test_multiprocessing_spawn \
+ test_multiprocessing_forkserver \
+ test_mailbox test_nntplib test_socket test_poll \
+ test_select test_zipfile test_concurrent_futures
+quicktest: all
+ $(TESTRUNNER) $(QUICKTESTOPTS)
+
+# SSL tests
+.PHONY: multisslcompile multissltest
+multisslcompile: all
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py --steps=modules
+
+multissltest: all
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py
+
+# All install targets use the "all" target as synchronization point to
+# prevent race conditions with PGO builds. PGO builds use recursive make,
+# which can lead to two parallel `./python setup.py build` processes that
+# step on each others toes.
+install: commoninstall bininstall maninstall
+ if test "x$(ENSUREPIP)" != "xno" ; then \
+ case $(ENSUREPIP) in \
+ upgrade) ensurepip="--upgrade" ;; \
+ install|*) ensurepip="" ;; \
+ esac; \
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+altinstall: commoninstall
+ if test "x$(ENSUREPIP)" != "xno" ; then \
+ case $(ENSUREPIP) in \
+ upgrade) ensurepip="--altinstall --upgrade" ;; \
+ install|*) ensurepip="--altinstall" ;; \
+ esac; \
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+commoninstall: check-clean-src \
+ altbininstall libinstall inclinstall libainstall \
+ sharedinstall oldsharedinstall altmaninstall
+
+# Install shared libraries enabled by Setup
+DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
+
+oldsharedinstall: $(DESTSHARED) all
+ @for i in X $(SHAREDMODS); do \
+ if test $$i != X; then \
+ echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
+ $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
+ fi; \
+ done
+
+$(DESTSHARED):
+ @for i in $(DESTDIRS); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+
+# Install the interpreter with $(VERSION) affixed
+# This goes into $(exec_prefix)
+altbininstall: $(BUILDPYTHON)
+ @for i in $(BINDIR) $(LIBDIR); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+ if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
+ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+ else \
+ $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+ fi
+ -if test "$(VERSION)" != "$(LDVERSION)"; then \
+ if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
+ then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
+ fi; \
+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
+ fi
+ @if test "$(PY_ENABLE_SHARED)" = 1 -o "$(STATIC_LIBPYTHON)" = 1; then \
+ if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
+ if test -n "$(DLLLIBRARY)" ; then \
+ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+ else \
+ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
+ if test $(LDLIBRARY) != $(INSTSONAME); then \
+ (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
+ fi \
+ fi; \
+ if test -n "$(PY3LIBRARY)"; then \
+ $(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
+ fi; \
+ else true; \
+ fi; \
+ fi
+ if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
+ rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE); \
+ lipo $(LIPO_32BIT_FLAGS) \
+ -output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
+ $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
+ fi
+ if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
+ rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE); \
+ lipo $(LIPO_INTEL64_FLAGS) \
+ -output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \
+ $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
+ fi
+
+# We depend on commoninstall here to make sure the installation is already usable
+# before we possibly overwrite the global 'python3' symlink to avoid causing
+# problems for anything else trying to run 'python3' while we install, particularly
+# if we're installing in parallel with -j.
+bininstall: commoninstall altbininstall
+ if test ! -d $(DESTDIR)$(LIBPC); then \
+ echo "Creating directory $(LIBPC)"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \
+ fi
+ -if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
+ then rm -f $(DESTDIR)$(BINDIR)/python3$(EXE); \
+ else true; \
+ fi
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE))
+ -if test "$(VERSION)" != "$(LDVERSION)"; then \
+ rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \
+ rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \
+ rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \
+ fi
+ -rm -f $(DESTDIR)$(BINDIR)/python3-config
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
+ -rm -f $(DESTDIR)$(LIBPC)/python3.pc
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
+ -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
+ -rm -f $(DESTDIR)$(BINDIR)/idle3
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
+ -rm -f $(DESTDIR)$(BINDIR)/pydoc3
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
+ -rm -f $(DESTDIR)$(BINDIR)/2to3
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
+ if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
+ rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
+ fi
+ if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
+ rm -f $(DESTDIR)$(BINDIR)/python3-intel64$(EXE); \
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-intel64$(EXE) python3-intel64$(EXE)) \
+ fi
+
+# Install the versioned manual page
+altmaninstall:
+ @for i in $(MANDIR) $(MANDIR)/man1; \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+ $(INSTALL_DATA) $(srcdir)/Misc/python.man \
+ $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
+
+# Install the unversioned manual page
+maninstall: altmaninstall
+ -rm -f $(DESTDIR)$(MANDIR)/man1/python3.1
+ (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1)
+
+# Install the library
+XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
+LIBSUBDIRS= asyncio \
+ collections \
+ concurrent concurrent/futures \
+ csv \
+ ctypes ctypes/macholib \
+ curses \
+ dbm \
+ distutils distutils/command \
+ email email/mime \
+ encodings \
+ ensurepip ensurepip/_bundled \
+ html \
+ http \
+ idlelib idlelib/Icons \
+ importlib importlib/resources importlib/metadata \
+ json \
+ lib2to3 lib2to3/fixes lib2to3/pgen2 \
+ logging \
+ multiprocessing multiprocessing/dummy \
+ pydoc_data \
+ re \
+ site-packages \
+ sqlite3 \
+ tkinter \
+ tomllib \
+ turtledemo \
+ unittest \
+ urllib \
+ venv venv/scripts venv/scripts/common venv/scripts/posix \
+ wsgiref \
+ $(XMLLIBSUBDIRS) \
+ xmlrpc \
+ zoneinfo \
+ __phello__
+TESTSUBDIRS= ctypes/test \
+ distutils/tests \
+ idlelib/idle_test \
+ lib2to3/tests \
+ lib2to3/tests/data \
+ lib2to3/tests/data/fixers \
+ lib2to3/tests/data/fixers/myfixes \
+ test \
+ test/audiodata \
+ test/certdata \
+ test/certdata/capath \
+ test/cjkencodings \
+ test/crashers \
+ test/configdata \
+ test/data \
+ test/decimaltestdata \
+ test/dtracedata \
+ test/encoded_modules \
+ test/imghdrdata \
+ test/leakers \
+ test/libregrtest \
+ test/regrtestdata \
+ test/regrtestdata/import_from_tests \
+ test/regrtestdata/import_from_tests/test_regrtest_b \
+ test/sndhdrdata \
+ test/subprocessdata \
+ test/support \
+ test/test_asyncio \
+ test/test_capi \
+ test/test_cppext \
+ test/test_dataclasses \
+ test/test_doctest \
+ test/test_email \
+ test/test_email/data \
+ test/test_future_stmt \
+ test/test_gdb \
+ test/test_inspect \
+ test/test_import \
+ test/test_import/data \
+ test/test_import/data/circular_imports \
+ test/test_import/data/circular_imports/subpkg \
+ test/test_import/data/circular_imports/subpkg2 \
+ test/test_import/data/circular_imports/subpkg2/parent \
+ test/test_import/data/package \
+ test/test_import/data/package2 \
+ test/test_import/data/unwritable \
+ test/test_importlib \
+ test/test_importlib/builtin \
+ test/test_importlib/data \
+ test/test_importlib/data01 \
+ test/test_importlib/data01/subdirectory \
+ test/test_importlib/data02 \
+ test/test_importlib/data02/one \
+ test/test_importlib/data02/two \
+ test/test_importlib/data03 \
+ test/test_importlib/data03/namespace \
+ test/test_importlib/data03/namespace/portion1 \
+ test/test_importlib/data03/namespace/portion2 \
+ test/test_importlib/extension \
+ test/test_importlib/frozen \
+ test/test_importlib/import_ \
+ test/test_importlib/namespace_pkgs \
+ test/test_importlib/namespace_pkgs/both_portions \
+ test/test_importlib/namespace_pkgs/both_portions/foo \
+ test/test_importlib/namespace_pkgs/module_and_namespace_package \
+ test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
+ test/test_importlib/namespace_pkgs/not_a_namespace_pkg \
+ test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \
+ test/test_importlib/namespace_pkgs/portion1 \
+ test/test_importlib/namespace_pkgs/portion1/foo \
+ test/test_importlib/namespace_pkgs/portion2 \
+ test/test_importlib/namespace_pkgs/portion2/foo \
+ test/test_importlib/namespace_pkgs/project1 \
+ test/test_importlib/namespace_pkgs/project1/parent \
+ test/test_importlib/namespace_pkgs/project1/parent/child \
+ test/test_importlib/namespace_pkgs/project2 \
+ test/test_importlib/namespace_pkgs/project2/parent \
+ test/test_importlib/namespace_pkgs/project2/parent/child \
+ test/test_importlib/namespace_pkgs/project3 \
+ test/test_importlib/namespace_pkgs/project3/parent \
+ test/test_importlib/namespace_pkgs/project3/parent/child \
+ test/test_importlib/namespacedata01 \
+ test/test_importlib/partial \
+ test/test_importlib/resources \
+ test/test_importlib/source \
+ test/test_importlib/zipdata01 \
+ test/test_importlib/zipdata02 \
+ test/test_json \
+ test/test_module \
+ test/test_peg_generator \
+ test/test_pydoc \
+ test/test_sqlite3 \
+ test/test_tomllib \
+ test/test_tomllib/data \
+ test/test_tomllib/data/invalid \
+ test/test_tomllib/data/invalid/array \
+ test/test_tomllib/data/invalid/array-of-tables \
+ test/test_tomllib/data/invalid/boolean \
+ test/test_tomllib/data/invalid/dates-and-times \
+ test/test_tomllib/data/invalid/dotted-keys \
+ test/test_tomllib/data/invalid/inline-table \
+ test/test_tomllib/data/invalid/keys-and-vals \
+ test/test_tomllib/data/invalid/literal-str \
+ test/test_tomllib/data/invalid/multiline-basic-str \
+ test/test_tomllib/data/invalid/multiline-literal-str \
+ test/test_tomllib/data/invalid/table \
+ test/test_tomllib/data/valid \
+ test/test_tomllib/data/valid/array \
+ test/test_tomllib/data/valid/dates-and-times \
+ test/test_tomllib/data/valid/multiline-basic-str \
+ test/test_tools \
+ test/test_warnings \
+ test/test_warnings/data \
+ test/test_zoneinfo \
+ test/test_zoneinfo/data \
+ test/tokenizedata \
+ test/tracedmodules \
+ test/typinganndata \
+ test/xmltestdata \
+ test/xmltestdata/c14n-20 \
+ test/ziptestdata \
+ tkinter/test \
+ tkinter/test/test_tkinter \
+ tkinter/test/test_ttk \
+ unittest/test \
+ unittest/test/testmock \
+ test/test_concurrent_futures \
+ test/test_multiprocessing_fork \
+ test/test_multiprocessing_forkserver \
+ test/test_multiprocessing_spawn
+
+TEST_MODULES=yes
+libinstall: all $(srcdir)/Modules/xxmodule.c
+ @for i in $(SCRIPTDIR) $(LIBDEST); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+ @if test "$(TEST_MODULES)" = yes; then \
+ subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \
+ else \
+ subdirs="$(LIBSUBDIRS)"; \
+ fi; \
+ for d in $$subdirs; \
+ do \
+ a=$(srcdir)/Lib/$$d; \
+ if test ! -d $$a; then continue; else true; fi; \
+ b=$(LIBDEST)/$$d; \
+ if test ! -d $(DESTDIR)$$b; then \
+ echo "Creating directory $$b"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
+ else true; \
+ fi; \
+ done
+ @for i in $(srcdir)/Lib/*.py; \
+ do \
+ if test -x $$i; then \
+ $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
+ echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
+ else \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
+ echo $(INSTALL_DATA) $$i $(LIBDEST); \
+ fi; \
+ done
+ @if test "$(TEST_MODULES)" = yes; then \
+ subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \
+ else \
+ subdirs="$(LIBSUBDIRS)"; \
+ fi; \
+ for d in $$subdirs; \
+ do \
+ a=$(srcdir)/Lib/$$d; \
+ if test ! -d $$a; then continue; else true; fi; \
+ if test `ls $$a | wc -l` -lt 1; then continue; fi; \
+ b=$(LIBDEST)/$$d; \
+ for i in $$a/*; \
+ do \
+ case $$i in \
+ *CVS) ;; \
+ *.py[co]) ;; \
+ *.orig) ;; \
+ *~) ;; \
+ *) \
+ if test -d $$i; then continue; fi; \
+ if test -x $$i; then \
+ echo $(INSTALL_SCRIPT) $$i $$b; \
+ $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
+ else \
+ echo $(INSTALL_DATA) $$i $$b; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
+ fi;; \
+ esac; \
+ done; \
+ done
+ $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
+ $(DESTDIR)$(LIBDEST); \
+ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+ if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+ -j0 -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -j0 -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+ -j0 -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+ -j0 -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -j0 -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+ -j0 -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+# bpo-21536: Misc/python-config.sh is generated in the build directory
+# from $(srcdir)Misc/python-config.sh.in.
+python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+ @ # Substitution happens here, as the completely-expanded BINDIR
+ @ # is not available in configure
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
+ @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
+ LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
+ @ # On Darwin, always use the python version of the script, the shell
+ @ # version doesn't use the compiler customizations that are provided
+ @ # in python (_osx_support.py).
+ @if test `uname -s` = Darwin; then \
+ cp python-config.py python-config; \
+ fi
+
+
+# Install the include files
+INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+inclinstall:
+ @for i in $(INCLDIRSTOMAKE); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+ @if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \
+ echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \
+ else true; \
+ fi
+ @if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \
+ echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
+ else true; \
+ fi
+ @for i in $(srcdir)/Include/*.h; \
+ do \
+ echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
+ done
+ @for i in $(srcdir)/Include/cpython/*.h; \
+ do \
+ echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \
+ done
+ @for i in $(srcdir)/Include/internal/*.h; \
+ do \
+ echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
+ done
+ $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
+
+# Install the library and miscellaneous stuff needed for extending/embedding
+# This goes into $(exec_prefix)
+LIBPL= $(prefix)/lib/python3.11/config-$(VERSION)$(ABIFLAGS)-x86_64-linux-gnu
+
+# pkgconfig directory
+LIBPC= $(LIBDIR)/pkgconfig
+
+libainstall: all python-config
+ @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+ @if test "$(STATIC_LIBPYTHON)" = 1; then \
+ if test -d $(LIBRARY); then :; else \
+ if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+ if test "$(SHLIB_SUFFIX)" = .dll; then \
+ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+ else \
+ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+ fi; \
+ else \
+ echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+ fi; \
+ fi; \
+ $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o; \
+ fi
+ $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
+ $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
+ $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
+ $(INSTALL_DATA) Modules/Setup.bootstrap $(DESTDIR)$(LIBPL)/Setup.bootstrap
+ $(INSTALL_DATA) Modules/Setup.stdlib $(DESTDIR)$(LIBPL)/Setup.stdlib
+ $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
+ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
+ $(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+ $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
+ $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
+ @if [ -s Modules/python.exp -a \
+ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
+ echo; echo "Installing support files for building shared extension modules on AIX:"; \
+ $(INSTALL_DATA) Modules/python.exp \
+ $(DESTDIR)$(LIBPL)/python.exp; \
+ echo; echo "$(LIBPL)/python.exp"; \
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
+ $(DESTDIR)$(LIBPL)/makexp_aix; \
+ echo "$(LIBPL)/makexp_aix"; \
+ $(INSTALL_SCRIPT) Modules/ld_so_aix \
+ $(DESTDIR)$(LIBPL)/ld_so_aix; \
+ echo "$(LIBPL)/ld_so_aix"; \
+ echo; echo "See Misc/README.AIX for details."; \
+ else true; \
+ fi
+
+# Install the dynamically loadable modules
+# This goes into $(exec_prefix)
+sharedinstall: all
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+ --root=$(DESTDIR)/
+ -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
+ -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+
+# Here are a couple of targets for MacOSX again, to install a full
+# framework-based Python. frameworkinstall installs everything, the
+# subtargets install specific parts. Much of the actual work is offloaded to
+# the Makefile in Mac
+#
+#
+# This target is here for backward compatibility, previous versions of Python
+# hadn't integrated framework installation in the normal install process.
+frameworkinstall: install
+
+# On install, we re-make the framework
+# structure in the install location, /Library/Frameworks/ or the argument to
+# --enable-framework. If --enable-framework has been specified then we have
+# automatically set prefix to the location deep down in the framework, so we
+# only have to cater for the structural bits of the framework.
+
+frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
+
+frameworkinstallstructure: $(LDLIBRARY)
+ @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+ echo Not configured with --enable-framework; \
+ exit 1; \
+ else true; \
+ fi
+ @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $(DESTDIR)$$i"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
+ else true; \
+ fi; \
+ done
+ $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
+ sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
+ $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
+ $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
+ $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
+ $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
+ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
+
+# This installs Mac/Lib into the framework
+# Install a number of symlinks to keep software that expects a normal unix
+# install (which includes python-config) happy.
+frameworkinstallmaclib:
+ $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).a"
+ $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).dylib"
+ $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).a"
+ $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).dylib"
+ $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(LDVERSION).dylib"
+ $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
+
+# This installs the IDE, the Launcher and other apps into /Applications
+frameworkinstallapps:
+ cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
+
+# Build the bootstrap executable that will spawn the interpreter inside
+# an app bundle within the framework. This allows the interpreter to
+# run OS X GUI APIs.
+frameworkpythonw:
+ cd Mac && $(MAKE) pythonw
+
+# This installs the python* and other bin symlinks in $prefix/bin or in
+# a bin directory relative to the framework root
+frameworkinstallunixtools:
+ cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
+
+frameworkaltinstallunixtools:
+ cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
+
+# This installs the Tools into the applications directory.
+# It is not part of a normal frameworkinstall
+frameworkinstallextras:
+ cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
+
+# Build the toplevel Makefile
+Makefile.pre: $(srcdir)/Makefile.pre.in config.status
+ CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
+ $(MAKE) -f Makefile.pre Makefile
+
+# Run the configure script.
+config.status: $(srcdir)/configure
+ $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
+
+.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
+
+# Some make's put the object file in the current directory
+.c.o:
+ $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
+
+# bpo-30104: dtoa.c uses union to cast double to unsigned long[2]. clang 4.0
+# with -O2 or higher and strict aliasing miscompiles the ratio() function
+# causing rounding issues. Compile dtoa.c using -fno-strict-aliasing on clang.
+# https://bugs.llvm.org//show_bug.cgi?id=31928
+Python/dtoa.o: Python/dtoa.c
+ $(CC) -c $(PY_CORE_CFLAGS) $(CFLAGS_ALIASING) -o $@ $<
+
+# Run reindent on the library
+reindent:
+ ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
+
+# Rerun configure with the same options as it was run last time,
+# provided the config.status script exists
+recheck:
+ $(SHELL) config.status --recheck
+ $(SHELL) config.status
+
+# Regenerate configure and pyconfig.h.in
+.PHONY: autoconf
+autoconf:
+ (cd $(srcdir); autoreconf -ivf -Werror)
+
+# See https://github.com/tiran/cpython_autoconf container
+.PHONY: regen-configure
+regen-configure:
+ @if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
+ if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
+ if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
+ # Manifest corresponds with tag '269' \
+ CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939" \
+ CMD="$$RUNTIME run --rm --pull=missing -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf@$$CPYTHON_AUTOCONF_MANIFEST"; \
+ echo $$CMD; \
+ $$CMD || exit $?
+
+# Create a tags file for vi
+tags::
+ ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h
+ for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done
+ ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch]
+ find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | ctags -f tags -w -a -L -
+ LC_ALL=C sort -o tags tags
+
+# Create a tags file for GNU Emacs
+TAGS::
+ cd $(srcdir); \
+ etags Include/*.h Include/cpython/*.h Include/internal/*.h; \
+ for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
+ etags -a $(srcdir)/Modules/_ctypes/*.[ch]
+ find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | etags - -a
+
+# Sanitation targets -- clean leaves libraries, executables and tags
+# files, which clobber removes as well
+pycremoval:
+ -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
+ -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
+
+rmtestturds:
+ -rm -f *BAD *GOOD *SKIPPED
+ -rm -rf OUT
+ -rm -f *.TXT
+ -rm -f *.txt
+ -rm -f gb-18030-2000.xml
+
+docclean:
+ $(MAKE) -C $(srcdir)/Doc clean
+
+# like the 'clean' target but retain the profile guided optimization (PGO)
+# data. The PGO data is only valid if source code remains unchanged.
+clean-retain-profile: pycremoval
+ find . -name '*.[oa]' -exec rm -f {} ';'
+ find . -name '*.s[ol]' -exec rm -f {} ';'
+ find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ find . -name '*.wasm' -exec rm -f {} ';'
+ find . -name '*.lst' -exec rm -f {} ';'
+ find build -name 'fficonfig.h' -exec rm -f {} ';' || true
+ find build -name '*.py' -exec rm -f {} ';' || true
+ find build -name '*.py[co]' -exec rm -f {} ';' || true
+ -rm -f pybuilddir.txt
+ -rm -f Lib/lib2to3/*Grammar*.pickle
+ -rm -f _bootstrap_python
+ -rm -f python.html python*.js python.data python*.symbols python*.map
+ -rm -f $(WASM_STDLIB)
+ -rm -f Programs/_testembed Programs/_freeze_module
+ -rm -f Python/deepfreeze/*.[co]
+ -rm -f Python/frozen_modules/*.h
+ -rm -f Python/frozen_modules/MANIFEST
+ -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
+ -rm -f Include/pydtrace_probes.h
+ -rm -f profile-gen-stamp
+
+profile-removal:
+ find . -name '*.gc??' -exec rm -f {} ';'
+ find . -name '*.profclang?' -exec rm -f {} ';'
+ find . -name '*.dyn' -exec rm -f {} ';'
+ rm -f $(COVERAGE_INFO)
+ rm -rf $(COVERAGE_REPORT)
+ rm -f profile-run-stamp
+
+clean: clean-retain-profile
+ @if test profile-opt = profile-opt; then \
+ rm -f profile-gen-stamp profile-clean-stamp; \
+ $(MAKE) profile-removal; \
+ fi
+
+clobber: clean
+ -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
+ tags TAGS \
+ config.cache config.log pyconfig.h Modules/config.c
+ -rm -rf build platform
+ -rm -rf $(PYTHONFRAMEWORKDIR)
+ -rm -f python-config.py python-config
+
+# Make things extra clean, before making a distribution:
+# remove all generated files, even Makefile[.pre]
+# Keep configure and Python-ast.[ch], it's possible they can't be generated
+distclean: clobber docclean
+ for file in $(srcdir)/Lib/test/data/* ; do \
+ if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
+ done
+ -rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
+ Modules/Setup.bootstrap Modules/Setup.stdlib \
+ Modules/ld_so_aix Modules/python.exp Misc/python.pc \
+ Misc/python-embed.pc Misc/python-config.sh
+ -rm -f python*-gdb.py
+ # Issue #28258: set LC_ALL to avoid issues with Estonian locale.
+ # Expansion is performed here by shell (spawned by make) itself before
+ # arguments are passed to find. So LC_ALL=C must be set as a separate
+ # command.
+ LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
+ -o -name '[@,#]*' -o -name '*.old' \
+ -o -name '*.orig' -o -name '*.rej' \
+ -o -name '*.bak' ')' \
+ -exec rm -f {} ';'
+
+# Check that all symbols exported by libpython start with "Py" or "_Py"
+smelly: all
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/smelly.py
+
+# Find files with funny names
+funny:
+ find $(SUBDIRS) $(SUBDIRSTOO) \
+ -type d \
+ -o -name '*.[chs]' \
+ -o -name '*.py' \
+ -o -name '*.pyw' \
+ -o -name '*.dat' \
+ -o -name '*.el' \
+ -o -name '*.fd' \
+ -o -name '*.in' \
+ -o -name '*.gif' \
+ -o -name '*.txt' \
+ -o -name '*.xml' \
+ -o -name '*.xbm' \
+ -o -name '*.xpm' \
+ -o -name '*.uue' \
+ -o -name '*.decTest' \
+ -o -name '*.tmCommand' \
+ -o -name '*.tmSnippet' \
+ -o -name 'Setup' \
+ -o -name 'Setup.*' \
+ -o -name README \
+ -o -name NEWS \
+ -o -name HISTORY \
+ -o -name Makefile \
+ -o -name ChangeLog \
+ -o -name .hgignore \
+ -o -name MANIFEST \
+ -o -print
+
+# Perform some verification checks on any modified files.
+patchcheck: all
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
+
+check-limited-abi: all
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --all $(srcdir)/Misc/stable_abi.toml
+
+.PHONY: update-config
+update-config:
+ curl -sL -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
+ curl -sL -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
+ chmod +x config.guess config.sub
+
+# Dependencies
+
+Python/thread.o: $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/thread_pthread_stubs.h $(srcdir)/Python/condvar.h
+
+# Declare targets that aren't real files
+.PHONY: all build_all build_wasm sharedmods check-clean-src oldsharedmods test quicktest
+.PHONY: install altinstall oldsharedinstall bininstall altbininstall
+.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
+.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
+.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
+.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
+.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
+.PHONY: clean-retain-profile profile-removal run_profile_task
+.PHONY: build_all_generate_profile build_all_merge_profile
+.PHONY: gdbhooks
+
+##########################################################################
+# Module dependencies
+
+MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h
+MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h
+MODULE_PYEXPAT_DEPS=
+MODULE_UNICODEDATA_DEPS=$(srcdir)/Modules/unicodedata_db.h $(srcdir)/Modules/unicodename_db.h
+MODULE__BLAKE2_DEPS=$(srcdir)/Modules/_blake2/impl/blake2-config.h $(srcdir)/Modules/_blake2/impl/blake2-impl.h $(srcdir)/Modules/_blake2/impl/blake2.h $(srcdir)/Modules/_blake2/impl/blake2b-load-sse2.h $(srcdir)/Modules/_blake2/impl/blake2b-load-sse41.h $(srcdir)/Modules/_blake2/impl/blake2b-ref.c $(srcdir)/Modules/_blake2/impl/blake2b-round.h $(srcdir)/Modules/_blake2/impl/blake2b.c $(srcdir)/Modules/_blake2/impl/blake2s-load-sse2.h $(srcdir)/Modules/_blake2/impl/blake2s-load-sse41.h $(srcdir)/Modules/_blake2/impl/blake2s-load-xop.h $(srcdir)/Modules/_blake2/impl/blake2s-ref.c $(srcdir)/Modules/_blake2/impl/blake2s-round.h $(srcdir)/Modules/_blake2/impl/blake2s.c $(srcdir)/Modules/_blake2/blake2module.h $(srcdir)/Modules/hashlib.h
+MODULE__CTYPES_DEPS=$(srcdir)/Modules/_ctypes/ctypes.h
+MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h $(LIBMPDEC_HEADERS) $(LIBMPDEC_A)
+MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c
+MODULE__HASHLIB_DEPS=$(srcdir)/Modules/hashlib.h
+MODULE__IO_DEPS=$(srcdir)/Modules/_io/_iomodule.h
+MODULE__MD5_DEPS=$(srcdir)/Modules/hashlib.h
+MODULE__SHA1_DEPS=$(srcdir)/Modules/hashlib.h
+MODULE__SHA256_DEPS=$(srcdir)/Modules/hashlib.h
+MODULE__SHA3_DEPS=$(srcdir)/Modules/_sha3/sha3.c $(srcdir)/Modules/_sha3/sha3.h $(srcdir)/Modules/hashlib.h
+MODULE__SHA512_DEPS=$(srcdir)/Modules/hashlib.h
+MODULE__SOCKET_DEPS=$(srcdir)/Modules/socketmodule.h $(srcdir)/Modules/addrinfo.h $(srcdir)/Modules/getaddrinfo.c $(srcdir)/Modules/getnameinfo.c
+MODULE__SSL_DEPS=$(srcdir)/Modules/_ssl.h $(srcdir)/Modules/_ssl/cert.c $(srcdir)/Modules/_ssl/debughelpers.c $(srcdir)/Modules/_ssl/misc.c $(srcdir)/Modules/_ssl_data.h $(srcdir)/Modules/_ssl_data_111.h $(srcdir)/Modules/_ssl_data_300.h $(srcdir)/Modules/socketmodule.h
+MODULE__TESTCAPI_DEPS=$(srcdir)/Modules/testcapi_long.h
+MODULE__SQLITE3_DEPS=$(srcdir)/Modules/_sqlite/connection.h $(srcdir)/Modules/_sqlite/cursor.h $(srcdir)/Modules/_sqlite/microprotocols.h $(srcdir)/Modules/_sqlite/module.h $(srcdir)/Modules/_sqlite/prepare_protocol.h $(srcdir)/Modules/_sqlite/row.h $(srcdir)/Modules/_sqlite/util.h
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+# Local Variables:
+# mode: makefile
+# End:
+
+# Rules appended by makesetup
+
+Modules/atexitmodule.o: $(srcdir)/Modules/atexitmodule.c $(MODULE_ATEXIT_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_ATEXIT_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/atexitmodule.c -o Modules/atexitmodule.o
+Modules/atexit$(EXT_SUFFIX): Modules/atexitmodule.o; $(BLDSHARED) Modules/atexitmodule.o $(MODULE_ATEXIT_LDFLAGS) -o Modules/atexit$(EXT_SUFFIX)
+Modules/faulthandler.o: $(srcdir)/Modules/faulthandler.c $(MODULE_FAULTHANDLER_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_FAULTHANDLER_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/faulthandler.c -o Modules/faulthandler.o
+Modules/faulthandler$(EXT_SUFFIX): Modules/faulthandler.o; $(BLDSHARED) Modules/faulthandler.o $(MODULE_FAULTHANDLER_LDFLAGS) -o Modules/faulthandler$(EXT_SUFFIX)
+Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(MODULE_POSIX_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_POSIX_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
+Modules/posix$(EXT_SUFFIX): Modules/posixmodule.o; $(BLDSHARED) Modules/posixmodule.o $(MODULE_POSIX_LDFLAGS) -o Modules/posix$(EXT_SUFFIX)
+Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(MODULE__SIGNAL_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__SIGNAL_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
+Modules/_signal$(EXT_SUFFIX): Modules/signalmodule.o; $(BLDSHARED) Modules/signalmodule.o $(MODULE__SIGNAL_LDFLAGS) -o Modules/_signal$(EXT_SUFFIX)
+Modules/_tracemalloc.o: $(srcdir)/Modules/_tracemalloc.c $(MODULE__TRACEMALLOC_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__TRACEMALLOC_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_tracemalloc.c -o Modules/_tracemalloc.o
+Modules/_tracemalloc$(EXT_SUFFIX): Modules/_tracemalloc.o; $(BLDSHARED) Modules/_tracemalloc.o $(MODULE__TRACEMALLOC_LDFLAGS) -o Modules/_tracemalloc$(EXT_SUFFIX)
+Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c $(MODULE__CODECS_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__CODECS_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
+Modules/_codecs$(EXT_SUFFIX): Modules/_codecsmodule.o; $(BLDSHARED) Modules/_codecsmodule.o $(MODULE__CODECS_LDFLAGS) -o Modules/_codecs$(EXT_SUFFIX)
+Modules/_collectionsmodule.o: $(srcdir)/Modules/_collectionsmodule.c $(MODULE__COLLECTIONS_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__COLLECTIONS_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o
+Modules/_collections$(EXT_SUFFIX): Modules/_collectionsmodule.o; $(BLDSHARED) Modules/_collectionsmodule.o $(MODULE__COLLECTIONS_LDFLAGS) -o Modules/_collections$(EXT_SUFFIX)
+Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c $(MODULE_ERRNO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_ERRNO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
+Modules/errno$(EXT_SUFFIX): Modules/errnomodule.o; $(BLDSHARED) Modules/errnomodule.o $(MODULE_ERRNO_LDFLAGS) -o Modules/errno$(EXT_SUFFIX)
+Modules/_io/_iomodule.o: $(srcdir)/Modules/_io/_iomodule.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/_iomodule.c -o Modules/_io/_iomodule.o
+Modules/_io/iobase.o: $(srcdir)/Modules/_io/iobase.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/iobase.c -o Modules/_io/iobase.o
+Modules/_io/fileio.o: $(srcdir)/Modules/_io/fileio.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/fileio.c -o Modules/_io/fileio.o
+Modules/_io/bytesio.o: $(srcdir)/Modules/_io/bytesio.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/bytesio.c -o Modules/_io/bytesio.o
+Modules/_io/bufferedio.o: $(srcdir)/Modules/_io/bufferedio.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/bufferedio.c -o Modules/_io/bufferedio.o
+Modules/_io/textio.o: $(srcdir)/Modules/_io/textio.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/textio.c -o Modules/_io/textio.o
+Modules/_io/stringio.o: $(srcdir)/Modules/_io/stringio.c $(MODULE__IO_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__IO_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_io/stringio.c -o Modules/_io/stringio.o
+Modules/_io$(EXT_SUFFIX): Modules/_io/_iomodule.o Modules/_io/iobase.o Modules/_io/fileio.o Modules/_io/bytesio.o Modules/_io/bufferedio.o Modules/_io/textio.o Modules/_io/stringio.o; $(BLDSHARED) Modules/_io/_iomodule.o Modules/_io/iobase.o Modules/_io/fileio.o Modules/_io/bytesio.o Modules/_io/bufferedio.o Modules/_io/textio.o Modules/_io/stringio.o $(MODULE__IO_LDFLAGS) -o Modules/_io$(EXT_SUFFIX)
+Modules/itertoolsmodule.o: $(srcdir)/Modules/itertoolsmodule.c $(MODULE_ITERTOOLS_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_ITERTOOLS_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/itertoolsmodule.c -o Modules/itertoolsmodule.o
+Modules/itertools$(EXT_SUFFIX): Modules/itertoolsmodule.o; $(BLDSHARED) Modules/itertoolsmodule.o $(MODULE_ITERTOOLS_LDFLAGS) -o Modules/itertools$(EXT_SUFFIX)
+Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(MODULE__SRE_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__SRE_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_sre/sre.c -o Modules/_sre/sre.o
+Modules/_sre$(EXT_SUFFIX): Modules/_sre/sre.o; $(BLDSHARED) Modules/_sre/sre.o $(MODULE__SRE_LDFLAGS) -o Modules/_sre$(EXT_SUFFIX)
+Modules/_threadmodule.o: $(srcdir)/Modules/_threadmodule.c $(MODULE__THREAD_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__THREAD_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_threadmodule.c -o Modules/_threadmodule.o
+Modules/_thread$(EXT_SUFFIX): Modules/_threadmodule.o; $(BLDSHARED) Modules/_threadmodule.o $(MODULE__THREAD_LDFLAGS) -o Modules/_thread$(EXT_SUFFIX)
+Modules/timemodule.o: $(srcdir)/Modules/timemodule.c $(MODULE_TIME_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_TIME_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o
+Modules/time$(EXT_SUFFIX): Modules/timemodule.o; $(BLDSHARED) Modules/timemodule.o $(MODULE_TIME_LDFLAGS) -o Modules/time$(EXT_SUFFIX)
+Modules/_weakref.o: $(srcdir)/Modules/_weakref.c $(MODULE__WEAKREF_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__WEAKREF_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o
+Modules/_weakref$(EXT_SUFFIX): Modules/_weakref.o; $(BLDSHARED) Modules/_weakref.o $(MODULE__WEAKREF_LDFLAGS) -o Modules/_weakref$(EXT_SUFFIX)
+Modules/_abc.o: $(srcdir)/Modules/_abc.c $(MODULE__ABC_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__ABC_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_abc.c -o Modules/_abc.o
+Modules/_abc$(EXT_SUFFIX): Modules/_abc.o; $(BLDSHARED) Modules/_abc.o $(MODULE__ABC_LDFLAGS) -o Modules/_abc$(EXT_SUFFIX)
+Modules/_functoolsmodule.o: $(srcdir)/Modules/_functoolsmodule.c $(MODULE__FUNCTOOLS_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__FUNCTOOLS_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_functoolsmodule.c -o Modules/_functoolsmodule.o
+Modules/_functools$(EXT_SUFFIX): Modules/_functoolsmodule.o; $(BLDSHARED) Modules/_functoolsmodule.o $(MODULE__FUNCTOOLS_LDFLAGS) -o Modules/_functools$(EXT_SUFFIX)
+Modules/_localemodule.o: $(srcdir)/Modules/_localemodule.c $(MODULE__LOCALE_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__LOCALE_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_localemodule.c -o Modules/_localemodule.o
+Modules/_locale$(EXT_SUFFIX): Modules/_localemodule.o; $(BLDSHARED) Modules/_localemodule.o $(MODULE__LOCALE_LDFLAGS) -o Modules/_locale$(EXT_SUFFIX)
+Modules/_operator.o: $(srcdir)/Modules/_operator.c $(MODULE__OPERATOR_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__OPERATOR_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_operator.c -o Modules/_operator.o
+Modules/_operator$(EXT_SUFFIX): Modules/_operator.o; $(BLDSHARED) Modules/_operator.o $(MODULE__OPERATOR_LDFLAGS) -o Modules/_operator$(EXT_SUFFIX)
+Modules/_stat.o: $(srcdir)/Modules/_stat.c $(MODULE__STAT_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__STAT_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_stat.c -o Modules/_stat.o
+Modules/_stat$(EXT_SUFFIX): Modules/_stat.o; $(BLDSHARED) Modules/_stat.o $(MODULE__STAT_LDFLAGS) -o Modules/_stat$(EXT_SUFFIX)
+Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c $(MODULE__SYMTABLE_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE__SYMTABLE_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
+Modules/_symtable$(EXT_SUFFIX): Modules/symtablemodule.o; $(BLDSHARED) Modules/symtablemodule.o $(MODULE__SYMTABLE_LDFLAGS) -o Modules/_symtable$(EXT_SUFFIX)
+Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(MODULE_PWD_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_PWD_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
+Modules/pwd$(EXT_SUFFIX): Modules/pwdmodule.o; $(BLDSHARED) Modules/pwdmodule.o $(MODULE_PWD_LDFLAGS) -o Modules/pwd$(EXT_SUFFIX)
+Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c $(MODULE_XXSUBTYPE_DEPS) $(PYTHON_HEADERS) Modules/config.c; $(CC) $(MODULE_XXSUBTYPE_CFLAGS) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
+Modules/xxsubtype$(EXT_SUFFIX): Modules/xxsubtype.o; $(BLDSHARED) Modules/xxsubtype.o $(MODULE_XXSUBTYPE_LDFLAGS) -o Modules/xxsubtype$(EXT_SUFFIX)
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup
new file mode 100644
index 0000000000000000000000000000000000000000..d3647ecb995928a5e2571f3a164b3cc571bbd02e
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup
@@ -0,0 +1,302 @@
+# -*- makefile -*-
+# The file Setup is used by the makesetup script to construct the files
+# Makefile and config.c, from Makefile.pre and config.c.in,
+# respectively. Note that Makefile.pre is created from Makefile.pre.in
+# by the toplevel configure script.
+
+# (VPATH notes: Setup and Makefile.pre are in the build directory, as
+# are Makefile and config.c; the *.in files are in the source directory.)
+
+# Each line in this file describes one or more optional modules.
+# Modules configured here will not be compiled by the setup.py script,
+# so the file can be used to override setup.py's behavior.
+# Tag lines containing just the word "*static*", "*shared*" or "*disabled*"
+# (without the quotes but with the stars) are used to tag the following module
+# descriptions. Tag lines may alternate throughout this file. Modules are
+# built statically when they are preceded by a "*static*" tag line or when
+# there is no tag line between the start of the file and the module
+# description. Modules are built as a shared library when they are preceded by
+# a "*shared*" tag line. Modules are not built at all, not by the Makefile,
+# nor by the setup.py script, when they are preceded by a "*disabled*" tag
+# line.
+
+# Lines have the following structure:
+#
+# ... [ ...] [ ...] [ ...]
+#
+# is anything ending in .c (.C, .cc, .c++ are C++ files)
+# is anything starting with -I, -D, -U or -C
+# is anything ending in .a or beginning with -l or -L
+# is anything else but should be a valid Python
+# identifier (letters, digits, underscores, beginning with non-digit)
+#
+# (As the makesetup script changes, it may recognize some other
+# arguments as well, e.g. *.so and *.sl as libraries. See the big
+# case statement in the makesetup script.)
+#
+# Lines can also have the form
+#
+# =
+#
+# which defines a Make variable definition inserted into Makefile.in.
+# You can also use any Make variable that is detected by configure and
+# defined in Makefile.pre.in, e.g. OpenSSL flags $(OPENSSL_INCLUDES).
+#
+# Rules generated by makesetup use additional variables:
+#
+# - All source file rules have a dependency on $(PYTHON_HEADERS) and on
+# optional variable $(MODULES_{mod_upper}_DEPS).
+# - If no and no arguments are given, then makesetup
+# defaults to $(MODULES_{mod_upper}_CFLAGS) cppargs and
+# $(MODULES_{mod_upper}_LDFLAGS) libraries. The variables are typically
+# defined by configure.
+#
+# The build process works like this:
+#
+# 1. Build all modules that are declared as static in Modules/Setup,
+# combine them into libpythonxy.a, combine that into python.
+# 2. Build all modules that are listed as shared in Modules/Setup.
+# 3. Invoke setup.py. That builds all modules that
+# a) are not builtin, and
+# b) are not listed in Modules/Setup, and
+# c) can be build on the target
+#
+# Therefore, modules declared to be shared will not be
+# included in the config.c file, nor in the list of objects to be
+# added to the library archive, and their linker options won't be
+# added to the linker options. Rules to create their .o files and
+# their shared libraries will still be added to the Makefile, and
+# their names will be collected in the Make variable SHAREDMODS. This
+# is used to build modules as shared libraries. (They can be
+# installed using "make sharedinstall", which is implied by the
+# toplevel "make install" target.) (For compatibility,
+# *noconfig* has the same effect as *shared*.)
+#
+# NOTE: As a standard policy, as many modules as can be supported by a
+# platform should be listed below. The distribution comes with all
+# modules enabled that are supported by most platforms and don't
+# require you to download sources from elsewhere.
+#
+# NOTE: Avoid editing this file directly. Local changes should go into
+# Modules/Setup.local file. To enable all modules for testing, run
+#
+# sed -n -E 's/^#([a-z_\*].*)$/\1/p' Modules/Setup > Modules/Setup.local
+
+
+# Some special rules to define PYTHONPATH.
+# Edit the definitions below to indicate which options you are using.
+# Don't add any whitespace or comments!
+
+# Directories where library files get installed.
+# DESTLIB is for Python modules; MACHDESTLIB for shared libraries.
+DESTLIB=$(LIBDEST)
+MACHDESTLIB=$(BINLIBDEST)
+
+# NOTE: all the paths are now relative to the prefix that is computed
+# at run time!
+
+# Standard path -- don't edit.
+# No leading colon since this is the first entry.
+# Empty since this is now just the runtime prefix.
+DESTPATH=
+
+# Site specific path components -- should begin with : if non-empty
+SITEPATH=
+
+# Standard path components for test modules
+TESTPATH=
+
+COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
+PYTHONPATH=$(COREPYTHONPATH)
+
+
+# ---
+# Built-in modules required to get a functioning interpreter are listed in
+# Modules/Setup.bootstrap.
+
+# ---
+# The rest of the modules listed in this file are all commented out by
+# default. Usually they can be detected and built as dynamically
+# loaded modules by setup.py. If you're on a platform that doesn't
+# support dynamic loading, want to compile modules statically into the
+# Python binary, or need to specify some odd set of compiler switches,
+# you can uncomment the appropriate lines below.
+
+# Uncommenting the following line tells makesetup that all following
+# modules are to be built as shared libraries (see above for more
+# detail; also note that *static* or *disabled* cancels this effect):
+
+#*shared*
+
+# Modules that should always be present (POSIX and Windows):
+
+#_asyncio _asynciomodule.c
+#_bisect _bisectmodule.c
+#_contextvars _contextvarsmodule.c
+#_csv _csv.c
+#_datetime _datetimemodule.c
+#_decimal _decimal/_decimal.c
+#_heapq _heapqmodule.c
+#_json _json.c
+#_lsprof _lsprof.c rotatingtree.c
+#_multiprocessing -I$(srcdir)/Modules/_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
+#_opcode _opcode.c
+#_pickle _pickle.c
+#_queue _queuemodule.c
+#_random _randommodule.c
+#_socket socketmodule.c
+#_statistics _statisticsmodule.c
+#_struct _struct.c
+#_typing _typingmodule.c
+#_zoneinfo _zoneinfo.c
+#array arraymodule.c
+#audioop audioop.c
+#binascii binascii.c
+#cmath cmathmodule.c
+#math mathmodule.c
+#mmap mmapmodule.c
+#select selectmodule.c
+
+# XML
+#_elementtree _elementtree.c
+#pyexpat pyexpat.c
+
+# hashing builtins
+#_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
+#_md5 md5module.c
+#_sha1 sha1module.c
+#_sha256 sha256module.c
+#_sha512 sha512module.c
+#_sha3 _sha3/sha3module.c
+
+# text encodings and unicode
+#_codecs_cn cjkcodecs/_codecs_cn.c
+#_codecs_hk cjkcodecs/_codecs_hk.c
+#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+#_codecs_jp cjkcodecs/_codecs_jp.c
+#_codecs_kr cjkcodecs/_codecs_kr.c
+#_codecs_tw cjkcodecs/_codecs_tw.c
+#_multibytecodec cjkcodecs/multibytecodec.c
+#unicodedata unicodedata.c
+
+# Modules with some UNIX dependencies
+
+#_posixsubprocess _posixsubprocess.c
+#_posixshmem -I$(srcdir)/Modules/_multiprocessing _multiprocessing/posixshmem.c -lrt
+#fcntl fcntlmodule.c
+#grp grpmodule.c
+#ossaudiodev ossaudiodev.c
+#resource resource.c
+#spwd spwdmodule.c
+#syslog syslogmodule.c
+#termios termios.c
+
+# Modules with UNIX dependencies that require external libraries
+
+#_crypt _cryptmodule.c -lcrypt
+#nis nismodule.c -I/usr/include/tirpc -lnsl -ltirpc
+
+# Modules that require external libraries.
+
+#_bz2 _bz2module.c -lbz2
+#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -ldl -lffi -DHAVE_FFI_PREP_CIF_VAR -DHAVE_FFI_PREP_CLOSURE_LOC -DHAVE_FFI_CLOSURE_ALLOC
+# The _dbm module supports NDBM, GDBM with compat module, and Berkeley DB.
+#_dbm _dbmmodule.c -lgdbm_compat -DUSE_GDBM_COMPAT
+#_gdbm _gdbmmodule.c -lgdbm
+#_lzma _lzmamodule.c -llzma
+#_uuid _uuidmodule.c -luuid
+#zlib zlibmodule.c -lz
+
+# The readline module also supports libeditline (-leditline).
+# Some systems may require -ltermcap or -ltermlib.
+#readline readline.c -lreadline -ltermcap
+
+# OpenSSL bindings
+#_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS)
+#_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) -lcrypto
+
+# To statically link OpenSSL:
+# _ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
+# -l:libssl.a -Wl,--exclude-libs,libssl.a \
+# -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a
+# _hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
+# -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a
+
+# The _tkinter module.
+#
+# The command for _tkinter is long and site specific. Please
+# uncomment and/or edit those parts as indicated. If you don't have a
+# specific extension (e.g. Tix or BLT), leave the corresponding line
+# commented out. (Leave the trailing backslashes in! If you
+# experience strange errors, you may want to join all uncommented
+# lines and remove the backslashes -- the backslash interpretation is
+# done by the shell's "read" command and it may not be implemented on
+# every system.
+
+# *** Always uncomment this (leave the leading underscore in!):
+#_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT $(TCLTK_INCLUDES) $(TCLTK_LIBS) \
+# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+# -L/usr/local/lib \
+# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+# -I/usr/local/include \
+# *** Uncomment and edit to reflect where your X11 header files are:
+# -I/usr/X11R6/include \
+# *** Or uncomment this for Solaris:
+# -I/usr/openwin/include \
+# *** Uncomment and edit for Tix extension only:
+# -DWITH_TIX -ltix8.1.8.2 \
+# *** Uncomment and edit for BLT extension only:
+# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+# *** Uncomment and edit for PIL (TkImaging) extension only:
+# (See http://www.pythonware.com/products/pil/ for more info)
+# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
+# *** Uncomment and edit for TOGL extension only:
+# -DWITH_TOGL togl.c \
+# *** Uncomment and edit to reflect where your X11 libraries are:
+# -L/usr/X11R6/lib \
+# *** Or uncomment this for Solaris:
+# -L/usr/openwin/lib \
+# *** Uncomment these for TOGL extension only:
+# -lGL -lGLU -lXext -lXmu \
+# *** Uncomment for AIX:
+# -lld \
+# *** Always uncomment this; X11 libraries to link with:
+# -lX11
+
+# Some system have -lcurses
+#_curses -lncurses -lncursesw -ltermcap _cursesmodule.c
+#_curses_panel -lpanel -lncurses _curses_panel.c
+
+# macOS specific module, needs SystemConfiguration and CoreFoundation framework
+# _scproxy _scproxy.c
+
+# Examples
+
+#xx xxmodule.c
+#xxlimited xxlimited.c
+#xxlimited_35 xxlimited_35.c
+xxsubtype xxsubtype.c # Required for the test suite to pass!
+
+# Testing
+
+#_xxsubinterpreters _xxsubinterpretersmodule.c
+#_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
+#_testbuffer _testbuffer.c
+#_testinternalcapi _testinternalcapi.c
+
+# Some testing modules MUST be built as shared libraries.
+
+#*shared*
+#_ctypes_test _ctypes/_ctypes_test.c
+#_testcapi _testcapimodule.c
+#_testimportmultiple _testimportmultiple.c
+#_testmultiphase _testmultiphase.c
+
+# ---
+# Uncommenting the following line tells makesetup that all following modules
+# are not built (see above for more detail).
+#
+#*disabled*
+#
+# _sqlite3 _tkinter _curses pyexpat
+# _codecs_jp _codecs_kr _codecs_tw unicodedata
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.bootstrap b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.bootstrap
new file mode 100644
index 0000000000000000000000000000000000000000..5fb3ab9b56742086f29312d378a16ed4b0be0bf4
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.bootstrap
@@ -0,0 +1,35 @@
+# -*- makefile -*-
+
+# ---
+# Built-in modules required to get a functioning interpreter;
+# cannot be built as shared!
+*static*
+
+# module C APIs are used in core
+atexit atexitmodule.c
+faulthandler faulthandler.c
+posix posixmodule.c
+_signal signalmodule.c
+_tracemalloc _tracemalloc.c
+
+# modules used by importlib, deepfreeze, freeze, runpy, and sysconfig
+_codecs _codecsmodule.c
+_collections _collectionsmodule.c
+errno errnomodule.c
+_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
+itertools itertoolsmodule.c
+_sre _sre/sre.c
+_thread _threadmodule.c
+time timemodule.c
+_weakref _weakref.c
+
+# commonly used core modules
+_abc _abc.c
+_functools _functoolsmodule.c
+_locale _localemodule.c
+_operator _operator.c
+_stat _stat.c
+_symtable symtablemodule.c
+
+# for systems without $HOME env, used by site._getuserbase()
+pwd pwdmodule.c
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.local b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.local
new file mode 100644
index 0000000000000000000000000000000000000000..ca2983e22e8602b865d2d7e6283c8f11e7e8415e
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.local
@@ -0,0 +1 @@
+# Edit this file for local setup changes
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.stdlib b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.stdlib
new file mode 100644
index 0000000000000000000000000000000000000000..135bada75cac54762b51a089ca808b91bdbfb7b8
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/Setup.stdlib
@@ -0,0 +1,182 @@
+# -*- makefile -*-
+#
+# This file is autogenerated from Modules/Setup.stdlib.in.
+#
+
+# The file is not used by default yet. For testing do:
+#
+# ln -sfr Modules/Setup.stdlib Modules/Setup.local
+#
+
+# * @MODULE_{NAME}_TRUE@ is removed when configure detects all build
+# dependencies for a module. Otherwise the template variable is replaced
+# by a comment "#" and the module is skipped.
+# * Module lines without any compiler and linker flags automatically use
+# $(MODULE_{NAME}_CFLAGS) and $(MODULE_{NAME}_LDFLAGS). These flags are
+# generated by PY_STDLIB_MOD macro.
+# * All source files automatically depend on $(PYTHON_HEADERS) and
+# $(MODULE_{NAME}_DEPS).
+#
+# See Modules/Setup and Modules/makesetup
+#
+
+
+# Build modules statically or as shared extensions
+# *shared* / *static*
+*shared*
+
+
+############################################################################
+# Modules that should always be present (POSIX and Windows):
+array arraymodule.c
+_asyncio _asynciomodule.c
+_bisect _bisectmodule.c
+_contextvars _contextvarsmodule.c
+_csv _csv.c
+_heapq _heapqmodule.c
+_json _json.c
+_lsprof _lsprof.c rotatingtree.c
+_opcode _opcode.c
+_pickle _pickle.c
+_queue _queuemodule.c
+_random _randommodule.c
+_struct _struct.c
+_typing _typingmodule.c
+_xxsubinterpreters _xxsubinterpretersmodule.c
+_zoneinfo _zoneinfo.c
+
+# needs libm
+audioop audioop.c
+math mathmodule.c
+cmath cmathmodule.c
+_statistics _statisticsmodule.c
+
+# needs libm and on some platforms librt
+_datetime _datetimemodule.c
+
+# _decimal uses libmpdec
+# either static libmpdec.a from Modules/_decimal/libmpdec or libmpdec.so
+# with ./configure --with-system-libmpdec
+_decimal _decimal/_decimal.c
+
+# compression libs and binascii (optional CRC32 from zlib)
+# bindings need -lbz2, -lz, or -llzma, respectively
+binascii binascii.c
+_bz2 _bz2module.c
+_lzma _lzmamodule.c
+zlib zlibmodule.c
+
+# dbm/gdbm
+# dbm needs either libndbm, libgdbm_compat, or libdb 5.x
+#@MODULE__DBM_TRUE@_dbm _dbmmodule.c
+# gdbm module needs -lgdbm
+#_gdbm _gdbmmodule.c
+
+# needs -lreadline or -leditline, sometimes termcap, termlib, or tinfo
+#@MODULE_READLINE_TRUE@readline readline.c
+
+# hashing builtins, can be disabled with --without-builtin-hashlib-hashes
+_md5 md5module.c
+_sha1 sha1module.c
+_sha256 sha256module.c
+_sha512 sha512module.c
+_sha3 _sha3/sha3module.c
+_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
+
+############################################################################
+# XML and text
+
+# pyexpat module uses libexpat
+# either static libexpat.a from Modules/expat or libexpat.so with
+# ./configure --with-system-expat
+pyexpat pyexpat.c
+
+# _elementtree libexpat via CAPI hook in pyexpat.
+_elementtree _elementtree.c
+
+_codecs_cn cjkcodecs/_codecs_cn.c
+_codecs_hk cjkcodecs/_codecs_hk.c
+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+_codecs_jp cjkcodecs/_codecs_jp.c
+_codecs_kr cjkcodecs/_codecs_kr.c
+_codecs_tw cjkcodecs/_codecs_tw.c
+_multibytecodec cjkcodecs/multibytecodec.c
+unicodedata unicodedata.c
+
+############################################################################
+# Modules with some UNIX dependencies
+#
+
+# needs -lcrypt on some systems
+_crypt _cryptmodule.c
+fcntl fcntlmodule.c
+grp grpmodule.c
+mmap mmapmodule.c
+# FreeBSD: nis/yp APIs are in libc
+# Linux: glibc has deprecated SUN RPC, APIs are in libnsl and libtirpc (bpo-32521)
+nis nismodule.c
+# needs sys/soundcard.h or linux/soundcard.h (Linux, FreeBSD)
+ossaudiodev ossaudiodev.c
+_posixsubprocess _posixsubprocess.c
+resource resource.c
+select selectmodule.c
+_socket socketmodule.c
+# AIX has shadow passwords, but does not provide getspent API
+spwd spwdmodule.c
+syslog syslogmodule.c
+termios termios.c
+
+# multiprocessing
+_posixshmem _multiprocessing/posixshmem.c
+_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
+
+
+############################################################################
+# Modules with third party dependencies
+#
+
+# needs -lffi and -ldl
+#@MODULE__CTYPES_TRUE@_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c
+
+# needs -lncurses, -lncursesw or -lcurses, sometimes -ltermcap
+#@MODULE__CURSES_TRUE@_curses _cursesmodule.c
+# needs -lncurses and -lpanel
+#@MODULE__CURSES_PANEL_TRUE@_curses_panel _curses_panel.c
+
+_sqlite3 _sqlite/blob.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c
+
+# needs -lssl and -lcrypt
+_ssl _ssl.c
+# needs -lcrypt
+_hashlib _hashopenssl.c
+
+# Linux: -luuid, BSD/AIX: libc's uuid_create()
+_uuid _uuidmodule.c
+
+_tkinter _tkinter.c tkappinit.c
+
+############################################################################
+# macOS specific modules
+
+# _scproxy needs SystemConfiguration and CoreFoundation framework
+#_scproxy _scproxy.c
+
+
+############################################################################
+# Test modules
+
+_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
+_testbuffer _testbuffer.c
+_testinternalcapi _testinternalcapi.c
+_testcapi _testcapimodule.c
+_testclinic _testclinic.c
+
+# Some testing modules MUST be built as shared libraries.
+*shared*
+_testimportmultiple _testimportmultiple.c
+_testmultiphase _testmultiphase.c
+_ctypes_test _ctypes/_ctypes_test.c
+
+# Limited API template modules; must be built as shared modules.
+xxlimited xxlimited.c
+xxlimited_35 xxlimited_35.c
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/__pycache__/python-config.cpython-311.pyc b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/__pycache__/python-config.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ed1bba8be5782335d09780fe1fbecc165f3ff2f5
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/__pycache__/python-config.cpython-311.pyc differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/config.c b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/config.c
new file mode 100644
index 0000000000000000000000000000000000000000..71c631a3ba55db791df4028b049af809c1e10800
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/config.c
@@ -0,0 +1,118 @@
+/* Generated automatically from /home/conda/feedstock_root/build_artifacts/python-split_1791909181428/work/Modules/config.c.in by makesetup. */
+/* -*- C -*- ***********************************************
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+******************************************************************/
+
+/* Module configuration */
+
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
+
+/* This file contains the table of built-in modules.
+ See create_builtin() in import.c. */
+
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern PyObject* PyInit_atexit(void);
+extern PyObject* PyInit_faulthandler(void);
+extern PyObject* PyInit_posix(void);
+extern PyObject* PyInit__signal(void);
+extern PyObject* PyInit__tracemalloc(void);
+extern PyObject* PyInit__codecs(void);
+extern PyObject* PyInit__collections(void);
+extern PyObject* PyInit_errno(void);
+extern PyObject* PyInit__io(void);
+extern PyObject* PyInit_itertools(void);
+extern PyObject* PyInit__sre(void);
+extern PyObject* PyInit__thread(void);
+extern PyObject* PyInit_time(void);
+extern PyObject* PyInit__weakref(void);
+extern PyObject* PyInit__abc(void);
+extern PyObject* PyInit__functools(void);
+extern PyObject* PyInit__locale(void);
+extern PyObject* PyInit__operator(void);
+extern PyObject* PyInit__stat(void);
+extern PyObject* PyInit__symtable(void);
+extern PyObject* PyInit_pwd(void);
+extern PyObject* PyInit_xxsubtype(void);
+
+/* -- ADDMODULE MARKER 1 -- */
+
+extern PyObject* PyMarshal_Init(void);
+extern PyObject* PyInit__imp(void);
+extern PyObject* PyInit_gc(void);
+extern PyObject* PyInit__ast(void);
+extern PyObject* PyInit__tokenize(void);
+extern PyObject* _PyWarnings_Init(void);
+extern PyObject* PyInit__string(void);
+
+struct _inittab _PyImport_Inittab[] = {
+
+ {"atexit", PyInit_atexit},
+ {"faulthandler", PyInit_faulthandler},
+ {"posix", PyInit_posix},
+ {"_signal", PyInit__signal},
+ {"_tracemalloc", PyInit__tracemalloc},
+ {"_codecs", PyInit__codecs},
+ {"_collections", PyInit__collections},
+ {"errno", PyInit_errno},
+ {"_io", PyInit__io},
+ {"itertools", PyInit_itertools},
+ {"_sre", PyInit__sre},
+ {"_thread", PyInit__thread},
+ {"time", PyInit_time},
+ {"_weakref", PyInit__weakref},
+ {"_abc", PyInit__abc},
+ {"_functools", PyInit__functools},
+ {"_locale", PyInit__locale},
+ {"_operator", PyInit__operator},
+ {"_stat", PyInit__stat},
+ {"_symtable", PyInit__symtable},
+ {"pwd", PyInit_pwd},
+ {"xxsubtype", PyInit_xxsubtype},
+
+/* -- ADDMODULE MARKER 2 -- */
+
+ /* This module lives in marshal.c */
+ {"marshal", PyMarshal_Init},
+
+ /* This lives in import.c */
+ {"_imp", PyInit__imp},
+
+ /* This lives in Python/Python-ast.c */
+ {"_ast", PyInit__ast},
+
+ /* This lives in Python/Python-tokenizer.c */
+ {"_tokenize", PyInit__tokenize},
+
+ /* These entries are here for sys.builtin_module_names */
+ {"builtins", NULL},
+ {"sys", NULL},
+
+ /* This lives in gcmodule.c */
+ {"gc", PyInit_gc},
+
+ /* This lives in _warnings.c */
+ {"_warnings", _PyWarnings_Init},
+
+ /* This lives in Objects/unicodeobject.c */
+ {"_string", PyInit__string},
+
+ /* Sentinel */
+ {0, 0}
+};
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/config.c.in b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/config.c.in
new file mode 100644
index 0000000000000000000000000000000000000000..6081f95759538f8c52ac4b688ce72aa72bae32b8
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/config.c.in
@@ -0,0 +1,71 @@
+/* -*- C -*- ***********************************************
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+******************************************************************/
+
+/* Module configuration */
+
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
+
+/* This file contains the table of built-in modules.
+ See create_builtin() in import.c. */
+
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* -- ADDMODULE MARKER 1 -- */
+
+extern PyObject* PyMarshal_Init(void);
+extern PyObject* PyInit__imp(void);
+extern PyObject* PyInit_gc(void);
+extern PyObject* PyInit__ast(void);
+extern PyObject* PyInit__tokenize(void);
+extern PyObject* _PyWarnings_Init(void);
+extern PyObject* PyInit__string(void);
+
+struct _inittab _PyImport_Inittab[] = {
+
+/* -- ADDMODULE MARKER 2 -- */
+
+ /* This module lives in marshal.c */
+ {"marshal", PyMarshal_Init},
+
+ /* This lives in import.c */
+ {"_imp", PyInit__imp},
+
+ /* This lives in Python/Python-ast.c */
+ {"_ast", PyInit__ast},
+
+ /* This lives in Python/Python-tokenizer.c */
+ {"_tokenize", PyInit__tokenize},
+
+ /* These entries are here for sys.builtin_module_names */
+ {"builtins", NULL},
+ {"sys", NULL},
+
+ /* This lives in gcmodule.c */
+ {"gc", PyInit_gc},
+
+ /* This lives in _warnings.c */
+ {"_warnings", _PyWarnings_Init},
+
+ /* This lives in Objects/unicodeobject.c */
+ {"_string", PyInit__string},
+
+ /* Sentinel */
+ {0, 0}
+};
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/install-sh b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/install-sh
new file mode 100644
index 0000000000000000000000000000000000000000..ec298b53740270ce82b326c4c2deaa5dcdec4596
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/install-sh
@@ -0,0 +1,541 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2020-11-14.01; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab=' '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
+ -s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -p) cpprog="$cpprog -p";;
+
+ -s) stripcmd=$stripprog;;
+
+ -S) backupsuffix="$2"
+ shift;;
+
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename.
+ if test -d "$dst"; then
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
+ dstdir_status=0
+ else
+ dstdir=`dirname "$dst"`
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ set -f
+ set fnord $dstdir
+ shift
+ set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ set +f &&
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/makesetup b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/makesetup
new file mode 100644
index 0000000000000000000000000000000000000000..08303814c8c9112f5d8f601c2a42bfc6177a0c0c
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/makesetup
@@ -0,0 +1,350 @@
+#! /bin/sh
+set -e
+
+# Convert templates into Makefile and config.c, based on the module
+# definitions found in the file Setup.
+#
+# Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-n [Setup] ...]
+#
+# Options:
+# -s directory: alternative source directory (default .)
+# -l directory: library source directory (default derived from $0)
+# -c file: alternative config.c template (default $libdir/config.c.in)
+# -c -: don't write config.c
+# -m file: alternative Makefile template (default ./Makefile.pre)
+# -m -: don't write Makefile
+#
+# Remaining arguments are one or more Setup files (default ./Setup).
+# Setup files after a -n option are used for their variables, modules
+# and libraries but not for their .o files.
+#
+# See Setup for a description of the format of the Setup file.
+#
+# The following edits are made:
+#
+# Copying config.c.in to config.c:
+# - insert an identifying comment at the start
+# - for each mentioned in Setup before *noconfig*:
+# + insert 'extern PyObject* PyInit_(void);' before MARKER 1
+# + insert '{"", PyInit_},' before MARKER 2
+#
+# Copying Makefile.pre to Makefile:
+# - insert an identifying comment at the start
+# - replace _MODBUILT_NAMES_ by the list of *static* and *shared* modules
+# from Setup
+# - replace _MODBSHARED_NAMES_ by the list of *shared* modules from Setup
+# - replace _MODDISABLED_NAMES_ by the list of *disabled* modules from Setup
+# - replace _MODOBJS_ by the list of objects from Setup (except for
+# Setup files after a -n option)
+# - replace _MODLIBS_ by the list of libraries from Setup
+# - for each object file mentioned in Setup, append a rule
+# '.o: .c; ' to the end of the Makefile
+# - for each module mentioned in Setup, append a rule
+# which creates a shared library version to the end of the Makefile
+# - for each variable definition found in Setup, insert the definition
+# before the comment 'Definitions added by makesetup'
+
+# Loop over command line options
+usage='
+usage: makesetup [-s srcdir] [-l libdir] [-c config.c.in] [-m Makefile.pre]
+ [Setup] ... [-n [Setup] ...]'
+srcdir='.'
+libdir=''
+config=''
+makepre=''
+noobjects=''
+doconfig=yes
+while :
+do
+ case $1 in
+ -s) shift; srcdir=$1; shift;;
+ -l) shift; libdir=$1; shift;;
+ -c) shift; config=$1; shift;;
+ -m) shift; makepre=$1; shift;;
+ --) shift; break;;
+ -n) noobjects=yes;;
+ -*) echo "$usage" 1>&2; exit 2;;
+ *) break;;
+ esac
+done
+
+# Set default libdir and config if not set by command line
+# (Not all systems have dirname)
+case $libdir in
+'') case $0 in
+ */*) libdir=`echo $0 | sed 's,/[^/]*$,,'`;;
+ *) libdir=.;;
+ esac;;
+esac
+case $config in
+'') config=$libdir/config.c.in;;
+esac
+case $makepre in
+'') makepre=Makefile.pre;;
+esac
+
+# Newline for sed i and a commands
+NL='\
+'
+
+# Setup to link with extra libraries when making shared extensions.
+# Currently, only Cygwin needs this baggage.
+case `uname -s` in
+CYGWIN*) if test $libdir = .
+ then
+ ExtraLibDir=.
+ else
+ ExtraLibDir='$(LIBPL)'
+ fi
+ ExtraLibs="-L$ExtraLibDir -lpython\$(LDVERSION)";;
+esac
+
+# Main loop
+for i in ${*-Setup}
+do
+ case $i in
+ -n) echo '*noobjects*';;
+ *) echo '*doconfig*'; cat "$i";;
+ esac
+done |
+sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
+(
+ rulesf="@rules.$$"
+ trap 'rm -f $rulesf' 0 1 2 3
+ echo "
+# Rules appended by makesetup
+" >$rulesf
+ DEFS=
+ BUILT=
+ BUILT_SHARED=
+ DISABLED=
+ CONFIGURED=
+ MODS=
+ SHAREDMODS=
+ OBJS=
+ LIBS=
+ LOCALLIBS=
+ BASELIBS=
+ while read line
+ do
+ # to handle backslashes for sh's that don't automatically
+ # continue a read when the last char is a backslash
+ while echo $line | grep '\\$' > /dev/null
+ do
+ read extraline
+ line=`echo $line| sed s/.$//`$extraline
+ done
+
+ # Output DEFS in reverse order so first definition overrides
+ case $line in
+ *=*) DEFS="$line$NL$DEFS"; continue;;
+ 'include '*) DEFS="$line$NL$DEFS"; continue;;
+ '*noobjects*')
+ case $noobjects in
+ yes) ;;
+ *) LOCALLIBS=$LIBS; LIBS=;;
+ esac
+ noobjects=yes;
+ continue;;
+ '*doconfig*') doconfig=yes; continue;;
+ '*static*') doconfig=yes; continue;;
+ '*noconfig*') doconfig=no; continue;;
+ '*shared*') doconfig=no; continue;;
+ '*disabled*') doconfig=disabled; continue;;
+ esac
+ srcs=
+ cpps=
+ libs=
+ mods=
+ mods_upper=
+ skip=
+ for arg in $line
+ do
+ case $skip in
+ libs) libs="$libs $arg"; skip=; continue;;
+ cpps) cpps="$cpps $arg"; skip=; continue;;
+ srcs) srcs="$srcs $arg"; skip=; continue;;
+ esac
+ case $arg in
+ -framework) libs="$libs $arg"; skip=libs;
+ # OSX/OSXS/Darwin framework link cmd
+ ;;
+ -[IDUCfF]*) cpps="$cpps $arg";;
+ -Xcompiler) skip=cpps;;
+ -Xlinker) libs="$libs $arg"; skip=libs;;
+ -rpath) libs="$libs $arg"; skip=libs;;
+ --rpath) libs="$libs $arg"; skip=libs;;
+ -[A-Zl]*) libs="$libs $arg";;
+ *.a) libs="$libs $arg";;
+ *.so) libs="$libs $arg";;
+ *.sl) libs="$libs $arg";;
+ /*.o) libs="$libs $arg";;
+ *.def) libs="$libs $arg";;
+ *.o) srcs="$srcs `basename $arg .o`.c";;
+ *.[cC]) srcs="$srcs $arg";;
+ *.m) srcs="$srcs $arg";; # Objective-C src
+ *.cc) srcs="$srcs $arg";;
+ *.c++) srcs="$srcs $arg";;
+ *.cxx) srcs="$srcs $arg";;
+ *.cpp) srcs="$srcs $arg";;
+ \$\(*_CFLAGS\)) cpps="$cpps $arg";;
+ \$\(*_INCLUDES\)) cpps="$cpps $arg";;
+ \$\(*_LIBS\)) libs="$libs $arg";;
+ \$\(*_LDFLAGS\)) libs="$libs $arg";;
+ \$\(*_RPATH\)) libs="$libs $arg";;
+ \$*) libs="$libs $arg"
+ cpps="$cpps $arg";;
+ *.*) echo 1>&2 "bad word $arg in $line"
+ exit 1;;
+ -u) skip=libs; libs="$libs -u";;
+ [a-zA-Z_]*)
+ mods="$mods $arg"
+ mods_upper=$(echo $mods | tr '[a-z]' '[A-Z]');;
+ *) echo 1>&2 "bad word $arg in $line"
+ exit 1;;
+ esac
+ done
+ if test -z "$cpps" -a -z "$libs"; then
+ cpps="\$(MODULE_${mods_upper}_CFLAGS)"
+ libs="\$(MODULE_${mods_upper}_LDFLAGS)"
+ fi
+ for mod in $mods
+ do
+ case $CONFIGURED in
+ *,${mod},*)
+ # Detected multiple rules for a module, first rule wins. This
+ # allows users to disable modules in Setup.local.
+ echo 1>&2 "maksetup: '$mod' was handled by previous rule."
+ continue 2;;
+ esac
+ CONFIGURED="$CONFIGURED,${mod},"
+ done
+ case $doconfig in
+ yes)
+ LIBS="$LIBS $libs"
+ MODS="$MODS $mods"
+ BUILT="$BUILT $mods"
+ ;;
+ no)
+ BUILT="$BUILT $mods"
+ ;;
+ disabled)
+ DISABLED="$DISABLED $mods"
+ continue
+ ;;
+ esac
+ case $noobjects in
+ yes) continue;;
+ esac
+ objs=''
+ for src in $srcs
+ do
+ case $src in
+ *.c) obj=`basename $src .c`.o; cc='$(CC)';;
+ *.cc) obj=`basename $src .cc`.o; cc='$(CXX)';;
+ *.c++) obj=`basename $src .c++`.o; cc='$(CXX)';;
+ *.C) obj=`basename $src .C`.o; cc='$(CXX)';;
+ *.cxx) obj=`basename $src .cxx`.o; cc='$(CXX)';;
+ *.cpp) obj=`basename $src .cpp`.o; cc='$(CXX)';;
+ *.m) obj=`basename $src .m`.o; cc='$(CC)';; # Obj-C
+ *) continue;;
+ esac
+ case $src in
+ */*) obj="$srcdir/`dirname $src`/$obj";;
+ *) obj="$srcdir/$obj";;
+ esac
+ objs="$objs $obj"
+ case $src in
+ glmodule.c) ;;
+ /*) ;;
+ \$*) ;;
+ *) src='$(srcdir)/'"$srcdir/$src";;
+ esac
+ # custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec
+ case $doconfig in
+ no) cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)";;
+ *)
+ cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)";;
+ esac
+ # force rebuild when header file or module build flavor (static/shared) is changed
+ rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(PYTHON_HEADERS) Modules/config.c; $cc -c $src -o $obj"
+ echo "$rule" >>$rulesf
+ done
+ case $doconfig in
+ yes) OBJS="$OBJS $objs";;
+ esac
+ for mod in $mods
+ do
+ file="$srcdir/$mod\$(EXT_SUFFIX)"
+ case $doconfig in
+ no)
+ SHAREDMODS="$SHAREDMODS $file"
+ BUILT_SHARED="$BUILT_SHARED $mod"
+ ;;
+ esac
+ rule="$file: $objs"
+ rule="$rule; \$(BLDSHARED) $objs $libs $ExtraLibs -o $file"
+ echo "$rule" >>$rulesf
+ done
+ done
+
+ case $SHAREDMODS in
+ '') ;;
+ *) DEFS="SHAREDMODS=$SHAREDMODS$NL$DEFS";;
+ esac
+
+ case $noobjects in
+ yes) BASELIBS=$LIBS;;
+ *) LOCALLIBS=$LIBS;;
+ esac
+ LIBS='$(LOCALMODLIBS) $(BASEMODLIBS)'
+ DEFS="BASEMODLIBS=$BASELIBS$NL$DEFS"
+ DEFS="LOCALMODLIBS=$LOCALLIBS$NL$DEFS"
+
+ EXTDECLS=
+ INITBITS=
+ for mod in $MODS
+ do
+ EXTDECLS="${EXTDECLS}extern PyObject* PyInit_$mod(void);$NL"
+ INITBITS="${INITBITS} {\"$mod\", PyInit_$mod},$NL"
+ done
+
+
+ case $config in
+ -) ;;
+ *) sed -e "
+ 1i$NL/* Generated automatically from $config by makesetup. */
+ /MARKER 1/i$NL$EXTDECLS
+
+ /MARKER 2/i$NL$INITBITS
+
+ " $config >config.c
+ ;;
+ esac
+
+ case $makepre in
+ -) ;;
+ *)
+ # macOS' sed has issues with 'a' command. Use 'r' command with an
+ # external replacement file instead.
+ sedf="@sed.in.$$"
+ sedr="@sed.replace.$$"
+ trap 'rm -f $sedf $sedr' 0 1 2 3
+ echo "$NL$NL$DEFS" | sed 's/\\$//' > $sedr
+ echo "1i\\" >$sedf
+ str="# Generated automatically from $makepre by makesetup."
+ echo "$str" >>$sedf
+ echo "s%_MODBUILT_NAMES_%$BUILT%" >>$sedf
+ echo "s%_MODSHARED_NAMES_%$BUILT_SHARED%" >>$sedf
+ echo "s%_MODDISABLED_NAMES_%$DISABLED%" >>$sedf
+ echo "s%_MODOBJS_%$OBJS%" >>$sedf
+ echo "s%_MODLIBS_%$LIBS%" >>$sedf
+ echo "/Definitions added by makesetup/r $sedr" >>$sedf
+ sed -f $sedf $makepre >Makefile
+ cat $rulesf >>Makefile
+ rm -f $sedf $sedr
+ ;;
+ esac
+
+ rm -f $rulesf
+)
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/python-config.py b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/python-config.py
new file mode 100644
index 0000000000000000000000000000000000000000..1a6336bbea9382e4680123b651cef9062821f436
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/python-config.py
@@ -0,0 +1,74 @@
+#!/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/physworld_p1_20261018/envs/p1/bin/python3.11
+# -*- python -*-
+
+# Keep this script in sync with python-config.sh.in
+
+import getopt
+import os
+import sys
+import sysconfig
+
+valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+ 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
+ 'embed']
+
+def exit_with_usage(code=1):
+ print("Usage: {0} [{1}]".format(
+ sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
+ sys.exit(code)
+
+try:
+ opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
+except getopt.error:
+ exit_with_usage()
+
+if not opts:
+ exit_with_usage()
+
+getvar = sysconfig.get_config_var
+pyver = getvar('VERSION')
+
+opt_flags = [flag for (flag, val) in opts]
+
+if '--help' in opt_flags:
+ exit_with_usage(code=0)
+
+for opt in opt_flags:
+ if opt == '--prefix':
+ print(getvar('prefix'))
+
+ elif opt == '--exec-prefix':
+ print(getvar('exec_prefix'))
+
+ elif opt in ('--includes', '--cflags'):
+ flags = ['-I' + sysconfig.get_path('include'),
+ '-I' + sysconfig.get_path('platinclude')]
+ if opt == '--cflags':
+ flags.extend(getvar('CFLAGS').split())
+ print(' '.join(flags))
+
+ elif opt in ('--libs', '--ldflags'):
+ libs = []
+ if '--embed' in opt_flags:
+ libs.append('-lpython' + pyver + sys.abiflags)
+ else:
+ libpython = getvar('LIBPYTHON')
+ if libpython:
+ libs.append(libpython)
+ libs.extend(getvar('LIBS').split() + getvar('SYSLIBS').split())
+
+ # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+ # shared library in prefix/lib/.
+ if opt == '--ldflags':
+ if not getvar('Py_ENABLE_SHARED'):
+ libs.insert(0, '-L' + getvar('LIBPL'))
+ print(' '.join(libs))
+
+ elif opt == '--extension-suffix':
+ print(getvar('EXT_SUFFIX'))
+
+ elif opt == '--abiflags':
+ print(sys.abiflags)
+
+ elif opt == '--configdir':
+ print(getvar('LIBPL'))
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/python.o b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/python.o
new file mode 100644
index 0000000000000000000000000000000000000000..8a5efa81ce9219e3da78bb14346432af2779f81a
Binary files /dev/null and b/physworld_p1_20261018/envs/p1/lib/python3.11/config-3.11-x86_64-linux-gnu/python.o differ
diff --git a/physworld_p1_20261018/envs/p1/lib/python3.11/configparser.py b/physworld_p1_20261018/envs/p1/lib/python3.11/configparser.py
new file mode 100644
index 0000000000000000000000000000000000000000..a54f6ab236d4e8aa7ddeb059dbb2b1db5ec2cdec
--- /dev/null
+++ b/physworld_p1_20261018/envs/p1/lib/python3.11/configparser.py
@@ -0,0 +1,1392 @@
+"""Configuration file parser.
+
+A configuration file consists of sections, lead by a "[section]" header,
+and followed by "name: value" entries, with continuations and such in
+the style of RFC 822.
+
+Intrinsic defaults can be specified by passing them into the
+ConfigParser constructor as a dictionary.
+
+class:
+
+ConfigParser -- responsible for parsing a list of
+ configuration files, and managing the parsed database.
+
+ methods:
+
+ __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
+ delimiters=('=', ':'), comment_prefixes=('#', ';'),
+ inline_comment_prefixes=None, strict=True,
+ empty_lines_in_values=True, default_section='DEFAULT',
+ interpolation=, converters=):
+
+ Create the parser. When `defaults` is given, it is initialized into the
+ dictionary or intrinsic defaults. The keys must be strings, the values
+ must be appropriate for %()s string interpolation.
+
+ When `dict_type` is given, it will be used to create the dictionary
+ objects for the list of sections, for the options within a section, and
+ for the default values.
+
+ When `delimiters` is given, it will be used as the set of substrings
+ that divide keys from values.
+
+ When `comment_prefixes` is given, it will be used as the set of
+ substrings that prefix comments in empty lines. Comments can be
+ indented.
+
+ When `inline_comment_prefixes` is given, it will be used as the set of
+ substrings that prefix comments in non-empty lines.
+
+ When `strict` is True, the parser won't allow for any section or option
+ duplicates while reading from a single source (file, string or
+ dictionary). Default is True.
+
+ When `empty_lines_in_values` is False (default: True), each empty line
+ marks the end of an option. Otherwise, internal empty lines of
+ a multiline option are kept as part of the value.
+
+ When `allow_no_value` is True (default: False), options without
+ values are accepted; the value presented for these is None.
+
+ When `default_section` is given, the name of the special section is
+ named accordingly. By default it is called ``"DEFAULT"`` but this can
+ be customized to point to any other valid section name. Its current
+ value can be retrieved using the ``parser_instance.default_section``
+ attribute and may be modified at runtime.
+
+ When `interpolation` is given, it should be an Interpolation subclass
+ instance. It will be used as the handler for option value
+ pre-processing when using getters. RawConfigParser objects don't do
+ any sort of interpolation, whereas ConfigParser uses an instance of
+ BasicInterpolation. The library also provides a ``zc.buildout``
+ inspired ExtendedInterpolation implementation.
+
+ When `converters` is given, it should be a dictionary where each key
+ represents the name of a type converter and each value is a callable
+ implementing the conversion from string to the desired datatype. Every
+ converter gets its corresponding get*() method on the parser object and
+ section proxies.
+
+ sections()
+ Return all the configuration section names, sans DEFAULT.
+
+ has_section(section)
+ Return whether the given section exists.
+
+ has_option(section, option)
+ Return whether the given option exists in the given section.
+
+ options(section)
+ Return list of configuration options for the named section.
+
+ read(filenames, encoding=None)
+ Read and parse the iterable of named configuration files, given by
+ name. A single filename is also allowed. Non-existing files
+ are ignored. Return list of successfully read files.
+
+ read_file(f, filename=None)
+ Read and parse one configuration file, given as a file object.
+ The filename defaults to f.name; it is only used in error
+ messages (if f has no `name` attribute, the string `??>` is used).
+
+ read_string(string)
+ Read configuration from a given string.
+
+ read_dict(dictionary)
+ Read configuration from a dictionary. Keys are section names,
+ values are dictionaries with keys and values that should be present
+ in the section. If the used dictionary type preserves order, sections
+ and their keys will be added in order. Values are automatically
+ converted to strings.
+
+ get(section, option, raw=False, vars=None, fallback=_UNSET)
+ Return a string value for the named option. All % interpolations are
+ expanded in the return values, based on the defaults passed into the
+ constructor and the DEFAULT section. Additional substitutions may be
+ provided using the `vars` argument, which must be a dictionary whose
+ contents override any pre-existing defaults. If `option` is a key in
+ `vars`, the value from `vars` is used.
+
+ getint(section, options, raw=False, vars=None, fallback=_UNSET)
+ Like get(), but convert value to an integer.
+
+ getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
+ Like get(), but convert value to a float.
+
+ getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
+ Like get(), but convert value to a boolean (currently case
+ insensitively defined as 0, false, no, off for False, and 1, true,
+ yes, on for True). Returns False or True.
+
+ items(section=_UNSET, raw=False, vars=None)
+ If section is given, return a list of tuples with (name, value) for
+ each option in the section. Otherwise, return a list of tuples with
+ (section_name, section_proxy) for each section, including DEFAULTSECT.
+
+ remove_section(section)
+ Remove the given file section and all its options.
+
+ remove_option(section, option)
+ Remove the given option from the given section.
+
+ set(section, option, value)
+ Set the given option.
+
+ write(fp, space_around_delimiters=True)
+ Write the configuration state in .ini format. If
+ `space_around_delimiters` is True (the default), delimiters
+ between keys and values are surrounded by spaces.
+"""
+
+from collections.abc import MutableMapping
+from collections import ChainMap as _ChainMap
+import functools
+import io
+import itertools
+import os
+import re
+import sys
+import warnings
+
+__all__ = ["NoSectionError", "DuplicateOptionError", "DuplicateSectionError",
+ "NoOptionError", "InterpolationError", "InterpolationDepthError",
+ "InterpolationMissingOptionError", "InterpolationSyntaxError",
+ "ParsingError", "MissingSectionHeaderError",
+ "ConfigParser", "SafeConfigParser", "RawConfigParser",
+ "Interpolation", "BasicInterpolation", "ExtendedInterpolation",
+ "LegacyInterpolation", "SectionProxy", "ConverterMapping",
+ "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"]
+
+_default_dict = dict
+DEFAULTSECT = "DEFAULT"
+
+MAX_INTERPOLATION_DEPTH = 10
+
+
+
+# exception classes
+class Error(Exception):
+ """Base class for ConfigParser exceptions."""
+
+ def __init__(self, msg=''):
+ self.message = msg
+ Exception.__init__(self, msg)
+
+ def __repr__(self):
+ return self.message
+
+ __str__ = __repr__
+
+
+class NoSectionError(Error):
+ """Raised when no section matches a requested option."""
+
+ def __init__(self, section):
+ Error.__init__(self, 'No section: %r' % (section,))
+ self.section = section
+ self.args = (section, )
+
+
+class DuplicateSectionError(Error):
+ """Raised when a section is repeated in an input source.
+
+ Possible repetitions that raise this exception are: multiple creation
+ using the API or in strict parsers when a section is found more than once
+ in a single input file, string or dictionary.
+ """
+
+ def __init__(self, section, source=None, lineno=None):
+ msg = [repr(section), " already exists"]
+ if source is not None:
+ message = ["While reading from ", repr(source)]
+ if lineno is not None:
+ message.append(" [line {0:2d}]".format(lineno))
+ message.append(": section ")
+ message.extend(msg)
+ msg = message
+ else:
+ msg.insert(0, "Section ")
+ Error.__init__(self, "".join(msg))
+ self.section = section
+ self.source = source
+ self.lineno = lineno
+ self.args = (section, source, lineno)
+
+
+class DuplicateOptionError(Error):
+ """Raised by strict parsers when an option is repeated in an input source.
+
+ Current implementation raises this exception only when an option is found
+ more than once in a single file, string or dictionary.
+ """
+
+ def __init__(self, section, option, source=None, lineno=None):
+ msg = [repr(option), " in section ", repr(section),
+ " already exists"]
+ if source is not None:
+ message = ["While reading from ", repr(source)]
+ if lineno is not None:
+ message.append(" [line {0:2d}]".format(lineno))
+ message.append(": option ")
+ message.extend(msg)
+ msg = message
+ else:
+ msg.insert(0, "Option ")
+ Error.__init__(self, "".join(msg))
+ self.section = section
+ self.option = option
+ self.source = source
+ self.lineno = lineno
+ self.args = (section, option, source, lineno)
+
+
+class NoOptionError(Error):
+ """A requested option was not found."""
+
+ def __init__(self, option, section):
+ Error.__init__(self, "No option %r in section: %r" %
+ (option, section))
+ self.option = option
+ self.section = section
+ self.args = (option, section)
+
+
+class InterpolationError(Error):
+ """Base class for interpolation-related exceptions."""
+
+ def __init__(self, option, section, msg):
+ Error.__init__(self, msg)
+ self.option = option
+ self.section = section
+ self.args = (option, section, msg)
+
+
+class InterpolationMissingOptionError(InterpolationError):
+ """A string substitution required a setting which was not available."""
+
+ def __init__(self, option, section, rawval, reference):
+ msg = ("Bad value substitution: option {!r} in section {!r} contains "
+ "an interpolation key {!r} which is not a valid option name. "
+ "Raw value: {!r}".format(option, section, reference, rawval))
+ InterpolationError.__init__(self, option, section, msg)
+ self.reference = reference
+ self.args = (option, section, rawval, reference)
+
+
+class InterpolationSyntaxError(InterpolationError):
+ """Raised when the source text contains invalid syntax.
+
+ Current implementation raises this exception when the source text into
+ which substitutions are made does not conform to the required syntax.
+ """
+
+
+class InterpolationDepthError(InterpolationError):
+ """Raised when substitutions are nested too deeply."""
+
+ def __init__(self, option, section, rawval):
+ msg = ("Recursion limit exceeded in value substitution: option {!r} "
+ "in section {!r} contains an interpolation key which "
+ "cannot be substituted in {} steps. Raw value: {!r}"
+ "".format(option, section, MAX_INTERPOLATION_DEPTH,
+ rawval))
+ InterpolationError.__init__(self, option, section, msg)
+ self.args = (option, section, rawval)
+
+
+class ParsingError(Error):
+ """Raised when a configuration file does not follow legal syntax."""
+
+ def __init__(self, source=None, filename=None):
+ # Exactly one of `source'/`filename' arguments has to be given.
+ # `filename' kept for compatibility.
+ if filename and source:
+ raise ValueError("Cannot specify both `filename' and `source'. "
+ "Use `source'.")
+ elif not filename and not source:
+ raise ValueError("Required argument `source' not given.")
+ elif filename:
+ source = filename
+ Error.__init__(self, 'Source contains parsing errors: %r' % source)
+ self.source = source
+ self.errors = []
+ self.args = (source, )
+
+ @property
+ def filename(self):
+ """Deprecated, use `source'."""
+ warnings.warn(
+ "The 'filename' attribute will be removed in Python 3.12. "
+ "Use 'source' instead.",
+ DeprecationWarning, stacklevel=2
+ )
+ return self.source
+
+ @filename.setter
+ def filename(self, value):
+ """Deprecated, user `source'."""
+ warnings.warn(
+ "The 'filename' attribute will be removed in Python 3.12. "
+ "Use 'source' instead.",
+ DeprecationWarning, stacklevel=2
+ )
+ self.source = value
+
+ def append(self, lineno, line):
+ self.errors.append((lineno, line))
+ self.message += '\n\t[line %2d]: %s' % (lineno, line)
+
+
+class MissingSectionHeaderError(ParsingError):
+ """Raised when a key-value pair is found before any section header."""
+
+ def __init__(self, filename, lineno, line):
+ Error.__init__(
+ self,
+ 'File contains no section headers.\nfile: %r, line: %d\n%r' %
+ (filename, lineno, line))
+ self.source = filename
+ self.lineno = lineno
+ self.line = line
+ self.args = (filename, lineno, line)
+
+
+# Used in parser getters to indicate the default behaviour when a specific
+# option is not found it to raise an exception. Created to enable `None` as
+# a valid fallback value.
+_UNSET = object()
+
+
+class Interpolation:
+ """Dummy interpolation that passes the value through with no changes."""
+
+ def before_get(self, parser, section, option, value, defaults):
+ return value
+
+ def before_set(self, parser, section, option, value):
+ return value
+
+ def before_read(self, parser, section, option, value):
+ return value
+
+ def before_write(self, parser, section, option, value):
+ return value
+
+
+class BasicInterpolation(Interpolation):
+ """Interpolation as implemented in the classic ConfigParser.
+
+ The option values can contain format strings which refer to other values in
+ the same section, or values in the special default section.
+
+ For example:
+
+ something: %(dir)s/whatever
+
+ would resolve the "%(dir)s" to the value of dir. All reference
+ expansions are done late, on demand. If a user needs to use a bare % in
+ a configuration file, she can escape it by writing %%. Other % usage
+ is considered a user error and raises `InterpolationSyntaxError`."""
+
+ _KEYCRE = re.compile(r"%\(([^)]+)\)s")
+
+ def before_get(self, parser, section, option, value, defaults):
+ L = []
+ self._interpolate_some(parser, option, L, value, section, defaults, 1)
+ return ''.join(L)
+
+ def before_set(self, parser, section, option, value):
+ tmp_value = value.replace('%%', '') # escaped percent signs
+ tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
+ if '%' in tmp_value:
+ raise ValueError("invalid interpolation syntax in %r at "
+ "position %d" % (value, tmp_value.find('%')))
+ return value
+
+ def _interpolate_some(self, parser, option, accum, rest, section, map,
+ depth):
+ rawval = parser.get(section, option, raw=True, fallback=rest)
+ if depth > MAX_INTERPOLATION_DEPTH:
+ raise InterpolationDepthError(option, section, rawval)
+ while rest:
+ p = rest.find("%")
+ if p < 0:
+ accum.append(rest)
+ return
+ if p > 0:
+ accum.append(rest[:p])
+ rest = rest[p:]
+ # p is no longer used
+ c = rest[1:2]
+ if c == "%":
+ accum.append("%")
+ rest = rest[2:]
+ elif c == "(":
+ m = self._KEYCRE.match(rest)
+ if m is None:
+ raise InterpolationSyntaxError(option, section,
+ "bad interpolation variable reference %r" % rest)
+ var = parser.optionxform(m.group(1))
+ rest = rest[m.end():]
+ try:
+ v = map[var]
+ except KeyError:
+ raise InterpolationMissingOptionError(
+ option, section, rawval, var) from None
+ if "%" in v:
+ self._interpolate_some(parser, option, accum, v,
+ section, map, depth + 1)
+ else:
+ accum.append(v)
+ else:
+ raise InterpolationSyntaxError(
+ option, section,
+ "'%%' must be followed by '%%' or '(', "
+ "found: %r" % (rest,))
+
+
+class ExtendedInterpolation(Interpolation):
+ """Advanced variant of interpolation, supports the syntax used by
+ `zc.buildout`. Enables interpolation between sections."""
+
+ _KEYCRE = re.compile(r"\$\{([^}]+)\}")
+
+ def before_get(self, parser, section, option, value, defaults):
+ L = []
+ self._interpolate_some(parser, option, L, value, section, defaults, 1)
+ return ''.join(L)
+
+ def before_set(self, parser, section, option, value):
+ tmp_value = value.replace('$$', '') # escaped dollar signs
+ tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
+ if '$' in tmp_value:
+ raise ValueError("invalid interpolation syntax in %r at "
+ "position %d" % (value, tmp_value.find('$')))
+ return value
+
+ def _interpolate_some(self, parser, option, accum, rest, section, map,
+ depth):
+ rawval = parser.get(section, option, raw=True, fallback=rest)
+ if depth > MAX_INTERPOLATION_DEPTH:
+ raise InterpolationDepthError(option, section, rawval)
+ while rest:
+ p = rest.find("$")
+ if p < 0:
+ accum.append(rest)
+ return
+ if p > 0:
+ accum.append(rest[:p])
+ rest = rest[p:]
+ # p is no longer used
+ c = rest[1:2]
+ if c == "$":
+ accum.append("$")
+ rest = rest[2:]
+ elif c == "{":
+ m = self._KEYCRE.match(rest)
+ if m is None:
+ raise InterpolationSyntaxError(option, section,
+ "bad interpolation variable reference %r" % rest)
+ path = m.group(1).split(':')
+ rest = rest[m.end():]
+ sect = section
+ opt = option
+ try:
+ if len(path) == 1:
+ opt = parser.optionxform(path[0])
+ v = map[opt]
+ elif len(path) == 2:
+ sect = path[0]
+ opt = parser.optionxform(path[1])
+ v = parser.get(sect, opt, raw=True)
+ else:
+ raise InterpolationSyntaxError(
+ option, section,
+ "More than one ':' found: %r" % (rest,))
+ except (KeyError, NoSectionError, NoOptionError):
+ raise InterpolationMissingOptionError(
+ option, section, rawval, ":".join(path)) from None
+ if "$" in v:
+ self._interpolate_some(parser, opt, accum, v, sect,
+ dict(parser.items(sect, raw=True)),
+ depth + 1)
+ else:
+ accum.append(v)
+ else:
+ raise InterpolationSyntaxError(
+ option, section,
+ "'$' must be followed by '$' or '{', "
+ "found: %r" % (rest,))
+
+
+class LegacyInterpolation(Interpolation):
+ """Deprecated interpolation used in old versions of ConfigParser.
+ Use BasicInterpolation or ExtendedInterpolation instead."""
+
+ _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ warnings.warn(
+ "LegacyInterpolation has been deprecated since Python 3.2 "
+ "and will be removed from the configparser module in Python 3.13. "
+ "Use BasicInterpolation or ExtendedInterpolation instead.",
+ DeprecationWarning, stacklevel=2
+ )
+
+ def before_get(self, parser, section, option, value, vars):
+ rawval = value
+ depth = MAX_INTERPOLATION_DEPTH
+ while depth: # Loop through this until it's done
+ depth -= 1
+ if value and "%(" in value:
+ replace = functools.partial(self._interpolation_replace,
+ parser=parser)
+ value = self._KEYCRE.sub(replace, value)
+ try:
+ value = value % vars
+ except KeyError as e:
+ raise InterpolationMissingOptionError(
+ option, section, rawval, e.args[0]) from None
+ else:
+ break
+ if value and "%(" in value:
+ raise InterpolationDepthError(option, section, rawval)
+ return value
+
+ def before_set(self, parser, section, option, value):
+ return value
+
+ @staticmethod
+ def _interpolation_replace(match, parser):
+ s = match.group(1)
+ if s is None:
+ return match.group()
+ else:
+ return "%%(%s)s" % parser.optionxform(s)
+
+
+class RawConfigParser(MutableMapping):
+ """ConfigParser that does not do interpolation."""
+
+ # Regular expressions for parsing section headers and options
+ _SECT_TMPL = r"""
+ \[ # [
+ (?P.+) # very permissive!
+ \] # ]
+ """
+ _OPT_TMPL = r"""
+ (?P