repo_name
stringclasses
1 value
pr_number
int64
4.12k
11.2k
pr_title
stringlengths
9
107
pr_description
stringlengths
107
5.48k
author
stringlengths
4
18
date_created
timestamp[ns, tz=UTC]
date_merged
timestamp[ns, tz=UTC]
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
118
5.52k
before_content
stringlengths
0
7.93M
after_content
stringlengths
0
7.93M
label
int64
-1
1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
"""Matrix Exponentiation""" import timeit """ Matrix Exponentiation is a technique to solve linear recurrences in logarithmic time. You read more about it here: https://zobayer.blogspot.com/2010/11/matrix-exponentiation.html https://www.hackerearth.com/practice/notes/matrix-exponentiation-1/ """ class Matrix: d...
"""Matrix Exponentiation""" import timeit """ Matrix Exponentiation is a technique to solve linear recurrences in logarithmic time. You read more about it here: https://zobayer.blogspot.com/2010/11/matrix-exponentiation.html https://www.hackerearth.com/practice/notes/matrix-exponentiation-1/ """ class Matrix: d...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
# Conversion Conversion programs convert a type of data, a number from a numerical base or unit into one of another type, base or unit, e.g. binary to decimal, integer to string or foot to meters. * <https://en.wikipedia.org/wiki/Data_conversion> * <https://en.wikipedia.org/wiki/Transcoding>
# Conversion Conversion programs convert a type of data, a number from a numerical base or unit into one of another type, base or unit, e.g. binary to decimal, integer to string or foot to meters. * <https://en.wikipedia.org/wiki/Data_conversion> * <https://en.wikipedia.org/wiki/Transcoding>
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
""" Project Euler Problem 38: https://projecteuler.net/problem=38 Take the number 192 and multiply it by each of 1, 2, and 3: 192 × 1 = 192 192 × 2 = 384 192 × 3 = 576 By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3) The same c...
""" Project Euler Problem 38: https://projecteuler.net/problem=38 Take the number 192 and multiply it by each of 1, 2, and 3: 192 × 1 = 192 192 × 2 = 384 192 × 3 = 576 By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3) The same c...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
"""Convert a Decimal Number to a Binary Number.""" def decimal_to_binary_iterative(num: int) -> str: """ Convert an Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary_iterative(0) '0b0' >>> decimal_to_binary_iterative(2) '0b10' >>> decimal_to_binary_iterative(7) '0...
"""Convert a Decimal Number to a Binary Number.""" def decimal_to_binary_iterative(num: int) -> str: """ Convert an Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary_iterative(0) '0b0' >>> decimal_to_binary_iterative(2) '0b10' >>> decimal_to_binary_iterative(7) '0...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
""" Name scores Problem 22 Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a ...
""" Name scores Problem 22 Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a ...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
""" Implementation of iterative merge sort in Python Author: Aman Gupta For doctests run following command: python3 -m doctest -v iterative_merge_sort.py For manual testing run: python3 iterative_merge_sort.py """ from __future__ import annotations def merge(input_list: list, low: int, mid: int, high: int) -> list...
""" Implementation of iterative merge sort in Python Author: Aman Gupta For doctests run following command: python3 -m doctest -v iterative_merge_sort.py For manual testing run: python3 iterative_merge_sort.py """ from __future__ import annotations def merge(input_list: list, low: int, mid: int, high: int) -> list...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
""" Approximates the area under the curve using the trapezoidal rule """ from __future__ import annotations from collections.abc import Callable def trapezoidal_area( fnc: Callable[[float], float], x_start: float, x_end: float, steps: int = 100, ) -> float: """ Treats curve as a collection of...
""" Approximates the area under the curve using the trapezoidal rule """ from __future__ import annotations from collections.abc import Callable def trapezoidal_area( fnc: Callable[[float], float], x_start: float, x_end: float, steps: int = 100, ) -> float: """ Treats curve as a collection of...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
#!/usr/bin/python # Logistic Regression from scratch # In[62]: # In[63]: # importing all the required libraries """ Implementing logistic regression for classification problem Helpful resources: Coursera ML course https://medium.com/@martinpella/logistic-regression-from-scratch-in-python-124c5636b8ac """ import nu...
#!/usr/bin/python # Logistic Regression from scratch # In[62]: # In[63]: # importing all the required libraries """ Implementing logistic regression for classification problem Helpful resources: Coursera ML course https://medium.com/@martinpella/logistic-regression-from-scratch-in-python-124c5636b8ac """ import nu...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
from __future__ import annotations import typing from collections.abc import Iterable import numpy as np Vector = typing.Union[Iterable[float], Iterable[int], np.ndarray] # noqa: UP007 VectorOut = typing.Union[np.float64, int, float] # noqa: UP007 def euclidean_distance(vector_1: Vector, vector_2: Vector) -> Vec...
from __future__ import annotations import typing from collections.abc import Iterable import numpy as np Vector = typing.Union[Iterable[float], Iterable[int], np.ndarray] # noqa: UP007 VectorOut = typing.Union[np.float64, int, float] # noqa: UP007 def euclidean_distance(vector_1: Vector, vector_2: Vector) -> Vec...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
from __future__ import annotations class Graph: def __init__(self, vertices: int) -> None: """ >>> graph = Graph(2) >>> graph.vertices 2 >>> len(graph.graph) 2 >>> len(graph.graph[0]) 2 """ self.vertices = vertices self.graph ...
from __future__ import annotations class Graph: def __init__(self, vertices: int) -> None: """ >>> graph = Graph(2) >>> graph.vertices 2 >>> len(graph.graph) 2 >>> len(graph.graph[0]) 2 """ self.vertices = vertices self.graph ...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
# Created by sarathkaul on 12/11/19 import requests _NEWS_API = "https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey=" def fetch_bbc_news(bbc_news_api_key: str) -> None: # fetching a list of articles in json format bbc_news_page = requests.get(_NEWS_API + bbc_news_api_key).json() # each ar...
# Created by sarathkaul on 12/11/19 import requests _NEWS_API = "https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey=" def fetch_bbc_news(bbc_news_api_key: str) -> None: # fetching a list of articles in json format bbc_news_page = requests.get(_NEWS_API + bbc_news_api_key).json() # each ar...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
# Bit manipulation Bit manipulation is the act of manipulating bits to detect errors (hamming code), encrypts and decrypts messages (more on that in the 'ciphers' folder) or just do anything at the lowest level of your computer. * <https://en.wikipedia.org/wiki/Bit_manipulation> * <https://docs.python.org/3/reference...
# Bit manipulation Bit manipulation is the act of manipulating bits to detect errors (hamming code), encrypts and decrypts messages (more on that in the 'ciphers' folder) or just do anything at the lowest level of your computer. * <https://en.wikipedia.org/wiki/Bit_manipulation> * <https://docs.python.org/3/reference...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
MIT License Copyright (c) 2016-2022 TheAlgorithms and contributors 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, modif...
MIT License Copyright (c) 2016-2022 TheAlgorithms and contributors 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, modif...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
# Sorting Algorithms Sorting is the process of putting data in a specific order. The way to arrange data in a specific order is specified by the sorting algorithm. The most typical orders are lexical or numerical. The significance of sorting lies in the fact that, if data is stored in a sorted manner, data searching ca...
# Sorting Algorithms Sorting is the process of putting data in a specific order. The way to arrange data in a specific order is specified by the sorting algorithm. The most typical orders are lexical or numerical. The significance of sorting lies in the fact that, if data is stored in a sorted manner, data searching ca...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
"""Implementation of Basic Math in Python.""" import math def prime_factors(n: int) -> list: """Find Prime Factors. >>> prime_factors(100) [2, 2, 5, 5] >>> prime_factors(0) Traceback (most recent call last): ... ValueError: Only positive integers have prime factors >>> prime_factor...
"""Implementation of Basic Math in Python.""" import math def prime_factors(n: int) -> list: """Find Prime Factors. >>> prime_factors(100) [2, 2, 5, 5] >>> prime_factors(0) Traceback (most recent call last): ... ValueError: Only positive integers have prime factors >>> prime_factor...
-1
TheAlgorithms/Python
9,707
Fix mypy errors in circular_linked_list.py and swap_nodes.py
### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit check. My fixes primarily consisted of `assert` statements ...
tianyizheng02
2023-10-04T14:51:39Z
2023-10-04T16:05:01Z
3fd3497f15982a7286326b520b5e7b52767da1f3
dfdd78135df938d948ba3044aca628aca08886e7
Fix mypy errors in circular_linked_list.py and swap_nodes.py. ### Describe your change: Fixes #9710 Fix mypy errors in `data_structures/linked_list/circular_linked_list.py` and `data_structures/linked_list/swap_nodes.py` that were let through in #9668. These errors are causing every new PR to fail the pre-commit ...
# Title: Dijkstra's Algorithm for finding single source shortest path from scratch # Author: Shubham Malik # References: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm import math import sys # For storing the vertex set to retrieve node with the lowest distance class PriorityQueue: # Based on Min Heap ...
# Title: Dijkstra's Algorithm for finding single source shortest path from scratch # Author: Shubham Malik # References: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm import math import sys # For storing the vertex set to retrieve node with the lowest distance class PriorityQueue: # Based on Min Heap ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
name: "build" on: pull_request: schedule: - cron: "0 0 * * *" # Run everyday jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.11 - uses: actions/cache@v3 with: path: ~/...
name: "build" on: pull_request: schedule: - cron: "0 0 * * *" # Run everyday jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: 3.12 allow-prereleases: true - uses: actions/cache@v...
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
# https://beta.ruff.rs name: ruff on: push: branches: - master pull_request: branches: - master jobs: ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: pip install --user ruff - run: ruff --output-format=github .
# https://beta.ruff.rs name: ruff on: push: branches: - master pull_request: branches: - master jobs: ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: pip install --user ruff - run: ruff --output-format=github .
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
# Contributing guidelines ## Before contributing Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before sending your pull requests, make sure that you __read the whole guidelines__. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://...
# Contributing guidelines ## Before contributing Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before sending your pull requests, make sure that you __read the whole guidelines__. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://...
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
## Arithmetic Analysis * [Bisection](arithmetic_analysis/bisection.py) * [Gaussian Elimination](arithmetic_analysis/gaussian_elimination.py) * [In Static Equilibrium](arithmetic_analysis/in_static_equilibrium.py) * [Intersection](arithmetic_analysis/intersection.py) * [Jacobi Iteration Method](arithmetic_ana...
## Arithmetic Analysis * [Bisection](arithmetic_analysis/bisection.py) * [Gaussian Elimination](arithmetic_analysis/gaussian_elimination.py) * [In Static Equilibrium](arithmetic_analysis/in_static_equilibrium.py) * [Intersection](arithmetic_analysis/intersection.py) * [Jacobi Iteration Method](arithmetic_ana...
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" In the Combination Sum problem, we are given a list consisting of distinct integers. We need to find all the combinations whose sum equals to target given. We can use an element more than one. Time complexity(Average Case): O(n!) Constraints: 1 <= candidates.length <= 30 2 <= candidates[i] <= 40 All elements of c...
""" In the Combination Sum problem, we are given a list consisting of distinct integers. We need to find all the combinations whose sum equals to target given. We can use an element more than one. Time complexity(Average Case): O(n!) Constraints: 1 <= candidates.length <= 30 2 <= candidates[i] <= 40 All elements of c...
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" https://en.wikipedia.org/wiki/Taylor_series#Trigonometric_functions """ from math import factorial, pi def maclaurin_sin(theta: float, accuracy: int = 30) -> float: """ Finds the maclaurin approximation of sin :param theta: the angle to which sin is found :param accuracy: the degree of accuracy w...
""" https://en.wikipedia.org/wiki/Taylor_series#Trigonometric_functions """ from math import factorial, pi def maclaurin_sin(theta: float, accuracy: int = 30) -> float: """ Finds the maclaurin approximation of sin :param theta: the angle to which sin is found :param accuracy: the degree of accuracy w...
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
beautifulsoup4 fake_useragent imageio keras lxml matplotlib numpy opencv-python pandas pillow projectq qiskit qiskit-aer requests rich scikit-fuzzy scikit-learn statsmodels sympy tensorflow texttable tweepy xgboost yulewalker
beautifulsoup4 fake_useragent imageio keras lxml matplotlib numpy opencv-python pandas pillow projectq qiskit ; python_version < '3.12' qiskit-aer ; python_version < '3.12' requests rich scikit-fuzzy scikit-learn statsmodels sympy tensorflow ; python_version < '3.12' texttable tweepy xgboost yulewalker
1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
#!/usr/bin/env python3 """ Simulation of the Quantum Key Distribution (QKD) protocol called BB84, created by Charles Bennett and Gilles Brassard in 1984. BB84 is a key-distribution protocol that ensures secure key distribution using qubits instead of classical bits. The generated key is the result of simulating a quan...
#!/usr/bin/env python3 """ Simulation of the Quantum Key Distribution (QKD) protocol called BB84, created by Charles Bennett and Gilles Brassard in 1984. BB84 is a key-distribution protocol that ensures secure key distribution using qubits instead of classical bits. The generated key is the result of simulating a quan...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from __future__ import annotations def print_distance(distance: list[float], src): print(f"Vertex\tShortest Distance from vertex {src}") for i, d in enumerate(distance): print(f"{i}\t\t{d}") def check_negative_cycle( graph: list[dict[str, int]], distance: list[float], edge_count: int ): for ...
from __future__ import annotations def print_distance(distance: list[float], src): print(f"Vertex\tShortest Distance from vertex {src}") for i, d in enumerate(distance): print(f"{i}\t\t{d}") def check_negative_cycle( graph: list[dict[str, int]], distance: list[float], edge_count: int ): for ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" https://cp-algorithms.com/string/z-function.html Z-function or Z algorithm Efficient algorithm for pattern occurrence in a string Time Complexity: O(n) - where n is the length of the string """ def z_function(input_str: str) -> list[int]: """ For the given string this function computes value for each ...
""" https://cp-algorithms.com/string/z-function.html Z-function or Z algorithm Efficient algorithm for pattern occurrence in a string Time Complexity: O(n) - where n is the length of the string """ def z_function(input_str: str) -> list[int]: """ For the given string this function computes value for each ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
tasks: - init: pip3 install -r ./requirements.txt
tasks: - init: pip3 install -r ./requirements.txt
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" https://en.wikipedia.org/wiki/N-gram """ def create_ngram(sentence: str, ngram_size: int) -> list[str]: """ Create ngrams from a sentence >>> create_ngram("I am a sentence", 2) ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce'] >>> create_ngram("I am an NLPer...
""" https://en.wikipedia.org/wiki/N-gram """ def create_ngram(sentence: str, ngram_size: int) -> list[str]: """ Create ngrams from a sentence >>> create_ngram("I am a sentence", 2) ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce'] >>> create_ngram("I am an NLPer...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" A NAND Gate is a logic gate in boolean algebra which results to 0 (False) if both the inputs are 1, and 1 (True) otherwise. It's similar to adding a NOT gate along with an AND gate. Following is the truth table of a NAND Gate: ------------------------------ | Input 1 | Input 2 | Output | ---------------...
""" A NAND Gate is a logic gate in boolean algebra which results to 0 (False) if both the inputs are 1, and 1 (True) otherwise. It's similar to adding a NOT gate along with an AND gate. Following is the truth table of a NAND Gate: ------------------------------ | Input 1 | Input 2 | Output | ---------------...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Minimax helps to achieve maximum score in a game by checking all possible moves depth is current depth in game tree. nodeIndex is index of current node in scores[]. if move is of maximizer return true else false leaves of game tree is stored in scores[] height is maximum height of Game tree """ from __future__ imp...
""" Minimax helps to achieve maximum score in a game by checking all possible moves depth is current depth in game tree. nodeIndex is index of current node in scores[]. if move is of maximizer return true else false leaves of game tree is stored in scores[] height is maximum height of Game tree """ from __future__ imp...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Arithmetic mean Reference: https://en.wikipedia.org/wiki/Arithmetic_mean Arithmetic series Reference: https://en.wikipedia.org/wiki/Arithmetic_series (The URL above will redirect you to arithmetic progression) """ def is_arithmetic_series(series: list) -> bool: """ checking whether the input series is ar...
""" Arithmetic mean Reference: https://en.wikipedia.org/wiki/Arithmetic_mean Arithmetic series Reference: https://en.wikipedia.org/wiki/Arithmetic_series (The URL above will redirect you to arithmetic progression) """ def is_arithmetic_series(series: list) -> bool: """ checking whether the input series is ar...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" The Mandelbrot set is the set of complex numbers "c" for which the series "z_(n+1) = z_n * z_n + c" does not diverge, i.e. remains bounded. Thus, a complex number "c" is a member of the Mandelbrot set if, when starting with "z_0 = 0" and applying the iteration repeatedly, the absolute value of "z_n" remains bounded...
""" The Mandelbrot set is the set of complex numbers "c" for which the series "z_(n+1) = z_n * z_n + c" does not diverge, i.e. remains bounded. Thus, a complex number "c" is a member of the Mandelbrot set if, when starting with "z_0 = 0" and applying the iteration repeatedly, the absolute value of "z_n" remains bounded...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
The Project Gutenberg eBook, Prehistoric Men, by Robert J. (Robert John) Braidwood, Illustrated by Susan T. Richert This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it und...
The Project Gutenberg eBook, Prehistoric Men, by Robert J. (Robert John) Braidwood, Illustrated by Susan T. Richert This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it und...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Author : Alexander Pantyukhin Date : November 2, 2022 Task: Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid binary search tree is defined as follows: - The left subtree of a node contains only nodes with keys less than the node's key. - The right subtree of a nod...
""" Author : Alexander Pantyukhin Date : November 2, 2022 Task: Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid binary search tree is defined as follows: - The left subtree of a node contains only nodes with keys less than the node's key. - The right subtree of a nod...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" pseudo-code DIJKSTRA(graph G, start vertex s, destination vertex d): //all nodes initially unexplored 1 - let H = min heap data structure, initialized with 0 and s [here 0 indicates the distance from start vertex s] 2 - while H is non-empty: 3 - remove the first node and cost of H, call it U and cost 4...
""" pseudo-code DIJKSTRA(graph G, start vertex s, destination vertex d): //all nodes initially unexplored 1 - let H = min heap data structure, initialized with 0 and s [here 0 indicates the distance from start vertex s] 2 - while H is non-empty: 3 - remove the first node and cost of H, call it U and cost 4...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" This is a pure Python implementation of the Geometric Series algorithm https://en.wikipedia.org/wiki/Geometric_series Run the doctests with the following command: python3 -m doctest -v geometric_series.py or python -m doctest -v geometric_series.py For manual testing run: python3 geometric_series.py """ from __fu...
""" This is a pure Python implementation of the Geometric Series algorithm https://en.wikipedia.org/wiki/Geometric_series Run the doctests with the following command: python3 -m doctest -v geometric_series.py or python -m doctest -v geometric_series.py For manual testing run: python3 geometric_series.py """ from __fu...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
# Check whether Graph is Bipartite or Not using BFS # A Bipartite Graph is a graph whose vertices can be divided into two independent sets, # U and V such that every edge (u, v) either connects a vertex from U to V or a vertex # from V to U. In other words, for every edge (u, v), either u belongs to U and v to V, # o...
# Check whether Graph is Bipartite or Not using BFS # A Bipartite Graph is a graph whose vertices can be divided into two independent sets, # U and V such that every edge (u, v) either connects a vertex from U to V or a vertex # from V to U. In other words, for every edge (u, v), either u belongs to U and v to V, # o...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from __future__ import annotations from collections import deque class Automaton: def __init__(self, keywords: list[str]): self.adlist: list[dict] = [] self.adlist.append( {"value": "", "next_states": [], "fail_state": 0, "output": []} ) for keyword in keywords: ...
from __future__ import annotations from collections import deque class Automaton: def __init__(self, keywords: list[str]): self.adlist: list[dict] = [] self.adlist.append( {"value": "", "next_states": [], "fail_state": 0, "output": []} ) for keyword in keywords: ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
# Author: João Gustavo A. Amorim & Gabriel Kunz # Author email: joaogustavoamorim@gmail.com and gabriel-kunz@uergs.edu.br # Coding date: apr 2019 # Black: True """ * This code implement the Hamming code: https://en.wikipedia.org/wiki/Hamming_code - In telecommunication, Hamming codes are a family of l...
# Author: João Gustavo A. Amorim & Gabriel Kunz # Author email: joaogustavoamorim@gmail.com and gabriel-kunz@uergs.edu.br # Coding date: apr 2019 # Black: True """ * This code implement the Hamming code: https://en.wikipedia.org/wiki/Hamming_code - In telecommunication, Hamming codes are a family of l...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
def max_product_subarray(numbers: list[int]) -> int: """ Returns the maximum product that can be obtained by multiplying a contiguous subarray of the given integer list `nums`. Example: >>> max_product_subarray([2, 3, -2, 4]) 6 >>> max_product_subarray((-2, 0, -1)) 0 >>> max_product...
def max_product_subarray(numbers: list[int]) -> int: """ Returns the maximum product that can be obtained by multiplying a contiguous subarray of the given integer list `nums`. Example: >>> max_product_subarray([2, 3, -2, 4]) 6 >>> max_product_subarray((-2, 0, -1)) 0 >>> max_product...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Title : Finding the value of either Gravitational Force, one of the masses or distance provided that the other three parameters are given. Description : Newton's Law of Universal Gravitation explains the presence of force of attraction between bodies having a definite mass situated at a distance. It is usually st...
""" Title : Finding the value of either Gravitational Force, one of the masses or distance provided that the other three parameters are given. Description : Newton's Law of Universal Gravitation explains the presence of force of attraction between bodies having a definite mass situated at a distance. It is usually st...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" This is a pure Python implementation of the merge sort algorithm. For doctests run following command: python -m doctest -v merge_sort.py or python3 -m doctest -v merge_sort.py For manual testing run: python merge_sort.py """ def merge_sort(collection: list) -> list: """ :param collection: some mutable or...
""" This is a pure Python implementation of the merge sort algorithm. For doctests run following command: python -m doctest -v merge_sort.py or python3 -m doctest -v merge_sort.py For manual testing run: python merge_sort.py """ def merge_sort(collection: list) -> list: """ :param collection: some mutable or...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
r""" Problem: Given root of a binary tree, return the: 1. binary-tree-right-side-view 2. binary-tree-left-side-view 3. binary-tree-top-side-view 4. binary-tree-bottom-side-view """ from __future__ import annotations from collections import defaultdict from dataclasses import dataclass @dataclass class TreeNode: ...
r""" Problem: Given root of a binary tree, return the: 1. binary-tree-right-side-view 2. binary-tree-left-side-view 3. binary-tree-top-side-view 4. binary-tree-bottom-side-view """ from __future__ import annotations from collections import defaultdict from dataclasses import dataclass @dataclass class TreeNode: ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" https://en.wikipedia.org/wiki/Floor_and_ceiling_functions """ def ceil(x: float) -> int: """ Return the ceiling of x as an Integral. :param x: the number :return: the smallest integer >= x. >>> import math >>> all(ceil(n) == math.ceil(n) for n ... in (1, -1, 0, -0, 1.1, -1.1, 1.0...
""" https://en.wikipedia.org/wiki/Floor_and_ceiling_functions """ def ceil(x: float) -> int: """ Return the ceiling of x as an Integral. :param x: the number :return: the smallest integer >= x. >>> import math >>> all(ceil(n) == math.ceil(n) for n ... in (1, -1, 0, -0, 1.1, -1.1, 1.0...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from __future__ import annotations import random import string class ShuffledShiftCipher: """ This algorithm uses the Caesar Cipher algorithm but removes the option to use brute force to decrypt the message. The passcode is a random password from the selection buffer of 1. uppercase letters of t...
from __future__ import annotations import random import string class ShuffledShiftCipher: """ This algorithm uses the Caesar Cipher algorithm but removes the option to use brute force to decrypt the message. The passcode is a random password from the selection buffer of 1. uppercase letters of t...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" - A linked list is similar to an array, it holds values. However, links in a linked list do not have indexes. - This is an example of a double ended, doubly linked list. - Each link references the next link and the previous one. - A Doubly Linked List (DLL) contains an extra pointer, typically called previous ...
""" - A linked list is similar to an array, it holds values. However, links in a linked list do not have indexes. - This is an example of a double ended, doubly linked list. - Each link references the next link and the previous one. - A Doubly Linked List (DLL) contains an extra pointer, typically called previous ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
def is_int_palindrome(num: int) -> bool: """ Returns whether `num` is a palindrome or not (see for reference https://en.wikipedia.org/wiki/Palindromic_number). >>> is_int_palindrome(-121) False >>> is_int_palindrome(0) True >>> is_int_palindrome(10) False >>> is_int_palindrome(1...
def is_int_palindrome(num: int) -> bool: """ Returns whether `num` is a palindrome or not (see for reference https://en.wikipedia.org/wiki/Palindromic_number). >>> is_int_palindrome(-121) False >>> is_int_palindrome(0) True >>> is_int_palindrome(10) False >>> is_int_palindrome(1...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
import math from timeit import timeit def num_digits(n: int) -> int: """ Find the number of digits in a number. >>> num_digits(12345) 5 >>> num_digits(123) 3 >>> num_digits(0) 1 >>> num_digits(-1) 1 >>> num_digits(-123456) 6 """ digits = 0 n = abs(n) wh...
import math from timeit import timeit def num_digits(n: int) -> int: """ Find the number of digits in a number. >>> num_digits(12345) 5 >>> num_digits(123) 3 >>> num_digits(0) 1 >>> num_digits(-1) 1 >>> num_digits(-123456) 6 """ digits = 0 n = abs(n) wh...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Greatest Common Divisor. Wikipedia reference: https://en.wikipedia.org/wiki/Greatest_common_divisor gcd(a, b) = gcd(a, -b) = gcd(-a, b) = gcd(-a, -b) by definition of divisibility """ def greatest_common_divisor(a: int, b: int) -> int: """ Calculate Greatest Common Divisor (GCD). >>> greatest_common...
""" Greatest Common Divisor. Wikipedia reference: https://en.wikipedia.org/wiki/Greatest_common_divisor gcd(a, b) = gcd(a, -b) = gcd(-a, b) = gcd(-a, -b) by definition of divisibility """ def greatest_common_divisor(a: int, b: int) -> int: """ Calculate Greatest Common Divisor (GCD). >>> greatest_common...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
# https://en.wikipedia.org/wiki/Simulated_annealing import math import random from typing import Any from .hill_climbing import SearchProblem def simulated_annealing( search_prob, find_max: bool = True, max_x: float = math.inf, min_x: float = -math.inf, max_y: float = math.inf, min_y: float =...
# https://en.wikipedia.org/wiki/Simulated_annealing import math import random from typing import Any from .hill_climbing import SearchProblem def simulated_annealing( search_prob, find_max: bool = True, max_x: float = math.inf, min_x: float = -math.inf, max_y: float = math.inf, min_y: float =...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" A pure Python implementation of the insertion sort algorithm This algorithm sorts a collection by comparing adjacent elements. When it finds that order is not respected, it moves the element compared backward until the order is correct. It then goes back directly to the element's initial position resuming forward...
""" A pure Python implementation of the insertion sort algorithm This algorithm sorts a collection by comparing adjacent elements. When it finds that order is not respected, it moves the element compared backward until the order is correct. It then goes back directly to the element's initial position resuming forward...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Calculate the Product Sum from a Special Array. reference: https://dev.to/sfrasica/algorithms-product-sum-from-an-array-dc6 Python doctests can be run with the following command: python -m doctest -v product_sum.py Calculate the product sum of a "special" array which can contain integers or nested arrays. The pro...
""" Calculate the Product Sum from a Special Array. reference: https://dev.to/sfrasica/algorithms-product-sum-from-an-array-dc6 Python doctests can be run with the following command: python -m doctest -v product_sum.py Calculate the product sum of a "special" array which can contain integers or nested arrays. The pro...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
"""Convert a Decimal Number to a Binary Number.""" def decimal_to_binary_iterative(num: int) -> str: """ Convert an Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary_iterative(0) '0b0' >>> decimal_to_binary_iterative(2) '0b10' >>> decimal_to_binary_iterative(7) '0...
"""Convert a Decimal Number to a Binary Number.""" def decimal_to_binary_iterative(num: int) -> str: """ Convert an Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary_iterative(0) '0b0' >>> decimal_to_binary_iterative(2) '0b10' >>> decimal_to_binary_iterative(7) '0...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Modular Exponential. Modular exponentiation is a type of exponentiation performed over a modulus. For more explanation, please check https://en.wikipedia.org/wiki/Modular_exponentiation """ """Calculate Modular Exponential.""" def modular_exponential(base: int, power: int, mod: int): """ ...
""" Modular Exponential. Modular exponentiation is a type of exponentiation performed over a modulus. For more explanation, please check https://en.wikipedia.org/wiki/Modular_exponentiation """ """Calculate Modular Exponential.""" def modular_exponential(base: int, power: int, mod: int): """ ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
def hamming_distance(string1: str, string2: str) -> int: """Calculate the Hamming distance between two equal length strings In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. https://en.wikipedia.or...
def hamming_distance(string1: str, string2: str) -> int: """Calculate the Hamming distance between two equal length strings In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. https://en.wikipedia.or...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Algorithm for calculating the most cost-efficient sequence for converting one string into another. The only allowed operations are --- Cost to copy a character is copy_cost --- Cost to replace a character is replace_cost --- Cost to delete a character is delete_cost --- Cost to insert a character is insert_cost """...
""" Algorithm for calculating the most cost-efficient sequence for converting one string into another. The only allowed operations are --- Cost to copy a character is copy_cost --- Cost to replace a character is replace_cost --- Cost to delete a character is delete_cost --- Cost to insert a character is insert_cost """...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
r""" Problem: The n queens problem is: placing N queens on a N * N chess board such that no queen can attack any other queens placed on that chess board. This means that one queen cannot have any other queen on its horizontal, vertical and diagonal lines. Solution: To solve this problem we will use simple math. Fir...
r""" Problem: The n queens problem is: placing N queens on a N * N chess board such that no queen can attack any other queens placed on that chess board. This means that one queen cannot have any other queen on its horizontal, vertical and diagonal lines. Solution: To solve this problem we will use simple math. Fir...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from __future__ import annotations from collections.abc import Callable from typing import Generic, TypeVar T = TypeVar("T") U = TypeVar("U") class DoubleLinkedListNode(Generic[T, U]): """ Double Linked List Node built specifically for LFU Cache >>> node = DoubleLinkedListNode(1,1) >>> node Nod...
from __future__ import annotations from collections.abc import Callable from typing import Generic, TypeVar T = TypeVar("T") U = TypeVar("U") class DoubleLinkedListNode(Generic[T, U]): """ Double Linked List Node built specifically for LFU Cache >>> node = DoubleLinkedListNode(1,1) >>> node Nod...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Illustrate how to add the integer without arithmetic operation Author: suraj Kumar Time Complexity: 1 https://en.wikipedia.org/wiki/Bitwise_operation """ def add(first: int, second: int) -> int: """ Implementation of addition of integer Examples: >>> add(3, 5) 8 >>> add(13, 5) 18 ...
""" Illustrate how to add the integer without arithmetic operation Author: suraj Kumar Time Complexity: 1 https://en.wikipedia.org/wiki/Bitwise_operation """ def add(first: int, second: int) -> int: """ Implementation of addition of integer Examples: >>> add(3, 5) 8 >>> add(13, 5) 18 ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from PIL import Image def change_brightness(img: Image, level: float) -> Image: """ Change the brightness of a PIL Image to a given level. """ def brightness(c: int) -> float: """ Fundamental Transformation/Operation that'll be performed on every bit. """ retur...
from PIL import Image def change_brightness(img: Image, level: float) -> Image: """ Change the brightness of a PIL Image to a given level. """ def brightness(c: int) -> float: """ Fundamental Transformation/Operation that'll be performed on every bit. """ retur...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
#
#
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Numerical integration or quadrature for a smooth function f with known values at x_i This method is the classical approach of suming 'Equally Spaced Abscissas' method 2: "Simpson Rule" """ def method_2(boundary, steps): # "Simpson Rule" # int(f) = delta_x/2 * (b-a)/3*(f1 + 4f2 + 2f_3 + ... + fn) h ...
""" Numerical integration or quadrature for a smooth function f with known values at x_i This method is the classical approach of suming 'Equally Spaced Abscissas' method 2: "Simpson Rule" """ def method_2(boundary, steps): # "Simpson Rule" # int(f) = delta_x/2 * (b-a)/3*(f1 + 4f2 + 2f_3 + ... + fn) h ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from __future__ import annotations import re def natural_sort(input_list: list[str]) -> list[str]: """ Sort the given list of strings in the way that humans expect. The normal Python sort algorithm sorts lexicographically, so you might not get the results that you expect... >>> example1 = ['2 f...
from __future__ import annotations import re def natural_sort(input_list: list[str]) -> list[str]: """ Sort the given list of strings in the way that humans expect. The normal Python sort algorithm sorts lexicographically, so you might not get the results that you expect... >>> example1 = ['2 f...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
#!/usr/bin/env python3 """ Davis–Putnam–Logemann–Loveland (DPLL) algorithm is a complete, backtracking-based search algorithm for deciding the satisfiability of propositional logic formulae in conjunctive normal form, i.e, for solving the Conjunctive Normal Form SATisfiability (CNF-SAT) problem. For more information ...
#!/usr/bin/env python3 """ Davis–Putnam–Logemann–Loveland (DPLL) algorithm is a complete, backtracking-based search algorithm for deciding the satisfiability of propositional logic formulae in conjunctive normal form, i.e, for solving the Conjunctive Normal Form SATisfiability (CNF-SAT) problem. For more information ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" https://en.wikipedia.org/wiki/Component_(graph_theory) Finding connected components in graph """ test_graph_1 = {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]} test_graph_2 = {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []} def dfs(graph: dict, vert: int, visited: list) -> li...
""" https://en.wikipedia.org/wiki/Component_(graph_theory) Finding connected components in graph """ test_graph_1 = {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]} test_graph_2 = {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []} def dfs(graph: dict, vert: int, visited: list) -> li...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from typing import Any def mode(input_list: list) -> list[Any]: """This function returns the mode(Mode as in the measures of central tendency) of the input data. The input list may contain any Datastructure or any Datatype. >>> mode([2, 3, 4, 5, 3, 4, 2, 5, 2, 2, 4, 2, 2, 2]) [2] >>> mode([3...
from typing import Any def mode(input_list: list) -> list[Any]: """This function returns the mode(Mode as in the measures of central tendency) of the input data. The input list may contain any Datastructure or any Datatype. >>> mode([2, 3, 4, 5, 3, 4, 2, 5, 2, 2, 4, 2, 2, 2]) [2] >>> mode([3...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Given a grid, where you start from the top left position [0, 0], you want to find how many paths you can take to get to the bottom right position. start here -> 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 <- finish here how many 'distinct' paths can you take t...
""" Given a grid, where you start from the top left position [0, 0], you want to find how many paths you can take to get to the bottom right position. start here -> 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 <- finish here how many 'distinct' paths can you take t...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
import requests from bs4 import BeautifulSoup, NavigableString, Tag from fake_useragent import UserAgent BASE_URL = "https://ww1.gogoanime2.org" def search_scraper(anime_name: str) -> list: """[summary] Take an url and return list of anime after scraping the site. >>> type(search_scraper("demon_sla...
import requests from bs4 import BeautifulSoup, NavigableString, Tag from fake_useragent import UserAgent BASE_URL = "https://ww1.gogoanime2.org" def search_scraper(anime_name: str) -> list: """[summary] Take an url and return list of anime after scraping the site. >>> type(search_scraper("demon_sla...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Convert speed units https://en.wikipedia.org/wiki/Kilometres_per_hour https://en.wikipedia.org/wiki/Miles_per_hour https://en.wikipedia.org/wiki/Knot_(unit) https://en.wikipedia.org/wiki/Metre_per_second """ speed_chart: dict[str, float] = { "km/h": 1.0, "m/s": 3.6, "mph": 1.609344, "knot": 1.852,...
""" Convert speed units https://en.wikipedia.org/wiki/Kilometres_per_hour https://en.wikipedia.org/wiki/Miles_per_hour https://en.wikipedia.org/wiki/Knot_(unit) https://en.wikipedia.org/wiki/Metre_per_second """ speed_chart: dict[str, float] = { "km/h": 1.0, "m/s": 3.6, "mph": 1.609344, "knot": 1.852,...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from json import loads from pathlib import Path import numpy as np from yulewalker import yulewalk from audio_filters.butterworth_filter import make_highpass from audio_filters.iir_filter import IIRFilter data = loads((Path(__file__).resolve().parent / "loudness_curve.json").read_text()) class EqualLoudnessFilter:...
from json import loads from pathlib import Path import numpy as np from yulewalker import yulewalk from audio_filters.butterworth_filter import make_highpass from audio_filters.iir_filter import IIRFilter data = loads((Path(__file__).resolve().parent / "loudness_curve.json").read_text()) class EqualLoudnessFilter:...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Project Euler Problem 75: https://projecteuler.net/problem=75 It turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples. 12 cm: (3,4,5) 24 cm: (6,8,10) 30 cm: (5,12,13) 36 cm: (9,12,15) 40 cm: (8,15,17...
""" Project Euler Problem 75: https://projecteuler.net/problem=75 It turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples. 12 cm: (3,4,5) 24 cm: (6,8,10) 30 cm: (5,12,13) 36 cm: (9,12,15) 40 cm: (8,15,17...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" A harshad number (or more specifically an n-harshad number) is a number that's divisible by the sum of its digits in some given base n. Reference: https://en.wikipedia.org/wiki/Harshad_number """ def int_to_base(number: int, base: int) -> str: """ Convert a given positive decimal integer to base 'base'. ...
""" A harshad number (or more specifically an n-harshad number) is a number that's divisible by the sum of its digits in some given base n. Reference: https://en.wikipedia.org/wiki/Harshad_number """ def int_to_base(number: int, base: int) -> str: """ Convert a given positive decimal integer to base 'base'. ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Reverse Polish Nation is also known as Polish postfix notation or simply postfix notation. https://en.wikipedia.org/wiki/Reverse_Polish_notation Classic examples of simple stack implementations. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Output: Enter a Postfix Equation ...
""" Reverse Polish Nation is also known as Polish postfix notation or simply postfix notation. https://en.wikipedia.org/wiki/Reverse_Polish_notation Classic examples of simple stack implementations. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Output: Enter a Postfix Equation ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
class BinaryHeap: """ A max-heap implementation in Python >>> binary_heap = BinaryHeap() >>> binary_heap.insert(6) >>> binary_heap.insert(10) >>> binary_heap.insert(15) >>> binary_heap.insert(12) >>> binary_heap.pop() 15 >>> binary_heap.pop() 12 >>> binary_heap.get_list ...
class BinaryHeap: """ A max-heap implementation in Python >>> binary_heap = BinaryHeap() >>> binary_heap.insert(6) >>> binary_heap.insert(10) >>> binary_heap.insert(15) >>> binary_heap.insert(12) >>> binary_heap.pop() 15 >>> binary_heap.pop() 12 >>> binary_heap.get_list ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np from sklearn.utils import shuffle import input_data random_numer = 42 np.random.seed(random_numer) def ReLu(x): mask = (x > 0) * 1.0 return mask * x def d_ReLu(x): mask = (x > 0) * 1.0 return mask def arcta...
import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np from sklearn.utils import shuffle import input_data random_numer = 42 np.random.seed(random_numer) def ReLu(x): mask = (x > 0) * 1.0 return mask * x def d_ReLu(x): mask = (x > 0) * 1.0 return mask def arcta...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
{ "_comment": "The following is a representative average of the Equal Loudness Contours as measured by Robinson and Dadson, 1956", "_doi": "10.1088/0508-3443/7/5/302", "frequencies": [ 0, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600, ...
{ "_comment": "The following is a representative average of the Equal Loudness Contours as measured by Robinson and Dadson, 1956", "_doi": "10.1088/0508-3443/7/5/302", "frequencies": [ 0, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600, ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Euler Problem 26 https://projecteuler.net/problem=26 Problem Statement: A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 ...
""" Euler Problem 26 https://projecteuler.net/problem=26 Problem Statement: A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
from __future__ import annotations from abc import abstractmethod from collections.abc import Iterable from typing import Generic, Protocol, TypeVar class Comparable(Protocol): @abstractmethod def __lt__(self: T, other: T) -> bool: pass @abstractmethod def __gt__(self: T, other: T) -> bool: ...
from __future__ import annotations from abc import abstractmethod from collections.abc import Iterable from typing import Generic, Protocol, TypeVar class Comparable(Protocol): @abstractmethod def __lt__(self: T, other: T) -> bool: pass @abstractmethod def __gt__(self: T, other: T) -> bool: ...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
# Project Euler Problems are taken from https://projecteuler.net/, the Project Euler. [Problems are licensed under CC BY-NC-SA 4.0](https://projecteuler.net/copyright). Project Euler is a series of challenging mathematical/computer programming problems that require more than just mathematical insights to solve. Proje...
# Project Euler Problems are taken from https://projecteuler.net/, the Project Euler. [Problems are licensed under CC BY-NC-SA 4.0](https://projecteuler.net/copyright). Project Euler is a series of challenging mathematical/computer programming problems that require more than just mathematical insights to solve. Proje...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Pure Python implementation of a binary search algorithm. For doctests run following command: python3 -m doctest -v simple_binary_search.py For manual testing run: python3 simple_binary_search.py """ from __future__ import annotations def binary_search(a_list: list[int], item: int) -> bool: """ >>> test_...
""" Pure Python implementation of a binary search algorithm. For doctests run following command: python3 -m doctest -v simple_binary_search.py For manual testing run: python3 simple_binary_search.py """ from __future__ import annotations def binary_search(a_list: list[int], item: int) -> bool: """ >>> test_...
-1
TheAlgorithms/Python
9,576
Upgrade to Python 3.12
### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues/10887 --- * [ ] A...
cclauss
2023-10-03T08:13:43Z
2023-10-03T09:17:11Z
f964dcbf2ff7c70e4aca20532a38dfb02ce8a4c0
0f4e51245f33175b4fb311f633d3821210741bdd
Upgrade to Python 3.12. ### Describe your change: Repeats #8777 Repeats #9306 * #8777 * #9306 **Disables** algorithms based on `qiskit` and `tensorflow` because those modules are not yet compatible with Python 3.12. * https://github.com/tensorflow/tensorflow/releases * https://github.com/Qiskit/qiskit/issues...
""" Project Euler Problem 113: https://projecteuler.net/problem=113 Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420. We ...
""" Project Euler Problem 113: https://projecteuler.net/problem=113 Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420. We ...
-1
TheAlgorithms/Python
9,543
[pre-commit.ci] pre-commit autoupdate
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) - [github.com/to...
pre-commit-ci[bot]
2023-10-02T23:32:55Z
2023-10-07T19:32:28Z
60291738d2552999545c414bb8a8e90f86c69678
895dffb412d80f29c65a062bf6d91fd2a70d8818
[pre-commit.ci] pre-commit autoupdate. <!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/co...
repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: check-executables-have-shebangs - id: check-toml - id: check-yaml - id: end-of-file-fixer types: [python] - id: trailing-whitespace - id: requirements-txt-fixer - repo: https:/...
repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: check-executables-have-shebangs - id: check-toml - id: check-yaml - id: end-of-file-fixer types: [python] - id: trailing-whitespace - id: requirements-txt-fixer - repo: https:/...
1
TheAlgorithms/Python
9,543
[pre-commit.ci] pre-commit autoupdate
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) - [github.com/to...
pre-commit-ci[bot]
2023-10-02T23:32:55Z
2023-10-07T19:32:28Z
60291738d2552999545c414bb8a8e90f86c69678
895dffb412d80f29c65a062bf6d91fd2a70d8818
[pre-commit.ci] pre-commit autoupdate. <!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/co...
""" Convolutional Neural Network Objective : To train a CNN model detect if TB is present in Lung X-ray or not. Resources CNN Theory : https://en.wikipedia.org/wiki/Convolutional_neural_network Resources Tensorflow : https://www.tensorflow.org/tutorials/images/cnn Download dataset from : https://lhncbc.nlm.nih.g...
""" Convolutional Neural Network Objective : To train a CNN model detect if TB is present in Lung X-ray or not. Resources CNN Theory : https://en.wikipedia.org/wiki/Convolutional_neural_network Resources Tensorflow : https://www.tensorflow.org/tutorials/images/cnn Download dataset from : https://lhncbc.nlm.nih.g...
1
TheAlgorithms/Python
9,543
[pre-commit.ci] pre-commit autoupdate
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) - [github.com/to...
pre-commit-ci[bot]
2023-10-02T23:32:55Z
2023-10-07T19:32:28Z
60291738d2552999545c414bb8a8e90f86c69678
895dffb412d80f29c65a062bf6d91fd2a70d8818
[pre-commit.ci] pre-commit autoupdate. <!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/co...
"""Source: https://github.com/jason9075/opencv-mosaic-data-aug""" import glob import os import random from string import ascii_lowercase, digits import cv2 import numpy as np # Parrameters OUTPUT_SIZE = (720, 1280) # Height, Width SCALE_RANGE = (0.4, 0.6) # if height or width lower than this scale, drop it. FILTER...
"""Source: https://github.com/jason9075/opencv-mosaic-data-aug""" import glob import os import random from string import ascii_lowercase, digits import cv2 import numpy as np # Parameters OUTPUT_SIZE = (720, 1280) # Height, Width SCALE_RANGE = (0.4, 0.6) # if height or width lower than this scale, drop it. FILTER_...
1