helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: allowed dialog file types with one filter

#### Description of Change

Closes https://github.com/electron/electron/issues/46883.
Refs https://github.com/electron/electron/issues/46623

Fixes an issue where filters wouldn't apply in the specific case only one was passed.

#### 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 an issue where filters wouldn't apply in the specific case only one was passed.

Changed files:
filename: shell/browser/ui/file_dialog_mac.mm
patch: @@ -131,10 +131,6 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
     [file_types_list addObject:content_types_set];
   }
 
-  // Don't add file format picker.
-  if ([file_types_list count] <= 1)
-    return;
-
   NSArray* content_types = [file_types_list objectAtIndex:0];
 
   __block BOOL allowAllFiles = NO;
@@ -148,6 +144,10 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
 
   [dialog setAllowedContentTypes:allowAllFiles ? @[] : content_types];
 
+  // Don't add file format picker.
+  if ([file_types_list count] <= 1)
+    return;
+
   // Add file format picker.
   ElectronAccessoryView* accessoryView = [[ElectronAccessoryView alloc]
       initWithFrame:NSMakeRect(0.0, 0.0, 200, 32.0)];
Repository: vercel/next.js
Pull request: fix: dev should produce the correct default fallback regex to match builds/Turbopack

`test/e2e/middleware-general/test/index.test.ts` has been frequently flaking recently in dev likely due to a timing change. If a default middleware matcher isn't written to disk, `setup-dev-bundler` returns a default regex of `.*`. However in webpack [prod builds](https://github.com/vercel/next.js/blob/5abb663b96493292031b04ef977686949f0a4445/packages/next/src/build/webpack/plugins/middleware-plugin.ts#L207-L212)/[Turbopack dev,](https://github.com/vercel/next.js/blob/5abb663b96493292031b04ef977686949f0a4445/crates/next-api/src/middleware.rs#L245-L249) this value is `^/.*$`. 

This updates dev to produce the same values in both environments. This should have no behavioral difference because all routes should start with `/`, anyway. 


### Test plan
This change passes [flake detection](https://github.com/vercel/next.js/actions/runs/17656597547/job/50181663593?pr=83701#step:34:187).

Changed files:
filename: packages/next/src/server/lib/router-utils/setup-dev-bundler.ts
patch: @@ -474,7 +474,7 @@ async function startWatcher(
             serverFields.actualMiddlewareFile
           )
           middlewareMatchers = staticInfo.middleware?.matchers || [
-            { regexp: '.*', originalSource: '/:path*' },
+            { regexp: '^/.*$', originalSource: '/:path*' },
           ]
           continue
         }

filename: test/e2e/middleware-general/test/index.test.ts
patch: @@ -200,7 +200,9 @@ describe('Middleware Runtime', () => {
           `/_next/static/${next.buildId}/_devMiddlewareManifest.json`
         )
         const matchers = await res.json()
-        expect(matchers).toEqual([{ regexp: '.*', originalSource: '/:path*' }])
+        expect(matchers).toEqual([
+          { regexp: '^/.*$', originalSource: '/:path*' },
+        ])
       })
     }
Repository: nodejs/node
Pull request: benchmark: fix sqlite-is-transaction

The variable deadCodeElimination is declared
but not initialized, making it undefined by default. When using the &&= operator with an undefined left operand, the result will always remain undefined regardless of how many iterations run.

```js
let deadCodeElimination;
deadCodeElimination &&= true
deadCodeElimination // undefined
```


Changed files:
filename: benchmark/sqlite/sqlite-is-transaction.js
patch: @@ -16,7 +16,7 @@ function main(conf) {
   }
 
   let i;
-  let deadCodeElimination;
+  let deadCodeElimination = true;
 
   bench.start();
   for (i = 0; i < conf.n; i += 1)
Repository: denoland/deno
Pull request: fix(bundle): don't use createRequire when targeting browser in Deno.bundle

Fixes #31524

Missed a code path in the original fix

Changed files:
filename: cli/tools/bundle/provider.rs
patch: @@ -173,7 +173,9 @@ impl BundleProvider for CliBundleProvider {
           super::process_result(
             &result,
             &bundler.cwd,
-            true,
+            crate::tools::bundle::should_replace_require_shim(
+              bundle_flags.platform,
+            ),
             bundle_flags.minify,
             bundler.input,
             bundle_flags.output_dir.as_ref().map(Path::new),

filename: tests/specs/bundle/require_browser/__test__.jsonc
patch: @@ -0,0 +1,29 @@
+{
+  "tempDir": true,
+  "tests": {
+    "api": {
+      "steps": [
+        {
+          "args": "run --unstable-bundle bundle.ts",
+          "output": "[WILDCARD]"
+        },
+        {
+          "args": "run -A has-createrequire.ts bundle.js",
+          "output": "false\n"
+        }
+      ]
+    },
+    "cli": {
+      "steps": [
+        {
+          "args": "bundle --platform browser --output bundle.js foo.cjs",
+          "output": "[WILDCARD]"
+        },
+        {
+          "args": "run -A has-createrequire.ts bundle.js",
+          "output": "false\n"
+        }
+      ]
+    }
+  }
+}

filename: tests/specs/bundle/require_browser/bundle.ts
patch: @@ -0,0 +1,5 @@
+await Deno.bundle({
+  entrypoints: ["./foo.cjs"],
+  platform: "browser",
+  outputPath: "bundle.js",
+});

filename: tests/specs/bundle/require_browser/foo.cjs
patch: @@ -0,0 +1,11 @@
+let arch;
+if (typeof globalThis.window !== "undefined") {
+  const os = require("node:os");
+  arch = os.arch;
+} else {
+  arch = "browser";
+}
+module.exports = {
+  hi: "hi",
+  arch,
+};

filename: tests/specs/bundle/require_browser/has-createrequire.ts
patch: @@ -0,0 +1,9 @@
+const file = Deno.args[0];
+
+const contents = Deno.readTextFileSync(file);
+
+if (contents.includes("createRequire")) {
+  console.log("true");
+} else {
+  console.log("false");
+}
Repository: facebook/react
Pull request: Use both displayName and name in forwardRef/memo

When defining a displayName on forwardRef/memo we forward that name to the inner function.

We used to use displayName for this but in #29206 I switched this to use `"name"`. That's because V8 doesn't use displayName, it only uses the overridden name in stack traces. This is the only thing covered by our tests for component stacks.

However, I realized that Safari only uses displayName and not the name. So this sets both.

Changed files:
filename: packages/react/src/ReactForwardRef.js
patch: @@ -71,6 +71,7 @@ export function forwardRef<Props, ElementType: React$ElementType>(
           Object.defineProperty(render, 'name', {
             value: name,
           });
+          render.displayName = name;
         }
       },
     });

filename: packages/react/src/ReactMemo.js
patch: @@ -51,6 +51,7 @@ export function memo<Props>(
           Object.defineProperty(type, 'name', {
             value: name,
           });
+          type.displayName = name;
         }
       },
     });
Repository: ollama/ollama
Pull request: Typo Correction in API Documentation

I've noticed a small typo in the API documentation and have submitted a fix for it. The "role" value was written as "assisant" which I've updated to "assistant". 

Changed files:
filename: docs/api.md
patch: @@ -409,7 +409,7 @@ A stream of JSON objects is returned:
   "model": "llama2",
   "created_at": "2023-08-04T08:52:19.385406455-07:00",
   "message": {
-    "role": "assisant",
+    "role": "assistant",
     "content": "The",
     "images": null
   },
@@ -505,7 +505,7 @@ A stream of JSON objects is returned:
   "model": "llama2",
   "created_at": "2023-08-04T08:52:19.385406455-07:00",
   "message": {
-    "role": "assisant",
+    "role": "assistant",
     "content": "The"
   },
   "done": false
Repository: huggingface/transformers
Pull request: Update no split modules in T5Gemma model

There's no T5GemmaBlock implementation. So FSDP no split modules should at least be these two kinds of layers.

Changed files:
filename: src/transformers/models/t5gemma/modeling_t5gemma.py
patch: @@ -585,7 +585,7 @@ class T5GemmaPreTrainedModel(PreTrainedModel):
     config: T5GemmaConfig
     base_model_prefix = "model"
     supports_gradient_checkpointing = True
-    _no_split_modules = ["T5GemmaBlock"]
+    _no_split_modules = ["T5GemmaEncoderLayer", "T5GemmaDecoderLayer"]
     _skip_keys_device_placement = ["past_key_values"]
     _supports_flash_attn = True
     _supports_sdpa = True

filename: src/transformers/models/t5gemma/modular_t5gemma.py
patch: @@ -476,7 +476,7 @@ class T5GemmaPreTrainedModel(Gemma2PreTrainedModel):
     config: T5GemmaConfig
     base_model_prefix = "model"
     supports_gradient_checkpointing = True
-    _no_split_modules = ["T5GemmaBlock"]
+    _no_split_modules = ["T5GemmaEncoderLayer", "T5GemmaDecoderLayer"]
 
     def _init_weights(self, module):
         # TODO: support initialization for encoders and decoders separately(?)

filename: tests/models/t5gemma/test_modeling_t5gemma.py
patch: @@ -597,7 +597,6 @@ class T5GemmaModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
     test_pruning = False
     _is_stateful = True
     is_encoder_decoder = True
-    model_split_percents = [0.5, 0.6]
 
     # used in `test_torch_compile_for_training`
     _torch_compile_train_cls = T5GemmaForConditionalGeneration if is_torch_available() else None
@@ -1460,7 +1459,6 @@ class T5GemmaEncoderOnlyModelTest(ModelTesterMixin, unittest.TestCase):
     test_headmasking = False
     _is_stateful = True
     is_encoder_decoder = False
-    model_split_percents = [0.4, 0.5]
 
     # won't fix
     test_torchscript = False
Repository: ollama/ollama
Pull request: Set corret CUDA minimum compute capability version

If you attempt to run the current CUDA build on compute capability 5.2 cards, you'll hit the following failure:
cuBLAS error 15 at ggml-cuda.cu:7956: the requested functionality is not supported

Changed files:
filename: gpu/gpu.go
patch: @@ -26,8 +26,8 @@ type handles struct {
 var gpuMutex sync.Mutex
 var gpuHandles *handles = nil
 
-// TODO verify this is the correct min version
-const CudaComputeMajorMin = 5
+// With our current CUDA compile flags, 5.2 and older will not work properly
+const CudaComputeMajorMin = 6
 
 // Note: gpuMutex must already be held
 func initGPUHandles() {
Repository: facebook/react
Pull request: [Flight] Try/Catch Eval

Follow up to https://github.com/facebook/react/pull/29632.

It's possible for `eval` to throw such as if we're in a CSP environment. This is non-essential debug information. We can still proceed to create a fake stack entry. It'll still have the right name. It just won't have the right line/col number nor source url/source map. It might also be ignored listed since it's inside Flight.


Changed files:
filename: packages/react-client/src/ReactFlightClient.js
patch: @@ -1648,7 +1648,7 @@ const taskCache: null | WeakMap<
   ConsoleTask,
 > = supportsCreateTask ? new WeakMap() : null;
 
-type FakeFunction<T> = (FakeFunction<T>) => T;
+type FakeFunction<T> = (() => T) => T;
 const fakeFunctionCache: Map<string, FakeFunction<any>> = __DEV__
   ? new Map()
   : (null: any);
@@ -1684,8 +1684,18 @@ function createFakeFunction<T>(
     code += '//# sourceURL=' + filename;
   }
 
-  // eslint-disable-next-line no-eval
-  const fn: FakeFunction<T> = (0, eval)(code);
+  let fn: FakeFunction<T>;
+  try {
+    // eslint-disable-next-line no-eval
+    fn = (0, eval)(code);
+  } catch (x) {
+    // If eval fails, such as if in an environment that doesn't support it,
+    // we fallback to creating a function here. It'll still have the right
+    // name but it'll lose line/column number and file name.
+    fn = function (_) {
+      return _();
+    };
+  }
   // $FlowFixMe[cannot-write]
   Object.defineProperty(fn, 'name', {value: name || '(anonymous)'});
   // $FlowFixMe[prop-missing]
Repository: denoland/deno
Pull request: fix(lsp): don't provide organizeImports action when client provides it

- Fixes https://github.com/denoland/vscode_deno/issues/1345
- Client-side change: https://github.com/denoland/vscode_deno/pull/1348

Changed files:
filename: cli/lsp/config.rs
patch: @@ -1208,6 +1208,14 @@ impl Config {
     })()
     .unwrap_or(false)
   }
+
+  pub fn client_provided_organize_imports_capable(&self) -> bool {
+    (|| {
+      let experimental = self.client_capabilities.experimental.as_ref()?;
+      experimental.get("clientProvidedOrganizeImports")?.as_bool()
+    })()
+    .unwrap_or(false)
+  }
 }
 
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]

filename: cli/lsp/language_server.rs
patch: @@ -2323,8 +2323,9 @@ impl Inner {
     );
 
     // Organize imports
-    if kinds.is_empty()
-      || kinds.contains(&CodeActionKind::SOURCE_ORGANIZE_IMPORTS)
+    if !self.config.client_provided_organize_imports_capable()
+      && (kinds.is_empty()
+        || kinds.contains(&CodeActionKind::SOURCE_ORGANIZE_IMPORTS))
     {
       let document_has_errors = params.context.diagnostics.iter().any(|d| {
         // Assume diagnostics without a severity are errors

filename: tests/integration/lsp_tests.rs
patch: @@ -8033,6 +8033,47 @@ console.log(other, submodule);
   client.shutdown();
 }
 
+#[test]
+#[timeout(300_000)]
+fn lsp_code_actions_organize_imports_client_provided_capability() {
+  let context = TestContextBuilder::new().use_temp_cwd().build();
+  let temp_dir = context.temp_dir();
+  let file = temp_dir.source_file(
+    "file.ts",
+    r#"import { z, y } from "./z.ts";
+import { c, a, b } from "./b.ts";
+import { d } from "./a.ts";
+import unused from "./c.ts";
+
+console.log(b, a, c, d, y, z);
+"#,
+  );
+  let uri = file.uri();
+  let mut client = context.new_lsp_command().build();
+  client.initialize(|builder| {
+    builder.enable_client_provided_organize_imports();
+  });
+  client.did_open_file(&file);
+
+  // Request "Organize Imports" action
+  let res = client.write_request(
+    "textDocument/codeAction",
+    json!({
+      "textDocument": { "uri": uri },
+      "range": {
+        "start": { "line": 0, "character": 0 },
+        "end": { "line": 0, "character": 0 }
+      },
+      "context": {
+        "diagnostics": [],
+        "only": ["source.organizeImports"]
+      }
+    }),
+  );
+  assert_eq!(res, json!(null));
+  client.shutdown();
+}
+
 #[test]
 #[timeout(300_000)]
 fn lsp_code_actions_refactor_no_disabled_support() {

filename: tests/util/server/src/lsp.rs
patch: @@ -321,6 +321,19 @@ impl InitializeParamsBuilder {
     self
   }
 
+  pub fn enable_client_provided_organize_imports(&mut self) -> &mut Self {
+    let obj = self
+      .params
+      .capabilities
+      .experimental
+      .as_mut()
+      .unwrap()
+      .as_object_mut()
+      .unwrap();
+    obj.insert("clientProvidedOrganizeImports".to_string(), true.into());
+    self
+  }
+
   pub fn set_cache(&mut self, value: impl AsRef<str>) -> &mut Self {
     let options = self.initialization_options_mut();
     options.insert("cache".to_string(), value.as_ref().to_string().into());
Repository: ggml-org/llama.cpp
Pull request: sync : ggml


Changed files:
filename: scripts/sync-ggml.last
patch: @@ -1 +1 @@
-7b6abb2b92fcef35cb01c6ce6ada9bd85306522d
+781baf2a14d9e0aaee542b2e1bb918bfc4132199
Repository: nodejs/node
Pull request: doc: fix broken sentence in `URL.parse`

The sentence was broken, so I fixed it using a wording similar to the MDN documentation.

Refs: https://developer.mozilla.org/en-US/docs/Web/API/URL/parse_static#return_value
<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/url.md
patch: @@ -720,7 +720,7 @@ added: v22.1.0
 
 Parses a string as a URL. If `base` is provided, it will be used as the base
 URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
-if `input` is not a valid.
+if the parameters can't be resolved to a valid URL.
 
 ### Class: `URLPattern`
Repository: denoland/deno
Pull request: fix(node): missing `statfs` export from `node:fs/promises`

We already had the functionality, we just didn't export it.

Fixes https://github.com/denoland/deno/issues/31526

Changed files:
filename: ext/node/polyfills/fs/promises.ts
patch: @@ -16,6 +16,7 @@ export const readlink = fsPromises.readlink;
 export const symlink = fsPromises.symlink;
 export const lstat = fsPromises.lstat;
 export const stat = fsPromises.stat;
+export const statfs = fsPromises.statfs;
 export const fstat = fsPromises.fstat;
 export const link = fsPromises.link;
 export const unlink = fsPromises.unlink;

filename: tests/unit_node/fs_test.ts
patch: @@ -42,6 +42,7 @@ import {
   lutimes,
   open,
   stat,
+  statfs,
   writeFile,
 } from "node:fs/promises";
 import process from "node:process";
@@ -183,6 +184,13 @@ Deno.test(
   },
 );
 
+Deno.test(
+  "[node/fs/promises statfs] export statfs function",
+  async () => {
+    await statfs(import.meta.filename!);
+  },
+);
+
 Deno.test(
   "[node/fs/promises cp] copy file",
   async () => {
Repository: facebook/react
Pull request: fix[ReactDebugHooks/find-primitive-index]: remove some assumptions

Partially reverts https://github.com/facebook/react/pull/28593.

While rolling out RDT 5.2.0, I've observed some issues on React Native side: hooks inspection for some complex hook trees, like in AnimatedView, were broken. After some debugging, I've noticed a difference between what is in frame's source.

The difference is in the top-most frame, where with V8 it will correctly pick up the `Type` as `Proxy` in `hookStack`, but for Hermes it will be `Object`. This means that for React Native this top most frame is skipped, since sources are identical.

Here I am reverting back to the previous logic, where we check each frame if its a part of the wrapper, but also updated `isReactWrapper` function to have an explicit case for `useFormStatus` support.



Changed files:
filename: packages/react-debug-tools/src/ReactDebugHooks.js
patch: @@ -868,7 +868,12 @@ function findCommonAncestorIndex(rootStack: any, hookStack: any) {
 }
 
 function isReactWrapper(functionName: any, wrapperName: string) {
-  return parseHookName(functionName) === wrapperName;
+  const hookName = parseHookName(functionName);
+  if (wrapperName === 'HostTransitionStatus') {
+    return hookName === wrapperName || hookName === 'FormStatus';
+  }
+
+  return hookName === wrapperName;
 }
 
 function findPrimitiveIndex(hookStack: any, hook: HookLogEntry) {
@@ -878,21 +883,24 @@ function findPrimitiveIndex(hookStack: any, hook: HookLogEntry) {
     return -1;
   }
   for (let i = 0; i < primitiveStack.length && i < hookStack.length; i++) {
+    // Note: there is no guarantee that we will find the top-most primitive frame in the stack
+    // For React Native (uses Hermes), these source fields will be identical and skipped
     if (primitiveStack[i].source !== hookStack[i].source) {
-      // If the next frame is a method from the dispatcher, we
-      // assume that the next frame after that is the actual public API call.
-      // This prohibits nesting dispatcher calls in hooks.
+      // If the next two frames are functions called `useX` then we assume that they're part of the
+      // wrappers that the React package or other packages adds around the dispatcher.
+      if (
+        i < hookStack.length - 1 &&
+        isReactWrapper(hookStack[i].functionName, hook.dispatcherHookName)
+      ) {
+        i++;
+      }
       if (
         i < hookStack.length - 1 &&
         isReactWrapper(hookStack[i].functionName, hook.dispatcherHookName)
       ) {
         i++;
-        // Guard against the dispatcher call being inlined.
-        // At this point we wouldn't be able to recover the actual React Hook name.
-        if (i < hookStack.length - 1) {
-          i++;
-        }
       }
+
       return i;
     }
   }
@@ -1040,7 +1048,7 @@ function buildTree(
     const levelChild: HooksNode = {
       id,
       isStateEditable,
-      name: name,
+      name,
       value: hook.value,
       subHooks: [],
       debugInfo: debugInfo,