text
string
label_name
string
labels
int64
n=act_fn, residual=residual, attention=attention, normalize=normalize, tanh=tanh)) self.add_module(f'A2V_{i}', EGCL_A2V(hidden_nf, hidden_nf, node_attr_nf, edge_attr_nf, hidden_nf, virtual_channels=virtual_channels, act_fn=act_fn, residual=residual, attention=...
Python
1
::global::k_poll_signal = unsafe { zephyr::poll::global::k_poll_signal::uninit() }; // A constructor function that calls its init #[allow(non_snake_case)] extern "C" fn #ctor() { use zephyr::poll::*; unsafe { #ident.init::<zephyr::context::Kernel>() } } ...
Rust
0
(), self.scheduler.clone()); MultiPaxosBuilder { state_machine: self.state_machine, config: self.config, master_strategy, scheduler: self.scheduler, } } /// Sets the master strategy to utilize a distinguished proposer pub fn with_distinguished...
Rust
0
new(numerator, denominator) .map_err(|e| Error::cli_arg(format!("invalid trust threshold fraction: {}", e))) } type UpgradeClientResult = Result<Vec<IbcEvent>, Error>; type UpgradeClientsForChainResult = Result<Vec<UpgradeClientResult>, Error>; struct OutputBuffer(Vec<UpgradeClientsForChainResult>); impl fmt...
Rust
0
]; F::from(x) + rhs }) .collect(); assert_eq!( transcript_messages .prover_round((namespace, 1)) .query_point(&[19, 29, 39], iop_trace!()), vec![vec![pm2_2[19]], vec![pm2_2[29]], vec![pm2_2[39]]] ); ...
Rust
0
prior_loglikelihoods (torch.Tensor) : Log-likelihoods of generating the sampled structures using the prior model. uniqueness (torch.Tensor) : Vector specifying the uniqueness ...
Python
1
SS5 /$S/$)=Return the list of possible upgrades for a client connection.rThe WebSocket transport is not available, you must install a WebSocket server that is compatible with your async mode to enable it. See the documentation for details. no-websocketr=rrrZ_log_error_once)re...
Python
1
# Copyright 2010 Hakan Kjellerstrand hakank@gmail.com # # 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 ...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType from .follower import Follower class CreateTaskFollowerRequest(BaseRequest): def __init__(self) -...
Python
1
from .node import create_graphrag_query_node __all__ = ["create_graphrag_query_node"]
Python
1
ASES ) def test_category_filtering_ref(allowed_schemas, expected_output): event_data = get_event_data( NESTED_EVENT_DATA, NESTED_CATEGORY_SCHEMA_REF, SCHEMA_ID, VERSION, allowed_schemas ) # Verify that *exactly* the right properties are recorded. assert expected_...
Python
1
eclare!(EGU2); declare!(EGU3); declare!(EGU4); declare!(EGU5); declare!(PWM0); declare!(PWM1); declare!(PWM2); declare!(PDM); declare!(PWM3); declare!(I2S); declare!(IPC); declare!(FPU); declare!(GPIOTE1); declare!(KMU); declare!(CRYPTOCELL); } use crate::{ForkCho...
Rust
0
n batch_paths: embedding = self.compute_image_embeddings(path) batch_embeddings.append(embedding) # Concat the embeddings of the batch and add to the index batch_embeddings = np.vstack(batch_embeddings) self.index.add(batch_embeddings) log...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 14 15:19:10 2025 @author: KalenJosifovski """ import torch import torch.nn as nn import torch.nn.functional as F class ImprovedProteinConvLSTMClassifier(nn.Module): def __init__(self, sequence_length, input_dim=26, conv_out_channels=64, kerne...
Python
1
trics responses.""" circuit_breakers: Dict[str, Any] = Field(..., description="Circuit breaker statistics") middleware: Dict[str, Any] = Field(..., description="Middleware performance metrics") timestamp: str = Field(..., description="Metrics collection timestamp") class Config: json_s...
Python
1
import argparse import glob import json import logging import os import time import cv2 import matplotlib.pyplot as plt import numpy as np import torch import torch.nn.functional as F from PIL import Image from torchvision import transforms from tqdm import tqdm from dataLoader import BasicDataset from models import ...
Python
1
i32 add %1 1) /// (%4 i32 add %2 2) /// (%5 i32 add %3 %4) /// ``` /// /// Can be reduced into /// /// ```plaintext /// (%6 i32 add %1 %2) /// (%5 i32 add %6 3) /// ``` fn eval_binary_deep(binary: &BinaryInst, f: &TacFunc) -> Option<(InstKind, Option<InstKind>)> { if !is_additive(binary.op) { return None; ...
Rust
0
addm, __adds, __divc, __modc, __mulc, __mulm, __ldmci, __ldmsi, __stmci, __stmsi, __stminti, __subc, __subml, __submr, }; use crate::BigInt; use crate::testing_emulated::P; // Doing nothing, at runtime as we test these instructions in a different // way in the test routines [at present] #[no_mang...
Rust
0
self.method(), self.password(), self.addr()); format!("ss://{}", encode_config(&param, URL_SAFE_NO_PAD)) } /// Get [SIP002](https://github.com/shadowsocks/shadowsocks-org/issues/27) URL pub fn to_url(&self) -> String { let user_info = format!("{}:{}", self.method(), self.password()); ...
Rust
0
rects_start = note_rects.get_center().copy() note_rects.add_updater(lambda m: m.move_to( note_rects_start + self.dist_per_sec * self.time * DOWN )) black_rect = Rectangle(width=piano.get_width(), height=5) black_rect.set_fill(BLACK, 1) black_rect.set_stroke(width=0) ...
Python
1
s( # title_opts=opts.TitleOpts(title=title), # 设置背景颜色 graphic_opts=[ opts.GraphicGroup( graphic_item=opts.GraphicItem( left="center", top="center", ...
Python
1
::Foundation::PSTR) -> i32>; #[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub type INSTALLUI_HANDLERW = ::core::option::Option<unsafe extern "system" fn(pvcontext: *mut ::core::ffi::c_void, imessagetype: u32, szmessage: super...
Rust
0
# Generated by Django 5.1.1 on 2024-10-10 02:14 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0004_receipt_image"), ] operations = [ migrations.CreateModel( name="ReceiptImage", ...
Python
1
)) .check_new_service::<Target, http::Request<_>>() .cache( svc::layers().push_on_response( svc::layers() .push_failfast(dispatch_timeout) .push_spawn_buffer_with_idle_timeout(buffer_capacity, cache_max_idle_age), ), ...
Rust
0
# Copyright (c) 2023 Binbin Zhang (binbzha@qq.com) # # 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 ...
Python
1
details. // // You should have received a copy of the GNU General Public License // along with Sulis. If not, see <http://www.gnu.org/licenses/> use std::collections::HashMap; use std::io::Error; use sulis_core::util::{gen_rand, unable_to_create_error}; use crate::{ItemState, Module}; const MAX_DEPTH: u32 = 10;...
Rust
0
self, i: u64) -> u64 { let n = self.len(); assert!(i < n); let chunk_size = Chunks::calc_chunk_size(n); let block_size = Blocks::calc_block_size(n); // 1. let i_chunk = i / chunk_size as u64; // 3. let rank_from_chunk = if i_chunk == 0 { 0 ...
Rust
0
# 영수 1~9 / 3개 # 민혁 1~9 / 3개 # 같은 자리면 strike / 존재하고 자리가 다르면 ball # 3 stike 면 게임 종료 from itertools import permutations T = int(input()) # 1~9 중 3자리 서로 다른 수 candidates = list(permutations(range(1, 10), 3)) # T개의 조건 입력 conditions = [] for _ in range(T): number, strike, ball = map(str, input().split()) number = ...
Python
1
] } } impl AsRef<str> for RenewalStatus { fn as_ref(&self) -> &str { self.as_str() } } #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive( std::clone::Clone, std::cmp::Eq, std::cmp::Ord, std::cmp::PartialEq, std::cmp::PartialOrd, std::fmt::De...
Rust
0
78400_BRM_saves', mcssavebrm.get_save_brm_path_prefix(root)) @patch('subprocess.check_call') def test_call_save_brm(self, mock_check_call): self.assertEqual(mcssavebrm.call_save_brm('test_path'), 'test_path') @patch('mcssavebrm.call_save_brm', return_value='test_path') @patch('mcssavebrm.get_s...
Python
1
interval() -> u32; } extern "C" { #[doc = " @brief Restart SNTP"] #[doc = ""] #[doc = " @return True - Restart"] #[doc = " False - SNTP was not initialized yet"] pub fn sntp_restart() -> bool; } extern "C" { pub fn dhcp_ip_addr_restore(netif: *mut ::core::ffi::c_void) -> bool; } extern ...
Rust
0
import requests import json class YandexTranslator: def __init__( self, api_key="Translator_key", api_id="api_id", folder_id="folder_id", target_language="ru", ): self.api_key = api_key self.api_id = api_id self.folder_id = folder_id self...
Python
1
# get model model = get_model(dls.vars, args) # get loss loss_func = torch.nn.MSELoss(reduction='mean') # get callbacks cbs = [RevInCB(dls.vars)] if args.revin else [] cbs += [ PatchCB(patch_len=args.patch_len, stride=args.stride), SaveModelCB(monitor='valid_loss', f...
Python
1
-3UTPKFvZimEpip/_vendor/rich/rule.pyXQo4~ϯC#QtO+THҁTx8Noe`{ݫB~ c;dR /offqn腂:wI蕂|ӹK}m_kֶ-뛪e]I9Ӿ}˜K{? XW3qUQ1~go_Fr/&v:!Qߌ {'Inpo ]eJ\2KOC- P;E[ˊliR.Aleht xj r_"ORi1᮷T5F.[#2dձp2I oS D0L*c1!ޯxue{hk4IgL[֨4tZaC园JgS'U;xXqW02㭞'ʷB6E"DyyC'$$-Y[M,{˖7Sk...
Python
1
Workers::Multi { storage: s, workers: w, } } Self::Single { worker } => Workers::Single { worker: worker.build(signal_queues.remove(0), session_queues.remove(0)), }, } } } /// Represents the ...
Rust
0
"top_services": sorted( service_stats.values(), key=lambda x: x["layer_count"], reverse=True )[:10] } if ctx: await ctx.info(f"统计信息获取完成: 总计 {total_count} 个图层") logger.info(f"图层资源统计完成: 总计 {total_count} 个...
Python
1
// pub(crate) traffic_samples: CyTrafficSamples, pub(crate) active_streams: usize, pub(crate) failed_streams: usize, pub(crate) total_streams: usize, pub(crate) sessions_running: usize, pub(crate) running_sessions_limit: usize, pub(crate) js_loop_cycle_gap: u32, pub(crate) current_trans...
Rust
0
c) if not utils.VerifySha1Hmac(cds, msg, hmac_digest, salt=hmac_salt): raise errors.GenericError("HMAC is wrong") if netutils.IP6Address.IsValid(host) or netutils.IP4Address.IsValid(host): destination = host else: destination = netutils.Hostname.GetNormalizedName(host) return (destination, ...
Python
1
200000; //Begin tests: println!("{}", c.add()); } fn cpu_testADD() -> bool { } /* fn cpu_test*() -> bool { } */ #![feature(test)] extern crate test; use std::mem::size_of; use test::Bencher; use urandom::{distributions, Distribution}; const RAND_BENCH_N: u64 = 1000; macro_rules! distr_int...
Rust
0
$(define_archive!(@get, $resource_type($resource_name, $is_optional $($args)* ));)* fn signature_name(archive_name: &str) -> String { format!("{}.archive", archive_name) } } impl ::std::fmt::Debug for $name { fn fmt(&self, f: &mut ::std::fmt...
Rust
0
strings::str_to_host(path.as_ref().as_str())?; Ok(path.into()) } } //! `NcMenu` widget // functions already exported by bindgen : 13 // ------------------------------------------ // ncmenu_create // ncmenu_destroy // ncmenu_item_set_status // ncmenu_mouse_selected // ncmenu_nextitem // ncmenu_nextse...
Rust
0
jsonify({'error': str(e)}), 500 @turnover_alert_bp.route('/api/generate_report') def api_generate_report(): """生成离职预警报告PDF""" try: if 'user_id' not in session: return jsonify({'error': '请先登录'}), 401 user = User.query.get(session['user_id']) if not user or user.user...
Python
1
does nothing unless polled/`await`-ed"] struct EpollFuture<'a> { syscall: &'a Syscall<'a>, events: Vec<EpollEvent>, time_now_ms: usize, timeout_ms: usize, } let now = ; impl<'a> Future for EpollFuture<'a> { type Output = LxRe...
Rust
0
# fees_app/urls.py from django.urls import path from rest_framework import routers from django.urls import path, include from rest_framework.response import Response from .views import FeepaymentView, UpdateFeePaymentView, FeePaymentDetailView, AddFeePayment # router = routers.DefaultRouter() # router.register('feepa...
Python
1
time/chrono/MinguoDate", java.flags == (empty), .name == "<init>", .descriptor == "(Ljava/time/LocalDate;)V" // unsafe { // let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())]; // let (__jni_class, __jni_method) = __jni_env.require_class_method("java/time/chro...
Rust
0
ter def NotifyUrl(self, NotifyUrl): self._NotifyUrl = NotifyUrl @property def CmqModel(self): return self._CmqModel @CmqModel.setter def CmqModel(self, CmqModel): self._CmqModel = CmqModel @property def CmqRegion(self): return self._CmqRegion @CmqRegio...
Python
1
::Scope<'_>, ) -> evoke::server::Replicate<&'a TileMap> { match history { Some(history) if *history == *item => evoke::server::Replicate::Unmodified, _ => evoke::server::Replicate::Modified(item), } } } <reponame>XFaonAE/millennium // Copyright 2022 pyke.io // 2...
Rust
0
umber of `D` records at each time `T`. //! The progress tracking logic assumes that this number is independent of the pact used. use std::{fmt::{self, Debug}, marker::PhantomData}; use timely_container::PushPartitioned; use crate::communication::{Push, Pull, Data}; use crate::communication::allocator::thread::{Thread...
Rust
0
); /// /// impl Pos { /// fn successors(&self) -> Vec<Pos> { /// let &Pos(x, y) = self; /// vec![Pos(x+1,y+2), Pos(x+1,y-2), Pos(x-1,y+2), Pos(x-1,y-2), /// Pos(x+2,y+1), Pos(x+2,y-1), Pos(x-2,y+1), Pos(x-2,y-1)] /// } /// } /// /// static GOAL: Pos = Pos(4, 6); /// let result = iddfs(Pos(1, 1), |p...
Rust
0
scores} name = (class_info.get("name") or "").lower() bases = [b.lower() for b in (class_info.get("bases") or [])] body = (class_info.get("body") or "").lower() functions = class_info.get("functions", []) rel = ((class_info.get("source_info") or {}).get("rel_path") or "").replac...
Python
1
\ isdataat:1, relative; \ byte_jump:2, 2, relative, big; \ content:!"|00 00|"; distance:0; within:2; \ isdataat:1, relative; \ byte_jump:2, 2, relative, big; \ xbits:isset,koen_supports_sni,track ip_dst; \ xbits:isnotset,koen_supports_sni_domain,track ip_dst; \ xbits:isnotset,koen_supports_sni_ipv4,track ip_dst; \ thr...
Python
1
(&self) -> u8 { match *self { SpriteSize::Size8x8 => 8, SpriteSize::Size8x16 => 16, } } } #[derive(Copy, Clone, Deserialize, Serialize)] struct PpuCtrl { val: u8, } impl PpuCtrl { fn vram_address_increment(self) -> VramAddressIncrement { if (self.val & 0x04)...
Rust
0
pBox( inPmGroupBox, title = "<b> PM_CheckBox examples</b>" ) self.checkBox1 = \ PM_CheckBox( self.checkBoxGroupBox, text = "Widget on left:", widgetColumn = 1, state = Qt.Chec...
Python
1
signatures, }), write_set: ws, events: vec![], major_status: StatusCode::ABORTED, gas_used: 0, }; txn_to_apply } mod channel_test; mod tx_applier_test; #[derive(Debug)] pub enum MirroringType { Hor = 0, Vert = 1, FourScreen = 0xf, } pub fn is_v...
Rust
0
0.0, 0.0, 0.0), &Point::new(165.0, 330.0, 165.0), Arc::clone(&white), )); box1 = Arc::new(RotateY::new(box1, 15.0)); box1 = Arc::new(Translate::new(box1, &Vec3::new(265.0, 0.0, 295.0))); objects.add(box1); let mut box2: Arc<dyn Hittable + Sync + Send> = Arc::new(boxes::Box::new( ...
Rust
0
ps::BitOr<_ze_image_flags_t> for _ze_image_flags_t { type Output = Self; #[inline] fn bitor(self, other: Self) -> Self { _ze_image_flags_t(self.0 | other.0) } } impl ::std::ops::BitOrAssign for _ze_image_flags_t { #[inline] fn bitor_assign(&mut self, rhs: _ze_image_flags_t) { sel...
Rust
0
import sys from typing import Optional class CustomException(Exception): """ Custom exception class for detailed error tracking. Captures message, original exception, filename, and line number. """ def __init__(self, message: str, error_detail: Optional[Exception] = None): """ Ini...
Python
1
with codecs.open(word_freq_filename)as f: for line in f.readlines(): splited_line = line.split("\t") freq = splited_line[1] if freq.strip() != '0': # print line.strip() zero_freq_list.append(line) print len(zero_freq_list) # des_...
Python
1
"""Utility functions for creating A2A Artifact objects.""" import uuid from typing import Any from a2a.types import Artifact, DataPart, Part, TextPart def new_artifact( parts: list[Part], name: str, description: str = '' ) -> Artifact: """Creates a new Artifact object. Args: parts: The list of...
Python
1
: XRInput, pub other_inputs: Vec<XRInput> } <filename>src/main.rs extern crate clap; extern crate glob; fn main() { let app = clap::App::new("globtest") .version("0.1") .author("NeoSmart Technologies <https://neosmart.net/>") .about("Print the results of rs-glob expressions") .a...
Rust
0
&self) -> Option<ShareId<NSMenu>> => [self, mainMenu] -> *mut AnyObject; fn set_main_menu(&self, main_menu: Option<ShareId<NSMenu>>) => [self, setMainMenu:(menu: *mut AnyObject)]; fn activate_ignoring_other_apps(&self, flag: bool) => [self, activateIgnoringOtherApps:(...
Rust
0
x_lst, y_lst, coordinates = [], [], [] for _ in range(3): x, y = map(int, input().split()) x_lst.append(x), y_lst.append(y), coordinates.append([x, y]) X, Y = set(x_lst), set(y_lst) ans = [str(x)+' '+str(y) for x in X for y in Y if [x, y] not in coordinates] print(ans[0])
Python
1
intersect_attributes(nested, context, self.variables, left, right) } else { panic!( "Attribute<->Attribute joins can't target more than two variables." ); } } ...
Rust
0
Geschwindigkeit { leiter: if self.aktueller_tab == &0 { (self.pwm_nachricht)( self.umdrehen_anschluss.clone(), self.pwm_pin.clone(), *self.pwm_polarität...
Rust
0
loomConfig, BloomPingPongBuffer, FrameBufferTexture, ShaderProgram, ShaderUniformKey, TextureUnit, }, }; use gl; use std::ffi::CString; #[derive(Copy, Clone, PartialEq, Eq, Hash)] enum UniformKey { Bloom, BloomIntensityMultiplier, Scene, } impl ShaderUniformKey ...
Rust
0
Source::Unknown); let mut lexer = WordLexer { lexer: &mut lexer, context: WordContext::Word, }; let result = block_on(lexer.word(|c| { assert_eq!(c, '\'', "unexpected call to is_delimiter({:?})", c); false })) .unwrap(); i...
Rust
0
from django.shortcuts import render from rest_framework import generics, status from rest_framework.response import Response from .models import Blogpost, Camera, Lens from .serializers import BlogpostSerializer, CameraSerializer, LensSerializer from rest_framework.views import APIView # Create your views here. clas...
Python
1
]) { // new `bulk_class` event // owned pointer equivalent to `alloc::boxed::Box<[u8; N]>` let mut buf: Box<P> = P::alloc().expect("OOM").freeze(); if let Ok(n) = bulk_class.ep_bulk_out.read(&mut *buf) { cx.spawn.process_packet(buf, n).ok().expect("OOM");...
Rust
0
in self.fractional.to_owned() { unit /= 3.0; let v = item.to_float(); result.x += v.x * unit; result.y += v.y * unit; } result } /// buffer format /// [integral length]+[integral pairs]+[fractional pairs] pub fn to_buffer(&self) -> Result<Vec<u8>, String> { // make sure no e...
Rust
0
TokenMapping::new("type", &[], "Type"), ]; let actual = semantic_tokens_to_highlights(&legend, mappings, tokens); let expect = vec![ Highlight { line: 2, character_start: 5, character_end: 8, group: "Type".into(), ...
Rust
0
data_block.records.len() as f64) / (get_number_of_threads() as f64)) .ceil() as usize; let mut rows_aggregators: Vec<RowsAggregator> = Vec::default(); let attr_rows_map = Arc::new(self.data_block.calc_attr_rows()); for c in &self .data_block .records ...
Rust
0
c!( "Type error: aggregator {:?} not defined for values {:?} and {:?}", aggregator, *accumulator, *elem ) } } } } impl Solution { pub fn can_i_win(max_choosable_integer: i32, desired_total: i32) -...
Rust
0
es.is_present("no-std"); if !no_std { std::process::Command::new("git") .args(&[ "clone", "<EMAIL>:wasplang/std.git", &format!("{}/vendor/{}", f, "std"), ...
Rust
0
# MIT License # # Copyright (c) 2024 milestonesys-research # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
Python
1
msg) => { panic!( "{}MicroXml {} incorrect : {}{}", *crate::RED, file_name, err_msg, *crate::RESET ); } } } } <filename>lib/backend-java/src/compiler.rs //! Java ba...
Rust
0
Utf8GeneralCi, #[iden = "utf8_tolower_ci"] Utf8TolowerCi, #[iden = "utf8_bin"] Utf8Bin, #[iden = "utf8_unicode_ci"] Utf8UnicodeCi, #[iden = "utf8_icelandic_ci"] Utf8IcelandicCi, #[iden = "utf8_latvian_ci"] Utf8LatvianCi, #[iden = "utf8_romanian_ci"] Utf8RomanianCi, ...
Rust
0
harged = maker_fee.mul_ceil(tb_delta); ensure!( mb_delta + base_charged == tb_delta, Error::<T>::ProofsUnsatisfied ); debug::debug!("ask-limit traded_base == base_fee + sum_of_maker_base_delta"); // FIXME ceil let quote_charged ...
Rust
0
Arg; use cron_gate::expression::{Expression, DATE_FORMAT}; fn main() { let app = app_from_crate!() .arg( Arg::with_name("expression") .help("Cron Expression '* * * 7 * [command]'") .required(true), ) .arg( Arg::with_name("after") ...
Rust
0
#!/usr/bin/env python3 # date: 2019.11.24 import selenium.webdriver driver = selenium.webdriver.Firefox() html_content = """ <div class=div1> <ul> <li> <a href='path/to/div1stuff/1'>Generic string 1</a> <a href='path/to/div1stuff/2'>Generic string 2</a> ...
Python
1
in secrets: severity = secret.get("Severity", "UNKNOWN") severity_enum = ( Severity(severity) if severity in Severity.__members__ else Severity.UNKNOWN ) ...
Python
1
bool { #[inline(always)] fn from(variant: REG_GPIO_15_SMT_A) -> Self { variant as u8 != 0 } } #[doc = "Field `reg_gpio_15_smt` reader - Schmitt trigger enabled for GPIO15."] pub struct REG_GPIO_15_SMT_R(crate::FieldReader<bool, REG_GPIO_15_SMT_A>); impl REG_GPIO_15_SMT_R { pub(crate) fn new(bit...
Rust
0
"""Base class for flow state persistence.""" import abc from typing import Any, Dict, Optional, Union from pydantic import BaseModel class FlowPersistence(abc.ABC): """Abstract base class for flow state persistence. This class defines the interface that all persistence implementations must follow. ...
Python
1
Non-CM case # NB The following functions first computes a finite set # containing the reducible primes, then checks that each is # reducible by computing l-isogenies. This appears circular # but the computated l-isogenies for a fixed prime l is # cached. if verbose: print("Non-CM cas...
Python
1
chr } else if (g - c_max).abs() < Scalar::EPSILON { // Yellow to cyan 2.0 + (b - r) / chr } else { // Cyan to magenta 4.0 + (r - g) / chr }; if h < 0.0 { h += 6.0; } else if h >= 6.0 { h -= 6.0; } ...
Rust
0
sadi = any( isinstance(o, (cs.SX, cs.MX, cs.DM)) for o in [ g, thrust_coeff, pitch_d, pitch_dd, pitch_gain, roll_d, roll_dd, roll_gain, ] ) ...
Python
1
if vespene_places: current_place = min(vespene_places, key=lambda place: place.distance_to(worker)) else: current_place = min(deficit_mining_places, key=lambda place: place.distance_to(worker)) deficit_mining_places.remove(current_place) ...
Python
1
crate::Reg<ef_key_slot_1_w3::EF_KEY_SLOT_1_W3_SPEC>, #[doc = "0x3c - ef_key_slot_2_w0."] pub ef_key_slot_2_w0: crate::Reg<ef_key_slot_2_w0::EF_KEY_SLOT_2_W0_SPEC>, #[doc = "0x40 - ef_key_slot_2_w1."] pub ef_key_slot_2_w1: crate::Reg<ef_key_slot_2_w1::EF_KEY_SLOT_2_W1_SPEC>, #[doc = "0x44 - ef_key_sl...
Rust
0
import json import random import numpy as np from openai import OpenAI from config import openai_client,model,epochs,system_message import matplotlib.pyplot as plt num_of_samples=100 # === Setup === client = OpenAI() model_name = "ft:gpt-3.5-turbo-1106:walid::CMlot2Tx" # Load test dataset with open("test.jsonl", "r...
Python
1
["details"]), **dev_stats, **test_stats, } else: flattened_result = {**without_keys(result, ["details"])} scalared_flattened_result = non_scalar_to_str(flattened_result) flattened_results[named_id] = scalared_flattened_result df = pd...
Python
1
from types import SimpleNamespace from prediction.configs.baseline import baseline_cfg model_cfg = baseline_cfg model_cfg.LIFT = SimpleNamespace( # Long BEV dimensions X_BOUND = [-50.0, 50.0, 0.5], # Forward Y_BOUND = [-50.0, 50.0, 0.5], # Sides Z_BOUND = [-10.0, 10.0, 20.0], # Hei...
Python
1
#write a program in which u take an integer input from the user if it is divisible by 3 and 6.print good number #if the integer is divisible by 2 and 7 then print an average number #if the integer is divisible by 4 or 9 then print awesome number, #else print bad number a=int(input("Enter the number:")) if a%3==0 an...
Python
1
eader = BufReader::new(file); let mut validator = MessageValidator::new(); let mut line = String::new(); loop { let bytes = reader .read_line(&mut line) .unwrap_or_else(|_| panic!("Failed to read line")); if bytes == 0 { break; } let tri...
Rust
0
regate(args=self.args, dim=128, dim_head=128, heads=self.args.num_heads) def forward(self, net, inp, corr, flow, attention): motion_features = self.encoder(flow, corr) motion_features_global = self.aggregator(attention, motion_features) inp_cat = torch.cat([inp, motion_features, motion_feat...
Python
1
mut rlp::RlpStream, opt: &Option<T>) { if let Some(inner) = opt { rlp.append(inner); } else { rlp.append(&""); } } /// normalizes the signature back to 0/1 pub(crate) fn normalize_v(v: u64, chain_id: crate::types::U64) -> u64 { if v > 1 { v - chain_id.as_u64() * 2 - 35 } els...
Rust
0
# Generated by Django 5.0.6 on 2024-09-14 13:32 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course', '0004_alter_course_code'), ('department', '0001_initial'), ] operations = [ migrations.Add...
Python
1
lf.total_function_time) / float(self.total_time_since_arming))) def execute(self, actions): # arm the time measurements the first time execute is hit self.arm_time_measurements() self.update_time_function_start() # send the control message self.communicate_socket("CONTROL"...
Python
1
Field, P: Parameters<BaseField = F> + Clone, { circuit.check_vars_bound(scalars)?; for base in bases.iter() { circuit.check_point_var_bound(base)?; } let scalar_0_bits_le = circuit.unpack(scalars[0], scalar_bit_length)?; let mut res = circuit.variable_base_binary_scalar_mul::<P>(&scalar...
Rust
0
.get(byte_idx).map(|byte| { let mask = 0b_1000_0000 >> self.bit_idx % 8; pixel_value[0] = (byte & mask != 0) as u8; }), Bpp::Bits8 => self .pixel_data .get(byte_idx) .map(|byte| pixel_value[0] = *byte), B...
Rust
0
PathBuf; use super::*; #[tokio::test] async fn test_builder() { // Device selection. Options are *additive* let mut b = Builder::new(); b // Discover any matching usb devices .with_default_usb() .unwrap() // Discover usb devices match...
Rust
0
from .sparse_vector_typed_dict import SparseVectorTypedDict from .vector_typed_dict import VectorTypedDict from .vector_metadata_dict import VectorMetadataTypedDict from .vector_tuple import VectorTuple, VectorTupleWithMetadata from .query_filter import FilterTypedDict from .search_rerank_typed_dict import SearchRerank...
Python
1