We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Problem with typing
Some error is occurring with sentry for python (using python 3.8)

```
[ERROR] AttributeError: type object 'Callable' has no attribute '_abc_registry'
Traceback (most recent call last):
  File "/var/task/handler.py", line 609, in lambda_handler
    return LambdaHandler.lambda_handler(event, context)
  File "/var/task/handler.py", line 240, in lambda_handler
    handler = cls()
  File "/var/task/handler.py", line 134, in __init__
    self.app_module = importlib.import_module(self.settings.APP_MODULE)
  File "/var/lang/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/task/src/main.py", line 6, in <module>
    import sentry_sdk
  File "/var/task/sentry_sdk/__init__.py", line 1, in <module>
    from sentry_sdk.hub import Hub, init
  File "/var/task/sentry_sdk/hub.py", line 8, in <module>
    from sentry_sdk._compat import with_metaclass
  File "/var/task/sentry_sdk/_compat.py", line 3, in <module>
    from sentry_sdk._types import MYPY
  File "/var/task/sentry_sdk/_types.py", line 2, in <module>
    from typing import TYPE_CHECKING as MYPY
  File "/var/task/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/var/task/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry

```
Any hint?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sentry_sdk/api.py`
Content:
```
1 import inspect
2 from contextlib import contextmanager
3 
4 from sentry_sdk.hub import Hub
5 from sentry_sdk.scope import Scope
6 
7 from sentry_sdk._types import MYPY
8 
9 if MYPY:
10     from typing import Any
11     from typing import Dict
12     from typing import Optional
13     from typing import overload
14     from typing import Callable
15     from typing import TypeVar
16     from typing import ContextManager
17 
18     from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint
19     from sentry_sdk.tracing import Span
20 
21     T = TypeVar("T")
22     F = TypeVar("F", bound=Callable[..., Any])
23 else:
24 
25     def overload(x):
26         # type: (T) -> T
27         return x
28 
29 
30 __all__ = [
31     "capture_event",
32     "capture_message",
33     "capture_exception",
34     "add_breadcrumb",
35     "configure_scope",
36     "push_scope",
37     "flush",
38     "last_event_id",
39     "start_span",
40     "set_tag",
41     "set_context",
42     "set_extra",
43     "set_user",
44     "set_level",
45 ]
46 
47 
48 def hubmethod(f):
49     # type: (F) -> F
50     f.__doc__ = "%s\n\n%s" % (
51         "Alias for :py:meth:`sentry_sdk.Hub.%s`" % f.__name__,
52         inspect.getdoc(getattr(Hub, f.__name__)),
53     )
54     return f
55 
56 
57 def scopemethod(f):
58     # type: (F) -> F
59     f.__doc__ = "%s\n\n%s" % (
60         "Alias for :py:meth:`sentry_sdk.Scope.%s`" % f.__name__,
61         inspect.getdoc(getattr(Scope, f.__name__)),
62     )
63     return f
64 
65 
66 @hubmethod
67 def capture_event(
68     event,  # type: Event
69     hint=None,  # type: Optional[Hint]
70     scope=None,  # type: Optional[Any]
71     **scope_args  # type: Dict[str, Any]
72 ):
73     # type: (...) -> Optional[str]
74     hub = Hub.current
75     if hub is not None:
76         return hub.capture_event(event, hint, scope=scope, **scope_args)
77     return None
78 
79 
80 @hubmethod
81 def capture_message(
82     message,  # type: str
83     level=None,  # type: Optional[str]
84     scope=None,  # type: Optional[Any]
85     **scope_args  # type: Dict[str, Any]
86 ):
87     # type: (...) -> Optional[str]
88     hub = Hub.current
89     if hub is not None:
90         return hub.capture_message(message, level, scope=scope, **scope_args)
91     return None
92 
93 
94 @hubmethod
95 def capture_exception(
96     error=None,  # type: Optional[BaseException]
97     scope=None,  # type: Optional[Any]
98     **scope_args  # type: Dict[str, Any]
99 ):
100     # type: (...) -> Optional[str]
101     hub = Hub.current
102     if hub is not None:
103         return hub.capture_exception(error, scope=scope, **scope_args)
104     return None
105 
106 
107 @hubmethod
108 def add_breadcrumb(
109     crumb=None,  # type: Optional[Breadcrumb]
110     hint=None,  # type: Optional[BreadcrumbHint]
111     **kwargs  # type: Any
112 ):
113     # type: (...) -> None
114     hub = Hub.current
115     if hub is not None:
116         return hub.add_breadcrumb(crumb, hint, **kwargs)
117 
118 
119 @overload  # noqa
120 def configure_scope():
121     # type: () -> ContextManager[Scope]
122     pass
123 
124 
125 @overload  # noqa
126 def configure_scope(
127     callback,  # type: Callable[[Scope], None]
128 ):
129     # type: (...) -> None
130     pass
131 
132 
133 @hubmethod  # noqa
134 def configure_scope(
135     callback=None,  # type: Optional[Callable[[Scope], None]]
136 ):
137     # type: (...) -> Optional[ContextManager[Scope]]
138     hub = Hub.current
139     if hub is not None:
140         return hub.configure_scope(callback)
141     elif callback is None:
142 
143         @contextmanager
144         def inner():
145             yield Scope()
146 
147         return inner()
148     else:
149         # returned if user provided callback
150         return None
151 
152 
153 @overload  # noqa
154 def push_scope():
155     # type: () -> ContextManager[Scope]
156     pass
157 
158 
159 @overload  # noqa
160 def push_scope(
161     callback,  # type: Callable[[Scope], None]
162 ):
163     # type: (...) -> None
164     pass
165 
166 
167 @hubmethod  # noqa
168 def push_scope(
169     callback=None,  # type: Optional[Callable[[Scope], None]]
170 ):
171     # type: (...) -> Optional[ContextManager[Scope]]
172     hub = Hub.current
173     if hub is not None:
174         return hub.push_scope(callback)
175     elif callback is None:
176 
177         @contextmanager
178         def inner():
179             yield Scope()
180 
181         return inner()
182     else:
183         # returned if user provided callback
184         return None
185 
186 
187 @scopemethod  # noqa
188 def set_tag(key, value):
189     # type: (str, Any) -> None
190     hub = Hub.current
191     if hub is not None:
192         hub.scope.set_tag(key, value)
193 
194 
195 @scopemethod  # noqa
196 def set_context(key, value):
197     # type: (str, Any) -> None
198     hub = Hub.current
199     if hub is not None:
200         hub.scope.set_context(key, value)
201 
202 
203 @scopemethod  # noqa
204 def set_extra(key, value):
205     # type: (str, Any) -> None
206     hub = Hub.current
207     if hub is not None:
208         hub.scope.set_extra(key, value)
209 
210 
211 @scopemethod  # noqa
212 def set_user(value):
213     # type: (Dict[str, Any]) -> None
214     hub = Hub.current
215     if hub is not None:
216         hub.scope.set_user(value)
217 
218 
219 @scopemethod  # noqa
220 def set_level(value):
221     # type: (str) -> None
222     hub = Hub.current
223     if hub is not None:
224         hub.scope.set_level(value)
225 
226 
227 @hubmethod
228 def flush(
229     timeout=None,  # type: Optional[float]
230     callback=None,  # type: Optional[Callable[[int, float], None]]
231 ):
232     # type: (...) -> None
233     hub = Hub.current
234     if hub is not None:
235         return hub.flush(timeout=timeout, callback=callback)
236 
237 
238 @hubmethod
239 def last_event_id():
240     # type: () -> Optional[str]
241     hub = Hub.current
242     if hub is not None:
243         return hub.last_event_id()
244     return None
245 
246 
247 @hubmethod
248 def start_span(
249     span=None,  # type: Optional[Span]
250     **kwargs  # type: Any
251 ):
252     # type: (...) -> Span
253 
254     # TODO: All other functions in this module check for
255     # `Hub.current is None`. That actually should never happen?
256     return Hub.current.start_span(span=span, **kwargs)
257
```
--- 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/sentry_sdk/api.py b/sentry_sdk/api.py
--- a/sentry_sdk/api.py
+++ b/sentry_sdk/api.py
@@ -14,8 +14,9 @@
     from typing import Callable
     from typing import TypeVar
     from typing import ContextManager
+    from typing import Union
 
-    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint
+    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint, ExcInfo
     from sentry_sdk.tracing import Span
 
     T = TypeVar("T")
@@ -93,7 +94,7 @@
 
 @hubmethod
 def capture_exception(
-    error=None,  # type: Optional[BaseException]
+    error=None,  # type: Optional[Union[BaseException, ExcInfo]]
     scope=None,  # type: Optional[Any]
     **scope_args  # type: Dict[str, Any]
 ):

{"golden_diff": "diff --git a/sentry_sdk/api.py b/sentry_sdk/api.py\n--- a/sentry_sdk/api.py\n+++ b/sentry_sdk/api.py\n@@ -14,8 +14,9 @@\n     from typing import Callable\n     from typing import TypeVar\n     from typing import ContextManager\n+    from typing import Union\n \n-    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint\n+    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint, ExcInfo\n     from sentry_sdk.tracing import Span\n \n     T = TypeVar(\"T\")\n@@ -93,7 +94,7 @@\n \n @hubmethod\n def capture_exception(\n-    error=None,  # type: Optional[BaseException]\n+    error=None,  # type: Optional[Union[BaseException, ExcInfo]]\n     scope=None,  # type: Optional[Any]\n     **scope_args  # type: Dict[str, Any]\n ):\n", "issue": "Problem with typing\nSome error is occurring with sentry for python (using python 3.8)\r\n\r\n```\r\n[ERROR] AttributeError: type object 'Callable' has no attribute '_abc_registry'\r\nTraceback (most recent call last):\r\n  File \"/var/task/handler.py\", line 609, in lambda_handler\r\n    return LambdaHandler.lambda_handler(event, context)\r\n  File \"/var/task/handler.py\", line 240, in lambda_handler\r\n    handler = cls()\r\n  File \"/var/task/handler.py\", line 134, in __init__\r\n    self.app_module = importlib.import_module(self.settings.APP_MODULE)\r\n  File \"/var/lang/lib/python3.8/importlib/__init__.py\", line 127, in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap_external>\", line 783, in exec_module\r\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\r\n  File \"/var/task/src/main.py\", line 6, in <module>\r\n    import sentry_sdk\r\n  File \"/var/task/sentry_sdk/__init__.py\", line 1, in <module>\r\n    from sentry_sdk.hub import Hub, init\r\n  File \"/var/task/sentry_sdk/hub.py\", line 8, in <module>\r\n    from sentry_sdk._compat import with_metaclass\r\n  File \"/var/task/sentry_sdk/_compat.py\", line 3, in <module>\r\n    from sentry_sdk._types import MYPY\r\n  File \"/var/task/sentry_sdk/_types.py\", line 2, in <module>\r\n    from typing import TYPE_CHECKING as MYPY\r\n  File \"/var/task/typing.py\", line 1357, in <module>\r\n    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):\r\n  File \"/var/task/typing.py\", line 1005, in __new__\r\n    self._abc_registry = extra._abc_registry\r\n\r\n```\r\nAny hint?\n", "before_files": [{"content": "import inspect\nfrom contextlib import contextmanager\n\nfrom sentry_sdk.hub import Hub\nfrom sentry_sdk.scope import Scope\n\nfrom sentry_sdk._types import MYPY\n\nif MYPY:\n    from typing import Any\n    from typing import Dict\n    from typing import Optional\n    from typing import overload\n    from typing import Callable\n    from typing import TypeVar\n    from typing import ContextManager\n\n    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint\n    from sentry_sdk.tracing import Span\n\n    T = TypeVar(\"T\")\n    F = TypeVar(\"F\", bound=Callable[..., Any])\nelse:\n\n    def overload(x):\n        # type: (T) -> T\n        return x\n\n\n__all__ = [\n    \"capture_event\",\n    \"capture_message\",\n    \"capture_exception\",\n    \"add_breadcrumb\",\n    \"configure_scope\",\n    \"push_scope\",\n    \"flush\",\n    \"last_event_id\",\n    \"start_span\",\n    \"set_tag\",\n    \"set_context\",\n    \"set_extra\",\n    \"set_user\",\n    \"set_level\",\n]\n\n\ndef hubmethod(f):\n    # type: (F) -> F\n    f.__doc__ = \"%s\\n\\n%s\" % (\n        \"Alias for :py:meth:`sentry_sdk.Hub.%s`\" % f.__name__,\n        inspect.getdoc(getattr(Hub, f.__name__)),\n    )\n    return f\n\n\ndef scopemethod(f):\n    # type: (F) -> F\n    f.__doc__ = \"%s\\n\\n%s\" % (\n        \"Alias for :py:meth:`sentry_sdk.Scope.%s`\" % f.__name__,\n        inspect.getdoc(getattr(Scope, f.__name__)),\n    )\n    return f\n\n\n@hubmethod\ndef capture_event(\n    event,  # type: Event\n    hint=None,  # type: Optional[Hint]\n    scope=None,  # type: Optional[Any]\n    **scope_args  # type: Dict[str, Any]\n):\n    # type: (...) -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.capture_event(event, hint, scope=scope, **scope_args)\n    return None\n\n\n@hubmethod\ndef capture_message(\n    message,  # type: str\n    level=None,  # type: Optional[str]\n    scope=None,  # type: Optional[Any]\n    **scope_args  # type: Dict[str, Any]\n):\n    # type: (...) -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.capture_message(message, level, scope=scope, **scope_args)\n    return None\n\n\n@hubmethod\ndef capture_exception(\n    error=None,  # type: Optional[BaseException]\n    scope=None,  # type: Optional[Any]\n    **scope_args  # type: Dict[str, Any]\n):\n    # type: (...) -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.capture_exception(error, scope=scope, **scope_args)\n    return None\n\n\n@hubmethod\ndef add_breadcrumb(\n    crumb=None,  # type: Optional[Breadcrumb]\n    hint=None,  # type: Optional[BreadcrumbHint]\n    **kwargs  # type: Any\n):\n    # type: (...) -> None\n    hub = Hub.current\n    if hub is not None:\n        return hub.add_breadcrumb(crumb, hint, **kwargs)\n\n\n@overload  # noqa\ndef configure_scope():\n    # type: () -> ContextManager[Scope]\n    pass\n\n\n@overload  # noqa\ndef configure_scope(\n    callback,  # type: Callable[[Scope], None]\n):\n    # type: (...) -> None\n    pass\n\n\n@hubmethod  # noqa\ndef configure_scope(\n    callback=None,  # type: Optional[Callable[[Scope], None]]\n):\n    # type: (...) -> Optional[ContextManager[Scope]]\n    hub = Hub.current\n    if hub is not None:\n        return hub.configure_scope(callback)\n    elif callback is None:\n\n        @contextmanager\n        def inner():\n            yield Scope()\n\n        return inner()\n    else:\n        # returned if user provided callback\n        return None\n\n\n@overload  # noqa\ndef push_scope():\n    # type: () -> ContextManager[Scope]\n    pass\n\n\n@overload  # noqa\ndef push_scope(\n    callback,  # type: Callable[[Scope], None]\n):\n    # type: (...) -> None\n    pass\n\n\n@hubmethod  # noqa\ndef push_scope(\n    callback=None,  # type: Optional[Callable[[Scope], None]]\n):\n    # type: (...) -> Optional[ContextManager[Scope]]\n    hub = Hub.current\n    if hub is not None:\n        return hub.push_scope(callback)\n    elif callback is None:\n\n        @contextmanager\n        def inner():\n            yield Scope()\n\n        return inner()\n    else:\n        # returned if user provided callback\n        return None\n\n\n@scopemethod  # noqa\ndef set_tag(key, value):\n    # type: (str, Any) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_tag(key, value)\n\n\n@scopemethod  # noqa\ndef set_context(key, value):\n    # type: (str, Any) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_context(key, value)\n\n\n@scopemethod  # noqa\ndef set_extra(key, value):\n    # type: (str, Any) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_extra(key, value)\n\n\n@scopemethod  # noqa\ndef set_user(value):\n    # type: (Dict[str, Any]) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_user(value)\n\n\n@scopemethod  # noqa\ndef set_level(value):\n    # type: (str) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_level(value)\n\n\n@hubmethod\ndef flush(\n    timeout=None,  # type: Optional[float]\n    callback=None,  # type: Optional[Callable[[int, float], None]]\n):\n    # type: (...) -> None\n    hub = Hub.current\n    if hub is not None:\n        return hub.flush(timeout=timeout, callback=callback)\n\n\n@hubmethod\ndef last_event_id():\n    # type: () -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.last_event_id()\n    return None\n\n\n@hubmethod\ndef start_span(\n    span=None,  # type: Optional[Span]\n    **kwargs  # type: Any\n):\n    # type: (...) -> Span\n\n    # TODO: All other functions in this module check for\n    # `Hub.current is None`. That actually should never happen?\n    return Hub.current.start_span(span=span, **kwargs)\n", "path": "sentry_sdk/api.py"}], "after_files": [{"content": "import inspect\nfrom contextlib import contextmanager\n\nfrom sentry_sdk.hub import Hub\nfrom sentry_sdk.scope import Scope\n\nfrom sentry_sdk._types import MYPY\n\nif MYPY:\n    from typing import Any\n    from typing import Dict\n    from typing import Optional\n    from typing import overload\n    from typing import Callable\n    from typing import TypeVar\n    from typing import ContextManager\n    from typing import Union\n\n    from sentry_sdk._types import Event, Hint, Breadcrumb, BreadcrumbHint, ExcInfo\n    from sentry_sdk.tracing import Span\n\n    T = TypeVar(\"T\")\n    F = TypeVar(\"F\", bound=Callable[..., Any])\nelse:\n\n    def overload(x):\n        # type: (T) -> T\n        return x\n\n\n__all__ = [\n    \"capture_event\",\n    \"capture_message\",\n    \"capture_exception\",\n    \"add_breadcrumb\",\n    \"configure_scope\",\n    \"push_scope\",\n    \"flush\",\n    \"last_event_id\",\n    \"start_span\",\n    \"set_tag\",\n    \"set_context\",\n    \"set_extra\",\n    \"set_user\",\n    \"set_level\",\n]\n\n\ndef hubmethod(f):\n    # type: (F) -> F\n    f.__doc__ = \"%s\\n\\n%s\" % (\n        \"Alias for :py:meth:`sentry_sdk.Hub.%s`\" % f.__name__,\n        inspect.getdoc(getattr(Hub, f.__name__)),\n    )\n    return f\n\n\ndef scopemethod(f):\n    # type: (F) -> F\n    f.__doc__ = \"%s\\n\\n%s\" % (\n        \"Alias for :py:meth:`sentry_sdk.Scope.%s`\" % f.__name__,\n        inspect.getdoc(getattr(Scope, f.__name__)),\n    )\n    return f\n\n\n@hubmethod\ndef capture_event(\n    event,  # type: Event\n    hint=None,  # type: Optional[Hint]\n    scope=None,  # type: Optional[Any]\n    **scope_args  # type: Dict[str, Any]\n):\n    # type: (...) -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.capture_event(event, hint, scope=scope, **scope_args)\n    return None\n\n\n@hubmethod\ndef capture_message(\n    message,  # type: str\n    level=None,  # type: Optional[str]\n    scope=None,  # type: Optional[Any]\n    **scope_args  # type: Dict[str, Any]\n):\n    # type: (...) -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.capture_message(message, level, scope=scope, **scope_args)\n    return None\n\n\n@hubmethod\ndef capture_exception(\n    error=None,  # type: Optional[Union[BaseException, ExcInfo]]\n    scope=None,  # type: Optional[Any]\n    **scope_args  # type: Dict[str, Any]\n):\n    # type: (...) -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.capture_exception(error, scope=scope, **scope_args)\n    return None\n\n\n@hubmethod\ndef add_breadcrumb(\n    crumb=None,  # type: Optional[Breadcrumb]\n    hint=None,  # type: Optional[BreadcrumbHint]\n    **kwargs  # type: Any\n):\n    # type: (...) -> None\n    hub = Hub.current\n    if hub is not None:\n        return hub.add_breadcrumb(crumb, hint, **kwargs)\n\n\n@overload  # noqa\ndef configure_scope():\n    # type: () -> ContextManager[Scope]\n    pass\n\n\n@overload  # noqa\ndef configure_scope(\n    callback,  # type: Callable[[Scope], None]\n):\n    # type: (...) -> None\n    pass\n\n\n@hubmethod  # noqa\ndef configure_scope(\n    callback=None,  # type: Optional[Callable[[Scope], None]]\n):\n    # type: (...) -> Optional[ContextManager[Scope]]\n    hub = Hub.current\n    if hub is not None:\n        return hub.configure_scope(callback)\n    elif callback is None:\n\n        @contextmanager\n        def inner():\n            yield Scope()\n\n        return inner()\n    else:\n        # returned if user provided callback\n        return None\n\n\n@overload  # noqa\ndef push_scope():\n    # type: () -> ContextManager[Scope]\n    pass\n\n\n@overload  # noqa\ndef push_scope(\n    callback,  # type: Callable[[Scope], None]\n):\n    # type: (...) -> None\n    pass\n\n\n@hubmethod  # noqa\ndef push_scope(\n    callback=None,  # type: Optional[Callable[[Scope], None]]\n):\n    # type: (...) -> Optional[ContextManager[Scope]]\n    hub = Hub.current\n    if hub is not None:\n        return hub.push_scope(callback)\n    elif callback is None:\n\n        @contextmanager\n        def inner():\n            yield Scope()\n\n        return inner()\n    else:\n        # returned if user provided callback\n        return None\n\n\n@scopemethod  # noqa\ndef set_tag(key, value):\n    # type: (str, Any) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_tag(key, value)\n\n\n@scopemethod  # noqa\ndef set_context(key, value):\n    # type: (str, Any) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_context(key, value)\n\n\n@scopemethod  # noqa\ndef set_extra(key, value):\n    # type: (str, Any) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_extra(key, value)\n\n\n@scopemethod  # noqa\ndef set_user(value):\n    # type: (Dict[str, Any]) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_user(value)\n\n\n@scopemethod  # noqa\ndef set_level(value):\n    # type: (str) -> None\n    hub = Hub.current\n    if hub is not None:\n        hub.scope.set_level(value)\n\n\n@hubmethod\ndef flush(\n    timeout=None,  # type: Optional[float]\n    callback=None,  # type: Optional[Callable[[int, float], None]]\n):\n    # type: (...) -> None\n    hub = Hub.current\n    if hub is not None:\n        return hub.flush(timeout=timeout, callback=callback)\n\n\n@hubmethod\ndef last_event_id():\n    # type: () -> Optional[str]\n    hub = Hub.current\n    if hub is not None:\n        return hub.last_event_id()\n    return None\n\n\n@hubmethod\ndef start_span(\n    span=None,  # type: Optional[Span]\n    **kwargs  # type: Any\n):\n    # type: (...) -> Span\n\n    # TODO: All other functions in this module check for\n    # `Hub.current is None`. That actually should never happen?\n    return Hub.current.start_span(span=span, **kwargs)\n", "path": "sentry_sdk/api.py"}]}