text
string
label_name
string
labels
int64
te::java::lang::Throwable>> { // class.path == "android/content/SharedPreferences$OnSharedPreferenceChangeListener", java.flags == PUBLIC | ABSTRACT, .name == "onSharedPreferenceChanged", .descriptor == "(Landroid/content/SharedPreferences;Ljava/lang/String;)V" unsafe { let __jni...
Rust
0
import openturns as ot from openturns.viewer import View f = ot.SymbolicFunction(["x"], ["sin(x)"]) a = -2.5 b = 4.5 # Graph g = f.draw(a, b, 512) # Fejer type 1 algo = ot.FejerAlgorithm([20], ot.FejerAlgorithm.FEJERTYPE1) value, nodes = algo.integrateWithNodes(f, ot.Interval(a, b)) lower = ot.Cloud(nodes, ot.Sample...
Python
1
b, a = signal.butter(4, [low, high], btype='band') filtered_data = np.zeros_like(data) # Aplica filtro em cada canal for i in range(data.shape[1]): filtered_data[:, i] = signal.filtfilt(b, a, data[:, i]) return filtered_data def _normalize_da...
Python
1
}", err); std::process::exit(1); } } } } struct EnterFunction; impl<Term: Terminal> Function<Term> for EnterFunction { fn execute(&self, prompter: &mut Prompter<Term>, count: i32, _ch: char) -> io::Result<()> { if prompter.buffer().ends_with('.') { promp...
Rust
0
#!/usr/bin/env python # Copyright (c) 2018 Pilz GmbH & Co. KG # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
Python
1
# -*- coding: utf-8 -*- """ Created on Tue Dec 24 15:30:41 2019 @author: zixing.mei """ import numpy as np from scipy.linalg.misc import norm from scipy.sparse.linalg import eigs def JDA(Xs,Xt,Ys,Yt,k=100,lamda=0.1,ker='primal',gamma=1.0,data='default'): X = np.hstack((Xs , Xt)) X = np.diag(1/np....
Python
1
, worst quality" image = pipe( prompt=prompt_final[0][0], negative_prompt=n_prompt, control_image=control_image, controlnet_conditioning_scale=controlnet_conditioning_scale, control_guidance_end=control_guidance_end, guidance_scale=7.0, generator=torch.Genera...
Python
1
layer_norm=True, # Whether to use layer normalization. discount=0.99, # Discount factor. tau=0.005, # Target network update rate. expectile=0.7, # IQL expectile. low_alpha=3.0, # Low-level AWR temperature. high_alpha=3.0, # High-level AWR temperature. ...
Python
1
ock, &mut msgs[0])?; return Ok(1); } let mut vec_msg_name = Vec::with_capacity(msgs.len()); let mut vec_msg_hdr = Vec::with_capacity(msgs.len()); for msg in msgs.iter_mut() { let mut hdr: libc::mmsghdr = unsafe { mem::zeroed() }; if let Some(addr) = msg.addr { vec_...
Rust
0
tity")) .select(pl.col("ps_suppkey").unique()) .join(q3, left_on="ps_suppkey", right_on="s_suppkey") .select("s_name", "s_address") .sort("s_name") ) q_final.collect() def test_pdsh_q21( lineitem: pl.LazyFrame, nation: pl.LazyFrame, orders: pl.LazyFrame, supplie...
Python
1
import pygame from sys import exit pygame.init() def scorepage(WINDOW_WIDTH, WINDOW_HEIGHT, pontuacao, highscore, highscore_name): tela = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT)) tela.fill((0, 0, 0,)) texto_do_usuario = "" entrada_concluida= False fontebase = pygame.font.Font('Oxan...
Python
1
head_obj = self._other_heads[head_name] prediction = self._predict_head( head_name=head_name, head_obj=head_obj, image_feature=image_feature, box_tower_feature=box_tower_feature, feature_index=feature_index, ...
Python
1
group = Value::Number(1.0); let args = vec![&regex, &full_match]; let result = super::match_modifier(&input, args); assert_eq!(result, Ok(Value::String(String::from("2test2 string")))); let args = vec![&regex]; let result = super::match_modifier(&input, args); assert_...
Rust
0
#encoding: utf-8 import sys from numpy import array as np_array, float32 as np_float32, int32 as np_int32 # import batch_padder of the corresponding model for different padding indices. from utils.fmt.plm.roberta.dual_reg import batch_padder from utils.h5serial import h5File from cnfg.ihyp import * def handle(finp...
Python
1
mework.permissions.IsAuthenticated', ], 'DEFAULT_AUTHENTICATION_CLASSES':( 'rest_framework_simplejwt.authentication.JWTAuthentication', ), # 'DEFAULT_RENDERER_CLASSES':( # 'rest_framework.renderers.JSONRenderer' # ) } from datetime import timedelta SIMPLE_JWT = { "ACCESS_TOKE...
Python
1
) != 0) } #[doc = "Bit 5 - Port Data Output Value Clear 5"] #[inline(always)] pub fn outclr5(&self) -> OUTCLR5_R { OUTCLR5_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 6 - Port Data Output Value Clear 6"] #[inline(always)] pub fn outclr6(&self) -> OUTCLR6_R { OUT...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 常见的内建模块练习之collections author: gxcuizy date: 2018-10-30 """ import collections # 程序主入口 if __name__ == '__main__': # collections提供了很多的集合类 # 使用nametuple()可以定义一个tuple对象,并且规定了tuple的个数 point = collections.namedtuple('point', ['x', 'y']) p = point(1, 2) ...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Python Gmond Module for Memcached This module declares a "memcached" collection group. For more information, including installation instructions, see: http://sourceforge.net/apps/trac/ganglia/wiki/ganglia_gmond_python_modules When invoked as a sta...
Python
1
# node1 should have quorum now and accept requests keeper_utils.wait_until_connected(cluster, nodes[0]) node_zks.append(get_fake_zk(nodes[CLUSTER_SIZE].name)) # add rest of the nodes for i in range(CLUSTER_SIZE + 1, len(nodes)): node = nodes[i] node.copy_file_to...
Python
1
j = 0; let mut party_shares: Vec<FE> = Vec::new(); for i in 1..=PARTIES { if i == party_num_int { party_shares.push(secret_shares[(i - 1) as usize]); } else { let aead_pack: AEAD = serde_json::from_str(&round3_ans_vec[j]).unwrap(); let key_i = BigInt::to_vec(...
Rust
0
es) - log_pis return self.f(states, actions, next_states, dones) - log_pis def calculate_reward(self, states, actions, log_pis, next_states, dones): with torch.no_grad(): # logits = self.forward(states, actions, log_pis, next_states, dones) logits = self.f(states, actions, n...
Python
1
# The open() function will return a file object which has reading and writing –related methods. # Pass ‘r' (or nothing) to open() to open the file in read mode. Pass ‘w' for write mode. Pass ‘a' for append mode. # Opening a nonexistent filename in write or append mode will create that file. # Call read() or write() to ...
Python
1
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 requ...
Python
1
s: key: The API key that hit rate limit retry_after: Seconds to wait before retrying (from API response) """ with self.lock: current_time = time.time() # Set rate limit duration (default to 60 seconds if not specified) wait_time = ...
Python
1
eLayout::from_std::<Self>( shared_vars, MONO_TYPE_LAYOUT, Self::S_ABI_CONSTS, GenericTLData::Enum(GenericTLEnum::exhaustive( TLDiscriminants::from_u8_slice(rslice![]) )), ) }; } ///////////// /// The layout of `extern "C" fn(...
Rust
0
f.write(f"## 检查点 {check_point_index+1}: {check_point}\n\n") f.write(f"{check_result}\n\n") logger.info(f"已将检查点 {check_point_index+1} 的结果保存到 {self.output_file_path}") except Exception as e: logger.error(f"保存检查点结果到文件时出错: {e}") # 返回...
Python
1
_result == 0 services_status["dovecot"] = { "process_running": dovecot_running, "imap_port_accessible": imap_accessible, "status": "healthy" if dovecot_running and imap_accessible else "unhealthy" } except Exception as e: services_status["dovecot"...
Python
1
VirtualKeyCode::PageUp => KeyCode::PgUp, VirtualKeyCode::PageDown => KeyCode::PgDown, VirtualKeyCode::End => KeyCode::End, VirtualKeyCode::Home => KeyCode::Home, VirtualKeyCode::Left => KeyCode::Left, VirtualKeyCode::Up => KeyCode::Up, VirtualKeyCode::Right => KeyCode::Ri...
Rust
0
Win32_Data_Xml_MsXml'*"] pub const DISPID_XMLDOM_NODE_NAMESPACE: u32 = 32u32; #[doc = "*Required features: 'Win32_Data_Xml_MsXml'*"] pub const DISPID_XMLDOM_NODE_NODETYPEDVALUE: u32 = 25u32; #[doc = "*Required features: 'Win32_Data_Xml_MsXml'*"] pub const DISPID_XMLDOM_NODE_PARSED: u32 = 31u32; #[doc = "*Required featu...
Rust
0
then(end_of_input())) .parse_str(text) { Ok(v) => println!("{}", v), Err(e) => println!("{}", e), } } } //! DMA on the GBA is very different from most embedded devices. It does not run //! in parallel to the CPU, but rather stops the CPU to preform the memory //! ...
Rust
0
#[derive(Clone, Default)] pub(crate) struct AuthInterceptor { token_provider: Option<Arc<TokenProvider>>, } impl fmt::Debug for AuthInterceptor { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("AuthInterceptor") .field("configured", &self.token_provider.is_some(...
Rust
0
(), &from_glib_borrow(request)).to_glib() } unsafe extern "C" fn close_trampoline<P, F: Fn(&P) + 'static>(this: *mut webkit2_sys::WebKitWebView, f: glib_sys::gpointer) where P: IsA<WebView> { let f: &F = &*(f as *const F); f(&WebView::from_glib_borrow(this).unsafe_cast()) } unsafe extern "C" fn context_menu_t...
Rust
0
urrent_day_iterator, datetime.time.min) day_end = datetime.datetime.combine(current_day_iterator, datetime.time.max) timestamps = [ ts for ts in utils.generate_timestamps( MakerSettings(day_start, day_end, settings.time_step, settings.jitter) ) ...
Python
1
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) #Set up the SQLite database URI app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) #Define the User model class User(db.Model): ...
Python
1
"lots": float(lots), "reason": reason, "L95": float(rec.L95), "E_R": float(rec.E_R), "bounds": rec.bounds, "p_eff": float(p_eff), "R_hat": float(R_hat), "n_eff": int(n_eff), "alpha_speed": float(alpha_speed), "consec_losses": int(consec_loss...
Python
1
import time import re import urllib import pymysql """ 业务逻辑的拆分,和服务器分开,框架进行中间人 读取模板信息,返回自定义的前段模板 open在没有指明参数的话,默认模式是r """ # # url_func_dict = { # # 字典的方式,比较好一点,但是使用装饰器的话会更简洁 # "/index.html": index, # "/center.html": center, # "/login.html": login # } url_func_dict = dict() def route(url...
Python
1
pace_action irreps = list(space.fibergroup.irreps()) S = 3 xs = np.arange(S) - (S // 2) if space.dimensionality > 0: grid = np.stack(np.meshgrid(*[xs]*space.dimensionality)) grid = grid.reshape(space.dimensionality, -1) else: grid = np...
Python
1
self.ensure_one() production = self.raw_material_production_id or self.production_id if production and (self.state != 'draft' or production.state != 'draft'): return True elif production: return False else: return super()._show_details_in_draft(...
Python
1
', 'zh' # # html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # 'ja' uses this config value. # 'zh' user can custom change `jieba` dictionary path. # # html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration dire...
Python
1
l, b, distance) }) .map(|h| h >> ((depth_start - self.depth) << 1)) // h_to_lower_depth .collect(); neigs.sort_unstable(); // sort the array (unstable is ok since we remove duplicates) neigs.dedup(); // remove duplicates (vector must be sorted first) let mut bmoc_builde...
Rust
0
message(&note_off_ch3).unwrap() ); } #[test] fn parses_control_change() { let cc_ch0 = [0b1011_0000u8, 20u8, 120u8]; let cc_ch15 = [0b1011_1111u8, 48u8, 24u8]; assert_eq!( MidiMessage::ControlChange { channel: 0, control: 20, value: 120 }, parse_mess...
Rust
0
nderingContext2d as RenderingContext, HtmlCanvasElement, }, yew::{ format::{ Bincode, Json, Nothing, Toml, }, html, prelude::*, services::{ fetch::{ FetchService, FetchTask...
Rust
0
>, } impl MidiIoThread { pub fn new( config: &MidiConfig, audio_config: &AudioConfig, midi_in_tx: Sender<Protocol>, studio_tx: Sender<StudioProtocol>, ) -> MidiIoThread { let (driver, endpoints_out, endpoints_in) = Self::init_endpoints(config, midi_in_tx); drop(studio_tx.send(StudioProtoco...
Rust
0
let indices_loc = builder.indices.as_ptr() as u32 / 2; let index_array = Uint16Array::new(&memory_buffer) .subarray(indices_loc, indices_loc + builder.indices.len() as u32); self.context.inner.buffer_data_with_array_buffer_view( WebGl2::ELEMENT_ARRAY_BUFFER, &...
Rust
0
/tables/GPOS.rs use crate::layout::common::{FeatureList, FeatureVariations, LookupFlags, ScriptList}; use crate::layout::contextual::{ deserialize_gpos7, deserialize_gpos8, ChainedSequenceContextFormat1, ChainedSequenceContextFormat2, ChainedSequenceContextFormat3, SequenceContextFormat1, SequenceContextFor...
Rust
0
let part_one = part_one(&template, &rules); let part_two = part_two(&template, &rules); Ok((part_one, part_two)) } fn part_one(template: &str, rules: &Rules) -> PartAnswer { let start = SystemTime::now(); let polymer = react(template, rules, 10); let max_count = polymer.most_common_character_c...
Rust
0
""" .. _read_dolfin_example: Read FEniCS/Dolfin Meshes ~~~~~~~~~~~~~~~~~~~~~~~~~ PyVista leverages `meshio`_ to read many mesh formats not natively supported by VTK including the `FEniCS/Dolfin`_ XML format. This example uses :func:`pyvista.read`. .. _meshio: https://github.com/nschloe/meshio .. _FEniCS/Dolfin: http...
Python
1
import re import matplotlib.pyplot as plt from model_qt_dsnn_config import * #this script compares test loss for the same N, same layer number, different C values N=10 #layer-1 step_num_after_S1=5 decrease_over = 50 decrease_rate = 0.6 num_epochs = 1000 C_vec=[10,20,30,40] decrease_overStr=format_using_decimal(de...
Python
1
import requests import sys from urllib.parse import urlparse headers = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4512.0 Safari/537.36', 'Content-Type' : 'application/x-www-form-urlencoded' } poc_payload = "/api/get-organizations?p=123&pageSiz...
Python
1
# Each element in the array is a separate RosChannel. elif node_type == Nodetype.ARRAY: sub_node_type = field[1][1][0] size = field[1][1][1] channels = [] for i in range(size): sub_field = (field_name, sub_node_type) channels.exte...
Python
1
0x4d, 0xed, 0x00, 0x85, 0xdc, 0xa5, 0xbd, 0x68, 0x8d, 0xdf, 0x72, 0x2e, 0x2c, 0x0f, 0xaf, 0x9d, 0x0f, 0xb2, 0xce, 0x7a, 0x0c, 0x3f, 0x2c, 0xee, 0x19, 0xca, 0x0f, 0xfb, 0xa4, 0x61, 0xca, 0x8d, 0xc5, 0xd2, 0xc8, 0x17, 0x8b, 0x07, 0x62, 0xcf, 0x67, 0x13, 0x55, 0x58, 0x49, 0x4d, 0x2a, 0x96, 0xf1, 0xa1, 0x39, 0...
Rust
0
let cargo_init = std::process::Command::new("cargo") .current_dir(&project_dir) .arg("init") .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) .status() .expect("failed to execute process"); if !cargo_init.success() { error("Failed to ...
Rust
0
import os import asyncio from dotenv import load_dotenv load_dotenv() from swarms.structs import Agent from swarm_models import Anthropic from swarms.structs.rearrange import AgentRearrange llm = Anthropic( anthropic_api_key=os.getenv("ANTHROPIC_API_KEY"), streaming=True ) async def sequential(): agent1 =...
Python
1
# Copyright 2011-2012 Canonical Ltd. # # This file is part of u1db. # # u1db is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # u1db is distributed in the hope that it will be useful, # but W...
Python
1
filter.bias.data = biases[i] nets.append(filter) if i != len(weights) - 1: nets.append(torch.nn.ReLU()) return torch.nn.Sequential(*nets) def _run_spconvs(self, x, filters): y = filters(x) return y.dense(channels_first=False) def _ru...
Python
1
import numpy as np def setmask(md): """ SETHYDROSTATICMASK - establish ocean_levelset field Determines grounded and floating ice position based on md.geometry.bed and md.geometry.thickness Usage: md = sethydrostaticmask(md) Examples: md = sethydrostaticmask(md) """ if np.siz...
Python
1
Data::new(header_text), true => TextData::new(header_text).without_text(), }; license.headers = vec![header_data]; } } Ok(()) } } use crate::{ accounts_db::SnapshotStorages, bank::{Bank, BankSlotDelta}, }; use crate::{ snap...
Rust
0
def add(x, y): return x + y def subtract(x, y): return x - y def multiply(x, y): return x * y def divide(x, y): if y != 0: return x / y else: return "Error! Division by zero." if __name__ == "__main__": print("Select operation:") print("1.Add") print("2.Subtract") ...
Python
1
__ = ('__isFirstEntrance',) def __init__(self): self.__isFirstEntrance = True def clear(self): self.__isFirstEntrance = True def onSoundModeChanged(self, isRankedSoundMode, initialProgressionState=None): if isRankedSoundMode: if self.__isFirstEntrance: ...
Python
1
: *const ::std::os::raw::c_char, value: float64, ) -> int32; } extern "C" { pub fn DAQmxGet9269CalAdjustPoints( calHandle: CalHandle, adjustmentPoints: *mut int32, bufferSize: uInt32, ) -> int32; } extern "C" { pub fn DAQmxSetup9269Cal( calHandle: CalHandle, ...
Rust
0
nst CVoid, tick: i32) -> isize { unsafe { rt_mutex_take(handle, tick) } } #[inline] pub(crate) fn rttbase_mutex_release(handle: *const CVoid) { unsafe { rt_mutex_release(handle); } } const RT_WAITING_FOREVER: i32 = -1; unsafe impl<T: Send> Send for Mutex<T> {} unsafe impl<T: Send> Sync for Mutex<...
Rust
0
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct IndexBufferID(pub u64); #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TextureID(pub u64); #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FramebufferID(pub u64); // For debu...
Rust
0
const i8; #[cfg(not(any(target_arch = "armv7l", target_arch = "i686")))] let egc_ptr = cstring![egc]; unsafe { c_api::ffi::ncplane_gradient( plane, y.unwrap_or(u32::MAX) as i32, x.unwrap_or(u32::MAX) as i32, len_y.unwrap_or(0), len_x.unwra...
Rust
0
R 5 g)NrbrcrrHr_r rq)rK shutdown_excs rr!SSLProtocol._on_shutdown_completeU  ( ( 4  ) ) 0 0 2,0D )    l + JJ !6!6 7rcUR[R5 UR...
Python
1
dress) self.update_worker_status(model, address, "STARTED", time) elif worker_status == "WAITING": self.update_worker_status(model, address, "WAITING", time) def update_worker_status(self, model, worker, status, time): self.workers_status[worker] = { "status": "W...
Python
1
Ok(count) } fn decode<R: Read>(r: &mut R) -> std::io::Result<Self> { let mut hash = [0_u8; 32]; r.read_exact(&mut hash)?; Ok(Hash(hash)) } } use state::{AppState, TypedKey}; use std::rc::Rc; use webplatform::{self, HtmlNode}; use uuid::Uuid; use {Queryable, Component, Properties, Ev...
Rust
0
# diffusers测试ControlNet import os os.environ["CUDA_VISIBLE_DEVICES"] = "0" import sys sys.path.append('..') import cv2 import time import torch import random import numpy as np from PIL import Image from diffusers.utils import load_image from diffusers import EulerAncestralDiscreteScheduler, AutoencoderKL from models.c...
Python
1
import os from os.path import join as p_join primary_device = "cuda:0" scenes = ["8b5caf3398", "b20a261fdf"] seed = 0 # Export SCENE env variable before running os.environ["SCENE"] = "0" # Train Split Eval use_train_split = True # # Novel View Synthesis Eval # use_train_split = False if use_train_split: sce...
Python
1
f.player.center_x mana_bar_y = self.player.center_y + self.player.height / 2 + 2 current_mana_width = mana_bar_width * (self.player.current_mana / self.player.max_mana) calls = [ call( mana_bar_x, mana_bar_y, ...
Python
1
from typing import NamedTuple, Optional class ModelConfig(NamedTuple): d_ff: int d_k: int d_model: int d_v: int dropout_rate: Optional[float] n_heads_kv: int n_layers: int n_rep_kv: int rms_norm_eps: float token_id_bos: int token_id_eos: int token_id_pad: int vocab_s...
Python
1
as_ref()); let c = F::from_le_bytes_mod_order(COEFF_C.as_ref()); let xy = x * y; let y_square = y * y; let f_y = c * (F::one() - y_square); let g_y = b * (y_square + b); let h_y = y_square - b; GroupProjective::<P>::new(f_y * h_y, g_y * xy, F::one(), h_y * xy) .into_affine() ...
Rust
0
PlanInput>, /// <p>To help organize your resources, you can assign your own metadata to the resources that /// you create. Each tag is a key-value pair. The specified tags are assigned to all backups /// created with this plan.</p> pub backup_plan_tags: std::option::Option<std::collections::Hash...
Rust
0
-(top + bottom) / (top - bottom), -(far + near) / (far - near), 1.0, ], ] } fn create_texture(display: &Display) -> glium::Texture2d { let cols_per_char = 8usize; // width let rows_per_char = 8usize; // height let chars_per_row = 16usize; let chars_per_c...
Rust
0
elif context['type'] == 'general': # 通用建议,包含表名、数据库名和SQL关键字 # 表名建议 for table_name, table_info in tables_cache.items(): suggestions.append({ 'label': table_name, 'kind': 8, # Cla...
Python
1
"merkle": merkle, "pos": pos})) } pub fn transaction_id_from_pos(&self, params: &[Value]) -> Result<Value> { let height = usize_from_value(params.get(0), "height")?; let tx_pos = usize_from_value(params.get(1), "tx_pos")?; let want_merkle = bool_from_value_or(params.get(...
Rust
0
акао (САР)', 'sc': 'RAS tzinesa de Macao', 'sd': 'مڪائو SAR چين', 'sd-Arab': 'مڪائو SAR چين', 'se': 'Makáo', 'si': 'මැකාවු විශේෂ පරිපාලන කලාපය චීනය', 'sk': 'Macao – OAO Číny', 'sl': 'Posebno upravno območje Ljudske republike Kitajske Macao', 'smn': 'Macao - – Kiina e.h.k.', 'so': 'Makaaw', 'sq': 'RPA i Makaos', 'sr': '...
Python
1
n_dict=False, )[0] # perform guidance if do_classifier_free_guidance: noise_pred_uncond, noise_pred_text = noise_pred.chunk(2) noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond) ...
Python
1
PodiumMustOnlyHaveCompetitorsInVie, ///CompetitorAlreadyStaked CompetitorAlreadyStaked, ///CompetitorsMustAllJoinToFinishTheVie CompetitorsMustAllJoinToFinishTheVie, ///MemoTooBig MemoTooBig, ///RemoveOperatorFromCompetitors RemoveOperatorFromCompetitors } #[pallet::hooks] impl<T: Config> Hooks<Blo...
Rust
0
# Generated by Django 4.1.3 on 2023-05-02 16:39 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('home', '0028_roommember_...
Python
1
)] struct Node { host: &'static str, ip: &'static str, port: u16, } // 为 Node 添加 to_string 功能 impl ToString for Node { fn to_string(&self) -> String { self.ip.to_string() + &self.port.to_string() } } // 哈希计算函数 fn hash<T: Hash>(val: &T) -> u64 { let mut hasher = DefaultHasher::new(); ...
Rust
0
import os import shutil import sys #这里输入视频有多少秒 #seconds = 180 #传参 这里传入视频多少秒 seconds = int(sys.argv[1]) # 默认从第二秒开始检测标注 # start = 2 #传参 这里传入视频从那一秒开始,这里需要设置为 0 start = int(sys.argv[2]) # 需要检测标注的时间位置[0,1,2,3,4,5,6,7,8,9,10] frames = range(start, seconds+1) # num_frames 存放对应图片的编号 num_frames = [] for i in frames: nu...
Python
1
# - {%- if cookiecutter.frontend_style == SPA %} from corsheaders.defaults import default_headers # - {% endif %} from settings.base import * DEBUG = False if not IS_DOCKER_BUILD: # Static site url, used when we need absolute url but lack request object, e.g. in email sending. # - {%- if cookiecutter.fronte...
Python
1
import sys sys.path.append("C:/Delhi") print([path for path in sys.path]) import gurgaon.mymodule as m from gurgaon.mymodule import Employee print(m.gstname) print("-" * 60) emp1 = Employee("Richard", 90000) print(emp1)
Python
1
class Solution: def solve(self, days): # n = len(days) # prices = [2, 7, 25] # durations = [1, 7, 30] # dp = [float("inf")] * (n + 1) # # dp[i] 表示截止第 i + 1 天(包括)需要多少钱,因此答案就是 dp[n] # dp[0] = 0 # for i in range(1, n + 1): # for j in range(i, n + 1):...
Python
1
them with a Daml ledger. //! //! ### Mapping Daml Structures to Rust //! //! Daml structures are modelled using various Rust language constructs in conjunction with custom attributes //! procedural macros as shown in the following table: //! //! | Daml Concept | Rust Construct | Custom Attribute | //!...
Rust
0
_allocation_granularity: u32::vk_to_wrapped(&src.vgpr_allocation_granularity), } } } impl Default for VkPhysicalDeviceShaderCoreProperties { fn default() -> VkPhysicalDeviceShaderCoreProperties { VkPhysicalDeviceShaderCoreProperties { shader_engine_count: 0, shader_array...
Rust
0
\x95\x02\x03\xa3\xccj\xb4\xe6C/\xf8\x99^\xbe\x8f\xbb\xe3\x1bUU\xdd\xdc\ WIH\xce\xf2\xcf\xd2n\xfa\xbb\xfc\xf4s\xff\xb1Z\xa7\xb0\x90w\x8aoj[\xda\xe6\ \x0c\x1c{L\x93*\x01\x85j+0\xfaUY\x95_\x08!\x12|pQ\x97\x9e\x8f\xc7\xf1\xba\ [\xb8\xb26\x89\x92\x95wj\x95d\xa6%\x27\xf9\x9d:\x8c \x8fG\xf1U\xb02lp\xe2\ b\x13\xc8\x94F\xe9o\...
Python
1
import pytest def pytest_addoption(parser): parser.addoption( "--dump-vcd", action="store_true", help="dump vcd for each test" ) parser.addoption( "--dump-asm", action="store_true", help="dump asm file for each test" ) parser.addoption( "--dump-bin", action="store_true", ...
Python
1
""" Mixin base para campos de auditoría y control de estado """ from datetime import datetime from typing import Optional from sqlalchemy import DateTime, Boolean from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.sql import func class AuditMixin: """ Mixin que proporciona campos de auditoría y c...
Python
1
{} impl ::core::clone::Clone for VDS_POOL_CUSTOM_ATTRIBUTES { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_Storage_VirtualDiskService\"`*"] pub struct VDS_PORTAL_GROUP_NOTIFICATION { pub ulEvent: u32, pub portalGroupId: ::windows_sys::core::GUID, } impl ::...
Rust
0
# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_state_changed_event_data import DisputeStateChangedEventData class DisputeStateChangedEvent(Unch...
Python
1
id, category, opened, None, "open", priority, subject, description, "AI_Bot"), ) ticket_id = cur.lastrowid db.commit() row = db.execute("SELECT * FROM SupportTickets WHERE ticket_id = ?", (ticket_id,)).fetchone() db.close() return dict(row) # =================================...
Python
1
get("/register")] pub async fn register( query: web::Query<RegisterQuery>, app_data: web::Data<Arc<Mutex<AppData>>> ) -> Result<HttpResponse> { let data = app_data.lock().unwrap(); let user = generic_http_err!( services::user_service::create_user(&data.pool, query.us...
Rust
0
from django.shortcuts import render, redirect from .models import Product from .forms import ProductForm from django.contrib.auth.decorators import login_required from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.views.generic.list import ListView from django.views.generic.detail impo...
Python
1
::ZX_CHANNEL_MAX_MSG_HANDLES as usize] = unsafe { std::mem::MaybeUninit::uninit().assume_init() }; for i in 0..write_num_handle_dispositions as usize { unsafe { let handle_disposition = std::mem::replace(&mut handle_dispositions[i], HandleDisposition::...
Rust
0
sers_available(): raise OptionalDependencyNotAvailable() except OptionalDependencyNotAvailable: from ..utils.dummy_diffusers_objects import ( ORTLatentConsistencyModelPipeline, ORTStableDiffusionImg2ImgPipeline, ORTStableDiffusionInpaintPipeline, O...
Python
1
st_src_build_path.display() ); } } files.retain(|_k: &usize, f: &mut File| { if f.ast.path.exists() { true } else { println!("file {} does not exist!", f.ast.path.display()); false } }); } pub mod github_workflows; use crate::n...
Rust
0
# Crie um Programa que leia o nome e o preco de varios productos, devera pergunta se o utilizador quer continuar. # No final mostre: # - Qual e o total gasto na compra. # - Quantos productos custam mais de 1000.00 Eur # - Qual e o nome do produto mais barato. totgasto = maisde1000 = precobarato = cont = 0 nomebarato =...
Python
1
return Err(SpressoError::from(RuntimeError::from(format!( "Symbol not found: {}", symbol ))) .maybe_with_tokens(expr.get_tokens())); } } ExprKind::List(mut exprs) => { let res = execute(&mut exprs, env)?; ...
Rust
0
is_ok()); assert_eq!(chip8.registers[2], 4); assert_eq!(chip8.registers[15], 1); } #[test] fn test_sub_vx_vy() { let mut chip8 = Chip8::new(); let opcode = 0x8235; // Test no borrow chip8.registers[2] = 5; chip8.registers[3] = 2; assert!(run...
Rust
0