mteb/LocBenchRR huggingface dataset:
`move_masks` only supports movement in positive direction
If you compare the code of `move_masks`, `move_detections` and `move_oriented_boxes`, you'll find that only mask code restricts offset direction:

```python
    if offset[0] < 0 or offset[1] < 0:
        raise ValueError(f"Offset values must be non-negative integers. Got: {offset}")
```

It should be possible to move masks in either direction, even if it results in cropping.

To complete this:
- [ ] Change the code so masks can be moved with negative offset
- [ ] Create a unit test suite for `move_masks`

---

It would help us immensely and speed up the review process if you could create a [Colab](https://colab.research.google.com/) showcasing the changes, but for this task it is optional. You may use the [Starter Template](https://colab.research.google.com/drive/1rin7WrS-UvVIe-_Gfxmu-yVslGphOq89?usp=sharing).
Share vocabulary objects between projects
Currently, each AnnifProject creates its own vocabulary (AnnifVocabulary object, which wraps a SubjectIndex) even though in reality many projects may use the same vocabulary - which is now even more likely since vocabularies are multilingual (#600). This leads to unnecessary use of RAM and also CPU when the subject index has to be recreated many times.

Instead, the vocabularies could be moved under AnnifRegistry which currently only stores projects. The vocabularies could be loaded lazily as needed using a get_vocab method, similar to the current get_vocab method in annif.vocab.
Share vocabulary objects between projects
Currently, each AnnifProject creates its own vocabulary (AnnifVocabulary object, which wraps a SubjectIndex) even though in reality many projects may use the same vocabulary - which is now even more likely since vocabularies are multilingual (#600). This leads to unnecessary use of RAM and also CPU when the subject index has to be recreated many times.

Instead, the vocabularies could be moved under AnnifRegistry which currently only stores projects. The vocabularies could be loaded lazily as needed using a get_vocab method, similar to the current get_vocab method in annif.vocab.
[Core] Avoid metrics log noise when idle

1a789ae7 [Core] Avoid metrics log noise when idle

commit 1a789ae76695bca801b55c9d4531e5438a3378c4
Author: Russell Bryant <rbryant@redhat.com>
Date:   Thu Sep 26 20:56:41 2024 +0000

    [Core] Avoid metrics log noise when idle
    
    Prior to this change, there was always a log message every 10 seconds,
    even when the system is idle. The noise when the metrics are all zeros
    doesn't seem very interesting, so this change makes it so the log
    message is only emitted while active. It will log a message whenever
    metrics are non-zero, or when returning to idle from non-idle.
    Repeated messages during idle now go to DEBUG instead of INFO.
    
    Signed-off-by: Russell Bryant <rbryant@redhat.com>
Improve non-first {% extends %} error message
Description
	 
Currently if you put {% extends %} after another tag, the error looks like:
TemplateSyntaxError: <ExtendsNode: extends 'base.html'> must be the first tag in the template.
ExtendsNode is a leaked internal detail. Showing its repr() is a bit confusing, especially for a beginner programmer.
The message would be clearer if it showed the actual text of the tag:
TemplateSyntaxError: {% extends 'base.html' %} must be the first tag in the template.
Switch to manual JWT verification of ID token from IdP
- Related to: https://github.com/neurobagel/api/issues/385

Even for a trial implementation, we can no longer rely on Google as our IdP because we have discovered that the "testing" mode of our Google service API does not restrict login to the app (namely, access to the basic user info provided by default in the ID token) based on test user list as originally expected. See https://issuetracker.google.com/issues/211370835#comment68 for more info on this behaviour.

So, to be able to employ any kind of "user list" to restrict queries for now, we need to use a different IdP and more generic ID token verification method.

- [x] use PyJWT library (update requirements.txt)
- [x] obtain certificate URL for Google to send a request for public keys (fetched automatically with `google_auth` package)
- [x] decode and validate claims of JWT manually
- [x] remove google_auth from dependencies?
Missing procedure call in line 417
Line 417 of the file "nltk/app/wordnet_app.py" should look like this:

    elif synset.pos() == wn.ADJ or synset.pos() == wn.ADJ_SAT:

but instead looks like this:

    elif synset.pos() == wn.ADJ or synset.pos == wn.ADJ_SAT:

which will generate this error (complete with spelling mistake) :

    "Unhandles synset POS type: s"
`edge_node_connectivity` unnecessarily constructed when slicing
When doing `Grid.isel()` with `n_face` or `n_node`, the `edge_node_connectivity` is constructed when the grid does not currently have any edges defined, which is not necessary and impacts the execution time. See also #1138
xarray.rolling().construct() and sliding_window_view chunking behaviour
Using ``.rolling().construct()`` will inject new dimensions into an array with ``sliding_window_view`` under the hood. NumPy is clever about this by arranging things to be a view of the underlying array and thus not increasing the memory footprint. Problems are starting to show up if you call a follow up operation that requires a copy, std is an example.

It uses construct under the hood but the aggregation requires a copy to handle NaNs, which makes memory blow up. A better example is something like

```
arr = xr.DataArray(da.random.random((2000, 2000, 2000), chunks=(200, 200, 200)), dims=['x','y', 'z'])
arr = arr.rolling({"x": 10, "y": 20}).construct({"x": "dim1", "y": "dim2"})
```

construct increase the chunk size by a factor of 200 to 14GB , things are still fine because we haven't performed a copy yet. But almost every subsequent operation will require copying the data, so things will go south real quick

```
arr.isel(dim1=[1, 3, 5, 7, 9])
```

This reduces chunk size to 7GB, but we will make a copy and memory will blow up

How to deal with this?

My suggestions would be to split up the other chunks in ``sliding_window_view`` to keep chunk sizes the same after construct, this would slow us down for cases where we indeed don't make a copy, but I think this is sufficiently rare in the general construct case.

Construct is also used internally for reductions, splitting up chunks unnecessarily there is not great since the reducer actually gets us back to our initial chunk size and the splitting would lead to a highly fragmented array. My suggestion here is to expose an option for xarray to turn the rechunk off, if xarray is sure that memory won't blow up.

Thoughts @dcherian for this?
Potential bug in repaint?
https://github.com/huggingface/diffusers/blob/dac623b59f52c58383a39207d5147aa34e0047cd/src/diffusers/schedulers/scheduling_repaint.py#L322

According to line5 of algorithm 1 in the paper, the second part in line 322 should remove the `**0.5`?
thanks!
Cloning of Sequential models w. input_tensors argument fails
Cloning a Sequential models layers fails if using the input_tensors argument.

Minimum reproducible example:

```
import keras

model = keras.models.Sequential()
model.add(keras.layers.Input(shape=(7, 3)))
model.add(keras.layers.Conv1D(2, 2, padding="same"))

input_tensor = model.inputs[0]
new_model = keras.models.clone_model(model, input_tensors=input_tensor)
```

Traceback:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/workspaces/keras/keras/src/models/cloning.py", line 159, in clone_model
    return _clone_sequential_model(
  File "/workspaces/keras/keras/src/models/cloning.py", line 301, in _clone_sequential_model
    if input_tensors:
  File "/workspaces/keras/keras/src/backend/common/keras_tensor.py", line 172, in __bool__
    raise TypeError("A symbolic KerasTensor cannot be used as a boolean.")
TypeError: A symbolic KerasTensor cannot be used as a boolean.
```

Still fails even after manually changing `if input_tensors:` to `if input_tensors is not None:` in keras/src/models/cloning.py:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/workspaces/keras/keras/src/models/cloning.py", line 159, in clone_model
    return _clone_sequential_model(
  File "/workspaces/keras/keras/src/models/cloning.py", line 313, in _clone_sequential_model
    inputs = Input(tensor=input_tensors, name=input_name)
  File "/workspaces/keras/keras/src/layers/core/input_layer.py", line 154, in Input
    layer = InputLayer(
  File "/workspaces/keras/keras/src/layers/core/input_layer.py", line 44, in __init__
    raise ValueError("You must pass a `shape` argument.")
ValueError: You must pass a `shape` argument.
```
[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.
The google authenticator's calls to check groups is done sync, can it be made async?
Quickly written, I can fill this in in more detail later.
Optimizing assert_all_finite check
Have done some work to come up with a Cython implementation of [`_assert_all_finite`]( https://github.com/scikit-learn/scikit-learn/blob/6d15840432c08b2c628babe62d7bef6d6a01fcf6/sklearn/utils/validation.py#L40 ) as the current check is rather slow. Have come up with [this implementation]( https://gist.github.com/jakirkham/8bafcec842e92641885c91f79ef7f44f ). This simply uses the C `isfinite` (or `isinf` for `allow_nan=True`) function in a tight loop; returning `False` whenever `isfinite` returns `False` and returning `True` otherwise. As such it has a very small, constant memory overhead.

For smallish data (0-8000 element `float64` arrays), this is comparable to the naive NumPy implementation in time and faster than the current scikit-learn implementation. Should add that the Cython implementation uses considerably less memory than either implementation. For large sized arrays, scikit-learn's performance improves to ~2x faster than the NumPy or Cython implementation. Expect this is mostly due to how the caches are utilized. So this can be improved further.

Would be interested in getting some feedback about whether such a contribution would be interesting to scikit-learn. If so, can investigate further improvements to this implementation.
shape hint arguments in lax numpy functions to enable compilation
Several functions in `jax.numpy` are not `jit`-compilable for shape-level arguments. Specifically, we can't decide their output shape from input shapes alone.

We've given [`jax.numpy.bincount`](https://github.com/google/jax/blob/db8f66d508d536e1312291ba966905ddf910582d/jax/numpy/lax_numpy.py#L1309) an optional `length` argument that's not in standard numpy because it determines the output shape (when it is static/concrete). It's not uncommon for callers to have this information on hand.

We could consider extending other functions similarly to accept optional shape hints:
- [x] argwhere (#6915)
- [x] compress (#21090)
- [x] extract (#21090)
- [x] nonzero (#6501 #7592)
- [x] flatnonzero (#6913)
- [x] 1-argument where (#6910)
- [x] repeat (#3670)
- [x] unique (#6912, #8121, #8186)
- [x] setdiff1d (#8144)
- [x] union1d (#6930, #8143)
- [x] intersect1d (#22979)
- [x] setxor1d (#23020)
What is the meaning of `missing-text`?
### Question

When exporting docx documents as text, I always seem to get some `missing-text` in the output. I was not able to find this string in the project repository, `python-docx`, or documentation. 

Snippet:

```py
doc_converter = DocumentConverter(allowed_formats=[InputFormat.DOCX])
conv_res = doc_converter.convert(input_doc_path)
print(conv_res.document.export_to_text())
```

Output:

```py
<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>

<missing-text>
```

Documents:

- Complete failure, all text is "missing-text": [doc.docx](https://github.com/user-attachments/files/17983955/doc.docx)
- Partial failure, only some of the text is "missing-text": [doc2.docx](https://github.com/user-attachments/files/17983962/doc2.docx)

Both documents are public. 

What causes `missing-text`? What should be my mental model for it when processing documents? 

Thanks!
Incorrect references.special_chars when using pivoted column
### Search before asking

- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.


### What Happened

When linting valid Snowflake code, following violation is raised incorrectly.

### Expected Behaviour

Since we only select from invalid named column, not creating invalid named column, violation shouldn't be raised.

### Observed Behaviour

```
== [bug2.sql] FAIL                                                                                                                                                                                                           
L:   4 | P:   5 | RF05 | Do not use special characters in identifiers.
                       | [references.special_chars]
L:   5 | P:   5 | RF05 | Do not use special characters in identifiers.
                       | [references.special_chars]
```

### How to reproduce

```sql
SELECT
    COL1,
    COL2,
    "'PIVOTED1'" AS PIVOTED1,
    "'PIVOTED2'" AS PIVOTED2
FROM TBL
PIVOT (
    MAX(VAL)
    FOR COL IN ('PIVOTED1', 'PIVOTED2')
)

```

### Dialect

snowflake

### Version

sqlfluff, version 2.3.4
python 3.10.12

### Configuration

N/A

### Are you willing to work on and submit a PR to address the issue?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)
GET /v1/server/isInsurance
```
  /v1/server/isInsurance:
    get:
      tags:
        - lookUpServer
      summary: "Check whether a TI-Messenger server name represents an insurance."
      parameters:
        - in: query
          name: serverName
          description: "The server name to query."
          required: true
          schema:
            type: string
      responses:
        "200":
          description: "OK"
          content:
            application/json:
              schema:
                type: object
                required:
                  - isInsurance
                properties:
                  isInsurance:
                    type: boolean
                    description: "`true` if the server name represents an insurance or `false` otherwise."
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
```

This endpoint will return the information if a server is an insurance server or not. This information is stored on the federationlist. Currently there is no test environment for the federation list and also the schema provided by gematik ([link](https://github.com/gematik/api-vzd/blob/main/src/schema/FederationList.json)) is not updated. To be able to implement this, we need to use the openapi spec, there they have the new definition ([link](https://github.com/gematik/api-vzd/blob/05a042ca67d49d231042576234aee940a12a6a52/src/openapi/I_VZD_TIM_Provider_Services.yaml#L510-L548)).

This endpoint should only be enabled in tim-pro mode.
[WIP] ENH Multilabel confusion matrix
This PR considers a helper for multilabel/set-wise evaluation metrics such as precision, recall, fbeta, jaccard (#10083), fall-out, miss rate and specificity (#5516). It also incorporates suggestions from #8126 regarding efficiency of multilabel true positives calculation (but does not optimise for micro-average, perhaps unfortunately). Unlike `confusion_matrix` it is optimised for the multilabel case, but also handles multiclass problems like they are handled in `precision_recall_fscore_support`: as binarised OvR problems.

It benefits us by simplifying the `precision_recall_fscore_support` and future jaccard implementations greatly, and allows for further refactors between them. It also benefits us by making a clear calculation of sufficient statistics (although perhaps more statistics than necessary) from which standard metrics are a simple calculation: it makes the code less mystifying. In that sense, this is mostly a cosmetic change, but it provides users with the ability to easily generalise the P/R/F/S implementation to related metrics.

TODO:
* [x] implement `multilabel_confusion_matrix` and use it in `precision_recall_fscore_support` as an indirect form of testing
* [x] fix up edge cases that fail tests
* [ ] benchmark multiclass implementation against incumbent P/R/F/S
* [ ] benchmark multilabel implementation with [benchmarks/bench_multilabel_metrics.py](https://github.com/scikit-learn/scikit-learn/blob/master/benchmarks/bench_multilabel_metrics.py) extended to consider non-micro averaging, sample_weight and perhaps other cases
* [ ] directly test `multilabel_confusion_matrix`
* [ ] document under model_evaluation.rst
* [ ] document how to calculate fall-out, miss-rate, sensitivity, specificity from `multilabel_confusion_matrix`
* [ ] refactor jaccard similarity implementation once #10083 is merged

If another contributor would like to take this on, I would welcome it. I have marked this as Easy because the code and technical knowledge involved is not hard, but it will take a bit of work, and clarity of understanding.
Add multi-label support to the confusion matrix metric
Currently the `confusion_matrix` support binary and multi-class classification, but not multi-label data yet.
Validate that DESIGN_MATRIX is correct upon initialization
The validation should include checking whether the design sheet part handles `NUM_REALIZATIONS` correctly, which means whether the all the design values combined with default sheet will handle the total number of realizations. 

- `REAL` column (if provided) should contain iens; which yield active realizations and thus filling the active realizations edit box. 
- in default sheet if the parameter is already present in the design sheet the default sheet entry is ignored otherwise it is appended as a new column with a singular default value.
- make sure that the parameter names are unique

~~Blocked by: https://github.com/equinor/ert/issues/8902~~
[RandomSunFlare] Add transparency to RandomSunFlare
![image](https://github.com/user-attachments/assets/2c1a7dec-77db-4150-86df-d484da5e2e31)

Sunflare obscures the object
ENH: add reduce op (and groupby reduce) support to EA
after #21160 
Reductions for ExtensionArray
Creeping up to this in https://github.com/pandas-dev/pandas/pull/22345

A few questions

1. What should this look like for EA authors? What helpers can / should we provide?
2. How does this affect users? Specifically, assuming IntegerArray implements reductions, what's the dtype here?

```python
In [11]: df = pd.DataFrame({"A": ['a', 'b', 'a'], "B": pd.core.arrays.IntegerArray([1, 2, 3])})

In [12]: df.groupby("A").B.min().dtype
```

Is it `int64`, or should we preserve `Int64`?

We can also discuss transforms ( cumulative operations like cumsum, maybe things like `.shift`).
ENH: add reduce op (and groupby reduce) support to EA
after #21160 
Reductions for ExtensionArray
Creeping up to this in https://github.com/pandas-dev/pandas/pull/22345

A few questions

1. What should this look like for EA authors? What helpers can / should we provide?
2. How does this affect users? Specifically, assuming IntegerArray implements reductions, what's the dtype here?

```python
In [11]: df = pd.DataFrame({"A": ['a', 'b', 'a'], "B": pd.core.arrays.IntegerArray([1, 2, 3])})

In [12]: df.groupby("A").B.min().dtype
```

Is it `int64`, or should we preserve `Int64`?

We can also discuss transforms ( cumulative operations like cumsum, maybe things like `.shift`).