text
string
label_name
string
labels
int64
"""empty message Revision ID: c5cefe557518 Revises: ed9a97d65548 Create Date: 2025-05-16 01:35:29.985419 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'c5cefe557518' down_revision: Union[str, None] = 'ed9a97d65548' bra...
Python
1
""" `plotly_express` is now an alias for `plotly.express` """ __version__ = "0.4.1" # sync with setup.py! from plotly.express import *
Python
1
import pytest from femora.components.Material.materialBase import Material from femora.components.Material.materialsOpenSees import Steel01Material @pytest.fixture(autouse=True) def clear_materials_registry(): Material.clear_all() yield Material.clear_all() def test_steel01_tcl_output_defaults(): m...
Python
1
from rest_framework import generics from .models import Subject, Result from .serializers import SubjectSerializer, ResultSerializer class SubjectListCreate(generics.ListCreateAPIView): queryset = Subject.objects.all() serializer_class = SubjectSerializer class SubjectRetrieveUpdateDestroy(generics.RetrieveU...
Python
1
lassification, TFRoFormerLayer, TFRoFormerModel, TFRoFormerPreTrainedModel, ) try: if not is_flax_available(): raise OptionalDependencyNotAvailable() except OptionalDependencyNotAvailable: pass else: from .modeling_flax_roforme...
Python
1
### REGULAR EXPRESSIONS ### # Exercises Level 1 #1. import re paragraph = 'I love teaching. If you do not love teaching what else can you love. I love Python if you do not love something which can give you all the capabilities to develop an application what else can you love.' words = re.findall(r'\b\w+\b', paragrap...
Python
1
paypal](https://paypal.me/LucianoBestia). //! You know the price of a beer in your local bar ;-) //! So I can drink a free beer for your health :-) //! [Na zdravje!](https://translate.google.com/?hl=en&sl=sl&tl=en&text=Na%20zdravje&op=translate) [Alla salute!](https://dictionary.cambridge.org/dictionary/italian-e...
Rust
0
(self) -> LockFile: """Context manager to create a lock file for the cache directory and remove it afterwards. """ return LockFile( self.getCacheLockFilename(), timeout = 10, wait_msg = "Waiting for lock file in cache directory to disappear." ...
Python
1
ize: {}, type: {}, model: {}, serial: {})".format( disk["State"], volume, disk["Size"], disk["Disk Type"], disk["Model"], disk["Serial Number"], ) return rstcli_states.get(disk["State"], 2), infotext ...
Python
1
long = 0x10000000; pub const SECBUFFER_RESERVED: ::c_ulong = 0x60000000; STRUCT!{struct SEC_NEGOTIATION_INFO { Size: ::c_ulong, NameLength: ::c_ulong, Name: *mut SEC_WCHAR, Reserved: *mut ::c_void, }} pub type PSEC_NEGOTIATION_INFO = *mut SEC_NEGOTIATION_INFO; STRUCT!{struct SEC_CHANNEL_BINDINGS { d...
Rust
0
""" ========================================== Benchmark collision detection for capsules ========================================== """ print(__doc__) import numpy as np from pytransform3d.transform_manager import TransformManager import pytransform3d.visualizer as pv from distance3d.random import rand_capsule from d...
Python
1
from diffusion import diffusion_collision_kernel, streaming_kernel_periodic from reverse_collision import diffusion_collision_kernel_reverse from reverse_pull import streaming_kernel_periodic_reverse import numpy as np from numba import cuda if __name__ == "__main__": # do collision streaming and reverse collision...
Python
1
bstr2string(&right_maximal(&v1cvec, &lgmap)[v1.len()..]); let v2str = bstr2string(&left_maximal(&right_maximal(&v1cvec, &lgmap), &rgmap)); edges.push((v1str.clone(), label, v2str)); } } } stree_json::StreeSerde { nodes, edges } } use actix_files as fs; use ac...
Rust
0
4]; } cap.corners = copy; perspective_setup(&mut cap.c, &cap.corners, 7.0, 7.0); } fn record_qr_grid( image: &mut ImageMut<'_>, regions: &mut Vec<Region>, capstones: &mut [Capstone], grids: &mut Vec<Grid>, mut a: usize, b: usize, mut c: usize, ) { if grids.len() >= 8 { ...
Rust
0
g.error("The number of replicas to remove must be greater than zero") return jsonify({"error": "The number of replicas to remove must be greater than zero"}), 400 if n > len(replicas): logging.error("The number of replicas to remove exceeds the number of available replicas") return jsonify(...
Python
1
stant_loop() { let mut program = parse("+++++++++++++[>+>++>>+++<<<<-]->>>>>>+").unwrap(); optimize_with_config(&mut program, &OptimizeConfig::o3()); let input = b""; let mut output = Vec::new(); let heap = run(&program, Cursor::new(input), &mut output); assert_eq!(hea...
Rust
0
from django.urls import path from . import views urlpatterns = [ path('',views.home, name='home'), path('contacto/nuevo/', views.contacto_nuevo, name="contacto_nuevo"), path('contacto/<int:pk>/', views.contacto_detalle, name="contacto_detalle"), path('contacto/<int:pk>/editar/', views.contacto_editar, ...
Python
1
se std::os::unix::fs::symlink; use std::sync::Arc; use std::collections::HashMap; use prelude::*; use ctx::Context; use rt::common::Runtime; use utils::cmd::{CommandBuilder, CommandHandlers}; use config::{ToolSpec, ToolStep, ToolCommand, ReportPatternMatch}; use report::Report; use formatting::FormatResult; use parki...
Rust
0
key_sig: Signature, } impl DecryptionRequest { pub fn new(body: DecryptionRequestBody, view_key_sig: Signature) -> Self { DecryptionRequest { body, view_key_sig } } pub fn create<C: Signing>( secp: &Secp256k1<C>, txs: Vec<TxId>, challenge: H256, view_secret_key: &Se...
Rust
0
("_rust_rocksdb_set_cache_and_index").expect(""); let mut opts = Options::new(); opts.create_if_missing(true); let mut block_opts = BlockBasedOptions::new(); block_opts.set_pin_l0_filter_and_index_blocks_in_cache(true); opts.set_block_based_table_factory(&block_opts); DB::open(opts, path.path()....
Rust
0
&U)) -> T { let mut result = start; for iter |x| { f(&mut result, x); } result } /** * Return the sum of the items yielding by an iterator. * * # Example: * * ~~~ {.rust} * let xs: ~[int] = ~[1, 2, 3, 4]; * assert_eq!(do sum |f| { xs.iter().advance(f) }, 10); * ~~~ */ #[inline] pub fn...
Rust
0
}".format(os.path.join(site_path, 'php-cli.ini'))) # 尝试安装composer中的依赖 self.print_log(logs_path, '开始安装composer依赖!\n') # self.print_log(logs_path, 'cd {} && export COMPOSER_ALLOW_SUPERUSER=1 && /www/server/php/{}/bin/php -c {} /usr/bin/composer{} install --no-interaction &>> {}'.format(site_path,...
Python
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/copyleft/gpl.txt from pisi.actionsapi import autotools from pisi.actionsapi import shelltools from pisi.actionsapi import pisitools from pisi.actionsapi import get shelltools.export...
Python
1
ast::RangeLimits::Closed, }) }, hir::ExprKind::Struct(path, fields, None) => match &path { hir::QPath::LangItem(hir::LangItem::RangeFull, ..) => Some(Range { start: None, end: None, limits: ast::RangeLim...
Rust
0
from wrike.wrike.workflow import ( create_workflow, get_workflow_id, get_workflow_metadata, get_workflow_name, get_custom_statuses_by_id, update_workflow ) # ===== example variables ============================================================================================ custom_status = [{'n...
Python
1
(WordsToNumbers.__ones__[hundreds_match.group(1)] * 100) # the tens- and ones-place value is whatever is left tens_and_ones = hundreds_match.group(2) else: # if there was no string matching the 'n hundred' pattern, # assume that the entire string con...
Python
1
import math import open3d as o3d import cv2 import numpy as np def circle_mask(size=(64, 48), border=0, channels=0): """ used to filter center circular area of a given image, corresponding to the geltip surface area """ if channels == 0: m = np.zeros((size[1], size[0])) m_...
Python
1
"""" Use this if: - the array might be sorted and then rotated around some unknown pivotor some elements might be modified based on a specific condition. - searching for a target satisfying multiple requirements, a modified binary search can be used. e. g. finding a range rather than a single target or...
Python
1
elf.m) } /// Calculates the [`Distance`] given the [`Speed`] (`d = s × t`). #[inline] pub fn calc_distance(&self, s: Speed) -> Distance { Length::new(self.m * s.m) } /// Derives Time from the given [`Energy`] and [`Power`] (`t = E / P`). #[inline] pub fn from_energy_power(e: En...
Rust
0
") } fn get_default_tasks_max(&self) -> Result<u64, Self::Err> { <Self as dbus::stdintf::org_freedesktop_dbus::Properties>::get(&self, "org.freedesktop.systemd1.Manager", "DefaultTasksMax") } fn get_timer_slack_nsec(&self) -> Result<u64, Self::Err> { <Self as dbus::stdintf::org_freedes...
Rust
0
Q6 => 90, Interrupt::GPIOQ7 => 91, Interrupt::TIMER6A => 98, Interrupt::TIMER6B => 99, Interrupt::TIMER7A => 100, Interrupt::TIMER7B => 101, Interrupt::I2C6 => 102, Interrupt::I2C7 => 103, Interrupt::I2C8 => 109, ...
Rust
0
"a.b".into(), problem: "LackOf".into(), ctx: "".into(), }), ..Default::default() } ); // Incomplete let e = ProtocolError::Incomplete("foo".into(), 5, 4); assert_eq!("incomplete field:foo, need:5, but:4", format!("{}", e)); let q: QE...
Rust
0
Rust language binding. // // Licensed under the MIT license or the Apache license (version 2.0), at your option. You may not // copy, modify, or distribute this file except in compliance with said license. You can find copies // of these licenses either in the LICENSE-MIT and LICENSE-APACHE files, or alternatively at ...
Rust
0
(&sqlite_test_file()).unwrap(); let test_setup = TestSetup { sql_family: SqlFamily::Sqlite, database: Arc::clone(&connector.database), }; let api = test_api(connector); test_fn(&test_setup, &api); } else { println!("--------------- Ignoring SQLite ---...
Rust
0
class Employee: def __init__(self, name, salary, ssn): self.name = name # public self._salary = salary # protected self.__ssn = ssn # private def display_info(self): print(f"Name: {self.name}") print(f"Salary: {self._salary}") print(f"SSN...
Python
1
} } <filename>firebase-auth-lite/tests/test_auth.rs use firebase_auth_lite::{Auth, AuthOptions, OauthFlowOptions}; use wasm_bindgen_test::*; wasm_bindgen_test_configure!(run_in_browser); #[wasm_bindgen_test(async)] async fn test_auth_sign_out() { let auth = Auth::new(AuthOptions::new("not-an-api-key")); ...
Rust
0
import chainer import numpy from .base_model import BaseModel from ..utility.image import array_to_image class SimpleConvolution(BaseModel): def __init__(self, loss_type='RGB'): out_channels = 2 if loss_type == 'ab' else 3 super(SimpleConvolution, self).__init__( conv1=chainer.functio...
Python
1
is the very /// minimum. /// /// The L2CAP implementation will not forward PDUs to the protocol unless this amount of space /// is available in the TX buffer. pub fn response_pdu_size(&self) -> u8 { self.rsp_pdu } /// Returns the protocol connected to the channel. pub fn protoc...
Rust
0
.and_then(|(p, c)| pathdiff::diff_paths(p, path).map(|p| (p, c))) .and_then(|(p, c)| p.to_str().map(|p| (p.to_owned(), c))) .map(|(p, c)| { let name = p.replace("\\\\", "/").replace("\\", "/"); println!("* Include file: {:?} as: {:?...
Rust
0
KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ------------------------------------------------------------------------------ */ #![allow(unknown_lints)] use block::Block; use consensus::notifier::BackgroundConsensusNotifi...
Rust
0
page); Ok((self.pages.get_mut(&frame_id), page_id)) } else { Ok((None, INVALID_PAGE_ID)) } } // find in free lists first, then replacer fn find_replacement(&mut self) -> Option<FrameId> { if let Some(frame_id) = self.free_list.pop_front() { Some(...
Rust
0
y_pred_list += lst for y, m in zip(target, mask): y_true_list += y[m == True].tolist() eval_loss += loss.item() eval_labels = list(label2id.keys()).copy() eval_labels.remove('O') assert ...
Python
1
import time from .backend import InMemoryCachedBackend from ._networkx import NetworkXBackend from ._sqlbackend import SQLBackend def test_can_create_cached_backend(): InMemoryCachedBackend(NetworkXBackend(), maxsize=1024, ttl=20) def test_can_add_node(): vanilla = NetworkXBackend() cached = InMemoryCac...
Python
1
"throwNpeIfArgIsNullNested2(ExceptionTestFixture.java:48)\n\t" \ "at org.jpy.fixtures.ExceptionTestFixture." \ "throwNpeIfArgIsNullNested3(ExceptionTestFixture.java:53)\n" \ "caused by java.lang.NullPointerException\n\t" \ ...
Python
1
def findLongestChain(pairs): """ Find the maximum length of a pair chain. Args: pairs (list of tuple): A list of pairs where each pair is represented as a tuple `(a, b)`. The goal is to find the maximum number of pairs (a, b) such that for any two pairs ...
Python
1
for v in vars.iter() { self.gen_def_var(v); } let mut emitter = Emitter::new(&mut self.objects.functions[fkey]); emitter.emit_return_init_pkg(index, None); self.func_stack.pop(); } } impl<'a> ExprVisitor for CodeGen<'a> { type Result = (); fn visit_expr(&m...
Rust
0
func: Callable[P, T], cache_strategy: CacheStrategy ) -> Callable[P, T]: ... @overload def with_cache_strategy( func: Callable[P, Awaitable[T]], cache_strategy: CacheStrategy ) -> Callable[P, Awaitable[T]]: ... @check_arg_types def with_cache_strategy( func: Callable[P, Awaitable[T]] | Callable[P, T], c...
Python
1
from collections import Counter from os.path import join, dirname, getmtime from polyglot_piranha import Rule, RuleGraph, execute_piranha, PiranhaArguments, Filter import logging from logging import info find_Replace_dir = join(dirname(__file__), "find_replace") def thrift_demo(): file_path = join(find_Replace_...
Python
1
1); /// /// let mut switch = Switch::new(); /// switch.set_entry(0, block0); /// switch.set_entry(1, block1); /// switch.set_entry(7, block2); /// switch.emit(&mut builder, val, fallback); /// ``` #[derive(Debug, Default)] pub struct Switch { cases: HashMap<EntryIndex, Block>, } impl Switch { /// Create a new...
Rust
0
_H_H, LD_H_L, LD_H_pHL, LD_H_A, LD_L_B, LD_L_C, LD_L_D, LD_L_E, LD_L_H, LD_L_L, LD_L_pHL, LD_L_A, LD_pHL_B, LD_pHL_C, LD_pHL_D, LD_pHL_E, LD_pHL_H, LD_pHL_L, HALT, LD_pHL_A, LD_A_B, LD_A_C, LD_A_D, LD_A_E, LD_A_H, LD_A_L...
Rust
0
Array; use std::mem; use std::slice; use std::sync::Arc; use std::time::SystemTime; pub const DNSCRYPT_CERTS_TTL: u32 = 86400; pub const DNSCRYPT_CERTS_RENEWAL: u32 = 28800; fn now() -> u32 { SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .expect("The clock is completely off") ....
Rust
0
e full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ extern crate clap; #[macro_use] extern crate uucore; use std::fs::File; use std::io::{stdin, BufRead, BufReader, Lines, Stdin}; use std::cmp::{min, Ordering}; use clap::{App, Arg}; static NAME: ...
Rust
0
self.len() == 0 } pub fn bases_len(&self, graph: &FnvHashMap<NodeId, Node>) -> usize { self.nodes .iter() .filter_map(|handle| graph.get(&handle.id()).map(|n| n.sequence.len())) .sum() } pub fn lookup_step_handle(&self, step: &PathStep) -> Option<Handle> { ...
Rust
0
estVersion: u32, pub dwClusterLowestVersion: u32, pub dwFlags: u32, pub dwReserved: u32, } impl ::core::marker::Copy for CLUSTERVERSIONINFO {} impl ::core::clone::Clone for CLUSTERVERSIONINFO { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_Networking_Cl...
Rust
0
# -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2012-2020 iSolver Software Solutions (C) 2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). import psychopy.logging as logging try: from psychopy_eyetracker_sr_research.sr_research.eyelink impor...
Python
1
ltiplicities in the `bonds` slice aren't `∈ 1..=3` /// - Any of the members of `atoms` aren't `∈ 1..=118` (i.e. they aren't valid atomic numbers) /// /// # Panics /// Panics when `debug_assertions` are enabled if any of the safety pre-conditions are violated. /// This makes this function safe, since it will panic if an...
Rust
0
ee += 1 elif y == 2: degree += x['ch_num'] / channel x["degree"] = degree interference_degree.append(x) interference_degree = sorted(interference_degree, key=lambda item: item['degree']) start_time = time.time() S = LR_schedule(interference_degree, conflict_matrix...
Python
1
db = &ctx.data::<GlobalContext>()?.userdb; let user_count = userdb.get_users_count().await?; if user_count > 0 && !check_is_admin(ctx)? { return Err("Forbidden".into()); }; if password.len() < 8 { return Err("Password less than 8 character".into()); } ...
Rust
0
S ===") video_path = "C:\\Users\\Karan Doifode\\Downloads\\ai8.mp4" # Replace with your video path try: # Analyze consecutive frames (30 frames from the 10% mark in the video) video_results = detector.analyze_video(video_path, max_frames=40, start_position=0.1) detector.print_results(vi...
Python
1
}); } Ok(RtmpMessage::SetChunkSize { size }) } #[cfg(test)] mod tests { use super::{serialize, deserialize}; use std::io::Cursor; use byteorder::{BigEndian, WriteBytesExt}; use bytes::Bytes; use ::messages::{RtmpMessage}; #[test] fn can_serialize_message() { let size = 52...
Rust
0
12] } //------------------------------------------------------------------------------ pub fn get_esr_el3() -> u32 { let esr; unsafe { asm!("mrs $0, esr_el3" : "=r"(esr)) }; esr } // from the current EL using the current SP0 #[no_mangle] pub fn curr_el_sp0_sync_el3(__ctx: *mut Context) { driver::uar...
Rust
0
import matplotlib.pyplot as plt import numpy as np from eval_agent.utils.gridworld_visualize import * import json from gridworld.gridworld_agent.envs.GridworldTextEnv import Gridworld import os import seaborn as sns from tqdm import tqdm PATH = ["", ""] NAME = ["Ours", "DFS"] COLOR = ["blue", "red"] def main(): ...
Python
1
Some((i, 'z')) => push_specifier!(i, Specifier::z), Some((i, '%')) => literal_start = i, Some((_, c)) => return Err(format!("Invalid specifier `{}`", c)), None => { return Err(String::from( "Cannot end formatting with `%`...
Rust
0
* * The version of the OpenAPI document: 1.0.0-oas3 * * Generated by: https://openapi-generator.tech */ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Nominations { /// The targets of the nomination. #[serde(rename = "targets", skip_serializing_if = "Option::is_none")] pub ...
Rust
0
(usize, usize) -> S, { let r0 = [f(0, 0), f(0, 1)]; let r1 = [f(1, 0), f(1, 1)]; Matrix2d { a: [r0, r1] } } /// Returns a row vector of a matrix. pub fn row_vec(&self, i: usize) -> Vec2d<S> { v2d(self.a[i][0], self.a[i][1]) } /// Returns a column vector of a matri...
Rust
0
factor, prev) in factors.zip(history) { if !prev.is_spinner { let jump_dist = (curr.base.pos - prev.end_pos).length() as f64; cumulative_strain_time += prev.strain_time; // * We also want to nerf stacks so that ...
Rust
0
False, header=False) lower_cut.to_csv(f"{lower}.bedGraph", sep='\t', index=False, header=False) lower_cut_for_viz.to_csv(f"{lower}.viz.bedGraph", sep='\t', index=False, header=False) subprocess.run(f"bedGraphToBigWig {upper}.bedGraph {chrom_sizes} {upper}.bw", shell=True, text=True, check=True) subproc...
Python
1
state[1] = state[1] + b; state[2] = state[2] + c; state[3] = state[3] + d; state[4] = state[4] + e; } } <reponame>monadgroup/re19<filename>tool/src/audio/bass_player.rs use super::{AudioPlayer, ControllableAudioPlayer}; use bass_sys::{ BASS_ChannelBytes2Seconds, BASS_ChannelGetPositi...
Rust
0
impl<Svc> Drop for DropNotifyService<Svc> { fn drop(&mut self) { let _ = self.notify.try_send(self.id).is_ok(); } } impl<Svc: Load> Load for DropNotifyService<Svc> { type Metric = Svc::Metric; fn load(&self) -> Self::Metric { self.svc.load() } } impl<Request, Svc: Service<Request>>...
Rust
0
"Dienstag", "version", "Sache", "sprechen", "Gemeinden", "electronic", "for", "Norden", "außerdem", "Antrag", "gleichzeitig", "ganzen", "Politiker", "gehörte", "großer", "China", "Nähe", "bereit", "setzte", "Druck", "tatsächlich", "Got...
Rust
0
u) mixin_json = json.loads(mixin[len('var tvInfoJs='):]) real_u = mixin_json['url'] real_html = get_content(real_u) parser = get_parser(real_html) self.title = parser.find('meta', property='og:title')['content'] tvid, videoid = self.vid info = ...
Python
1
| Command | /// |------------------|------------------------------------------| /// | Fedora / Red Hat | `sudo dnf install coin-or-Cbc-devel` | /// | Ubuntu / Debian | `sudo apt-get install coinor-libcbc-dev` | /// | macOS | `brew install cbc` ...
Rust
0
AX_SKILL_LEVEL kpi = [] skillsConfig = tankmen.getSkillsConfig() for skillName, level in skills.items(): skillKpi = skillsConfig.getSkill(skillName).kpi for _kpi in skillKpi: baseValue = 1.0 if _kpi.type == KPI.Type.MUL else 0.0 value = baseValue - (baseValue - _kpi....
Python
1
routerify::{Router, RouterService}; use std::{convert::Infallible, net::SocketAddr}; use tokio::prelude::*; // Import the stream_body crate which provides an alternative version of hyper::Body with // more features. For more info visit: https://github.com/rousan/stream-body use stream_body::StreamBody; // A handler f...
Rust
0
egory, specific, extra, })) } fn kind(input: &[u8]) -> IResult<&[u8], EntityKind> { let (input, kind) = be_u8(input)?; let kind = EntityKind::from(kind); Ok((input, kind)) } fn country(input: &[u8]) -> IResult<&[u8], Country> { let (input, country) = be_u16(input)?; let country...
Rust
0
lear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); self.w } } #[doc = "Port Data Output Value Set ...
Rust
0
=> { return Err(BuildError::InvalidType { expected: "NumberList".into(), actual: x, }) } }, None => Err(BuildError::MissingArgument), } } fn arg_expr(expr: Option<&Expr>) -> Result<Expr, BuildError> { match exp...
Rust
0
is selected by default.", ) parser.add_argument( "--clip_stats_path", type=str, help="Path to the clip stats file. Only required if the stable unclip model's config specifies `model.params.noise_aug_config.params.clip_stats_path`.", required=False, ) parser.add_argument( ...
Python
1
ror<String>>> { self.mock().select(ctx, credentials) } /// Get the inner `MockClient`'s `aggregate` method. pub fn aggregate(&mut self, ctx: Context) -> future::Ready<Result<(), ServerError<String>>> { self.mock().aggregate(ctx) } /// Get the inner `MockClient`. pub fn mock(&se...
Rust
0
, GType}; // Aliases pub type GESFrameNumber = i64; // Enums pub type GESAssetLoadingReturn = c_int; pub const GES_ASSET_LOADING_ERROR: GESAssetLoadingReturn = 0; pub const GES_ASSET_LOADING_ASYNC: GESAssetLoadingReturn = 1; pub const GES_ASSET_LOADING_OK: GESAssetLoadingReturn = 2; pub type GESChildrenControlMode =...
Rust
0
tones=[opt.iters // 2, opt.iters * 3 // 4, opt.iters * 9 // 10], gamma=0.33) # scheduler = lambda optimizer: optim.lr_scheduler.LambdaLR(optimizer, lambda iter: 0.1 ** min(iter / opt.iters, 1)) scheduler = lambda optimizer: optim.lr_scheduler.LambdaLR(optimizer, lambda iter: 0.01 + 0.99 * (iter / 500) i...
Python
1
'Results': [{ 'Task': task, 'Dataset': dataset, 'Metrics': metrics }], 'Weights': checkpoint } models.append(model) ...
Python
1
scraped_texts_list_for_file.append(scraped_text_or_error) else: logger.error(f" [{idx+1}] Page Content Scraping Failed: {scraped_text_or_error}") scraped_texts_list_for_file...
Python
1
xdeR:\x08\xfd\xc0\xb5\ \xa4\xdc\xe8\x82\xd2\x81H\x92\xa4I\xb9\x80|\x86_[\ :\x10\xfd\xc0\x1d\xc0\x85\xf8\x9cH\xd3\xf5'\xc0\xec\xd2\ AH}t4\xf0K\xa5\x83\x90\x0a\xdbL6\xf6\xbf\ \x0d|\x89\xac\xa3j\xb3\x99K\x06]/\x01\x1e$m\ \x9c\x1e\xec|\xdd\xa6\x01\xd8sI;\xa7\xd3\x81\x13\x81\ }igb\x02\xf2\xff\xbd\x9aTM<\x0a,\xa5F\ \xaf\xe7Y...
Python
1
rallel bits deposit. /// - Architecture: x86. /// - Instruction set: BMI2. /// - Registers: 32/64 bit. /// /// # Example /// /// ``` /// # use bitintr::*; /// let n = 0b1011_1110_1001_0011u16; /// /// let m0 = 0b0110_0011_1000_0101u16; /// let s0 = 0b0000_0010_0000_...
Rust
0
#!/usr/bin/env python3 # libpulp - User-space Livepatching Library # # Copyright (C) 2020-2021 SUSE Software Solutions GmbH # # This file is part of libpulp. # # libpulp is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by t...
Python
1
from __future__ import annotations from typing import TYPE_CHECKING, Any, Literal, Optional from aiogram.enums import InputStoryContentType from .input_story_content import InputStoryContent class InputStoryContentVideo(InputStoryContent): """ Describes a video to post as a story. Source: https://core...
Python
1
ut() } } } #[cfg(feature = "mc-test-circuit")] #[no_mangle] pub extern "C" fn zendoo_create_return_csw_test_proof( zk: bool, amount: u64, constant: *const FieldElement, sc_id: *const FieldElement, nullifier: *const FieldElement, mc_pk_hash: *const BufferWithSize, cert_data_hash:...
Rust
0
match branch.type_ref() { TYPE_REFS_ARRAY => Y_ARRAY, TYPE_REFS_MAP => Y_MAP, TYPE_REFS_TEXT => Y_TEXT, TYPE_REFS_XML_ELEMENT => Y_XML_ELEM, TYPE_REFS_XML_TEXT => Y_XML_TEXT, other => panic!("Unknown kind: {}", other), } } else ...
Rust
0
pwr); exit_lprun(&mut ta.pwr); } unsafe { set_sysclk_msi_max(&mut ta.flash, &mut ta.pwr, &mut ta.rcc) }; } #[test] fn lsi_to_from(ta: &mut TestArgs) { #[derive(defmt::Format, Clone, Copy)] enum TestPre { Div1, Div128, } im...
Rust
0
= np.loadtxt(path.join(args.data_dir, "intrinsics.txt")) pose_files = sorted(os.listdir(path.join(args.data_dir, 'pose'))) img_files = sorted(os.listdir(path.join(args.data_dir, 'rgb'))) if self.split == 'train': pose_files = [x for x in pose_files if x.startswith('0_')] ...
Python
1
"log": cmd_log, "ls-files": cmd_ls_files, "ls-remote": cmd_ls_remote, "ls-tree": cmd_ls_tree, "pack-objects": cmd_pack_objects, "pack-refs": cmd_pack_refs, "pull": cmd_pull, "push": cmd_push, "receive-pack": cmd_receive_pack, "remote": cmd_remote, "repack": cmd_repack, "r...
Python
1
== (b & 0xFFFF) { count += 1; } } Ok(format!("{}", count)) } fn main() { match solve() { Ok(msg) => println!("Result: {}", msg), Err(err) => println!("Error: {}", err), } } <filename>src/model/categorical_value.rs //! Representative value of a categorical feature. use crate::model::category_...
Rust
0
{ #[doc = "Channel 0."] _0000, #[doc = "Channel 1."] _0001, #[doc = "Channel 2."] _0010, #[doc = "Channel 3."] _0011, #[doc = "Channel 4."] _0100, #[doc = "Channel 5."] _0101, #[doc = "Channel 6."] _0110, #[doc = "Channel 7."] _0111, #[doc = "Channel ...
Rust
0
#!/usr/bin/env python3 """ DFG表达式分析和修正方案 基于实际的4004 DFG文件内容设计正确的线性分析方法 """ import re from collections import defaultdict from dataclasses import dataclass from typing import Dict, List, Set, Tuple, Optional, Union import json @dataclass class ExpressionNode: """表达式树节点""" node_type: str # 'operator', 'terminal...
Python
1
'播放失败', msg, xbmcgui.NOTIFICATION_INFO, 800, False) elif meida_type == 'mlog': result = music.mlog_detail(mv_id, r) url = result['data']['resource']['content']['video']['urlInfo']['url'] # else: # music.daka(song_id,sourceId,dt) plugin.set_resolved_url(url) # 主目录 @plugin.rou...
Python
1
n\n{:?}", e, e), }; assert_eq!( got.as_str().len(), src.len(), "Only parsed \"{}\" out of \"{}\"", got.as_str(), src, ); ...
Rust
0
pub mod break_with_numbers; pub mod break_with_tags; pub mod const_shadowing; pub mod demo1hello_world; pub mod demo2compare_number; pub mod demo3type_change; pub mod demo4guess_number; pub mod demo5variable_readable; pub mod demo6data_type; pub mod for_loop; pub mod given_value_block; pub mod learn_if; pub mod while_l...
Rust
0
r start_date>fund.index[0]): start_date = fund.index[0] if(end_date == 0 or end_date<fund.index[-1]): end_date = fund.index[-1] mult = i_start_cash/fund.values[0] pyplot.plot(fund.index, fund.values * mult, label = \ pa...
Python
1
Es384, #[serde(rename = "ES512")] Es512, } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EdgeModuleEntity { #[serde(flatten)] pub proxy_resource: ProxyResource, #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option<EdgeMo...
Rust
0