mteb/LocBenchRR huggingface dataset:
`ByteSize.human_readable` with an optional separator (e.g. whitespace) between value and unit
### Initial Checks

- [X] I have searched Google & GitHub for similar requests and couldn't find anything
- [X] I have read and followed [the docs](https://docs.pydantic.dev) and still think this feature is missing

### Description

Currently, the return value of `ByteSize.human_readable` does not have any separator between the value and unit.

```python
>>> size = ByteSize(12345678)
>>> size.human_readable()
'11.8MiB'
```

It looks a little bit weird to me, and I think it could be better if there's a space separating the value and unit. Though there are many ways to handle this need, it may be a better idea to provide an optional argument with this method? For example:

```python
ByteSize.human_readable(decimal: bool = False, separator: bool = False) -> str
```

When I switch the `separator` on:

```python
>>> size = ByteSize(12345678)
>>> size.human_readable(separator=True)
'11.8 MiB'
```

It's probably easy to be implemented, so I can create a PR to implement this feature if it will be acceptable.

What do you think about it?

### Affected Components

- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
- [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)
- [ ] [Data serialization](https://docs.pydantic.dev/concepts/serialization/) - `.model_dump()` and `.model_dump_json()`
- [ ] [JSON Schema](https://docs.pydantic.dev/concepts/json_schema/)
- [ ] [Dataclasses](https://docs.pydantic.dev/concepts/dataclasses/)
- [ ] [Model Config](https://docs.pydantic.dev/concepts/config/)
- [X] [Field Types](https://docs.pydantic.dev/api/types/) - adding or changing a particular data type
- [ ] [Function validation decorator](https://docs.pydantic.dev/concepts/validation_decorator/)
- [ ] [Generic Models](https://docs.pydantic.dev/concepts/models/#generic-models)
- [ ] [Other Model behaviour](https://docs.pydantic.dev/concepts/models/) - `model_construct()`, pickling, private attributes, ORM mode
- [ ] [Plugins](https://docs.pydantic.dev/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.
Support more callables in `PlainSerializer`
### Initial Checks

- [X] I have searched Google & GitHub for similar requests and couldn't find anything
- [X] I have read and followed [the docs](https://docs.pydantic.dev) and still think this feature is missing

### Description

As [noticed](https://github.com/pydantic/pydantic/pull/9450#issuecomment-2120916182) in https://github.com/pydantic/pydantic/pull/9450, the callable passed into `PlainSerializer`/`WrapSerializer` can optionally take a `serializer` and `info` argument. However, callables with arguments with default values will not be accepted, even though it could work fine:

```python
from typing import Annotated

from pydantic import BaseModel, PlainSerializer

def my_callable(value, unrelated_arg = None, other_unrelated_arg = 1, even_more = "a"): ...

class Model(BaseModel):
    foo: Annotated[int, PlainSerializer(my_callable)]
```

This currently fails as `my_callable` has `4` positional arguments, and Pydantic expects at most 3 (for the wrap serializer). One real use case is with `str`, having the signature `<Signature (object=<no value>, encoding=<no value>, errors=<no value>)>`.

I think it is reasonable to assume that any argument with default values should not be counted by `count_positional_params`. After all, if you need the `info` argument there's no reason to have a default value. I'll try to come up with a solution which will hopefully not break existing use cases.

### Affected Components

- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
- [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)
- [ ] [Data serialization](https://docs.pydantic.dev/concepts/serialization/) - `.model_dump()` and `.model_dump_json()`
- [ ] [JSON Schema](https://docs.pydantic.dev/concepts/json_schema/)
- [ ] [Dataclasses](https://docs.pydantic.dev/concepts/dataclasses/)
- [ ] [Model Config](https://docs.pydantic.dev/concepts/config/)
- [ ] [Field Types](https://docs.pydantic.dev/api/types/) - adding or changing a particular data type
- [ ] [Function validation decorator](https://docs.pydantic.dev/concepts/validation_decorator/)
- [ ] [Generic Models](https://docs.pydantic.dev/concepts/models/#generic-models)
- [X] [Other Model behaviour](https://docs.pydantic.dev/concepts/models/) - `model_construct()`, pickling, private attributes, ORM mode
- [ ] [Plugins](https://docs.pydantic.dev/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.
Improve utils.text.Truncator &co to use a full HTML parser.
Description
		
(last modified by Carlton Gibson)		
Original description:
I'm using Truncator.chars to truncate wikis, and it sometimes truncates in the middle of &quot; entities, resulting in '<p>some text &qu</p>'
This is a limitation of the regex based implementation (which has had security issues, and presents an intractable problem). 
Better to move to use a HTML parser, for Truncate, and strip_tags(), via html5lib and bleach.
Improve utils.text.Truncator &co to use a full HTML parser.
Description
		
(last modified by Carlton Gibson)		
Original description:
I'm using Truncator.chars to truncate wikis, and it sometimes truncates in the middle of &quot; entities, resulting in '<p>some text &qu</p>'
This is a limitation of the regex based implementation (which has had security issues, and presents an intractable problem). 
Better to move to use a HTML parser, for Truncate, and strip_tags(), via html5lib and bleach.
DOC: outdated information about adaptive sampling in plot() function
I have recently learned (https://github.com/mgeier/python-audio/issues/4) that SymPy doesn't use adaptive sampling by default anymore.

Therefore, this documentation is outdated:

https://github.com/sympy/sympy/blob/a7719e719c0b43ec1dbb964b01b57c4f3783be8d/sympy/plotting/plot.py#L304-L305

https://github.com/sympy/sympy/blob/a7719e719c0b43ec1dbb964b01b57c4f3783be8d/sympy/plotting/plot.py#L380-L389
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.
user customized style for SegmentedButton not wrapped
### Duplicate Check

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

### Describe the bug

user cutomized style is not working in SegmentButton
![image](https://github.com/user-attachments/assets/7c5f6f9c-9c29-43b5-a4d4-87f52d0d420d)


### Code sample

<details open><summary>Code</summary>

```python
import flet as ft


def main(page: ft.Page):
    page.window.width = 800
    page.window.height = 500
    page.window.alignment = ft.alignment.center

    def handle_change(e):
        print("on_change data : " + str(e.data))

    def on_error(e) -> None:
        print("error: ", e.data)

    page.on_error = on_error

    style = ft.ButtonStyle(shape=ft.RoundedRectangleBorder(radius=5))
    page.add(
        ft.SegmentedButton(
            on_change=handle_change,
            selected_icon=ft.Icon(ft.icons.ONETWOTHREE),
            selected={"1", "4"},
            allow_multiple_selection=True,
            style=style,
            segments=[
                ft.Segment(
                    value="1",
                    label=ft.Text("1"),
                    icon=ft.Icon(ft.icons.LOOKS_ONE),
                ),
                ft.Segment(
                    value="2",
                    label=ft.Text("2"),
                    icon=ft.Icon(ft.icons.LOOKS_TWO),
                ),
                ft.Segment(
                    value="3",
                    label=ft.Text("3"),
                    icon=ft.Icon(ft.icons.LOOKS_3),
                ),
                ft.Segment(
                    value="4",
                    label=ft.Text("4"),
                    icon=ft.Icon(ft.icons.LOOKS_4),
                ),
            ],
        )
    )


ft.app(main)

```

</details>


### To reproduce

pass customized style to SegmentedButton (style has customized attribute value, e.g. `style = ft.ButtonStyle(shape=ft.RoundedRectangleBorder(radius=5))`)

### Expected behavior

SegmentedButton has RoundedRectangleBorder

### Screenshots / Videos

<details open>
<summary>Captures</summary>

[Upload media here]
![Code_2eBKOg7ESB](https://github.com/user-attachments/assets/e8389abd-23e6-4328-89b4-0ebbb9ac0200)

</details>


### Operating System

Windows

### Operating system details

Windows 11 24H2

### Flet version

0.24.1

### Regression

No, it isn't

### Suggestions

_No response_

### Logs

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


### Additional details

_No response_
Optimize the VISTA3D latency
**Is your feature request related to a problem? Please describe.**
The VISTA3D is a very brilliant model for everything segmentation in a medical image. However it suffers a slowdown [issue](https://github.com/Project-MONAI/model-zoo/tree/dev/models/vista3d/docs#inference-gpu-benchmarks) when running on a GPU platform, which takes minutes to run a single inference. Therefore, a lower latency version of the VISTA3D model should be a user-friendly model and gain more usage.

**Describe the solution you'd like**
1. Update the VISTA3D bundle parameters to achieve a better latency.
2. Update the VISTA3D network to solve some latency bottlenecks.
3. Try to accelerate the bundle with acceleration tools like TensorRT.

**Additional context**
Some analyzation has already done in [this PR](https://github.com/Project-MONAI/model-zoo/pull/671).
The corresponding MONAI core code change is included [here](https://github.com/binliunls/MONAI/pull/1)
Clarify django.urls.set_urlconf scoping behaviour
Description
	 
django.urls.set_urlconf ​docstring mentions setting the urlconf for the current thread. However, this is backed by asgiref.local.Local, which is supposed to provide scoping features related to asyncio tasks as well. This becomes relevant, for example, when doing multi-tenancy with more than one urlconf and trying to call django.urls.reverse in an ASGI application.
I have been trying to infer what is the expected behaviour in async Django code by following the current implementation, and I found that asgiref.local.Local behaviour has changed over time (see ​https://github.com/django/asgiref/issues/473).
I assume that using asgiref.local.Local instead of threading.local hints at an intention is to give set_urlconf/get_urlconf meaningful semantics for Channels consumers or ASGI applications.
Whether the intention is to isolate set_urlconf/get_urlconf across different asyncio tasks or to only support isolation between threads, I suppose it would be useful if their behaviour was documented also for the case of asyncio code, especially given they back django.urls.reverse.
[cheroot==8.1.0 regression] Significant performance drop
❓ **I'm submitting a ...**
- [X] 🐞 bug report
- [ ] 🐣 feature request
- [ ] ❓ question about the decisions made in the repository

🐞 **Describe the bug. What is the current behavior?**

This more a note than a bug report:
I run some benchmark against my project ([WsgiDAV](https://github.com/mar10/wsgidav)] and found that there is a drastical drop in performance between cheroot versions 8.0.0 and 8.1.0.

The test uses a homegrown tool ([stressor](https://github.com/mar10/stressor)) that runs a test script ([see here](https://github.com/mar10/wsgidav/blob/master/tests/stressor/test_rw.yaml)):

- 10 users in parallel
  - GET a common file 
  - PUT another file (one per user)
  - GET that file
- Running for 30 seconds

Benchmarks show 11k activities per 30 seconds until v8.0.
Starting with cheroot 8.1 this drops to 2.9k activities per 30 sec.

I also tried with gevent as backend, and it delivered 12.4k activities.

Please note that these results may be due to poor implementation on my tools, but all I changed was WSGI server behind WsgiDAV, so I thought I let you know.
 

💡 **To Reproduce**

See https://github.com/mar10/wsgidav/blob/master/tests/stressor/results.md

If you are interested, I can provide more details.

Cheers
Martin
Calling infer_auto_device_map() with max_memory=None throws an error in version 1.2.0
### System Info

```Shell
accelerate==1.2.0
```

### Reproduction

Bug is from this commit:
https://github.com/huggingface/accelerate/commit/d7b1b368e9f484a18636a71600566b757d5cf87e

`max_memory` initialization was moved into `_init_infer_auto_device_map`, which does not return the `max_memory` value.

So if max_memory=None is passed to `infer_auto_device_map` (the default value), then it will still be None at line 1415:
https://github.com/huggingface/accelerate/blob/cb8b7c637a8588668c52bd306f9b2828f69d9585/src/accelerate/utils/modeling.py#L1415

Leading to error: TypeError: 'NoneType' object is not subscriptable

### Expected behavior

max_memory=None when passed to `infer_auto_device_map` does not throw an error.
Pairwise distance scalability
Raising this issue to revisit the scalability of our pairwise distance calculation and whether it's worth returning to a map-reduce style implementation that would allow chunking along both dimensions.

In the work that @aktech is doing on early scalability demonstrations (#345) there are some memory usage difficulties emerging. @aktech is I believe trying to run a pairwise distance computation over data from Ag1000G phase 2, using all SNPs and samples from a single chromosome arm. This is of the order ~20 million variants and ~1000 samples. With the current implementation, it is hard to get this to run on systems with average memory/CPU ratios, below 12G/CPU. My understanding is that, essentially, this is because the pairwise distance implementation currently does not support chunking along the variants dimension, and so to reduce memory footprint you need short chunks along the samples dimension. Depending on how the input data have been chunked natively, this may be suboptimal, i.e., you may need to run the computation with sample chunks that are (much) shorter than the native storage.

If this is correct, then it raises two questions for discussion.

First, should we revisit the map-reduce implementation of pairwise distance? This would allow chunking on both samples and variants dimensions, and so could naturally make use of whatever the underlying chunking of the data in storage, without large memory footprint. 

Secondly, do we ever really need to run pairwise distance on arrays that are large in the variants dimension? I.e., do we care about scaling this up to large numbers of variants? xref https://github.com/pystatgen/sgkit/pull/306#issuecomment-714654217
Normalization layer fails to broadcast scalar mean and variance
Normalization layer errors out for scalar mean and variance arguments. The documentation states that these arguments will be broadcast to the necessary size and the examples include scalars, but instead the source code seems to only reshape them (see [here](https://github.com/keras-team/keras/blob/v3.7.0/keras/src/layers/preprocessing/normalization.py#L193)).

I'm using Python 3.12.1 and Keras 3.6.0.

```
>>> in1 = keras.Input(shape=(16, 16, 3))
>>> normLayer = keras.layers.Normalization(mean=0.1, variance=0.05)
>>> out1 = normLayer(in1)
I tensorflow/core/framework/local_rendezvous.cc:405] Local rendezvous is aborting with status: INVALID_ARGUMENT: Input to reshape is a tensor with 1 values, but the requested shape has 3
```
ErrorList.copy() reverts to default renderer
Description
	 
When an ErrorList is copied, it loses track of any custom renderer, reverting to the default one. Practically, this means custom styles are not applied to non-field errors when rendering a whole form.
For example, I wrote a custom renderer that swaps some templates like so:
from django import forms
from django.forms.renderers import TemplatesSetting
from django.template.exceptions import TemplateDoesNotExist
class CustomRenderer(TemplatesSetting):
	def get_template(self, template_name):
		if template_name.startswith("django/forms/"):
			# Load our custom version from "custom/forms/" if it exists
			our_template = f"custom/{template_name.removeprefix('django/')}"
			try:
				return super().get_template(our_template)
			except TemplateDoesNotExist:
				pass
		return super().get_template(template_name)
class MyForm(forms.Form):
	default_renderer = CustomRenderer()
The custom error list template uses some CSS utility classes from Tailwind, like text-red-600:
{% if errors %}<ul class="text-red-600">{% for error in errors %}<li>{{ error }}</li>{% endfor %}</ul>{% endif %}
Creating a form with a non-field error and rendering those errors uses the custom template:
In [1]: from example.forms import MyForm
 ...:
 ...: form = MyForm({})
 ...: form.full_clean()
 ...: form.add_error(None, "Test error")
In [2]: form.non_field_errors().render()
Out[2]: '<ul class="text-red-600"><li>Test error</li></ul>'
But rendering the whole form reverts to the default template, from the default renderer:
In [3]: form.render()
Out[3]: '<ul class="errorlist nonfield"><li>Test error</li></ul>\n\n <div></div>'
This occurs because the ErrorList is copied in Form.get_context():
​https://github.com/django/django/blob/1860a1afc9ac20750f932e8e0a94b32d096f2848/django/forms/forms.py#L225
The fix would be to also copy over renderer in ErrorList.copy():
​https://github.com/django/django/blob/1860a1afc9ac20750f932e8e0a94b32d096f2848/django/forms/utils.py#L165
I think this has probably been an issue ever since a custom renderer became possible in #31026.
Specific language for easyOCR
### Question
Well, this library perform pretty good tasks, but for some cases, the languages is incorrect (in my Vietnamese language)
Just want to ask `How can I specific language parser to make result more concise?`
False positive on `wafv2_webacl_with_rules` when when ACL provisioned with AWS Firewall Manager
### Steps to Reproduce

1. Depoloy ACL with AWS Firewall Manager including any rule group
2. Run prowler against AWS account where ACL is provisioned with Firewall Manager
3. Prowler will add that ACL as failed because the list of managed rules is empty, but it has AWS Firewall Manager provisioned rules


### Expected behavior

it's expected that ACL is managed centrally and may not have rules added directly

### Actual Result with Screenshots or Logs

![image](https://github.com/user-attachments/assets/bc4da90e-caf6-4748-9fd1-1cef8e4e41f4)

![image](https://github.com/user-attachments/assets/54640d49-5e58-44c6-9801-3c1bd1fe9343)



### How did you install Prowler?

From pip package (pip install prowler)

### Environment Resource

4. EKS

### OS used

1. Amazon Linux 2023

### Prowler version

5.0.0

### Pip version

24.0

### Context

_No response_
DoIP functional addressing responses not associated with preceding request
### Brief description

When sending a request over DoIP using functional addressing, the DoIP source addesses of the ECU responses will be different from the target address of the preceding request, as the ECUs respond from their actual address instead of the functional "broadcast address" used in the request. `DoIP.hashret` effectively filters out these "mismatched" packets, so when using `DoIPSocket.sr(...)` with a functional target address, no responses will ever be returned.

### Scapy version

2.6.0

### Python version

3.11

### Operating system

Linux 6.1.21-v8+

### Additional environment information

_No response_

### How to reproduce

```python3
from scapy.contrib.automotive.doip import *
from scapy.contrib.automotive.uds import *

ip="169.254.207.236"
sock = DoIPSocket(ip)

ans, unans = sock.sr(DoIP(payload_type=0x8001, source_address=0xe80, target_address=0xe400) / UDS() / UDS_TP(), multi=True, timeout=2)
```

### Actual result

```console
INFO: Routing activation successful! Target address set to: 0x3107
Begin emission:
Finished sending 1 packets.
.........
Received 9 packets, got 0 answers, remaining 1 packets
```

### Expected result

```console
INFO: Routing activation successful! Target address set to: 0x3107
Begin emission:
Finished sending 1 packets.
.********
Received 9 packets, got 8 answers, remaining 0 packets
```

This result was obtained by monkey-patching DoIP.hashret to ignore the addresses, based on a config setting, analogous to how scapy handles IP broadcast traffic with the `conf.checkIPaddr` setting (see below)

### Related resources

Just for reference, this is the monkey-patch I'm using at the moment to enable me to run functional addressing requests (by disabling the setting whenever I need it):

```python3
from scapy.config import conf
from scapy.contrib.automotive.doip import DoIP

def hashret_patched(self):
    if self.payload_type in [0x8001, 0x8002, 0x8003]:
        if conf.checkDoIPaddr:
            return bytes(self)[:2] + struct.pack(
                "H", self.target_address ^ self.source_address)
        return bytes(self)[:2]
    return bytes(self)[:2]

conf.checkDoIPaddr = True
DoIP.hashret = hashret_patched
```

But there is maybe/probably a better way.
(🐞) Wrong column number for "Invalid location for ParamSpec"
```py
from typing import List, ParamSpec

P = ParamSpec('P')

def foo(x: List[P]) -> None: ...
```
```
test.py:5:13: error: Invalid location for ParamSpec "P"  [misc]
test.py:5:18: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P, int]'
Found 2 errors in 1 file (checked 1 source file)
```

Column 13 is the `L` in `List`. The error and the note don't match up.

Notice that the error and the note specify different column numbers.

An internal error with the correct column number is generated, but is removed as a duplicate.
[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