text
string
label_name
string
labels
int64
gs={"k": 5}) relevant_docs = retriever.get_relevant_documents(query) prompt = PromptTemplate.from_template( """ You are a helper for qeustion answering tasks. Use the following to answer the question. If you don't know the...
Python
1
MASK: usize = Self::BITS << Self::SHIFT; fn as_usize(&self) -> usize; fn from_usize(val: usize) -> Self; #[inline(always)] fn pack(&self, to: usize) -> usize { let value = self.as_usize(); debug_assert!(value <= Self::BITS); (to & !Self::MASK) | (value << Self::SHIFT) } ...
Rust
0
import datetime import pytest from server.main import get_learned_words from server.schema import User, UserWord, Word @pytest.mark.asyncio async def test_get_learned_words_returns_correct_count(async_db): Session = async_db async with Session() as session: session.add_all( [ ...
Python
1
"The class `TFAutoModelWithLMHead` is deprecated and will be removed in a future version. Please use" " `TFAutoModelForCausalLM` for causal language models, `TFAutoModelForMaskedLM` for masked language models" " and `TFAutoModelForSeq2SeqLM` for encoder-decoder models.", ...
Python
1
""" Here we implement the SDP to find the optimal cloner for a given set of states. If the states are |psi_x> and they are sent with probability p(x) then we need to solve max \sum_x p(x) <psi_x'|<psi_x|<psi_x| C_{A_1A_2A_3} |psi_x'>|psi_x>|psi_x> s.t. Tr_{A_2A_3}[ C_{A_1A_2A_3}] = I_{A_1} C_{A_1A_2A_3} >= 0 whe...
Python
1
import re import requests import logging from collections import OrderedDict from datetime import datetime import config # 日志记录。 logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s', handlers=[logging.FileHandler("function.log", "w", encoding="utf-8"), logging...
Python
1
::core::geometry::point::{Point3f, Point2f}; use crate::core::pbrt::Float; use crate::shapes::triangle::create_trianglemesh; pub fn create_heightfield( o2w: Arc<Transform>, w2o: Arc<Transform>, reverse_orientation: bool, params: &ParamSet) -> Vec<Arc<Shapes>> { let nx = params.find_one_int("nu", -1); ...
Rust
0
t_equal(d_soft.dtype, data.dtype) assert_equal(d_garotte.dtype, data.dtype) # values < threshold are zero lt = np.where(np.abs(data) < thresh) assert_(np.all(d_garotte[lt] == 0)) # values > than the threshold are intermediate between soft and hard gt = np.where(np.abs(d...
Python
1
}) }) .collect() } } fn deserialize_witness<'de, D>(d: D) -> Result<Vec<Vec<u8>>, D::Error> where D: serde::de::Deserializer<'de>, { use crate::serde::Deserialize; use bitcoin::hashes::hex::FromHex; let list = Vec::<String>::deserialize(d)?; list.into_ite...
Rust
0
callback_query["message"]["text"] await queue.join() await final_edit_msg( session, chat_id, sent_message_id, bot_prev_response, received_message_id, ) print(f"An error has occurred in handle_ca...
Python
1
rt it. if cwd[0] != '/': cwd = Invoke(IFACE_HOST, "translate-path", cwd) # Default? if not cwd: cwd = HOME_PATH_ON_VM # Spawn the terminal. cwd = cwd.replace("'", "\\'") command = "(cd '%s'; %s &)" % (cwd, TERMINAL_CMD) # Spawn. if subprocess.call(command, shell=True) == 0: # subpro...
Python
1
).unwrap(); // let data: Vec<Binary> = vec![ // Binary{numbers: vec![0, 0, 1, 0, 0]}, // Binary{numbers: vec![1,1,1,1,0]}, // Binary{numbers: vec![1,0,1,1,0]}, // Binary{numbers: vec![1,0,1,1,1]}, // Binary{numbers: vec![1,0,1,0,1]}, // Bin...
Rust
0
lhs, rhs), _ => panic!("ICE codegen_compare_float unhandled op {}", op), }, PrimitiveType::Bool, ) .into() } pub fn codegen_compare_signed( module: &AatbeModule, op: &String, lhs: LLVMValueRef, rhs: LLVMValueRef, ) -> ValueTypePair { ( match op.as_str...
Rust
0
}: {int(ai_decision['duration'])} min ({ai_decision['distance']:.2f} km)") else: st.warning("No escape route available.") if time_to_impact_min > 0: st.warning(f"☄️ Impact will occur in {time_to_impact_min} minutes.") else: st.error(f"💥 Impact occurred {time_after_impact_min} minutes ago.") st.ma...
Python
1
ef room_book(): global a a= Tk() a.title('Room Availability') a.minsize(width=400,height=400) a.geometry('850x750') Canvas1 = Canvas(a) Canvas1.config(bg="#808080") Canvas1.pack(expand=True,fill=BOTH) l0=Label(a,text="Room Availability",bg="white",fg="black",height="50",width=...
Python
1
"""proyectoTrigorojo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') C...
Python
1
/// /// let props = Props::new_args(BankAccount::actor, /// ("<NAME>".into(), "12345678".into())); /// /// // start the actor and get an `ActorRef` /// let actor = sys.actor_of(props, "bank_account").unwrap(); /// ``` pub fn new_args<A, Args, F>(creator: F...
Rust
0
``` "], pub hexadecimal<Span, Literal>, map_res!( regex!(r"(?-u)^0[xX][0-9a-fA-F]+"), hexadecimal_mapper ) ); #[inline] fn hexadecimal_mapper(span: Span) -> StdResult<Literal, ParseIntError> { i64 ::from_str_radix( unsafe { str::from_utf8_unchecked(&(span.as_sl...
Rust
0
ormat(filter_template, (item for assertion in assertions for item in assertion)) def get_page_cookie(server_ctrls): """Get the page control cookie from the server control list. :param server_ctrls: list -- Server controls including page control. :return: Cookie for page control or ``None`` if last page r...
Python
1
# This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator/create_python_api.py script. """Public API for tf.initializers namespace. """ from __future__ import print_function as _print_function from tensorflow.python import Constant as constant from tensorflow.python import G...
Python
1
one hundred. assert_ok!(TestRiskManager::set_min_partial_liquidation_sum( admin_origin(), DOT, ONE_HUNDRED )); assert_eq!( TestRiskManager::risk_manager_params(DOT).min_partial_liquidation_sum, ONE_HUNDRED ); let expected_event = Event::TestRiskManager(crate::Event::MinSumForPartialLiquidationH...
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
e(xyz.permute(2,0,1)[None], xys.reshape(1, -1, 1, 2)) sampled_xyzs = sampled_xyzs.permute(0,2,3,1).reshape(hd-2,wd-2,4,3) bottom_point = sampled_xyzs[:,:,0] top_point = sampled_xyzs[:,:,1] right_point = sampled_xyzs[:,:,2] left_point = sampled_xyzs[:,:,3] else: bottom...
Python
1
'verbose_name_plural': 'Progressos de Leitura', 'unique_together': {('user', 'book')}, }, ), migrations.CreateModel( name='UserAchievement', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verb...
Python
1
< self.len(), "Index out of range!"); let (elt, bit) = T::split(cursor); if (self.inner[elt]).get(E::curr::<T>(bit)) { &true } else { &false } } } /// Gets the bit in a specific element. The element index must be less than or /// equal to the value returned by `elts()`, and the bit index must be less /// than th...
Rust
0
,value\n') for k, v in vars_args.items(): csvf.write('%s,%s\n' % (k, v)) def get_data_iterator(iterable): """Allows training with DataLoaders in a single infinite loop: for i, data in enumerate(inf_generator(train_loader)): """ iterator = iterable.__iter__() while True: ...
Python
1
::new(); for arg in env::args().skip(1) { let path = Path::new(&arg); if !path.is_file() { out.push_str(&arg); out.push_str("\n"); continue } let mut contents = Vec::new(); File::open(path).unwrap().read_to_end(&mut contents).unwrap(); ...
Rust
0
a mut W, } impl<'a> FIFO_2_RXFF_FLUSH_ON_START_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FIFO_2_RXFF_FLUSH_ON_START_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "`0`"] #[inline(always)] pub fn fif...
Rust
0
y, op: CompareOp) -> PyResult<PyObject> { impl_richmp!(self, other, op, self.ontology) } } // --- OwlAxioms ------------------------------------------------------------- /// OwlAxiomsClause(axioms) /// -- /// /// A header clause containing untranslatable OWL axioms. #[pyclass(extends=BaseHeaderClause, mod...
Rust
0
"3t"; let x = CalculatorFloat::from(inp); if let CalculatorFloat::Str(y) = x.clone() { assert_eq!(y, "3t") } assert!(!x.is_float()); let inp2: &str = "3"; let x2 = CalculatorFloat::from(inp2); assert_eq!(x2, CalculatorFloat::from(3)); assert!(...
Rust
0
.i_s_max, inf, cfg.k_u, cfg.k_b ) self.flux_torque_ctrl = FluxTorqueController( par, cfg.alpha_psi, cfg.alpha_tau, 0, cfg.alpha_tau, cfg.i_s_max ) self.observer = create_vhz_observer(par, cfg.k_o) self.alpha_f: float = cfg.alpha_f self.tau_M_lpf: float = 0.0 ...
Python
1
i].legend() plt.tight_layout() plt.show() def load_data(file_path): # Load the data from a text file without parsing dates upfront df = pd.read_csv(file_path, sep=' ', header=None, names=['date', 'time', 'epoch', 'moteid', 'temperature', 'humidity...
Python
1
, 40, 48, 56) ); assert_eq!( calculate_attack_board_rook(0.into(), bitboard!(1, 8)), bitboard!(1, 8) ); assert_eq!( calculate_attack_board_rook(0.into(), bitboard!(1, 8, 9, 16, 24)), bitboard!(1, 8) ); assert_eq!( ...
Rust
0
8c334715d2489.js", "1093d98f5fc0758d.js", "15d9592709b947a0.js", "2179895ec5cc6276.js", "247a3a57e8176ebd.js", "441a92357939904a.js", "47f974d6fc52e3e4.js", "4e1a0da46ca45afe.js", "5829d742ab805866.js", "589dc8ad3b9aa28f.js", "598a5cedba92154d.js", "72d79750e81ef03d.js", ...
Rust
0
iniciado com sucesso!") def desligar_servidor(): os._exit(0) root = tk.Tk() root.title("Servidor de E-mail") root.geometry("300x200") btn_ligar = tk.Button(root, text="Ligar Servidor", command=ligar_servidor) btn_ligar.pack(pady=10) btn_desligar = tk.Button(root, ...
Python
1
from contextlib import contextmanager import pytest import sklearn.linear_model from baikal import make_step, Step @contextmanager def does_not_warn(): yield @pytest.mark.parametrize( "class_name,expected,warns", [ (None, "LogisticRegression", pytest.warns(FutureWarning)), ("LogisticRe...
Python
1
from pathlib import Path from podcast_transcript_convert.converters.xml_to_json import xml_to_podcast_dict def test_xml_to_podcast_dict(): html_string = Path( "tests/fixtures/Hunting CrossSite Scripting on the Web.xsl", ).read_text() transcript_dict = xml_to_podcast_dict(html_string) assert t...
Python
1
, width: rect.right - rect.left, height: rect.bottom - rect.top, } } } impl From<Rect> for RECT { fn from(rect: Rect) -> Self { RECT { left: rect.x, top: rect.y, right: rect.x + rect.width, bottom: rect.y + rect.height, ...
Rust
0
self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.t...
Python
1
0m0,061s // $ [...] < data/input-x157 0m14,503s // It should be noted that all sudoku in thread B were solved after all those // in thread A, effectively rendering the multithreading useless. // With `main_rayon` // $ [......
Rust
0
# -*- coding: utf-8 -*- """ Created on Fri Oct 16 17:38:11 2020 @author: giamp """ import numpy as np name = 'rosen-suzuki' startp = np.array([0.0,0.0,0.0,0.0]) lb = startp - 10.0 ub = startp + 10.0 n = len(lb) nint = 2 ncont = n-nint lbmix = np.zeros(n); lbmix[:ncont] = lb[:ncont] ubmix = 100...
Python
1
(&self, coordinate: impl Vector<f32, 2>) -> V { unsafe { let mut result = Default::default(); asm!( "%sampledImage = OpLoad _ {this}", "%coordinate = OpLoad _ {coordinate}", "%result = OpImageSampleImplicitLod _ %sampledImage %coordinate", ...
Rust
0
domain: network.domain_name, vlan_enabled: network.vlan_enabled, vlan: network.vlan.map(|vlan| u16::from_str(&vlan).ok()).flatten(), dhcp: Some(NetworkDhcp { enabled: network.dhcpd_enabled, start: dhcpd_start, end: dhcpd_end, lease_dura...
Rust
0
pub const MAX_FRAME_COUNT: usize = 2; pub const FRAME_INDICES: [usize; MAX_FRAME_COUNT] = [0, 1]; // application configs - default values pub static mut VULKAN_API_VERSION: u32 = vk::make_api_version(0, 1, 0, 0); pub static mut DEBUG_MESSAGE_LEVEL: vk::DebugUtilsMessageSeverityFlagsEXT = vk::DebugUtilsMessageSeverityF...
Rust
0
<_F_>, _>, AddRef: crate::rt::handler::ComRepr_AddRef::<$imp<_F_>>, Release: crate::rt::handler::ComRepr_Release::<$imp<_F_>>, }, Invoke: { unsafe extern "system" fn Invoke<_F_>(this_: *mut $interface $(,$p :...
Rust
0
isinstance(mcp_result, dict) else 'unknown' arguments = getattr(mcp_result, 'arguments', {}) if hasattr(mcp_result, 'arguments') else mcp_result.get('arguments', {}) if isinstance(mcp_result, dict) else {} result = getattr(mcp_result, 'result', None) if hasattr(mcp_result, 'resu...
Python
1
del into the database async fn insert(self, db: &PgPool) -> sqlx::Result<Self>; async fn get(db: &PgPool, id: Id) -> sqlx::Result<Option<Self>> { let res = sqlx::query_as::<Postgres, Self>(&format!("SELECT * FROM {} WHERE id = $1", Self::table())) .bind(id) .fetch_optional(db).a...
Rust
0
SLT_BereqAcct, "0 0 0 0 0 0"; ); let record = apply_last!(builder, 5, SLT_End, "") .unwrap_backend_access(); assert_eq!(record.start, Some(parse!("1471355385.239334"))); assert_eq!(record.end, Some(parse!("1471355385.239427"))); assert_matches!(record.transac...
Rust
0
let x_start = (part.x as f64) * H_CELL_SIZE; let y_start = (part.y as f64) * V_CELL_SIZE; context.fill_rect(x_start, y_start, H_CELL_SIZE, V_CELL_SIZE); } } } fn new_piece_type_bag() -> Vec<TetrisPieceType> { vec![ TetrisPieceType::Q, ...
Rust
0
# Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # p_norm paddle model generator # import sys import numpy as np import paddle if paddle.__version__ >= '2.6.0': from paddle.base.layer_helper import LayerHelper else: from paddle.fluid.layer_helper import LayerHelper from s...
Python
1
alRuns, LastUpdate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, (*key, rate, top3, total, last_update)) upserts += 1 conn.commit() conn.close() return upserts, len(agg) if __name__ == "__main__": print("\n[INFO] This module provides helper functions for processing HKJC ho...
Python
1
_str(v.as_str()).unwrap(); //push values into the storage vector received_values.push((v.time, v.value )); }); //clear stored values after processing websocket_values.borrow_mut().clear(); if now - time_of_last_animation_frame > 100 { ...
Rust
0
) { vec3 n = normalize(v_normal); float d = clamp(dot(n,u_light_dir),0.0,1.0); vec3 res = u_ambient_color.xyz * u_iris_color.xyz + d * u_light_color.xyz * u_iris_color.xyz; float z = gl_FragCoord.z / gl_FragCoord.w; float a = u_...
Rust
0
import pandas as pd from mltrace import Component c = Component( name="cleaning", description="process raw data by adding column names and features", owner="jeanne", tags=["etl"], ) @c.run( input_vars=["input_filepath"], output_vars=["output_filepath"], ) def clean(input_filepath: str, output...
Python
1
import numpy as np from scipy.optimize import least_squares # Target function def f(u): return np.sqrt(-2 * np.log(u)) # Polynomial evaluator def polyval(coeffs, x): return np.polyval(coeffs, x) # Rational approximation function def rational_approx(x, p_coeffs, q_coeffs): return polyval(p_coeffs, x) / po...
Python
1
"""Tests for the Hyperbolic Billing action provider initialization.""" import os from unittest.mock import patch import pytest from coinbase_agentkit.action_providers.hyperboliclabs.billing.action_provider import ( BillingActionProvider, hyperbolic_billing_action_provider, ) from coinbase_agentkit.network im...
Python
1
# # 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...
Python
1
> { match captures[capture_key].parse() { Ok(num) => return Ok(num), Err(e) => { let error_message = format!("Unable to parse regex match as number, got error {:?}", e); return Err(Error::new(ErrorKind::NotFound, error_message)) } } ...
Rust
0
import os import socket import platform import psutil import asyncio from telegram import Bot from datetime import datetime import ctypes # Configuração do Telegram TELEGRAM_TOKEN = "<SEU_TOKEN_TELEGRAM>" TELEGRAM_CHAT_ID = "<SEU_ID_TELEGRAM>" def verificar_admin(): """ Verifica se o script está sendo executa...
Python
1
ch_embed(x) # add pos embed w/o cls token x = x + self.pos_embed[:, 1:, :] B = x.shape[0] h = w = int(x.shape[1]**.5) # apply Transformer blocks for blk in self.blocks: x = blk(x) x = self.norm(x) x = self.unpatchify(x) return x...
Python
1
w(StdFile::open(path).unwrap())).unwrap() } // https://github.com/abonander/mime_guess/blob/master/src/mime_types.rs const FAVICON: &'static str = "static/ico/favicon.ico"; // Example: ROOTDIR=/var/lib/www lazy_static! { static ref ROOT_DIR: PathBuf = match env::var("ROOTDIR") { Ok(root_dir) => root_dir.i...
Rust
0
ify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [shiftsden](shiftsden) module"] pub type SHIFTSDEN = crate::Reg<u32, _SHIFTSDEN>; #[allow(missing_docs)] #[doc(hidden)] pub struct _SHIFTSDEN; #[doc = "`read()` method returns ...
Rust
0
"""Test cases for the base environment class.""" import json import tempfile from unittest.mock import patch import pytest import predicators.envs from predicators import utils from predicators.envs import BaseEnv, create_new_env, get_or_create_env from tests.approaches.test_oracle_approach import ENV_NAME_AND_CLS ...
Python
1
]), left_sum + right_sum) } #[test] fn base_max_subarray_test() { let test_cases = [ ( vec![ 22, -27, 38, -34, 49, 40, 13, -44, -13, 28, 46, 7, -26, 42, 29, 0, -6, 35, 23, -37, 10, 12, -2, 18, -12, -49, -10, 37, -5, 17, 6, -11, -22, -17, -50, -40, 44, 14, -41, 19...
Rust
0
import argparse import re import sys import unicodedata import chardet def str_escape(s): s = s.replace('\\\\', '\\') s = s.replace('\\\'', '\'') s = s.replace('\\"', '"') s = s.replace('\\n', '\n') s = s.replace('\\r', '\r') s = s.replace('\\t', '\t') s = s.replace('\\0', '') return ...
Python
1
import torch import torch.nn as nn import einops import numpy as np import math from predbench.registry import MODELS from .lstm_cells import SpatioTemporalLSTMCellv1 from .rnn_base import RNNBase @MODELS.register_module() class PredRNNv1(RNNBase): def __init__(self, input_shape, num_layers, ...
Python
1
pub fb_intr_type: crate::Reg<fb_intr_type::FB_INTR_TYPE_SPEC>, #[doc = "0x8c - Indicators of interrupt trigger polarities (will depend on the type of interrupt)"] pub fb_intr_pol: crate::Reg<fb_intr_pol::FB_INTR_POL_SPEC>, #[doc = "0x90 - FB interrupt enable for AP"] pub fb_intr_en_ap: crate::Reg<fb...
Rust
0
credit_info,x.act_info) ,axis=1) fpr_lr,tpr_lr,_ = roc_curve(val_y,val['score']) val_ks = abs(fpr_lr - tpr_lr).max() print('val_ks : ',val_ks) #对应评级区间 def level(score): level = 0 if score <= 600: level = "D" elif score <= 640 and score > 600 : l...
Python
1
me_t = libc::c_long; pub type __useconds_t = libc::c_uint; pub type __suseconds_t = libc::c_long; pub type __daddr_t = libc::c_int; pub type __key_t = libc::c_int; pub type __clockid_t = libc::c_int; pub type __timer_t = *mut libc::c_void; pub type __blksize_t = libc::c_int; pub type __blkcnt_t = libc::c_long; pub type...
Rust
0
RoleName=role_name, AssumeRolePolicyDocument=document) return role_name except AlreadyExistsError: if allow_recreate: return None else: raise def upload_server_certificate(cert_name, cert, private_key, chain=None): kwargs = dict( ...
Python
1
500), &to_bignum(2)); let mut tx_builder = TransactionBuilder::new( &linear_fee, &to_bignum(1), &to_bignum(1), &to_bignum(1), MAX_VALUE_SIZE, MAX_TX_SIZE ); let spend = root_key_15() .derive(harden(1852)) ...
Rust
0
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
Python
1
NoMatch, Matched, NoMatch, NoMatch] ); assert_eq!( match_word(a("bloom"), a("prowl")), [NoMatch, NoMatch, Matched, NoMatch, WrongPosition] ); } fn cycle(m: Match) -> Match { match m { Match::Matched => Match::WrongPosition, Match:...
Rust
0
::io::Error::new( ::std::io::ErrorKind::WouldBlock, "No socket", )) } } } impl Evented for Con { fn register( &self, poll: &Poll, token: Token, interest: Ready, opts: PollOpt, ) -> ::std::io::Result<()> { if...
Rust
0
# -*- coding: utf-8 -*- '''Verification of the define_dummy_springs function in the strut_and_tie_utils module. ''' __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2025, LCPT and AOO" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" import math import ...
Python
1
= ElementWriter::pretty(write); element_writer.write(&tag).unwrap(); let expected = r#"<?xml version="1.0" encoding="UTF-8"?> <tag id="my_tag"> <ns:subtag id="my_subtag">Some text</ns:subtag> </tag>"#; assert_eq!( expected, String::from_utf8(element_writer.into_inner()....
Rust
0
// /// This texture has two components: /// /// The metalness values are sampled from the B channel. /// The roughness values are sampled from the G channel. /// These values are linear. If other channels are present (R or A), /// they are ignored for metallic-roughness calculations. #[serde...
Rust
0
s[history_column][i]) == 0: prompt = query else: prompt = "" history = examples[history_column][i] for turn_idx, (old_query, response) in enumerate(history): prompt += "[Round {}]\n问:{}\n答:{}\n".forma...
Python
1
_object_type_array(&args[0])?; if let Some(obj) = array.get(0) { Ok(obj.clone()) } else { Ok(Object::Nil) } } fn builtin_tail(args: Vec<Object>) -> Result<Object, RuntimeError> { assert_num_arguments(&args, 1)?; let array = assert_object_type_array(&args[0])?; match array.get(1....
Rust
0
ss_results['emission_matrix'], 'forward_likelihood': consciousness_likelihood, 'viterbi_score': consciousness_score, 'state_distribution': consciousness_state_counts, 'consciousness_factor': consciousness_results['consciousness_factor'], 'consciousness_matrix_sum': consciousness_results['consciousness_matrix_sum']}, 'c...
Python
1
ng either skip the update-mask flag or provide an empty value (--update-mask '') for it.""", ) parser.display_info.AddFormat(properties.VALUES.core.default_format.Get()) def Run(self, args): # Determine what version to call from --location and --api-version. version = _GetApiVersion(args) ...
Python
1
as *mut _); } } #[cfg(feature = "futures")] pub fn new_from_stream_async_future<P: IsA<gio::InputStream> + Clone + 'static>(stream: &P) -> Box<Future<Item = Pixbuf, Error=Error>> { use gio::GioFuture; let stream = stream.clone(); GioFuture::new(&(), move |_obj, send| { ...
Rust
0
import os import torch from transformers import AutoTokenizer, AutoModelForMaskedLM import sys model_id = 'dccuchile/bert-base-spanish-wwm-uncased' from et_dirs import melo_tts_base, model_dir_base model_dir = os.path.join(os.path.join(model_dir_base, os.path.basename(melo_tts_base)), f'models{os.path.sep}bert-base-s...
Python
1
/runner.rs use crate::common::*; #[derive(Debug)] pub(crate) struct Runner { files: Vec<File>, options: RunnerOptions, } #[derive(Debug, Clone, StructOpt)] pub(crate) struct RunnerOptions { #[clap(long, help = "Modify documents in place.")] pub(crate) in_place: bool, #[clap(long, help = "Interactively prese...
Rust
0
neg_log_dens=lambda pos: (pos @ prec @ pos) / 2, grad_neg_log_dens=lambda pos: prec @ pos, ) @pytest.fixture def integrator(self, system): return mici.integrators.LeapfrogIntegrator(system, 0.5) @pytest.fixture def chain_state(self, rng): pos, mom = rng.standard...
Python
1
, 66, 197, 33, 178, 98, 81, 195, 129, 12, 30, 5, 121, 201, 168, 149, 60, 18, 125, 62, 131, 110, 41, 67, 155, 71, 86, 1, 113, 92, 47, 20, 15, 192, 198, 34, 116, 145, 76, 179, 164, 95, 99, 82, 135, 127, 65, 196, 194, 11, 120, 200, 130, 40, 154, 14, 163, 64, 119, 39, 153, 13, 162, 161]; assert_eq!(vec_i32_to_i64(...
Rust
0
cd certs //! ./generate-tls-assets.sh -f -c ./configs/dev-network.yml //! cd .. //! ``` //! //! <a href="https://asciinema.org/a/473131?autoplay=1" width="600" height="400" target="_blank"><img src="https://asciinema.org/a/473131.png"/></a> //! //! ### Generate JWT Keys //! //! This repo includes default JWT signing k...
Rust
0
tCol[1] par.fontcolorb = fontCol[2] par.fontalpha = fontCol[3] ''' button.panel.state = value def UpdateCompUI(self, compPar, compAttr, parNames): n = 1 for parName in parNames: self.extOP.op(parName).store('attr', compAttr['uiAttr'][parName]) d = op.LM.Delay(delayFrames = n, fromOP = self.ext...
Python
1
"\n".join(log) print(log_text, file=sys.stderr) raise ValueError(f"{TUNNEL_ERROR_MESSAGE}\n{log_text}") while url == "": # check for timeout and log if time.time() - start_timestamp >= TUNNEL_TIMEOUT_SECONDS: _raise_tunnel_error() as...
Python
1
save_model(request, obj, form, change) if len(form.cleaned_data['permissions']) > 0: permissions = list(Permission.objects.filter( id__in=form.cleaned_data['permissions']).order_by('name')) else: permissions = [] update_permissions_group(permissions, ob...
Python
1
ize.x / 2, combined_size.y), columns: 2, } } else { unimplemented!() } } pub fn align_to_32(size: UVec2) -> UVec2 { UVec2::new( (size.x as f32 / 32_f32).ceil() as u32 * 32, (size.y as f32 / 32_f32).ceil() as u32 * 32, ) } pub enum AlignmentDirection { In...
Rust
0
""" def __init__(self): r""" :param _ClusterId: 集群ID :type ClusterId: str :param _InstanceIdSet: 实例ID列表,目前只支持单个实例修改 :type InstanceIdSet: list of str :param _CPU: 修改后的CPU核数。取值参考文档【购买指南】 :type CPU: int :param _Memory: 修改后的内存大小,单位GiB。取值参考文档【购买指南】 ...
Python
1
orb(ref q in rbig_1()) { Ring::prop_left_zero_absorb(q) } #[test] fn prop_right_zero_absorb(ref q in rbig_1()) { Ring::prop_right_zero_absorb(q) } #[test] fn prop_left_mul_negate((ref q, ref r) in rbig_2()) { Ring::prop_left_mul_negate((q, r)) } #[test] fn prop_right_mul_negate((ref ...
Rust
0
: C2RustUnnamed_9, } #[repr(C)]#[derive(Copy, Clone)] pub struct C2RustUnnamed_9 { pub destroy: wl_signal, } #[repr(C)]#[derive(Copy, Clone)] pub struct wlr_data_source_impl { pub send: Option<unsafe extern "C" fn(_: *mut wlr_data_source, _: *const libc::c_char, _: in...
Rust
0
use cryptoki::context::Pkcs11; /// use cryptoki::context::CInitializeArgs; /// use cryptoki::object::AttributeType; /// use cryptoki::session::UserType; /// use cryptoki::session::SessionFlags; /// use std::collections::HashMap; /// use std::env; /// /// let pkcs11 = Pkcs11::new( //...
Rust
0
env.cursor = env.limit - v_6; // call verb_suffix, line 206 if !r_verb_suffix(env, context) { break 'lab4; } break 'lab5; } env.cursor = env.limit - v_5; ...
Rust
0
> { fn drop(&mut self) { unsafe { if (**self.ptr).rel_ref() == 1 { intrinsics::drop_in_place(*self.ptr); self.allocator.free(*self.ptr); } } } } // Warning! This implementation is incomplete! // Does not support duplicate values pub str...
Rust
0
nd email notification: {e}") async def _send_report_email(self, db: Session, user_id: str, report_name: str, report_path: str = None, task_info: Dict = None): """发送报告邮件的内部方法""" try: # 检查邮件通知偏好 if not crud.notification_preference.is_notifi...
Python
1
rity_rank, COUNT(*) as count FROM prioritized_output GROUP BY priority_rank ORDER BY priority_rank ASC """) priority_counts = {row[0]: row[1] for row in cursor.fetchall()} # Get counts by category from raw_feedback cursor.execute(""" ...
Python
1
use std::sync::Arc; static mut SERVER_NAME: MaybeUninit<rustls::ServerName> = MaybeUninit::uninit(); static mut CFG: MaybeUninit<Arc<rustls::ClientConfig>> = MaybeUninit::uninit(); static CFG_ONCE: std::sync::Once = std::sync::Once::new(); CFG_ONCE.call_once(|| { let mut certs = rustls::RootCe...
Rust
0