mteb/LocBenchRR huggingface dataset:
bigquery: json_value transpilation gives incorrect result or fails due to escaping
noticed via sqlmesh, which recently updated `sqlglot (25.19.0 -> 25.31.4)`.  

We have an expression like `select json_value('{"fu bar": 42}', "$.fu bar")` which runs correctly on bigquery yielding 42.   Previously this was transpiled unchanged, but now results in an incorrect selection (note the added `.`s):

```
>>> sqlglot.__version__
'25.31.4'
>>> print(sqlglot.transpile("""select json_value('{"fu bar": 42}', "$.fu bar")""", read="bigquery", write="bigquery")[0])
SELECT json_value('{"fu bar": 42}', '$.fu.bar')
```
This query now yields `null` instead of 42 in bigquery.

The space-containing-key can be escaped in bigquery with double-quotes for [json_value](https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_value) which is apparently different from the bracketed escaping used by [json_extract](https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_extract)... 🤯    So this also works successfully in bigquery: `SELECT json_value('{"fu bar": 42}', '$."fu bar"')`.

But it now gets transpiled to sql which throws an error, namely `Invalid token in JSONPath at: ['fu bar']`:

```
>>> print(sqlglot.transpile("""SELECT json_value('{"fu bar": 42}', '$."fu bar"')""", read="bigquery", write="bigquery")[0])
SELECT json_value('{"fu bar": 42}', '$[\'fu bar\']')
```

a workaround is apparently to use the deprecated json_extract[_scalar] functions.  i.e. the query `SELECT json_extract('{"fu bar": 42}', '$[\'fu bar\']')` works correctly and is transpiled unchanged:

```
>>> print(sqlglot.transpile("""SELECT json_extract('{"fu bar": 42}', '$[\\'fu bar\\']')""", read="bigquery", write="bigquery")[0])
SELECT json_extract('{"fu bar": 42}', '$[\'fu bar\']')
```
`arg-type` error duck typing a `TypedDict` with `NotRequired` field
**Bug Report**

[mypy play url](https://mypy-play.net/?mypy=latest&python=3.12&gist=e6a8b78acddafd1ad10e81364e8e9ab5)

it seems that mypy doesn't "match" a `NotRequired` field with a normal one when duck typing 2 different typed dict:

Let's say that I have a function `foo` that expect a `Small` TypedDict as parameter

```python
class Small(TypedDict):
    a: NotRequired[str]

def foo(small: Small) -> None: ...
```

In this `Small` TypedDict the field `a` is marked as `NotRequired`.

Elsewere I have another `Big` TypedDict with 2 fields `a`, and `b`, both required.

```python
class Big(TypedDict):
    a: str
    b: str
```

but if I try to pass a `Big` dict instance to my `foo` function, mypy mark it as an error:
`main.py:21: error: Argument 1 to "foo" has incompatible type "Big"; expected "Small"  [arg-type]`

If I change the type of `Big.a` to a `NotRequired[str]`, mypy is happy, however mypy should allow the original definition, as a "normal" field should be treated as a stricter, "smaller" version of a not required one
Converting from `numpy.float32(float('inf'))` throws
sympy==1.13.3
numpy==2.1.3
python 3.10.15

```python
import numpy
import sympy
sympy.Float(np.float32(float('inf')))
```
thows with:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../lib/python3.10/site-packages/sympy/core/numbers.py", line 805, in __new__
    num = _convert_numpy_types(num)
  File ".../lib/python3.10/site-packages/sympy/core/sympify.py", line 93, in _convert_numpy_types
    p, q = a.as_integer_ratio()
OverflowError: cannot convert Infinity to integer ratio
```
Unable to extract code block in HTML page
When I try to extract the content from a webpage using ```docling```,  I found it cannot extract **code blocks** in the webpage.

# Reproduce steps

HTML URL: https://requests.readthedocs.io/en/latest/user/quickstart/
 
```python
from docling.document_converter import DocumentConverter

converter = DocumentConverter()
result = converter.convert('https://requests.readthedocs.io/en/latest/user/quickstart/')
print(result.document.export_to_markdown())
````
The code blocks in the following picture cannot be extracted in the result markdown:
<img width="754" alt="image" src="https://github.com/user-attachments/assets/0175ddce-7516-4786-bdc7-95c3e830fad2">


The result markdown of this part in the above picture is :

```markdown
## Make a Request¶

Making a request with Requests is very simple.

Begin by importing the Requests module:

Now, let’s try to get a webpage. For this example, let’s get GitHub’s public
timeline:

Now, we have a Response object called r. We can
get all the information we need from this object.

Requests’ simple API means that all forms of HTTP request are as obvious. For
example, this is how you make an HTTP POST request:

Nice, right? What about the other HTTP request types: PUT, DELETE, HEAD and
OPTIONS? These are all just as simple:

That’s all well and good, but it’s also only the start of what Requests can
do.

```
ENH: increase verbosity on error
### Feature Type

- [ ] Adding new functionality to pandas

- [X] Changing existing functionality in pandas

- [ ] Removing existing functionality in pandas


### Problem Description

On a specific type error the error causing type is not logged in the error

### Feature Description

By replacing:
`raise AttributeError("Can only use .str accessor with string values!")`
with
`raise AttributeError(f"Can only use .str accessor with string values! Inferred dType: {inferred_dtype}")`
the problem would be solved

Details can be found in [here](https://github.com/pandas-dev/pandas/pull/59649/files)

### Alternative Solutions

Use a debugger and set a break point

### Additional Context

_No response_
Wrong result for transpiling `OVER (ORDER BY .. )` from `trino` to `bigquery` 
**Fully reproducible code snippet**
It can be reproduced by the following code:
```python
import sqlglot

sql = """
WITH t1 as (
  select 1 f1, 2 f2 union all select 2 f1, 4 f2 union all select 3 f1, 6 f2
)
select sum(f1) over (order by f2) from t1;
"""
result = sqlglot.transpile(sql, read="trino", write="bigquery")[0]
print(result)
# the output is
# WITH t1 AS (SELECT 1 AS f1, 2 AS f2 UNION ALL SELECT 2 AS f1, 4 AS f2 UNION ALL SELECT 3 AS f1, 6 AS f2)
# SELECT SUM(f1) OVER (ORDER BY f2 NULLS LAST) FROM t1
```
This SQL isn't valid for BigQuery. It will get the error message from BigQuery:
```
NULLS LAST not supported with ascending sort order in RANGE clauses of analytic functions.
```
It seems that `NULLS LAST` shouldn't be added in the `OVER` clause.

If I don't assign the `read` dialect, it works well.
```python
import sqlglot

sql = """
WITH t1 as (
  select 1 f1, 2 f2 union all select 2 f1, 4 f2 union all select 3 f1, 6 f2
)
select sum(f1) over (order by f2) from t1;
"""
result = sqlglot.transpile(sql, read=None, write="bigquery")[0]
print(result)
# WITH t1 AS (SELECT 1 AS f1, 2 AS f2 UNION ALL SELECT 2 AS f1, 4 AS f2 UNION ALL SELECT 3 AS f1, 6 AS f2)
# SELECT SUM(f1) OVER (ORDER BY f2) FROM t1
```

**Official Documentation**
[Window function syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls#syntax)
[help wanted]: add sliding window support for flashinfer 
### Anything you want to discuss about vllm.

flashinfer already supports sliding window in https://github.com/flashinfer-ai/flashinfer/issues/159 , and we should update our code and pass sliding window to flashinfer , to remove this restriction: 

https://github.com/vllm-project/vllm/blob/5f8d8075f957d5376b2f1cc451e35a2a757e95a5/vllm/attention/backends/flashinfer.py#L739-L740

### Before submitting a new issue...

- [X] Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the [documentation page](https://docs.vllm.ai/en/latest/), which can answer lots of frequently asked questions.
Template system: escape() calls in get_exception_info() should be removed
Description
	 
​Here there are some calls to escape()
They shouldn't be there: escaping happens in templates for non-safe strings anyway, so there's no need.
And there _is_ a drawback: as an example, the Python Sentry SDK ​copies this info, but because it gets sent over the wire (as a JSON string) the information that this has already been escaped is lost, and on the receiving end it is escaped again.
This means that on the server-side ​the Error-tracking, in my case Bugsink will show doubly escaped html code snippets. This looks something like this:
&lt;p class=&quot;relative text-slate-600 text-base md:text-xl mb-4 md:mb-5&quot;&gt; 
Removing the calls to escape simply solves this. Which makes sense: calling escape is simply not the responsibility of this piece of code, it should just stay marked as unsafe and be escape at the edges (on rendering).
Remove unidist specific workaround in `.from_pandas()`
Since unidist 0.6.0 (modin-project/unidist#409) it now always copy the input data, so the workaround can be removed
https://github.com/modin-project/modin/blob/01c529cf06cfaf412b5725f41c81a5f914b44b95/modin/core/dataframe/pandas/partitioning/partition_manager.py#L872-L880
Rework support for comma separated values config
- flake8 config has comma separated string value that can't be properly parsed and requires https://nitpick.readthedocs.io/en/latest/nitpick_section.html#comma-separated-values
- We prefer `.flake8` config over `setup.cfg` for clarity and nitpick has implemented `comma-separated-values` feature by hardcoding support only for `setup.cfg` in files section schema. This wasn't mentioned in the documentation and caused failure when trying to configure `.flake8` style
- The implementation is the inverse of how nitpick files section config should be done. A list of files should be listed per config e.g. `absent`, `present`, `comma_separated_values` instead of using hardcoded filename i.e. `[nitpick.files."setup.cfg"]` ref: https://nitpick.readthedocs.io/en/latest/nitpick_section.html#files-that-should-exist and https://nitpick.readthedocs.io/en/latest/nitpick_section.html#files-that-should-be-deleted
add load_lora_weights to  pipeline_stable_diffusion_3_img2img.py
**Is your feature request related to a problem? Please describe.*"
Yes, there is no effective way to load lora weights with SD3

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...].
I can't get LoRa weights to load despite the fact there is a thorough and easy way to train them

**Describe the solution you'd like.**
the function load_lora_weights() should be added to pipeline_stable_diffusion_3_img2img.py

**Describe alternatives you've considered.**
A clear and concise description of any alternative solutions or features you've considered.
Any sort of work around using another form of loader or model merging etc.

**Additional context.**
Add any other context or screenshots about the feature request here.
https://huggingface.co/Mujeeb603/SD3-medium-Geometry-Diagrams-Lora-1
Some segment has a 1 second shifted after PR #856
appreciate your hard work

---

audio (2 minutes): [01.aac.zip](https://github.com/user-attachments/files/17751633/01.aac.zip)

The correct SRT result (using commit fbcf58b, which is before the huge PR #856): [01.old.srt.zip](https://github.com/user-attachments/files/17751733/01.old.srt.zip)

The wrong SRT result (using latest commit 85e61ea): [01.new.srt.zip](https://github.com/user-attachments/files/17751755/01.new.srt.zip)

---

I am **not** using the batch version

```python
model = faster_whisper.WhisperModel(
    model_size_or_path='large-v2',
    device='cuda',
    cpu_threads=4,
)
model.transcribe(
    audio=audio,
    language=None,
    task='transcribe',
    vad_filter=False,
    initial_prompt=None,
    word_timestamps=True,
    repetition_penalty=1.0,
)
```

script from this project https://github.com/heimoshuiyu/whisper-fastapi

---

![image](https://github.com/user-attachments/assets/d679ce1b-8771-4310-aadd-ef5c8ab7f886)

some segments on the left (wrong) has 1 second mismatch (shift +1s) than the right (correct)

---

I also test on the commit of RP #856 (eb839023), which is worse

result SRT: 
[01.eb839023.srt.zip](https://github.com/user-attachments/files/17752205/01.eb839023.srt.zip)

![image](https://github.com/user-attachments/assets/cd958dfb-fb15-4b08-ac4a-0e66f7cd0f3d)

left: commit eb839023 PR #856
middle: latest commit 85e61ea
right: commit fbcf58b
Prowler scan stuck on cloudtrail_threat_detection checks
### Steps to Reproduce

Command: prowler aws --log-level DEBUG. 
Cloud provider: aws
Environment: SecurityAudit and ReadOnlyAccess levels to a single organization. Trying to run it using the security audit credentials. 
Error: Program seems to hang up on cloudtrail_threat_detection_enumeration and cloudtrail_threat_detection_privilege_escalation tests

### Expected behavior

I entered my credentials and started the scan and it worked for a while until test 81 (cloudtrail_threat_detection_enumeration). I thought it was just getting hung up on that one test so i used the -e flag and targeted that test, then it started getting hung up on the cloudtrail_threat_detection_privilege_escalation. I've let it run for 15 minutes and it keeps getting stuck each time.

### Actual Result with Screenshots or Logs

![image](https://github.com/user-attachments/assets/e542e3e2-3459-4ba3-b692-971f87694d94)


### How did you install Prowler?

From pip package (pip install prowler)

### Environment Resource

7. Workstation

### OS used

Ubutnu WSL

### Prowler version

Prowler 4.6.0

### Pip version

pip 24.0

### Context

First time using tool. Tried to read documentation / other issue requests to help fix issue myself.
One Case Per Sample for FASTQ 
<!--
Filled in by the Product Owner or the Stakeholders.
-->

As a user assigned to the pipeline FASTQ,
I want one case per sample,
So that the order-view in Trailblazer would tell me if a sample failed on amount of reads.

# Acceptance Criteria
<!--
Filled in by the Product Owner or the Stakeholders.
-->


- [ ] For each sample, generate one case in any ticket that includes an app-tag related to FASTQ delivery.

...

# Notes
<!--
Filled in by the Product Owner or the Stakeholders.
-->

- Additional information.
- Dependencies.
- Related user stories.

# Implementation plan
<!--
This section will be populated by the developers during their technical refinements.
-->

- [ ] Work item 1
- [ ] Work item 2
Doc string of `operation` in ParameterExpression._apply_operation
It says
```
operation: One of operator.{add,sub,mul,truediv}.
```
But the function is already called also with other operations, for example `pow` in `ParameterExpression.__pow__`.
`==`-based narrowing of `Optional`
1. Mypy's current behaviour:

```python
x: int | None
if x == None:
    x  # "Union[builtins.int, None]"
else:
    x  # "Union[builtins.int, None]"
```

2. Pyright's current behaviour:

```python
x: int | None
if x == None:
    x  # x is None
else:
    x  # x is int
```

3. I think the ideal solution would be:

```python
x: int | None
if x == None:
    x  # "Union[builtins.int, None]"
else:
    x  # "builtins.int"
```

This [Mypy code comment](https://github.com/python/mypy/blob/3b00002acdf098e7241df8f2e1843f8b8260b168/mypy/checker.py#L6278-L6280) seems to favour solution 2.

I am asking because if Mypy would follow solution 2 or 3, `in`-based narrowing of optional types could be implemented more consistently.   

Related pull requests: #15760 #17154 #17044.
Upgrade Python Version
              **thought**: It looks like 3.10 is the next python to EOL. Can this run on python 3.12 or 3.13 which are still getting support and not just security fixes?

https://devguide.python.org/versions/

_Originally posted by @steveoh in https://github.com/agrc/masquerade/pull/219#discussion_r1868240956_
            
Reverse Geocoding
Currently, this is not implemented. Short term, we should probably remove it from this list of capabilities: https://github.com/agrc/masquerade/blob/c9a9bffd73d11834b86c2cfe4856f589eab5c799/src/masquerade/main.py#L132

And then in the long term, we should probably implement it. @mhchou tried to use it today for something.
Translate address grids to actual cities as returned by the web api
Masquerade could be updated to fix incorrect cities returned by the web API service. It would take a secondary request(s) to OpenSGID to get the city/county.

Ref: https://github.com/agrc/api.mapserv.utah.gov/issues/245
Deprecate using `xlrd` engine in favor of openpyxl
xlrd is unmaintained and the previous maintainer has asked us to move towards openpyxl. xlrd works now, but *might* have some issues when Python 3.9 or later gets released and changes some elements of the XML parser, as default usage right now throws a `PendingDeprecationWarning`

Considering that I think we need to deprecate using `xlrd` in favor of `openpyxl`. We might not necessarily need to remove the former and it does offer some functionality the latter doesn't (namely reading `.xls` files) but should at the very least start moving towards the latter
Alert to ambiguous name match
Re: isledecomp/isle#1192

When matching a comment annotation by its name[^1], we pick whichever entry is available first based on insertion order. [^2] This allows us to match multiple entries that have the same name. For example: `_Construct`. The order of match _attempts_ depends on the order we read each file; this is what we get when using `os.walk` to iterate on the code directory.

A function with different arguments or a different return type (including const vs. non-const) will appear to have the same name in the output from cvdump. The current way to distinguish between these functions is to match using the symbol name instead, which includes all of this information while not being very human-readable.

We can mitigate this problem in a few different ways:

1. For functions with the same name, display an alternate "unique name" that includes the distinguishing characteristics. This will help asm sanitize show a diff where there is one.
2. If we detect that a name match has multiple possible results, alert the user to what was matched. For example, a message like:
    ```
    Match at 0x10049160 is ambiguous, we chose: ?erase@?$_Tree@PAULegoPathCtrlEdge@@PAU1@U_Kfn@?$set@PAULegoPathCtrlEdge@@ULegoPathCtrlEdgeCompare@@V?$allocator@PAULegoPathCtrlEdge@@@@@@ULegoPathCtrlEdgeCompare@@V?$allocator@PAULegoPathCtrlEdge@@@@@@QAE?AViterator@1@V21@@Z
    ```
3. Sort match annotations by the original address so that matching does not depend on file or directory names.

[^1]: Unless we determine that the name given is a symbol, which means (for C++ symbols in MSVC) that "?" is the first character.
[^2]: Right now this is equivalent to recomp address because we sort the dict in `CvdumpAnalysis` before inserting to the database.
Dangling job occurs when job_id contains the character ":"
Hi,

After updating to v2.0.0, job_id cannot contain the character ":"; otherwise, the job is never picked up or started by a worker.

I'll investigate this over the next few days, but I suspect that [PR #1964](https://github.com/rq/rq/pull/1964) might restrict the job_id format. We may need to add validation when creating jobs to address this.
Post processing performance can be improved
## Problem

Images generated in batches pay a performance penalty in the post-processing step of the diffusion pipeline.

A lot of calls to image_processor.denormalize are made instead of batching the computation.

### Suggested Improvements

#### Using multiplication instead of division

This is a freebie, numerically the same but much cheaper on all compute platforms

```python
def denormalize(images: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:
    return (images * 0.5 + 0.5).clamp(0, 1)
```

#### Adding Fast path in an all-or-nothing denormalization scenario

Instead of calling `torch.stack` on a batch where all (or none) of the images require denormalization, apply the operation on the full tensor directly

```python
def post_process(...):
    # ... 
    if do_denormalize is None:
        return self.denormalize(images) if self.config.do_normalize else images
    # ...
```

#### Denormalize first, stack later

Invoking the `denormalize` call multiple times incurs a lot of overhead on the compute pipeline, more so than "wasting" compute of denormalizing everything and calling `torch.stack` on the results.

```python
def post_process(...):
    # ...
    denormalized = self.denormalize(image)
    image = torch.stack([
        denormalized[i] if do_denormalize[i] else image[i] for i in range(image.shape[0])
    ])
    # ...
```

## Benchmarks

https://colab.research.google.com/drive/1H1SKUlyEZduUeU50V8SVEZgmFrdl6Ego?usp=sharing

These were ran in a Colab T4 instance on CUDA. The batch is of the shape `[1024,3,512,512]` and dtype `fp16`. Further combinations can be made if requested.

### Baseline

<img width="745" alt="image" src="https://github.com/user-attachments/assets/3bd79c84-bce0-47f4-aae9-5ba86b77a2de">

### Suggested Improvements

<img width="729" alt="image" src="https://github.com/user-attachments/assets/3c739ea0-71e6-467d-b36a-e07e42593003">
Still not supporting for ChatGLM3 maybe
### System Info

trl    0.12.1
transformers      4.46.2

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder
- [X] My own task or dataset (give details below)

### Reproduction

```python
from transformers import AutoTokenizer, AutoModel, BertTokenizer, BertForSequenceClassification, Trainer, TrainingArguments, AutoModelForCausalLM
import torch
import transformers
from peft import PeftModel
from trl import PPOTrainer, PPOConfig, AutoModelForCausalLMWithValueHead

model = AutoModelForCausalLMWithValueHead.from_pretrained("THUDM/chatglm3-6b-128k", trust_remote_code=True)
```

outputs:
```
Traceback (most recent call last):
  File "/home/fjy/folders/ERNIE2.0/finetune_chatglm6b.py", line 16, in <module>
    model = AutoModelForCausalLMWithValueHead.from_pretrained("THUDM/chatglm3-6b-128k", trust_remote_code=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fjy/anaconda3/envs/env/lib/python3.12/site-packages/trl/models/modeling_base.py", line 233, in from_pretrained
    model = cls(pretrained_model, **trl_model_args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fjy/anaconda3/envs/env/lib/python3.12/site-packages/trl/models/modeling_value_head.py", line 107, in __init__
    raise ValueError("The model does not have a language model head, please use a model that has one.")
ValueError: The model does not have a language model head, please use a model that has one.
```


### Expected behavior

It's shown that ChatGLM3 doesnot have a language model head. Appearly it has. 

### Checklist

- [X] I have checked that my issue isn't already filed (see [open issues](https://github.com/huggingface/trl/issues?q=is%3Aissue))
- [X] I have included my system information
- [X] Any code provided is minimal, complete, and reproducible ([more on MREs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks))
- [X] Any code provided is properly formatted in code blocks, (no screenshot, [more on code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks))
- [X] Any traceback provided is complete