anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: planetlabs/planet-client-python
Issue: Unable to get single mosaic metadata

The `planet mosaic` command appears to be broken in 0.0.3:

```
$ planet mosaic color_balance_mosaic
Error: MissingResource: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>
```

`color_balance_mosaic` does appear when `planet mosaics` is run.


Changed files:
planet/api/client.py, tests/test_mosaics.py

diff --git a/planet/api/client.py b/planet/api/client.py
index 81d21ca..2b1cc0b 100644
--- a/planet/api/client.py
+++ b/planet/api/client.py
@@ -184,7 +184,7 @@ class Client(object):
         :param name:
             Mosaic name as returned by `list_mosaics`.
         """
-        return self._get('mosaics/%s/' % name).get_body()
+        return self._get('mosaics/%s' % name).get_body()
 
     def get_mosaic_quads(self, name, intersects=None, count=50):
         """
diff --git a/tests/test_mosaics.py b/tests/test_mosaics.py
index 04882a4..84b4b30 100644
--- a/tests/test_mosaics.py
+++ b/tests/test_mosaics.py
@@ -43,7 +43,7 @@ def test_get_mosaic():
 
         text = read_fixture('get-mosaic.json')
         uri = os.path.join(client.base_url,
-                           'mosaics/%s/' % mosaic_name)
+                           'mosaics/%s' % mosaic_name)
         m.get(uri, text=text, status_code=200)
 
         r = client.get_mosaic(mosaic_name)
Repository: planetlabs/planet-client-python
Issue: An http test, test__calculate_wait, randomly fails

The test `test__calculate_wait()`, which compares a randomly generated number with a list of hard-coded numbers, randomly fails.

Here's the traceback:

```
tests/unit/test_http.py:277: AssertionError

    def test__calculate_wait():
        max_retry_backoff = 20
        wait_times = [
            http.Session._calculate_wait(i + 1, max_retry_backoff)
            for i in range(5)
        ]
    
        # (min, max): 2**n to 2**n + 1, last entry hit threshold
        expected_times = [2, 4, 8, 16, 20]
    
        for wait, expected in zip(wait_times, expected_times):
            # this doesn't really test the randomness but does test exponential
            # and threshold
>           assert math.floor(wait) == expected
E           assert 17 == 16
E            +  where 17 = <built-in function floor>(17.0)
E            +    where <built-in function floor> = math.floor
```

"random is, unpredictably, often trouble"
-@jreiberkyle

Changed files:
planet/http.py

diff --git a/planet/http.py b/planet/http.py
index d554c4a..97983c0 100644
--- a/planet/http.py
+++ b/planet/http.py
@@ -335,7 +335,7 @@ class Session(BaseSession):
         """Calculates retry wait
 
         Base wait period is calculated as a exponential based on the number of
-        tries. Then, a random jitter of up to 1s is added to the base wait
+        tries. Then, a random jitter of up to 999ms is added to the base wait
         to avoid waves of requests in the case of multiple requests. Finally,
         the wait is thresholded to the maximum retry backoff.
 
@@ -347,7 +347,7 @@ class Session(BaseSession):
         * https://developers.planet.com/docs/data/api-mechanics/
         * https://cloud.google.com/iot/docs/how-tos/exponential-backoff
         """
-        random_number_milliseconds = random.randint(0, 1000) / 1000.0
+        random_number_milliseconds = random.randint(0, 999) / 1000.0
         calc_wait = 2**num_tries + random_number_milliseconds
         return min(calc_wait, max_retry_backoff)
Repository: planetlabs/planet-client-python
Issue: Remove checksum argument from orders.download_order()

`orders.download_order()` has a `checksum` argument, which is never used, which may be misleading to a user if they mark `checksum=True`. 

- In the SDK, the checksum is done in a separate call (e.g., `orders.download_order()` then `orders.validate_checksum()`). 
- In the CLI, the checksum is just a flag baked into the CLI's functionality.

**To do:** Remove `checksum` argument from `orders.download_order()` to avoid confusion.

Changed files:
planet/clients/orders.py

diff --git a/planet/clients/orders.py b/planet/clients/orders.py
index 584df8d..e5e8334 100644
--- a/planet/clients/orders.py
+++ b/planet/clients/orders.py
@@ -265,8 +265,7 @@ class OrdersClient:
                              order_id: str,
                              directory: Path = Path('.'),
                              overwrite: bool = False,
-                             progress_bar: bool = False,
-                             checksum: Optional[str] = None) -> List[Path]:
+                             progress_bar: bool = False) -> List[Path]:
         """Download all assets in an order.
 
         Parameters:
Repository: planetlabs/planet-client-python
Issue: Wrong order of inputs in update_search in its CLI command

In the CLI command `search_update()`, `name` is in the wrong place in the client call, `cl.update_search()`, which breaks tests. 

Although this isn't what is desired, a working solution here: https://github.com/planetlabs/planet-client-python/pull/905/commits/383deba7e815fdc039541f2fac1e93bac1d09ea5

I believe what needs to be done is instead change the order of inputs in `cl.update_search()`.



Changed files:
tests/integration/test_data_api.py, planet/clients/data.py

diff --git a/planet/clients/data.py b/planet/clients/data.py
index 6a5536c..21c8b1c 100644
--- a/planet/clients/data.py
+++ b/planet/clients/data.py
@@ -219,17 +219,17 @@ class DataClient:
 
     async def update_search(self,
                             search_id: str,
-                            name: str,
                             item_types: List[str],
                             search_filter: dict,
+                            name: str,
                             enable_email: bool = False) -> dict:
         """Update an existing saved search.
 
         Parameters:
             search_id: Saved search identifier.
-            name: The name of the saved search.
             item_types: The item types to include in the search.
             search_filter: Structured search criteria.
+            name: The name of the saved search.
             enable_email: Send a daily email when new results are added.
 
         Returns:
diff --git a/tests/integration/test_data_api.py b/tests/integration/test_data_api.py
index dba0e7b..8ae40ef 100644
--- a/tests/integration/test_data_api.py
+++ b/tests/integration/test_data_api.py
@@ -352,8 +352,9 @@ async def test_update_search_basic(search_filter, session):
 
     cl = DataClient(session, base_url=TEST_URL)
     search = await cl.update_search(VALID_SEARCH_ID,
-                                    'test', ['PSScene'],
-                                    search_filter)
+                                    item_types=['PSScene'],
+                                    search_filter=search_filter,
+                                    name='test')
 
     # check that request is correct
     expected_request = {