text
string
label_name
string
labels
int64
to be provided") exit(1) if video_dir and not ensure_path_exists(video_dir): logger.error("Path %s does not exist", video_dir) exit(1) if text_file and not ensure_path_exists(text_file): logger.error("Path %s does not exist", text_file) exit(1) if video_dir: ...
Python
1
structure"] impl crate::Readable for AESCTL {} #[doc = "`write(|w| ..)` method takes [aesctl::W](aesctl::W) writer structure"] impl crate::Writable for AESCTL {} #[doc = "AES Input/Output Buffer Control"] pub mod aesctl; #[doc = "Crypto Data Length LSW\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`...
Rust
0
svg_path def formatPath( * args): """ Accepts a series of pseudo svg path arguments 'M', 'L', 'C' , and point objects. Returns path_string which is a string formatted for use as the 'd' path attribute in an svg object. """ tokens = [] # initialize an empty array # put all the parameters in * ...
Python
1
&Vec<i32>, input: i32) -> i32 { let program = &mut intcode.to_vec(); if let (_, Some(res)) = intcode_computer::run_intcode(program, &mut vec![input], 0) { res } else { program[0] } } use std::collections::HashMap; use std::cmp::min; //1 <= n <= 100 // 0 <= minProfit <= 100 // 1 <= group.length <= 100 // 1 <= ...
Rust
0
'tag>], ) -> MResult<()> { let store = ctx.documents_fields_counts_store; let reader = ctx.reader; 'documents: for doc in documents { doc.bare_matches.sort_unstable_by_key(|bm| (bm.query_index, Reverse(bm.is_exact))); // mark the document if we find a "one word...
Rust
0
s ------ FluxSurfaceError If the flux surface at the point in the equilibrium is not an open flux surface Notes ----- Less mathematically accurate. Will return exact intersection point. Sensitive to equilibrium grid discretisation. Presently does not correctly work for flux surfaces ...
Python
1
: String, /// connected: is player connected to the server? pub connected: bool, } /// PlayerId identifies a player in the lobby. /// /// Specifically, it's value can be used to index players in the lobby to get information such as /// name and table position. // // NB: note that this means that the server wan...
Rust
0
/// quote: /// /// ```compile_fail /// quote! { /// /// try to interpolate: #ident /// /// /// /// ... /// } /// ``` /// /// ```compile_fail /// quote! { /// #[doc = "try to interpolate: #ident"] /// } /// ``` /// /// Macro calls in a doc attribute are not valid syntax: /// /// ```compile_fail /// quot...
Rust
0
o_add.into_iter() { let add_addr = deps.api.addr_validate(&add.addr)?; MEMBERS.update(deps.storage, &add_addr, height, |old| -> StdResult<_> { total -= old.unwrap_or_default(); total += add.points; diffs.push(MemberDiff::new(add.addr, old, Some(add.points))); ...
Rust
0
import argparse import os import random import openslide from preprocess import ( create_tissue_mask, create_tissue_tiles, crop_rect_from_slide, make_tile_QC_fig, tile_is_not_empty, ) parser = argparse.ArgumentParser( description="Script to sample tiles from a WSI and save them as individual ...
Python
1
at(descriptor, DescriptorFormat.AGENT2AGENT) def from_agent_card(agent_card: Dict[str, Any]) -> AgentDescriptor: """Convert an Agent2Agent protocol AgentCard to an AgentDescriptor.""" return from_format(agent_card, DescriptorFormat.AGENT2AGENT) def is_agent_card_compatible(descriptor: AgentDescriptor) -> bo...
Python
1
(+$)NFToriginating_sourcerr`is_specialized_nn_module is_dict_keyr\)rrs rmatch_on_id_for_tensorr-AP  % %F&+,, %%''     F 6:(F$FFrc*\rSrSr%S\S'S\S'Srg) GuardCodeListP list[str] code_listr.r...
Python
1
import urllib.parse from unittest.mock import Mock import pytest from dbt_common.exceptions import DbtRuntimeError from dbt.adapters.databricks.api_client import NotebookPermissionsApi from tests.unit.api_client.api_test_base import ApiTestBase class TestNotebookPermissionsApi(ApiTestBase): @pytest.fixture ...
Python
1
# -*- coding: utf-8 -*- def test_qwen2_model(): import os os.environ['BiLLM_START_INDEX'] = '-1' from billm import Qwen2Model, Qwen2Config model = Qwen2Model(Qwen2Config(vocab_size=128, hidden_size=32, intermediate_size=64...
Python
1
e inaccessible: No such file or directory\n\ tail: 'untailable' has been replaced with an untailable file\n\ tail: 'untailable' has become accessible\n"; let expected_stdout = "foo\nbar\n"; let delay = 1000; let mut args = vec![ "-s.1", ...
Rust
0
sult<serde_json::Value, Box<Error+Send+Sync>> = FromSql::<types::Json, Pg>::from_sql(Some(b"boom")); assert_eq!(uuid.unwrap_err().description(), "JSON error"); } #[test] fn no_json_from_sql() { let uuid: Result<serde_json::Value, Box<Error+Send+Sync>> = FromSql::<types::Json, Pg>::from_sql(None...
Rust
0
e options for this filter.""" # always clone to get new data; filter instances are persistent # Because these options rarely change we can confidently cache # them as lists of tuples. # This cache key gets invalidated on the various signals set # up in moztrap.model.__init__. ...
Python
1
("4") == iter.next()); assert!(Some("5") == iter.next()); assert!(Some("6") == iter.next()); assert!(Some("7") == iter.next()); assert!(Some("8") == iter.next()); assert!(Some("9") == iter.next()); assert!(None == iter.next()); } #[test] fn rebalance_1() { let left = Rope::from_str(&(Strin...
Rust
0
* 56)..((i + 1) * 56)].copy_from_slice(&buf[4..60]); } signature } pub fn main() { let hidapi = hidapi::HidApi::new().unwrap(); let devices = [ (0x054c, 0x05c4), // Sony DualShock 4 (0x1532, 0x0401), // Razer Panthera (0x1209, 0x214d), // Passing Link ]; let device = devices .iter() ....
Rust
0
None, generic_rules: Vec::new(), ctrl: None, is_group_to_choice_enum: false, is_multi_type_choice: false, is_multi_group_choice: false, type_group_name_entry: None, advance_to_next_entry: false, is_ctrl_map_equality: false, entry_counts: None, validated_keys:...
Rust
0
import math import numpy as np import pandas as pd import plotly.express as px import pickle import seaborn as sns import os # from LinearRegression import LinearRegression def compute_cost(self, predictions): m = len(predictions) cost = np.sum(np.square(predictions - self.y)) / (2 * m) return cost def...
Python
1
9.value().start_object(); crate::json_ser::serialize_structure_crate_model_aws_ecs_task_definition_container_definitions_ulimits_details(&mut object_2501, item_2500)?; object_2501.finish(); } } array_2499.finish(); } if let Some(var_2502) = &input.user...
Rust
0
d_range() { for n in 1..101 { // from 1 to 100 (exclude 101). You can write `for n in 1..=100 {` as alternatives if n % 15 == 0 { println!("fizzbuzz"); } else if n % 3 == 0 { println!("fizz"); } else if n % 5 == 0 { println!("buzz"); } else { ...
Rust
0
) * {input_token_price:.6f} = {input_cost:.2f}" output_cost_detail = f"(({output_token} * ({rpm} / 60) * 3600 * 24 * 30.42) / 1000) * {output_token_price:.6f} = {output_cost:.2f}" total_cost = f"{input_cost:.2f} + {output_cost:.2f} = {input_cost + output_cost:.2f}" return input_cost_det...
Python
1
e timestamp-mode=tai sync=false", pravega_plugin_properties = test_config.pravega_plugin_properties(stream_name), timestamp_offset = first_timestamp.nanoseconds().unwrap(), num_buffers = num_buffers_written, fps = fps, video_encoder_pipeline = video_encoder_pi...
Rust
0
# -*- coding: utf-8 -*- # @Author : chenghua.yuan import logging import unittest from common.utils import get_driver, compare_images_with_cv, save_image_file from common.project import get_absolute_path, RESULT_IMAGE_FILE_FOLDER, ORIGINAL_IMAGE_FILE_FOLDER from pages.home_page import HomePage from pages.more_page impo...
Python
1
ep10_in_buffer_control::R) reader structure"] impl crate::Readable for EP10_IN_BUFFER_CONTROL {} #[doc = "`write(|w| ..)` method takes [ep10_in_buffer_control::W](ep10_in_buffer_control::W) writer structure"] impl crate::Writable for EP10_IN_BUFFER_CONTROL {} #[doc = "Buffer control for both buffers of an endpoint. Fie...
Rust
0
CREEN_WIDTH: i32 = 40; //parameters for dungeon generator pub const ROOM_MAX_SIZE: i32 = 10; pub const ROOM_MIN_SIZE: i32 = 6; pub const MAX_ROOMS: usize = 30; pub const HEAL_AMOUNT: i32 = 40; pub const SLINGSHOT_DAMAGE: i32 = 40; pub const SLINGSHOT_RANGE: i32 = 5; pub const BRICK_RANGE: f32 = 8.0; pub const BRICK_N...
Rust
0
8_SAMPLES = 0b111, // Available for measurements in background mode only } impl PressureResolution { pub fn val(self) -> u8 { self as u8 } #[allow(non_snake_case)] pub fn get_kP_value(self) -> f32 { // See Section 4.9.3 Sec. "Compensation Scale Factors", Table 9. Col. "Scale Factor col...
Rust
0
## 성능이 안좋음 RAG_PROMPT_TEMPLATE = """ 당신은 응급 상황을 평가하는 전문가입니다. 환자의 긴급성을 평가하기 위해 대화 상대에게 정보를 요청하십시오. 나이, 증상, 활력징후, 병력을 고려하여 환자의 상태를 평가하십시오. 필요하지 않다면 고려하지 않아도 됩니다. 환자를 KTAS 단계로 분류하십시오. KTAS는 환자의 상태의 심각성에 따라 다섯 단계로 나뉩니다. 단계 1은 가장 긴급하고 단계 5는 가장 덜 긴급합니다. 1. 단계 1 (즉각적인 의학적 주의 필요): 생명 위협 또는 즉각적인 의학적 주의가 필요한 상태. 예: 심정지, 심한 호흡 ...
Python
1
<O, T::NoAlias>, /// See `BitDomain::Region`. tail: &'a mut BitSlice<O, T::Alias>, }, } impl<'a, O, T> From<&'a mut BitSlice<O, T>> for BitDomainMut<'a, O, T> where O: BitOrder, T: 'a + BitStore, { fn from(this: &'a mut BitSlice<O, T>) -> Self { match (&*this).into() { BitDomain::Enclave { head, body, tai...
Rust
0
oltage, VCELL, 0xA4, 0x9F, 6.58); cmd_test!(reset, new_59, destroy_59, reset, COMMAND, POR_X8_X9); set_table_test!(set_table, new_59, destroy_59); } //! An iterator over all line intersections with a given scanline. use crate::{ geometry::Point, primitives::common::{LineJoin, Scanline, StrokeOffset, Th...
Rust
0
inute / self.rate_limit_backoff_factor logger.warning(f"Rate limit encountered, reducing token generation rate: {self.token_bucket.tokens_per_minute:.0f} -> {new_rate:.0f} tokens/min") print(f"⚠️ Rate limit encountered, reducing request rate: {self.token_bucket.tokens_per_minute:.0f} -> {new_rat...
Python
1
fn span(&self) -> Span { let start = match &self.visibility { Some(pub_token) => pub_token.span(), None => self.trait_token.span(), }; let end = match &self.trait_defs_opt { Some(trait_defs) => trait_defs.span(), None => self.trait_items.span(...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
).to_vec(); slow as i32 } //! The Type Pass module handles walking the raw parser ADT, performing //! additional type checking and enrichment. use super::CompilationStage; use crate::stage::ast::{self, FuncProto, Typed}; mod scopes; use scopes::ScopeStack; #[derive(Clone, Copy, PartialEq, Eq)] struct Integer { ...
Rust
0
rewards[chat_completion.id, choice_index] = reward metrics[chat_completion.id, choice_index] = _metrics except Exception as e: exceptions.append(e) stats.update(id=chat_completion.id, exception=e) continue ...
Python
1
""" Author: Louis M Date: Thu, 18 Apr 2024 18:45:56 +0000 Description: Unit test used to test accessibility of locations with and without Li """ from . import AquariaTestBase from ..Items import ItemNames from ..Locations import AquariaLocationNames from ..Options import TurtleRandomizer class LiAccessTest(AquariaTe...
Python
1
(); // // Delete the recently created post // let request = format!("posts/{}/delete", post.id); let mut res = Vec::new(); Client::new(&request[..]).get(&mut res); let res = std::str::from_utf8(&res).unwrap(); let count = json::decode(&res).unwrap();...
Rust
0
self.size = size; let old_memory = self.memory.clone(); self.memory = VecDeque::with_capacity(size); let len; if old_len < size { len = old_len; } else { len = size; } for idx in 0..len { self.memory.push_back(old_memory[id...
Rust
0
initialise and show # iren.Initialize() # iren.Start() def get_sources(self): # file_name = "CFD_file_37.vtu" file_name = r"../Base/InitialDisplay/Coronary.stl" print(os. getcwd()) # Read the source file. reader = vtk.vtkSTLReader() reader.SetFileNam...
Python
1
ks.is_empty() { block["subblocks"] = json!([]); return; } for subblock in subblocks.iter_mut() { recursive_subblock_dumper(subblock, current_depth + 1); } } //////////////////// /* ✅ Test Module */ //////////////////// #[cfg(test)] mod test { const TEST_DIR: &str = "resources/test/"; use super::*; use st...
Rust
0
BotdError> { log::debug!("[check] Headers: {:?}", resp.get_header_names_str()); let req_status = match resp.get_header(REQUEST_STATUS_HEADER) { Some(r) => r, _ => return Err(NoRequestStatusInHeaders) }; if !req_status.eq("processed") && resp.get_header(ERROR_DESCRIPTION_HEADER).is_none(...
Rust
0
input = r#" fn main() { let scrutinee = 42; let result = match scrutinee { 0 => false, 1 => 0, }; } "#; let expected = Err(Error::Semantic( SemanticError::MatchBranchExpressionInvalidType { location: Location::new(6, 14), expected: Type::boolean().to_str...
Rust
0
, }, &[243, 15, 44, 214], OperandSize::Qword, ) } #[test] fn cvttss2si_4() { run_test( &Instruction { mnemonic: Mnemonic::CVTTSS2SI, operand1: Some(Direct(EDI)), operand2: Some(IndirectScaledIndexed( RDI, RCX, ...
Rust
0
_SPORT_JUMPMASTER: u8 = 46; pub const FIT_SPORT_BOXING: u8 = 47; pub const FIT_SPORT_FLOOR_CLIMBING: u8 = 48; pub const FIT_SPORT_DIVING: u8 = 53; pub const FIT_SPORT_ALL: u8 = 254; // Swim stroke enumeration. pub const FIT_ENUM_INVALID: u8 = 0xff; pub const FIT_STROKE_TYPE_INVALID: u8 = FIT_ENUM_INVALID; pub const FI...
Rust
0
vec![commander.xfr_command_buffer.clone()], signal_semaphores: vec![], chain: None }; Fence::reset_fences(&[fence.clone()])?; commander.xfr_queue.submit( Some(&[submit_info]), Some(&fence) )?; Fence::wait_for_fences(&[fence], true, Timeout::Infinite)?; Ok(()) } // Copyright © 2021 VM...
Rust
0
.to_string(), &language); let mut data = [0; 1]; let mut input = Cursor::new(vec![]); let mut output = Vec::new(); let mut env = Environment::new(&mut data, &mut input, &mut output); // Should not panic run(&ops, &mut env); } #[test] fn test_compress() { ...
Rust
0
// Waiting is complete, return output return Ok(output); } Err(err) => { let local_exit_code = &err.data["local_error"]["data"]["exit_code"]; let can_retry = err.code == ErrorCode::MessageExpired as u32 && (err.data["loca...
Rust
0
from basic_players import Player from player_tools import strategies from player_tools import Spy_tiles class Super_Greedy(Player): def __init__(self): super().__init__(0, "Super_Greedy") def play(self, board_extremes, play_hist): if len(play_hist) == 0: playable_tiles = ...
Python
1
.into_iter() .map(|(name, front_address, mempool_address)| { let authority = Authority { name, front_address, mempool_address, }; (name, authority) ...
Rust
0
from odoo.tests.common import TransactionCase class JsonFieldTest(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() cls.discussion_1 = cls.env['test_new_api.discussion'].create({ 'name': 'Test Discussion JSON field' }) def test_json_field_read_w...
Python
1
import pytest from qcelemental.info import cpu_info, dft_info @pytest.mark.parametrize( "functional,base_name", [ ("svwn", "svwn"), ("b3lyp", "b3lyp"), ("b3lyp-d3", "b3lyp"), ("b3lyp-d3zero", "b3lyp"), ("b3lyp-d3mbj", "b3lyp"), ("b3lyp-nl", "b3lyp"), ("...
Python
1
"leo".to_string(), canonical_addr.clone(), vec![bonsai.clone()], ); let gardener2 = Gardener::new( "ricky".to_string(), other_addr.clone(), vec![bonsai.clone()], ); let gardeners = vec![gardener2.clone(), gardener.clone()]; for el in gardeners.clone() { ...
Rust
0
s: if plugin.manages_global_connection: plugin.connect(ctx) set_global_color_scheme(ctx) signal.signal(signal.SIGINT, lambda s, f: exit_now(ctx, 1, "Interrupted... Exiting...")) start_background_tasks(ctx) start_worker() colors = get_global_color_scheme(cfg) menu_header = ...
Python
1
FileStream`*"] pub fn write_with_str(this: &FileSystemWritableFileStream, data: &str) -> ::js_sys::Promise; #[cfg(feature = "WriteParams")] # [wasm_bindgen (method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[...
Rust
0
to_string()) .collect(); let b: Vec<String> = vec!["S", "T", "R", "A", "N", "G", "E", "S", "O", "M", "O"] .iter() .map(|s| s.to_string()) .collect(); let moves = crate::yavom::myers(&a, &b); eprint!("{} moves...", moves.len()); moves.iter()...
Rust
0
import os from models.base_model import BaseModel from models.amenity import Amenity from models.city import City from models.place import Place from models.review import Review from models.state import State from models.user import User """CNC - dictionary = { Class Name (string) : Class Type }""" if os.environ.get(...
Python
1
nization, provided that the /// GitHub App has the proper permissions configured. This is achieved by automatically obtaining an /// installation access token. The client automatically renews the token once it expires. Also, the /// client retries API requests that failed for reasons such as network issues multiple tim...
Rust
0
{ use ::std::iter::Iterator; let device_nodes = crate::device::utils::find_device_nodes_by_class( #class ).into_iter(); #filter_by_driver device_nodes.collect() ...
Rust
0
} fn bad_version(n: usize, version: usize) -> Vec<bool> { let mut versions = vec![false; n]; for index in version..n { versions[index - 1] = true; } versions } fn is_bad_version(version: i32) -> bool { // let mut versions = vec![false;100]; VERSIONS[version as usize] } /// 力扣(242. 有效...
Rust
0
lterPolicy + Send + Sync>, data: &[u8]) -> Self { let mut c = Self { num: 0, base_lg: 0, data: null(), offset: null(), policy, }; let n = data.len(); if n < 5 { return c; } c.base_lg = data[n - 1] as ...
Rust
0
from importlib import __import__ import pytest @pytest.mark.parametrize( "log_module,fromlist", [ ("average_precision", ["AveragePrecision"]), ("cohen_kappa", ["CohenKappa"]), ("gpu_info", ["GpuInfo"]), ("precision_recall_curve", ["PrecisionRecallCurve"]), ("roc_auc", ...
Python
1
""Itanium.""" PPC32 = "ppc32" """32-bit PowerPC.""" PPC64 = "ppc64" """64-bit PowerPC.""" S390X = "s390x" """IBM z/Architecture.""" X86 = "x86" """32-bit x86.""" @deprecated( version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OsTypeValues`...
Python
1
, (4,)], [1, 2, 4, (1,), (2,), (4,)])) def test_occlusion_disjunct(data_simple, window, stride): '''Function to test whether the inputs used for disjunct occlusion windows are correct.''' model = IdentityLogger() # delete everything except the window occlusion_fn = partial(occlude_independent, fill_fn=...
Python
1
# SPDX-License-Identifier: Apache-2.0 """Tests for the Insight WASM bridge.""" import json import subprocess from pathlib import Path from click.testing import CliRunner from unittest.mock import patch from alpha_factory_v1.demos.alpha_agi_insight_v1.src.interface import cli def _cli_output(seed: int) -> list[dict]...
Python
1
to machine precision, and converges everywhere. /// The crate [geographiclib-rs](https://crates.io/crates/geographiclib-rs), by /// <NAME> and <NAME>, provides a Rust implementation of Karney's algorithm. #[must_use] #[allow(non_snake_case)] pub fn geodesic_fwd( &self, from: &Coordin...
Rust
0
import smart_imports smart_imports.all() class STATE(rels_django.DjangoEnum): records = (('ENABLED', 0, 'в игре'), ('DISABLED', 1, 'вне игры'),) class MODE(rels_django.DjangoEnum): records = (('AUTOMATIC', 0, 'автоматический'), ('MANUAL', 1, 'ручной'),) class DEDICATION(rel...
Python
1
an Option, it may be set to null to indicate None. pub inner: *mut nativeRouteHop, /// Indicates that this is the only struct which contains the same pointer. /// Rust functions which take ownership of an object provided via an argument require /// this to be true and invalidate the object pointed to by inner. p...
Rust
0
from matplotlib.colors import Normalize, to_hex from matplotlib.cm import ScalarMappable from matplotlib.colors import LinearSegmentedColormap Metal_indices = ['Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Nb', 'Mo', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'Ta', 'W', ...
Python
1
import re import pytest from scrapli_community.nokia.srlinux.nokia_srlinux import DEFAULT_PRIVILEGE_LEVELS @pytest.mark.parametrize( "priv_pattern", [ ("exec", "--{ running }--[ ]--\nA:srl#"), ("exec", "--{ + running }--[ ]--\nA:srl#"), ("exec", "--{ [YANG RELOAD] [FACTORY] running...
Python
1
[doc = "Port Data Input Value 23"] pub type IN23_A = IN0_A; #[doc = "Reader of field `IN23`"] pub type IN23_R = crate::R<bool, IN0_A>; #[doc = "Port Data Input Value 24"] pub type IN24_A = IN0_A; #[doc = "Reader of field `IN24`"] pub type IN24_R = crate::R<bool, IN0_A>; #[doc = "Port Data Input Value 25"] pub type IN25...
Rust
0
nid: server.nid, mask: BITSET::empty(), }; let mut mask_idx = 0; #[allow(non_snake_case)] let ($( $t, )+ PlayerIdDescriptor,) = &server.history; // Begin for each compon...
Rust
0
s_ref()); trace!("rlp: {:?}", rlp); let t = Value::decode(&rlp)?; Ok(t) } } pub mod memorizer { use super::*; use dashmap::DashSet; use std::{ fmt::Display, sync::atomic::{AtomicUsize, Ordering}, }; #[derive(Default)] pub struct AccountStorageRootsCo...
Rust
0
import pandas as pd import numpy as np import yfinance as yf import matplotlib.pyplot as plt # Definir os ativos assets = [ "VGIA11.SA", "AGRX11.SA", "BTCI11.SA", "BTLG11.SA", "GARE11.SA", "GLOG11.SA", "VISC11.SA", "CYCR11.SA", "VSLH11.SA", "^BVSP", ] # Nomes amigáveis para os...
Python
1
Ok(()), Err(err) => return Err(err), }; // Generate a new id for the connection. let id = new_id(current_id); println!("Accepted a new connection from: {}: id={}", address, id); // Register the TCP connection so we can handle events for it as well. os_queue...
Rust
0
# Copyright (C) 2010-2017 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
Python
1
u32>(0)?.unwrap(); let max_id_val = max(max_tuple_id, SYSTEM_ID_MAX); // Insert max_id into _schema space. let created_max_id = sys_schema .insert(&("max_id".to_string(), max_id_val + 1))?; created_max_id.field::<u32>(1)?.unwrap() }; Ok(space_id) } /// Drop a space....
Rust
0
{"id": 3053623823, "issue_id": "215"}, {"id": 3509836934, "issue_id": "55516"}, ] next_url_headers = {"link": "<https://api.github.com/test&page=3>; rel='next'"} # Make sure required requests are made as long as next link is present in the header since = ( TEST_URL + "?state...
Python
1
st G_RIGHTARROW: &[&str] = &["rarr", "rightarrow"]; pub const G_TO: &[&str] = &["->", "to"]; pub const G_RIGHTARROWTAIL: &[&str] = &[">->", "rightarrowtail"]; pub const G_TWOHEADRIGHTARROW: &[&str] = &["->>", "twoheadrightarrow"]; pub const G_TWOHEADRIGHTARROWTAIL: &[&str] = &[">->>", "twoheadrightarrowtail"]; pub cons...
Rust
0
.map(Value::Object)) .parse_stream(input) } pub fn parse_type<'a, T>(input: &mut TokenStream<'a>) -> ParseResult<Type<'a, T>, TokenStream<'a>> where T: Text<'a>, { name::<'a, T>().map(Type::NamedType) .or(punct("[") .with(parser(parse_type)) .skip(punct("]")) .map(Box::new) ...
Rust
0
)), (32, hound::SampleFormat::Float) => { self.reader.samples::<f32>().next().and_then(|s| s.ok()) } _ => None, } } } <reponame>katharostech/rafx use crate::gles3::gles3_bindings; use crate::gles3::gles3_bindings::types::GLenum; use crate::gles3::RafxDevic...
Rust
0
riable): [b x hid] """ # 1.7.1.1st state - create [out] if j==0: out, s, w = decoder(input_idx=y[:,j], encoded=encoded, encoded_idx=inputs, prev_state=s, weighted=w, order=j) # remaining state...
Python
1
from setuptools import find_packages, setup package_name = "warmup_project" setup( name=package_name, version="0.0.0", packages=find_packages(exclude=["test"]), data_files=[ ("share/ament_index/resource_index/packages", ["resource/" + package_name]), ("share/" + package_name, ["package...
Python
1
move. try!(bssl::map_result(unsafe { GFp_BN_MONT_CTX_set(&mut r.ctx, self.as_ref()) })); Ok(r) } pub fn into_public_exponent(self) -> Result<PublicExponent, error::Unspecified> { let bits = self.bit_length(); if bits < bits::Bi...
Rust
0
from src import * from tensorflow.keras.datasets import mnist import numpy as np (X_train, y_train), (X_test, y_test) = mnist.load_data() # Flatten the images X_train_flattened = X_train.reshape(X_train.shape[0], -1) X_test_flattened = X_test.reshape(X_test.shape[0], -1) # One hot encode y_train = np.eye(np.max(y_t...
Python
1
els, num_groups=num_groups, stride_in_1x1=stride_in_1x1, stride=stride, dilation=dilation, norm_func=group_norm, dcn_config=dcn_config ) class StemWithGN(BaseStem): def __init__(self, cfg): super(StemWithGN, self).__init__(cfg...
Python
1
eroes instead. if cfg!(target_arch = "arm") && BITMASK_STRIDE % 8 == 0 { self.0.swap_bytes().leading_zeros() as usize / BITMASK_STRIDE } else { self.0.trailing_zeros() as usize / BITMASK_STRIDE } } /// Returns the number of leading zeroes in the `BitMask`. #[...
Rust
0
L_SPEC>`"] pub type LIMITL = crate::Reg<limitl::LIMITL_SPEC>; #[doc = "Description cluster: Last results is equal or below CH\\[n\\].LIMIT.LOW"] pub mod limitl; <gh_stars>1000+ use clap::Parser; #[derive(Parser, Debug, PartialEq)] #[clap(author, version, about, long_about = None)] struct Opt { // Default parser fo...
Rust
0
Value { let s = match entry.weight { Some(weight) => format!("{};q={:.3}", entry.encoding, weight), None => entry.encoding.to_string(), }; unsafe { HeaderValue::from_bytes_unchecked(s.into_bytes()) } } } #[cfg(test)] mod test { use super::*; #[test] fn s...
Rust
0
from scipy.sparse import diags from numpy import ndarray def partial_derivative_matrix(D: int, N: int, axis_number: int, dr: float) -> ndarray: """ Generates the sparse second derivative central difference derivative matrix along given axis, for a grid of dimensions N^D. :param D: The number of dimensions ...
Python
1
assert_eq!( &*values.get().unwrap(), vec![ Cow::<[u8]>::Owned(b"b100".to_vec()), Cow::<[u8]>::Borrowed(b"db"), Cow::<[u8]>::Borrowed(b"fa"), ] ); values.delete_all(); assert!(values.get().is_err()); ...
Rust
0
"""Chunking module initializer. Publishes the public aspects of the chunking sub-package interface. """ from __future__ import annotations from unstructured.chunking.base import CHUNK_MAX_CHARS_DEFAULT, CHUNK_MULTI_PAGE_DEFAULT from unstructured.chunking.dispatch import ( Chunker, add_chunking_strategy, ...
Python
1
# -*- coding: utf-8 -*- """ @Author: Federico Bau @Date: 31/07/2022 The insertion sort is somewhat similar to the selection sort but moves backward each time when a smaller value is found instead of swapping the values as it moves forward Rules: 1) Iterate/Loop through inputs values starting at index 1 2) Store the ...
Python
1
option = RequestOption() # 鉴权、获取 token verify(self.config, request, option) # 添加 content-type if request.body is not None: option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8" # 发起请求 resp: RawResponse = Transport.execute(self.config, r...
Python
1
# Ejercicios para practivar el uso de print(), de arimetica, concatenación, variables e input() # 1. Pida al usuario 2 palabras y las imprima juntas # Ejemplo: # Input1: "Hola" # Input2: "Mundo" # Output: "HolaMundo" # palabra1 = input('Palabra 1: ') # palabra2 = input('Palabra 2: ') # print(palabra1+palabra2) # print...
Python
1
0] = 32 props[26][0] = 27 generate_map() if current_room == 27: close_door(26) if current_room == 32: close_door(25) show_text("The computer tells you the doors are closed.", 1) sounds.say_doors_closed.play() def door_in_room_26(): global airlock_door_frame, room_map fra...
Python
1
pub const WOTD_TROPHY_2018_SEED: u16 = 6015; pub const GROWSCAN_9000: u16 = 6016; pub const GROWSCAN_9000_SEED: u16 = 6017; pub const ELEMENT___EARTH: u16 = 6018; pub const ELEMENT___EARTH_SEED: u16 = 6019; pub const ELEMENT___FIRE: u16 = 6020; pub const ELEMENT___FIRE_SEED: u16 = 6021; pub const ELEMENT___WIND: u16 =...
Rust
0
let card_first = *stichseq.current_stich().first(); if /*either weggelaufen or epi is not partner, and accordingly does not hold rufsau*/stichseq.completed_stichs().iter() .any(|stich| epi==stich.first_playerindex() && self.is_ruffarbe(*stich.first())) { ...
Rust
0
# -*- coding: utf-8 -*- import pygcb def CreateDBObject(): dbObj=pygcb.tcAcousticModel() dbObj.databaseClass='RN205' dbObj.xSpeed_kts=[0.000000,8.400000,29.400000,42.000000] dbObj.ySL_dB=[82.400002,87.196594,120.772766,130.365967] dbObj.speedMinNL_kts=9.380000 dbObj.NL_min=46.200001 dbObj.sp...
Python
1