SYMBOL INDEX (619 symbols across 65 files) FILE: patterns/behavioral/catalog.py class Catalog (line 10) | class Catalog: method __init__ (line 14) | def __init__(self, param: str) -> None: method _static_method_1 (line 30) | def _static_method_1() -> str: method _static_method_2 (line 34) | def _static_method_2() -> str: method main_method (line 37) | def main_method(self) -> str: class CatalogInstance (line 46) | class CatalogInstance: method __init__ (line 51) | def __init__(self, param: str) -> None: method _instance_method_1 (line 60) | def _instance_method_1(self) -> str: method _instance_method_2 (line 63) | def _instance_method_2(self) -> str: method main_method (line 71) | def main_method(self) -> str: class CatalogClass (line 80) | class CatalogClass: method __init__ (line 88) | def __init__(self, param: str) -> None: method _class_method_1 (line 96) | def _class_method_1(cls) -> str: method _class_method_2 (line 100) | def _class_method_2(cls) -> str: method main_method (line 108) | def main_method(self) -> str: class CatalogStatic (line 117) | class CatalogStatic: method __init__ (line 122) | def __init__(self, param: str) -> None: method _static_method_1 (line 130) | def _static_method_1() -> str: method _static_method_2 (line 134) | def _static_method_2() -> str: method main_method (line 142) | def main_method(self) -> str: function main (line 152) | def main(): FILE: patterns/behavioral/chain_of_responsibility.py class Handler (line 29) | class Handler(ABC): method __init__ (line 30) | def __init__(self, successor: Optional["Handler"] = None): method handle (line 33) | def handle(self, request: int) -> None: method check_range (line 46) | def check_range(self, request: int) -> Optional[bool]: class ConcreteHandler0 (line 50) | class ConcreteHandler0(Handler): method check_range (line 56) | def check_range(request: int) -> Optional[bool]: class ConcreteHandler1 (line 63) | class ConcreteHandler1(Handler): method check_range (line 68) | def check_range(self, request: int) -> Optional[bool]: class ConcreteHandler2 (line 75) | class ConcreteHandler2(Handler): method check_range (line 78) | def check_range(self, request: int) -> Optional[bool]: method get_interval_from_db (line 86) | def get_interval_from_db() -> Tuple[int, int]: class FallbackHandler (line 90) | class FallbackHandler(Handler): method check_range (line 92) | def check_range(request: int) -> Optional[bool]: function main (line 97) | def main(): FILE: patterns/behavioral/chaining_method.py class Person (line 4) | class Person: method __init__ (line 5) | def __init__(self, name: str) -> None: method do_action (line 8) | def do_action(self, action: Action) -> Action: class Action (line 13) | class Action: method __init__ (line 14) | def __init__(self, name: str) -> None: method amount (line 17) | def amount(self, val: str) -> Action: method stop (line 21) | def stop(self) -> None: function main (line 25) | def main(): FILE: patterns/behavioral/command.py class HideFileCommand (line 26) | class HideFileCommand: method __init__ (line 31) | def __init__(self) -> None: method execute (line 35) | def execute(self, filename: str) -> None: method undo (line 39) | def undo(self) -> None: class DeleteFileCommand (line 44) | class DeleteFileCommand: method __init__ (line 49) | def __init__(self) -> None: method execute (line 53) | def execute(self, filename: str) -> None: method undo (line 57) | def undo(self) -> None: class MenuItem (line 62) | class MenuItem: method __init__ (line 67) | def __init__(self, command: Union[HideFileCommand, DeleteFileCommand])... method on_do_press (line 70) | def on_do_press(self, filename: str) -> None: method on_undo_press (line 73) | def on_undo_press(self) -> None: function main (line 77) | def main(): FILE: patterns/behavioral/iterator.py function count_to (line 10) | def count_to(count: int): function count_to_two (line 17) | def count_to_two() -> None: function count_to_five (line 21) | def count_to_five() -> None: function main (line 25) | def main(): FILE: patterns/behavioral/iterator_alt.py class NumberWords (line 11) | class NumberWords: method __init__ (line 22) | def __init__(self, start: int, stop: int) -> None: method __iter__ (line 26) | def __iter__(self) -> NumberWords: # this makes the class an Iterable method __next__ (line 29) | def __next__(self) -> str: # this makes the class an Iterator function main (line 40) | def main(): FILE: patterns/behavioral/mediator.py class ChatRoom (line 14) | class ChatRoom: method display_message (line 17) | def display_message(self, user: User, message: str) -> None: class User (line 21) | class User: method __init__ (line 24) | def __init__(self, name: str) -> None: method say (line 28) | def say(self, message: str) -> None: method __str__ (line 31) | def __str__(self) -> str: function main (line 35) | def main(): FILE: patterns/behavioral/memento.py function memento (line 12) | def memento(obj: Any, deep: bool = False) -> Callable: class Transaction (line 22) | class Transaction: method __init__ (line 31) | def __init__(self, deep: bool, *targets: Any) -> None: method commit (line 36) | def commit(self) -> None: method rollback (line 39) | def rollback(self) -> None: function Transactional (line 44) | def Transactional(method): class NumObj (line 72) | class NumObj: method __init__ (line 73) | def __init__(self, value: int) -> None: method __repr__ (line 76) | def __repr__(self) -> str: method increment (line 79) | def increment(self) -> None: method do_stuff (line 83) | def do_stuff(self) -> None: function main (line 88) | def main(): FILE: patterns/behavioral/observer.py class Observer (line 17) | class Observer: method update (line 18) | def update(self, subject: Subject) -> None: class Subject (line 28) | class Subject: method __init__ (line 31) | def __init__(self) -> None: method attach (line 37) | def attach(self, observer: Observer) -> None: method detach (line 47) | def detach(self, observer: Observer) -> None: method notify (line 59) | def notify(self) -> None: class Data (line 67) | class Data(Subject): method __init__ (line 68) | def __init__(self, name: str = "") -> None: method data (line 74) | def data(self) -> int: method data (line 78) | def data(self, value: int) -> None: class HexViewer (line 83) | class HexViewer: method update (line 84) | def update(self, subject: Data) -> None: class DecimalViewer (line 88) | class DecimalViewer: method update (line 89) | def update(self, subject: Data) -> None: function main (line 93) | def main(): FILE: patterns/behavioral/publish_subscribe.py class Provider (line 10) | class Provider: method __init__ (line 11) | def __init__(self) -> None: method notify (line 15) | def notify(self, msg: str) -> None: method subscribe (line 18) | def subscribe(self, msg: str, subscriber: Subscriber) -> None: method unsubscribe (line 21) | def unsubscribe(self, msg: str, subscriber: Subscriber) -> None: method update (line 24) | def update(self) -> None: class Publisher (line 31) | class Publisher: method __init__ (line 32) | def __init__(self, msg_center: Provider) -> None: method publish (line 35) | def publish(self, msg: str) -> None: class Subscriber (line 39) | class Subscriber: method __init__ (line 40) | def __init__(self, name: str, msg_center: Provider) -> None: method subscribe (line 44) | def subscribe(self, msg: str) -> None: method unsubscribe (line 47) | def unsubscribe(self, msg: str) -> None: method run (line 50) | def run(self, msg: str) -> None: function main (line 54) | def main(): FILE: patterns/behavioral/registry.py class RegistryHolder (line 4) | class RegistryHolder(type): method __new__ (line 7) | def __new__(cls, name, bases, attrs): method get_registry (line 17) | def get_registry(cls): class BaseRegisteredClass (line 21) | class BaseRegisteredClass(metaclass=RegistryHolder): function main (line 29) | def main(): FILE: patterns/behavioral/servant.py class Position (line 26) | class Position: method __init__ (line 29) | def __init__(self, x, y): class Circle (line 34) | class Circle: method __init__ (line 37) | def __init__(self, radius, position: Position): class Rectangle (line 42) | class Rectangle: method __init__ (line 45) | def __init__(self, width, height, position: Position): class GeometryTools (line 51) | class GeometryTools: method calculate_area (line 58) | def calculate_area(shape): method calculate_perimeter (line 79) | def calculate_perimeter(shape): method move_to (line 100) | def move_to(shape, new_position: Position): function main (line 112) | def main(): FILE: patterns/behavioral/specification.py class Specification (line 12) | class Specification: method and_specification (line 13) | def and_specification(self, candidate): method or_specification (line 16) | def or_specification(self, candidate): method not_specification (line 19) | def not_specification(self): method is_satisfied_by (line 23) | def is_satisfied_by(self, candidate): class CompositeSpecification (line 27) | class CompositeSpecification(Specification): method is_satisfied_by (line 29) | def is_satisfied_by(self, candidate): method and_specification (line 32) | def and_specification(self, candidate: "Specification") -> "AndSpecifi... method or_specification (line 35) | def or_specification(self, candidate: "Specification") -> "OrSpecifica... method not_specification (line 38) | def not_specification(self) -> "NotSpecification": class AndSpecification (line 42) | class AndSpecification(CompositeSpecification): method __init__ (line 43) | def __init__(self, one: "Specification", other: "Specification") -> None: method is_satisfied_by (line 47) | def is_satisfied_by(self, candidate: Union["User", str]) -> bool: class OrSpecification (line 54) | class OrSpecification(CompositeSpecification): method __init__ (line 55) | def __init__(self, one: "Specification", other: "Specification") -> None: method is_satisfied_by (line 59) | def is_satisfied_by(self, candidate: Union["User", str]): class NotSpecification (line 66) | class NotSpecification(CompositeSpecification): method __init__ (line 67) | def __init__(self, wrapped: "Specification"): method is_satisfied_by (line 70) | def is_satisfied_by(self, candidate: Union["User", str]): class User (line 74) | class User: method __init__ (line 75) | def __init__(self, super_user: bool = False) -> None: class UserSpecification (line 79) | class UserSpecification(CompositeSpecification): method is_satisfied_by (line 80) | def is_satisfied_by(self, candidate: Union["User", str]) -> bool: class SuperUserSpecification (line 84) | class SuperUserSpecification(CompositeSpecification): method is_satisfied_by (line 85) | def is_satisfied_by(self, candidate: "User") -> bool: function main (line 89) | def main(): FILE: patterns/behavioral/state.py class State (line 14) | class State: method scan (line 17) | def scan(self) -> None: class AmState (line 25) | class AmState(State): method __init__ (line 26) | def __init__(self, radio: Radio) -> None: method toggle_amfm (line 32) | def toggle_amfm(self) -> None: class FmState (line 37) | class FmState(State): method __init__ (line 38) | def __init__(self, radio: Radio) -> None: method toggle_amfm (line 44) | def toggle_amfm(self) -> None: class Radio (line 49) | class Radio: method __init__ (line 52) | def __init__(self) -> None: method toggle_amfm (line 58) | def toggle_amfm(self) -> None: method scan (line 61) | def scan(self) -> None: function main (line 65) | def main(): FILE: patterns/behavioral/strategy.py class DiscountStrategyValidator (line 15) | class DiscountStrategyValidator: # Descriptor class for check perform method validate (line 17) | def validate(obj: Order, value: Callable) -> bool: method __set_name__ (line 29) | def __set_name__(self, owner, name: str) -> None: method __set__ (line 32) | def __set__(self, obj: Order, value: Callable = None) -> None: method __get__ (line 38) | def __get__(self, obj: object, objtype: type = None): class Order (line 42) | class Order: method __init__ (line 45) | def __init__(self, price: float, discount_strategy: Callable = None) -... method apply_discount (line 49) | def apply_discount(self) -> float: method __repr__ (line 57) | def __repr__(self) -> str: function ten_percent_discount (line 62) | def ten_percent_discount(order: Order) -> float: function on_sale_discount (line 66) | def on_sale_discount(order: Order) -> float: function main (line 70) | def main(): FILE: patterns/behavioral/template.py function get_text (line 13) | def get_text() -> str: function get_pdf (line 17) | def get_pdf() -> str: function get_csv (line 21) | def get_csv() -> str: function convert_to_text (line 25) | def convert_to_text(data: str) -> str: function saver (line 30) | def saver() -> None: function template_function (line 34) | def template_function(getter, converter=False, to_save=False) -> None: function main (line 49) | def main(): FILE: patterns/behavioral/visitor.py class Node (line 20) | class Node: class A (line 24) | class A(Node): class B (line 28) | class B(Node): class C (line 32) | class C(A, B): class Visitor (line 36) | class Visitor: method visit (line 37) | def visit(self, node: Union[A, C, B], *args, **kwargs) -> None: method generic_visit (line 49) | def generic_visit(self, node: A, *args, **kwargs) -> None: method visit_B (line 52) | def visit_B(self, node: Union[C, B], *args, **kwargs) -> None: function main (line 56) | def main(): FILE: patterns/creational/abstract_factory.py class Pet (line 37) | class Pet: method __init__ (line 38) | def __init__(self, name: str) -> None: method speak (line 41) | def speak(self) -> None: method __str__ (line 44) | def __str__(self) -> str: class Dog (line 48) | class Dog(Pet): method speak (line 49) | def speak(self) -> None: method __str__ (line 52) | def __str__(self) -> str: class Cat (line 56) | class Cat(Pet): method speak (line 57) | def speak(self) -> None: method __str__ (line 60) | def __str__(self) -> str: class PetShop (line 64) | class PetShop: method __init__ (line 67) | def __init__(self, animal_factory: Type[Pet]) -> None: method buy_pet (line 72) | def buy_pet(self, name: str) -> Pet: function main (line 81) | def main() -> None: FILE: patterns/creational/borg.py class Borg (line 39) | class Borg: method __init__ (line 42) | def __init__(self) -> None: class YourBorg (line 46) | class YourBorg(Borg): method __init__ (line 47) | def __init__(self, state: str = None) -> None: method __str__ (line 56) | def __str__(self) -> str: function main (line 60) | def main(): FILE: patterns/creational/builder.py class Building (line 34) | class Building: method __init__ (line 35) | def __init__(self) -> None: method build_floor (line 39) | def build_floor(self): method build_size (line 42) | def build_size(self): method __repr__ (line 45) | def __repr__(self) -> str: class House (line 50) | class House(Building): method build_floor (line 51) | def build_floor(self) -> None: method build_size (line 54) | def build_size(self) -> None: class Flat (line 58) | class Flat(Building): method build_floor (line 59) | def build_floor(self) -> None: method build_size (line 62) | def build_size(self) -> None: class ComplexBuilding (line 72) | class ComplexBuilding: method __repr__ (line 73) | def __repr__(self) -> str: class ComplexHouse (line 77) | class ComplexHouse(ComplexBuilding): method build_floor (line 78) | def build_floor(self) -> None: method build_size (line 81) | def build_size(self) -> None: function construct_building (line 85) | def construct_building(cls) -> Building: function main (line 92) | def main(): FILE: patterns/creational/factory.py class Localizer (line 28) | class Localizer(Protocol): method localize (line 29) | def localize(self, msg: str) -> str: ... class GreekLocalizer (line 32) | class GreekLocalizer: method __init__ (line 35) | def __init__(self) -> None: method localize (line 38) | def localize(self, msg: str) -> str: class EnglishLocalizer (line 43) | class EnglishLocalizer: method localize (line 46) | def localize(self, msg: str) -> str: function get_localizer (line 50) | def get_localizer(language: str = "English") -> Localizer: function main (line 60) | def main(): FILE: patterns/creational/lazy_evaluation.py class lazy_property (line 26) | class lazy_property: method __init__ (line 27) | def __init__(self, function: Callable) -> None: method __get__ (line 31) | def __get__(self, obj: "Person", type_: Type["Person"]) -> str: function lazy_property2 (line 39) | def lazy_property2(fn: Callable) -> property: class Person (line 57) | class Person: method __init__ (line 58) | def __init__(self, name: str, occupation: str) -> None: method relatives (line 64) | def relatives(self) -> str: method parents (line 70) | def parents(self) -> str: function main (line 75) | def main(): FILE: patterns/creational/pool.py class ObjectPool (line 35) | class ObjectPool: method __init__ (line 36) | def __init__(self, queue: Queue, auto_get: bool = False) -> None: method __enter__ (line 40) | def __enter__(self) -> str: method __exit__ (line 45) | def __exit__( method __del__ (line 55) | def __del__(self) -> None: function main (line 61) | def main(): FILE: patterns/creational/prototype.py class Prototype (line 29) | class Prototype: method __init__ (line 30) | def __init__(self, value: str = "default", **attrs: Any) -> None: method clone (line 34) | def clone(self, **attrs: Any) -> Prototype: class PrototypeDispatcher (line 43) | class PrototypeDispatcher: method __init__ (line 44) | def __init__(self): method get_objects (line 47) | def get_objects(self) -> dict[str, Prototype]: method register_object (line 51) | def register_object(self, name: str, obj: Prototype) -> None: method unregister_object (line 55) | def unregister_object(self, name: str) -> None: function main (line 60) | def main() -> None: FILE: patterns/dependency_injection.py class ConstructorInjection (line 30) | class ConstructorInjection: method __init__ (line 31) | def __init__(self, time_provider: Callable) -> None: method get_current_time_as_html_fragment (line 34) | def get_current_time_as_html_fragment(self) -> str: class ParameterInjection (line 42) | class ParameterInjection: method __init__ (line 43) | def __init__(self) -> None: method get_current_time_as_html_fragment (line 46) | def get_current_time_as_html_fragment(self, time_provider: Callable) -... class SetterInjection (line 54) | class SetterInjection: method __init__ (line 57) | def __init__(self): method set_time_provider (line 60) | def set_time_provider(self, time_provider: Callable): method get_current_time_as_html_fragment (line 63) | def get_current_time_as_html_fragment(self): function production_code_time_provider (line 71) | def production_code_time_provider() -> str: function midnight_time_provider (line 81) | def midnight_time_provider() -> str: function main (line 86) | def main(): FILE: patterns/fundamental/delegation_pattern.py class Delegator (line 14) | class Delegator: method __init__ (line 33) | def __init__(self, delegate: Delegate) -> None: method __getattr__ (line 36) | def __getattr__(self, name: str) -> Any | Callable: class Delegate (line 48) | class Delegate: method __init__ (line 49) | def __init__(self) -> None: method do_something (line 52) | def do_something(self, something: str, kw=None) -> str: FILE: patterns/other/blackboard.py class AbstractExpert (line 16) | class AbstractExpert(ABC): method __init__ (line 20) | def __init__(self, blackboard) -> None: method is_eager_to_contribute (line 25) | def is_eager_to_contribute(self) -> int: method contribute (line 29) | def contribute(self) -> None: class Blackboard (line 33) | class Blackboard: method __init__ (line 36) | def __init__(self) -> None: method add_expert (line 45) | def add_expert(self, expert: AbstractExpert) -> None: class Controller (line 49) | class Controller: method __init__ (line 52) | def __init__(self, blackboard: Blackboard) -> None: method run_loop (line 55) | def run_loop(self): class Student (line 67) | class Student(AbstractExpert): method __init__ (line 70) | def __init__(self, blackboard) -> None: method is_eager_to_contribute (line 74) | def is_eager_to_contribute(self) -> bool: method contribute (line 77) | def contribute(self) -> None: class Scientist (line 84) | class Scientist(AbstractExpert): method __init__ (line 87) | def __init__(self, blackboard) -> None: method is_eager_to_contribute (line 91) | def is_eager_to_contribute(self) -> int: method contribute (line 94) | def contribute(self) -> None: class Professor (line 101) | class Professor(AbstractExpert): method __init__ (line 102) | def __init__(self, blackboard) -> None: method is_eager_to_contribute (line 106) | def is_eager_to_contribute(self) -> bool: method contribute (line 109) | def contribute(self) -> None: function main (line 116) | def main(): FILE: patterns/other/graph_search.py class GraphSearch (line 4) | class GraphSearch: method __init__ (line 11) | def __init__(self, graph: Dict[str, List[str]]) -> None: method find_path_dfs (line 14) | def find_path_dfs( method find_all_paths_dfs (line 28) | def find_all_paths_dfs( method find_shortest_path_dfs (line 42) | def find_shortest_path_dfs( method find_shortest_path_bfs (line 59) | def find_shortest_path_bfs(self, start: str, end: str) -> Optional[Lis... function main (line 98) | def main(): FILE: patterns/other/hsm/hsm.py class UnsupportedMessageType (line 12) | class UnsupportedMessageType(BaseException): class UnsupportedState (line 16) | class UnsupportedState(BaseException): class UnsupportedTransition (line 20) | class UnsupportedTransition(BaseException): class HierachicalStateMachine (line 24) | class HierachicalStateMachine: method __init__ (line 25) | def __init__(self): method _next_state (line 45) | def _next_state(self, state): method _send_diagnostics_request (line 51) | def _send_diagnostics_request(self): method _raise_alarm (line 54) | def _raise_alarm(self): method _clear_alarm (line 57) | def _clear_alarm(self): method _perform_switchover (line 60) | def _perform_switchover(self): method _send_switchover_response (line 63) | def _send_switchover_response(self): method _send_operator_inservice_response (line 66) | def _send_operator_inservice_response(self): method _send_diagnostics_failure_report (line 69) | def _send_diagnostics_failure_report(self): method _send_diagnostics_pass_report (line 72) | def _send_diagnostics_pass_report(self): method _abort_diagnostics (line 75) | def _abort_diagnostics(self): method _check_mate_status (line 78) | def _check_mate_status(self): method on_message (line 81) | def on_message(self, message_type): # message ignored class Unit (line 88) | class Unit: method __init__ (line 89) | def __init__(self, HierachicalStateMachine): method on_switchover (line 92) | def on_switchover(self): method on_fault_trigger (line 95) | def on_fault_trigger(self): method on_diagnostics_failed (line 98) | def on_diagnostics_failed(self): method on_diagnostics_passed (line 101) | def on_diagnostics_passed(self): method on_operator_inservice (line 104) | def on_operator_inservice(self): class Inservice (line 108) | class Inservice(Unit): method __init__ (line 109) | def __init__(self, HierachicalStateMachine): method on_fault_trigger (line 112) | def on_fault_trigger(self): method on_switchover (line 117) | def on_switchover(self): class Active (line 123) | class Active(Inservice): method __init__ (line 124) | def __init__(self, HierachicalStateMachine): method on_fault_trigger (line 127) | def on_fault_trigger(self): method on_switchover (line 131) | def on_switchover(self): class Standby (line 136) | class Standby(Inservice): method __init__ (line 137) | def __init__(self, HierachicalStateMachine): method on_switchover (line 140) | def on_switchover(self): class OutOfService (line 145) | class OutOfService(Unit): method __init__ (line 146) | def __init__(self, HierachicalStateMachine): method on_operator_inservice (line 149) | def on_operator_inservice(self): class Suspect (line 155) | class Suspect(OutOfService): method __init__ (line 156) | def __init__(self, HierachicalStateMachine): method on_diagnostics_failed (line 159) | def on_diagnostics_failed(self): method on_diagnostics_passed (line 163) | def on_diagnostics_passed(self): method on_operator_inservice (line 168) | def on_operator_inservice(self): class Failed (line 173) | class Failed(OutOfService): method __init__ (line 176) | def __init__(self, HierachicalStateMachine): FILE: patterns/structural/3-tier.py class Data (line 9) | class Data: method __get__ (line 18) | def __get__(self, obj, klas): class BusinessLogic (line 23) | class BusinessLogic: method product_list (line 28) | def product_list(self) -> KeysView[str]: method product_information (line 31) | def product_information( class Ui (line 37) | class Ui: method __init__ (line 40) | def __init__(self) -> None: method get_product_list (line 43) | def get_product_list(self) -> None: method get_product_information (line 49) | def get_product_information(self, product: str) -> None: function main (line 62) | def main(): FILE: patterns/structural/adapter.py class Dog (line 36) | class Dog: method __init__ (line 37) | def __init__(self) -> None: method bark (line 40) | def bark(self) -> str: class Cat (line 44) | class Cat: method __init__ (line 45) | def __init__(self) -> None: method meow (line 48) | def meow(self) -> str: class Human (line 52) | class Human: method __init__ (line 53) | def __init__(self) -> None: method speak (line 56) | def speak(self) -> str: class Car (line 60) | class Car: method __init__ (line 61) | def __init__(self) -> None: method make_noise (line 64) | def make_noise(self, octane_level: int) -> str: class Adapter (line 68) | class Adapter: method __init__ (line 77) | def __init__(self, obj: T, **adapted_methods: Callable[..., Any]) -> N... method __getattr__ (line 82) | def __getattr__(self, attr: str) -> Any: method original_dict (line 86) | def original_dict(self) -> Dict[str, Any]: function main (line 91) | def main(): FILE: patterns/structural/bridge.py class DrawingAPI1 (line 12) | class DrawingAPI1: method draw_circle (line 13) | def draw_circle(self, x: int, y: int, radius: float) -> None: class DrawingAPI2 (line 18) | class DrawingAPI2: method draw_circle (line 19) | def draw_circle(self, x: int, y: int, radius: float) -> None: class CircleShape (line 24) | class CircleShape: method __init__ (line 25) | def __init__( method draw (line 34) | def draw(self) -> None: method scale (line 38) | def scale(self, pct: float) -> None: function main (line 42) | def main(): FILE: patterns/structural/composite.py class Graphic (line 33) | class Graphic(ABC): method render (line 35) | def render(self) -> None: class CompositeGraphic (line 39) | class CompositeGraphic(Graphic): method __init__ (line 40) | def __init__(self) -> None: method render (line 43) | def render(self) -> None: method add (line 47) | def add(self, graphic: Graphic) -> None: method remove (line 50) | def remove(self, graphic: Graphic) -> None: class Ellipse (line 54) | class Ellipse(Graphic): method __init__ (line 55) | def __init__(self, name: str) -> None: method render (line 58) | def render(self) -> None: function main (line 62) | def main(): FILE: patterns/structural/decorator.py class TextTag (line 28) | class TextTag: method __init__ (line 31) | def __init__(self, text: str) -> None: method render (line 34) | def render(self) -> str: class BoldWrapper (line 38) | class BoldWrapper(TextTag): method __init__ (line 41) | def __init__(self, wrapped: TextTag) -> None: method render (line 44) | def render(self) -> str: class ItalicWrapper (line 48) | class ItalicWrapper(TextTag): method __init__ (line 51) | def __init__(self, wrapped: TextTag) -> None: method render (line 54) | def render(self) -> str: function main (line 58) | def main(): FILE: patterns/structural/facade.py class CPU (line 33) | class CPU: method freeze (line 38) | def freeze(self) -> None: method jump (line 41) | def jump(self, position: str) -> None: method execute (line 44) | def execute(self) -> None: class Memory (line 48) | class Memory: method load (line 53) | def load(self, position: str, data: str) -> None: class SolidStateDrive (line 57) | class SolidStateDrive: method read (line 62) | def read(self, lba: str, size: str) -> str: class ComputerFacade (line 66) | class ComputerFacade: method __init__ (line 71) | def __init__(self): method start (line 76) | def start(self): function main (line 83) | def main(): FILE: patterns/structural/flyweight.py class Card (line 31) | class Card: method __new__ (line 39) | def __new__(cls, value: str, suit: str): method __repr__ (line 55) | def __repr__(self) -> str: function main (line 59) | def main(): FILE: patterns/structural/flyweight_with_metaclass.py class FlyweightMeta (line 4) | class FlyweightMeta(type): method __new__ (line 5) | def __new__(mcs, name, parents, dct): method _serialize_params (line 19) | def _serialize_params(cls, *args, **kwargs): method __call__ (line 29) | def __call__(cls, *args, **kwargs): class Card2 (line 40) | class Card2(metaclass=FlyweightMeta): method __init__ (line 41) | def __init__(self, *args, **kwargs): FILE: patterns/structural/front_controller.py class MobileView (line 13) | class MobileView: method show_index_page (line 14) | def show_index_page(self) -> None: class TabletView (line 18) | class TabletView: method show_index_page (line 19) | def show_index_page(self) -> None: class Dispatcher (line 23) | class Dispatcher: method __init__ (line 24) | def __init__(self) -> None: method dispatch (line 28) | def dispatch(self, request: Request) -> None: class RequestController (line 43) | class RequestController: method __init__ (line 46) | def __init__(self) -> None: method dispatch_request (line 49) | def dispatch_request(self, request: Any) -> None: class Request (line 59) | class Request: method __init__ (line 65) | def __init__(self, request): function main (line 74) | def main(): FILE: patterns/structural/mvc.py class Model (line 12) | class Model(ABC): method __iter__ (line 16) | def __iter__(self) -> Any: method get (line 20) | def get(self, item: str) -> dict: method item_type (line 27) | def item_type(self) -> str: class ProductModel (line 31) | class ProductModel(Model): class Price (line 34) | class Price(float): method __str__ (line 38) | def __str__(self) -> str: method __iter__ (line 49) | def __iter__(self) -> Any: method get (line 52) | def get(self, product: str) -> dict: class View (line 59) | class View(ABC): method show_item_list (line 63) | def show_item_list(self, item_type: str, item_list: list) -> None: method show_item_information (line 67) | def show_item_information( method item_not_found (line 75) | def item_not_found(self, item_type: str, item_name: str) -> None: class ConsoleView (line 79) | class ConsoleView(View): method show_item_list (line 82) | def show_item_list(self, item_type: str, item_list: list) -> None: method capitalizer (line 89) | def capitalizer(string: str) -> str: method show_item_information (line 93) | def show_item_information( method item_not_found (line 104) | def item_not_found(self, item_type: str, item_name: str) -> None: class Controller (line 108) | class Controller: method __init__ (line 111) | def __init__(self, model_class: Model, view_class: View) -> None: method show_items (line 115) | def show_items(self) -> None: method show_item_information (line 120) | def show_item_information(self, item_name: str) -> None: class Router (line 134) | class Router: method __init__ (line 137) | def __init__(self): method register (line 140) | def register( method resolve (line 151) | def resolve(self, path: str) -> Controller: function main (line 159) | def main(): FILE: patterns/structural/proxy.py class Subject (line 21) | class Subject: method do_the_job (line 31) | def do_the_job(self, user: str) -> None: class RealSubject (line 35) | class RealSubject(Subject): method do_the_job (line 41) | def do_the_job(self, user: str) -> None: class Proxy (line 45) | class Proxy(Subject): method __init__ (line 46) | def __init__(self) -> None: method do_the_job (line 49) | def do_the_job(self, user: str) -> None: function client (line 62) | def client(job_doer: Union[RealSubject, Proxy], user: str) -> None: function main (line 66) | def main(): FILE: tests/behavioral/test_catalog.py function test_catalog_multiple_methods (line 5) | def test_catalog_multiple_methods(): function test_catalog_multiple_instance_methods (line 10) | def test_catalog_multiple_instance_methods(): function test_catalog_multiple_class_methods (line 15) | def test_catalog_multiple_class_methods(): function test_catalog_multiple_static_methods (line 20) | def test_catalog_multiple_static_methods(): FILE: tests/behavioral/test_mediator.py function test_mediated_comments (line 5) | def test_mediated_comments(): FILE: tests/behavioral/test_memento.py function test_object_creation (line 5) | def test_object_creation(): function test_rollback_on_transaction (line 9) | def test_rollback_on_transaction(): function test_rollback_with_transactional_annotation (line 25) | def test_rollback_with_transactional_annotation(): FILE: tests/behavioral/test_observer.py function observable (line 9) | def observable(): function test_attach_detach (line 13) | def test_attach_detach(observable): function test_one_data_change_notifies_each_observer_once (line 24) | def test_one_data_change_notifies_each_observer_once(observable): FILE: tests/behavioral/test_publish_subscribe.py class TestProvider (line 7) | class TestProvider(unittest.TestCase): method test_subscriber_shall_be_attachable_to_subscriptions (line 12) | def test_subscriber_shall_be_attachable_to_subscriptions(cls): method test_subscriber_shall_be_detachable_from_subscriptions (line 20) | def test_subscriber_shall_be_detachable_from_subscriptions(cls): method test_publisher_shall_append_subscription_message_to_queue (line 29) | def test_publisher_shall_append_subscription_message_to_queue(cls): method test_provider_shall_update_affected_subscribers_with_published_subscription (line 40) | def test_provider_shall_update_affected_subscribers_with_published_sub... FILE: tests/behavioral/test_servant.py function circle (line 7) | def circle(): function rectangle (line 12) | def rectangle(): function test_calculate_area (line 16) | def test_calculate_area(circle, rectangle): function test_calculate_perimeter (line 24) | def test_calculate_perimeter(circle, rectangle): function test_move_to (line 32) | def test_move_to(circle, rectangle): FILE: tests/behavioral/test_state.py function radio (line 7) | def radio(): function test_initial_state (line 11) | def test_initial_state(radio): function test_initial_am_station (line 15) | def test_initial_am_station(radio): function test_toggle_amfm (line 20) | def test_toggle_amfm(radio): FILE: tests/behavioral/test_strategy.py function order (line 7) | def order(): function test_discount_function_return (line 14) | def test_discount_function_return(func, order, discount): function test_order_discount_strategy_validate_success (line 21) | def test_order_discount_strategy_validate_success(func, price): function test_order_discount_strategy_validate_error (line 28) | def test_order_discount_strategy_validate_error(): function test_discount_apply_success (line 38) | def test_discount_apply_success(func, price, discount): FILE: tests/behavioral/test_visitor.py function visitor (line 6) | def visitor(): function test_visiting_generic_node (line 9) | def test_visiting_generic_node(visitor): function test_visiting_specific_nodes (line 14) | def test_visiting_specific_nodes(visitor): function test_visiting_inherited_nodes (line 19) | def test_visiting_inherited_nodes(visitor): FILE: tests/creational/test_abstract_factory.py class TestPetShop (line 7) | class TestPetShop(unittest.TestCase): method test_dog_pet_shop_shall_show_dog_instance (line 8) | def test_dog_pet_shop_shall_show_dog_instance(self): FILE: tests/creational/test_borg.py class BorgTest (line 6) | class BorgTest(unittest.TestCase): method setUp (line 7) | def setUp(self): method tearDown (line 14) | def tearDown(self): method test_initial_borg_state_shall_be_init (line 17) | def test_initial_borg_state_shall_be_init(self): method test_changing_instance_attribute_shall_change_borg_state (line 21) | def test_changing_instance_attribute_shall_change_borg_state(self): method test_instances_shall_have_own_ids (line 27) | def test_instances_shall_have_own_ids(self): FILE: tests/creational/test_builder.py class TestSimple (line 6) | class TestSimple(unittest.TestCase): method test_house (line 7) | def test_house(self): method test_flat (line 12) | def test_flat(self): class TestComplex (line 18) | class TestComplex(unittest.TestCase): method test_house (line 19) | def test_house(self): FILE: tests/creational/test_factory.py class TestFactory (line 4) | class TestFactory(unittest.TestCase): method test_get_localizer_greek (line 5) | def test_get_localizer_greek(self): method test_get_localizer_english (line 13) | def test_get_localizer_english(self): method test_get_localizer_default (line 19) | def test_get_localizer_default(self): method test_get_localizer_unknown_language (line 24) | def test_get_localizer_unknown_language(self): FILE: tests/creational/test_lazy.py class TestDynamicExpanding (line 6) | class TestDynamicExpanding(unittest.TestCase): method setUp (line 7) | def setUp(self): method test_innate_properties (line 10) | def test_innate_properties(self): method test_relatives_not_in_properties (line 16) | def test_relatives_not_in_properties(self): method test_extended_properties (line 19) | def test_extended_properties(self): method test_relatives_after_access (line 31) | def test_relatives_after_access(self): method test_parents (line 35) | def test_parents(self): FILE: tests/creational/test_pool.py class TestPool (line 7) | class TestPool(unittest.TestCase): method setUp (line 8) | def setUp(self): method test_items_recoil (line 13) | def test_items_recoil(self): method test_frozen_pool (line 21) | def test_frozen_pool(self): class TestNaitivePool (line 31) | class TestNaitivePool(unittest.TestCase): method test_pool_behavior_with_single_object_inside (line 36) | def test_pool_behavior_with_single_object_inside(self): FILE: tests/creational/test_prototype.py class TestPrototypeFeatures (line 6) | class TestPrototypeFeatures(unittest.TestCase): method setUp (line 7) | def setUp(self): method test_cloning_propperty_innate_values (line 10) | def test_cloning_propperty_innate_values(self): method test_extended_property_values_cloning (line 15) | def test_extended_property_values_cloning(self): method test_cloning_propperty_assigned_values (line 21) | def test_cloning_propperty_assigned_values(self): class TestDispatcherFeatures (line 27) | class TestDispatcherFeatures(unittest.TestCase): method setUp (line 28) | def setUp(self): method test_batch_retrieving (line 38) | def test_batch_retrieving(self): method test_particular_properties_retrieving (line 41) | def test_particular_properties_retrieving(self): method test_extended_properties_retrieving (line 46) | def test_extended_properties_retrieving(self): FILE: tests/fundamental/test_delegation.py function test_delegator_delegates_attribute_and_call (line 6) | def test_delegator_delegates_attribute_and_call(): function test_delegator_missing_attribute_raises (line 13) | def test_delegator_missing_attribute_raises(): FILE: tests/structural/test_adapter.py class ClassTest (line 6) | class ClassTest(unittest.TestCase): method setUp (line 7) | def setUp(self): method test_dog_shall_bark (line 13) | def test_dog_shall_bark(self): method test_cat_shall_meow (line 18) | def test_cat_shall_meow(self): method test_human_shall_speak (line 23) | def test_human_shall_speak(self): method test_car_shall_make_loud_noise (line 28) | def test_car_shall_make_loud_noise(self): method test_car_shall_make_very_loud_noise (line 33) | def test_car_shall_make_very_loud_noise(self): class AdapterTest (line 39) | class AdapterTest(unittest.TestCase): method test_dog_adapter_shall_make_noise (line 40) | def test_dog_adapter_shall_make_noise(self): method test_cat_adapter_shall_make_noise (line 47) | def test_cat_adapter_shall_make_noise(self): method test_human_adapter_shall_make_noise (line 54) | def test_human_adapter_shall_make_noise(self): method test_car_adapter_shall_make_loud_noise (line 61) | def test_car_adapter_shall_make_loud_noise(self): method test_car_adapter_shall_make_very_loud_noise (line 68) | def test_car_adapter_shall_make_very_loud_noise(self): FILE: tests/structural/test_bridge.py class BridgeTest (line 7) | class BridgeTest(unittest.TestCase): method test_bridge_shall_draw_with_concrete_api_implementation (line 8) | def test_bridge_shall_draw_with_concrete_api_implementation(cls): method test_bridge_shall_scale_both_api_circles_with_own_implementation (line 22) | def test_bridge_shall_scale_both_api_circles_with_own_implementation(c... FILE: tests/structural/test_decorator.py class TestTextWrapping (line 6) | class TestTextWrapping(unittest.TestCase): method setUp (line 7) | def setUp(self): method test_italic (line 10) | def test_italic(self): method test_bold (line 15) | def test_bold(self): method test_mixed_bold_and_italic (line 20) | def test_mixed_bold_and_italic(self): FILE: tests/structural/test_facade.py function test_computer_facade_start (line 4) | def test_computer_facade_start(capsys): FILE: tests/structural/test_flyweight.py function test_card_flyweight_identity_and_repr (line 4) | def test_card_flyweight_identity_and_repr(): function test_card_attribute_persistence_and_pool_clear (line 11) | def test_card_attribute_persistence_and_pool_clear(): FILE: tests/structural/test_mvc.py function test_productmodel_iteration_and_price_str (line 11) | def test_productmodel_iteration_and_price_str(): function test_productmodel_get_raises_keyerror (line 21) | def test_productmodel_get_raises_keyerror(): function test_consoleview_capitalizer_and_list_and_info (line 28) | def test_consoleview_capitalizer_and_list_and_info(capsys): function test_show_item_information_missing_calls_item_not_found (line 50) | def test_show_item_information_missing_calls_item_not_found(capsys): function test_router_register_resolve_and_unknown (line 60) | def test_router_register_resolve_and_unknown(): FILE: tests/structural/test_proxy.py class ProxyTest (line 8) | class ProxyTest(unittest.TestCase): method setUpClass (line 10) | def setUpClass(cls): method setUp (line 14) | def setUp(cls): method tearDown (line 20) | def tearDown(cls): method test_do_the_job_for_admin_shall_pass (line 25) | def test_do_the_job_for_admin_shall_pass(self): method test_do_the_job_for_anonymous_shall_reject (line 32) | def test_do_the_job_for_anonymous_shall_reject(self): FILE: tests/test_hsm.py class HsmMethodTest (line 15) | class HsmMethodTest(unittest.TestCase): method setUpClass (line 17) | def setUpClass(cls): method test_initial_state_shall_be_standby (line 20) | def test_initial_state_shall_be_standby(cls): method test_unsupported_state_shall_raise_exception (line 23) | def test_unsupported_state_shall_raise_exception(cls): method test_unsupported_message_type_shall_raise_exception (line 27) | def test_unsupported_message_type_shall_raise_exception(cls): method test_calling_next_state_shall_change_current_state (line 31) | def test_calling_next_state_shall_change_current_state(cls): method test_method_perform_switchover_shall_return_specifically (line 37) | def test_method_perform_switchover_shall_return_specifically(cls): class StandbyStateTest (line 45) | class StandbyStateTest(unittest.TestCase): method setUpClass (line 50) | def setUpClass(cls): method setUp (line 53) | def setUp(cls): method test_given_standby_on_message_switchover_shall_set_active (line 56) | def test_given_standby_on_message_switchover_shall_set_active(cls): method test_given_standby_on_message_switchover_shall_call_hsm_methods (line 60) | def test_given_standby_on_message_switchover_shall_call_hsm_methods(cls): method test_given_standby_on_message_fault_trigger_shall_set_suspect (line 75) | def test_given_standby_on_message_fault_trigger_shall_set_suspect(cls): method test_given_standby_on_message_diagnostics_failed_shall_raise_exception_and_keep_in_state (line 79) | def test_given_standby_on_message_diagnostics_failed_shall_raise_excep... method test_given_standby_on_message_diagnostics_passed_shall_raise_exception_and_keep_in_state (line 86) | def test_given_standby_on_message_diagnostics_passed_shall_raise_excep... method test_given_standby_on_message_operator_inservice_shall_raise_exception_and_keep_in_state (line 93) | def test_given_standby_on_message_operator_inservice_shall_raise_excep...