text
string
label_name
string
labels
int64
x00\xdb\x06\xce\ \xc0\xc6l\xf5\x02\xa8\x82\x97<\xeb\x10w,\xfe\x8e?\ \x9f,P\xb7\x07\x10\xaa\x0a\x8c\x03$\x82c\x9a\x16\xe4\ \x1a$p\xae\x05.\x9d\xf7\xc08\x0dq#\x82\x12\x00\ \x19\x8e)8#6E&\xe5u\xb9K\xe6n0\xf4\ K\x5c\x8b\xe9\xdenR7bRvo\xb2b&\xf7\ \x00~\x0b\xd44\x0d.\x1d*~\x7fm\x89\xaa\xaa \ \x1e9E\xce\x9c(Xk\x80J\x00\xeb\xb...
Python
1
Video.stack([videos[3], videos[4].trim(0, 0.1)], dim=3).numpy().tolist() assert dim_3 == [[[[30, 40]]], [[[31, 0]]], [[[32, 0]]]] def test_video_source(): frames = np.arange(10).astype(np.uint8).reshape(-1, 1, 1, 1) sequence = SequenceFrames(frames, fps=1) # type: ignore source = VideoSource(sequence...
Python
1
unwrap()); println!("{:#?}\n", genre.unwrap()); println!("{:#?}\n", genres.unwrap()); println!("{:#?}\n", genre_artists.unwrap()); println!("{:#?}\n", radios_genres.unwrap()); println!("{:#?}\n", radio_top.unwrap()); println!("{:#?}\n", radios_tracks.unwrap()); println!("{:#?}\n", radios.unwrap()); prin...
Rust
0
def next_slide(self): if self.slice_index < self.slice_num - 1: self.slice_index += 1 if (self.slice_num > 0): self.update_slide() self.update_slidebar() def prev_slide(self): if self.slice_index > 0: self.slice_index -= 1 if (self....
Python
1
# PADRÃO: ANSI escape sequence, o escape é representado pela contra barra \ # Sempre que você quiser escrever representar uma cor em python você vai: # escrever \033[m # entre o "\033[" e o "m" # você pode colocar alguns códigos # o primeiro código que agente vai representar é o código do comportamento/stilo/style # e...
Python
1
{OpStore, OpStoreResult, OperationId, OperationMetadata}; use crate::operation::Operation; use crate::simple_op_store::SimpleOpStore; use crate::store::{CommitId, Timestamp}; use crate::store_wrapper::StoreWrapper; pub trait View { fn checkout(&self) -> &CommitId; fn heads(&self) -> &HashSet<CommitId>; fn ...
Rust
0
::Error>; } pub struct EventId(u64); /// A bidirectional channel which keeps track of the initiator half /// and sends the corresponding response to the listener of the operation. pub(crate) struct ContractHandlerChannel<CErr, End> { rx: mpsc::UnboundedReceiver<InternalCHEvent<CErr>>, tx: mpsc::UnboundedSende...
Rust
0
impl ::protobuf::Clear for CLibraryBootstrapData { fn clear(&mut self) { self.app_data.clear(); self.unknown_fields.clear(); } } impl ::std::fmt::Debug for CLibraryBootstrapData { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(...
Rust
0
import torch import json from transformers.utils import WEIGHTS_NAME, CONFIG_NAME from transformers.utils.hub import cached_file def load_pretrained_mamba(pretrained_model_name: str): """Load pretrained weights from HuggingFace into model. Args: pretrained_model_name: One of * 'state-spac...
Python
1
-2] >> 32)) >> 25; tmp2[i] = tmp2[i].wrapping_add((Self::uint32(tmp[i-1])) >> 28); tmp2[i] = tmp2[i].wrapping_add((Self::uint32(tmp[i-1]>>32) << 4) & BOTTOM_29BITS); tmp2[i] = tmp2[i].wrapping_add(Self::uint32(tmp[i]) & BOTTOM_29BITS); tmp2[i] = tmp2[i].wrapping_add(carry...
Rust
0
te_error(y_test, y_pred); r2 = r2_score(y_test, y_pred) os.makedirs(out_folder, exist_ok=True) report_path = os.path.join(out_folder, 'autopredict_lasso_report.txt'); raster_out = os.path.join(out_folder, 'autopredict_lasso_depth.tif') samples_csv = os.path.join(out_folder, 'autopredict...
Python
1
T, WSAESTALE as ESTALE, WSAETIMEDOUT as ETIMEDOUT, WSAETOOMANYREFS as ETOOMANYREFS, WSAEUSERS as EUSERS, WSAEWOULDBLOCK as EWOULDBLOCK, WSAEWOULDBLOCK as EAGAIN, WSAPOLLFD as pollfd, *, }; struct Solution; use std::cmp::Reverse; impl Solution { fn best_coordinate(towers: Vec<Vec<i32>>, radius: i32) -> Vec...
Rust
0
rate(text_seed=["b", "c"]) == "d" assert mle_trigram_model.generate(text_seed=["a", "c"]) == "d" def test_generate_one_from_varied_context(mle_trigram_model): # When context doesn't limit our options enough, seed the random choice assert mle_trigram_model.generate(text_seed=("a", "<s>"), random_seed=2) ==...
Python
1
assert_eq!(count_esc(&s), 140); } /// Check if all constants are available #[test] fn test_colors_bg() { let s = String::new() + BG_BLACK + BG_BLACK_INTENSE + BG_RED + BG_RED_INTENSE + BG_GREEN + BG_GREEN_INTENSE + BG_YELLOW + BG_YELLOW_INTENSE ...
Rust
0
BuilderSpritesheet<filename>src/lib.rs use serde::{Deserialize, Serialize}; pub use serde_json::Error; /// A sprite sheet which contains many sprites in a single image. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SpriteSheet { image_png_bytes_b64: String, width_px: u32, he...
Rust
0
_relative(b1)), opcodes::BVC => ("BVC", 1, format_relative(b1)), opcodes::BVS => ("BVS", 1, format_relative(b1)), // BRK opcodes::BRK => ("BRK", 0, format_implied()), // CLC, CLD, CLI opcodes::CLC => ("CLC", 0, format_implied()), opcodes::CLD => ("CLD", 0, forma...
Rust
0
); } } <reponame>rakaly/ck3save use serde::Deserialize; use std::borrow::Cow; #[derive(Debug, Deserialize)] pub struct HeaderOwned { pub meta_data: MetadataOwned, } #[derive(Debug, Deserialize)] pub struct HeaderBorrowed<'a> { #[serde(borrow)] pub meta_data: MetadataBorrowed<'a>, } #[derive(Debug, De...
Rust
0
""" Top-K plot with Others ---------------------- This example shows how to use aggregate, window, and calculate transfromations to display the top-k directors by average worldwide gross while grouping the remaining directors as 'All Others'. """ # category: case studies import altair as alt from vega_datasets import ...
Python
1
"""The 'View' Module of the application: The GUI Events. This file contains the different GUI events that can be triggered by the user/application. License: MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "S...
Python
1
ce_skip = True elif "parent_metadata" in entity_configuration and "namespace" in entity_configuration["parent_metadata"]: if entity_configuration["parent_metadata"]["namespace"] in check_id_denylist: namespace_skip = True else: if "default" in ...
Python
1
2, Error::InvalidArguments); let spk = args.remove(0).into_spk()?; let network = args.pop().map_or(Ok(Network::Signet), TryInto::try_into)?; Ok(Address::from_script(&spk, network) .ok_or_else(|| Error::NotAddressable(spk))? .into()) } pub fn repeat(mut args: Ve...
Rust
0
.port_id) }; assert_eq!(ret, 0); } else { // Safety: foreign function. Uninitialized data structure will be filled. let dpdk_stat = unsafe { let mut temp = MaybeUninit::uninit(); let ret = dpdk_sys::rte_eth_stats_get(self.inner.port_id, temp.as...
Rust
0
import numpy as np import pytest from akuire.acquisition import Acquisition, AcquisitionResult from akuire.compilers.default import compile_events from akuire.config import SystemConfig from akuire.engine import AcquisitionEngine from akuire.events import AcquireZStackEvent, ImageDataEvent, MoveEvent from akuire.manag...
Python
1
= as_floats(values); rolling_apply_convolve( values, window_size, min_periods, det_offsets, compute_var, weights, ) } } } pub fn rolling_sum<T>( values: &[T], window_size: usize, ...
Rust
0
# import os import pyvista as pv from pyvista import examples from trame.app import get_server from trame.ui.html import DivLayout from trame.widgets import html, client, vtk as vtk_widgets from trame_vtklocal.widgets import vtklocal WASM = True # "USE_WASM" in os.environ # -----------------------------------------...
Python
1
From<io::Error> for Error { fn from(err: io::Error) -> Error { Error::Io(err) } } // Copyright (c) 2022 Blacknon. All rights reserved. // Reference: // - https://gist.github.com/kylewlacy/115965b40e02a3325558 /// Given a vector containing a partial Cartesian product, and a list of items, /// return ...
Rust
0
n::<Service>("io.containerd.empty.v1") //! ``` //! use std::collections::hash_map::DefaultHasher; use std::fs::File; use std::hash::Hasher; use std::os::unix::io::RawFd; use std::os::unix::net::UnixListener; use std::path::{Path, PathBuf}; use nix::ioctl_write_ptr_bad; pub use containerd_shim_protos as protos; pub u...
Rust
0
= DirectoryContent::new(2096); let file_info = FileInfo::try_from_path_and_index("./data/TEST.TXT", 0x1234).unwrap(); assert_eq!(table.push(file_info.clone()), Ok(())); assert_eq!(table.push(file_info.clone()), Ok(())); assert_eq!(table.push(file_info.clone()), Ok(())); // Chec...
Rust
0
x - 1 ) assert _mutable_equal(simp(x - (x + 1)), -1) assert isinstance(simp(x - (x + 1)), int) x = nni.choice('x', [0., 1., 2.]) assert _mutable_equal(simp((x + 1) ** 2 - (x * x + 2 * x + 2)), -1) assert isinstance(simp(x - (x + 1)), float) x = nni.choice('x', [2, 4, 8]) assert _...
Python
1
'''def expo(x, y): return (x ** y) print(expo(2, 5)) print(expo(3, 2)) print(expo(5, 3)) ''' '''def voto(x, y): if y < 16: return (x, False) else: return(x, True) #=================================== while True: eleitor = input("nome do candidato: ") idade = int(input("idade: ")) ...
Python
1
#!/usr/bin/env python3 """ pointgrey_camera_driver (at least the version installed with apt-get) doesn't properly handle camera info in indigo. This node is a work-around that will read in a camera calibration .yaml file (as created by the cameracalibrator.py in the camera_calibration pkg), convert it to a valid sensor...
Python
1
is_better = False if self.mode == 'max': is_better = current_score > self.best_score else: is_better = current_score < self.best_score if not self.save_best_only or is_better: if is_better: self.best_score = current_score ...
Python
1
ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] $($field:tt)* ) => {}; (@struct=>make_proj_ty=>unnamed; [$proj_vis:vis] [][$proj_ty_ident:ident] [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$...
Rust
0
32, max_mem_type_1: u32 } impl PostScriptTableHeader { /// Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, /// negative for text that leans to the right (forward). #[inline] pub fn italic_angle(&self) -> i32 { self.italic_angle } /// This is the ...
Rust
0
'a, 'tcx>, t: Ty<'tcx>, val: ValueRef, to: Disr) { let l = bcx.ccx.layout_of(t); match *l { layout::CEnum{ discr, min, max, .. } => { assert_discr_in_range(Disr(min), Disr(max), to); bcx.store(C_integral(Type::from_integer(bcx.ccx, discr), to.0, true), val, None...
Rust
0
# /core/retrieval.py from langchain_chroma import Chroma from core.config_loader import load_config from core.embeddings import get_embeddings def get_vectorstore(): cfg = load_config() persist_directory = cfg["vectorstore"]["persist_directory"] collection_name = cfg["vectorstore"]["collection_name"] e...
Python
1
= "/usr/bin/python /var/www/webvirtmgr/manage.py run_gunicorn -c\ /var/www/webvirtmgr/conf/gunicorn.conf.py", directory="/var/www/webvirtmgr", user=user, stdout_logfile="/var/log/supervisor/webvirtmgr.log", autostart=True, autorestart=...
Python
1
alidation_datasets) return training_datasets, validation_datasets def construct_dataset(raw_data, num_samples): """ Builds a dataset. :param raw_data: Raw data. :param num_samples: The number of samples to generate. :return: The list of constructed samples. """ examples = [] data_...
Python
1
jcli: bawawa::Command, testing_directory: Option<PathBuf>, generate_documentation: bool, ) -> Self { let rng = ChaChaRng::from_seed(seed.0); let testing_directory = if let Some(testing_directory) = testing_directory { TestingDirectory::User(testing_directory) } e...
Rust
0
to pause. if 'PAGER' in os.environ: del os.environ['PAGER'] self.RunCommand('help', []) def testCatCommandRuns(self): """Test that the cat command basically runs.""" src_uri = self.CreateObject(contents='foo') stdout = self.RunCommand('cat', [suri(src_uri)], return_stdout=True) self.as...
Python
1
arameters()), lr=lr, momentum=momentum, weight_decay=weight_decay) return FT_iter(data_loaders, model, criterion, new_optimizer, epoch, args, mask) @iterative_unlearn def CF(data_loaders, model, criterion, optimizer, epoch, args, mask=None): reinit_and_freeze_layers(model, k=1, reinit=False) lr = optimize...
Python
1
let expected = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]; assert_eq!(actual, expected); } } use chrono::prelude::*; use chrono::Duration; use maybe_async::maybe_async; use rspotify::client::SpotifyBuilder; use rspotify::oauth2::{CredentialsBuilder, OAuthBuilder, Token, TokenBuilder}; use rspot...
Rust
0
import os import batchman from batchman import Request, UserMessage, ProviderConfig batch = batchman.create_batch( "stories-generation", ) jobs = ["an astronaut", "a doctor", "a firefighter", "a teacher", "a chef", "a farmer", "a pilot", "a police officer", "a baker", "a scientist", "a writer", "a musici...
Python
1
} } } } } impl Solution { fn has_path_sum(root: Tree, sum: i32) -> bool { if root.is_none() { return false; } root.has_path_sum(sum) } } #[test] fn test() { let root = TreeNode::branch( 5, TreeNode::branch( ...
Rust
0
for syllable in pStr: sLoc = idx % 3 # 0: CHOSUNG, 1: JUNGSUNG 2: JUNGSUNG idx+=1 if syllable == 'ㅇ' and sLoc == 0: continue elif syllable == '_' and sLoc == 2: continue else: count+=1 result+=syllable return count, result ...
Python
1
crate::colodottc!(DotTrueColor{r: r, g: g, b: b}, arg); } } pub fn reset () { printdot!(DotTypes::Light, DotColors::Reset ); } } #[macro_export] macro_rules! colodot { ($dot_type: expr, $dot_color: expr, $args: expr) => { let data: &str = $args; ...
Rust
0
тан в _media_group_callback else: return event def _should_ignore_message(self, message: types.Message) -> bool: """ Проверяет, нужно ли игнорировать сообщение. Игнорируем каналы и специальные типы сообщений. """ # Каналы (боты не работают в каналах) ...
Python
1
contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, softwar...
Rust
0
(key=lambda x: channels.index(x)) print("=" * 50) print(f"Testing completed!") print(f"Working channels: {len(self.working_channels)}") print(f"Failed channels: {len(self.failed_channels)}") print(f"Success rate: {len(self.working_channels)/total_channels*100:.1f}%") ...
Python
1
FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BU...
Rust
0
each prompt using both models id_counter = 0 for prompt in tqdm(prompts, desc="Generating outputs", unit="prompt", total=len(prompts)): completion = generate_answer(model, tokenizer, prompt) # print(f"Prompt: \n{prompt}") # print(f"Completion...
Python
1
> = Box::new(Mutable::new(1).signal()); let _: Box<dyn Send + Sync> = Box::new(Mutable::new(1).signal_cloned()); let a = channel(1); let _: Box<dyn Send + Sync> = Box::new(a.0); let _: Box<dyn Send + Sync> = Box::new(a.1); } #[test] fn test_map_future() { let mutable = Rc::new(Mutable::new(1)); ...
Rust
0
) as Z_{H}(t) * v_i / (t- h g^i) where: - Z_{H}(t) = \prod_{j} (t-h*g^j) = (t^m-h^m), and - v_{i} = 1 / \prod_{j \neq i} h(g^i-g^j). Below we use the fact that v_{0} = 1/(m * h^(m-1)) and v_{i+1} = g * v_{i}. We first compute the inverse of each coefficient, except for the Z_H(t)...
Rust
0
pen(&self) -> fs::File { let mut f = self.f.as_ref().unwrap().try_clone().unwrap(); let _ = f.seek(SeekFrom::Start(0)); f } /// Returns the path to the tempfile pub fn path(&self) -> &Path { &self.path } } impl Drop for TempFile { fn drop(&mut self) { mem::d...
Rust
0
tart=0., eps_end=0.) NUM_STATE = env_test.env.observation_space.shape[0] NUM_ACTIONS = env_test.env.action_space.n NUM_ACTIONS_TCLs = 4 NUM_ACTIONS_PRICES = 5 NUM_ACTIONS_DEF = 2 NUM_ACTIONS_EXCESS = 2 NONE_STATE = np.zeros(NUM_STATE) EPISODE_COUNTER = 0 brain = Brain() # brain is global in A3C # envs = [Environment...
Python
1
key = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] def pad_time(string, padding=2): string = padding * "0" + str(string) return string[-2:] def add_time(start, duration, start_day=None): start = start.split(" ") start_time = start[0].split(":") start_hour = int(...
Python
1
self.beacons = self.beacons.iter().map(|b| b.face_neg_z()).collect(); } 5 => self.rotate_all_vectors_z(), 6 => self.rotate_all_vectors_z(), 7 => self.rotate_all_vectors_z(), 8 => { self.rotate_all_vectors_z(); se...
Rust
0
id: &str, module: &Module, id: String, entry_in: EntryBuilder, ) -> Result<Entry, Error> { if module.items.get(&id).is_none() { warn!("Unable to find item '{}'", id); return unable_to_create_error("loot_list", builder_id); } let (min_qty, max_...
Rust
0
# __init__.py - collection of Swedish numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library 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 2.1 of the License, ...
Python
1
from django import forms from .models import * from django import forms from .models import EmployeeCV class EmployeeCVForm(forms.ModelForm): class Meta: model = EmployeeCV fields = ['name', 'email', 'password', 'experience', 'education', 'profile'] class CVReviewForm(forms.ModelForm): class...
Python
1
ate.g = np.tanh(np.dot(self.param.wg, xc) + self.param.bg) self.state.i = sigmoid(np.dot(self.param.wi, xc) + self.param.bi) self.state.f = sigmoid(np.dot(self.param.wf, xc) + self.param.bf) self.state.o = sigmoid(np.dot(self.param.wo, xc) + self.param.bo) self.state.s = self.state.g * s...
Python
1
near", align_corners=False) # Concatenate final output with mid-level decoder feature fused_feat = torch.cat([feat, skip_feat], dim=1) print("Shape of fused_feat:", fused_feat.shape) # 2. 三头分支 np_out = self.np_branch(fused_feat) hv_out = self.hv_branch(fused_feat) ...
Python
1
fn initialized(&self) -> bool { self.initialized } fn free_memory(&mut self) { // self.buffer = Buffer::<u8>::new(self.queue.clone(), None, 1, None).unwrap(); } } <filename>src/ui.rs #[allow(unused_imports)] use log::{debug, error, info, log, trace, warn}; use shlex; use std::{cell::RefC...
Rust
0
# -*- coding: utf-8 -*- import pygcb def CreateDBObject(): dbObj=pygcb.tcMissileDBObject() dbObj.mzClass='AS-30' dbObj.natoClass='AS-30' dbObj.mnModelType=5 dbObj.mnType=64 dbObj.cost=0.000000 dbObj.weight_kg=530.000000 dbObj.volume_m3=1.000000 dbObj.initialYear=1964.000000 dbObj...
Python
1
} } <reponame>dakv/logger #[macro_use(o)] extern crate slog; use crate::drain::DaKvFormatter; use slog::{Drain, FilterLevel, Logger, Never}; use slog_async::Async; use slog_envlogger::{EnvLogger, LogBuilder}; use slog_term::PlainDecorator; use std::io; use std::sync::Mutex; mod drain; /// ``` /// use slog::{crit, d...
Rust
0
num_reviews = document["review_count"] address = convert_address(document["location"]["display_address"]) dishes = [dish[0] for dish in document["dishes"]] phone_number = document["display_phone"] opening_hours = ( convert_hours(document["hours"][0]["open"]) if document["hours"] != "" else "" ...
Python
1
import json class FileHandler: def __init__(self, sciezka_do_pliku_z_historia, sciezka_do_pliku_z_ksiegozbiorem_i_saldem): self.plik_z_historia: str = sciezka_do_pliku_z_historia self.plik_z_ksiegozbiorem_i_saldem: str = sciezka_do_pliku_z_ksiegozbiorem_i_saldem def odczyt_danych_z_pliku_z_ks...
Python
1
if self.state_manager.is_system_speaking(): print("🔊 Wake word BLOQUEADA - sistema falando") else: status = self.state_manager.get_status() print(f"⚠️ Wake...
Python
1
state .build_queues_checked(&mem, 0, state.queues.len(), max_size) .unwrap(); // Invalid max queue size. let mut bad_q = QueueState::default(); bad_q.max_size = max_size + 1; state.queues = vec![bad_q]; state .build_queues_checked(&mem...
Rust
0
" => self.gpr[22] = val, "r23" => self.gpr[23] = val, "r24" => self.gpr[24] = val, "r25" => self.gpr[25] = val, "r26" => self.gpr[26] = val, "r27" => self.gpr[27] = val, "r28" => self.gpr[28] = val, "r29" => self.gpr[29] = val, ...
Rust
0
et3/Extras/InverseDynamics/MultiBodyNameMap.cpp") .file("bullet3/Extras/InverseDynamics/User2InternalIndex.cpp") .compile("BulletInverseDynamicsUtils"); cc::Build::new() .include("bullet3/src") .define("BulletFileLoader_EXPORTS", None) .define("BT_USE_DOUBLE_PRECISION", None...
Rust
0
; extern crate ic_types; extern crate num_traits; extern crate serde; #[macro_use] extern crate log; extern crate clap; extern crate env_logger; extern crate structopt; use structopt::StructOpt; use clap::Shell; //use candid::Decode; use ic_agent::Agent; use ic_types::Principal; use std::io; use std::time::Duration...
Rust
0
CACHE: u32 = 154u32; #[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"] pub const LDAP_OPT_SASL_METHOD: u32 = 151u32; #[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"] pub const LDAP_OPT_SCH_FLAGS: u32 = 67u32; #[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"] pub const LDAP_OPT_SECURITY_CO...
Rust
0
db=db, vc=vc, webhook_config=webhook_config, event_info=event_info) return JSONResponse(status_code=200, content={"message": "Payload received. Processing will continue."}) elif event_info["event_type"] == "live_commit": backg...
Python
1
entType, source: str, data: Optional[Dict[str, Any]] = None): """イベントを即座に発行""" event = GameEvent(event_type, source, data) self.publish(event) def _process_events(self): """キューに溜まったイベントを処理""" if self._processing: return self._processing = Tru...
Python
1
crate::Variant<u8, SDCLKFS_A> { use crate::Variant::*; match self.bits { 1 => Val(SDCLKFS_A::_1), 2 => Val(SDCLKFS_A::_10), 4 => Val(SDCLKFS_A::_100), 8 => Val(SDCLKFS_A::_1000), 16 => Val(SDCLKFS_A::_10000), 32 => Val(SDCLKFS_A::_...
Rust
0
resources.char_animations.get_template(&idle_name) { self.char_animation.set_idle_animation(animation, 3); } self.position += direction_offset; } } fn draw(&self, resources: &Resources) { clear_background(LIGHTGRAY); let tile_size = vec2( ...
Rust
0
) = start_meta_node_cluster(btreeset![0, 1, 2], btreeset![3]).await?; let all = all_tc.iter().map(|tc| tc.meta_node()).collect::<Vec<_>>(); // ensure cluster works assert_upsert_kv_synced(all.clone(), "foo").await?; // - db name to create // - expected db id let cases: ...
Rust
0
G_END_LSCH5_INT_ST`"] pub type DUTY_CHNG_END_LSCH5_INT_ST_R = crate::R<bool, bool>; #[doc = "Reader of field `DUTY_CHNG_END_LSCH4_INT_ST`"] pub type DUTY_CHNG_END_LSCH4_INT_ST_R = crate::R<bool, bool>; #[doc = "Reader of field `DUTY_CHNG_END_LSCH3_INT_ST`"] pub type DUTY_CHNG_END_LSCH3_INT_ST_R = crate::R<bool, bool>; ...
Rust
0
from django.utils import timezone from django.db import models class BaseModel(models.Model): created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(null=True, blank=True) def save(self, *args, **kwargs): if not self._state.adding: self.updated_at = tim...
Python
1
CLASS_ZMM = 25, XED_REG_CLASS_LAST = 26, } extern "C" { pub fn str2xed_reg_class_enum_t(s: *const ::std::os::raw::c_char) -> xed_reg_class_enum_t; } extern "C" { pub fn xed_reg_class_enum_t2str(p: xed_reg_class_enum_t) -> *const ::std::os::raw::c_char; } extern "C" { pub fn xed_reg_class_enum_...
Rust
0
import logging import pytest from config.config_api.config import BASE_URL from services.entity.api_client import APIClient from services.entity.entity_service import EntityService from services.entity.models.entity_model import EntityResponse @pytest.fixture def api_client() -> APIClient: """Fixture to create ...
Python
1
# Copyright (c) 2011, Joerg Raedler (Berlin, Germany) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this list # of cond...
Python
1
metadata)] #![deny(clippy::cast_lossless)] #![deny(clippy::checked_conversions)] #![warn(clippy::clone_on_ref_ptr)] #![warn(clippy::cognitive_complexity)] #![deny(clippy::debug_assert_with_mut_call)] #![deny(clippy::exhaustive_enums)] #![deny(clippy::exhaustive_structs)] #![deny(clippy::expl_impl_clone_on_copy)] #![den...
Rust
0
, down:false}, s:MazeEdge{x:0,y:0,passable:false, up:false, down:false}, w:MazeEdge{x:0,y:0,passable:false, up:false, down:false}}); } else { // some more sloppy assumptions here. Assume a . isn't on the edge of the map unless it links to a portal. let mut node = MazeNode{coord:C...
Rust
0
l, port = api_util.get_url_port(shared.opts.outside_server_url_port) folderId = _get_folderId(shared.opts.save_to_eagle_folderid, shared.opts.allow_to_create_folder_on_eagle, server_url=server_url, port=port) _ret = api_item.add_from_URL_base64( item, folderId=fol...
Python
1
) } })), ); } else if ibutton.is_some() { if !user.has_group("drink") { return ( StatusCode::UNAUTHORIZED, Json(json!({ "error": "User does not have the correct permissions", "errorCode": ...
Rust
0
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- # This example is used to check if float texture a...
Python
1
""" Various utilities for neural networks. """ import math import torch as th import torch.nn as nn # PyTorch 1.7 has SiLU, but we support PyTorch 1.5. class SiLU(nn.Module): def forward(self, x): return x * th.sigmoid(x) class SIG(nn.Module): def forward(self, x): return th.sigmoid(x) clas...
Python
1
"" character_data = cache.character_data[character_id] base_chara_hp_mp_common_settle(character_data.target_character_id, add_time, mp_value=-1, degree=1, change_data=change_data) @settle_behavior.add_settle_behavior_effect(constant_effect.BehaviorEffect.DOWN_TARGET_LARGE_HIT_POINT) def handle_sub_target_larg...
Python
1
("Unable to set the debug object name: {}", err); AscheError::VkResult(err) }) }?; Ok(()) } /// Sets a debug name for an object. #[cfg(not(debug_assertions))] pub(crate) unsafe fn set_object_name( &self, _name: &str, _object_t...
Rust
0
import psycopg2 from pet_bridge_Fosters import Fosters from pet_bridge_Pets import Pets from pet_bridge_care import Care conn = psycopg2.connect(database="PetBridge", user='postgres', password='jannetj0388', host='localhost', port='5432') conn.autocommit = True cursor = conn.cursor() print("Welcome to the PetBridge M...
Python
1
d registrants about the webinar cancellation via email. * * `false`: Do not send any email notification to webinar registrants and panelists. * * The default value of this field is `false`. */ pub async fn delete( &self, webinar_id: i64, occurrence_id: &str...
Rust
0
IDEO_H264_CHROMA_FORMAT_IDC_444: StdVideoH264ChromaFormatIdc = 3; pub const StdVideoH264ChromaFormatIdc_STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID: StdVideoH264ChromaFormatIdc = 2147483647; pub type StdVideoH264ChromaFormatIdc = ::std::os::raw::c_uint; pub const StdVideoH264ProfileIdc_STD_VIDEO_H264_PROFILE_IDC_B...
Rust
0
" mod foo { trait Trait { fn foo(&self) -> u32 {} } } fn test<T: foo::Trait>(x: T) { x.foo(); } //^ u32 "#, ); } #[test] fn super_trait_method_resolution() { check_infer( r#" mod foo { trait SuperTrait { fn foo(&self) -> u32 {} }...
Rust
0
PARAMETER_PROBLEM: otIcmp6Type = 4; #[doc = "< Echo Request"] pub const OT_ICMP6_TYPE_ECHO_REQUEST: otIcmp6Type = 128; #[doc = "< Echo Reply"] pub const OT_ICMP6_TYPE_ECHO_REPLY: otIcmp6Type = 129; #[doc = "< Router Solicitation"] pub const OT_ICMP6_TYPE_ROUTER_SOLICIT: otIcmp6Type = 133; #[doc = "< Router Advertisemen...
Rust
0
es + jake_peaches_diff\nprint(jake_peaches)\n' ), ( 'Katie had 57 new games and 39 old games. Her friends had 34 new games. How many more games does Katie have than her friends?', 'katie_new_games = 57\nkatie_old_games = 39\nfriends_new_games = 34\ntotal_katie_games = katie_new_g...
Python
1
import sys import pytest import time def run_all_suites(): """在单进程中运行所有测试套件""" # 收集所有测试套件路径 suites = [ "test_case/askSquare", "test_case/portfolioSquare", "test_case/productUser", "test_case/rankFront", "test_case/rankHomepage", "test_case/vipCard", ...
Python
1
; let mut r_t: (u32, u32) = mem::uninitialized(); let mut q_t: (u32, u32) = mem::uninitialized(); let r_all: &mut u64 = mem::transmute(&mut r_t); let q_all: &mut u64 = mem::transmute(&mut q_t); let (q_lo, q_hi) = (&mut q_t.0, &mut q_t.1); let (r_lo, r_hi) = (&mut r_t.0, &mut r_t.1); match ...
Rust
0
.fmt(f) } } <filename>src/msg.rs use cosmwasm_std::Addr; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::state::{GameMove, Match}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct InstantiateMsg { pub admin: Option<String>, } #[derive(Serialize, Des...
Rust
0