Fix all Python Cookbook links (#22205)
diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst
index 6bf7814..6666d55 100644
--- a/Doc/library/bisect.rst
+++ b/Doc/library/bisect.rst
@@ -60,7 +60,7 @@
.. seealso::
`SortedCollection recipe
- <https://code.activestate.com/recipes/577197-sortedcollection/>`_ that uses
+ <https://github.com/ActiveState/code/tree/master/recipes/Python/577197_SortedCollection/recipe-577197.py>`_ that uses
bisect to build a full-featured collection class with straight-forward search
methods and support for a key-function. The keys are precomputed to save
unnecessary calls to the key function during searches.
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
index db0e25b..a603809 100644
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -308,7 +308,7 @@
.. seealso::
- * `OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an
+ * `OrderedSet recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576694_OrderedSet/recipe-576694.py>`_ for an
example built on :class:`MutableSet`.
* For more about ABCs, see the :mod:`abc` module and :pep:`3119`.
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index f538da5..a7d01b3 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -135,12 +135,12 @@
:attr:`~collections.ChainMap.parents` property.
* The `Nested Contexts recipe
- <https://code.activestate.com/recipes/577434/>`_ has options to control
+ <https://github.com/ActiveState/code/tree/master/recipes/Python/577434_Nested_contexts__chamapping/recipe-577434.py>`_ has options to control
whether writes and other mutations apply only to the first mapping or to
any mapping in the chain.
* A `greatly simplified read-only version of Chainmap
- <https://code.activestate.com/recipes/305268/>`_.
+ <https://github.com/ActiveState/code/tree/master/recipes/Python/305268_Chained_map_lookups/recipe-305268.py>`_.
:class:`ChainMap` Examples and Recipes
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index aa08988..009b797 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -633,7 +633,7 @@
work.
* `Simple version control recipe
- <https://code.activestate.com/recipes/576729/>`_ for a small application
+ <https://github.com/ActiveState/code/tree/master/recipes/Python/576729_Simple_Version_Control/recipe-576729.py>`_ for a small application
built with :class:`SequenceMatcher`.
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index bbf6464..f152c45 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -123,7 +123,7 @@
For further discussion and two alternative approaches, see the `ASPN cookbook
recipes for accurate floating point summation
- <https://code.activestate.com/recipes/393090/>`_\.
+ <https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py>`_\.
.. function:: gcd(*integers)
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index 0cdf0a6..4e97b1d 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -57,7 +57,7 @@
`Complementary-Multiply-with-Carry recipe
- <https://code.activestate.com/recipes/576707/>`_ for a compatible alternative
+ <https://github.com/ActiveState/code/tree/master/recipes/Python/576707_Long_period_random_number/recipe-576707.py>`_ for a compatible alternative
random number generator with a long period and comparatively simple update
operations.
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
index f08c581..a94255b 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -75,7 +75,7 @@
.. seealso::
- `Persistent dictionary recipe <https://code.activestate.com/recipes/576642/>`_
+ `Persistent dictionary recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576642_Persistent_dict_multiple_standard_file/recipe-576642.py>`_
with widely supported storage formats and having the speed of native
dictionaries.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 0ffe7b7..2eee22c 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1404,7 +1404,7 @@
.. seealso::
- * The `linspace recipe <http://code.activestate.com/recipes/579000/>`_
+ * The `linspace recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/579000_Equallyspaced_numbers_linspace/recipe-579000.py>`_
shows how to implement a lazy version of range suitable for floating
point applications.
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index d201d70..aa417ed 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -679,7 +679,7 @@
additional garbage collector overhead if the object is managed by the garbage
collector.
- See `recursive sizeof recipe <https://code.activestate.com/recipes/577504>`_
+ See `recursive sizeof recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/577504_Compute_Memory_footprint_object_its/recipe-577504.py>`_
for an example of using :func:`getsizeof` recursively to find the size of
containers and all their contents.