Northy1717/SWE-bench-Live huggingface dataset:
Repository: conan-io/conan

Issue:
``AutotoolsToolchain`` compiler_executable mapping for RC win compiler
Ok, I just realized. The ``openssl`` recipe uses the ``AutotoolsToolchain`` that defines the compiler mapping as: ``compilers_mapping = {"c": "CC", "cpp": "CXX", "cuda": "NVCC", "fortran": "FC"}``

In other words, it is not prepared for cross-compiling from Linux -> Windows and defining the RC compiler.

So the issue needs to be addressed in both places, opening another ticket in the Conan client

_Originally posted by @memsharded in https://github.com/conan-io/cmake-conan/issues/631#issuecomment-2018475971_
            


Discussion:

Patch:
diff --git a/conan/tools/gnu/autotoolstoolchain.py b/conan/tools/gnu/autotoolstoolchain.py
index e106367c047..31440917138 100644
--- a/conan/tools/gnu/autotoolstoolchain.py
+++ b/conan/tools/gnu/autotoolstoolchain.py
@@ -166,7 +166,7 @@ def environment(self):
         compilers_by_conf = self._conanfile.conf.get("tools.build:compiler_executables", default={},
                                                      check_type=dict)
         if compilers_by_conf:
-            compilers_mapping = {"c": "CC", "cpp": "CXX", "cuda": "NVCC", "fortran": "FC"}
+            compilers_mapping = {"c": "CC", "cpp": "CXX", "cuda": "NVCC", "fortran": "FC", "rc": "RC"}
             for comp, env_var in compilers_mapping.items():
                 if comp in compilers_by_conf:
                     compiler = compilers_by_conf[comp]


Test patch:
diff --git a/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py b/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py
index b0774335c52..e8c71a6e671 100644
--- a/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py
+++ b/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py
@@ -215,7 +215,7 @@ def test_toolchain_and_compilers_build_context():
     os=Linux
 
     [conf]
-    tools.build:compiler_executables={"c": "gcc", "cpp": "g++"}
+    tools.build:compiler_executables={"c": "gcc", "cpp": "g++", "rc": "windres"}
     """)
     build = textwrap.dedent("""
     [settings]
@@ -265,6 +265,7 @@ def build(self):
             content = load(self, toolchain)
             assert 'export CC="gcc"' in content
             assert 'export CXX="g++"' in content
+            assert 'export RC="windres"' in content
     """)
     client = TestClient()
     client.save({
Repository: conan-io/conan

Issue:
[feature] Add support for Pop!_OS to package_manager
### What is your suggestion?

[Pop!_OS](https://pop.system76.com/) is an Ubuntu-based Linux distribution. It would be great if it could be added to the list of distributions that support `apt-get`. Its `distro.id()` is `pop`.

### Have you read the CONTRIBUTING guide?

- [X] I've read the CONTRIBUTING guide


Discussion:
Sure, thanks for the suggestion @jwillikers 

That should be an easy one, do you want to submit the contribution yourself?
I can do that.



Patch:
diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py
index f1dcfc42cda..70195b09082 100644
--- a/conan/tools/system/package_manager.py
+++ b/conan/tools/system/package_manager.py
@@ -39,7 +39,7 @@ def get_default_tool(self):
             os_name = distro.id() or os_name
         elif os_name == "Windows" and self._conanfile.conf.get("tools.microsoft.bash:subsystem") == "msys2":
             os_name = "msys2"
-        manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint", 'astra', 'elbrus', 'altlinux'],
+        manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint", 'astra', 'elbrus', 'altlinux', 'pop'],
                            "apk": ["alpine"],
                            "yum": ["pidora", "scientific", "xenserver", "amazon", "oracle", "amzn",
                                    "almalinux", "rocky"],
@@ -61,7 +61,7 @@ def get_default_tool(self):
             for d in distros:
                 if d in os_name:
                     return tool
-                
+
         # No default package manager was found for the system,
         # so notify the user
         self._conanfile.output.info("A default system package manager couldn't be found for {}, "


Test patch:
diff --git a/conans/test/integration/tools/system/package_manager_test.py b/conans/test/integration/tools/system/package_manager_test.py
index dc48198e7cf..6375a18c695 100644
--- a/conans/test/integration/tools/system/package_manager_test.py
+++ b/conans/test/integration/tools/system/package_manager_test.py
@@ -62,6 +62,7 @@ def test_msys2():
     ('altlinux', "apt-get"),
     ("astra", 'apt-get'),
     ('elbrus', 'apt-get'),
+    ('pop', "apt-get"),
 ])
 @pytest.mark.skipif(platform.system() != "Linux", reason="Only linux")
 def test_package_manager_distro(distro, tool):
Repository: keras-team/keras

Issue:
`keras.ops.softmax` errors out when used in a TensorFlow compiled function
## MRE

```python
import keras
from keras import ops

class SoftmaxLayer(keras.Layer):
  def call(self, x):
    return ops.softmax(x, axis=-1)

class Model(keras.Model):
  def __init__(self):
    x = keras.Input(shape=(None,))
    y = SoftmaxLayer()(x)
    super().__init__(inputs=x, outputs=y)

model = Model()  # Error
```

## Additional Details

The regression was introduced in [d5a4521](https://github.com/keras-team/keras/commit/d5a452155a415d5fcbe568eb2a8441f64e57aa90)

Discovered by KerasCV test run with `keras-nightly`: https://github.com/keras-team/keras-cv/actions/runs/8259807616/job/22594330565


Discussion:

Patch:
diff --git a/keras/ops/nn.py b/keras/ops/nn.py
index 6731d9980a36..5724f8de4569 100644
--- a/keras/ops/nn.py
+++ b/keras/ops/nn.py
@@ -538,10 +538,13 @@ def softmax(x, axis=-1):
     array([0.09003057, 0.24472847, 0.66524096], shape=(3,), dtype=float64)
 
     """
-    if isinstance(axis, int) and backend.shape(x)[axis] == 1:
+    # Don't use `backend.shape` since TensorFlow returns
+    # symbolic tensors for unknown shape which can trigger
+    # an error in TensorFlow graph execution.
+    if isinstance(axis, int) and x.shape[axis] == 1:
         warnings.warn(
             f"You are using a softmax over axis {axis} "
-            f"of a tensor of shape {backend.shape(x)}. This axis "
+            f"of a tensor of shape {x.shape}. This axis "
             "has size 1. The softmax operation will always return "
             "the value 1, which is likely not what you intended. "
             "Did you mean to use a sigmoid instead?"


Test patch:
diff --git a/keras/ops/nn_test.py b/keras/ops/nn_test.py
index e5f9e10a065c..bc77ca2700b8 100644
--- a/keras/ops/nn_test.py
+++ b/keras/ops/nn_test.py
@@ -2,10 +2,12 @@
 import pytest
 from absl.testing import parameterized
 
+import keras
 from keras import backend
 from keras import layers
 from keras import losses
 from keras import models
+from keras import ops
 from keras import testing
 from keras.backend.common import standardize_dtype
 from keras.backend.common.keras_tensor import KerasTensor
@@ -84,6 +86,22 @@ def test_softmax(self):
         self.assertEqual(knn.softmax(x, axis=1).shape, (None, 2, 3))
         self.assertEqual(knn.softmax(x, axis=-1).shape, (None, 2, 3))
 
+    def test_softmax_in_graph(self):
+        class SoftmaxLayer(keras.Layer):
+            def call(self, x):
+                return ops.softmax(x, axis=-1)
+
+        class Model(keras.Model):
+            def __init__(self):
+                x = keras.Input(shape=(None,))
+                y = SoftmaxLayer()(x)
+                super().__init__(inputs=x, outputs=y)
+
+        # Make sure Keras is able to compile the model graph
+        model = Model()
+        x = ops.array([[1.0, 2.0, 3.0, 4.0]])
+        model.predict(x)
+
     def test_log_softmax(self):
         x = KerasTensor([None, 2, 3])
         self.assertEqual(knn.log_softmax(x).shape, (None, 2, 3))
Repository: instructlab/instructlab

Issue:
TESTING: lint flag styles
Flags should be hyphen-only

e.g. `--model-dir` and not `--model_dir`


Discussion:

Patch:
diff --git a/cli/lab.py b/cli/lab.py
index b7ffb67eaf..fae3867ad2 100755
--- a/cli/lab.py
+++ b/cli/lab.py
@@ -44,7 +44,7 @@ def __init__(self, filename):
 def configure(ctx, param, filename):
     """Configure is responsible for reading the config file, initiating Lab object and CLI context."""
     # skip configuration reading when invoked command is `init`
-    if len(sys.argv) > 0 and sys.argv[1] == "init":
+    if len(sys.argv) > 0 and sys.argv[1] in ("init", "--help"):
         return
 
     if not exists(filename):
@@ -110,7 +110,7 @@ def cli(ctx, config):
     help="Taxonomy repository location.",
 )
 @click.option(
-    "--min_taxonomy",
+    "--min-taxonomy",
     is_flag=True,
     help="Shallow clone the taxonomy repository with minimum size. "
     "Please do not use this option if you are planning to contribute back "


Test patch:
diff --git a/tests/test_lab.py b/tests/test_lab.py
new file mode 100644
index 0000000000..1f088f2d9c
--- /dev/null
+++ b/tests/test_lab.py
@@ -0,0 +1,25 @@
+# Standard
+import re
+import unittest
+
+# Third Party
+import click
+
+# First Party
+from cli import lab
+
+
+class TestConfig(unittest.TestCase):
+    def test_cli_params_hyphenated(self):
+        flag_pattern = re.compile("-{1,2}[a-z-]+")
+        invalid_flags = []
+        for name, cmd in lab.cli.commands.items():
+            for param in cmd.params:
+                if not isinstance(param, click.Option):
+                    continue
+                for opt in param.opts:
+                    if not flag_pattern.fullmatch(opt):
+                        invalid_flags.append(f"{name} {opt}")
+        self.assertFalse(
+            invalid_flags, "<- these commands are using non-hyphenated params"
+        )
diff --git a/tests/test_lab_download.py b/tests/test_lab_download.py
index 0c644f5ef5..5d5e7f646f 100644
--- a/tests/test_lab_download.py
+++ b/tests/test_lab_download.py
@@ -17,9 +17,6 @@ def mock_download_raise_exception(repo_id, revision, filename, local_dir):
 
 
 class TestLabDownload(unittest.TestCase):
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-
     @patch("huggingface_hub.hf_hub_download")
     def test_download(self, _):
         runner = CliRunner()
diff --git a/tests/test_lab_init.py b/tests/test_lab_init.py
index 62e9f467bd..7e172d73b8 100644
--- a/tests/test_lab_init.py
+++ b/tests/test_lab_init.py
@@ -15,9 +15,6 @@
 
 
 class TestLabInit(unittest.TestCase):
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-
     @patch("git.Repo.clone_from", MagicMock())
     def test_init(self):
         runner = CliRunner()