text
string
label_name
string
labels
int64
''' Что нужно знать? and ----> ∧ or ----> v → ----> <= P.S. подумайте почему = ----> == ≠ ----> != ''' print('>>>>>>>') # К.Ю.Поляков 385 ''' Элементами множеств А, P, Q являются натуральные числа, причём P={1,3,7}, Q={1,2,4,5,6}. Известно, что выражение ((x ∉ A) → (x ∉ P)) ∨ ((x ∉ Q) ∧ (x ∈ P)) истинн...
Python
1
ponse: content = chunk["message"]["content"] if content: if not full_response and console: stop_spinner.set() if spinner_thread: spinner_thread.join() console.print("\r...
Python
1
# Copyright 2016 gRPC authors. # # 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...
Python
1
device_id: i32, flags: KeymapCompileFlags, ) -> Keymap { unsafe { Keymap::from_raw_ptr(xkb_x11_keymap_new_from_device( context.get_raw_ptr(), connection.get_raw_conn(), device_id, flags, )) } } #[must_use] pub fn state_new_from_device( ...
Rust
0
import os import time import yaml import omnigibson as og from omnigibson.macros import gm NUM_STEPS = 100 def main(random_selection=False, headless=False, short_exec=False): # Load the config gm.RENDER_VIEWER_CAMERA = False gm.ENABLE_FLATCACHE = True gm.USE_GPU_DYNAMICS = False gm.ENABLE_TRANS...
Python
1
[doc = "`read()` method returns [tcd14_soff::R](tcd14_soff::R) reader structure"] impl crate::Readable for TCD14_SOFF {} #[doc = "`write(|w| ..)` method takes [tcd14_soff::W](tcd14_soff::W) writer structure"] impl crate::Writable for TCD14_SOFF {} #[doc = "TCD Signed Source Address Offset"] pub mod tcd14_soff; #[doc = ...
Rust
0
impl ::protobuf::ProtobufEnum for StellarSignTx_StellarMemoType { fn value(&self) -> i32 { *self as i32 } fn from_i32(value: i32) -> ::std::option::Option<StellarSignTx_StellarMemoType> { match value { 0 => ::std::option::Option::Some(StellarSignTx_StellarMemoType::NONE), ...
Rust
0
V price data from both exchanges separately """ for pair_key, pair in self.datasets.items(): for interval_key, interval in pair.items(): print(f"\nCorrelation matrix for {pair_key} for {interval_key} interval on Binance exchange") print(interval[["open_Binance...
Python
1
} else { bad_txs.push(tx.clone()); } } (ok_txs, bad_txs) } } <gh_stars>0 #[macro_use] extern crate tracing; use opentelemetry::{api::{Provider, Sampler}, exporter::trace::jaeger, global, sdk}; use std::{thread, time::Duration}; use tracing_attributes::instrument; ...
Rust
0
import json import time from dataclasses import dataclass, field from datetime import datetime from pathlib import Path from typing import Any, Dict, List from agent import patch2checker, patch2pattern, pattern2plan, plan2checker from checker_data import CheckerData from checker_example import init_example from checke...
Python
1
# coding=utf-8 # Copyright 2025 The HuggingFace Inc. team. 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 r...
Python
1
:test] async fn test_scale_to_exponent_up() { test_instr_exec_ok(instruction::scale_to_exponent(pc(1, u64::MAX, 1000), -1000)).await } #[tokio::test] async fn test_scale_to_exponent_best_case() { test_instr_exec_ok(instruction::scale_to_exponent(pc(1, u64::MAX, 10), 10)).await } #[tokio::test] async fn test_n...
Rust
0
TTI too seq_id = 0 cam_id = 0 pass start = 0 end = -1 # Rotation angles around axes angle_x_range = 5 angle_y_range = 15 angle_x_period = 400 # in terms of frames angle_y_period = 200 # Displacement ranges as percentages of mean displacement in each direction b...
Python
1
RelativeOid, /// but faster. /// /// # Examples /// /// ``` /// # use oid_str::RelativeOid; /// /// let oid = RelativeOid::from_bytes(b"\x81\x01\x02\x82\x00").unwrap(); /// assert_eq!(oid.get(2..).unwrap().as_bytes(), b"\x02\x82\x00"); /// // Arc boundary /// assert_eq!(o...
Rust
0
r of points used and the mode is returned Return: numpy array or (value, npts, mode) if index is not None . """ arr = np.asarray(arr) if np.iscomplexobj(arr): raise ValueError("Derivatives of complex functions are not supported!") # Retrieve weights. try: centr_ws = ce...
Python
1
atch(Interaction::Previous), PageNavigation::Update); assert_eq!(sut.current_char, 1); assert_eq!(sut.dispatch(Interaction::Previous), PageNavigation::Update); assert_eq!(sut.current_char, 0); } #[test] fn dispatch_action_back_and_up() { let value: CellSetting<i32> = Default::default(); let mut sut...
Rust
0
def draw_matches(img1, kp1, img2, kp2, matches, color=None): """Draws lines between matching keypoints of two images. Keypoints not in a matching pair are not drawn. Places the images side by side in a new image and draws circles around each keypoint, with line segments connecting matching pairs. ...
Python
1
u16, pub pAddress: *mut super::WinSock::SOCKADDR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Networking_WinSock"))] impl ::core::marker::Copy for HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Networking_WinSock"))] impl ::core::clone::Clone for HTTP_...
Rust
0
# flops = FlopCountAnalysis(model,inputs) # n_param = sum([p.nelement() for p in model.parameters()]) # 所有参数数量 # print(f'GMac:{flops.total()/(1024*1024*1024)}') # print(f'Params:{n_param}') model2 = Mamba( # This module uses roughly 3 * expand * d_model^2 parameters d_model=16, # M...
Python
1
/// this fn map_ptr<T>(proc: &mut super::Process, ptr: usize) -> &'static mut T { unsafe { (proc.map_mem(ptr).unwrap() as *mut T).as_mut() }.unwrap() } /// Nanosleep Syscall pub fn syscall_nanosleep(proc: &mut super::Process, time: usize, _remaining: usize) -> usize { let time: &'static mut IncomingTime = map_...
Rust
0
's should evaluate node function. Modify this function to // experiment with custom difficulties. fn should_evaluate_node(depth: i32) -> bool { if depth == 0 { true } else { let evaluate_node_probability = 0.8; rand::thread_rng().gen_bool(evaluate_node_probability) } } fn main() { ...
Rust
0
Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceSkuLocationInfo { #[doc = "Gets location of the SKU"] #[serde(default, skip_serializing_if = "Option::is_none")] pub location: Option<String>, #[doc = "Gets list of availability zones where the SKU is supported."] #[serde(defaul...
Rust
0
mu.adjacency ) if verbose: print('\n_test_hawkes_cumulants_solve') print(f'Learner: {Learner}') print(f'penalty: {penalty}') print(f'expected_R_pred:\n{expected_R_pred}') print(f'solution:\n{learner.solution}') self._test_relative_mag...
Python
1
)] #![cfg_attr(feature = "no_core", no_core)] // We definitely don't depend on libstd. // #![no_core] generally covers it for no_core environment. #![cfg_attr(not(feature = "no_core"), no_std)] // Rust language items #![feature(lang_items)] // TODO: Start no core implementation as needed. #[cfg(feature = "no_core")] m...
Rust
0
_pointee(create()); bench_par(b, 4, move || process(&m.load_full())); } #[bench] fn baseline(b: &mut Bencher) { let x = Arc::new(create()); b.iter(|| process(test::black_box(&x))); } fn bench_par<R: 'static>( b: &mut Bencher, threads: usize, f: impl Fn() -> R + Sync + 'static, ) { assert!(...
Rust
0
.unwrap() .into_iter() .find(|x| x.name() == cfg.selected_host) { this.load_device(host, cfg.selected_device); }; this.outputs = PortStorage::new(cfg.outputs); this } #[tracing::instrument(level = "TRACE", skip_all, fields(node_id = self.id....
Rust
0
# Copyright 2025 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
EUROPE, 238 RUSSIAN, 204 MAC, 77 BALTIC, 186 } pub_struct_const! { CLIP, u8, /// [`HFONT::CreateFont`](crate::HFONT::CreateFont) `clip_precision` and /// [`LOGFONT`](crate::LOGFONT) `lfClipPrecision` (`u8`). => DEFAULT_PRECIS, 0 CHARACTER_PRECIS, 1 STROKE_PRECIS, 2 MASK, 0xf LH_ANGLES, 1 << 4 ...
Rust
0
)); let confirmed_blocks = rpc_client.get_confirmed_blocks(start_slot, Some(end_slot))?; let start_slot_index = (start_slot - first_slot_in_epoch) as usize; let end_slot_index = (end_slot - first_slot_in_epoch) as usize; let total_slots = end_slot_index - start_slot_index + 1; let total_blocks = co...
Rust
0
// outputs 33bytes for output in self.outputs.iter() { vec.extend_from_slice(&output.to_bytes()); } // message ?bytes vec.extend_from_slice(self.message.to_bytes()); vec } pub fn from_bytes(bytes: &[u8]) -> Result<Self, String> { // cannot d...
Rust
0
# testing/test_baseline1_svm.py import os import json import joblib import pandas as pd import numpy as np from tqdm import tqdm from configs.config import get_config, LABEL_COLS from scipy.special import expit # ====== 配置 ====== config = get_config("svm") TEST_PATH = "data/processed/test.csv" MODEL_PATH = os.path.joi...
Python
1
PrincipalId::from_str( "bngem-gzprz-dtr6o-xnali-fgmfi-fjgpb-rya7j-x2idk-3eh6u-4v7tx-hqe" ), Ok(id) ); assert!(id.authenticates_for_pubkey(&key)); } #[test] fn parse_derived_id_ok() { let registerer = PrincipalId::try_from( &[ ...
Rust
0
''' This file handles the game logic and manages the game objects. ''' import pygame import random from sprites import Block, Obstacle # Initialize pygame pygame.init() # Set up the display screen_width = 800 screen_height = 400 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption(...
Python
1
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # 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 # notic...
Python
1
width", required=True, type=int, help="Width of the input data" ) parser.add_argument( "-ih", "--input_height", required=True, type=int, help="Height of the input data", ) parser.add_argument( "-ic", "--input_depth", required=True, type=int, help="Depth of...
Python
1
.clone() })?; let response = response .error_for_status() .context(error::HttpResponse { url })?; Ok(response) } /// Copies a file from the path given by `request.instructions` to the tempdir with filename given /// by `request.filename`. fn handle_file_request<P>(request: &LogRequest<'_>, temp...
Rust
0
"""Example of using templates for structured task execution.""" import os from shannon import ShannonClient, EventType # Initialize client client = ShannonClient( grpc_endpoint="localhost:50052", http_endpoint="http://localhost:8081", api_key=os.getenv("SHANNON_API_KEY", ""), ) print("=" * 60) print("Tem...
Python
1
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, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, e...
Rust
0
let from_new_nonce = from_account.nonce; self.insert_account(op.account_id, from_account); updates.push(( op.account_id, AccountUpdate::UpdateBalance { balance_update: (op.tx.token, from_old_balance, from_new_balance), old_nonce: from_old...
Rust
0
def analyze_smc(df): # Placeholder: analyze FVG / BOS / CHoCH return "FVG Detected" if df['close'].iloc[-1] > df['open'].iloc[-1] else "No Pattern"
Python
1
# Author: Alex Gezerlis # Numerical Methods in Physics with Python (2nd ed., CUP, 2023) # Solution to chapter 3, problem 10 # NOTE TO INSTRUCTORS: this solution is made available to all readers (i.e., not locked) from mpl_toolkits import mplot3d import numpy as np import matplotlib.pyplot as plt def phi(xs): x0...
Python
1
from scenarios import * conf = 'fixed_server' scenario = ( send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), expect_stanza("/iq[@type='result']/commands:command[@node='...
Python
1
")?] ); // Test capturing to the bottom left. let fen = Fen::try_from("rnbqkb1r/pppp1ppp/5n2/4p3/2PP4/5N2/PP2PPPP/RNBQKB1R b KQkq - 0 3")?; let state = State::from(fen); let move_list = state.generate_pseudo_legal_pawn_moves(Coordinate::E5); assert_eq!( ...
Rust
0
.app student_id = int(request.match_info['student_id']) course_id = int(request.match_info['course_id']) data = await request.post() async with app['db'].acquire() as conn: student = await Student.get(conn, student_id) course = await Course.get(conn, course_id) if not student or ...
Python
1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import re from collections import defaultdict from re import RegexFlag from typing import List def extract_structure_data(plain_text_content: str): # extracts lines starts with specific flags # map id to its related information data...
Python
1
import datetime import logging import time import uuid from datetime import timedelta from pathlib import Path import pandas as pd import plotly.express as px import plotly.graph_objects as go import pytz import streamlit as st from azure.core.exceptions import ResourceNotFoundError from azure.storage.blob import Blob...
Python
1
,extra_edge_index),dim=1) else: complete_edge_index = twoway_edge_index outdegree_node_index, indegree_node_index = complete_edge_index[0], complete_edge_index[1] if precompute_Moments is None: """node to node contribution""" (A_node_to_node, two_way_B_node_to_node,single_way_B...
Python
1
, 2), (addresses[0].to_hex(), 0, 1)]; let msg = deltas_msg(&input, "GetDeltas"); let res: Value = conn_and_call_ipc(&msg.to_string(), port); let deltas_accepted = res["result"]["deltas"].as_array().unwrap(); let first_address = deltas_accepted[0]["address"].as_str().unwrap(); let second_address = de...
Rust
0
#[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> YNLR_PULL_UP_A { match self.bits { false => YNLR_PULL_UP_A::YNLR_PULL_UP_0, true => YNLR_PULL_UP_A::YNLR_PULL_UP_1, } } #[doc = "Checks if the value of the field is `YNLR_PUL...
Rust
0
(f"_{key.lower()}", None) for key in type(self).env_keys()} self.__dict__.update(store_env_dict) # this is hacky # print(f"__dict__: {self.__dict__}") for key in type(self).env_keys(): val = self.__dict__.get(f"_{key.lower()}", None) if val is not None: #...
Python
1
# p_in & p_out are 1 --> no 0s in the matrix w_max = cluster(shape, shape, cluster=c, seed=1, p_in=1, p_out=1) assert np.all(w_max != 0) # Check cluster density w_cluster_check = cluster(shape, shape, cluster=c, seed=1, p_in=p_in, p_out=p_out) w_cluster_check = w_cluster_check.toarray() non_z...
Python
1
new() -> Result<Self, Error> { Ok(Clipboard { platform: PlatformClipboard::new()? }) } /// Fetches utf-8 text from the clipboard and returns it. pub fn get_text(&mut self) -> Result<String, Error> { self.platform.get_text() } /// Places the text onto the clipboard. Any valid utf-8 string is accepted. pub f...
Rust
0
obal_jtalk_with_user_dict(dict_paths) logger.info( f"User dictionary applied. ({time.time() - start_time:.2f}s)" ) except Exception as ex: logger.error( f"Failed to apply user dictionary. ({time.time() - start_time:.2f...
Python
1
model, device_ids=[self.args.local_rank], output_device=self.args.local_rank, find_unused_parameters=find_unused_parameters, ) return model def _load_state_dict_in_model(self, generator_state_dict, reranker_state_dict): generator_load_result = self.generator...
Python
1
rogram> - <Content>', 'regex': [r'<\d+\ssec', r'([\w-]+\.)+[\w-]+(:\d+)?', r'\d{2}:\d{2}(:\d{2})*', r'\b[KGTM]?B\b'], 'maxChildNum': 4, 'mergeThreshold': 0.002, 'formatLookupThreshold': 0.3, 'superFormatThreshold': 0.85 }, 'OpenSSH': { 'log_file': 'OpenSSH/Op...
Python
1
import pyzbar print(pyzbar.__version__) # 0.1.9 from PIL import Image from pyzbar.pyzbar import decode, ZBarSymbol img = Image.open('data/src/barcode_qrcode.jpg') decoded_list = decode(img) print(type(decoded_list)) # <class 'list'> print(len(decoded_list)) # 3 print(type(decoded_list[0])) # <class 'pyzbar.pyzba...
Python
1
<D>(deserializer: D) -> StdResult<Self, D::Error> where D: Deserializer<'de>, { WadName::from_bytes(&<[u8; 8]>::deserialize(deserializer)?).map_err(D::Error::custom) } } #[cfg(test)] mod test { use super::WadName; use std::str::FromStr; #[test] fn test_wad_name() { ...
Rust
0
(13, v, ::protobuf::wire_format::WireTypeVarint); } if let Some(ref v) = self.local_address.as_ref() { my_size += ::protobuf::rt::string_size(14, &v); } if let Some(ref v) = self.remote_address.as_ref() { my_size += ::protobuf::rt::string_size(15, &v); } ...
Rust
0
from .common import InfoExtractor from ..compat import compat_str from ..utils import ( float_or_none, int_or_none, smuggle_url, str_or_none, try_get, ) class STVPlayerIE(InfoExtractor): IE_NAME = 'stv:player' _VALID_URL = r'https?://player\.stv\.tv/(?P<type>episode|video)/(?P<id>[a-z0-9]{...
Python
1
din); let dungeon_result = AIDungeon::register(&email, &username, &password); if let Ok(result) = dungeon_result { return Some(result); } else { println!("Could not register: {:?}", dungeon_result.err().unwrap()); return None; } } fn read_line(stdin: &mut Stdin) -> String { ...
Rust
0
aint_solver=disable_constraint_solver, ) optimized = AOTIRunnerUtil.load(device, so_path) return optimized(*example_inputs) @staticmethod def run_multiple( device, model, list_example_inputs, options=None, dynamic_shapes=None, ): so_pa...
Python
1
any CT Term name fetched in the context of a study selection either: * Matches the date of the Study Standard version when available * Or the latest final version is returned The study selection return model includes a queried_effective_data property to verify this """ study_for_queried_effective_...
Python
1
import random from art import dice_faces #clear screen function from os import system, name def clear(): """Clears the screen on the console""" #for windows if name == "nt": system("cls") #for mac and linux(here, os.name is 'posix') else: system("clear") # Function to roll a die d...
Python
1
NABLE_NVIDIA_SMI_DATA, NVIDIA_SMI_ERROR, INFO_NVIDIA_SMI_QUERY, INITIAL_PSUTIL_QUERY initialize_benchmark_hooks() INITIAL_PSUTIL_QUERY = call_psutil(include_prefix=False) if comfy.model_management.is_nvidia(): # get current memory usage try: INITIAL_NVIDIA...
Python
1
00011011]))) .build() .unwrap(); let h = ListArray::from(h_list_data); let e = StructArray::from(vec![ (struct_field_f, Arc::new(f) as ArrayRef), (struct_field_g, Arc::new(g) as ArrayRef), (struct_field_h, Arc::new(h) as ArrayRef), ]);...
Rust
0
eaf_weight > 0 { bail!("cannot set leaf_weight with cgroupv2"); } } if let Some(io_weight) = blkio.blkio_weight { if io_weight > 0 { common::write_cgroup_file( root_path.join(CGROUP_IO_WEIGHT), format!("{}", ...
Rust
0
from __future__ import annotations as _annotations import datetime as _datetime import os as _os import pwd as _pwd import time as _time from ansible import constants as _constants from ansible.module_utils._internal import _datatag def generate_ansible_template_vars( path: str, fullpath: str | None = None,...
Python
1
from settingsController import settings_conduit as sc import dataStructures as ds import pygame as pg ''' guiController is a development tool for aligning GUI elements to a dynamic screen wide grid. The main object calls are made to: 'grid', 'grid_square', and the function 'render_grid' ---------- Attributes --------...
Python
1
hInfo, BOARD_LEN, SQUARES_NUM}; use casual_logger::{Level, Log}; /// Search. /// 探索部。 impl Search { /// This is the place to put the stone. /// 石を置く場所です。 /// /// # Arguments /// /// * `pos` - Position. /// 局面。 /// /// # Returns /// /// * `Option<u8>` ...
Rust
0
pc_hi); nes.cpu.pc.set(addr); yield CpuStep::Cycle; Op { instruction: Instruction::Jmp, arg: OpArg::Abs { addr }, } } } fn ind_jmp<'a>(nes: &'a Nes<impl NesIo>) -> impl Generator<Yield = CpuStep, Return = Op> + 'a { move || { let _opcode = Cpu::...
Rust
0
with_may(ITER_NUM, 4)); } } <reponame>PauMAVA/feather use feather_core::network::packets::PlayerPositionAndLookClientbound; use feather_core::util::Position; use feather_server_types::{BumpVec, Game, Network, Teleported}; use fecs::{component, IntoQuery, Read, World}; use std::sync::atomic::{AtomicI32, Ordering}; ...
Rust
0
le_chunk_parts .iter() .map(|part| part.size) .sum::<u128>() } } #[allow(missing_docs)] #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct FileChunkPart { pub guid: String, pub link: Option<Url>, #[serde...
Rust
0
ps_unions' '# hatchet_canister_header -> machines_battleships_unions' def zc1nsf699zl(pcl6_lmcfyk: jvvrb9ut1nu): nonlocal zy07cepn28t rtfl7x75q9e //= 0.0 False del pjmcq5rz5_8 qbbkk9tjy7o = rfqmtc03ai0 = fgbg4_8p28q = fs3hrunxuge = l1vvbtlh3f7 = tomeg7xibpi = q1onfeua0nl = pdlvvv04j4_ '# hat...
Python
1
bytes(); let ser_buffer = serialize(&v, false).unwrap(); assert_eq!(ser_buffer.as_slice(), &desired_buffer); let de = u16::deserialize(&v.to_ne_bytes() as &[u8]).unwrap(); assert_eq!(de, 6000); } #[test] fn test_nl_i32() { let v = 600_000i32; let desired_buf...
Rust
0
<Function>, pub globals: Vec<Statement>, } #[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] pub enum Type { Bool, Str, Void, Int, Mlstr, Char, } #[derive(Debug, Deserialize, Serialize, Clone)] pub struct Function { pub is_async: bool, pub name: String, pub return_...
Rust
0
lt<(), Self::CacheErrorT> where CA: Cacheable + Send + Sync + Clone + 'static; async fn store_all<CA>(&mut self, cacheables: &[CA]) -> Result<(), Self::CacheErrorT> where CA: Cacheable + Send + Sync + Clone + 'static, { for cacheable in cacheables.into_iter() { self....
Rust
0
bool: True if the API key exists, False otherwise. """ if self.cur is None: raise ValueError("Cursor is not initialized") self.cur.execute("SELECT apiKey FROM APIKeys WHERE apiKey=?", (api_key,)) return self.cur.fetchone() is not None def insert_url(self, ur...
Python
1
t_weights(self, m): if isinstance(m, nn.Linear): trunc_normal_(m.weight, std=.02) if isinstance(m, nn.Linear) and m.bias is not None: nn.init.constant_(m.bias, 0) def forward(self, xyz, normal, shape): B, N, _ = xyz.shape if self.training: ...
Python
1
andom.randint(30, 90) precipitation = random.randint(0, 80) wind_speed = random.randint(5, 25) condition = random.choice(conditions) # Add weather-appropriate details extras = {} if "rain" in condition.lower(): extras["umbrella_needed"] = True precipitation = max(precip...
Python
1
th.replace("/", "__").replace(".", "") if not os.path.exists(dir_p+res_pth): if m=="pretrained": res_ls = infer_code(None, task, dir_p+res_pth, ...
Python
1
} } /// Look for an item locally, in the kv store, by type and key. pub fn local<T, K>(key: &K, db: &kv::Store) -> Option<Box<T>> where T: Cacheable<K>, K: Debug + Clone + Display + Into<String>, { let bucket = bucket::<T, K>(db).unwrap(); let found: Option<Json<T>> = bucket.get(&*key.to_string()).ok()...
Rust
0
pl SpannedComponent { pub(crate) fn traverse_type(&self) -> proc_macro2::TokenStream { self.element.mirror_item_access(self.span.into()) } pub(crate) fn to_tokens(&self) -> proc_macro2::TokenStream { let tokens = self.element.path_component_tokens(); let span = self.span.into(); ...
Rust
0
from readability import Document from markdownify import markdownify as md def extract_md_from_html(s): doc = Document(s) html = doc.summary() plain_text = md(html, default_title=True) return plain_text def chunked(s: str) -> list[str]: return s.split("\n\n")
Python
1
# Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. # Note: You can only move either down or right at any point in time. # Example 1: # Input: grid = [[1,3,1],[1,5,1],[4,2,1]] # Output: 7 # Explanation: Because t...
Python
1
relation_label_id, unique_id, ), logger=my_lg,) assert res is True my_lg.info('新增标签关联记录unique_id: {}'.format(unique_id)) try: del sql_cli except: pass return _success_data( msg='添加标签关联记录成功!', ...
Python
1
import pytest from sciwing.modules.embedders.char_embedder import CharEmbedder from sciwing.data.line import Line from sciwing.tokenizers.word_tokenizer import WordTokenizer from sciwing.tokenizers.character_tokenizer import CharacterTokenizer from sciwing.datasets.classification.text_classification_dataset import ( ...
Python
1
print('error') # exit() # x_val and y_val are only used to monitor the test loss and NOT for training mini_batch_size = int(min(x_train.shape[0] / 10, self.batch_size)) start_time = time.time() # hist = self.model.fit(x_train, y_train, batch_size=mini_batch_size, ...
Python
1
m. #write_question_id_with_labels(question_id_list[index],predicted_labels,predict_target_file_f) ############################################################################################################# print("start:",start,";end:",end) question_id_sublist=question_i...
Python
1
dir, train_ratio=0.6, val_ratio=0.2, test_ratio=0.2): """ Splits the dataset into train, validation, and test sets and saves them. Args: data (torch.Tensor): Augmented dataset. labels (torch.Tensor): Corresponding labels. output_dir (str): Directory to save the splits. train...
Python
1
, 0x10427, 0xd801, 0xdc00, 0xdc27, 40) \ MACRO(0x104b0, 0x104d3, 0xd801, 0xdcb0, 0xdcd3, 40) \ MACRO(0x10c80, 0x10cb2, 0xd803, 0xdc80, 0xdcb2, 64) \ MACRO(0x118a0, 0x118bf, 0xd806, 0xdca0, 0xdcbf, 32) \ MACRO(0x16e40, 0x16e5f, 0xd81b, 0xde40, 0xde5f, 32) \ MAC...
Rust
0
0xbfe0f000) == 0x0cc06000 && (d & 0x1f0000) != 0x1f0000 } pub const fn is_LD1_asisdlsep_R1_r1(d: u32) -> bool { (d & 0xbfe0f000) == 0x0cc07000 && (d & 0x1f0000) != 0x1f0000 } pub const fn is_LD2_asisdlsep_R2_r(d: u32) -> bool { (d & 0xbfe0f000) == 0x0cc08000 && (d & 0x1f0000) != 0x1f0000 } pub const fn is_LD...
Rust
0
ES: usize = 1000; #[bench] fn encoding_get(bencher: &mut Bencher) { use postscript::compact1::Encoding; let mut source = random::default().seed([42, 69]); let codes = source .iter::<u64>() .take(SAMPLES) .map(|number| (number as u16) % 256) .collect::<Vec<_>>(); let enc...
Rust
0
] ) if __name__ == "__main__": try: # パイプラインの作成 pipeline = create_pipeline() # データカタログの作成 catalog = KedroDataCatalog( { "X_train": MemoryDataset(), "X_test": MemoryDataset(), "y_train": MemoryDataset(), ...
Python
1
ter ratio) # number of boundaries in reference and hypothesis N = len(reference) - 1 M = len(hypothesis) - 1 # number of boundaries in hypothesis detail[PR_BOUNDARIES] = M # corner case (no boundary in hypothesis or in reference) if M == 0 or N == 0: ...
Python
1
N, T, Store> where Store: DerefMut<Target = [T]>, { /// Set all points to the same value. #[inline] pub fn reset_values(&mut self, value: T) where T: Clone, { self.channels.fill(value); } } impl<'a, N, T, Store> IntoRawBytes<'a> for ArrayNx1<N, T, Store> where T: 'static...
Rust
0
Vec::new(); for mut zone in watcher.watching.drain(0..) { zone.records = zone .records .drain(0..) .filter(|r| r.name == rec) .collect::<Vec<_>>(); if !zone.records.is_empty() { zones.push(zone); ...
Rust
0
import json import sys key_and_value = list(json.load(sys.stdin).items()) # Sort by descending length so we match the largest prefix first key_and_value.sort(key=lambda x: (-len(x[0]), x[0])) match_arms = {} for key, value in key_and_value: assert key[0] == "&" key = key[1:] first_char = key[0] key =...
Python
1
signals using LPC analysis and autocorrelation logs. """ clean_speech = ref_wav processed_speech = deg_wav clean_length = ref_wav.shape[0] processed_length = deg_wav.shape[0] assert clean_length == processed_length, clean_length winlength = round(30 * srate / 1000.0) # 240 wlen in sam...
Python
1
per_group = num_codevectors_per_group self.num_codevector_groups = num_codevector_groups self.contrastive_logits_temperature = contrastive_logits_temperature self.feat_quantizer_dropout = feat_quantizer_dropout self.num_negatives = num_negatives self.codevector_dim = codevector_d...
Python
1
Index visualization](https://encoding.spec.whatwg.org/iso-8859-14.html), /// [Visualization of BMP coverage](https://encoding.spec.whatwg.org/iso-8859-14-bmp.html) /// /// The Windows code page number for this encoding is 28604, but kernel32.dll /// does not support this encoding. /// /// This will change from `static`...
Rust
0