We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`statistics.py` wrong parameter name
## 🐛 Bug

The functions [here](https://github.com/facebookresearch/CompilerGym/blob/e248330d2475fbcdf473cc3df951f25b5eaf4945/compiler_gym/util/statistics.py#L8) says they take `iterable` as inputs. However, `np.asarray` actually take `array_like`.

[Quote:
](https://numpy.org/doc/stable/reference/generated/numpy.asarray.html)

> Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays.

e.g.
```python
geometric_mean(i for i in range(10))
```
This will fail because though it's an `iterable`, it's not an `array_like`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `compiler_gym/util/statistics.py`
Content:
```
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 #
3 # This source code is licensed under the MIT license found in the
4 # LICENSE file in the root directory of this source tree.
5 import numpy as np
6 
7 
8 def geometric_mean(iterable):
9     """Zero-length-safe geometric mean."""
10     values = np.asarray(iterable)
11     if not values.size:
12         return 0
13     # Shortcut to return 0 when any element of the input is not positive.
14     if not np.all(values > 0):
15         return 0
16     a = np.log(values)
17     return np.exp(a.sum() / len(a))
18 
19 
20 def arithmetic_mean(iterable):
21     """Zero-length-safe arithmetic mean."""
22     values = np.asarray(iterable)
23     if not values.size:
24         return 0
25     return values.mean()
26 
27 
28 def stdev(iterable):
29     """Zero-length-safe standard deviation."""
30     values = np.asarray(iterable)
31     if not values.size:
32         return 0
33     return values.std()
34
```
--- 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/compiler_gym/util/statistics.py b/compiler_gym/util/statistics.py
--- a/compiler_gym/util/statistics.py
+++ b/compiler_gym/util/statistics.py
@@ -5,9 +5,9 @@
 import numpy as np
 
 
-def geometric_mean(iterable):
+def geometric_mean(array_like):
     """Zero-length-safe geometric mean."""
-    values = np.asarray(iterable)
+    values = np.asarray(array_like)
     if not values.size:
         return 0
     # Shortcut to return 0 when any element of the input is not positive.
@@ -17,17 +17,17 @@
     return np.exp(a.sum() / len(a))
 
 
-def arithmetic_mean(iterable):
+def arithmetic_mean(array_like):
     """Zero-length-safe arithmetic mean."""
-    values = np.asarray(iterable)
+    values = np.asarray(array_like)
     if not values.size:
         return 0
     return values.mean()
 
 
-def stdev(iterable):
+def stdev(array_like):
     """Zero-length-safe standard deviation."""
-    values = np.asarray(iterable)
+    values = np.asarray(array_like)
     if not values.size:
         return 0
     return values.std()

{"golden_diff": "diff --git a/compiler_gym/util/statistics.py b/compiler_gym/util/statistics.py\n--- a/compiler_gym/util/statistics.py\n+++ b/compiler_gym/util/statistics.py\n@@ -5,9 +5,9 @@\n import numpy as np\n \n \n-def geometric_mean(iterable):\n+def geometric_mean(array_like):\n     \"\"\"Zero-length-safe geometric mean.\"\"\"\n-    values = np.asarray(iterable)\n+    values = np.asarray(array_like)\n     if not values.size:\n         return 0\n     # Shortcut to return 0 when any element of the input is not positive.\n@@ -17,17 +17,17 @@\n     return np.exp(a.sum() / len(a))\n \n \n-def arithmetic_mean(iterable):\n+def arithmetic_mean(array_like):\n     \"\"\"Zero-length-safe arithmetic mean.\"\"\"\n-    values = np.asarray(iterable)\n+    values = np.asarray(array_like)\n     if not values.size:\n         return 0\n     return values.mean()\n \n \n-def stdev(iterable):\n+def stdev(array_like):\n     \"\"\"Zero-length-safe standard deviation.\"\"\"\n-    values = np.asarray(iterable)\n+    values = np.asarray(array_like)\n     if not values.size:\n         return 0\n     return values.std()\n", "issue": "`statistics.py` wrong parameter name\n## \ud83d\udc1b Bug\r\n\r\nThe functions [here](https://github.com/facebookresearch/CompilerGym/blob/e248330d2475fbcdf473cc3df951f25b5eaf4945/compiler_gym/util/statistics.py#L8) says they take `iterable` as inputs. However, `np.asarray` actually take `array_like`.\r\n\r\n[Quote:\r\n](https://numpy.org/doc/stable/reference/generated/numpy.asarray.html)\r\n\r\n> Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays.\r\n\r\ne.g.\r\n```python\r\ngeometric_mean(i for i in range(10))\r\n```\r\nThis will fail because though it's an `iterable`, it's not an `array_like`.\n", "before_files": [{"content": "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\nimport numpy as np\n\n\ndef geometric_mean(iterable):\n    \"\"\"Zero-length-safe geometric mean.\"\"\"\n    values = np.asarray(iterable)\n    if not values.size:\n        return 0\n    # Shortcut to return 0 when any element of the input is not positive.\n    if not np.all(values > 0):\n        return 0\n    a = np.log(values)\n    return np.exp(a.sum() / len(a))\n\n\ndef arithmetic_mean(iterable):\n    \"\"\"Zero-length-safe arithmetic mean.\"\"\"\n    values = np.asarray(iterable)\n    if not values.size:\n        return 0\n    return values.mean()\n\n\ndef stdev(iterable):\n    \"\"\"Zero-length-safe standard deviation.\"\"\"\n    values = np.asarray(iterable)\n    if not values.size:\n        return 0\n    return values.std()\n", "path": "compiler_gym/util/statistics.py"}], "after_files": [{"content": "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\nimport numpy as np\n\n\ndef geometric_mean(array_like):\n    \"\"\"Zero-length-safe geometric mean.\"\"\"\n    values = np.asarray(array_like)\n    if not values.size:\n        return 0\n    # Shortcut to return 0 when any element of the input is not positive.\n    if not np.all(values > 0):\n        return 0\n    a = np.log(values)\n    return np.exp(a.sum() / len(a))\n\n\ndef arithmetic_mean(array_like):\n    \"\"\"Zero-length-safe arithmetic mean.\"\"\"\n    values = np.asarray(array_like)\n    if not values.size:\n        return 0\n    return values.mean()\n\n\ndef stdev(array_like):\n    \"\"\"Zero-length-safe standard deviation.\"\"\"\n    values = np.asarray(array_like)\n    if not values.size:\n        return 0\n    return values.std()\n", "path": "compiler_gym/util/statistics.py"}]}