internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: googleapis/google-auth-library-python

Issue:
cryptography int_from_bytes is deprecated
Error: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead

https://github.com/googleapis/google-auth-library-python/blob/77d7f1b6c4bfde594e58bd67891633fc3e9515c2/google/auth/crypt/es256.py#L56

#### Environment details

  - OS: Ubuntu 20.04.3
  - Python version: 3.8.10
  - pip version: 20.0.2
  - `google-auth` version: 2.3.2

#### Steps to reproduce

  1. install google auth using pip
  2. Python: `from google.oauth2 import service_account`



Discussion:
@arithmetic1728 I think this got re-added with the 2.7 re-shuffle for gcloud. Can the logic be adjusted so Python 3 users don't see the deprecating warning? (original fix was in https://github.com/googleapis/google-auth-library-python/pull/846 and #848)

Resolving patch:
diff --git a/google/auth/_helpers.py b/google/auth/_helpers.py
--- a/google/auth/_helpers.py
+++ b/google/auth/_helpers.py
@@ -17,6 +17,7 @@
 import base64
 import calendar
 import datetime
+import sys
 
 import six
 from six.moves import urllib
@@ -233,3 +234,12 @@ def unpadded_urlsafe_b64encode(value):
         Union[str|bytes]: The encoded value
     """
     return base64.urlsafe_b64encode(value).rstrip(b"=")
+
+
+def is_python_3():
+    """Check if the Python interpreter is Python 2 or 3.
+
+    Returns:
+        bool: True if the Python interpreter is Python 3 and False otherwise.
+    """
+    return sys.version_info > (3, 0)
diff --git a/google/auth/crypt/es256.py b/google/auth/crypt/es256.py
--- a/google/auth/crypt/es256.py
+++ b/google/auth/crypt/es256.py
@@ -53,8 +53,16 @@ def verify(self, message, signature):
         sig_bytes = _helpers.to_bytes(signature)
         if len(sig_bytes) != 64:
             return False
-        r = utils.int_from_bytes(sig_bytes[:32], byteorder="big")
-        s = utils.int_from_bytes(sig_bytes[32:], byteorder="big")
+        r = (
+            int.from_bytes(sig_bytes[:32], byteorder="big")
+            if _helpers.is_python_3()
+            else utils.int_from_bytes(sig_bytes[:32], byteorder="big")
+        )
+        s = (
+            int.from_bytes(sig_bytes[32:], byteorder="big")
+            if _helpers.is_python_3()
+            else utils.int_from_bytes(sig_bytes[32:], byteorder="big")
+        )
         asn1_sig = encode_dss_signature(r, s)
 
         message = _helpers.to_bytes(message)
@@ -121,7 +129,11 @@ def sign(self, message):
 
         # Convert ASN1 encoded signature to (r||s) raw signature.
         (r, s) = decode_dss_signature(asn1_signature)
-        return utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32)
+        return (
+            (r.to_bytes(32, byteorder="big") + s.to_bytes(32, byteorder="big"))
+            if _helpers.is_python_3()
+            else (utils.int_to_bytes(r, 32) + utils.int_to_bytes(s, 32))
+        )
 
     @classmethod
     def from_string(cls, key, key_id=None):


Test patch:
Repository: googleapis/google-auth-library-python

Issue:
new cachetools version (5.0.0+) can't work with google-auth
`cachetools` has released a new version (5.0.0) which conflicts with google-auth requirements of it being <5, this prevents updates to the `cachetools` package and pose a potential security concern (as updates are no longer possible to it)

```
The conflict is caused by:
    The user requested cachetools==5.0.0
    google-auth 2.3.3 depends on cachetools<5.0 and >=2.0.0
```

issue seems in https://github.com/googleapis/google-auth-library-python/blob/3c3fbf40b07e090f2be7fac5b304dbf438b5cd6c/setup.py#L23 

#### Environment details

  - OS: alpine3.11
  - Python version: python:3.8.6
  - pip version: 20.3.3
  - `google-auth` version: 2.3.3 (latest at time of writing)

#### Steps to reproduce

  1. try pip install using latest `cachetools` with latest `google-auth`
  2. pip fails



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
 
 
 DEPENDENCIES = (
-    "cachetools>=2.0.0,<5.0",
+    "cachetools>=2.0.0,<6.0",
     "pyasn1-modules>=0.2.1",
     # rsa==4.5 is the last version to support 2.7
     # https://github.com/sybrenstuvel/python-rsa/issues/152#issuecomment-643470233


Test patch:
Repository: googleapis/google-auth-library-python

Issue:
Mandatory urllib3 dependency introduced without declaration by 2.4.0 release
@arithmetic1728 I think https://github.com/googleapis/google-auth-library-python/pull/948 may have broken the 2.4.0 release. `google-auth` [does not declare a dependency on `urllib3`](https://github.com/googleapis/google-auth-library-python/blob/88580b441fc20e9677433e1d01f07a466317df61/setup.py#L22). `grpcio` is seeing this issue in CI:

```
  ...
  File "/var/local/git/grpc/src/python/grpcio_tests/tests/_loader.py", line 74, in walk_packages
    module = importer.find_module(module_name).load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/local/git/grpc/src/python/grpcio_tests/tests_aio/interop/client.py", line 23, in <module>
    from tests.interop import client as interop_client_lib
  File "/var/local/git/grpc/src/python/grpcio_tests/tests/interop/client.py", line 24, in <module>
    from tests.interop import methods
  File "/var/local/git/grpc/src/python/grpcio_tests/tests/interop/methods.py", line 33, in <module>
    from google.auth.transport import requests as google_auth_transport_requests
  File "/var/local/git/grpc/py38/lib/python3.8/site-packages/google/auth/transport/requests.py", line 40, in <module>
    from urllib3.util.ssl_ import (
ModuleNotFoundError: No module named 'urllib3'
```


Discussion:
@arithmetic1728 @parthea 

Resolving patch:
diff --git a/google/auth/transport/requests.py b/google/auth/transport/requests.py
--- a/google/auth/transport/requests.py
+++ b/google/auth/transport/requests.py
@@ -36,10 +36,10 @@
     )
 import requests.adapters  # pylint: disable=ungrouped-imports
 import requests.exceptions  # pylint: disable=ungrouped-imports
-import six  # pylint: disable=ungrouped-imports
-from urllib3.util.ssl_ import (
+from requests.packages.urllib3.util.ssl_ import (  # type: ignore
     create_urllib3_context,
 )  # pylint: disable=ungrouped-imports
+import six  # pylint: disable=ungrouped-imports
 
 from google.auth import environment_vars
 from google.auth import exceptions


Test patch:
diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc
Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ
Repository: googleapis/google-auth-library-python

Issue:
support useEmailAzp in service account iam.generateIdToken flow
after useEmailAzp is available 


Discussion:

Resolving patch:
diff --git a/google/oauth2/_client.py b/google/oauth2/_client.py
--- a/google/oauth2/_client.py
+++ b/google/oauth2/_client.py
@@ -331,7 +331,7 @@ def call_iam_generate_id_token_endpoint(request, signer_email, audience, access_
     Returns:
         Tuple[str, datetime]: The ID token and expiration.
     """
-    body = {"audience": audience, "includeEmail": "true"}
+    body = {"audience": audience, "includeEmail": "true", "useEmailAzp": "true"}
 
     response_data = _token_endpoint_request(
         request,
diff --git a/google/oauth2/service_account.py b/google/oauth2/service_account.py
--- a/google/oauth2/service_account.py
+++ b/google/oauth2/service_account.py
@@ -743,10 +743,9 @@ def _refresh_with_iam_endpoint(self, request):
         request to IAM generateIdToken endpoint. The request body is:
             {
                 "audience": self._target_audience,
-                "includeEmail": "true"
+                "includeEmail": "true",
+                "useEmailAzp": "true",
             }
-        TODO: add "set_azp_to_email": "true" once it's ready from server side.
-        https://github.com/googleapis/google-auth-library-python/issues/1263
 
         If the request is succesfully, it will return {"token":"the ID token"},
         and we can extract the ID token and compute its expiry.


Test patch:
diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc
Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ
diff --git a/tests/oauth2/test__client.py b/tests/oauth2/test__client.py
--- a/tests/oauth2/test__client.py
+++ b/tests/oauth2/test__client.py
@@ -326,6 +326,7 @@ def test_call_iam_generate_id_token_endpoint():
     response_body = json.loads(request.call_args[1]["body"])
     assert response_body["audience"] == "fake_audience"
     assert response_body["includeEmail"] == "true"
+    assert response_body["useEmailAzp"] == "true"
 
     # Check result
     assert token == id_token
Repository: googleapis/google-auth-library-python

Issue:
Invalid `dev` version identifiers in `setup.py`
There is a bunch of ~invalid~ version matchers (edit: valid, but not parsed correctly by distlib) in `setup.py`.  [PEP 440](https://peps.python.org/pep-0440/) states:

> The canonical public version identifiers MUST comply with the following scheme:
> `[N!]N(.N)*[{a|b|rc}N][.postN][.devN]`

So you are missing a dot and a number in every version identifier that contains the string `dev`.

It is also considered bad practice to have an upper bound on package versions and installers like pip do not typically consider development versions in any case (unless explicitly told to).

See: https://github.com/googleapis/google-api-python-client/issues/2151


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -31,9 +31,9 @@
 )
 
 extras = {
-    "aiohttp": ["aiohttp >= 3.6.2, < 4.0.0dev", "requests >= 2.20.0, < 3.0.0dev"],
+    "aiohttp": ["aiohttp >= 3.6.2, < 4.0.0.dev0", "requests >= 2.20.0, < 3.0.0.dev0"],
     "pyopenssl": ["pyopenssl>=20.0.0", "cryptography>=38.0.3"],
-    "requests": "requests >= 2.20.0, < 3.0.0dev",
+    "requests": "requests >= 2.20.0, < 3.0.0.dev0",
     "reauth": "pyu2f>=0.1.5",
     # Enterprise cert only works for OpenSSL 1.1.1. Newer versions of these
     # dependencies are built with OpenSSL 3.0 so we need to fix the version.


Test patch:
diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc
Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ
Repository: googleapis/google-auth-library-python

Issue:
Support for urllib3 2
Hi - I see that urllib3 was pinned to <2.0 in #1283. Is there any plan to support 2.0 and above?

Thanks,
Tom


Discussion:
We are working on a plan to remove this limitation but there is no timeline for when that will happen.

Resolving patch:
diff --git a/google/auth/transport/urllib3.py b/google/auth/transport/urllib3.py
--- a/google/auth/transport/urllib3.py
+++ b/google/auth/transport/urllib3.py
@@ -179,7 +179,7 @@ def _make_mutual_tls_http(cert, key):
     return http
 
 
-class AuthorizedHttp(urllib3.request.RequestMethods):
+class AuthorizedHttp(urllib3._request_methods.RequestMethods):  # type: ignore
     """A urllib3 HTTP class with credentials.
 
     This class is used to perform requests to API endpoints that require
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -25,8 +25,7 @@
     # rsa==4.5 is the last version to support 2.7
     # https://github.com/sybrenstuvel/python-rsa/issues/152#issuecomment-643470233
     "rsa>=3.1.4,<5",
-    # install enum34 to support 2.7. enum34 only works up to python version 3.3.
-    "urllib3<2.0",
+    "urllib3>=2.0.5",
 )
 
 extras = {


Test patch:
diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc
Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ
Repository: googleapis/google-auth-library-python

Issue:
deprecation notice for 3.7 modifies global state (user warning filters) as import side-effect
It is impossible to filter Python37DeprecationWarning after PR https://github.com/googleapis/google-auth-library-python/pull/1371.

Custom libraries should not configure warning filters, because it is user project's global state. Most of the times you cannot modify import order and insert new warning filters after your library modifies them.

#### Environment details

  - OS: Ubuntu 22.04.3 LTS linux 5.15.0-89-generic
  - Python version: 3.7.17
  - pip version: 23.3.1
  - `google-auth` version: 2.24.0

#### Steps to reproduce

  1. install google-auth into your python3.7 project
  2. configure filterwarning rule `ignore::DeprecationWarning` in pytest.ini
  3. use google.auth or google.oauth2 somewhere in your project
  4. run pytest
  5. get Python37DeprecationWarning that you cannot filter 


Discussion:

Resolving patch:
diff --git a/google/auth/__init__.py b/google/auth/__init__.py
--- a/google/auth/__init__.py
+++ b/google/auth/__init__.py
@@ -49,9 +49,6 @@ class Python37DeprecationWarning(DeprecationWarning):  # pragma: NO COVER
         "for Python 3.7. More details about Python 3.7 support "
         "can be found at https://cloud.google.com/python/docs/python37-sunset/"
     )
-
-    # Configure the Python37DeprecationWarning warning so that it is only emitted once.
-    warnings.simplefilter("once", Python37DeprecationWarning)
     warnings.warn(message, Python37DeprecationWarning)
 
 # Set default logging handler to avoid "No handler found" warnings.
diff --git a/google/oauth2/__init__.py b/google/oauth2/__init__.py
--- a/google/oauth2/__init__.py
+++ b/google/oauth2/__init__.py
@@ -35,6 +35,4 @@ class Python37DeprecationWarning(DeprecationWarning):  # pragma: NO COVER
         "for Python 3.7. More details about Python 3.7 support "
         "can be found at https://cloud.google.com/python/docs/python37-sunset/"
     )
-    # Configure the Python37DeprecationWarning warning so that it is only emitted once.
-    warnings.simplefilter("once", Python37DeprecationWarning)
     warnings.warn(message, Python37DeprecationWarning)


Test patch:
diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc
Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ
Repository: googleapis/google-auth-library-python

Issue:
Broken link in Python37DeprecationWarning deprecation message
```
    warnings.warn(message, Python37DeprecationWarning)
E   google.auth.Python37DeprecationWarning: After January 1, 2024, new releases of this library will drop support for Python 3.7. More details about Python 3.7 support can be found at https://cloud.google.com/python/docs/python37-sunset/
```
The link https://cloud.google.com/python/docs/python37-sunset/ results in 404. We should remove it from the deprecation message.


Discussion:

Resolving patch:
diff --git a/google/auth/__init__.py b/google/auth/__init__.py
--- a/google/auth/__init__.py
+++ b/google/auth/__init__.py
@@ -35,8 +35,7 @@
 class Python37DeprecationWarning(DeprecationWarning):  # pragma: NO COVER
     """
     Deprecation warning raised when Python 3.7 runtime is detected.
-    Python 3.7 support will be dropped after January 1, 2024. See
-    https://cloud.google.com/python/docs/python37-sunset/ for more information.
+    Python 3.7 support will be dropped after January 1, 2024.
     """
 
     pass
@@ -46,8 +45,7 @@ class Python37DeprecationWarning(DeprecationWarning):  # pragma: NO COVER
 if sys.version_info.major == 3 and sys.version_info.minor == 7:  # pragma: NO COVER
     message = (
         "After January 1, 2024, new releases of this library will drop support "
-        "for Python 3.7. More details about Python 3.7 support "
-        "can be found at https://cloud.google.com/python/docs/python37-sunset/"
+        "for Python 3.7."
     )
     warnings.warn(message, Python37DeprecationWarning)
 
diff --git a/google/oauth2/__init__.py b/google/oauth2/__init__.py
--- a/google/oauth2/__init__.py
+++ b/google/oauth2/__init__.py
@@ -21,8 +21,7 @@
 class Python37DeprecationWarning(DeprecationWarning):  # pragma: NO COVER
     """
     Deprecation warning raised when Python 3.7 runtime is detected.
-    Python 3.7 support will be dropped after January 1, 2024. See
-    https://cloud.google.com/python/docs/python37-sunset/ for more information.
+    Python 3.7 support will be dropped after January 1, 2024.
     """
 
     pass
@@ -32,7 +31,6 @@ class Python37DeprecationWarning(DeprecationWarning):  # pragma: NO COVER
 if sys.version_info.major == 3 and sys.version_info.minor == 7:  # pragma: NO COVER
     message = (
         "After January 1, 2024, new releases of this library will drop support "
-        "for Python 3.7. More details about Python 3.7 support "
-        "can be found at https://cloud.google.com/python/docs/python37-sunset/"
+        "for Python 3.7."
     )
     warnings.warn(message, Python37DeprecationWarning)


Test patch:
Repository: googleapis/google-auth-library-python

Issue:
OAuth2 RefreshError while refreshing access token in Docker
Google Sheets and Drive API connections suddenly stopped working two days ago. No code or credentials have changed. OAuth2 token refreshes work fine locally. However, when running within Docker, with access to same credentials file and tokens, I receive the following error.

 File "/google_sheets_connect.py", line 32, in <module>
    creds.refresh(Request())
  File "/usr/local/lib/python3.7/site-packages/google/oauth2/credentials.py", line 344, in refresh
    self._universe_domain
google.auth.exceptions.RefreshError: User credential refresh is only supported in the default googleapis.com universe domain, but the current universe domain is None. If you created the credential with an access token, it's likely that the provided token is expired now, please update your code with a valid token.


Discussion:
@arithmetic1728 can you take a look? 

Resolving patch:
diff --git a/google/oauth2/credentials.py b/google/oauth2/credentials.py
--- a/google/oauth2/credentials.py
+++ b/google/oauth2/credentials.py
@@ -180,7 +180,7 @@ def __setstate__(self, d):
         self._rapt_token = d.get("_rapt_token")
         self._enable_reauth_refresh = d.get("_enable_reauth_refresh")
         self._trust_boundary = d.get("_trust_boundary")
-        self._universe_domain = d.get("_universe_domain")
+        self._universe_domain = d.get("_universe_domain") or _DEFAULT_UNIVERSE_DOMAIN
         # The refresh_handler setter should be used to repopulate this.
         self._refresh_handler = None
 


Test patch:
diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc
Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ
diff --git a/tests/oauth2/test_credentials.py b/tests/oauth2/test_credentials.py
--- a/tests/oauth2/test_credentials.py
+++ b/tests/oauth2/test_credentials.py
@@ -913,6 +913,17 @@ def test_pickle_and_unpickle(self):
         for attr in list(creds.__dict__):
             assert getattr(creds, attr) == getattr(unpickled, attr)
 
+    def test_pickle_and_unpickle_universe_domain(self):
+        # old version of auth lib doesn't have _universe_domain, so the pickled
+        # cred doesn't have such a field.
+        creds = self.make_credentials()
+        del creds._universe_domain
+
+        unpickled = pickle.loads(pickle.dumps(creds))
+
+        # make sure the unpickled cred sets _universe_domain to default.
+        assert unpickled.universe_domain == "googleapis.com"
+
     def test_pickle_and_unpickle_with_refresh_handler(self):
         expected_expiry = _helpers.utcnow() + datetime.timedelta(seconds=2800)
         refresh_handler = mock.Mock(return_value=("TOKEN", expected_expiry))
Repository: TheAlgorithms/Python

Issue:
ProjectEuler -- Problem 1 -- solv2.py -- Error
For the Input ```1000``` I get ```233366.4```. The correct answer should be ```233168``` 
See [file](https://github.com/TheAlgorithms/Python/blob/master/Project%20Euler/Problem%2001/sol2.py)


Discussion:

Resolving patch:
diff --git a/Project Euler/Problem 01/sol2.py b/Project Euler/Problem 01/sol2.py
--- a/Project Euler/Problem 01/sol2.py	
+++ b/Project Euler/Problem 01/sol2.py	
@@ -11,10 +11,10 @@
     raw_input = input  # Python 3
 n = int(raw_input().strip())
 sum = 0
-terms = (n-1)/3
-sum+= ((terms)*(6+(terms-1)*3))/2 #sum of an A.P.
-terms = (n-1)/5
-sum+= ((terms)*(10+(terms-1)*5))/2
-terms = (n-1)/15
-sum-= ((terms)*(30+(terms-1)*15))/2
+terms = (n-1)//3
+sum+= ((terms)*(6+(terms-1)*3))//2 #sum of an A.P.
+terms = (n-1)//5
+sum+= ((terms)*(10+(terms-1)*5))//2
+terms = (n-1)//15
+sum-= ((terms)*(30+(terms-1)*15))//2
 print(sum)


Test patch:
Repository: TheAlgorithms/Python

Issue:
Bug report for radix sort
**Description**

if the test case for [`radix_sort.py`](https://github.com/TheAlgorithms/Python/blob/master/sorts/radix_sort.py) is `[104, 203, 308, 401]`, the result would be `[401, 203, 104, 308]`

It's wrong!

The reason is that if the `tmp` is always `0` in one loop, it will exit the loop. In other words, If the same digit of all numbers is 0, then the result may be wrong. The similar example like:
*Input*: `[2018, 33017, 24016]`
*Output*: `[24016, 33017, 2018]`
Wrong again!!

**Suggestion**

Do not use `maxLength` as a loop variable because the value of `maxLength` is related to `tmp`.

I think that by finding the maximum value of the array and assigning it to `max_digit`, using another variable `digit` with an initial value of 1 as the loop variable, each loop `digit`  is multiplied by 10, and exit the loops when the `digit` greater than `max_digit`, which can guarantee the correct number of loops.

And the complexity will be O(nk + n) . n is the size of input list and k is the digit length of the number.


Discussion:

Resolving patch:
diff --git a/sorts/radix_sort.py b/sorts/radix_sort.py
--- a/sorts/radix_sort.py
+++ b/sorts/radix_sort.py
@@ -1,28 +1,26 @@
 def radixsort(lst):
-  RADIX = 10
-  maxLength = False
-  tmp , placement = -1, 1
+    RADIX = 10
+    placement = 1
 
-  while not maxLength:
-    maxLength = True
-    # declare and initialize buckets
-    buckets = [list() for _ in range( RADIX )]
+    # get the maximum number
+    max_digit = max(lst)
 
-    # split lst between lists
-    for i in lst:
-      tmp = int((i / placement) % RADIX)
-      buckets[tmp].append(i)
+    while placement < max_digit:
+      # declare and initialize buckets
+      buckets = [list() for _ in range( RADIX )]
 
-      if maxLength and tmp > 0:
-        maxLength = False
+      # split lst between lists
+      for i in lst:
+        tmp = int((i / placement) % RADIX)
+        buckets[tmp].append(i)
 
-    # empty lists into lst array
-    a = 0
-    for b in range( RADIX ):
-      buck = buckets[b]
-      for i in buck:
-        lst[a] = i
-        a += 1
+      # empty lists into lst array
+      a = 0
+      for b in range( RADIX ):
+        buck = buckets[b]
+        for i in buck:
+          lst[a] = i
+          a += 1
 
-    # move to next
-    placement *= RADIX
+      # move to next
+      placement *= RADIX


Test patch:
Repository: TheAlgorithms/Python

Issue:
Unnecessary Loop 
https://github.com/TheAlgorithms/Python/blob/4e0184a41dd3e4838da484057d25e17234353da0/dynamic_programming/matrix_chain_order.py#L12-L15

`Line 12` creates a NxN Matrix that **contains 0**. So there is no need for `Line 14-15`


Discussion:

Resolving patch:
diff --git a/dynamic_programming/matrix_chain_order.py b/dynamic_programming/matrix_chain_order.py
--- a/dynamic_programming/matrix_chain_order.py
+++ b/dynamic_programming/matrix_chain_order.py
@@ -11,8 +11,6 @@ def MatrixChainOrder(array):
     N=len(array)
     Matrix=[[0 for x in range(N)] for x in range(N)]
     Sol=[[0 for x in range(N)] for x in range(N)]
-    for i in range(1,N):
-        Matrix[i][i]=0
 
     for ChainLength in range(2,N):
         for a in range(1,N-ChainLength+1):


Test patch: