text string | label_name string | labels int64 |
|---|---|---|
T> {
fn new(value: Option<T>) -> Self {
Self { value }
}
}
impl<T: fmt::Display> fmt::Display for OptionFormat<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.value {
Some(ref value) => write!(f, "{value:.2}"),
None => f.write_str("-"),
... | Rust | 0 |
00/c0000000.rle");
let rle = parse_rle(0, data).unwrap();
}
#[test]
fn test_c0000042_rle() {
let data = include_bytes!("../../../data/RLEs/Chr/C00/c0000042.rle");
let rle = parse_rle(42, data).unwrap();
}
#[test]
fn test_c0200188_rle() {
let data = i... | Rust | 0 |
interrupt.
/// * DMA2_IT_TC1: DMA2 Channel1 transfer complete interrupt.
/// * DMA2_IT_HT1: DMA2 Channel1 half transfer interrupt.
/// * DMA2_IT_TE1: DMA2 Channel1 transfer error interrupt.
/// * DMA2_IT_GL2: DMA2 Channel2 global interrupt.
/// * DMA2_IT_TC2: DMA2 Channel2 transfer complete interrupt.
/// * DMA2_IT_HT... | Rust | 0 |
::new([-2.0, -1.0, 0.0, 1.0, 2.0]);
let r1 = Sin.forward(t.clone());
let r2 = sin(t);
assert_eq!(r1.data(), r2.data());
}
#[test]
fn test_cos() {
let t = Tensor1D::new([-2.0, -1.0, 0.0, 1.0, 2.0]);
let r1 = Cos.forward(t.clone());
let r2 = cos(t);
asse... | Rust | 0 |
let (total, count) = bitcoin_transactions
.iter()
.filter_map(|tx| tx.detail.fee.map(|amount| amount.as_sat().abs() as u64))
.fold((0, 0), |(total, count), x| (total + x, count + 1));
*vault.metrics.average_btc_fee.data.write().await = AverageTracker { total, count };
... | Rust | 0 |
fish_img_pos)
for pos, val in enumerate(stage):
# 绘制打工地图
stage_bg = get_save_file(val).resize(stage_bg_size, Image.ANTIALIAS)
stage_bg_pos = (500, 2 + 162 * pos)
coop_stage_bg.paste(stage_bg, stage_bg_pos)
# 绘制 地图名
stage_name_bg = get_stage_name_bg(val.zh_name, 25)
... | Python | 1 |
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class BaseLanguageInstall(models.TransientModel):
_inherit = "base.language.install"
website_ids = fields.Many2many('website', string='Websites to translate')
@api.... | Python | 1 |
ocess_sqlx_with_multiple_refs(templater):
input_sqlx = """config {
type: "view",
columns: {
"test" : "test",
"value:: "value"
}
}
SELECT * FROM ${ref('test')} JOIN ${ref('other_table')} ON test.id = other_table.id
"""
expected_sql = "\nSELECT * FROM `my_project.my_dataset.test` JOIN ... | Python | 1 |
import os
import sys
import numpy as np
import argparse
import open3d as o3d
import plateaupy
### usage
# python test/statistics.py -loc 533925 -c
# argparser
parser = argparse.ArgumentParser(description='plateaupy appviewer')
parser.add_argument('-paths','--paths',help='list of paths to CityGML dirctories',default=... | Python | 1 |
t!("{}.name", readable_key_prefix), "string");
let value = table.remove(key).ok_or_else(&error)?;
value.into_str().map_err(|_| error())
}
impl ConfigReader for Config {
fn new() -> Self {
let conf = Config { accounts: Vec::new() };
return conf;
}
fn read(&mut self) -> Result<(), Co... | Rust | 0 |
l_embeddings.shape
if self.context_feature == 'attention':
visual_context = torch.cat([global_feat.reshape(B, C, 1), visual_embeddings.reshape(B, C, H*W)], dim=2).permute(0, 2, 1) # B, N, C
visual_one = visual_embeddings.reshape(B, C, H*W).permute(0, 2, 1)
# (B, K, C)
text_... | Python | 1 |
mand=mostrar_interfaz_principal, bg='blue', fg='white', font=("Arial", 14)).pack(pady=40)
# Configurar la aplicación principal
aplicacion = interface.Tk()
aplicacion.configure(bg='#dff0d8')
aplicacion.title("Bienvenido a EcoGas")
# Pantalla de bienvenida
pantalla_bienvenida = interface.Frame(aplicacion, bg='#dff0d8')... | Python | 1 |
def settings(user_id: str, username: str, password: str) -> str:
return "系统设置"
def version(username: str, password: str) -> str:
return "获取版本"
| Python | 1 |
vids, _) => {
write!(
w,
"concatn {}",
FmtCommaSep::new(vids.iter(), |w, vid| FmtVid(func, *vid, verbose).fmt(w))
)?;
}
Hhbc::ConsumeL(lid, _) => {
write!(w, "consume_local {}", FmtLid(lid, ctx.strings))?;
}
... | Rust | 0 |
T as i32,
/// Right region of interest for the auto-exposure algorithm.
ExposureRoiRight = sys::rs2_frame_metadata_value_RS2_FRAME_METADATA_EXPOSURE_ROI_RIGHT as i32,
/// Top region of interest for the auto-exposure algorithm.
ExposureRoiTop = sys::rs2_frame_metadata_value_RS2_FRAME_METADATA_EXPOSURE_RO... | Rust | 0 |
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="scrum-cli",
version="1.0.0",
author="Rachit Gandhi",
author_email="rachit@example.com",
description="AI-powered meeting assistant with real-time transcript... | Python | 1 |
from typing import List
class Solution:
def getMaximumXor(self, nums: List[int], maximumBit: int) -> List[int]:
res =0
for num in nums:
res^=num
mask = (1<< maximumBit)-1
answer = []
for num in reversed(nums):
answer.append(res^mask)
... | Python | 1 |
ity, _minion, transform) in (entities, minions, transforms).join() {
let tower_translation = tower_transform.translation();
if self.is_in_range(tower_translation, transform.translation()) {
self.target = Some(entity);
self.fire(projectiles)... | Rust | 0 |
"""
Created 07-01-21 by Mojtaba Heydari <mheydari@ur.rochester.edu>
"""
# Local imports
# None.
# Third party imports
# None.
# Python standard library imports
import setuptools
from setuptools import find_packages
import distutils.cmd
# Required packages
REQUIRED_PACKAGES = [
'numpy',
'cython',
'lib... | Python | 1 |
2rust_unnamed_4: C2RustUnnamed_7,
pub c2rust_unnamed_5: C2RustUnnamed_6,
pub c2rust_unnamed_6: C2RustUnnamed_5,
pub c2rust_unnamed_7: C2RustUnnamed_4,
pub c2rust_unnamed_8: C2RustUnnamed_3,
pub c2rust_unnamed_9: C2RustUnnamed_2,
pub c2rust_unnamed_10: C2RustUnnamed_1,
pub c2rust_unnamed_11: ... | Rust | 0 |
#!/usr/bin/env python
from vtkmodules.vtkCommonCore import (
vtkFloatArray,
vtkMath,
)
from vtkmodules.vtkCommonDataModel import (
vtkImageData,
vtkPiecewiseFunction,
)
from vtkmodules.vtkFiltersCore import (
vtkDelaunay3D,
vtkProbeFilter,
)
from vtkmodules.vtkFiltersSources import vtkPointSourc... | Python | 1 |
import cudf
import dask_cudf
def add_id_column(input_parquet_path: str, output_parquet_path: str = None, id_column: str = "id"):
"""
Add an ID column to a parquet file.
Args:
input_parquet_path: Path to input parquet file
output_parquet_path: Path to save output parquet (if None, over... | Python | 1 |
utput, TimedOut>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
let future: Pin<&mut tokio::time::Timeout<F>> = this.future;
if let Poll::Ready(result) = future.poll(cx) {
match result {
Ok(out) => Poll::R... | Rust | 0 |
k_cargo_toml().await?;
let mut wasm_path = format!(
"./target/wasm32-unknown-unknown/release/{}.wasm",
contract_name
);
let wasm_tmpl = build_constructor_template(&wasm_path).await?;
if debug {
let tmpl_path = format!(
"./target/wasm32-unknown-unknown/release/{}.tm... | Rust | 0 |
.build(),
)
.slice(
SliceBuilder::new(true)
.origin(relative_file_path)
.source_annotation(
text_range_to_tuple(diagnostic.highlight_range()),
&format!("use of possibly-uninitialized `{}`", variable_name),
... | Rust | 0 |
about when and how often to download directory information
download_schedule: DownloadScheduleConfig,
/// Facility to override network parameters from the values set in the
/// consensus.
#[serde(default)]
override_net_params: HashMap<String, i32>,
/// Information about how to build paths thr... | Rust | 0 |
LocalEngine, modifies: Vec<Modify>) -> Result<()> {
fail_point!("rockskv_write_modifies", |_| Err(box_err!("write failed")));
let mut wb = kv_engine.write_batch();
for rev in modifies {
let res = match rev {
Modify::Delete(cf, k) => {
if cf == CF_DEFAULT {
... | Rust | 0 |
import logging
from rcs.envs.base import ControlMode, RelativeTo
from rcs.envs.creators import SimEnvCreator
import rcs
from rcs import sim
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def main():
robot_cfg = sim.SimRobotConfig()
robot_cfg.actuators = ["1", "2", "3", "4", "5"]
ro... | Python | 1 |
```no_run
/// async {
/// use podman_api::Podman;
/// use podman_api::opts::{ImageListOpts, ImageListFilter};
/// let podman = Podman::unix("/run/user/1000/podman/podman.sock");
///
/// for image in podman
/// .images()
/// .list(
/// &Ima... | Rust | 0 |
# coding: utf-8
"""
Slurm REST API
API to access and control Slurm
The version of the OpenAPI document: Slurm-24.11.5&openapi/slurmdbd&openapi/slurmctld
Contact: sales@schedmd.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E50... | Python | 1 |
= settings.resources
assert resources is not settings._resources
def test_resources_not_set_on_error():
settings = SgeQsubBatchSettings()
unaltered_resources = settings.resources
with pytest.raises(TypeError):
settings.resources = {"meep": Exception}
assert unaltered_resources == settings... | Python | 1 |
nsactions for this session
transactions: Vec<KRB5Transaction>,
/// tx counter for assigning incrementing id's to tx's
tx_id: u64,
}
pub struct KRB5Transaction {
/// The message type: AS-REQ, AS-REP, etc.
pub msg_type: MessageType,
/// The client PrincipalName, if present
pub cname: Option... | Rust | 0 |
import unittest
import numpy as np
from pymatgen.core.structure import Lattice, Molecule, Structure
from m3gnet.graph import RadiusCutoffGraphConverter, tf_compute_distance_angle
from m3gnet.layers import PairDistance, PairVector, SphericalBesselWithHarmonics
class TestTwoBody(unittest.TestCase):
@classmethod
... | Python | 1 |
.dds", 0x5353_4703, 0x7D94_4234),
(r"icons\c\tx_amulet_com4.dds", 0x5353_4703, 0x90C5_295B),
(r"icons\c\tx_amulet_com3.dds", 0x5353_4703, 0xB3D8_E722),
(r"icons\c\tx_amulet_com2.dds", 0x5353_4703, 0xE1E3_7BD0),
(r"meshes\d\ex_cave_door_01.nif", 0x5357_1237, 0x62E4_B78A),
(r"meshes\d\ex_de_ship_... | Rust | 0 |
('N');
set.insert('O');
set.insert('P');
set.insert('Q');
set.insert('R');
set.insert('S');
set.insert('T');
set.insert('U');
set.insert('W');
set.insert('V');
set.insert('X');
set.insert('Y');
set.insert('Z');
set.i... | Rust | 0 |
-----------------------------------------------------------------
pub fn iter_available(conn: &Connection) -> Result<Vec<Available>, rusqlite::Error> {
let mut stmt = conn.prepare(
r#"
SELECT available.title, url, publication, duration_secs, feedurl, feed.title, lastupdate
FROM available INN... | Rust | 0 |
from datasets import load_dataset
def get_bb_dataset(split):
if split == "causal_judgement":
raw_dataset = load_dataset("tasksource/bigbench", "causal_judgment")
choices = ["Yes", "No"]
dataset = []
for split_ in ["validation", "train"]:
for dp in raw_dataset[split_]... | Python | 1 |
m
}
/// Sort fields, by encoded size, using stable sort
/// Arrays are treated as being the size of their members
pub fn sort_fields_by_desc_encoded_len(&mut self) {
//array types are sorted by the type of the array items
self.fields.sort_by(|a, b| {
b.uorbtype.field_sortin... | Rust | 0 |
ptr: extern "C" fn()) -> u64;
fn rump_pub_etfs_register(key: *const i8, hostpath: *const i8, ftype: i32) -> i32;
fn rump_pub_netconfig_dhcp_ipv4_oneshot(iface: *const i8) -> i64;
fn _libc_init();
fn mount(typ: *const i8, path: *const i8, n: u64, args: *const tmpfs_args, argsize: usize);
... | Rust | 0 |
c68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120,
0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0,
0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef,
0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa... | Rust | 0 |
(3600, 360, 5, 2),
(3600, 300, 6, 2)])
# Land Cover CCI
self.assertEqual(pow2_1d_subdivisions(129600),
[(129600, 675, 3, 7),
(129600, 405, 5, 7),
(129600, 810, 5, 6),
... | Python | 1 |
"тыя",
"іх",
"у",
"уже",
"хотя",
"чего",
"чей",
"чем",
"что",
"чтобы",
"чье",
"чья",
"эта",
"эти",
"это",
"яго",
"яе",
"яму",
"яна",
"адзін",
"два",
"тры",
"чатыры",
"пяць",
"шэсць",
"сем",
"восем",
"дзевяць",
... | Rust | 0 |
print("4. If no tasks show, check 'gh issue list -l conductor:task' to debug")
print("5. Review CLAUDE.md for my instructions")
print("```")
def _display_traditional_setup_steps(self):
"""Display traditional setup steps"""
print("\n📋 Traditional Setup Steps:")
print("... | Python | 1 |
"""
LeetCode 3: Longest Substring Without Repeating Characters
Difficulty: Medium
Concept:
---------
This is a **variable-size sliding window** problem.
- We need the longest substring with no duplicate characters.
- Use two pointers (left, right) to define a window.
- Expand right pointer to include characters.
- If... | Python | 1 |
unsolicited_report_interval` [RFC 2710 section 7.10]
///
/// [RFC 2710 section 7.10] https://tools.ietf.org/html/rfc2710#section-7.10
const DEFAULT_UNSOLICITED_REPORT_INTERVAL: Duration = Duration::from_secs(10);
impl Default for MldConfig {
fn default() -> Self {
MldConfig {
unsolicited_report... | Rust | 0 |
class Solution:
def isValidBST(self, root: Optional[TreeNode]) -> bool:
low_range,high_range=float('-inf'),float('inf')
def check(root,low_range,high_range):
if root==None:
return True
if root.val<=low_range or root.val>=high_range:
return F... | Python | 1 |
mode) } == FALSE {
return Err(io::Error::last_os_error().into());
}
Ok(())
}
// Ref https://docs.microsoft.com/en-us/windows/console/clearing-the-screen#example-2
#[cfg(feature = "windows-console")]
pub(crate) fn clear() -> Result<(), Error> {
let console = console_handle()?;
let csbi = buffer_info(co... | Rust | 0 |
ent_roles
if (user_event_role.event_id is None) or (event != "all" and user_event_role.event_id == event.id)
] + [None]
for role in roles:
role_permissions = ROLE_PERMISSIONS.get(role)
if role_permissions is None:
continue
action_checker: BaseActionChecker | None = g... | Python | 1 |
"""
Exercice 1:
Dans cet exercice, vous devez expliquer les différences entre
les différentes fonctions de lecture de texte à partir d'un fichier.
ATTENTION! Ne pas exécuter toutes les lignes d'un coup. Enlever un commentaire à la fois.
"""
with open("zen.txt") as f:
print(f.read())
print(f.read(12))
print(... | Python | 1 |
#!/usr/bin/env python3
"""
Auto Changelog Updater Hook
This hook automatically updates the changelog after git commits are made.
It runs the update-changelog.py script in automatic mode to analyze recent
commits and update the CHANGELOG.md file accordingly.
Hook Type: post_tool_use
Triggers On: git commit commands
""... | Python | 1 |
d_completed
def review_details(self):
review_groups = FaultReviewGroup.objects.order_by("-required", "group__name")
review_group_instances = self.faultreviewinstance_set.order_by(
"-fault_review_group__required",
"fault_review_group__group__name",
).select_related(
... | Python | 1 |
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar
from attrs import define as _attrs_define
from attrs import field as _attrs_field
from ..models.recurring_task_period import RecurringTaskPeriod
if TYPE_CHECKING:
from ..models.calendar_events_stats_per_subperiod import CalendarEv... | Python | 1 |
from __future__ import annotations
from typing import TYPE_CHECKING, Iterable, List, TypeVar, cast, overload
from prompt_toolkit.formatted_text.base import OneStyleAndTextTuple
if TYPE_CHECKING:
from typing_extensions import SupportsIndex
__all__ = [
"explode_text_fragments",
]
_T = TypeVar("_T", bound=One... | Python | 1 |
grave",
0x1001eb2u32 => "Abrevehook",
0x1001eb3u32 => "abrevehook",
0x1001eb4u32 => "Abrevetilde",
0x1001eb5u32 => "abrevetilde",
0x1001eb6u32 => "Abrevebelowdot",
0x1001eb7u32 => "abrevebelowdot",
0x1001eb8u32 => "Ebelowdot",
0x1001eb9u32 => "ebelowdot",
0x1001ebau32 => "Ehook",
0x1001ebbu32 => "ehook",
0x1001ebcu32 =... | Rust | 0 |
failure::bail!("rtnl_link_alloc_cache failed: {}", ret);
}
let link =
rtnl_link_get_by_name(all_links, std::ffi::CString::new(if_name).unwrap().as_ptr());
let ifindex = rtnl_link_get_ifindex(link);
// println!("nitems={:#?}", nl_cache_nit... | Rust | 0 |
catalog: &CrateCatalog,
) -> Option<Result<(CrateContext, bool)>> {
let own_crate_catalog_entry = catalog.entry_for_package_id(&node.id)?;
let own_package = own_crate_catalog_entry.package();
let is_binary_dep = self
.settings
.binary_deps
.keys()
.any(|key| key == &own_packag... | Rust | 0 |
let data = OptionalData {
test: Some("value".into()),
};
assert_eq!(serde_json::to_string(&data).unwrap(), "{\"test\":\"value\"}");
let data = OptionalData {
test: None,
};
assert_eq!(serde_json::to_string(&data).unwrap(), "{}");
}
use thiserror::Error;
use crate::constants::... | Rust | 0 |
import random
from textblob import TextBlob
from compliment_bank import positive_compliments, neutral_compliments, negative_comforts
def detect_sentiment(text):
blob = TextBlob(text)
polarity = blob.sentiment.polarity
if polarity > 0.3:
return "positive"
elif polarity < -0.1:
return "ne... | Python | 1 |
# Adjacency matrix
matrix = [
[0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1],
[1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1],
[0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0],
[0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1],
[0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1],
[1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,... | Python | 1 |
_binding
} else {
// Create a new binding
let keyframe_viewmodel = self.get_keyframe_model(&frames);
let new_binding = Arc::new(Binding::new(keyframe_viewmodel));
keyframes.insert(frames, Arc::downgrade(&new_binding));
new_binding
}
}
... | Rust | 0 |
ut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
///
/// // enable the HSI16 source clock
/// dp.RCC.cr.modify(|_, w| w.hsion().set_bit());
/// while dp.RCC.cr.read().hsirdy().is_not_ready() {}
///
/// let uart: Uart2<NoRx, NoTx> = Uart2::new(dp.USART2, 115_200, uart::Clk::Hsi16, &mu... | Rust | 0 |
_fields: &[String],
batch_webhook_id: &str,
) -> Result<crate::types::Webhooks> {
let mut query_args: Vec<(String, String)> = Default::default();
if !exclude_fields.is_empty() {
query_args.push(("exclude_fields".to_string(), exclude_fields.join(" ")));
}
if !field... | Rust | 0 |
return dag unchanged
if not can_fuse_predecessors(
dag,
name,
array_names=array_names,
max_total_source_arrays=max_total_source_arrays,
max_total_num_input_blocks=max_total_num_input_blocks,
always_fuse=always_fuse,
never_fuse=never_fuse,
):
return... | Python | 1 |
_open_parentheses == 0
{
let position_of_closing_parenthesis = character_index;
let (parenthesized_expression, _) =
remaining_input.split_at(position_of_closing_parenthesis);
let remaining_input = characters.as_str();
return Ok(Some((parenthesized_expression, remaining_input)));
}
}
Err(crate::p... | Rust | 0 |
value) })
.collect::<Vec<u32>>();
match keep.len() {
0 => None,
1 => Some(keep[0]),
_ => sieve(&keep, i + 1, bits, filter),
}
}
sieve(input, 0, bits, filter)
}
fn calculate_oxygen_generator_rating(input: &Vec<u32>, bits: usize) -> Option<u32> {
... | Rust | 0 |
open(self.TMPDIR / "microsd" / "skipped.md").read(),
"\n### files",
# spoiler it
"<details><summary>click to expand</summary>\n\n```\n\n",
open(self.TMPDIR / "microsd" / "files.txt").read(),
"\n\n```\n\n</details>\n",
"\n#... | Python | 1 |
#
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley with assistance from asn1ate v.0.6.0.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# TEST Company Classification Policies
#
# ASN.1 source from:
# https://www.rfc-editor.org/rfc/rfc3114.txt
... | Python | 1 |
MetaButtonMapping {
location: ButtonGridLocation::MetaBottom,
coordinate: ButtonCoordinate::new(2, 0),
on_action: MetaButtonAction::SelectFixtureGroupControl(FixtureGroupId::new(3)),
off_action: None,
},
MetaButtonMappi... | Rust | 0 |
[
("start_datetime", &start_time),
("end_datetime", &start_time),
],
)?
} else {
url.parse()?
};
Ok(url)
}
pub async fn sync_with_client(
&self,
start_datetime: Option<DateTime<Utc>>,
... | Rust | 0 |
const a = -Infinity",
"const a = NaN",
"const a = +NaN",
"const a = -NaN",
"const a = null",
"const a = /a/",
"const a = RegExp('a')",
"const a = RegExp?.('a')",
"const a = new RegExp?.('a')",
"const a = 'str'",
r#"const a = "str""#,
"const a = `str`",
... | Rust | 0 |
, '𝠥', '🃖', '\u{fa8}', '𘨠',
'ᨮ', '³', '⋧', 'ഓ', '⧘', '𖹵', '⒩', 'ⶄ', 'ḽ', '᪦', 'ၪ', 'ﰻ',
'𔕮', '౿', '𖢷', 'ꢪ', '𑿬', 'ꌁ', '⌳', '𖩎', 'ᅮ', 'ꫠ', 'ⱘ',
'\u{8e0}', 'ꌬ', '⸔', '𓋺', '🧜', '𐾁', '𐭦', '⯢', '𝞚', 'ڗ', 'ꐓ',
'ퟂ', '𒄈', '𖧄', '⾷', '𐝢', '🀕', '΄', '𖹆', '𑧟', 'ờ', 'ᨏ', '꣙',
'బ', '𐏑', '燐', '... | Rust | 0 |
sector = Location::new(0, 0);
self.filename = Petscii::from_bytes(&[0u8; ENTRY_FILENAME_LENGTH]);
self.extra = Extra::default();
self.file_size = 0;
// The position field must be left untouched.
}
/// Read the serialized directory entry from the provided byte slice, and
/// ... | Rust | 0 |
self.log(ERROR, msg, *args)
tb = None
if isinstance(exc_info, BaseException):
tb = exc_info
elif hasattr(sys, "exc_info"):
tb = sys.exc_info()[1]
if tb:
buf = io.StringIO()
sys.print_exception(tb, buf)
self.log(ERROR, buf.getva... | Python | 1 |
= "hail",
is_rainy: hourly_precip == "rain",
is_snowy: hourly_precip == "snow",
uv_index: hourly_uv_index.unwrap_or(0.into()).into(),
summary: hourly.unwrap().to_owned(),
wind_speed: hourly_wind_speed.unwrap_or(0.into()).into(),
... | Rust | 0 |
count: usize,
}
fn load_vertex_attribute<'a, V: GltfDataType>(
decoded: &'a GltfDecoded,
accessor: Accessor<'_>,
output: &mut Vec<u8>,
) -> Result<Range<usize>, GltfLoadingError> {
if V::DIMENSIONS != accessor.dimensions() {
return Err(GltfLoadingError::UnexpectedDimensions {
un... | Rust | 0 |
nblockMAX = 0;
s.save_nblock = 0;
s.save_es = 0;
s.save_N = 0;
s.save_curr = 0;
s.save_zt = 0;
s.save_zn = 0;
s.save_zvec = 0;
s.save_zj = 0;
s.save_gSel = 0;
s.save_gMinlen = 0;
s.save_gLimit = std::ptr::null_mut();
s.save_... | Rust | 0 |
= 1;
iter::from_fn(move || {
let range = PatternRange {
m,
start: pos + n - 1,
end: pos + 2 * n - 1,
};
pos += 2 * n;
m *= -1;
Some(range)
})
}
fn run_phase(signal: &mut DigitList) {
let partial_sum = signal
.iter()
... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2014 Google LLC. 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 requir... | Python | 1 |
fn get_cflags(mkl_dirs: &MklDirectories) -> Vec<String> {
if cfg!(target_os = "windows") {
get_cflags_windows(mkl_dirs)
} else if cfg!(target_os = "linux") {
get_cflags_linux(mkl_dirs)
} else {
panic!("Target OS not supported");
}
}
#[derive(Debug)]
pub struct Callbacks;
impl P... | Rust | 0 |
# 方法3:简化函数(论文风格)
print("\n方法3:简化函数(论文风格)")
tau_simple = kendall_corr(x1, y1)
print(f"肯德尔相关系数: {tau_simple:.4f}")
# 验证结果一致性
print(f"\n结果验证:")
results = [tau_basic, tau_stats, tau_simple]
print(f"API版本: {tau_basic:.6f}")
print(f"统计版本: {tau_stats:.6f}")
print(f"简化函数: {ta... | Python | 1 |
continue;
}
if group.len() < min_weight_count
|| (group.len() == min_weight_count
&& quantum_entanglement.unwrap() < min_quantum_entanglement)
{
min_weight_count = group.len();
min_quantum_entanglement = quantum_entanglement.unwrap();
}
}
min_quantum_entanglement
}
... | Rust | 0 |
addr(), "chunk marked UNLOADED from read buffer");
Ok(DbChunk::snapshot(&chunk))
}
#[macro_use]
extern crate pretty_assertions;
extern crate lcd;
mod util;
use lcd::{FunctionDots, FunctionLine, FunctionMode};
#[test]
fn init_4bit() {
let input = vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
let vec =... | Rust | 0 |
([ao_soc0, ao_soc1, ao_soc2])
mo_soc = np.einsum("kpq,ip,jq->kij", ao_soc, mo_coeff, mo_coeff)
coeff_thresh = 1e-5
x_coeff_s1, y_coeff_s1 = g_parser_s1.get_xy_coeff()
xpy_coeff_s1 = x_coeff_s1 + y_coeff_s1
norm_s1 = np.sqrt(np.trace(xpy_coeff_s1 @ xpy_coeff_s1.T) * 2.0)
xpy_coeff_s1 = xpy_coe... | Python | 1 |
assert_eq!(vfs.mode(&file2).unwrap(), 0o100777);
// no recurse = dir1 is the only chmod that will occur
assert!(vfs.chmod_b(&dir1).unwrap().no_recurse().dirs(0o755).files(0o644).exec().is_ok());
assert_eq!(vfs.mode(&dir1).unwrap(), 0o40755);
assert_eq!(vfs.mode(&file1).unwrap(), 0o1... | Rust | 0 |
#!/usr/bin/env python3
import os, traceback, sys
import romtools as rt
from mfvitools.mml2mfvi import mml_to_akao
def akao_to_asm(data, channels, mfvi_labels):
symbol_list = []
label_list = []
# add a symbol for the size of the song data
symbol_list.append((0, '.word', 'SongEnd - Header'))
# a... | Python | 1 |
let mut allocated = vec![];
let arena = ArenaImpl::new();
let n = 100000;
let mut bytes = 0;
let rnd = Random::new(301);
for i in 0..n {
let mut s;
if i % (n / 10) == 0 {
s = i;
} else {
s = if rnd.one_in(4000)... | Rust | 0 |
reat computer scientist:
let mut dijkstra = User {
id: Uid::new_oid()?,
legal_name: String::from("<NAME>"),
contact: Some(Contact::Phone(String::from("+31 10 123 4567"))),
birthday: NaiveDate {
year: 1930,
month: 5,
day: 11,
}
};
us... | Rust | 0 |
om/Homebrew/homebrew-core/issues/40179 for more details\n"
);
}
Err(err)
}
}
}
"##)
} else {
writeln!(
w,
"{}",
r##" Err(err) => Err(err),
}
}
"##
)
}
}
<gh_stars>100-1000
//! `InfluxDB` is a telem... | Rust | 0 |
thread")]
#[cfg(all(feature = "check", feature = "stream"))]
async fn test_base58_encode_stream_check() {
encode_stream_address!(
"12f4bd0587c43594b0ddb2ef4e616d24232d14eee07f45b46ac19ef3b11e7c7e6be2a59b6284ad5b1a1b43051d07e788756dcfff36008637322a1c975eeb614927",
"4Au2dGq2uFHWapf... | Rust | 0 |
#=======================================================================
# verilog_bug_test.py
#=======================================================================
import pytest
from pymtl import *
from exceptions import VerilatorCompileError
pytestmark = requires_verilator
#-------------------------------... | Python | 1 |
import socket
IDENTIFIER = "<END_OF_COMMAND_RESULT>"
eof_identifier = "<END_OF_FILE_IDENTIFIER>"
CHUNK_SIZE = 2048
def receive_file():
print("Receiving file")
if __name__ == "__main__":
hacker_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
IP = "X.X.X.X"
Port = 8008
socket_address = ... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
bonus property
"""
from rebulk import Rebulk, AppendMatch, Rule
from rebulk.remodule import re
from .title import TitleFromPosition
from ..common.formatters import cleanup
from ..common.pattern import is_disabled
from ...config import load_config_patterns
def bonus(c... | Python | 1 |
None => {
warn!("Failed to get 'labels' from {} -> {}", stype, id);
continue;
},
Some(l) => l,
};
if m.ends_with("Bwc") && v.is_object() {
let m_io_name = format!("{}_{}_iops", stype, mdef[m].as_object().unw... | Rust | 0 |
.
//!
//! Template contain the state of the page they relate to and are returned
//! by a handler since they can be rendered to HTML.
use crate::models::User;
use crate::news::models::NewsStory;
/// Companion to `MaybeLoggedIn`
///
/// HTML File: `index.html`
///
/// This is a simple wrapper to act as the companion t... | Rust | 0 |
signal
self.current = x.clone();
self.transition(state.clone(), x);
} else {
panic!("State {:?} probed Action::DelayedTransition to event {:?}, but doesn't return Action::Transition", state, evt);
// sel... | Rust | 0 |
ue
break
if stop:
break
t = y + 1
# left
l = 0
stop = False
for x in xrange(w):
for y in xrange(h):
p = i.getpixel((x,y))
if not is_transparent(p):
stop = True
break
if stop:
... | Python | 1 |
# tab2
import streamlit as st
# 색상 지정 함수
def get_color(number):
number = int(number)
if 1 <= number <= 10:
return "#f9c74f" # 노란색
elif 11 <= number <= 20:
return "#007bff" # 파란색
elif 21 <= number <= 30:
return "#dc3545" # 빨간색
elif 31 <= number <= 40:
return "#6c75... | Python | 1 |
= DB2QA.CREATE_TABLE.format(table=name, fields=", ".join(columns))
# pylint: disable=W0703
try:
db.execute(create)
except Exception as e:
print(create)
print("Failed to create table: " + e)
def find(self, question, cur):
"""
Finds a corre... | Python | 1 |
iter: impl IntoIterator<Item = T>) -> &'ast mut [T]
where
T: AstAlloc<'ast, Id>,
{
T::alloc_extend(iter, self)
}
}
$(
impl<'ast, Id> AstAlloc<'ast, Id> for $ty {
fn alloc(self, arena: &'ast Arena<'ast, Id>) -> &'as... | Rust | 0 |
:
network: Required. Network name. If the network is not part of the
organization, the `compute.network.get` permission must be granted to
the caller. Format: `//compute.googleapis.com/projects/{PROJECT_ID}/glob
al/networks/{NETWORK_NAME}` Example:
`//compute.googleapis.com/projects/my-proje... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.