We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[fix] fix registry exception for duplicate factory
@TODO:
- return exception for duplicate factory
- check that all registries usage are correct: both in `__init__.py` and `model.py` for example
[fix] fix registry exception for duplicate factory
@TODO:
- return exception for duplicate factory
- check that all registries usage are correct: both in `__init__.py` and `model.py` for example

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `catalyst/utils/registry.py`
Content:
```
1 import warnings
2 import inspect
3 from typing import Dict, Callable, Any, Union, Type, Mapping, Tuple, List, \
4     Optional, Iterator
5 
6 Factory = Union[Type, Callable[..., Any]]
7 LateAddCallbak = Callable[["Registry"], None]
8 MetaFactory = Callable[[Factory, Tuple, Mapping], Any]
9 
10 
11 def _default_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):
12     return factory(*args, **kwargs)
13 
14 
15 class RegistryException(Exception):
16     def __init__(self, message):
17         super().__init__(message)
18 
19 
20 class Registry(Mapping):
21     """
22     Universal class allowing to add and access various factories by name
23     """
24 
25     def __init__(
26         self,
27         default_name_key: str,
28         default_meta_factory: MetaFactory = _default_meta_factory
29     ):
30         """
31         :param default_name_key: Default key containing factory name when
32             creating from config
33         :param default_meta_factory: default object that calls factory.
34             Optional. Default just calls factory.
35         """
36         self.meta_factory = default_meta_factory
37         self._name_key = default_name_key
38         self._factories: Dict[str, Factory] = {}
39         self._late_add_callbacks: List[LateAddCallbak] = []
40 
41     @staticmethod
42     def _get_factory_name(f, provided_name=None) -> str:
43         if not provided_name:
44             provided_name = getattr(f, "__name__", None)
45             if not provided_name:
46                 raise RegistryException(
47                     f"Factory {f} has no __name__ and no "
48                     f"name was provided"
49                 )
50             if provided_name == "<lambda>":
51                 raise RegistryException(
52                     "Name for lambda factories must be provided"
53                 )
54         return provided_name
55 
56     def _do_late_add(self):
57         if self._late_add_callbacks:
58             for cb in self._late_add_callbacks:
59                 cb(self)
60             self._late_add_callbacks = []
61 
62     def add(
63         self,
64         factory: Factory = None,
65         *factories: Factory,
66         name: str = None,
67         **named_factories: Factory
68     ) -> Factory:
69         """
70         Adds factory to registry with it's __name__ attribute or provided
71         name.
72         Signature is flexible.
73 
74         :param factory: Factory instance
75         :param factories: More instances
76         :param name: Provided name for first instance. Use only when pass
77         single instance.
78         :param named_factories: Factory and their names as kwargs
79 
80         :return: First factory passed
81         """
82         if len(factories) > 0 and name is not None:
83             raise RegistryException(
84                 "Multiple factories with single name are not allowed"
85             )
86 
87         if factory is not None:
88             named_factories[self._get_factory_name(factory, name)] = factory
89 
90         if len(factories) > 0:
91             new = {self._get_factory_name(f): f for f in factories}
92             named_factories.update(new)
93 
94         if len(named_factories) == 0:
95             warnings.warn("No factories were provided!")
96 
97         # @TODO: return warning
98         # for name in named_factories:
99         #     if name in self._factories:
100         #         raise RegistryException(
101         #             f"Factory with name '{name}' is already present"
102         #         )
103 
104         self._factories.update(named_factories)
105 
106         return factory
107 
108     def late_add(self, cb: LateAddCallbak):
109         """
110         Allows to prevent cycle imports by delaying some imports till next
111             registry query
112 
113         :param cb: Callback receives registry and must call it's methods to
114             register factories
115         :return:
116         """
117         self._late_add_callbacks.append(cb)
118 
119     def add_from_module(self, module) -> None:
120         """
121         Adds all factories present in module.
122         If __all__ attribute is present, takes ony what mentioned in it
123 
124         :param module: module to scan
125         :return: None
126         """
127         factories = {
128             k: v
129             for k, v in module.__dict__.items()
130             if inspect.isclass(v) or inspect.isfunction(v)
131         }
132 
133         # Filter by __all__ if present
134         names_to_add = getattr(module, "__all__", list(factories.keys()))
135 
136         to_add = {name: factories[name] for name in names_to_add}
137 
138         self.add(**to_add)
139 
140     def get(self, name: str) -> Optional[Factory]:
141         """
142         Retrieves factory, without creating any objects with it
143             or raises error
144 
145         :param name: factory name
146         :returns Factory
147         """
148 
149         self._do_late_add()
150 
151         if name is None:
152             return None
153 
154         res = self._factories.get(name, None)
155 
156         if not res:
157             raise RegistryException(
158                 f"No factory with name '{name}' was registered"
159             )
160 
161         return res
162 
163     def get_if_str(self, obj: Union[str, Factory]):
164         if type(obj) is str:
165             return self.get(obj)
166         return obj
167 
168     def get_instance(self, name: str, *args, meta_factory=None, **kwargs):
169         """
170         Creates instance by calling specified factory
171         with instantiate_fn
172         :param name: factory name
173         :param meta_factory: Function that calls factory the right way.
174             If not provided, default is used
175         :param args: args to pass to the factory
176         :param kwargs: kwargs to pass to the factory
177         :return: created instance
178         """
179         meta_factory = meta_factory or self.meta_factory
180         f = self.get(name)
181 
182         try:
183             if hasattr(f, "create_from_params"):
184                 return f.create_from_params(*args, **kwargs)
185             return meta_factory(f, args, kwargs)
186         except Exception as e:
187             raise RegistryException(
188                 f"Factory '{name}' call failed: args={args} kwargs={kwargs}"
189             ) from e
190 
191     def get_from_params(
192         self, *, meta_factory=None, **kwargs
193     ) -> Union[Any, Tuple[Any, Mapping[str, Any]]]:
194         """
195         Creates instance based in configuration dict with instantiation_fn.
196         If config[name_key] is None, None is returned.
197 
198         :param meta_factory: Function that calls factory the right way.
199             If not provided, default is used.
200         :param kwargs: additional kwargs for factory
201         :return: result of calling instantiate_fn(factory, **config)
202         """
203 
204         name = kwargs.pop(self._name_key, None)
205         if name:
206             return self.get_instance(name, meta_factory=meta_factory, **kwargs)
207 
208     def all(self) -> List[str]:
209         """
210         :return: list of names of registered items
211         """
212         self._do_late_add()
213         result = list(self._factories.keys())
214 
215         return result
216 
217     def len(self) -> int:
218         """
219         :return: length of registered items
220         """
221         return len(self._factories)
222 
223     def __str__(self) -> str:
224         return self.all().__str__()
225 
226     def __repr__(self) -> str:
227         return self.all().__str__()
228 
229     # mapping methods
230     def __len__(self) -> int:
231         self._do_late_add()
232         return self.len()
233 
234     def __getitem__(self, name: str) -> Optional[Factory]:
235         return self.get(name)
236 
237     def __iter__(self) -> Iterator[str]:
238         self._do_late_add()
239         return self._factories.__iter__()
240 
241     def __contains__(self, name: str):
242         self._do_late_add()
243         return self._factories.__contains__(name)
244 
245     def __setitem__(self, name: str, factory: Factory) -> None:
246         self.add(factory, name=name)
247 
248 
249 __all__ = ["Registry", "RegistryException"]
250
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/catalyst/utils/registry.py b/catalyst/utils/registry.py
--- a/catalyst/utils/registry.py
+++ b/catalyst/utils/registry.py
@@ -94,12 +94,15 @@
         if len(named_factories) == 0:
             warnings.warn("No factories were provided!")
 
-        # @TODO: return warning
-        # for name in named_factories:
-        #     if name in self._factories:
-        #         raise RegistryException(
-        #             f"Factory with name '{name}' is already present"
-        #         )
+        for name, f in named_factories.items():
+            # self._factories[name] != f is a workaround for
+            # https://github.com/catalyst-team/catalyst/issues/135
+            if name in self._factories and self._factories[name] != f:
+                raise RegistryException(
+                    f"Factory with name '{name}' is already present\n"
+                    f"Already registered: '{self._factories[name]}'\n"
+                    f"New: '{f}'"
+                )
 
         self._factories.update(named_factories)

{"golden_diff": "diff --git a/catalyst/utils/registry.py b/catalyst/utils/registry.py\n--- a/catalyst/utils/registry.py\n+++ b/catalyst/utils/registry.py\n@@ -94,12 +94,15 @@\n         if len(named_factories) == 0:\n             warnings.warn(\"No factories were provided!\")\n \n-        # @TODO: return warning\n-        # for name in named_factories:\n-        #     if name in self._factories:\n-        #         raise RegistryException(\n-        #             f\"Factory with name '{name}' is already present\"\n-        #         )\n+        for name, f in named_factories.items():\n+            # self._factories[name] != f is a workaround for\n+            # https://github.com/catalyst-team/catalyst/issues/135\n+            if name in self._factories and self._factories[name] != f:\n+                raise RegistryException(\n+                    f\"Factory with name '{name}' is already present\\n\"\n+                    f\"Already registered: '{self._factories[name]}'\\n\"\n+                    f\"New: '{f}'\"\n+                )\n \n         self._factories.update(named_factories)\n", "issue": "[fix] fix registry exception for duplicate factory\n@TODO:\r\n- return exception for duplicate factory\r\n- check that all registries usage are correct: both in `__init__.py` and `model.py` for example\n[fix] fix registry exception for duplicate factory\n@TODO:\r\n- return exception for duplicate factory\r\n- check that all registries usage are correct: both in `__init__.py` and `model.py` for example\n", "before_files": [{"content": "import warnings\nimport inspect\nfrom typing import Dict, Callable, Any, Union, Type, Mapping, Tuple, List, \\\n    Optional, Iterator\n\nFactory = Union[Type, Callable[..., Any]]\nLateAddCallbak = Callable[[\"Registry\"], None]\nMetaFactory = Callable[[Factory, Tuple, Mapping], Any]\n\n\ndef _default_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):\n    return factory(*args, **kwargs)\n\n\nclass RegistryException(Exception):\n    def __init__(self, message):\n        super().__init__(message)\n\n\nclass Registry(Mapping):\n    \"\"\"\n    Universal class allowing to add and access various factories by name\n    \"\"\"\n\n    def __init__(\n        self,\n        default_name_key: str,\n        default_meta_factory: MetaFactory = _default_meta_factory\n    ):\n        \"\"\"\n        :param default_name_key: Default key containing factory name when\n            creating from config\n        :param default_meta_factory: default object that calls factory.\n            Optional. Default just calls factory.\n        \"\"\"\n        self.meta_factory = default_meta_factory\n        self._name_key = default_name_key\n        self._factories: Dict[str, Factory] = {}\n        self._late_add_callbacks: List[LateAddCallbak] = []\n\n    @staticmethod\n    def _get_factory_name(f, provided_name=None) -> str:\n        if not provided_name:\n            provided_name = getattr(f, \"__name__\", None)\n            if not provided_name:\n                raise RegistryException(\n                    f\"Factory {f} has no __name__ and no \"\n                    f\"name was provided\"\n                )\n            if provided_name == \"<lambda>\":\n                raise RegistryException(\n                    \"Name for lambda factories must be provided\"\n                )\n        return provided_name\n\n    def _do_late_add(self):\n        if self._late_add_callbacks:\n            for cb in self._late_add_callbacks:\n                cb(self)\n            self._late_add_callbacks = []\n\n    def add(\n        self,\n        factory: Factory = None,\n        *factories: Factory,\n        name: str = None,\n        **named_factories: Factory\n    ) -> Factory:\n        \"\"\"\n        Adds factory to registry with it's __name__ attribute or provided\n        name.\n        Signature is flexible.\n\n        :param factory: Factory instance\n        :param factories: More instances\n        :param name: Provided name for first instance. Use only when pass\n        single instance.\n        :param named_factories: Factory and their names as kwargs\n\n        :return: First factory passed\n        \"\"\"\n        if len(factories) > 0 and name is not None:\n            raise RegistryException(\n                \"Multiple factories with single name are not allowed\"\n            )\n\n        if factory is not None:\n            named_factories[self._get_factory_name(factory, name)] = factory\n\n        if len(factories) > 0:\n            new = {self._get_factory_name(f): f for f in factories}\n            named_factories.update(new)\n\n        if len(named_factories) == 0:\n            warnings.warn(\"No factories were provided!\")\n\n        # @TODO: return warning\n        # for name in named_factories:\n        #     if name in self._factories:\n        #         raise RegistryException(\n        #             f\"Factory with name '{name}' is already present\"\n        #         )\n\n        self._factories.update(named_factories)\n\n        return factory\n\n    def late_add(self, cb: LateAddCallbak):\n        \"\"\"\n        Allows to prevent cycle imports by delaying some imports till next\n            registry query\n\n        :param cb: Callback receives registry and must call it's methods to\n            register factories\n        :return:\n        \"\"\"\n        self._late_add_callbacks.append(cb)\n\n    def add_from_module(self, module) -> None:\n        \"\"\"\n        Adds all factories present in module.\n        If __all__ attribute is present, takes ony what mentioned in it\n\n        :param module: module to scan\n        :return: None\n        \"\"\"\n        factories = {\n            k: v\n            for k, v in module.__dict__.items()\n            if inspect.isclass(v) or inspect.isfunction(v)\n        }\n\n        # Filter by __all__ if present\n        names_to_add = getattr(module, \"__all__\", list(factories.keys()))\n\n        to_add = {name: factories[name] for name in names_to_add}\n\n        self.add(**to_add)\n\n    def get(self, name: str) -> Optional[Factory]:\n        \"\"\"\n        Retrieves factory, without creating any objects with it\n            or raises error\n\n        :param name: factory name\n        :returns Factory\n        \"\"\"\n\n        self._do_late_add()\n\n        if name is None:\n            return None\n\n        res = self._factories.get(name, None)\n\n        if not res:\n            raise RegistryException(\n                f\"No factory with name '{name}' was registered\"\n            )\n\n        return res\n\n    def get_if_str(self, obj: Union[str, Factory]):\n        if type(obj) is str:\n            return self.get(obj)\n        return obj\n\n    def get_instance(self, name: str, *args, meta_factory=None, **kwargs):\n        \"\"\"\n        Creates instance by calling specified factory\n        with instantiate_fn\n        :param name: factory name\n        :param meta_factory: Function that calls factory the right way.\n            If not provided, default is used\n        :param args: args to pass to the factory\n        :param kwargs: kwargs to pass to the factory\n        :return: created instance\n        \"\"\"\n        meta_factory = meta_factory or self.meta_factory\n        f = self.get(name)\n\n        try:\n            if hasattr(f, \"create_from_params\"):\n                return f.create_from_params(*args, **kwargs)\n            return meta_factory(f, args, kwargs)\n        except Exception as e:\n            raise RegistryException(\n                f\"Factory '{name}' call failed: args={args} kwargs={kwargs}\"\n            ) from e\n\n    def get_from_params(\n        self, *, meta_factory=None, **kwargs\n    ) -> Union[Any, Tuple[Any, Mapping[str, Any]]]:\n        \"\"\"\n        Creates instance based in configuration dict with instantiation_fn.\n        If config[name_key] is None, None is returned.\n\n        :param meta_factory: Function that calls factory the right way.\n            If not provided, default is used.\n        :param kwargs: additional kwargs for factory\n        :return: result of calling instantiate_fn(factory, **config)\n        \"\"\"\n\n        name = kwargs.pop(self._name_key, None)\n        if name:\n            return self.get_instance(name, meta_factory=meta_factory, **kwargs)\n\n    def all(self) -> List[str]:\n        \"\"\"\n        :return: list of names of registered items\n        \"\"\"\n        self._do_late_add()\n        result = list(self._factories.keys())\n\n        return result\n\n    def len(self) -> int:\n        \"\"\"\n        :return: length of registered items\n        \"\"\"\n        return len(self._factories)\n\n    def __str__(self) -> str:\n        return self.all().__str__()\n\n    def __repr__(self) -> str:\n        return self.all().__str__()\n\n    # mapping methods\n    def __len__(self) -> int:\n        self._do_late_add()\n        return self.len()\n\n    def __getitem__(self, name: str) -> Optional[Factory]:\n        return self.get(name)\n\n    def __iter__(self) -> Iterator[str]:\n        self._do_late_add()\n        return self._factories.__iter__()\n\n    def __contains__(self, name: str):\n        self._do_late_add()\n        return self._factories.__contains__(name)\n\n    def __setitem__(self, name: str, factory: Factory) -> None:\n        self.add(factory, name=name)\n\n\n__all__ = [\"Registry\", \"RegistryException\"]\n", "path": "catalyst/utils/registry.py"}], "after_files": [{"content": "import warnings\nimport inspect\nfrom typing import Dict, Callable, Any, Union, Type, Mapping, Tuple, List, \\\n    Optional, Iterator\n\nFactory = Union[Type, Callable[..., Any]]\nLateAddCallbak = Callable[[\"Registry\"], None]\nMetaFactory = Callable[[Factory, Tuple, Mapping], Any]\n\n\ndef _default_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):\n    return factory(*args, **kwargs)\n\n\nclass RegistryException(Exception):\n    def __init__(self, message):\n        super().__init__(message)\n\n\nclass Registry(Mapping):\n    \"\"\"\n    Universal class allowing to add and access various factories by name\n    \"\"\"\n\n    def __init__(\n        self,\n        default_name_key: str,\n        default_meta_factory: MetaFactory = _default_meta_factory\n    ):\n        \"\"\"\n        :param default_name_key: Default key containing factory name when\n            creating from config\n        :param default_meta_factory: default object that calls factory.\n            Optional. Default just calls factory.\n        \"\"\"\n        self.meta_factory = default_meta_factory\n        self._name_key = default_name_key\n        self._factories: Dict[str, Factory] = {}\n        self._late_add_callbacks: List[LateAddCallbak] = []\n\n    @staticmethod\n    def _get_factory_name(f, provided_name=None) -> str:\n        if not provided_name:\n            provided_name = getattr(f, \"__name__\", None)\n            if not provided_name:\n                raise RegistryException(\n                    f\"Factory {f} has no __name__ and no \"\n                    f\"name was provided\"\n                )\n            if provided_name == \"<lambda>\":\n                raise RegistryException(\n                    \"Name for lambda factories must be provided\"\n                )\n        return provided_name\n\n    def _do_late_add(self):\n        if self._late_add_callbacks:\n            for cb in self._late_add_callbacks:\n                cb(self)\n            self._late_add_callbacks = []\n\n    def add(\n        self,\n        factory: Factory = None,\n        *factories: Factory,\n        name: str = None,\n        **named_factories: Factory\n    ) -> Factory:\n        \"\"\"\n        Adds factory to registry with it's __name__ attribute or provided\n        name.\n        Signature is flexible.\n\n        :param factory: Factory instance\n        :param factories: More instances\n        :param name: Provided name for first instance. Use only when pass\n        single instance.\n        :param named_factories: Factory and their names as kwargs\n\n        :return: First factory passed\n        \"\"\"\n        if len(factories) > 0 and name is not None:\n            raise RegistryException(\n                \"Multiple factories with single name are not allowed\"\n            )\n\n        if factory is not None:\n            named_factories[self._get_factory_name(factory, name)] = factory\n\n        if len(factories) > 0:\n            new = {self._get_factory_name(f): f for f in factories}\n            named_factories.update(new)\n\n        if len(named_factories) == 0:\n            warnings.warn(\"No factories were provided!\")\n\n        for name, f in named_factories.items():\n            # self._factories[name] != f is a workaround for\n            # https://github.com/catalyst-team/catalyst/issues/135\n            if name in self._factories and self._factories[name] != f:\n                raise RegistryException(\n                    f\"Factory with name '{name}' is already present\\n\"\n                    f\"Already registered: '{self._factories[name]}'\\n\"\n                    f\"New: '{f}'\"\n                )\n\n        self._factories.update(named_factories)\n\n        return factory\n\n    def late_add(self, cb: LateAddCallbak):\n        \"\"\"\n        Allows to prevent cycle imports by delaying some imports till next\n            registry query\n\n        :param cb: Callback receives registry and must call it's methods to\n            register factories\n        :return:\n        \"\"\"\n        self._late_add_callbacks.append(cb)\n\n    def add_from_module(self, module) -> None:\n        \"\"\"\n        Adds all factories present in module.\n        If __all__ attribute is present, takes ony what mentioned in it\n\n        :param module: module to scan\n        :return: None\n        \"\"\"\n        factories = {\n            k: v\n            for k, v in module.__dict__.items()\n            if inspect.isclass(v) or inspect.isfunction(v)\n        }\n\n        # Filter by __all__ if present\n        names_to_add = getattr(module, \"__all__\", list(factories.keys()))\n\n        to_add = {name: factories[name] for name in names_to_add}\n\n        self.add(**to_add)\n\n    def get(self, name: str) -> Optional[Factory]:\n        \"\"\"\n        Retrieves factory, without creating any objects with it\n            or raises error\n\n        :param name: factory name\n        :returns Factory\n        \"\"\"\n\n        self._do_late_add()\n\n        if name is None:\n            return None\n\n        res = self._factories.get(name, None)\n\n        if not res:\n            raise RegistryException(\n                f\"No factory with name '{name}' was registered\"\n            )\n\n        return res\n\n    def get_if_str(self, obj: Union[str, Factory]):\n        if type(obj) is str:\n            return self.get(obj)\n        return obj\n\n    def get_instance(self, name: str, *args, meta_factory=None, **kwargs):\n        \"\"\"\n        Creates instance by calling specified factory\n        with instantiate_fn\n        :param name: factory name\n        :param meta_factory: Function that calls factory the right way.\n            If not provided, default is used\n        :param args: args to pass to the factory\n        :param kwargs: kwargs to pass to the factory\n        :return: created instance\n        \"\"\"\n        meta_factory = meta_factory or self.meta_factory\n        f = self.get(name)\n\n        try:\n            if hasattr(f, \"create_from_params\"):\n                return f.create_from_params(*args, **kwargs)\n            return meta_factory(f, args, kwargs)\n        except Exception as e:\n            raise RegistryException(\n                f\"Factory '{name}' call failed: args={args} kwargs={kwargs}\"\n            ) from e\n\n    def get_from_params(\n        self, *, meta_factory=None, **kwargs\n    ) -> Union[Any, Tuple[Any, Mapping[str, Any]]]:\n        \"\"\"\n        Creates instance based in configuration dict with instantiation_fn.\n        If config[name_key] is None, None is returned.\n\n        :param meta_factory: Function that calls factory the right way.\n            If not provided, default is used.\n        :param kwargs: additional kwargs for factory\n        :return: result of calling instantiate_fn(factory, **config)\n        \"\"\"\n\n        name = kwargs.pop(self._name_key, None)\n        if name:\n            return self.get_instance(name, meta_factory=meta_factory, **kwargs)\n\n    def all(self) -> List[str]:\n        \"\"\"\n        :return: list of names of registered items\n        \"\"\"\n        self._do_late_add()\n        result = list(self._factories.keys())\n\n        return result\n\n    def len(self) -> int:\n        \"\"\"\n        :return: length of registered items\n        \"\"\"\n        return len(self._factories)\n\n    def __str__(self) -> str:\n        return self.all().__str__()\n\n    def __repr__(self) -> str:\n        return self.all().__str__()\n\n    # mapping methods\n    def __len__(self) -> int:\n        self._do_late_add()\n        return self.len()\n\n    def __getitem__(self, name: str) -> Optional[Factory]:\n        return self.get(name)\n\n    def __iter__(self) -> Iterator[str]:\n        self._do_late_add()\n        return self._factories.__iter__()\n\n    def __contains__(self, name: str):\n        self._do_late_add()\n        return self._factories.__contains__(name)\n\n    def __setitem__(self, name: str, factory: Factory) -> None:\n        self.add(factory, name=name)\n\n\n__all__ = [\"Registry\", \"RegistryException\"]\n", "path": "catalyst/utils/registry.py"}]}