SYMBOL INDEX (4127 symbols across 1152 files) FILE: audio_filters/butterworth_filter.py function make_lowpass (line 13) | def make_lowpass( function make_highpass (line 43) | def make_highpass( function make_bandpass (line 73) | def make_bandpass( function make_allpass (line 104) | def make_allpass( function make_peak (line 131) | def make_peak( function make_lowshelf (line 163) | def make_lowshelf( function make_highshelf (line 200) | def make_highshelf( FILE: audio_filters/iir_filter.py class IIRFilter (line 4) | class IIRFilter: method __init__ (line 26) | def __init__(self, order: int) -> None: method set_coefficients (line 39) | def set_coefficients(self, a_coeffs: list[float], b_coeffs: list[float... method process (line 75) | def process(self, sample: float) -> float: FILE: audio_filters/show_response.py class FilterType (line 11) | class FilterType(Protocol): method process (line 13) | def process(self, sample: float) -> float: function get_bounds (line 22) | def get_bounds( function show_frequency_response (line 38) | def show_frequency_response(filter_type: FilterType, samplerate: int) ->... function show_phase_response (line 70) | def show_phase_response(filter_type: FilterType, samplerate: int) -> None: FILE: backtracking/all_combinations.py function combination_lists (line 13) | def combination_lists(n: int, k: int) -> list[list[int]]: function generate_all_combinations (line 23) | def generate_all_combinations(n: int, k: int) -> list[list[int]]: function create_all_state (line 64) | def create_all_state( FILE: backtracking/all_permutations.py function generate_all_permutations (line 12) | def generate_all_permutations(sequence: list[int | str]) -> None: function create_state_space_tree (line 16) | def create_state_space_tree( FILE: backtracking/all_subsequences.py function generate_all_subsequences (line 14) | def generate_all_subsequences(sequence: list[Any]) -> None: function create_state_space_tree (line 18) | def create_state_space_tree( FILE: backtracking/coloring.py function valid_coloring (line 10) | def valid_coloring( function util_color (line 36) | def util_color( function color (line 88) | def color(graph: list[list[int]], max_colors: int) -> list[int]: FILE: backtracking/combination_sum.py function backtrack (line 16) | def backtrack( function combination_sum (line 41) | def combination_sum(candidates: list, target: int) -> list: function main (line 68) | def main() -> None: FILE: backtracking/crossword_puzzle_solver.py function is_valid (line 4) | def is_valid( function place_word (line 36) | def place_word( function remove_word (line 59) | def remove_word( function solve_crossword (line 82) | def solve_crossword(puzzle: list[list[str]], words: list[str]) -> bool: FILE: backtracking/generate_parentheses.py function backtrack (line 11) | def backtrack( function generate_parenthesis (line 48) | def generate_parenthesis(n: int) -> list[str]: FILE: backtracking/generate_parentheses_iterative.py function generate_parentheses_iterative (line 1) | def generate_parentheses_iterative(length: int) -> list[str]: FILE: backtracking/hamiltonian_cycle.py function valid_connection (line 11) | def valid_connection( function util_hamilton_cycle (line 49) | def util_hamilton_cycle(graph: list[list[int]], path: list[int], curr_in... function hamilton_cycle (line 110) | def hamilton_cycle(graph: list[list[int]], start_index: int = 0) -> list... FILE: backtracking/knight_tour.py function get_valid_pos (line 6) | def get_valid_pos(position: tuple[int, int], n: int) -> list[tuple[int, ... function is_complete (line 35) | def is_complete(board: list[list[int]]) -> bool: function open_knight_tour_helper (line 49) | def open_knight_tour_helper( function open_knight_tour (line 71) | def open_knight_tour(n: int) -> list[list[int]]: FILE: backtracking/match_word_pattern.py function match_word_pattern (line 1) | def match_word_pattern(pattern: str, input_string: str) -> bool: FILE: backtracking/minimax.py function minimax (line 16) | def minimax( function main (line 81) | def main() -> None: FILE: backtracking/n_queens.py function is_safe (line 16) | def is_safe(board: list[list[int]], row: int, column: int) -> bool: function solve (line 63) | def solve(board: list[list[int]], row: int) -> bool: function printboard (line 92) | def printboard(board: list[list[int]]) -> None: FILE: backtracking/n_queens_math.py function depth_first_search (line 82) | def depth_first_search( function n_queens_solution (line 141) | def n_queens_solution(n: int) -> None: FILE: backtracking/power_sum.py function backtrack (line 10) | def backtrack( function solve (line 54) | def solve(needed_sum: int, power: int) -> int: FILE: backtracking/rat_in_maze.py function solve_maze (line 4) | def solve_maze( function run_maze (line 139) | def run_maze( FILE: backtracking/sudoku.py function is_safe (line 44) | def is_safe(grid: Matrix, row: int, column: int, n: int) -> bool: function find_empty_location (line 63) | def find_empty_location(grid: Matrix) -> tuple[int, int] | None: function sudoku (line 75) | def sudoku(grid: Matrix) -> Matrix | None: function print_solution (line 112) | def print_solution(grid: Matrix) -> None: FILE: backtracking/sum_of_subsets.py function generate_sum_of_subsets_solutions (line 11) | def generate_sum_of_subsets_solutions(nums: list[int], max_sum: int) -> ... function create_state_space_tree (line 32) | def create_state_space_tree( FILE: backtracking/word_break.py function backtrack (line 10) | def backtrack(input_string: str, word_dict: set[str], start: int) -> bool: function word_break (line 48) | def word_break(input_string: str, word_dict: set[str]) -> bool: FILE: backtracking/word_ladder.py function backtrack (line 15) | def backtrack( function word_ladder (line 68) | def word_ladder(begin_word: str, end_word: str, word_set: set[str]) -> l... FILE: backtracking/word_search.py function get_point_key (line 36) | def get_point_key(len_board: int, len_board_column: int, row: int, colum... function exits_word (line 47) | def exits_word( function word_exists (line 91) | def word_exists(board: list[list[str]], word: str) -> bool: FILE: bit_manipulation/binary_and_operator.py function binary_and (line 4) | def binary_and(a: int, b: int) -> str: FILE: bit_manipulation/binary_coded_decimal.py function binary_coded_decimal (line 1) | def binary_coded_decimal(number: int) -> str: FILE: bit_manipulation/binary_count_setbits.py function binary_count_setbits (line 1) | def binary_count_setbits(a: int) -> int: FILE: bit_manipulation/binary_count_trailing_zeros.py function binary_count_trailing_zeros (line 4) | def binary_count_trailing_zeros(a: int) -> int: FILE: bit_manipulation/binary_or_operator.py function binary_or (line 4) | def binary_or(a: int, b: int) -> str: FILE: bit_manipulation/binary_shifts.py function logical_left_shift (line 6) | def logical_left_shift(number: int, shift_amount: int) -> str: function logical_right_shift (line 36) | def logical_right_shift(number: int, shift_amount: int) -> str: function arithmetic_right_shift (line 68) | def arithmetic_right_shift(number: int, shift_amount: int) -> str: FILE: bit_manipulation/binary_twos_complement.py function twos_complement (line 4) | def twos_complement(number: int) -> str: FILE: bit_manipulation/binary_xor_operator.py function binary_xor (line 4) | def binary_xor(a: int, b: int) -> str: FILE: bit_manipulation/bitwise_addition_recursive.py function bitwise_addition_recursive (line 7) | def bitwise_addition_recursive(number: int, other_number: int) -> int: FILE: bit_manipulation/count_1s_brian_kernighan_method.py function get_1s_count (line 1) | def get_1s_count(number: int) -> int: FILE: bit_manipulation/count_number_of_one_bits.py function get_set_bits_count_using_brian_kernighans_algorithm (line 4) | def get_set_bits_count_using_brian_kernighans_algorithm(number: int) -> ... function get_set_bits_count_using_modulo_operator (line 33) | def get_set_bits_count_using_modulo_operator(number: int) -> int: function benchmark (line 63) | def benchmark() -> None: FILE: bit_manipulation/excess_3_code.py function excess_3_code (line 1) | def excess_3_code(number: int) -> str: FILE: bit_manipulation/find_previous_power_of_two.py function find_previous_power_of_two (line 1) | def find_previous_power_of_two(number: int) -> int: FILE: bit_manipulation/find_unique_number.py function find_unique_number (line 1) | def find_unique_number(arr: list[int]) -> int: FILE: bit_manipulation/gray_code_sequence.py function gray_code (line 1) | def gray_code(bit_count: int) -> list: function gray_code_sequence_string (line 50) | def gray_code_sequence_string(bit_count: int) -> list: FILE: bit_manipulation/highest_set_bit.py function get_highest_set_bit_position (line 1) | def get_highest_set_bit_position(number: int) -> int: FILE: bit_manipulation/index_of_rightmost_set_bit.py function get_index_of_rightmost_set_bit (line 4) | def get_index_of_rightmost_set_bit(number: int) -> int: FILE: bit_manipulation/is_even.py function is_even (line 1) | def is_even(number: int) -> bool: FILE: bit_manipulation/is_power_of_two.py function is_power_of_two (line 18) | def is_power_of_two(number: int) -> bool: FILE: bit_manipulation/largest_pow_of_two_le_num.py function largest_pow_of_two_le_num (line 22) | def largest_pow_of_two_le_num(number: int) -> int: FILE: bit_manipulation/missing_number.py function find_missing_number (line 1) | def find_missing_number(nums: list[int]) -> int: FILE: bit_manipulation/numbers_different_signs.py function different_signs (line 14) | def different_signs(num1: int, num2: int) -> bool: FILE: bit_manipulation/power_of_4.py function power_of_4 (line 18) | def power_of_4(number: int) -> bool: FILE: bit_manipulation/reverse_bits.py function get_reverse_bit_string (line 1) | def get_reverse_bit_string(number: int) -> str: function reverse_bit (line 31) | def reverse_bit(number: int) -> int: FILE: bit_manipulation/single_bit_manipulation_operations.py function set_bit (line 6) | def set_bit(number: int, position: int) -> int: function clear_bit (line 24) | def clear_bit(number: int, position: int) -> int: function flip_bit (line 40) | def flip_bit(number: int, position: int) -> int: function is_bit_set (line 56) | def is_bit_set(number: int, position: int) -> bool: function get_bit (line 77) | def get_bit(number: int, position: int) -> int: FILE: bit_manipulation/swap_all_odd_and_even_bits.py function show_bits (line 1) | def show_bits(before: int, after: int) -> str: function swap_odd_even_bits (line 10) | def swap_odd_even_bits(num: int) -> int: FILE: blockchain/diophantine_equation.py function diophantine (line 6) | def diophantine(a: int, b: int, c: int) -> tuple[float, float]: function diophantine_all_soln (line 33) | def diophantine_all_soln(a: int, b: int, c: int, n: int = 2) -> None: function extended_gcd (line 74) | def extended_gcd(a: int, b: int) -> tuple[int, int, int]: FILE: boolean_algebra/and_gate.py function and_gate (line 19) | def and_gate(input_1: int, input_2: int) -> int: function n_input_and_gate (line 35) | def n_input_and_gate(inputs: list[int]) -> int: FILE: boolean_algebra/imply_gate.py function imply_gate (line 20) | def imply_gate(input_1: int, input_2: int) -> int: function recursive_imply_list (line 36) | def recursive_imply_list(input_list: list[int]) -> int: FILE: boolean_algebra/karnaugh_map_simplification.py function simplify_kmap (line 7) | def simplify_kmap(kmap: list[list[int]]) -> str: function main (line 32) | def main() -> None: FILE: boolean_algebra/multiplexer.py function mux (line 1) | def mux(input0: int, input1: int, select: int) -> int: FILE: boolean_algebra/nand_gate.py function nand_gate (line 18) | def nand_gate(input_1: int, input_2: int) -> int: FILE: boolean_algebra/nimply_gate.py function nimply_gate (line 20) | def nimply_gate(input_1: int, input_2: int) -> int: FILE: boolean_algebra/nor_gate.py function nor_gate (line 19) | def nor_gate(input_1: int, input_2: int) -> int: function truth_table (line 37) | def truth_table(func: Callable) -> str: FILE: boolean_algebra/not_gate.py function not_gate (line 15) | def not_gate(input_1: int) -> int: FILE: boolean_algebra/or_gate.py function or_gate (line 17) | def or_gate(input_1: int, input_2: int) -> int: FILE: boolean_algebra/quine_mc_cluskey.py function compare_string (line 7) | def compare_string(string1: str, string2: str) -> str | Literal[False]: function check (line 28) | def check(binary: list[str]) -> list[str]: function decimal_to_binary (line 52) | def decimal_to_binary(no_of_variable: int, minterms: Sequence[float]) ->... function is_for_table (line 67) | def is_for_table(string1: str, string2: str, count: int) -> bool: function selection (line 81) | def selection(chart: list[list[int]], prime_implicants: list[str]) -> li... function prime_implicant_chart (line 122) | def prime_implicant_chart( function main (line 139) | def main() -> None: FILE: boolean_algebra/xnor_gate.py function xnor_gate (line 19) | def xnor_gate(input_1: int, input_2: int) -> int: FILE: boolean_algebra/xor_gate.py function xor_gate (line 18) | def xor_gate(input_1: int, input_2: int) -> int: FILE: cellular_automata/conways_game_of_life.py function new_generation (line 26) | def new_generation(cells: list[list[int]]) -> list[list[int]]: function generate_images (line 72) | def generate_images(cells: list[list[int]], frames: int) -> list[Image.I... FILE: cellular_automata/game_of_life.py function create_canvas (line 44) | def create_canvas(size: int) -> list[list[bool]]: function seed (line 49) | def seed(canvas: list[list[bool]]) -> None: function run (line 55) | def run(canvas: list[list[bool]]) -> list[list[bool]]: function __judge_point (line 78) | def __judge_point(pt: bool, neighbours: list[list[bool]]) -> bool: FILE: cellular_automata/langtons_ant.py class LangtonsAnt (line 17) | class LangtonsAnt: method __init__ (line 28) | def __init__(self, width: int, height: int) -> None: method move_ant (line 37) | def move_ant(self, axes: plt.Axes | None, display: bool, _frame: int) ... method display (line 86) | def display(self, frames: int = 100_000) -> None: FILE: cellular_automata/nagel_schrekenberg.py function construct_highway (line 31) | def construct_highway( function get_distance (line 60) | def get_distance(highway_now: list, car_index: int) -> int: function update (line 81) | def update(highway_now: list, probability: float, max_speed: int) -> list: function simulate (line 108) | def simulate( FILE: cellular_automata/one_dimensional.py function format_ruleset (line 18) | def format_ruleset(ruleset: int) -> list[int]: function new_generation (line 30) | def new_generation(cells: list[list[int]], rule: list[int], time: int) -... function generate_image (line 44) | def generate_image(cells: list[list[int]]) -> Image.Image: FILE: cellular_automata/wa_tor.py class Entity (line 38) | class Entity: method __init__ (line 51) | def __init__(self, prey: bool, coords: tuple[int, int]) -> None: method reset_reproduction_time (line 62) | def reset_reproduction_time(self) -> None: method __repr__ (line 77) | def __repr__(self) -> str: class WaTor (line 94) | class WaTor: method __init__ (line 118) | def __init__(self, width: int, height: int) -> None: method set_planet (line 132) | def set_planet(self, planet: list[list[Entity | None]]) -> None: method add_entity (line 153) | def add_entity(self, prey: bool) -> None: method get_entities (line 173) | def get_entities(self) -> list[Entity]: method balance_predators_and_prey (line 183) | def balance_predators_and_prey(self) -> None: method get_surrounding_prey (line 215) | def get_surrounding_prey(self, entity: Entity) -> list[Entity]: method move_and_reproduce (line 257) | def move_and_reproduce( method perform_prey_actions (line 347) | def perform_prey_actions( method perform_predator_actions (line 373) | def perform_predator_actions( method run (line 431) | def run(self, *, iteration_count: int) -> None: function visualise (line 481) | def visualise(wt: WaTor, iter_number: int, *, colour: bool = True) -> None: FILE: ciphers/a1z26.py function encode (line 12) | def encode(plain: str) -> list[int]: function decode (line 20) | def decode(encoded: list[int]) -> str: function main (line 28) | def main() -> None: FILE: ciphers/affine_cipher.py function check_keys (line 14) | def check_keys(key_a: int, key_b: int, mode: str) -> None: function encrypt_message (line 38) | def encrypt_message(key: int, message: str) -> str: function decrypt_message (line 56) | def decrypt_message(key: int, message: str) -> str: function get_random_key (line 77) | def get_random_key() -> int: function main (line 85) | def main() -> None: FILE: ciphers/atbash.py function atbash_slow (line 6) | def atbash_slow(sequence: str) -> str: function atbash (line 26) | def atbash(sequence: str) -> str: function benchmark (line 41) | def benchmark() -> None: FILE: ciphers/autokey.py function encrypt (line 12) | def encrypt(plaintext: str, key: str) -> str: function decrypt (line 77) | def decrypt(ciphertext: str, key: str) -> str: FILE: ciphers/baconian_cipher.py function encode (line 40) | def encode(word: str) -> str: function decode (line 62) | def decode(coded: str) -> str: FILE: ciphers/base16.py function base16_encode (line 1) | def base16_encode(data: bytes) -> str: function base16_decode (line 18) | def base16_decode(data: str) -> bytes: FILE: ciphers/base32.py function base32_encode (line 10) | def base32_encode(data: bytes) -> bytes: function base32_decode (line 26) | def base32_decode(data: bytes) -> bytes: FILE: ciphers/base64_cipher.py function base64_encode (line 4) | def base64_encode(data: bytes) -> bytes: function base64_decode (line 64) | def base64_decode(encoded_data: str) -> bytes: FILE: ciphers/base85.py function _base10_to_85 (line 8) | def _base10_to_85(d: int) -> str: function _base85_to_10 (line 12) | def _base85_to_10(digits: list) -> int: function ascii85_encode (line 16) | def ascii85_encode(data: bytes) -> bytes: function ascii85_decode (line 33) | def ascii85_decode(data: bytes) -> bytes: FILE: ciphers/beaufort_cipher.py function generate_key (line 14) | def generate_key(message: str, key: str) -> str: function cipher_text (line 33) | def cipher_text(message: str, key_new: str) -> str: function original_text (line 52) | def original_text(cipher_text: str, key_new: str) -> str: function main (line 69) | def main() -> None: FILE: ciphers/bifid.py class BifidCipher (line 21) | class BifidCipher: method __init__ (line 22) | def __init__(self) -> None: method letter_to_numbers (line 25) | def letter_to_numbers(self, letter: str) -> np.ndarray: method numbers_to_letter (line 40) | def numbers_to_letter(self, index1: int, index2: int) -> str: method encode (line 54) | def encode(self, message: str) -> str: method decode (line 88) | def decode(self, message: str) -> str: FILE: ciphers/brute_force_caesar_cipher.py function decrypt (line 4) | def decrypt(message: str) -> None: function main (line 48) | def main() -> None: FILE: ciphers/caesar_cipher.py function encrypt (line 6) | def encrypt(input_string: str, key: int, alphabet: str | None = None) ->... function decrypt (line 91) | def decrypt(input_string: str, key: int, alphabet: str | None = None) ->... function brute_force (line 163) | def brute_force(input_string: str, alphabet: str | None = None) -> dict[... FILE: ciphers/cryptomath_module.py function find_mod_inverse (line 4) | def find_mod_inverse(a: int, m: int) -> int: FILE: ciphers/decrypt_caesar_with_chi_squared.py function decrypt_caesar_with_chi_squared (line 5) | def decrypt_caesar_with_chi_squared( FILE: ciphers/deterministic_miller_rabin.py function miller_rabin (line 6) | def miller_rabin(n: int, allow_probable: bool = False) -> bool: function test_miller_rabin (line 90) | def test_miller_rabin() -> None: FILE: ciphers/diffie.py function find_primitive (line 4) | def find_primitive(modulus: int) -> int | None: FILE: ciphers/diffie_hellman.py class DiffieHellman (line 182) | class DiffieHellman: method __init__ (line 214) | def __init__(self, group: int = 14) -> None: method get_private_key (line 222) | def get_private_key(self) -> str: method generate_public_key (line 225) | def generate_public_key(self) -> str: method is_valid_public_key (line 229) | def is_valid_public_key(self, key: int) -> bool: method generate_shared_key (line 236) | def generate_shared_key(self, other_key_str: str) -> str: method is_valid_public_key_static (line 244) | def is_valid_public_key_static(remote_public_key_str: int, prime: int)... method generate_shared_key_static (line 252) | def generate_shared_key_static( FILE: ciphers/elgamal_key_generator.py function primitive_root (line 16) | def primitive_root(p_val: int) -> int: function generate_key (line 27) | def generate_key(key_size: int) -> tuple[tuple[int, int, int, int], tupl... function make_key_files (line 40) | def make_key_files(name: str, key_size: int) -> None: function main (line 59) | def main() -> None: FILE: ciphers/enigma_machine2.py function _validator (line 74) | def _validator( function _plugboard (line 114) | def _plugboard(pbstring: str) -> dict[str, str]: function enigma (line 167) | def enigma( FILE: ciphers/fractionated_morse_cipher.py function encode_to_morse (line 79) | def encode_to_morse(plaintext: str) -> str: function encrypt_fractionated_morse (line 95) | def encrypt_fractionated_morse(plaintext: str, key: str) -> str: function decrypt_fractionated_morse (line 129) | def decrypt_fractionated_morse(ciphertext: str, key: str) -> str: FILE: ciphers/gronsfeld_cipher.py function gronsfeld (line 4) | def gronsfeld(text: str, key: str) -> str: FILE: ciphers/hill_cipher.py class HillCipher (line 46) | class HillCipher: method __init__ (line 56) | def __init__(self, encrypt_key: np.ndarray) -> None: method replace_letters (line 64) | def replace_letters(self, letter: str) -> int: method replace_digits (line 74) | def replace_digits(self, num: int) -> str: method check_determinant (line 86) | def check_determinant(self) -> None: method process_text (line 104) | def process_text(self, text: str) -> str: method encrypt (line 120) | def encrypt(self, text: str) -> str: method make_decrypt_key (line 145) | def make_decrypt_key(self) -> np.ndarray: method decrypt (line 168) | def decrypt(self, text: str) -> str: function main (line 193) | def main() -> None: FILE: ciphers/mixed_keyword_cypher.py function mixed_keyword (line 4) | def mixed_keyword( FILE: ciphers/mono_alphabetic_ciphers.py function translate_message (line 6) | def translate_message( function encrypt_message (line 31) | def encrypt_message(key: str, message: str) -> str: function decrypt_message (line 39) | def decrypt_message(key: str, message: str) -> str: function main (line 47) | def main() -> None: FILE: ciphers/morse_code.py function encrypt (line 25) | def encrypt(message: str) -> str: function decrypt (line 35) | def decrypt(message: str) -> str: function main (line 43) | def main() -> None: FILE: ciphers/onepad_cipher.py class Onepad (line 4) | class Onepad: method encrypt (line 6) | def encrypt(text: str) -> tuple[list[int], list[int]]: method decrypt (line 39) | def decrypt(cipher: list[int], key: list[int]) -> str: FILE: ciphers/permutation_cipher.py function generate_valid_block_size (line 14) | def generate_valid_block_size(message_length: int) -> int: function generate_permutation_key (line 37) | def generate_permutation_key(block_size: int) -> list[int]: function encrypt (line 57) | def encrypt( function decrypt (line 94) | def decrypt(encrypted_message: str, key: list[int]) -> str: function main (line 124) | def main() -> None: FILE: ciphers/playfair_cipher.py function chunker (line 27) | def chunker(seq: Iterable[str], size: int) -> Generator[tuple[str, ...]]: function prepare_input (line 36) | def prepare_input(dirty: str) -> str: function generate_table (line 62) | def generate_table(key: str) -> list[str]: function encode (line 83) | def encode(plaintext: str, key: str) -> str: function decode (line 121) | def decode(ciphertext: str, key: str) -> str: FILE: ciphers/polybius.py class PolybiusCipher (line 20) | class PolybiusCipher: method __init__ (line 21) | def __init__(self) -> None: method letter_to_numbers (line 24) | def letter_to_numbers(self, letter: str) -> np.ndarray: method numbers_to_letter (line 38) | def numbers_to_letter(self, index1: int, index2: int) -> str: method encode (line 51) | def encode(self, message: str) -> str: method decode (line 74) | def decode(self, message: str) -> str: FILE: ciphers/porta_cipher.py function generate_table (line 31) | def generate_table(key: str) -> list[tuple[str, str]]: function encrypt (line 41) | def encrypt(key: str, words: str) -> str: function decrypt (line 55) | def decrypt(key: str, words: str) -> str: function get_position (line 63) | def get_position(table: tuple[str, str], char: str) -> tuple[int, int]: function get_opponent (line 74) | def get_opponent(table: tuple[str, str], char: str) -> str: FILE: ciphers/rabin_miller.py function rabin_miller (line 6) | def rabin_miller(num: int) -> bool: function is_prime_low_num (line 28) | def is_prime_low_num(num: int) -> bool: function generate_large_prime (line 213) | def generate_large_prime(keysize: int = 1024) -> int: FILE: ciphers/rail_fence_cipher.py function encrypt (line 4) | def encrypt(input_string: str, key: int) -> str: function decrypt (line 41) | def decrypt(input_string: str, key: int) -> str: function bruteforce (line 87) | def bruteforce(input_string: str) -> dict[int, str]: FILE: ciphers/rot13.py function dencrypt (line 1) | def dencrypt(s: str, n: int = 13) -> str: function main (line 23) | def main() -> None: FILE: ciphers/rsa_cipher.py function get_blocks_from_text (line 10) | def get_blocks_from_text( function get_text_from_blocks (line 24) | def get_text_from_blocks( function encrypt_message (line 39) | def encrypt_message( function decrypt_message (line 50) | def decrypt_message( function read_key_file (line 63) | def read_key_file(key_filename: str) -> tuple[int, int, int]: function encrypt_and_write_to_file (line 70) | def encrypt_and_write_to_file( function read_from_file_and_decrypt (line 93) | def read_from_file_and_decrypt(message_filename: str, key_filename: str)... function main (line 115) | def main() -> None: FILE: ciphers/rsa_factorization.py function rsafactor (line 19) | def rsafactor(d: int, e: int, n: int) -> list[int]: FILE: ciphers/rsa_key_generator.py function main (line 10) | def main() -> None: function generate_key (line 16) | def generate_key(key_size: int) -> tuple[tuple[int, int], tuple[int, int]]: function make_key_files (line 43) | def make_key_files(name: str, key_size: int) -> None: FILE: ciphers/running_key_cipher.py function running_key_encrypt (line 6) | def running_key_encrypt(key: str, plaintext: str) -> str: function running_key_decrypt (line 29) | def running_key_decrypt(key: str, ciphertext: str) -> str: function test_running_key_encrypt (line 52) | def test_running_key_encrypt() -> None: FILE: ciphers/shuffled_shift_cipher.py class ShuffledShiftCipher (line 7) | class ShuffledShiftCipher: method __init__ (line 31) | def __init__(self, passcode: str | None = None) -> None: method __str__ (line 41) | def __str__(self) -> str: method __neg_pos (line 47) | def __neg_pos(self, iterlist: list[int]) -> list[int]: method __passcode_creator (line 59) | def __passcode_creator(self) -> list[str]: method __make_key_list (line 73) | def __make_key_list(self) -> list[str]: method __make_shift_key (line 119) | def __make_shift_key(self) -> int: method decrypt (line 127) | def decrypt(self, encoded_message: str) -> str: method encrypt (line 149) | def encrypt(self, plaintext: str) -> str: function test_end_to_end (line 172) | def test_end_to_end(msg: str = "Hello, this is a modified Caesar cipher"... FILE: ciphers/simple_keyword_cypher.py function remove_duplicates (line 1) | def remove_duplicates(key: str) -> str: function create_cipher_map (line 20) | def create_cipher_map(key: str) -> dict[str, str]: function encipher (line 46) | def encipher(message: str, cipher_map: dict[str, str]) -> str: function decipher (line 60) | def decipher(message: str, cipher_map: dict[str, str]) -> str: function main (line 77) | def main() -> None: FILE: ciphers/simple_substitution_cipher.py function main (line 7) | def main() -> None: function check_valid_key (line 24) | def check_valid_key(key: str) -> None: function encrypt_message (line 34) | def encrypt_message(key: str, message: str) -> str: function decrypt_message (line 42) | def decrypt_message(key: str, message: str) -> str: function translate_message (line 50) | def translate_message(key: str, message: str, mode: str) -> str: function get_random_key (line 71) | def get_random_key() -> str: FILE: ciphers/transposition_cipher.py function main (line 11) | def main() -> None: function encrypt_message (line 25) | def encrypt_message(key: int, message: str) -> str: function decrypt_message (line 39) | def decrypt_message(key: int, message: str) -> str: FILE: ciphers/transposition_cipher_encrypt_decrypt_file.py function main (line 8) | def main() -> None: FILE: ciphers/trifid_cipher.py function __encrypt_part (line 23) | def __encrypt_part(message_part: str, character_to_number: dict[str, str... function __decrypt_part (line 40) | def __decrypt_part( function __prepare (line 62) | def __prepare( function encrypt_message (line 124) | def encrypt_message( function decrypt_message (line 169) | def decrypt_message( FILE: ciphers/vernam_cipher.py function vernam_encrypt (line 1) | def vernam_encrypt(plaintext: str, key: str) -> str: function vernam_decrypt (line 15) | def vernam_decrypt(ciphertext: str, key: str) -> str: FILE: ciphers/vigenere_cipher.py function main (line 4) | def main() -> None: function encrypt_message (line 20) | def encrypt_message(key: str, message: str) -> str: function decrypt_message (line 28) | def decrypt_message(key: str, message: str) -> str: function translate_message (line 36) | def translate_message(key: str, message: str, mode: str) -> str: FILE: ciphers/xor_cipher.py class XORCipher (line 23) | class XORCipher: method __init__ (line 24) | def __init__(self, key: int = 0): method encrypt (line 33) | def encrypt(self, content: str, key: int) -> list[str]: method decrypt (line 68) | def decrypt(self, content: str, key: int) -> list[str]: method encrypt_string (line 103) | def encrypt_string(self, content: str, key: int = 0) -> str: method decrypt_string (line 144) | def decrypt_string(self, content: str, key: int = 0) -> str: method encrypt_file (line 185) | def encrypt_file(self, file: str, key: int = 0) -> bool: method decrypt_file (line 212) | def decrypt_file(self, file: str, key: int) -> bool: FILE: computer_vision/flip_augmentation.py function main (line 20) | def main() -> None: function get_dataset (line 45) | def get_dataset(label_dir: str, img_dir: str) -> tuple[list, list]: function update_image_and_anno (line 78) | def update_image_and_anno( function random_chars (line 114) | def random_chars(number_char: int = 32) -> str: FILE: computer_vision/haralick_descriptors.py function root_mean_square_error (line 10) | def root_mean_square_error(original: np.ndarray, reference: np.ndarray) ... function normalize_image (line 25) | def normalize_image( function normalize_array (line 52) | def normalize_array(array: np.ndarray, cap: float = 1) -> np.ndarray: function grayscale (line 74) | def grayscale(image: np.ndarray) -> np.ndarray: function binarize (line 88) | def binarize(image: np.ndarray, threshold: float = 127.0) -> np.ndarray: function transform (line 104) | def transform( function opening_filter (line 160) | def opening_filter(image: np.ndarray, kernel: np.ndarray | None = None) ... function closing_filter (line 178) | def closing_filter(image: np.ndarray, kernel: np.ndarray | None = None) ... function binary_mask (line 195) | def binary_mask( function matrix_concurrency (line 222) | def matrix_concurrency(image: np.ndarray, coordinate: tuple[int, int]) -... function haralick_descriptors (line 256) | def haralick_descriptors(matrix: np.ndarray) -> list[float]: function get_descriptors (line 313) | def get_descriptors( function euclidean (line 338) | def euclidean(point_1: np.ndarray, point_2: np.ndarray) -> float: function get_distances (line 352) | def get_distances(descriptors: np.ndarray, base: int) -> list[tuple[int,... FILE: computer_vision/harris_corner.py class HarrisCorner (line 10) | class HarrisCorner: method __init__ (line 11) | def __init__(self, k: float, window_size: int): method __str__ (line 23) | def __str__(self) -> str: method detect (line 26) | def detect(self, img_path: str) -> tuple[cv2.Mat, list[list[int]]]: FILE: computer_vision/horn_schunck.py function warp (line 18) | def warp( function horn_schunck (line 61) | def horn_schunck( FILE: computer_vision/intensity_based_segmentation.py function segment_image (line 9) | def segment_image(image: np.ndarray, thresholds: list[int]) -> np.ndarray: FILE: computer_vision/mean_threshold.py function mean_threshold (line 9) | def mean_threshold(image: Image) -> Image: FILE: computer_vision/mosaic_augmentation.py function main (line 21) | def main() -> None: function get_dataset (line 57) | def get_dataset(label_dir: str, img_dir: str) -> tuple[list, list]: function update_image_and_anno (line 87) | def update_image_and_anno( function random_chars (line 172) | def random_chars(number_char: int) -> str: FILE: computer_vision/pooling_functions.py function maxpooling (line 8) | def maxpooling(arr: np.ndarray, size: int, stride: int) -> np.ndarray: function avgpooling (line 64) | def avgpooling(arr: np.ndarray, size: int, stride: int) -> np.ndarray: FILE: conversions/astronomical_length_scale_conversion.py function length_conversion (line 46) | def length_conversion(value: float, from_type: str, to_type: str) -> float: FILE: conversions/binary_to_decimal.py function bin_to_decimal (line 1) | def bin_to_decimal(bin_string: str) -> int: FILE: conversions/binary_to_hexadecimal.py function bin_to_hexadecimal (line 21) | def bin_to_hexadecimal(binary_str: str) -> str: FILE: conversions/binary_to_octal.py function bin_to_octal (line 21) | def bin_to_octal(bin_string: str) -> str: FILE: conversions/convert_number_to_words.py class NumberingSystem (line 5) | class NumberingSystem(Enum): method max_value (line 33) | def max_value(cls, system: str) -> int: class NumberWords (line 56) | class NumberWords(Enum): function convert_small_number (line 95) | def convert_small_number(num: int) -> str: function convert_number (line 137) | def convert_number( FILE: conversions/decimal_to_any.py function decimal_to_any (line 8) | def decimal_to_any(num: int, base: int) -> str: FILE: conversions/decimal_to_binary.py function decimal_to_binary_iterative (line 4) | def decimal_to_binary_iterative(num: int) -> str: function decimal_to_binary_recursive_helper (line 55) | def decimal_to_binary_recursive_helper(decimal: int) -> str: function decimal_to_binary_recursive (line 74) | def decimal_to_binary_recursive(number: str) -> str: FILE: conversions/decimal_to_hexadecimal.py function decimal_to_hexadecimal (line 24) | def decimal_to_hexadecimal(decimal: float) -> str: FILE: conversions/decimal_to_octal.py function decimal_to_octal (line 9) | def decimal_to_octal(num: int) -> str: function main (line 27) | def main() -> None: FILE: conversions/energy_conversions.py function energy_conversion (line 45) | def energy_conversion(from_type: str, to_type: str, value: float) -> float: FILE: conversions/excel_title_to_column.py function excel_title_to_column (line 1) | def excel_title_to_column(column_title: str) -> int: FILE: conversions/hex_to_bin.py function hex_to_bin (line 1) | def hex_to_bin(hex_num: str) -> int: FILE: conversions/hexadecimal_to_decimal.py function hex_to_decimal (line 4) | def hex_to_decimal(hex_string: str) -> int: FILE: conversions/ipv4_conversion.py function ipv4_to_decimal (line 4) | def ipv4_to_decimal(ipv4_address: str) -> int: function alt_ipv4_to_decimal (line 41) | def alt_ipv4_to_decimal(ipv4_address: str) -> int: function decimal_to_ipv4 (line 51) | def decimal_to_ipv4(decimal_ipv4: int) -> str: FILE: conversions/length_conversion.py class FromTo (line 28) | class FromTo(NamedTuple): function length_conversion (line 58) | def length_conversion(value: float, from_type: str, to_type: str) -> float: FILE: conversions/molecular_chemistry.py function molarity_to_normality (line 10) | def molarity_to_normality(nfactor: int, moles: float, volume: float) -> ... function moles_to_pressure (line 26) | def moles_to_pressure(volume: float, moles: float, temperature: float) -... function moles_to_volume (line 46) | def moles_to_volume(pressure: float, moles: float, temperature: float) -... function pressure_and_volume_to_temperature (line 66) | def pressure_and_volume_to_temperature( FILE: conversions/octal_to_binary.py function octal_to_binary (line 11) | def octal_to_binary(octal_number: str) -> str: FILE: conversions/octal_to_decimal.py function oct_to_decimal (line 1) | def oct_to_decimal(oct_string: str) -> int: FILE: conversions/octal_to_hexadecimal.py function octal_to_hex (line 1) | def octal_to_hex(octal: str) -> str: FILE: conversions/prefix_conversions.py class SIUnit (line 10) | class SIUnit(Enum): class BinaryUnit (line 33) | class BinaryUnit(Enum): function convert_si_prefix (line 44) | def convert_si_prefix( function convert_binary_prefix (line 73) | def convert_binary_prefix( FILE: conversions/prefix_conversions_string.py class BinaryUnit (line 21) | class BinaryUnit(Enum): class SIUnit (line 33) | class SIUnit(Enum): method get_positive (line 56) | def get_positive(cls) -> dict: method get_negative (line 71) | def get_negative(cls) -> dict: function add_si_prefix (line 87) | def add_si_prefix(value: float) -> str: function add_binary_prefix (line 103) | def add_binary_prefix(value: float) -> str: FILE: conversions/pressure_conversions.py class FromTo (line 25) | class FromTo(NamedTuple): function pressure_conversion (line 42) | def pressure_conversion(value: float, from_type: str, to_type: str) -> f... FILE: conversions/rectangular_to_polar.py function rectangular_to_polar (line 4) | def rectangular_to_polar(real: float, img: float) -> tuple[float, float]: FILE: conversions/rgb_cmyk_conversion.py function rgb_to_cmyk (line 1) | def rgb_to_cmyk(r_input: int, g_input: int, b_input: int) -> tuple[int, ... FILE: conversions/rgb_hsv_conversion.py function hsv_to_rgb (line 15) | def hsv_to_rgb(hue: float, saturation: float, value: float) -> list[int]: function rgb_to_hsv (line 84) | def rgb_to_hsv(red: int, green: int, blue: int) -> list[float]: function approximately_equal_hsv (line 142) | def approximately_equal_hsv(hsv_1: list[float], hsv_2: list[float]) -> b... FILE: conversions/roman_numerals.py function roman_to_int (line 18) | def roman_to_int(roman: str) -> int: function int_to_roman (line 41) | def int_to_roman(number: int) -> str: FILE: conversions/speed_conversions.py function convert_speed (line 25) | def convert_speed(speed: float, unit_from: str, unit_to: str) -> float: FILE: conversions/temperature_conversions.py function celsius_to_fahrenheit (line 4) | def celsius_to_fahrenheit(celsius: float, ndigits: int = 2) -> float: function celsius_to_kelvin (line 32) | def celsius_to_kelvin(celsius: float, ndigits: int = 2) -> float: function celsius_to_rankine (line 56) | def celsius_to_rankine(celsius: float, ndigits: int = 2) -> float: function fahrenheit_to_celsius (line 80) | def fahrenheit_to_celsius(fahrenheit: float, ndigits: int = 2) -> float: function fahrenheit_to_kelvin (line 110) | def fahrenheit_to_kelvin(fahrenheit: float, ndigits: int = 2) -> float: function fahrenheit_to_rankine (line 140) | def fahrenheit_to_rankine(fahrenheit: float, ndigits: int = 2) -> float: function kelvin_to_celsius (line 170) | def kelvin_to_celsius(kelvin: float, ndigits: int = 2) -> float: function kelvin_to_fahrenheit (line 194) | def kelvin_to_fahrenheit(kelvin: float, ndigits: int = 2) -> float: function kelvin_to_rankine (line 218) | def kelvin_to_rankine(kelvin: float, ndigits: int = 2) -> float: function rankine_to_celsius (line 242) | def rankine_to_celsius(rankine: float, ndigits: int = 2) -> float: function rankine_to_fahrenheit (line 266) | def rankine_to_fahrenheit(rankine: float, ndigits: int = 2) -> float: function rankine_to_kelvin (line 286) | def rankine_to_kelvin(rankine: float, ndigits: int = 2) -> float: function reaumur_to_kelvin (line 306) | def reaumur_to_kelvin(reaumur: float, ndigits: int = 2) -> float: function reaumur_to_fahrenheit (line 325) | def reaumur_to_fahrenheit(reaumur: float, ndigits: int = 2) -> float: function reaumur_to_celsius (line 344) | def reaumur_to_celsius(reaumur: float, ndigits: int = 2) -> float: function reaumur_to_rankine (line 363) | def reaumur_to_rankine(reaumur: float, ndigits: int = 2) -> float: FILE: conversions/time_conversions.py function convert_time (line 25) | def convert_time(time_value: float, unit_from: str, unit_to: str) -> float: FILE: conversions/volume_conversions.py class FromTo (line 24) | class FromTo(NamedTuple): function volume_conversion (line 40) | def volume_conversion(value: float, from_type: str, to_type: str) -> float: FILE: conversions/weight_conversion.py function weight_conversion (line 62) | def weight_conversion(from_type: str, to_type: str, value: float) -> float: FILE: data_compression/burrows_wheeler.py class BWTTransformDict (line 19) | class BWTTransformDict(TypedDict): function all_rotations (line 24) | def all_rotations(s: str) -> list[str]: function bwt_transform (line 54) | def bwt_transform(s: str) -> BWTTransformDict: function reverse_bwt (line 93) | def reverse_bwt(bwt_string: str, idx_original_string: int) -> str: FILE: data_compression/coordinate_compression.py class CoordinateCompressor (line 8) | class CoordinateCompressor: method __init__ (line 33) | def __init__(self, arr: list[int | float | str]) -> None: method compress_coordinates (line 60) | def compress_coordinates(self) -> None: method compress (line 82) | def compress(self, original: float | str) -> int: method decompress (line 101) | def decompress(self, num: int) -> int | float | str: FILE: data_compression/huffman.py class Letter (line 6) | class Letter: method __init__ (line 7) | def __init__(self, letter: str, freq: int): method __repr__ (line 12) | def __repr__(self) -> str: class TreeNode (line 16) | class TreeNode: method __init__ (line 17) | def __init__(self, freq: int, left: Letter | TreeNode, right: Letter |... function parse_file (line 23) | def parse_file(file_path: str) -> list[Letter]: function build_tree (line 38) | def build_tree(letters: list[Letter]) -> Letter | TreeNode: function traverse_tree (line 54) | def traverse_tree(root: Letter | TreeNode, bitstring: str) -> list[Letter]: function huffman (line 69) | def huffman(file_path: str) -> None: FILE: data_compression/lempel_ziv.py function read_file_binary (line 11) | def read_file_binary(file_path: str) -> str: function add_key_to_lexicon (line 28) | def add_key_to_lexicon( function compress_data (line 44) | def compress_data(data_bits: str) -> str: function add_file_length (line 74) | def add_file_length(source_path: str, compressed: str) -> str: function write_file_binary (line 86) | def write_file_binary(file_path: str, to_write: str) -> None: function compress (line 113) | def compress(source_path: str, destination_path: str) -> None: FILE: data_compression/lempel_ziv_decompress.py function read_file_binary (line 10) | def read_file_binary(file_path: str) -> str: function decompress_data (line 27) | def decompress_data(data_bits: str) -> str: function write_file_binary (line 57) | def write_file_binary(file_path: str, to_write: str) -> None: function remove_prefix (line 84) | def remove_prefix(data_bits: str) -> str: function compress (line 100) | def compress(source_path: str, destination_path: str) -> None: FILE: data_compression/lz77.py class Token (line 38) | class Token: method __repr__ (line 48) | def __repr__(self) -> str: class LZ77Compressor (line 59) | class LZ77Compressor: method __init__ (line 64) | def __init__(self, window_size: int = 13, lookahead_buffer_size: int =... method compress (line 69) | def compress(self, text: str) -> list[Token]: method decompress (line 111) | def decompress(self, tokens: list[Token]) -> str: method _find_encoding_token (line 144) | def _find_encoding_token(self, text: str, search_buffer: str) -> Token: method _match_length_from_index (line 183) | def _match_length_from_index( FILE: data_compression/peak_signal_to_noise_ratio.py function peak_signal_to_noise_ratio (line 17) | def peak_signal_to_noise_ratio(original: float, contrast: float) -> float: function main (line 25) | def main() -> None: FILE: data_compression/run_length_encoding.py function run_length_encode (line 4) | def run_length_encode(text: str) -> list: function run_length_decode (line 29) | def run_length_decode(encoded: list) -> str: FILE: data_structures/arrays/equilibrium_index_in_array.py function equilibrium_index (line 23) | def equilibrium_index(arr: list[int]) -> int: FILE: data_structures/arrays/find_triplets_with_0_sum.py function find_triplets_with_0_sum (line 4) | def find_triplets_with_0_sum(nums: list[int]) -> list[list[int]]: function find_triplets_with_0_sum_hashing (line 27) | def find_triplets_with_0_sum_hashing(arr: list[int]) -> list[list[int]]: FILE: data_structures/arrays/index_2d_array_in_1d.py class Index2DArrayIterator (line 28) | class Index2DArrayIterator: method __iter__ (line 31) | def __iter__(self) -> Iterator[int]: function index_2d_array_in_1d (line 62) | def index_2d_array_in_1d(array: list[list[int]], index: int) -> int: FILE: data_structures/arrays/kth_largest_element.py function partition (line 8) | def partition(arr: list[int], low: int, high: int) -> int: function kth_largest_element (line 44) | def kth_largest_element(arr: list[int], position: int) -> int: FILE: data_structures/arrays/median_two_array.py function find_median_sorted_arrays (line 6) | def find_median_sorted_arrays(nums1: list[int], nums2: list[int]) -> float: FILE: data_structures/arrays/monotonic_array.py function is_monotonic (line 2) | def is_monotonic(nums: list[int]) -> bool: FILE: data_structures/arrays/pairs_with_given_sum.py function pairs_with_sum (line 13) | def pairs_with_sum(arr: list, req_sum: int) -> int: FILE: data_structures/arrays/permutations.py function permute_recursive (line 1) | def permute_recursive(nums: list[int]) -> list[list[int]]: function permute_backtrack (line 21) | def permute_backtrack(nums: list[int]) -> list[list[int]]: FILE: data_structures/arrays/prefix_sum.py class PrefixSum (line 10) | class PrefixSum: method __init__ (line 11) | def __init__(self, array: list[int]) -> None: method get_sum (line 21) | def get_sum(self, start: int, end: int) -> int: method contains_sum (line 61) | def contains_sum(self, target_sum: int) -> bool: FILE: data_structures/arrays/product_sum.py function product_sum (line 23) | def product_sum(arr: list[int | list], depth: int) -> int: function product_sum_array (line 67) | def product_sum_array(array: list[int | list]) -> int: FILE: data_structures/arrays/rotate_array.py function rotate_array (line 1) | def rotate_array(arr: list[int], steps: int) -> list[int]: FILE: data_structures/arrays/sparse_table.py function build_sparse_table (line 17) | def build_sparse_table(number_list: list[int]) -> list[list[int]]: function query (line 61) | def query(sparse_table: list[list[int]], left_bound: int, right_bound: i... FILE: data_structures/arrays/sudoku_solver.py function cross (line 11) | def cross(items_a, items_b): function test (line 44) | def test(): function parse_grid (line 64) | def parse_grid(grid): function grid_values (line 77) | def grid_values(grid): function assign (line 86) | def assign(values, s, d): function eliminate (line 98) | def eliminate(values, s, d): function display (line 124) | def display(values): function solve (line 141) | def solve(grid): function some (line 148) | def some(seq): function search (line 156) | def search(values): function solve_all (line 169) | def solve_all(grids, name="", showif=0.0): function solved (line 196) | def solved(values): function from_file (line 207) | def from_file(filename, sep="\n"): function random_puzzle (line 213) | def random_puzzle(assignments=17): function shuffled (line 229) | def shuffled(seq): FILE: data_structures/binary_tree/avl_tree.py class MyQueue (line 16) | class MyQueue: method __init__ (line 17) | def __init__(self) -> None: method is_empty (line 22) | def is_empty(self) -> bool: method push (line 25) | def push(self, data: Any) -> None: method pop (line 29) | def pop(self) -> Any: method count (line 34) | def count(self) -> int: method print_queue (line 37) | def print_queue(self) -> None: class MyNode (line 43) | class MyNode: method __init__ (line 44) | def __init__(self, data: Any) -> None: method get_data (line 50) | def get_data(self) -> Any: method get_left (line 53) | def get_left(self) -> MyNode | None: method get_right (line 56) | def get_right(self) -> MyNode | None: method get_height (line 59) | def get_height(self) -> int: method set_data (line 62) | def set_data(self, data: Any) -> None: method set_left (line 65) | def set_left(self, node: MyNode | None) -> None: method set_right (line 68) | def set_right(self, node: MyNode | None) -> None: method set_height (line 71) | def set_height(self, height: int) -> None: function get_height (line 75) | def get_height(node: MyNode | None) -> int: function my_max (line 81) | def my_max(a: int, b: int) -> int: function right_rotation (line 87) | def right_rotation(node: MyNode) -> MyNode: function left_rotation (line 110) | def left_rotation(node: MyNode) -> MyNode: function lr_rotation (line 126) | def lr_rotation(node: MyNode) -> MyNode: function rl_rotation (line 143) | def rl_rotation(node: MyNode) -> MyNode: function insert_node (line 150) | def insert_node(node: MyNode | None, data: Any) -> MyNode | None: function get_right_most (line 180) | def get_right_most(root: MyNode) -> Any: function get_left_most (line 189) | def get_left_most(root: MyNode) -> Any: function del_node (line 198) | def del_node(root: MyNode, data: Any) -> MyNode | None: class AVLtree (line 245) | class AVLtree: method __init__ (line 279) | def __init__(self) -> None: method get_height (line 282) | def get_height(self) -> int: method insert (line 285) | def insert(self, data: Any) -> None: method del_node (line 289) | def del_node(self, data: Any) -> None: method __str__ (line 296) | def __str__( function _test (line 332) | def _test() -> None: FILE: data_structures/binary_tree/basic_binary_tree.py class Node (line 8) | class Node: method __iter__ (line 13) | def __iter__(self) -> Iterator[int]: method __len__ (line 20) | def __len__(self) -> int: method is_full (line 23) | def is_full(self) -> bool: class BinaryTree (line 32) | class BinaryTree: method __iter__ (line 35) | def __iter__(self) -> Iterator[int]: method __len__ (line 38) | def __len__(self) -> int: method small_tree (line 42) | def small_tree(cls) -> BinaryTree: method medium_tree (line 57) | def medium_tree(cls) -> BinaryTree: method depth (line 75) | def depth(self) -> int: method _depth (line 88) | def _depth(self, node: Node | None) -> int: method is_full (line 93) | def is_full(self) -> bool: FILE: data_structures/binary_tree/binary_search_tree.py class Node (line 100) | class Node: method __iter__ (line 106) | def __iter__(self) -> Iterator[int]: method __repr__ (line 117) | def __repr__(self) -> str: method is_right (line 125) | def is_right(self) -> bool: class BinarySearchTree (line 130) | class BinarySearchTree: method __bool__ (line 133) | def __bool__(self) -> bool: method __iter__ (line 136) | def __iter__(self) -> Iterator[int]: method __str__ (line 139) | def __str__(self) -> str: method __reassign_nodes (line 145) | def __reassign_nodes(self, node: Node, new_children: Node | None) -> N... method empty (line 156) | def empty(self) -> bool: method __insert (line 170) | def __insert(self, value) -> None: method insert (line 195) | def insert(self, *values) -> Self: method search (line 200) | def search(self, value) -> Node | None: method get_max (line 234) | def get_max(self, node: Node | None = None) -> Node | None: method get_min (line 257) | def get_min(self, node: Node | None = None) -> Node | None: method remove (line 280) | def remove(self, value: int) -> None: method preorder_traverse (line 302) | def preorder_traverse(self, node: Node | None) -> Iterable: method traversal_tree (line 308) | def traversal_tree(self, traversal_function=None) -> Any: method inorder (line 318) | def inorder(self, arr: list, node: Node | None) -> None: method find_kth_smallest (line 326) | def find_kth_smallest(self, k: int, node: Node) -> int: function inorder (line 333) | def inorder(curr_node: Node | None) -> list[Node]: function postorder (line 343) | def postorder(curr_node: Node | None) -> list[Node]: FILE: data_structures/binary_tree/binary_search_tree_recursive.py class Node (line 19) | class Node: method __init__ (line 20) | def __init__(self, label: int, parent: Node | None) -> None: class BinarySearchTree (line 27) | class BinarySearchTree: method __init__ (line 28) | def __init__(self) -> None: method empty (line 31) | def empty(self) -> None: method is_empty (line 42) | def is_empty(self) -> bool: method put (line 55) | def put(self, label: int) -> None: method _put (line 74) | def _put(self, node: Node | None, label: int, parent: Node | None = No... method search (line 87) | def search(self, label: int) -> Node: method _search (line 104) | def _search(self, node: Node | None, label: int) -> Node: method remove (line 115) | def remove(self, label: int) -> None: method _reassign_nodes (line 146) | def _reassign_nodes(self, node: Node, new_children: Node | None) -> None: method _get_lowest_node (line 158) | def _get_lowest_node(self, node: Node) -> Node: method exists (line 167) | def exists(self, label: int) -> bool: method get_max_label (line 186) | def get_max_label(self) -> int: method get_min_label (line 210) | def get_min_label(self) -> int: method inorder_traversal (line 234) | def inorder_traversal(self) -> Iterator[Node]: method _inorder_traversal (line 250) | def _inorder_traversal(self, node: Node | None) -> Iterator[Node]: method preorder_traversal (line 256) | def preorder_traversal(self) -> Iterator[Node]: method _preorder_traversal (line 272) | def _preorder_traversal(self, node: Node | None) -> Iterator[Node]: class BinarySearchTreeTest (line 279) | class BinarySearchTreeTest(unittest.TestCase): method _get_binary_search_tree (line 281) | def _get_binary_search_tree() -> BinarySearchTree: method test_put (line 307) | def test_put(self) -> None: method test_search (line 366) | def test_search(self) -> None: method test_remove (line 378) | def test_remove(self) -> None: method test_remove_2 (line 468) | def test_remove_2(self) -> None: method test_empty (line 497) | def test_empty(self) -> None: method test_is_empty (line 502) | def test_is_empty(self) -> None: method test_exists (line 509) | def test_exists(self) -> None: method test_get_max_label (line 515) | def test_get_max_label(self) -> None: method test_get_min_label (line 524) | def test_get_min_label(self) -> None: method test_inorder_traversal (line 533) | def test_inorder_traversal(self) -> None: method test_preorder_traversal (line 539) | def test_preorder_traversal(self) -> None: function binary_search_tree_example (line 546) | def binary_search_tree_example() -> None: FILE: data_structures/binary_tree/binary_tree_mirror.py function binary_tree_mirror_dict (line 7) | def binary_tree_mirror_dict(binary_tree_mirror_dictionary: dict, root: i... function binary_tree_mirror (line 16) | def binary_tree_mirror(binary_tree: dict, root: int = 1) -> dict: FILE: data_structures/binary_tree/binary_tree_node_sum.py class Node (line 16) | class Node: method __init__ (line 21) | def __init__(self, value: int) -> None: class BinaryTreeNodeSum (line 27) | class BinaryTreeNodeSum: method __init__ (line 58) | def __init__(self, tree: Node) -> None: method depth_first_search (line 61) | def depth_first_search(self, node: Node | None) -> int: method __iter__ (line 68) | def __iter__(self) -> Iterator[int]: FILE: data_structures/binary_tree/binary_tree_path_sum.py class Node (line 13) | class Node: method __init__ (line 18) | def __init__(self, value: int) -> None: class BinaryTreePathSum (line 24) | class BinaryTreePathSum: method __init__ (line 77) | def __init__(self) -> None: method depth_first_search (line 80) | def depth_first_search(self, node: Node | None, path_sum: int) -> None: method path_sum (line 92) | def path_sum(self, node: Node | None, target: int | None = None) -> int: FILE: data_structures/binary_tree/binary_tree_traversals.py class Node (line 10) | class Node: function make_tree (line 16) | def make_tree() -> Node | None: function preorder (line 33) | def preorder(root: Node | None) -> Generator[int]: function postorder (line 46) | def postorder(root: Node | None) -> Generator[int]: function inorder (line 59) | def inorder(root: Node | None) -> Generator[int]: function reverse_inorder (line 72) | def reverse_inorder(root: Node | None) -> Generator[int]: function height (line 85) | def height(root: Node | None) -> int: function level_order (line 96) | def level_order(root: Node | None) -> Generator[int]: function get_nodes_from_left_to_right (line 119) | def get_nodes_from_left_to_right(root: Node | None, level: int) -> Gener... function get_nodes_from_right_to_left (line 141) | def get_nodes_from_right_to_left(root: Node | None, level: int) -> Gener... function zigzag (line 163) | def zigzag(root: Node | None) -> Generator[int]: function main (line 185) | def main() -> None: # Main function for testing. FILE: data_structures/binary_tree/diameter_of_binary_tree.py class Node (line 12) | class Node: method depth (line 17) | def depth(self) -> int: method diameter (line 35) | def diameter(self) -> int: FILE: data_structures/binary_tree/diff_views_of_binary_tree.py class TreeNode (line 16) | class TreeNode: function make_tree (line 22) | def make_tree() -> TreeNode: function binary_tree_right_side_view (line 30) | def binary_tree_right_side_view(root: TreeNode) -> list[int]: function binary_tree_left_side_view (line 70) | def binary_tree_left_side_view(root: TreeNode) -> list[int]: function binary_tree_top_side_view (line 110) | def binary_tree_top_side_view(root: TreeNode) -> list[int]: function binary_tree_bottom_side_view (line 159) | def binary_tree_bottom_side_view(root: TreeNode) -> list[int]: FILE: data_structures/binary_tree/distribute_coins.py class TreeNode (line 47) | class TreeNode: class CoinsDistribResult (line 53) | class CoinsDistribResult(NamedTuple): function distribute_coins (line 58) | def distribute_coins(root: TreeNode | None) -> int: FILE: data_structures/binary_tree/fenwick_tree.py class FenwickTree (line 4) | class FenwickTree: method __init__ (line 11) | def __init__(self, arr: list[int] | None = None, size: int | None = No... method init (line 28) | def init(self, arr: list[int]) -> None: method get_array (line 53) | def get_array(self) -> list[int]: method next_ (line 73) | def next_(index: int) -> int: method prev (line 77) | def prev(index: int) -> int: method add (line 80) | def add(self, index: int, value: int) -> None: method update (line 107) | def update(self, index: int, value: int) -> None: method prefix (line 129) | def prefix(self, right: int) -> int: method query (line 156) | def query(self, left: int, right: int) -> int: method get (line 178) | def get(self, index: int) -> int: method rank_query (line 198) | def rank_query(self, value: int) -> int: FILE: data_structures/binary_tree/flatten_binarytree_to_linkedlist.py class TreeNode (line 17) | class TreeNode: method __init__ (line 23) | def __init__(self, data: int) -> None: function build_tree (line 29) | def build_tree() -> TreeNode: function flatten (line 60) | def flatten(root: TreeNode | None) -> None: function display_linked_list (line 109) | def display_linked_list(root: TreeNode | None) -> None: FILE: data_structures/binary_tree/floor_and_ceiling.py class Node (line 20) | class Node: method __iter__ (line 25) | def __iter__(self) -> Iterator[int]: method __len__ (line 32) | def __len__(self) -> int: function floor_ceiling (line 36) | def floor_ceiling(root: Node | None, key: int) -> tuple[int | None, int ... FILE: data_structures/binary_tree/inorder_tree_traversal_2022.py class BinaryTreeNode (line 8) | class BinaryTreeNode: method __init__ (line 11) | def __init__(self, data: int) -> None: function insert (line 17) | def insert(node: BinaryTreeNode | None, new_value: int) -> BinaryTreeNod... function inorder (line 46) | def inorder(node: None | BinaryTreeNode) -> list[int]: # if node is Non... function make_tree (line 60) | def make_tree() -> BinaryTreeNode | None: function main (line 71) | def main() -> None: FILE: data_structures/binary_tree/is_sorted.py class Node (line 24) | class Node: method __iter__ (line 29) | def __iter__(self) -> Iterator[float]: method is_sorted (line 48) | def is_sorted(self) -> bool: FILE: data_structures/binary_tree/is_sum_tree.py class Node (line 14) | class Node: method __iter__ (line 19) | def __iter__(self) -> Iterator[int]: method __len__ (line 34) | def __len__(self) -> int: method is_sum_node (line 46) | def is_sum_node(self) -> bool: class BinaryTree (line 72) | class BinaryTree: method __iter__ (line 75) | def __iter__(self) -> Iterator[int]: method __len__ (line 82) | def __len__(self) -> int: method __str__ (line 89) | def __str__(self) -> str: method is_sum_tree (line 99) | def is_sum_tree(self) -> bool: method build_a_tree (line 109) | def build_a_tree(cls) -> BinaryTree: method build_a_sum_tree (line 134) | def build_a_sum_tree(cls) -> BinaryTree: FILE: data_structures/binary_tree/lazy_segment_tree.py class SegmentTree (line 6) | class SegmentTree: method __init__ (line 7) | def __init__(self, size: int) -> None: method left (line 15) | def left(self, idx: int) -> int: method right (line 27) | def right(self, idx: int) -> int: method build (line 39) | def build( method update (line 52) | def update( method query (line 89) | def query( method __str__ (line 121) | def __str__(self) -> str: FILE: data_structures/binary_tree/lowest_common_ancestor.py function swap (line 9) | def swap(a: int, b: int) -> tuple[int, int]: function create_sparse (line 27) | def create_sparse(max_node: int, parent: list[list[int]]) -> list[list[i... function lowest_common_ancestor (line 57) | def lowest_common_ancestor( function breadth_first_search (line 94) | def breadth_first_search( function main (line 139) | def main() -> None: FILE: data_structures/binary_tree/maximum_fenwick_tree.py class MaxFenwickTree (line 1) | class MaxFenwickTree: method __init__ (line 39) | def __init__(self, size: int) -> None: method get_next (line 54) | def get_next(index: int) -> int: method get_prev (line 61) | def get_prev(index: int) -> int: method update (line 67) | def update(self, index: int, value: int) -> None: method query (line 87) | def query(self, left: int, right: int) -> int: FILE: data_structures/binary_tree/maximum_sum_bst.py class TreeNode (line 11) | class TreeNode: function max_sum_bst (line 17) | def max_sum_bst(root: TreeNode | None) -> int: FILE: data_structures/binary_tree/merge_two_binary_trees.py class Node (line 12) | class Node: method __init__ (line 17) | def __init__(self, value: int = 0) -> None: function merge_two_binary_trees (line 23) | def merge_two_binary_trees(tree1: Node | None, tree2: Node | None) -> No... function print_preorder (line 56) | def print_preorder(root: Node | None) -> None: FILE: data_structures/binary_tree/mirror_binary_tree.py class Node (line 14) | class Node: method __iter__ (line 23) | def __iter__(self) -> Iterator[int]: method __len__ (line 30) | def __len__(self) -> int: method mirror (line 33) | def mirror(self) -> Node: function make_tree_seven (line 56) | def make_tree_seven() -> Node: function make_tree_nine (line 83) | def make_tree_nine() -> Node: function main (line 114) | def main() -> None: FILE: data_structures/binary_tree/non_recursive_segment_tree.py class SegmentTree (line 47) | class SegmentTree[T]: method __init__ (line 48) | def __init__(self, arr: list[T], fnc: Callable[[T, T], T]) -> None: method build (line 67) | def build(self) -> None: method update (line 71) | def update(self, p: int, v: T) -> None: method query (line 90) | def query(self, left: int, right: int) -> T | None: function test_all_segments (line 143) | def test_all_segments() -> None: FILE: data_structures/binary_tree/number_of_possible_binary_trees.py function binomial_coefficient (line 20) | def binomial_coefficient(n: int, k: int) -> int: function catalan_number (line 42) | def catalan_number(node_count: int) -> int: function factorial (line 59) | def factorial(n: int) -> int: function binary_tree_count (line 81) | def binary_tree_count(node_count: int) -> int: FILE: data_structures/binary_tree/red_black_tree.py class RedBlackTree (line 6) | class RedBlackTree: method __init__ (line 20) | def __init__( method rotate_left (line 43) | def rotate_left(self) -> RedBlackTree: method rotate_right (line 65) | def rotate_right(self) -> RedBlackTree: method insert (line 87) | def insert(self, label: int) -> RedBlackTree: method _insert_repair (line 112) | def _insert_repair(self) -> None: method remove (line 150) | def remove(self, label: int) -> RedBlackTree: method _remove_repair (line 205) | def _remove_repair(self) -> None: method check_color_properties (line 278) | def check_color_properties(self) -> bool: method check_coloring (line 311) | def check_coloring(self) -> bool: method black_height (line 321) | def black_height(self) -> int | None: method __contains__ (line 343) | def __contains__(self, label: int) -> bool: method search (line 350) | def search(self, label: int) -> RedBlackTree | None: method floor (line 367) | def floor(self, label: int) -> int | None: method ceil (line 384) | def ceil(self, label: int) -> int | None: method get_max (line 402) | def get_max(self) -> int | None: method get_min (line 412) | def get_min(self) -> int | None: method grandparent (line 423) | def grandparent(self) -> RedBlackTree | None: method sibling (line 431) | def sibling(self) -> RedBlackTree | None: method is_left (line 440) | def is_left(self) -> bool: method is_right (line 446) | def is_right(self) -> bool: method __bool__ (line 452) | def __bool__(self) -> bool: method __len__ (line 455) | def __len__(self) -> int: method preorder_traverse (line 466) | def preorder_traverse(self) -> Iterator[int | None]: method inorder_traverse (line 473) | def inorder_traverse(self) -> Iterator[int | None]: method postorder_traverse (line 480) | def postorder_traverse(self) -> Iterator[int | None]: method __repr__ (line 487) | def __repr__(self) -> str: method __eq__ (line 502) | def __eq__(self, other: object) -> bool: function color (line 512) | def color(node: RedBlackTree | None) -> int: function test_rotations (line 526) | def test_rotations() -> bool: function test_insertion_speed (line 560) | def test_insertion_speed() -> bool: function test_insert (line 570) | def test_insert() -> bool: function test_insert_and_search (line 591) | def test_insert_and_search() -> bool: function test_insert_delete (line 607) | def test_insert_delete() -> bool: function test_floor_ceil (line 629) | def test_floor_ceil() -> bool: function test_min_max (line 645) | def test_min_max() -> bool: function test_tree_traversal (line 657) | def test_tree_traversal() -> bool: function test_tree_chaining (line 673) | def test_tree_chaining() -> bool: function print_results (line 684) | def print_results(msg: str, passes: bool) -> None: function pytests (line 688) | def pytests() -> None: function main (line 698) | def main() -> None: FILE: data_structures/binary_tree/segment_tree.py class SegmentTree (line 4) | class SegmentTree: method __init__ (line 5) | def __init__(self, a): method left (line 14) | def left(self, idx): method right (line 26) | def right(self, idx): method build (line 38) | def build(self, idx, left, right): method update (line 47) | def update(self, a, b, val): method update_recursive (line 59) | def update_recursive(self, idx, left, right, a, b, val): method query (line 74) | def query(self, a, b): method query_recursive (line 86) | def query_recursive(self, idx, left, right, a, b): method show_data (line 99) | def show_data(self): FILE: data_structures/binary_tree/segment_tree_other.py class SegmentTreeNode (line 11) | class SegmentTreeNode: method __init__ (line 12) | def __init__(self, start, end, val, left=None, right=None): method __repr__ (line 20) | def __repr__(self): class SegmentTree (line 24) | class SegmentTree: method __init__ (line 130) | def __init__(self, collection: Sequence, function): method update (line 136) | def update(self, i, val): method query_range (line 149) | def query_range(self, i, j): method _build_tree (line 168) | def _build_tree(self, start, end): method _update_tree (line 176) | def _update_tree(self, node, i, val): method _query_range (line 186) | def _query_range(self, node, i, j): method traverse (line 204) | def traverse(self): FILE: data_structures/binary_tree/serialize_deserialize_binary_tree.py class TreeNode (line 8) | class TreeNode: method __post_init__ (line 22) | def __post_init__(self): method __iter__ (line 26) | def __iter__(self) -> Iterator[TreeNode]: method __len__ (line 42) | def __len__(self) -> int: method __repr__ (line 56) | def __repr__(self) -> str: method five_tree (line 73) | def five_tree(cls) -> TreeNode: function deserialize (line 86) | def deserialize(data: str) -> TreeNode | None: FILE: data_structures/binary_tree/symmetric_tree.py class Node (line 14) | class Node: function make_symmetric_tree (line 38) | def make_symmetric_tree() -> Node: function make_asymmetric_tree (line 71) | def make_asymmetric_tree() -> Node: function is_symmetric_tree (line 104) | def is_symmetric_tree(tree: Node) -> bool: function is_mirror (line 125) | def is_mirror(left: Node | None, right: Node | None) -> bool: FILE: data_structures/binary_tree/treap.py class Node (line 6) | class Node: method __init__ (line 12) | def __init__(self, value: int | None = None): method __repr__ (line 18) | def __repr__(self) -> str: method __str__ (line 28) | def __str__(self) -> str: function split (line 35) | def split(root: Node | None, value: int) -> tuple[Node | None, Node | No... function merge (line 61) | def merge(left: Node | None, right: Node | None) -> Node | None: function insert (line 83) | def insert(root: Node | None, value: int) -> Node | None: function erase (line 96) | def erase(root: Node | None, value: int) -> Node | None: function inorder (line 109) | def inorder(root: Node | None) -> None: function interact_treap (line 121) | def interact_treap(root: Node | None, args: str) -> Node | None: function main (line 158) | def main() -> None: FILE: data_structures/binary_tree/wavelet_tree.py class Node (line 16) | class Node: method __init__ (line 17) | def __init__(self, length: int) -> None: method __repr__ (line 24) | def __repr__(self) -> str: function build_tree (line 35) | def build_tree(arr: list[int]) -> Node | None: function rank_till_index (line 70) | def rank_till_index(node: Node | None, num: int, index: int) -> int: function rank (line 100) | def rank(node: Node | None, num: int, start: int, end: int) -> int: function quantile (line 121) | def quantile(node: Node | None, index: int, start: int, end: int) -> int: function range_counting (line 161) | def range_counting( FILE: data_structures/disjoint_set/alternate_disjoint_set.py class DisjointSet (line 7) | class DisjointSet: method __init__ (line 8) | def __init__(self, set_counts: list) -> None: method merge (line 19) | def merge(self, src: int, dst: int) -> bool: method get_parent (line 54) | def get_parent(self, disj_set: int) -> int: FILE: data_structures/disjoint_set/disjoint_set.py class Node (line 7) | class Node: method __init__ (line 8) | def __init__(self, data: int) -> None: function make_set (line 14) | def make_set(x: Node) -> None: function union_set (line 24) | def union_set(x: Node, y: Node) -> None: function find_set (line 42) | def find_set(x: Node) -> Node: function find_python_set (line 51) | def find_python_set(node: Node) -> set: function test_disjoint_set (line 63) | def test_disjoint_set() -> None: FILE: data_structures/hashing/bloom_filter.py class Bloom (line 67) | class Bloom: method __init__ (line 68) | def __init__(self, size: int = 8) -> None: method add (line 72) | def add(self, value: str) -> None: method exists (line 76) | def exists(self, value: str) -> bool: method __contains__ (line 80) | def __contains__(self, other: str) -> bool: method format_bin (line 83) | def format_bin(self, bitarray: int) -> str: method bitstring (line 88) | def bitstring(self) -> str: method hash_ (line 91) | def hash_(self, value: str) -> int: method format_hash (line 100) | def format_hash(self, value: str) -> str: method estimated_error_rate (line 104) | def estimated_error_rate(self) -> float: FILE: data_structures/hashing/double_hash.py class DoubleHash (line 19) | class DoubleHash(HashTable): method __init__ (line 24) | def __init__(self, *args, **kwargs): method __hash_function_2 (line 27) | def __hash_function_2(self, value, data): method __hash_double_function (line 35) | def __hash_double_function(self, key, data, increment): method _collision_resolution (line 38) | def _collision_resolution(self, key, data=None): FILE: data_structures/hashing/hash_map.py class _Item (line 20) | class _Item[KEY, VAL]: class _DeletedItem (line 25) | class _DeletedItem(_Item): method __init__ (line 26) | def __init__(self) -> None: method __bool__ (line 29) | def __bool__(self) -> bool: class HashMap (line 36) | class HashMap(MutableMapping[KEY, VAL]): method __init__ (line 41) | def __init__( method _get_bucket_index (line 50) | def _get_bucket_index(self, key: KEY) -> int: method _get_next_ind (line 53) | def _get_next_ind(self, ind: int) -> int: method _try_set (line 69) | def _try_set(self, ind: int, key: KEY, val: VAL) -> bool: method _is_full (line 90) | def _is_full(self) -> bool: method _is_sparse (line 107) | def _is_sparse(self) -> bool: method _resize (line 114) | def _resize(self, new_size: int) -> None: method _size_up (line 122) | def _size_up(self) -> None: method _size_down (line 125) | def _size_down(self) -> None: method _iterate_buckets (line 128) | def _iterate_buckets(self, key: KEY) -> Iterator[int]: method _add_item (line 134) | def _add_item(self, key: KEY, val: VAL) -> None: method __setitem__ (line 177) | def __setitem__(self, key: KEY, val: VAL) -> None: method __delitem__ (line 206) | def __delitem__(self, key: KEY) -> None: method __getitem__ (line 267) | def __getitem__(self, key: KEY) -> VAL: method __len__ (line 297) | def __len__(self) -> int: method __iter__ (line 314) | def __iter__(self) -> Iterator[KEY]: method __repr__ (line 317) | def __repr__(self) -> str: FILE: data_structures/hashing/hash_table.py class HashTable (line 7) | class HashTable: method __init__ (line 12) | def __init__( method keys (line 25) | def keys(self): method balanced_factor (line 51) | def balanced_factor(self): method hash_function (line 56) | def hash_function(self, key): method _step_by_step (line 83) | def _step_by_step(self, step_ord): method bulk_insert (line 88) | def bulk_insert(self, values): method _set_value (line 133) | def _set_value(self, key, data): method _collision_resolution (line 179) | def _collision_resolution(self, key, data=None): method rehashing (line 239) | def rehashing(self): method insert_data (line 247) | def insert_data(self, data): FILE: data_structures/hashing/hash_table_with_linked_list.py class HashTableWithLinkedList (line 6) | class HashTableWithLinkedList(HashTable): method __init__ (line 7) | def __init__(self, *args, **kwargs): method _set_value (line 10) | def _set_value(self, key, data): method balanced_factor (line 15) | def balanced_factor(self): method _collision_resolution (line 22) | def _collision_resolution(self, key, data=None): FILE: data_structures/hashing/number_theory/prime_numbers.py function is_prime (line 9) | def is_prime(number: int) -> bool: function next_prime (line 50) | def next_prime(value, factor=1, **kwargs): FILE: data_structures/hashing/quadratic_probing.py class QuadraticProbing (line 6) | class QuadraticProbing(HashTable): method __init__ (line 11) | def __init__(self, *args, **kwargs): method _collision_resolution (line 14) | def _collision_resolution(self, key, data=None): # noqa: ARG002 FILE: data_structures/hashing/tests/test_hash_map.py function _get (line 8) | def _get(k): function _set (line 12) | def _set(k, v): function _del (line 16) | def _del(k): function _run_operation (line 20) | def _run_operation(obj, fun, *args): function test_hash_map_is_the_same_as_dict (line 77) | def test_hash_map_is_the_same_as_dict(operations): function test_no_new_methods_was_added_to_api (line 90) | def test_no_new_methods_was_added_to_api(): FILE: data_structures/heap/binomial_heap.py class Node (line 7) | class Node: method __init__ (line 15) | def __init__(self, val): method merge_trees (line 23) | def merge_trees(self, other): class BinomialHeap (line 48) | class BinomialHeap: method __init__ (line 126) | def __init__(self, bottom_root=None, min_node=None, heap_size=0): method merge_heaps (line 131) | def merge_heaps(self, other): method insert (line 206) | def insert(self, val): method peek (line 247) | def peek(self): method is_empty (line 253) | def is_empty(self): method delete_min (line 256) | def delete_min(self): method pre_order (line 359) | def pre_order(self): method __traversal (line 374) | def __traversal(self, curr_node, preorder, level=0): method __str__ (line 385) | def __str__(self): FILE: data_structures/heap/heap.py class Comparable (line 8) | class Comparable(Protocol): method __lt__ (line 10) | def __lt__(self: T, other: T) -> bool: method __gt__ (line 14) | def __gt__(self: T, other: T) -> bool: method __eq__ (line 18) | def __eq__(self: T, other: object) -> bool: class Heap (line 25) | class Heap[T: Comparable]: method __init__ (line 48) | def __init__(self) -> None: method __repr__ (line 52) | def __repr__(self) -> str: method parent_index (line 55) | def parent_index(self, child_idx: int) -> int | None: method left_child_idx (line 91) | def left_child_idx(self, parent_idx: int) -> int | None: method right_child_idx (line 101) | def right_child_idx(self, parent_idx: int) -> int | None: method max_heapify (line 111) | def max_heapify(self, index: int) -> None: method build_max_heap (line 134) | def build_max_heap(self, collection: Iterable[T]) -> None: method extract_max (line 165) | def extract_max(self) -> T: method insert (line 196) | def insert(self, value: T) -> None: method heap_sort (line 232) | def heap_sort(self) -> None: FILE: data_structures/heap/heap_generic.py class Heap (line 4) | class Heap: method __init__ (line 10) | def __init__(self, key: Callable | None = None) -> None: method _parent (line 21) | def _parent(self, i: int) -> int | None: method _left (line 25) | def _left(self, i: int) -> int | None: method _right (line 30) | def _right(self, i: int) -> int | None: method _swap (line 35) | def _swap(self, i: int, j: int) -> None: method _cmp (line 45) | def _cmp(self, i: int, j: int) -> bool: method _get_valid_parent (line 49) | def _get_valid_parent(self, i: int) -> int: method _heapify_up (line 65) | def _heapify_up(self, index: int) -> None: method _heapify_down (line 72) | def _heapify_down(self, index: int) -> None: method update_item (line 79) | def update_item(self, item: int, item_value: int) -> None: method delete_item (line 90) | def delete_item(self, item: int) -> None: method insert_item (line 105) | def insert_item(self, item: int, item_value: int) -> None: method get_top (line 116) | def get_top(self) -> tuple | None: method extract_top (line 120) | def extract_top(self) -> tuple | None: function test_heap (line 131) | def test_heap() -> None: FILE: data_structures/heap/max_heap.py class BinaryHeap (line 1) | class BinaryHeap: method __init__ (line 19) | def __init__(self): method __swap_up (line 23) | def __swap_up(self, i: int) -> None: method insert (line 32) | def insert(self, value: int) -> None: method __swap_down (line 38) | def __swap_down(self, i: int) -> None: method pop (line 53) | def pop(self) -> int: method get_list (line 63) | def get_list(self): method __len__ (line 66) | def __len__(self): FILE: data_structures/heap/min_heap.py class Node (line 5) | class Node: method __init__ (line 6) | def __init__(self, name, val): method __str__ (line 10) | def __str__(self): method __lt__ (line 13) | def __lt__(self, other): class MinHeap (line 17) | class MinHeap: method __init__ (line 34) | def __init__(self, array): method __getitem__ (line 39) | def __getitem__(self, key): method get_parent_idx (line 42) | def get_parent_idx(self, idx): method get_left_child_idx (line 45) | def get_left_child_idx(self, idx): method get_right_child_idx (line 48) | def get_right_child_idx(self, idx): method get_value (line 51) | def get_value(self, key): method build_heap (line 54) | def build_heap(self, array): method sift_down (line 67) | def sift_down(self, idx, array): method sift_up (line 91) | def sift_up(self, idx): method peek (line 102) | def peek(self): method remove (line 105) | def remove(self): method insert (line 117) | def insert(self, node): method is_empty (line 123) | def is_empty(self): method decrease_key (line 126) | def decrease_key(self, node, new_value): FILE: data_structures/heap/randomized_heap.py class RandomizedHeapNode (line 12) | class RandomizedHeapNode[T: bool]: method __init__ (line 18) | def __init__(self, value: T) -> None: method value (line 24) | def value(self) -> T: method merge (line 38) | def merge( class RandomizedHeap (line 76) | class RandomizedHeap[T: bool]: method __init__ (line 99) | def __init__(self, data: Iterable[T] | None = ()) -> None: method insert (line 111) | def insert(self, value: T) -> None: method pop (line 125) | def pop(self) -> T | None: method top (line 153) | def top(self) -> T: method clear (line 175) | def clear(self) -> None: method to_sorted_list (line 188) | def to_sorted_list(self) -> list[Any]: method __bool__ (line 202) | def __bool__(self) -> bool: FILE: data_structures/heap/skew_heap.py class SkewNode (line 11) | class SkewNode[T: bool]: method __init__ (line 17) | def __init__(self, value: T) -> None: method value (line 23) | def value(self) -> T: method merge (line 59) | def merge( class SkewHeap (line 90) | class SkewHeap[T: bool]: method __init__ (line 114) | def __init__(self, data: Iterable[T] | None = ()) -> None: method __bool__ (line 125) | def __bool__(self) -> bool: method __iter__ (line 141) | def __iter__(self) -> Iterator[T]: method insert (line 159) | def insert(self, value: T) -> None: method pop (line 173) | def pop(self) -> T | None: method top (line 198) | def top(self) -> T: method clear (line 220) | def clear(self) -> None: FILE: data_structures/kd_tree/build_kdtree.py function build_kdtree (line 12) | def build_kdtree(points: list[list[float]], depth: int = 0) -> KDNode | ... FILE: data_structures/kd_tree/example/example_usage.py function main (line 16) | def main() -> None: FILE: data_structures/kd_tree/example/hypercube_points.py function hypercube_points (line 12) | def hypercube_points( FILE: data_structures/kd_tree/kd_node.py class KDNode (line 12) | class KDNode: method __init__ (line 22) | def __init__( FILE: data_structures/kd_tree/nearest_neighbour_search.py function nearest_neighbour_search (line 12) | def nearest_neighbour_search( FILE: data_structures/kd_tree/tests/test_kdtree.py function test_build_kdtree (line 26) | def test_build_kdtree(num_points, cube_size, num_dimensions, depth, expe... function test_nearest_neighbour_search (line 61) | def test_nearest_neighbour_search(): function test_edge_cases (line 88) | def test_edge_cases(): FILE: data_structures/linked_list/__init__.py class Node (line 14) | class Node: method __init__ (line 15) | def __init__(self, item: Any, next: Any) -> None: # noqa: A002 class LinkedList (line 20) | class LinkedList: method __init__ (line 21) | def __init__(self) -> None: method add (line 25) | def add(self, item: Any, position: int = 0) -> None: method remove (line 77) | def remove(self) -> Any: method is_empty (line 89) | def is_empty(self) -> bool: method __str__ (line 92) | def __str__(self) -> str: method __len__ (line 115) | def __len__(self) -> int: FILE: data_structures/linked_list/circular_linked_list.py class Node (line 9) | class Node: class CircularLinkedList (line 15) | class CircularLinkedList: method __iter__ (line 19) | def __iter__(self) -> Iterator[Any]: method __len__ (line 32) | def __len__(self) -> int: method __repr__ (line 38) | def __repr__(self) -> str: method insert_tail (line 46) | def insert_tail(self, data: Any) -> None: method insert_head (line 52) | def insert_head(self, data: Any) -> None: method insert_nth (line 58) | def insert_nth(self, index: int, data: Any) -> None: method delete_front (line 89) | def delete_front(self) -> Any: method delete_tail (line 97) | def delete_tail(self) -> Any: method delete_nth (line 107) | def delete_nth(self, index: int = 0) -> Any: method is_empty (line 142) | def is_empty(self) -> bool: function test_circular_linked_list (line 151) | def test_circular_linked_list() -> None: FILE: data_structures/linked_list/deque_doubly.py class _DoublyLinkedBase (line 11) | class _DoublyLinkedBase: class _Node (line 14) | class _Node: method __init__ (line 17) | def __init__(self, link_p, element, link_n): method has_next_and_prev (line 22) | def has_next_and_prev(self): method __init__ (line 27) | def __init__(self): method __len__ (line 34) | def __len__(self): method is_empty (line 37) | def is_empty(self): method _insert (line 40) | def _insert(self, predecessor, e, successor): method _delete (line 49) | def _delete(self, node): class LinkedDeque (line 62) | class LinkedDeque(_DoublyLinkedBase): method first (line 63) | def first(self): method last (line 75) | def last(self): method add_first (line 89) | def add_first(self, element): method add_last (line 96) | def add_last(self, element): method remove_first (line 105) | def remove_first(self): method remove_last (line 125) | def remove_last(self): FILE: data_structures/linked_list/doubly_linked_list.py class Node (line 6) | class Node: method __init__ (line 7) | def __init__(self, data): method __str__ (line 12) | def __str__(self): class DoublyLinkedList (line 16) | class DoublyLinkedList: method __init__ (line 17) | def __init__(self): method __iter__ (line 21) | def __iter__(self): method __str__ (line 35) | def __str__(self): method __len__ (line 46) | def __len__(self): method insert_at_head (line 56) | def insert_at_head(self, data): method insert_at_tail (line 59) | def insert_at_tail(self, data): method insert_at_nth (line 62) | def insert_at_nth(self, index: int, data): method delete_head (line 108) | def delete_head(self): method delete_tail (line 111) | def delete_tail(self): method delete_at_nth (line 114) | def delete_at_nth(self, index: int): method delete (line 159) | def delete(self, data) -> str: method is_empty (line 179) | def is_empty(self): function test_doubly_linked_list (line 191) | def test_doubly_linked_list() -> None: FILE: data_structures/linked_list/doubly_linked_list_two.py class Node (line 19) | class Node[DataType]: method __str__ (line 24) | def __str__(self) -> str: class LinkedListIterator (line 28) | class LinkedListIterator: method __init__ (line 29) | def __init__(self, head): method __iter__ (line 32) | def __iter__(self): method __next__ (line 35) | def __next__(self): class LinkedList (line 45) | class LinkedList: method __str__ (line 49) | def __str__(self): method __contains__ (line 57) | def __contains__(self, value: DataType): method __iter__ (line 65) | def __iter__(self): method get_head_data (line 68) | def get_head_data(self): method get_tail_data (line 73) | def get_tail_data(self): method set_head (line 78) | def set_head(self, node: Node) -> None: method set_tail (line 85) | def set_tail(self, node: Node) -> None: method insert (line 92) | def insert(self, value: DataType) -> None: method insert_before_node (line 99) | def insert_before_node(self, node: Node, node_to_insert: Node) -> None: method insert_after_node (line 110) | def insert_after_node(self, node: Node, node_to_insert: Node) -> None: method insert_at_position (line 121) | def insert_at_position(self, position: int, value: DataType) -> None: method get_node (line 133) | def get_node(self, item: DataType) -> Node: method delete_value (line 141) | def delete_value(self, value): method remove_node_pointers (line 152) | def remove_node_pointers(node: Node) -> None: method is_empty (line 162) | def is_empty(self): function create_linked_list (line 166) | def create_linked_list() -> None: FILE: data_structures/linked_list/floyds_cycle_detection.py class Node (line 19) | class Node: class LinkedList (line 29) | class LinkedList: method __iter__ (line 36) | def __iter__(self) -> Iterator: method add_node (line 61) | def add_node(self, data: Any) -> None: method detect_cycle (line 89) | def detect_cycle(self) -> bool: FILE: data_structures/linked_list/from_sequence.py class Node (line 7) | class Node: method __init__ (line 8) | def __init__(self, data=None): method __repr__ (line 12) | def __repr__(self): function make_linked_list (line 23) | def make_linked_list(elements_list: list | tuple) -> Node: FILE: data_structures/linked_list/has_loop.py class ContainsLoopError (line 6) | class ContainsLoopError(Exception): class Node (line 10) | class Node: method __init__ (line 11) | def __init__(self, data: Any) -> None: method __iter__ (line 15) | def __iter__(self): method has_loop (line 26) | def has_loop(self) -> bool: FILE: data_structures/linked_list/is_palindrome.py class ListNode (line 7) | class ListNode: function is_palindrome (line 12) | def is_palindrome(head: ListNode | None) -> bool: function is_palindrome_stack (line 68) | def is_palindrome_stack(head: ListNode | None) -> bool: function is_palindrome_dict (line 124) | def is_palindrome_dict(head: ListNode | None) -> bool: FILE: data_structures/linked_list/merge_two_lists.py class Node (line 15) | class Node: class SortedLinkedList (line 20) | class SortedLinkedList: method __init__ (line 21) | def __init__(self, ints: Iterable[int]) -> None: method __iter__ (line 26) | def __iter__(self) -> Iterator[int]: method __len__ (line 38) | def __len__(self) -> int: method __str__ (line 50) | def __str__(self) -> str: function merge_lists (line 62) | def merge_lists( FILE: data_structures/linked_list/middle_element_of_linked_list.py class Node (line 4) | class Node: method __init__ (line 5) | def __init__(self, data: int) -> None: class LinkedList (line 10) | class LinkedList: method __init__ (line 11) | def __init__(self): method push (line 14) | def push(self, new_data: int) -> int: method middle_element (line 20) | def middle_element(self) -> int | None: FILE: data_structures/linked_list/print_reverse.py class Node (line 8) | class Node: class LinkedList (line 13) | class LinkedList: method __init__ (line 18) | def __init__(self) -> None: method __iter__ (line 27) | def __iter__(self) -> Iterator[int]: method __repr__ (line 40) | def __repr__(self) -> str: method append (line 54) | def append(self, data: int) -> None: method extend (line 71) | def extend(self, items: Iterable[int]) -> None: function make_linked_list (line 88) | def make_linked_list(elements_list: Iterable[int]) -> LinkedList: function in_reverse (line 110) | def in_reverse(linked_list: LinkedList) -> str: FILE: data_structures/linked_list/reverse_k_group.py class Node (line 8) | class Node: class LinkedList (line 13) | class LinkedList: method __init__ (line 14) | def __init__(self, ints: Iterable[int]) -> None: method __iter__ (line 19) | def __iter__(self) -> Iterator[int]: method __len__ (line 33) | def __len__(self) -> int: method __str__ (line 45) | def __str__(self) -> str: method append (line 54) | def append(self, data: int) -> None: method reverse_k_nodes (line 76) | def reverse_k_nodes(self, group_size: int) -> None: FILE: data_structures/linked_list/rotate_to_the_right.py class Node (line 7) | class Node: function print_linked_list (line 12) | def print_linked_list(head: Node | None) -> None: function insert_node (line 40) | def insert_node(head: Node | None, data: int) -> Node: function rotate_to_the_right (line 70) | def rotate_to_the_right(head: Node, places: int) -> Node: FILE: data_structures/linked_list/singly_linked_list.py class Node (line 9) | class Node: method __repr__ (line 25) | def __repr__(self) -> str: class LinkedList (line 40) | class LinkedList: method __init__ (line 41) | def __init__(self): method __iter__ (line 50) | def __iter__(self) -> Iterator[Any]: method __len__ (line 69) | def __len__(self) -> int: method __repr__ (line 90) | def __repr__(self) -> str: method __getitem__ (line 108) | def __getitem__(self, index: int) -> Any: method __setitem__ (line 133) | def __setitem__(self, index: int, data: Any) -> None: method insert_tail (line 160) | def insert_tail(self, data: Any) -> None: method insert_head (line 176) | def insert_head(self, data: Any) -> None: method insert_nth (line 192) | def insert_nth(self, index: int, data: Any) -> None: method print_list (line 223) | def print_list(self) -> None: # print every node data method delete_head (line 235) | def delete_head(self) -> Any: method delete_tail (line 262) | def delete_tail(self) -> Any: # delete from tail method delete_nth (line 289) | def delete_nth(self, index: int = 0) -> Any: method is_empty (line 325) | def is_empty(self) -> bool: method reverse (line 337) | def reverse(self) -> None: function test_singly_linked_list (line 366) | def test_singly_linked_list() -> None: function test_singly_linked_list_2 (line 411) | def test_singly_linked_list_2() -> None: function main (line 494) | def main(): FILE: data_structures/linked_list/skip_list.py class Node (line 16) | class Node[KT, VT]: method __init__ (line 17) | def __init__(self, key: KT | str = "root", value: VT | None = None): method __repr__ (line 22) | def __repr__(self) -> str: method level (line 34) | def level(self) -> int: class SkipList (line 52) | class SkipList[KT, VT]: method __init__ (line 53) | def __init__(self, p: float = 0.5, max_level: int = 16): method __str__ (line 59) | def __str__(self) -> str: method __iter__ (line 109) | def __iter__(self): method random_level (line 116) | def random_level(self) -> int: method _locate_node (line 128) | def _locate_node(self, key) -> tuple[Node[KT, VT] | None, list[Node[KT... method delete (line 163) | def delete(self, key: KT): method insert (line 189) | def insert(self, key: KT, value: VT): method find (line 226) | def find(self, key: VT) -> VT | None: function test_insert (line 249) | def test_insert(): function test_insert_overrides_existing_value (line 269) | def test_insert_overrides_existing_value(): function test_searching_empty_list_returns_none (line 297) | def test_searching_empty_list_returns_none(): function test_search (line 302) | def test_search(): function test_deleting_item_from_empty_list_do_nothing (line 318) | def test_deleting_item_from_empty_list_do_nothing(): function test_deleted_items_are_not_founded_by_find_method (line 325) | def test_deleted_items_are_not_founded_by_find_method(): function test_delete_removes_only_given_key (line 340) | def test_delete_removes_only_given_key(): function test_delete_doesnt_leave_dead_nodes (line 373) | def test_delete_doesnt_leave_dead_nodes(): function test_iter_always_yields_sorted_values (line 391) | def test_iter_always_yields_sorted_values(): function pytests (line 408) | def pytests(): function main (line 426) | def main(): FILE: data_structures/linked_list/swap_nodes.py class Node (line 9) | class Node: class LinkedList (line 15) | class LinkedList: method __iter__ (line 18) | def __iter__(self) -> Iterator: method __len__ (line 32) | def __len__(self) -> int: method push (line 43) | def push(self, new_data: Any) -> None: method swap_nodes (line 67) | def swap_nodes(self, node_data_1: Any, node_data_2: Any) -> None: FILE: data_structures/queues/circular_queue.py class CircularQueue (line 4) | class CircularQueue: method __init__ (line 7) | def __init__(self, n: int): method __len__ (line 14) | def __len__(self) -> int: method is_empty (line 28) | def is_empty(self) -> bool: method first (line 39) | def first(self): method enqueue (line 50) | def enqueue(self, data): method dequeue (line 81) | def dequeue(self): FILE: data_structures/queues/circular_queue_linked_list.py class CircularQueueLinkedList (line 9) | class CircularQueueLinkedList: method __init__ (line 22) | def __init__(self, initial_capacity: int = 6) -> None: method create_linked_list (line 27) | def create_linked_list(self, initial_capacity: int) -> None: method is_empty (line 40) | def is_empty(self) -> bool: method first (line 61) | def first(self) -> Any | None: method enqueue (line 86) | def enqueue(self, data: Any) -> None: method dequeue (line 111) | def dequeue(self) -> Any: method check_can_perform_operation (line 142) | def check_can_perform_operation(self) -> None: method check_is_full (line 146) | def check_is_full(self) -> None: class Node (line 151) | class Node: method __init__ (line 152) | def __init__(self) -> None: FILE: data_structures/queues/double_ended_queue.py class Deque (line 12) | class Deque: class _Node (line 39) | class _Node: class _Iterator (line 49) | class _Iterator: method __init__ (line 60) | def __init__(self, cur: Deque._Node | None) -> None: method __iter__ (line 63) | def __iter__(self) -> Deque._Iterator: method __next__ (line 70) | def __next__(self) -> Any: method __init__ (line 89) | def __init__(self, iterable: Iterable[Any] | None = None) -> None: method append (line 99) | def append(self, val: Any) -> None: method appendleft (line 141) | def appendleft(self, val: Any) -> None: method extend (line 183) | def extend(self, iterable: Iterable[Any]) -> None: method extendleft (line 212) | def extendleft(self, iterable: Iterable[Any]) -> None: method pop (line 241) | def pop(self) -> Any: method popleft (line 290) | def popleft(self) -> Any: method is_empty (line 336) | def is_empty(self) -> bool: method __len__ (line 353) | def __len__(self) -> int: method __eq__ (line 375) | def __eq__(self, other: object) -> bool: method __iter__ (line 419) | def __iter__(self) -> Deque._Iterator: method __repr__ (line 439) | def __repr__(self) -> str: FILE: data_structures/queues/linked_queue.py class Node (line 9) | class Node: method __init__ (line 10) | def __init__(self, data: Any) -> None: method __str__ (line 14) | def __str__(self) -> str: class LinkedQueue (line 18) | class LinkedQueue: method __init__ (line 45) | def __init__(self) -> None: method __iter__ (line 49) | def __iter__(self) -> Iterator[Any]: method __len__ (line 55) | def __len__(self) -> int: method __str__ (line 70) | def __str__(self) -> str: method is_empty (line 83) | def is_empty(self) -> bool: method put (line 95) | def put(self, item: Any) -> None: method get (line 115) | def get(self) -> Any: method clear (line 139) | def clear(self) -> None: FILE: data_structures/queues/priority_queue_using_list.py class OverFlowError (line 7) | class OverFlowError(Exception): class UnderFlowError (line 11) | class UnderFlowError(Exception): class FixedPriorityQueue (line 15) | class FixedPriorityQueue: method __init__ (line 69) | def __init__(self): method enqueue (line 76) | def enqueue(self, priority: int, data: int) -> None: method dequeue (line 89) | def dequeue(self) -> int: method __str__ (line 99) | def __str__(self) -> str: class ElementPriorityQueue (line 103) | class ElementPriorityQueue: method __init__ (line 149) | def __init__(self): method enqueue (line 152) | def enqueue(self, data: int) -> None: method dequeue (line 161) | def dequeue(self) -> int: method __str__ (line 173) | def __str__(self) -> str: function fixed_priority_queue (line 180) | def fixed_priority_queue(): function element_priority_queue (line 205) | def element_priority_queue(): FILE: data_structures/queues/queue_by_list.py class QueueByList (line 6) | class QueueByList[T]: method __init__ (line 7) | def __init__(self, iterable: Iterable[T] | None = None) -> None: method __len__ (line 18) | def __len__(self) -> int: method __repr__ (line 40) | def __repr__(self) -> str: method put (line 58) | def put(self, item: T) -> None: method get (line 72) | def get(self) -> T: method rotate (line 98) | def rotate(self, rotation: int) -> None: method get_front (line 118) | def get_front(self) -> T: FILE: data_structures/queues/queue_by_two_stacks.py class QueueByTwoStacks (line 6) | class QueueByTwoStacks[T]: method __init__ (line 7) | def __init__(self, iterable: Iterable[T] | None = None) -> None: method __len__ (line 19) | def __len__(self) -> int: method __repr__ (line 42) | def __repr__(self) -> str: method put (line 59) | def put(self, item: T) -> None: method get (line 74) | def get(self) -> T: FILE: data_structures/queues/queue_on_pseudo_stack.py class Queue (line 6) | class Queue: method __init__ (line 7) | def __init__(self): method __str__ (line 11) | def __str__(self): method put (line 19) | def put(self, item: Any) -> None: method get (line 28) | def get(self) -> Any: method rotate (line 40) | def rotate(self, rotation: int) -> None: method front (line 50) | def front(self) -> Any: method size (line 58) | def size(self) -> int: FILE: data_structures/stacks/balanced_parentheses.py function balanced_parentheses (line 4) | def balanced_parentheses(parentheses: str) -> bool: FILE: data_structures/stacks/dijkstras_two_stack_algorithm.py function dijkstras_two_stack_algorithm (line 40) | def dijkstras_two_stack_algorithm(equation: str) -> int: FILE: data_structures/stacks/infix_to_postfix_conversion.py function precedence (line 28) | def precedence(char: str) -> int: function associativity (line 37) | def associativity(char: str) -> Literal["LR", "RL"]: function infix_to_postfix (line 45) | def infix_to_postfix(expression_str: str) -> str: FILE: data_structures/stacks/infix_to_prefix_conversion.py function infix_2_postfix (line 18) | def infix_2_postfix(infix: str) -> str: function infix_2_prefix (line 127) | def infix_2_prefix(infix: str) -> str: FILE: data_structures/stacks/largest_rectangle_histogram.py function largest_rectangle_area (line 1) | def largest_rectangle_area(heights: list[int]) -> int: FILE: data_structures/stacks/lexicographical_numbers.py function lexical_order (line 4) | def lexical_order(max_number: int) -> Iterator[int]: FILE: data_structures/stacks/next_greater_element.py function next_greatest_element_slow (line 7) | def next_greatest_element_slow(arr: list[float]) -> list[float]: function next_greatest_element_fast (line 40) | def next_greatest_element_fast(arr: list[float]) -> list[float]: function next_greatest_element (line 71) | def next_greatest_element(arr: list[float]) -> list[float]: FILE: data_structures/stacks/postfix_evaluation.py function parse_token (line 40) | def parse_token(token: str | float) -> float | str: function evaluate (line 64) | def evaluate(post_fix: list[str], verbose: bool = False) -> float: FILE: data_structures/stacks/prefix_evaluation.py function is_operand (line 14) | def is_operand(c): function evaluate (line 26) | def evaluate(expression): function evaluate_recursive (line 58) | def evaluate_recursive(expression: list[str]): FILE: data_structures/stacks/stack.py class StackOverflowError (line 8) | class StackOverflowError(BaseException): class StackUnderflowError (line 12) | class StackUnderflowError(BaseException): class Stack (line 16) | class Stack[T]: method __init__ (line 25) | def __init__(self, limit: int = 10): method __bool__ (line 29) | def __bool__(self) -> bool: method __str__ (line 32) | def __str__(self) -> str: method push (line 35) | def push(self, data: T) -> None: method pop (line 57) | def pop(self) -> T: method peek (line 76) | def peek(self) -> T: method is_empty (line 95) | def is_empty(self) -> bool: method is_full (line 110) | def is_full(self) -> bool: method size (line 123) | def size(self) -> int: method __contains__ (line 144) | def __contains__(self, item: T) -> bool: function test_stack (line 161) | def test_stack() -> None: FILE: data_structures/stacks/stack_using_two_queues.py class StackWithQueues (line 8) | class StackWithQueues: method push (line 37) | def push(self, item: int) -> None: method pop (line 43) | def pop(self) -> int: method peek (line 46) | def peek(self) -> int | None: FILE: data_structures/stacks/stack_with_doubly_linked_list.py class Node (line 11) | class Node[T]: method __init__ (line 12) | def __init__(self, data: T): class Stack (line 18) | class Stack[T]: method __init__ (line 44) | def __init__(self) -> None: method push (line 47) | def push(self, data: T) -> None: method pop (line 58) | def pop(self) -> T | None: method top (line 70) | def top(self) -> T | None: method __len__ (line 74) | def __len__(self) -> int: method is_empty (line 82) | def is_empty(self) -> bool: method print_stack (line 85) | def print_stack(self) -> None: FILE: data_structures/stacks/stack_with_singly_linked_list.py class Node (line 11) | class Node[T]: method __init__ (line 12) | def __init__(self, data: T): method __str__ (line 16) | def __str__(self) -> str: class LinkedStack (line 20) | class LinkedStack[T]: method __init__ (line 50) | def __init__(self) -> None: method __iter__ (line 53) | def __iter__(self) -> Iterator[T]: method __str__ (line 59) | def __str__(self) -> str: method __len__ (line 70) | def __len__(self) -> int: method is_empty (line 83) | def is_empty(self) -> bool: method push (line 94) | def push(self, item: T) -> None: method pop (line 108) | def pop(self) -> T: method peek (line 132) | def peek(self) -> T: method clear (line 147) | def clear(self) -> None: FILE: data_structures/stacks/stock_span_problem.py function calculate_span (line 11) | def calculate_span(price: list[int]) -> list[int]: function print_array (line 61) | def print_array(arr, n): FILE: data_structures/suffix_tree/example/example_usage.py function main (line 12) | def main() -> None: FILE: data_structures/suffix_tree/suffix_tree.py class SuffixTree (line 12) | class SuffixTree: method __init__ (line 13) | def __init__(self, text: str) -> None: method build_suffix_tree (line 24) | def build_suffix_tree(self) -> None: method _add_suffix (line 34) | def _add_suffix(self, suffix: str, index: int) -> None: method search (line 51) | def search(self, pattern: str) -> bool: FILE: data_structures/suffix_tree/suffix_tree_node.py class SuffixTreeNode (line 12) | class SuffixTreeNode: method __init__ (line 13) | def __init__( FILE: data_structures/suffix_tree/tests/test_suffix_tree.py class TestSuffixTree (line 14) | class TestSuffixTree(unittest.TestCase): method setUp (line 15) | def setUp(self) -> None: method test_search_existing_patterns (line 20) | def test_search_existing_patterns(self) -> None: method test_search_non_existing_patterns (line 29) | def test_search_non_existing_patterns(self) -> None: method test_search_empty_pattern (line 38) | def test_search_empty_pattern(self) -> None: method test_search_full_text (line 42) | def test_search_full_text(self) -> None: method test_search_substrings (line 48) | def test_search_substrings(self) -> None: FILE: data_structures/trie/radix_tree.py class RadixNode (line 8) | class RadixNode: method __init__ (line 9) | def __init__(self, prefix: str = "", is_leaf: bool = False) -> None: method match (line 18) | def match(self, word: str) -> tuple[str, str, str]: method insert_many (line 39) | def insert_many(self, words: list[str]) -> None: method insert (line 50) | def insert(self, word: str) -> None: method find (line 102) | def find(self, word: str) -> bool: method delete (line 131) | def delete(self, word: str) -> bool: method print_tree (line 181) | def print_tree(self, height: int = 0) -> None: function test_trie (line 194) | def test_trie() -> bool: function pytests (line 211) | def pytests() -> None: function main (line 215) | def main() -> None: FILE: data_structures/trie/trie.py class TrieNode (line 9) | class TrieNode: method __init__ (line 10) | def __init__(self) -> None: method insert_many (line 14) | def insert_many(self, words: list[str]) -> None: method insert (line 23) | def insert(self, word: str) -> None: method find (line 36) | def find(self, word: str) -> bool: method delete (line 49) | def delete(self, word: str) -> None: function print_words (line 78) | def print_words(node: TrieNode, word: str) -> None: function test_trie (line 92) | def test_trie() -> bool: function print_results (line 111) | def print_results(msg: str, passes: bool) -> None: function pytests (line 115) | def pytests() -> None: function main (line 119) | def main() -> None: FILE: digital_image_processing/change_brightness.py function change_brightness (line 4) | def change_brightness(img: Image, level: float) -> Image: FILE: digital_image_processing/change_contrast.py function change_contrast (line 14) | def change_contrast(img: Image, level: int) -> Image: FILE: digital_image_processing/convert_to_negative.py function convert_to_negative (line 8) | def convert_to_negative(img): FILE: digital_image_processing/dithering/burkes.py class Burkes (line 9) | class Burkes: method __init__ (line 19) | def __init__(self, input_img, threshold: int): method get_greyscale (line 40) | def get_greyscale(cls, blue: int, green: int, red: int) -> float: method process (line 56) | def process(self) -> None: FILE: digital_image_processing/edge_detection/canny.py function gen_gaussian_kernel (line 10) | def gen_gaussian_kernel(k_size, sigma): function suppress_non_maximum (line 21) | def suppress_non_maximum(image_shape, gradient_direction, sobel_grad): function detect_high_low_threshold (line 73) | def detect_high_low_threshold( function track_edge (line 94) | def track_edge(image_shape, destination, weak, strong): function canny (line 119) | def canny(image, threshold_low=15, threshold_high=30, weak=128, strong=2... FILE: digital_image_processing/filters/bilateral_filter.py function vec_gaussian (line 20) | def vec_gaussian(img: np.ndarray, variance: float) -> np.ndarray: function get_slice (line 27) | def get_slice(img: np.ndarray, x: int, y: int, kernel_size: int) -> np.n... function get_gauss_kernel (line 32) | def get_gauss_kernel(kernel_size: int, spatial_variance: float) -> np.nd... function bilateral_filter (line 43) | def bilateral_filter( function parse_args (line 64) | def parse_args(args: list) -> tuple: FILE: digital_image_processing/filters/convolve.py function im2col (line 8) | def im2col(image, block_size): function img_convolve (line 23) | def img_convolve(image, filter_kernel): FILE: digital_image_processing/filters/gabor_filter.py function gabor_filter_kernel (line 7) | def gabor_filter_kernel( FILE: digital_image_processing/filters/gaussian_filter.py function gen_gaussian_kernel (line 11) | def gen_gaussian_kernel(k_size, sigma): function gaussian_filter (line 18) | def gaussian_filter(image, k_size, sigma): FILE: digital_image_processing/filters/laplacian_filter.py function my_laplacian (line 20) | def my_laplacian(src: np.ndarray, ksize: int) -> np.ndarray: FILE: digital_image_processing/filters/local_binary_pattern.py function get_neighbors_pixel (line 5) | def get_neighbors_pixel( function local_binary_value (line 26) | def local_binary_value(image: np.ndarray, x_coordinate: int, y_coordinat... FILE: digital_image_processing/filters/median_filter.py function median_filter (line 9) | def median_filter(gray_img, mask=3): FILE: digital_image_processing/filters/sobel_filter.py function sobel_filter (line 10) | def sobel_filter(image): FILE: digital_image_processing/histogram_equalization/histogram_stretch.py class ConstantStretch (line 15) | class ConstantStretch: method __init__ (line 16) | def __init__(self): method stretch (line 27) | def stretch(self, input_image): method plot_histogram (line 49) | def plot_histogram(self): method show_image (line 52) | def show_image(self): FILE: digital_image_processing/index_calculation.py class IndexCalculation (line 11) | class IndexCalculation: method __init__ (line 107) | def __init__(self, red=None, green=None, blue=None, red_edge=None, nir... method set_matricies (line 110) | def set_matricies(self, red=None, green=None, blue=None, red_edge=None... method calculation (line 123) | def calculation( method arv12 (line 180) | def arv12(self): method ccci (line 189) | def ccci(self): method cvi (line 199) | def cvi(self): method gli (line 207) | def gli(self): method ndvi (line 217) | def ndvi(self): method bndvi (line 226) | def bndvi(self): method red_edge_ndvi (line 235) | def red_edge_ndvi(self): method gndvi (line 243) | def gndvi(self): method gbndvi (line 251) | def gbndvi(self): method grndvi (line 261) | def grndvi(self): method rbndvi (line 271) | def rbndvi(self): method pndvi (line 279) | def pndvi(self): method atsavi (line 289) | def atsavi(self, x=0.08, a=1.22, b=0.03): method bwdrvi (line 300) | def bwdrvi(self): method ci_green (line 308) | def ci_green(self): method ci_rededge (line 316) | def ci_rededge(self): method ci (line 324) | def ci(self): method ctvi (line 332) | def ctvi(self): method gdvi (line 341) | def gdvi(self): method evi (line 349) | def evi(self): method gemi (line 359) | def gemi(self): method gosavi (line 370) | def gosavi(self, y=0.16): method gsavi (line 379) | def gsavi(self, n=0.5): method hue (line 388) | def hue(self): method ivi (line 398) | def ivi(self, a=None, b=None): method ipvi (line 408) | def ipvi(self): method i (line 416) | def i(self): method rvi (line 424) | def rvi(self): method mrvi (line 432) | def mrvi(self): method m_savi (line 440) | def m_savi(self): method norm_g (line 451) | def norm_g(self): method norm_nir (line 459) | def norm_nir(self): method norm_r (line 467) | def norm_r(self): method ngrdi (line 475) | def ngrdi(self): method ri (line 485) | def ri(self): method s (line 493) | def s(self): method _if (line 503) | def _if(self): method dvi (line 511) | def dvi(self): method tvi (line 520) | def tvi(self): method ndre (line 528) | def ndre(self): FILE: digital_image_processing/morphological_operations/dilation_operation.py function rgb_to_gray (line 7) | def rgb_to_gray(rgb: np.ndarray) -> np.ndarray: function gray_to_binary (line 23) | def gray_to_binary(gray: np.ndarray) -> np.ndarray: function dilation (line 40) | def dilation(image: np.ndarray, kernel: np.ndarray) -> np.ndarray: FILE: digital_image_processing/morphological_operations/erosion_operation.py function rgb_to_gray (line 7) | def rgb_to_gray(rgb: np.ndarray) -> np.ndarray: function gray_to_binary (line 24) | def gray_to_binary(gray: np.ndarray) -> np.ndarray: function erosion (line 42) | def erosion(image: np.ndarray, kernel: np.ndarray) -> np.ndarray: FILE: digital_image_processing/resize/resize.py class NearestNeighbour (line 7) | class NearestNeighbour: method __init__ (line 13) | def __init__(self, img, dst_width: int, dst_height: int): method process (line 30) | def process(self): method get_x (line 35) | def get_x(self, x: int) -> int: method get_y (line 48) | def get_y(self, y: int) -> int: FILE: digital_image_processing/rotation/rotation.py function get_rotation (line 8) | def get_rotation( FILE: digital_image_processing/sepia.py function make_sepia (line 8) | def make_sepia(img, factor: int): FILE: digital_image_processing/test_digital_image_processing.py function test_convert_to_negative (line 27) | def test_convert_to_negative(): function test_change_contrast (line 34) | def test_change_contrast(): function test_gen_gaussian_kernel (line 43) | def test_gen_gaussian_kernel(): function test_canny (line 50) | def test_canny(): function test_gen_gaussian_kernel_filter (line 60) | def test_gen_gaussian_kernel_filter(): function test_convolve_filter (line 64) | def test_convolve_filter(): function test_median_filter (line 71) | def test_median_filter(): function test_sobel_filter (line 75) | def test_sobel_filter(): function test_sepia (line 81) | def test_sepia(): function test_burkes (line 86) | def test_burkes(file_path: str = "digital_image_processing/image_data/le... function test_nearest_neighbour (line 92) | def test_nearest_neighbour( function test_local_binary_pattern (line 100) | def test_local_binary_pattern(): FILE: divide_and_conquer/closest_pair_of_points.py function euclidean_distance_sqr (line 23) | def euclidean_distance_sqr(point1, point2): function column_based_sort (line 31) | def column_based_sort(array, column=0): function dis_between_closest_pair (line 39) | def dis_between_closest_pair(points, points_counts, min_dis=float("inf")): function dis_between_closest_in_strip (line 61) | def dis_between_closest_in_strip(points, points_counts, min_dis=float("i... function closest_pair_of_points_sqr (line 82) | def closest_pair_of_points_sqr(points_sorted_on_x, points_sorted_on_y, p... function closest_pair_of_points (line 125) | def closest_pair_of_points(points, points_counts): FILE: divide_and_conquer/convex_hull.py class Point (line 21) | class Point: method __init__ (line 48) | def __init__(self, x, y): method __eq__ (line 51) | def __eq__(self, other): method __ne__ (line 54) | def __ne__(self, other): method __gt__ (line 57) | def __gt__(self, other): method __lt__ (line 64) | def __lt__(self, other): method __ge__ (line 67) | def __ge__(self, other): method __le__ (line 74) | def __le__(self, other): method __repr__ (line 81) | def __repr__(self): method __hash__ (line 84) | def __hash__(self): function _construct_points (line 88) | def _construct_points( function _validate_input (line 135) | def _validate_input(points: list[Point] | list[list[float]]) -> list[Poi... function _det (line 188) | def _det(a: Point, b: Point, c: Point) -> float: function convex_hull_bf (line 223) | def convex_hull_bf(points: list[Point]) -> list[Point]: function convex_hull_recursive (line 295) | def convex_hull_recursive(points: list[Point]) -> list[Point]: function _construct_hull (line 365) | def _construct_hull( function convex_hull_melkman (line 409) | def convex_hull_melkman(points: list[Point]) -> list[Point]: function main (line 480) | def main(): FILE: divide_and_conquer/heaps_algorithm.py function heaps (line 10) | def heaps(arr: list) -> list: FILE: divide_and_conquer/heaps_algorithm_iterative.py function heaps (line 10) | def heaps(arr: list) -> list: FILE: divide_and_conquer/inversions.py function count_inversions_bf (line 12) | def count_inversions_bf(arr): function count_inversions_recursive (line 43) | def count_inversions_recursive(arr): function _count_cross_inversions (line 77) | def _count_cross_inversions(p, q): function main (line 121) | def main(): FILE: divide_and_conquer/kth_order_statistic.py function random_pivot (line 17) | def random_pivot(lst): function kth_number (line 26) | def kth_number(lst: list[int], k: int) -> int: FILE: divide_and_conquer/max_difference_pair.py function max_difference (line 1) | def max_difference(a: list[int]) -> tuple[int, int]: FILE: divide_and_conquer/max_subarray.py function max_subarray (line 19) | def max_subarray( function max_cross_sum (line 64) | def max_cross_sum( function time_max_subarray (line 87) | def time_max_subarray(input_size: int) -> float: function plot_runtimes (line 95) | def plot_runtimes() -> None: FILE: divide_and_conquer/mergesort.py function merge (line 4) | def merge(left_half: list, right_half: list) -> list: function merge_sort (line 60) | def merge_sort(array: list) -> list: FILE: divide_and_conquer/peak.py function peak (line 14) | def peak(lst: list[int]) -> int: FILE: divide_and_conquer/power.py function actual_power (line 1) | def actual_power(a: int, b: int) -> int: function power (line 30) | def power(a: int, b: int) -> float: FILE: divide_and_conquer/strassen_matrix_multiplication.py function default_matrix_multiplication (line 6) | def default_matrix_multiplication(a: list, b: list) -> list: function matrix_addition (line 19) | def matrix_addition(matrix_a: list, matrix_b: list): function matrix_subtraction (line 26) | def matrix_subtraction(matrix_a: list, matrix_b: list): function split_matrix (line 33) | def split_matrix(a: list) -> tuple[list, list, list, list]: function matrix_dimensions (line 66) | def matrix_dimensions(matrix: list) -> tuple[int, int]: function print_matrix (line 70) | def print_matrix(matrix: list) -> None: function actual_strassen (line 74) | def actual_strassen(matrix_a: list, matrix_b: list) -> list: function strassen (line 107) | def strassen(matrix1: list, matrix2: list) -> list: FILE: dynamic_programming/abbreviation.py function abbr (line 15) | def abbr(a: str, b: str) -> bool: FILE: dynamic_programming/all_construct.py function all_construct (line 9) | def all_construct(target: str, word_bank: list[str] | None = None) -> li... FILE: dynamic_programming/bitmask.py class AssignmentUsingBitmask (line 15) | class AssignmentUsingBitmask: method __init__ (line 16) | def __init__(self, task_performed, total): method count_ways_until (line 31) | def count_ways_until(self, mask, task_no): method count_no_of_ways (line 64) | def count_no_of_ways(self, task_performed): FILE: dynamic_programming/catalan_numbers.py function catalan_numbers (line 30) | def catalan_numbers(upper_limit: int) -> "list[int]": FILE: dynamic_programming/climbing_stairs.py function climb_stairs (line 4) | def climb_stairs(number_of_steps: int) -> int: FILE: dynamic_programming/combination_sum_iv.py function combination_sum_iv (line 26) | def combination_sum_iv(array: list[int], target: int) -> int: function combination_sum_iv_dp_array (line 45) | def combination_sum_iv_dp_array(array: list[int], target: int) -> int: function combination_sum_iv_bottom_up (line 75) | def combination_sum_iv_bottom_up(n: int, array: list[int], target: int) ... FILE: dynamic_programming/edit_distance.py class EditDistance (line 14) | class EditDistance: method __init__ (line 21) | def __init__(self): method __min_dist_top_down_dp (line 26) | def __min_dist_top_down_dp(self, m: int, n: int) -> int: method min_dist_top_down (line 44) | def min_dist_top_down(self, word1: str, word2: str) -> int: method min_dist_bottom_up (line 59) | def min_dist_bottom_up(self, word1: str, word2: str) -> int: FILE: dynamic_programming/factorial.py function factorial (line 7) | def factorial(num: int) -> int: FILE: dynamic_programming/fast_fibonacci.py function fibonacci (line 13) | def fibonacci(n: int) -> int: function _fib (line 25) | def _fib(n: int) -> tuple[int, int]: FILE: dynamic_programming/fibonacci.py class Fibonacci (line 7) | class Fibonacci: method __init__ (line 8) | def __init__(self) -> None: method get (line 11) | def get(self, index: int) -> list: function main (line 27) | def main() -> None: FILE: dynamic_programming/fizz_buzz.py function fizz_buzz (line 4) | def fizz_buzz(number: int, iterations: int) -> str: FILE: dynamic_programming/floyd_warshall.py class Graph (line 4) | class Graph: method __init__ (line 5) | def __init__(self, n=0): # a graph with Node 0,1,...,N-1 method add_edge (line 14) | def add_edge(self, u, v, w): method floyd_warshall (line 26) | def floyd_warshall(self): method show_min (line 45) | def show_min(self, u, v): FILE: dynamic_programming/integer_partition.py function partition (line 11) | def partition(m: int) -> int: FILE: dynamic_programming/iterating_through_submasks.py function list_of_submasks (line 12) | def list_of_submasks(mask: int) -> list[int]: FILE: dynamic_programming/k_means_clustering_tensorflow.py function tf_k_means_cluster (line 7) | def tf_k_means_cluster(vectors, noofclusters): FILE: dynamic_programming/knapsack.py function mf_knapsack (line 10) | def mf_knapsack(i, wt, val, j): function knapsack (line 29) | def knapsack(w, wt, val, n): function knapsack_with_example_solution (line 42) | def knapsack_with_example_solution(w: int, wt: list, val: list): function _construct_solution (line 103) | def _construct_solution(dp: list, wt: list, i: int, j: int, optimal_set:... FILE: dynamic_programming/largest_divisible_subset.py function largest_divisible_subset (line 4) | def largest_divisible_subset(items: list[int]) -> list[int]: FILE: dynamic_programming/longest_common_subsequence.py function longest_common_subsequence (line 9) | def longest_common_subsequence(x: str, y: str): FILE: dynamic_programming/longest_common_substring.py function longest_common_substring (line 13) | def longest_common_substring(text1: str, text2: str) -> str: FILE: dynamic_programming/longest_increasing_subsequence.py function longest_subsequence (line 19) | def longest_subsequence(array: list[int]) -> list[int]: # This function... FILE: dynamic_programming/longest_increasing_subsequence_iterative.py function longest_subsequence (line 21) | def longest_subsequence(array: list[int]) -> list[int]: FILE: dynamic_programming/longest_increasing_subsequence_o_nlogn.py function ceil_index (line 10) | def ceil_index(v, left, right, key): function longest_increasing_subsequence_length (line 20) | def longest_increasing_subsequence_length(v: list[int]) -> int: FILE: dynamic_programming/longest_palindromic_subsequence.py function longest_palindromic_subsequence (line 11) | def longest_palindromic_subsequence(input_string: str) -> int: FILE: dynamic_programming/matrix_chain_multiplication.py function matrix_chain_multiply (line 54) | def matrix_chain_multiply(arr: list[int]) -> int: function matrix_chain_order (line 99) | def matrix_chain_order(dims: list[int]) -> int: function elapsed_time (line 131) | def elapsed_time(msg: str) -> Iterator: FILE: dynamic_programming/matrix_chain_order.py function matrix_chain_order (line 13) | def matrix_chain_order(array: list[int]) -> tuple[list[list[int]], list[... function print_optimal_solution (line 37) | def print_optimal_solution(optimal_solution: list[list[int]], i: int, j:... function main (line 51) | def main(): FILE: dynamic_programming/max_non_adjacent_sum.py function maximum_non_adjacent_sum (line 6) | def maximum_non_adjacent_sum(nums: list[int]) -> int: FILE: dynamic_programming/max_product_subarray.py function max_product_subarray (line 1) | def max_product_subarray(numbers: list[int]) -> int: FILE: dynamic_programming/max_subarray_sum.py function max_subarray_sum (line 16) | def max_subarray_sum( FILE: dynamic_programming/min_distance_up_bottom.py function min_distance_up_bottom (line 14) | def min_distance_up_bottom(word1: str, word2: str) -> int: FILE: dynamic_programming/minimum_coin_change.py function dp_count (line 10) | def dp_count(s, n): FILE: dynamic_programming/minimum_cost_path.py function minimum_cost_path (line 6) | def minimum_cost_path(matrix: list[list[int]]) -> int: FILE: dynamic_programming/minimum_partition.py function find_min (line 6) | def find_min(numbers: list[int]) -> int: FILE: dynamic_programming/minimum_size_subarray_sum.py function minimum_subarray_sum (line 4) | def minimum_subarray_sum(target: int, numbers: list[int]) -> int: FILE: dynamic_programming/minimum_squares_to_represent_a_number.py function minimum_squares_to_represent_a_number (line 5) | def minimum_squares_to_represent_a_number(number: int) -> int: FILE: dynamic_programming/minimum_steps_to_one.py function min_steps_to_one (line 30) | def min_steps_to_one(number: int) -> int: FILE: dynamic_programming/minimum_tickets_cost.py function mincost_tickets (line 28) | def mincost_tickets(days: list[int], costs: list[int]) -> int: FILE: dynamic_programming/narcissistic_number.py function find_narcissistic_numbers (line 27) | def find_narcissistic_numbers(limit: int) -> list[int]: FILE: dynamic_programming/optimal_binary_search_tree.py class Node (line 23) | class Node: method __init__ (line 26) | def __init__(self, key, freq): method __str__ (line 30) | def __str__(self): function print_binary_search_tree (line 38) | def print_binary_search_tree(root, key, i, j, parent, is_left): function find_optimal_binary_search_tree (line 68) | def find_optimal_binary_search_tree(nodes): function main (line 137) | def main(): FILE: dynamic_programming/palindrome_partitioning.py function find_minimum_partitions (line 12) | def find_minimum_partitions(string: str) -> int: FILE: dynamic_programming/range_sum_query.py function prefix_sum (line 64) | def prefix_sum(array: list[int], queries: list[tuple[int, int]]) -> list... FILE: dynamic_programming/regex_match.py function recursive_match (line 13) | def recursive_match(text: str, pattern: str) -> bool: function dp_match (line 52) | def dp_match(text: str, pattern: str) -> bool: FILE: dynamic_programming/rod_cutting.py function naive_cut_rod_recursive (line 14) | def naive_cut_rod_recursive(n: int, prices: list): function top_down_cut_rod (line 56) | def top_down_cut_rod(n: int, prices: list): function _top_down_cut_rod_recursive (line 94) | def _top_down_cut_rod_recursive(n: int, prices: list, max_rev: list): function bottom_up_cut_rod (line 133) | def bottom_up_cut_rod(n: int, prices: list): function _enforce_args (line 177) | def _enforce_args(n: int, prices: list): function main (line 200) | def main(): FILE: dynamic_programming/smith_waterman.py function score_function (line 12) | def score_function( function smith_waterman (line 39) | def smith_waterman( function traceback (line 129) | def traceback(score: list[list[int]], query: str, subject: str) -> str: FILE: dynamic_programming/subset_generation.py function subset_combinations (line 1) | def subset_combinations(elements: list[int], n: int) -> list: FILE: dynamic_programming/sum_of_subset.py function is_sum_subset (line 1) | def is_sum_subset(arr: list[int], required_sum: int) -> bool: FILE: dynamic_programming/trapped_water.py function trapped_rainwater (line 16) | def trapped_rainwater(heights: tuple[int, ...]) -> int: FILE: dynamic_programming/tribonacci.py function tribonacci (line 4) | def tribonacci(num: int) -> list[int]: FILE: dynamic_programming/viterbi.py function viterbi (line 4) | def viterbi( function _validation (line 179) | def _validation( function _validate_not_empty (line 217) | def _validate_not_empty( function _validate_lists (line 248) | def _validate_lists(observations_space: Any, states_space: Any) -> None: function _validate_list (line 264) | def _validate_list(_object: Any, var_name: str) -> None: function _validate_dicts (line 286) | def _validate_dicts( function _validate_nested_dict (line 315) | def _validate_nested_dict(_object: Any, var_name: str) -> None: function _validate_dict (line 340) | def _validate_dict( FILE: dynamic_programming/wildcard_matching.py function is_match (line 19) | def is_match(string: str, pattern: str) -> bool: FILE: dynamic_programming/word_break.py function word_break (line 27) | def word_break(string: str, words: list[str]) -> bool: FILE: electronics/apparent_power.py function apparent_power (line 5) | def apparent_power( FILE: electronics/builtin_voltage.py function builtin_voltage (line 8) | def builtin_voltage( FILE: electronics/capacitor_equivalence.py function capacitor_parallel (line 6) | def capacitor_parallel(capacitors: list[float]) -> float: function capacitor_series (line 26) | def capacitor_series(capacitors: list[float]) -> float: FILE: electronics/carrier_concentration.py function carrier_concentration (line 8) | def carrier_concentration( FILE: electronics/charging_capacitor.py function charging_capacitor (line 21) | def charging_capacitor( FILE: electronics/charging_inductor.py function charging_inductor (line 32) | def charging_inductor( FILE: electronics/circular_convolution.py class CircularConvolution (line 21) | class CircularConvolution: method __init__ (line 26) | def __init__(self) -> None: method circular_convolution (line 34) | def circular_convolution(self) -> list[float]: FILE: electronics/coulombs_law.py function couloumbs_law (line 8) | def couloumbs_law( FILE: electronics/electric_conductivity.py function electric_conductivity (line 6) | def electric_conductivity( FILE: electronics/electric_power.py class Result (line 7) | class Result(NamedTuple): function electric_power (line 12) | def electric_power(voltage: float, current: float, power: float) -> tuple: FILE: electronics/electrical_impedance.py function electrical_impedance (line 12) | def electrical_impedance( FILE: electronics/ic_555_timer.py function astable_frequency (line 26) | def astable_frequency( function astable_duty_cycle (line 50) | def astable_duty_cycle(resistance_1: float, resistance_2: float) -> float: FILE: electronics/ind_reactance.py function ind_reactance (line 7) | def ind_reactance( FILE: electronics/ohms_law.py function ohms_law (line 5) | def ohms_law(voltage: float, current: float, resistance: float) -> dict[... FILE: electronics/real_and_reactive_power.py function real_power (line 4) | def real_power(apparent_power: float, power_factor: float) -> float: function reactive_power (line 25) | def reactive_power(apparent_power: float, power_factor: float) -> float: FILE: electronics/resistor_color_code.py function get_significant_digits (line 138) | def get_significant_digits(colors: list) -> str: function get_multiplier (line 161) | def get_multiplier(color: str) -> float: function get_tolerance (line 181) | def get_tolerance(color: str) -> float: function get_temperature_coeffecient (line 201) | def get_temperature_coeffecient(color: str) -> int: function get_band_type_count (line 221) | def get_band_type_count(total_number_of_bands: int, type_of_band: str) -... function check_validity (line 260) | def check_validity(number_of_bands: int, colors: list) -> bool: function calculate_resistance (line 295) | def calculate_resistance(number_of_bands: int, color_code_list: list) ->... FILE: electronics/resistor_equivalence.py function resistor_parallel (line 6) | def resistor_parallel(resistors: list[float]) -> float: function resistor_series (line 31) | def resistor_series(resistors: list[float]) -> float: FILE: electronics/resonant_frequency.py function resonant_frequency (line 16) | def resonant_frequency(inductance: float, capacitance: float) -> tuple: FILE: electronics/wheatstone_bridge.py function wheatstone_solver (line 5) | def wheatstone_solver( FILE: file_transfer/receive_file.py function main (line 4) | def main(): FILE: file_transfer/send_file.py function send_file (line 1) | def send_file(filename: str = "mytext.txt", testing: bool = False) -> None: FILE: file_transfer/tests/test_send_file.py function test_send_file_running_as_expected (line 8) | def test_send_file_running_as_expected(file, sock): FILE: financial/equated_monthly_installments.py function equated_monthly_installments (line 11) | def equated_monthly_installments( FILE: financial/exponential_moving_average.py function exponential_moving_average (line 15) | def exponential_moving_average( FILE: financial/interest.py function simple_interest (line 6) | def simple_interest( function compound_interest (line 42) | def compound_interest( function apr_interest (line 80) | def apr_interest( FILE: financial/present_value.py function present_value (line 12) | def present_value(discount_rate: float, cash_flows: list[float]) -> float: FILE: financial/price_plus_tax.py function price_plus_tax (line 6) | def price_plus_tax(price: float, tax_rate: float) -> float: FILE: financial/simple_moving_average.py function simple_moving_average (line 13) | def simple_moving_average( FILE: financial/straight_line_depreciation.py function straight_line_depreciation (line 32) | def straight_line_depreciation( FILE: financial/time_and_half_pay.py function pay (line 6) | def pay(hours_worked: float, pay_rate: float, hours: float = 40) -> float: FILE: fractals/julia_sets.py function eval_exponential (line 40) | def eval_exponential(c_parameter: complex, z_values: np.ndarray) -> np.n... function eval_quadratic_polynomial (line 53) | def eval_quadratic_polynomial(c_parameter: complex, z_values: np.ndarray... function prepare_grid (line 67) | def prepare_grid(window_size: float, nb_pixels: int) -> np.ndarray: function iterate_function (line 85) | def iterate_function( function show_results (line 127) | def show_results( function ignore_overflow_warnings (line 148) | def ignore_overflow_warnings() -> None: FILE: fractals/koch_snowflake.py function iterate (line 38) | def iterate(initial_vectors: list[np.ndarray], steps: int) -> list[np.nd... function iteration_step (line 53) | def iteration_step(vectors: list[np.ndarray]) -> list[np.ndarray]: function rotate (line 77) | def rotate(vector: np.ndarray, angle_in_degrees: float) -> np.ndarray: function plot (line 92) | def plot(vectors: list[np.ndarray]) -> None: FILE: fractals/mandelbrot.py function get_distance (line 23) | def get_distance(x: float, y: float, max_step: int) -> float: function get_black_and_white_rgb (line 50) | def get_black_and_white_rgb(distance: float) -> tuple: function get_color_coded_rgb (line 68) | def get_color_coded_rgb(distance: float) -> tuple: function get_image (line 86) | def get_image( FILE: fractals/sierpinski_triangle.py function get_mid (line 30) | def get_mid(p1: tuple[float, float], p2: tuple[float, float]) -> tuple[f... function triangle (line 48) | def triangle( FILE: fractals/vicsek.py function draw_cross (line 18) | def draw_cross(x: float, y: float, length: float): function draw_fractal_recursive (line 37) | def draw_fractal_recursive(x: float, y: float, length: float, depth: flo... function set_color (line 53) | def set_color(rgb: str): function draw_vicsek_fractal (line 57) | def draw_vicsek_fractal(x: float, y: float, length: float, depth: float,... function main (line 69) | def main(): FILE: fuzzy_logic/fuzzy_operations.py class FuzzySet (line 16) | class FuzzySet: method __str__ (line 68) | def __str__(self) -> str: method complement (line 77) | def complement(self) -> FuzzySet: method intersection (line 93) | def intersection(self, other) -> FuzzySet: method membership (line 112) | def membership(self, x: float) -> float: method union (line 141) | def union(self, other) -> FuzzySet: method plot (line 159) | def plot(self): FILE: genetic_algorithm/basic_string.py function evaluate (line 24) | def evaluate(item: str, main_target: str) -> tuple[str, float]: function crossover (line 35) | def crossover(parent_1: str, parent_2: str) -> tuple[str, str]: function mutate (line 48) | def mutate(child: str, genes: list[str]) -> str: function select (line 62) | def select( function basic (line 97) | def basic(target: str, genes: list[str], debug: bool = True) -> tuple[in... FILE: geodesy/haversine_distance.py function haversine_distance (line 8) | def haversine_distance(lat1: float, lon1: float, lat2: float, lon2: floa... FILE: geodesy/lamberts_ellipsoidal_distance.py function lamberts_ellipsoidal_distance (line 10) | def lamberts_ellipsoidal_distance( FILE: geometry/geometry.py class Angle (line 12) | class Angle: method __post_init__ (line 32) | def __post_init__(self) -> None: class Side (line 38) | class Side: method __post_init__ (line 69) | def __post_init__(self) -> None: class Ellipse (line 79) | class Ellipse: method area (line 95) | def area(self) -> float: method perimeter (line 103) | def perimeter(self) -> float: class Circle (line 111) | class Circle(Ellipse): method __init__ (line 127) | def __init__(self, radius: float) -> None: method __repr__ (line 131) | def __repr__(self) -> str: method diameter (line 135) | def diameter(self) -> float: method max_parts (line 142) | def max_parts(self, num_cuts: float) -> float: class Polygon (line 171) | class Polygon: method add_side (line 194) | def add_side(self, side: Side) -> Self: method get_side (line 202) | def get_side(self, index: int) -> Side: method set_side (line 213) | def set_side(self, index: int, side: Side) -> Self: class Rectangle (line 226) | class Rectangle(Polygon): method __init__ (line 241) | def __init__(self, short_side_length: float, long_side_length: float) ... method post_init (line 247) | def post_init(self) -> None: method perimeter (line 258) | def perimeter(self) -> float: method area (line 261) | def area(self) -> float: class Square (line 266) | class Square(Rectangle): method __init__ (line 277) | def __init__(self, side_length: float) -> None: method perimeter (line 280) | def perimeter(self) -> float: method area (line 283) | def area(self) -> float: FILE: geometry/graham_scan.py class Point (line 28) | class Point: method __init__ (line 41) | def __init__(self, x_coordinate: float, y_coordinate: float) -> None: method __eq__ (line 52) | def __eq__(self, other: object) -> bool: method __lt__ (line 65) | def __lt__(self, other: Point) -> bool: method euclidean_distance (line 80) | def euclidean_distance(self, other: Point) -> float: method consecutive_orientation (line 91) | def consecutive_orientation(self, point_a: Point, point_b: Point) -> f... function graham_scan (line 113) | def graham_scan(points: Sequence[Point]) -> list[Point]: FILE: geometry/jarvis_march.py class Point (line 25) | class Point: method __init__ (line 28) | def __init__(self, x_coordinate: float, y_coordinate: float) -> None: method __eq__ (line 32) | def __eq__(self, other: object) -> bool: method __repr__ (line 37) | def __repr__(self) -> str: method __hash__ (line 40) | def __hash__(self) -> int: function _cross_product (line 44) | def _cross_product(origin: Point, point_a: Point, point_b: Point) -> float: function _is_point_on_segment (line 58) | def _is_point_on_segment(p1: Point, p2: Point, point: Point) -> bool: function _find_leftmost_point (line 72) | def _find_leftmost_point(points: list[Point]) -> int: function _find_next_hull_point (line 83) | def _find_next_hull_point(points: list[Point], current_idx: int) -> int: function _is_valid_polygon (line 100) | def _is_valid_polygon(hull: list[Point]) -> bool: function _add_point_to_hull (line 111) | def _add_point_to_hull(hull: list[Point], point: Point) -> None: function jarvis_march (line 120) | def jarvis_march(points: list[Point]) -> list[Point]: FILE: geometry/tests/test_graham_scan.py function test_empty_points (line 8) | def test_empty_points() -> None: function test_single_point (line 13) | def test_single_point() -> None: function test_two_points (line 18) | def test_two_points() -> None: function test_duplicate_points (line 23) | def test_duplicate_points() -> None: function test_collinear_points (line 30) | def test_collinear_points() -> None: function test_triangle (line 42) | def test_triangle() -> None: function test_rectangle (line 56) | def test_rectangle() -> None: function test_triangle_with_interior_points (line 69) | def test_triangle_with_interior_points() -> None: function test_rectangle_with_interior_points (line 94) | def test_rectangle_with_interior_points() -> None: function test_star_shape (line 121) | def test_star_shape() -> None: function test_rectangle_with_collinear_points (line 152) | def test_rectangle_with_collinear_points() -> None: function test_point_equality (line 178) | def test_point_equality() -> None: function test_point_comparison (line 188) | def test_point_comparison() -> None: function test_euclidean_distance (line 199) | def test_euclidean_distance() -> None: function test_consecutive_orientation (line 207) | def test_consecutive_orientation() -> None: function test_large_hull (line 220) | def test_large_hull() -> None: function test_random_order (line 246) | def test_random_order() -> None: FILE: geometry/tests/test_jarvis_march.py class TestPoint (line 8) | class TestPoint: method test_point_creation (line 11) | def test_point_creation(self) -> None: method test_point_equality (line 17) | def test_point_equality(self) -> None: method test_point_repr (line 25) | def test_point_repr(self) -> None: method test_point_hash (line 30) | def test_point_hash(self) -> None: class TestJarvisMarch (line 37) | class TestJarvisMarch: method test_triangle (line 40) | def test_triangle(self) -> None: method test_collinear_points (line 47) | def test_collinear_points(self) -> None: method test_rectangle_with_interior_point (line 53) | def test_rectangle_with_interior_point(self) -> None: method test_star_shape (line 62) | def test_star_shape(self) -> None: method test_empty_list (line 77) | def test_empty_list(self) -> None: method test_single_point (line 81) | def test_single_point(self) -> None: method test_two_points (line 85) | def test_two_points(self) -> None: method test_square (line 89) | def test_square(self) -> None: method test_duplicate_points (line 97) | def test_duplicate_points(self) -> None: method test_pentagon (line 104) | def test_pentagon(self) -> None: FILE: graphics/bezier_curve.py class BezierCurve (line 8) | class BezierCurve: method __init__ (line 15) | def __init__(self, list_of_points: list[tuple[float, float]]): method basis_function (line 25) | def basis_function(self, t: float) -> list[float]: method bezier_curve_function (line 49) | def bezier_curve_function(self, t: float) -> tuple[float, float]: method plot_curve (line 75) | def plot_curve(self, step_size: float = 0.01): FILE: graphics/butterfly_pattern.py function butterfly_pattern (line 1) | def butterfly_pattern(n: int) -> str: FILE: graphics/digital_differential_analyzer_line.py function digital_differential_analyzer_line (line 4) | def digital_differential_analyzer_line( FILE: graphics/vector3_for_2d_rendering.py function convert_to_2d (line 13) | def convert_to_2d( function rotate (line 38) | def rotate( FILE: graphs/a_star.py function search (line 12) | def search( FILE: graphs/ant_colony_optimization_algorithms.py function main (line 29) | def main( function distance (line 102) | def distance(city1: list[int], city2: list[int]) -> float: function pheromone_update (line 115) | def pheromone_update( function city_select (line 168) | def city_select( FILE: graphs/articulation_points.py function compute_ap (line 2) | def compute_ap(graph): FILE: graphs/basic_graphs.py function _input (line 4) | def _input(message): function initialize_unweighted_directed_graph (line 8) | def initialize_unweighted_directed_graph( function initialize_unweighted_undirected_graph (line 21) | def initialize_unweighted_undirected_graph( function initialize_weighted_undirected_graph (line 35) | def initialize_weighted_undirected_graph( function dfs (line 79) | def dfs(g, s): function bfs (line 114) | def bfs(g, s): function dijk (line 149) | def dijk(g, s): function topo (line 189) | def topo(g, ind=None, q=None): function adjm (line 219) | def adjm(): function floy (line 259) | def floy(a_and_n): function prim (line 284) | def prim(g, s): function edglist (line 313) | def edglist(): function krusk (line 350) | def krusk(e_and_n): function find_isolated_nodes (line 374) | def find_isolated_nodes(graph): FILE: graphs/bellman_ford.py function print_distance (line 4) | def print_distance(distance: list[float], src): function check_negative_cycle (line 10) | def check_negative_cycle( function bellman_ford (line 20) | def bellman_ford( FILE: graphs/bi_directional_dijkstra.py function pass_and_relaxation (line 19) | def pass_and_relaxation( function bidirectional_dij (line 47) | def bidirectional_dij( FILE: graphs/bidirectional_a_star.py class Node (line 28) | class Node: method __init__ (line 44) | def __init__( method calculate_heuristic (line 63) | def calculate_heuristic(self) -> float: method __lt__ (line 74) | def __lt__(self, other: Node) -> bool: class AStar (line 78) | class AStar: method __init__ (line 94) | def __init__(self, start: TPosition, goal: TPosition): method search (line 103) | def search(self) -> list[TPosition]: method get_successors (line 132) | def get_successors(self, parent: Node) -> list[Node]: method retrace_path (line 158) | def retrace_path(self, node: Node | None) -> list[TPosition]: class BidirectionalAStar (line 171) | class BidirectionalAStar: method __init__ (line 184) | def __init__(self, start: TPosition, goal: TPosition) -> None: method search (line 189) | def search(self) -> list[TPosition]: method retrace_bidirectional_path (line 232) | def retrace_bidirectional_path( FILE: graphs/bidirectional_breadth_first_search.py class Node (line 24) | class Node: method __init__ (line 25) | def __init__( class BreadthFirstSearch (line 36) | class BreadthFirstSearch: method __init__ (line 55) | def __init__(self, start: tuple[int, int], goal: tuple[int, int]): method search (line 62) | def search(self) -> Path | None: method get_successors (line 79) | def get_successors(self, parent: Node) -> list[Node]: method retrace_path (line 98) | def retrace_path(self, node: Node | None) -> Path: class BidirectionalBreadthFirstSearch (line 111) | class BidirectionalBreadthFirstSearch: method __init__ (line 125) | def __init__(self, start, goal): method search (line 130) | def search(self) -> Path | None: method retrace_bidirectional_path (line 157) | def retrace_bidirectional_path(self, fwd_node: Node, bwd_node: Node) -... FILE: graphs/bidirectional_search.py function expand_search (line 17) | def expand_search( function construct_path (line 41) | def construct_path(current: int | None, parents: dict[int, int | None]) ... function bidirectional_search (line 49) | def bidirectional_search( function main (line 151) | def main() -> None: FILE: graphs/boruvka.py class Graph (line 33) | class Graph: method __init__ (line 34) | def __init__(self, num_of_nodes: int) -> None: method add_edge (line 49) | def add_edge(self, u_node: int, v_node: int, weight: int) -> None: method find_component (line 54) | def find_component(self, u_node: int) -> int: method set_component (line 61) | def set_component(self, u_node: int) -> None: method union (line 68) | def union(self, component_size: list[int], u_node: int, v_node: int) -... method boruvka (line 83) | def boruvka(self) -> None: function test_vector (line 141) | def test_vector() -> None: FILE: graphs/breadth_first_search.py class Graph (line 10) | class Graph: method __init__ (line 11) | def __init__(self) -> None: method print_graph (line 14) | def print_graph(self) -> None: method add_edge (line 26) | def add_edge(self, from_vertex: int, to_vertex: int) -> None: method bfs (line 40) | def bfs(self, start_vertex: int) -> set[int]: FILE: graphs/breadth_first_search_2.py function breadth_first_search (line 32) | def breadth_first_search(graph: dict, start: str) -> list[str]: function breadth_first_search_with_deque (line 53) | def breadth_first_search_with_deque(graph: dict, start: str) -> list[str]: function benchmark_function (line 73) | def benchmark_function(name: str) -> None: FILE: graphs/breadth_first_search_shortest_path.py class Graph (line 18) | class Graph: method __init__ (line 19) | def __init__(self, graph: dict[str, list[str]], source_vertex: str) ->... method breath_first_search (line 29) | def breath_first_search(self) -> None: method shortest_path (line 49) | def shortest_path(self, target_vertex: str) -> str: FILE: graphs/breadth_first_search_shortest_path_2.py function bfs_shortest_path (line 21) | def bfs_shortest_path(graph: dict, start, goal) -> list[str]: function bfs_shortest_path_distance (line 72) | def bfs_shortest_path_distance(graph: dict, start, target) -> int: FILE: graphs/breadth_first_search_zero_one_shortest_path.py class Edge (line 15) | class Edge: class AdjacencyList (line 22) | class AdjacencyList: method __init__ (line 25) | def __init__(self, size: int): method __getitem__ (line 29) | def __getitem__(self, vertex: int) -> Iterator[Edge]: method size (line 34) | def size(self): method add_edge (line 37) | def add_edge(self, from_vertex: int, to_vertex: int, weight: int): method get_shortest_path (line 63) | def get_shortest_path(self, start_vertex: int, finish_vertex: int) -> ... FILE: graphs/check_bipatrite.py function is_bipartite_dfs (line 4) | def is_bipartite_dfs(graph: dict[int, list[int]]) -> bool: function is_bipartite_bfs (line 84) | def is_bipartite_bfs(graph: dict[int, list[int]]) -> bool: FILE: graphs/check_cycle.py function check_cycle (line 6) | def check_cycle(graph: dict) -> bool: function depth_first_search (line 24) | def depth_first_search(graph: dict, vertex: int, visited: set, rec_stk: ... FILE: graphs/connected_components.py function dfs (line 13) | def dfs(graph: dict, vert: int, visited: list) -> list: function connected_components (line 33) | def connected_components(graph: dict) -> list: FILE: graphs/deep_clone_graph.py class Node (line 17) | class Node: method __post_init__ (line 21) | def __post_init__(self) -> None: method __hash__ (line 28) | def __hash__(self) -> int: function clone_graph (line 36) | def clone_graph(node: Node | None) -> Node | None: FILE: graphs/depth_first_search.py function depth_first_search (line 6) | def depth_first_search(graph: dict, start: str) -> set[str]: FILE: graphs/depth_first_search_2.py class Graph (line 6) | class Graph: method __init__ (line 7) | def __init__(self): method print_graph (line 11) | def print_graph(self) -> None: method add_edge (line 35) | def add_edge(self, from_vertex: int, to_vertex: int) -> None: method dfs (line 57) | def dfs(self) -> None: method dfs_recursive (line 81) | def dfs_recursive(self, start_vertex: int, visited: list) -> None: FILE: graphs/dijkstra.py function dijkstra (line 37) | def dijkstra(graph, start, end): FILE: graphs/dijkstra_2.py function print_dist (line 1) | def print_dist(dist, v): function min_dist (line 11) | def min_dist(mdist, vset, v): function dijkstra (line 21) | def dijkstra(graph, v, src): FILE: graphs/dijkstra_algorithm.py class PriorityQueue (line 11) | class PriorityQueue: method __init__ (line 13) | def __init__(self): method is_empty (line 30) | def is_empty(self): method min_heapify (line 44) | def min_heapify(self, idx): method insert (line 87) | def insert(self, tup): method extract_min (line 108) | def extract_min(self): method left (line 130) | def left(self, i): method right (line 143) | def right(self, i): method par (line 156) | def par(self, i): method swap (line 171) | def swap(self, i, j): method decrease_key (line 192) | def decrease_key(self, tup, new_d): class Graph (line 213) | class Graph: method __init__ (line 214) | def __init__(self, num): method add_edge (line 235) | def add_edge(self, u, v, w): method show_graph (line 258) | def show_graph(self): method dijkstra (line 277) | def dijkstra(self, src): method show_distances (line 380) | def show_distances(self, src): method show_path (line 394) | def show_path(self, src, dest): FILE: graphs/dijkstra_alternate.py class Graph (line 4) | class Graph: method __init__ (line 5) | def __init__(self, vertices: int) -> None: method print_solution (line 18) | def print_solution(self, distances_from_source: list[int]) -> None: method minimum_distance (line 27) | def minimum_distance( method dijkstra (line 49) | def dijkstra(self, source: int) -> None: FILE: graphs/dijkstra_binary_grid.py function dijkstra (line 14) | def dijkstra( FILE: graphs/dinic.py class Dinic (line 4) | class Dinic: method __init__ (line 5) | def __init__(self, n): method add_edge (line 17) | def add_edge(self, a, b, c, rcap=0): method depth_first_search (line 22) | def depth_first_search(self, vertex, sink, flow): method max_flow (line 38) | def max_flow(self, source, sink): FILE: graphs/directed_and_undirected_weighted_graph.py class DirectedGraph (line 9) | class DirectedGraph: method __init__ (line 10) | def __init__(self): method add_pair (line 16) | def add_pair(self, u, v, w=1): method all_nodes (line 25) | def all_nodes(self): method remove_pair (line 29) | def remove_pair(self, u, v): method dfs (line 36) | def dfs(self, s=-2, d=-1): method fill_graph_randomly (line 76) | def fill_graph_randomly(self, c=-1): method bfs (line 86) | def bfs(self, s=-2): method in_degree (line 102) | def in_degree(self, u): method out_degree (line 110) | def out_degree(self, u): method topological_sort (line 113) | def topological_sort(self, s=-2): method cycle_nodes (line 146) | def cycle_nodes(self): method has_cycle (line 199) | def has_cycle(self): method dfs_time (line 251) | def dfs_time(self, s=-2, e=-1): method bfs_time (line 257) | def bfs_time(self, s=-2): class Graph (line 264) | class Graph: method __init__ (line 265) | def __init__(self): method add_pair (line 271) | def add_pair(self, u, v, w=1): method remove_pair (line 290) | def remove_pair(self, u, v): method dfs (line 302) | def dfs(self, s=-2, d=-1): method fill_graph_randomly (line 342) | def fill_graph_randomly(self, c=-1): method bfs (line 352) | def bfs(self, s=-2): method degree (line 368) | def degree(self, u): method cycle_nodes (line 371) | def cycle_nodes(self): method has_cycle (line 424) | def has_cycle(self): method all_nodes (line 476) | def all_nodes(self): method dfs_time (line 479) | def dfs_time(self, s=-2, e=-1): method bfs_time (line 485) | def bfs_time(self, s=-2): FILE: graphs/edmonds_karp_multiple_source_and_sink.py class FlowNetwork (line 1) | class FlowNetwork: method __init__ (line 2) | def __init__(self, graph, sources, sinks): method _normalize_graph (line 12) | def _normalize_graph(self, sources, sinks): method find_maximum_flow (line 47) | def find_maximum_flow(self): method set_maximum_flow_algorithm (line 56) | def set_maximum_flow_algorithm(self, algorithm): class FlowNetworkAlgorithmExecutor (line 60) | class FlowNetworkAlgorithmExecutor: method __init__ (line 61) | def __init__(self, flow_network): method execute (line 71) | def execute(self): method _algorithm (line 77) | def _algorithm(self): class MaximumFlowAlgorithmExecutor (line 81) | class MaximumFlowAlgorithmExecutor(FlowNetworkAlgorithmExecutor): method __init__ (line 82) | def __init__(self, flow_network): method get_maximum_flow (line 87) | def get_maximum_flow(self): class PushRelabelExecutor (line 94) | class PushRelabelExecutor(MaximumFlowAlgorithmExecutor): method __init__ (line 95) | def __init__(self, flow_network): method _algorithm (line 103) | def _algorithm(self): method process_vertex (line 135) | def process_vertex(self, vertex_index): method push (line 149) | def push(self, from_index, to_index): method relabel (line 159) | def relabel(self, vertex_index): FILE: graphs/eulerian_path_and_circuit_for_undirected_graph.py function dfs (line 9) | def dfs(u, graph, visited_edge, path=None): function check_circuit_or_path (line 19) | def check_circuit_or_path(graph, max_node): function check_euler (line 35) | def check_euler(graph, max_node): function main (line 52) | def main(): FILE: graphs/even_tree.py function dfs (line 20) | def dfs(start: int) -> int: function even_tree (line 33) | def even_tree(): FILE: graphs/finding_bridges.py function __get_demo_graph (line 13) | def __get_demo_graph(index): function compute_bridges (line 60) | def compute_bridges(graph: dict[int, list[int]]) -> list[tuple[int, int]]: FILE: graphs/frequent_pattern_graph_miner.py function get_distinct_edge (line 27) | def get_distinct_edge(edge_array): function get_bitcode (line 40) | def get_bitcode(edge_array, distinct_edge): function get_frequency_table (line 53) | def get_frequency_table(edge_array): function get_nodes (line 74) | def get_nodes(frequency_table): function get_cluster (line 88) | def get_cluster(nodes): function get_support (line 99) | def get_support(cluster): function print_all (line 113) | def print_all() -> None: function create_edge (line 130) | def create_edge(nodes, graph, cluster, c1): function construct_graph (line 154) | def construct_graph(cluster, nodes): function my_dfs (line 172) | def my_dfs(graph, start, end, path=None): function find_freq_subgraph_given_support (line 184) | def find_freq_subgraph_given_support(s, cluster, graph): function freq_subgraphs_edge_list (line 193) | def freq_subgraphs_edge_list(paths): function preprocess (line 209) | def preprocess(edge_array): FILE: graphs/g_topological_sort.py function print_stack (line 21) | def print_stack(stack, clothes): function depth_first_search (line 29) | def depth_first_search(u, visited, graph): function topological_sort (line 38) | def topological_sort(graph, visited): FILE: graphs/gale_shapley_bigraph.py function stable_matching (line 4) | def stable_matching( FILE: graphs/graph_adjacency_list.py class GraphAdjacencyList (line 31) | class GraphAdjacencyList[T]: method __init__ (line 32) | def __init__( method add_vertex (line 60) | def add_vertex(self, vertex: T) -> None: method add_edge (line 79) | def add_edge(self, source_vertex: T, destination_vertex: T) -> None: method remove_vertex (line 107) | def remove_vertex(self, vertex: T) -> None: method remove_edge (line 132) | def remove_edge(self, source_vertex: T, destination_vertex: T) -> None: method contains_vertex (line 159) | def contains_vertex(self, vertex: T) -> bool: method contains_edge (line 165) | def contains_edge(self, source_vertex: T, destination_vertex: T) -> bool: method clear_graph (line 183) | def clear_graph(self) -> None: method __repr__ (line 189) | def __repr__(self) -> str: class TestGraphAdjacencyList (line 193) | class TestGraphAdjacencyList(unittest.TestCase): method __assert_graph_edge_exists_check (line 194) | def __assert_graph_edge_exists_check( method __assert_graph_edge_does_not_exist_check (line 204) | def __assert_graph_edge_does_not_exist_check( method __assert_graph_vertex_exists_check (line 214) | def __assert_graph_vertex_exists_check( method __assert_graph_vertex_does_not_exist_check (line 223) | def __assert_graph_vertex_does_not_exist_check( method __generate_random_edges (line 232) | def __generate_random_edges( method __generate_graphs (line 251) | def __generate_graphs( method test_init_check (line 278) | def test_init_check(self) -> None: method test_contains_vertex (line 299) | def test_contains_vertex(self) -> None: method test_add_vertices (line 315) | def test_add_vertices(self) -> None: method test_remove_vertices (line 339) | def test_remove_vertices(self) -> None: method test_add_and_remove_vertices_repeatedly (line 363) | def test_add_and_remove_vertices_repeatedly(self) -> None: method test_contains_edge (line 400) | def test_contains_edge(self) -> None: method test_add_edge (line 434) | def test_add_edge(self) -> None: method test_remove_edge (line 455) | def test_remove_edge(self) -> None: method test_add_and_remove_edges_repeatedly (line 475) | def test_add_and_remove_edges_repeatedly(self) -> None: method test_add_vertex_exception_check (line 509) | def test_add_vertex_exception_check(self) -> None: method test_remove_vertex_exception_check (line 523) | def test_remove_vertex_exception_check(self) -> None: method test_add_edge_exception_check (line 538) | def test_add_edge_exception_check(self) -> None: method test_remove_edge_exception_check (line 552) | def test_remove_edge_exception_check(self) -> None: method test_contains_edge_exception_check (line 576) | def test_contains_edge_exception_check(self) -> None: FILE: graphs/graph_adjacency_matrix.py class GraphAdjacencyMatrix (line 31) | class GraphAdjacencyMatrix[T]: method __init__ (line 32) | def __init__( method add_edge (line 61) | def add_edge(self, source_vertex: T, destination_vertex: T) -> None: method remove_edge (line 90) | def remove_edge(self, source_vertex: T, destination_vertex: T) -> None: method add_vertex (line 118) | def add_vertex(self, vertex: T) -> None: method remove_vertex (line 135) | def remove_vertex(self, vertex: T) -> None: method contains_vertex (line 165) | def contains_vertex(self, vertex: T) -> bool: method contains_edge (line 171) | def contains_edge(self, source_vertex: T, destination_vertex: T) -> bool: method clear_graph (line 191) | def clear_graph(self) -> None: method __repr__ (line 198) | def __repr__(self) -> str: class TestGraphMatrix (line 204) | class TestGraphMatrix(unittest.TestCase): method __assert_graph_edge_exists_check (line 205) | def __assert_graph_edge_exists_check( method __assert_graph_edge_does_not_exist_check (line 215) | def __assert_graph_edge_does_not_exist_check( method __assert_graph_vertex_exists_check (line 225) | def __assert_graph_vertex_exists_check( method __assert_graph_vertex_does_not_exist_check (line 234) | def __assert_graph_vertex_does_not_exist_check( method __generate_random_edges (line 243) | def __generate_random_edges( method __generate_graphs (line 262) | def __generate_graphs( method test_init_check (line 289) | def test_init_check(self) -> None: method test_contains_vertex (line 311) | def test_contains_vertex(self) -> None: method test_add_vertices (line 327) | def test_add_vertices(self) -> None: method test_remove_vertices (line 351) | def test_remove_vertices(self) -> None: method test_add_and_remove_vertices_repeatedly (line 375) | def test_add_and_remove_vertices_repeatedly(self) -> None: method test_contains_edge (line 412) | def test_contains_edge(self) -> None: method test_add_edge (line 446) | def test_add_edge(self) -> None: method test_remove_edge (line 467) | def test_remove_edge(self) -> None: method test_add_and_remove_edges_repeatedly (line 487) | def test_add_and_remove_edges_repeatedly(self) -> None: method test_add_vertex_exception_check (line 521) | def test_add_vertex_exception_check(self) -> None: method test_remove_vertex_exception_check (line 535) | def test_remove_vertex_exception_check(self) -> None: method test_add_edge_exception_check (line 550) | def test_add_edge_exception_check(self) -> None: method test_remove_edge_exception_check (line 564) | def test_remove_edge_exception_check(self) -> None: method test_contains_edge_exception_check (line 588) | def test_contains_edge_exception_check(self) -> None: FILE: graphs/graph_list.py class GraphAdjacencyList (line 14) | class GraphAdjacencyList[T]: method __init__ (line 75) | def __init__(self, directed: bool = True) -> None: method add_edge (line 84) | def add_edge( method __repr__ (line 149) | def __repr__(self) -> str: FILE: graphs/graphs_floyd_warshall.py function _print_dist (line 8) | def _print_dist(dist, v): function floyd_warshall (line 19) | def floyd_warshall(graph, v): FILE: graphs/greedy_best_first.py class Node (line 40) | class Node: method __init__ (line 56) | def __init__( method calculate_heuristic (line 74) | def calculate_heuristic(self) -> float: method __lt__ (line 83) | def __lt__(self, other) -> bool: method __eq__ (line 86) | def __eq__(self, other) -> bool: class GreedyBestFirst (line 90) | class GreedyBestFirst: method __init__ (line 107) | def __init__( method search (line 119) | def search(self) -> Path | None: method get_successors (line 147) | def get_successors(self, parent: Node) -> list[Node]: method retrace_path (line 168) | def retrace_path(self, node: Node | None) -> Path: FILE: graphs/greedy_min_vertex_cover.py function greedy_min_vertex_cover (line 12) | def greedy_min_vertex_cover(graph: dict) -> set[int]: FILE: graphs/kahns_algorithm_long.py function longest_distance (line 2) | def longest_distance(graph): FILE: graphs/kahns_algorithm_topo.py function topological_sort (line 1) | def topological_sort(graph: dict[int, list[int]]) -> list[int] | None: FILE: graphs/karger.py function partition_graph (line 25) | def partition_graph(graph: dict[str, list[str]]) -> set[tuple[str, str]]: FILE: graphs/lanczos_eigenvectors.py function validate_adjacency_list (line 32) | def validate_adjacency_list(graph: list[list[int | None]]) -> None: function lanczos_iteration (line 71) | def lanczos_iteration( function multiply_matrix_vector (line 133) | def multiply_matrix_vector( function find_lanczos_eigenvectors (line 165) | def find_lanczos_eigenvectors( function main (line 196) | def main() -> None: FILE: graphs/markov_chain.py class MarkovChainGraphUndirectedUnweighted (line 7) | class MarkovChainGraphUndirectedUnweighted: method __init__ (line 12) | def __init__(self): method add_node (line 15) | def add_node(self, node: str) -> None: method add_transition_probability (line 18) | def add_transition_probability( method get_nodes (line 27) | def get_nodes(self) -> list[str]: method transition (line 30) | def transition(self, node: str) -> str: function get_transitions (line 41) | def get_transitions( FILE: graphs/matching_min_vertex_cover.py function matching_min_vertex_cover (line 11) | def matching_min_vertex_cover(graph: dict) -> set: function get_edges (line 39) | def get_edges(graph: dict) -> set: FILE: graphs/minimum_path_sum.py function min_path_sum (line 1) | def min_path_sum(grid: list) -> int: function fill_row (line 47) | def fill_row(current_row: list, row_above: list) -> list: FILE: graphs/minimum_spanning_tree_boruvka.py class Graph (line 1) | class Graph: method __init__ (line 6) | def __init__(self): method add_vertex (line 11) | def add_vertex(self, vertex): method add_edge (line 20) | def add_edge(self, head, tail, weight): method distinct_weight (line 35) | def distinct_weight(self): method __str__ (line 57) | def __str__(self): method get_edges (line 68) | def get_edges(self): method get_vertices (line 78) | def get_vertices(self): method build (line 85) | def build(vertices=None, edges=None): class UnionFind (line 101) | class UnionFind: method __init__ (line 106) | def __init__(self): method __len__ (line 110) | def __len__(self): method make_set (line 113) | def make_set(self, item): method find (line 121) | def find(self, item): method union (line 128) | def union(self, item1, item2): method boruvka_mst (line 150) | def boruvka_mst(graph): FILE: graphs/minimum_spanning_tree_kruskal.py function kruskal (line 1) | def kruskal( FILE: graphs/minimum_spanning_tree_kruskal2.py class DisjointSetTreeNode (line 8) | class DisjointSetTreeNode[T]: method __init__ (line 10) | def __init__(self, data: T) -> None: class DisjointSetTree (line 16) | class DisjointSetTree[T]: method __init__ (line 18) | def __init__(self) -> None: method make_set (line 22) | def make_set(self, data: T) -> None: method find_set (line 26) | def find_set(self, data: T) -> DisjointSetTreeNode[T]: method link (line 33) | def link( method union (line 44) | def union(self, data1: T, data2: T) -> None: class GraphUndirectedWeighted (line 49) | class GraphUndirectedWeighted[T]: method __init__ (line 50) | def __init__(self) -> None: method add_node (line 54) | def add_node(self, node: T) -> None: method add_edge (line 59) | def add_edge(self, node1: T, node2: T, weight: int) -> None: method kruskal (line 66) | def kruskal(self) -> GraphUndirectedWeighted[T]: FILE: graphs/minimum_spanning_tree_prims.py class Heap (line 5) | class Heap: method __init__ (line 6) | def __init__(self): method get_position (line 9) | def get_position(self, vertex): method set_position (line 12) | def set_position(self, vertex, pos): method top_to_bottom (line 15) | def top_to_bottom(self, heap, start, size, positions): method bottom_to_top (line 42) | def bottom_to_top(self, val, index, heap, position): method heapify (line 63) | def heapify(self, heap, positions): method delete_minimum (line 68) | def delete_minimum(self, heap, positions): function prisms_algorithm (line 75) | def prisms_algorithm(adjacency_list): FILE: graphs/minimum_spanning_tree_prims2.py function get_parent_position (line 18) | def get_parent_position(position: int) -> int: function get_child_left_position (line 30) | def get_child_left_position(position: int) -> int: function get_child_right_position (line 40) | def get_child_right_position(position: int) -> int: class MinPriorityQueue (line 50) | class MinPriorityQueue[T]: method __init__ (line 86) | def __init__(self) -> None: method __len__ (line 91) | def __len__(self) -> int: method __repr__ (line 94) | def __repr__(self) -> str: method is_empty (line 97) | def is_empty(self) -> bool: method push (line 101) | def push(self, elem: T, weight: int) -> None: method extract_min (line 108) | def extract_min(self) -> T: method update_key (line 120) | def update_key(self, elem: T, weight: int) -> None: method _bubble_up (line 134) | def _bubble_up(self, elem: T) -> None: method _bubble_down (line 148) | def _bubble_down(self, elem: T) -> None: method _swap_nodes (line 175) | def _swap_nodes(self, node1_pos: int, node2_pos: int) -> None: class GraphUndirectedWeighted (line 187) | class GraphUndirectedWeighted[T]: method __init__ (line 196) | def __init__(self) -> None: method __repr__ (line 200) | def __repr__(self) -> str: method __len__ (line 203) | def __len__(self) -> int: method add_node (line 206) | def add_node(self, node: T) -> None: method add_edge (line 212) | def add_edge(self, node1: T, node2: T, weight: int) -> None: function prims_algo (line 220) | def prims_algo[T]( FILE: graphs/multi_heuristic_astar.py class PriorityQueue (line 9) | class PriorityQueue: method __init__ (line 10) | def __init__(self): method minkey (line 14) | def minkey(self): method empty (line 20) | def empty(self): method put (line 23) | def put(self, item, priority): method remove_element (line 39) | def remove_element(self, item): method top_show (line 50) | def top_show(self): method get (line 53) | def get(self): function consistent_heuristic (line 59) | def consistent_heuristic(p: TPos, goal: TPos): function heuristic_2 (line 66) | def heuristic_2(p: TPos, goal: TPos): function heuristic_1 (line 71) | def heuristic_1(p: TPos, goal: TPos): function key (line 76) | def key(start: TPos, i: int, goal: TPos, g_function: dict[TPos, float]): function do_something (line 81) | def do_something(back_pointer, goal, start): function valid (line 123) | def valid(p: TPos): function expand_state (line 129) | def expand_state( function make_common_ground (line 172) | def make_common_ground(): function multi_a_star (line 236) | def multi_a_star(start: TPos, goal: TPos, n_heuristic: int): FILE: graphs/page_rank.py class Node (line 18) | class Node: method __init__ (line 19) | def __init__(self, name): method add_inbound (line 24) | def add_inbound(self, node): method add_outbound (line 27) | def add_outbound(self, node): method __repr__ (line 30) | def __repr__(self): function page_rank (line 34) | def page_rank(nodes, limit=3, d=0.85): function main (line 52) | def main(): FILE: graphs/prim.py class Vertex (line 13) | class Vertex: method __init__ (line 16) | def __init__(self, id_): method __lt__ (line 30) | def __lt__(self, other): method __repr__ (line 34) | def __repr__(self): method add_neighbor (line 38) | def add_neighbor(self, vertex): method add_edge (line 42) | def add_edge(self, vertex, weight): function connect (line 47) | def connect(graph, a, b, edge): function prim (line 56) | def prim(graph: list, root: Vertex) -> list: function prim_heap (line 86) | def prim_heap(graph: list, root: Vertex) -> Iterator[tuple]: function test_vector (line 118) | def test_vector() -> None: FILE: graphs/random_graph_generator.py function random_graph (line 12) | def random_graph( function complete_graph (line 50) | def complete_graph(vertices_number: int) -> dict: FILE: graphs/scc_kosaraju.py function dfs (line 4) | def dfs(u): function dfs2 (line 14) | def dfs2(u): function kosaraju (line 24) | def kosaraju(): FILE: graphs/strongly_connected_components.py function topology_sort (line 13) | def topology_sort( function find_components (line 37) | def find_components( function strongly_connected_components (line 59) | def strongly_connected_components(graph: dict[int, list[int]]) -> list[l... FILE: graphs/tarjans_scc.py function tarjan (line 4) | def tarjan(g: list[list[int]]) -> list[list[int]]: function create_graph (line 83) | def create_graph(n: int, edges: list[tuple[int, int]]) -> list[list[int]]: FILE: graphs/tests/test_min_spanning_tree_kruskal.py function test_kruskal_successful_result (line 4) | def test_kruskal_successful_result(): FILE: graphs/tests/test_min_spanning_tree_prim.py function test_prim_successful_result (line 6) | def test_prim_successful_result(): FILE: greedy_methods/best_time_to_buy_and_sell_stock.py function max_profit (line 18) | def max_profit(prices: list[int]) -> int: FILE: greedy_methods/fractional_cover_problem.py class Item (line 8) | class Item: method ratio (line 13) | def ratio(self) -> float: function fractional_cover (line 33) | def fractional_cover(items: list[Item], capacity: int) -> float: FILE: greedy_methods/fractional_knapsack.py function frac_knapsack (line 5) | def frac_knapsack(vl, wt, w, n): FILE: greedy_methods/fractional_knapsack_2.py function fractional_knapsack (line 8) | def fractional_knapsack( FILE: greedy_methods/gas_station.py class GasStation (line 31) | class GasStation: function get_gas_stations (line 36) | def get_gas_stations( function can_complete_journey (line 62) | def can_complete_journey(gas_stations: tuple[GasStation, ...]) -> int: FILE: greedy_methods/minimum_coin_change.py function find_minimum_change (line 44) | def find_minimum_change(denominations: list[int], value: str) -> list[int]: FILE: greedy_methods/minimum_waiting_time.py function minimum_waiting_time (line 16) | def minimum_waiting_time(queries: list[int]) -> int: FILE: greedy_methods/optimal_merge_pattern.py function optimal_merge_pattern (line 23) | def optimal_merge_pattern(files: list) -> float: FILE: greedy_methods/smallest_range.py function smallest_range (line 10) | def smallest_range(nums: list[list[int]]) -> list[int]: FILE: hashes/adler32.py function adler32 (line 14) | def adler32(plain_text: str) -> int: FILE: hashes/chaos_machine.py function push (line 16) | def push(seed): function pull (line 42) | def pull(): function reset (line 75) | def reset(): FILE: hashes/djb2.py function djb2 (line 21) | def djb2(s: str) -> int: FILE: hashes/elf.py function elf_hash (line 1) | def elf_hash(data: str) -> int: FILE: hashes/enigma_machine.py function rotator (line 10) | def rotator(): function engine (line 30) | def engine(input_character): FILE: hashes/fletcher16.py function fletcher16 (line 13) | def fletcher16(text: str) -> int: FILE: hashes/hamming_code.py function text_to_bits (line 52) | def text_to_bits(text, encoding="utf-8", errors="surrogatepass"): function text_from_bits (line 61) | def text_from_bits(bits, encoding="utf-8", errors="surrogatepass"): function emitter_converter (line 71) | def emitter_converter(size_par, data): function receptor_converter (line 150) | def receptor_converter(size_par, data): FILE: hashes/luhn.py function is_luhn (line 6) | def is_luhn(string: str) -> bool: FILE: hashes/md5.py function to_little_endian (line 18) | def to_little_endian(string_32: bytes) -> bytes: function reformat_hex (line 46) | def reformat_hex(i: int) -> bytes: function preprocess (line 90) | def preprocess(message: bytes) -> bytes: function get_block_words (line 134) | def get_block_words(bit_string: bytes) -> Generator[list[int]]: function not_32 (line 190) | def not_32(i: int) -> int: function sum_32 (line 228) | def sum_32(a: int, b: int) -> int: function left_rotate_32 (line 253) | def left_rotate_32(i: int, shift: int) -> int: function md5_me (line 297) | def md5_me(message: bytes) -> bytes: FILE: hashes/sdbm.py function sdbm (line 22) | def sdbm(plain_text: str) -> int: FILE: hashes/sha1.py class SHA1Hash (line 34) | class SHA1Hash: method __init__ (line 41) | def __init__(self, data): method rotate (line 53) | def rotate(n, b): method padding (line 61) | def padding(self): method split_blocks (line 69) | def split_blocks(self): method expand_block (line 78) | def expand_block(self, block): method final_hash (line 88) | def final_hash(self): function test_sha1_hash (line 133) | def test_sha1_hash(): function main (line 138) | def main(): FILE: hashes/sha256.py class SHA256 (line 23) | class SHA256: method __init__ (line 34) | def __init__(self, data: bytes) -> None: method preprocessing (line 121) | def preprocessing(data: bytes) -> bytes: method final_hash (line 126) | def final_hash(self) -> None: method ror (line 190) | def ror(self, value: int, rotations: int) -> int: class SHA256HashTest (line 197) | class SHA256HashTest(unittest.TestCase): method test_match_hashes (line 202) | def test_match_hashes(self) -> None: function main (line 209) | def main() -> None: FILE: knapsack/greedy_knapsack.py function calc_profit (line 20) | def calc_profit(profit: list, weight: list, max_weight: int) -> int: FILE: knapsack/knapsack.py function knapsack (line 10) | def knapsack( FILE: knapsack/recursive_approach_knapsack.py function knapsack (line 20) | def knapsack( FILE: knapsack/tests/test_greedy_knapsack.py class TestClass (line 8) | class TestClass(unittest.TestCase): method test_sorted (line 13) | def test_sorted(self): method test_negative_max_weight (line 23) | def test_negative_max_weight(self): method test_negative_profit_value (line 33) | def test_negative_profit_value(self): method test_negative_weight_value (line 43) | def test_negative_weight_value(self): method test_null_max_weight (line 53) | def test_null_max_weight(self): method test_unequal_list_length (line 63) | def test_unequal_list_length(self): FILE: knapsack/tests/test_knapsack.py class Test (line 15) | class Test(unittest.TestCase): method test_base_case (line 16) | def test_base_case(self): method test_easy_case (line 31) | def test_easy_case(self): method test_knapsack (line 41) | def test_knapsack(self): method test_knapsack_repetition (line 51) | def test_knapsack_repetition(self): FILE: linear_algebra/gaussian_elimination.py function retroactive_resolution (line 11) | def retroactive_resolution( function gaussian_elimination (line 46) | def gaussian_elimination( FILE: linear_algebra/jacobi_iteration_method.py function jacobi_iteration_method (line 13) | def jacobi_iteration_method( function strictly_diagonally_dominant (line 169) | def strictly_diagonally_dominant(table: NDArray[float64]) -> bool: FILE: linear_algebra/lu_decomposition.py function lower_upper_decomposition (line 25) | def lower_upper_decomposition(table: np.ndarray) -> tuple[np.ndarray, np... FILE: linear_algebra/matrix_inversion.py function invert_matrix (line 4) | def invert_matrix(matrix: list[list[float]]) -> list[list[float]]: FILE: linear_algebra/src/conjugate_gradient.py function _is_matrix_spd (line 12) | def _is_matrix_spd(matrix: np.ndarray) -> bool: function _create_spd_matrix (line 48) | def _create_spd_matrix(dimension: int) -> Any: function conjugate_gradient (line 71) | def conjugate_gradient( function test_conjugate_gradient (line 154) | def test_conjugate_gradient() -> None: FILE: linear_algebra/src/gaussian_elimination_pivoting.py function solve_linear_system (line 4) | def solve_linear_system(matrix: np.ndarray) -> np.ndarray: FILE: linear_algebra/src/lib.py class Vector (line 30) | class Vector: method __init__ (line 51) | def __init__(self, components: Collection[float] | None = None) -> None: method __len__ (line 60) | def __len__(self) -> int: method __str__ (line 66) | def __str__(self) -> str: method __add__ (line 72) | def __add__(self, other: Vector) -> Vector: method __sub__ (line 85) | def __sub__(self, other: Vector) -> Vector: method __eq__ (line 98) | def __eq__(self, other: object) -> bool: method __mul__ (line 109) | def __mul__(self, other: float) -> Vector: ... method __mul__ (line 112) | def __mul__(self, other: Vector) -> float: ... method __mul__ (line 114) | def __mul__(self, other: float | Vector) -> float | Vector: method copy (line 129) | def copy(self) -> Vector: method component (line 135) | def component(self, i: int) -> float: method change_component (line 145) | def change_component(self, pos: int, value: float) -> None: method euclidean_length (line 155) | def euclidean_length(self) -> float: method angle (line 175) | def angle(self, other: Vector, deg: bool = False) -> float: function zero_vector (line 196) | def zero_vector(dimension: int) -> Vector: function unit_basis_vector (line 205) | def unit_basis_vector(dimension: int, pos: int) -> Vector: function axpy (line 218) | def axpy(scalar: float, x: Vector, y: Vector) -> Vector: function random_vector (line 231) | def random_vector(n: int, a: int, b: int) -> Vector: class Matrix (line 243) | class Matrix: method __init__ (line 265) | def __init__(self, matrix: list[list[float]], w: int, h: int) -> None: method __str__ (line 273) | def __str__(self) -> str: method __add__ (line 287) | def __add__(self, other: Matrix) -> Matrix: method __sub__ (line 303) | def __sub__(self, other: Matrix) -> Matrix: method __mul__ (line 320) | def __mul__(self, other: float) -> Matrix: ... method __mul__ (line 323) | def __mul__(self, other: Vector) -> Vector: ... method __mul__ (line 325) | def __mul__(self, other: float | Vector) -> Vector | Matrix: method height (line 353) | def height(self) -> int: method width (line 359) | def width(self) -> int: method component (line 365) | def component(self, x: int, y: int) -> float: method change_component (line 374) | def change_component(self, x: int, y: int, value: float) -> None: method minor (line 383) | def minor(self, x: int, y: int) -> float: method cofactor (line 394) | def cofactor(self, x: int, y: int) -> float: method determinant (line 405) | def determinant(self) -> float: function square_zero_matrix (line 427) | def square_zero_matrix(n: int) -> Matrix: function random_matrix (line 435) | def random_matrix(width: int, height: int, a: int, b: int) -> Matrix: FILE: linear_algebra/src/polynom_for_points.py function points_to_polynomial (line 1) | def points_to_polynomial(coordinates: list[list[int]]) -> str: FILE: linear_algebra/src/power_iteration.py function power_iteration (line 4) | def power_iteration( function test_power_iteration (line 84) | def test_power_iteration() -> None: FILE: linear_algebra/src/rank_of_matrix.py function rank_of_matrix (line 8) | def rank_of_matrix(matrix: list[list[int | float]]) -> int: FILE: linear_algebra/src/rayleigh_quotient.py function is_hermitian (line 10) | def is_hermitian(matrix: np.ndarray) -> bool: function rayleigh_quotient (line 30) | def rayleigh_quotient(a: np.ndarray, v: np.ndarray) -> Any: function tests (line 54) | def tests() -> None: FILE: linear_algebra/src/schur_complement.py function schur_complement (line 7) | def schur_complement( class TestSchurComplement (line 61) | class TestSchurComplement(unittest.TestCase): method test_schur_complement (line 62) | def test_schur_complement(self) -> None: method test_improper_a_b_dimensions (line 77) | def test_improper_a_b_dimensions(self) -> None: method test_improper_b_c_dimensions (line 85) | def test_improper_b_c_dimensions(self) -> None: FILE: linear_algebra/src/test_linear_algebra.py class Test (line 24) | class Test(unittest.TestCase): method test_component (line 25) | def test_component(self) -> None: method test_str (line 34) | def test_str(self) -> None: method test_size (line 41) | def test_size(self) -> None: method test_euclidean_length (line 48) | def test_euclidean_length(self) -> None: method test_add (line 61) | def test_add(self) -> None: method test_sub (line 71) | def test_sub(self) -> None: method test_mul (line 81) | def test_mul(self) -> None: method test_zero_vector (line 91) | def test_zero_vector(self) -> None: method test_unit_basis_vector (line 97) | def test_unit_basis_vector(self) -> None: method test_axpy (line 103) | def test_axpy(self) -> None: method test_copy (line 111) | def test_copy(self) -> None: method test_change_component (line 119) | def test_change_component(self) -> None: method test_str_matrix (line 128) | def test_str_matrix(self) -> None: method test_minor (line 135) | def test_minor(self) -> None: method test_cofactor (line 145) | def test_cofactor(self) -> None: method test_determinant (line 155) | def test_determinant(self) -> None: method test__mul__matrix (line 162) | def test__mul__matrix(self) -> None: method test_change_component_matrix (line 171) | def test_change_component_matrix(self) -> None: method test_component_matrix (line 179) | def test_component_matrix(self) -> None: method test__add__matrix (line 186) | def test__add__matrix(self) -> None: method test__sub__matrix (line 194) | def test__sub__matrix(self) -> None: method test_square_zero_matrix (line 202) | def test_square_zero_matrix(self) -> None: FILE: linear_algebra/src/transformations_2d.py function scaling (line 20) | def scaling(scaling_factor: float) -> list[list[float]]: function rotation (line 29) | def rotation(angle: float) -> list[list[float]]: function projection (line 39) | def projection(angle: float) -> list[list[float]]: function reflection (line 50) | def reflection(angle: float) -> list[list[float]]: FILE: linear_programming/simplex.py class Tableau (line 21) | class Tableau: method __init__ (line 43) | def __init__( method generate_col_titles (line 86) | def generate_col_titles(self) -> list[str]: method find_pivot (line 108) | def find_pivot(self) -> tuple[Any, Any]: method pivot (line 149) | def pivot(self, row_idx: int, col_idx: int) -> np.ndarray: method change_stage (line 173) | def change_stage(self) -> np.ndarray: method run_simplex (line 210) | def run_simplex(self) -> dict[Any, Any]: method interpret_tableau (line 307) | def interpret_tableau(self) -> dict[str, float]: FILE: machine_learning/apriori_algorithm.py function load_data (line 18) | def load_data() -> list[list[str]]: function prune (line 28) | def prune(itemset: list, candidates: list, length: int) -> list: function apriori (line 65) | def apriori(data: list[list[str]], min_support: int) -> list[tuple[list[... FILE: machine_learning/astar.py class Cell (line 19) | class Cell: method __init__ (line 27) | def __init__(self): method __eq__ (line 39) | def __eq__(self, cell): method showcell (line 42) | def showcell(self): class Gridworld (line 46) | class Gridworld: method __init__ (line 53) | def __init__(self, world_size=(5, 5)): method show (line 58) | def show(self): method get_neighbours (line 61) | def get_neighbours(self, cell): function astar (line 89) | def astar(world, start, goal): FILE: machine_learning/automatic_differentiation.py class OpType (line 21) | class OpType(Enum): class Variable (line 35) | class Variable: method __init__ (line 51) | def __init__(self, value: Any) -> None: method __repr__ (line 59) | def __repr__(self) -> str: method to_ndarray (line 62) | def to_ndarray(self) -> np.ndarray: method __add__ (line 65) | def __add__(self, other: Variable) -> Variable: method __sub__ (line 74) | def __sub__(self, other: Variable) -> Variable: method __mul__ (line 83) | def __mul__(self, other: Variable) -> Variable: method __truediv__ (line 92) | def __truediv__(self, other: Variable) -> Variable: method __matmul__ (line 101) | def __matmul__(self, other: Variable) -> Variable: method __pow__ (line 110) | def __pow__(self, power: int) -> Variable: method add_param_to (line 124) | def add_param_to(self, param_to: Operation) -> None: method add_result_of (line 127) | def add_result_of(self, result_of: Operation) -> None: class Operation (line 131) | class Operation: method __init__ (line 138) | def __init__( method add_params (line 146) | def add_params(self, params: list[Variable]) -> None: method add_output (line 149) | def add_output(self, output: Variable) -> None: method __eq__ (line 152) | def __eq__(self, value) -> bool: class GradientTracker (line 156) | class GradientTracker: method __new__ (line 196) | def __new__(cls) -> Self: method __init__ (line 206) | def __init__(self) -> None: method __enter__ (line 209) | def __enter__(self) -> Self: method __exit__ (line 213) | def __exit__( method append (line 221) | def append( method gradient (line 247) | def gradient(self, target: Variable, source: Variable) -> np.ndarray |... method derivative (line 281) | def derivative(self, param: Variable, operation: Operation) -> np.ndar... FILE: machine_learning/data_transformations.py function normalization (line 32) | def normalization(data: list, ndigits: int = 3) -> list: function standardization (line 51) | def standardization(data: list, ndigits: int = 3) -> list: FILE: machine_learning/decision_tree.py class DecisionTree (line 10) | class DecisionTree: method __init__ (line 11) | def __init__(self, depth=5, min_leaf_size=5): method mean_squared_error (line 19) | def mean_squared_error(self, labels, prediction): method train (line 45) | def train(self, x, y): method predict (line 140) | def predict(self, x): class TestDecisionTree (line 158) | class TestDecisionTree: method helper_mean_squared_error_test (line 162) | def helper_mean_squared_error_test(labels, prediction): function main (line 176) | def main(): FILE: machine_learning/dimensionality_reduction.py function column_reshape (line 20) | def column_reshape(input_array: np.ndarray) -> np.ndarray: function covariance_within_classes (line 32) | def covariance_within_classes( function covariance_between_classes (line 60) | def covariance_between_classes( function principal_component_analysis (line 94) | def principal_component_analysis(features: np.ndarray, dimensions: int) ... function linear_discriminant_analysis (line 126) | def linear_discriminant_analysis( function test_linear_discriminant_analysis (line 164) | def test_linear_discriminant_analysis() -> None: function test_principal_component_analysis (line 183) | def test_principal_component_analysis() -> None: FILE: machine_learning/forecasting/run.py function linear_regression_prediction (line 23) | def linear_regression_prediction( function sarimax_predictor (line 40) | def sarimax_predictor(train_user: list, train_match: list, test_match: l... function support_vector_regressor (line 62) | def support_vector_regressor(x_train: list, x_test: list, train_user: li... function interquartile_range_checker (line 81) | def interquartile_range_checker(train_user: list) -> float: function data_safety_checker (line 98) | def data_safety_checker(list_vote: list, actual_result: float) -> bool: FILE: machine_learning/frequent_pattern_growth.py class TreeNode (line 19) | class TreeNode: method __repr__ (line 43) | def __repr__(self) -> str: method inc (line 46) | def inc(self, num_occur: int) -> None: method disp (line 49) | def disp(self, ind: int = 1) -> None: function create_tree (line 55) | def create_tree(data_set: list, min_sup: int = 1) -> tuple[TreeNode, dict]: function update_tree (line 128) | def update_tree(items: list, in_tree: TreeNode, header_table: dict, coun... function update_header (line 173) | def update_header(node_to_test: TreeNode, target_node: TreeNode) -> Tree... function ascend_tree (line 213) | def ascend_tree(leaf_node: TreeNode, prefix_path: list[str]) -> None: function find_prefix_path (line 243) | def find_prefix_path(base_pat: frozenset, tree_node: TreeNode | None) ->... function mine_tree (line 279) | def mine_tree( FILE: machine_learning/gradient_boosting_classifier.py class GradientBoostingClassifier (line 8) | class GradientBoostingClassifier: method __init__ (line 9) | def __init__(self, n_estimators: int = 100, learning_rate: float = 0.1... method fit (line 26) | def fit(self, features: np.ndarray, target: np.ndarray) -> None: method predict (line 56) | def predict(self, features: np.ndarray) -> np.ndarray: method gradient (line 83) | def gradient(self, target: np.ndarray, y_pred: np.ndarray) -> np.ndarray: FILE: machine_learning/gradient_descent.py function _error (line 22) | def _error(example_no, data_set="train"): function _hypothesis_value (line 33) | def _hypothesis_value(data_input_tuple): function output (line 49) | def output(example_no, data_set): function calculate_hypothesis_value (line 62) | def calculate_hypothesis_value(example_no, data_set): function summation_of_cost_derivative (line 76) | def summation_of_cost_derivative(index, end=m): function get_cost_derivative (line 94) | def get_cost_derivative(index): function run_gradient_descent (line 105) | def run_gradient_descent(): function test_gradient_descent (line 130) | def test_gradient_descent(): FILE: machine_learning/k_means_clust.py function get_initial_centroids (line 62) | def get_initial_centroids(data, k, seed=None): function centroid_pairwise_dist (line 79) | def centroid_pairwise_dist(x, centroids): function assign_clusters (line 83) | def assign_clusters(data, centroids): function revise_centroids (line 95) | def revise_centroids(data, k, cluster_assignment): function compute_heterogeneity (line 108) | def compute_heterogeneity(data, k, centroids, cluster_assignment): function plot_heterogeneity (line 125) | def plot_heterogeneity(heterogeneity, k): function plot_kmeans (line 135) | def plot_kmeans(data, centroids, cluster_assignment): function kmeans (line 148) | def kmeans( function report_generator (line 218) | def report_generator( FILE: machine_learning/k_nearest_neighbours.py class KNN (line 23) | class KNN: method __init__ (line 24) | def __init__( method _euclidean_distance (line 37) | def _euclidean_distance(a: np.ndarray[float], b: np.ndarray[float]) ->... method classify (line 47) | def classify(self, pred_point: np.ndarray[float], k: int = 5) -> str: FILE: machine_learning/linear_discriminant_analysis.py function gaussian_distribution (line 53) | def gaussian_distribution(mean: float, std_dev: float, instance_count: i... function y_generator (line 74) | def y_generator(class_count: int, instance_count: list) -> list: function calculate_mean (line 94) | def calculate_mean(instance_count: int, items: list) -> float: function calculate_probabilities (line 110) | def calculate_probabilities(instance_count: int, total_count: int) -> fl... function calculate_variance (line 127) | def calculate_variance(items: list, means: list, total_count: int) -> fl... function predict_y_values (line 156) | def predict_y_values( function accuracy (line 220) | def accuracy(actual_y: list, predicted_y: list) -> float: function valid_input (line 251) | def valid_input[num]( function main (line 283) | def main(): FILE: machine_learning/linear_regression.py function collect_dataset (line 23) | def collect_dataset(): function run_steep_gradient_descent (line 43) | def run_steep_gradient_descent(data_x, data_y, len_data, alpha, theta): function sum_of_square_error (line 70) | def sum_of_square_error(data_x, data_y, len_data, theta): function run_linear_regression (line 91) | def run_linear_regression(data_x, data_y): function mean_absolute_error (line 113) | def mean_absolute_error(predicted_y, original_y): function main (line 128) | def main(): FILE: machine_learning/local_weighted_learning/local_weighted_learning.py function weight_matrix (line 38) | def weight_matrix(point: np.ndarray, x_train: np.ndarray, tau: float) ->... function local_weight (line 70) | def local_weight( function local_weight_regression (line 102) | def local_weight_regression( function load_data (line 130) | def load_data( function plot_preds (line 151) | def plot_preds( FILE: machine_learning/logistic_regression.py function sigmoid_function (line 31) | def sigmoid_function(z: float | np.ndarray) -> float | np.ndarray: function cost_function (line 66) | def cost_function(h: np.ndarray, y: np.ndarray) -> float: function log_likelihood (line 106) | def log_likelihood(x, y, weights): function logistic_reg (line 112) | def logistic_reg(alpha, x, y, max_iterations=70000): function predict_prob (line 143) | def predict_prob(x): FILE: machine_learning/loss_functions.py function binary_cross_entropy (line 4) | def binary_cross_entropy( function binary_focal_cross_entropy (line 42) | def binary_focal_cross_entropy( function categorical_cross_entropy (line 93) | def categorical_cross_entropy( function categorical_focal_cross_entropy (line 151) | def categorical_focal_cross_entropy( function hinge_loss (line 253) | def hinge_loss(y_true: np.ndarray, y_pred: np.ndarray) -> float: function huber_loss (line 293) | def huber_loss(y_true: np.ndarray, y_pred: np.ndarray, delta: float) -> ... function mean_squared_error (line 333) | def mean_squared_error(y_true: np.ndarray, y_pred: np.ndarray) -> float: function mean_absolute_error (line 366) | def mean_absolute_error(y_true: np.ndarray, y_pred: np.ndarray) -> float: function mean_squared_logarithmic_error (line 403) | def mean_squared_logarithmic_error(y_true: np.ndarray, y_pred: np.ndarra... function mean_absolute_percentage_error (line 439) | def mean_absolute_percentage_error( function perplexity_loss (line 484) | def perplexity_loss( function smooth_l1_loss (line 576) | def smooth_l1_loss(y_true: np.ndarray, y_pred: np.ndarray, beta: float =... function kullback_leibler_divergence (line 632) | def kullback_leibler_divergence(y_true: np.ndarray, y_pred: np.ndarray) ... FILE: machine_learning/mfcc.py function mfcc (line 69) | def mfcc( function normalize (line 152) | def normalize(audio: np.ndarray) -> np.ndarray: function audio_frames (line 174) | def audio_frames( function calculate_fft (line 218) | def calculate_fft(audio_windowed: np.ndarray, ftt_size: int = 1024) -> n... function calculate_signal_power (line 254) | def calculate_signal_power(audio_fft: np.ndarray) -> np.ndarray: function freq_to_mel (line 274) | def freq_to_mel(freq: float) -> float: function mel_to_freq (line 292) | def mel_to_freq(mels: float) -> float: function mel_spaced_filterbank (line 310) | def mel_spaced_filterbank( function get_filters (line 351) | def get_filters(filter_points: np.ndarray, ftt_size: int) -> np.ndarray: function get_filter_points (line 383) | def get_filter_points( function discrete_cosine_transform (line 430) | def discrete_cosine_transform(dct_filter_num: int, filter_num: int) -> n... function example (line 456) | def example(wav_file_path: str = "./path-to-file/sample.wav") -> np.ndar... FILE: machine_learning/multilayer_perceptron_classifier.py function wrapper (line 18) | def wrapper(y): FILE: machine_learning/polynomial_regression.py class PolynomialRegression (line 41) | class PolynomialRegression: method __init__ (line 44) | def __init__(self, degree: int) -> None: method _design_matrix (line 55) | def _design_matrix(data: np.ndarray, degree: int) -> np.ndarray: method fit (line 102) | def fit(self, x_train: np.ndarray, y_train: np.ndarray) -> None: method predict (line 152) | def predict(self, data: np.ndarray) -> np.ndarray: function main (line 183) | def main() -> None: FILE: machine_learning/principle_component_analysis.py function collect_dataset (line 20) | def collect_dataset() -> tuple[np.ndarray, np.ndarray]: function apply_pca (line 37) | def apply_pca(data_x: np.ndarray, n_components: int) -> tuple[np.ndarray... function main (line 64) | def main() -> None: FILE: machine_learning/scoring_functions.py function mae (line 19) | def mae(predict, actual): function mse (line 40) | def mse(predict, actual): function rmse (line 62) | def rmse(predict, actual): function rmsle (line 84) | def rmsle(predict, actual): function mbd (line 109) | def mbd(predict, actual): function manual_accuracy (line 138) | def manual_accuracy(predict, actual): FILE: machine_learning/self_organizing_map.py class SelfOrganizingMap (line 8) | class SelfOrganizingMap: method get_winner (line 9) | def get_winner(self, weights: list[list[float]], sample: list[int]) ->... method update (line 24) | def update( function main (line 39) | def main() -> None: FILE: machine_learning/sequential_minimum_optimization.py class SmoSVM (line 47) | class SmoSVM: method __init__ (line 48) | def __init__( method fit (line 78) | def fit(self): method predict (line 143) | def predict(self, test_samples, classify=True): method _check_obey_kkt (line 162) | def _check_obey_kkt(self, index): method _k (line 171) | def _k(self, i1, i2): method _e (line 180) | def _e(self, index): method _calculate_k_matrix (line 196) | def _calculate_k_matrix(self): method _predict (line 206) | def _predict(self, sample): method _choose_alphas (line 220) | def _choose_alphas(self): method _choose_a1 (line 226) | def _choose_a1(self): method _choose_a2 (line 263) | def _choose_a2(self, i1): method _get_new_alpha (line 302) | def _get_new_alpha(self, i1, i2, a1, a2, e1, e2, y1, y2): method _norm (line 376) | def _norm(self, data): method _is_unbound (line 385) | def _is_unbound(self, index): method _is_support (line 388) | def _is_support(self, index): method unbound (line 392) | def unbound(self): method support (line 396) | def support(self): method length (line 400) | def length(self): class Kernel (line 404) | class Kernel: method __init__ (line 405) | def __init__(self, kernel, degree=1.0, coef0=0.0, gamma=1.0): method _polynomial (line 413) | def _polynomial(self, v1, v2): method _linear (line 416) | def _linear(self, v1, v2): method _rbf (line 419) | def _rbf(self, v1, v2): method _check (line 422) | def _check(self): method _get_kernel (line 426) | def _get_kernel(self, kernel_name): method __call__ (line 430) | def __call__(self, v1, v2): method __repr__ (line 433) | def __repr__(self): function count_time (line 437) | def count_time(func): function test_cancer_data (line 450) | def test_cancer_data(): function test_demonstration (line 505) | def test_demonstration(): function test_linear_kernel (line 527) | def test_linear_kernel(ax, cost): function test_rbf_kernel (line 547) | def test_rbf_kernel(ax, cost): function plot_partition_boundary (line 567) | def plot_partition_boundary( FILE: machine_learning/similarity_search.py function euclidean (line 19) | def euclidean(input_a: np.ndarray, input_b: np.ndarray) -> float: function similarity_search (line 37) | def similarity_search( function cosine_similarity (line 143) | def cosine_similarity(input_a: np.ndarray, input_b: np.ndarray) -> float: FILE: machine_learning/support_vector_machines.py function norm_squared (line 6) | def norm_squared(vector: ndarray) -> float: class SVC (line 27) | class SVC: method __init__ (line 54) | def __init__( method __linear (line 81) | def __linear(self, vector1: ndarray, vector2: ndarray) -> float: method __rbf (line 85) | def __rbf(self, vector1: ndarray, vector2: ndarray) -> float: method fit (line 101) | def fit(self, observations: list[ndarray], classes: ndarray) -> None: method predict (line 170) | def predict(self, observation: ndarray) -> int: FILE: machine_learning/t_stochastic_neighbour_embedding.py function collect_dataset (line 15) | def collect_dataset() -> tuple[ndarray, ndarray]: function compute_pairwise_affinities (line 32) | def compute_pairwise_affinities(data_matrix: ndarray, sigma: float = 1.0... function compute_low_dim_affinities (line 61) | def compute_low_dim_affinities(embedding_matrix: ndarray) -> tuple[ndarr... function apply_tsne (line 90) | def apply_tsne( function main (line 149) | def main() -> None: FILE: machine_learning/word_frequency_functions.py function term_frequency (line 43) | def term_frequency(term: str, document: str) -> int: function document_frequency (line 64) | def document_frequency(term: str, corpus: str) -> tuple[int, int]: function inverse_document_frequency (line 86) | def inverse_document_frequency(df: int, n: int, smoothing=False) -> float: function tf_idf (line 123) | def tf_idf(tf: int, idf: int) -> float: FILE: machine_learning/xgboost_classifier.py function data_handling (line 10) | def data_handling(data: dict) -> tuple: function xgboost (line 24) | def xgboost(features: np.ndarray, target: np.ndarray) -> XGBClassifier: function main (line 43) | def main() -> None: FILE: machine_learning/xgboost_regressor.py function data_handling (line 9) | def data_handling(data: dict) -> tuple: function xgboost (line 20) | def xgboost( function main (line 40) | def main() -> None: FILE: maths/abs.py function abs_val (line 4) | def abs_val(num: float) -> float: function abs_min (line 18) | def abs_min(x: list[int]) -> int: function abs_max (line 38) | def abs_max(x: list[int]) -> int: function abs_max_sort (line 58) | def abs_max_sort(x: list[int]) -> int: function test_abs_val (line 74) | def test_abs_val(): FILE: maths/addition_without_arithmetic.py function add (line 9) | def add(first: int, second: int) -> int: FILE: maths/aliquot_sum.py function aliquot_sum (line 1) | def aliquot_sum(input_num: int) -> int: FILE: maths/allocation_number.py function allocation_num (line 12) | def allocation_num(number_of_bytes: int, partitions: int) -> list[str]: FILE: maths/arc_length.py function arc_length (line 4) | def arc_length(angle: int, radius: int) -> float: FILE: maths/area.py function surface_area_cube (line 9) | def surface_area_cube(side_length: float) -> float: function surface_area_cuboid (line 31) | def surface_area_cuboid(length: float, breadth: float, height: float) ->... function surface_area_sphere (line 59) | def surface_area_sphere(radius: float) -> float: function surface_area_hemisphere (line 83) | def surface_area_hemisphere(radius: float) -> float: function surface_area_cone (line 106) | def surface_area_cone(radius: float, height: float) -> float: function surface_area_conical_frustum (line 138) | def surface_area_conical_frustum( function surface_area_cylinder (line 173) | def surface_area_cylinder(radius: float, height: float) -> float: function surface_area_torus (line 205) | def surface_area_torus(torus_radius: float, tube_radius: float) -> float: function area_rectangle (line 239) | def area_rectangle(length: float, width: float) -> float: function area_square (line 267) | def area_square(side_length: float) -> float: function area_triangle (line 287) | def area_triangle(base: float, height: float) -> float: function area_triangle_three_sides (line 315) | def area_triangle_three_sides(side1: float, side2: float, side3: float) ... function area_parallelogram (line 363) | def area_parallelogram(base: float, height: float) -> float: function area_trapezium (line 391) | def area_trapezium(base1: float, base2: float, height: float) -> float: function area_circle (line 435) | def area_circle(radius: float) -> float: function area_ellipse (line 455) | def area_ellipse(radius_x: float, radius_y: float) -> float: function area_rhombus (line 485) | def area_rhombus(diagonal_1: float, diagonal_2: float) -> float: function area_reg_polygon (line 513) | def area_reg_polygon(sides: int, length: float) -> float: FILE: maths/area_under_curve.py function trapezoidal_area (line 10) | def trapezoidal_area( function f (line 53) | def f(x): FILE: maths/average_absolute_deviation.py function average_absolute_deviation (line 1) | def average_absolute_deviation(nums: list[int]) -> float: FILE: maths/average_mean.py function mean (line 4) | def mean(nums: list) -> float: FILE: maths/average_median.py function median (line 4) | def median(nums: list) -> int | float: function main (line 34) | def main(): FILE: maths/average_mode.py function mode (line 4) | def mode(input_list: list) -> list[Any]: FILE: maths/bailey_borwein_plouffe.py function bailey_borwein_plouffe (line 1) | def bailey_borwein_plouffe(digit_position: int, precision: int = 1000) -... function _subsum (line 58) | def _subsum( FILE: maths/base_neg2_conversion.py function decimal_to_negative_base_2 (line 1) | def decimal_to_negative_base_2(num: int) -> int: FILE: maths/basic_maths.py function prime_factors (line 6) | def prime_factors(n: int) -> list: function number_of_divisors (line 34) | def number_of_divisors(n: int) -> int: function sum_of_divisors (line 66) | def sum_of_divisors(n: int) -> int: function euler_phi (line 98) | def euler_phi(n: int) -> int: FILE: maths/binary_exponentiation.py function binary_exp_recursive (line 17) | def binary_exp_recursive(base: float, exponent: int) -> float: function binary_exp_iterative (line 53) | def binary_exp_iterative(base: float, exponent: int) -> float: function binary_exp_mod_recursive (line 90) | def binary_exp_mod_recursive(base: float, exponent: int, modulus: int) -... function binary_exp_mod_iterative (line 125) | def binary_exp_mod_iterative(base: float, exponent: int, modulus: int) -... FILE: maths/binary_multiplication.py function binary_multiply (line 23) | def binary_multiply(a: int, b: int) -> int: function binary_mod_multiply (line 61) | def binary_mod_multiply(a: int, b: int, modulus: int) -> int: FILE: maths/binomial_coefficient.py function binomial_coefficient (line 1) | def binomial_coefficient(n: int, r: int) -> int: FILE: maths/binomial_distribution.py function binomial_distribution (line 7) | def binomial_distribution(successes: int, trials: int, prob: float) -> f... FILE: maths/ceil.py function ceil (line 6) | def ceil(x: float) -> int: FILE: maths/chebyshev_distance.py function chebyshev_distance (line 1) | def chebyshev_distance(point_a: list[float], point_b: list[float]) -> fl... FILE: maths/check_polygon.py function check_polygon (line 4) | def check_polygon(nums: list[float]) -> bool: FILE: maths/chinese_remainder_theorem.py function extended_euclid (line 19) | def extended_euclid(a: int, b: int) -> tuple[int, int]: function chinese_remainder_theorem (line 36) | def chinese_remainder_theorem(n1: int, r1: int, n2: int, r2: int) -> int: function invert_modulo (line 59) | def invert_modulo(a: int, n: int) -> int: function chinese_remainder_theorem2 (line 75) | def chinese_remainder_theorem2(n1: int, r1: int, n2: int, r2: int) -> int: FILE: maths/chudnovsky_algorithm.py function pi (line 5) | def pi(precision: int) -> str: FILE: maths/collatz_sequence.py function collatz_sequence (line 20) | def collatz_sequence(n: int) -> Generator[int]: function main (line 59) | def main(): FILE: maths/combinations.py function combinations (line 6) | def combinations(n: int, k: int) -> int: FILE: maths/continued_fraction.py function continued_fraction (line 11) | def continued_fraction(num: Fraction) -> list[int]: FILE: maths/decimal_isolate.py function decimal_isolate (line 7) | def decimal_isolate(number: float, digit_amount: int) -> float: FILE: maths/decimal_to_fraction.py function decimal_to_fraction (line 1) | def decimal_to_fraction(decimal: float | str) -> tuple[int, int]: FILE: maths/dodecahedron.py function dodecahedron_surface_area (line 9) | def dodecahedron_surface_area(edge: float) -> float: function dodecahedron_volume (line 40) | def dodecahedron_volume(edge: float) -> float: FILE: maths/double_factorial.py function double_factorial_recursive (line 1) | def double_factorial_recursive(n: int) -> int: function double_factorial_iterative (line 28) | def double_factorial_iterative(num: int) -> int: FILE: maths/dual_number_automatic_differentiation.py class Dual (line 11) | class Dual: method __init__ (line 12) | def __init__(self, real, rank): method __repr__ (line 19) | def __repr__(self): method reduce (line 23) | def reduce(self): method __add__ (line 29) | def __add__(self, other): method __sub__ (line 45) | def __sub__(self, other): method __mul__ (line 48) | def __mul__(self, other): method __truediv__ (line 66) | def __truediv__(self, other): method __floordiv__ (line 74) | def __floordiv__(self, other): method __pow__ (line 82) | def __pow__(self, n): function differentiate (line 95) | def differentiate(func, position, order): function f (line 136) | def f(y): FILE: maths/entropy.py function calculate_prob (line 15) | def calculate_prob(text: str) -> None: function analyze_text (line 93) | def analyze_text(text: str) -> tuple[dict, dict]: function main (line 111) | def main(): FILE: maths/euclidean_distance.py function euclidean_distance (line 12) | def euclidean_distance(vector_1: Vector, vector_2: Vector) -> VectorOut: function euclidean_distance_no_np (line 28) | def euclidean_distance_no_np(vector_1: Vector, vector_2: Vector) -> Vect... function benchmark (line 42) | def benchmark() -> None: FILE: maths/euler_method.py function explicit_euler (line 6) | def explicit_euler( FILE: maths/euler_modified.py function euler_modified (line 6) | def euler_modified( FILE: maths/eulers_totient.py function totient (line 2) | def totient(n: int) -> list: FILE: maths/extended_euclidean_algorithm.py function extended_euclidean_algorithm (line 20) | def extended_euclidean_algorithm(a: int, b: int) -> tuple[int, int]: function main (line 74) | def main(): FILE: maths/factorial.py function factorial (line 6) | def factorial(number: int) -> int: function factorial_recursive (line 38) | def factorial_recursive(n: int) -> int: FILE: maths/factors.py function factors_of_a_number (line 5) | def factors_of_a_number(num: int) -> list: FILE: maths/fast_inverse_sqrt.py function fast_inverse_sqrt (line 10) | def fast_inverse_sqrt(number: float) -> float: FILE: maths/fermat_little_theorem.py function binary_exponentiation (line 8) | def binary_exponentiation(a: int, n: float, mod: int) -> int: FILE: maths/fibonacci.py function time_func (line 26) | def time_func(func, *args, **kwargs): function fib_iterative_yield (line 40) | def fib_iterative_yield(n: int) -> Iterator[int]: function fib_iterative (line 65) | def fib_iterative(n: int) -> list[int]: function fib_recursive (line 91) | def fib_recursive(n: int) -> list[int]: function fib_recursive_cached (line 135) | def fib_recursive_cached(n: int) -> list[int]: function fib_memoization (line 168) | def fib_memoization(n: int) -> list[int]: function fib_binet (line 201) | def fib_binet(n: int) -> list[int]: function matrix_pow_np (line 238) | def matrix_pow_np(m: ndarray, power: int) -> ndarray: function fib_matrix_np (line 282) | def fib_matrix_np(n: int) -> int: FILE: maths/find_max.py function find_max_iterative (line 4) | def find_max_iterative(nums: list[int | float]) -> int | float: function find_max_recursive (line 29) | def find_max_recursive(nums: list[int | float], left: int, right: int) -... FILE: maths/find_min.py function find_min_iterative (line 4) | def find_min_iterative(nums: list[int | float]) -> int | float: function find_min_recursive (line 32) | def find_min_recursive(nums: list[int | float], left: int, right: int) -... FILE: maths/floor.py function floor (line 6) | def floor(x: float) -> int: FILE: maths/gamma.py function gamma_iterative (line 18) | def gamma_iterative(num: float) -> float: function integrand (line 50) | def integrand(x: float, z: float) -> float: function gamma_recursive (line 54) | def gamma_recursive(num: float) -> float: FILE: maths/gaussian.py function gaussian (line 8) | def gaussian(x, mu: float = 0.0, sigma: float = 1.0) -> float: FILE: maths/gcd_of_n_numbers.py function get_factors (line 9) | def get_factors( function get_greatest_common_divisor (line 63) | def get_greatest_common_divisor(*numbers: int) -> int: FILE: maths/geometric_mean.py function compute_geometric_mean (line 8) | def compute_geometric_mean(*args: int) -> float: FILE: maths/germain_primes.py function is_germain_prime (line 14) | def is_germain_prime(number: int) -> bool: function is_safe_prime (line 41) | def is_safe_prime(number: int) -> bool: FILE: maths/greatest_common_divisor.py function greatest_common_divisor (line 10) | def greatest_common_divisor(a: int, b: int) -> int: function gcd_by_iterative (line 39) | def gcd_by_iterative(x: int, y: int) -> int: function main (line 63) | def main(): FILE: maths/hardy_ramanujanalgo.py function exact_prime_factor_count (line 7) | def exact_prime_factor_count(n: int) -> int: FILE: maths/integer_square_root.py function integer_square_root (line 16) | def integer_square_root(num: int) -> int: FILE: maths/interquartile_range.py function find_median (line 14) | def find_median(nums: list[int | float]) -> float: function interquartile_range (line 34) | def interquartile_range(nums: list[int | float]) -> float: FILE: maths/is_int_palindrome.py function is_int_palindrome (line 1) | def is_int_palindrome(num: int) -> bool: FILE: maths/is_ip_v4_address_valid.py function is_ip_v4_address_valid (line 12) | def is_ip_v4_address_valid(ip: str) -> bool: FILE: maths/is_square_free.py function is_square_free (line 10) | def is_square_free(factors: list[int]) -> bool: FILE: maths/jaccard_similarity.py function jaccard_similarity (line 17) | def jaccard_similarity( FILE: maths/joint_probability_distribution.py function joint_probability_distribution (line 7) | def joint_probability_distribution( function expectation (line 31) | def expectation(values: list, probabilities: list) -> float: function variance (line 41) | def variance(values: list[int], probabilities: list[float]) -> float: function covariance (line 52) | def covariance( function standard_deviation (line 72) | def standard_deviation(variance: float) -> float: FILE: maths/josephus_problem.py function josephus_recursive (line 18) | def josephus_recursive(num_people: int, step_size: int) -> int: function find_winner (line 80) | def find_winner(num_people: int, step_size: int) -> int: function josephus_iterative (line 100) | def josephus_iterative(num_people: int, step_size: int) -> int: FILE: maths/juggler_sequence.py function juggler_sequence (line 15) | def juggler_sequence(number: int) -> list[int]: FILE: maths/karatsuba.py function karatsuba (line 4) | def karatsuba(a: int, b: int) -> int: function main (line 27) | def main(): FILE: maths/kth_lexicographic_permutation.py function kth_permutation (line 1) | def kth_permutation(k, n): FILE: maths/largest_of_very_large_numbers.py function res (line 6) | def res(x, y): FILE: maths/least_common_multiple.py function least_common_multiple_slow (line 7) | def least_common_multiple_slow(first_num: int, second_num: int) -> int: function least_common_multiple_fast (line 25) | def least_common_multiple_fast(first_num: int, second_num: int) -> int: function benchmark (line 37) | def benchmark(): class TestLeastCommonMultiple (line 51) | class TestLeastCommonMultiple(unittest.TestCase): method test_lcm_function (line 65) | def test_lcm_function(self): FILE: maths/line_length.py function line_length (line 7) | def line_length( function f (line 57) | def f(x): FILE: maths/liouville_lambda.py function liouville_lambda (line 14) | def liouville_lambda(number: int) -> int: FILE: maths/lucas_lehmer_primality_test.py function lucas_lehmer_test (line 16) | def lucas_lehmer_test(p: int) -> bool: FILE: maths/lucas_series.py function recursive_lucas_number (line 6) | def recursive_lucas_number(n_th_number: int) -> int: function dynamic_lucas_number (line 34) | def dynamic_lucas_number(n_th_number: int) -> int: FILE: maths/maclaurin_series.py function maclaurin_sin (line 8) | def maclaurin_sin(theta: float, accuracy: int = 30) -> float: function maclaurin_cos (line 60) | def maclaurin_cos(theta: float, accuracy: int = 30) -> float: FILE: maths/manhattan_distance.py function manhattan_distance (line 1) | def manhattan_distance(point_a: list, point_b: list) -> float: function _validate_point (line 46) | def _validate_point(point: list[float]) -> None: function manhattan_distance_one_liner (line 81) | def manhattan_distance_one_liner(point_a: list, point_b: list) -> float: FILE: maths/matrix_exponentiation.py class Matrix (line 13) | class Matrix: method __init__ (line 14) | def __init__(self, arg: list[list] | int) -> None: method __mul__ (line 22) | def __mul__(self, b: Matrix) -> Matrix: function modular_exponentiation (line 31) | def modular_exponentiation(a: Matrix, b: int) -> Matrix: function fibonacci_with_matrix_exponentiation (line 41) | def fibonacci_with_matrix_exponentiation(n: int, f1: int, f2: int) -> int: function simple_fibonacci (line 67) | def simple_fibonacci(n: int, f1: int, f2: int) -> int: function matrix_exponentiation_time (line 98) | def matrix_exponentiation_time() -> float: function simple_fibonacci_time (line 109) | def simple_fibonacci_time() -> float: function main (line 122) | def main() -> None: FILE: maths/max_sum_sliding_window.py function max_sum_in_array (line 13) | def max_sum_in_array(array: list[int], k: int) -> int: FILE: maths/minkowski_distance.py function minkowski_distance (line 1) | def minkowski_distance( FILE: maths/mobius_function.py function mobius (line 12) | def mobius(n: int) -> int: FILE: maths/modular_division.py function modular_division (line 4) | def modular_division(a: int, b: int, n: int) -> int: function invert_modulo (line 43) | def invert_modulo(a: int, n: int) -> int: function modular_division2 (line 63) | def modular_division2(a: int, b: int, n: int) -> int: function extended_gcd (line 82) | def extended_gcd(a: int, b: int) -> tuple[int, int, int]: function extended_euclid (line 112) | def extended_euclid(a: int, b: int) -> tuple[int, int]: function greatest_common_divisor (line 129) | def greatest_common_divisor(a: int, b: int) -> int: FILE: maths/modular_exponential.py function modular_exponential (line 11) | def modular_exponential(base: int, power: int, mod: int): function main (line 35) | def main(): FILE: maths/monte_carlo.py function pi_estimator (line 11) | def pi_estimator(iterations: int) -> None: function area_under_curve_estimator (line 42) | def area_under_curve_estimator( function area_under_line_estimator_check (line 71) | def area_under_line_estimator_check( function pi_estimator_using_area_under_curve (line 103) | def pi_estimator_using_area_under_curve(iterations: int) -> None: FILE: maths/monte_carlo_dice.py class Dice (line 6) | class Dice: method __init__ (line 9) | def __init__(self): method roll (line 13) | def roll(self): function throw_dice (line 17) | def throw_dice(num_throws: int, num_dice: int = 2) -> list[float]: FILE: maths/number_of_digits.py function num_digits (line 5) | def num_digits(n: int) -> int: function num_digits_fast (line 38) | def num_digits_fast(n: int) -> int: function num_digits_faster (line 65) | def num_digits_faster(n: int) -> int: function benchmark (line 92) | def benchmark() -> None: FILE: maths/numerical_analysis/adams_bashforth.py class AdamsBashforth (line 15) | class AdamsBashforth: method __post_init__ (line 52) | def __post_init__(self) -> None: method step_2 (line 67) | def step_2(self) -> np.ndarray: method step_3 (line 100) | def step_3(self) -> np.ndarray: method step_4 (line 137) | def step_4(self) -> np.ndarray: method step_5 (line 181) | def step_5(self) -> np.ndarray: FILE: maths/numerical_analysis/bisection.py function bisection (line 4) | def bisection(function: Callable[[float], float], a: float, b: float) ->... function f (line 46) | def f(x: float) -> float: FILE: maths/numerical_analysis/bisection_2.py function equation (line 11) | def equation(x: float) -> float: function bisection (line 27) | def bisection(a: float, b: float) -> float: FILE: maths/numerical_analysis/integration_by_simpson_approx.py function f (line 21) | def f(x: float) -> float: function simpson_integration (line 37) | def simpson_integration(function, a: float, b: float, precision: int = 4... FILE: maths/numerical_analysis/intersection.py function intersection (line 5) | def intersection(function: Callable[[float], float], x0: float, x1: floa... function f (line 44) | def f(x: float) -> float: FILE: maths/numerical_analysis/nevilles_method.py function neville_interpolate (line 12) | def neville_interpolate(x_points: list, y_points: list, x0: int) -> list: FILE: maths/numerical_analysis/newton_forward_interpolation.py function ucal (line 8) | def ucal(u: float, p: int) -> float: function main (line 23) | def main() -> None: FILE: maths/numerical_analysis/newton_raphson.py function calc_derivative (line 18) | def calc_derivative(f: RealFunc, x: float, delta_x: float = 1e-3) -> float: function newton_raphson (line 35) | def newton_raphson( function func (line 107) | def func(x: float) -> float: FILE: maths/numerical_analysis/numerical_integration.py function trapezoidal_area (line 10) | def trapezoidal_area( function f (line 57) | def f(x): FILE: maths/numerical_analysis/proper_fractions.py function proper_fractions (line 4) | def proper_fractions(denominator: int) -> list[str]: FILE: maths/numerical_analysis/runge_kutta.py function runge_kutta (line 4) | def runge_kutta(f, y0, x0, h, x_end): FILE: maths/numerical_analysis/runge_kutta_fehlberg_45.py function runge_kutta_fehlberg_45 (line 10) | def runge_kutta_fehlberg_45( FILE: maths/numerical_analysis/runge_kutta_gills.py function runge_kutta_gills (line 14) | def runge_kutta_gills( FILE: maths/numerical_analysis/secant_method.py function f (line 9) | def f(x: float) -> float: function secant_method (line 17) | def secant_method(lower_bound: float, upper_bound: float, repeats: int) ... FILE: maths/numerical_analysis/simpson_rule.py function method_2 (line 12) | def method_2(boundary: list[int], steps: int) -> float: function make_points (line 61) | def make_points(a, b, h): function f (line 68) | def f(x): # enter your function here function main (line 73) | def main(): FILE: maths/numerical_analysis/square_root.py function fx (line 4) | def fx(x: float, a: float) -> float: function fx_derivative (line 8) | def fx_derivative(x: float) -> float: function get_initial_point (line 12) | def get_initial_point(a: float) -> float: function square_root_iterative (line 21) | def square_root_iterative( FILE: maths/numerical_analysis/weierstrass_method.py function weierstrass_method (line 6) | def weierstrass_method( FILE: maths/odd_sieve.py function odd_sieve (line 5) | def odd_sieve(num: int) -> list[int]: FILE: maths/perfect_cube.py function perfect_cube (line 1) | def perfect_cube(n: int) -> bool: function perfect_cube_binary_search (line 14) | def perfect_cube_binary_search(n: int) -> bool: FILE: maths/perfect_number.py function perfect (line 15) | def perfect(number: int) -> bool: FILE: maths/perfect_square.py function perfect_square (line 4) | def perfect_square(num: int) -> bool: function perfect_square_binary_search (line 24) | def perfect_square_binary_search(n: int) -> bool: FILE: maths/persistence.py function multiplicative_persistence (line 1) | def multiplicative_persistence(num: int) -> int: function additive_persistence (line 40) | def additive_persistence(num: int) -> int: FILE: maths/pi_generator.py function calculate_pi (line 1) | def calculate_pi(limit: int) -> str: function main (line 79) | def main() -> None: FILE: maths/pi_monte_carlo_estimation.py class Point (line 4) | class Point: method __init__ (line 5) | def __init__(self, x: float, y: float) -> None: method is_in_unit_circle (line 9) | def is_in_unit_circle(self) -> bool: method random_unit_square (line 17) | def random_unit_square(cls): function estimate_pi (line 24) | def estimate_pi(number_of_simulations: int) -> float: FILE: maths/points_are_collinear_3d.py function create_vector (line 35) | def create_vector(end_point1: Point3d, end_point2: Point3d) -> Vector3d: function get_3d_vectors_cross (line 52) | def get_3d_vectors_cross(ab: Vector3d, ac: Vector3d) -> Vector3d: function is_zero_vector (line 77) | def is_zero_vector(vector: Vector3d, accuracy: int) -> bool: function are_collinear (line 96) | def are_collinear(a: Point3d, b: Point3d, c: Point3d, accuracy: int = 10... FILE: maths/pollard_rho.py function pollard_rho (line 6) | def pollard_rho( FILE: maths/polynomial_evaluation.py function evaluate_poly (line 4) | def evaluate_poly(poly: Sequence[float], x: float) -> float: function horner (line 18) | def horner(poly: Sequence[float], x: float) -> float: FILE: maths/polynomials/single_indeterminate_operations.py class Polynomial (line 15) | class Polynomial: method __init__ (line 16) | def __init__(self, degree: int, coefficients: MutableSequence[float]) ... method __add__ (line 34) | def __add__(self, polynomial_2: Polynomial) -> Polynomial: method __sub__ (line 54) | def __sub__(self, polynomial_2: Polynomial) -> Polynomial: method __neg__ (line 64) | def __neg__(self) -> Polynomial: method __mul__ (line 73) | def __mul__(self, polynomial_2: Polynomial) -> Polynomial: method evaluate (line 90) | def evaluate(self, substitution: float) -> float: method __str__ (line 102) | def __str__(self) -> str: method __repr__ (line 127) | def __repr__(self) -> str: method derivative (line 135) | def derivative(self) -> Polynomial: method integral (line 147) | def integral(self, constant: float = 0) -> Polynomial: method __eq__ (line 160) | def __eq__(self, polynomial_2: object) -> bool: method __ne__ (line 180) | def __ne__(self, polynomial_2: object) -> bool: FILE: maths/power_using_recursion.py function power (line 16) | def power(base: int, exponent: int) -> float: FILE: maths/prime_check.py function is_prime (line 9) | def is_prime(number: int) -> bool: class Test (line 60) | class Test(unittest.TestCase): method test_primes (line 61) | def test_primes(self): method test_not_primes (line 73) | def test_not_primes(self): FILE: maths/prime_factors.py function prime_factors (line 8) | def prime_factors(n: int) -> list[int]: function unique_prime_factors (line 50) | def unique_prime_factors(n: int) -> list[int]: FILE: maths/prime_numbers.py function slow_primes (line 5) | def slow_primes(max_n: int) -> Generator[int]: function primes (line 32) | def primes(max_n: int) -> Generator[int]: function fast_primes (line 61) | def fast_primes(max_n: int) -> Generator[int]: function benchmark (line 93) | def benchmark(): FILE: maths/prime_sieve_eratosthenes.py function prime_sieve_eratosthenes (line 15) | def prime_sieve_eratosthenes(num: int) -> list[int]: FILE: maths/primelib.py function is_prime (line 45) | def is_prime(number: int) -> bool: function sieve_er (line 95) | def sieve_er(n): function get_prime_numbers (line 141) | def get_prime_numbers(n): function prime_factorization (line 179) | def prime_factorization(number): function greatest_prime_factor (line 235) | def greatest_prime_factor(number): function smallest_prime_factor (line 277) | def smallest_prime_factor(number): function is_even (line 319) | def is_even(number): function is_odd (line 348) | def is_odd(number): function goldbach (line 377) | def goldbach(number): function kg_v (line 447) | def kg_v(number1, number2): function get_prime (line 538) | def get_prime(n): function get_primes_between (line 587) | def get_primes_between(p_number_1, p_number_2): function get_divisors (line 651) | def get_divisors(n): function is_perfect_number (line 688) | def is_perfect_number(number): function simplify_fraction (line 728) | def simplify_fraction(numerator, denominator): function factorial (line 767) | def factorial(n): function fib (line 800) | def fib(n: int) -> int: FILE: maths/print_multiplication_table.py function multiplication_table (line 1) | def multiplication_table(number: int, number_of_terms: int) -> str: FILE: maths/pythagoras.py class Point (line 6) | class Point: method __init__ (line 7) | def __init__(self, x, y, z): method __repr__ (line 12) | def __repr__(self) -> str: function distance (line 16) | def distance(a: Point, b: Point) -> float: FILE: maths/qr_decomposition.py function qr_householder (line 4) | def qr_householder(a: np.ndarray): FILE: maths/quadratic_equations_complex_numbers.py function quadratic_roots (line 6) | def quadratic_roots(a: int, b: int, c: int) -> tuple[complex, complex]: function main (line 32) | def main(): FILE: maths/radians.py function radians (line 4) | def radians(degree: float) -> float: FILE: maths/radix2_fft.py class FFT (line 9) | class FFT: method __init__ (line 52) | def __init__(self, poly_a=None, poly_b=None): method __dft (line 82) | def __dft(self, which): method __multiply (line 110) | def __multiply(self): method __str__ (line 160) | def __str__(self): FILE: maths/remove_digit.py function remove_digit (line 1) | def remove_digit(num: int) -> int: FILE: maths/segmented_sieve.py function sieve (line 6) | def sieve(n: int) -> list[int]: FILE: maths/series/arithmetic.py function is_arithmetic_series (line 11) | def is_arithmetic_series(series: list) -> bool: function arithmetic_mean (line 42) | def arithmetic_mean(series: list) -> float: FILE: maths/series/geometric.py function is_geometric_series (line 10) | def is_geometric_series(series: list) -> bool: function geometric_mean (line 46) | def geometric_mean(series: list) -> float: FILE: maths/series/geometric_series.py function geometric_series (line 15) | def geometric_series( FILE: maths/series/harmonic.py function is_harmonic_series (line 10) | def is_harmonic_series(series: list) -> bool: function harmonic_mean (line 59) | def harmonic_mean(series: list) -> float: FILE: maths/series/harmonic_series.py function harmonic_series (line 15) | def harmonic_series(n_term: str) -> list: FILE: maths/series/hexagonal_numbers.py function hexagonal_numbers (line 18) | def hexagonal_numbers(length: int) -> list[int]: FILE: maths/series/p_series.py function p_series (line 15) | def p_series(nth_term: float | str, power: float | str) -> list[str]: FILE: maths/sieve_of_eratosthenes.py function prime_sieve (line 19) | def prime_sieve(num: int) -> list[int]: FILE: maths/sigmoid.py function sigmoid (line 14) | def sigmoid(vector: np.ndarray) -> np.ndarray: FILE: maths/signum.py function signum (line 6) | def signum(num: float) -> int: function test_signum (line 39) | def test_signum() -> None: FILE: maths/simultaneous_linear_equation_solver.py function simplify (line 12) | def simplify(current_set: list[list]) -> list[list]: function solve_simultaneous (line 57) | def solve_simultaneous(equations: list[list]) -> list: FILE: maths/sin.py function sin (line 17) | def sin( FILE: maths/sock_merchant.py function sock_merchant (line 4) | def sock_merchant(colors: list[int]) -> int: FILE: maths/softmax.py function softmax (line 16) | def softmax(vector): FILE: maths/solovay_strassen_primality_test.py function jacobi_symbol (line 15) | def jacobi_symbol(random_a: int, number: int) -> int: function solovay_strassen (line 64) | def solovay_strassen(number: int, iterations: int) -> bool: FILE: maths/spearman_rank_correlation_coefficient.py function assign_ranks (line 4) | def assign_ranks(data: Sequence[float]) -> list[int]: function calculate_spearman_rank_correlation (line 27) | def calculate_spearman_rank_correlation( FILE: maths/special_numbers/armstrong_numbers.py function armstrong_number (line 16) | def armstrong_number(n: int) -> bool: function pluperfect_number (line 43) | def pluperfect_number(n: int) -> bool: function narcissistic_number (line 70) | def narcissistic_number(n: int) -> bool: function main (line 85) | def main(): FILE: maths/special_numbers/automorphic_number.py function is_automorphic_number (line 14) | def is_automorphic_number(number: int) -> bool: FILE: maths/special_numbers/bell_numbers.py function bell_numbers (line 11) | def bell_numbers(max_set_length: int) -> list[int]: function _binomial_coefficient (line 48) | def _binomial_coefficient(total_elements: int, elements_to_choose: int) ... FILE: maths/special_numbers/carmichael_number.py function power (line 17) | def power(x: int, y: int, mod: int) -> int: function is_carmichael_number (line 35) | def is_carmichael_number(n: int) -> bool: FILE: maths/special_numbers/catalan_number.py function catalan (line 11) | def catalan(number: int) -> int: FILE: maths/special_numbers/hamming_numbers.py function hamming (line 8) | def hamming(n_element: int) -> list: FILE: maths/special_numbers/happy_number.py function is_happy_number (line 1) | def is_happy_number(number: int) -> bool: FILE: maths/special_numbers/harshad_numbers.py function int_to_base (line 8) | def int_to_base(number: int, base: int) -> str: function sum_of_digits (line 56) | def sum_of_digits(num: int, base: int) -> str: function harshad_numbers_in_base (line 89) | def harshad_numbers_in_base(limit: int, base: int) -> list[str]: function is_harshad_number_in_base (line 129) | def is_harshad_number_in_base(num: int, base: int) -> bool: FILE: maths/special_numbers/hexagonal_number.py function hexagonal (line 14) | def hexagonal(number: int) -> int: FILE: maths/special_numbers/krishnamurthy_number.py function factorial (line 13) | def factorial(digit: int) -> int: function krishnamurthy (line 26) | def krishnamurthy(number: int) -> bool: FILE: maths/special_numbers/perfect_number.py function perfect (line 15) | def perfect(number: int) -> bool: FILE: maths/special_numbers/polygonal_numbers.py function polygonal_num (line 1) | def polygonal_num(num: int, sides: int) -> int: FILE: maths/special_numbers/pronic_number.py function is_pronic (line 13) | def is_pronic(number: int) -> bool: FILE: maths/special_numbers/proth_number.py function proth (line 10) | def proth(number: int) -> int: function is_proth_number (line 62) | def is_proth_number(number: int) -> bool: FILE: maths/special_numbers/triangular_numbers.py function triangular_number (line 11) | def triangular_number(position: int) -> int: FILE: maths/special_numbers/ugly_numbers.py function ugly_numbers (line 12) | def ugly_numbers(n: int) -> int: FILE: maths/special_numbers/weird_number.py function factors (line 10) | def factors(number: int) -> list[int]: function abundant (line 32) | def abundant(n: int) -> bool: function semi_perfect (line 51) | def semi_perfect(number: int) -> bool: function weird (line 84) | def weird(number: int) -> bool: FILE: maths/sum_of_arithmetic_series.py function sum_of_series (line 2) | def sum_of_series(first_term: int, common_diff: int, num_of_terms: int) ... function main (line 16) | def main(): FILE: maths/sum_of_digits.py function sum_of_digits (line 1) | def sum_of_digits(n: int) -> int: function sum_of_digits_recursion (line 21) | def sum_of_digits_recursion(n: int) -> int: function sum_of_digits_compact (line 37) | def sum_of_digits_compact(n: int) -> int: function benchmark (line 52) | def benchmark() -> None: FILE: maths/sum_of_geometric_progression.py function sum_of_geometric_progression (line 1) | def sum_of_geometric_progression( FILE: maths/sum_of_harmonic_series.py function sum_of_harmonic_progression (line 1) | def sum_of_harmonic_progression( FILE: maths/sumset.py function sumset (line 11) | def sumset(set_a: set, set_b: set) -> set: FILE: maths/sylvester_sequence.py function sylvester (line 11) | def sylvester(number: int) -> int: FILE: maths/tanh.py function tangent_hyperbolic (line 16) | def tangent_hyperbolic(vector: np.ndarray) -> np.ndarray: FILE: maths/test_factorial.py function test_zero (line 14) | def test_zero(function): function test_positive_integers (line 19) | def test_positive_integers(function): function test_large_number (line 26) | def test_large_number(function): function test_negative_number (line 31) | def test_negative_number(function): function test_float_number (line 37) | def test_float_number(function): FILE: maths/three_sum.py function three_sum (line 6) | def three_sum(nums: list[int]) -> list[list[int]]: FILE: maths/trapezoidal_rule.py function trapezoidal_rule (line 6) | def trapezoidal_rule(boundary, steps): function make_points (line 36) | def make_points(a, b, h): function f (line 65) | def f(x): function main (line 82) | def main(): FILE: maths/triplet_sum.py function make_dataset (line 14) | def make_dataset() -> tuple[list[int], int]: function triplet_sum1 (line 23) | def triplet_sum1(arr: list[int], target: int) -> tuple[int, ...]: function triplet_sum2 (line 42) | def triplet_sum2(arr: list[int], target: int) -> tuple[int, int, int]: function solution_times (line 69) | def solution_times() -> tuple[float, float]: FILE: maths/twin_prime.py function twin_prime (line 14) | def twin_prime(number: int) -> int: FILE: maths/two_pointer.py function two_pointer (line 24) | def two_pointer(nums: list[int], target: int) -> list[int]: FILE: maths/two_sum.py function two_sum (line 18) | def two_sum(nums: list[int], target: int) -> list[int]: FILE: maths/volume.py function vol_cube (line 13) | def vol_cube(side_length: float) -> float: function vol_spherical_cap (line 35) | def vol_spherical_cap(height: float, radius: float) -> float: function vol_spheres_intersect (line 60) | def vol_spheres_intersect( function vol_spheres_union (line 124) | def vol_spheres_union( function vol_cuboid (line 173) | def vol_cuboid(width: float, height: float, length: float) -> float: function vol_cone (line 205) | def vol_cone(area_of_base: float, height: float) -> float: function vol_right_circ_cone (line 234) | def vol_right_circ_cone(radius: float, height: float) -> float: function vol_prism (line 261) | def vol_prism(area_of_base: float, height: float) -> float: function vol_pyramid (line 290) | def vol_pyramid(area_of_base: float, height: float) -> float: function vol_sphere (line 319) | def vol_sphere(radius: float) -> float: function vol_hemisphere (line 345) | def vol_hemisphere(radius: float) -> float: function vol_circular_cylinder (line 372) | def vol_circular_cylinder(radius: float, height: float) -> float: function vol_hollow_circular_cylinder (line 402) | def vol_hollow_circular_cylinder( function vol_conical_frustum (line 443) | def vol_conical_frustum(height: float, radius_1: float, radius_2: float)... function vol_torus (line 482) | def vol_torus(torus_radius: float, tube_radius: float) -> float: function vol_icosahedron (line 513) | def vol_icosahedron(tri_side: float) -> float: function main (line 543) | def main(): FILE: maths/zellers_congruence.py function zeller (line 5) | def zeller(date_input: str) -> str: FILE: matrix/binary_search_matrix.py function binary_search (line 1) | def binary_search(array: list, lower_bound: int, upper_bound: int, value... function mat_bin_search (line 25) | def mat_bin_search(value: int, matrix: list) -> list: FILE: matrix/count_islands_in_matrix.py class Matrix (line 6) | class Matrix: # Public class to implement a graph method __init__ (line 7) | def __init__(self, row: int, col: int, graph: list[list[bool]]) -> None: method is_safe (line 12) | def is_safe(self, i: int, j: int, visited: list[list[bool]]) -> bool: method diffs (line 20) | def diffs(self, i: int, j: int, visited: list[list[bool]]) -> None: method count_islands (line 29) | def count_islands(self) -> int: # And finally, count all islands. FILE: matrix/count_negative_numbers_in_sorted_matrix.py function generate_large_matrix (line 9) | def generate_large_matrix() -> list[list[int]]: function validate_grid (line 27) | def validate_grid(grid: list[list[int]]) -> None: function find_negative_index (line 37) | def find_negative_index(array: list[int]) -> int: function count_negatives_binary_search (line 85) | def count_negatives_binary_search(grid: list[list[int]]) -> int: function count_negatives_brute_force (line 102) | def count_negatives_brute_force(grid: list[list[int]]) -> int: function count_negatives_brute_force_with_break (line 112) | def count_negatives_brute_force_with_break(grid: list[list[int]]) -> int: function benchmark (line 129) | def benchmark() -> None: FILE: matrix/count_paths.py function depth_first_search (line 23) | def depth_first_search(grid: list[list[int]], row: int, col: int, visit:... FILE: matrix/cramers_rule_2x2.py function cramers_rule_2x2 (line 5) | def cramers_rule_2x2(equation1: list[int], equation2: list[int]) -> tupl... FILE: matrix/inverse_of_matrix.py function inverse_of_matrix (line 8) | def inverse_of_matrix(matrix: list[list[float]]) -> list[list[float]]: FILE: matrix/largest_square_area_in_matrix.py function largest_square_area_in_matrix_top_down_approch (line 46) | def largest_square_area_in_matrix_top_down_approch( function largest_square_area_in_matrix_top_down_approch_with_dp (line 82) | def largest_square_area_in_matrix_top_down_approch_with_dp( function largest_square_area_in_matrix_bottom_up (line 124) | def largest_square_area_in_matrix_bottom_up( function largest_square_area_in_matrix_bottom_up_space_optimization (line 153) | def largest_square_area_in_matrix_bottom_up_space_optimization( FILE: matrix/matrix_based_game.py function validate_matrix_size (line 53) | def validate_matrix_size(size: int) -> None: function validate_matrix_content (line 64) | def validate_matrix_content(matrix: list[str], size: int) -> None: function validate_moves (line 92) | def validate_moves(moves: list[tuple[int, int]], size: int) -> None: function parse_moves (line 105) | def parse_moves(input_str: str) -> list[tuple[int, int]]: function find_repeat (line 128) | def find_repeat( function increment_score (line 164) | def increment_score(count: int) -> int: function move_x (line 176) | def move_x(matrix_g: list[list[str]], column: int, size: int) -> list[li... function move_y (line 196) | def move_y(matrix_g: list[list[str]], size: int) -> list[list[str]]: function play (line 220) | def play( function process_game (line 243) | def process_game(size: int, matrix: list[str], moves: list[tuple[int, in... FILE: matrix/matrix_class.py class Matrix (line 6) | class Matrix: method __init__ (line 110) | def __init__(self, rows: list[list[int]]): method columns (line 131) | def columns(self) -> list[list[int]]: method num_rows (line 135) | def num_rows(self) -> int: method num_columns (line 139) | def num_columns(self) -> int: method order (line 143) | def order(self) -> tuple[int, int]: method is_square (line 147) | def is_square(self) -> bool: method identity (line 150) | def identity(self) -> Matrix: method determinant (line 157) | def determinant(self) -> int: method is_invertable (line 175) | def is_invertable(self) -> bool: method get_minor (line 178) | def get_minor(self, row: int, column: int) -> int: method get_cofactor (line 190) | def get_cofactor(self, row: int, column: int) -> int: method minors (line 195) | def minors(self) -> Matrix: method cofactors (line 203) | def cofactors(self) -> Matrix: method adjugate (line 216) | def adjugate(self) -> Matrix: method inverse (line 223) | def inverse(self) -> Matrix: method __repr__ (line 229) | def __repr__(self) -> str: method __str__ (line 232) | def __str__(self) -> str: method add_row (line 249) | def add_row(self, row: list[int], position: int | None = None) -> None: method add_column (line 265) | def add_column(self, column: list[int], position: int | None = None) -... method __eq__ (line 287) | def __eq__(self, other: object) -> bool: method __ne__ (line 292) | def __ne__(self, other: object) -> bool: method __neg__ (line 295) | def __neg__(self) -> Matrix: method __add__ (line 298) | def __add__(self, other: Matrix) -> Matrix: method __sub__ (line 308) | def __sub__(self, other: Matrix) -> Matrix: method __mul__ (line 318) | def __mul__(self, other: Matrix | float) -> Matrix: method __pow__ (line 340) | def __pow__(self, other: int) -> Matrix: method dot_product (line 359) | def dot_product(cls, row: list[int], column: list[int]) -> int: FILE: matrix/matrix_equalization.py function array_equalization (line 4) | def array_equalization(vector: list[int], step_size: int) -> int: FILE: matrix/matrix_multiplication_recursion.py function is_square (line 58) | def is_square(matrix: Matrix) -> bool: function matrix_multiply (line 71) | def matrix_multiply(matrix_a: Matrix, matrix_b: Matrix) -> Matrix: function matrix_multiply_recursive (line 82) | def matrix_multiply_recursive(matrix_a: Matrix, matrix_b: Matrix) -> Mat... FILE: matrix/matrix_operation.py function add (line 10) | def add(*matrix_s: list[list[int]]) -> list[list[int]]: function subtract (line 30) | def subtract(matrix_a: list[list[int]], matrix_b: list[list[int]]) -> li... function scalar_multiply (line 50) | def scalar_multiply(matrix: list[list[int]], n: float) -> list[list[floa... function multiply (line 60) | def multiply(matrix_a: list[list[int]], matrix_b: list[list[int]]) -> li... function identity (line 83) | def identity(n: int) -> list[list[int]]: function transpose (line 95) | def transpose( function minor (line 116) | def minor(matrix: list[list[int]], row: int, column: int) -> list[list[i... function determinant (line 125) | def determinant(matrix: list[list[int]]) -> Any: function inverse (line 141) | def inverse(matrix: list[list[int]]) -> list[list[float]] | None: function _check_not_integer (line 165) | def _check_not_integer(matrix: list[list[int]]) -> bool: function _shape (line 169) | def _shape(matrix: list[list[int]]) -> tuple[int, int]: function _verify_matrix_sizes (line 173) | def _verify_matrix_sizes( function main (line 186) | def main() -> None: FILE: matrix/max_area_of_island.py function is_safe (line 21) | def is_safe(row: int, col: int, rows: int, cols: int) -> bool: function depth_first_search (line 33) | def depth_first_search(row: int, col: int, seen: set, mat: list[list[int... function find_max_area (line 55) | def find_max_area(mat: list[list[int]]) -> int: FILE: matrix/median_matrix.py function median (line 6) | def median(matrix: list[list[int]]) -> int: FILE: matrix/nth_fibonacci_using_matrix_exponentiation.py function multiply (line 19) | def multiply(matrix_a: list[list[int]], matrix_b: list[list[int]]) -> li... function identity (line 33) | def identity(n: int) -> list[list[int]]: function nth_fibonacci_matrix (line 37) | def nth_fibonacci_matrix(n: int) -> int: function nth_fibonacci_bruteforce (line 57) | def nth_fibonacci_bruteforce(n: int) -> int: function main (line 73) | def main() -> None: FILE: matrix/pascal_triangle.py function print_pascal_triangle (line 11) | def print_pascal_triangle(num_rows: int) -> None: function generate_pascal_triangle (line 35) | def generate_pascal_triangle(num_rows: int) -> list[list[int]]: function populate_current_row (line 77) | def populate_current_row(triangle: list[list[int]], current_row_idx: int... function calculate_current_element (line 93) | def calculate_current_element( function generate_pascal_triangle_optimized (line 111) | def generate_pascal_triangle_optimized(num_rows: int) -> list[list[int]]: function benchmark (line 166) | def benchmark() -> None: FILE: matrix/rotate_matrix.py function make_matrix (line 11) | def make_matrix(row_size: int = 4) -> list[list[int]]: function rotate_90 (line 28) | def rotate_90(matrix: list[list[int]]) -> list[list[int]]: function rotate_180 (line 40) | def rotate_180(matrix: list[list[int]]) -> list[list[int]]: function rotate_270 (line 52) | def rotate_270(matrix: list[list[int]]) -> list[list[int]]: function transpose (line 64) | def transpose(matrix: list[list[int]]) -> list[list[int]]: function reverse_row (line 69) | def reverse_row(matrix: list[list[int]]) -> list[list[int]]: function reverse_column (line 74) | def reverse_column(matrix: list[list[int]]) -> list[list[int]]: function print_matrix (line 79) | def print_matrix(matrix: list[list[int]]) -> None: FILE: matrix/searching_in_sorted_matrix.py function search_in_a_sorted_matrix (line 4) | def search_in_a_sorted_matrix(mat: list[list[int]], m: int, n: int, key:... function main (line 31) | def main() -> None: FILE: matrix/sherman_morrison.py class Matrix (line 6) | class Matrix: method __init__ (line 12) | def __init__(self, row: int, column: int, default_value: float = 0) ->... method __str__ (line 27) | def __str__(self) -> str: method __repr__ (line 54) | def __repr__(self) -> str: method validate_indices (line 57) | def validate_indices(self, loc: tuple[int, int]) -> bool: method __getitem__ (line 75) | def __getitem__(self, loc: tuple[int, int]) -> Any: method __setitem__ (line 87) | def __setitem__(self, loc: tuple[int, int], value: float) -> None: method __add__ (line 102) | def __add__(self, another: Matrix) -> Matrix: method __neg__ (line 127) | def __neg__(self) -> Matrix: method __sub__ (line 146) | def __sub__(self, another: Matrix) -> Matrix: method __mul__ (line 149) | def __mul__(self, another: float | Matrix) -> Matrix: method transpose (line 180) | def transpose(self) -> Matrix: method sherman_morrison (line 203) | def sherman_morrison(self, u: Matrix, v: Matrix) -> Any: function test1 (line 245) | def test1() -> None: function test2 (line 262) | def test2() -> None: FILE: matrix/spiral_print.py function check_matrix (line 10) | def check_matrix(matrix: list[list[int]]) -> bool: function spiral_print_clockwise (line 30) | def spiral_print_clockwise(a: list[list[int]]) -> None: function spiral_traversal (line 82) | def spiral_traversal(matrix: list[list]) -> list[int]: FILE: matrix/tests/test_matrix_operation.py function test_addition (line 38) | def test_addition(mat1, mat2): function test_subtraction (line 58) | def test_subtraction(mat1, mat2): function test_multiplication (line 78) | def test_multiplication(mat1, mat2): function test_scalar_multiply (line 97) | def test_scalar_multiply(): function test_identity (line 104) | def test_identity(): function test_transpose (line 112) | def test_transpose(mat): FILE: matrix/validate_sudoku_board.py function is_valid_sudoku_board (line 28) | def is_valid_sudoku_board(sudoku_board: list[list[str]]) -> bool: FILE: networking_flow/ford_fulkerson.py function breadth_first_search (line 20) | def breadth_first_search(graph: list, source: int, sink: int, parents: l... function ford_fulkerson (line 58) | def ford_fulkerson(graph: list, source: int, sink: int) -> int: FILE: networking_flow/minimum_cut.py function bfs (line 13) | def bfs(graph, s, t, parent): function mincut (line 30) | def mincut(graph, source, sink): FILE: neural_network/activation_functions/binary_step.py function binary_step (line 14) | def binary_step(vector: np.ndarray) -> np.ndarray: FILE: neural_network/activation_functions/exponential_linear_unit.py function exponential_linear_unit (line 14) | def exponential_linear_unit(vector: np.ndarray, alpha: float) -> np.ndar... FILE: neural_network/activation_functions/gaussian_error_linear_unit.py function sigmoid (line 16) | def sigmoid(vector: np.ndarray) -> np.ndarray: function gaussian_error_linear_unit (line 28) | def gaussian_error_linear_unit(vector: np.ndarray) -> np.ndarray: FILE: neural_network/activation_functions/leaky_rectified_linear_unit.py function leaky_rectified_linear_unit (line 12) | def leaky_rectified_linear_unit(vector: np.ndarray, alpha: float) -> np.... FILE: neural_network/activation_functions/mish.py function mish (line 14) | def mish(vector: np.ndarray) -> np.ndarray: FILE: neural_network/activation_functions/rectified_linear_unit.py function relu (line 18) | def relu(vector: list[float]): FILE: neural_network/activation_functions/scaled_exponential_linear_unit.py function scaled_exponential_linear_unit (line 18) | def scaled_exponential_linear_unit( FILE: neural_network/activation_functions/soboleva_modified_hyperbolic_tangent.py function soboleva_modified_hyperbolic_tangent (line 14) | def soboleva_modified_hyperbolic_tangent( FILE: neural_network/activation_functions/softplus.py function softplus (line 12) | def softplus(vector: np.ndarray) -> np.ndarray: FILE: neural_network/activation_functions/squareplus.py function squareplus (line 12) | def squareplus(vector: np.ndarray, beta: float) -> np.ndarray: FILE: neural_network/activation_functions/swish.py function sigmoid (line 21) | def sigmoid(vector: np.ndarray) -> np.ndarray: function sigmoid_linear_unit (line 33) | def sigmoid_linear_unit(vector: np.ndarray) -> np.ndarray: function swish (line 53) | def swish(vector: np.ndarray, trainable_parameter: int) -> np.ndarray: FILE: neural_network/back_propagation_neural_network.py function sigmoid (line 25) | def sigmoid(x: np.ndarray) -> np.ndarray: class DenseLayer (line 29) | class DenseLayer: method __init__ (line 34) | def __init__( method initializer (line 53) | def initializer(self, back_units): method cal_gradient (line 60) | def cal_gradient(self): method forward_propagation (line 69) | def forward_propagation(self, xdata): method back_propagation (line 81) | def back_propagation(self, gradient): class BPNN (line 99) | class BPNN: method __init__ (line 104) | def __init__(self): method add_layer (line 110) | def add_layer(self, layer): method build (line 113) | def build(self): method summary (line 120) | def summary(self): method train (line 126) | def train(self, xdata, ydata, train_round, accuracy): method cal_loss (line 160) | def cal_loss(self, ydata, ydata_): method plot_loss (line 166) | def plot_loss(self): function example (line 177) | def example(): FILE: neural_network/convolution_neural_network.py class CNN (line 23) | class CNN: method __init__ (line 24) | def __init__( method save_model (line 55) | def save_model(self, save_path): method read_model (line 79) | def read_model(cls, model_path): method sig (line 103) | def sig(self, x): method do_round (line 106) | def do_round(self, x): method convolute (line 109) | def convolute(self, data, convs, w_convs, thre_convs, conv_step): method pooling (line 145) | def pooling(self, featuremaps, size_pooling, pooling_type="average_poo... method _expand (line 169) | def _expand(self, data): method _expand_mat (line 180) | def _expand_mat(self, data_mat): method _calculate_gradient_from_pool (line 187) | def _calculate_gradient_from_pool( method train (line 212) | def train( method predict (line 313) | def predict(self, datas_test): method convolution (line 339) | def convolution(self, data): FILE: neural_network/input_data.py class _Datasets (line 31) | class _Datasets(typing.NamedTuple): function _read32 (line 41) | def _read32(bytestream): function _extract_images (line 47) | def _extract_images(f): function _dense_to_one_hot (line 76) | def _dense_to_one_hot(labels_dense, num_classes): function _extract_labels (line 86) | def _extract_labels(f, one_hot=False, num_classes=10): class _DataSet (line 114) | class _DataSet: method __init__ (line 125) | def __init__( method images (line 185) | def images(self): method labels (line 189) | def labels(self): method num_examples (line 193) | def num_examples(self): method epochs_completed (line 197) | def epochs_completed(self): method next_batch (line 200) | def next_batch(self, batch_size, fake_data=False, shuffle=True): function _maybe_download (line 247) | def _maybe_download(filename, work_directory, source_url): function read_data_sets (line 270) | def read_data_sets( FILE: neural_network/simple_neural_network.py function sigmoid_function (line 11) | def sigmoid_function(value: float, deriv: bool = False) -> float: function forward_propagation (line 28) | def forward_propagation(expected: int, number_propagations: int) -> float: FILE: neural_network/two_hidden_layers_neural_network.py class TwoHiddenLayerNeuralNetwork (line 11) | class TwoHiddenLayerNeuralNetwork: method __init__ (line 12) | def __init__(self, input_array: np.ndarray, output_array: np.ndarray) ... method feedforward (line 53) | def feedforward(self) -> np.ndarray: method back_propagation (line 96) | def back_propagation(self) -> None: method train (line 157) | def train(self, output: np.ndarray, iterations: int, give_loss: bool) ... method predict (line 184) | def predict(self, input_arr: np.ndarray) -> int: function sigmoid (line 226) | def sigmoid(value: np.ndarray) -> np.ndarray: function sigmoid_derivative (line 239) | def sigmoid_derivative(value: np.ndarray) -> np.ndarray: function example (line 252) | def example() -> int: FILE: other/activity_selection.py function print_max_activities (line 11) | def print_max_activities(start: list[int], finish: list[int]) -> None: FILE: other/alternative_list_arrange.py function alternative_list_arrange (line 1) | def alternative_list_arrange(first_input_list: list, second_input_list: ... FILE: other/bankers_algorithm.py class BankersAlgorithm (line 40) | class BankersAlgorithm: method __init__ (line 41) | def __init__( method __processes_resource_summation (line 59) | def __processes_resource_summation(self) -> list[int]: method __available_resources (line 68) | def __available_resources(self) -> list[int]: method __need (line 76) | def __need(self) -> list[list[int]]: method __need_index_manager (line 86) | def __need_index_manager(self) -> dict[int, list[int]]: method main (line 103) | def main(self, **kwargs) -> None: method __pretty_data (line 197) | def __pretty_data(self): FILE: other/davis_putnam_logemann_loveland.py class Clause (line 18) | class Clause: method __init__ (line 34) | def __init__(self, literals: list[str]) -> None: method __str__ (line 41) | def __str__(self) -> str: method __len__ (line 50) | def __len__(self) -> int: method assign (line 61) | def assign(self, model: dict[str, bool | None]) -> None: method evaluate (line 76) | def evaluate(self, model: dict[str, bool | None]) -> bool | None: class Formula (line 99) | class Formula: method __init__ (line 107) | def __init__(self, clauses: Iterable[Clause]) -> None: method __str__ (line 113) | def __str__(self) -> str: function generate_clause (line 123) | def generate_clause() -> Clause: function generate_formula (line 146) | def generate_formula() -> Formula: function generate_parameters (line 157) | def generate_parameters(formula: Formula) -> tuple[list[Clause], list[st... function find_pure_symbols (line 184) | def find_pure_symbols( function find_unit_clauses (line 235) | def find_unit_clauses( function dpll_algorithm (line 285) | def dpll_algorithm( FILE: other/doomsday.py function get_week_day (line 17) | def get_week_day(year: int, month: int, day: int) -> str: FILE: other/fischer_yates_shuffle.py function fisher_yates_shuffle (line 13) | def fisher_yates_shuffle(data: list) -> list[Any]: FILE: other/gauss_easter.py function gauss_easter (line 9) | def gauss_easter(year: int) -> datetime: FILE: other/graham_scan.py class Direction (line 19) | class Direction(Enum): method __repr__ (line 24) | def __repr__(self): function angle_comparer (line 28) | def angle_comparer(point: tuple[int, int], minx: int, miny: int) -> float: function check_direction (line 51) | def check_direction( function graham_scan (line 93) | def graham_scan(points: list[tuple[int, int]]) -> list[tuple[int, int]]: FILE: other/greedy.py class Things (line 1) | class Things: method __init__ (line 2) | def __init__(self, name, value, weight): method __repr__ (line 7) | def __repr__(self): method get_value (line 10) | def get_value(self): method get_name (line 13) | def get_name(self): method get_weight (line 16) | def get_weight(self): method value_weight (line 19) | def value_weight(self): function build_menu (line 23) | def build_menu(name, value, weight): function greedy (line 30) | def greedy(item, max_cost, key_func): function test_greedy (line 42) | def test_greedy(): FILE: other/guess_the_number_search.py function temp_input_value (line 16) | def temp_input_value( function get_avg (line 58) | def get_avg(number_1: int, number_2: int) -> int: function guess_the_number (line 79) | def guess_the_number(lower: int, higher: int, to_guess: int) -> None: function main (line 154) | def main() -> None: FILE: other/h_index.py function h_index (line 28) | def h_index(citations: list[int]) -> int: FILE: other/least_recently_used.py class LRUCache (line 10) | class LRUCache[T]: method __init__ (line 37) | def __init__(self, n: int) -> None: method refer (line 50) | def refer(self, x: T) -> None: method display (line 66) | def display(self) -> None: method __repr__ (line 73) | def __repr__(self) -> str: FILE: other/lfu_cache.py class DoubleLinkedListNode (line 10) | class DoubleLinkedListNode[T, U]: method __init__ (line 19) | def __init__(self, key: T | None, val: U | None): method __repr__ (line 26) | def __repr__(self) -> str: class DoubleLinkedList (line 33) | class DoubleLinkedList[T, U]: method __init__ (line 100) | def __init__(self) -> None: method __repr__ (line 105) | def __repr__(self) -> str: method add (line 114) | def add(self, node: DoubleLinkedListNode[T, U]) -> None: method _position_node (line 131) | def _position_node(self, node: DoubleLinkedListNode[T, U]) -> None: method remove (line 145) | def remove( class LFUCache (line 164) | class LFUCache[T, U]: method __init__ (line 199) | def __init__(self, capacity: int): method __repr__ (line 207) | def __repr__(self) -> str: method __contains__ (line 218) | def __contains__(self, key: T) -> bool: method get (line 232) | def get(self, key: T) -> U | None: method put (line 251) | def put(self, key: T, value: U) -> None: method decorator (line 281) | def decorator( FILE: other/linear_congruential_generator.py class LinearCongruentialGenerator (line 6) | class LinearCongruentialGenerator: method __init__ (line 17) | def __init__(self, multiplier, increment, modulo, seed=int(time())): ... method next_number (line 29) | def next_number(self): FILE: other/lru_cache.py class DoubleLinkedListNode (line 10) | class DoubleLinkedListNode[T, U]: method __init__ (line 18) | def __init__(self, key: T | None, val: U | None): method __repr__ (line 24) | def __repr__(self) -> str: class DoubleLinkedList (line 31) | class DoubleLinkedList[T, U]: method __init__ (line 98) | def __init__(self) -> None: method __repr__ (line 103) | def __repr__(self) -> str: method add (line 112) | def add(self, node: DoubleLinkedListNode[T, U]) -> None: method remove (line 127) | def remove( class LRUCache (line 146) | class LRUCache[T, U]: method __init__ (line 212) | def __init__(self, capacity: int): method __repr__ (line 220) | def __repr__(self) -> str: method __contains__ (line 231) | def __contains__(self, key: T) -> bool: method get (line 246) | def get(self, key: T) -> U | None: method put (line 266) | def put(self, key: T, value: U) -> None: method decorator (line 298) | def decorator( FILE: other/magicdiamondpattern.py function floyd (line 5) | def floyd(n): function reverse_floyd (line 30) | def reverse_floyd(n): function pretty_print (line 55) | def pretty_print(n): FILE: other/majority_vote_algorithm.py function majority_vote (line 11) | def majority_vote(votes: list[int], votes_needed_to_win: int) -> list[int]: FILE: other/maximum_subsequence.py function max_subsequence_sum (line 4) | def max_subsequence_sum(nums: Sequence[int] | None = None) -> int: FILE: other/nested_brackets.py function is_balanced (line 17) | def is_balanced(s: str) -> bool: function main (line 64) | def main(): FILE: other/number_container_system.py class NumberContainer (line 12) | class NumberContainer: method __init__ (line 13) | def __init__(self) -> None: method binary_search_delete (line 20) | def binary_search_delete(self, array: list | str | range, item: int) -... method binary_search_insert (line 77) | def binary_search_insert(self, array: list | str | range, index: int) ... method change (line 125) | def change(self, index: int, number: int) -> None: method find (line 157) | def find(self, number: int) -> int: FILE: other/password.py function password_generator (line 6) | def password_generator(length: int = 8) -> str: function alternative_password_generator (line 28) | def alternative_password_generator(chars_incl: str, i: int) -> str: function random (line 50) | def random(chars_incl: str, i: int) -> str: function is_strong_password (line 54) | def is_strong_password(password: str, min_length: int = 8) -> bool: function main (line 83) | def main(): FILE: other/scoring_algorithm.py function get_data (line 27) | def get_data(source_data: list[list[float]]) -> list[list[float]]: function calculate_each_score (line 41) | def calculate_each_score( function generate_final_scores (line 80) | def generate_final_scores(score_lists: list[list[float]]) -> list[float]: function procentual_proximity (line 97) | def procentual_proximity( FILE: other/sdes.py function apply_table (line 1) | def apply_table(inp, table): function left_shift (line 14) | def left_shift(data): function xor (line 22) | def xor(a, b): function apply_sbox (line 36) | def apply_sbox(s, data): function function (line 42) | def function(expansion, s0, s1, key, message): FILE: other/sliding_window_maximum.py function sliding_window_maximum (line 4) | def sliding_window_maximum(numbers: list[int], window_size: int) -> list... FILE: other/tower_of_hanoi.py function move_tower (line 1) | def move_tower(height, from_pole, to_pole, with_pole): function move_disk (line 18) | def move_disk(fp, tp): function main (line 22) | def main(): FILE: other/word_search.py class WordSearch (line 20) | class WordSearch: method __init__ (line 28) | def __init__(self, words: list[str], width: int, height: int) -> None: method insert_north (line 36) | def insert_north(self, word: str, rows: list[int], cols: list[int]) ->... method insert_northeast (line 68) | def insert_northeast(self, word: str, rows: list[int], cols: list[int]... method insert_east (line 106) | def insert_east(self, word: str, rows: list[int], cols: list[int]) -> ... method insert_southeast (line 138) | def insert_southeast(self, word: str, rows: list[int], cols: list[int]... method insert_south (line 176) | def insert_south(self, word: str, rows: list[int], cols: list[int]) ->... method insert_southwest (line 208) | def insert_southwest(self, word: str, rows: list[int], cols: list[int]... method insert_west (line 246) | def insert_west(self, word: str, rows: list[int], cols: list[int]) -> ... method insert_northwest (line 278) | def insert_northwest(self, word: str, rows: list[int], cols: list[int]... method generate_board (line 316) | def generate_board(self) -> None: function visualise_word_search (line 347) | def visualise_word_search( FILE: physics/altitude_pressure.py function get_altitude_at_pressure (line 11) | def get_altitude_at_pressure(pressure: float) -> float: FILE: physics/archimedes_principle_of_buoyant_force.py function archimedes_principle (line 15) | def archimedes_principle( FILE: physics/basic_orbital_capture.py function capture_radii (line 20) | def capture_radii( function capture_area (line 66) | def capture_area(capture_radius: float) -> float: FILE: physics/casimir_effect.py function casimir_force (line 49) | def casimir_force(force: float, area: float, distance: float) -> dict[st... FILE: physics/center_of_mass.py function center_of_mass (line 34) | def center_of_mass(particles: list[Particle]) -> Coord3D: FILE: physics/centripetal_force.py function centripetal (line 24) | def centripetal(mass: float, velocity: float, radius: float) -> float: FILE: physics/coulombs_law.py function coulombs_law (line 18) | def coulombs_law(q1: float, q2: float, radius: float) -> float: FILE: physics/doppler_frequency.py function doppler_effect (line 47) | def doppler_effect( FILE: physics/escape_velocity.py function escape_velocity (line 4) | def escape_velocity(mass: float, radius: float) -> float: FILE: physics/grahams_law.py function validate (line 20) | def validate(*values: float) -> bool: function effusion_ratio (line 42) | def effusion_ratio(molar_mass_1: float, molar_mass_2: float) -> float | ... function first_effusion_rate (line 67) | def first_effusion_rate( function second_effusion_rate (line 103) | def second_effusion_rate( function first_molar_mass (line 139) | def first_molar_mass( function second_molar_mass (line 175) | def second_molar_mass( FILE: physics/horizontal_projectile_motion.py function check_args (line 27) | def check_args(init_velocity: float, angle: float) -> None: function horizontal_distance (line 48) | def horizontal_distance(init_velocity: float, angle: float) -> float: function max_height (line 78) | def max_height(init_velocity: float, angle: float) -> float: function total_time (line 108) | def total_time(init_velocity: float, angle: float) -> float: function test_motion (line 138) | def test_motion() -> None: FILE: physics/hubble_parameter.py function hubble_parameter (line 30) | def hubble_parameter( FILE: physics/ideal_gas_law.py function pressure_of_gas_system (line 24) | def pressure_of_gas_system(moles: float, kelvin: float, volume: float) -... function volume_of_gas_system (line 40) | def volume_of_gas_system(moles: float, kelvin: float, pressure: float) -... function temperature_of_gas_system (line 56) | def temperature_of_gas_system(moles: float, volume: float, pressure: flo... function moles_of_gas_system (line 73) | def moles_of_gas_system(kelvin: float, volume: float, pressure: float) -... FILE: physics/in_static_equilibrium.py function polar_force (line 11) | def polar_force( function in_static_equilibrium (line 34) | def in_static_equilibrium( FILE: physics/kinetic_energy.py function kinetic_energy (line 21) | def kinetic_energy(mass: float, velocity: float) -> float: FILE: physics/lens_formulae.py function focal_length_of_lens (line 51) | def focal_length_of_lens( function object_distance (line 79) | def object_distance( function image_distance (line 108) | def image_distance( FILE: physics/lorentz_transformation_four_vector.py function beta (line 41) | def beta(velocity: float) -> float: function gamma (line 64) | def gamma(velocity: float) -> float: function transformation_matrix (line 89) | def transformation_matrix(velocity: float) -> np.ndarray: function transform (line 137) | def transform(velocity: float, event: np.ndarray | None = None) -> np.nd... FILE: physics/malus_law.py function malus_law (line 40) | def malus_law(initial_intensity: float, angle: float) -> float: FILE: physics/mass_energy_equivalence.py function energy_from_mass (line 24) | def energy_from_mass(mass: float) -> float: function mass_from_energy (line 49) | def mass_from_energy(energy: float) -> float: FILE: physics/mirror_formulae.py function focal_length (line 61) | def focal_length(distance_of_object: float, distance_of_image: float) ->... function object_distance (line 84) | def object_distance(focal_length: float, distance_of_image: float) -> fl... function image_distance (line 107) | def image_distance(focal_length: float, distance_of_object: float) -> fl... FILE: physics/n_body_simulation.py class Body (line 28) | class Body: method __init__ (line 29) | def __init__( method position (line 52) | def position(self) -> tuple[float, float]: method velocity (line 56) | def velocity(self) -> tuple[float, float]: method update_velocity (line 59) | def update_velocity( method update_position (line 86) | def update_position(self, delta_time: float) -> None: class BodySystem (line 112) | class BodySystem: method __init__ (line 121) | def __init__( method __len__ (line 133) | def __len__(self) -> int: method update_system (line 136) | def update_system(self, delta_time: float) -> None: function update_step (line 185) | def update_step( function plot (line 213) | def plot( function example_1 (line 253) | def example_1() -> BodySystem: function example_2 (line 277) | def example_2() -> BodySystem: function example_3 (line 303) | def example_3() -> BodySystem: FILE: physics/newtons_law_of_gravitation.py function gravitational_law (line 28) | def gravitational_law( FILE: physics/newtons_second_law_of_motion.py function newtons_second_law_of_motion (line 65) | def newtons_second_law_of_motion(mass: float, acceleration: float) -> fl... FILE: physics/orbital_transfer_work.py function orbital_transfer_work (line 1) | def orbital_transfer_work( FILE: physics/period_of_pendulum.py function period_of_pendulum (line 30) | def period_of_pendulum(length: float) -> float: FILE: physics/photoelectric_effect.py function maximum_kinetic_energy (line 27) | def maximum_kinetic_energy( FILE: physics/potential_energy.py function potential_energy (line 31) | def potential_energy(mass: float, height: float) -> float: FILE: physics/rainfall_intensity.py function rainfall_intensity (line 17) | def rainfall_intensity( FILE: physics/reynolds_number.py function reynolds_number (line 33) | def reynolds_number( FILE: physics/rms_speed_of_molecule.py function rms_speed_of_molecule (line 26) | def rms_speed_of_molecule(temperature: float, molar_mass: float) -> float: FILE: physics/shear_stress.py function shear_stress (line 12) | def shear_stress( FILE: physics/speed_of_sound.py function speed_of_sound_in_a_fluid (line 23) | def speed_of_sound_in_a_fluid(density: float, bulk_modulus: float) -> fl... FILE: physics/speeds_of_gas_molecules.py function avg_speed_of_molecule (line 54) | def avg_speed_of_molecule(temperature: float, molar_mass: float) -> float: function mps_speed_of_molecule (line 82) | def mps_speed_of_molecule(temperature: float, molar_mass: float) -> float: FILE: physics/terminal_velocity.py function terminal_velocity (line 27) | def terminal_velocity( FILE: project_euler/problem_001/sol1.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_001/sol2.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_001/sol3.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_001/sol4.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_001/sol5.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_001/sol6.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_001/sol7.py function solution (line 13) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_002/sol1.py function solution (line 19) | def solution(n: int = 4000000) -> int: FILE: project_euler/problem_002/sol2.py function solution (line 19) | def solution(n: int = 4000000) -> int: FILE: project_euler/problem_002/sol3.py function solution (line 19) | def solution(n: int = 4000000) -> int: FILE: project_euler/problem_002/sol4.py function solution (line 22) | def solution(n: int = 4000000) -> int: FILE: project_euler/problem_002/sol5.py function solution (line 19) | def solution(n: int = 4000000) -> int: FILE: project_euler/problem_003/sol1.py function is_prime (line 17) | def is_prime(number: int) -> bool: function solution (line 51) | def solution(n: int = 600851475143) -> int: FILE: project_euler/problem_003/sol2.py function solution (line 15) | def solution(n: int = 600851475143) -> int: FILE: project_euler/problem_003/sol3.py function solution (line 15) | def solution(n: int = 600851475143) -> int: FILE: project_euler/problem_004/sol1.py function solution (line 16) | def solution(n: int = 998001) -> int: FILE: project_euler/problem_004/sol2.py function solution (line 16) | def solution(n: int = 998001) -> int: FILE: project_euler/problem_005/sol1.py function solution (line 17) | def solution(n: int = 20) -> int: FILE: project_euler/problem_005/sol2.py function lcm (line 21) | def lcm(x: int, y: int) -> int: function solution (line 40) | def solution(n: int = 20) -> int: FILE: project_euler/problem_006/sol1.py function solution (line 20) | def solution(n: int = 100) -> int: FILE: project_euler/problem_006/sol2.py function solution (line 20) | def solution(n: int = 100) -> int: FILE: project_euler/problem_006/sol3.py function solution (line 22) | def solution(n: int = 100) -> int: FILE: project_euler/problem_006/sol4.py function solution (line 20) | def solution(n: int = 100) -> int: FILE: project_euler/problem_007/sol1.py function is_prime (line 18) | def is_prime(number: int) -> bool: function solution (line 52) | def solution(nth: int = 10001) -> int: FILE: project_euler/problem_007/sol2.py function is_prime (line 18) | def is_prime(number: int) -> bool: function solution (line 52) | def solution(nth: int = 10001) -> int: FILE: project_euler/problem_007/sol3.py function is_prime (line 19) | def is_prime(number: int) -> bool: function prime_generator (line 53) | def prime_generator(): function solution (line 65) | def solution(nth: int = 10001) -> int: FILE: project_euler/problem_008/sol1.py function solution (line 60) | def solution(n: str = N) -> int: FILE: project_euler/problem_008/sol2.py function solution (line 60) | def solution(n: str = N) -> int: FILE: project_euler/problem_008/sol3.py function str_eval (line 60) | def str_eval(s: str) -> int: function solution (line 76) | def solution(n: str = N) -> int: FILE: project_euler/problem_009/sol1.py function solution (line 20) | def solution() -> int: function solution_fast (line 41) | def solution_fast() -> int: function benchmark (line 62) | def benchmark() -> None: FILE: project_euler/problem_009/sol2.py function solution (line 20) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_009/sol3.py function solution (line 20) | def solution() -> int: FILE: project_euler/problem_009/sol4.py function get_squares (line 20) | def get_squares(n: int) -> list[int]: function solution (line 36) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_010/sol1.py function is_prime (line 17) | def is_prime(number: int) -> bool: function solution (line 51) | def solution(n: int = 2000000) -> int: FILE: project_euler/problem_010/sol2.py function is_prime (line 19) | def is_prime(number: int) -> bool: function prime_generator (line 53) | def prime_generator() -> Iterator[int]: function solution (line 65) | def solution(n: int = 2000000) -> int: FILE: project_euler/problem_010/sol3.py function solution (line 16) | def solution(n: int = 2000000) -> int: FILE: project_euler/problem_011/sol1.py function largest_product (line 30) | def largest_product(grid): function solution (line 71) | def solution(): FILE: project_euler/problem_011/sol2.py function solution (line 30) | def solution(): FILE: project_euler/problem_012/sol1.py function count_divisors (line 26) | def count_divisors(n): function solution (line 41) | def solution(): FILE: project_euler/problem_012/sol2.py function triangle_number_generator (line 26) | def triangle_number_generator(): function count_divisors (line 31) | def count_divisors(n): function solution (line 46) | def solution(): FILE: project_euler/problem_013/sol1.py function solution (line 12) | def solution(): FILE: project_euler/problem_014/sol1.py function solution (line 22) | def solution(n: int = 1000000) -> int: FILE: project_euler/problem_014/sol2.py function collatz_sequence_length (line 34) | def collatz_sequence_length(n: int) -> int: function solution (line 44) | def solution(n: int = 1000000) -> int: FILE: project_euler/problem_015/sol1.py function solution (line 12) | def solution(n: int = 20) -> int: FILE: project_euler/problem_015/sol2.py function solution (line 10) | def solution(n: int = 20) -> int: FILE: project_euler/problem_016/sol1.py function solution (line 10) | def solution(power: int = 1000) -> int: FILE: project_euler/problem_016/sol2.py function solution (line 10) | def solution(power: int = 1000) -> int: FILE: project_euler/problem_017/sol1.py function solution (line 19) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_018/solution.py function solution (line 34) | def solution(): FILE: project_euler/problem_019/sol1.py function solution (line 24) | def solution(): FILE: project_euler/problem_020/sol1.py function factorial (line 13) | def factorial(num: int) -> int: function split_and_add (line 21) | def split_and_add(number: int) -> int: function solution (line 31) | def solution(num: int = 100) -> int: FILE: project_euler/problem_020/sol2.py function solution (line 15) | def solution(num: int = 100) -> int: FILE: project_euler/problem_020/sol3.py function solution (line 15) | def solution(num: int = 100) -> int: FILE: project_euler/problem_020/sol4.py function solution (line 13) | def solution(num: int = 100) -> int: FILE: project_euler/problem_021/sol1.py function sum_of_divisors (line 20) | def sum_of_divisors(n: int) -> int: function solution (line 30) | def solution(n: int = 10000) -> int: FILE: project_euler/problem_022/sol1.py function solution (line 21) | def solution(): FILE: project_euler/problem_022/sol2.py function solution (line 21) | def solution(): FILE: project_euler/problem_023/sol1.py function solution (line 22) | def solution(limit=28123): FILE: project_euler/problem_024/sol1.py function solution (line 16) | def solution(): FILE: project_euler/problem_025/sol1.py function fibonacci (line 28) | def fibonacci(n: int) -> int: function fibonacci_digits_index (line 58) | def fibonacci_digits_index(n: int) -> int: function solution (line 83) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_025/sol2.py function fibonacci_generator (line 30) | def fibonacci_generator() -> Generator[int]: function solution (line 52) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_025/sol3.py function solution (line 28) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_026/sol1.py function solution (line 27) | def solution(numerator: int = 1, digit: int = 1000) -> int: FILE: project_euler/problem_027/sol1.py function is_prime (line 26) | def is_prime(number: int) -> bool: function solution (line 62) | def solution(a_limit: int = 1000, b_limit: int = 1000) -> int: FILE: project_euler/problem_028/sol1.py function solution (line 23) | def solution(n: int = 1001) -> int: FILE: project_euler/problem_029/sol1.py function solution (line 19) | def solution(n: int = 100) -> int: FILE: project_euler/problem_030/sol1.py function digits_fifth_powers_sum (line 27) | def digits_fifth_powers_sum(number: int) -> int: function solution (line 35) | def solution() -> int: FILE: project_euler/problem_031/sol1.py function one_pence (line 16) | def one_pence() -> int: function two_pence (line 20) | def two_pence(x: int) -> int: function five_pence (line 24) | def five_pence(x: int) -> int: function ten_pence (line 28) | def ten_pence(x: int) -> int: function twenty_pence (line 32) | def twenty_pence(x: int) -> int: function fifty_pence (line 36) | def fifty_pence(x: int) -> int: function one_pound (line 40) | def one_pound(x: int) -> int: function two_pound (line 44) | def two_pound(x: int) -> int: function solution (line 48) | def solution(n: int = 200) -> int: FILE: project_euler/problem_031/sol2.py function solution (line 35) | def solution(pence: int = 200) -> int: FILE: project_euler/problem_032/sol32.py function is_combination_valid (line 19) | def is_combination_valid(combination): function solution (line 40) | def solution(): FILE: project_euler/problem_033/sol1.py function is_digit_cancelling (line 23) | def is_digit_cancelling(num: int, den: int) -> bool: function fraction_list (line 29) | def fraction_list(digit_len: int) -> list[str]: function solution (line 60) | def solution(n: int = 2) -> int: FILE: project_euler/problem_034/sol1.py function sum_of_digit_factorial (line 14) | def sum_of_digit_factorial(n: int) -> int: function solution (line 25) | def solution() -> int: FILE: project_euler/problem_035/sol1.py function is_prime (line 30) | def is_prime(n: int) -> bool: function contains_an_even_digit (line 43) | def contains_an_even_digit(n: int) -> bool: function find_circular_primes (line 56) | def find_circular_primes(limit: int = 1000000) -> list[int]: function solution (line 74) | def solution() -> int: FILE: project_euler/problem_036/sol1.py function is_palindrome (line 21) | def is_palindrome(n: int | str) -> bool: function solution (line 39) | def solution(n: int = 1000000): FILE: project_euler/problem_037/sol1.py function is_prime (line 20) | def is_prime(number: int) -> bool: function list_truncated_nums (line 59) | def list_truncated_nums(n: int) -> list[int]: function validate (line 77) | def validate(n: int) -> bool: function compute_truncated_primes (line 94) | def compute_truncated_primes(count: int = 11) -> list[int]: function solution (line 111) | def solution() -> int: FILE: project_euler/problem_038/sol1.py function is_9_pandigital (line 44) | def is_9_pandigital(n: int) -> bool: function solution (line 58) | def solution() -> int | None: FILE: project_euler/problem_039/sol1.py function pythagorean_triple (line 17) | def pythagorean_triple(max_perimeter: int) -> typing.Counter[int]: function solution (line 40) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_040/sol1.py function solution (line 18) | def solution(): FILE: project_euler/problem_041/sol1.py function is_prime (line 20) | def is_prime(number: int) -> bool: function solution (line 59) | def solution(n: int = 7) -> int: FILE: project_euler/problem_042/solution42.py function solution (line 23) | def solution(): FILE: project_euler/problem_043/sol1.py function is_substring_divisible (line 24) | def is_substring_divisible(num: tuple) -> bool: function solution (line 51) | def solution(n: int = 10) -> int: FILE: project_euler/problem_044/sol1.py function is_pentagonal (line 15) | def is_pentagonal(n: int) -> bool: function solution (line 29) | def solution(limit: int = 5000) -> int: FILE: project_euler/problem_045/sol1.py function hexagonal_num (line 17) | def hexagonal_num(n: int) -> int: function is_pentagonal (line 30) | def is_pentagonal(n: int) -> bool: function solution (line 44) | def solution(start: int = 144) -> int: FILE: project_euler/problem_046/sol1.py function is_prime (line 25) | def is_prime(number: int) -> bool: function compute_nums (line 67) | def compute_nums(n: int) -> list[int]: function solution (line 110) | def solution() -> int: FILE: project_euler/problem_047/sol1.py function unique_prime_factors (line 24) | def unique_prime_factors(n: int) -> set: function upf_len (line 50) | def upf_len(num: int) -> int: function equality (line 59) | def equality(iterable: list) -> bool: function run (line 72) | def run(n: int) -> list[int]: function solution (line 101) | def solution(n: int = 4) -> int | None: FILE: project_euler/problem_048/sol1.py function solution (line 11) | def solution(): FILE: project_euler/problem_049/sol1.py function is_prime (line 32) | def is_prime(number: int) -> bool: function search (line 71) | def search(target: int, prime_list: list) -> bool: function solution (line 95) | def solution(): FILE: project_euler/problem_050/sol1.py function prime_sieve (line 22) | def prime_sieve(limit: int) -> list[int]: function solution (line 54) | def solution(ceiling: int = 1_000_000) -> int: FILE: project_euler/problem_051/sol1.py function prime_sieve (line 24) | def prime_sieve(n: int) -> list[int]: function digit_replacements (line 56) | def digit_replacements(number: int) -> list[list[int]]: function solution (line 78) | def solution(family_length: int = 8) -> int: FILE: project_euler/problem_052/sol1.py function solution (line 13) | def solution(): FILE: project_euler/problem_053/sol1.py function combinations (line 23) | def combinations(n, r): function solution (line 27) | def solution(): FILE: project_euler/problem_054/sol1.py class PokerHand (line 49) | class PokerHand: method __init__ (line 105) | def __init__(self, hand: str) -> None: method hand (line 137) | def hand(self): method compare_with (line 141) | def compare_with(self, other: PokerHand) -> str: method hand_name (line 187) | def hand_name(self) -> str: method _compare_cards (line 226) | def _compare_cards(self, other: PokerHand) -> str: method _get_hand_type (line 233) | def _get_hand_type(self) -> int: method _is_flush (line 253) | def _is_flush(self) -> bool: method _is_five_high_straight (line 256) | def _is_five_high_straight(self) -> bool: method _is_straight (line 273) | def _is_straight(self) -> bool: method _is_same_kind (line 279) | def _is_same_kind(self) -> int: method _internal_state (line 318) | def _internal_state(self) -> tuple[list[int], set[str]]: method __repr__ (line 327) | def __repr__(self): method __str__ (line 330) | def __str__(self): method __eq__ (line 337) | def __eq__(self, other): method __lt__ (line 342) | def __lt__(self, other): method __le__ (line 347) | def __le__(self, other): method __gt__ (line 352) | def __gt__(self, other): method __ge__ (line 357) | def __ge__(self, other): method __hash__ (line 362) | def __hash__(self): function solution (line 366) | def solution() -> int: FILE: project_euler/problem_054/test_poker_hand.py function generate_random_hand (line 139) | def generate_random_hand(): function generate_random_hands (line 146) | def generate_random_hands(number_of_hands: int = 100): function test_hand_is_flush (line 151) | def test_hand_is_flush(hand, expected): function test_hand_is_straight (line 156) | def test_hand_is_straight(hand, expected): function test_hand_is_five_high_straight (line 161) | def test_hand_is_five_high_straight(hand, expected, card_values): function test_hand_is_same_kind (line 168) | def test_hand_is_same_kind(hand, expected): function test_hand_values (line 173) | def test_hand_values(hand, expected): function test_compare_simple (line 178) | def test_compare_simple(hand, other, expected): function test_compare_random (line 183) | def test_compare_random(hand, other, expected): function test_hand_sorted (line 187) | def test_hand_sorted(): function test_custom_sort_five_high_straight (line 196) | def test_custom_sort_five_high_straight(): function test_multiple_calls_five_high_straight (line 203) | def test_multiple_calls_five_high_straight(): function test_euler_project (line 214) | def test_euler_project(): FILE: project_euler/problem_055/sol1.py function is_palindrome (line 30) | def is_palindrome(n: int) -> bool: function sum_reverse (line 43) | def sum_reverse(n: int) -> int: function solution (line 56) | def solution(limit: int = 10000) -> int: FILE: project_euler/problem_056/sol1.py function solution (line 13) | def solution(a: int = 100, b: int = 100) -> int: FILE: project_euler/problem_057/sol1.py function solution (line 23) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_058/sol1.py function is_prime (line 40) | def is_prime(number: int) -> bool: function solution (line 79) | def solution(ratio: float = 0.1) -> int: FILE: project_euler/problem_059/sol1.py function try_key (line 44) | def try_key(ciphertext: list[int], key: tuple[int, ...]) -> str | None: function filter_valid_chars (line 69) | def filter_valid_chars(ciphertext: list[int]) -> list[str]: function filter_common_word (line 88) | def filter_common_word(possibles: list[str], common_word: str) -> list[s... function solution (line 101) | def solution(filename: str = "p059_cipher.txt") -> int: FILE: project_euler/problem_062/sol1.py function solution (line 16) | def solution(max_base: int = 5) -> int: function get_digits (line 47) | def get_digits(num: int) -> str: FILE: project_euler/problem_063/sol1.py function solution (line 14) | def solution(max_base: int = 10, max_power: int = 22) -> int: FILE: project_euler/problem_064/sol1.py function continuous_fraction_period (line 19) | def continuous_fraction_period(n: int) -> int: function solution (line 47) | def solution(n: int = 10000) -> int: FILE: project_euler/problem_065/sol1.py function sum_digits (line 56) | def sum_digits(num: int) -> int: function solution (line 74) | def solution(max_n: int = 100) -> int: FILE: project_euler/problem_067/sol1.py function solution (line 18) | def solution(): FILE: project_euler/problem_067/sol2.py function solution (line 18) | def solution() -> int: FILE: project_euler/problem_068/sol1.py function solution (line 46) | def solution(gon_side: int = 5) -> int: function generate_gon_ring (line 80) | def generate_gon_ring(gon_side: int, perm: list[int]) -> list[int]: function is_magic_gon (line 104) | def is_magic_gon(numbers: list[int]) -> bool: FILE: project_euler/problem_069/sol1.py function solution (line 27) | def solution(n: int = 10**6) -> int: FILE: project_euler/problem_070/sol1.py function get_totients (line 37) | def get_totients(max_one: int) -> list[int]: function has_same_digits (line 58) | def has_same_digits(num1: int, num2: int) -> bool: function solution (line 75) | def solution(max_n: int = 10000000) -> int: FILE: project_euler/problem_071/sol1.py function solution (line 22) | def solution(numerator: int = 3, denominator: int = 7, limit: int = 1000... FILE: project_euler/problem_072/sol1.py function solution (line 27) | def solution(limit: int = 1_000_000) -> int: FILE: project_euler/problem_072/sol2.py function solution (line 20) | def solution(limit: int = 1000000) -> int: FILE: project_euler/problem_073/sol1.py function solution (line 22) | def solution(max_d: int = 12_000) -> int: FILE: project_euler/problem_074/sol1.py function sum_digit_factorials (line 56) | def sum_digit_factorials(n: int) -> int: function chain_length (line 73) | def chain_length(n: int, previous: set | None = None) -> int: function solution (line 98) | def solution(num_terms: int = 60, max_start: int = 1000000) -> int: FILE: project_euler/problem_074/sol2.py function digit_factorial_sum (line 42) | def digit_factorial_sum(number: int) -> int: function solution (line 72) | def solution(chain_length: int = 60, number_limit: int = 1000000) -> int: FILE: project_euler/problem_075/sol1.py function solution (line 34) | def solution(limit: int = 1500000) -> int: FILE: project_euler/problem_076/sol1.py function solution (line 19) | def solution(m: int = 100) -> int: FILE: project_euler/problem_077/sol1.py function partition (line 34) | def partition(number_to_partition: int) -> set[int]: function solution (line 64) | def solution(number_unique_partitions: int = 5000) -> int | None: FILE: project_euler/problem_078/sol1.py function solution (line 22) | def solution(number: int = 1000000) -> int: FILE: project_euler/problem_079/sol1.py function find_secret_passcode (line 21) | def find_secret_passcode(logins: list[str]) -> int: function solution (line 56) | def solution(input_file: str = "keylog.txt") -> int: FILE: project_euler/problem_080/sol1.py function solution (line 13) | def solution() -> int: FILE: project_euler/problem_081/sol1.py function solution (line 20) | def solution(filename: str = "matrix.txt") -> int: FILE: project_euler/problem_082/sol1.py function solution (line 24) | def solution(filename: str = "input.txt") -> int: FILE: project_euler/problem_085/sol1.py function solution (line 53) | def solution(target: int = 2000000) -> int: FILE: project_euler/problem_086/sol1.py function solution (line 72) | def solution(limit: int = 1000000) -> int: FILE: project_euler/problem_087/sol1.py function solution (line 18) | def solution(limit: int = 50000000) -> int: FILE: project_euler/problem_089/sol1.py function parse_roman_numerals (line 36) | def parse_roman_numerals(numerals: str) -> int: function generate_roman_numerals (line 62) | def generate_roman_numerals(num: int) -> str: function solution (line 118) | def solution(roman_numerals_filename: str = "/p089_roman.txt") -> int: FILE: project_euler/problem_091/sol1.py function is_right (line 17) | def is_right(x1: int, y1: int, x2: int, y2: int) -> bool: function solution (line 40) | def solution(limit: int = 50) -> int: FILE: project_euler/problem_092/sol1.py function next_number (line 17) | def next_number(number: int) -> int: function chain (line 54) | def chain(number: int) -> bool: function solution (line 83) | def solution(number: int = 10000000) -> int: FILE: project_euler/problem_094/sol1.py function solution (line 16) | def solution(max_perimeter: int = 10**9) -> int: FILE: project_euler/problem_095/sol1.py function generate_primes (line 34) | def generate_primes(max_num: int) -> list[int]: function multiply (line 51) | def multiply( function find_longest_chain (line 107) | def find_longest_chain(chain: list[int], max_num: int) -> int: function solution (line 134) | def solution(max_num: int = 1000000) -> int: FILE: project_euler/problem_097/sol1.py function solution (line 13) | def solution(n: int = 10) -> str: FILE: project_euler/problem_099/sol1.py function solution (line 20) | def solution(data_file: str = "base_exp.txt") -> int: FILE: project_euler/problem_100/sol1.py function solution (line 16) | def solution(min_total: int = 10**12) -> int: FILE: project_euler/problem_101/sol1.py function solve (line 52) | def solve(matrix: Matrix, vector: Matrix) -> Matrix: function interpolate (line 113) | def interpolate(y_list: list[int]) -> Callable[[int], int]: function question_function (line 164) | def question_function(variable: int) -> int: function solution (line 191) | def solution(func: Callable[[int], int] = question_function, order: int ... FILE: project_euler/problem_102/sol1.py function vector_product (line 27) | def vector_product(point1: tuple[int, int], point2: tuple[int, int]) -> ... function contains_origin (line 38) | def contains_origin(x1: int, y1: int, x2: int, y2: int, x3: int, y3: int... function solution (line 60) | def solution(filename: str = "p102_triangles.txt") -> int: FILE: project_euler/problem_104/sol1.py function check (line 21) | def check(number: int) -> bool: function check1 (line 70) | def check1(number: int) -> bool: function solution (line 102) | def solution() -> int: FILE: project_euler/problem_107/sol1.py class Graph (line 39) | class Graph: method __init__ (line 44) | def __init__(self, vertices: set[int], edges: Mapping[EdgeT, int]) -> ... method add_edge (line 50) | def add_edge(self, edge: EdgeT, weight: int) -> None: method prims_algorithm (line 64) | def prims_algorithm(self) -> Graph: function solution (line 95) | def solution(filename: str = "p107_network.txt") -> int: FILE: project_euler/problem_109/sol1.py function solution (line 59) | def solution(limit: int = 100) -> int: FILE: project_euler/problem_112/sol1.py function check_bouncy (line 20) | def check_bouncy(n: int) -> bool: function solution (line 55) | def solution(percent: float = 99) -> int: FILE: project_euler/problem_113/sol1.py function choose (line 21) | def choose(n: int, r: int) -> int: function non_bouncy_exact (line 37) | def non_bouncy_exact(n: int) -> int: function non_bouncy_upto (line 50) | def non_bouncy_upto(n: int) -> int: function solution (line 63) | def solution(num_digits: int = 100) -> int: FILE: project_euler/problem_114/sol1.py function solution (line 35) | def solution(length: int = 50) -> int: FILE: project_euler/problem_115/sol1.py function solution (line 30) | def solution(min_block_length: int = 50) -> int: FILE: project_euler/problem_116/sol1.py function solution (line 38) | def solution(length: int = 50) -> int: FILE: project_euler/problem_117/sol1.py function solution (line 32) | def solution(length: int = 50) -> int: FILE: project_euler/problem_119/sol1.py function digit_sum (line 16) | def digit_sum(n: int) -> int: function solution (line 29) | def solution(n: int = 30) -> int: FILE: project_euler/problem_120/sol1.py function solution (line 18) | def solution(n: int = 1000) -> int: FILE: project_euler/problem_121/sol1.py function solution (line 29) | def solution(num_turns: int = 15) -> int: FILE: project_euler/problem_122/sol1.py function solve (line 40) | def solve(nums: list[int], goal: int, depth: int) -> bool: function solution (line 62) | def solution(n: int = 200) -> int: FILE: project_euler/problem_123/sol1.py function sieve (line 46) | def sieve() -> Generator[int]: function solution (line 80) | def solution(limit: float = 1e10) -> int: FILE: project_euler/problem_125/sol1.py function is_palindrome (line 19) | def is_palindrome(n: int) -> bool: function solution (line 35) | def solution() -> int: FILE: project_euler/problem_129/sol1.py function least_divisible_repunit (line 17) | def least_divisible_repunit(divisor: int) -> int: function solution (line 37) | def solution(limit: int = 1000000) -> int: FILE: project_euler/problem_131/sol1.py function is_prime (line 18) | def is_prime(number: int) -> bool: function solution (line 32) | def solution(max_prime: int = 10**6) -> int: FILE: project_euler/problem_135/sol1.py function solution (line 23) | def solution(limit: int = 1000000) -> int: FILE: project_euler/problem_136/sol1.py function solution (line 31) | def solution(n_limit: int = 50 * 10**6) -> int: FILE: project_euler/problem_144/sol1.py function next_point (line 35) | def next_point( function solution (line 78) | def solution(first_x_coord: float = 1.4, first_y_coord: float = -9.6) ->... FILE: project_euler/problem_145/sol1.py function slow_reversible_numbers (line 21) | def slow_reversible_numbers( function slow_solution (line 80) | def slow_solution(max_power: int = 9) -> int: function reversible_numbers (line 96) | def reversible_numbers( function solution (line 116) | def solution(max_power: int = 9) -> int: function benchmark (line 132) | def benchmark() -> None: FILE: project_euler/problem_164/sol1.py function solve (line 13) | def solve( function solution (line 51) | def solution(n_digits: int = 20) -> int: FILE: project_euler/problem_173/sol1.py function solution (line 17) | def solution(limit: int = 1000000) -> int: FILE: project_euler/problem_174/sol1.py function solution (line 24) | def solution(t_limit: int = 1000000, n_limit: int = 10) -> int: FILE: project_euler/problem_180/sol1.py function is_sq (line 54) | def is_sq(number: int) -> bool: function add_three (line 69) | def add_three( function solution (line 88) | def solution(order: int = 35) -> int: FILE: project_euler/problem_187/sol1.py function slow_calculate_prime_numbers (line 17) | def slow_calculate_prime_numbers(max_number: int) -> list[int]: function calculate_prime_numbers (line 41) | def calculate_prime_numbers(max_number: int) -> list[int]: function slow_solution (line 71) | def slow_solution(max_number: int = 10**8) -> int: function while_solution (line 94) | def while_solution(max_number: int = 10**8) -> int: function solution (line 117) | def solution(max_number: int = 10**8) -> int: function benchmark (line 142) | def benchmark() -> None: FILE: project_euler/problem_188/sol1.py function _modexpt (line 23) | def _modexpt(base: int, exponent: int, modulo_value: int) -> int: function solution (line 45) | def solution(base: int = 1777, height: int = 1855, digits: int = 8) -> int: FILE: project_euler/problem_190/sol1.py function solution (line 23) | def solution(n: int = 15) -> int: FILE: project_euler/problem_191/sol1.py function _calculate (line 31) | def _calculate(days: int, absent: int, late: int) -> int: function solution (line 89) | def solution(days: int = 30) -> int: FILE: project_euler/problem_203/sol1.py function get_pascal_triangle_unique_coefficients (line 34) | def get_pascal_triangle_unique_coefficients(depth: int) -> set[int]: function get_squarefrees (line 63) | def get_squarefrees(unique_coefficients: set[int]) -> set[int]: function solution (line 100) | def solution(n: int = 51) -> int: FILE: project_euler/problem_205/sol1.py function total_frequency_distribution (line 17) | def total_frequency_distribution(sides_number: int, dice_number: int) ->... function solution (line 41) | def solution() -> float: FILE: project_euler/problem_206/sol1.py function is_square_form (line 36) | def is_square_form(num: int) -> bool: function solution (line 58) | def solution() -> int: FILE: project_euler/problem_207/sol1.py function check_partition_perfect (line 44) | def check_partition_perfect(positive_integer: int) -> bool: function solution (line 63) | def solution(max_proportion: float = 1 / 12345) -> int: FILE: project_euler/problem_234/sol1.py function prime_sieve (line 23) | def prime_sieve(n: int) -> list: function solution (line 53) | def solution(limit: int = 999_966_663_333) -> int: FILE: project_euler/problem_301/sol1.py function solution (line 36) | def solution(exponent: int = 30) -> int: FILE: project_euler/problem_345/sol1.py function solve (line 67) | def solve(arr: NDArray, row: int, cols: set[int], cache: dict[str, int])... function solution (line 95) | def solution(matrix_str: list[str] = MATRIX_2) -> int: FILE: project_euler/problem_493/sol1.py function solution (line 34) | def solution(num_picks: int = 20) -> str: FILE: project_euler/problem_551/sol1.py function next_term (line 20) | def next_term(a_i, k, i, n): function compute (line 109) | def compute(a_i, k, i, n): function add (line 148) | def add(digits, k, addend): function solution (line 170) | def solution(n: int = 10**15) -> int: FILE: project_euler/problem_587/sol1.py function circle_bottom_arc_integral (line 32) | def circle_bottom_arc_integral(point: float) -> float: function concave_triangle_area (line 51) | def concave_triangle_area(circles_number: int) -> float: function solution (line 75) | def solution(fraction: float = 1 / 1000) -> int: FILE: project_euler/problem_686/sol1.py function log_difference (line 20) | def log_difference(number: int) -> float: function solution (line 46) | def solution(number: int = 678910) -> int: FILE: project_euler/problem_800/sol1.py function calculate_prime_numbers (line 16) | def calculate_prime_numbers(max_number: int) -> list[int]: function solution (line 33) | def solution(base: int = 800800, degree: int = 800800) -> int: FILE: quantum/q_fourier_transform.py function quantum_fourier_transform (line 21) | def quantum_fourier_transform(number_of_qubits: int = 3) -> qiskit.resul... FILE: scheduling/first_come_first_served.py function calculate_waiting_times (line 8) | def calculate_waiting_times(duration_times: list[int]) -> list[int]: function calculate_turnaround_times (line 26) | def calculate_turnaround_times( function calculate_average_turnaround_time (line 47) | def calculate_average_turnaround_time(turnaround_times: list[int]) -> fl... function calculate_average_waiting_time (line 61) | def calculate_average_waiting_time(waiting_times: list[int]) -> float: FILE: scheduling/highest_response_ratio_next.py function calculate_turn_around_time (line 13) | def calculate_turn_around_time( function calculate_waiting_time (line 76) | def calculate_waiting_time( FILE: scheduling/job_sequence_with_deadline.py class Task (line 22) | class Task: function max_tasks (line 28) | def max_tasks(tasks_info: list[tuple[int, int]]) -> list[int]: FILE: scheduling/job_sequencing_with_deadline.py function job_sequencing_with_deadlines (line 1) | def job_sequencing_with_deadlines(jobs: list) -> list: FILE: scheduling/multi_level_feedback_queue.py class Process (line 4) | class Process: method __init__ (line 5) | def __init__(self, process_name: str, arrival_time: int, burst_time: i... class MLFQ (line 15) | class MLFQ: method __init__ (line 25) | def __init__( method calculate_sequence_of_finish_queue (line 43) | def calculate_sequence_of_finish_queue(self) -> list[str]: method calculate_waiting_time (line 60) | def calculate_waiting_time(self, queue: list[Process]) -> list[int]: method calculate_turnaround_time (line 77) | def calculate_turnaround_time(self, queue: list[Process]) -> list[int]: method calculate_completion_time (line 94) | def calculate_completion_time(self, queue: list[Process]) -> list[int]: method calculate_remaining_burst_time_of_processes (line 111) | def calculate_remaining_burst_time_of_processes( method update_waiting_time (line 134) | def update_waiting_time(self, process: Process) -> int: method first_come_first_served (line 150) | def first_come_first_served(self, ready_queue: deque[Process]) -> dequ... method round_robin (line 189) | def round_robin( method multi_level_feedback_queue (line 243) | def multi_level_feedback_queue(self) -> deque[Process]: FILE: scheduling/non_preemptive_shortest_job_first.py function calculate_waitingtime (line 13) | def calculate_waitingtime( function calculate_turnaroundtime (line 70) | def calculate_turnaroundtime( FILE: scheduling/round_robin.py function calculate_waiting_times (line 12) | def calculate_waiting_times(burst_times: list[int]) -> list[int]: function calculate_turn_around_times (line 44) | def calculate_turn_around_times( FILE: scheduling/shortest_job_first.py function calculate_waitingtime (line 12) | def calculate_waitingtime( function calculate_turnaroundtime (line 76) | def calculate_turnaroundtime( function calculate_average_times (line 95) | def calculate_average_times( FILE: scripts/build_directory_md.py function good_file_paths (line 7) | def good_file_paths(top_dir: str = ".") -> Iterator[str]: function md_prefix (line 21) | def md_prefix(indent: int) -> str: function print_path (line 37) | def print_path(old_path: str, new_path: str) -> str: function print_directory_md (line 45) | def print_directory_md(top_dir: str = ".") -> None: FILE: scripts/validate_solutions.py function convert_path_to_module (line 30) | def convert_path_to_module(file_path: pathlib.Path) -> ModuleType: function all_solution_file_paths (line 38) | def all_solution_file_paths() -> list[pathlib.Path]: function get_files_url (line 51) | def get_files_url() -> str: function added_solution_file_path (line 58) | def added_solution_file_path() -> list[pathlib.Path]: function collect_solution_file_paths (line 82) | def collect_solution_file_paths() -> list[pathlib.Path]: function test_project_euler (line 98) | def test_project_euler(solution_path: pathlib.Path) -> None: FILE: searches/binary_search.py function bisect_left (line 17) | def bisect_left( function bisect_right (line 59) | def bisect_right( function insort_left (line 100) | def insort_left( function insort_right (line 140) | def insort_right( function binary_search (line 180) | def binary_search(sorted_collection: list[int], item: int) -> int: function binary_search_std_lib (line 217) | def binary_search_std_lib(sorted_collection: list[int], item: int) -> int: function binary_search_with_duplicates (line 245) | def binary_search_with_duplicates(sorted_collection: list[int], item: in... function binary_search_by_recursion (line 320) | def binary_search_by_recursion( function exponential_search (line 360) | def exponential_search(sorted_collection: list[int], item: int) -> int: FILE: searches/binary_tree_traversal.py class TreeNode (line 10) | class TreeNode: method __init__ (line 11) | def __init__(self, data): function build_tree (line 17) | def build_tree() -> TreeNode: function pre_order (line 42) | def pre_order(node: TreeNode) -> None: function in_order (line 64) | def in_order(node: TreeNode) -> None: function post_order (line 86) | def post_order(node: TreeNode) -> None: function level_order (line 108) | def level_order(node: TreeNode) -> None: function level_order_actual (line 136) | def level_order_actual(node: TreeNode) -> None: function pre_order_iter (line 172) | def pre_order_iter(node: TreeNode) -> None: function in_order_iter (line 202) | def in_order_iter(node: TreeNode) -> None: function post_order_iter (line 230) | def post_order_iter(node: TreeNode) -> None: function prompt (line 261) | def prompt(s: str = "", width=50, char="*") -> str: FILE: searches/double_linear_search.py function double_linear_search (line 4) | def double_linear_search(array: list[int], search_item: int) -> int: FILE: searches/double_linear_search_recursion.py function search (line 1) | def search(list_data: list, key: int, left: int = 0, right: int = 0) -> ... FILE: searches/exponential_search.py function binary_search_by_recursion (line 19) | def binary_search_by_recursion( function exponential_search (line 60) | def exponential_search(sorted_collection: list[int], item: int) -> int: FILE: searches/fibonacci_search.py function fibonacci (line 18) | def fibonacci(k: int) -> int: function fibonacci_search (line 58) | def fibonacci_search(arr: list, val: int) -> int: FILE: searches/hill_climbing.py class SearchProblem (line 5) | class SearchProblem: method __init__ (line 11) | def __init__(self, x: int, y: int, step_size: int, function_to_optimize): method score (line 25) | def score(self) -> int: method get_neighbors (line 37) | def get_neighbors(self): method __hash__ (line 61) | def __hash__(self): method __eq__ (line 67) | def __eq__(self, obj): method __str__ (line 75) | def __str__(self): function hill_climbing (line 86) | def hill_climbing( function test_f1 (line 167) | def test_f1(x, y): function test_f2 (line 188) | def test_f2(x, y): FILE: searches/interpolation_search.py function interpolation_search (line 6) | def interpolation_search(sorted_collection: list[int], item: int) -> int... function interpolation_search_by_recursion (line 76) | def interpolation_search_by_recursion( FILE: searches/jump_search.py class Comparable (line 16) | class Comparable(Protocol): method __lt__ (line 17) | def __lt__(self, other: Any, /) -> bool: ... function jump_search (line 20) | def jump_search[T: Comparable](arr: Sequence[T], item: T) -> int: FILE: searches/linear_search.py function linear_search (line 12) | def linear_search(sequence: list, target: int) -> int: function rec_linear_search (line 36) | def rec_linear_search(sequence: list, low: int, high: int, target: int) ... FILE: searches/median_of_medians.py function median_of_five (line 12) | def median_of_five(arr: list) -> int: function median_of_medians (line 31) | def median_of_medians(arr: list) -> int: function quick_select (line 61) | def quick_select(arr: list, target: int) -> int: FILE: searches/quick_select.py function _partition (line 11) | def _partition(data: list, pivot) -> tuple: function quick_select (line 30) | def quick_select(items: list, index: int): function median (line 65) | def median(items: list): FILE: searches/sentinel_linear_search.py function sentinel_linear_search (line 14) | def sentinel_linear_search(sequence, target): FILE: searches/simple_binary_search.py function binary_search (line 14) | def binary_search(a_list: list[int], item: int) -> bool: FILE: searches/simulated_annealing.py function simulated_annealing (line 9) | def simulated_annealing( function test_f1 (line 99) | def test_f1(x, y): function test_f2 (line 122) | def test_f2(x, y): FILE: searches/tabu_search.py function generate_neighbours (line 32) | def generate_neighbours(path): function generate_first_solution (line 74) | def generate_first_solution(path, dict_of_neighbours): function find_neighborhood (line 127) | def find_neighborhood(solution, dict_of_neighbours): function tabu_search (line 188) | def tabu_search( function main (line 253) | def main(args=None): FILE: searches/ternary_search.py function lin_search (line 20) | def lin_search(left: int, right: int, array: list[int], target: int) -> ... function ite_ternary_search (line 62) | def ite_ternary_search(array: list[int], target: int) -> int: function rec_ternary_search (line 112) | def rec_ternary_search(left: int, right: int, array: list[int], target: ... FILE: sorts/bead_sort.py function bead_sort (line 7) | def bead_sort(sequence: list) -> list: FILE: sorts/binary_insertion_sort.py function binary_insertion_sort (line 14) | def binary_insertion_sort(collection: list) -> list: FILE: sorts/bitonic_sort.py function comp_and_swap (line 10) | def comp_and_swap(array: list[int], index1: int, index2: int, direction:... function bitonic_merge (line 41) | def bitonic_merge(array: list[int], low: int, length: int, direction: in... function bitonic_sort (line 65) | def bitonic_sort(array: list[int], low: int, length: int, direction: int... FILE: sorts/bogo_sort.py function bogo_sort (line 19) | def bogo_sort(collection: list) -> list: FILE: sorts/bubble_sort.py function bubble_sort_iterative (line 4) | def bubble_sort_iterative(collection: list[Any]) -> list[Any]: function bubble_sort_recursive (line 63) | def bubble_sort_recursive(collection: list[Any]) -> list[Any]: FILE: sorts/bucket_sort.py function bucket_sort (line 34) | def bucket_sort(my_list: list, bucket_count: int = 10) -> list: FILE: sorts/circle_sort.py function circle_sort (line 12) | def circle_sort(collection: list) -> list: FILE: sorts/cocktail_shaker_sort.py function cocktail_shaker_sort (line 8) | def cocktail_shaker_sort(arr: list[int]) -> list[int]: FILE: sorts/comb_sort.py function comb_sort (line 22) | def comb_sort(data: list) -> list: FILE: sorts/counting_sort.py function counting_sort (line 12) | def counting_sort(collection): function counting_sort_string (line 59) | def counting_sort_string(string): FILE: sorts/cycle_sort.py function cycle_sort (line 7) | def cycle_sort(array: list) -> list: FILE: sorts/cyclic_sort.py function cyclic_sort (line 15) | def cyclic_sort(nums: list[int]) -> list[int]: FILE: sorts/double_sort.py function double_sort (line 4) | def double_sort(collection: list[Any]) -> list[Any]: FILE: sorts/dutch_national_flag_sort.py function dutch_national_flag_sort (line 33) | def dutch_national_flag_sort(sequence: list) -> list: FILE: sorts/exchange_sort.py function exchange_sort (line 1) | def exchange_sort(numbers: list[int]) -> list[int]: FILE: sorts/external_sort.py class FileSplitter (line 10) | class FileSplitter: method __init__ (line 13) | def __init__(self, filename): method write_block (line 17) | def write_block(self, data, block_number): method get_block_filenames (line 23) | def get_block_filenames(self): method split (line 26) | def split(self, block_size, sort_key=None): method cleanup (line 43) | def cleanup(self): class NWayMerge (line 47) | class NWayMerge: method select (line 48) | def select(self, choices): class FilesArray (line 59) | class FilesArray: method __init__ (line 60) | def __init__(self, files): method get_dict (line 66) | def get_dict(self): method refresh (line 71) | def refresh(self): method unshift (line 82) | def unshift(self, index): class FileMerger (line 89) | class FileMerger: method __init__ (line 90) | def __init__(self, merge_strategy): method merge (line 93) | def merge(self, filenames, outfilename, buffer_size): method get_file_handles (line 100) | def get_file_handles(self, filenames, buffer_size): class ExternalSort (line 109) | class ExternalSort: method __init__ (line 110) | def __init__(self, block_size): method sort (line 113) | def sort(self, filename, sort_key=None): method get_number_blocks (line 124) | def get_number_blocks(self, filename, block_size): function parse_memory (line 128) | def parse_memory(string): function main (line 139) | def main(): FILE: sorts/gnome_sort.py function gnome_sort (line 16) | def gnome_sort(lst: list) -> list: FILE: sorts/heap_sort.py function heapify (line 6) | def heapify(unsorted: list[int], index: int, heap_size: int) -> None: function heap_sort (line 34) | def heap_sort(unsorted: list[int]) -> list[int]: FILE: sorts/insertion_sort.py class Comparable (line 20) | class Comparable(Protocol): method __lt__ (line 21) | def __lt__(self, other: Any, /) -> bool: ... function insertion_sort (line 27) | def insertion_sort[T: Comparable](collection: MutableSequence[T]) -> Mut... FILE: sorts/intro_sort.py function insertion_sort (line 10) | def insertion_sort(array: list, start: int = 0, end: int = 0) -> list: function heapify (line 39) | def heapify(array: list, index: int, heap_size: int) -> None: # Max Heap function heap_sort (line 59) | def heap_sort(array: list) -> list: function median_of_3 (line 82) | def median_of_3( function partition (line 108) | def partition(array: list, low: int, high: int, pivot: int) -> int: function sort (line 137) | def sort(array: list) -> list: function intro_sort (line 166) | def intro_sort( FILE: sorts/iterative_merge_sort.py function merge (line 15) | def merge(input_list: list, low: int, mid: int, high: int) -> list: function iter_merge_sort (line 29) | def iter_merge_sort(input_list: list) -> list: FILE: sorts/merge_insertion_sort.py function binary_search_insertion (line 17) | def binary_search_insertion(sorted_list, item): function merge (line 38) | def merge(left, right): function sortlist_2d (line 52) | def sortlist_2d(list_2d): function merge_insertion_sort (line 64) | def merge_insertion_sort(collection: list[int]) -> list[int]: FILE: sorts/merge_sort.py function merge_sort (line 13) | def merge_sort(collection: list) -> list: FILE: sorts/msd_radix_sort.py function msd_radix_sort (line 11) | def msd_radix_sort(list_of_ints: list[int]) -> list[int]: function _msd_radix_sort (line 40) | def _msd_radix_sort(list_of_ints: list[int], bit_position: int) -> list[... function msd_radix_sort_inplace (line 78) | def msd_radix_sort_inplace(list_of_ints: list[int]): function _msd_radix_sort_inplace (line 112) | def _msd_radix_sort_inplace( FILE: sorts/natural_sort.py function natural_sort (line 6) | def natural_sort(input_list: list[str]) -> list[str]: FILE: sorts/odd_even_sort.py function odd_even_sort (line 8) | def odd_even_sort(input_list: list) -> list: FILE: sorts/odd_even_transposition_parallel.py function oe_process (line 32) | def oe_process( function odd_even_transposition (line 81) | def odd_even_transposition(arr): function main (line 182) | def main(): FILE: sorts/odd_even_transposition_single_threaded.py function odd_even_transposition (line 11) | def odd_even_transposition(arr: list) -> list: FILE: sorts/pancake_sort.py function pancake_sort (line 12) | def pancake_sort(arr): FILE: sorts/patience_sort.py class Stack (line 23) | class Stack(list): method __lt__ (line 24) | def __lt__(self, other): method __eq__ (line 27) | def __eq__(self, other): function patience_sort (line 31) | def patience_sort(collection: list) -> list: FILE: sorts/pigeon_sort.py function pigeon_sort (line 16) | def pigeon_sort(array: list[int]) -> list[int]: FILE: sorts/pigeonhole_sort.py function pigeonhole_sort (line 6) | def pigeonhole_sort(a): function main (line 38) | def main(): FILE: sorts/quick_sort.py function quick_sort (line 16) | def quick_sort(collection: list) -> list: FILE: sorts/quick_sort_3_partition.py function quick_sort_3partition (line 1) | def quick_sort_3partition(sorting: list, left: int, right: int) -> None: function quick_sort_lomuto_partition (line 44) | def quick_sort_lomuto_partition(sorting: list, left: int, right: int) ->... function lomuto_partition (line 75) | def lomuto_partition(sorting: list, left: int, right: int) -> int: function three_way_radix_quicksort (line 91) | def three_way_radix_quicksort(sorting: list) -> list: FILE: sorts/radix_sort.py function radix_sort (line 12) | def radix_sort(list_of_ints: list[int]) -> list[int]: FILE: sorts/recursive_insertion_sort.py function rec_insertion_sort (line 8) | def rec_insertion_sort(collection: list, n: int): function insert_next (line 39) | def insert_next(collection: list, index: int): FILE: sorts/recursive_mergesort_array.py function merge (line 8) | def merge(arr: list[int]) -> list[int]: FILE: sorts/recursive_quick_sort.py function quick_sort (line 1) | def quick_sort(data: list) -> list: FILE: sorts/selection_sort.py function selection_sort (line 1) | def selection_sort(collection: list[int]) -> list[int]: FILE: sorts/shell_sort.py function shell_sort (line 6) | def shell_sort(collection: list[int]) -> list[int]: FILE: sorts/shrink_shell_sort.py function shell_sort (line 24) | def shell_sort(collection: list) -> list: FILE: sorts/slowsort.py function slowsort (line 15) | def slowsort(sequence: list, start: int | None = None, end: int | None =... FILE: sorts/stalin_sort.py function stalin_sort (line 8) | def stalin_sort(sequence: list[int]) -> list[int]: FILE: sorts/stooge_sort.py function stooge_sort (line 1) | def stooge_sort(arr: list[int]) -> list[int]: function stooge (line 14) | def stooge(arr: list[int], i: int, h: int) -> None: FILE: sorts/strand_sort.py function strand_sort (line 4) | def strand_sort(arr: list, reverse: bool = False, solution: list | None ... FILE: sorts/tim_sort.py function binary_search (line 1) | def binary_search(lst, item, start, end): function insertion_sort (line 16) | def insertion_sort(lst): function merge (line 27) | def merge(left, right): function tim_sort (line 40) | def tim_sort(lst): function main (line 75) | def main(): FILE: sorts/topological_sort.py function topological_sort (line 18) | def topological_sort(start: str, visited: list[str], sort: list[str]) ->... FILE: sorts/tree_sort.py class Node (line 14) | class Node: method __iter__ (line 19) | def __iter__(self) -> Iterator[int]: method __len__ (line 26) | def __len__(self) -> int: method insert (line 29) | def insert(self, val: int) -> None: function tree_sort (line 42) | def tree_sort(arr: list[int]) -> tuple[int, ...]: FILE: sorts/unknown_sort.py function merge_sort (line 9) | def merge_sort(collection): FILE: sorts/wiggle_sort.py function wiggle_sort (line 12) | def wiggle_sort(nums: list) -> list: FILE: strings/aho_corasick.py class Automaton (line 6) | class Automaton: method __init__ (line 7) | def __init__(self, keywords: list[str]): method find_next_state (line 17) | def find_next_state(self, current_state: int, char: str) -> int | None: method add_keyword (line 23) | def add_keyword(self, keyword: str) -> None: method set_fail_transitions (line 42) | def set_fail_transitions(self) -> None: method search_in (line 67) | def search_in(self, string: str) -> dict[str, list[int]]: FILE: strings/alternative_string_arrange.py function alternative_string_arrange (line 1) | def alternative_string_arrange(first_str: str, second_str: str) -> str: FILE: strings/anagrams.py function signature (line 8) | def signature(word: str) -> str: function anagram (line 25) | def anagram(my_word: str) -> list[str]: FILE: strings/autocomplete_using_trie.py class Trie (line 6) | class Trie: method __init__ (line 7) | def __init__(self) -> None: method insert_word (line 10) | def insert_word(self, text: str) -> None: method find_word (line 18) | def find_word(self, prefix: str) -> tuple | list: method _elements (line 27) | def _elements(self, d: dict) -> tuple: function autocomplete_using_trie (line 41) | def autocomplete_using_trie(string: str) -> tuple: function main (line 57) | def main() -> None: FILE: strings/barcode_validator.py function get_check_digit (line 6) | def get_check_digit(barcode: int) -> int: function is_valid (line 35) | def is_valid(barcode: int) -> bool: function get_barcode (line 56) | def get_barcode(barcode: str) -> int: FILE: strings/bitap_string_match.py function bitap_string_match (line 17) | def bitap_string_match(text: str, pattern: str) -> int: FILE: strings/boyer_moore_search.py class BoyerMooreSearch (line 22) | class BoyerMooreSearch: method __init__ (line 32) | def __init__(self, text: str, pattern: str): method match_in_pattern (line 36) | def match_in_pattern(self, char: str) -> int: method mismatch_in_text (line 57) | def mismatch_in_text(self, current_pos: int) -> int: method bad_character_heuristic (line 79) | def bad_character_heuristic(self) -> list[int]: FILE: strings/camel_case_to_snake_case.py function camel_to_snake_case (line 1) | def camel_to_snake_case(input_str: str) -> str: FILE: strings/can_string_be_rearranged_as_palindrome.py function can_string_be_rearranged_as_palindrome_counter (line 11) | def can_string_be_rearranged_as_palindrome_counter( function can_string_be_rearranged_as_palindrome (line 29) | def can_string_be_rearranged_as_palindrome(input_str: str = "") -> bool: function benchmark (line 78) | def benchmark(input_str: str = "") -> None: FILE: strings/capitalize.py function capitalize (line 1) | def capitalize(sentence: str) -> str: FILE: strings/check_anagrams.py function check_anagrams (line 8) | def check_anagrams(first_str: str, second_str: str) -> bool: FILE: strings/count_vowels.py function count_vowels (line 1) | def count_vowels(s: str) -> int: FILE: strings/credit_card_validator.py function validate_initial_digits (line 8) | def validate_initial_digits(credit_card_number: str) -> bool: function luhn_validation (line 21) | def luhn_validation(credit_card_number: str) -> bool: function validate_credit_card_number (line 55) | def validate_credit_card_number(credit_card_number: str) -> bool: FILE: strings/damerau_levenshtein_distance.py function damerau_levenshtein_distance (line 11) | def damerau_levenshtein_distance(first_string: str, second_string: str) ... FILE: strings/detecting_english_programmatically.py function load_dictionary (line 7) | def load_dictionary() -> dict[str, None]: function get_english_count (line 19) | def get_english_count(message: str) -> float: function remove_non_letters (line 27) | def remove_non_letters(message: str) -> str: function is_english (line 43) | def is_english( FILE: strings/dna.py function dna (line 4) | def dna(dna: str) -> str: FILE: strings/edit_distance.py function edit_distance (line 1) | def edit_distance(source: str, target: str) -> int: FILE: strings/frequency_finder.py function get_letter_count (line 38) | def get_letter_count(message: str) -> dict[str, int]: function get_item_at_index_zero (line 47) | def get_item_at_index_zero(x: tuple) -> str: function get_frequency_order (line 51) | def get_frequency_order(message: str) -> str: function english_freq_match_score (line 82) | def english_freq_match_score(message: str) -> int: FILE: strings/hamming_distance.py function hamming_distance (line 1) | def hamming_distance(string1: str, string2: str) -> int: FILE: strings/indian_phone_validator.py function indian_phone_validator (line 4) | def indian_phone_validator(phone: str) -> bool: FILE: strings/is_contains_unique_chars.py function is_contains_unique_chars (line 1) | def is_contains_unique_chars(input_str: str) -> bool: FILE: strings/is_isogram.py function is_isogram (line 6) | def is_isogram(string: str) -> bool: FILE: strings/is_pangram.py function is_pangram (line 6) | def is_pangram( function is_pangram_faster (line 35) | def is_pangram_faster( function is_pangram_fastest (line 59) | def is_pangram_fastest( function benchmark (line 77) | def benchmark() -> None: FILE: strings/is_polish_national_id.py function is_polish_national_id (line 1) | def is_polish_national_id(input_str: str) -> bool: FILE: strings/is_spain_national_id.py function is_spain_national_id (line 5) | def is_spain_national_id(spanish_id: str) -> bool: FILE: strings/is_srilankan_phone_number.py function is_sri_lankan_phone_number (line 4) | def is_sri_lankan_phone_number(phone: str) -> bool: FILE: strings/is_valid_email_address.py function is_valid_email_address (line 43) | def is_valid_email_address(email: str) -> bool: FILE: strings/jaro_winkler.py function jaro_winkler (line 4) | def jaro_winkler(str1: str, str2: str) -> float: FILE: strings/join.py function join (line 6) | def join(separator: str, separated: list[str]) -> str: FILE: strings/knuth_morris_pratt.py function knuth_morris_pratt (line 4) | def knuth_morris_pratt(text: str, pattern: str) -> int: function get_failure_array (line 45) | def get_failure_array(pattern: str) -> list[int]: FILE: strings/levenshtein_distance.py function levenshtein_distance (line 4) | def levenshtein_distance(first_word: str, second_word: str) -> int: function levenshtein_distance_optimized (line 54) | def levenshtein_distance_optimized(first_word: str, second_word: str) ->... function benchmark_levenshtein_distance (line 99) | def benchmark_levenshtein_distance(func: Callable) -> None: FILE: strings/lower.py function lower (line 1) | def lower(word: str) -> str: FILE: strings/manacher.py function palindromic_string (line 1) | def palindromic_string(input_string: str) -> str: FILE: strings/min_cost_string_conversion.py function compute_transform_tables (line 12) | def compute_transform_tables( function assemble_transformation (line 76) | def assemble_transformation(ops: list[list[str]], i: int, j: int) -> lis... FILE: strings/naive_string_search.py function naive_pattern_search (line 12) | def naive_pattern_search(s: str, pattern: str) -> list: FILE: strings/ngram.py function create_ngram (line 6) | def create_ngram(sentence: str, ngram_size: int) -> list[str]: FILE: strings/palindrome.py function is_palindrome (line 21) | def is_palindrome(s: str) -> bool: function is_palindrome_traversal (line 40) | def is_palindrome_traversal(s: str) -> bool: function is_palindrome_recursive (line 59) | def is_palindrome_recursive(s: str) -> bool: function is_palindrome_slice (line 74) | def is_palindrome_slice(s: str) -> bool: function benchmark_function (line 84) | def benchmark_function(name: str) -> None: FILE: strings/pig_latin.py function pig_latin (line 1) | def pig_latin(word: str) -> str: FILE: strings/prefix_function.py function prefix_function (line 14) | def prefix_function(input_string: str) -> list: function longest_prefix (line 44) | def longest_prefix(input_str: str) -> int: FILE: strings/rabin_karp.py function rabin_karp (line 7) | def rabin_karp(pattern: str, text: str) -> bool: function test_rabin_karp (line 54) | def test_rabin_karp() -> None: FILE: strings/remove_duplicate.py function remove_duplicates (line 1) | def remove_duplicates(sentence: str) -> str: FILE: strings/reverse_letters.py function reverse_letters (line 1) | def reverse_letters(sentence: str, length: int = 0) -> str: FILE: strings/reverse_words.py function reverse_words (line 1) | def reverse_words(sentence: str) -> str: FILE: strings/snake_case_to_camel_pascal_case.py function snake_to_camel_case (line 1) | def snake_to_camel_case(input_str: str, use_pascal: bool = False) -> str: FILE: strings/split.py function split (line 1) | def split(string: str, separator: str = " ") -> list: FILE: strings/string_switch_case.py function split_input (line 19) | def split_input(str_: str) -> list: function to_simple_case (line 27) | def to_simple_case(str_: str) -> str: function to_complex_case (line 44) | def to_complex_case(text: str, upper: bool, separator: str) -> str: function to_pascal_case (line 81) | def to_pascal_case(text: str) -> str: function to_camel_case (line 89) | def to_camel_case(text: str) -> str: function to_snake_case (line 101) | def to_snake_case(text: str, upper: bool) -> str: function to_kebab_case (line 111) | def to_kebab_case(text: str, upper: bool) -> str: FILE: strings/strip.py function strip (line 1) | def strip(user_string: str, characters: str = " \t\n\r") -> str: FILE: strings/text_justification.py function text_justification (line 1) | def text_justification(word: str, max_width: int) -> list: FILE: strings/title.py function to_title_case (line 1) | def to_title_case(word: str) -> str: function sentence_to_title_case (line 34) | def sentence_to_title_case(input_str: str) -> str: FILE: strings/top_k_frequent_words.py class WordCount (line 23) | class WordCount: method __init__ (line 24) | def __init__(self, word: str, count: int) -> None: method __eq__ (line 28) | def __eq__(self, other: object) -> bool: method __lt__ (line 45) | def __lt__(self, other: object) -> bool: function top_k_frequent_words (line 67) | def top_k_frequent_words(words: list[str], k_value: int) -> list[str]: FILE: strings/upper.py function upper (line 1) | def upper(word: str) -> str: FILE: strings/wave_string.py function wave (line 1) | def wave(txt: str) -> list: FILE: strings/wildcard_pattern_matching.py function match_pattern (line 10) | def match_pattern(input_string: str, pattern: str) -> bool: FILE: strings/word_occurrence.py function word_occurrence (line 6) | def word_occurrence(sentence: str) -> dict: FILE: strings/word_patterns.py function get_word_pattern (line 1) | def get_word_pattern(word: str) -> str: FILE: strings/z_function.py function z_function (line 13) | def z_function(input_str: str) -> list[int]: function go_next (line 52) | def go_next(i: int, z_result: list[int], s: str) -> bool: function find_pattern (line 59) | def find_pattern(pattern: str, input_str: str) -> int: FILE: web_programming/co2_emission.py function fetch_last_half_hour (line 20) | def fetch_last_half_hour() -> str: function fetch_from_to (line 26) | def fetch_from_to(start, end) -> list: FILE: web_programming/covid_stats_via_xpath.py class CovidData (line 22) | class CovidData(NamedTuple): function covid_stats (line 28) | def covid_stats( FILE: web_programming/crawl_google_scholar_citation.py function get_citation (line 18) | def get_citation(base_url: str, params: dict) -> str: FILE: web_programming/currency_converter.py function convert_currency (line 178) | def convert_currency( FILE: web_programming/current_stock_price.py function stock_price (line 23) | def stock_price(symbol: str = "AAPL") -> str: FILE: web_programming/current_weather.py function current_weather (line 19) | def current_weather(location: str) -> list[dict]: FILE: web_programming/daily_horoscope.py function horoscope (line 13) | def horoscope(zodiac_sign: int, day: str) -> str: FILE: web_programming/download_images_from_google_query.py function download_images_from_google_query (line 24) | def download_images_from_google_query(query: str = "dhaka", max_images: ... FILE: web_programming/emails_from_url.py class Parser (line 26) | class Parser(HTMLParser): method __init__ (line 27) | def __init__(self, domain: str) -> None: method handle_starttag (line 32) | def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]... function get_domain_name (line 47) | def get_domain_name(url: str) -> str: function get_sub_domain_name (line 60) | def get_sub_domain_name(url: str) -> str: function emails_from_url (line 70) | def emails_from_url(url: str = "https://github.com") -> list[str]: FILE: web_programming/fetch_anime_and_play.py function search_scraper (line 17) | def search_scraper(anime_name: str) -> list: function search_anime_episode_list (line 72) | def search_anime_episode_list(episode_endpoint: str) -> list: function get_anime_episode (line 125) | def get_anime_episode(episode_endpoint: str) -> list: FILE: web_programming/fetch_bbc_news.py function fetch_bbc_news (line 15) | def fetch_bbc_news(bbc_news_api_key: str) -> None: FILE: web_programming/fetch_github_info.py function fetch_github_info (line 44) | def fetch_github_info(auth_token: str) -> dict[Any, Any]: FILE: web_programming/fetch_jobs.py function fetch_jobs (line 23) | def fetch_jobs(location: str = "mumbai") -> Generator[tuple[str, str]]: FILE: web_programming/fetch_quotes.py function quote_of_the_day (line 23) | def quote_of_the_day() -> list: function random_quotes (line 27) | def random_quotes() -> list: FILE: web_programming/fetch_well_rx_price.py function fetch_pharmacy_and_price_list (line 14) | def fetch_pharmacy_and_price_list(drug_name: str, zip_code: str) -> list... FILE: web_programming/get_amazon_product_data.py function get_amazon_product_data (line 23) | def get_amazon_product_data(product: str = "laptop") -> DataFrame: FILE: web_programming/get_imdb_top_250_movies_csv.py function get_imdb_top_250_movies (line 17) | def get_imdb_top_250_movies(url: str = "") -> dict[str, float]: function write_movies (line 28) | def write_movies(filename: str = "IMDb_Top_250_Movies.csv") -> None: FILE: web_programming/get_ip_geolocation.py function get_ip_geolocation (line 12) | def get_ip_geolocation(ip_address: str) -> str: FILE: web_programming/get_top_billionaires.py function years_old (line 30) | def years_old(birth_timestamp: int, today: date | None = None) -> int: function get_forbes_real_time_billionaires (line 61) | def get_forbes_real_time_billionaires() -> list[dict[str, int | str]]: function display_billionaires (line 82) | def display_billionaires(forbes_billionaires: list[dict[str, int | str]]... FILE: web_programming/get_top_hn_posts.py function get_hackernews_story (line 13) | def get_hackernews_story(story_id: str) -> dict: function hackernews_top_stories (line 18) | def hackernews_top_stories(max_stories: int = 10) -> list[dict]: function hackernews_top_stories_as_markdown (line 27) | def hackernews_top_stories_as_markdown(max_stories: int = 10) -> str: FILE: web_programming/giphy.py function get_gifs (line 16) | def get_gifs(query: str, api_key: str = giphy_api_key) -> list: FILE: web_programming/instagram_crawler.py function extract_user_profile (line 23) | def extract_user_profile(script) -> dict: class InstagramUser (line 32) | class InstagramUser: method __init__ (line 44) | def __init__(self, username): method get_json (line 48) | def get_json(self) -> dict: method __repr__ (line 59) | def __repr__(self) -> str: method __str__ (line 62) | def __str__(self) -> str: method username (line 66) | def username(self) -> str: method fullname (line 70) | def fullname(self) -> str: method biography (line 74) | def biography(self) -> str: method email (line 78) | def email(self) -> str: method website (line 82) | def website(self) -> str: method number_of_followers (line 86) | def number_of_followers(self) -> int: method number_of_followings (line 90) | def number_of_followings(self) -> int: method number_of_posts (line 94) | def number_of_posts(self) -> int: method profile_picture_url (line 98) | def profile_picture_url(self) -> str: method is_verified (line 102) | def is_verified(self) -> bool: method is_private (line 106) | def is_private(self) -> bool: function test_instagram_user (line 110) | def test_instagram_user(username: str = "github") -> None: FILE: web_programming/instagram_pic.py function download_image (line 15) | def download_image(url: str) -> str: FILE: web_programming/instagram_video.py function download_video (line 13) | def download_video(url: str) -> bytes: FILE: web_programming/nasa_data.py function get_apod_data (line 11) | def get_apod_data(api_key: str) -> dict: function save_apod (line 20) | def save_apod(api_key: str, path: str = ".") -> dict: function get_archive_data (line 32) | def get_archive_data(query: str) -> dict: FILE: web_programming/random_anime_character.py function save_image (line 20) | def save_image(image_url: str, image_title: str) -> None: function random_anime_character (line 29) | def random_anime_character() -> tuple[str, str, str]: FILE: web_programming/recaptcha_verification.py function login_using_recaptcha (line 51) | def login_using_recaptcha(request): FILE: web_programming/reddit.py function get_subreddit_data (line 25) | def get_subreddit_data( FILE: web_programming/search_books_by_isbn.py function get_openlibrary_data (line 19) | def get_openlibrary_data(olid: str = "isbn/0140328726") -> dict: function summarize_book (line 40) | def summarize_book(ol_book_data: dict) -> dict: FILE: web_programming/slack_message.py function send_slack_message (line 13) | def send_slack_message(message_body: str, slack_url: str) -> None: FILE: web_programming/test_fetch_github_info.py function test_fetch_github_info (line 8) | def test_fetch_github_info(monkeypatch): FILE: web_programming/world_covid19_stats.py function world_covid19_stats (line 20) | def world_covid19_stats(