text
string
label_name
string
labels
int64
from mllm import Chat from mllm.provider_switch import set_default_to_deepseek from mllm.utils.parser import Parse, parse_json_by_cheap_model def test_parse_quotes(): src = """ 123 ```python This is a quoted string ``` 123 """ res = Parse.quotes(src) assert res == "This is a quoted string" def test_parse...
Python
1
model.font_size = model.font_size_min + model.distance as u32 / 2; let win_rect = app.main_window().rect(); let letter = &model .letters .chars() .nth(model.counter) .unwrap() .to_string(); model.step_size = text(letter) ....
Rust
0
This example retrieves in oPointRef the reference point for | PointOnSurface feature. | | Dim oPointRef As CATIAReference | Set oPointRef = PointOnSurface.PointRef :rtype: Reference """ return Re...
Python
1
(_, ty, _): (usize, Expression, usize), (_, storage, _): (usize, ::std::option::Option<StorageLocation>, usize), (_, name, _): (usize, Identifier, usize), ) -> VariableDeclaration { VariableDeclaration { ty, storage, name } } #[allow(unused_variables)] fn __action27< 'input, >( input: &...
Rust
0
gen::Local<'env, crate::java::lang::Throwable>> { // class.path == "java/lang/invoke/MethodHandleInfo", java.flags == PUBLIC | STATIC, .name == "refKindIsValid", .descriptor == "(I)Z" unsafe { let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)]; let (__jn...
Rust
0
::Arc; /// list of pre-computed checkpoints from a given [`Ref`]. /// /// [`Ref`]: ./struct.Ref.html #[derive(Clone, Debug, PartialEq, Eq)] pub struct Checkpoints(Vec<HeaderHash>); impl Checkpoints { /// create a new list of checkpoints from the given starting point (tip). /// /// The function make use of...
Rust
0
hi, self.step) def __repr__(self): return 'Range(lo={}, hi={}, step={})'.format(self.lo, self.hi, self.step) class LinspaceRange(object): """ Defines a domain with precise endpoints but the points are not precisely equidistant Similar to numpy.linspace """ def __init__(self, lo, hi, ...
Python
1
""" An implementation of the basestring type for Python 3 Example use: >>> s = b'abc' >>> assert isinstance(s, basestring) >>> from past.types import str as oldstr >>> s2 = oldstr(b'abc') >>> assert isinstance(s2, basestring) """ import sys from past.utils import with_metaclass, PY2 if PY2: str = unicode ver...
Python
1
def mochila_gulosa(capacidade, itens): itens.sort(key = lambda x: x.razao, reverse = True) capacidade_restante = capacidade itens_seleciondados = [] for item in itens: if item.peso <= capacidade_restante: itens_seleciondados.append(item) capacidade_restante -= item.peso ...
Python
1
"""Module that describes a rook""" from typing import Tuple, Dict, List import pygame from game.model.pieces.piece import Piece, PieceColor, CELL_SIZE WHITE_ROOK = pygame.image.load('assets\\images\\white_rook.png') BLACK_ROOK = pygame.image.load('assets\\images\\black_rook.png') WHITE_ROOK = pygame.transform.scale...
Python
1
# Маппинг полей: avatar -> avatar_url field_name = 'avatar_url' if key == 'avatar' else key data[field_name] = file print(f"UserProfileView.update: Объединенные данные для сериализатора: {list(data.keys())}") serializer = self.get_serializer(ins...
Python
1
) mulx $9, $5, $3 // (lo, r3) = a * b2 adc $5, $2 // r2 += lo + CF (carry in CF) mulx $10, $5, $4 // (lo, r4) = a * b3 adc $5, $3 // r3 += lo + CF (carry in CF) adc $11, $4 // r4 += 0 + CF (no carry, CF to 0) " : // Output c...
Rust
0
, Lint { name: "zst_offset", group: "correctness", desc: "Check for offset calculations on raw pointers to zero-sized types", deprecation: None, module: "methods", }, ]; // end lint list, do not remove this comment, it’s used in `update_lints` } <reponame>TenStrings/chain...
Rust
0
up_dirs = { "C:/Program Files (x86)/Steam/steamapps/sourcemods": sourcemod_dirs, "D:/SteamLibrary/steamapps/common": {**goldsrc_dirs, **source_dirs}, "E:/Mod": extracted_dirs, # console groups "E:/Mod/Dreamcast": dreamcast_dirs, "E:/Mod/PS4": ps4_dirs, "E:/Mod/Switch": switch_dirs, "E:/M...
Python
1
// Overlaps lead to index 9~15, which are illegal in range table // shift1 = (input, prev_input) << 1 byte let shift1 = push_last_byte_of_a_to_b(prev_input, input); let pos = _mm256_sub_epi8(shift1, _mm256_set1_epi8(0xEFi32 as i8)); // -------...
Rust
0
# Copyright 2024 the LlamaFactory team. # # 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 i...
Python
1
l information // regarding copyright ownership. The ASF licenses this file // to you 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 req...
Rust
0
N, M = map(int, input().split()) find = {} # 메모장 만들기 for _ in range(N): site, password = map(str, input().split()) find[site] = password # 비밀번호 찾기 for _ in range(M): print(find[input()])
Python
1
assert ( min_vocab_size <= vocab_size ), f"Vocab size {vocab_size} is too small for the range of tokens {min_vocab_size}" if min_vocab_size + 100 > vocab_size: logging.warning( f"Initial alphabet size {min_vocab_size} is almost as large as the vocab" ...
Python
1
from collections import deque n, m = map(int, input().split()) # 방 크기 r, c, d = map(int, input().split()) # 시작 좌표 + 방향 room_map = [] for _ in range(n): room_map.append(list(map(int, input().split()))) dr = [-1, 0, 1, 0] dc = [0, 1, 0, -1] # 북 동 남 서 / 0 1 2 3 # 모든 경우의 수를 찾는다 -> DFS or BFS를 사용하라 def get_count...
Python
1
block_size: Some(65464), ..Opts::default() } ); let (_, opts) = parse_opts(b"blksize\065465\0").unwrap(); assert_eq!( opts, Opts { block_size: None, ..Opts::default() } ); } #[test] fn check_timeout_boundaries() { let (_, opts) = ...
Rust
0
ve trackback""" def __init__(self, app: Sphinx, stream: IO) -> None: self.app = app def write(self, data: str) -> None: self.app.messagelog.append(data) def setup(app: Sphinx, status: IO, warning: IO) -> None: """Setup root logger for Sphinx""" logger = logging.getLogger(NAMESPACE) ...
Python
1
using LogisticRegression::MINI_BATCH training algorithm. It /// has to take values less than the total number of training samples. /// ## See also /// setMiniBatchSize fn get_mini_batch_size(&self) -> Result<i32> { unsafe { sys::cv_ml_LogisticRegression_getMiniBatchSize_const(self.as_raw_LogisticRegression())...
Rust
0
val="weekly", time_period="14") is not None def test_get_ad() -> None: assert handler.get_ad(symbol="IBM", interval="daily") is not None def test_get_adosc() -> None: assert handler.get_adosc(symbol="IBM", interval="daily", fastperiod="5") is not None def test_get_obv() -> None: assert handler.get_obv(sy...
Python
1
import os import re def distribute(PROJECT_DIR, TARGET_READMES_DIR): def make_relative_link(project_abspath, match): label, abs_path = match.group(1), match.group(2) # 将绝对路径转为相对路径 # 只针对属于本项目目录下的文件 abs_path_norm = abs_path.replace("\\", "/") proj_path_norm = project_abspath.re...
Python
1
erialize)] pub struct Team { id: u64, node_id: NodeId, url: String, html_url: String, name: String, slug: String, description: Option<String>, privacy: String, permission: String, members_url: String, repositories_url: String, parent: Option<Box<Team>>, } #[derive(Clone,...
Rust
0
} $crate::decl_module! { @impl_offchain $mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?>; { $( $other_where_bounds )* } $( $offchain )* } $crate::decl_module! { @impl_deposit_event $mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?>; $system;...
Rust
0
ates.iter().sum(); let target = sum_integrated_spectra(a, eta); let error = ((total - target) / target).abs(); println!("a = {:.2e}, eta = {:.2e} => sum_{{n=1}}^{{{}}} rate_n = (alpha/eta) {:.6e}, err = {:.3e}", a, eta, nmax, total, error); assert!(error < 1.0e-3); let (nmax, a,...
Rust
0
import torch.nn as nn import torch from .token import TokenEmbedding from .position import PositionalEmbedding class BERTEmbedding(nn.Module): def __init__(self,cfg, inp_channels, embed_size, dropout=0.1, max_len = 7, istrain=False): super().__init__() self.cfg = cfg self.token = TokenEmb...
Python
1
let root_url = reqwest::Url::parse(api_root).expect("Could not parse API root"); let url = root_url.join("/oauth/token").expect("Could not parse API endpoint"); let client = Client::new(); let response = client.post(url).json(&params_map).send()?; match response.status() { ...
Rust
0
ect='auto', origin='lower') fig.colorbar(im, ax=ax[1]) ax[1].set_title('Noise mags - pred') noise_diff = noise - noise_pred im = ax[2].imshow(noise_diff.T, aspect='auto', origin='lower') fig.colorbar(im, ax=ax[2]) ax[2].set_title('Noise mags - diff') for ax in fig.axes: ...
Python
1
#!/usr/bin/env python # DO NOT EDIT # Autogenerated from the notebook lowess.ipynb. # Edit the notebook and then sync the output with this file. # # flake8: noqa # DO NOT EDIT # # LOWESS Smoother # # This notebook introduces the LOWESS smoother in the `nonparametric` # package. LOWESS performs weighted local linear f...
Python
1
# Tests for a few of the "double-double" C++ functions defined in # special/cephes/dd_real.h. Prior to gh-20390 which translated these # functions from C to C++, there were test cases for _dd_expm1. It # was determined that this function is not used anywhere internally # in SciPy, so this function was not translated. ...
Python
1
vation_manager.compute() return obs_dict["policy"], {"observations": obs_dict} @property def episode_length_buf(self) -> torch.Tensor: """The episode length buffer.""" return self.unwrapped.episode_length_buf @episode_length_buf.setter def episode_length_buf(self, value: torch....
Python
1
#[test] fn test_bitwise_xor() { let s = to_chars("^"); let cur = &mut 0; expect_next_token(&s, cur, Token::BitwiseXor); } #[test] fn test_xor_equals() { let s = to_chars("^="); let cur = &mut 0; expect_next_token(&s, cur, Token::XorEquals); } /* ...
Rust
0
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
Python
1
')), Some(&Controllers::Filter) ); assert_eq!( event_controllers.get(&Event::Char('v')), Some(&Controllers::CFilter) ); assert_eq!( event_controllers.get(&Event::Char('o')), Some(&Controllers::JForward) ); assert_eq!( event_controllers.get(&Event::...
Rust
0
import csv import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from argparse import ArgumentParser def make_plot(epoch_scores, output_file): plt.figure(figsize=(4*1.5, 3*1.5), dpi=200) sns.lineplot(data=epoch_scores, x='Epoch', y='F1', hue='Model', style='Method', markers=True, dashes=F...
Python
1
z: -1036.0 } }, BoostPad { id: 15, big: true, location: Vector3 { x: -3584.0, y: 9.0, z: 0.0 } }, BoostPad { id: 16, big: false, location: Vector3 { x: -1024.0, y: 6.0, z: 0.0 } }, BoostPad { id: 17, big: false, location: Vector3 { x: 1024.0, y: 6.0, z: 0.0 } }, BoostPad...
Rust
0
com_conn: xous::CID) -> Result<xous::Result, xous::Error> { let s: xous_names::api::XousServerName = name.try_into()?; let request = api::Opcode::RegisterBattStatsListener(s); let mut writer = rkyv::ArchiveBuffer::new(xous::XousBuffer::new(4096)); let pos = writer.archive(&request).expect("couldn't arc...
Rust
0
import logging import hydra import pytorch_lightning as pl from omegaconf import DictConfig from nuplan.planning.script.builders.metric_runner_builder import build_metric_runners from nuplan.planning.script.builders.simulation_log_builder import build_simulation_logs from nuplan.planning.script.run_simulation import ...
Python
1
cation with k-fold cross-validation. Args: X (np.ndarray): Feature matrix. y (np.ndarray): Target vector. **kwargs: Additional keyword arguments for k-fold cross-validation. Returns: tuple[np.ndarray, float, np.ndarray]: - Predictions from the cross-validation. ...
Python
1
describer::*; use test_api::*; use test_macros::test_each_connector; #[tokio::test] async fn all_postgres_column_types_must_work() { let mut migration = Migration::new().schema(SCHEMA); migration.create_table("User", move |t| { t.add_column("array_bin_col", types::array(&types::binary())); t.ad...
Rust
0
>= 20 && Self::is_base64_string(word)) .filter(|word| Self::calc_entropy(word, 64) > 4.5) .map(|word| str::from_utf8(word).unwrap().to_string()) .collect(); let mut hex_words: Vec<String> = words .iter() // there must be a better way .filter(|word| (w...
Rust
0
/ (2.0 * 2.0 + 2.0 * 2.0 * 0.0 * 0.0) as f32).sqrt(), -(2.0 / (2.0 * 2.0 + 2.0 * 2.0 * 0.0 * 0.0) as f32).sqrt(), (0.0 / (2.0 * 2.0 + 2.0 * 2.0 * 0.0 * 0.0) as f32).sqrt() ) ); } #[test] fn as_color_test() { let col = Vec3::new(1.0, 0.0, 0.143).as_color(); assert_eq!( ...
Rust
0
# # SPDX-License-Identifier: MIT # # Copyright (c) 2025 Carsten Igel. # # This file is part of simplepycons # (see https://github.com/carstencodes/simplepycons). # # This file is published using the MIT license. # Refer to LICENSE for more information # """""" # pylint: disable=C0302 # Justification: Code is generated ...
Python
1
Op, Ts>( &mut self, scope: &mut Scope, var: &Variable, initializer: Op, shape: Ts, dtype: DataType, slot_name: &str, op_name: &str, ) -> Result<Variable> where Op: ::framework::GetOp, Ts: ShapeOps; /// Find or create a slot ini...
Rust
0
t_b14_3 - t_b14_4 + t_b14_5 - t_b14_6 + t_b14_7 - t_b14_8 + t_b14_9 - t_b14_10 + t_b14_11 - t_b14_12 + t_b14_13 - t_b14_14); let t_b1_rot = self.rotate.rotate(t_b1); let t_b2_rot = self.rotate.rotate(t_b2); let t_b3_rot = self.rotate.rotate(t_b3); let t_b4_rot = self.rotate.rotate(t_b4...
Rust
0
, c_int); pub type COLLECT_CB = extern "C" fn(*mut WorkerP, *mut Task, *mut c_void, *mut u8) -> BDD; extern "C" { pub fn Sylvan_isconst(bdd: MTBDD) -> c_int; pub fn Sylvan_isnode(bdd: MTBDD) -> c_int; pub fn Sylvan_set_granularity(granularity: c_int) -> c_void; pub fn Sylvan_get_granularity() -> c_int...
Rust
0
} #[doc = "Bit 25 - Codec FIFO Overflow"] #[inline(always)] pub fn c_ovr(&self) -> C_OVR_R { C_OVR_R::new(((self.bits >> 25) & 0x01) != 0) } #[doc = "Bit 26 - CRC Synchronization Error"] #[inline(always)] pub fn crc_err(&self) -> CRC_ERR_R { CRC_ERR_R::new(((self.bits >> 26) ...
Rust
0
import streamlit as st from streamlit_chat import message # from utils import * from utils_2 import * # from urls_extracter import * from url_extractor_main import * import re if "user_input" not in st.session_state: st.session_state['user_input'] = [] if "AI_responce" not in st.session_state: ...
Python
1
"""Training utilities and trainers for DNA sequence models.""" from .utils import ( compute_metrics, compute_metrics_f1, compute_metrics_mcc, count_parameters, get_model_size_mb, get_training_summary, validate_training_inputs, create_training_config, get_default_training_args, ) fr...
Python
1
ecirc" => make("\\^{e}", false, "&ecirc;", "e", "ê", "ê"), "Euml" => make("\\\"{E}", false, "&Euml;", "E", "Ë", "Ë"), "euml" => make("\\\"{e}", false, "&euml;", "e", "ë", "ë"), "Igrave" => make("\\`{I}", false, "&Igrave;", "I", "Ì", "Ì"), "igrave" => make("\\`{i}", false, "&igrave;", "i", "ì", "ì"), ...
Rust
0
/ 1000.0, 'g', label='melt') plt.ylabel('divergence (m/s)') plt.grid(True) # optional - check velo field correctness #fig = plt.figure(4, facecolor='w') #plt.plot(x, sliding[ind]) #plt.grid(True) # plot some edge quantities inde = np.nonzero(yEdge[:] == centerY) xe = xEdge[inde]/1000.0 ve = f.variables['waterVelocit...
Python
1
"species", component=species.Page, label="layout.species", children=[ solara.Route( path=":species_id", component=species.Page, ), ], ), solara.Route( "diseases", component=diseases.Page, label="la...
Python
1
assert!(exponent <= PUBLIC_EXPONENT_MAX_VALUE); let mut acc = base.clone(); let mut bit = 1 << (64 - 1 - exponent.leading_zeros()); debug_assert!((exponent & bit) != 0); while bit > 1 { bit >>= 1; acc = elem_squared(acc, m); if (exponent & bit) != 0 { acc = elem_m...
Rust
0
/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, either express or implied. // See the License for the specific language governing permissions and // limitations un...
Rust
0
uct FilterMap<F, In, Out> where F: FnMut(In) -> Option<Out>, { name: SharedString, filter_map: F, inlet: Inlet<In>, outlet: Outlet<Out>, log_blocks: bool, } impl<F, In, Out> FilterMap<F, In, Out> where F: FnMut(In) -> Option<Out>, { pub fn new(name: impl Into<SharedString>, f: F) -> Sel...
Rust
0
trace!("Saved epoch state list {:?} to {:?}", epoch_state_list, &self.state_path); Ok(()) } /// Empty the `EpochState` list both in memory and to disk pub fn reset(&self) -> Result<(), Error> { let mut guard = self.lock_guard_or_wait()?; replace(&mut *guard, vec![]); ...
Rust
0
//! struct Ws; //! //! impl Actor for Ws { //! type Context = ws::WebsocketContext<Self>; //! } //! //! // Handler for ws::Message messages //! impl StreamHandler<ws::Message, ws::ProtocolError> for Ws { //! fn handle(&mut self, msg: ws::Message, ctx: &mut Self::Context) { //! match msg { //! ...
Rust
0
fset ~= target_position`. zero_pos = arm.read("Present_Position") zero_nearest_pos = compute_nearest_rounded_position(zero_pos, arm.motor_models) homing_offset = zero_target_pos - zero_nearest_pos # The rotated target position corresponds to a rotation of a quarter turn from the zero position. # Th...
Python
1
from ._DCVMethods import DCV_peak_area, Automated_trumpet
Python
1
text)} символов\$\\. " f"Максимальная длина\\: {MAX_POST_TEXT_LENGTH}\\. " # Use imported constant "Пожалуйста, сократите текст и отправьте снова\\.", reply_markup=get_cancel_keyboard(), parse_mode="MarkdownV2" ) return await state.update_data(text=te...
Python
1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, Generic, Optional, Tuple, TypeVar from my_qlib.typehint import final if TYPE_CHECKING: from .utils.env_wrapper import EnvWrapper SimulatorState = TypeVar("Sim...
Python
1
s.", "Error", gtk::MessageType::Error); } else { return Some(ga_image::point::Rect{ x: x_offset.unwrap() as i32, y: y_offset.unwrap() as i32, width: width.unwrap(), height: height.unwrap() }); ...
Rust
0
f64::from_bits(ui); if k < 20 { y = (x - e + (1.0 - uf)) * twopk; } else { y = (x - (e + uf) + 1.0) * twopk; } y } #[cfg(test)] mod tests { #[test] fn sanity_check() { assert_eq!(super::expm1(1.1), 2.0041660239464334); } } #![allow(bad_style, overflowing_literals,...
Rust
0
class Solution: def judgeCircle(self, moves: str) -> bool: return moves.count('R') == moves.count('L') and moves.count('U') == moves.count('D')
Python
1
a="AbC dEf Gh" #实例调用 #1.str.lower 返回字符串的副本,全部字符小写 b=a.lower() print(b) #2.str.upper 返回字符串的副本,全部字符大写 b=a.upper() print(b) #3.str.title 返回字符串的副本,全部单词首字母大写,其余小写 b=a.title() print(b) #4.str.capitalize 返回字符串的副本,全部字符首字母大写,其余小写 b=a.capitalize() print(b) #5.str.strip 返回字符串的副本,去掉首尾字符 b=a.strip() print(b) #6.str.lstrip(char...
Python
1
, 1); let b: u32x4 = u32x4::new(1, 0, 0, 0); let e: u16x4 = u16x4::new(0xFF_FF, 0, 0, 0); let r: u16x4 = transmute(vsubhn_u32(transmute(a), transmute(b))); assert_eq!(r, e); } #[simd_test(enable = "neon")] unsafe fn test_vsubhn_u64() { let a: u64x2 = u64x2::new(0xFF_...
Rust
0
def _deserialize(self, params): self._CertId = params.get("CertId") self._DnsNames = params.get("DnsNames") self._CertCaId = params.get("CertCaId") self._SSLMode = params.get("SSLMode") memeber_set = set(params.keys()) for name, value in vars(self).items(): p...
Python
1
# Given an array of integers nums sorted in non-decreasing order, # find the starting and ending position of a given target value. # If target is not found in the array, return [-1, -1]. # You must write an algorithm with O(log n) runtime complexity. def findPosition(nums, target): if target not in nums: ...
Python
1
Color::Reset)] #[case::action_merge_selected( DisplayColor::ActionMerge, true, CrosstermColor::DarkYellow, CrosstermColor::AnsiValue(237) )] #[case::normal(DisplayColor::Normal, false, CrosstermColor::Reset, CrosstermColor::Reset)] #[case::normal_selected(DisplayColor::Normal, true, CrosstermColor::Reset, C...
Rust
0
19487, 3.2645), (0.64396, 0.18664, 3.3662), (0.65446, 0.1803, 3.4671), (0.66514, 0.17558, 3.5675), (0.67598, 0.17227, 3.6674), (0.68701, 0.17016, 3.7669), (0.69821, 0.16911, 3.8661), (0.70959, 0.16897, 3.9653), (0.72117, 0.16966, 4.0644), (0.73292, 0.17107, 4.1635), (0.74488, 0.1...
Rust
0
_count); info!( "Server send to ({}) -> {}", self.server.user(&user_key).address(), new_message_contents ); let new_message = StringMessage::new(new_message_cont...
Rust
0
# Generated by Django 4.2.1 on 2024-07-06 14:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bot', '0019_alter_compleatetasks_date'), ] operations = [ migrations.AddField( model_name='users', name='cliker_box'...
Python
1
import random as rd var=rd.randint(1,6) v=int(input("Enter a no from 1 to 6:")) if var==v: print("You\'ve guessed it correctly") else: print("Better luck next time") print(var)
Python
1
[tensor_name]) # Use copy to avoid errors with numpy and pytorch parsed_parameters["tensors"][name] = torch.from_numpy(np.copy(weights)) if len(reader_keys) > 0: logger.info(f"Some keys of the GGUF file were not considered: {reader_keys}") return parsed_parameters def revers...
Python
1
.user_name()) } else { None } } fn extra_groups(&self) -> Option<NonEmptyMap<TemplateString, ExtraGroup, &'_ Map<TemplateString, ExtraGroup>>> { NonEmptyMap::from_map(&self.spec.extra_groups) } fn get_include(&self, name: &VPackageName) -> Option<&Package> { ...
Rust
0
ead_bytes(&paths.delta).is_err()); } #[test] fn test_compound_blobfs() { let testdata_dir: PathBuf = TESTDATA_DIR.into(); let alpha_beta_artifact_reader = BlobFsArtifactReader::try_new( testdata_dir.as_path(), testdata_dir.join(ALPHA_BETA_BLOBFS_FILE).as_path(), ) .unwrap(); let bet...
Rust
0
ecified." detail = (f"Vehicle ID: {vehicle_detail[0]} \n" f"Model: {vehicle_detail[1]} \n" f"Last Inspection: {vehicle_detail[2]} \n" f"Next Inspection: {vehicle_detail[3]} \n" f"Performance: {vehicl...
Python
1
rch_dataloaders(self): dataset = TestDataset(self.u2seq, self.u2seq_add, self.u2answer, self.max_len) dataloader = data_utils.DataLoader(dataset, batch_size=self.batch_size, shuffle=False, pin_memory=True) return dataloader def _extract_into_tensor(arr, timesteps, broadcast_shape): """ ...
Python
1
import numpy as np sifrank = [0.2938,0.3912, 0.3982,0.2238,0.3260,0.3725,0.1116,0.1603,0.1842,0.2430,0.2760,0.2796,0.0162,0.0252,0.0300,0.0301,0.0534,0.0586] sifrank_f5 = [sifrank[i]*100 for i in range(0,len(sifrank),3)] sifrank_f10 = [sifrank[i]*100 for i in range(1,len(sifrank),3)] sifrank_f15 = [sifrank[i]*100 for ...
Python
1
import cv2 import argparse import visualization.plot_segments as plot_segments if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--video_path', type=str, help="path to desired input video file") parser.add_argument('--gt_file', type=str, help="path to ground truth of that ...
Python
1
# -*- coding: utf-8 -*- # This file is called from 'test_eval.py' if "call_test2" in locals(): call_test2(y) # noqa: F821 undefined name
Python
1
bj; $( let _: $field_type = $field; )* }; } } #[allow(unused_macros)] // rust-analyzer is being weird macro_rules! check_enum_variants { ($obj:ty : $typ:ty { $($name:ident = $value:expr),* $(,)? }) => { const _: fn($typ) -> Result<$obj, planus...
Rust
0
U8>) { self.encrypt(block); } } impl BlockDecrypt for Rc2 { fn decrypt_block(&self, block: &mut GenericArray<u8, U8>) { self.decrypt(block); } } opaque_debug::implement!(Rc2); <reponame>DevLazio/graph-rs<filename>src/sites/request.rs use crate::client::Graph; use crate::content_types::{Con...
Rust
0
de los que existen en total!") # El resto de nodos son libres => no se especifica su tipo free_count = num_nodes - pinned_count # Ej: pinned_list = [0,0,2] (2 machines, 1 assembly), free_count= (lo que falte) # Barajamos pinned_list pinned_list = torch.tensor(pinned_list, devic...
Python
1
# -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import argparse import sys from pathlib import Path import bpy import os MAX_SIZE = 5e7 _package_dir = os.path.dirname(os.path.realpath(__f...
Python
1
in product_text: score += 1 matched_keywords_for_product.append(w) for word in product_text.split(): try: similarity = fuzz.ratio(keyword, word) / 100.0 if similarity >= 0.8: score += 1 ...
Python
1
doc = "Write proxy for field `DMA_OUTLINK_ADDR_CH2`"] pub struct DMA_OUTLINK_ADDR_CH2_W<'a> { w: &'a mut W, } impl<'a> DMA_OUTLINK_ADDR_CH2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { self.w.bits = (self.w.bits & !0x000f_...
Rust
0
::new_v4(), first_name: FirstName(EN).fake(), last_name: LastName(EN).fake(), email: SafeEmail(EN).fake(), }); } for customer in customers { let pool = pool.clone(); thread::spawn(move || { let connection = pool.get().expect("Connection er...
Rust
0
p(|seals| SealFlags::from_bits_unchecked(seals as u32)) } } #[inline] pub(crate) fn fcntl_add_seals(fd: BorrowedFd<'_>, seals: SealFlags) -> io::Result<()> { #[cfg(target_pointer_width = "32")] unsafe { ret(syscall_readonly!( __NR_fcntl64, fd, c_uint(F_ADD_SEALS)...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2007-2025 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 y...
Python
1
from django.apps import AppConfig class ImageSharingAppConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'image_sharing_app'
Python
1
temperatura = float(input("digite a temperatura em celsius: ")) if temperatura > 30: print(f"Está a {temperatura} grau celsius,vista roupas leves ") elif temperatura >= 15: print(f"está a {temperatura} grau celsius, vista roupas confortaveis ") elif temperatura < 15: print(f"está a {temperatura} grau celsiu...
Python
1
## Used an old nightly //! //! Error message: //! //! ``` text //! $ cargo build //! Compiling cortex-m-rt v0.2.0 //! error[E0463]: can't find crate for `core` //! | //! = note: the `thumbv7em-none-eabihf` target may not be installed //! //! error: aborting due to previous error //! ``` //! //! Solution: Use a more rec...
Rust
0
#!/usr/bin/python ############################################################################################# # # get_idaho_chip_gbdxtools_v2.py # # Created by: Dave Loomis # Digitalglobe GBD Solutions # # Version 0.1: Dec 15, 2016 # - example of how to get idaho tif chip # # Usage: py...
Python
1
import unittest from selenium import webdriver from selenium.webdriver.common.by import By from ddt import ddt, data, unpack @ddt class SearchDDT(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() driver =self.driver driver.implicitly_wait(30) driver.maximiz...
Python
1
ADDING.load(Ordering::SeqCst) } pub fn set_padding(value: usize) { PADDING.store(value, Ordering::SeqCst) } pub fn sub_padding(amount: usize) { let padding = get_padding(); if padding >= amount { set_padding(padding - amount); } } pub fn padding() -> String { format!("{0:<1$}", " ", get_p...
Rust
0
_nopad(input: TokenStream) -> TokenStream { helper(input, data_encoding::BASE32HEX_NOPAD) } #[proc_macro_hack] pub fn base32_nopad(input: TokenStream) -> TokenStream { helper(input, data_encoding::BASE32_NOPAD) } #[proc_macro_hack] pub fn base64_nopad(input: TokenStream) -> TokenStream { helper(input, dat...
Rust
0