We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
imdb.load_data function returns a python list instead of ndarray object
In Keras 3.2.1 the imdb.load_data function returns a Python list instead of a ndarray object as described in the function documentation. 
In Keras 2.15 the train and test data are converted to a ndarray using the following statements before returning the tuple.
x_train, y_train = np.array(xs[:idx], dtype="object"), labels[:idx]
x_test, y_test = np.array(xs[idx:], dtype="object"), labels[idx:]

In Keras 3.2.1 the conversion is not applied, i.e., 
x_train, y_train = xs[:idx], labels[:idx]
x_test, y_test = xs[idx:], labels[idx:]


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `keras/src/datasets/imdb.py`
Content:
```
1 """IMDB sentiment classification dataset."""
2 
3 import json
4 
5 import numpy as np
6 
7 from keras.src.api_export import keras_export
8 from keras.src.utils.file_utils import get_file
9 from keras.src.utils.python_utils import remove_long_seq
10 
11 
12 @keras_export("keras.datasets.imdb.load_data")
13 def load_data(
14     path="imdb.npz",
15     num_words=None,
16     skip_top=0,
17     maxlen=None,
18     seed=113,
19     start_char=1,
20     oov_char=2,
21     index_from=3,
22     **kwargs,
23 ):
24     """Loads the [IMDB dataset](https://ai.stanford.edu/~amaas/data/sentiment/).
25 
26     This is a dataset of 25,000 movies reviews from IMDB, labeled by sentiment
27     (positive/negative). Reviews have been preprocessed, and each review is
28     encoded as a list of word indexes (integers).
29     For convenience, words are indexed by overall frequency in the dataset,
30     so that for instance the integer "3" encodes the 3rd most frequent word in
31     the data. This allows for quick filtering operations such as:
32     "only consider the top 10,000 most
33     common words, but eliminate the top 20 most common words".
34 
35     As a convention, "0" does not stand for a specific word, but instead is used
36     to encode the pad token.
37 
38     Args:
39         path: where to cache the data (relative to `~/.keras/dataset`).
40         num_words: integer or None. Words are
41             ranked by how often they occur (in the training set) and only
42             the `num_words` most frequent words are kept. Any less frequent word
43             will appear as `oov_char` value in the sequence data. If None,
44             all words are kept. Defaults to `None`.
45         skip_top: skip the top N most frequently occurring words
46             (which may not be informative). These words will appear as
47             `oov_char` value in the dataset. When 0, no words are
48             skipped. Defaults to `0`.
49         maxlen: int or None. Maximum sequence length.
50             Any longer sequence will be truncated. None, means no truncation.
51             Defaults to `None`.
52         seed: int. Seed for reproducible data shuffling.
53         start_char: int. The start of a sequence will be marked with this
54             character. 0 is usually the padding character. Defaults to `1`.
55         oov_char: int. The out-of-vocabulary character.
56             Words that were cut out because of the `num_words` or
57             `skip_top` limits will be replaced with this character.
58         index_from: int. Index actual words with this index and higher.
59 
60     Returns:
61         Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.
62 
63     **`x_train`, `x_test`**: lists of sequences, which are lists of indexes
64       (integers). If the num_words argument was specific, the maximum
65       possible index value is `num_words - 1`. If the `maxlen` argument was
66       specified, the largest possible sequence length is `maxlen`.
67 
68     **`y_train`, `y_test`**: lists of integer labels (1 or 0).
69 
70     **Note**: The 'out of vocabulary' character is only used for
71     words that were present in the training set but are not included
72     because they're not making the `num_words` cut here.
73     Words that were not seen in the training set but are in the test set
74     have simply been skipped.
75     """
76     origin_folder = (
77         "https://storage.googleapis.com/tensorflow/tf-keras-datasets/"
78     )
79     path = get_file(
80         fname=path,
81         origin=origin_folder + "imdb.npz",
82         file_hash=(  # noqa: E501
83             "69664113be75683a8fe16e3ed0ab59fda8886cb3cd7ada244f7d9544e4676b9f"
84         ),
85     )
86     with np.load(path, allow_pickle=True) as f:
87         x_train, labels_train = f["x_train"], f["y_train"]
88         x_test, labels_test = f["x_test"], f["y_test"]
89 
90     rng = np.random.RandomState(seed)
91     indices = np.arange(len(x_train))
92     rng.shuffle(indices)
93     x_train = x_train[indices]
94     labels_train = labels_train[indices]
95 
96     indices = np.arange(len(x_test))
97     rng.shuffle(indices)
98     x_test = x_test[indices]
99     labels_test = labels_test[indices]
100 
101     if start_char is not None:
102         x_train = [[start_char] + [w + index_from for w in x] for x in x_train]
103         x_test = [[start_char] + [w + index_from for w in x] for x in x_test]
104     elif index_from:
105         x_train = [[w + index_from for w in x] for x in x_train]
106         x_test = [[w + index_from for w in x] for x in x_test]
107     else:
108         x_train = [[w for w in x] for x in x_train]
109         x_test = [[w for w in x] for x in x_test]
110 
111     if maxlen:
112         x_train, labels_train = remove_long_seq(maxlen, x_train, labels_train)
113         x_test, labels_test = remove_long_seq(maxlen, x_test, labels_test)
114         if not x_train or not x_test:
115             raise ValueError(
116                 "After filtering for sequences shorter than maxlen="
117                 f"{str(maxlen)}, no sequence was kept. Increase maxlen."
118             )
119 
120     xs = x_train + x_test
121     labels = np.concatenate([labels_train, labels_test])
122 
123     if not num_words:
124         num_words = max(max(x) for x in xs)
125 
126     # by convention, use 2 as OOV word
127     # reserve 'index_from' (=3 by default) characters:
128     # 0 (padding), 1 (start), 2 (OOV)
129     if oov_char is not None:
130         xs = [
131             [w if (skip_top <= w < num_words) else oov_char for w in x]
132             for x in xs
133         ]
134     else:
135         xs = [[w for w in x if skip_top <= w < num_words] for x in xs]
136 
137     idx = len(x_train)
138     x_train, y_train = xs[:idx], labels[:idx]
139     x_test, y_test = xs[idx:], labels[idx:]
140     return (x_train, y_train), (x_test, y_test)
141 
142 
143 @keras_export("keras.datasets.imdb.get_word_index")
144 def get_word_index(path="imdb_word_index.json"):
145     """Retrieves a dict mapping words to their index in the IMDB dataset.
146 
147     Args:
148         path: where to cache the data (relative to `~/.keras/dataset`).
149 
150     Returns:
151         The word index dictionary. Keys are word strings, values are their
152         index.
153 
154     Example:
155 
156     ```python
157     # Use the default parameters to keras.datasets.imdb.load_data
158     start_char = 1
159     oov_char = 2
160     index_from = 3
161     # Retrieve the training sequences.
162     (x_train, _), _ = keras.datasets.imdb.load_data(
163         start_char=start_char, oov_char=oov_char, index_from=index_from
164     )
165     # Retrieve the word index file mapping words to indices
166     word_index = keras.datasets.imdb.get_word_index()
167     # Reverse the word index to obtain a dict mapping indices to words
168     # And add `index_from` to indices to sync with `x_train`
169     inverted_word_index = dict(
170         (i + index_from, word) for (word, i) in word_index.items()
171     )
172     # Update `inverted_word_index` to include `start_char` and `oov_char`
173     inverted_word_index[start_char] = "[START]"
174     inverted_word_index[oov_char] = "[OOV]"
175     # Decode the first sequence in the dataset
176     decoded_sequence = " ".join(inverted_word_index[i] for i in x_train[0])
177     ```
178     """
179     origin_folder = (
180         "https://storage.googleapis.com/tensorflow/tf-keras-datasets/"
181     )
182     path = get_file(
183         fname=path,
184         origin=origin_folder + "imdb_word_index.json",
185         file_hash="bfafd718b763782e994055a2d397834f",
186     )
187     with open(path) as f:
188         return json.load(f)
189
```
--- 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/keras/src/datasets/imdb.py b/keras/src/datasets/imdb.py
--- a/keras/src/datasets/imdb.py
+++ b/keras/src/datasets/imdb.py
@@ -135,8 +135,8 @@
         xs = [[w for w in x if skip_top <= w < num_words] for x in xs]
 
     idx = len(x_train)
-    x_train, y_train = xs[:idx], labels[:idx]
-    x_test, y_test = xs[idx:], labels[idx:]
+    x_train, y_train = np.array(xs[:idx], dtype="object"), labels[:idx]
+    x_test, y_test = np.array(xs[idx:], dtype="object"), labels[idx:]
     return (x_train, y_train), (x_test, y_test)

{"golden_diff": "diff --git a/keras/src/datasets/imdb.py b/keras/src/datasets/imdb.py\n--- a/keras/src/datasets/imdb.py\n+++ b/keras/src/datasets/imdb.py\n@@ -135,8 +135,8 @@\n         xs = [[w for w in x if skip_top <= w < num_words] for x in xs]\n \n     idx = len(x_train)\n-    x_train, y_train = xs[:idx], labels[:idx]\n-    x_test, y_test = xs[idx:], labels[idx:]\n+    x_train, y_train = np.array(xs[:idx], dtype=\"object\"), labels[:idx]\n+    x_test, y_test = np.array(xs[idx:], dtype=\"object\"), labels[idx:]\n     return (x_train, y_train), (x_test, y_test)\n", "issue": "imdb.load_data function returns a python list instead of ndarray object\nIn Keras 3.2.1 the imdb.load_data function returns a Python list instead of a ndarray object as described in the function documentation. \r\nIn Keras 2.15 the train and test data are converted to a ndarray using the following statements before returning the tuple.\r\nx_train, y_train = np.array(xs[:idx], dtype=\"object\"), labels[:idx]\r\nx_test, y_test = np.array(xs[idx:], dtype=\"object\"), labels[idx:]\r\n\r\nIn Keras 3.2.1 the conversion is not applied, i.e., \r\nx_train, y_train = xs[:idx], labels[:idx]\r\nx_test, y_test = xs[idx:], labels[idx:]\r\n\n", "before_files": [{"content": "\"\"\"IMDB sentiment classification dataset.\"\"\"\n\nimport json\n\nimport numpy as np\n\nfrom keras.src.api_export import keras_export\nfrom keras.src.utils.file_utils import get_file\nfrom keras.src.utils.python_utils import remove_long_seq\n\n\n@keras_export(\"keras.datasets.imdb.load_data\")\ndef load_data(\n    path=\"imdb.npz\",\n    num_words=None,\n    skip_top=0,\n    maxlen=None,\n    seed=113,\n    start_char=1,\n    oov_char=2,\n    index_from=3,\n    **kwargs,\n):\n    \"\"\"Loads the [IMDB dataset](https://ai.stanford.edu/~amaas/data/sentiment/).\n\n    This is a dataset of 25,000 movies reviews from IMDB, labeled by sentiment\n    (positive/negative). Reviews have been preprocessed, and each review is\n    encoded as a list of word indexes (integers).\n    For convenience, words are indexed by overall frequency in the dataset,\n    so that for instance the integer \"3\" encodes the 3rd most frequent word in\n    the data. This allows for quick filtering operations such as:\n    \"only consider the top 10,000 most\n    common words, but eliminate the top 20 most common words\".\n\n    As a convention, \"0\" does not stand for a specific word, but instead is used\n    to encode the pad token.\n\n    Args:\n        path: where to cache the data (relative to `~/.keras/dataset`).\n        num_words: integer or None. Words are\n            ranked by how often they occur (in the training set) and only\n            the `num_words` most frequent words are kept. Any less frequent word\n            will appear as `oov_char` value in the sequence data. If None,\n            all words are kept. Defaults to `None`.\n        skip_top: skip the top N most frequently occurring words\n            (which may not be informative). These words will appear as\n            `oov_char` value in the dataset. When 0, no words are\n            skipped. Defaults to `0`.\n        maxlen: int or None. Maximum sequence length.\n            Any longer sequence will be truncated. None, means no truncation.\n            Defaults to `None`.\n        seed: int. Seed for reproducible data shuffling.\n        start_char: int. The start of a sequence will be marked with this\n            character. 0 is usually the padding character. Defaults to `1`.\n        oov_char: int. The out-of-vocabulary character.\n            Words that were cut out because of the `num_words` or\n            `skip_top` limits will be replaced with this character.\n        index_from: int. Index actual words with this index and higher.\n\n    Returns:\n        Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.\n\n    **`x_train`, `x_test`**: lists of sequences, which are lists of indexes\n      (integers). If the num_words argument was specific, the maximum\n      possible index value is `num_words - 1`. If the `maxlen` argument was\n      specified, the largest possible sequence length is `maxlen`.\n\n    **`y_train`, `y_test`**: lists of integer labels (1 or 0).\n\n    **Note**: The 'out of vocabulary' character is only used for\n    words that were present in the training set but are not included\n    because they're not making the `num_words` cut here.\n    Words that were not seen in the training set but are in the test set\n    have simply been skipped.\n    \"\"\"\n    origin_folder = (\n        \"https://storage.googleapis.com/tensorflow/tf-keras-datasets/\"\n    )\n    path = get_file(\n        fname=path,\n        origin=origin_folder + \"imdb.npz\",\n        file_hash=(  # noqa: E501\n            \"69664113be75683a8fe16e3ed0ab59fda8886cb3cd7ada244f7d9544e4676b9f\"\n        ),\n    )\n    with np.load(path, allow_pickle=True) as f:\n        x_train, labels_train = f[\"x_train\"], f[\"y_train\"]\n        x_test, labels_test = f[\"x_test\"], f[\"y_test\"]\n\n    rng = np.random.RandomState(seed)\n    indices = np.arange(len(x_train))\n    rng.shuffle(indices)\n    x_train = x_train[indices]\n    labels_train = labels_train[indices]\n\n    indices = np.arange(len(x_test))\n    rng.shuffle(indices)\n    x_test = x_test[indices]\n    labels_test = labels_test[indices]\n\n    if start_char is not None:\n        x_train = [[start_char] + [w + index_from for w in x] for x in x_train]\n        x_test = [[start_char] + [w + index_from for w in x] for x in x_test]\n    elif index_from:\n        x_train = [[w + index_from for w in x] for x in x_train]\n        x_test = [[w + index_from for w in x] for x in x_test]\n    else:\n        x_train = [[w for w in x] for x in x_train]\n        x_test = [[w for w in x] for x in x_test]\n\n    if maxlen:\n        x_train, labels_train = remove_long_seq(maxlen, x_train, labels_train)\n        x_test, labels_test = remove_long_seq(maxlen, x_test, labels_test)\n        if not x_train or not x_test:\n            raise ValueError(\n                \"After filtering for sequences shorter than maxlen=\"\n                f\"{str(maxlen)}, no sequence was kept. Increase maxlen.\"\n            )\n\n    xs = x_train + x_test\n    labels = np.concatenate([labels_train, labels_test])\n\n    if not num_words:\n        num_words = max(max(x) for x in xs)\n\n    # by convention, use 2 as OOV word\n    # reserve 'index_from' (=3 by default) characters:\n    # 0 (padding), 1 (start), 2 (OOV)\n    if oov_char is not None:\n        xs = [\n            [w if (skip_top <= w < num_words) else oov_char for w in x]\n            for x in xs\n        ]\n    else:\n        xs = [[w for w in x if skip_top <= w < num_words] for x in xs]\n\n    idx = len(x_train)\n    x_train, y_train = xs[:idx], labels[:idx]\n    x_test, y_test = xs[idx:], labels[idx:]\n    return (x_train, y_train), (x_test, y_test)\n\n\n@keras_export(\"keras.datasets.imdb.get_word_index\")\ndef get_word_index(path=\"imdb_word_index.json\"):\n    \"\"\"Retrieves a dict mapping words to their index in the IMDB dataset.\n\n    Args:\n        path: where to cache the data (relative to `~/.keras/dataset`).\n\n    Returns:\n        The word index dictionary. Keys are word strings, values are their\n        index.\n\n    Example:\n\n    ```python\n    # Use the default parameters to keras.datasets.imdb.load_data\n    start_char = 1\n    oov_char = 2\n    index_from = 3\n    # Retrieve the training sequences.\n    (x_train, _), _ = keras.datasets.imdb.load_data(\n        start_char=start_char, oov_char=oov_char, index_from=index_from\n    )\n    # Retrieve the word index file mapping words to indices\n    word_index = keras.datasets.imdb.get_word_index()\n    # Reverse the word index to obtain a dict mapping indices to words\n    # And add `index_from` to indices to sync with `x_train`\n    inverted_word_index = dict(\n        (i + index_from, word) for (word, i) in word_index.items()\n    )\n    # Update `inverted_word_index` to include `start_char` and `oov_char`\n    inverted_word_index[start_char] = \"[START]\"\n    inverted_word_index[oov_char] = \"[OOV]\"\n    # Decode the first sequence in the dataset\n    decoded_sequence = \" \".join(inverted_word_index[i] for i in x_train[0])\n    ```\n    \"\"\"\n    origin_folder = (\n        \"https://storage.googleapis.com/tensorflow/tf-keras-datasets/\"\n    )\n    path = get_file(\n        fname=path,\n        origin=origin_folder + \"imdb_word_index.json\",\n        file_hash=\"bfafd718b763782e994055a2d397834f\",\n    )\n    with open(path) as f:\n        return json.load(f)\n", "path": "keras/src/datasets/imdb.py"}], "after_files": [{"content": "\"\"\"IMDB sentiment classification dataset.\"\"\"\n\nimport json\n\nimport numpy as np\n\nfrom keras.src.api_export import keras_export\nfrom keras.src.utils.file_utils import get_file\nfrom keras.src.utils.python_utils import remove_long_seq\n\n\n@keras_export(\"keras.datasets.imdb.load_data\")\ndef load_data(\n    path=\"imdb.npz\",\n    num_words=None,\n    skip_top=0,\n    maxlen=None,\n    seed=113,\n    start_char=1,\n    oov_char=2,\n    index_from=3,\n    **kwargs,\n):\n    \"\"\"Loads the [IMDB dataset](https://ai.stanford.edu/~amaas/data/sentiment/).\n\n    This is a dataset of 25,000 movies reviews from IMDB, labeled by sentiment\n    (positive/negative). Reviews have been preprocessed, and each review is\n    encoded as a list of word indexes (integers).\n    For convenience, words are indexed by overall frequency in the dataset,\n    so that for instance the integer \"3\" encodes the 3rd most frequent word in\n    the data. This allows for quick filtering operations such as:\n    \"only consider the top 10,000 most\n    common words, but eliminate the top 20 most common words\".\n\n    As a convention, \"0\" does not stand for a specific word, but instead is used\n    to encode the pad token.\n\n    Args:\n        path: where to cache the data (relative to `~/.keras/dataset`).\n        num_words: integer or None. Words are\n            ranked by how often they occur (in the training set) and only\n            the `num_words` most frequent words are kept. Any less frequent word\n            will appear as `oov_char` value in the sequence data. If None,\n            all words are kept. Defaults to `None`.\n        skip_top: skip the top N most frequently occurring words\n            (which may not be informative). These words will appear as\n            `oov_char` value in the dataset. When 0, no words are\n            skipped. Defaults to `0`.\n        maxlen: int or None. Maximum sequence length.\n            Any longer sequence will be truncated. None, means no truncation.\n            Defaults to `None`.\n        seed: int. Seed for reproducible data shuffling.\n        start_char: int. The start of a sequence will be marked with this\n            character. 0 is usually the padding character. Defaults to `1`.\n        oov_char: int. The out-of-vocabulary character.\n            Words that were cut out because of the `num_words` or\n            `skip_top` limits will be replaced with this character.\n        index_from: int. Index actual words with this index and higher.\n\n    Returns:\n        Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.\n\n    **`x_train`, `x_test`**: lists of sequences, which are lists of indexes\n      (integers). If the num_words argument was specific, the maximum\n      possible index value is `num_words - 1`. If the `maxlen` argument was\n      specified, the largest possible sequence length is `maxlen`.\n\n    **`y_train`, `y_test`**: lists of integer labels (1 or 0).\n\n    **Note**: The 'out of vocabulary' character is only used for\n    words that were present in the training set but are not included\n    because they're not making the `num_words` cut here.\n    Words that were not seen in the training set but are in the test set\n    have simply been skipped.\n    \"\"\"\n    origin_folder = (\n        \"https://storage.googleapis.com/tensorflow/tf-keras-datasets/\"\n    )\n    path = get_file(\n        fname=path,\n        origin=origin_folder + \"imdb.npz\",\n        file_hash=(  # noqa: E501\n            \"69664113be75683a8fe16e3ed0ab59fda8886cb3cd7ada244f7d9544e4676b9f\"\n        ),\n    )\n    with np.load(path, allow_pickle=True) as f:\n        x_train, labels_train = f[\"x_train\"], f[\"y_train\"]\n        x_test, labels_test = f[\"x_test\"], f[\"y_test\"]\n\n    rng = np.random.RandomState(seed)\n    indices = np.arange(len(x_train))\n    rng.shuffle(indices)\n    x_train = x_train[indices]\n    labels_train = labels_train[indices]\n\n    indices = np.arange(len(x_test))\n    rng.shuffle(indices)\n    x_test = x_test[indices]\n    labels_test = labels_test[indices]\n\n    if start_char is not None:\n        x_train = [[start_char] + [w + index_from for w in x] for x in x_train]\n        x_test = [[start_char] + [w + index_from for w in x] for x in x_test]\n    elif index_from:\n        x_train = [[w + index_from for w in x] for x in x_train]\n        x_test = [[w + index_from for w in x] for x in x_test]\n    else:\n        x_train = [[w for w in x] for x in x_train]\n        x_test = [[w for w in x] for x in x_test]\n\n    if maxlen:\n        x_train, labels_train = remove_long_seq(maxlen, x_train, labels_train)\n        x_test, labels_test = remove_long_seq(maxlen, x_test, labels_test)\n        if not x_train or not x_test:\n            raise ValueError(\n                \"After filtering for sequences shorter than maxlen=\"\n                f\"{str(maxlen)}, no sequence was kept. Increase maxlen.\"\n            )\n\n    xs = x_train + x_test\n    labels = np.concatenate([labels_train, labels_test])\n\n    if not num_words:\n        num_words = max(max(x) for x in xs)\n\n    # by convention, use 2 as OOV word\n    # reserve 'index_from' (=3 by default) characters:\n    # 0 (padding), 1 (start), 2 (OOV)\n    if oov_char is not None:\n        xs = [\n            [w if (skip_top <= w < num_words) else oov_char for w in x]\n            for x in xs\n        ]\n    else:\n        xs = [[w for w in x if skip_top <= w < num_words] for x in xs]\n\n    idx = len(x_train)\n    x_train, y_train = np.array(xs[:idx], dtype=\"object\"), labels[:idx]\n    x_test, y_test = np.array(xs[idx:], dtype=\"object\"), labels[idx:]\n    return (x_train, y_train), (x_test, y_test)\n\n\n@keras_export(\"keras.datasets.imdb.get_word_index\")\ndef get_word_index(path=\"imdb_word_index.json\"):\n    \"\"\"Retrieves a dict mapping words to their index in the IMDB dataset.\n\n    Args:\n        path: where to cache the data (relative to `~/.keras/dataset`).\n\n    Returns:\n        The word index dictionary. Keys are word strings, values are their\n        index.\n\n    Example:\n\n    ```python\n    # Use the default parameters to keras.datasets.imdb.load_data\n    start_char = 1\n    oov_char = 2\n    index_from = 3\n    # Retrieve the training sequences.\n    (x_train, _), _ = keras.datasets.imdb.load_data(\n        start_char=start_char, oov_char=oov_char, index_from=index_from\n    )\n    # Retrieve the word index file mapping words to indices\n    word_index = keras.datasets.imdb.get_word_index()\n    # Reverse the word index to obtain a dict mapping indices to words\n    # And add `index_from` to indices to sync with `x_train`\n    inverted_word_index = dict(\n        (i + index_from, word) for (word, i) in word_index.items()\n    )\n    # Update `inverted_word_index` to include `start_char` and `oov_char`\n    inverted_word_index[start_char] = \"[START]\"\n    inverted_word_index[oov_char] = \"[OOV]\"\n    # Decode the first sequence in the dataset\n    decoded_sequence = \" \".join(inverted_word_index[i] for i in x_train[0])\n    ```\n    \"\"\"\n    origin_folder = (\n        \"https://storage.googleapis.com/tensorflow/tf-keras-datasets/\"\n    )\n    path = get_file(\n        fname=path,\n        origin=origin_folder + \"imdb_word_index.json\",\n        file_hash=\"bfafd718b763782e994055a2d397834f\",\n    )\n    with open(path) as f:\n        return json.load(f)\n", "path": "keras/src/datasets/imdb.py"}]}