We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] Incorrect type for print_json indent in __init__.py
**Describe the bug**

The type for `indent` (`indent: int = 2`) in `print_json` from the `__init__.py` file seems to be incorrect. In `console.py` it is typed as `indent: Union[None, int, str] = 2` and `print_json` in the init calls from console.py so it seems like they should have the same type.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `rich/__init__.py`
Content:
```
1 """Rich text and beautiful formatting in the terminal."""
2 
3 import os
4 from typing import Callable, IO, TYPE_CHECKING, Any, Optional
5 
6 from ._extension import load_ipython_extension
7 
8 __all__ = ["get_console", "reconfigure", "print", "inspect"]
9 
10 if TYPE_CHECKING:
11     from .console import Console
12 
13 # Global console used by alternative print
14 _console: Optional["Console"] = None
15 
16 _IMPORT_CWD = os.path.abspath(os.getcwd())
17 
18 
19 def get_console() -> "Console":
20     """Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console,
21     and hasn't been explicitly given one.
22 
23     Returns:
24         Console: A console instance.
25     """
26     global _console
27     if _console is None:
28         from .console import Console
29 
30         _console = Console()
31 
32     return _console
33 
34 
35 def reconfigure(*args: Any, **kwargs: Any) -> None:
36     """Reconfigures the global console by replacing it with another.
37 
38     Args:
39         console (Console): Replacement console instance.
40     """
41     from rich.console import Console
42 
43     new_console = Console(*args, **kwargs)
44     _console = get_console()
45     _console.__dict__ = new_console.__dict__
46 
47 
48 def print(
49     *objects: Any,
50     sep: str = " ",
51     end: str = "\n",
52     file: Optional[IO[str]] = None,
53     flush: bool = False,
54 ) -> None:
55     r"""Print object(s) supplied via positional arguments.
56     This function has an identical signature to the built-in print.
57     For more advanced features, see the :class:`~rich.console.Console` class.
58 
59     Args:
60         sep (str, optional): Separator between printed objects. Defaults to " ".
61         end (str, optional): Character to write at end of output. Defaults to "\\n".
62         file (IO[str], optional): File to write to, or None for stdout. Defaults to None.
63         flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False.
64 
65     """
66     from .console import Console
67 
68     write_console = get_console() if file is None else Console(file=file)
69     return write_console.print(*objects, sep=sep, end=end)
70 
71 
72 def print_json(
73     json: Optional[str] = None,
74     *,
75     data: Any = None,
76     indent: int = 2,
77     highlight: bool = True,
78     skip_keys: bool = False,
79     ensure_ascii: bool = True,
80     check_circular: bool = True,
81     allow_nan: bool = True,
82     default: Optional[Callable[[Any], Any]] = None,
83     sort_keys: bool = False,
84 ) -> None:
85     """Pretty prints JSON. Output will be valid JSON.
86 
87     Args:
88         json (str): A string containing JSON.
89         data (Any): If json is not supplied, then encode this data.
90         indent (int, optional): Number of spaces to indent. Defaults to 2.
91         highlight (bool, optional): Enable highlighting of output: Defaults to True.
92         skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
93         ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
94         check_circular (bool, optional): Check for circular references. Defaults to True.
95         allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
96         default (Callable, optional): A callable that converts values that can not be encoded
97             in to something that can be JSON encoded. Defaults to None.
98         sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
99     """
100 
101     get_console().print_json(
102         json,
103         data=data,
104         indent=indent,
105         highlight=highlight,
106         skip_keys=skip_keys,
107         ensure_ascii=ensure_ascii,
108         check_circular=check_circular,
109         allow_nan=allow_nan,
110         default=default,
111         sort_keys=sort_keys,
112     )
113 
114 
115 def inspect(
116     obj: Any,
117     *,
118     console: Optional["Console"] = None,
119     title: Optional[str] = None,
120     help: bool = False,
121     methods: bool = False,
122     docs: bool = True,
123     private: bool = False,
124     dunder: bool = False,
125     sort: bool = True,
126     all: bool = False,
127     value: bool = True,
128 ) -> None:
129     """Inspect any Python object.
130 
131     * inspect(<OBJECT>) to see summarized info.
132     * inspect(<OBJECT>, methods=True) to see methods.
133     * inspect(<OBJECT>, help=True) to see full (non-abbreviated) help.
134     * inspect(<OBJECT>, private=True) to see private attributes (single underscore).
135     * inspect(<OBJECT>, dunder=True) to see attributes beginning with double underscore.
136     * inspect(<OBJECT>, all=True) to see all attributes.
137 
138     Args:
139         obj (Any): An object to inspect.
140         title (str, optional): Title to display over inspect result, or None use type. Defaults to None.
141         help (bool, optional): Show full help text rather than just first paragraph. Defaults to False.
142         methods (bool, optional): Enable inspection of callables. Defaults to False.
143         docs (bool, optional): Also render doc strings. Defaults to True.
144         private (bool, optional): Show private attributes (beginning with underscore). Defaults to False.
145         dunder (bool, optional): Show attributes starting with double underscore. Defaults to False.
146         sort (bool, optional): Sort attributes alphabetically. Defaults to True.
147         all (bool, optional): Show all attributes. Defaults to False.
148         value (bool, optional): Pretty print value. Defaults to True.
149     """
150     _console = console or get_console()
151     from rich._inspect import Inspect
152 
153     # Special case for inspect(inspect)
154     is_inspect = obj is inspect
155 
156     _inspect = Inspect(
157         obj,
158         title=title,
159         help=is_inspect or help,
160         methods=is_inspect or methods,
161         docs=is_inspect or docs,
162         private=private,
163         dunder=dunder,
164         sort=sort,
165         all=all,
166         value=value,
167     )
168     _console.print(_inspect)
169 
170 
171 if __name__ == "__main__":  # pragma: no cover
172     print("Hello, **World**")
173
```
--- 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/rich/__init__.py b/rich/__init__.py
--- a/rich/__init__.py
+++ b/rich/__init__.py
@@ -1,7 +1,7 @@
 """Rich text and beautiful formatting in the terminal."""
 
 import os
-from typing import Callable, IO, TYPE_CHECKING, Any, Optional
+from typing import Callable, IO, TYPE_CHECKING, Any, Optional, Union
 
 from ._extension import load_ipython_extension
 
@@ -73,7 +73,7 @@
     json: Optional[str] = None,
     *,
     data: Any = None,
-    indent: int = 2,
+    indent: Union[None, int, str] = 2,
     highlight: bool = True,
     skip_keys: bool = False,
     ensure_ascii: bool = True,

{"golden_diff": "diff --git a/rich/__init__.py b/rich/__init__.py\n--- a/rich/__init__.py\n+++ b/rich/__init__.py\n@@ -1,7 +1,7 @@\n \"\"\"Rich text and beautiful formatting in the terminal.\"\"\"\n \n import os\n-from typing import Callable, IO, TYPE_CHECKING, Any, Optional\n+from typing import Callable, IO, TYPE_CHECKING, Any, Optional, Union\n \n from ._extension import load_ipython_extension\n \n@@ -73,7 +73,7 @@\n     json: Optional[str] = None,\n     *,\n     data: Any = None,\n-    indent: int = 2,\n+    indent: Union[None, int, str] = 2,\n     highlight: bool = True,\n     skip_keys: bool = False,\n     ensure_ascii: bool = True,\n", "issue": "[BUG] Incorrect type for print_json indent in __init__.py\n**Describe the bug**\r\n\r\nThe type for `indent` (`indent: int = 2`) in `print_json` from the `__init__.py` file seems to be incorrect. In `console.py` it is typed as `indent: Union[None, int, str] = 2` and `print_json` in the init calls from console.py so it seems like they should have the same type.\n", "before_files": [{"content": "\"\"\"Rich text and beautiful formatting in the terminal.\"\"\"\n\nimport os\nfrom typing import Callable, IO, TYPE_CHECKING, Any, Optional\n\nfrom ._extension import load_ipython_extension\n\n__all__ = [\"get_console\", \"reconfigure\", \"print\", \"inspect\"]\n\nif TYPE_CHECKING:\n    from .console import Console\n\n# Global console used by alternative print\n_console: Optional[\"Console\"] = None\n\n_IMPORT_CWD = os.path.abspath(os.getcwd())\n\n\ndef get_console() -> \"Console\":\n    \"\"\"Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console,\n    and hasn't been explicitly given one.\n\n    Returns:\n        Console: A console instance.\n    \"\"\"\n    global _console\n    if _console is None:\n        from .console import Console\n\n        _console = Console()\n\n    return _console\n\n\ndef reconfigure(*args: Any, **kwargs: Any) -> None:\n    \"\"\"Reconfigures the global console by replacing it with another.\n\n    Args:\n        console (Console): Replacement console instance.\n    \"\"\"\n    from rich.console import Console\n\n    new_console = Console(*args, **kwargs)\n    _console = get_console()\n    _console.__dict__ = new_console.__dict__\n\n\ndef print(\n    *objects: Any,\n    sep: str = \" \",\n    end: str = \"\\n\",\n    file: Optional[IO[str]] = None,\n    flush: bool = False,\n) -> None:\n    r\"\"\"Print object(s) supplied via positional arguments.\n    This function has an identical signature to the built-in print.\n    For more advanced features, see the :class:`~rich.console.Console` class.\n\n    Args:\n        sep (str, optional): Separator between printed objects. Defaults to \" \".\n        end (str, optional): Character to write at end of output. Defaults to \"\\\\n\".\n        file (IO[str], optional): File to write to, or None for stdout. Defaults to None.\n        flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False.\n\n    \"\"\"\n    from .console import Console\n\n    write_console = get_console() if file is None else Console(file=file)\n    return write_console.print(*objects, sep=sep, end=end)\n\n\ndef print_json(\n    json: Optional[str] = None,\n    *,\n    data: Any = None,\n    indent: int = 2,\n    highlight: bool = True,\n    skip_keys: bool = False,\n    ensure_ascii: bool = True,\n    check_circular: bool = True,\n    allow_nan: bool = True,\n    default: Optional[Callable[[Any], Any]] = None,\n    sort_keys: bool = False,\n) -> None:\n    \"\"\"Pretty prints JSON. Output will be valid JSON.\n\n    Args:\n        json (str): A string containing JSON.\n        data (Any): If json is not supplied, then encode this data.\n        indent (int, optional): Number of spaces to indent. Defaults to 2.\n        highlight (bool, optional): Enable highlighting of output: Defaults to True.\n        skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.\n        ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.\n        check_circular (bool, optional): Check for circular references. Defaults to True.\n        allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.\n        default (Callable, optional): A callable that converts values that can not be encoded\n            in to something that can be JSON encoded. Defaults to None.\n        sort_keys (bool, optional): Sort dictionary keys. Defaults to False.\n    \"\"\"\n\n    get_console().print_json(\n        json,\n        data=data,\n        indent=indent,\n        highlight=highlight,\n        skip_keys=skip_keys,\n        ensure_ascii=ensure_ascii,\n        check_circular=check_circular,\n        allow_nan=allow_nan,\n        default=default,\n        sort_keys=sort_keys,\n    )\n\n\ndef inspect(\n    obj: Any,\n    *,\n    console: Optional[\"Console\"] = None,\n    title: Optional[str] = None,\n    help: bool = False,\n    methods: bool = False,\n    docs: bool = True,\n    private: bool = False,\n    dunder: bool = False,\n    sort: bool = True,\n    all: bool = False,\n    value: bool = True,\n) -> None:\n    \"\"\"Inspect any Python object.\n\n    * inspect(<OBJECT>) to see summarized info.\n    * inspect(<OBJECT>, methods=True) to see methods.\n    * inspect(<OBJECT>, help=True) to see full (non-abbreviated) help.\n    * inspect(<OBJECT>, private=True) to see private attributes (single underscore).\n    * inspect(<OBJECT>, dunder=True) to see attributes beginning with double underscore.\n    * inspect(<OBJECT>, all=True) to see all attributes.\n\n    Args:\n        obj (Any): An object to inspect.\n        title (str, optional): Title to display over inspect result, or None use type. Defaults to None.\n        help (bool, optional): Show full help text rather than just first paragraph. Defaults to False.\n        methods (bool, optional): Enable inspection of callables. Defaults to False.\n        docs (bool, optional): Also render doc strings. Defaults to True.\n        private (bool, optional): Show private attributes (beginning with underscore). Defaults to False.\n        dunder (bool, optional): Show attributes starting with double underscore. Defaults to False.\n        sort (bool, optional): Sort attributes alphabetically. Defaults to True.\n        all (bool, optional): Show all attributes. Defaults to False.\n        value (bool, optional): Pretty print value. Defaults to True.\n    \"\"\"\n    _console = console or get_console()\n    from rich._inspect import Inspect\n\n    # Special case for inspect(inspect)\n    is_inspect = obj is inspect\n\n    _inspect = Inspect(\n        obj,\n        title=title,\n        help=is_inspect or help,\n        methods=is_inspect or methods,\n        docs=is_inspect or docs,\n        private=private,\n        dunder=dunder,\n        sort=sort,\n        all=all,\n        value=value,\n    )\n    _console.print(_inspect)\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    print(\"Hello, **World**\")\n", "path": "rich/__init__.py"}], "after_files": [{"content": "\"\"\"Rich text and beautiful formatting in the terminal.\"\"\"\n\nimport os\nfrom typing import Callable, IO, TYPE_CHECKING, Any, Optional, Union\n\nfrom ._extension import load_ipython_extension\n\n__all__ = [\"get_console\", \"reconfigure\", \"print\", \"inspect\"]\n\nif TYPE_CHECKING:\n    from .console import Console\n\n# Global console used by alternative print\n_console: Optional[\"Console\"] = None\n\n_IMPORT_CWD = os.path.abspath(os.getcwd())\n\n\ndef get_console() -> \"Console\":\n    \"\"\"Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console,\n    and hasn't been explicitly given one.\n\n    Returns:\n        Console: A console instance.\n    \"\"\"\n    global _console\n    if _console is None:\n        from .console import Console\n\n        _console = Console()\n\n    return _console\n\n\ndef reconfigure(*args: Any, **kwargs: Any) -> None:\n    \"\"\"Reconfigures the global console by replacing it with another.\n\n    Args:\n        console (Console): Replacement console instance.\n    \"\"\"\n    from rich.console import Console\n\n    new_console = Console(*args, **kwargs)\n    _console = get_console()\n    _console.__dict__ = new_console.__dict__\n\n\ndef print(\n    *objects: Any,\n    sep: str = \" \",\n    end: str = \"\\n\",\n    file: Optional[IO[str]] = None,\n    flush: bool = False,\n) -> None:\n    r\"\"\"Print object(s) supplied via positional arguments.\n    This function has an identical signature to the built-in print.\n    For more advanced features, see the :class:`~rich.console.Console` class.\n\n    Args:\n        sep (str, optional): Separator between printed objects. Defaults to \" \".\n        end (str, optional): Character to write at end of output. Defaults to \"\\\\n\".\n        file (IO[str], optional): File to write to, or None for stdout. Defaults to None.\n        flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False.\n\n    \"\"\"\n    from .console import Console\n\n    write_console = get_console() if file is None else Console(file=file)\n    return write_console.print(*objects, sep=sep, end=end)\n\n\ndef print_json(\n    json: Optional[str] = None,\n    *,\n    data: Any = None,\n    indent: Union[None, int, str] = 2,\n    highlight: bool = True,\n    skip_keys: bool = False,\n    ensure_ascii: bool = True,\n    check_circular: bool = True,\n    allow_nan: bool = True,\n    default: Optional[Callable[[Any], Any]] = None,\n    sort_keys: bool = False,\n) -> None:\n    \"\"\"Pretty prints JSON. Output will be valid JSON.\n\n    Args:\n        json (str): A string containing JSON.\n        data (Any): If json is not supplied, then encode this data.\n        indent (int, optional): Number of spaces to indent. Defaults to 2.\n        highlight (bool, optional): Enable highlighting of output: Defaults to True.\n        skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.\n        ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.\n        check_circular (bool, optional): Check for circular references. Defaults to True.\n        allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.\n        default (Callable, optional): A callable that converts values that can not be encoded\n            in to something that can be JSON encoded. Defaults to None.\n        sort_keys (bool, optional): Sort dictionary keys. Defaults to False.\n    \"\"\"\n\n    get_console().print_json(\n        json,\n        data=data,\n        indent=indent,\n        highlight=highlight,\n        skip_keys=skip_keys,\n        ensure_ascii=ensure_ascii,\n        check_circular=check_circular,\n        allow_nan=allow_nan,\n        default=default,\n        sort_keys=sort_keys,\n    )\n\n\ndef inspect(\n    obj: Any,\n    *,\n    console: Optional[\"Console\"] = None,\n    title: Optional[str] = None,\n    help: bool = False,\n    methods: bool = False,\n    docs: bool = True,\n    private: bool = False,\n    dunder: bool = False,\n    sort: bool = True,\n    all: bool = False,\n    value: bool = True,\n) -> None:\n    \"\"\"Inspect any Python object.\n\n    * inspect(<OBJECT>) to see summarized info.\n    * inspect(<OBJECT>, methods=True) to see methods.\n    * inspect(<OBJECT>, help=True) to see full (non-abbreviated) help.\n    * inspect(<OBJECT>, private=True) to see private attributes (single underscore).\n    * inspect(<OBJECT>, dunder=True) to see attributes beginning with double underscore.\n    * inspect(<OBJECT>, all=True) to see all attributes.\n\n    Args:\n        obj (Any): An object to inspect.\n        title (str, optional): Title to display over inspect result, or None use type. Defaults to None.\n        help (bool, optional): Show full help text rather than just first paragraph. Defaults to False.\n        methods (bool, optional): Enable inspection of callables. Defaults to False.\n        docs (bool, optional): Also render doc strings. Defaults to True.\n        private (bool, optional): Show private attributes (beginning with underscore). Defaults to False.\n        dunder (bool, optional): Show attributes starting with double underscore. Defaults to False.\n        sort (bool, optional): Sort attributes alphabetically. Defaults to True.\n        all (bool, optional): Show all attributes. Defaults to False.\n        value (bool, optional): Pretty print value. Defaults to True.\n    \"\"\"\n    _console = console or get_console()\n    from rich._inspect import Inspect\n\n    # Special case for inspect(inspect)\n    is_inspect = obj is inspect\n\n    _inspect = Inspect(\n        obj,\n        title=title,\n        help=is_inspect or help,\n        methods=is_inspect or methods,\n        docs=is_inspect or docs,\n        private=private,\n        dunder=dunder,\n        sort=sort,\n        all=all,\n        value=value,\n    )\n    _console.print(_inspect)\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    print(\"Hello, **World**\")\n", "path": "rich/__init__.py"}]}