helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: events: extract event listener validation as a function

There was some repetitive logics that validated the existence of eventlisteners.  
We now replace this with a single line of, `hasEventListener(self, type)`.  
- `self` is the object(e.g. EventEmitter) to be checked whether eventlisteners exists or not.  
- `type` is the type of eventlisteners, which can be `undefined`  

Changed files:
filename: lib/events.js
patch: @@ -276,6 +276,12 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
   },
 });
 
+function hasEventListener(self, type) {
+  if (type === undefined)
+    return self._events !== undefined;
+  return self._events !== undefined && self._events[type] !== undefined;
+};
+
 ObjectDefineProperties(EventEmitter, {
   kMaxEventTargetListeners: {
     __proto__: null,
@@ -669,13 +675,11 @@ EventEmitter.prototype.removeListener =
     function removeListener(type, listener) {
       checkListener(listener);
 
-      const events = this._events;
-      if (events === undefined)
+      if (!hasEventListener(this, type))
         return this;
 
+      const events = this._events;
       const list = events[type];
-      if (list === undefined)
-        return this;
 
       if (list === listener || list.listener === listener) {
         this._eventsCount -= 1;
@@ -729,9 +733,9 @@ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  */
 EventEmitter.prototype.removeAllListeners =
     function removeAllListeners(type) {
-      const events = this._events;
-      if (events === undefined)
+      if (!hasEventListener(this))
         return this;
+      const events = this._events;
 
       // Not listening for removeListener, no need to emit
       if (events.removeListener === undefined) {
@@ -776,14 +780,10 @@ EventEmitter.prototype.removeAllListeners =
     };
 
 function _listeners(target, type, unwrap) {
-  const events = target._events;
-
-  if (events === undefined)
+  if (!hasEventListener(target, type))
     return [];
 
-  const evlistener = events[type];
-  if (evlistener === undefined)
-    return [];
+  const evlistener = target._events[type];
 
   if (typeof evlistener === 'function')
     return unwrap ? [evlistener.listener || evlistener] : [evlistener];
Repository: electron/electron
Pull request: fix: vibrant view is inserted into Views API hierarchy

#### Description of Change

Closes https://github.com/electron/electron/issues/42336
Closes https://github.com/electron/electron/issues/42335
Refs https://github.com/electron/electron/pull/43033.

Now that the above PR has been reverted we can apply this fix to all release branches.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Fixed issues with the vibrancy view on macOS.


Changed files:
filename: shell/browser/native_window_mac.h
patch: @@ -12,6 +12,7 @@
 #include <string>
 #include <vector>
 
+#include "base/memory/raw_ptr.h"
 #include "electron/shell/common/api/api.mojom.h"
 #include "shell/browser/native_window.h"
 #include "third_party/skia/include/core/SkRegion.h"
@@ -300,6 +301,9 @@ class NativeWindowMac : public NativeWindow,
 
   std::string vibrancy_type_;
 
+  // A views::NativeViewHost wrapping the vibrant view. Owned by the root view.
+  raw_ptr<views::NativeViewHost> vibrant_native_view_host_ = nullptr;
+
   // The presentation options before entering simple fullscreen mode.
   NSApplicationPresentationOptions simple_fullscreen_options_;
 };

filename: shell/browser/native_window_mac.mm
patch: @@ -1391,13 +1391,19 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
   NativeWindow::SetVibrancy(type);
 
   NSVisualEffectView* vibrantView = [window_ vibrantView];
+  views::View* rootView = GetContentsView();
 
   if (type.empty()) {
-    if (vibrantView == nil)
-      return;
+    if (vibrant_native_view_host_ != nullptr) {
+      // Transfers ownership back to caller in the form of a unique_ptr which is
+      // subsequently deleted.
+      rootView->RemoveChildViewT(vibrant_native_view_host_);
+      vibrant_native_view_host_ = nullptr;
+    }
 
-    [vibrantView removeFromSuperview];
-    [window_ setVibrantView:nil];
+    if (vibrantView != nil) {
+      [window_ setVibrantView:nil];
+    }
 
     return;
   }
@@ -1453,9 +1459,13 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
         [vibrantView setState:NSVisualEffectStateFollowsWindowActiveState];
       }
 
-      [[window_ contentView] addSubview:vibrantView
-                             positioned:NSWindowBelow
-                             relativeTo:nil];
+      // Vibrant view is inserted into the root view hierarchy underneath all
+      // other views.
+      vibrant_native_view_host_ = rootView->AddChildViewAt(
+          std::make_unique<views::NativeViewHost>(), 0);
+      vibrant_native_view_host_->Attach(vibrantView);
+
+      rootView->DeprecatedLayoutImmediately();
 
       UpdateVibrancyRadii(IsFullscreen());
     }
Repository: denoland/deno
Pull request: fix(coverage): do not generate script coverage with empty url

closes #24004

This PR skips saving script_coverage as json when `script_coverage.url` is an empty string. This happens (strangely) when the test case includes `Deno.statSync` call (See #24004 for details).

Changed files:
filename: cli/tools/coverage/mod.rs
patch: @@ -68,12 +68,14 @@ impl crate::worker::CoverageCollector for CoverageCollector {
 
     let script_coverages = self.take_precise_coverage().await?.result;
     for script_coverage in script_coverages {
-      // Filter out internal and http/https JS files from being included in coverage reports
+      // Filter out internal and http/https JS files and eval'd scripts
+      // from being included in coverage reports
       if script_coverage.url.starts_with("ext:")
         || script_coverage.url.starts_with("[ext:")
         || script_coverage.url.starts_with("http:")
         || script_coverage.url.starts_with("https:")
         || script_coverage.url.starts_with("node:")
+        || script_coverage.url.is_empty()
       {
         continue;
       }

filename: tests/testdata/coverage/multisource/test.ts
patch: @@ -20,3 +20,7 @@ Deno.test("qux", () => {
 Deno.test("quux", () => {
   quux(false);
 });
+
+// Function constructor or eval function generates a new script source internally.
+// This call ensures that the coverage data for the eval script source is not generated.
+eval("console.log(1)");
Repository: denoland/deno
Pull request: fix(deno_task): more descriptive error message

#23990 Added a more descriptive error message for a missing deno.json config file.

Changed files:
filename: cli/args/mod.rs
patch: @@ -1355,7 +1355,7 @@ impl CliOptions {
     } else if self.maybe_package_json.is_some() {
       Ok(Default::default())
     } else {
-      bail!("No config file found")
+      bail!("deno task couldn't find deno.json(c). See https://deno.land/manual@v{}/getting_started/configuration_file", env!("CARGO_PKG_VERSION"))
     }
   }
Repository: electron/electron
Pull request: fix: vibrant view is inserted into Views API hierarchy

Backport of #43078

See that PR for details.


Notes: Fixed issues with the vibrancy view on macOS.


Changed files:
filename: shell/browser/native_window_mac.h
patch: @@ -12,6 +12,7 @@
 #include <string>
 #include <vector>
 
+#include "base/memory/raw_ptr.h"
 #include "electron/shell/common/api/api.mojom.h"
 #include "shell/browser/native_window.h"
 #include "ui/display/display_observer.h"
@@ -299,6 +300,9 @@ class NativeWindowMac : public NativeWindow,
 
   std::string vibrancy_type_;
 
+  // A views::NativeViewHost wrapping the vibrant view. Owned by the root view.
+  raw_ptr<views::NativeViewHost> vibrant_native_view_host_ = nullptr;
+
   // The presentation options before entering simple fullscreen mode.
   NSApplicationPresentationOptions simple_fullscreen_options_;
 };

filename: shell/browser/native_window_mac.mm
patch: @@ -1394,13 +1394,19 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
   NativeWindow::SetVibrancy(type);
 
   NSVisualEffectView* vibrantView = [window_ vibrantView];
+  views::View* rootView = GetContentsView();
 
   if (type.empty()) {
-    if (vibrantView == nil)
-      return;
+    if (vibrant_native_view_host_ != nullptr) {
+      // Transfers ownership back to caller in the form of a unique_ptr which is
+      // subsequently deleted.
+      rootView->RemoveChildViewT(vibrant_native_view_host_);
+      vibrant_native_view_host_ = nullptr;
+    }
 
-    [vibrantView removeFromSuperview];
-    [window_ setVibrantView:nil];
+    if (vibrantView != nil) {
+      [window_ setVibrantView:nil];
+    }
 
     return;
   }
@@ -1456,9 +1462,13 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
         [vibrantView setState:NSVisualEffectStateFollowsWindowActiveState];
       }
 
-      [[window_ contentView] addSubview:vibrantView
-                             positioned:NSWindowBelow
-                             relativeTo:nil];
+      // Vibrant view is inserted into the root view hierarchy underneath all
+      // other views.
+      vibrant_native_view_host_ = rootView->AddChildViewAt(
+          std::make_unique<views::NativeViewHost>(), 0);
+      vibrant_native_view_host_->Attach(vibrantView);
+
+      rootView->DeprecatedLayoutImmediately();
 
       UpdateVibrancyRadii(IsFullscreen());
     }
Repository: ggml-org/llama.cpp
Pull request: llamafile : ppc64le GEMV forwarding for FP32.

This patch enables usage of MMA when one of the
dimensions of the matrix(ie either M or N) is 1. This is useful in case of token generation where N < 2.

The concept of 'GEMV Forwarding' is used where when one of the matrix has a single row/column, the elements are broadcasted, instead of using packing routine to prepack the matrix elements.

This change results in 5% - 15% improvement in total speed(ie all tokens/total time), across various batch sizes. This is in comparision with the corresponding dot product implementation.

The patch is tested with FP32 models of Meta-Lllama-3-8B, Mistral-7B, Llama-2-7B-chat-hf on a IBM POWER10 machine.




Changed files:
filename: ggml/src/ggml-cpu/llamafile/sgemm.cpp
patch: @@ -2680,13 +2680,25 @@ class tinyBLAS_PPC {
             __builtin_mma_xxsetaccz(&acc_0);
             vec_t vec_A[4] {0}, vec_B[4] = {0};
             for (int l=0; l<k; l+=4) {
-                if (RN >= 4 && RM == 1) {
+                /* 'GEMV Forwarding' concept is used in first two conditional loops.
+                 * when one of the matrix has a single row/column, the elements are
+                 * broadcasted, instead of using packing routine to prepack the
+                 * matrix elements.
+                 */
+                if (RM == 1) {
                     TA* a = const_cast<TA*>(A+(ii)*lda+l);
-                    packTranspose<vector float>(B+(jj*ldb)+l, ldb, 4, 4, (TA*)vec_B);
+                    packTranspose<vector float>(B+(jj*ldb)+l, ldb, RN, 4, (TA*)vec_B);
                     vec_A[0] = (vec_t)vec_xl(0,a);
                     vec_A[1] = (vec_t)vec_splats(*((TA*)&vec_A+1));
                     vec_A[2] = (vec_t)vec_splats(*((TA*)&vec_A+2));
                     vec_A[3] = (vec_t)vec_splats(*((TA*)&vec_A+3));
+                } else if (RN == 1) {
+                    packTranspose<vector float>(A+(ii*lda)+l, lda, RM, 4, (TA*)vec_A);
+                    TB* b = const_cast<TB*>(B+(jj)*ldb+l);
+                    vec_B[0] = (vec_t)vec_xl(0,b);
+                    vec_B[1] = (vec_t)vec_splats(*((TB*)&vec_B+1));
+                    vec_B[2] = (vec_t)vec_splats(*((TB*)&vec_B+2));
+                    vec_B[3] = (vec_t)vec_splats(*((TB*)&vec_B+3));
                 } else {
                     packTranspose<vector float>(A+(ii*lda)+l, lda, RM, 4, (TA*)vec_A);
                     packTranspose<vector float>(B+(jj*ldb)+l, ldb, RN, 4, (TA*)vec_B);
@@ -2790,8 +2802,10 @@ bool llamafile_sgemm(const struct ggml_compute_params * params, int64_t m, int64
     assert(params->ith < params->nth);
 
     // only enable sgemm for prompt processing
+#if !defined(__MMA__)
     if (n < 2)
         return false;
+#endif
 
     if (Ctype != GGML_TYPE_F32)
         return false;
Repository: nodejs/node
Pull request: doc: add notable-change mention to sec release

Refs: https://github.com/nodejs/changelog-maker/pull/167 & https://github.com/nodejs-private/security-release/issues/38

Changed files:
filename: doc/contributing/releases.md
patch: @@ -311,6 +311,9 @@ $ git checkout -b v1.2.3-proposal upstream/v1.x
 git cherry-pick  ...  # cherry-pick nodejs-private PR commits directly into the proposal
 ```
 
+Be sure to label the CVE fixes as `notable-change` in the nodejs-private repository.
+This will ensure they are included in the "Notable Changes" section of the CHANGELOG.
+
 </details>
 
 ### 3. Update `src/node_version.h`
Repository: facebook/react
Pull request: RFC: Remove build time extractErrors message when error codes can't be found

Per https://github.com/facebook/react/pull/9548#issuecomment-297949223 -- just removing these errors since they're noisy. The extract errors process is documented as part of releases, and we don't extract errors between releases.

Changed files:
filename: scripts/error-codes/__tests__/dev-expression-with-codes-test.js
patch: @@ -115,28 +115,4 @@ ${expectedInvariantTransformResult}`
         `_prodInvariant('18', 'Foo', 'Bar') : void 0;`
     );
   });
-
-  it('should warn in non-test envs if the error message cannot be found', () => {
-    spyOn(console, 'warn');
-    transform("invariant(condition, 'a %s b', 'c');");
-
-    expect(console.warn.calls.count()).toBe(1);
-    expect(console.warn.calls.argsFor(0)[0]).toBe(
-      'Error message "a %s b" ' +
-        'cannot be found. The current React version ' +
-        'and the error map are probably out of sync. ' +
-        'Please run `yarn build -- --extractErrors` to build React with the error map in sync.'
-    );
-  });
-
-  it('should not warn in test env if the error message cannot be found', () => {
-    process.env.NODE_ENV = 'test';
-
-    spyOn(console, 'warn');
-    transform("invariant(condition, 'a %s b', 'c');");
-
-    expect(console.warn.calls.count()).toBe(0);
-
-    process.env.NODE_ENV = '';
-  });
 });

filename: scripts/error-codes/dev-expression-with-codes.js
patch: @@ -117,16 +117,6 @@ module.exports = function(babel) {
             if (prodErrorId === undefined) {
               // The error cannot be found in the map.
               node[SEEN_SYMBOL] = true;
-              if (process.env.NODE_ENV !== 'test') {
-                console.warn(
-                  'Error message "' +
-                    errorMsgLiteral +
-                    '" cannot be found. The current React version ' +
-                    'and the error map are probably out of sync. ' +
-                    'Please run `yarn build -- --extractErrors` to ' +
-                    'build React with the error map in sync.'
-                );
-              }
               return;
             }
 

filename: scripts/fiber/tests-passing.txt
patch: @@ -28,8 +28,6 @@ scripts/error-codes/__tests__/dev-expression-with-codes-test.js
 * should only add `reactProdInvariant` once
 * should support invariant calls with args
 * should support invariant calls with a concatenated template string and args
-* should warn in non-test envs if the error message cannot be found
-* should not warn in test env if the error message cannot be found
 
 scripts/error-codes/__tests__/invertObject-test.js
 * should return an empty object for an empty input
Repository: denoland/deno
Pull request: FUTURE(ext/ffi,ext/webgpu): stabilize FFI and WebGPU APIs

Closes #23906

Changed files:
filename: cli/args/mod.rs
patch: @@ -1757,7 +1757,9 @@ impl CliOptions {
 
     if *DENO_FUTURE {
       from_config_file.extend_from_slice(&[
+        deno_runtime::deno_ffi::UNSTABLE_FEATURE_NAME.to_string(),
         deno_runtime::deno_fs::UNSTABLE_FEATURE_NAME.to_string(),
+        deno_runtime::deno_webgpu::UNSTABLE_FEATURE_NAME.to_string(),
       ]);
     }
 

filename: tests/specs/future/unstable_flags/main.js
patch: @@ -1,3 +1,5 @@
+console.log(typeof await navigator.gpu.requestAdapter() === "object"); // Throws without `--unstable-gpu`
+console.log(typeof Deno.dlopen === "function"); // Undefined without `--unstable-ffi`
 console.log(
   // Undefined without `--unstable-fs`
   Deno.build.os === "windows" ? true : typeof Deno.umask === "function",

filename: tests/specs/future/unstable_flags/main.out
patch: @@ -1 +1,3 @@
 true
+true
+true
Repository: facebook/react
Pull request: [DevTools] Using array destructuring without assigning first variable does not error

## Summary

Before this commit, if a hook returned an array the was destructured, but without assigning a variable to the first element in the array, this would produce an error. This was detected via internal testing.

This commit fixes that and adds regression tests.


## Test Plan

- yarn flow
- yarn test
- yarn test-build-devtools
- added new regression tests 
- named hooks still work on manual test of browser extension on a few different apps (code sandbox, create-react-app, internally).



Changed files:
filename: packages/react-devtools-extensions/src/__tests__/__source__/__untransformed__/ComponentWithUseState.js
patch: @@ -14,7 +14,8 @@ function Component(props) {
   const [foo] = useState(true);
   const bar = useState(true);
   const [baz] = React.useState(true);
+  const [, forceUpdate] = useState();
   return `${foo}-${bar}-${baz}`;
 }
 
-module.exports = {Component};
\ No newline at end of file
+module.exports = {Component};

filename: packages/react-devtools-extensions/src/__tests__/parseHookNames-test.js
patch: @@ -95,7 +95,7 @@ describe('parseHookNames', () => {
     const Component = require('./__source__/__untransformed__/ComponentWithUseState')
       .Component;
     const hookNames = await getHookNamesForComponent(Component);
-    expectHookNamesToEqual(hookNames, ['foo', 'bar', 'baz']);
+    expectHookNamesToEqual(hookNames, ['foo', 'bar', 'baz', null]);
   });
 
   it('should parse names for useReducer()', async () => {

filename: packages/react-devtools-extensions/src/astUtils.js
patch: @@ -271,7 +271,7 @@ function getHookVariableName(
   const nodeType = hook.node.id.type;
   switch (nodeType) {
     case AST_NODE_TYPES.ARRAY_PATTERN:
-      return !isCustomHook ? hook.node.id.elements[0].name : null;
+      return !isCustomHook ? hook.node.id.elements[0]?.name ?? null : null;
 
     case AST_NODE_TYPES.IDENTIFIER:
       return hook.node.id.name;
Repository: denoland/deno
Pull request: fix(coverage): skip generating coverage json for http(s) scripts

This PR skips saving the coverage raw data from http(s) modules.

closes #21784


Changed files:
filename: cli/tools/coverage/mod.rs
patch: @@ -68,9 +68,11 @@ impl crate::worker::CoverageCollector for CoverageCollector {
 
     let script_coverages = self.take_precise_coverage().await?.result;
     for script_coverage in script_coverages {
-      // Filter out internal JS files from being included in coverage reports
+      // Filter out internal and http/https JS files from being included in coverage reports
       if script_coverage.url.starts_with("ext:")
         || script_coverage.url.starts_with("[ext:")
+        || script_coverage.url.starts_with("http:")
+        || script_coverage.url.starts_with("https:")
         || script_coverage.url.starts_with("node:")
       {
         continue;

filename: tests/integration/coverage_tests.rs
patch: @@ -439,6 +439,39 @@ fn no_internal_node_code() {
   }
 }
 
+#[test]
+fn no_http_coverage_data() {
+  let _http_server_guard = test_util::http_server();
+  let context = TestContext::default();
+  let tempdir = context.temp_dir();
+  let tempdir = tempdir.path().join("cov");
+
+  let output = context
+    .new_command()
+    .args_vec(vec![
+      "test".to_string(),
+      "--quiet".to_string(),
+      "--no-check".to_string(),
+      format!("--coverage={}", tempdir),
+      "coverage/no_http_coverage_data_test.ts".to_string(),
+    ])
+    .run();
+
+  output.assert_exit_code(0);
+  output.skip_output_check();
+
+  // Check that coverage files contain no http urls
+  let paths = tempdir.read_dir();
+  for path in paths {
+    let unwrapped = PathRef::new(path.unwrap().path());
+    let data = unwrapped.read_to_string();
+
+    let value: serde_json::Value = serde_json::from_str(&data).unwrap();
+    let url = value["url"].as_str().unwrap();
+    assert_starts_with!(url, "file:");
+  }
+}
+
 #[test]
 fn test_html_reporter() {
   // This test case generates a html coverage report of test cases in /tests/testdata/coverage/multisource

filename: tests/testdata/coverage/no_http_coverage_data_test.ts
patch: @@ -0,0 +1,5 @@
+import "http://localhost:4546/run/001_hello.js";
+
+Deno.test("hello", () => {
+  console.log("hello");
+});
Repository: huggingface/transformers
Pull request: fix transformers_cli import relative path issue

**Issue**
when use `python src/transformers/commands/transformers_cli.py env` to get env list by following this [doc](https://huggingface.co/docs/transformers/en/contributing), will report below error:

> Traceback (most recent call last): File "/workspace/transformers/src/transformers/commands/transformers_cli.py", line 18, in <module> from .add_fast_image_processor import AddFastImageProcessorCommand ImportError: attempted relative import with no known parent package

**Fix**
1. replace relative path import to module based import
2. add the missing XPU info

**Results**
Both  `python src/transformers/commands/transformers_cli.py env` and `transformers-cli env` works


Changed files:
filename: src/transformers/commands/env.py
patch: @@ -94,6 +94,7 @@ def run(self):
 
             pt_version = torch.__version__
             pt_cuda_available = torch.cuda.is_available()
+            pt_xpu_available = torch.xpu.is_available()
             pt_npu_available = is_torch_npu_available()
             pt_hpu_available = is_torch_hpu_available()
 
@@ -151,6 +152,9 @@ def run(self):
             if pt_cuda_available:
                 info["Using GPU in script?"] = "<fill in>"
                 info["GPU type"] = torch.cuda.get_device_name()
+            elif pt_xpu_available:
+                info["Using XPU in script?"] = "<fill in>"
+                info["XPU type"] = torch.xpu.get_device_name()
             elif pt_hpu_available:
                 info["Using HPU in script?"] = "<fill in>"
                 info["HPU type"] = torch.hpu.get_device_name()

filename: src/transformers/commands/transformers_cli.py
patch: @@ -14,15 +14,14 @@
 # limitations under the License.
 
 from transformers import HfArgumentParser
-
-from .add_fast_image_processor import AddFastImageProcessorCommand
-from .add_new_model_like import AddNewModelLikeCommand
-from .chat import ChatCommand
-from .convert import ConvertCommand
-from .download import DownloadCommand
-from .env import EnvironmentCommand
-from .run import RunCommand
-from .serving import ServeCommand
+from transformers.commands.add_fast_image_processor import AddFastImageProcessorCommand
+from transformers.commands.add_new_model_like import AddNewModelLikeCommand
+from transformers.commands.chat import ChatCommand
+from transformers.commands.convert import ConvertCommand
+from transformers.commands.download import DownloadCommand
+from transformers.commands.env import EnvironmentCommand
+from transformers.commands.run import RunCommand
+from transformers.commands.serving import ServeCommand
 
 
 def main():