char_count
int64
200
992k
dataset
stringclasses
5 values
domain
stringclasses
2 values
id
stringlengths
32
32
text
stringlengths
200
992k
timestamp
stringdate
2026-04-01 17:36:18
2026-04-03 14:59:37
tokens_count
int64
31
663k
2,540
github-top-code
code
fdefaa0d9765e75b35e28587493d60ff
#include "settings.h" #include <esp_log.h> #include <nvs_flash.h> #define TAG "Settings" Settings::Settings(const std::string& ns, bool read_write) : ns_(ns), read_write_(read_write) { nvs_open(ns.c_str(), read_write_ ? NVS_READWRITE : NVS_READONLY, &nvs_handle_); } Settings::~Settings() { if (nvs_handle_ != 0) { if (r...
2026-04-02 17:15:34
960
2,600
github-top-code
code
a01937dfd3a5bbddebe93d2454c09180
<# .SYNOPSIS Merges the latest changes from Library.Template into HEAD of this repo. .PARAMETER LocalBranch The name of the local branch to create at HEAD and use to merge into from Library.Template. #> [CmdletBinding(SupportsShouldProcess = $true)] Param( [string]$LocalBranch = "dev/$($env:USERNAME)/libtemplateUpdate"...
2026-04-02 17:15:34
760
9,173
github-top-code
code
38a1d05f07f65f2277a7b0be282e4bd5
//! Build script for PHPantomLSP. //! //! Parses `stubs/jetbrains/phpstorm-stubs/PhpStormStubsMap.php` and generates //! a Rust source file (`stub_map_generated.rs`) that: //! //! 1. Embeds every referenced PHP stub file via `include_str!`. //! 2. Provides static arrays mapping class names and function names to //! ind...
2026-04-02 17:15:34
2,926
964
github-top-code
code
86e2536fa97b9690e7895fe6161494dd
from __future__ import annotations import numpy as np class my_float: def __radd__(self, other: np.float32) -> my_float: return my_float() a = np.float32() b = np.float32() reveal_type(a + b) # Revealed type is "numpy.floating[numpy.typing._32Bit]" class _FloatOp(Protocol[_NBit1]): @overload def __call__(self, __other:...
2026-04-02 17:15:34
342
1,381
github-top-code
code
ab27feb455f8d73200981dec3cbbb5c2
from dataclasses import dataclass from typing import Any, Callable # here both `Parent` and `Child` are frozen dataclasses @dataclass(frozen=True) class Parent: __call__: Callable[..., None] def __call__(self, *args: Any, **kwargs: Any) -> None: # type: ignore raise NotImplementedError @dataclass(frozen=True) class Chi...
2026-04-02 17:15:34
407
481
github-top-code
code
35550333b8261a33702587ee23ef4b4b
from typing import Any @dataclass class C: dict:object # This attribute name shadows `dict` type, but it should not shadow the name inside of the `class` lexical scope; that's not how python works. d:dict # This attribute is annotated as `dict`. The interpreter does not pick up the previous shadowed attribute, but mypy...
2026-04-02 17:15:34
133
803
github-top-code
code
0e2d204b9acbff8d2781beafb391bd55
// Copyright 2023 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "crash-reporter/crash_sender_paths.h" #include <gtest/gtest.h> namespace paths { namespace { // Chrome's crash report log file when not under the dry run mode. conste...
2026-04-02 17:15:34
221
498
github-top-code
code
9eb45fd16679f5728bfffc8d028ecedd
// Copyright 2024 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Provides the help string for the crosh "help_advanced" command. // // The actual command is handled by `main.rs`. use crate::dispatcher::{Command, Dispatcher}; pub fn regis...
2026-04-02 17:15:34
122
2,987
github-top-code
code
b8579bba7f64834897fbf3260c5c2f4c
// Copyright 2014 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "debugd/src/dev_mode_no_owner_restriction.h" #include <gtest/gtest.h> namespace debugd { namespace { // Test class to fake different system state conditions. class Fa...
2026-04-02 17:15:34
892
849
github-top-code
code
64f1830bea6bb4123e8f7b7267ff4ed0
// Copyright 2021 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef HPS_DAEMON_FILTERS_THRESHOLD_FILTER_H_ #define HPS_DAEMON_FILTERS_THRESHOLD_FILTER_H_ #include <memory> #include "base/functional/callback.h" #include "hps/daemon/filt...
2026-04-02 17:15:34
226
3,203
github-top-code
code
f311d1305824f378e6d944c413544e84
// Copyright 2024 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "init/startup/mount_var_home_encrypted_impl.h" #include <sys/mount.h> #include <memory> #include <optional> #include <stack> #include <string> #include <utility> #inc...
2026-04-02 17:15:34
884
1,939
github-top-code
code
5304194e98dce4518e974a5945f00b1b
// Copyright 2024 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "odml/on_device_model/public/cpp/text_safety_assets.h" #include <cstdint> #include <string_view> #include <base/files/file.h> #include <base/files/file_util.h> #inclu...
2026-04-02 17:15:35
569
4,432
github-top-code
code
bdb7e95681f29be7ed161c874a838bb6
// Copyright 2014 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef POWER_MANAGER_POWERD_POLICY_INPUT_DEVICE_CONTROLLER_H_ #define POWER_MANAGER_POWERD_POLICY_INPUT_DEVICE_CONTROLLER_H_ #include <string> #include "power_manager/common/...
2026-04-02 17:15:35
1,140
2,054
github-top-code
code
5d620d1fe7280d984629f7adc62e580c
// Copyright 2022 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SECANOMALYD_SYSTEM_CONTEXT_H_ #define SECANOMALYD_SYSTEM_CONTEXT_H_ #include <set> #include <base/files/file_path.h> #include <session_manager/dbus-proxies.h> using Se...
2026-04-02 17:15:35
524
1,944
github-top-code
code
31ee6248c3ded5f16d4c3241dd99da1e
// Copyright 2023 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VM_TOOLS_CONCIERGE_MM_BALLOON_METRICS_H_ #define VM_TOOLS_CONCIERGE_MM_BALLOON_METRICS_H_ #include <string> #include <base/functional/callback.h> #include <base/sequen...
2026-04-02 17:15:35
565
2,321
github-top-code
code
48a09225a31fdfaa92a4cfbb856e3771
// Copyright 2022 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VTPM_BACKENDS_REAL_TPM_HANDLE_MANAGER_H_ #define VTPM_BACKENDS_REAL_TPM_HANDLE_MANAGER_H_ #include "vtpm/backends/tpm_handle_manager.h" #include <map> #include <unorde...
2026-04-02 17:15:35
710
3,032
github-top-code
code
8536568e9d61b4b3608510e79a2505c1
// Copyright 2023 The Dawn & Tint Authors // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following d...
2026-04-02 17:15:35
743
7,437
github-top-code
code
fd85588807488acac4e7eef32ecf16db
// Copyright 2025 The Dawn & Tint Authors // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following d...
2026-04-02 17:15:35
2,193
5,442
github-top-code
code
46cb020ba5ca8f5da5eb06f76d6ccf95
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <algorithm> #include <set> #include "base/command_line.h" #include "base/strings/string_split.h" #include "gn/commands.h" #include "gn/metadata_wa...
2026-04-02 17:15:35
1,548
1,815
github-top-code
code
6baacf606dd9f473dba4adfc0551e86c
import threading import queue import time import random class Channel: MAX_REQUEST = 100 def __init__(self, threads): self.request_queue = queue.Queue(maxsize=self.MAX_REQUEST) self.thread_pool = [] self.cv = threading.Condition() for i in range(threads): self.thread_pool.append(WorkerThread("Worker-" + str(i), self)) ...
2026-04-02 17:15:35
540
10,171
github-top-code
code
a8e4bde282fdba4d395751649d6bef59
# Defines functions and macros useful for building Google Test and # Google Mock. # # Note: # # - This file will be run twice when building Google Mock (once via # Google Test's CMakeLists.txt, and once via Google Mock's). # Therefore it shouldn't have any side effects other than defining # the functions and macros. # ...
2026-04-02 17:15:35
3,346
3,468
github-top-code
code
d69cafdb1ed11641b468e33b7441baa1
use std::io::Write; use crate::{ args::{self, Usage, positional}, round::TimeSpanBalance, span::TimeSpan, }; const USAGE: &'static str = r#" Balance spans to a specified largest unit. When a unit isn't given, it defaults to `years`, which is the largest unit supported by Biff. Balancing a span refers to either collapsi...
2026-04-02 17:15:36
1,041
1,352
github-top-code
code
461f7fae46b34f6819ca2bd31870c714
'use strict'; /** * Created by:CaMnter */ /****************** * Promise.race() * ******************/ /** * Promise.race 方法也是用于将多个 Promise 实例 * 包装成一个新的 Promise 实例 * * 与 Promise.all 的区别在于:只要 Promise 数组中,有一个 Promise 最先改变状态 * 那么 Promise.race 返回的 Promise 实例 */ (function () { var arrayA = [true, false, false]; // 依然会走 then P...
2026-04-02 17:15:36
555
449
github-top-code
code
6188865845b41992792ae68c22b0b89c
// Copyright 2023 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <iostream> void calcSum(int* x, int length, int& sum) { for (int i = 0; i < length; ++i) { sum += x[i]; } } int main() { int sum = 0, n = 10; int x[10]; /* initialize x...
2026-04-02 17:15:36
164
1,769
github-top-code
code
6f14ebfbf793a62e9bc265ba27128685
// Copyright 2025 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as i18n from './i18n.js'; describe('fetchAndRegisterLocaleData', () => { let fetchStub: sinon.SinonStub; beforeEach(() => { fetchStub = sinon.stub(window, 'fetch'); fet...
2026-04-02 17:15:36
600
1,853
github-top-code
code
f5be4d52db5fc166cec11222a0e724f8
/* * Copyright 2025 The Chromium Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @scope to (devtools-widget > *) { :scope { position: fixed; z-index: 9999; /* subtract var(--sys-size-5) * 2 so that there is equal space on the left and on the right in smal...
2026-04-02 17:15:36
664
2,004
github-top-code
code
6c8e97dce989d9ad51d32a0ed1910b1a
# Copyright 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
2026-04-02 17:15:36
610
2,411
github-top-code
code
3080598df0229807e43452ee71f24353
//------------------------------------------------------------------------------ // <auto-generated> // Este código fue generado por una herramienta. // Versión de runtime: 4.0.30319.42000 // // Los cambios de este archivo pueden provocar un comportamiento inesperado y se perderán si // el código se vuelve a generar. ...
2026-04-02 17:15:36
624
935
github-top-code
code
e168576a5d27e06b1a78fee657403290
/* eslint-disable no-undef */ const path = require('path'); const webpack = require('webpack'); module.exports = { mode: 'development', devtool: 'cheap-module-source-map', entry: { 'polymer-demos': './src/index.js' }, output: { path: path.resolve(__dirname, '..', 'dist'), filename: '[name].js', publicPath: '/' }, resol...
2026-04-02 17:15:36
313
360
github-top-code
code
0d2f234a796023f494c1e42e66a736b1
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits * * @path ch07/7.2/S7.2_A5_T4.js * @description Use S...
2026-04-02 17:15:36
106
576
github-top-code
code
883379339053804543818fa2ffa7db03
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Multi line comment can contain CARRIAGE RETURN (U+000D) * * @path ch07/7.3/S7.3_A5.2_T1.js * @description Insert CARRIAGE RETURN (U+000D) into multi line comment */ // CHECK#1 eval("/...
2026-04-02 17:15:36
230
298
github-top-code
code
6b29b75c533cfb3d3ac6368d5cb60579
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * DecimalLiteral :: ExponentPart is incorrect * * @path ch07/7.8/7.8.3/S7.8.3_A4.1_T2.js * @description ExponentPart :: E DecimalDigits * @negative */ //CHECK#1 E1
2026-04-02 17:15:36
94
465
github-top-code
code
bf275505a19623d64ffff79e63cead1b
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Check For Statement for automatic semicolon insertion. * If automatic insertion semicolon would become one of the two semicolons in the header of a For Statement. * Use one semicolon ...
2026-04-02 17:15:36
129
369
github-top-code
code
f8ad8657344a2dc6d4f37eadbab0ac82
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Operator x || y uses GetValue * * @path ch11/11.11/11.11.2/S11.11.2_A2.1_T4.js * @description If ToBoolean(x) is true and GetBase(y) is null, return true */ //CHECK#1 if ((true || x) ...
2026-04-02 17:15:36
133
561
github-top-code
code
101809dcdec479ae6bde1d58e5bdb57a
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Operator --x returns x = ToNumber(x) - 1 * * @path ch11/11.4/11.4.5/S11.4.5_A3_T5.js * @description Type(x) is Object object or Function object */ //CHECK#1 var x = {}; --x; if (isNaN...
2026-04-02 17:15:36
205
942
github-top-code
code
f58ae53ffc302367c305507d3d9a625a
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Operator x - y returns ToNumber(x) - ToNumber(y) * * @path ch11/11.6/11.6.2/S11.6.2_A3_T2.6.js * @description Type(x) is different from Type(y) and both types vary between String (pri...
2026-04-02 17:15:36
310
584
github-top-code
code
d9bc5a0e46ee830ba107d31748f8b3e9
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * 1. Evaluate Expression * * @path ch12/12.13/S12.13_A3_T2.js * @description Evaluating string expression */ // CHECK#1 try{ throw "exception"+" #1"; } catch(e){ if (e!=="exception #1")...
2026-04-02 17:15:37
192
956
github-top-code
code
f94cfd4a14b57c4ce0708a0564139b04
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
248
729
github-top-code
code
bdc2b696a54cfb3424740ab57b6c4f41
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
205
728
github-top-code
code
b6f9b2a304cba40ba113e0ab918adfb4
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
203
641
github-top-code
code
263df62f7ed5aa011d3bd756c8df0f61
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
193
900
github-top-code
code
dd7a9d602f87698f1009882e55505aaf
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
261
1,135
github-top-code
code
9484546049a894cc5941c82feb809e07
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
327
804
github-top-code
code
c80a51d4caee9188ec0dea8cde9925de
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
246
1,003
github-top-code
code
c535cab2c4dbc792a305a3491ed5010f
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
311
545
github-top-code
code
46b812804ab7753ef0d8e5daa41916df
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Object.prototype.toLocaleString has not prototype property * * @path ch15/15.2/15.2.4/15.2.4.3/S15.2.4.3_A6.js * @description Checking if obtaining the prototype property of Object.pr...
2026-04-02 17:15:37
156
786
github-top-code
code
635b2555c305944d6f93646cc8c0f12e
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this...
2026-04-02 17:15:37
218
625
github-top-code
code
3c25a86712a54bcb8a34aa6becc2adea
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * [[Get]] from not an inherited property * * @path ch15/15.4/15.4.4/15.4.4.3/S15.4.4.3_A3_T1.js * @description [[Prototype]] of Array instance is Array.prototype */ //CHECK#1 var n = 0;...
2026-04-02 17:15:37
230
1,412
github-top-code
code
e6ae5178fe793de3ac2db18916196d45
// delete operator on any type var ANY; var ANY1; var ANY2 = ["", ""]; var obj; var obj1 = { x: "", y: function () { } }; function foo() { var a; return a; } var A = (function () { function A() { } A.foo = function () { var a; return a; }; return A; })(); var M; (function (M) { M.n; })(M || (M = {})); var objA = new A(...
2026-04-02 17:15:37
417
293
github-top-code
code
d26f239b02180ca18427166c01de683c
// object types can define string indexers that are more specific than the default 'any' that would be returned // no errors expected below var o = {}; var r = o['']; var C = (function () { function C() { } return C; })(); var c; var r2 = c['']; var i; var r3 = i['']; var o2; var r4 = o2[''];
2026-04-02 17:15:37
96
255
github-top-code
code
85c02c65620477473322513ca04c05f4
var _Color = (function () { function _Color() { } return _Color; })(); var Color; (function (Color) { Color.namedColors; })(Color || (Color = {})); var a = Color.namedColors["azure"]; var a = Color.namedColors.blue; var a = Color.namedColors["pale blue"];
2026-04-02 17:15:37
78
2,205
github-top-code
code
198b1ffa1cba9ab6eff8f3492c88a730
import { useState, useCallback } from 'react' import { AttachedImage } from './types' export function useImageHandler() { const [attachedImages, setAttachedImages] = useState<AttachedImage[]>([]) const [isDragging, setIsDragging] = useState(false) const processImageFiles = useCallback((files: FileList | File[]) => { co...
2026-04-02 17:15:37
641
256
github-top-code
code
e5ed16afbe0ca701690f661c9d10c30a
import { Component, ViewEncapsulation } from '@angular/core' @Component({ selector: 'ex-guide-main', templateUrl: './main.component.html', styleUrls: ['./main.component.scss'], encapsulation: ViewEncapsulation.None, }) export class ExGuideMainComponent { }
2026-04-02 17:15:38
78
4,684
github-top-code
code
590d0cd00e8dbc47d6e6ae3d13730bcb
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js"; export class ChatbotView { #config; #container = document.querySelector("#ewcb-widget"); #header = document.querySelector(".ewcb-chat-header"); #messages = document.querySelector("#ewcb-messages"); #input = document.querySelector("#ewcb-inp...
2026-04-02 17:15:38
1,420
578
github-top-code
code
18f2139651021fa5cbb83a72e9cf7787
% British Royal family (small subset of) male(philip). male(william). male(harry). male(charles). male(george). female(elizabeth). female(diana). parent(elizabeth, charles). parent(philip, charles). parent(diana, william). parent(charles, william). parent(diana, harry). parent(charles, harry). parent(william, george). ...
2026-04-02 17:15:38
193
10,233
github-top-code
code
71688a6206d8a86d788a5ffddd8d95c7
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] //! Tests for the kex_done callback and shared secret access. //! //! This feature enables protocol bridging use cases where applications need to //! derive additional encryption keys from the SSH KEX shared secret. use std::borrow::Cow; use std::sync::...
2026-04-02 17:15:38
3,297
1,245
github-top-code
code
08a63b34796726e707f01f870cdbe2c4
/* * Copyright 2017 GcsSloop * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, soft...
2026-04-02 17:15:38
336
4,810
github-top-code
code
9180e6a27056c3b7985e78b811e6ab7d
import json from pathlib import Path from typing import Any, Dict, Iterable, List from urllib.parse import urlparse import numpy as np import ray import typer from numpyencoder import NumpyEncoder from ray.air import Result from ray.train.torch.torch_checkpoint import TorchCheckpoint from typing_extensions import Annot...
2026-04-02 17:15:38
1,349
6,920
github-top-code
code
4b9407fd289d42a8e92595dd16e54f0c
package schema import ( _ "embed" "encoding/json" "fmt" "strings" "github.com/kaptinlin/jsonschema" "github.com/samber/oops" "gopkg.in/yaml.v3" ) //go:embed ai-rules-v2.schema.json var schemaV2JSON []byte //go:embed ai-rules-v3.schema.json var schemaV3JSON []byte var compiler = jsonschema.NewCompiler() const properties...
2026-04-02 17:15:38
1,918
18,255
github-top-code
code
214429866d3e6f20a5fa47b95d29fd48
//! Tests for background fixtures //! Generated from: testing_data/background #[cfg(test)] mod background { use axum::body::Body; use axum::http::Request; use serde_json::Value; use spikard::testing::TestServer; #[tokio::test] async fn test_background_background_event_logging() { // Fixture: Background event logging //...
2026-04-02 17:15:38
6,012
36,366
github-top-code
code
32bb822180f212d956ebc9286fd77e9f
//! Spikard Rust HTTP server for workload benchmarking. //! //! This server uses the actual Spikard Rust crate to test performance //! with Rust handlers (no FFI overhead). //! //! Provides both raw endpoints (no validation) and validated endpoints (with schema validation) //! at the /validated/ prefix. use axum::body:...
2026-04-02 17:15:38
12,030
1,318
github-top-code
code
4417651c5900f78e3f0cc4db7ea016d8
import org.gradle.api.initialization.resolve.RepositoriesMode pluginManagement { repositories { gradlePluginPortal() google() mavenCentral() } } rootProject.name = "android-browser-helper" dependencyResolutionManagement { repositories { repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS google() mavenCentral() /...
2026-04-02 17:15:38
418
2,184
github-top-code
code
70e060ac4aaf9aa998675c9277b7f471
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.compositor.layouts.eventfilter; import android.content.Context; import android.view.MotionEvent; import java.util.Array...
2026-04-02 17:15:39
539
7,238
github-top-code
code
13d11fa8bee5afbd4b3cebc3be7ec217
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.infobar; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManage...
2026-04-02 17:15:39
1,859
3,614
github-top-code
code
93d6b10aa3c0b238efd32d588ba61dcc
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.media.remote; import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; import an...
2026-04-02 17:15:39
861
1,238
github-top-code
code
b827bc0775231e95bdbceedfa3b8c020
import type { ReactNode } from 'react'; import type { ToolResultContentBlock } from '@claude-agent-kit/messages'; import type { ClaudeMessageContext } from '../../../types'; import { FileToolRenderer } from '../file-tool-renderer'; import { isNonEmptyRecord, type ToolInput } from '../utils'; export class ReadRenderer e...
2026-04-02 17:15:39
348
562
github-top-code
code
22347bec29b8961909d3c42c53170558
load("set.js"); var names = new Set(); names.add("David"); names.add("Jennifer"); names.add("Cynthia"); names.add("Mike"); names.add("Raymond"); if (names.add("Mike")) { print("Mike added"); } else { print("Can't add Mike, must already be in set."); } print(names.show()); var removed = "Mike"; if (names.remove("Mike"))...
2026-04-02 17:15:39
170
357
github-top-code
code
841b818107d105181a734889c6684c13
package com.kieronquinn.app.springboardsettings.settings; import android.view.View; /** * Created by Kieron on 25/02/2018. */ public class TextSetting extends BaseSetting { View.OnClickListener onClickListener; String text; public TextSetting(String text, View.OnClickListener onClickListener) { this.text = text; this.o...
2026-04-02 17:15:39
94
525
github-top-code
code
f7e2e0902ac9ff9737a9315f5bc22bbf
package com.google.android.gsa.overlay.model import android.os.Bundle data class ByteBundleHolder(val bytes: ByteArray, val extras: Bundle) { override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false other as ByteBundleHolder if (!bytes.contentEquals(oth...
2026-04-02 17:15:39
134
1,123
github-top-code
code
37e3cdcc1c71d09d52de4b3910cf4229
import os import sys import warnings # Remove '' and current working directory from the first entry # of sys.path, if present to avoid using current directory # in pip commands check, freeze, install, list and show, # when invoked as python -m pip <command> if sys.path[0] in ("", os.getcwd()): sys.path.pop(0) # If we a...
2026-04-02 17:15:39
335
975
github-top-code
code
a2827c45badd47fcfbe975336ff09726
class UnpackException(Exception): """Base class for some exceptions raised while unpacking. NOTE: unpack may raise exception other than subclass of UnpackException. If you want to catch all error, catch Exception instead. """ class BufferFull(UnpackException): pass class OutOfData(UnpackException): pass class FormatErr...
2026-04-02 17:15:40
219
1,905
github-top-code
code
be813c99fe7e0e0fc11230e0eef08083
import { sql } from "../db/postgres" import { validateInsertTodo, validateUpdateTodo, validateInsertConfig, validateUpdateConfig, } from "../db/validation" import { PendingMutation } from "../../../src/types" import { processMutations } from "./write-to-pg" import express from "express" const router = express.Router() ...
2026-04-02 17:15:40
490
926
github-top-code
code
8e8bb82dc253067a4c0c2dd3fb201590
import { Variants, BezierDefinition } from 'framer-motion'; // Transition timing constants (ms) export const TRANSITION_TIMING = { PUNK_DURATION: 350, STROBE_ENTER: 700, STROBE_EXIT: 300, HACKING_EXIT: 450, SMOOTH_ENTER: 240, SMOOTH_EXIT: 280, PAGE_SWAP_BUFFER: 80, } as const; // Easing curves export const EASE: Bezier...
2026-04-02 17:15:40
354
2,198
github-top-code
code
fa91dfeb15c20468463e268747a0e014
/* * Copyright 2016 Maxim Tuev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, s...
2026-04-02 17:15:40
527
1,222
github-top-code
code
ac9ca113eb0de5fecfd1e40a687a9491
import { createDefaultCoreModule, createDefaultSharedCoreModule, type DefaultSharedCoreModuleContext, inject, type LangiumCoreServices, type LangiumSharedCoreServices, type Module, type PartialLangiumCoreServices, } from 'langium'; import { EipcGeneratedModule, EipcGeneratedSharedModule } from './generated/module.js'; ...
2026-04-02 17:15:40
278
650
github-top-code
code
dc57f4720aa3d40c17ccab9ee984a791
import * as TypeGraphQL from "type-graphql"; import * as GraphQLScalars from "graphql-scalars"; import { PostCreateInput } from "../../../inputs/PostCreateInput"; import { PostUpdateInput } from "../../../inputs/PostUpdateInput"; import { PostWhereUniqueInput } from "../../../inputs/PostWhereUniqueInput"; @TypeGraphQL....
2026-04-02 17:15:40
179
451
github-top-code
code
6958569634aed2401d686bc2cb2dee18
import * as TypeGraphQL from "type-graphql"; import * as GraphQLScalars from "graphql-scalars"; import { Prisma } from "../../../client"; import { DecimalJSScalar } from "../../scalars"; @TypeGraphQL.ObjectType("ProblemSumAggregate", {}) export class ProblemSumAggregate { @TypeGraphQL.Field(_type => TypeGraphQL.Int, { ...
2026-04-02 17:15:40
130
1,221
github-top-code
code
b2d0e4bce0bb1efd5d357e5fb4c56d14
#!/usr/bin/env bash set -ue source="${BASH_SOURCE[0]}" # resolve $source until the file is no longer a symlink while [[ -h "$source" ]]; do scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" source="$(readlink "$source")" # if $source was a relative symlink, we need to resolve it relative to the path where the # s...
2026-04-02 17:15:40
421
354
github-top-code
code
50c4b33610843c82a9d8ad159c18edc8
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #ifdef __GNUC__ #ifdef __clang__ #pragma clang attribute push (__attribute__((target("avx512f,avx512dq"))), apply_to = any(function)) #else #pragma GCC push_options #pragma GCC target...
2026-04-02 17:15:40
112
1,693
github-top-code
code
c2003e17778c8d25f4f964f0216f71ee
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /*============================================================= ** ** Source: virtualprotect.c ** ** Purpose: Positive test the VirtualProtect API. ** Call VirtualProtect to set new p...
2026-04-02 17:15:40
442
3,211
github-top-code
code
ed494db1cff67002b99e7def25299f2a
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /*============================================================= ** ** Source: loadlibrary.c (test 6) ** ** Purpose: Positive test the LoadLibrary API. Test will verify ** that it is u...
2026-04-02 17:15:40
974
963
github-top-code
code
14782f8d83feea87723601ebc0f967fb
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class IpHlpApi { public const int MAX_HOSTNAME_LEN = 128; public co...
2026-04-02 17:15:41
284
423
github-top-code
code
5300922d5d69111bf5a789c902eda41c
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; internal static partial class Interop { internal static partial class User32 { [DllImport(Librar...
2026-04-02 17:15:41
101
6,624
github-top-code
code
d2919197dd8c34c30377076cd8e29ab8
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; namespace Microsoft.Extensions.DependencyModel { public static class Depen...
2026-04-02 17:15:41
1,578
361
github-top-code
code
48c25e126eee7b88014ced53c445bc26
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments { public class RecursiveWildcardSegment : IPathSegment { public bool CanProduceStem => true; publ...
2026-04-02 17:15:41
83
4,957
github-top-code
code
5f80ce7de3d2407f81be5e1a694acbfa
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; using System.Data.Common; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Threading; using System.Threading.Tasks; namespace System.D...
2026-04-02 17:15:41
1,272
4,323
github-top-code
code
5027d7953d3e5ca5278b8570434ac4f0
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // Copyright (c) 2004 Mainsoft Co. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "S...
2026-04-02 17:15:41
1,093
2,023
github-top-code
code
ae74ac17e60ee49a9e9b0b94bc4e3f42
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // // System.Drawing.PrintEventArgs.cs // // Author: // Dennis Hayes (dennish@Raytek.com) // // (C) 2002 Ximian, Inc // // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) //...
2026-04-02 17:15:41
452
2,763
github-top-code
code
880f5ad75f979f1f63d822d6b9a10c1b
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.InteropServices; using Xunit; namespace System.Globalization.Tests { /// <summary> /// According to the ToASCII algorithm, if the UseSTD3ASCIIRules ...
2026-04-02 17:15:41
1,070
661
github-top-code
code
d652563efe7d1760d2da4f54339c250d
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Xunit; namespace System.IO.Tests { public class FileInfo_Delete : File_Delete { protected override void Delete(string path) { new FileInfo(path).Delete(); } [Fact] public void F...
2026-04-02 17:15:41
161
3,718
github-top-code
code
5b230aa93511a384afde81705159ae07
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Xunit; namespace System.IO.Tests { [PlatformSpecific(TestPlatforms.Windows)] public class Junctions : BaseSymbolicLinks { private DirectoryInfo CreateJunction(string junctionPa...
2026-04-02 17:15:41
906
9,529
github-top-code
code
1f65be2f5cb552a3cd32f1af4406c2f1
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.IO.PortsTests; using System.Linq; using System.Text; using System.Threading; using Legacy.Support; using Xunit; namespace System.IO.Ports.Tests ...
2026-04-02 17:15:41
2,628
1,556
github-top-code
code
5670b2158527a62c165412d4f6442940
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /*============================================================ ** ** ** ** ** ** Purpose: Exception for a missing satellite assembly needed ** for ultimate resource fallback. This usu...
2026-04-02 17:15:41
402
4,079
github-top-code
code
7d3bc82e3dd26f2effc6933be6135d26
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using OLEDB.Test.ModuleCore; using System.IO; namespace System.Xml.Tests { [InheritRequired()] public abstract partial class TCXMLException : TCXMLReaderBaseGeneral { private void Com...
2026-04-02 17:15:42
1,143
18,612
github-top-code
code
237a51a4be62457605fc07651149f808
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.Serialization; using System.Xml; using System.Xml.Serialization; namesp...
2026-04-02 17:15:42
4,647
803
github-top-code
code
490b3b502710e549b31a5773c050e03a
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Security.Principal; using Xunit; namespace System.Security.AccessControl.Tests { public class RawAcl_IsSynchronized { [Fac...
2026-04-02 17:15:42
222
11,979
github-top-code
code
7de4ae4fdf3d11a3addb923f50dfa0f1
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Internal.Cryptography; using Internal.NativeCrypto; using System.IO; using System.Runtime.Versioning; namespace System.Security.Cryptography { public sealed partial class RSACry...
2026-04-02 17:15:42
3,130
642
github-top-code
code
edcf43512d180eb39f8334d901020660
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Diagnostics; using Internal.Cryptography; namespace System.Security.Cryptography.Pkcs { public sealed class AlgorithmIdentifier { public AlgorithmIdentifier...
2026-04-02 17:15:42
178
15,576
github-top-code
code
620d7fdc330ac5203b7639482ffa299b
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; using System.Collections.Generic; using System.Linq; using Xunit; namespace System.Text.Encodings.Web.Tests { public class TextEncoderTests { [Fact] public void ...
2026-04-02 17:15:42
4,909
522
github-top-code
code
633cf658583cebbafb45573a16a097b7
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; internal class Program { private static int s_result = 100; private static int Main() { Test(1L << 32); return s_result; } [Method...
2026-04-02 17:15:43
159