Search for the first item of type `item_type` with `attributes` in `item_list`. `attributes` are compared using the utility `check_nested_attrs`.
(
item_list: Iterable[T], item_type: Type[T], attributes: Mapping
)
| 71 | |
| 72 | |
| 73 | def search_for_item( |
| 74 | item_list: Iterable[T], item_type: Type[T], attributes: Mapping |
| 75 | ) -> Optional[T]: |
| 76 | """Search for the first item of type `item_type` with `attributes` in |
| 77 | `item_list`. |
| 78 | |
| 79 | `attributes` are compared using the utility `check_nested_attrs`. |
| 80 | """ |
| 81 | for item in item_list: |
| 82 | if isinstance(item, item_type) and check_nested_attrs(item, attributes): |
| 83 | return item |
| 84 | |
| 85 | return None |
| 86 | |
| 87 | |
| 88 | def raiden_events_search_for_item( |