text
string
label_name
string
labels
int64
# Dicionarios # Utiliza index no formato de Keys e Values # Aceita string, integer, float, boolean... # Armazenar mais de uma informação em variáveis # Manter a sequencia dos dados em uma variável # Permite adicionar, remover e alterar dados # Indexação: Utilizar números para acessar os dados ...
Python
1
ses.Default.ReturnCode = 0 self._configure_client_output_expectations(tr.Processes.Default) tr.StillRunningAfter = self._server tr.StillRunningAfter = self._ts def run_cases_expecting_no_transformation(self): tr = Test.AddTestRun(f"Verify the ESI plugin does not transform responses:...
Python
1
from django.urls import path , include from . import views from django.conf import settings from django.conf.urls.static import static from django.urls import path from .views import list_properties urlpatterns = [ # path('', views.apiOverview, name='apiOverview'), path('property-list/', views.ShowAll, name...
Python
1
velocity_limit_sim=32.0, joint_names_expr=["waist_yaw_joint"], stiffness=STIFFNESS_7520_14, damping=DAMPING_7520_14, armature=ARMATURE_7520_14, ), "arms": ImplicitActuatorCfg( joint_names_expr=[ ".*_shoulder_pitch_joint",...
Python
1
var_os("DEBUG").is_some() { info(msg); } } fn info(msg: impl Into<String>) { get_active_span(|span| { span.add_event(msg.into(), Default::default()); }); } fn function_span<T, F>(name: &'static str, arg1: u64, f: F) -> T where F: FnOnce() -> T, { let tracer = global::tracer(TRACER_...
Rust
0
().pushMessage( tr('Sorry, the field \'{fieldname}\' is empty for this entity.' .format(fieldname=field)), level=Qgis.MessageLevel.Warning, duration=7) else: if field in ['url', 'website', 'wikipedia', 'wikidata']: url = None ...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class ResPartner(models.Model): _inherit = 'res.partner' property_delivery_carrier_id = fields.Many2one('delivery.carrier', company_dependent=True, string="Delivery Method", help="Default delivery meth...
Python
1
4581, 0x9f, 0xf3, 0x61, 0x02, 0x7a, 0x8f, 0xe5, 0x32)] interface IKsJackSinkInformation(IKsJackSinkInformationVtbl): IUnknown(IUnknownVtbl) { fn GetJackSinkInformation( pJackSinkInformation: *mut KSJACK_SINK_INFORMATION, ) -> HRESULT, }} RIDL! {#[uuid(0xc99af463, 0xd629, 0x4ec4, 0x8c, 0x00, 0xe5, 0x4d, ...
Rust
0
def solution(s): open_parenthesis = 0 max_depth = 0 for ch in s: if ch == "(": open_parenthesis += 1 if ch == ")": open_parenthesis -= 1 max_depth = max(open_parenthesis, max_depth) return max_depth def main(): test_cases = [["(1+(2*3)+((8)/4))+1",...
Python
1
::Convert, //winapi::VK_NONCONVERT => events::VirtualKeyCode::Nonconvert, //winapi::VK_ACCEPT => events::VirtualKeyCode::Accept, //winapi::VK_MODECHANGE => events::VirtualKeyCode::Modechange, winapi::VK_SPACE => events::VirtualKeyCode::Space, winapi::VK_PRIOR => events::VirtualKe...
Rust
0
] } #[cfg(test)] mod tests { use super::*; #[test] fn fuel_needed_for_mass_12() { assert_eq!(fuel_needed_for(&12), 2); } #[test] fn fuel_needed_for_mass_14() { assert_eq!(fuel_needed_for(&14), 2); } #[test] fn fuel_needed_for_mass_1969() { assert_eq!(fuel...
Rust
0
# Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """Monitor GPU memory hook.""" from __future__ import annotations from typing import TYPE_CHECKING, Any from lightning.pytorch.callbacks.callback import Callback if TYPE_CHECKING: from lightning import LightningModule, Trainer class...
Python
1
] installing VEH") _installed = True @HANDLERFUNC def handler(exception_pointers): rec = exception_pointers.contents.ExceptionRecord.contents if rec.ExceptionCode == EXCEPTION_ACCESS_VIOLATION: _debug("[wincrash] VEH handler triggered") result = b"" for (...
Python
1
import shap import matplotlib.pyplot as plt import os import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from xgboost import XGBClassifier from keras.models import Model def explain_with_shap(model, X,...
Python
1
ck.patch.object(current_org_shape, "org_config", org_config): yield org_config def _create_org(org_name: str, config_name: str, flow_name: str = None): runtime = CliRuntime(load_keychain=True) try: org, org_config = runtime.get_org(org_name) except OrgNotFound: org = None if or...
Python
1
)]; TOO_SHORT); check!("p", [fix!(LowerAmPm)]; TOO_SHORT); check!("x", [fix!(LowerAmPm)]; TOO_SHORT); check!("xx", [fix!(LowerAmPm)]; INVALID); check!("", [fix!(LowerAmPm)]; TOO_SHORT); // fixed: dot plus nanoseconds check!("", [fix!(Nanosecond)]; ); // no field set, but no...
Rust
0
# 1423 - [Job Adv] (Lv.30) Path of the Bandit darkMarble = 4031013 job = "Bandit" monster = "Swamp Monster" sm.setSpeakerID(1052001) # Dark Lord sm.sendNext("You wish to become a #b"+ job +"#k?\r\n\r\n" "A #b"+ job +"#k is specialised in short range attacks and use #bdaggers#k to defeat their enemies." ...
Python
1
r.email": "<EMAIL>" } } } } "# .to_string(); let config = common::from_string(&string); test_gardens(&config); } fn test_gardens(config: &garden::model::Configuration) { assert!(config.gardens.len() >= 2); // "cola" garden assert_eq!("cola", config.gardens[0].get_n...
Rust
0
from . import chinese, english, chinese_mix from . import cleaned_text_to_sequence import copy language_module_map = {"ZH": chinese, "EN": english, 'ZH_MIX_EN': chinese_mix} def clean_text(text, language): language_module = language_module_map[language] norm_text = language_module.text_normalize(text) ph...
Python
1
static ref PORT: Mutex<u16> = Mutex::new(30000); } fn get_config() -> Fallible<Config> { Ok(Config::from_file(&format!("../{}", CONFIG_FILENAME))?) } fn get_next_port() -> u16 { let mut port = PORT.lock().unwrap(); *port += 1; *port } pub fn create_testserver() -> Fallible<Url> { // Prepare th...
Rust
0
one, Debug, Hash, PartialEq, PartialOrd)] pub struct ScreenSpaceRect { /// min: Position on screen to render, in pixels from top-left. Defaults to (0, 0). pub min: ScreenSpaceXY, /// max: Max (width, height) bounds, in pixels from top-left. Defaults to unbounded. pub max: ScreenSpaceXY, } d!(for ...
Rust
0
0@\x00\x01\x04\x10x\x92\x02z\x1a\xfb$\ \x9b\xa3-\x04\x10@\x00\x01\x04\x10xB\x024\x83\x00\ \x02\x08 \x80@\xb1\x80\xbeU*\x81.\xd0wG\xc5\ \xd32\xa7\xc9j2\x9a6M\xb3\xa6As[\xa4\xf5\ \xba\xb4\x7f\xea\xc7y\xc9f\xcfJ.wJsB\x5c\ \xf7\xa8\xe6\xb0\xe6\xa0\x88\xb7O<\xaf\xbe3\xa2\xd3\xe2\ \xd5\xe9\xf2:]fS\xabe{\xd2^\xad4\xa5\xeb\ \x...
Python
1
_improvement, onchange=|s| Msg::UpdateMaxGenNoImprove(s), type="number", min="0", required="",/> </div> </div> }; let row3 = html! { <div class="pure-u-1", style="text-align: center",...
Rust
0
unwrap_or(None) } /// A trie root formed from the enumerated items. // TODO: remove (just use `ordered_trie_root`) pub fn enumerated_trie_root<H>(input: &[&[u8]]) -> H::Out where H: Hasher, H::Out: Ord, { trie::ordered_trie_root::<H, _, _>(input.iter()) } /// A trie root formed from the iterated items. pub fn trie...
Rust
0
from pep600_compliance.images import base, package_manager class OpenSUSE(base.Base): def __init__( self, image, eol, packages, machines, version=None, skip_lib=frozenset() ): if version is None: _, version = image.split(":") self._packages = packages super().__init...
Python
1
&Config) -> Result<()> { self.connect_wss(WebsocketAPI::Custom(config.ws_endpoint.clone()).params(subscription)) } pub fn connect_multiple_streams(&mut self, endpoints: &[String]) -> Result<()> { self.connect_wss(WebsocketAPI::MultiStream.params(&endpoints.join("/"))) } fn connect_wss...
Rust
0
E_U, ) .expect("inituvm: mappage"); ptr::copy(src.as_ptr(), mem, src.len()); } /// Allocate PTEs and physical memory to grow process from oldsz to /// newsz, which need not be page aligned. Returns Ok(new size) or Err(()) on error. pub unsafe fn uvmalloc(&mut self, mut oldsz: u...
Rust
0
code and error message. pub(crate) fn error_response(error: HttpError, status: StatusCode) -> Response { let mut response = Response::new(Version::Http11, status); let err_msg = ErrorMessage { code: "UNDEFINED".to_string(), message: format!("{:?}", error), }; response.set_body(Body::new...
Rust
0
> {} impl<F: IFunc, T: IOpaqueShape> IOpaqueShape for Fold<F, T, OpaqueMarker> {} impl<F: IFunc, T: ITransparentShape> ITransparentShape for Fold<F, T, TransparentMarker> {} impl<F: IFunc, T: MakeExpr, M: ITypeMarker> MakeExpr for Fold<F, T, M> { fn make_expr(&self, ctx: &Context, func: &mut glsl::Function) -> gls...
Rust
0
stores_carts(&self, store_id: &str, cart_id: &str) -> Result<()> { let url = format!( "/ecommerce/stores/{}/carts/{}", crate::progenitor_support::encode_path(&store_id.to_string()), crate::progenitor_support::encode_path(&cart_id.to_string()), ); self.client....
Rust
0
an and the Sea"); index_writer.add_document(doc!( isbn => "978-0099908401", title => "The old Man and the see" )); index_writer.add_document(doc!( isbn => "978-0140177398", title => "Of Mice and Men", )); index_writer.add_document(doc!( title => "Frankentein", ...
Rust
0
videos.append({ "vod_id": vod_id, "vod_name": title, "vod_pic": img, "vod_remarks": desc, "vod_content": content, # 无用参数 }) except Exc...
Python
1
ChrTalk( 0x0103, ( '#0030490009V#020F嗯,是这样的。', TxtCtl.Enter, TxtCtl.Clear, '#0030490010V据说有需要护卫到拉文努村\n', '的任务,是吧?', TxtCtl.Enter, ), ) CloseMessageWindow() Jump('loc_396') def _loc_32C(): pass label...
Python
1
clone(); game.one.truncate(a as usize); game.two.truncate(b as usize); recurse(&mut game) } else { b > a }; if winner { game.two.push_back(b); game.two.push_back(a); } else { game.one.push_back(a); ...
Rust
0
class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: def findFirst(nums, target): left, right = 0, len(nums) - 1 while left <= right: mid = left + (right - left) // 2 if nums[mid] == target: if mid == 0 ...
Python
1
status=BatchStatus.RUNNING, start_time=datetime.now(), total_batches=1, # 並行處理不需要批次概念 active_workers=0, cache_hits=0, incremental_updates=0 ) mode_text = "測試模式" if stock_list is not None else "正式模式"...
Python
1
# taking seller manager choice manager_seller_choice=input("Dear Seller manager Please Enter Desirable choice:").strip() # calling the mehtod according to the choice if manager_seller_choice=="1": print() self.see_all_sellers_accounts() el...
Python
1
]; assert_eq!(v.len(), 3); let mut cnt = 0; for v.iter().advance |f| { assert!(*f == Foo); cnt += 1; } assert_eq!(cnt, 3); for v.slice(1, 3).iter().advance |f| { assert!(*f == Foo); cnt += 1; } assert_eq!(c...
Rust
0
l.provider_name in preferred_providers: score += 20 # 2. 模型类型匹配 (+20分,reasoning任务强烈偏好think模型) if task_type == "reasoning" and model.model_type == ModelType.THINK.value: score += 20 # reasoning任务优先选择think模型 logger.debug(f"reasoning任务匹配...
Python
1
# 조건에 맞게 수열 변환하기 3 # https://school.programmers.co.kr/learn/courses/30/lessons/181835 def solution(arr, k): return [i * k if k % 2 != 0 else i + k for i in arr] # l로 만들기 # https://school.programmers.co.kr/learn/courses/30/lessons/181834 def solution(myString): return "".join([i if i > "l" else "l" for i in my...
Python
1
pub remark: u32, /// Current score. pub score: u64, /// `AccountId` of `pathfinder`. pub pathfinder: AccountId, /// The current state of challenge. pub status: ChallengeStatus, /// The `AccountId` of challenger. pub challenger: AccountId, } impl<AccountId, BlockNumber> Metadata<...
Rust
0
::<T>(); } Matrix { no_rows : no_rows, data : d } } } impl<'a, T : Neg<Output = T> + Copy> Neg for &'a Matrix<T> { type Output = Matrix<T>; fn neg(self) -> Matrix<T> { let elems = self.data.len(); let mut d = alloc_dirty_vec(elems); for i in 0..elems { d[i] = - self.data[i] } M...
Rust
0
import unittest from tokenizer import Tokenizer from tokenizer_ext import ( encode_text_parallel, decode_text_parallel, batch_encode_parallel, batch_decode_parallel, ) class TestParallelTokenizer(unittest.TestCase): def setUp(self): self.tokenizer = Tokenizer() self.pad_token_id ...
Python
1
let range = Range { max_exclusive: &max_exclusive, sampling_params: &sampling_params, }; // Test that a generated zero is rejected and that `sample_into_limbs` // gives up after a while of only getting zeros. { let mut result = [0, 0]; as...
Rust
0
let scalar_ = scalar_.clone(); Box::new(move |_: Pass, y_: Val<_>, _state: RefMut<_>, sink: &mut Sink| { if let Some(adj_y_) = y_.adjoint(sink) { let adj_x_ = FlatBroadcastMultiplyOp::build_device_f32_op(adj_y_.clone(), scalar_.clone()); x_.put_adjoint(adj_x_, sink); ...
Rust
0
#!/usr/bin/env python3 """ QuantRS2のGPUサポートを確認するスクリプト """ import sys import traceback def check_gpu_support(): """QuantRS2のGPUサポートを確認します""" try: # まずネイティブモジュールをインポート import _quantrs2 as qr print("_quantrs2モジュールを正常にインポートしました") # GPUサポートを確認 try: ...
Python
1
from app.extensions import db class Sale(db.Model): id = db.Column(db.Integer, primary_key=True) Staff_id = db.Column(db.String, db.ForeignKey('users.id'), nullable=False) Date = db.Column(db.Date, nullable=False) Tax = db.Column(db.Float, nullable=True) Discount = db.Column(db.Float, nullable=True...
Python
1
> { TestBackend::wrap(service) } // Disable some unhelpful warnings #![allow(unused_imports)] #![allow(dead_code)] #![allow(unused_variables)] #![allow(unused_mut)] // Some basic includes to alwawys include use itertools::Itertools; use std::collections::{HashMap, HashSet, VecDeque}; use crate::*; pub fn part1(l...
Rust
0
in keystrokes.chunks(10) { self.raw_cmd(U64CommandID::Keyb, data)?; } Ok(()) } pub fn dumpmem<T: AsRef<path::Path>>(&self, name: T) -> anyhow::Result<()> { let reply = self.raw_cmd_rx(U64CommandID::ReadMem, &[0_u8; 0])?; let mut f = File::create(name)?; f.wr...
Rust
0
impl<'input, Node: ParserNodeType<'input>, Visitor: ParseTreeVisitor<'input, Node> + ?Sized> Visitable<Visitor> for TerminalNode<'input, Node> { fn accept(&self, visitor: &mut Visitor) { visitor.visit_terminal(self) } } /// # Error Leaf /// Created for each token created or consumed during recovery pub type E...
Rust
0
= "0x440 - Debug RAF, WAF, TDF levels"] pub fifo_levels: FIFO_LEVELS, #[doc = "0x444 - Abort an in-progress transfer sequence on one or more channels"] pub chan_abort: CHAN_ABORT, #[doc = "0x448 - The number of channels this DMA instance is equipped with. This DMA supports up to 16 hardware channels, b...
Rust
0
# richard -- video index system # Copyright (C) 2012, 2013, 2014, 2015 richard contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
Python
1
le to read data from the end of the steady state step analysis # field_output = odb.steps['Step-1'].frames[-1].fieldOutputs['MFL'] # ivol = odb.steps['Step-1'].frames[-1].fieldOutputs['IVOL'] # values_at_integration_points = field_output.values # values_at_integration_pointsB = ivol.values # #Creating a readable out...
Python
1
~ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | //~ |:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:| //~ | r0 | r1 | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 | r10 | r11 | r12 | r13 | r14 | let rc = coeff(idx); ...
Rust
0
# hsrp parameters ng_order = (3072,) _ng_const = ( # 3072 ( """\ FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08\ 8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B\ 302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9\ A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6\ 492866...
Python
1
# -*- coding: utf-8 -*- from dataclasses import dataclass from sharc.parameters.parameters_base import ParametersBase @dataclass class ParametersRns(ParametersBase): """ Simulation parameters for radionavigation service """ section_name: str = "rns" # x-y coordinates [m] x: float = 660.0 ...
Python
1
cosh(d) - isin(a)sinh(b)kcosh(c)sinh(d)) // // (sin(a)cosh(b)cosh(c)cosh(d) - isin(a)cosh(b)sinh(c)sinh(d) + icos(a)sinh(b)cosh(c)cosh(d) - iicos(a)sinh(b)sinh(c)sinh(d)) // + (jcos(a)cosh(b)sinh(c)cosh(d) + kcos(a)cosh(b)cosh(c)sinh(d) - ijsin(a)sinh(b)sinh(c)cosh(d) - iksin(a)sinh(b)cosh(c)...
Rust
0
train_set, batch_size=batch_size, shuffle=True, worker_init_fn=tools.worker_init, **kwargs) arch = supervisor.get_arch(args) if args.poison_type == 'TaCT': source_classes = [config.source_class] else: source_classes = None model = arch(num_classes=num_classes) model = nn.DataParallel(model) model = m...
Python
1
eyboardInterrupt: raise except: if not ignore_errors: raise # Singleton object. the_coverage = coverage() # Module functions call methods in the singleton object. def start(*args, **kw): return apply(the_coverage.start, args, kw) def stop(*args, **kw): ...
Python
1
import pytest from plenum.test.conftest import getValueFromModule from plenum.test.node_catchup.helper import waitNodeDataEquality from plenum.test.primary_selection.helper import check_newly_added_nodes, \ getPrimaryNodesIdxs from plenum.test.pool_transactions.conftest import sdk_node_theta_added_fixture def sd...
Python
1
tch *self { LineEnding::LF => 1, LineEnding::CRLF => 2 } } } #[derive(Clone, Copy, Debug)] pub enum LineWrap { NoWrap, // wrap length is always > 0 Wrap(usize, LineEnding) } /// Contains configuration parameters for base64 encoding #[derive(Clone, Copy, Debug)] pub stru...
Rust
0
error!("Name={}, detailMessage={}", cls_name, detail_message); } } pub mod collection; pub mod movie; net.sf.jasperreports.crosstabs.fill.calculation.MeasureDefinition net.sf.jasperreports.crosstabs.fill.calculation.MeasureDefinition$1 net.sf.jasperreports.crosstabs.fill.calculation.MeasureDefinition$MeasureValue <...
Rust
0
})); let mut map = ::std::collections::HashMap::new(); map.insert("method", command); let client = Client::new().unwrap(); let address = format!("http://{}:{}", connect, port); client.post(&address) .headers(headers) .json(&map) .send() } fn get_json_response(command: &str...
Rust
0
.1.5.19 - icmpOutSrcQuenchs // 1.3.6.1.2.1.5.20 - icmpOutRedirects // 1.3.6.1.2.1.5.21 - icmpOutEchos // 1.3.6.1.2.1.5.22 - icmpOutEchoReps // 1.3.6.1.2.1.5.23 - icmpOutTimestamps // 1.3.6.1.2.1.5.24 - icmpOutTimestampReps // 1.3.6.1.2.1.5.25 - icm...
Rust
0
t(SDL_INIT_VIDEO); // 0 for success, negative for error assert_eq!(0, SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4)); assert_eq!(0, SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 6)); assert_eq!(0, SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE.0 as _)); // ma...
Rust
0
mm256_andnot_pd(self.value.0, other.value.0), _mm256_andnot_pd(self.value.1, other.value.1), ) }) } const FULL_BITMASK: u16 = 0b11111111; #[inline(always)] fn bitmask(self) -> u16 { unsafe { let low = _mm256_movemask_pd(self.value.0) as u16; ...
Rust
0
import enum class RatingEnum(int, enum.Enum): ONE = 1 TWO = 2 THREE = 3 FOUR = 4 FIVE = 5 SIX = 6 SEVEN = 7 EIGHT = 8 NINE = 9 TEN = 10 class LanguageEnum(str, enum.Enum): RUS = 'Русский' ENG = 'Английский' class MediaTypeEnum(str, enum.Enum): IMAGE = 'image' ...
Python
1
return try: target_library_key = LibraryLocatorV2.from_string(target_key_string) target_collection_slug = None except InvalidKeyError: try: target_collection_key = LibraryCollectionLocator.from_string(target_key_string) tar...
Python
1
from __future__ import annotations import enum # See chia/wallet/puzzles/condition_codes.clib class ConditionOpcode(bytes, enum.Enum): # AGG_SIG is ascii "1" # the conditions below require bls12-381 signatures AGG_SIG_PARENT = bytes([43]) AGG_SIG_PUZZLE = bytes([44]) AGG_SIG_AMOUNT = bytes([45]...
Python
1
dSelectionOrder, UiEvent, UiEventType}; // TODO: If none selected and there is a Selectable in the World, select the lower ordered one automatically? /// Component indicating that a Ui entity is selectable. /// Generic Type: /// - G: Selection Group. Used to determine which entities can be selected together at the sa...
Rust
0
if "detect_usage" in data: used = data["detect_usage"](self) else: used = self.module.params.get(option) is not None if used and "default" in self.module.argument_spec[option]: used = ( ...
Python
1
(verbose_name='HTTP请求的头信息,json格式')), ('url', models.CharField(max_length=250, verbose_name='HTTP请求的URL,也就是接口路径')), ('params', models.TextField(verbose_name='HTTP请求的参数,urlencode格式或者json格式')), ('bodyType', models.CharField(choices=[('form-data', '表单提交'), ('x-www-form-urlenc...
Python
1
ide = 16 self.write_reg(ApicReg::LVTTimer, TIMER_VEC as u32); // Enable Timer self.write_reg(ApicReg::LVTThermalSensor, 0); // "Disable" Thermal Sensor self.write_reg(ApicReg::LVTPermCounters, 0); // "Disable" ? Counters self.write_reg(ApicReg::LVT_LINT0, 0); // "Disable" LINT0 self.write_reg(ApicReg::LVT_LIN...
Rust
0
same thing. #[test] fn double_vote_some_vals_repeat() { let v1 = vec![0, 1, 2, 3, 4, 5, 6]; let v2 = vec![0, 2, 4, 6]; let v3 = vec![1, 3, 5]; let att1 = indexed_att(&v1, 0, 1, 0); let att2 = indexed_att(&v2, 0, 1, 1); let att3 = indexed_att(&v3, 0, 1, 0); let slashings = hashset![att_slash...
Rust
0
ode for that caption, and if a label is provided, adds the latex code for a label. The size is the vertical size of each row of subfigures as a fraction. See Also ======== to_latex Nwriter)rypathoptionss r^rrr JJx*'*+r r r r r ror ...
Python
1
raw::c_int, ), >; extern "C" { pub fn PhidgetGPS_setOnPositionFixStateChangeHandler( ch: PhidgetGPSHandle, fptr: PhidgetGPS_OnPositionFixStateChangeCallback, ctx: *mut ::std::os::raw::c_void, ) -> PhidgetReturnCode; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _PhidgetGyrosc...
Rust
0
c.sticky["gismo_check"].versionDate(ghenv.Component) if validVersionDate: gismo_preparation = sc.sticky["gismo_Preparation"]() locationStr_current = RhinoEarthAnchorPt(location_) locationName, latitude, longitude, timeZone_dumm, elevation_dumm = gismo_preparation.deconstructLocation...
Python
1
feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[derive(Copy, Clone)] pub struct FluidWidget { enabled: bool, /// The fluid configurations pub fluid_configs: FluidConfigs, } impl Default for FluidWidget { fn default() -> Self { Self { enabled: true, fl...
Rust
0
= di.currently_delayed.get(0) { if app.primary.sim.time() - *t > di.halt_limit { let id = ID::Intersection(*i); app.primary.layer = Some(Box::new(crate::layer::traffic::TrafficJams::new(ctx, app))); ...
Rust
0
import os sep = "/" def normcase(s): return s def normpath(s): return s def abspath(s): if s[0] != "/": return os.getcwd() + "/" + s return s def join(*args): # TODO: this is non-compliant if type(args[0]) is bytes: return b"/".join(args) else: return "/".join(a...
Python
1
io::Result<()> { match self.data { Data::Text(ref text) => writer.write_text(&self.name, text), Data::File(ref path) => writer.write_file(&self.name, path), Data::Stream(ref mut stream) => writer.write_stream( &mut stream.stream, ...
Rust
0
_from_usage( " --unordered 'Channel is unordered' <connection-identifier> 'The connection identifier of demo chain' <port-identifier> 'The identifier of port' <counterparty-port-identifier> 'The identifier of port on counterparty chain' ", )]) .subcommands(vec![SubCommand::with_name(...
Rust
0
string(), "1:31"); assert_eq!(Hours(dec!(10)).to_string(), "10:00"); } } <filename>src/gl_context_wgl.rs /* * Copyright 2015 The Servo Project Developers * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ extern crate glutin; use gl_rasterizatio...
Rust
0
import random from io import BytesIO from collections import Counter from typing import TypedDict from clovers_sarof.core.linecard import text_to_image from ..action import place, Event from ..core import Session as BaseSession, to_int game = "恶魔轮盘" place.info[game] = "向自己开枪|向对方开枪|使用道具 xxx" class SessionData(TypedDi...
Python
1
num_classes).round().clamp_(0, num_classes-1).cuda().long() for i in range(10): optimizer.zero_grad() with autocast(): skips = unet.encoder(dummy_input) print([i.shape for i in skips]) output = unet.decoder(skips)[0] l = loss(output, dummy_gt) ...
Python
1
find_object(self, id) } fn try_find_object(&self, id: impl Into<ObjectId>) -> Result<Option<ObjectRef<'_, Self>>, object::find::Error> { try_find_object(self, id) } } mod liquidity_verify; mod swap_verify; mod utils; use alloc::vec::Vec; use core::result::Result; // Import CKB syscalls an...
Rust
0
class ClinicalAssessment: """ TODO: fill in types of clinical assessments. """ pass
Python
1
x03\ \xb4w\xcd\xc1`\xf4@\x15\x02\xecWA\xcf\x0b\xbb&\ \xbd{9^z\xc2\xf1R\x8c\xc5\xaa\xfb\x0f\xe0\xab?\ \xf5\xdb\x7f\xe6W\xf8\x03P\x1f\xd8V\xca\xb6\xfd\xb98\ \xd1T\x9f\x00t\x99]l;#\x0f\xc2s\x13Yf\ 0\x14\xe8\x1a\x9c\x84V4\xf6m\xc8\xba:\xab\x0a\x7f\ \xf1\xd1\xdd\xb6}&\x9a\x96\x9c\xc4\xd0t\x0fZz\x87\ \xe6\xcfc\xb2.\xdc\xe6\x...
Python
1
_win(board: [[char; 3]; 3]) -> GameState { // check for win for (i, row) in board.iter().enumerate() { if row[0] == row[1] && row[0] == row[2] { return which_win(row[0]); } else if board[0][i] == board[1][i] && board[0][i] == board[2][i] { return which_win(board[0][i]); ...
Rust
0
from ...error import GraphQLError from ...utils.type_comparators import do_types_overlap from ...utils.type_from_ast import type_from_ast from .base import ValidationRule # Necessary for static type checking if False: # flake8: noqa from ...language.ast import Field, InlineFragment from typing import Any, Lis...
Python
1
# Este programa es un juego de trivia de capitales de algunos paises en el mundo # las 2 integrantes de este equipo somos: # Marcela Kristel Ensaldo Renteria y # Elsie Vanessa Ensaldo Renteria # Para importar el módulo random import random # Definimos la función principal para correr el juego def juego_trivia(): ...
Python
1
poll_read() } fn read(&mut self) -> Poll<Frame<Self::Out, Self::BodyOut, Self::Error>, io::Error> { self.upstream.read() } fn poll_write(&mut self) -> Async<()> { if self.buffer.is_none() { return Async::Ready(()); } Asyn...
Rust
0
_data[index + 1]; let b_color = palette_data[index + 2]; if r_color == 0 && g_color == 0 && b_color == 255 { image_bgra_data.push(0); image_bgra_data.push(0); image_bgra_data.push(0); image_bgra_data.push(0); } else { ...
Rust
0
t collected //! enough entropy yet. To avoid returning low-entropy bytes, we first read from //! `/dev/random` and only switch to `/dev/urandom` once this has succeeded. //! //! # Error handling //! //! We always choose failure over returning insecure "random" bytes. In general, //! on supported platforms, failure is h...
Rust
0
"dnssec")] use crate::client::{ proto::rr::dnssec::rdata::key::KEY, rr::dnssec::{DnsSecResult, SigSigner, SupportedAlgorithms}, rr::Name, }; use crate::{ authority::{LookupError, MessageRequest, UpdateResult, ZoneType}, client::rr::{LowerName, RecordSet, RecordType}, proto::rr::RrsetRecords, ...
Rust
0
extern crate webkit2gtk; use gtk::prelude::*; use gio::prelude::*; use glib::clone; use gtk::{Application, Builder, ApplicationWindow, Button, Box}; use webkit2gtk::{ WebView, WebViewExt, WebContextExt, CookieManagerExt, CookiePersistentStorage, SecurityOrigin, NotificationExt }; use std::env; use std::path::Path; use...
Rust
0
ApiResponse::from(res) } #[derive(Deserialize)] pub struct CreateOrganizationReportRequest { comments: String, term_start_date: chrono::NaiveDateTime, } #[post("/<org_id>/reports", format = "application/json", data = "<report_form>")] pub fn create_organization_report( org_id: i32, report_form: Js...
Rust
0
ax.get_legend_handles_labels() ax.legend( handles, labels, loc="upper center", bbox_to_anchor=(0.5, -0.15), ncol=3, title="Ratings" ) # Adjust layout to prevent cutting off the bottom plt.tight_layout() # Save the figure graph_dir = "matplot...
Python
1
from unittest import mock import tools.codex_pipeline as pipeline class DummyResponse: def __init__(self, code: int, body: str) -> None: self._code = code self._body = body def getcode(self) -> int: # pragma: no cover - used by urlopen return self._code def read(self) -> bytes:...
Python
1
import pytest from aphrodite.processing.scheduler import Scheduler from aphrodite.engine.args_tools import EngineArgs from aphrodite.engine.aphrodite_engine import AphroditeEngine from aphrodite.common.sampling_params import SamplingParams from aphrodite.v1.core.sched.scheduler import Scheduler as V1Scheduler from aph...
Python
1