SYMBOL INDEX (693 symbols across 115 files) FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/check_permutation.py function check_permutation_sets (line 4) | def check_permutation_sets(string: str, potential_permutation_string: st... function check_permutation_sort (line 8) | def check_permutation_sort(string: str, potential_permutation_string: st... function check_permutation_array (line 12) | def check_permutation_array(string: str, potential_permutation_string: s... function test_algorithm (line 45) | def test_algorithm(function, string, potential_permutation_string, is_pe... FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/is_unique.py function check_if_has_unique_characters_pythonic (line 4) | def check_if_has_unique_characters_pythonic(string: str) -> bool: function check_if_has_unique_characters_ascii (line 8) | def check_if_has_unique_characters_ascii(string: str) -> bool: function check_if_has_unique_characters_no_structures (line 18) | def check_if_has_unique_characters_no_structures(string: str) -> bool: function check_if_has_unique_characters_no_structures_sort (line 26) | def check_if_has_unique_characters_no_structures_sort(string: str) -> bool: function test_algorithm (line 50) | def test_algorithm(function, string, has_all_unique_chars): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/one_away.py function is_one_edit_away_pythonic (line 4) | def is_one_edit_away_pythonic(string: str, edit: str) -> bool: function is_one_edit_away_loop (line 14) | def is_one_edit_away_loop(string: str, edit: str) -> bool: function test_algorithm (line 55) | def test_algorithm(function, string, edit, expected_result): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/palindrome_permutation.py function is_palindrome_permutation_pythonic (line 6) | def is_palindrome_permutation_pythonic(string: str) -> bool: function is_palindrome_permutation_counter (line 16) | def is_palindrome_permutation_counter(string: str) -> bool: function test_algorithm (line 48) | def test_algorithm(function, string, expected_result): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/rotate_matrix.py function rotate_matrix_list_comprehension (line 6) | def rotate_matrix_list_comprehension(matrix: List[List[int]]) -> List[Li... function rotate_matrix_zip (line 14) | def rotate_matrix_zip(matrix: List[List[int]]) -> List[List[int]]: function test_algorithm (line 42) | def test_algorithm(function, matrix, rotated_matrix): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/string_compression.py function compress_string (line 6) | def compress_string(text: str) -> str: function test_algorithm (line 32) | def test_algorithm(text, expected_result): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/string_rotation.py function is_rotated (line 4) | def is_rotated(string: str, rotated_string: str) -> bool: function test_algorithm (line 18) | def test_algorithm(string, rotated_string, expected_result): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/urlify.py function urlify_pythonic (line 4) | def urlify_pythonic(url: str) -> str: function urlify_array (line 8) | def urlify_array(url: str) -> str: function test_algorithm (line 45) | def test_algorithm(function, url, expected_url): FILE: books/cracking-coding-interview/src/ch01_arrays_and_strings/zero_matrix.py function nullify_loop (line 6) | def nullify_loop(matrix: List[List[int]]) -> List[List[int]]: function nullify_in_place (line 25) | def nullify_in_place(matrix: List[List[int]]) -> List[List[int]]: function test_algorithm (line 65) | def test_algorithm(function, matrix, rotated_matrix): FILE: books/cracking-coding-interview/src/ch02_linked_lists/delete_middle_node.py function delete_middle_node (line 9) | def delete_middle_node(node: Node) -> None: function test_algorithm (line 22) | def test_algorithm(values, node, expected_result): FILE: books/cracking-coding-interview/src/ch02_linked_lists/intersection.py function intersection (line 11) | def intersection(list_0: LinkedList, list_1: LinkedList) -> Optional[Node]: function test_algorithm (line 50) | def test_algorithm(list_0, list_0_tail, list_1, list_1_tail, expected_re... FILE: books/cracking-coding-interview/src/ch02_linked_lists/linked_list.py class Node (line 9) | class Node: method __init__ (line 10) | def __init__(self, data: int) -> None: class LinkedList (line 15) | class LinkedList: method __init__ (line 16) | def __init__(self, data: List[int]) -> None: method values (line 22) | def values(self) -> List[int]: method tail (line 30) | def tail(self) -> Optional[Node]: method length (line 37) | def length(self) -> int: method node_for_value (line 40) | def node_for_value(self, val: int) -> Optional[Node]: method append (line 48) | def append(self, data: int) -> None: method delete (line 51) | def delete(self, data: int) -> None: function delete (line 55) | def delete(head: Optional[Node], data: int) -> Optional[Node]: function append (line 73) | def append(head: Optional[Node], data: int) -> Optional[Node]: function test_append (line 91) | def test_append(values): function test_delete (line 105) | def test_delete(values, to_delete, expected_result): function test_node_for_value (line 117) | def test_node_for_value(values, value, expected_node_val): function test_tail (line 129) | def test_tail(values, expected_tail): FILE: books/cracking-coding-interview/src/ch02_linked_lists/loop_detection.py function get_loop (line 11) | def get_loop(linked_list: LinkedList) -> Optional[Node]: function test_algorithm (line 46) | def test_algorithm(linked_list, expected_result): FILE: books/cracking-coding-interview/src/ch02_linked_lists/palindrome.py function is_palindrome_simple (line 9) | def is_palindrome_simple(linked_list: LinkedList) -> bool: function is_palindrome_reverse (line 14) | def is_palindrome_reverse(linked_list: LinkedList) -> bool: function is_palindrome_slow_fast_runner (line 39) | def is_palindrome_slow_fast_runner(linked_list: LinkedList) -> bool: function test_algorithm (line 74) | def test_algorithm(function, values, expected_result): FILE: books/cracking-coding-interview/src/ch02_linked_lists/partition.py function partition (line 7) | def partition(linked_list: LinkedList, partition_val: int) -> Tuple[Link... function test_algorithm (line 28) | def test_algorithm(values, partition_val, expected_values): FILE: books/cracking-coding-interview/src/ch02_linked_lists/remove_dups.py function remove_duplicates_buffer (line 6) | def remove_duplicates_buffer(linked_list: LinkedList) -> LinkedList: function remove_duplicates_no_buffer (line 21) | def remove_duplicates_no_buffer(linked_list: LinkedList) -> LinkedList: function test_algorithm (line 52) | def test_algorithm(function, values, expected_result): FILE: books/cracking-coding-interview/src/ch02_linked_lists/return_kth_to_last.py function return_kth_to_last_simple (line 11) | def return_kth_to_last_simple(linked_list: LinkedList, k: int) -> int: function return_kth_to_last_simplest (line 25) | def return_kth_to_last_simplest(linked_list: LinkedList, k: int) -> int: function return_kth_to_last_recursive (line 32) | def return_kth_to_last_recursive(linked_list: LinkedList, k: int) -> int: function return_kth_to_last_iterative (line 52) | def return_kth_to_last_iterative(linked_list: LinkedList, k: int) -> int: function test_algorithm (line 81) | def test_algorithm(function, values, k, expected_result): FILE: books/cracking-coding-interview/src/ch02_linked_lists/sum_lists.py function sum_lists (line 9) | def sum_lists(list_0: LinkedList, list_1: LinkedList) -> LinkedList: function test_algorithm (line 46) | def test_algorithm(list_0, list_1, expected_result): FILE: books/go/ch01/hello.go function main (line 5) | func main() { FILE: books/go/ch02/const.go constant x (line 5) | x int64 = 10 constant idKey (line 8) | idKey = "id" constant nameKey (line 9) | nameKey = "name" constant z (line 12) | z = 20 * 20 function main (line 14) | func main() { FILE: books/go/ch02/unicode.go function main (line 5) | func main() { FILE: books/go/ch03/types.go function main (line 5) | func main() { FILE: books/go/ch04/case.go function main (line 5) | func main() { FILE: books/go/ch04/for.go function main (line 7) | func main() { function completeFor (line 15) | func completeFor() { function conditionOnlyFor (line 21) | func conditionOnlyFor() { function infiniteFor (line 29) | func infiniteFor() { function forRange (line 36) | func forRange() { function labelingStatements (line 56) | func labelingStatements() { FILE: books/go/ch04/if.go function main (line 8) | func main() { FILE: books/go/ch05/anonymous.go function main (line 5) | func main() { FILE: books/go/ch05/deferExample.go function getFile (line 9) | func getFile(name string) (*os.File, func(), error) { function main (line 19) | func main() { FILE: books/go/ch05/functionAsParam.go type Person (line 8) | type Person struct function main (line 14) | func main() { FILE: books/go/ch05/functions.go function main (line 8) | func main() { function Div (line 27) | func Div(numerator int, denominator int) int { type MyFuncOpts (line 34) | type MyFuncOpts struct function MyFunc (line 40) | func MyFunc(opts MyFuncOpts) int { function addTo (line 44) | func addTo(base int, vals ...int) []int { function divAndRemainder (line 52) | func divAndRemainder(numerator int, denominator int) (result int, remain... FILE: books/go/ch05/functionsAreValues.go function main (line 5) | func main() { function add (line 16) | func add(i int, j int) int { return i + j } function sub (line 17) | func sub(i int, j int) int { return i - j } function mul (line 18) | func mul(i int, j int) int { return i * j } function div (line 19) | func div(i int, j int) int { return i / j } FILE: books/go/ch05/returnFunction.go function makeMult (line 5) | func makeMult(base int) func(int) int { function main (line 11) | func main() { FILE: books/go/ch06/pointers.go function failedUpdate (line 5) | func failedUpdate(px *int) { function update (line 10) | func update(px *int) { function main (line 14) | func main() { FILE: books/go/ch07/counter.go type Counter (line 8) | type Counter struct method Increment (line 13) | func (c *Counter) Increment() { method String (line 18) | func (c Counter) String() string { function updateWrong (line 22) | func updateWrong(c Counter) { function updateRight (line 27) | func updateRight(c *Counter) { function main (line 32) | func main() { FILE: books/go/ch07/dependencyInjection.go function LogOutput (line 9) | func LogOutput(message string) { type SimpleDataStore (line 13) | type SimpleDataStore struct method UserNameForId (line 17) | func (sds SimpleDataStore) UserNameForId(userID string) (string, bool) { function NewSimpleDataStore (line 22) | func NewSimpleDataStore() SimpleDataStore { type DataStore (line 32) | type DataStore interface type Logger (line 36) | type Logger interface type LoggerAdapter (line 40) | type LoggerAdapter method Log (line 42) | func (lg LoggerAdapter) Log(message string) { type SimpleLogic (line 46) | type SimpleLogic struct method SayHello (line 51) | func (sl SimpleLogic) SayHello(userID string) (string, error) { method SayGoodbye (line 60) | func (sl SimpleLogic) SayGoodbye(userID string) (string, error) { function NewSimpleLogic (line 69) | func NewSimpleLogic(l Logger, ds DataStore) SimpleLogic { type MyLogic (line 76) | type MyLogic interface type Controller (line 80) | type Controller struct method SayHello (line 85) | func (c Controller) SayHello(w http.ResponseWriter, r *http.Request) { function NewController (line 97) | func NewController(l Logger, logic MyLogic) Controller { function main (line 104) | func main() { FILE: books/go/ch07/embedding.go type Employee (line 5) | type Employee struct method Description (line 10) | func (e Employee) Description() string { type Manager (line 14) | type Manager struct function main (line 19) | func main() { FILE: books/go/ch07/intTree.go type IntTree (line 5) | type IntTree struct method Insert (line 10) | func (it *IntTree) Insert(val int) *IntTree { method Contains (line 24) | func (it *IntTree) Contains(val int) bool { function main (line 37) | func main() { FILE: books/go/ch07/interfaces.go type LogicProvider (line 5) | type LogicProvider struct method Process (line 7) | func (lp LogicProvider) Process(data string) string { type Logic (line 11) | type Logic interface type Client (line 15) | type Client struct method Program (line 19) | func (c Client) Program() { function main (line 24) | func main() { FILE: books/go/ch07/iota.go type MailCategory (line 3) | type MailCategory constant Uncategorized (line 6) | Uncategorized MailCategory = iota constant Personal (line 7) | Personal constant Spam (line 8) | Spam constant Social (line 9) | Social constant Ads (line 10) | Ads FILE: books/go/ch07/types.go type Person (line 5) | type Person struct method String (line 13) | func (p Person) String() string { type King (line 11) | type King type Score (line 17) | type Score type Converter (line 18) | type Converter type TeamScore (line 19) | type TeamScore function main (line 21) | func main() { FILE: books/go/ch08/customErrors.go type Status (line 3) | type Status constant InvalidLogin (line 6) | InvalidLogin Status = iota + 1 constant NotFound (line 7) | NotFound type StatusErr (line 10) | type StatusErr struct method Error (line 16) | func (se StatusErr) Error() string { method Unwrap (line 20) | func (se StatusErr) Unwrap() error { FILE: books/go/ch08/errors.go function calcRemainderAndMod (line 9) | func calcRemainderAndMod(numerator, denominator int) (int, int, error) { function main (line 16) | func main() { FILE: books/go/ch08/panic.go function doPanic (line 3) | func doPanic(msg string) { function main (line 7) | func main() { FILE: books/go/ch08/recover.go function div60 (line 5) | func div60(i int) { function main (line 14) | func main() { FILE: books/go/ch08/sentinel.go type Sentinel (line 9) | type Sentinel method Error (line 11) | func (s Sentinel) Error() string { constant ErrFoo (line 16) | ErrFoo = Sentinel("foo err") constant ErrBar (line 17) | ErrBar = Sentinel("bar err") function main (line 20) | func main() { FILE: books/go/ch08/wrappingErrors.go function fileChecker (line 9) | func fileChecker(name string) error { function main (line 19) | func main() { FILE: books/go/ch09/formatter/formatter.go function Format (line 5) | func Format(num int) string { FILE: books/go/ch09/main.go function main (line 9) | func main() { FILE: books/go/ch09/math/math.go function Double (line 3) | func Double(a int) int { FILE: books/go/ch10/deadlock.go function main (line 5) | func main() { FILE: books/go/ch10/deadlockSolution.go function main (line 5) | func main() { FILE: books/go/ch10/goroutinesExample.go function process (line 3) | func process(val int) int { function runThingConcurrently (line 7) | func runThingConcurrently(in <-chan int, out chan<- int) { FILE: books/head-first-design-patterns/ch_01_strategy.py class FlyBehavior (line 1) | class FlyBehavior: method fly (line 2) | def fly(self) -> None: class QuackBehavior (line 6) | class QuackBehavior: method quack (line 7) | def quack(self) -> None: class Duck (line 11) | class Duck: method __init__ (line 12) | def __init__(self, fly_behavior: FlyBehavior, quack_behavior: QuackBeh... method perform_fly (line 16) | def perform_fly(self) -> None: method perform_quack (line 19) | def perform_quack(self) -> None: method display (line 22) | def display(self) -> None: class FlyWithWings (line 26) | class FlyWithWings(FlyBehavior): method fly (line 27) | def fly(self) -> None: class FlyNoWay (line 31) | class FlyNoWay(FlyBehavior): method fly (line 32) | def fly(self) -> None: class Quack (line 36) | class Quack(QuackBehavior): method quack (line 37) | def quack(self) -> None: class Squeak (line 41) | class Squeak(QuackBehavior): method quack (line 42) | def quack(self) -> None: class MuteQuack (line 46) | class MuteQuack(QuackBehavior): method quack (line 47) | def quack(self) -> None: class MallardDuck (line 51) | class MallardDuck(Duck): method __init__ (line 52) | def __init__(self) -> None: method display (line 55) | def display(self) -> None: FILE: books/head-first-design-patterns/ch_02_observer.py class Observer (line 1) | class Observer: method update (line 2) | def update(self) -> None: class Subject (line 6) | class Subject: method register_observer (line 7) | def register_observer(self, observer: Observer) -> None: method remove_observer (line 10) | def remove_observer(self, observer: Observer) -> None: method notify_observers (line 13) | def notify_observers(self) -> None: class DisplayElement (line 17) | class DisplayElement: method display (line 18) | def display(self) -> None: class WeatherData (line 22) | class WeatherData(Subject): method __init__ (line 23) | def __init__(self): method register_observer (line 29) | def register_observer(self, observer: Observer) -> None: method remove_observer (line 32) | def remove_observer(self, observer: Observer) -> None: method notify_observers (line 35) | def notify_observers(self) -> None: method set_measurements (line 39) | def set_measurements(self, temperature: float, humidity: float, pressu... class CurrentConditionsDisplay (line 46) | class CurrentConditionsDisplay(Observer, DisplayElement): method __init__ (line 47) | def __init__(self, weather_data: WeatherData): method display (line 53) | def display(self) -> None: method update (line 56) | def update(self) -> None: class AvgTempDisplay (line 62) | class AvgTempDisplay(Observer, DisplayElement): method __init__ (line 63) | def __init__(self, weather_data: WeatherData): method display (line 68) | def display(self) -> None: method update (line 71) | def update(self) -> None: FILE: books/head-first-design-patterns/ch_03_decorator.py class Beverage (line 1) | class Beverage: method description (line 3) | def description(self) -> str: method cost (line 7) | def cost(self) -> float: class CondimentDecorator (line 11) | class CondimentDecorator(Beverage): method __init__ (line 12) | def __init__(self, beverage: Beverage): method description (line 16) | def description(self) -> str: method cost (line 20) | def cost(self) -> float: class Espresso (line 24) | class Espresso(Beverage): method cost (line 26) | def cost(self) -> float: class HouseBlend (line 30) | class HouseBlend(Beverage): method cost (line 32) | def cost(self) -> float: class Mocha (line 36) | class Mocha(CondimentDecorator): method cost (line 38) | def cost(self) -> float: class Soy (line 42) | class Soy(CondimentDecorator): method cost (line 44) | def cost(self) -> float: FILE: books/head-first-design-patterns/ch_04_factory.py class Ingredient (line 1) | class Ingredient: method __init__ (line 2) | def __init__(self): class ThinCrustDough (line 6) | class ThinCrustDough(Ingredient): class ThickCrustDough (line 10) | class ThickCrustDough(Ingredient): class MarinaraSauce (line 14) | class MarinaraSauce(Ingredient): class PlumTomatoSauce (line 18) | class PlumTomatoSauce(Ingredient): class MozzarellaCheese (line 22) | class MozzarellaCheese(Ingredient): class ReggianoCheese (line 26) | class ReggianoCheese(Ingredient): class Garlic (line 30) | class Garlic(Ingredient): class Onion (line 34) | class Onion(Ingredient): class Mushroom (line 38) | class Mushroom(Ingredient): class SlicedPepperoni (line 42) | class SlicedPepperoni(Ingredient): class FreshClams (line 46) | class FreshClams(Ingredient): class FrozenClams (line 50) | class FrozenClams(Ingredient): class PizzaIngredientFactory (line 54) | class PizzaIngredientFactory: method create_dough (line 55) | def create_dough(self): method create_sauce (line 58) | def create_sauce(self): method create_cheese (line 61) | def create_cheese(self): method create_veggies (line 64) | def create_veggies(self): method create_pepperoni (line 67) | def create_pepperoni(self): method create_clam (line 70) | def create_clam(self): class NYPizzaIngredientFactory (line 74) | class NYPizzaIngredientFactory(PizzaIngredientFactory): method create_dough (line 75) | def create_dough(self): method create_sauce (line 78) | def create_sauce(self): method create_cheese (line 81) | def create_cheese(self): method create_veggies (line 84) | def create_veggies(self): method create_pepperoni (line 87) | def create_pepperoni(self): method create_clam (line 90) | def create_clam(self): class ChicagoPizzaIngredientFactory (line 94) | class ChicagoPizzaIngredientFactory(PizzaIngredientFactory): method create_dough (line 95) | def create_dough(self): method create_sauce (line 98) | def create_sauce(self): method create_cheese (line 101) | def create_cheese(self): method create_veggies (line 104) | def create_veggies(self): method create_pepperoni (line 107) | def create_pepperoni(self): method create_clam (line 110) | def create_clam(self): class Pizza (line 114) | class Pizza: method __init__ (line 117) | def __init__(self, ingredient_factory: PizzaIngredientFactory): method prepare (line 120) | def prepare(self) -> None: method bake (line 123) | def bake(self) -> None: method cut (line 126) | def cut(self) -> None: method box (line 129) | def box(self) -> None: class CheesePizza (line 133) | class CheesePizza(Pizza): method prepare (line 134) | def prepare(self) -> None: class ClamPizza (line 141) | class ClamPizza(Pizza): method prepare (line 142) | def prepare(self) -> None: class PizzaStore (line 150) | class PizzaStore: method order_pizza (line 151) | def order_pizza(self, pizza_type: str) -> Pizza: method create_pizza (line 162) | def create_pizza(self, pizza_type: str) -> Pizza: class NYPizzaStore (line 166) | class NYPizzaStore(PizzaStore): method create_pizza (line 167) | def create_pizza(self, pizza_type: str) -> Pizza: class ChicagoPizzaStore (line 183) | class ChicagoPizzaStore(PizzaStore): method create_pizza (line 184) | def create_pizza(self, pizza_type: str) -> Pizza: FILE: books/head-first-design-patterns/ch_05_singleton.py class ChocolateBoiler (line 1) | class ChocolateBoiler: method __new__ (line 4) | def __new__(cls): class ChocolateBoiler (line 19) | class ChocolateBoiler: method __new__ (line 4) | def __new__(cls): function get_chocolate_boiler (line 28) | def get_chocolate_boiler() -> ChocolateBoiler: function get_chocolate_boiler (line 40) | def get_chocolate_boiler() -> ChocolateBoiler: FILE: books/head-first-design-patterns/ch_06_command.py class Device (line 4) | class Device: method name (line 6) | def name(self) -> str: method on (line 9) | def on(self) -> None: method off (line 12) | def off(self) -> None: class Light (line 16) | class Light(Device): class Tv (line 20) | class Tv(Device): class Stereo (line 24) | class Stereo(Device): method __init__ (line 25) | def __init__(self) -> None: method set_cd (line 28) | def set_cd(self) -> None: method set_volume (line 31) | def set_volume(self, volume: int) -> None: class Command (line 36) | class Command: method execute (line 37) | def execute(self) -> None: method undo (line 40) | def undo(self) -> None: class NoCommand (line 44) | class NoCommand(Command): method execute (line 45) | def execute(self) -> None: method undo (line 48) | def undo(self) -> None: class MarcoCommand (line 52) | class MarcoCommand(Command): method __init__ (line 53) | def __init__(self, commands: List[Command]): method execute (line 56) | def execute(self) -> None: method undo (line 60) | def undo(self) -> None: class DeviceOnCommand (line 65) | class DeviceOnCommand(Command): method __init__ (line 66) | def __init__(self, device: Device) -> None: method execute (line 69) | def execute(self) -> None: method undo (line 72) | def undo(self) -> None: class DeviceOffCommand (line 76) | class DeviceOffCommand(Command): method __init__ (line 77) | def __init__(self, device: Device) -> None: method execute (line 80) | def execute(self) -> None: method undo (line 83) | def undo(self) -> None: class StereoVolumeUpCommand (line 87) | class StereoVolumeUpCommand(Command): method __init__ (line 88) | def __init__(self, stereo: Stereo) -> None: method execute (line 91) | def execute(self) -> None: method undo (line 94) | def undo(self) -> None: class RemoteControl (line 98) | class RemoteControl: method __init__ (line 99) | def __init__(self): method set_command (line 104) | def set_command(self, slot: int, on_command: Command, off_command: Com... method on_button_pushed (line 108) | def on_button_pushed(self, slot: int) -> None: method off_button_pushed (line 112) | def off_button_pushed(self, slot: int) -> None: method undo_button_pushed (line 116) | def undo_button_pushed(self) -> None: FILE: books/head-first-design-patterns/ch_07_adapter.py class Duck (line 1) | class Duck: method quack (line 2) | def quack(self) -> None: method fly (line 5) | def fly(self) -> None: class Turkey (line 9) | class Turkey: method gobble (line 10) | def gobble(self) -> None: method fly (line 13) | def fly(self) -> None: class WildTurkey (line 17) | class WildTurkey(Turkey): method gobble (line 18) | def gobble(self) -> None: method fly (line 21) | def fly(self) -> None: class TurkeyAdapter (line 25) | class TurkeyAdapter(Duck): method __init__ (line 26) | def __init__(self, turkey: Turkey): method quack (line 29) | def quack(self) -> None: method fly (line 32) | def fly(self) -> None: FILE: books/head-first-design-patterns/ch_07_facade.py class HomeTheaterFacade (line 4) | class HomeTheaterFacade: method __init__ (line 5) | def __init__(self, amplifier, tuner, projector, lights, screen, player... method watch_movie (line 15) | def watch_movie(self, movie): FILE: books/head-first-design-patterns/ch_08_template_method.py class CaffeineBeverage (line 1) | class CaffeineBeverage: method prepare_recipe (line 2) | def prepare_recipe(self) -> None: method _boil_water (line 8) | def _boil_water(self) -> None: method _pour_in_cup (line 11) | def _pour_in_cup(self) -> None: method _brew (line 14) | def _brew(self) -> None: method _add_condiments (line 17) | def _add_condiments(self) -> None: class Tea (line 21) | class Tea(CaffeineBeverage): method _brew (line 22) | def _brew(self) -> None: method _add_condiments (line 25) | def _add_condiments(self) -> None: class Coffee (line 29) | class Coffee(CaffeineBeverage): method _brew (line 30) | def _brew(self) -> None: method _add_condiments (line 33) | def _add_condiments(self) -> None: FILE: books/head-first-design-patterns/ch_09_composite.py class MenuComponent (line 7) | class MenuComponent: method add (line 8) | def add(self, menu_component: MenuComponent): method remove (line 11) | def remove(self, menu_component: MenuComponent): method get_child (line 14) | def get_child(self, i: int): method print (line 17) | def print(self): class MenuItem (line 22) | class MenuItem(MenuComponent, ABC): method print (line 28) | def print(self): class Menu (line 32) | class Menu(MenuComponent): method __init__ (line 33) | def __init__(self, name: str): method add (line 37) | def add(self, menu_component: MenuComponent): method remove (line 40) | def remove(self, menu_component: MenuComponent): method get_child (line 43) | def get_child(self, i: int): method print (line 46) | def print(self): class Waitress (line 52) | class Waitress: method __init__ (line 53) | def __init__(self, menu_component: MenuComponent): method print_menu (line 56) | def print_menu(self): FILE: books/head-first-design-patterns/ch_09_iterator.py class MenuItem (line 11) | class MenuItem: class DinnerMenuIterator (line 18) | class DinnerMenuIterator(Iterator): method __init__ (line 20) | def __init__(self, collection: List[MenuItem]): method __next__ (line 24) | def __next__(self) -> MenuItem: class DinnerMenu (line 34) | class DinnerMenu: method __iter__ (line 43) | def __iter__(self) -> DinnerMenuIterator: class BreakfastMenuIterator (line 48) | class BreakfastMenuIterator(Iterator): method __init__ (line 50) | def __init__(self, collection: Dict[str, MenuItem]): method __next__ (line 54) | def __next__(self) -> MenuItem: class BreakfastMenu (line 64) | class BreakfastMenu: method __iter__ (line 72) | def __iter__(self) -> BreakfastMenuIterator: class Waitress (line 77) | class Waitress: method __init__ (line 78) | def __init__(self, pancake_menu: BreakfastMenu, dinner_menu: DinnerMenu): method print_menu (line 82) | def print_menu(self): method _print_menu (line 89) | def _print_menu(menu: Union[BreakfastMenu, DinnerMenu]): FILE: books/head-first-design-patterns/ch_10_state.py class State (line 6) | class State: method __init__ (line 7) | def __init__(self, gumball_machine: GumballMachine): method insert_quarter (line 10) | def insert_quarter(self) -> None: method eject_quarter (line 13) | def eject_quarter(self) -> None: method turn_crank (line 16) | def turn_crank(self) -> None: method dispense (line 19) | def dispense(self) -> None: class NoQuarterState (line 23) | class NoQuarterState(State): method insert_quarter (line 24) | def insert_quarter(self) -> None: class HasQuarterState (line 29) | class HasQuarterState(State): method eject_quarter (line 30) | def eject_quarter(self) -> None: method turn_crank (line 34) | def turn_crank(self) -> None: class SoldState (line 43) | class SoldState(State): method dispense (line 44) | def dispense(self) -> None: class SoldOutState (line 54) | class SoldOutState(State): class WinnerState (line 58) | class WinnerState(State): method dispense (line 59) | def dispense(self) -> None: class GumballMachine (line 75) | class GumballMachine: method __init__ (line 76) | def __init__(self, count: int): method insert_quarter (line 87) | def insert_quarter(self) -> None: method eject_quarter (line 90) | def eject_quarter(self) -> None: method turn_crank (line 93) | def turn_crank(self) -> None: method release_ball (line 97) | def release_ball(self) -> None: FILE: books/head-first-design-patterns/ch_11_virtual_proxy.py class Icon (line 1) | class Icon: method width (line 3) | def width(self) -> int: method height (line 7) | def height(self) -> int: method paint_icon (line 10) | def paint_icon(self) -> None: class ImageIcon (line 14) | class ImageIcon(Icon): method width (line 16) | def width(self) -> int: method height (line 20) | def height(self) -> int: method paint_icon (line 23) | def paint_icon(self) -> None: class ImageProxy (line 27) | class ImageProxy(Icon): method __init__ (line 28) | def __init__(self, url: str): method width (line 34) | def width(self) -> int: method height (line 38) | def height(self) -> int: method paint_icon (line 41) | def paint_icon(self) -> None: FILE: books/pytest/src/api.py class Card (line 22) | class Card: method from_dict (line 29) | def from_dict(cls, d): method to_dict (line 32) | def to_dict(self): class CardsException (line 36) | class CardsException(Exception): class MissingSummary (line 40) | class MissingSummary(CardsException): class InvalidCardId (line 44) | class InvalidCardId(CardsException): class CardsDB (line 48) | class CardsDB: method __init__ (line 49) | def __init__(self, db_path): method add_card (line 53) | def add_card(self, card: Card) -> int: method get_card (line 63) | def get_card(self, card_id: int) -> Card: method list_cards (line 71) | def list_cards(self, owner=None, state=None): function count (line 91) | def count(self) -> int: function update_card (line 95) | def update_card(self, card_id: int, card_mods: Card) -> None: function start (line 102) | def start(self, card_id: int): function finish (line 106) | def finish(self, card_id: int): function delete_card (line 110) | def delete_card(self, card_id: int) -> None: function delete_all (line 117) | def delete_all(self) -> None: function close (line 121) | def close(self): function path (line 124) | def path(self): FILE: books/pytest/src/cli.py function version (line 18) | def version(): function add (line 24) | def add( function delete (line 34) | def delete(card_id: int): function list_cards (line 44) | def list_cards( function update (line 67) | def update( function start (line 84) | def start(card_id: int): function finish (line 94) | def finish(card_id: int): function config (line 104) | def config(): function count (line 111) | def count(): function main (line 118) | def main(ctx: typer.Context): function get_path (line 126) | def get_path(): function cards_db (line 136) | def cards_db(): FILE: books/pytest/src/db.py class DB (line 7) | class DB: method __init__ (line 8) | def __init__(self, db_path, db_file_prefix): method create (line 13) | def create(self, item: dict) -> int: method read (line 17) | def read(self, id: int): method read_all (line 21) | def read_all(self): method update (line 24) | def update(self, id: int, mods) -> None: method delete (line 28) | def delete(self, id: int) -> None: method delete_all (line 31) | def delete_all(self) -> None: method count (line 34) | def count(self) -> int: method close (line 37) | def close(self): FILE: books/pytest/tests/ch_02/test_card.py function test_field_access (line 6) | def test_field_access(): function test_defaults (line 11) | def test_defaults(): function test_equality (line 16) | def test_equality(): function test_equality_with_different_ids (line 20) | def test_equality_with_different_ids(): function test_inequality (line 24) | def test_inequality(): function test_to_dict (line 28) | def test_to_dict(): function test_from_dict (line 37) | def test_from_dict(): FILE: books/pytest/tests/ch_02/test_classes.py class TestEquality (line 4) | class TestEquality: method test_equality (line 5) | def test_equality(self): method test_equality_with_different_ids (line 8) | def test_equality_with_different_ids(self): method test_inequality (line 11) | def test_inequality(self): FILE: books/pytest/tests/ch_02/test_exceptions.py function test_no_path_raises (line 5) | def test_no_path_raises(): function test_raises_with_info (line 10) | def test_raises_with_info(): FILE: books/pytest/tests/ch_02/test_helper.py function assert_identical (line 6) | def assert_identical(c1: Card, c2: Card): function test_identical (line 15) | def test_identical(): function test_identical_fail (line 20) | def test_identical_fail(): FILE: books/pytest/tests/ch_03/conftest.py function db (line 13) | def db(): function cards_db (line 22) | def cards_db(db): function some_cards (line 28) | def some_cards(): FILE: books/pytest/tests/ch_03/test_autouse.py function non_empty_db (line 12) | def non_empty_db(cards_db, some_cards): function footer_session_scope (line 19) | def footer_session_scope(): function footer_function_scope (line 28) | def footer_function_scope(): function test_1 (line 35) | def test_1(): function test_2 (line 39) | def test_2(): FILE: books/pytest/tests/ch_03/test_count.py function test_empty (line 4) | def test_empty(cards_db): function test_two (line 8) | def test_two(cards_db): function test_three (line 14) | def test_three(cards_db): FILE: books/pytest/tests/ch_03/test_count_initial.py function test_empty (line 7) | def test_empty(): FILE: books/pytest/tests/ch_03/test_fixtures.py function some_data (line 5) | def some_data(): function test_some_data (line 9) | def test_some_data(some_data): FILE: books/pytest/tests/ch_03/test_rename_fixture.py function ultimate_answer_fixture (line 5) | def ultimate_answer_fixture(): function test_everything (line 9) | def test_everything(ultimate_answer): FILE: books/pytest/tests/ch_03/test_some.py function non_empty_db (line 5) | def non_empty_db(cards_db, some_cards): function test_add_some (line 11) | def test_add_some(cards_db, some_cards): function test_non_empty (line 18) | def test_non_empty(non_empty_db): FILE: books/pytest/tests/ch_04/conftest.py function db (line 6) | def db(tmp_path_factory): FILE: books/pytest/tests/ch_04/test_config.py function run_cards (line 5) | def run_cards(*params): function test_run_cards (line 11) | def test_run_cards(): function test_patch_get_path (line 15) | def test_patch_get_path(monkeypatch, tmp_path): function test_patch_home (line 23) | def test_patch_home(monkeypatch, tmp_path): function test_patch_env_var (line 33) | def test_patch_env_var(monkeypatch, tmp_path): FILE: books/pytest/tests/ch_04/test_tmp.py function test_tmp_path (line 1) | def test_tmp_path(tmp_path): function test_tmp_path_factory (line 7) | def test_tmp_path_factory(tmp_path_factory): FILE: books/pytest/tests/ch_04/test_version.py function test_version (line 6) | def test_version(capsys): function test_version_v2 (line 12) | def test_version_v2(): FILE: books/pytest/tests/ch_05/test_parametrize.py function db (line 10) | def db(tmp_path_factory): function cards_db (line 18) | def cards_db(db): function test_finish (line 24) | def test_finish(cards_db, initial_state): function start_state (line 35) | def start_state(request): function test_finish_v2 (line 39) | def test_finish_v2(cards_db, start_state): function pytest_generate_tests (line 49) | def pytest_generate_tests(metafunc): function test_finish_v3 (line 54) | def test_finish_v3(cards_db, start_state_2): FILE: books/pytest/tests/ch_06/test_builtin.py function test_less_than_skip (line 15) | def test_less_than_skip(): function test_less_than_skipif (line 23) | def test_less_than_skipif(): function test_less_than_xfail (line 31) | def test_less_than_xfail(): function test_xpass (line 36) | def test_xpass(): function test_xpass_strict (line 42) | def test_xpass_strict(): FILE: books/pytest/tests/ch_06/test_custom.py function db (line 12) | def db(tmp_path_factory): function cards_db (line 20) | def cards_db(db): function test_start (line 26) | def test_start(cards_db): function test_start_non_existent (line 34) | def test_start_non_existent(cards_db): FILE: books/pytest/tests/ch_06/text_combination.py function db (line 9) | def db(tmp_path_factory): function cards_db (line 17) | def cards_db(db, request, faker): function test_zero (line 30) | def test_zero(cards_db): function test_three (line 35) | def test_three(cards_db): FILE: books/pytest/tests/ch_12/hello.py function main (line 1) | def main(): FILE: books/pytest/tests/ch_12/test_hello.py function test_hello (line 4) | def test_hello(capsys): FILE: books/pytest/tests/ch_15/conftest.py function pytest_configure (line 4) | def pytest_configure(config): function pytest_addoption (line 8) | def pytest_addoption(parser): function pytest_collection_modifyitems (line 12) | def pytest_collection_modifyitems(config, items): FILE: books/pytest/tests/ch_15/test_slow.py function test_normal (line 4) | def test_normal(): function test_slow (line 8) | def test_slow(): FILE: books/python-architecture-patterns/src/adapters/notifications.py class AbstractNotifications (line 13) | class AbstractNotifications(ABC): method send (line 15) | def send(self, destination, message): class EmailNotifications (line 19) | class EmailNotifications(AbstractNotifications): method __init__ (line 20) | def __init__(self, smtp_host=DEFAULT_HOST, port=DEFAULT_PORT): method send (line 24) | def send(self, destination, message): FILE: books/python-architecture-patterns/src/adapters/orm.py class AllocationsView (line 7) | class AllocationsView(SQLModel, table=True): function create_db_and_tables (line 14) | def create_db_and_tables(engine): function clean_db_and_tables (line 18) | def clean_db_and_tables(engine): FILE: books/python-architecture-patterns/src/adapters/redis_publisher.py function publish (line 9) | def publish(channel: str, event: Event): FILE: books/python-architecture-patterns/src/adapters/repository.py class AbstractRepository (line 18) | class AbstractRepository(Protocol): method add (line 19) | def add(self, product: Product): method get (line 22) | def get(self, sku: str) -> Optional[Product]: method get_by_batch_ref (line 25) | def get_by_batch_ref(self, ref: str) -> Optional[Product]: class Repository (line 29) | class Repository(AbstractRepository): method __init__ (line 30) | def __init__(self, session: Session): method add (line 33) | def add(self, product: Product): method get (line 37) | def get(self, sku: str) -> Optional[Product]: method get_by_batch_ref (line 40) | def get_by_batch_ref(self, ref: str) -> Optional[Product]: class TrackingRepository (line 44) | class TrackingRepository(AbstractRepository): method __init__ (line 47) | def __init__(self, repo: AbstractRepository): method add (line 52) | def add(self, product: Product): method get (line 56) | def get(self, sku: str) -> Optional[Product]: method get_by_batch_ref (line 62) | def get_by_batch_ref(self, ref: str) -> Optional[Product]: FILE: books/python-architecture-patterns/src/app.py function allocate_endpoint (line 22) | async def allocate_endpoint(order_line: OrderLine, response: Response): function add_batch_endpoint (line 33) | async def add_batch_endpoint(batch: Batch): function allocate_view_endpoint (line 39) | async def allocate_view_endpoint(order_id: str, response: Response): FILE: books/python-architecture-patterns/src/bootstrap.py function bootstrap (line 25) | def bootstrap(start_orm: bool = True, engine: Engine = create_engine(con... function inject_dependencies (line 46) | def inject_dependencies(handler, dependencies): FILE: books/python-architecture-patterns/src/config.py function get_postgres_uri (line 4) | def get_postgres_uri(): function get_api_url (line 12) | def get_api_url(): function get_redis_host_and_port (line 18) | def get_redis_host_and_port(): function get_email_host_and_port (line 24) | def get_email_host_and_port(): FILE: books/python-architecture-patterns/src/domain/commands.py class Command (line 6) | class Command: class Allocate (line 11) | class Allocate(Command): class CreateBatch (line 18) | class CreateBatch(Command): class ChangeBatchQuantity (line 26) | class ChangeBatchQuantity(Command): FILE: books/python-architecture-patterns/src/domain/events.py class Event (line 4) | class Event(BaseModel): class OutOfStock (line 8) | class OutOfStock(Event): class Allocated (line 12) | class Allocated(Event): class Deallocated (line 19) | class Deallocated(Event): class BatchQuantityChanged (line 25) | class BatchQuantityChanged(Event): FILE: books/python-architecture-patterns/src/domain/model.py class OutOfStock (line 26) | class OutOfStock(Exception): class OrderLine (line 30) | class OrderLine(SQLModel, table=True): class Batch (line 40) | class Batch(SQLModel, table=True): method __eq__ (line 51) | def __eq__(self, other): method __hash__ (line 56) | def __hash__(self): method __gt__ (line 59) | def __gt__(self, other): method allocate (line 66) | def allocate(self, order_line: OrderLine) -> None: method deallocate (line 73) | def deallocate(self, order_line: OrderLine) -> None: method deallocate_one (line 78) | def deallocate_one(self): method allocated_quantity (line 82) | def allocated_quantity(self) -> int: method available_quantity (line 86) | def available_quantity(self) -> int: method can_allocate (line 89) | def can_allocate(self, order_line: OrderLine) -> bool: class Product (line 93) | class Product(SQLModel, table=True): method __hash__ (line 102) | def __hash__(self): method messages (line 106) | def messages(self) -> List[Message]: method allocate (line 109) | def allocate(self, order_line: OrderLine) -> Optional[str]: method change_batch_quantity (line 125) | def change_batch_quantity(self, ref: str, qty: int): FILE: books/python-architecture-patterns/src/redis_consumer.py function main (line 17) | def main(): function _handle_change_batch_quantity (line 26) | def _handle_change_batch_quantity(message: Dict, bus: MessageBus): FILE: books/python-architecture-patterns/src/service_layer/handlers.py class InvalidSku (line 19) | class InvalidSku(Exception): function allocate (line 23) | def allocate(command: commands.Allocate, uow: AbstractUnitOfWork) -> str: function add_batch (line 37) | def add_batch(command: commands.CreateBatch, uow: AbstractUnitOfWork): function change_batch_quantity (line 47) | def change_batch_quantity(command: commands.ChangeBatchQuantity, uow: Ab... function send_out_of_stock_notification (line 54) | def send_out_of_stock_notification(event: events.OutOfStock, notificatio... function publish_allocated_event (line 58) | def publish_allocated_event(event: events.Allocated, uow: AbstractUnitOf... function add_allocation_to_read_model (line 62) | def add_allocation_to_read_model(event: events.Allocated, uow: UnitOfWork): function remove_allocation_from_read_model (line 74) | def remove_allocation_from_read_model(event: events.Deallocated, uow: Un... function reallocate (line 86) | def reallocate(event: events.Deallocated, uow: AbstractUnitOfWork, ): FILE: books/python-architecture-patterns/src/service_layer/message_bus.py class MessageBus (line 34) | class MessageBus: method __init__ (line 35) | def __init__(self, uow: AbstractUnitOfWork, event_handlers: Dict[Type[... method handle (line 42) | def handle(self, message: Message): method _handle_event (line 53) | def _handle_event(self, event: events.Event): method _handle_command (line 63) | def _handle_command(self, command: commands.Command): FILE: books/python-architecture-patterns/src/service_layer/unit_of_work.py class AbstractUnitOfWork (line 21) | class AbstractUnitOfWork(ABC): method __enter__ (line 24) | def __enter__(self) -> AbstractUnitOfWork: method __exit__ (line 27) | def __exit__(self, *args): method commit (line 30) | def commit(self): method collect_new_messages (line 33) | def collect_new_messages(self): method rollback (line 39) | def rollback(self): method _commit (line 43) | def _commit(self): function default_session (line 47) | def default_session(): class UnitOfWork (line 51) | class UnitOfWork(AbstractUnitOfWork): method __init__ (line 52) | def __init__(self, session: Optional[Session] = None): method __enter__ (line 56) | def __enter__(self): method __exit__ (line 60) | def __exit__(self, *args): method rollback (line 64) | def rollback(self): method _commit (line 67) | def _commit(self): FILE: books/python-architecture-patterns/src/views.py function allocations (line 9) | def allocations(order_id: str, uow: UnitOfWork) -> List[Dict]: FILE: books/python-architecture-patterns/tests/conftest.py function in_memory_db (line 22) | def in_memory_db(): function session (line 30) | def session(in_memory_db): function wait_for_postgres_to_come_up (line 37) | def wait_for_postgres_to_come_up(engine): function wait_for_redis_to_come_up (line 42) | def wait_for_redis_to_come_up(): function postgres_db (line 48) | def postgres_db(): function postgres_session (line 57) | def postgres_session(postgres_db): function client (line 64) | def client(): FILE: books/python-architecture-patterns/tests/e2e/api_client.py function post_to_allocate (line 9) | def post_to_allocate(client, order_id, sku, qty): function get_allocation (line 13) | def get_allocation(client, order_id): function post_to_add_batch (line 17) | def post_to_add_batch(client, ref, sku, qty, eta): FILE: books/python-architecture-patterns/tests/e2e/redis_client.py function subscribe_to (line 9) | def subscribe_to(channel): function publish_message (line 17) | def publish_message(channel, message): FILE: books/python-architecture-patterns/tests/e2e/test_app.py function random_suffix (line 11) | def random_suffix(): function random_sku (line 15) | def random_sku(name=''): function random_batch_ref (line 19) | def random_batch_ref(name=''): function random_order_id (line 23) | def random_order_id(name=''): function test_happy_path_returns_200_and_allocated_batch (line 27) | def test_happy_path_returns_200_and_allocated_batch(client): function test_unhappy_path_returns_400_and_error_message (line 43) | def test_unhappy_path_returns_400_and_error_message(client): FILE: books/python-architecture-patterns/tests/e2e/test_external_events.py function test_change_batch_quantity_leading_to_allocation (line 22) | def test_change_batch_quantity_leading_to_allocation(client): FILE: books/python-architecture-patterns/tests/integration/test_uow.py function insert_batch (line 23) | def insert_batch(session, batch_id): function get_allocated_batch_ref (line 27) | def get_allocated_batch_ref(session, order_id, sku): function test_uow_retrieve_batch_and_allocate_to_it (line 33) | def test_uow_retrieve_batch_and_allocate_to_it(session): function test_rolls_back_uncommitted_work_by_default (line 46) | def test_rolls_back_uncommitted_work_by_default(in_memory_db): function test_rolls_back_on_error (line 53) | def test_rolls_back_on_error(in_memory_db): function try_to_allocate (line 67) | def try_to_allocate(order_id: str, exceptions: List[Exception]): function test_concurrent_updates_to_version_number_are_not_allowed (line 79) | def test_concurrent_updates_to_version_number_are_not_allowed(postgres_db): FILE: books/python-architecture-patterns/tests/integration/test_views.py function sqlite_bus (line 17) | def sqlite_bus(in_memory_db): function test_allocations_view (line 28) | def test_allocations_view(sqlite_bus): function test_deallocation (line 44) | def test_deallocation(sqlite_bus): FILE: books/python-architecture-patterns/tests/unit/test_batches.py function batch_and_line (line 9) | def batch_and_line(sku, batch_quantity, line_quantity): function test_allocating_to_batch_reduces_available_quantity (line 13) | def test_allocating_to_batch_reduces_available_quantity(): function test_can_allocate_if_available_greater_than_required (line 19) | def test_can_allocate_if_available_greater_than_required(): function test_cannot_allocate_if_available_smaller_than_required (line 24) | def test_cannot_allocate_if_available_smaller_than_required(): function test_not_allocate_if_available_equal_to_required (line 29) | def test_not_allocate_if_available_equal_to_required(): function test_cannot_allocate_if_skus_dont_match (line 34) | def test_cannot_allocate_if_skus_dont_match(): function test_can_only_deallocate_allocated_lines (line 40) | def test_can_only_deallocate_allocated_lines(): function test_allocation_is_idempotent (line 46) | def test_allocation_is_idempotent(): FILE: books/python-architecture-patterns/tests/unit/test_handlers.py class FakeRepository (line 25) | class FakeRepository(AbstractRepository): method __init__ (line 26) | def __init__(self, products): method add (line 30) | def add(self, product: Product): method get (line 33) | def get(self, sku: str) -> Optional[Product]: method get_by_batch_ref (line 36) | def get_by_batch_ref(self, ref: str) -> Optional[Product]: class FakeUnitOfWork (line 40) | class FakeUnitOfWork(AbstractUnitOfWork): method __init__ (line 41) | def __init__(self): method rollback (line 45) | def rollback(self): method _commit (line 48) | def _commit(self): class FakeNotifications (line 52) | class FakeNotifications(AbstractNotifications): method __init__ (line 53) | def __init__(self): method send (line 56) | def send(self, destination, message): function bootstrap_test_app (line 60) | def bootstrap_test_app(): class TestAddBatch (line 69) | class TestAddBatch: method test_for_new_product (line 70) | def test_for_new_product(self): method test_for_existing_product (line 76) | def test_for_existing_product(self): class TestAllocate (line 83) | class TestAllocate: method test_errors_for_invalid_sku (line 84) | def test_errors_for_invalid_sku(self): method test_commits (line 90) | def test_commits(self): method test_sends_email_on_out_of_stock_error (line 96) | def test_sends_email_on_out_of_stock_error(self): class TestChangeBatchQuantity (line 109) | class TestChangeBatchQuantity: method test_changes_available_quantity (line 110) | def test_changes_available_quantity(self): method test_reallocates_if_necessary (line 120) | def test_reallocates_if_necessary(self): FILE: books/python-architecture-patterns/tests/unit/test_product.py function test_prefers_current_stock_batches_to_shipments (line 11) | def test_prefers_current_stock_batches_to_shipments(): function test_prefers_earlier_batches (line 23) | def test_prefers_earlier_batches(): function test_returns_allocated_batch_ref (line 37) | def test_returns_allocated_batch_ref(): function test_records_out_of_stock_event_if_cannot_allocate (line 48) | def test_records_out_of_stock_event_if_cannot_allocate():