text
string
label_name
string
labels
int64
<(), Infallible> { profile!("apply-intents"); let tick = world.time(); let s = tracing::error_span!("apply-intents", tick = tick); let _e = s.enter(); debug!("Got {} intents", intents.len()); intents::move_into_storage(world, intents); debug!("Executing systems...
Rust
0
import torch from ..oracle_utils import interpolate from ..soccer.stop import StopReference, StopSoccerOracle class KickSoccerOracle(StopSoccerOracle): def __init__(self, **kwargs): super().__init__(**kwargs) self.reference = StopReference( num_envs=self.num_envs, predicti...
Python
1
import xml.etree.ElementTree as ET import sumolib import os def fix_calibrators(): print("=== SỬA CALIBRATOR POSITIONS ===\n") # Kiểm tra file tồn tại net_file = "network/region_1.net.xml" cal_file = "additional/calibrator_hour_8.xml" if not os.path.exists(net_file): print(f"❌ Khô...
Python
1
\"{}\"", x)).collect(); let mut array = "[".to_string(); for item in &with_quotes { array.push_str(item); array.push_str(",") } if with_quotes.len() > 0 { array.pop(); } array.push_str("]"); array } fn characterless_player_to_phase_json_obj(player: &CharacterlessPlay...
Rust
0
from django.views.generic import ( ListView, CreateView, DeleteView, DetailView, UpdateView, ) from django.urls import reverse_lazy from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from ..models import Service, AdCompany, Client, Contract class ContractListView(Pe...
Python
1
pub(crate) fn get(&self, var: &Var) -> Option<&Id> { self.vec .iter() .find_map(|(v, id)| if v == var { Some(id) } else { None }) } } impl std::ops::Index<&Var> for Subst { type Output = Id; fn index(&self, var: &Var) -> &Self::Output { match self.get(var) { ...
Rust
0
起纷争吗?', TxtCtl.Enter, ), ) CloseMessageWindow() def _loc_40DA(): pass label('loc_40DA') Jump('loc_4132') def _loc_40DD(): pass label('loc_40DD') If( ( (Expr.TestScenaFlags, ScenaFlag(0x0083, 3, 0x41B)), Expr.Return, ), ...
Python
1
�阳市市辖区"); map.insert("410902", "河南省濮阳市华龙区"); map.insert("410921", "河南省滑县"); map.insert("410922", "河南省清丰县"); map.insert("410923", "河南省南乐县"); map.insert("410924", "河南省内黄县"); map.insert("410925", "河南省长垣县"); map.insert("410926", "河南省范县"); map.insert("410927", ...
Rust
0
a; use target_lexicon::Triple; /// Return an `isa` builder configured for the current host /// machine, or `Err(())` if the host machine is not supported /// in the current configuration. pub fn builder() -> Result<isa::Builder, &'static str> { builder_with_options(isa::BackendVariant::Any, true) } /// Return an ...
Rust
0
"SRCSRVTRG=%LOCALAPPDATA%\\fts\\fts_pdbsrc\\{}\\%FTS_PDBSTR_UUID%\\%var2%", Path::new(&op.pdb).file_stem().unwrap().to_str().unwrap() )?; if nonces.is_empty() { writeln!( srcsrv, "SRCSRVCMD=fts_pdbsrc extract_one --pdb-uuid %FTS_PDBSTR_UUID% --file %var2% --out %SRCS...
Rust
0
self.spline.points() } pub fn set_points(&mut self, points: Vec<SplinePoint<(Scalar, Scalar)>>) { if let Ok(result) = Self::new(points) { *self = result; } } pub fn spline(&self) -> &Spline<(Scalar, Scalar)> { &self.spline } pub fn sample(&self, mut ...
Rust
0
icator: Arc::new(Box::new(move || { let alg = Algorithm::HS512; let bearer_token_lifetime = Duration::from_secs(60 * 60); let refresh_token_lifetime = Duration::from_secs(60 * 60 * 24); shareable_data(JwtAuthenticator::new( iss.clone(), alg...
Rust
0
embedding_result: emb = embedding_result['embedding'] else: emb = embedding_result.embedding print(f"✅ Generated test embedding successfully (length: {len(emb)})") print(f" First few va...
Python
1
register accessor: an alias for `Reg<TRACECONFIG_SPEC>`"] pub type TRACECONFIG = crate::Reg<traceconfig::TRACECONFIG_SPEC>; #[doc = "Clocking options for the trace port debug interface"] pub mod traceconfig; #[doc = "LFRCMODE register accessor: an alias for `Reg<LFRCMODE_SPEC>`"] pub type LFRCMODE = crate::Reg<lfrcmod...
Rust
0
ic(self, metric: float) -> None: """ Record a new value of the metric and update the various things that depend on it. """ new_best = ( (self._best_so_far is None) or (self._should_decrease and metric < self._best_so_far) or (not self._should_decrease ...
Python
1
Next>(tag_name: &str, stack: &mut T) -> Result<Prefix, XmlParseError> { try!(start_element(tag_name, stack)); let obj = try!(characters(stack)); try!(end_element(tag_name, stack)); Ok(obj) } } /// Write `Prefix` contents to a `SignedRequest` struct PrefixWriter; impl PrefixWriter { ...
Rust
0
#write a python program to use of forzenset. set_1={1,2,3,4,5,6} set1=frozenset(set_1) print(set1)
Python
1
TRAVIS_BRANCH".to_string()), }); assert!(info.ci); assert!(info.pr.unwrap()); assert_eq!(info.vendor.unwrap(), Vendor::TravisCI); assert_eq!(info.name.unwrap(), "Travis CI"); assert_eq!(info.branch_name.unwrap(), "mock_branch"); } #[test] fn get_pr2_travis() { let info = get_with_env(TestV...
Rust
0
torch.cuda.set_device(args.local_rank) # device = torch.device('cuda', args.local_rank) # dist.init_process_group(backend='nccl', init_method='env://') # distributed backend # model = get_net(cfg).to(device) # model_file = '/home/zwt/DaChuang/weights/epoch--2.pth' # checkpoint = tor...
Python
1
ns_list): recon = recon.squeeze(0).cpu() for image in range(recon.size(0)): save_image(recon[image, :, :, :], '{}/m{}/m{}/{}_{}.png'.format(savedir, r,o, image, i)) def cross_generate(self, data): N = 10 recon_tries...
Python
1
knight_moves(position, capture_mask, push_mask, !pinned, list); slider_moves(position, capture_mask, push_mask, pinned, king_sq, list); pawn_moves(position, capture_mask, push_mask, !pinned, list); } Ordering::Less => { let push_mask = EMPTY; // When not ...
Rust
0
network_interfaces.push(network_interface); } AF_INET6 => { let sockaddr: *mut SOCKADDR_IN6 = address.lpSockaddr as *mut SOCKADDR_IN6; let addr = make_ipv6_addr(&sockaddr)?...
Rust
0
tusError as error: # We expect to find Declaration/Affirmations without a normalizer meta if error.response.status_code == 404 and origin.method != "manual": logger.warning( "Could not find normalizer_meta [task_id=%s, method=%s, origin_type=%s...
Python
1
#!/usr/bin/env python3 ''' This script is on variables. I will be adding some legal and illegal variables ''' #illegal variables #1animal = "Snake" #an-animal = "Dog" #an animal = "cat" #legal variables ananimal = "G" an_a = "a" _a_ab = "bs" anAni = "Owl" ANIMAL = "bunny" print(anAni)
Python
1
Sender<Message>, audio_clock: ClockConsumer, state_tracker: GridStateTracker, virtual_grid: VirtualGrid, picking_scale: bool } impl MMMS { pub fn new( ports: (BelaPort, BelaPort), width: usize, height: usize, tempo: f32, ) -> (MMMS, MMMSRenderer) { let (...
Rust
0
from click.testing import CliRunner from mapboxcli.scripts.cli import main_group def test_config_file(tmpdir): """Get options from a config file.""" config = str(tmpdir.join('mapbox.ini')) with open(config, 'w') as cfg: cfg.write("[mapbox]\n") cfg.write("access-token = pk.test_config_file...
Python
1
#[inline] pub fn get_bit(&self, bit_index: usize) -> bool { let byte_index = Self::byte_index(bit_index); let byte = self.bytes[byte_index]; let mask_index = bit_index % 8; let bit_mask = 128 >> mask_index; 0 != (byte & bit_mask) } #[inline] pub fn set_bit(&mut s...
Rust
0
import httpx from config import Config async def create_crystalpay_invoice(config: Config, amount: float, order_id: str) -> tuple[str | None, str | None]: headers = {'Content-Type': 'application/json'} data = { "auth_login": config.crystalpay_login, "auth_secret": config.crystalpay_secret_key, ...
Python
1
use na::{self, Isometry3, Vector3}; use parry3d::math::Real; use parry3d::query; use parry3d::shape::{Ball, Cuboid}; #[test] fn ball_cuboid_toi() { let cuboid = Cuboid::new(Vector3::new(1.0, 1.0, 1.0)); let ball = Ball::new(1.0); let cuboid_pos = Isometry3::identity(); let ball_pos_intersecting = Isom...
Rust
0
); consume_token(&mut lexer, Tok::ColonColon).map_err(|_| { anyhow!( "{}\n\n A double colon was expected after the module address.", error_message ) })?; Some(address) } else { None }; if lexer.peek() != Tok::Ident...
Rust
0
"workspace".to_string(), config: workspace_task, }); } else { create_execution_plan_for_step( &config, &task, &mut steps, &mut task_names, true, allow_private, ); } // always add end task even if al...
Rust
0
hex_to_val(c)) { val = (val << 4) + b; bytes.next(); } } val } _ => c, }) } } unescaped } fn hex_to_bytes(s: &str) -> Result<Vec<u8>> { ...
Rust
0
WeakSchurNumber { fn hash<H: Hasher>(&self, state: &mut H) { self.partitions.hash(state) } } impl PartialEq for WeakSchurNumber { fn eq(&self, other: &WeakSchurNumber) -> bool { self.partitions.eq(&other.partitions) } } #[async_trait] impl Playable for WeakSchurNumber { #[allow(cl...
Rust
0
ef()); let token_layout = MsLayout { token_element: self.layout_token_element(context, &mut calculator), rquote, lquote }; Box::new(token_layout) } fn type_info(&self) -> ElementType { ElementType::TokenElement(TokenElement::Ms) } f...
Rust
0
")]), Attr { abc: vec![pq!("item1")], }, "args 1", ); check_msg( pq!(#[attr("item1", "item2")]), Attr { abc: vec![pq!("item1"), pq!("item2")], }, "args 2", ); } #[test] fn test_struct_flag() { #[derive(StructMeta, PartialEq...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2019 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
import runpod runpod.api_key = "IOQA87IDZCITG92W82HJA34LWYT6MFJF2JY3FYYU" # Get all my pods pods = runpod.get_pods() # Get a specific pod pod = runpod.get_pod(pod.id) # Create a pod pod = runpod.create_pod("test", "runpod/stack", "NVIDIA GeForce RTX 3070") # Stop the pod runpod.stop_pod(pod.id) # Resume the pod r...
Python
1
import abc import numpy from pomdpy.pomdp import Point class DiscreteState(Point): """ An ABC for a discrete representation of a point in a state space """ @abc.abstractmethod def copy(self): """ :return: """ @abc.abstractmethod def as_list(self): """ ...
Python
1
sh is changed. # # TODO(b/215560602): Delete this code when Zephyr's Cmake # system is fixed. paths_for_hashing = set() for path in self.cmake_defs.get("DTC_OVERLAY_FILE", "").split(";"): if not path: continue paths_for_hashing.add(pathlib...
Python
1
de(rename = "i64")] I64, /// The `i128` primitive signed integer. #[serde(rename = "i128")] I128, /// The SRML address type. AccountId, /// The SRML balance type. Balance, /// The SRML hash type. Hash, /// The SRML moment type. Moment, /// The SRML block number type. ...
Rust
0
from logging import getLogger from time import sleep from typing import Dict, List, Optional from openai import OpenAI, RateLimitError from medask.const import KEY_OPENAI from medask.models.comms.models import CMessage from medask.models.orm.models import Lang, Role from medask.util.decorator import timeit from medas...
Python
1
}) = self.res_in.recv() { match event { ServerEvent::ActionProgress { server_id, action, progress: _progress, maximum: _maximum, action_number: _action_number, } => spinner.se...
Rust
0
epoch_train_acc += torch.sum(torch.argmax(pred.data, axis=1) == y) / len(y) epoch_train_loss /= num_steps epoch_train_acc /= num_steps model.eval() classifier.eval() val_loss, val_accu = evaluate(val_loader, model, cl...
Python
1
from twilio.rest import Client from config import config import streamlit as st def get_twilio_client(): """Get Twilio client""" return Client(config["TWILIO_ACCOUNT_SID"], config["TWILIO_AUTH_TOKEN"]) def send_sms(to, message): """Send SMS using Twilio""" try: client = get_twilio_client() ...
Python
1
from flask import Blueprint, jsonify,request from app.database import get_mysql_connection from app.game.backened.game import Board history_api = Blueprint('history_api',__name__) # Retrieve a single game history entry by id @history_api.route('/getHistory', methods=['GET','POST']) def get_history_by_name(): da...
Python
1
pub transaction_forwards: Vec<UdpSocket>, pub vote: Vec<UdpSocket>, pub broadcast: Vec<UdpSocket>, pub transactions_quic: UdpSocket, } pub struct Tpu { fetch_stage: FetchStage, sigverify_stage: SigVerifyStage, vote_sigverify_stage: SigVerifyStage, banking_stage: BankingStage, cluste...
Rust
0
}; let sun_path: &mut [u8] = unsafe { let path_len = path.as_bytes().len(); // Pathname must be a null-terminated C string c_addr.sun_path[path_len] = 0; std::mem::transmute(&mut c_addr.sun_path[..path_len]) }; ...
Rust
0
e { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } pub const OptixRayFlags_OPTIX_RAY_FLAG_NONE: OptixRayFlags = 0; pub const OptixRayFlags_OPTIX_RAY_FLAG_DISABLE_ANYHIT: OptixRayFlags = 1; pub const OptixRayFlags_OPTIX_RAY_FLAG_ENFORCE_ANYHIT: OptixRayFlags = 2;...
Rust
0
default() -> Self { Self { server_addr: super::server::default_addr(), ui: view::Config::default(), } } } impl Client { /// Loads client configuration. /// /// The standard client configuration path is /// `(system config dir)/xyz.ashikun.zombiesplit/client....
Rust
0
extern crate dunce; use crate::game_data::{CustomGameData, CustomGameDataBuilder}; use sentry::integrations::panic::register_panic_handler; use std::{path, time::Duration}; const ARENA_HEIGHT: f32 = 90.0; const ARENA_WIDTH: f32 = 160.0; const PADDLE_HEIGHT: f32 = 16.0; const PADDLE_WIDTH: f32 = 4.0; const PADDLE_VELOC...
Rust
0
, calculation_func=calculate_spike_optimized, lookback_period=90, spike_threshold=0.15) finstore.write.indicator(ohlcv_data=ohlcv_data, calculation_func=detect_large_gap_optimized, lookback_period=90, gap_threshold=0.15) finstore.write.indicator(ohlcv_data=ohlcv_data, calculation_func=calculate_...
Python
1
; } use std::convert::TryFrom; if let Ok(agent_info) = crate::agent_store::AgentInfo::try_from(agent_info_signed) { if let Some(url) = agent_info.as_urls_ref().get(0) { if let Ok(purl) = kitsune_p2p_proxy::ProxyUrl::from_full(u...
Rust
0
from unittest import mock from test.unit.terrareg import TerraregUnitTest, setup_test_data, mock_models from test import client import terrareg.models class TestApiTerraregGitProviders(TerraregUnitTest): """Test TestApiTerraregGitProviders resource.""" def test_with_no_git_providers_configured(self, mock_m...
Python
1
}, ]; for &span in &spans { span_union.insert(span); } let content = "012345\n012345\n012345"; let mut iter = take_spans(content, &span_union); { let item = iter.next().unwrap(); assert_eq!(item.span, spans[0]); assert_e...
Rust
0
<S, Ix1>>, dim: usize, rtol: A::Real, strategy: Strategy, ) -> (Q<A>, R<A>) where A: Scalar + Lapack, S: Data<Elem = A>, { let h = Householder::new(dim, rtol); qr(iter, h, strategy) } #[cfg(test)] mod tests { use super::*; use crate::assert::*; use num_traits::Zero; #[test]...
Rust
0
0, 0, 0, ], ); transmute(ret) } /// Broadcast the low packed 8-bit integer from a to all elements of dst using writemask k (elements are copied from src when the corresponding mask bit is not set). /// /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm51...
Rust
0
rows = self.files.iter() .map(|file| first_table.row_for_file(file, file_has_xattrs(file))) .collect::<Vec<_>>(); let file_names = self.files.iter() .map(|file| self.file_style.for_file(file, self.theme).paint().promote()) ...
Rust
0
assert_eq!( sync.synchronize_inputs()?, vec![Some("second"), Some("remote_2")] ); advance_frame(&mut sync, 2, None)?; assert_eq!( sync.synchronize_inputs()?, vec![Some("third"), Some("remote_2")] ); advance_frame(&mut sync, 3,...
Rust
0
mt='-o', label='SAM', color=colors[1], capsize=5) if avg_dice_medsam is not None: plt.errorbar(avg_dice_medsam.index.categories.mid, avg_dice_medsam, yerr=sem_dice_medsam, fmt='-o', label='MedSAM', color=colors[2], capsize=5) plt.xlabel('Area (% of total image)', fontsize=20) plt.ylabel('Dice Score...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # flake8: noqa from wdom.tag import NewTagClass as NewTag from wdom.themes import * name = 'Bijou' project_url = 'http://andhart.github.io/bijou/' project_repository = 'https://github.com/andhart/bijou' license = 'MIT License' license_url = 'https://github.com/andhart/bi...
Python
1
print('Helo Kawand')
Python
1
texist except Keyisnotexist as error: return key, error else: error = None return key, error @staticmethod def animal(user_answers): """В этом методе ведётся подсчёт результатов. Сначала инициализируется словарь count. Затем происходи...
Python
1
n_name=RUN_NAME, project_name=PROJECT_NAME, run_description=""" GPT XTTS training """, dashboard_logger=DASHBOARD_LOGGER, logger_uri=LOGGER_URI, audio=audio_config, batch_size=BATCH_SIZE, batch_group_size=48, eval_batch_size=BATCH_S...
Python
1
nfig_item["config"]["step_size_tokens"] = step_size if threshold is not None: stage_config_item["config"]["splitting_threshold"] = threshold if min_segment_length is not None: stage_config_item["config"][ ...
Python
1
lf)): if self.beamsList[i].number == number: self.beamsList[i].type = type self.beamsList[i].direction = direction # ----------------------------------------------------------------------------- class Test(unittest.TestCase): def testCopyAndDeepcopy(self): fr...
Python
1
ntext = &mut Context::from_waker(&waker); let mut counter = 0; loop { let future_mut = future.as_mut(); match future_mut.poll(&mut context) { Poll::Ready(v) => return v, Poll::Pending => { if flags.borrow().awoken_flag && counter < 128 { ...
Rust
0
e first parent for this element, convert `parent` // to String and insert directly. Otherwise append ", " + parent. let value = bags_map.entry(child.trim_start().to_string()).or_insert(parent.to_string()); if !(*value).contains(parent) { (*value).push(';'); ...
Rust
0
# Download the story and generate the EPUB log_action("Starting story download") story_content, story_title, story_author, story_category, story_tags = download_story(url) if not story_content: error_msg = f"Failed to download the story from the given URL: {url}" log...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.CPAliveBillEntrySet import CPAliveBillEntrySet class AlipayEcoCplifeBillModifyResponse(AlipayResponse): def __init__(self): super(AlipayEcoCplifeBillModi...
Python
1
#!/usr/bin/env python # pylint: disable=R0903 # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2022 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public L...
Python
1
key[start_idx:end_idx, start_idx_h:end_idx_h, :, :], value[start_idx:end_idx, start_idx_h:end_idx_h, :, :], attn_mask=attn_mask[start_idx:end_idx, start_idx_h:end_idx_h, start_idx_q:end_idx_q, :] if attn_mask is not None else attn...
Python
1
); } #[test] fn test_audio_s2c() { let data = AudioData::S2C { codec: CodecType::OpusVoice, id: 0x1234, from: 0x5678, data: &[1, 2, 3], }; test_audio_roundtrip(Direction::S2C, &data); } #[test] fn test_audio_s2c_whisper() { let data = AudioData::S2CWhisper { codec: CodecType::OpusVoice, ...
Rust
0
nsumer_secret"] = json!("xxxx"); } else { panic!("failed to open config file. reason: {}", err) } } }; CONFW!(file) = file_path; CONFW!(credential) = credential; } fn read_file(file_path: &str) -> String { let mut file_data = String::new(); if file_...
Rust
0
or _ in range(t, t + 100)]), ), ) positions2d = [[math.sin(i * math.tau / 100.0) * t, math.cos(i * math.tau / 100.0) * t] for i in range(100)] rr.log( "2D/points", rr.Points2D( np.array(positions2d), labels=[str(i) for i in ra...
Python
1
let z = theta.cos() * r; array[(n * n_points + i, 0)] = x; array[(n * n_points + i, 1)] = y; array[(n * n_points + i, 2)] = z; } } array } use selfe_sys::*; use crate::cap::{ page_state, role, CapType, ChildCNode, CopyAliasable, DirectRetype, LocalCa...
Rust
0
penalty = 3 else: penalty = -1 return penalty def compare_Q(self): change_sum = 0 for i in range(3): l_2 = [] for row in self.last_Q: l = [] for column in row: max_action = np.ar...
Python
1
import base64 import secrets from pypureomapi import ( Omapi, OMAPI_OP_STATUS, OMAPI_OP_UPDATE, OmapiError, OmapiMessage, pack_ip, ) def generate_omapi_key() -> str: """Generate a base64-encoded key to use for OMAPI access.""" return base64.b64encode(secrets.token_bytes(64)).decode("a...
Python
1
, introduction_version: 13.1f32, name: "kiss: woman, man, medium-dark skin tone, medium-light skin tone", group: "People & Body", subgroup: "family", is_variant: true, variants: &[], annotations: &[], }], annotations: &[...
Rust
0
always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u16) & 0x01) << 4); self.w } } #[doc = "Output mode 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum OUTMOD_A { #[doc = "0: PWM output mode: 0 ...
Rust
0
buffer += &self.children[0].to_syntax(use_macros, indent); } else { // otherwise print all child nodes with each line and indented for child in self.children.iter() { buffer += &format!( "\n{}{},", sauron_vdom::util::indent(indent +...
Rust
0
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType class GetTaskCommentRequest(BaseRequest): def __init__(self) -> None: super().__init__() ...
Python
1
_path) checkpoint = torch.load(checkpoint_path) model.load_state_dict(checkpoint["net"]) break else: print("\nTraining from Scratch!!") csv_columns = ["unique_pat_ID_scan_date_days_period", "unique_pat_ID_scan_date", "sex", "patient_ID...
Python
1
of this `MappedPages`'s page table entries. /// /// Note that attempting to change certain "reserved" flags will have no effect. /// For example, arbitrarily setting the `EXCLUSIVE` bit would cause unsafety, so it cannot be changed. pub fn remap(&mut self, active_table_mapper: &mut Mapper, new_flags: ...
Rust
0
# -*- coding: utf-8 -*- from __future__ import annotations import os APP_TITLE = '🧠 MacroCoach v2(互动+稳健热修复)' APP_ICON = '🧠' DEFAULTS = { 'sex': 'male', 'age': 21, 'height_cm': 181.0, 'weight_kg': 88.2, 'body_fat_pct': 24.0, 'baseline_pal': 1.35, 'protein_g_per_kg_bw': 2.2, 'fat_g_per_kg_bw': 0.7, 'd...
Python
1
fice dataset""" def __init__(self): super(AlexModel, self).__init__() self.restored = False model_alexnet = models.alexnet(pretrained=True) self.features = model_alexnet.features self.fc = nn.Sequential() for i in range(6): self.fc.add_module("classifie...
Python
1
st] fn not_nan32_from_primitive() { assert_eq!(NotNan::<f32>::from_i8(42i8), Some(NotNan::from(42.0))); assert_eq!(NotNan::<f32>::from_u8(42u8), Some(NotNan::from(42.0))); assert_eq!(NotNan::<f32>::from_i16(42i16), Some(NotNan::from(42.0))); assert_eq!(NotNan::<f32>::from_u16(42u16), Some(NotNan::from(4...
Rust
0
ath::InMemory(prefix)) => in_mem_throttled .list_with_delimiter(prefix) .map_ok(|list_result| list_result.map_paths(path::Path::InMemory)) .await .context(InMemoryObjectStoreError), (File(file), path::Path::File(prefix)) => file ...
Rust
0
lete"], headers: Optional[dict[str, str]] = None, **kwargs: Any, ) -> Response: loop = asyncio.get_running_loop() ctx = contextvars.copy_context() func_call = functools.partial( ctx.run, self._do_request, url=url, method=method, headers=headers, **kwargs )...
Python
1
-x_rng[0]], [0, 1, -y_rng[0]], [0, 0, 1]]) mosaic_shape = (int(math.ceil(x_rng[1] - x_rng[0])), int(math.ceil(y_rng[1] - y_rng[0]))) else: H_offset = np.eye(3) mosaic_shape = img.shape[1::-1] if options.blend: out_type = np.int32 else: out_ty...
Python
1
type(str_to) == list: caption = random.choice(str_to) else: caption = str_to else: caption = caption.replace(str_from, str_to) return caption def get_input_ids(self, caption, tokenizer=None): if...
Python
1
: *mut spc_tpic_ = &mut _TPIC_STATE; assert!(!spe.is_null() && !ap.is_null() && !tp.is_null()); (*ap).cur.skip_blank(); if let Some(q) = (*ap).cur.parse_float_decimal() { (*tp).pen_size = atof(q.as_ptr()) * (0.072f64 / pdf_dev_scale()); 0 } else { spc_warn!(spe, "Invalid pen size...
Rust
0
, y_test, perf_metric): """Evaluates performance of baseline evaluation model without data valuation. Args: eval_model: evaluation model (object) x_train: training features y_train: training labels x_test: testing features y_test: testing labels perf_metric: 'auc', '...
Python
1
a2kp_exps.append(he_driving_emo_xi['emo']) emo_exps.append(emo_exp) if T is None: he_driving_emo, input_st = audio2kptransformer(x, kp_canonical, emoprompt=emoprompt, deepprompt=deepprompt, side=True) # {'yaw': yaw, 'pitch': pi...
Python
1
// highlighter: highlighter, } } } impl Lino { pub(crate) fn spawn_highlighting_thread(&mut self) -> (Sender<(HighlightingThreadMessage, Cursor)>, Receiver<(std::vec::Vec<(syntect::highlighting::Style, usize)>, Cursor)> ) { let (main_thread_tx, high...
Rust
0
# Copyright (c) 2021-2024 Intel Corporation # # 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...
Python
1
_t, ); } extern "C" { #[doc = " Draw a color map to the display (image)"] #[doc = " @param cords_p coordinates the color map"] #[doc = " @param mask_p the map will drawn only on this area (truncated to VDB area)"] #[doc = " @param map_p pointer to a lv_color_t array"] #[doc = " @param opa opaci...
Rust
0
; let v = vel.0; let a = acc.0; let v0 = v - a; let x0 = x - v; let ground = 1.0; if x.y > ground { // calculate the time point where this entity hit the ground let time_point_of_hit_p...
Rust
0
STrack.init_overlap(self.tracked_stracks) STrack.check_overlap(self.tracked_stracks) output += self.tracked_stracks output_track_info_dict = self.convert_output_format_to_dict(self.tracked_stracks) return output_track_info_dict def filter_object_result(self, detection_re...
Python
1
b: int16x4_t) -> int16x4_t; } vrhadd_s16_(a, b) } /// Rounding halving add #[inline] #[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vrhadd.s16"))] #[cfg_attr(all(test, target_arch = "aarch64"), assert_instr...
Rust
0
print!("oex\t/Home/mine/sightings_file.csv"); print!("\t\t\t\t\t\t{}",color::Fg(my_gray)); print!("exports sightings data file to a csv format"); print!("{}\n",style::Reset); print!("oex"); print!("\t\t\t\t\t\t\t\t\t\t{}",color::Fg(my_gray)); print!("exports sightings data file to...
Rust
0