text
string
label_name
string
labels
int64
**kwargs ) -> Dict[str, Any]: """Simple chat interface""" messages = [] if system_prompt: messages.append({"role": "system", "content": system_prompt}) messages.append({"role": "user", "content": prompt}) return await self.proxy...
Python
1
RID}}/homeRealmDiscoveryPolicies", params: 0, has_body: false }); get!({ doc: "# Get extensionProperties from applications", name: get_extension_properties, response: serde_json::Value, path: "/applications/{{RID}}/extensionProperties/{{id}}", params: 1, ...
Rust
0
iter.simpletag("setting", value=s, label=l) writer.newline() writer.endtag("feature") writer.newline() def fromXML(self, name, attrs, content, ttFont): if name == "version": self.version = float(safeEval(attrs["version"])) elif name == "feature": ...
Python
1
pub limitl: self::events_ch::LIMITL, } #[doc = r"Register block"] #[doc = "Unspecified"] pub mod events_ch; #[doc = r"Register block"] #[repr(C)] pub struct CH { #[doc = "0x00 - Description cluster\\[n\\]: Input positive pin selection for CH\\[n\\]"] pub pselp: self::ch::PSELP, #[doc = "0x04 - Descript...
Rust
0
("Adding for {:?} {:?} token_ids {:?}", value, text_info.id, tokens_ids); if let Some(el) = data.text_id_to_token_ids.as_mut() { el.add_all(text_info.id, &tokens_ids).unwrap(); } } if let Some(el) = data...
Rust
0
torch.device = torch.device('cuda')): super().__init__(plans, configuration, fold, dataset_json, unpack_dataset, device) self.num_epochs = 4000 class nnUNetTrainer_NexToU_NoDeepSupervision_8000epochs(nnUNetTrainer_NexToU_NoDeepSupervision): def __init__(self, plans: dict, configuration: str, fold...
Python
1
self) -> &'a str { &self.str[self.index..] } } impl<'a> Iterator for Utf16CharIndices<'a> { type Item = (usize,Utf16Char); fn next(&mut self) -> Option<(usize,Utf16Char)> { match Utf16Char::from_str_start(&self.str[self.index..]) { Ok((u16c, bytes)) => { let item ...
Rust
0
807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138,...
Rust
0
::PrevalidateAttests::<Runtime>::new(), ) }; let raw_payload = SignedPayload::from_raw( function, extra(nonce, 0), ( VERSION.spec_version, VERSION.transaction_version, genesis_hash, genesis_hash, (), (), (), // (), // (), // (), (), ...
Rust
0
RUS:5 US-$)Nr?r|rrr)rors rsqrt _Z3Ops.sqrt4^^F+F NN ( (1 53; rXc.[R"U5$)Nr'Abs)rors rabs _Z3Ops.abs66&> !rXc...
Python
1
lf_to_odd_27: (NEG_INFINITY, 1, NEG_INFINITY), half_to_odd_28: (-103., -1, -100.), half_to_odd_29: (-105., -1, -110.), half_to_odd_30: (-107., -1, -110.), half_to_odd_31: (-113., -1, -110.), half_to_odd_32: (-115., -1, -110.), half_to_odd_33: (-117., -1, -120.), half_to_odd_34: (-123., -1, -120.), half_...
Rust
0
(index, diagnostics); } } fn validate_scalar_field_unknown_default_functions( &self, db: &parser_database::ParserDatabase, diagnostics: &mut Diagnostics, ) { for d in db.walk_scalar_field_defaults_with_unknown_function() { let (func_name, args, span) = d....
Rust
0
# На вход программе подается строка текста в которой буква «h» # встречается как минимум два раза. Напишите программу, # которая возвращает исходную строку и переворачивает последовательность символов, # заключенную между первым и последним вхождением буквы «h». s = input() first_h = s.find('h') last_h = s.rfind('h'...
Python
1
[cfg(feature = "package-container-service-2016-09")] mod package_container_service_2016_09; #[cfg(feature = "package-container-service-2016-09")] pub use package_container_service_2016_09::{models, operations, API_VERSION}; #[cfg(feature = "package-2016-04-preview")] mod package_2016_04_preview; #[cfg(feature = "packag...
Rust
0
apping.endElement("item", "some item", None) self.assertEqual(self.block_device_mapping["some name"], "some value") class TestLaunchConfiguration(AWSMockServiceTestCase): connection_class = EC2Connection def default_body(self): # This is a dummy response return b""" <DescribeL...
Python
1
#!/usr/bin/env python3 import argparse import json import sys plugin = { "name": "Strong to emphasis", "transforms": [ { "name": "transform-typography", "doc": "An example transform that rewrites bold text as text with emphasis.", "stage": "document" } ...
Python
1
); test::black_box(bytes); }); } /// Decode normal u64 in VarInt using original TiKV implementation. /// The buffer size >= 10. #[bench] fn bench_decode_varint_normal_original_large_buffer(b: &mut test::Bencher) { let mut buf: Vec<u8> = vec![0; 10]; buf[0..VARINT...
Rust
0
from flask import Flask from flask_sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, scoped_session import os from flask_jwt_extended import JWTManager from datetime import timedelta basedir = os.path.abspath(os.path.dirname(__file__)) app = Flask(__name__) app...
Python
1
""" LLM 智能绘图模块使用示例 演示如何使用各种功能 """ import json from pathlib import Path import sys # 添加项目路径 sys.path.append(str(Path(__file__).parent.parent.parent)) from core.llm_plot import ( initialize_chart_service, generate_smart_chart, generate_chart, validate_chart_config, get_chart_template, SUPPORTED...
Python
1
", image: BuffImage::Avatar(CharacterName::Thoma), genre: BuffGenre::Character, description: Some("托马天赋1:当前场上自己的角色获取或刷新烈烧佑命护盾时,护盾强效提升5%,持续时间6秒。此效果每0.3秒至多触发一次,至多叠加5次。"), from: BuffFrom::Character(CharacterName::Thoma), }; #[cfg(not(target_family = "wasm"))] const CONFIG: Opti...
Rust
0
< 8 { return Option::None; } let mut parts = header.to_str().ok()?.splitn(2, ' '); match parts.next() { Some(scheme) if scheme == "Bearer" => (), _ => return Option::None, } let token = parts.next()?; Option::from(token.to_string()) } fn get_user_info_args(req: &ServiceRequest) -> Result<(...
Rust
0
import json import streamlit as st from code_editor import code_editor import base64 import sqlite3 import streamlit.components.v1 as components import requests from login import get_user_id_by_username from login import get_file_ids_by_user_id from login import get_file_data_as_json import difflib import re from g4f.c...
Python
1
o_content) tunnel_card.setFixedHeight(60) card_layout = QHBoxLayout(tunnel_card) card_layout.setContentsMargins(15, 10, 15, 10) id_label = BodyLabel(f"隧道ID: {tunnel_id}", tunnel_card) card_layout.addWidget(id_label) card_layout.addStretch() ...
Python
1
import torch import torch.distributed as dist from torch.nn import Parameter from torch.nn import Module from apex.parallel import DistributedDataParallel as DDP import argparse import os parser = argparse.ArgumentParser(description='allreduce hook example') parser.add_argument("--local_rank", default=0, type=int) ar...
Python
1
ariant(&mut self, v: &mut Variant) { noop_visit_variant(v, self); } fn visit_ident(&mut self, i: &mut Ident) { noop_visit_ident(i, self); } fn visit_path(&mut self, p: &mut Path) { noop_visit_path(p, self); } fn visit_qself(&mut self, qs: &mut Option<QSelf>) { ...
Rust
0
'    JJ kk  E# (:(:5(I $E+< =E TE\ !F $VU 3Fd# Mr?r>rrcX/n[U[5(aURSU5nOURU5 [U[5(deUR ...
Python
1
from rich.console import Console from rich.layout import Layout from rich.live import Live from rich.style import Style from rich.table import Table from rich.text import Text from rich.panel import Panel from rich import box import time import os import string import pyperclip live = Live console: Console = Console(...
Python
1
opedata): scale,c2size = self.researchBeamSizeCalibration(scopedata,'scale') if not c2size: return None c2results = leginondata.C2ApertureSizeData(session=self.node.session,tem=scopedata['tem']).query(results=1) if c2results and c2results[0]['size']: session_c2size = float(c2results[0]['size']) return ...
Python
1
from net.swordie.ms.constants import BossConstants from net.swordie.ms.enums import EventType # Mode, Required Level, Map ID, Death Count, Event Type, Cooldown, Hour String destinations = [ ["Normal", 120, 262030100, 5, EventType.Hilla, 43200000, 12], ["Hard", 170, 262031100, 5, EventType.HHilla, 64800000, 18...
Python
1
1_OEN_INV_SEL_W { GPIO_FUNC1_OEN_INV_SEL_W { w: self } } #[doc = "Bit 9"] #[inline(always)] pub fn gpio_func1_oen_sel(&mut self) -> GPIO_FUNC1_OEN_SEL_W { GPIO_FUNC1_OEN_SEL_W { w: self } } #[doc = "Bit 8"] #[inline(always)] pub fn gpio_func1_out_inv_sel(&mut self) -> GPI...
Rust
0
import numpy as np from skimage.color import rgb2lab def _calc_angle_diff(angle1, angle2): """角度の差(0°~180°)を計算する関数 """ diff = abs(angle1 - angle2) return diff if diff <= 180 else 360 - diff def hex_to_rgb(hex_color): hex_color = hex_color.lstrip('#') return tuple(int(hex_color[i:i + 2], 16) ...
Python
1
from .. import IconBase class IconPanelRight(IconBase): class_name = "lucide lucide-panel-right" svg_data = { "attrs": { "width": "24", "height": "24", "view_box": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke_width": "2", "stroke_li...
Python
1
import random def sprawdz_liczbe(x): try: return int(x) except ValueError: return None def zgadnij_liczbe(): while True: minimalna = input("Podaj minimalną wartość zakresu: ") maksymalna = input("Podaj maksymalną wartość zakresu: ") minimalna = sprawdz_liczbe(min...
Python
1
// allow future cargo implementations to break the // interpretation of each line here and older cargo will simply // ignore the new lines. ret.extend(lines.filter_map(|line| { let (summary, locked) = match self.parse_registry_package(line) { ...
Rust
0
M_EN`"] pub type SYSCON_CLK_320M_EN_R = crate::R<bool, bool>; #[doc = "Write proxy for field `SYSCON_CLK_320M_EN`"] pub struct SYSCON_CLK_320M_EN_W<'a> { w: &'a mut W, } impl<'a> SYSCON_CLK_320M_EN_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self....
Rust
0
from decimal import Decimal from pydantic.main import BaseModel class Apartment(BaseModel): price: Decimal
Python
1
k += 1; } let li = self.li; self.li += 1; Some(foundation::get_permutation_element_by_node(self.size, self.ipk, li)) } #[inline] fn size_hint(&self) -> (usize, Option<usize>) { let k2 = 1 << (self.ipk - 1); let size = self.size - (k2 + self.li - 1); ...
Rust
0
random_double_lim(0.5, 1.0), ); let fuzz: f64 = random_double_lim(0.0, 0.5); let sphere_material = Metal::news(albedo, fuzz); let met: Sphere<Metal> = Sphere { center, radius: 0.2...
Rust
0
import sys from itertools import permutations def get_largest_smaller_number(bob_cards, alice_cards): # Bob이 만들 수 있는 두 수 bob_num1 = int("".join(bob_cards)) bob_num2 = int("".join(bob_cards[::-1])) # Bob이 만들 수 있는 두 수 중 큰 수를 bob_max로 설정 bob_min = min(bob_num1, bob_num2) n = len(alice_cards) ...
Python
1
.format(args.epoch, iter_epoch, len(loader), batch_time=batch_time, data_time=data_time, loss=log_loss, log_top1=log_top1)) # end of epoch args.start_iter = 0 args.epoch += 1 # dump checkpoint if not args.rank: torch.save({ ...
Python
1
# initialize import pyddm import pandas as pd import numpy as np from pyddm import Sample import os import sys import matplotlib.pyplot as plt import gc # Get number of CPUs from SLURM environment variable n_cpus = int(os.environ.get('SLURM_CPUS_PER_TASK', 1)) pyddm.set_N_cpus(n_cpus) # Get the subject ID and results...
Python
1
mut group = c.benchmark_group("Intersection 8/2"); group.bench_function("native", |b| { b.iter(|| { let _result: BTreeSet<&str> = set1.intersection(&set2).cloned().collect(); }) }); group.bench_function("oso", |b| { b.iter(|| { let _result: BTreeSet<&str> = s...
Rust
0
(base.clone_dynamic(), patch()), |(mut base, patch)| base.apply(black_box(&*patch)), BatchSize::SmallInput, ); }, ); } for field_count in SIZES { group.throughput(Throughput::Elements(field_count as u64)); group.bench...
Rust
0
lib_name + '.fobjects') with open(listfn, 'w') as f: f.write("\n".join(os.path.abspath(obj) for obj in f_objects)) listfn = os.path.join(self.build_clib, lib_name + '.cobjects') with open(listfn, 'w') as ...
Python
1
def save_load_local(self): super().test_save_load_local(expected_max_difference=0.005)
Python
1
import os import sys import asyncio # Add the src directory to Python path sys.path.insert( 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")) ) import asyncio from pathlib import Path from whatsplay.client import ( Client, ) # Asegúrate de que la ruta sea correcta a tu client.py from ...
Python
1
rain(self,terrain:SubTerrain,difficulty, depth, platform_size=1.): # 要从 坑中爬出来 difficulty = np.clip(difficulty, 0, 1) depth = depth * difficulty depth = int(depth / terrain.vertical_scale) platform_size = int(platform_size / terrain.horizontal_scale / 2) x1 = terrain.len...
Python
1
from typing import Any from typing import ClassVar from typing import Optional import numpy as np from evidently.legacy.core import ColumnType from evidently.legacy.features.generated_features import ApplyColumnGeneratedFeature class NonLetterCharacterPercentage(ApplyColumnGeneratedFeature): class Config: ...
Python
1
(e) => @{node: stmt_expr(e, cx.next_id()), span: e.span}, mr_any(_,_,stmt_mkr) => stmt_mkr(), _ => cx.span_fatal( pth.span, fmt!("non-stmt macro in stmt pos: %s", *extname)) }; //keep going, outside-in ...
Rust
0
will be bound to a `RecordsImplLayout::Error` /// associated type directly. type Error; /// If `Some(E)`, `parse_with_context` of `LimitedRecordsImplBridge` will emit the /// provided constant as an error if the provided buffer is exhausted while `context` /// is not 0, or if the `context` reaches...
Rust
0
from langchain_community.vectorstores.docarray.hnsw import DocArrayHnswSearch from langchain_community.vectorstores.docarray.in_memory import DocArrayInMemorySearch __all__ = [ "DocArrayHnswSearch", "DocArrayInMemorySearch", ]
Python
1
type_info: Box::new(TypeInfo::from_type_anno(&tp.type_anno, cur_scope)), }, TypeAnnotation::Unknown => TypeInfo::Unknown, _ => todo!(), } } pub(crate) fn from_fn_signature(item: &impl FnSignature) -> Self { let tp_fn_ptr = TypeFnPtr::from_fn_signature(item)...
Rust
0
//Used to distinguish the chain types supported by the wallet BTC = 1, BtcTest = 2, ETH = 3, EthTest = 4, EEE = 5, EeeTest = 6, BtcPrivate = 7, BtcPrivateTest = 8, EthPrivate = 9, EthPrivateTest = 10, EeePrivate = 11, EeePrivateTest = 12, } impl ChainType { pub fn fr...
Rust
0
rwork: &mut [f32], lrwork: i32, iwork: &mut [i32], info: &mut i32, ) { ffi::cuncsd_( &(jobu1 as c_char), &(jobu2 as c_char), &(jobv1t as c_char), &(jobv2t as c_char), &(trans as c_char), &(signs as c_char), &m, &p, &q, ...
Rust
0
extures\tx_emperor_parasol_02.dds", 0x3D15_0E4A, 0x08F9_6B5F), (r"textures\tx_emperor_parasol_03.dds", 0x3D15_0E4A, 0x4755_EF65), (r"textures\tx_emperor_parasol_01.dds", 0x3D15_0E4A, 0xAFA0_632B), (r"textures\tx_a_redoran_master_h2.dds", 0x3D17_3C58, 0xBED8_EECA), (r"textures\tx_a_redoran_master_h1....
Rust
0
).grid(row=2, column=1, sticky="e", pady=5) # Configure grid columns summary_stats.columnconfigure(0, weight=1) summary_stats.columnconfigure(1, weight=1) # Create and animate charts weekly_chart = WeeklyActivityChart( weekly_canvas, x=0, y=0, ...
Python
1
ut right); lt_pivot } else { Self::k_closest(lt_pivot, k) } } } // submission codes end #[cfg(test)] mod tests { use super::*; #[test] fn test_973() { } } <filename>src/graph/dynconn.rs //! //! Graph data structures and algorithms providing dynamic connecti...
Rust
0
: &String, channel_state_key: &String, channel_state: Option<&mpc::ChannelMPCState>, merch_state_key: &String, merch_state: &mpc::MerchantMPCState, ) -> Result<(), String> { // let key = String::from("cli:merch_db"); match channel_state { Some(n) => { ...
Rust
0
t = time.time() p0 = lpcompile_for_execution(QR, inputs=["I"], outputs=["Rs"]) p1 = p0(A, Vs, Ts, Rs, Ss, N_blocks, 0) e = time.time() c_time = e - t config = npw.config.default() program = lp.LambdaPackProgram(p1, config=config) return program, {"outputs":[Rs, Vs, Ts], "intermediates":[Ss]...
Python
1
a['Uniqueness (%)'], xerr=genmol_data['Diversity std'], yerr=genmol_data['Uniqueness (%) std'], color=colors['GenMol'], alpha=0.2, ls='--', capsize=3, markersize=0) if not fragmol_data.empty: # Plot main line and points ax.plot(fragmol_data['Diversity'], fragm...
Python
1
# -*- coding: utf-8 -*- import copy import logging from typing import * import pubsub.pub as pub import wx import config import designer.ui_base logger = logging.getLogger('native-ui.' + __name__) class RoomConfigDialog(designer.ui_base.RoomConfigDialogBase): _GIFT_PRON_CHOICES = ('', 'pinyin', 'kana') de...
Python
1
) .await; _verify_unpack_malformed( remove_field(ENCRYPTED_MSG_AUTH_X25519, "tag").as_str(), "Malformed: Message is not a valid JWE, JWS or JWM", ) .await; _verify_unpack_malformed( update_protected_field(ENCRYPTED_MSG_AUTH_X25519, "...
Rust
0
::Relaxed); } } struct MyActor3; impl Actor for MyActor3 { type Context = Context<Self>; } impl actix::Handler<Ping> for MyActor3 { type Result = (); fn handle(&mut self, _: Ping, _: &mut actix::Context<MyActor3>) -> Self::Result { Arbiter::system().do_send(actix::msgs::SystemExit(0)); }...
Rust
0
e_selection jsonly" onclick="page.on_action_button()"> <div id="actions-btn-text">More&nbsp;</div> <span class="fa fa-solid fa-plus" id="actions-btn-icon"><b>+</b></span> <span class="fa fa-duotone fa-spinner fa-spin" id="actions-loading-icon"><span class='spin'>⚉</span></span> </div> <div id="progress-island" ...
Python
1
"presence_penalty":args.presence_penalty #存在惩罚 } # 是否采用llm-judge judge_api_url = args.judge_api_url judge_model = args.judge_model if judge_model == None and judge_api_url == None: print("当前评测未采用llmjudge,仅通过Rule进行评测") judge_api_config = None else: print("当前评测采...
Python
1
pe of a `Mixin.src` URL. /// /// Only the following URLs are allowed at the moment: /// - [TeamSpeak] URL (starting with `ts://` scheme and having a host); /// - [MP3] HTTP URL (starting with `http://` or `https://` scheme, having a /// host and `.mp3` extension in its path). /// /// [MP3]: https://en.wikipedia.org/w...
Rust
0
} } impl CommandExtra for Command { fn with_current_dir(mut self, dir: impl AsRef<Path>) -> Self { self.current_dir(dir); self } fn with_env(mut self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> Self { self.env(key, value); self } fn without_env(mut se...
Rust
0
eating this logic multiple times. // This is essentially a 192 bit number let r0 = Cell::new(0u64); let r1 = Cell::new(0u64); let r2 = Cell::new(0u64); let multiply_in = |i: usize, j: usize| { let uv = u128::from(self.limbs[i]) * u128::from(other.limbs[j]); ...
Rust
0
_EDR_ESCO_3MBPS_MODE(x: u64) -> u64 { GET_BIT(x, 46) } #[inline] pub fn LMP_3SLOT_EDR_ESCO_PACKETS(x: u64) -> u64 { GET_BIT(x, 47) } #[inline] pub fn LMP_EXTENDED_INQUIRY_RESPONSE(x: u64) -> u64 { GET_BIT(x, 48) } #[inline] pub fn LMP_SIMULT_LE_BR_TO_SAME_DEV(x: u64) -> u64 { GET_BIT(x, 49) } #[inline] ...
Rust
0
'F1-Confidence(P)', 'Precision-Confidence(P)', 'Recall-Confidence(P)'] @property def curves_results(self): """Returns dictionary of computed performance metrics and statistics.""" return self.box.curves_results + self.pose.curves_results class ClassifyMetrics(SimpleClass): """ Class ...
Python
1
_WM_BASE_PONG, serial) }; RequestResult::Sent(()) } } } pub mod xdg_positioner { //! child surface positioner //! //! The xdg_positioner provides a collection of rules for the placement of a //! child surface relative to a parent surface. Rules can be defined to ensure //! th...
Rust
0
.insert(block_type.to_string(), vec![0; self.capacity]); } (*self.count.get_mut(block_type).unwrap())[counter_idx] += 1; } pub fn add_block_count(&mut self, other: BlockCount) -> Result<(), BlockCountError> { if self.world_y_range != other.world_y_range { return Err(Mism...
Rust
0
"""Tests for SQL registration table.""" from typing import List, cast import sqlalchemy from system_server.persistence.tables import add_tables_to_db # The statements that we expect to emit when we create a fresh database. # # If this changes semantically in any way, # the change must be paired with a SQL schema migr...
Python
1
import nibabel as nib import numpy as np from matplotlib import pyplot as plt class NiiToMNI: def __init__( self, PATH_nii_file: str = r"C:\code\RMap_ROI_Estimation\Automated Anatomical Labeling 3 (Rolls 2020).nii", ) -> None: self.img = nib.Nifti1Image.from_filename(PATH_nii_file) ...
Python
1
'), a=2.856e-10,c=(2.8e-10*np.sqrt(8./3.) if OR=='Burgers' else None)) poles = O.related(OR).to_frame(uvw=pole,with_symmetry=True).reshape(-1,3) points = util.project_equal_area(poles,'z') fig, ax = plt.subplots() ax.add_patch(plt.Circle((0,0),1, color='k',fill=False)) ax.scatte...
Python
1
from moveit_configs_utils import MoveItConfigsBuilder from moveit_configs_utils.launches import generate_rsp_launch from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, OpaqueFunction from launch.substitutions import LaunchConfiguration def launch_setup(context, *args, **kwargs): ...
Python
1
events to be sorted by /// timestamp, but in practice if you have a lot of events coming /// in from different threads they will end up being out of order /// due to waiting on a shared lock. So if you try to keep the /// events in each batch in order, and start a new batch every /// time an out-of...
Rust
0
timeline_state); } proptest! { #![proptest_config(ProptestConfig::with_cases(10))] #[test] fn test_mempool_process_incoming_transactions((txns, timeline_state) in mempool_incoming_transactions_strategy()) { test_mempool_process_incoming_transactions_impl(txns, timeline_state); } } // btleplug...
Rust
0
le fields see [mask](mask) module"] pub type MASK = crate::Reg<u32, _MASK>; #[allow(missing_docs)] #[doc(hidden)] pub struct _MASK; #[doc = "`read()` method returns [mask::R](mask::R) reader structure"] impl crate::Readable for MASK {} #[doc = "`write(|w| ..)` method takes [mask::W](mask::W) writer structure"] impl cra...
Rust
0
let camera_depth = match render_opts.cam_fov { Fov::Degrees(_) => unimplemented!(), Fov::Radians(_) => unimplemented!(), Fov::Tangent(t) => 0.5 * camera_width / t, }; let camera_dir = (render_opts.cam_lookat - render_opts.cam_origin).normalize(); let camera_reldir = Vector::new(0.0, 0.0, -1.0); ...
Rust
0
(), Some(&mut AnyExpr::from(expr::BitvecConst::from(5))) ); assert_eq!( iter.next(), Some(&mut AnyExpr::from(expr::BitvecConst::from(42))) ); assert_eq!( iter.next_back(), Some(&mut AnyExpr::from(expr::BitvecConst::from(0))) ); assert_eq!( iter.next(), Some(&mut AnyExpr::from(expr::Bitv...
Rust
0
test_merge_ranges2() { let ranges = vec![Range::new(1, 2), Range::new(3, 12)]; assert_eq!( Range::merge_ranges(ranges), vec![Range::new(1, 2), Range::new(3, 12)] ); } #[test] fn test_is_covered_with() { let range1 = Range::new(1, 7); let rang...
Rust
0
aiton::Read, kv: KeyValue { key: String::from("key"), value: 0, }, }; // //wrap messages let wrapped_msg = Package{ types: Types::CMD, msg: Msg::CMD(message), }; //serialization let serialized = serde_json::to_string(&wrapped_msg).unwrap();...
Rust
0
"""WHAD Protocol PHY modulation messages abstraction layer. """ from whad.protocol.whad_pb2 import Message from whad.protocol.phy.phy_pb2 import SetBPSKModulationCmd from ..message import pb_bind, PbFieldInt, PbFieldBool, PbMessageWrapper from . import PhyDomain @pb_bind(PhyDomain, 'mod_ask', 1) class SetAskMod(PbMess...
Python
1
, 0, 0, 0, 0, 0, 0, 1, 194, 95, 255, 96, 6, ], 1, ), ( vec![(1000, 1.0), (1001, 200.0), (1002, -2f64)], vec![ 0, 0, 0, 0, 0, 0, 3, 232, 63, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
Rust
0
_text, glm::vec3(0.5, -0.2, 0.0), display, target, font); let controls_pause_text = String::from("Pause: Esc|F1"); render_text(controls_pause_text, glm::vec3(0.5, -0.3, 0.0), display, target, font); } fn render_pause(display: &Display, target: &mut Frame, font: &FontTexture) { let text_system = glium_text...
Rust
0
00] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#900] and stop // --> [Mp3fa#9...
Rust
0
from ..dev import FluxDevInt8, FluxDevNF4 from .transformer import ( FluxDevStoiqoNewRealityAlphaV2TransformerInt8, FluxDevStoiqoNewRealityAlphaV2TransformerNF4 ) __all__ = [ "FluxDevStoiqoNewRealityAlphaV2Int8", "FluxDevStoiqoNewRealityAlphaV2NF4" ] class FluxDevStoiqoNewRealityAlphaV2Int8(FluxDevInt...
Python
1
into np.dtype then to numba type. nb_type = from_dtype(np.dtype(desc.literal_value)) return from_nb_type(nb_type) elif isinstance(desc, types.functions.NumberClass): thestr = str(desc.dtype) # Convert the str description into np.dtype then to numba type. nb_type = from_dtype(...
Python
1
#[test] fn sequence() { assert!(EncOption::Fast < EncOption::HideMeta); } } mod strings { use super::*; #[test] fn case_insentisive() { assert_eq!(EncOption::from_str("Fast"), Ok(EncOption::Fast)); assert_eq!(EncOption::from_s...
Rust
0
<T>(n: T) -> Self where T: PrimInt, { let n = n.to_usize().unwrap(); let bits = 32; let flags_num = n / bits + 1; let defaults: Vec<usize> = vec![0x5D75D75D, 0xD75D75D7, 0x75D75D75]; let (mut i, mut f, mut j); let max = ((n as f64).sqrt() as usize) + 1; ...
Rust
0
,subserver): # msg=random.randrange(1,11) # if msg < 7: # reply=mkmsg.gfamsg() # comment='Autoguiding continue.......' # dict_data={'inst': 'GFA', 'savedata': 'False','filename': 'None','message': comment, 'thred': msg} # reply.update(dict_data) # rsp=json.dumps(reply) # ...
Python
1
limit of {}", &_name, total_limit); RuntimeControl::Stop } else { RuntimeControl::Continue } } } pub fn control_limit_per_rule(per_rule_limit: u64) -> impl FnMut(&Arc<str>, &dyn Access, u64) -> RuntimeControl { let mut per_rule_counts = std::collections::HashMap::new();...
Rust
0
import os import zipfile def delete_old_zip(zip_name): """ Delete the zip file if it already exists. :param zip_name: Name of the zip file to be deleted. """ if os.path.exists(zip_name): os.remove(zip_name) print(f"Deleted old {zip_name}") else: print(f"{zip_name} does...
Python
1
_init_thread: Hello World"); { let serial = find_device("serial_device_00") .expect("Failed to find serial device"); println!("Count: {}", Arc::strong_count(&serial)); let lock = serial.lock(); let mut lock = lock.write(); let str = "Found the serial device pr...
Rust
0
.len()); // assert_eq!(montgomery_key, bs58::encode(base64::decode(&key.x).unwrap()).into_string()); // } use super::color::Color; #[derive(Clone, Debug, Copy)] pub struct Pixel { pub pos: (u32, u32), pub color: Color, pub palette_index: Option<u8> } impl Pixel { pub fn from_palette_index(pos: (u3...
Rust
0
grault: Grault } } #[test] fn test_unit() { assert_eq!(Foo::from_str("Bar").unwrap(), Foo::Bar); } #[test] fn test_unnamed() { assert_eq!(Foo::from_str("Qux").unwrap(), Foo::Qux(0)); } #[test] fn test_named() { assert_eq!(Foo::from_str("Corge").unwrap(), Foo::Corge { st: Default::default(), ...
Rust
0
t props = vec![]; if self.is_template() { props.push("template"); } if self.is_template_specialization() { props.push("template_specialization"); } if self.is_abstract() { props.push("abstract"); } if self.is_trait() { props.push("trait"); } if self.is_by_ptr() { props.push("by_ptr"); ...
Rust
0
_ProjectId @ProjectId.setter def ProjectId(self, ProjectId): self._ProjectId = ProjectId @property def EventCaseList(self): return self._EventCaseList @EventCaseList.setter def EventCaseList(self, EventCaseList): self._EventCaseList = EventCaseList @property d...
Python
1
.iter() .filter_map(|tx| tx.changes.keys()) .flatten() .filter(|changed_key| changed_key.key == "nkey") .count(); assert_eq!(nkey_changes, 3); harness.shutdown().await?; Ok(()) } }; } pub s...
Rust
0