text
string
label_name
string
labels
int64
expected = { "nic0": "fa:16:3e:05:30:fe", "enp0s1": "fa:16:3e:69:b0:58", "enp0s2": "fa:16:3e:d4:57:ad", } assert expected == config_name2mac # We should, however, warn the user that we don't recognise the type assert ( "Unknown network_d...
Python
1
# bambot/docker_utils.py import os import docker from tqdm import tqdm def build_image(container_dir): """Build a Docker image for an AI agent""" docker_client = docker.from_env() image, _ = docker_client.images.build(path=container_dir, tag=f"{os.path.basename(container_dir)}:latest", dockerfile="Dockerfi...
Python
1
_embeddings, src_embeddings, tgt_emb_idx_map, src_emb_idx_map, alpha, comparator_model, symmetrize_comparator, ) return best_blended_neighbor_x2y, best_blended_neighbor_y2x def fastmax_retrieval( neighbors_x2y: Neighbors, neig...
Python
1
erialize, Debug, Clone)] #[doc = "Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization"] pub struct TestProxy { #[doc = "Proxy server IP address"] pub server: String, #[doc = "Proxy server port"] pub port: i32, ...
Rust
0
json, std::path::PathBuf, }; #[derive(FromArgs, Debug, PartialEq)] /// Various operations on packages, package repositories, and the package cache. pub struct Args { #[argh(subcommand)] pub command: Command, } #[derive(FromArgs, Debug, PartialEq)] #[argh(subcommand)] pub enum Command { Resolve(Resolve...
Rust
0
Linux" => mapping.platform = Platform::Linux, "platform" if value == "Mac OS X" => mapping.platform = Platform::Mac, "platform" if value == "Android" => mapping.platform = Platform::Android, "platform" if value == "iOS" => mapping.platform = Platform::IOS, ...
Rust
0
yield BIN_INT32 yield key + BIN_NONE yield int32.pack(value) else: raise TypeError("Unsupported type: %s" % type(value)) yield BIN_END if not alt_format else BIN_END_ALT def vbkv_loads(s, mapper=dict, merge_duplicate_keys=True): """ Deserialize ``s`` (...
Python
1
logit = resize( input=seg_logit, size=seg_label.shape[2:], mode='bilinear', align_corners=self.align_corners) if self.sampler is not None: seg_weight = self.sampler.sample(seg_logit, seg_label) seg_label = seg_label.squeeze(1) loss['los...
Python
1
""" Basic test for reference manager service """ import asyncio from services.reference_manager_service import ( ReferenceManagerService, BibliographicData, AuthCredentials, ReferenceManagerType ) def test_basic_functionality(): """Test basic service functionality""" service = ReferenceManager...
Python
1
from __future__ import annotations from functools import wraps from typing import Callable from .spec import Table def table_defaults(*, gap_x: int | None = None, gap_y: int | None = None): """Decorator to enforce/override default gaps on a Table factory. Example: @table_defaults(gap_x=16, gap_y=12) ...
Python
1
ut cursor)?; Ok((header, order)) } /// Read without checking for endianness. pub fn read<T: Read>(reader: &mut T) -> io::Result<Self> { let mut header = Header::default(); reader.read_exact(header.magic.as_mut())?; header.clock_rate = reader.read_u32::<BigEndian>()?; ...
Rust
0
from llama_index.llms.replicate.base import Replicate __all__ = ["Replicate"]
Python
1
Ok((s, (k, v))) } fn uint_range_parse(s: &str) -> IResult<&str, Node> { let (s, _) = multispace0(s)?; let (s, _) = tag("range")(s)?; let (s, _) = multispace1(s)?; let (s, v) = double_quoted_string(s)?; let (_, r) = range_uint_parse(v)?; let (s, _) = multispace0(s)?; let (s, _) = char(';')(s...
Rust
0
}} "#, email, password )) .reply(&server); let json: Value = serde_json::from_str(str::from_utf8(res.body()).unwrap()).unwrap(); let token = &json["data"]["login"].as_str().unwrap(); let claims = (tokeniser.verify)(token).unwrap(); assert_eq!(res.status(), 200); assert_eq!(claims....
Rust
0
0 | 1 | 2 => { enemy_kind = kindvec[0]; }, 3 => { enemy_kind = kindvec[1]; }, 4 => { enemy_kind = kindvec[2]; }, _ => {printl...
Rust
0
} else { Err("Exceeds maximum value") } } #[inline(always)] fn from_usize_or_none(value: usize) -> Result<Self, &'static str> { if value <= Self::Maximum as usize { Ok(value as Self) } else { Err("Exceeds maximum value") } } } } } unsig...
Rust
0
)?)), } } } impl AscIndexId for Array<bool> { const INDEX_ASC_TYPE_ID: IndexForAscTypeId = IndexForAscTypeId::ArrayBool; } impl AscIndexId for Array<Uint8Array> { const INDEX_ASC_TYPE_ID: IndexForAscTypeId = IndexForAscTypeId::ArrayUint8Array; } impl AscIndexId for Array<AscPtr<AscEnum<EthereumV...
Rust
0
}", "vse256.v v16, (t0)", in (reg) p); } 512 => { rvv_asm!("mv t0, {0}", "vse512.v v16, (t0)", in (reg) p); } 1024 => { rvv_asm!("mv t0, {0}", "vse1024.v v16, (t0)", in (reg) p); } _ => { panic!("Inva...
Rust
0
from __future__ import annotations from dataclasses import dataclass from typing import Literal, Optional import numpy as np from ngboost import NGBRegressor from ngboost.distns import LogNormal, Gamma, Normal from sklearn.tree import DecisionTreeRegressor from ngboost.scores import CRPScore SUPPORTED = {"lognormal": ...
Python
1
from starlette.requests import Request def get_ipaddr(request: Request) -> str: """ Returns the ip address for the current request (or 127.0.0.1 if none found) based on the X-Forwarded-For headers. Note that a more robust method for determining IP address of the client is provided by uvicorn's ...
Python
1
""" Sets the ssl_secret_id of this ModifyPluggableDatabaseManagementDetails. The `OCID`__ of the Oracle Cloud Infrastructure `secret`__. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm __ https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyo...
Python
1
ss), self.interpreter) } bir::PlaceData::Intrinsic(intrinsic) => op( &mut Value::our(self.interpreter, *intrinsic), self.interpreter, ), bir::PlaceData::Dot(place, word) => self .with_place_mut_box(*place, |value, interprete...
Rust
0
# # --repeat argument for py.test taken from: # http://stackoverflow.com/questions/21764473/ # how-can-i-repeat-each-test-multiple-times-in-a-py-test-run # import pytest import os def pytest_addoption(parser): parser.addoption( '--repeat', action='store', help='Number of times to repeat each te...
Python
1
lt, JsonSchema)] pub struct ScaledJobJobTargetRefTemplateSpecVolumeDevices { /// devicePath is the path inside of the container that the device will be mapped to. #[serde(rename = "devicePath")] pub device_path: String, /// name must match the name of a persistentVolumeClaim in the pod #[serde(renam...
Rust
0
from repositories.lojaRepository import LojaRepository class LojaService: def __init__(self): self.lojaRepository = LojaRepository() def salvarLoja(self, loja): """Salva uma loja no repositório""" return self.lojaRepository.salvar(loja) def buscarLojaPorNome(self, nome): ...
Python
1
u(F.max_pool2d(self.ebn5(self.encoder5(out)),2,2)) t5 = out # b, c4, H/32, W/32 if self.bridge: t1, t2, t3, t4, t5 = self.scab(t1, t2, t3, t4, t5) out = F.gelu(self.encoder6(out)) # b, c5, H/32, W/32 out5 = F.gelu(self.dbn1(self.decoder1(out))) # b, c4, H/32, W/32 ...
Python
1
/ Result of removing a key from a `Knot`. enum KnotRemove<'a, K, V> { /// Key not found; knot not modified. None, /// The removed leaf, which was the only leaf left in the knot node. Old knot /// node left intact in case remove subsequently fails. Caller must drop old knot /// node if remove fully s...
Rust
0
ed = ARPInstance::<Fr, PerRegisterARP>::is_satisfied(&props, &witness, &worker); assert!(is_satisfied.is_ok()); let arp = ARPInstance::<Fr, PerRegisterARP>::from_instance(props.clone(), &worker).expect("must work"); let witness_polys = arp.calculate_witness_polys(witness, &worker).expect("must work"); ...
Rust
0
w: self } } } use polars::prelude::*; use std::io::Cursor; #[test] fn test_vstack_empty_3220() -> Result<()> { let df1 = df! { "a" => ["1", "2"], "b" => [1, 2] }?; let empty_df = df1.head(Some(0)); let mut stacked = df1.clone(); stacked.vstack_mut(&empty_df)?; stacked.vstac...
Rust
0
RaycastTermination::Miss } } #[derive(Copy, Clone, Default, Debug)] pub struct Raycast { pub hit : bool, pub dist : f32, pub incidence : u32, pub material : u32, pub voxel_id : u32, pub termination : RaycastTermination, pub iterations : u32, } pub fn voxel_march(voxels : &[VChildDescri...
Rust
0
ng_time; } } <filename>src/fennel/mod.rs //! Fennel RPC Connection mod error; use subxt::{sp_core::sr25519::Pair, ClientBuilder, DefaultConfig, DefaultExtra, PairSigner}; pub use self::error::Error; /// To run this example, a local fennel node should be running. /// /// ```bash /// curl "https://github.com/pari...
Rust
0
enum after mutation"); } } #[test] #[cfg_attr(feature = "wasm", wasm_bindgen_test)] fn recursive_structures() { #[derive(Archive, Serialize, Deserialize, Debug, PartialEq)] #[archive(compare(PartialEq))] #[archive_attr(derive(Debug))] // The derive macros don't a...
Rust
0
flags: libc::c_int, ) -> libc::c_int; } extern "C" { pub fn spng_decode_scanline( ctx: *mut spng_ctx, out: *mut libc::c_void, len: usize, ) -> libc::c_int; } extern "C" { pub fn spng_decode_row(ctx: *mut spng_ctx, out: *mut libc::c_void, len: usize) -> libc::c_int; } exte...
Rust
0
\x12\x039\x04\n\n\x0c\n\x05\x04\n\x02\x01\x01\x12\x039\x0b\x0f\n\x0c\n\ \x05\x04\n\x02\x01\x03\x12\x039\x12\x13\n\n\n\x02\x04\x0b\x12\x04<\0>\ \x01\n\n\n\x03\x04\x0b\x01\x12\x03<\x08\x14\n\x0b\n\x04\x04\x0b\x02\0\ \x12\x03=\x04\x16\n\r\n\x05\x04\x0b\x02\0\x04\x12\x04=\x04<\x16\n\x0c\n\ \x05\x04\x0b\x02\...
Rust
0
for inst in all_but_last(get_instructions(bb)).filter(|&i| needs_name(i)) { instnames.push(( inst, Name::name_or_num(unsafe { get_value_name(inst) }, ctr), )); } let term = unsafe { LLVMGetBasicBlockTerminator(bb) }; if term_needs_n...
Rust
0
} Err(e) => panic!("{}", e), } } #[test] fn test_point_convex_loop_interior() { //let normal = Vector3D::new(0., 0., 1.); let mut the_loop = Loop3D::new(); let l = 0.5; the_loop.push(Point3D::new(-l, -l, 0.)).unwrap(); the_loop.push(Point3D::n...
Rust
0
/{error_result['total_invalid_cases']}" ) print( f" ✓ Graceful degradation: {'✅' if error_result['graceful_degradation'] else '❌'}" ) # Overall assessment successful_tests = sum( [ compatibility_result["success"], convenience_result["success"], s...
Python
1
// This is rather arbitrary as based on experience if dos.e_lfanew == 0 || dos.e_lfanew > 0x200 { return Err(PeError::Insanity); } dos.e_lfanew as usize }; //---------------- Read up to and including NT headers let nt_bytes = e_lfanew + mem::size_of::<ImageNtHeaders>(); buf.resize(nt_bytes, 0)...
Rust
0
رآگاه_زن:', 'id': ':detektif_wanita:', 'zh': ':女侦探:', 'ru': ':женщина-детектив:' }, '\U0001F575\U0000200D\U00002640\U0000FE0F': { # 🕵‍♀️ 'en': ':woman_detective:', 'status': unqualified, 'E': 4, 'alias': [':female_detective:'], 'de': ':detektivin...
Python
1
def __getattr__(attr_name): from numpy._core import umath from ._utils import _raise_warning ret = getattr(umath, attr_name, None) if ret is None: raise AttributeError( f"module 'numpy.core.umath' has no attribute {attr_name}") _raise_warning(attr_name, "umath") return ret
Python
1
let mut h = im::HashMap::new(); for (key, value) in env.into_iter() { h = h.update(key.to_string(), apply_sub_scheme(subs, value.clone())); } h } fn compose(subs: Subs, subs2: Subs) -> im::HashMap<String, Type> { let mut h = im::HashMap::new(); for (key, value) in subs.into_iter() { ...
Rust
0
ck is removed. click_randomize(fitb) # Put this before the assertions, since it will wait until the text appears (implying the problem has been updated). check_description(selenium_utils_get, fitb, "What is 3 + 4?") assert ( selenium_utils_get.driver.find_element_by_id( "test_fitb_dy...
Python
1
slide.shapes.title.text = section_title content_shape = None for shape in slide.shapes: if shape.is_placeholder and shape.placeholder_format.idx == 1: content_shape = shape ...
Python
1
FO" => "Orlando", "1KBB-US-SEFP" => "Tampa", "1KBB-US-SEG" => "Georgia (US State)", "1KBB-US-SEGS" => "Savannah", "1KBB-US-SEGT" => "Atlanta", "1KBB-US-SEM" => "Maryland", "1KBB-US-SEMA" => "Annapolis", "1KBB-US-SEMB" => "Baltimore", "1KBB-US-SEN" => "North Carolina", "1KBB-US-SENA" ...
Rust
0
or> { match *query { Query::All => Ok(()), Query::Keys(ref query_properties) => { let err_key = query_properties.keys().map(|key| { if let Some(property_schema) = self.properties.get(key) { property_schema.validate_query(&query_properties.get(key).unwrap()) } else...
Rust
0
``False`` values will be unchanged. attn_mask = (attn_mask.sigmoid().flatten(2).unsqueeze(1).repeat(1, self.num_heads, 1, 1).flatten(0, 1) < 0.5).bool() attn_mask = attn_mask.detach() return outputs_class, outputs_mask, attn_mask @torch.jit.unused def _set_aux_loss(self, outputs_class...
Python
1
{ "name": "Helpdesk Portal Reopen", "version": "18.0.1.0.0", "author": "Glo Networks", "website": "https://github.com/GlodoUK/odoo-addons", "depends": ["helpdesk"], "data": [ "views/helpdesk_portal_templates.xml", "views/helpdesk_team_views.xml", ], "license": "Other prop...
Python
1
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
1
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
1
nb...", "a\nbc")); assert!(match_vec_helper("a\nb...", "a\nbc")); assert!(!match_vec_helper("a\nb...", "a\nb\nc")); assert!(match_vec_helper("a\n...b...", "a\nb")); assert!(match_vec_helper("a\n...b...", "a\nxbz")); assert!(match_vec_helper("a\n...b...", "a\nbz")); assert...
Rust
0
import torch import torch.nn as nn import torch.optim as optim import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score def discriminative_score_metric(critic, real_data, synthetic_data, device, test_size=0.3, batch_size=32, num_epochs=100): real_data = rea...
Python
1
A20BE, 0x4C42E38, 0x45157F0, 0x2AB1D00, 0xBB402EA, 0x101B4FA, 0xE38, ]; pub const CURVE_W: [[Chunk; NLEN]; 2] = [[0; NLEN]; 2]; pub const CURVE_SB: [[[Chunk; NLEN]; 2]; 2] = [[[0; NLEN]; 2]; 2]; pub const CURVE_WB: [[Chunk; NLEN]; 4] = [[0; NLEN]; 4]; pub const CURVE_BB: [[[Chunk; NLEN]; 4]; 4] = [[[0; NLEN]; 4]; 4]; ...
Rust
0
= config[1]; let server_min_ver = config[2]; let server_max_ver = config[3]; let exp_version = config[4]; if (client_max_ver < 3 || server_max_ver < 3) && !cfg!(feature="legacy_protocols") { continue; } let (c, s) = create_tcp_pa...
Rust
0
; use foreign_types::ForeignType; use foreign_types::ForeignTypeRef; use libc::c_char; use libc::{c_int, c_uchar, c_uint, c_void}; use std::ffi::CStr; use std::mem; use std::ptr; use std::slice; use std::str; use std::sync::Arc; use crate::error::ErrorStack; use crate::ssl::AlpnError; use crate::ssl::{ClientHello, Sel...
Rust
0
nUR[U55 g)Nrrrn)rArs r1load_frozenset_Unpickler.load_frozenset  Ie$%r0cFUR5nURU5 g)Nrr)rArs r1 load_list_Unpickle...
Python
1
from fastapi import FastAPI from src.recommender import Recommender from pydantic import BaseModel, field_validator from typing import List, Optional recommender = Recommender() app = FastAPI() class Rating(BaseModel): movieID: str score: float @field_validator("movieID") @classmethod def check_m...
Python
1
does not move the /// resource on failure. /// // #[deprecated = "Use leak_box_at and initialize it with the value. This does not move the value in the failure case."] pub fn leak_at<V>(&self, val: V, level: Level) -> Result<(&mut V, Level), LeakError<V>> { let alloc = match self.ge...
Rust
0
#!/usr/bin/env python3 import sys sum = 0 lines = sys.stdin.read().splitlines() h = len(lines) w = len(lines[0]) areas = [] dirs = ( (1, 0), (0, 1), (-1, 0), (0, -1), ) vis = set() c = None for i in range(h): for j in range(w): if (i, j) not in vis: c = lines[i][j] ...
Python
1
axis=1) sum_counts = y[special_case].sum(axis=1) with np.errstate(divide="ignore"): out_beta[special_case] = np.where( sum_counts == 0, -np.inf, np.log(sum_counts / sum_lib) ) out_conv[special_case] = True # Otherwise going through NR iterations out_beta[general_case], o...
Python
1
: CovariantPhantom<T>, /// } /// /// impl<T> WithGhost<T> { /// const fn new(value: T) -> Self { /// Self { /// value, /// _ghost: T::PHANTOM_COVARIANT, /// } /// } /// } /// ``` /// const PHANTOM_COVARIANT: PhantomDat...
Rust
0
level_filter = tracing_subscriber::filter::LevelFilter::from_level(level); /// let (filter, handle) = reload::Layer::new(level_filter); /// config.max_log_level.set_handle(handle).unwrap(); /// } /// /// impl<T: Subscriber + Debug> ReloadMut<Level> for Handle<LevelFilter, T> { /// fn reload(&mut self, level...
Rust
0
(enable = "crypto")] #[cfg_attr(test, assert_instr(sha256su0))] pub unsafe fn vsha256su0q_u32( w0_3: uint32x4_t, w4_7: uint32x4_t, ) -> uint32x4_t { vsha256su0q_u32_(w0_3, w4_7) } /// SHA256 schedule update accelerator, second part. #[inline] #[target_feature(enable = "crypto")] #[cfg_attr(test, assert_instr(s...
Rust
0
from django.apps import AppConfig class WagtailSnippetsTestsAppConfig(AppConfig): default_auto_field = "django.db.models.AutoField" name = "wagtail.test.streamfield_migrations" label = "streamfield_migration_tests" verbose_name = "Wagtail StreamField migration tests"
Python
1
up.title.text if soup.title else "N/A", "URL": url, "Number of links": len(soup.find_all('a')) if soup else 0, "Number of images": len(soup.find_all('img')) if soup else 0, } st.json(example_data) else: ...
Python
1
import numpy as np import pytest import starfish.data from starfish import FieldOfView from starfish.image import Filter from starfish.spots import FindSpots from starfish.types import TraceBuildingStrategies @pytest.mark.skip('This test runs but takes forever') def test_allen_smFISH_cropped_data(): # set rando...
Python
1
chr_bank: [usize; 8], interrupt_counter: u16, interrupt_step: u16, interrupt_active: bool, interrupt_enabled: bool, prg_bank_mode: bool, chr_inversion: bool, prg_banks: u8, mirror: MirrorMode, prg_ram: Box<[Wrapping<u8>]>, } impl Mmc3 { fn new(prg_banks: u8) -> Self { Sel...
Rust
0
import logging from robyn import Robyn from communication import mq_publisher as publisher from communication.mq_consumer import MQConsumer from config import config as config from config.settings import * from handler.db_handler import DBHandler from handler.redis_handler import RedisHandler from handler.router_inst...
Python
1
Self::lowercase_and_ensure_unique_handle(handle)?; Self::reserve_handle_deposit(&space.owner)?; SpaceIdByHandle::insert(handle_in_lowercase, space.id); Ok(()) } fn unreserve_handle( space: &Space<T>, handle: Vec<u8> ) -> DispatchResult { let handle_in_lowerc...
Rust
0
s::KeyTrait; #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] struct Testcase { typ: Option<String>, decrypt_key: String, passphrase: String, verify_key: Option<String>, filename: Option<String>, timestamp: Option<u64>, textcontent: Option<String>, keyid: Opti...
Rust
0
#!/usr/bin/env python3 """ Thunder Flat扭矩控制模式测试脚本 测试新的扭矩控制功能是否正常工作 """ import numpy as np import sys import os # 添加部署目录到路径 sys.path.append(os.path.dirname(os.path.abspath(__file__))) from action_processor import ThunderActionProcessor def test_torque_control_processor(): """测试扭矩控制版本的action processor""" prin...
Python
1
}use crate::i18n::t::t; use crate::database::error_codes as ec; pub fn error_code_message( error_code: &str, lang_code: &str, ) -> &'static str { let t = &t(lang_code); match error_code { ec::CSRF_TOKEN_IS_NOT_A_VALID_UUID => t.err_csrf_token_is_not_a_valid_uuid, ec::EMAI...
Rust
0
ecified by the const generic paramater. /// If the buffer does not contain a complete http request, /// a [`HandshakeError::NotEnoughData`] error will be returned. /// If the required headers(mentioned above) do not pass the check /// (case insensitive), other corresponding errors will be returned. ...
Rust
0
let index = (hasher.finish() as usize) % BUCKETS_MAX; for e in &*self.buckets[index].borrow() { let e = e.borrow(); if e.0 == key { return Some(self.values.borrow()[e.1].get()); } } None } pub fn put(&self, key: K, val: V) { ...
Rust
0
mut self) -> &mut T { // SAFETY: the pointer is valid, non-null and aligned, so this is safe. // SAFETY: the caller is still responsible for not giving out any mutable // SAFETY: or immutable references to the same place before calling deref_mut(), // SAFETY: however, creating such refer...
Rust
0
if self.positions[symbol]['amount'] <= 0: del self.positions[symbol] trade_record = { 'timestamp': datetime.now(timezone.utc).isoformat(), 'symbol': symbol, 'action': 'SELL', ...
Python
1
import rclpy import os from rclpy.node import Node from sensor_msgs.msg import NavSatFix from sensor_msgs.msg import NavSatStatus from std_msgs.msg import Header class GpsNode(Node): def __init__(self): super().__init__('gps_publisher') self.publisher_start = self.create_publisher(NavSatFix, '/g...
Python
1
return success class AssocArrayVisitor(ASTVisitor): def __init__(self, ast=None): super().__init__(ast) # Initialize variables self.success = True self.current_dimension = 0 self.key_types = [] # Set the first key type to wildcard (an...
Python
1
!(head, vec![true, true, true]); /// ``` pub fn get_chunk_body_decompressor( &self, _flags: &Flags, metadata: &ChunkMetadata<T>, ) -> QCompressResult<ChunkBodyDecompressor<T>> { ChunkBodyDecompressor::new(metadata) } /// Reads a chunk body, returning it as a vector of numbers. /// Will retu...
Rust
0
ext_color(bevy_egui::egui::Color32::RED))); } realm_selector.draw_ui(ui, &known_realms, &mut server_requests, |realm| puzzleverse_core::ClientRequest::RealmChange { realm }) }, ); "Puzzleverse".into() } ScreenState::PasswordLogin { insecure, password, server, player, erro...
Rust
0
gularaxis=dict( tickfont=dict(size=12, color="black", family="Arial", weight="bold") ) ), showlegend=False, title={ 'text': "Proficiency in Programming Languages & Frameworks", 'font': {'size': 15, 'color': 'black'} } ) fig2 = go.Figure() fig2.add_trace(go.Scatterpol...
Python
1
rl), html.escape(url) ) body = "</a><div class='container'>%s</div></div>" % html.escape( endpoint["context"] ) body = body.replace( html.escape(endpoint["link"]), "<span style...
Python
1
import json from typing import Any, Dict, Optional from tau_bench.envs.tool import Tool class get_commitments(Tool): @staticmethod def invoke(data: Dict[str, Any], fund_id: Optional[str] = None, investor_id: Optional[str] = None, status: Optional[str] = None, currency: Optional[st...
Python
1
from p2pd import * COMPUTER_A_NAME = "computer_a" # Put your custom protocol code here. async def msg_cb(msg, client_tup, pipe): # E.G. add a ping feature to your protocol. if b"PING" in msg: await pipe.send(b"PONG") # Computer a and b code can run on different # computers -- for demo they're just on...
Python
1
static str, pub(crate) via_zinc_900: &'static str, } pub(crate) const BACKGROUNDS: Backgrounds = Backgrounds { bg_amber_100: "bg-amber-100", bg_amber_200: "bg-amber-200", bg_amber_300: "bg-amber-300", bg_amber_400: "bg-amber-400", bg_amber_50: "bg-amber-50", bg_amber_500: "bg-amber-500", ...
Rust
0
Database" ET.SubElement(source, "annotation").text = "PASCAL VOC2007" ET.SubElement(source, "image").text = "flickr" ET.SubElement(source, "flickrid").text = "341012865" owner = ET.SubElement(root, "owner") ET.SubElement(owner, "flickrid").text = "341012865" ET.SubEleme...
Python
1
hMap; use lazy_static::lazy_static; use std::ops::Deref; use std::sync::Arc; use url::Url; lazy_static! { static ref TRADERS: DashMap<String, Trader, RandomState> = DashMap::with_hasher(RandomState::new()); } #[derive(Clone)] pub struct Trader { pub name: String, pub uri: Url, inner: Arc<dyn T...
Rust
0
match parse(input) { Ok(("", elements)) => { Ok(elements.into_iter().flat_map(|e| e.texts()).collect()) } Ok(_) => Err("Input could not be fully parsed"), Err(_) => Err("Parser encountered an error"), } } /// Parses markdown into its list of elements. pub fn parse<'a>(in...
Rust
0
magic} {magic:x}", magic = foo::BAR); println!("{:?}", foo::MAGIC); println!("Test Success"); }<filename>src/hero.rs use entity::Entity; use input_manager::InputManager; use sdl2::pixels::Color; use sdl2::render::Renderer; pub struct Hero { pub entity: Entity, pub move_speed: f32, } impl Hero { pub fn ...
Rust
0
"""Returns a config for filter that keeps everything.""" return cls( max_subsequence_ratio=None, min_align_ratio=None, min_hit_length=None, deduplicate_sequences=False, max_hits=None, max_template_date=datetime.date(3000, 1, 1), # Very far in the future. ) ...
Python
1
#[no_mangle] fn printf(_: *const libc::c_char, _: ...) -> libc::c_int; #[no_mangle] fn memset(_: *mut libc::c_void, _: libc::c_int, _: libc::c_ulong) -> *mut libc::c_void; #[no_mangle] fn strncmp(_: *const libc::c_char, _: *const libc::c_char, _: libc::c_ulong) -> libc::c_int...
Rust
0
The byte offset must be in range `0..512`. #[derive(Default, Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq)] pub struct XBytes(pub usize); /// A byte offset in `y` register set. /// /// The byte offset must be in range `0..512`. #[derive(Default, Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq)] pub struct YB...
Rust
0
entation.z = quaternion_arrow[2] marker.pose.orientation.w = quaternion_arrow[3] # 设置箭头的方向 marker.scale.x = 20 * np.linalg.norm(force) # 箭头的宽度 marker.scale.y = 0.2 # 箭头的尾部宽度 marker.scale.z = 0.2 # 500 *np.linalg.norm(force) # 箭头的长度 # 设置箭头的颜色 marker.color.r = color[0] # 颜色信息 marker....
Python
1
f.assertEqual(read_nwbfile.container_source, self.link_filename) def validate(self): filenames = [self.data_filename, self.link_filename] for fn in filenames: if os.path.exists(fn): with NWBHDF5IO(fn, mode='r') as io: errors = pynwb_validate(io=io) ...
Python
1
(not no_hires): return 1 if s2.audio_quality == AudioQuality.HI_RES and (not no_hires): return -1 return s1.audio_quality.value - s2.audio_quality.value video_streams.sort(key=cmp_to_key(video_stream_cmp), reverse=True) audi...
Python
1
ium": { "gte": float(min_sodium or 0), "lte": float(max_sodium or 10000) } } }) # Add protein filter if provided if min_protein or max_protein: search_query['query']['bool']['filter'].append({ ...
Python
1
32, usize)>, ) -> bool { if edges[0] == target { return true; } if cache.contains(&(edges[0], edges[1], edges[2], edges[3], used)) { return false; } for i in 0..nums.len() { if used & (1 << i) > 0 { continue; } ...
Rust
0
{ if lot.acquisition.when.year() == year { current_holdings_by_year_rows.push(row); continue; } } } } for open_order in db.open_orders(None, Some(OrderSide::Sell)) { for lot in open_order.lots.iter() { ...
Rust
0
lst = list(map(int, input().split())) lst2 = [] for i in lst: lst2.append(i**2) print(lst2)
Python
1
pub fn new() -> Self { Dialog { kind: DialogKind::Dialog, id: String::new(), args: Vec::new(), } } pub fn from_dialog_data<T: AsRef<str>>(kind: DialogKind, id: T, args: Vec<DialogBody>) -> Self { Dialog { kind, id: String:...
Rust
0
s to be discarded from the clumps dictionary for clump_key in clumps_to_be_discarded.keys(): del clumps[clump_key] print ("clumps after discarding:", json.dumps([{ "key": clump["key"], "start": clump["start"], "length": clump["length"], "utterances": clump["utterances"] ...
Python
1