We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
argmin

argmin


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ivy/functional/frontends/jax/numpy/searching_sorting.py`
Content:
```
1 # global
2 import logging
3 
4 # local
5 import ivy
6 from ivy.functional.frontends.jax.func_wrapper import (
7     to_ivy_arrays_and_back,
8 )
9 from ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar
10 from ivy.func_wrapper import (
11     with_unsupported_dtypes,
12 )
13 
14 
15 @to_ivy_arrays_and_back
16 @with_unsupported_dtypes(
17     {
18         "0.4.20 and below": (
19             "float16",
20             "bfloat16",
21         )
22     },
23     "jax",
24 )
25 def argmax(a, axis=None, out=None, keepdims=False):
26     return ivy.argmax(a, axis=axis, keepdims=keepdims, out=out, dtype=ivy.int64)
27 
28 
29 @to_ivy_arrays_and_back
30 def argsort(a, axis=-1, kind="stable", order=None):
31     if kind != "stable":
32         logging.warning(
33             "'kind' argument to argsort is ignored; only 'stable' sorts are supported."
34         )
35     if order is not None:
36         raise ivy.utils.exceptions.IvyError(
37             "'order' argument to argsort is not supported."
38         )
39 
40     return ivy.argsort(a, axis=axis)
41 
42 
43 @to_ivy_arrays_and_back
44 def argwhere(a, /, *, size=None, fill_value=None):
45     if size is None and fill_value is None:
46         return ivy.argwhere(a)
47 
48     result = ivy.matrix_transpose(
49         ivy.vstack(ivy.nonzero(a, size=size, fill_value=fill_value))
50     )
51     num_of_dimensions = a.ndim
52 
53     if num_of_dimensions == 0:
54         return result[:0].reshape(result.shape[0], 0)
55 
56     return result.reshape(result.shape[0], num_of_dimensions)
57 
58 
59 @with_unsupported_dtypes(
60     {
61         "0.4.20 and below": (
62             "uint8",
63             "int8",
64             "bool",
65         )
66     },
67     "jax",
68 )
69 @to_ivy_arrays_and_back
70 def count_nonzero(a, axis=None, keepdims=False):
71     return ivy.astype(ivy.count_nonzero(a, axis=axis, keepdims=keepdims), "int64")
72 
73 
74 @to_ivy_arrays_and_back
75 def extract(condition, arr):
76     if condition.dtype is not bool:
77         condition = condition != 0
78     return arr[condition]
79 
80 
81 @to_ivy_arrays_and_back
82 def flatnonzero(a):
83     return ivy.nonzero(ivy.reshape(a, (-1,)))
84 
85 
86 @to_ivy_arrays_and_back
87 def lexsort(keys, /, *, axis=-1):
88     return ivy.lexsort(keys, axis=axis)
89 
90 
91 @to_ivy_arrays_and_back
92 def msort(a):
93     return ivy.msort(a)
94 
95 
96 @to_ivy_arrays_and_back
97 @from_zero_dim_arrays_to_scalar
98 def nanargmax(a, /, *, axis=None, out=None, keepdims=False):
99     if out is not None:
100         raise NotImplementedError(
101             "The 'out' argument to jnp.nanargmax is not supported."
102         )
103     nan_mask = ivy.isnan(a)
104     if not ivy.any(nan_mask):
105         return ivy.argmax(a, axis=axis, keepdims=keepdims)
106 
107     a = ivy.where(nan_mask, -ivy.inf, a)
108     res = ivy.argmax(a, axis=axis, keepdims=keepdims)
109     return ivy.where(ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res)
110 
111 
112 @to_ivy_arrays_and_back
113 @from_zero_dim_arrays_to_scalar
114 def nanargmin(a, /, *, axis=None, out=None, keepdims=None):
115     if out is not None:
116         raise NotImplementedError(
117             "The 'out' argument to jnp.nanargmax is not supported."
118         )
119     nan_mask = ivy.isnan(a)
120     if not ivy.any(nan_mask):
121         return ivy.argmin(a, axis=axis, keepdims=keepdims)
122 
123     a = ivy.where(nan_mask, ivy.inf, a)
124     res = ivy.argmin(a, axis=axis, keepdims=keepdims)
125     return ivy.where(ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res)
126 
127 
128 @to_ivy_arrays_and_back
129 def nonzero(a, *, size=None, fill_value=None):
130     return ivy.nonzero(a, size=size, fill_value=fill_value)
131 
132 
133 @to_ivy_arrays_and_back
134 def searchsorted(a, v, side="left", sorter=None, *, method="scan"):
135     return ivy.searchsorted(a, v, side=side, sorter=sorter, ret_dtype="int32")
136 
137 
138 @to_ivy_arrays_and_back
139 def sort(a, axis=-1, kind="quicksort", order=None):
140     # todo: handle case where order is not None
141     return ivy.sort(a, axis=axis)
142 
143 
144 @to_ivy_arrays_and_back
145 def sort_complex(a):
146     return ivy.sort(a)
147 
148 
149 @to_ivy_arrays_and_back
150 def unique(
151     ar,
152     return_index=False,
153     return_inverse=False,
154     return_counts=False,
155     axis=None,
156     *,
157     size=None,
158     fill_value=None,
159 ):
160     uniques = list(ivy.unique_all(ar, axis=axis))
161     if size is not None:
162         fill_value = fill_value if fill_value is not None else 1  # default fill_value 1
163         pad_len = size - len(uniques[0])
164         if pad_len > 0:
165             # padding
166             num_dims = len(uniques[0].shape) - 1
167             padding = [(0, 0)] * num_dims + [(0, pad_len)]
168             uniques[0] = ivy.pad(uniques[0], padding, constant_values=fill_value)
169             # padding the indices and counts with zeros
170             for i in range(1, len(uniques)):
171                 if i == 2:
172                     continue
173                 uniques[i] = ivy.pad(uniques[i], padding[-1], constant_values=0)
174         else:
175             for i in range(len(uniques)):
176                 uniques[i] = uniques[i][..., :size]
177     # constructing a list of bools for indexing
178     bools = [return_index, return_inverse, return_counts]
179     # indexing each element whose condition is True except for the values
180     uniques = [uniques[0]] + [uni for idx, uni in enumerate(uniques[1:]) if bools[idx]]
181     return uniques[0] if len(uniques) == 1 else uniques
182 
183 
184 @to_ivy_arrays_and_back
185 def where(condition, x=None, y=None, *, size=None, fill_value=0):
186     if x is None and y is None:
187         return nonzero(condition, size=size, fill_value=fill_value)
188     if x is not None and y is not None:
189         return ivy.where(condition, x, y)
190     else:
191         raise ValueError("Both x and y should be given.")
192
```
--- 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/ivy/functional/frontends/jax/numpy/searching_sorting.py b/ivy/functional/frontends/jax/numpy/searching_sorting.py
--- a/ivy/functional/frontends/jax/numpy/searching_sorting.py
+++ b/ivy/functional/frontends/jax/numpy/searching_sorting.py
@@ -8,6 +8,7 @@
 )
 from ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar
 from ivy.func_wrapper import (
+    with_supported_device_and_dtypes,
     with_unsupported_dtypes,
 )
 
@@ -26,6 +27,58 @@
     return ivy.argmax(a, axis=axis, keepdims=keepdims, out=out, dtype=ivy.int64)
 
 
+# argmin
+@to_ivy_arrays_and_back
+@with_supported_device_and_dtypes(
+    {
+        "0.4.20 and below": {
+            "cpu": (
+                "int16",
+                "int32",
+                "int64",
+                "float32",
+                "float64",
+                "uint8",
+                "uint16",
+                "uint32",
+                "uint64",
+            )
+        }
+    },
+    "jax",
+)
+def argmin(a, axis=None, out=None, keepdims=None):
+    if a is not None:
+        if isinstance(a, list):
+            if all(isinstance(elem, ivy.Array) for elem in a):
+                if len(a) == 1:
+                    a = a[0]
+                else:
+                    return [
+                        ivy.argmin(
+                            ivy.to_native_arrays(elem),
+                            axis=axis,
+                            out=out,
+                            keepdims=keepdims,
+                        )
+                        for elem in a
+                    ]
+            else:
+                raise ValueError(
+                    "Input 'a' must be an Ivy array or a list of Ivy arrays."
+                )
+
+        if not isinstance(a, ivy.Array):
+            raise TypeError("Input 'a' must be an array.")
+
+        if a.size == 0:
+            raise ValueError("Input 'a' must not be empty.")
+
+        return ivy.argmin(a, axis=axis, out=out, keepdims=keepdims)
+    else:
+        raise ValueError("argmin takes at least 1 argument.")
+
+
 @to_ivy_arrays_and_back
 def argsort(a, axis=-1, kind="stable", order=None):
     if kind != "stable":

{"golden_diff": "diff --git a/ivy/functional/frontends/jax/numpy/searching_sorting.py b/ivy/functional/frontends/jax/numpy/searching_sorting.py\n--- a/ivy/functional/frontends/jax/numpy/searching_sorting.py\n+++ b/ivy/functional/frontends/jax/numpy/searching_sorting.py\n@@ -8,6 +8,7 @@\n )\n from ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar\n from ivy.func_wrapper import (\n+    with_supported_device_and_dtypes,\n     with_unsupported_dtypes,\n )\n \n@@ -26,6 +27,58 @@\n     return ivy.argmax(a, axis=axis, keepdims=keepdims, out=out, dtype=ivy.int64)\n \n \n+# argmin\n+@to_ivy_arrays_and_back\n+@with_supported_device_and_dtypes(\n+    {\n+        \"0.4.20 and below\": {\n+            \"cpu\": (\n+                \"int16\",\n+                \"int32\",\n+                \"int64\",\n+                \"float32\",\n+                \"float64\",\n+                \"uint8\",\n+                \"uint16\",\n+                \"uint32\",\n+                \"uint64\",\n+            )\n+        }\n+    },\n+    \"jax\",\n+)\n+def argmin(a, axis=None, out=None, keepdims=None):\n+    if a is not None:\n+        if isinstance(a, list):\n+            if all(isinstance(elem, ivy.Array) for elem in a):\n+                if len(a) == 1:\n+                    a = a[0]\n+                else:\n+                    return [\n+                        ivy.argmin(\n+                            ivy.to_native_arrays(elem),\n+                            axis=axis,\n+                            out=out,\n+                            keepdims=keepdims,\n+                        )\n+                        for elem in a\n+                    ]\n+            else:\n+                raise ValueError(\n+                    \"Input 'a' must be an Ivy array or a list of Ivy arrays.\"\n+                )\n+\n+        if not isinstance(a, ivy.Array):\n+            raise TypeError(\"Input 'a' must be an array.\")\n+\n+        if a.size == 0:\n+            raise ValueError(\"Input 'a' must not be empty.\")\n+\n+        return ivy.argmin(a, axis=axis, out=out, keepdims=keepdims)\n+    else:\n+        raise ValueError(\"argmin takes at least 1 argument.\")\n+\n+\n @to_ivy_arrays_and_back\n def argsort(a, axis=-1, kind=\"stable\", order=None):\n     if kind != \"stable\":\n", "issue": "argmin\n\nargmin\n\n", "before_files": [{"content": "# global\nimport logging\n\n# local\nimport ivy\nfrom ivy.functional.frontends.jax.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\nfrom ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar\nfrom ivy.func_wrapper import (\n    with_unsupported_dtypes,\n)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes(\n    {\n        \"0.4.20 and below\": (\n            \"float16\",\n            \"bfloat16\",\n        )\n    },\n    \"jax\",\n)\ndef argmax(a, axis=None, out=None, keepdims=False):\n    return ivy.argmax(a, axis=axis, keepdims=keepdims, out=out, dtype=ivy.int64)\n\n\n@to_ivy_arrays_and_back\ndef argsort(a, axis=-1, kind=\"stable\", order=None):\n    if kind != \"stable\":\n        logging.warning(\n            \"'kind' argument to argsort is ignored; only 'stable' sorts are supported.\"\n        )\n    if order is not None:\n        raise ivy.utils.exceptions.IvyError(\n            \"'order' argument to argsort is not supported.\"\n        )\n\n    return ivy.argsort(a, axis=axis)\n\n\n@to_ivy_arrays_and_back\ndef argwhere(a, /, *, size=None, fill_value=None):\n    if size is None and fill_value is None:\n        return ivy.argwhere(a)\n\n    result = ivy.matrix_transpose(\n        ivy.vstack(ivy.nonzero(a, size=size, fill_value=fill_value))\n    )\n    num_of_dimensions = a.ndim\n\n    if num_of_dimensions == 0:\n        return result[:0].reshape(result.shape[0], 0)\n\n    return result.reshape(result.shape[0], num_of_dimensions)\n\n\n@with_unsupported_dtypes(\n    {\n        \"0.4.20 and below\": (\n            \"uint8\",\n            \"int8\",\n            \"bool\",\n        )\n    },\n    \"jax\",\n)\n@to_ivy_arrays_and_back\ndef count_nonzero(a, axis=None, keepdims=False):\n    return ivy.astype(ivy.count_nonzero(a, axis=axis, keepdims=keepdims), \"int64\")\n\n\n@to_ivy_arrays_and_back\ndef extract(condition, arr):\n    if condition.dtype is not bool:\n        condition = condition != 0\n    return arr[condition]\n\n\n@to_ivy_arrays_and_back\ndef flatnonzero(a):\n    return ivy.nonzero(ivy.reshape(a, (-1,)))\n\n\n@to_ivy_arrays_and_back\ndef lexsort(keys, /, *, axis=-1):\n    return ivy.lexsort(keys, axis=axis)\n\n\n@to_ivy_arrays_and_back\ndef msort(a):\n    return ivy.msort(a)\n\n\n@to_ivy_arrays_and_back\n@from_zero_dim_arrays_to_scalar\ndef nanargmax(a, /, *, axis=None, out=None, keepdims=False):\n    if out is not None:\n        raise NotImplementedError(\n            \"The 'out' argument to jnp.nanargmax is not supported.\"\n        )\n    nan_mask = ivy.isnan(a)\n    if not ivy.any(nan_mask):\n        return ivy.argmax(a, axis=axis, keepdims=keepdims)\n\n    a = ivy.where(nan_mask, -ivy.inf, a)\n    res = ivy.argmax(a, axis=axis, keepdims=keepdims)\n    return ivy.where(ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res)\n\n\n@to_ivy_arrays_and_back\n@from_zero_dim_arrays_to_scalar\ndef nanargmin(a, /, *, axis=None, out=None, keepdims=None):\n    if out is not None:\n        raise NotImplementedError(\n            \"The 'out' argument to jnp.nanargmax is not supported.\"\n        )\n    nan_mask = ivy.isnan(a)\n    if not ivy.any(nan_mask):\n        return ivy.argmin(a, axis=axis, keepdims=keepdims)\n\n    a = ivy.where(nan_mask, ivy.inf, a)\n    res = ivy.argmin(a, axis=axis, keepdims=keepdims)\n    return ivy.where(ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res)\n\n\n@to_ivy_arrays_and_back\ndef nonzero(a, *, size=None, fill_value=None):\n    return ivy.nonzero(a, size=size, fill_value=fill_value)\n\n\n@to_ivy_arrays_and_back\ndef searchsorted(a, v, side=\"left\", sorter=None, *, method=\"scan\"):\n    return ivy.searchsorted(a, v, side=side, sorter=sorter, ret_dtype=\"int32\")\n\n\n@to_ivy_arrays_and_back\ndef sort(a, axis=-1, kind=\"quicksort\", order=None):\n    # todo: handle case where order is not None\n    return ivy.sort(a, axis=axis)\n\n\n@to_ivy_arrays_and_back\ndef sort_complex(a):\n    return ivy.sort(a)\n\n\n@to_ivy_arrays_and_back\ndef unique(\n    ar,\n    return_index=False,\n    return_inverse=False,\n    return_counts=False,\n    axis=None,\n    *,\n    size=None,\n    fill_value=None,\n):\n    uniques = list(ivy.unique_all(ar, axis=axis))\n    if size is not None:\n        fill_value = fill_value if fill_value is not None else 1  # default fill_value 1\n        pad_len = size - len(uniques[0])\n        if pad_len > 0:\n            # padding\n            num_dims = len(uniques[0].shape) - 1\n            padding = [(0, 0)] * num_dims + [(0, pad_len)]\n            uniques[0] = ivy.pad(uniques[0], padding, constant_values=fill_value)\n            # padding the indices and counts with zeros\n            for i in range(1, len(uniques)):\n                if i == 2:\n                    continue\n                uniques[i] = ivy.pad(uniques[i], padding[-1], constant_values=0)\n        else:\n            for i in range(len(uniques)):\n                uniques[i] = uniques[i][..., :size]\n    # constructing a list of bools for indexing\n    bools = [return_index, return_inverse, return_counts]\n    # indexing each element whose condition is True except for the values\n    uniques = [uniques[0]] + [uni for idx, uni in enumerate(uniques[1:]) if bools[idx]]\n    return uniques[0] if len(uniques) == 1 else uniques\n\n\n@to_ivy_arrays_and_back\ndef where(condition, x=None, y=None, *, size=None, fill_value=0):\n    if x is None and y is None:\n        return nonzero(condition, size=size, fill_value=fill_value)\n    if x is not None and y is not None:\n        return ivy.where(condition, x, y)\n    else:\n        raise ValueError(\"Both x and y should be given.\")\n", "path": "ivy/functional/frontends/jax/numpy/searching_sorting.py"}], "after_files": [{"content": "# global\nimport logging\n\n# local\nimport ivy\nfrom ivy.functional.frontends.jax.func_wrapper import (\n    to_ivy_arrays_and_back,\n)\nfrom ivy.functional.frontends.numpy.func_wrapper import from_zero_dim_arrays_to_scalar\nfrom ivy.func_wrapper import (\n    with_supported_device_and_dtypes,\n    with_unsupported_dtypes,\n)\n\n\n@to_ivy_arrays_and_back\n@with_unsupported_dtypes(\n    {\n        \"0.4.20 and below\": (\n            \"float16\",\n            \"bfloat16\",\n        )\n    },\n    \"jax\",\n)\ndef argmax(a, axis=None, out=None, keepdims=False):\n    return ivy.argmax(a, axis=axis, keepdims=keepdims, out=out, dtype=ivy.int64)\n\n\n# argmin\n@to_ivy_arrays_and_back\n@with_supported_device_and_dtypes(\n    {\n        \"0.4.20 and below\": {\n            \"cpu\": (\n                \"int16\",\n                \"int32\",\n                \"int64\",\n                \"float32\",\n                \"float64\",\n                \"uint8\",\n                \"uint16\",\n                \"uint32\",\n                \"uint64\",\n            )\n        }\n    },\n    \"jax\",\n)\ndef argmin(a, axis=None, out=None, keepdims=None):\n    if a is not None:\n        if isinstance(a, list):\n            if all(isinstance(elem, ivy.Array) for elem in a):\n                if len(a) == 1:\n                    a = a[0]\n                else:\n                    return [\n                        ivy.argmin(\n                            ivy.to_native_arrays(elem),\n                            axis=axis,\n                            out=out,\n                            keepdims=keepdims,\n                        )\n                        for elem in a\n                    ]\n            else:\n                raise ValueError(\n                    \"Input 'a' must be an Ivy array or a list of Ivy arrays.\"\n                )\n\n        if not isinstance(a, ivy.Array):\n            raise TypeError(\"Input 'a' must be an array.\")\n\n        if a.size == 0:\n            raise ValueError(\"Input 'a' must not be empty.\")\n\n        return ivy.argmin(a, axis=axis, out=out, keepdims=keepdims)\n    else:\n        raise ValueError(\"argmin takes at least 1 argument.\")\n\n\n@to_ivy_arrays_and_back\ndef argsort(a, axis=-1, kind=\"stable\", order=None):\n    if kind != \"stable\":\n        logging.warning(\n            \"'kind' argument to argsort is ignored; only 'stable' sorts are supported.\"\n        )\n    if order is not None:\n        raise ivy.utils.exceptions.IvyError(\n            \"'order' argument to argsort is not supported.\"\n        )\n\n    return ivy.argsort(a, axis=axis)\n\n\n@to_ivy_arrays_and_back\ndef argwhere(a, /, *, size=None, fill_value=None):\n    if size is None and fill_value is None:\n        return ivy.argwhere(a)\n\n    result = ivy.matrix_transpose(\n        ivy.vstack(ivy.nonzero(a, size=size, fill_value=fill_value))\n    )\n    num_of_dimensions = a.ndim\n\n    if num_of_dimensions == 0:\n        return result[:0].reshape(result.shape[0], 0)\n\n    return result.reshape(result.shape[0], num_of_dimensions)\n\n\n@with_unsupported_dtypes(\n    {\n        \"0.4.20 and below\": (\n            \"uint8\",\n            \"int8\",\n            \"bool\",\n        )\n    },\n    \"jax\",\n)\n@to_ivy_arrays_and_back\ndef count_nonzero(a, axis=None, keepdims=False):\n    return ivy.astype(ivy.count_nonzero(a, axis=axis, keepdims=keepdims), \"int64\")\n\n\n@to_ivy_arrays_and_back\ndef extract(condition, arr):\n    if condition.dtype is not bool:\n        condition = condition != 0\n    return arr[condition]\n\n\n@to_ivy_arrays_and_back\ndef flatnonzero(a):\n    return ivy.nonzero(ivy.reshape(a, (-1,)))\n\n\n@to_ivy_arrays_and_back\ndef lexsort(keys, /, *, axis=-1):\n    return ivy.lexsort(keys, axis=axis)\n\n\n@to_ivy_arrays_and_back\ndef msort(a):\n    return ivy.msort(a)\n\n\n@to_ivy_arrays_and_back\n@from_zero_dim_arrays_to_scalar\ndef nanargmax(a, /, *, axis=None, out=None, keepdims=False):\n    if out is not None:\n        raise NotImplementedError(\n            \"The 'out' argument to jnp.nanargmax is not supported.\"\n        )\n    nan_mask = ivy.isnan(a)\n    if not ivy.any(nan_mask):\n        return ivy.argmax(a, axis=axis, keepdims=keepdims)\n\n    a = ivy.where(nan_mask, -ivy.inf, a)\n    res = ivy.argmax(a, axis=axis, keepdims=keepdims)\n    return ivy.where(ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res)\n\n\n@to_ivy_arrays_and_back\n@from_zero_dim_arrays_to_scalar\ndef nanargmin(a, /, *, axis=None, out=None, keepdims=None):\n    if out is not None:\n        raise NotImplementedError(\n            \"The 'out' argument to jnp.nanargmax is not supported.\"\n        )\n    nan_mask = ivy.isnan(a)\n    if not ivy.any(nan_mask):\n        return ivy.argmin(a, axis=axis, keepdims=keepdims)\n\n    a = ivy.where(nan_mask, ivy.inf, a)\n    res = ivy.argmin(a, axis=axis, keepdims=keepdims)\n    return ivy.where(ivy.all(nan_mask, axis=axis, keepdims=keepdims), -1, res)\n\n\n@to_ivy_arrays_and_back\ndef nonzero(a, *, size=None, fill_value=None):\n    return ivy.nonzero(a, size=size, fill_value=fill_value)\n\n\n@to_ivy_arrays_and_back\ndef searchsorted(a, v, side=\"left\", sorter=None, *, method=\"scan\"):\n    return ivy.searchsorted(a, v, side=side, sorter=sorter, ret_dtype=\"int32\")\n\n\n@to_ivy_arrays_and_back\ndef sort(a, axis=-1, kind=\"quicksort\", order=None):\n    # todo: handle case where order is not None\n    return ivy.sort(a, axis=axis)\n\n\n@to_ivy_arrays_and_back\ndef sort_complex(a):\n    return ivy.sort(a)\n\n\n@to_ivy_arrays_and_back\ndef unique(\n    ar,\n    return_index=False,\n    return_inverse=False,\n    return_counts=False,\n    axis=None,\n    *,\n    size=None,\n    fill_value=None,\n):\n    uniques = list(ivy.unique_all(ar, axis=axis))\n    if size is not None:\n        fill_value = fill_value if fill_value is not None else 1  # default fill_value 1\n        pad_len = size - len(uniques[0])\n        if pad_len > 0:\n            # padding\n            num_dims = len(uniques[0].shape) - 1\n            padding = [(0, 0)] * num_dims + [(0, pad_len)]\n            uniques[0] = ivy.pad(uniques[0], padding, constant_values=fill_value)\n            # padding the indices and counts with zeros\n            for i in range(1, len(uniques)):\n                if i == 2:\n                    continue\n                uniques[i] = ivy.pad(uniques[i], padding[-1], constant_values=0)\n        else:\n            for i in range(len(uniques)):\n                uniques[i] = uniques[i][..., :size]\n    # constructing a list of bools for indexing\n    bools = [return_index, return_inverse, return_counts]\n    # indexing each element whose condition is True except for the values\n    uniques = [uniques[0]] + [uni for idx, uni in enumerate(uniques[1:]) if bools[idx]]\n    return uniques[0] if len(uniques) == 1 else uniques\n\n\n@to_ivy_arrays_and_back\ndef where(condition, x=None, y=None, *, size=None, fill_value=0):\n    if x is None and y is None:\n        return nonzero(condition, size=size, fill_value=fill_value)\n    if x is not None and y is not None:\n        return ivy.where(condition, x, y)\n    else:\n        raise ValueError(\"Both x and y should be given.\")\n", "path": "ivy/functional/frontends/jax/numpy/searching_sorting.py"}]}