czlll/Loc-Bench_V0.1 huggingface dataset:
Repository: huggingface/diffusers
Issue category: Feature Request

Allow configuring `shift=` for SD3 dynamically
**Is your feature request related to a problem? Please describe.**
Allow passing `shift=` per inference call (like timesteps) on the pipeline, for flow matching scheduler, or allow `set_shift()` etc. on the scheduler. This seems to be the key to getting good results with SD3 https://x.com/bfitzgerald242/status/1801018438120341911


Functions to edit:
src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py:FlowMatchEulerDiscreteScheduler.__init__
src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py:FlowMatchEulerDiscreteScheduler
src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py:FlowMatchEulerDiscreteScheduler.set_timesteps
Functions added: src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py:FlowMatchEulerDiscreteScheduler.shift
src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py:FlowMatchEulerDiscreteScheduler.set_shift

Patch:
diff --git a/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py b/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py
index 6ddd9ac23009..c7474d56c708 100644
--- a/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py
+++ b/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py
@@ -99,10 +99,19 @@ def __init__(
         self._step_index = None
         self._begin_index = None
 
+        self._shift = shift
+
         self.sigmas = sigmas.to("cpu")  # to avoid too much CPU/GPU communication
         self.sigma_min = self.sigmas[-1].item()
         self.sigma_max = self.sigmas[0].item()
 
+    @property
+    def shift(self):
+        """
+        The value used for shifting.
+        """
+        return self._shift
+
     @property
     def step_index(self):
         """
@@ -128,6 +137,9 @@ def set_begin_index(self, begin_index: int = 0):
         """
         self._begin_index = begin_index
 
+    def set_shift(self, shift: float):
+        self._shift = shift
+
     def scale_noise(
         self,
         sample: torch.FloatTensor,
@@ -236,7 +248,7 @@ def set_timesteps(
         if self.config.use_dynamic_shifting:
             sigmas = self.time_shift(mu, 1.0, sigmas)
         else:
-            sigmas = self.config.shift * sigmas / (1 + (self.config.shift - 1) * sigmas)
+            sigmas = self.shift * sigmas / (1 + (self.shift - 1) * sigmas)
 
         if self.config.shift_terminal:
             sigmas = self.stretch_shift_to_terminal(sigmas)
Repository: huggingface/diffusers
Issue category: Feature Request

Make `time_embed_dim` of `UNet2DModel` changeable
**Is your feature request related to a problem? Please describe.**
I want to change the `time_embed_dim` of `UNet2DModel`, but it is hard coded as `time_embed_dim = block_out_channels[0] * 4` in the `__init__` function.

**Describe the solution you'd like.**
Make `time_embedding_dim` a parameter of the `__init__` function, with the default value of `None`. Use `time_embed_dim = time_embedding_dim or block_out_channels[0] * 4` in the function body.

**Describe alternatives you've considered.**
N/A.

**Additional context.**
The same thing in `UNet2DConditionModel` can be changed via the parameter `time_embedding_dim` of its `__init__` function.


Functions to edit:
src/diffusers/models/unets/unet_2d.py:UNet2DModel.__init__

Patch:
diff --git a/src/diffusers/models/unets/unet_2d.py b/src/diffusers/models/unets/unet_2d.py
index 5972505f2897..d05af686dede 100644
--- a/src/diffusers/models/unets/unet_2d.py
+++ b/src/diffusers/models/unets/unet_2d.py
@@ -97,6 +97,7 @@ def __init__(
         out_channels: int = 3,
         center_input_sample: bool = False,
         time_embedding_type: str = "positional",
+        time_embedding_dim: Optional[int] = None,
         freq_shift: int = 0,
         flip_sin_to_cos: bool = True,
         down_block_types: Tuple[str, ...] = ("DownBlock2D", "AttnDownBlock2D", "AttnDownBlock2D", "AttnDownBlock2D"),
@@ -122,7 +123,7 @@ def __init__(
         super().__init__()
 
         self.sample_size = sample_size
-        time_embed_dim = block_out_channels[0] * 4
+        time_embed_dim = time_embedding_dim or block_out_channels[0] * 4
 
         # Check inputs
         if len(down_block_types) != len(up_block_types):
Repository: huggingface/diffusers
Issue category: Bug Report

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!


Functions to edit:
src/diffusers/schedulers/scheduling_repaint.py:RePaintScheduler.step

Patch:
diff --git a/src/diffusers/schedulers/scheduling_repaint.py b/src/diffusers/schedulers/scheduling_repaint.py
index 97665bb5277b..ae953cfb966b 100644
--- a/src/diffusers/schedulers/scheduling_repaint.py
+++ b/src/diffusers/schedulers/scheduling_repaint.py
@@ -319,7 +319,7 @@ def step(
         prev_unknown_part = alpha_prod_t_prev**0.5 * pred_original_sample + pred_sample_direction + variance
 
         # 8. Algorithm 1 Line 5 https://arxiv.org/pdf/2201.09865.pdf
-        prev_known_part = (alpha_prod_t_prev**0.5) * original_image + ((1 - alpha_prod_t_prev) ** 0.5) * noise
+        prev_known_part = (alpha_prod_t_prev**0.5) * original_image + (1 - alpha_prod_t_prev) * noise
 
         # 9. Algorithm 1 Line 8 https://arxiv.org/pdf/2201.09865.pdf
         pred_prev_sample = mask * prev_known_part + (1.0 - mask) * prev_unknown_part
Repository: huggingface/diffusers
Issue category: Bug Report

Some bugs in FLUX pipeline
### Describe the bug

1. missing self.theta in get_1d_rotary_pos_embed:
https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/embeddings.py#L961-L963
2. if prompt_embeds is None, pooled_prompt_embeds will never be computed:
https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/flux/pipeline_flux.py#L348-L363

### Reproduction

.

### Logs

_No response_

### System Info

.

### Who can help?

@yiyixuxu @sayakpaul @DN6 @asomoza


Functions to edit:
src/diffusers/models/embeddings.py:FluxPosEmbed.forward

Patch:
diff --git a/src/diffusers/models/embeddings.py b/src/diffusers/models/embeddings.py
index 91451fa9aac2..8f8f1073da74 100644
--- a/src/diffusers/models/embeddings.py
+++ b/src/diffusers/models/embeddings.py
@@ -959,7 +959,12 @@ def forward(self, ids: torch.Tensor) -> torch.Tensor:
         freqs_dtype = torch.float32 if is_mps else torch.float64
         for i in range(n_axes):
             cos, sin = get_1d_rotary_pos_embed(
-                self.axes_dim[i], pos[:, i], repeat_interleave_real=True, use_real=True, freqs_dtype=freqs_dtype
+                self.axes_dim[i],
+                pos[:, i],
+                theta=self.theta,
+                repeat_interleave_real=True,
+                use_real=True,
+                freqs_dtype=freqs_dtype,
             )
             cos_out.append(cos)
             sin_out.append(sin)
Repository: huggingface/diffusers
Issue category: Bug Report

[BUG - STABLE DIFFUSION 3] Grey images generated
### Describe the bug

I'm running the SD3 model [stabilityai/stable-diffusion-3-medium](https://huggingface.co/stabilityai/stable-diffusion-3-medium) with the following settings:
- Height: 1024
- Width: 1024
- Inference steps: 50
- Guidance scale: 7
- Prompts length: 32 (using the same input prompt: "A men jumps from a high building")

The model generates 32 images, but half of them are grey.

### Reproduction

Reproduction code:

```
import os

os.environ['CUDA_VISIBLE_DEVICES'] = '7'

import torch
from diffusers import StableDiffusion3Pipeline

base_dir = os.path.join(os.path.dirname(__file__), '..', '..')

def run():
    input_prompts = ["A men jumps from a high building"] * 32
    img_save_dir = f'{base_dir}/data/test_generated_img'
    os.makedirs(f'{img_save_dir}', exist_ok=True)

    pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, cache_dir="/data0/tien/cache")
    pipe.to("cuda")

    torch.set_grad_enabled(False)
    images = pipe(
        prompt=input_prompts,
        negative_prompt="",
        height=1024,
        width=1024,
        num_inference_steps=50,
        guidance_scale=7.0
    ).images

    for j in range(len(input_prompts)):
        images[j].save(os.path.join(f'{img_save_dir}', f'{j}.jpg'))

    torch.cuda.empty_cache()
    
run()
```

### Logs

_No response_

### System Info
- Device: H100
- Driver Version: 550.127.05
- CUDA Version: 12.4
- Torch: 2.5.1+cu124
- OS: Ubuntu 22.04.3 LTS
- Python: 3.10.15
- diffusers: 0.31.0

### Who can help?

_No response_


Functions to edit:
src/diffusers/models/upsampling.py:Upsample2D.forward

Patch:
diff --git a/src/diffusers/models/upsampling.py b/src/diffusers/models/upsampling.py
index cf07e45b0c5c..af04ae4b93cf 100644
--- a/src/diffusers/models/upsampling.py
+++ b/src/diffusers/models/upsampling.py
@@ -165,6 +165,14 @@ def forward(self, hidden_states: torch.Tensor, output_size: Optional[int] = None
         # if `output_size` is passed we force the interpolation output
         # size and do not make use of `scale_factor=2`
         if self.interpolate:
+            # upsample_nearest_nhwc also fails when the number of output elements is large
+            # https://github.com/pytorch/pytorch/issues/141831
+            scale_factor = (
+                2 if output_size is None else max([f / s for f, s in zip(output_size, hidden_states.shape[-2:])])
+            )
+            if hidden_states.numel() * scale_factor > pow(2, 31):
+                hidden_states = hidden_states.contiguous()
+
             if output_size is None:
                 hidden_states = F.interpolate(hidden_states, scale_factor=2.0, mode="nearest")
             else:
Repository: huggingface/diffusers
Issue category: Bug Report

Replace shutil.copy with shutil.copyfile
shutil.copy copies permission bits which fails when the user who's running the script is trying to use a common cache that was generated by another user, even though the first user has read & write permissions over the cache (through Group permission for example). A real case scenario: submitting jobs on a GPU cluster accessed by multiple users with common cache directory to reduce disk and network usage.

https://github.com/huggingface/diffusers/blob/0d1d267b12e47b40b0e8f265339c76e0f45f8c49/src/diffusers/utils/dynamic_modules_utils.py#L328

Suggested solution: replace shutil.copy by shutil.copyfile which doesn't copy ownership.


Functions to edit:
src/diffusers/utils/dynamic_modules_utils.py:get_cached_module_file

Patch:
diff --git a/src/diffusers/utils/dynamic_modules_utils.py b/src/diffusers/utils/dynamic_modules_utils.py
index f0cf953924ad..50d9bbaac57c 100644
--- a/src/diffusers/utils/dynamic_modules_utils.py
+++ b/src/diffusers/utils/dynamic_modules_utils.py
@@ -325,7 +325,7 @@ def get_cached_module_file(
         # We always copy local files (we could hash the file to see if there was a change, and give them the name of
         # that hash, to only copy when there is a modification but it seems overkill for now).
         # The only reason we do the copy is to avoid putting too many folders in sys.path.
-        shutil.copy(resolved_module_file, submodule_path / module_file)
+        shutil.copyfile(resolved_module_file, submodule_path / module_file)
         for module_needed in modules_needed:
             if len(module_needed.split(".")) == 2:
                 module_needed = "/".join(module_needed.split("."))
@@ -333,7 +333,7 @@ def get_cached_module_file(
                 if not os.path.exists(submodule_path / module_folder):
                     os.makedirs(submodule_path / module_folder)
             module_needed = f"{module_needed}.py"
-            shutil.copy(os.path.join(pretrained_model_name_or_path, module_needed), submodule_path / module_needed)
+            shutil.copyfile(os.path.join(pretrained_model_name_or_path, module_needed), submodule_path / module_needed)
     else:
         # Get the commit hash
         # TODO: we will get this info in the etag soon, so retrieve it from there and not here.
@@ -350,7 +350,7 @@ def get_cached_module_file(
                 module_folder = module_file.split("/")[0]
                 if not os.path.exists(submodule_path / module_folder):
                     os.makedirs(submodule_path / module_folder)
-            shutil.copy(resolved_module_file, submodule_path / module_file)
+            shutil.copyfile(resolved_module_file, submodule_path / module_file)
 
         # Make sure we also have every file with relative
         for module_needed in modules_needed:
Repository: fortra/impacket
Issue category: Feature Request

SAM Dump for accounts without secrets
I realised that some defaults Windows accounts, like for example WDAGUtilityAccount, throw the following error:

![image](https://github.com/user-attachments/assets/cb6a1d68-d50a-4a0b-8689-41bf878a9ca2)

However there is no error here. WDAGUtilisatyAccount does not have a NT hash in the SAM database because this is a virtual account used to contain applications in a sandbox (for example browsers) and these featuers are not used on windows servers. Considering I never saw secretsdump failing in dumping SAM database, I believe it is possible to switch the following liens from impacket/impacket/examples/secretsdump.py:

```python
if userAccount['NTHashLength'] == 0:
    logging.error('SAM hashes extraction for user %s failed. The account doesn\'t have hash information.' % userName)
    continue
```

to 

```python
if userAccount['NTHashLength'] == 0:
    logging.debug('SAM hashes extraction for user %s failed. The account doesn\'t have hash information.' % userName)
    continue
```

That way most of tools using impacket secretsdump won't have a messed up output.

Let me know what you think about this :)


Functions to edit:
impacket/examples/secretsdump.py:SAMHashes.dump

Patch:
diff --git a/impacket/examples/secretsdump.py b/impacket/examples/secretsdump.py
index 43b776218..537c45dab 100644
--- a/impacket/examples/secretsdump.py
+++ b/impacket/examples/secretsdump.py
@@ -1432,7 +1432,7 @@ def dump(self):
             userName = V[userAccount['NameOffset']:userAccount['NameOffset']+userAccount['NameLength']].decode('utf-16le')
 
             if userAccount['NTHashLength'] == 0:
-                logging.error('SAM hashes extraction for user %s failed. The account doesn\'t have hash information.' % userName)
+                logging.debug('The account %s doesn\'t have hash information.' % userName)
                 continue
 
             encNTHash = b''
Repository: modin-project/modin
Issue category: Performance Issue

Avoid unnecessary length checks in `df.squeeze`
It is possible that when `axis=1` in squeeze we still check `len(self.index)`, which is never necessary when `axis=1`. Link to code here: https://github.com/modin-project/modin/blob/eac3c77baf456c7bd7e1e5fde81790a4ed3ebb27/modin/pandas/dataframe.py#L2074-L2084

This is an easy fix, also see https://github.com/snowflakedb/snowpark-python/pull/1767


Functions to edit:
modin/pandas/dataframe.py:DataFrame.squeeze

Patch:
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
index de96ea0ab26..2ce83913ebb 100644
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -2074,12 +2074,12 @@ def squeeze(
         Squeeze 1 dimensional axis objects into scalars.
         """
         axis = self._get_axis_number(axis) if axis is not None else None
-        if axis is None and (len(self.columns) == 1 or len(self.index) == 1):
+        if axis is None and (len(self.columns) == 1 or len(self) == 1):
             return Series(query_compiler=self._query_compiler).squeeze()
         if axis == 1 and len(self.columns) == 1:
             self._query_compiler._shape_hint = "column"
             return Series(query_compiler=self._query_compiler)
-        if axis == 0 and len(self.index) == 1:
+        if axis == 0 and len(self) == 1:
             qc = self.T._query_compiler
             qc._shape_hint = "column"
             return Series(query_compiler=qc)
Repository: ccxt/ccxt
Issue category: Bug Report

binance myLiquidations uninitialized before accessed
### Operating System

Ubuntu

### Programming Languages

Python

### CCXT Version

4.4.27

### Description

Got following error while watching binance websocket.

### Code



```
2024-11-26 05:56:31,267 - 875 - exchanges.binance - ERROR - 'NoneType' object does not support item assignment
Traceback (most recent call last):
  File "/home/sytd/test/src/exchanges/future_exchange_base.py", line 118, in watch_balances
    event = await self._exchange.watch_balance()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/pro/binance.py", line 2503, in watch_balance
    return await self.watch(url, messageHash, message, type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/async_support/base/ws/fast_client.py", line 27, in handler
    self.handle_message(message)
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/async_support/base/ws/aiohttp_client.py", line 34, in handle_message
    self.handle_text_or_binary_message(message.data)
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/async_support/base/ws/aiohttp_client.py", line 29, in handle_text_or_binary_message
    self.on_message_callback(self, decoded)
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/pro/binance.py", line 3966, in handle_message
    method(client, message)
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/pro/binance.py", line 3396, in handle_order_update
    self.handle_my_liquidation(client, message)
  File "/home/sytd/test/.venv/lib/python3.11/site-packages/ccxt/pro/binance.py", line 518, in handle_my_liquidation
    self.myLiquidations[symbol] = myLiquidations
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object does not support item assignment
```



Functions to edit:
python/ccxt/base/exchange.py:Exchange.__init__

Patch:
diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py
index 9b79354f89c5..66f8170154a4 100644
--- a/python/ccxt/base/exchange.py
+++ b/python/ccxt/base/exchange.py
@@ -382,6 +382,7 @@ def __init__(self, config={}):
         self.transactions = dict() if self.transactions is None else self.transactions
         self.ohlcvs = dict() if self.ohlcvs is None else self.ohlcvs
         self.liquidations = dict() if self.liquidations is None else self.liquidations
+        self.myLiquidations = dict() if self.myLiquidations is None else self.myLiquidations
         self.currencies = dict() if self.currencies is None else self.currencies
         self.options = self.get_default_options() if self.options is None else self.options  # Python does not allow to define properties in run-time with setattr
         self.decimal_to_precision = decimal_to_precision
Repository: Qiskit/qiskit
Issue category: Bug Report

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__`.


Functions to edit:
qiskit/circuit/parameterexpression.py:ParameterExpression._apply_operation

Patch:
diff --git a/qiskit/circuit/parameterexpression.py b/qiskit/circuit/parameterexpression.py
index fe786762c09..feaa0b772c7 100644
--- a/qiskit/circuit/parameterexpression.py
+++ b/qiskit/circuit/parameterexpression.py
@@ -340,7 +340,7 @@ def _apply_operation(
         either a constant or a second ParameterExpression.
 
         Args:
-            operation: One of operator.{add,sub,mul,truediv}.
+            operation: An operator, such as add, sub, mul, and truediv.
             other: The second argument to be used with self in operation.
             reflected: Optional - The default ordering is "self operator other".
                        If reflected is True, this is switched to "other operator self".
Repository: sktime/sktime
Issue category: Bug Report

[BUG] Croston cannot handle exogenous variables.
**Describe the bug**
Croston cannot handle exogenous variables, but is marked as if it can.

**To Reproduce**
Example returns the tag "ignores-exogeneous-X".

```python
from sktime.forecasting.croston import Croston

Croston.get_class_tag("ignores-exogeneous-X")
```

**Expected behavior**
The returned tag "ignores-exogeneous-X" should be True and not False.

**Versions**
0.30.1



Functions to edit:
sktime/forecasting/croston.py:Croston

Patch:
diff --git a/sktime/forecasting/croston.py b/sktime/forecasting/croston.py
index 4aee85f8c86..fe7956dc428 100644
--- a/sktime/forecasting/croston.py
+++ b/sktime/forecasting/croston.py
@@ -77,6 +77,7 @@ class Croston(BaseForecaster):
         # estimator type
         # --------------
         "requires-fh-in-fit": False,  # is forecasting horizon already required in fit?
+        "ignores-exogeneous-X": True,
     }
 
     def __init__(self, smoothing=0.1):
Repository: numpy/numpy
Issue category: Feature Request

DOC: Examples in docstrings – tracking issue
"Examples, more examples, and more detailed examples" is the recurrent theme in the feedback about the NumPy documentation we received via the 2020 and 2021 NumPy user surveys. 

If you come across a docstring where a function is missing an example or more/better examples are needed, please add a comment below.

**Re: the “sprintable” label** This could be a good activity for a sprint with new contributors as most of them are NumPy users. However, one doesn’t have to be a sprint participant to contribute to this initiative.




Functions to edit:
numpy/ctypeslib.py:as_array
numpy/ctypeslib.py:as_ctypes

Patch:
diff --git a/numpy/ctypeslib.py b/numpy/ctypeslib.py
index 370cdf224cdc..d11b9dcb43d3 100644
--- a/numpy/ctypeslib.py
+++ b/numpy/ctypeslib.py
@@ -527,6 +527,26 @@ def as_array(obj, shape=None):
 
         The shape parameter must be given if converting from a ctypes POINTER.
         The shape parameter is ignored if converting from a ctypes array
+
+        Examples
+        --------
+        Converting a ctypes integer array:
+
+        >>> import ctypes
+        >>> ctypes_array = (ctypes.c_int * 5)(0, 1, 2, 3, 4)
+        >>> np_array = np.ctypeslib.as_array(ctypes_array)
+        >>> np_array
+        array([0, 1, 2, 3, 4], dtype=int32)
+
+        Converting a ctypes POINTER:
+
+        >>> import ctypes
+        >>> buffer = (ctypes.c_int * 5)(0, 1, 2, 3, 4)
+        >>> pointer = ctypes.cast(buffer, ctypes.POINTER(ctypes.c_int))
+        >>> np_array = np.ctypeslib.as_array(pointer, (5,))
+        >>> np_array
+        array([0, 1, 2, 3, 4], dtype=int32)
+
         """
         if isinstance(obj, ctypes._Pointer):
             # convert pointers to an array of the desired shape
@@ -541,8 +561,31 @@ def as_array(obj, shape=None):
 
 
     def as_ctypes(obj):
-        """Create and return a ctypes object from a numpy array.  Actually
-        anything that exposes the __array_interface__ is accepted."""
+        """
+        Create and return a ctypes object from a numpy array.  Actually
+        anything that exposes the __array_interface__ is accepted.
+
+        Examples
+        --------
+        Create ctypes object from inferred int ``np.array``:
+
+        >>> inferred_int_array = np.array([1, 2, 3])
+        >>> c_int_array = np.ctypeslib.as_ctypes(inferred_int_array)
+        >>> type(c_int_array)
+        <class 'c_long_Array_3'>
+        >>> c_int_array[:]
+        [1, 2, 3]
+
+        Create ctypes object from explicit 8 bit unsigned int ``np.array`` :
+
+        >>> exp_int_array = np.array([1, 2, 3], dtype=np.uint8)
+        >>> c_int_array = np.ctypeslib.as_ctypes(exp_int_array)
+        >>> type(c_int_array)
+        <class 'c_ubyte_Array_3'>
+        >>> c_int_array[:]
+        [1, 2, 3]
+
+        """
         ai = obj.__array_interface__
         if ai["strides"]:
             raise TypeError("strided arrays not supported")
Repository: numpy/numpy
Issue category: Feature Request

DOC: types for numpy.delete's obj argument don't cover all possibilities
### Issue with current documentation:

The docstring for `numpy.delete` specifues the type of the `obj` parameter as:
> **obj : _slice, int or array of ints_**

It seem it can also be anything that can be cast as an array of ints, including e.g. an iterator like `range(0,4,2)` or list of ints like `[0,2,3]`. I confirmed this by looking in the source and I think this line is where anything that isn't a slice, int or bool is cast as a `numpy.array`:

https://github.com/numpy/numpy/blob/83bf22579b6eaa8113f6cff67b10fd9524965f23/numpy/lib/_function_base_impl.py#L5317

This type specification also doesn't mention that `obj` can be an array of booleans.

### Idea or request for content:

I'd open a PR but am not sure the best wording. I'm looking for something like

> **obj : _slice, int, array of bools or anything that can be cast as an array of ints_**

but that seems a bit verbose. Perhaps there's some NumPy jargon that's more succinct?


Functions to edit:
numpy/lib/_function_base_impl.py:delete

Patch:
diff --git a/numpy/lib/_function_base_impl.py b/numpy/lib/_function_base_impl.py
index 477c6a4f39a8..7a2c69bad0e6 100644
--- a/numpy/lib/_function_base_impl.py
+++ b/numpy/lib/_function_base_impl.py
@@ -5198,7 +5198,7 @@ def delete(arr, obj, axis=None):
     ----------
     arr : array_like
         Input array.
-    obj : slice, int or array of ints
+    obj : slice, int, array-like of ints or bools
         Indicate indices of sub-arrays to remove along the specified axis.
 
         .. versionchanged:: 1.19.0
Repository: vllm-project/vllm
Issue category: Feature Request

[Bug]:  Support Falcon Mamba 
### Your current environment

Does VLLM support  Falcon Mamba models? if not, when it will be supported 

### 🐛 Describe the bug

Does VLLM support  Falcon Mamba models? if not, when it will be supported 


Functions to edit:
vllm/engine/llm_engine.py:LLMEngine._get_stats

Patch:
diff --git a/vllm/engine/llm_engine.py b/vllm/engine/llm_engine.py
index 3a29e6a9ae094..51a0d10db8f38 100644
--- a/vllm/engine/llm_engine.py
+++ b/vllm/engine/llm_engine.py
@@ -1612,7 +1612,7 @@ def _get_stats(self,
         # KV Cache Usage in %
         num_total_gpu = self.cache_config.num_gpu_blocks
         gpu_cache_usage_sys = 0.
-        if num_total_gpu is not None:
+        if num_total_gpu:  # Guard against both None and 0
             num_free_gpu = sum(
                 scheduler.block_manager.get_num_free_gpu_blocks()
                 for scheduler in self.scheduler)
@@ -1620,7 +1620,7 @@ def _get_stats(self,
 
         num_total_cpu = self.cache_config.num_cpu_blocks
         cpu_cache_usage_sys = 0.
-        if num_total_cpu is not None and num_total_cpu > 0:
+        if num_total_cpu:  # Guard against both None and 0
             num_free_cpu = sum(
                 scheduler.block_manager.get_num_free_cpu_blocks()
                 for scheduler in self.scheduler)
Repository: mlflow/mlflow
Issue category: Performance Issue

Remove useless `chunk_dicts`
### Summary

```diff
diff --git a/mlflow/openai/_openai_autolog.py b/mlflow/openai/_openai_autolog.py
index 149e92793..45e486808 100644
--- a/mlflow/openai/_openai_autolog.py
+++ b/mlflow/openai/_openai_autolog.py
@@ -158,7 +158,6 @@ def patched_call(original, self, *args, **kwargs):
                 yield chunk
 
             try:
-                chunk_dicts = []
                 chunk_dicts = [chunk.to_dict() for chunk in chunks]
                 if config.log_traces and request_id:
                     mlflow_client.end_trace(
```

### Notes

- Make sure to open a PR from a **non-master** branch.
- Sign off the commit using the `-s` flag when making a commit:

  ```sh
  git commit -s -m "..."
           # ^^ make sure to use this
  ```

- Include `#{issue_number}` (e.g. `#123`) in the PR description when opening a PR.



Functions to edit:
mlflow/openai/_openai_autolog.py:patched_call

Patch:
diff --git a/mlflow/openai/_openai_autolog.py b/mlflow/openai/_openai_autolog.py
index d67da788da443..5ddbf87dc4379 100644
--- a/mlflow/openai/_openai_autolog.py
+++ b/mlflow/openai/_openai_autolog.py
@@ -159,7 +159,6 @@ def _stream_output_logging_hook(stream: Iterator) -> Iterator:
                 yield chunk
 
             try:
-                chunk_dicts = []
                 chunk_dicts = [chunk.to_dict() for chunk in chunks]
                 if config.log_traces and request_id:
                     mlflow_client.end_trace(
Repository: huggingface/transformers
Issue category: Feature Request

Limit number of parametes logged with `MLflowCallback`
### Feature request

Add a new environment variable, such as `MLFLOW_MAX_LOG_PARAMS`, which can limit the number of parameters logged by the `MLflowCallback`.

### Motivation

When using mlflow in Azure ML, there is a limit of 200 parameters that can be logged in a single run, meaning that when attempting to run a training job, the callback needs to be disabled entirely, or the module needs to be "monkeypatched" to limit the number of params logged.

### Your contribution

I will submit a PR


Functions to edit:
src/transformers/integrations/integration_utils.py:MLflowCallback.setup

Patch:
diff --git a/src/transformers/integrations/integration_utils.py b/src/transformers/integrations/integration_utils.py
index 4f7cf3632fe549..a09116552c8e34 100755
--- a/src/transformers/integrations/integration_utils.py
+++ b/src/transformers/integrations/integration_utils.py
@@ -1218,6 +1218,8 @@ def setup(self, args, state, model):
             and other parameters are ignored.
         - **MLFLOW_FLATTEN_PARAMS** (`str`, *optional*, defaults to `False`):
             Whether to flatten the parameters dictionary before logging.
+        - **MLFLOW_MAX_LOG_PARAMS** (`int`, *optional*):
+            Set the maximum number of parameters to log in the run.
         """
         self._log_artifacts = os.getenv("HF_MLFLOW_LOG_ARTIFACTS", "FALSE").upper() in ENV_VARS_TRUE_VALUES
         self._nested_run = os.getenv("MLFLOW_NESTED_RUN", "FALSE").upper() in ENV_VARS_TRUE_VALUES
@@ -1225,6 +1227,7 @@ def setup(self, args, state, model):
         self._experiment_name = os.getenv("MLFLOW_EXPERIMENT_NAME", None)
         self._flatten_params = os.getenv("MLFLOW_FLATTEN_PARAMS", "FALSE").upper() in ENV_VARS_TRUE_VALUES
         self._run_id = os.getenv("MLFLOW_RUN_ID", None)
+        self._max_log_params = os.getenv("MLFLOW_MAX_LOG_PARAMS", None)
 
         # "synchronous" flag is only available with mlflow version >= 2.8.0
         # https://github.com/mlflow/mlflow/pull/9705
@@ -1273,6 +1276,13 @@ def setup(self, args, state, model):
                     del combined_dict[name]
             # MLflow cannot log more than 100 values in one go, so we have to split it
             combined_dict_items = list(combined_dict.items())
+            if self._max_log_params and self._max_log_params.isdigit():
+                max_log_params = int(self._max_log_params)
+                if max_log_params < len(combined_dict_items):
+                    logger.debug(
+                        f"Reducing the number of parameters to log from {len(combined_dict_items)} to {max_log_params}."
+                    )
+                    combined_dict_items = combined_dict_items[:max_log_params]
             for i in range(0, len(combined_dict_items), self._MAX_PARAMS_TAGS_PER_BATCH):
                 if self._async_log:
                     self._ml_flow.log_params(
Repository: huggingface/transformers
Issue category: Feature Request

Boolean as tool input
### Feature request

It would be great if `boolean` was authorized as input to a `Tool`

### Motivation

I am willing to use my own tools with transformers CodeAgent ; using the method `tool`
I have a proper function `func` with typing and doc-strings as required. One of the input of the function is a `bool`.
When I try to run `tool(func)` I get: `Exception: Input 'perte_de_salaire': type 'boolean' is not an authorized value, should be one of ['string', 'integer', 'number', 'image', 'audio', 'any']`.

The Exception is rather clear, but why wouldn't a type as basic as `boolean` not be allowed? Especially since any is authorized. This is clearly a limitation to using the library.

### Your contribution

I seems like a few lines of code to change in tools.py (https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py)


Functions to edit:
src/transformers/agents/tools.py:Tool.validate_arguments

Patch:
diff --git a/src/transformers/agents/tools.py b/src/transformers/agents/tools.py
index cfb1e4cf95ced9..a425ffc8f106b2 100644
--- a/src/transformers/agents/tools.py
+++ b/src/transformers/agents/tools.py
@@ -138,7 +138,7 @@ def validate_arguments(self):
             "inputs": Dict,
             "output_type": str,
         }
-        authorized_types = ["string", "integer", "number", "image", "audio", "any"]
+        authorized_types = ["string", "integer", "number", "image", "audio", "any", "boolean"]
 
         for attr, expected_type in required_attributes.items():
             attr_value = getattr(self, attr, None)
Repository: django/django
Issue category: Feature Request

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.


Functions to edit:
django/urls/base.py:set_urlconf
django/urls/base.py:get_urlconf

Patch:
diff --git a/django/urls/base.py b/django/urls/base.py
index 753779c75b46..bb40ba222436 100644
--- a/django/urls/base.py
+++ b/django/urls/base.py
@@ -127,8 +127,9 @@ def clear_script_prefix():
 
 def set_urlconf(urlconf_name):
     """
-    Set the URLconf for the current thread (overriding the default one in
-    settings). If urlconf_name is None, revert back to the default.
+    Set the URLconf for the current thread or asyncio task (overriding the
+    default one in settings). If urlconf_name is None, revert back to the
+    default.
     """
     if urlconf_name:
         _urlconfs.value = urlconf_name
@@ -139,8 +140,8 @@ def set_urlconf(urlconf_name):
 
 def get_urlconf(default=None):
     """
-    Return the root URLconf to use for the current thread if it has been
-    changed from the default one.
+    Return the root URLconf to use for the current thread or asyncio task if it
+    has been changed from the default one.
     """
     return getattr(_urlconfs, "value", default)
Repository: sktime/sktime
Issue category: Performance Issue

[ENH] `polars` schema checks - address performance warnings
The current schema checks for lazy `polars` based data types raise performance warnings, e.g.,

```
sktime/datatypes/tests/test_check.py::test_check_metadata_inference[Table-polars_lazy_table-fixture:1]
  /home/runner/work/sktime/sktime/sktime/datatypes/_adapter/polars.py:234: PerformanceWarning: Determining the width of a LazyFrame requires resolving its schema, which is a potentially expensive operation. Use `LazyFrame.collect_schema().len()` to get the width without this warning.
    metadata["n_features"] = obj.width - len(index_cols)
```

These should be addressed.

The tests to execute to check whether these warnings persist are those in the `datatypes` module - these are automatically executed for a change in the impacted file, on remote CI.


Functions to edit:
sktime/datatypes/_adapter/polars.py:check_polars_frame

Patch:
diff --git a/sktime/datatypes/_adapter/polars.py b/sktime/datatypes/_adapter/polars.py
index e1fdd5f3ab7..e8138e4faa9 100644
--- a/sktime/datatypes/_adapter/polars.py
+++ b/sktime/datatypes/_adapter/polars.py
@@ -226,22 +226,31 @@ def check_polars_frame(
 
     # columns in polars are unique, no check required
 
+    if lazy:
+        width = obj.collect_schema().len()
+        columns = obj.collect_schema().names()
+        dtypes = obj.collect_schema().dtypes()
+    else:
+        width = obj.width
+        columns = obj.columns
+        dtypes = obj.dtypes
+
     if _req("is_empty", return_metadata):
-        metadata["is_empty"] = obj.width < 1
+        metadata["is_empty"] = width < 1
     if _req("is_univariate", return_metadata):
-        metadata["is_univariate"] = obj.width - len(index_cols) == 1
+        metadata["is_univariate"] = width - len(index_cols) == 1
     if _req("n_features", return_metadata):
-        metadata["n_features"] = obj.width - len(index_cols)
+        metadata["n_features"] = width - len(index_cols)
     if _req("feature_names", return_metadata):
-        feature_columns = [x for x in obj.columns if x not in index_cols]
+        feature_columns = [x for x in columns if x not in index_cols]
         metadata["feature_names"] = feature_columns
     if _req("dtypekind_dfip", return_metadata):
         index_cols_count = len(index_cols)
-        dtype_list = obj.dtypes[index_cols_count:]
+        dtype_list = dtypes[index_cols_count:]
         metadata["dtypekind_dfip"] = _polars_dtype_to_kind(dtype_list)
     if _req("feature_kind", return_metadata):
         index_cols_count = len(index_cols)
-        dtype_list = obj.dtypes[index_cols_count:]
+        dtype_list = dtypes[index_cols_count:]
         dtype_kind = _polars_dtype_to_kind(dtype_list)
         metadata["feature_kind"] = _get_feature_kind(dtype_kind)