czlll/Loc-Bench_V0.1 huggingface dataset:
Repository: Netflix/metaflow
Issue category: Bug Report

BUG: Data store error - AWS batch/step execution
**Environment:**
metaflow version: 2.12.29
Python 3.11 (Docker Image from public.ecr.aws/docker/library/python:3.11)
Running on AWS Batch

**Description:**
Tested with version 2.12.28 and it runs successfully, with this latest version we get:
Data store error: No completed attempts of the task was found for task `MyFlow/sfn-*/_parameters/*-params`.

Maybe worth mentioning that we include a json file into `MyFlow` like:
```

json_config = IncludeFile(
        name="my_config",
        required=True,
        help="The Configuration",
        default=f"./{PARAMS_JSON}",
    )

```



Functions to edit:
metaflow/cli.py:dump

Patch:
diff --git a/metaflow/cli.py b/metaflow/cli.py
index 1fc6a14953..a318b84a3e 100644
--- a/metaflow/cli.py
+++ b/metaflow/cli.py
@@ -282,31 +282,21 @@ def dump(obj, input_path, private=None, max_value_size=None, include=None, file=
     else:
         ds_list = list(datastore_set)  # get all tasks
 
-    tasks_processed = False
     for ds in ds_list:
-        if ds is not None:
-            tasks_processed = True
-            echo(
-                "Dumping output of run_id=*{run_id}* "
-                "step=*{step}* task_id=*{task_id}*".format(
-                    run_id=ds.run_id, step=ds.step_name, task_id=ds.task_id
-                ),
-                fg="magenta",
-            )
-
-            if file is None:
-                echo_always(
-                    ds.format(**kwargs),
-                    highlight="green",
-                    highlight_bold=False,
-                    err=False,
-                )
-            else:
-                output[ds.pathspec] = ds.to_dict(**kwargs)
+        echo(
+            "Dumping output of run_id=*{run_id}* "
+            "step=*{step}* task_id=*{task_id}*".format(
+                run_id=ds.run_id, step=ds.step_name, task_id=ds.task_id
+            ),
+            fg="magenta",
+        )
 
-    if not tasks_processed:
-        echo(f"No task(s) found for pathspec {input_path}", fg="red")
-        return
+        if file is None:
+            echo_always(
+                ds.format(**kwargs), highlight="green", highlight_bold=False, err=False
+            )
+        else:
+            output[ds.pathspec] = ds.to_dict(**kwargs)
 
     if file is not None:
         with open(file, "wb") as f:
Repository: ray-project/ray
Issue category: Bug Report

ray/serve/generated file is missing after running setup-dev.py
### What happened + What you expected to happen

When running `python setup-dev.py`, it creates softlink for each python package. However, since the generated folder is not part of the repository, creating the symbolic link for the `serve` package inadvertently overwrites the folder and the generated folder can't be found anymore.

### Versions / Dependencies

Lastest

### Reproduction script

```

pip install -U "ray[serve] @ https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp39-cp39-macosx_11_0_arm64.whl"
python python/ray/setup-dev.py

```

### Issue Severity

Medium: It is a significant difficulty but I can work around it.


Functions to edit:
python/ray/setup-dev.py:do_link

Patch:
diff --git a/python/ray/setup-dev.py b/python/ray/setup-dev.py
index 31d722b89984..d26d377a65f5 100755
--- a/python/ray/setup-dev.py
+++ b/python/ray/setup-dev.py
@@ -73,9 +73,27 @@ def do_link(package, force=False, skip_list=None, local_path=None):
             print("You don't have write permission " f"to {package_home}, using sudo:")
             sudo = ["sudo"]
         print(f"Creating symbolic link from \n {local_home} to \n {package_home}")
+
+        # Preserve ray/serve/generated
+        if package == "serve":
+            # Copy generated folder to a temp dir
+            generated_folder = os.path.join(package_home, "generated")
+            temp_dir = "/tmp/ray/_serve/"
+            if not os.path.exists(temp_dir):
+                os.makedirs(temp_dir)
+            subprocess.check_call(["cp", "-r", generated_folder, temp_dir])
+
         subprocess.check_call(sudo + ["rm", "-rf", package_home])
         subprocess.check_call(sudo + ["ln", "-s", local_home, package_home])
 
+        # Move generated folder to local_home
+        if package == "serve":
+            tmp_generated_folder = os.path.join(temp_dir, "generated")
+            package_generated_folder = os.path.join(package_home, "generated")
+            subprocess.check_call(
+                ["mv", tmp_generated_folder, package_generated_folder]
+            )
+
 
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(
Repository: ray-project/ray
Issue category: Bug Report

[serve] logging_config specified in `serve.run` is not propagated cluster-wide
### Description

Specifying `logging_config` in `serve.run(..., logging_config={...})` does not configure logging for the cluster, as is expected. This is because we don't propagate `logging_config` to `.serve_start(...)` here:

https://github.com/ray-project/ray/blob/master/python/ray/serve/api.py#L475-L477

A simple workaround for now is,
```Python
logging_config = {"log_level": "..."}
serve.start(logging_config=logging_config)
serve.run(logging_config=logging_config)
```

### Use case

This issue arose when trying to configure Serve logging holistically for tests.


Functions to edit:
python/ray/serve/api.py:_run

Patch:
diff --git a/python/ray/serve/api.py b/python/ray/serve/api.py
index 182795889d47..13b92c7fcaae 100644
--- a/python/ray/serve/api.py
+++ b/python/ray/serve/api.py
@@ -474,6 +474,7 @@ def _run(
     else:
         client = _private_api.serve_start(
             http_options={"location": "EveryNode"},
+            global_logging_config=logging_config,
         )
         # Record after Ray has been started.
         ServeUsageTag.API_VERSION.record("v2")
Repository: ray-project/ray
Issue category: Bug Report

[Ray Clusters] `ray exec ... --stop --tmux ...` doesn't work with both `--stop` and `--tmux` specified
### What happened + What you expected to happen

When running `ray exec ...` with both `--stop` and `--tmux` flags, the `sudo shutdown -h now` command gets incorrectly left outside the tmux command and thus the machine is immediately shut down without the actual command finishing inside tmux.

For example, consider the following command:
```
ray exec \
  --verbose \
  --start \
  --stop \
  --tmux \
  --no-config-cache \
  ./cluster-config.yml \
  'echo "start" && sleep 10 && echo "done"'
```
This results in (as printed out by the command runner):
> Running `tmux new -d bash -c 'echo "start" && sleep 10 && echo "done"; ray stop; ray teardown ~/ray_bootstrap_config.yaml --yes --workers-only; exec bash'; sudo shutdown -h now`

The first part `tmux new -d bash -c '...'` returns immediately and thus the `sudo shutdown -h now` gets executed immediately before the command inside tmux finishes. I would expect the shutdown command to run only after the actual command.

### Versions / Dependencies

```
$ ray --version
ray, version 2.37.0
```

### Reproduction script

`cluster-config.yml`:
```yml
auth:
  ssh_user: ubuntu

cluster_name: minimal

provider:
  type: gcp
  region: us-east1
  availability_zone: us-east1-b
  project_id: [project-id]  # Globally unique project id
```

Command:
```
ray exec \
  --verbose \
  --start \
  --stop \
  --tmux \
  --no-config-cache \
  ./cluster-config.yml \
  'echo "start" && sleep 10 && echo "done"'
```

### Issue Severity

Medium: It is a significant difficulty but I can work around it.


Functions to edit:
python/ray/autoscaler/_private/commands.py:exec_cluster

Patch:
diff --git a/python/ray/autoscaler/_private/commands.py b/python/ray/autoscaler/_private/commands.py
index 3c03738854f7..9a9b9d91cc2f 100644
--- a/python/ray/autoscaler/_private/commands.py
+++ b/python/ray/autoscaler/_private/commands.py
@@ -1153,16 +1153,15 @@ def exec_cluster(
         },
         docker_config=config.get("docker"),
     )
-    shutdown_after_run = False
     if cmd and stop:
         cmd = "; ".join(
             [
                 cmd,
                 "ray stop",
                 "ray teardown ~/ray_bootstrap_config.yaml --yes --workers-only",
+                "sudo shutdown -h now",
             ]
         )
-        shutdown_after_run = True
 
     result = _exec(
         updater,
@@ -1172,7 +1171,7 @@ def exec_cluster(
         port_forward=port_forward,
         with_output=with_output,
         run_env=run_env,
-        shutdown_after_run=shutdown_after_run,
+        shutdown_after_run=False,
         extra_screen_args=extra_screen_args,
     )
     if tmux or screen:
Repository: ray-project/ray
Issue category: Bug Report

[ray metrics launch-prometheus] Incorrect download URL generation for aarch64 architecture
### What happened + What you expected to happen

<img width="802" alt="image" src="https://github.com/user-attachments/assets/e370ab29-db28-432b-b2c5-4c50e8e2dcf6">

- When executing the "ray metrics launch-prometheus" command on an aarch64 architecture system, the download URL is incorrectly generated, leading to a "not found" error. 
- This occurs because the command attempts to download the Prometheus build file from the GitHub releases page (https://github.com/prometheus/prometheus/releases) using "aarch64" in the URL, while Prometheus classifies this architecture as "arm64".

### Versions / Dependencies

- Ray: rayproject/ray:nightly-aarch64

### Reproduction script

1. Run "ray metrics launch-prometheus" on an aarch64 system
2. Observe that the command attempts to download a file with "aarch64" in the URL

### Issue Severity

Low: It annoys or frustrates me.


Functions to edit:
python/ray/dashboard/modules/metrics/install_and_start_prometheus.py:get_system_info

Patch:
diff --git a/python/ray/dashboard/modules/metrics/install_and_start_prometheus.py b/python/ray/dashboard/modules/metrics/install_and_start_prometheus.py
index a65050212950..cf7cb31c3607 100644
--- a/python/ray/dashboard/modules/metrics/install_and_start_prometheus.py
+++ b/python/ray/dashboard/modules/metrics/install_and_start_prometheus.py
@@ -26,6 +26,9 @@ def get_system_info():
     if architecture == "x86_64":
         # In the Prometheus filename, it's called amd64
         architecture = "amd64"
+    elif architecture == "aarch64":
+        # In the Prometheus filename, it's called arm64
+        architecture = "arm64"
     return os_type, architecture
Repository: optuna/optuna
Issue category: Bug Report

CLI for empty DB raises `ValueError`
### Expected behavior

CLI for empty DB should output empty result, but the current implementation raises `ValueError`.

### Environment

- Optuna version:4.2.0.dev
- Python version:3.13.0
- OS:macOS-15.1-x86_64-i386-64bit-Mach-O
- (Optional) Other libraries and their versions:

### Error messages, stack traces, or logs

```shell
See below.
```


### Steps to reproduce

For empty DB (`tmp.db` does not exist before the command), the `optuna studies` command raises `ValueError`.

```bash
$ optuna --storage sqlite:///tmp.db studies
Traceback (most recent call last):
  File "/Users/naotomizuno/.pyenv/versions/optuna-3.13.0/bin/optuna", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/naotomizuno/optuna/optuna/cli.py", line 991, in main
    return args.handler(args)
           ~~~~~~~~~~~~^^^^^^
  File "/Users/naotomizuno/optuna/optuna/cli.py", line 463, in take_action
    _format_output(
    ~~~~~~~~~~~~~~^
        records, self._study_list_header, parsed_args.format, parsed_args.flatten
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/naotomizuno/optuna/optuna/cli.py", line 258, in _format_output
    return _dump_table(values, header).strip()
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/naotomizuno/optuna/optuna/cli.py", line 222, in _dump_table
    max_width = max(len(header[column]), max(row[column].width() for row in rows))
                                         ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: max() iterable argument is empty
```


### Additional context (optional)

_No response_


Functions to edit:
optuna/cli.py:_dump_table

Patch:
diff --git a/optuna/cli.py b/optuna/cli.py
index 16fa3a6df1..7246a86e21 100644
--- a/optuna/cli.py
+++ b/optuna/cli.py
@@ -215,7 +215,10 @@ def _dump_table(records: list[dict[str, Any]], header: list[str]) -> str:
         for t in value_types:
             if t == ValueType.STRING:
                 value_type = ValueType.STRING
-        max_width = max(len(header[column]), max(row[column].width() for row in rows))
+        if len(rows) == 0:
+            max_width = len(header[column])
+        else:
+            max_width = max(len(header[column]), max(row[column].width() for row in rows))
         separator += "-" * (max_width + 2) + "+"
         if value_type == ValueType.NUMERIC:
             header_string += f" {header[column]:>{max_width}} |"
@@ -228,7 +231,8 @@ def _dump_table(records: list[dict[str, Any]], header: list[str]) -> str:
     ret += separator + "\n"
     ret += header_string + "\n"
     ret += separator + "\n"
-    ret += "\n".join(rows_string) + "\n"
+    for row_string in rows_string:
+        ret += row_string + "\n"
     ret += separator + "\n"
 
     return ret
Repository: BerriAI/litellm
Issue category: Bug Report

[Bug]: supported params are out of date for fireworks AI
### What happened?

when calling fireworks models, litellm is complianing: logprobs is not supproted but it's actually supported by fireworks ai.
ref: https://docs.fireworks.ai/api-reference/post-completions

### Relevant log output

_No response_

### Twitter / LinkedIn details

_No response_


Functions to edit:
litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py:FireworksAIConfig
litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py:FireworksAIConfig.__init__
litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py:FireworksAIConfig.get_supported_openai_params

Patch:
diff --git a/litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py b/litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py
index 4d5b2d6eb3ba..10d8a5913328 100644
--- a/litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py
+++ b/litellm/llms/fireworks_ai/chat/fireworks_ai_transformation.py
@@ -25,6 +25,7 @@ class FireworksAIConfig:
     stop: Optional[Union[str, list]] = None
     response_format: Optional[dict] = None
     user: Optional[str] = None
+    logprobs: Optional[int] = None
 
     # Non OpenAI parameters - Fireworks AI only params
     prompt_truncate_length: Optional[int] = None
@@ -44,6 +45,7 @@ def __init__(
         stop: Optional[Union[str, list]] = None,
         response_format: Optional[dict] = None,
         user: Optional[str] = None,
+        logprobs: Optional[int] = None,
         prompt_truncate_length: Optional[int] = None,
         context_length_exceeded_behavior: Optional[Literal["error", "truncate"]] = None,
     ) -> None:
@@ -86,6 +88,7 @@ def get_supported_openai_params(self):
             "stop",
             "response_format",
             "user",
+            "logprobs",
             "prompt_truncate_length",
             "context_length_exceeded_behavior",
         ]
Repository: BerriAI/litellm
Issue category: Feature Request

Replace deprecated Pydantic Config class with model_config
The code uses a deprecated Pydantic Config class, which reports a warning. It should be replaced with `model_config`


Functions to edit:
litellm/proxy/_types.py:LiteLLM_OrganizationMembershipTable

Patch:
diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py
index 72d6c84c95eb..a900ab318424 100644
--- a/litellm/proxy/_types.py
+++ b/litellm/proxy/_types.py
@@ -1451,6 +1451,8 @@ class UserAPIKeyAuth(
     user_tpm_limit: Optional[int] = None
     user_rpm_limit: Optional[int] = None
 
+    model_config = ConfigDict(arbitrary_types_allowed=True)
+
     @model_validator(mode="before")
     @classmethod
     def check_api_key(cls, values):
@@ -1462,9 +1464,6 @@ def check_api_key(cls, values):
                 values.update({"api_key": hash_token(values.get("api_key"))})
         return values
 
-    class Config:
-        arbitrary_types_allowed = True
-
 
 class UserInfoResponse(LiteLLMBase):
     user_id: Optional[str]
Repository: matplotlib/matplotlib
Issue category: Feature Request

Improve LineCollection docstring further
              (M, 2)

I would perhaps completely drop the "list of points" and just write
```
A sequence ``[line0, line1, ...]`` where each line is a (N, 2)-shape
array-like of points::

    line0 = [(x0, y0), (x1, y1), ...]

Each line can...
```

_Originally posted by @anntzer in https://github.com/matplotlib/matplotlib/pull/26676#discussion_r1313026557_


            


Functions to edit:
lib/matplotlib/collections.py:LineCollection.__init__

Patch:
diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py
index a78f1838357e..f18d5a4c3a8c 100644
--- a/lib/matplotlib/collections.py
+++ b/lib/matplotlib/collections.py
@@ -1612,14 +1612,13 @@ def __init__(self, segments,  # Can be None.
         """
         Parameters
         ----------
-        segments : list of array-like
-            A sequence (*line0*, *line1*, *line2*) of lines, where each line is a list
-            of points::
+        segments : list of (N, 2) array-like
+            A sequence ``[line0, line1, ...]`` where each line is a (N, 2)-shape
+            array-like containing points::
 
-                lineN = [(x0, y0), (x1, y1), ... (xm, ym)]
+                line0 = [(x0, y0), (x1, y1), ...]
 
-            or the equivalent Mx2 numpy array with two columns. Each line
-            can have a different number of segments.
+            Each line can contain a different number of points.
         linewidths : float or list of float, default: :rc:`lines.linewidth`
             The width of each line in points.
         colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
Repository: matplotlib/matplotlib
Issue category: Bug Report

[Bug]: inconsistent ‘animation.FuncAnimation’ between display and save
### Bug summary

when i want to save images to gif,  it's inconsistent between display and save; 

It seems that the color information has been lost:

![temp](https://github.com/user-attachments/assets/f1a6c123-2533-4db0-8c14-4264cfe3345c)


### Code for reproduction

```Python
def animation_test():
    import matplotlib.pyplot as plt
    import matplotlib.animation as animation
    file = r'example.dat'
    num_frames = 72
    nx = 8
    ny = 9
    data = np.fromfile(file, np.float32).reshape(num_frames, ny, nx)

    fig, ax = plt.subplots()
    img = data[0,]
    # plt.imshow(img)
    vmax = 100
    vmin = 0
    h = ax.imshow(img, cmap=plt.get_cmap('CMRmap_r'), origin='lower', interpolation='none', vmin=vmin, vmax=vmax, animated=True)
    ax.set_xticks(range(nx))
    ax.set_xticklabels(range(1, nx + 1))
    ax.set_yticks(range(ny))
    ax.set_yticklabels(range(1, ny + 1))
    fig.tight_layout()

    def update(frame):
        img = data[frame, ]
        h.set_array(img)
        return h,

    # create animation
    interval = 100
    ani = animation.FuncAnimation(fig, update, frames=range(num_frames), interval=interval, blit=True)
    # ani = animation.FuncAnimation(fig, update, frames=frame_iter, interval=interval, blit=False, cache_frame_data=False)

    ani.save('example.gif', writer='pillow', fps=2, dpi=300)

    pass

if __name__ == '__main__':
    animation_test()
```


### Actual outcome

above picture -> right

### Expected outcome

above picture -> left

### Additional information

_No response_

### Operating system

win10

### Matplotlib Version

'3.4.2'

### Matplotlib Backend

_No response_

### Python version

3.7.10

### Jupyter version

_No response_

### Installation

pip


Functions to edit:
lib/matplotlib/animation.py:PillowWriter.grab_frame

Patch:
diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py
index 47f2f0f9515b..2be61284073a 100644
--- a/lib/matplotlib/animation.py
+++ b/lib/matplotlib/animation.py
@@ -492,8 +492,15 @@ def grab_frame(self, **savefig_kwargs):
         buf = BytesIO()
         self.fig.savefig(
             buf, **{**savefig_kwargs, "format": "rgba", "dpi": self.dpi})
-        self._frames.append(Image.frombuffer(
-            "RGBA", self.frame_size, buf.getbuffer(), "raw", "RGBA", 0, 1))
+        im = Image.frombuffer(
+            "RGBA", self.frame_size, buf.getbuffer(), "raw", "RGBA", 0, 1)
+        if im.getextrema()[3][0] < 255:
+            # This frame has transparency, so we'll just add it as is.
+            self._frame.append(im)
+        else:
+            # Without transparency, we switch to RGB mode, which converts to P mode a
+            # little better if needed (specifically, this helps with GIF output.)
+            self._frames.append(im.convert("RGB"))
 
     def finish(self):
         self._frames[0].save(
Repository: tobymao/sqlglot
Issue category: Bug Report

getting UnboundLocalError: cannot access local variable 'aggregate' where it is not associated with a value when running sqlglot.planner.Plan
**Before you file an issue**
- Make sure you specify the "read" dialect eg. `parse_one(sql, read="spark")`
- Make sure you specify the "write" dialect eg. `ast.sql(dialect="duckdb")`
- Check if the issue still exists on main

**Fully reproducible code snippet**
```
import sqlglot
import sqlglot.planner

r = 'select suma from ( select sum(a) as suma from table1) order by suma'
parsed = sqlglot.parse_one(r, dialect='snowflake')
p = sqlglot.planner.Plan(parsed)
```
Throws:
```
File venv/lib/python3.11/site-packages/sqlglot/planner.py:14, in Plan.__init__(self, expression)
     12 def __init__(self, expression: exp.Expression) -> None:
     13     self.expression = expression.copy()
---> 14     self.root = Step.from_expression(self.expression)
     15     self._dag: t.Dict[Step, t.Set[Step]] = {}

File venv/lib/python3.11/site-packages/sqlglot/planner.py:213, in Step.from_expression(cls, expression, ctes)
    210         if extract_agg_operands(exp.alias_(ordered.this, f"_o_{i}", quoted=True)):
    211             ordered.this.replace(exp.column(f"_o_{i}", step.name, quoted=True))
--> 213     set_ops_and_aggs(aggregate)
    215 sort = Sort()
    216 sort.name = step.name

UnboundLocalError: cannot access local variable 'aggregate' where it is not associated with a value
```

On sqlglot 25.33.0

dialect seems to be irrelevant, same error with Athena

**Official Documentation**
Please include links to official SQL documentation related to your issue.



Functions to edit:
sqlglot/planner.py:Step.from_expression

Patch:
diff --git a/sqlglot/planner.py b/sqlglot/planner.py
index 2e42b32c4..687bffb9f 100644
--- a/sqlglot/planner.py
+++ b/sqlglot/planner.py
@@ -201,11 +201,13 @@ def set_ops_and_aggs(step):
 
             aggregate.add_dependency(step)
             step = aggregate
+        else:
+            aggregate = None
 
         order = expression.args.get("order")
 
         if order:
-            if isinstance(step, Aggregate):
+            if aggregate and isinstance(step, Aggregate):
                 for i, ordered in enumerate(order.expressions):
                     if extract_agg_operands(exp.alias_(ordered.this, f"_o_{i}", quoted=True)):
                         ordered.this.replace(exp.column(f"_o_{i}", step.name, quoted=True))
Repository: flet-dev/flet
Issue category: Bug Report

`flet build` creates bundle but running it gives `ImportError: No module named main` error
### Duplicate Check

- [X] I have searched the [opened issues](https://github.com/flet-dev/flet/issues) and there are no duplicates

### Describe the bug

Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<frozen runpy>", line 222, in run_module
  File "<frozen runpy>", line 142, in _get_module_details
ImportError: No module named main


### Code sample

<details open><summary>Code</summary>

```python
print(error)
```

</details>


### To reproduce

...

### Expected behavior

_No response_

### Screenshots / Videos

<details open>
<summary>Captures</summary>

![Screenshot_2024-11-28-23-36-20-36_92b64b2a7aa6eb3771ed6e18d0029815](https://github.com/user-attachments/assets/e22fcd4a-eaa1-448f-8c61-51164c6cbae7)


</details>


### Operating System

Windows

### Operating system details

11

### Flet version

0.25

### Regression

No, it isn't

### Suggestions

_No response_

### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Additional details

_No response_


Functions to edit:
sdk/python/packages/flet-cli/src/flet_cli/commands/build.py:Command.package_python_app

Patch:
diff --git a/sdk/python/packages/flet-cli/src/flet_cli/commands/build.py b/sdk/python/packages/flet-cli/src/flet_cli/commands/build.py
index 0dcd8539a..212157549 100644
--- a/sdk/python/packages/flet-cli/src/flet_cli/commands/build.py
+++ b/sdk/python/packages/flet-cli/src/flet_cli/commands/build.py
@@ -1271,6 +1271,7 @@ def package_python_app(self):
         assert self.options
         assert self.get_pyproject
         assert self.python_app_path
+        assert self.package_app_path
         assert self.build_dir
         assert self.flutter_dir
 
@@ -1282,7 +1283,7 @@ def package_python_app(self):
             "run",
             "serious_python:main",
             "package",
-            str(self.python_app_path),
+            str(self.package_app_path),
             "--platform",
             self.package_platform,
         ]
Repository: flet-dev/flet
Issue category: Bug Report

Icon rotation doesn't work with flet-0.25.0.dev3711
### Duplicate Check

- [X] I have searched the [opened issues](https://github.com/flet-dev/flet/issues) and there are no duplicates

### Describe the bug

Icon rotation doesn't work anymore with flet 0.25
IconButton and other controls are OK

### Code sample

<details open><summary>Code</summary>

flet 0.24.1 : 
```python
import flet as ft
import math


def main(page: ft.Page):
    page.add(
        ft.Icon(
            name=ft.icons.FAVORITE,
        ),
        ft.Icon(
            name=ft.icons.FAVORITE,
            size=60,
            rotate=ft.Rotate(0.5*math.pi)
        ),
    )
    


ft.app(target=main)
```

flet-0.25.0.dev3711 : 
```python
import flet as ft
import math


def main(page: ft.Page):
    page.add(
        ft.Icon(
            name=ft.Icons.FAVORITE,
        ),
        ft.Icon(
            name=ft.Icons.FAVORITE,
            size=60,
            rotate=ft.Rotate(0.5*math.pi)
        ),
    )

ft.app(target=main)
```
</details>


### To reproduce

Nothing particular : 
With the same code, icon is rotated with flet 0.24.1 and lower, not rotated with 0.25

### Expected behavior

Icon rotate..

### Screenshots / Videos

<details open>
<summary>Captures</summary>

0.24.1 : 
![image](https://github.com/user-attachments/assets/620d5cd8-c867-4cd7-8ecf-73837665cb68)

flet-0.25.0.dev3711
![image](https://github.com/user-attachments/assets/25a13b91-3de3-4831-86cf-06b201c28312)

</details>


### Operating System

Windows

### Operating system details

windows 11 24H2

### Flet version

flet-0.25.0.dev3711

### Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

### Suggestions

_No response_

### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Additional details

_No response_


Functions to edit:
sdk/python/packages/flet/src/flet/core/icon.py:Icon.before_update

Patch:
diff --git a/sdk/python/packages/flet/src/flet/core/icon.py b/sdk/python/packages/flet/src/flet/core/icon.py
index 8944f28bf..5af67aa7b 100644
--- a/sdk/python/packages/flet/src/flet/core/icon.py
+++ b/sdk/python/packages/flet/src/flet/core/icon.py
@@ -130,6 +130,7 @@ def _get_control_name(self):
         return "icon"
 
     def before_update(self):
+        super().before_update()
         self._set_attr_json("shadows", self.__shadows)
 
     # name
Repository: explodinggradients/ragas
Issue category: Feature Request

In NoiseSensitivity, the `.` should be deleted as the split condition.
[ ] I checked the [documentation](https://docs.ragas.io/) and related resources and couldn't find an answer to my question.

**Your Question**
After the sentence is split, i think the `.` should no longer be used as a split condition. Many other languages ​​do not use `.` as a split condition. Just follow the result of `sentence_segmenter`.

**Code Examples**
https://github.com/explodinggradients/ragas/blob/main/src/ragas/metrics/_noise_sensitivity.py#L104C13-L104C46

**Additional context**
I will provide a pr.



Functions to edit:
src/ragas/metrics/_noise_sensitivity.py:NoiseSensitivity._decompose_answer_into_statements

Patch:
diff --git a/src/ragas/metrics/_noise_sensitivity.py b/src/ragas/metrics/_noise_sensitivity.py
index a6a903b68..4074d0edc 100644
--- a/src/ragas/metrics/_noise_sensitivity.py
+++ b/src/ragas/metrics/_noise_sensitivity.py
@@ -101,7 +101,6 @@ async def _decompose_answer_into_statements(
         sentences_with_index = {
             i: sentence
             for i, sentence in enumerate(sentences)
-            if sentence.strip().endswith(".")
         }
 
         statements_simplified = await self.statement_prompt.generate(
Repository: scikit-learn/scikit-learn
Issue category: Bug Report

Missing format string arguments
This assertion error string is not properly formatted as the 2 format arguments `y_pred.shape` and `y.shape` are missing:

https://github.com/scikit-learn/scikit-learn/blob/551d56c254197c4b6ad63974d749824ed2c7bc58/sklearn/utils/estimator_checks.py#L2139

```python
assert y_pred.shape == y.shape, (
    "The shape of the prediction for multioutput data is incorrect."
    " Expected {}, got {}."
)
```

should become

```python
assert y_pred.shape == y.shape, (
    "The shape of the prediction for multioutput data is incorrect."
    " Expected {}, got {}.".format(y_pred.shape, y.shape)
)
```


Functions to edit:
sklearn/utils/estimator_checks.py:check_regressor_multioutput

Patch:
diff --git a/sklearn/utils/estimator_checks.py b/sklearn/utils/estimator_checks.py
index f5d542d9a59fc..da1300817b148 100644
--- a/sklearn/utils/estimator_checks.py
+++ b/sklearn/utils/estimator_checks.py
@@ -2076,11 +2076,11 @@ def check_regressor_multioutput(name, estimator):
 
     assert y_pred.dtype == np.dtype("float64"), (
         "Multioutput predictions by a regressor are expected to be"
-        " floating-point precision. Got {} instead".format(y_pred.dtype)
+        f" floating-point precision. Got {y_pred.dtype} instead"
     )
     assert y_pred.shape == y.shape, (
         "The shape of the prediction for multioutput data is incorrect."
-        " Expected {}, got {}."
+        f" Expected {y_pred.shape}, got {y.shape}."
     )
Repository: Lightning-AI/pytorch-lightning
Issue category: Bug Report

UnboundLocalError: local variable 'any_on_epoch' referenced before assignment in prediction loop
### Bug description

`UnboundLocalError` raises when using the predict method with `return_predictions=False`.

This is due to `any_on_epoch` [not being defined](https://github.com/Lightning-AI/pytorch-lightning/blob/be608fa355b835b9b0727df2f5476f0a1d90bc59/src/lightning/pytorch/loops/prediction_loop.py#L236) if `data_fetcher` is [an instance](https://github.com/Lightning-AI/pytorch-lightning/blob/be608fa355b835b9b0727df2f5476f0a1d90bc59/src/lightning/pytorch/loops/prediction_loop.py#L229) of `_DataLoaderIterDataFetcher`.

### What version are you seeing the problem on?

v2.4

### How to reproduce the bug

_No response_

### Error messages and logs

```
UnboundLocalError: local variable 'any_on_epoch' referenced before assignment
```


### Environment

<details>
  <summary>Current environment</summary>

```
#- PyTorch Lightning Version (e.g., 2.4.0):
#- PyTorch Version (e.g., 2.4):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
```

</details>


### More info

_No response_


Functions to edit:
src/lightning/pytorch/loops/prediction_loop.py:_PredictionLoop._predict_step

Patch:
diff --git a/src/lightning/pytorch/loops/prediction_loop.py b/src/lightning/pytorch/loops/prediction_loop.py
index 7044ccea87a7f..dcfd873a28b4b 100644
--- a/src/lightning/pytorch/loops/prediction_loop.py
+++ b/src/lightning/pytorch/loops/prediction_loop.py
@@ -233,8 +233,9 @@ def _predict_step(
 
         self.batch_progress.increment_ready()
 
-        if not using_dataloader_iter:
-            any_on_epoch = self._store_data_for_prediction_writer(batch_idx, dataloader_idx)
+        any_on_epoch = (
+            self._store_data_for_prediction_writer(batch_idx, dataloader_idx) if not using_dataloader_iter else False
+        )
 
         # the `_step` methods don't take a batch_idx when `dataloader_iter` is used, but all other hooks still do,
         # so we need different kwargs
Repository: Lightning-AI/pytorch-lightning
Issue category: Feature Request

Proposal(CLI): after_instantiate_classes hook
### Description & Motivation

Adds a `after_instantiate_classes` hook to the Lightning CLI, called after `self.instantiate_classes()` during the initalization of `LightningCLI`.

### Pitch

While having the Lightning CLI is great, it is not perfect for each use case out-of-the-box. Hence, you included hooks like `before_instantiate_classes` and describe in the docs how to extend the CLI. Problem is, you cannot extend this feature without hacks or substantial copy-pasta.

I think, to further improve the CLI, without adding any complexity, it makes sense to add a `after_instantiate_classes` hook, too.

### Alternatives

1. Hacks
 - Extend the Lightning CLI and run the `after_instantiate_classes` function before the `self._run_subcommand` function.
 - Problems: it's not intuitive that the function is called there, won't be called if `self.subcommand is None`
2. Copy-Pasta
 - Extend the Lightning CLI and replace the original `__init__` with the proposed one.
 - Problems: could break with any update, lots of code duplication


### Additional context

_No response_

cc @borda @tchaton @justusschock @awaelchli @mauvilsa


Functions to edit:
src/lightning/pytorch/cli.py:LightningCLI.__init__
Functions added: src/lightning/pytorch/cli.py:LightningCLI.after_instantiate_classes

Patch:
diff --git a/src/lightning/pytorch/cli.py b/src/lightning/pytorch/cli.py
index 26af335f7be93..e0de8a24b38f5 100644
--- a/src/lightning/pytorch/cli.py
+++ b/src/lightning/pytorch/cli.py
@@ -389,6 +389,7 @@ def __init__(
         self._add_instantiators()
         self.before_instantiate_classes()
         self.instantiate_classes()
+        self.after_instantiate_classes()
 
         if self.subcommand is not None:
             self._run_subcommand(self.subcommand)
@@ -560,6 +561,9 @@ def instantiate_classes(self) -> None:
         self._add_configure_optimizers_method_to_model(self.subcommand)
         self.trainer = self.instantiate_trainer()
 
+    def after_instantiate_classes(self) -> None:
+        """Implement to run some code after instantiating the classes."""
+
     def instantiate_trainer(self, **kwargs: Any) -> Trainer:
         """Instantiates the trainer.
Repository: kornia/kornia
Issue category: Bug Report

AugmentationSequential explicitly moves the output to the CPU if data_keys is given
### Describe the bug

With the 0.7.4 release, augmentations on the GPU are not possible anymore because the output of the input tensor is always explicitly moved to the CPU.

The problem is that `_detach_tensor_to_cpu` is called explicitly on every tensor in [augment.py](https://github.com/kornia/kornia/blob/main/kornia/augmentation/container/augment.py#L507).

### Reproduction steps
The augmented version of the input gets moved to the CPU:

```python
import torch
import kornia

input = torch.randn(1, 3, 10, 10, device="cuda")
mask = torch.randn(1, 10, 10, device="cuda")
aug_list = kornia.augmentation.AugmentationSequential(kornia.augmentation.RandomHorizontalFlip(p=1))

for a in aug_list(input, mask, data_keys=["input", "mask"]):
    print(a.dtype, a.device)
# torch.float32 cpu
# torch.float32 cuda:0
```

Without `data_keys` and only one input, the output device is as expected:
```python
for a in aug_list(input):
    print(a.dtype, a.device)
# torch.float32 cuda:0
```


### Expected behavior

I would expect the augmented version of the input tensor to reside on the GPU.

### Environment

- PyTorch Version (e.g., 1.0): 2.5.1
- OS (e.g., Linux): Ubuntu
- How you installed PyTorch (`conda`, `pip`, source): pip
- Build command you used (if compiling from source):
- Python version: 3.12
- CUDA/cuDNN version: 12.4
- GPU models and configuration: NVIDIA 4090 RTX
- Any other relevant information:


### Additional context

Reverting back to 0.7.3 fixes the problem.


Functions to edit:
kornia/augmentation/container/augment.py:AugmentationSequential.__call__

Patch:
diff --git a/kornia/augmentation/container/augment.py b/kornia/augmentation/container/augment.py
index a9cad91924..ebd892bf17 100644
--- a/kornia/augmentation/container/augment.py
+++ b/kornia/augmentation/container/augment.py
@@ -507,11 +507,9 @@ def __call__(
                 if output_type == "tensor":
                     self._output_image = _output_image
                     if isinstance(_output_image, dict):
-                        self._output_image[original_keys[idx]] = self._detach_tensor_to_cpu(
-                            _output_image[original_keys[idx]]
-                        )
+                        self._output_image[original_keys[idx]] = _output_image[original_keys[idx]]
                     else:
-                        self._output_image[idx] = self._detach_tensor_to_cpu(_output_image[idx])
+                        self._output_image[idx] = _output_image[idx]
                 elif isinstance(_output_image, dict):
                     self._output_image[original_keys[idx]] = _output_image[original_keys[idx]]
                 else:
Repository: wandb/wandb
Issue category: Bug Report

[Bug]: Incorrect order in `runs.histories()`
### Describe the bug

`Runs` have a `order` attribute. However in the `Runs.histories()` method the order is not respected and the `runid` is used to sort instead (see [Relevant code](https://github.com/wandb/wandb/blob/v0.18.7/wandb/apis/public/runs.py#L236). I don't think this is desirable and also is undocumented behavior. I would recommend that the order specified in the `Runs` object is used or to not reorder  all so that it is preserved to match the order obtained when iterating over the `runs` object via the iterator interface.

wandb: 0.17.3
python 3.11.8
operating system: Ubuntu 22.04


Functions to edit:
wandb/apis/public/runs.py:Runs.histories

Patch:
diff --git a/wandb/apis/public/runs.py b/wandb/apis/public/runs.py
index c605630e079..b29b5109f91 100644
--- a/wandb/apis/public/runs.py
+++ b/wandb/apis/public/runs.py
@@ -236,7 +236,6 @@ def histories(
             if not histories:
                 return pd.DataFrame()
             combined_df = pd.concat(histories)
-            combined_df.sort_values("run_id", inplace=True)
             combined_df.reset_index(drop=True, inplace=True)
             # sort columns for consistency
             combined_df = combined_df[(sorted(combined_df.columns))]
@@ -262,9 +261,9 @@ def histories(
                 histories.append(df)
             if not histories:
                 return pl.DataFrame()
-            combined_df = pl.concat(histories, how="align")
+            combined_df = pl.concat(histories, how="vertical")
             # sort columns for consistency
-            combined_df = combined_df.select(sorted(combined_df.columns)).sort("run_id")
+            combined_df = combined_df.select(sorted(combined_df.columns))
 
             return combined_df
Repository: wandb/wandb
Issue category: Bug Report

[Bug]: "wandb.Video requires moviepy when passing raw data" Error due to new moviepy version
### Describe the bug

The moviepy package was updated to 2.x and removed the `moviepy.editor` namespace (see [here](https://zulko.github.io/moviepy/getting_started/updating_to_v2.html)), breaking the `Video.encode` method. 
Fixing by either migrating to moviepy 2.x or pinning the earlier version.

Version info:
NixOS 24.05
Python 3.11.10
wandb 0.18.7
moviepy 2.1.1


Functions to edit:
wandb/sdk/data_types/video.py:Video.encode

Patch:
diff --git a/wandb/sdk/data_types/video.py b/wandb/sdk/data_types/video.py
index 54e338ef2a5..41310640d6f 100644
--- a/wandb/sdk/data_types/video.py
+++ b/wandb/sdk/data_types/video.py
@@ -138,10 +138,21 @@ def __init__(
             self.encode(fps=fps)
 
     def encode(self, fps: int = 4) -> None:
-        mpy = util.get_module(
-            "moviepy.editor",
-            required='wandb.Video requires moviepy when passing raw data.  Install with "pip install wandb[media]"',
-        )
+        # Try to import ImageSequenceClip from the appropriate MoviePy module
+        mpy = None
+        try:
+            # Attempt to load moviepy.editor for MoviePy < 2.0
+            mpy = util.get_module(
+                "moviepy.editor",
+                required='wandb.Video requires moviepy when passing raw data. Install with "pip install wandb[media]"',
+            )
+        except wandb.Error:
+            # Fallback to moviepy for MoviePy >= 2.0
+            mpy = util.get_module(
+                "moviepy",
+                required='wandb.Video requires moviepy when passing raw data. Install with "pip install wandb[media]"',
+            )
+
         tensor = self._prepare_video(self.data)
         _, self._height, self._width, self._channels = tensor.shape  # type: ignore
Repository: speechbrain/speechbrain
Issue category: Bug Report

Syntax Bug in Librispeech Whisper Recipe
### Describe the bug

These bugs listed below are related to whisper specifically following this [recipe](recipes/LibriSpeech/ASR/transformer/train_with_whisper.py)
1) line 228 in dataio_prepare, hparams is a dictionary so `hasattr(hparams, "normalized_transcripts")` does not work as intended.

2) line 50. I've gotten some rounding issues for some batches where the .long() rounds down rather than to the nearest int. (i.e. 12.998 gets rounded down to 12, excluding the last token).

### Expected behaviour

1) just change syntax to check keys in dictionary
2) use torch.round() to ensure proper mask computation

### To Reproduce

_No response_

### Environment Details

_No response_

### Relevant Log Output

_No response_

### Additional Context

_No response_


Functions to edit:
recipes/LibriSpeech/ASR/transformer/train_with_whisper.py:dataio_prepare

Patch:
diff --git a/recipes/LibriSpeech/ASR/transformer/train_with_whisper.py b/recipes/LibriSpeech/ASR/transformer/train_with_whisper.py
index 5c65a49682..90e0d118d3 100644
--- a/recipes/LibriSpeech/ASR/transformer/train_with_whisper.py
+++ b/recipes/LibriSpeech/ASR/transformer/train_with_whisper.py
@@ -107,7 +107,6 @@ def compute_objectives(self, predictions, batch, stage):
             target_words = self.tokenizer.batch_decode(
                 target_words, skip_special_tokens=True
             )
-
             if hasattr(self.hparams, "normalized_transcripts"):
 
                 if hasattr(self.tokenizer, "normalize"):
@@ -237,7 +236,10 @@ def audio_pipeline(wav):
         "wrd", "tokens_list", "tokens_bos", "tokens_eos", "tokens"
     )
     def text_pipeline(wrd):
-        if "normalized_transcripts" in hparams:
+        if (
+            "normalized_transcripts" in hparams
+            and hparams["normalized_transcripts"]
+        ):
             wrd = tokenizer.normalize(wrd)
         yield wrd
         tokens_list = tokenizer.encode(wrd, add_special_tokens=False)
Repository: ultralytics/ultralytics
Issue category: Performance Issue

Significant mAP Drop When Using Bottom-Right Padding Instead of Center Padding in YOLOv8 Training
### Search before asking

- [X] I have searched the Ultralytics YOLO [issues](https://github.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) and found no similar questions.


### Question

Hi, I'm training a YOLOv8 model on the same dataset, but noticed a significant difference in mAP when changing the padding strategy.

    When using center padding (default), the mAP@50 after the first epoch is around 0.88.
    When using bottom-right padding instead, the mAP@50 drops to 0.0001.

I ensured that:

    The same data augmentation and other settings were used in both cases.

However, the bottom-right padding leads to poor performance. What could be causing such a drastic performance drop? Is it related to padding affecting feature distribution, anchor design, or augmentation strategies? Any suggestions for improving performance in this case would be appreciated!

Thanks!
I changed "center=True" to "center=False",augment.py line1500
![2024-11-23 16-09-01 的屏幕截图](https://github.com/user-attachments/assets/b2c6c27d-2518-45cf-819b-40e6e6de87ce)
![2024-11-23 16-09-40 的屏幕截图](https://github.com/user-attachments/assets/fa10d8b8-2a61-4212-b709-2c213133bac4)
![2024-11-23 16-09-29 的屏幕截图](https://github.com/user-attachments/assets/2b2c9fd2-f53d-47ca-977f-7db6cd00f1c8)


### Additional

_No response_


Functions to edit:
ultralytics/data/augment.py:LetterBox.__call__

Patch:
diff --git a/ultralytics/data/augment.py b/ultralytics/data/augment.py
index d092e3c3703..bd821de28de 100644
--- a/ultralytics/data/augment.py
+++ b/ultralytics/data/augment.py
@@ -1591,7 +1591,7 @@ def __call__(self, labels=None, image=None):
             labels["ratio_pad"] = (labels["ratio_pad"], (left, top))  # for evaluation
 
         if len(labels):
-            labels = self._update_labels(labels, ratio, dw, dh)
+            labels = self._update_labels(labels, ratio, left, top)
             labels["img"] = img
             labels["resized_shape"] = new_shape
             return labels