text
string
label_name
string
labels
int64
/// // Step 2: Build the Model let mut builder = j::DirectedModelBuilder::new(); builder = builder.with_named_variable(&difficulty, "D", HashSet::new(), j::Initialization::Binomial(0.6)); builder = builder.with_named_variable(&intelligence, "I", HashSet::new(), j::Initialization::Binomial(0.7)); bui...
Rust
0
2783":{ "descr":"Shift Subtitle Right", "command_name": "shift_subtitle_right", }, "32784":{ "descr":"Display Stats", "command_name": "display_stats", }, "33405":{ "descr":"Reset Display Stats", "command_name": "reset_display_stats", }, "33243":{ "desc...
Python
1
# coding=UTF-8 # ex:ts=4:sw=4:et=on # ------------------------------------------------------------------------- # Copyright (C) 2014 by Mathijs Dumon <mathijs dot dumon at gmail dot com> # # mvc is a framework derived from the original pygtkmvc framework # hosted at: <http://sourceforge.net/projects/pygtkmvc/> # # ...
Python
1
d.index(t)])) labels.append(f"{method}, {t}") ax.legend(handles, labels, title="Method / Time", bbox_to_anchor=(1.02,0.98), loc="upper left", borderaxespad=0) # better-is & unit ax.annotate( note, xy=(0.82,0.35), xycoords="figure fraction", ha="left", va="t...
Python
1
} }; if let Some(write_ref) = write_ref { repo.set_ref_immediate( None, write_ref, Some(import.ostree_commit.as_str()), gio::NONE_CANCELLABLE, )?; println!( "Imported: {} => {}", write_ref, impor...
Rust
0
import os import pandas as pd def process_txt_files(year, folder): carga_path = os.path.join(folder, f"{year}Carga.txt") atracacao_path = os.path.join(folder, f"{year}Atracacao.txt") if os.path.exists(carga_path) and os.path.exists(atracacao_path): df_carga = pd.read_csv(carga_path, delimiter=...
Python
1
(val) => write!(f, "{:?}", val), ExprData::Uneval { op, left, right } => write!(f, "{:?}({:?}, {:?})", op, left, right), ExprData::Ident(ident) => write!(f, "Ident({})", ident), } } } /// Convenience for creating instances of `ExprData::Value`. impl<T> From<T> for ExprData where Valu...
Rust
0
Eq)] #[repr(i32)] pub enum RtpTransceiverDirection { /// The [`RTCRtpTransceiver`]'s [RTCRtpSender] will offer to send RTP, /// and will send RTP if the remote peer accepts. /// The [`RTCRtpTransceiver`]'s [RTCRtpReceiver] will offer to receive /// RTP, and will receive RTP if th...
Rust
0
thError, HasSessionStorage, HasUserAuth}; use base::{CanCreateView, CanUpdateData, ResourceError}; use crypto::HasSecretKey; use futures::{ future::{err, Either}, Future, }; use warp::{Filter, Rejection, Reply}; use x_auth; /// Handle get user data pub fn get_user_data<S>( state: &S, ) -> impl Filter<Extra...
Rust
0
import wx import gui.fitCommands as cmd import gui.mainFrame from gui.contextMenu import ContextMenuSingle from service.fit import Fit _t = wx.GetTranslation class ProjectItem(ContextMenuSingle): visibilitySetting = 'project' def __init__(self): self.mainFrame = gui.mainFrame.MainFrame.getInstance(...
Python
1
const UNKNOWN = 0; /// data for the texture is stored in row-major order. /// only the following texture properties are supported: /// /// - `TEXTURE2D` /// - single mip level /// - single array slice /// 64kb alignment /// non-MSA...
Rust
0
k).unwrap_or(false) } fn starts_with_cjk(text: &str) -> bool { text.chars().next().map(is_cjk).unwrap_or(false) } fn find_next_text<'a>(events: &'a [Event], start: usize) -> &'a str { for event in events[start..].iter() { match event { Event::Text(text) => { return text; ...
Rust
0
# coding: utf-8 """ Slurm REST API API to access and control Slurm The version of the OpenAPI document: Slurm-24.11.5&openapi/slurmdbd&openapi/slurmctld Contact: sales@schedmd.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E50...
Python
1
self.set_clk(WDTSSEL_A::SMCLK) } pub fn reset(&mut self) { self.periph.wdtctl.modify(|r, w| { unsafe { w.bits(r.bits()).wdtpw().bits(PASSWORD) } .wdtcntcl() .set_bit() }); } pub fn disable(&mut self) { self.periph.wdtctl.modif...
Rust
0
[ // d1=2.1 // 0, 45, 90, 135, 180 degrees [0.94, 0.94, 0.93, 0.92, 0.92], // d2=0.1 [0.98, 0.97, 0.94, 0.89, 0.86], // d2=0.6 [0.99, 0.99, 0.96, 0.87, 0.82], // d2=1 [1.00, 0.99, 0.97, 0.87, 0.81], // d2=1.3 [1.00, 1.00, 0.99, 0.90, 0.84], // d2=1.8 ...
Rust
0
0<(len-*starts){ // 持ち駒の枚数。 let mut count = 1; match &line[*starts..(*starts+1)]{ "1"=>{ // 1枚のときは数字は付かないので、10~18 と確定☆ match &line[*starts..(*starts+1)]{ "0"=>{count=10; *start...
Rust
0
tware is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED...
Rust
0
time { use super::{BlockNumber, Moment}; /// Since BABE is probabilistic this is the average expected block time that /// we are targeting. Blocks will be produced at a minimum duration defined /// by `SLOT_DURATION`, but some slots will not be allocated to any /// authority and hence no block will be produced. W...
Rust
0
(Dict["ColumnElement[Any]", "MapperProperty[Any]"]): """Error reporting helper for mapper._columntoproperty.""" __slots__ = ("mapper",) def __init__(self, mapper): # TODO: weakref would be a good idea here self.mapper = mapper def __missing__(self, column): prop = self.mapper....
Python
1
'] == 404: # raise Exception('Lithops Runtime: {} not deployed'.format(runtime_name)) # else: # raise Exception(response) def get_runtime_key(self, runtime_name, runtime_memory, version=__version__): """ Method that creates and returns the runtime key. ...
Python
1
behind this serialized header when sending /// over a channel. /// # Returns /// 0 on success, -1 on serialization failure. /// # Safety /// Ensure that `target_buffer` is large enough before executing this function. #[no_mangle] pub unsafe extern "C" fn serialize_request_header( target_buffer: *mut libc::c_uchar, ...
Rust
0
asks(&[Layer::Territory, Layer::World]), ); } // fn spawn_rabbit( // mut commands: Commands, // textures: Res<TextureAssets>, // mut burrows: Query<(&Transform, &mut House)>, // ) { // for (transform, mut burrow) in burrows.iter_mut() { // if burrow.state == BurrowState::Spawn { // ...
Rust
0
pub fn br_x509_minimal_init(ctx: *mut br_x509_minimal_context, dn_hash_impl: *const br_hash_class, trust_anchors: *const br_x509_trust_anchor, trust_anchors_num: usize); pub fn br_x509_minimal_init_full(ctx: *mut br_x509_minimal_context, trust_anchors: *const br_x509_trust_anchor, trust_anchors_num: usize); } use crat...
Rust
0
break; } } } Result::<(), Error>::Ok(()) }) }; notifications_loop.await.expect("panic on JoinError")?; Ok(bc) } } impl BlockchainRunning { /// Creates a subscription for no...
Rust
0
{ bits: 8 } } #[doc = r" Writes raw bits to the register"] #[inline] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.bits = bits; self } #[doc = "Bit 0"] #[inline] pub fn tdoen(&mut self) -> _TDOENW { _TDOENW { w: self } } #[doc = "Bit 2"] ...
Rust
0
# Label(controlPanel, text="Out Phase",bg="#3A3939",fg="white").grid(row=1,column=0,sticky='e') # Label(controlPanel, text="In Phase",bg="#3A3939",fg="white").grid(row=1,column=2) # Label(controlPanel, text="D",font=("Ubuntu",15),width=12,bg="#3A3939",fg="white").grid(row=2, column=0) def labelWidgets(root,labelList)...
Python
1
return None def generate_video(self, text_prompt: str, video_style: str = "教育", duration: int = 30, output_type: str = "text_video"): if not VIDEO_GENERATION_AVAILABLE or not self.video_generator: print("❌ 视频生成功能不可用") print("💡 请安装视频生成依赖: pip install -r requirements...
Python
1
import onnx_graphsurgeon as gs import numpy as np import onnx # onnx_graph_surgeon(gs)中的IR会有以下三种结构 # Tensor # -- 有两种类型 # -- Variable: 主要就是那些不到推理不知道的变量 # -- Constant: 不用推理时,而在推理前就知道的变量 # Node # -- 跟onnx中的NodeProto差不多 # Graph # -- 跟onnx中的GraphProto差不多 def main() -> None: input = gs.Variable( ...
Python
1
elf.pin_memory, shuffle=True ) def val_dataloader(self): return DataLoader( self.val_dataset, batch_size=self.batch_size, num_workers=self.num_workers, pin_memory=self.pin_memory, ) def test_dataloader(self): r...
Python
1
import pygame import serial import time from dataclasses import dataclass def init_gamepad(): pygame.init() pygame.joystick.init() joystick_count = pygame.joystick.get_count() if joystick_count == 0: print("게임 패드가 연결되어 있지 않습니다.") return None joystick = pygame.joystick.Joystick(0) ...
Python
1
n_noise, replay_buffer_class=replay_buffer_class, replay_buffer_kwargs=replay_buffer_kwargs, optimize_memory_usage=optimize_memory_usage, n_steps=n_steps, policy_kwargs=policy_kwargs, tensorboard_log=tensorboard_log, verbose=verbose, ...
Python
1
lel_world_size(): """Return world size for the expert parallel group.""" return torch.distributed.get_world_size(group=get_expert_parallel_group()) def get_expert_data_parallel_world_size(): """Return world size for the expert data parallel group.""" return torch.distributed.get_world_size(group=get_e...
Python
1
bug { println!("bottom: within bounds {:?}", h); } if (cave[h + 1][w] <= cave[h][w]) { is_low = false; } } if debug{ println!("{:?}, {:?}: {:?} = {:?}", h, w, is_low, cave[h][w]); ...
Rust
0
{hash}")] pub async fn upload( path: web::Path<(String, String)>, state: web::Data<Arc<UploadState>>, mut payload: web::Payload, ) -> Result<impl Responder> { let (stream, hash) = path.into_inner(); let map = &mut state.map.lock().await; if let Some(entry) = map.get_mut(&stream) { // L...
Rust
0
from __future__ import annotations from typing import TYPE_CHECKING from gridfs import GridFS from pymongo import MongoClient from ayugespidertools.common.typevars import DatabaseSingletonMeta __all__ = [ "MongoDBEngineClass", "MongoDbBase", ] if TYPE_CHECKING: from pymongo.database import Database ...
Python
1
a_position as u32, 3, WebGl2RenderingContext::FLOAT, false, 0, 0, ); gl.enable_vertex_attrib_array(a_position as u32); } } if buffers.normal.is_some() { ...
Rust
0
of_u8(*byte); byte_array.reverse(); // preserve little endian encoding let hex_str = hex::encode(&byte_array); v += &hex_str; } s.serialize_str(&v) } } impl<'de> Deserialize<'de> for FrRepr { fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error...
Rust
0
# Function that performs the sorting operation def merge(arr, lt, mid, rt): i, j = lt, mid+1 b = [] # Compares the elements of the two arrays and sorts them while i<=mid and j<=rt: if arr[i]>arr[j]: b.append(arr[j]) j+=1 else: b.append(arr[i]) ...
Python
1
ter_name}".' ) return character_name, path def is_trailblazer(self, character_img: Image) -> bool: """Check if the character is Trailblazer Side effect: Sets the is_stelle QSetting :param character_img: The character image :return: True if the characte...
Python
1
; /// assert_eq!(w, &[0x78, 0x56, 0x34, 0x12]); /// ``` fn write_le<T: ToBytes<N>>(&mut self, t: T) -> std::io::Result<()> { self.write_all(&t.to_le_bytes()) } } macro_rules! impl_to_bytes { ($($ty:ident)+) => ($( impl ToBytes<{ size_of::<$ty>() }> for $ty { fn to_be_byt...
Rust
0
import numpy as np import matplotlib.pyplot as plt from huecodec import codec as hc SIZE_DEFAULT = 8 SIZE_LARGE = 10 plt.rc("font", family="Roboto") # controls default font plt.rc("font", weight="normal") # controls default font plt.rc("font", size=SIZE_DEFAULT) # controls default text sizes plt.rc("axes", titles...
Python
1
from emmet.api.resource import ReadOnlyResource from emmet.core.molecules.electric import ElectricMultipoleDoc from emmet.api.query_operator import ( PaginationQuery, SparseFieldsQuery, NumericQuery, ) from emmet.api.routes.molecules.electric.query_operators import ( MultipoleMomentComponentQuery, ) f...
Python
1
"date": date.tolist()[::time_interval], "SP500": sp500_values[::time_interval], "prices": prices, "sharpe_ratio": sharpe_ratio } response["isSuccess"] = True return jsonify(response) # @front_end.route("/portfolio/calculate", methods=['POST']) # def g...
Python
1
.encode(); println!("encode = {}", encode); // let decode = vrf_proof::decode(&encode).unwrap(); let result = curve25519_vrf_verify(&y, alpha, &proof); println!("result = {}", result); } } /// Converts bytes to an encoded string. fn bytes_to_string<T: ?Sized + AsRef<[u8]>>(input: &T...
Rust
0
mut u8, size as usize, size as usize) }; let config = serde_json::from_slice(&buffer)?; Ok(config) } pub mod ffi { extern "C" { pub(super) fn register(ptr: u32, size: u32); pub(super) fn emit(ptr: u32, size: u32) -> u32; pub(super) fn raise(ptr: u32, size: u32) -> u32; pub(s...
Rust
0
F_PFX_PASSPHRASE == "": print('Skipping signing because HF_PFX_PASSPHRASE is empty') return # FIXME use logic similar to the SetPackagingParameteres.cmake to locate the executable SIGN_TOOL = "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x64/signtool.exe" # sign the launcher exec...
Python
1
str() }) .collect_vec(); if known_library_versions.contains(&qt_config.installation_data.qt_version.as_str()) { config.set_current_cpp_library_version(Some(qt_config.installation_data.qt_version)); } else { match detect_closest_version( &known_library_versions, ...
Rust
0
# Copyright 2023 Akretion (https://www.akretion.com). # @author Sébastien BEAU <sebastien.beau@akretion.com> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). def format_m2m(records): if records: return "; ".join(records.mapped("display_name")) return ""
Python
1
() { Some((last, others)) => { for statement in others { statement.analyze(analyzer)?; } analyzer.is_final_statement_in_block = true; last.analyze(analyzer)?; analyzer.is_final_statement_in_block = false; Ok(()) } None => Ok(()), } } } impl Analyzable for Statement { ...
Rust
0
import json import pytest from chromewhip import helpers from chromewhip.protocol import page def test_valid_json_to_event(): valid_payload = {"method": "Page.frameNavigated", "params": { "frame": {"id": "3635.1", "loaderId": "3635.1", "url": "http://httpbin.org/html", "securityOrigin"...
Python
1
c\xeb\xab\xb3\x82\x01\ \xa4\xae7d\x87Ovy\xc1\xe0U/\xb4\x96c\xeb\ L\x96l\x83\xe9U\x91\xc94\xde\xc6w4\x96l\x8a\ x9\x15N#\x90\x0dY\x8c\x9c\x1a\xe1\x91\xa4K\xf6\ \xaa\x1a`OaS\x99\x00b\x075R\x19\x04|\xf4\ \xa9\x91\x83\x1c\x8e\xb5\xcdk\x5c\xa6\xf55\xf4\xb6\xcb\xfe\ 5\xd6\xe9K\xc6k\x93\xd3\x90\x0d\x9d\xab\xb2\xd2cl\ \x03\xb7\...
Python
1
cmd = ' '.join([cmd, '-o HOLD=ON']) cmd = ' '.join([cmd, '-o HOLDTYPE=PRIVATE']) cmd = ' '.join([cmd, '-o HOLDKEY=%s' % self.job_storage_pin.encode('ascii')]) else: cmd =...
Python
1
BlendMode::ColorBurn => "color-burn", BlendMode::HardLight => "hard-light", BlendMode::SoftLight => "soft-light", BlendMode::Difference => "difference", BlendMode::Exclusion => "exclusion", BlendMode::Hue => "hue", BlendMode::Saturation => "saturation", BlendMode::Color => "color", Blend...
Rust
0
::url_to_filename; pub use deno::test_util::*; use url::Url; let g = util::http_server(); let deno_dir = TempDir::new().expect("tempdir fail"); let module_url = Url::parse("http://localhost:4545/cli/tests/006_url_imports.ts").unwrap(); let output = Command::new(deno_exe_path()) .env("DENO_DIR", d...
Rust
0
""" # Definition for a Node. class Node: def __init__(self, val = 0, neighbors = None): self.val = val self.neighbors = neighbors if neighbors is not None else [] """ from typing import Optional class Solution: def __init__(self): # Dictionary to store the cloned nodes self.clon...
Python
1
ZResult<Box<dyn Action>> { let screen_pos = hex_to_point(view.tile_size(), at); let texture = match state.map().tile(at) { TileType::Plain => textures().map.tile, TileType::Rocks => textures().map.tile_rocks, }; let size = view.tile_size() * 2.0 * geom::FLATNESS_COEFFICIENT; let mut...
Rust
0
ights) print("Total number of search points", num_tries) threads = args.num_jobs pool = Pool(threads) compute_fxn = partial(compute, feats=feats, ref_lid=ref_asr, nbest_lid=nbest_lid, ref_asr=ref_asr, nbest_asr=nbest_asr, n=args.n, exclude=args.exclude) results = pool.map(compute_fxn, weights) p...
Python
1
ome(sig)).expect("Error running ptrace()"); } ws => panic!("Unknown wait status: {:?}", ws), } } Ok(()) } fn main() -> Result<(), io::Error> { let matches = App::new("C2Rust cross-check pointer access tracer") .version(crate_version!()) .author(crate_authors!...
Rust
0
mal(mu, prec).T return out def run_pp_mix_bernoulli(burnin, niter, thin, data, params, log_every): ranges = np.zeros((2, data.shape[1])) ranges[0, :] = 0.0 ranges[1, :] = 1.0 out = [] pp_mix = make_pp(params) h = make_jump(params) g = make_prec(params) pp_mix.set_ranges(ranges) ...
Python
1
import sys sys.stdin = open('password.txt') for tc in range(1, 11): N, raw_data = input().split() stack1 = [i for i in raw_data] stack2 = [] N = int(N) for i in range(N): stack2.append(stack1.pop()) if len(stack2) >= 2 and stack2[-1] == stack2[-2]: stack2.pop() ...
Python
1
import logging from pythonjsonlogger import jsonlogger from core import settings # Setup logging def setup_logging() -> logging.Logger: """ Set up logging configuration. :return: Configured logger """ log_level = logging.DEBUG if settings.bot.debug else logging.WARNING # Stream handler for...
Python
1
1 as T; #[inline(always)] pub fn add(x: T, y: T) -> T { x + y } #[inline(always)] pub fn sub(x: T, y: T) -> T { x - y } #[inline(always)] pub fn mul(x: T, y: T) -> T { x * y } #[inline(always)] pub fn div(x: T, y: T) -> T { x / y } #[inline(always)] pub fn rem(x: T, y: T) -> T { x % y } #[inline(always)] pub fn lt(x...
Rust
0
from ._approval import Approval, ApprovalDecision from ._approver import Approver from ._auto import auto_approver from ._human.approver import human_approver from ._policy import ApprovalPolicy from ._registry import approver __all__ = [ "Approver", "Approval", "ApprovalDecision", "ApprovalPolicy", ...
Python
1
q.push(5); q.push(6); q.push(7); let res = q.pop(); assert_eq!(res, Some(7)); let res = q.pop(); assert_eq!(res, Some(6)); let res = q.pop(); assert_eq!(res, Some(5)); let res = q.pop(); assert_eq!(res, Some(4)); let res =...
Rust
0
elif len(parts) == 2: name, url = parts[0], parts[1] item = self.create_advertiser_item(name, url, "暂无介绍") self.advertiser_layout.addWidget(item) else: self.add_empty_message(self.ad...
Python
1
egistration of a new service followed by unregistration when the /// client drops the ConnectionReceiver. #[test] fn test_register_service() -> Result<(), Error> { let mut exec = fasync::Executor::new().unwrap(); let id = PeerId(234); let (mut mock_peer, _observer_stream, _env_vars)...
Rust
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 under the License...
Rust
0
import pandas as pd import pprint as pp def lineBreaker(): print(f'{"x ---------- "*5}x') # Importando dataset com delimitador vírgula df = pd.read_csv('./data/Pedidos-1.csv') #pp.pprint(df) lineBreaker() # Importando dataset com delimitador ponto-vírgula df2 = pd.read_csv('./data/Pedidos-2.csv', delimiter=';') ...
Python
1
parse_command_line() api_token = os.environ['JUPYTERHUB_API_TOKEN'] loop = IOLoop.current() task = partial(backup_details, url=options.url, api_token=api_token, interval=options.interval, backups=options.backups, config_map=options.config_map) # Schedule the first backup...
Python
1
cfg() # return model # # # @register_model # def visformer_net5(pretrained=False, **kwargs): # model = Visformer( # init_channels=32, embed_dim=384, depth=12, num_heads=6, mlp_ratio=4., group=1, attn_stage='111', # spatial_conv='111', vit_stem=False, conv_init=True, **kwargs) # model.default...
Python
1
import torch from torch.profiler import record_function from triton_kernels.swiglu import swiglu_fn from triton_kernels.numerics_details.mxfp import downcast_to_mxfp from triton_kernels.matmul_ogs import PrecisionConfig, FlexCtx, FnSpecs, FusedActivation from triton_kernels.matmul_ogs import matmul_ogs from triton_ker...
Python
1
class ConfigEmail : def __init__(self): self.config = {} # 存储配置的字典 self.load_config() # 加载配置 def load_config(self): # 加载配置 self.config = { "emails": [ ("MichaelMatthews1969714@outlook.com", "Michael187368"), ...
Python
1
Rights: /// - https://docs.microsoft.com/en-us/windows/win32/fileio/file-security-and-access-rights /// STANDARD_RIGHTS_ALL /// - https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask #[cfg(windows)] const OWNER_ACL_ENTRY_UNRESTRICT_MASK: u32 = FILE_GENERIC_READ | FILE_GENERIC_WRITE | STANDARD_RIGH...
Rust
0
_base_ = '../retinanet/retinanet_x101-32x4d_fpn_1x_coco.py' model = dict( bbox_head=dict( type='PISARetinaHead', loss_bbox=dict(type='SmoothL1Loss', beta=0.11, loss_weight=1.0)), train_cfg=dict(isr=dict(k=2., bias=0.), carl=dict(k=1., bias=0.2)))
Python
1
# Copyright (c) 2023 Uber Technologies, Inc. # <p>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 # <p>http://www.apache.org/licenses/LICENSE-2.0 # <p>Unless required by applicable law or agreed ...
Python
1
) d.add_field('constraint_set0_flag', bs.read_bits, count=1) d.add_field('constraint_set1_flag', bs.read_bits, count=1) d.add_field('constraint_set2_flag', bs.read_bits, count=1) d.add_field('constraint_set3_flag', bs.read_bits, count=1) d.add_field('constraint_set4_flag', bs.read_bits, count=1) ...
Python
1
import json import time from app import DEPLOYMENTS_ROUTE TEST_BUCKET_NAME = "test-bucket" DOMAIN_NAME = "test.com" ENVIRONMENT_URL = "test-env.eba-p4cwtpiw.us-east-1.elasticbeanstalk.com" CONTACT_INFO = { 'FirstName': 'John', 'LastName': 'Doe', 'ContactType': 'PERSON', 'OrganizationName': 'Example O...
Python
1
def __init__(self, vit_model='eva_clip_g', img_size=224, drop_path_rate=0, use_grad_checkpoint=False, vit_precision='fp16', freeze_vit=True, num_query_token=32, t5_model='google/flan-t5-xl', prompt='', max_txt_len=32, apply_lemmatizer=False): """ apply_lemmatizer: when set to True, postprocess p...
Python
1
_type) => { type_to_string(&intersection_type.left) + " & " + &type_to_string(&intersection_type.right) } data::Type::WithTypeParameter(type_with_parameter) => { type_to_string(&type_with_parameter.r#type) + &(if type_with_paramete...
Rust
0
len += 1; chunk.users += 1 } /// note: This is for writing single chunks, /// use `bchunk_list_append_data_n` when writing large blocks of memory into many chunks. fn bchunk_list_append_data( info: &BArrayInfo, bs_mem: &mut BArrayMemory, chunk_list: PtrMut<BChunkList>, data: &[u8], ) { debug_assert...
Rust
0
tive_values(): col_vals = [-1, 0, 1, 2] df = pd.DataFrame({"col": col_vals}) with pytest.warns( UserWarning, match="Value -1 in column 'col' is less than the domain minimum 0. Setting to 0.", ): result = _scale_numeric_column(df, "col", col_vals) assert result == [0, 0, 0.5...
Python
1
let false_condition = Expr::cmplts(lhs, zero)?; control_flow_graph.conditional_edge( head_index, true_index, Expr::cmpeq(false_condition.clone(), expr_const(0, 1))? )?; control_flow_graph.conditional_edge( head_index, terminating_index, false_condition ...
Rust
0
es["UpArrow"]: await SendKey(Key.tab, True, Key.up) elif reaction_emoji == emotes["RightArrow"]: await SendKey(Key.tab, True, Key.right) elif reaction_emoji == emotes["AButton"]: await SendKey(Key.tab, False, "d") ...
Python
1
peso = float(input("Quantos quilos?")) if peso <=50: print(f"Seu peixe tem {peso}Kg, não é nescessário multa") else: exe = (peso-50)*4 print(f"Seu peixe tem {peso:.2f}Kg, a sua multa é de {exe:.2f}")
Python
1
import pywt import csv import pandas as pd wavelet_names = [f'db{i}' for i in range(1, 30)] with open('daubechies_filters.csv', mode='w', newline='') as file: writer = csv.writer(file) writer.writerow(['Wavelet', 'Stage', 'Type', 'Coefficient_Index', 'Value']) for wavelet_name in wavelet_names: w...
Python
1
enerating == False: self.traj_generating = True self.update_trajectory() def update_trajectory(self): """ Calls generate_trajectory which (like the name suggests) generates a trajectory. Then trajectory_smoother is called which modifies and sends the traject...
Python
1
ape("const path = require('path').join(__dirname, '"), regex::escape(".wasm');\nconst bytes = require('fs').readFileSync(path);"), )) .expect("expected pre-set regex to succeed"); let text_decoder_regex = regex::Regex::new( &format!("const .*{}\n", regex::escape("require(`util`);")) ) ...
Rust
0
(nn_matrix[:, i, 1:], "b v -> b v 4 4") kv_z_extrinsics = torch.gather(extrinsics_tensor, dim=1, index=index) else: kv_x = torch.stack(x, dim=1) kv_y_intrinsics = torch.stack(y, dim=1) kv_z_extrinsics = torch.stack(z, dim=1) kv.append(kv_x) kv_in...
Python
1
_supported_modifiers_sizeof)(_buffer) } /// Returns `true` iff the symbol `xcb_dri3_get_supported_modifiers_sizeof` could be loaded. #[cfg(feature = "has_symbol")] pub fn has_xcb_dri3_get_supported_modifiers_sizeof(&self) -> bool { has_sym!(self, xcb_dri3_get_supported_modifiers_sizeof) } ...
Rust
0
he way from source to sink: /// /// ```no_run /// use async_executors::TimerExt; /// use async_nursery::Nursery; /// use crossbeam_queue::SegQueue; /// use std::{sync::Arc, time::Duration}; /// /// use callbag::{combine, for_each, interval, map, pipe, take}; /// /// let (nursery, nursery_out) = Nursery::new(async_execu...
Rust
0
: 4}, {"challenge_id": 1583516876634190, "challenge_name": "人性", "sum_count": 4}, { "challenge_id": 1613479358433288, "challenge_name": "内容过于真实", "sum_count": 4, }, {"challenge_id": 1667490735102984, "challenge_name": "学浪计划", "sum_count": 4}, {"challenge_id": 1565262013464578...
Python
1
import os import sys import locale import subprocess import shutil import ast #打包函数 #访问目标资源,使得能在打包后还能获取 def get_resource_path(relpath): # relpath 例如: 'resource/xxx.png' if hasattr(sys, '_MEIPASS'): #打包后exe return os.path.join(sys._MEIPASS, relpath) return os.path.join(os.path.dirname(__f...
Python
1
name": "foobar", "type": "loadable_module", "resources": [ "pkg/foobar/res.one" ], "binaries": { "x64": [ "arch/x64/lib/foobar.stg" ] } } "#; // This metadata has diffe...
Rust
0
mut GeneralDiscoveryArgs, gold_sm: &Graph, max_permutation: usize, train_node_storage: Rc<RefCell<Vec<(String, f64, Graph)>>>) -> Vec<GeneralDiscoveryNode> { // explore more nodes, and add those nodes back to the store as training data ...
Rust
0
ma(x: u8) -> u8 { /// A permutation table. /// /// It is generated by generating a cycle by going through all the integers, several thousand /// times, then permuting them based on a pseudorandom stream based on 1024 of PCG round, then /// the table is reordered to be full-cycle. static TABLE: [...
Rust
0
from django.urls import path from .views import totp_login_view, setup_totp_view, home_view urlpatterns = [ path('login/', totp_login_view, name='login'), path('setup-totp/', setup_totp_view, name='setup_totp'), path('', home_view, name='home'), ]
Python
1
pub wDriverOffset: u16, pub wDeviceOffset: u16, pub wOutputOffset: u16, pub wDefault: u16, } #[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))] impl ::core::marker::Copy for DEVNAMES {} #[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))] impl ::core::clone::Clone for DEVNAMES { fn clo...
Rust
0
down(&self) -> Result<()>; /// Handle vcpu event from `kvm`. fn kvm_vcpu_exec(&self) -> Result<bool>; } /// `CPU` is a wrapper around creating and using a kvm-based VCPU. #[allow(clippy::upper_case_acronyms)] pub struct CPU { /// ID of this virtual CPU, `0` means this cpu is primary `CPU`. id: u8, ...
Rust
0
], [1, 2, 0, 1, -1, -1], [1, 0, 2, 1, -1, 1], [1, 2, 0, 1, 1, 1], [1, 0, 2, -1, 1, 1], [1, 2, 0, -1, 1, -1], [1, 0, 2, -1, -1, -1], [1, 2, 0, -1, -1, 1], [2, 1, 0, 1, 1, -1], [2, 0, 1, 1, -1, -1], [2, 1, 0, 1, -1, 1], [2, 0, 1, 1, 1, 1], [2, 1, 0, -1, 1, 1], [2, 0, 1,...
Rust
0
List of environment wrappers. Defaults to empty list Returns: None """ save_model(agent, exp_dict.run_name, exp_type=exp_dict.exp_type, print_path=print_path) exp_folder = "" if exp_dict.exp_type is None else exp_dict.exp_type if exp_dict.capture_video: filepath, _ = create_folder_...
Python
1