text
string
label_name
string
labels
int64
# print(boxes_features_all.shape) boxes_features_all=self.fc_emb_1(boxes_features_all) # B*T,MAX_N, NFB boxes_features_all=F.relu(boxes_features_all) boxes_features_all=self.dropout_emb_1(boxes_features_all) actions_scores=[] activities_scores=[] bboxes_num...
Python
1
_module__): return "%s.[%s].%s" % (func.__module__, line, func.__name__) else: return "%s.%s" % (func.__module__, func.__name__) def get_substitutions(func_name, api_version=None): if hasattr(func_name, "__id__"): func_name = func_name.__id__ substitutions = _SUBSTITUTIONS.get(fun...
Python
1
from dataclasses import dataclass from typing import List from ...util.hparams import HyperParams import yaml @dataclass class DeferHyperParams(HyperParams): # Experiments edit_lr: int n_iter: int # Method threshold: float # Module templates inner_params: List[str] device: int ...
Python
1
e, index, width, height = Utility.get_activity_name() updates = { 'ACTIVITY': activity, 'OUTPUT_FILE': output_file, 'INDEX': index, 'WIDTH': width, 'HEIGHT': height # Added HEIGHT as it was missing } # Update the config file and reload the config module parser....
Python
1
DependencyDescriptor>, decls: &'a HashSet<(JsWord, SyntaxContext)>, ignore_mark: swc_common::Mark, config: &'a Config, diagnostics: &'a mut Vec<Diagnostic>, ) -> impl Fold + 'a { DependencyCollector { source_map, items, in_try: false, in_promise: false, require_node: None, decls, i...
Rust
0
ensorId_e_SH2_GAME_ROTATION_VECTOR: sh2_SensorId_e = 8; pub const sh2_SensorId_e_SH2_GEOMAGNETIC_ROTATION_VECTOR: sh2_SensorId_e = 9; pub const sh2_SensorId_e_SH2_PRESSURE: sh2_SensorId_e = 10; pub const sh2_SensorId_e_SH2_AMBIENT_LIGHT: sh2_SensorId_e = 11; pub const sh2_SensorId_e_SH2_HUMIDITY: sh2_SensorId_e = 12; p...
Rust
0
""" Copyright (c) 2022, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause """ from dataclasses import dataclass from typing import Optional import torch from transformers.model...
Python
1
)>, mut commands: Commands, time: Res<Time>, ) { let mut should_trigger_wait = false; for GoldChange { who, change } in er.iter() { let mut player_data = match who { FightPlayers::MySelf => query.q0_mut().single_mut().expect("Cannot get main player"), FightPlayers::My...
Rust
0
""" Required device info for the avr64ea32 devices The following data was collected from device pack Microchip.AVR-Ex_DFP 1.0.31 """ from pymcuprog.deviceinfo.eraseflags import ChiperaseEffect DEVICE_INFO = { 'interface': 'UPDI', 'name': 'avr64ea32', 'architecture': 'avr8x', # eeprom 'eeprom_add...
Python
1
= NumberFormatBuilder::new() .digit_separator(num::NonZeroU8::new(b'_')) .no_special(true) .no_integer_leading_zeros(true) .internal_digit_separator(true) .trailing_digit_separator(true) .consecutive_digit_separator(true) .build(); const_assert!(NumberFormat::<{ D_LITERAL }> {}.is_valid())...
Rust
0
from django.contrib import admin from .models import Appointment @admin.register(Appointment) class AppointmentAdmin(admin.ModelAdmin): list_display = ('patient', 'provider', 'date_time', 'status', 'appointment_type') list_filter = ('status', 'appointment_type', 'date_time') search_fields = ('patient__user...
Python
1
import sys import os import collections import argparse import pprint import numpy as np import pdb import sys import os.path this_dir = os.path.dirname(__file__) sys.path.insert(0, this_dir + '/..') from lib.lstm.test import test_net from lib.lstm.config import cfg, cfg_from_file, cfg_from_list, get_output_dir, get_...
Python
1
7, 8]), x => panic!("Unexpected result: {:?}", x), } } #[tokio::test] async fn read_half_should_update_buf_with_some_of_inner_channel_that_can_fit_and_add_rest_to_overflow( ) { let (tx, _rx, stream) = InmemoryStream::make(1); let (mut t_read, _t_write) = stream.into...
Rust
0
that expressions inside parentheses must be evaluated first: """ print((1-5)+(10+10)) """ Output: 16 """ # Multiplication * has higher precedence than addition +, and therefore multiplications are evaluated before additions: print(100 + 2 * 3) """ Output: 106 """ # The precedence order is described in the table b...
Python
1
Data<Elem = usize>, Ix1>, ) -> HashMap<usize, IncrementalMean<F>> { let mut new_centroids: HashMap<usize, IncrementalMean<F>> = HashMap::new(); Zip::from(observations.genrows()) .and(cluster_memberships) .apply(|observation, cluster_membership| { if let Some(incremental_mean) = new_...
Rust
0
t_bignum!(u128, 16, IS_LITTLE_ENDIAN, 0); #[cfg(test)] mod test { macro_rules! test_common ( ($test_mod_name:ident, $t:ty) => ( mod $test_mod_name { use crate::exceptions; use crate::ToPyObject; use crate::Python; #[test] ...
Rust
0
let vk_bytes = postcard::to_allocvec(&vk).unwrap(); println!("Spartan nizk Creating proof..."); let c1 = Mini::<Fr> { x: Some(Fr::from(2u32)), y: Some(Fr::from(3u32)), z: Some(Fr::from(10u32)), num: 10, }; let proof = create_random_proof(&pk, c1, rng).unwrap(); ...
Rust
0
""" Goal of the program: Mixing two .txts input through cmd. By Fran Ogallas Starting date: 9th of April 2024. Current version: 9th of April 2024. """ import sys from typeguard import typechecked @typechecked() def mix_test_lists(text1: list, text2: list): final_text = [] for n in range(max(len(text1), len(te...
Python
1
, 1006559213, 1532043124, 3780490932, 735080823, 4038443176, 1464982680, 2188164698, 1105691252, 2832066849, 642565775, 2809009489, 3698954670, 1268079142, 3380048275, 2662521390, 3640101839, 1367787965, 1769983508, 1558676012, 3821420353, 557271040, 200032047, 2391640791, 3185110957, 3370102276, 4192700174...
Rust
0
impl Sv39Pte { fn ppn(&self, level: usize) -> RegT { match level { 0 => (self.0 >> 10) & 0x1ff, 1 => (self.0 >> 19) & 0x1ff, 2 => (self.0 >> 28) & 0x3ffffff, _ => unreachable!() } } fn ppn_all(&self) -> RegT { (self.0 >> 10) & 0xfff_fff...
Rust
0
assert_eq!( vec![vec![1, 2, 3, 4]], chunk_stream.collect::<Vec<_>>().await ); } } pub use self::cache::*; pub use fst_op::{AccessibleOpState, FstOp, SerializableOpState}; pub use fst_op_2::FstOp2; pub use lazy_fst::{LazyFst, SerializableLazyFst}; pub use lazy_fst_2::LazyFst2; pub ...
Rust
0
""" Math Inspector: a visual programming environment for scientific computing Copyright (C) 2021 Matt Calhoun This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at y...
Python
1
{ js_func .call1(&JsValue::NULL, &JsValue::from(idx as u32)) .unwrap() .as_f64() .unwrap() }), } } /// Create a new Floats1d with n evenly spaced elements from start to end #[wasm_bindgen(js_...
Rust
0
from enum import Enum, auto from typing import Optional, Union from pydantic import BaseModel as PydanticBaseModel from pydantic import ConfigDict, NonNegativeInt, PositiveInt class BaseModel(PydanticBaseModel): """Pydantic.BaseModel with a safe config applied.""" model_config = ConfigDict(frozen=True, extr...
Python
1
ingo_ast_binary_operator_clingo_ast_binary_operator_or => BinaryOperator::Or, clingo_ast_binary_operator_clingo_ast_binary_operator_and => BinaryOperator::And, clingo_ast_binary_operator_clingo_ast_binary_operator_plus => BinaryOperator::Plus, clingo_ast_binary_operator_clingo_ast_bi...
Rust
0
) resolution_tz = parse_tz_aware( issue.fields.statuscategorychangedate, _DATETIME_FORMAT ) else: if issue.fields.resolutiondate: logging.debug( "Found issue close: %s, %s: %s", issue.fields.r...
Python
1
import json import os import time from utils.logger import write_to_record_file class BaseAgent(object): ''' Base class for an agent to generate and save trajectories. ''' def __init__(self, env): self.env = env self.results = {} def get_results(self, detailed_output=False): outp...
Python
1
import torch from gptqmodel_exllama_eora import gptq_gemm, gptq_gemm_eora m = 1 k = 4096 n = 6144 // 2 r = 128 bit = 3 use_exllama = True x = torch.rand((m, k), device='cuda', dtype=torch.float16) eora_a = torch.randn((k, r), device='cuda', dtype=torch.float16) / 10. eora_b = torch.randn((n, r), device='cuda', dtype...
Python
1
und in manifest // ignore non-integer versions (stashed things must be overwritten) if let Ok(n) = d.version.parse::<u32>() { if n == cand && d.environment == env { info!("Reuse {} {} {}", env, name, n); deps.remove(&name); ...
Rust
0
Valid8OutOf8 = 1, Valid2OutOf3 = 2, Valid2OutOf4 = 3, Valid2OutOf8 = 4, Valid1OutOf2 = 5, Valid1OutOf5 = 6, Valid1OutOf8 = 7, Indefinitely = 8, } /// The enumeration of persistence controls. #[repr(usize)] #[derive(FromPrimitive, Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum HoleFillin...
Rust
0
; // Generate the initial build.ninja. space.run_expect(std::process::Command::new("sh").args(vec!["./gen.sh"]))?; // Run: expect to regenerate because we don't know how the file was made. let out = space.run_expect(&mut n2_command(vec!["out"]))?; assert_output_contains(&out, "ran 1 task"); /...
Rust
0
ce(v, dict): for key, value in v.items(): if not isinstance(key, str) or not isinstance(value, str): raise ValueError("Connection IDs must be string-to-string mappings") else: raise ValueError("Connection IDs must be a list or dictionary") retu...
Python
1
tom1 = heap.pop().unwrap(); let autom = alternative(autom1, autom2, &mut counter); heap.push(autom); } _ => {} } // heap.last().unwrap().display(); // DISPLAY AUTOMATA AFTER COMPUTING OPERATOR ...
Rust
0
ay obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Lice...
Rust
0
"https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/rust_model.ot", /// )); /// ``` pub fn from_pretrained(name_url_tuple: (&str, &str)) -> RemoteResource { let cache_subdir = name_url_tuple.0.to_string(); let url = name_url_tuple.1.to_string(); R...
Rust
0
bilities.fill(0) current_prediction = -1 pygame.display.set_caption('Draw a digit (0-9) - ESC to clear') def main(): clock = pygame.time.Clock() drawing = False while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() ...
Python
1
tions: Point predictions prediction_errors: Prediction errors confidence_level: Confidence level for intervals Returns: Prediction interval statistics """ logger.info(f"Calculating {confidence_level*100}% prediction intervals") # ...
Python
1
{ *self } } impl ::std::default::Default for Struct__HPDF_TTF_OffsetTbl { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } pub type HPDF_TTF_OffsetTbl = Struct__HPDF_TTF_OffsetTbl; #[repr(C)] #[derive(Copy)] pub struct Struct__HPDF_TTF_CmapRange { pub format: HPDF_UINT16, pub length: HPDF_UINT16,...
Rust
0
from django.urls import path from . import views urlpatterns = [ path('tasks/', views.TaskListCreate.as_view(), name='task_view_create'), path('tasks/<int:pk>/', views.TaskRetrieveUpdateDestroy.as_view(), name='update'), path('tasks/by-date/', views.TasksByDate.as_view(), name='tasks-by-date'), ]
Python
1
(String::from).collect::<Vec<_>>(); value }) }, 9 => { self.bits =field.one().map(|v| { let value = String::from(v); value }) }, 10 => { self.accu...
Rust
0
ErrorCode { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::EventInvalid => write!(f, "EventError: Invalid `rcl_event_t` given!"), Self::EventTakeFailed => write!( f, "EventError: Failed to take an event from the event han...
Rust
0
ng("No client verifier has been set.") token = self._fetch_token(url, **request_kwargs) log.debug("Resetting verifier attribute, should not be used anymore.") self._client.client.verifier = None return token def parse_authorization_response(self, url): """Extract parameters ...
Python
1
_redis::{r2d2, redis}; static CACHE_PREFIX: &str = "v2:cache"; static TAG_PREFIX: &str = "v2:tag"; pub struct RedisCacheStore { pool: r2d2::Pool<RedisConnectionManager>, ns: String, notifier: Option<RedisCacheNotifier>, metric_get_duration: Histogram, metric_set_duration: Histogram, metric_hits_total: Int...
Rust
0
from typing import List, Optional, Tuple, cast from django.conf import settings import promptgame.settings.custom_types as settings_types def _tiers() -> List[settings_types.TierDict]: # Type checkers cannot infer types for settings.* attributes, so we cast the # right type here to catch bugs. This is done ...
Python
1
from setup import import_split_and_make_transects, Profile, Transect import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from scipy.stats import linregress transects, profiles = import_split_and_make_transects(use_cache=True, use_downcasts=True...
Python
1
# Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE import os from pathlib import Path from unittest.mock import patch import pytest from lightning import Trainer from otx.backend.native.models.base import DataInputParams from otx.models import EfficientNet from otx.types.label imp...
Python
1
\xdd[:\x14\x0f4\ i:\x1c\xf9x*\xd1\x96lG\xd8\xe4\xb2\xa8#x\ \x04d\x8f\x13\x8a\xc7\xc7\xb6W\x9f\xda\xdaf\xa3\xa6\xf8\ \xd1\xe0\xbb\xf3/,n<\x04l\xa5\xb4\xd3\xe6\x89\xcd\ \xbe\x93a\x7fey\xa5\xe1\xac\xae\x98\xb4Z\x85\xe5\x8e\ \xaf$\xd1\x87K\x88\x82\xa0a\xdd[\xf8\xa3\xc4-\xa4\ j\xd0\xf8\x87\xc26:\x95\x86\xb4\xa6\xce\x1d3\xc2...
Python
1
_name_by_skill_type(skill); self.get_value(AttributeName::HPRatioBase) + self.get_value(key1) + self.get_value(key2) } fn get_extra_damage(&self, element: Element, skill: SkillType) -> f64 { let key1 = AttributeName::extra_dmg_name_by_element(element); let key2 = AttributeN...
Rust
0
from flask_cors import CORS, cross_origin from flask import Flask, request, jsonify, Response import json import re from collections import Counter app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADERS'] = 'Content-Type' def clean_text(cipher_text: str) -> str: cipher_text: str = re.sub(r'\n', '', ciph...
Python
1
'], net['pool6_mbox_priorbox']], mode='concat', concat_axis=1, name='mbox_priorbox') if hasattr(net['mbox_loc'], '_keras_shape'): num_boxes = net['mbox_loc']._keras_shape[-1] // 4 elif hasattr(net['mbox_l...
Python
1
''' THis file is to collect all lang.txt and move to a new directory, this is for the convenience to compress and scp the lang for post-processing ''' import os, sys, shutil if __name__ == "__main__": parent_dir = "../datasets_rob" dataset_paths = ["Bridge_v1_TT14", "Bridge_v2_TT14"] store_folder = ".....
Python
1
finition( name="aes_single_ga_abs20_ism12_1sec", simulation_type=treble.SimulationType.ga, model=shoebox_model, crossover_frequency=250, # energy_decay_threshold=20, # Instead of a constant IR length you can define a energy decay threshold which will stop the simulation automatically. receiver_...
Python
1
# 105. Statistics Module import statistics data = [1, 2, 2, 3, 4, 5] print("Mean:", statistics.mean(data)) print("Median:", statistics.median(data)) print("Mode:", statistics.mode(data))
Python
1
return BrandVettingPage(self._version, response, self._solution) def get_page(self, target_url: str) -> BrandVettingPage: """ Retrieve a specific page of BrandVettingInstance records from the API. Request is executed immediately :param target_url: API-generated URL for the reque...
Python
1
@allure.step("验证数据不存在: {sql}") def validate_data_not_exists(self, sql: str, params: Tuple = None): """验证数据不存在""" result = self.db_helper.execute_query(sql, params) assert result.row_count == 0, f"查询 '{sql}' 返回了不应该存在的数据" @allure.step("验证字段值: {field} = {expected_value}") d...
Python
1
from django.urls import re_path from . import consumers websocket_urlpatterns = [ re_path(r'ws/messaging/(?P<conversation_id>\d+)/$', consumers.ChatConsumer.as_asgi()), re_path(r'ws/group-chat/(?P<group_id>\d+)/$', consumers.GroupChatConsumer.as_asgi()), ]
Python
1
_fence(Default::default()) }); } let frame = self.frame_gen.next_with_fences(fences); let ref semaphores = self.semaphores; let mut fence_index = 0; let mut ready = Submission { waits: Vec::new(), buffers: Vec::new(), signals: Vec::new() }; for submission ...
Rust
0
t!("{:?} mb", value / 1_000_000).red(), } } impl Persistence { fn load_types_index_to_one<T: IndexIdToParentData, P: AsRef<Path> + std::fmt::Debug>( data_direct_path: P, metadata: IndexValuesMetadata, ) -> Result<Box<dyn IndexIdToParent<Output = u32>>, VelociError> { let store = Sin...
Rust
0
3 P3: PORT_3_4 => p3in, p3out, p3dir, p3ren, p3selc, p3sel0, p3sel1, [p3ies, p3ie, p3ifg, p3iv]); gpio_impl!(p4 P4: PORT_3_4 => p4in, p4out, p4dir, p4ren, p4selc, p4sel0, p4sel1, [p4ies, p4ie, p4ifg, p4iv]); gpio_impl16!(p6: PORT_J => pjin, pjout, pjdir, pjren, pjselc, pjsel0, pjsel1); //gpio_impl!(p6: P6 => p6in, p6o...
Rust
0
, AllMessages::AvailabilityStore( AvailabilityStoreMessage::QueryAllChunks(_, tx) ) => { let v = self.chunks.iter() .filter(|c| send_chunk(c.index.0 as usize)) .cloned() .collect(); let _ = tx.send(v); } ) } async fn test_chunk_requests( &self, candidate_hash: CandidateHash...
Rust
0
l operation, `cargo` rebuilds a project when any potentially relevant file changes. One //! can use the //! [`rerun-if-changed`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#change-detection) //! instruction to tell `cargo` to only rebuild if certain files are changed. However, it is easy //! to forget ...
Rust
0
from roadtools.roadrecon.server import create_app_test, db from sqlalchemy import func from roadtools.roadlib.metadef.database import Policy from flask_sqlalchemy import SQLAlchemy import pytest @pytest.fixture(scope='module') def app(): app = create_app_test() return app def test_db_has_users(client): "...
Python
1
:class:`~escnn.kernels.GaussianRadialProfile`). The analytical angular solutions of kernel constraints belong to an infinite dimensional space and so can be expressed in terms of infinitely many basis elements. Only a finite subset can however be implemented. ``maximum_frequency`` defines the maximum freq...
Python
1
t (substream, proto) = match origin { ConnectionOrigin::Inbound => { let mut listener = connection.listen_for_inbound(); let substream = listener.next().await.ok_or_else(|| { io::Error::new( io::ErrorKind::ConnectionAborted, "Connec...
Rust
0
urn try: DrawMainWindow() window_flags = PyImGui.WindowFlags.AlwaysAutoResize if PyImGui.begin("move", window_flags): hovered_skill = GLOBAL_CACHE.SkillBar.GetHoveredSkillID() PyImGui.text(f"Hovered Skill ID: {hovered_skill}") if hovered_skill != 0: ...
Python
1
""" Invoke Function +++++++++++++++ :class:`Operator.invoke` is used to initialize the operator from the context at the moment the operator is called. invoke() is typically used to assign properties which are then used by execute(). Some operators don't have an execute() function, removing the ability to be repeated f...
Python
1
f os.getenv('CPOLAR_PASSWORD'): return True # For keyring, we can't check without accessing it # So we return a generic status to avoid permission prompts try: # Try to check if keyring backend is available backend = keyring.get_keyring() ...
Python
1
turn list(range(self.n_actions)) def is_terminal(self, state: Tuple[int, int]) -> bool: """Check if state is terminal (goal state).""" return state == self.goal_state def render_grid(self, values: np.ndarray = None, policy: np.ndarray = None) -> str: """Render the grid with opt...
Python
1
import sys # Read input n = int(input()) garland = input() # Initialize dp array with maximum possible value (for now) dp = [sys.maxsize] * (n + 1) # Base case: no recolors needed for an empty garland dp[0] = 0 # Fill dp array using dynamic programming for i in range(1, n + 1): prev_colors = garland[i - 3:i] ...
Python
1
PSH, /// <POP, Restores text script state from stack and resumes previous event. POP, /// <KEY related to player 2? KE2, /// <FRE related to player 2? FR2, // ---- Custom opcodes, for use by modders ---- } #[derive(FromPrimitive, PartialEq, Copy, Clone)] pub enum CreditOpCode { /// ...
Rust
0
from server import db class Notification(db.Model): __tablename__ = 'notifications' notification_id = db.Column(db.BIGINT, primary_key=True, autoincrement=True) message = db.Column(db.String(500), nullable=False) member_id = db.Column(db.BIGINT, db.ForeignKey('memberships.membership_id'), nullable=Fal...
Python
1
import numpy import pytest from thinc.api import ( PyTorchWrapper_v2, TorchScriptWrapper_v1, pytorch_to_torchscript_wrapper, ) from thinc.compat import has_torch, torch @pytest.mark.skipif(not has_torch, reason="needs PyTorch") @pytest.mark.parametrize("nN,nI,nO", [(2, 3, 4)]) def test_pytorch_script(nN,...
Python
1
test_zeroes() { let x: f32 = 0.0_f32; let y: f32 = -0.0_f32; assert!(x.approx_eq_ulps(&y,0) == true); } impl ApproxEqUlps for f64 { type Flt = f64; fn approx_eq_ulps(&self, other: &f64, ulps: i64) -> bool { // -0 and +0 are drastically far in ulps terms, so // we need a special cas...
Rust
0
to exit early if let Some(end) = end { if start.elapsed() >= end { return; } } if kill_signal.is_full() { return; } // send keep alive if needed. if ka_time.map(|t: Instant| t.elapsed() >= ka_freq).unwrap_or(true) { (&mut ka_buf[space_start..space_start+KEEPALIVE_SIZ...
Rust
0
r.into_iter().enumerate() { assert_eq!(r.rfind(elt), Some(i)); } } #[test] fn test_rev_slice_split() { let data = [1, 2, 3, 4]; let r = <&RevSlice<_>>::from(&data[..]); for i in 0..r.len() { let (a, b) = r.split_at(i); assert_eq!(a, &r[..i]); assert_eq!(b, &r[i..]); ...
Rust
0
# What is Python? # • Python is simple & easy # • Free & Open Source # • High Level Language # . Developed by Guido van Rossum & first released in 1991 presently maintained by the Python Software Foundation work in Microsoft Visual. # • Portable # • Python is a high-level, interpreted, interactive, object-oriented, an...
Python
1
# quote_features/size_imbalance_tw.py from __future__ import annotations import datetime as dt from pathlib import Path from typing import Dict, Tuple import numpy as np import pandas as pd import pyarrow.parquet as pq from feature_base import FeatureContext from quote_feature_base import QuoteBaseFeature, DATARAW_RO...
Python
1
transient state. if self.state.transient() { self.recovery_start = Some(pkt.time_sent); self.state.update(); } if !pkt.cc_in_flight() { return; } self.bytes_in_flight += pkt.size; qdebug!( [self], "Pkt Sent le...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2025 Google LLC. 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 requir...
Python
1
derive(SessionDiagnostic)] #[error(code = "E0123", slug = "foo")] struct ErrorWithNonexistentField { #[suggestion(message = "bar", code = "{name}")] //~^ ERROR `name` doesn't refer to a field on this type suggestion: (Span, Applicability), } #[derive(SessionDiagnostic)] //~^ ERROR invalid format string: ex...
Rust
0
: u32 { const NONE = 0x00000000; const UART = 0x00000001; const SPI = 0x00000002; const GPIO = 0x00000004; const I2C = 0x00000008; } } /// A struct which can check that needed capability requirements are met. pub struct Capabilities { capabilities: Capability, needed...
Rust
0
import numpy as np a = np.dot([2, 3, 1, 0.5], [5, 8, 1, 0.9]) print(a)
Python
1
.png" %(str(int(units_index_test[idx])), int(win_len), int(win_stride), int(bs), str(lr), int(sub), str(rms))) print("The FLOPs is:{}".format(get_flops(o...
Python
1
74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x08, 0x01, 0x12, 0x03, 0x72, 0x08, 0x12, 0x0a, 0x1f, 0x0a, 0x04, 0x04, 0x08, 0x02, 0x00, 0x12, 0x03, 0x74, 0x02, 0x12, 0x1a...
Rust
0
h_str("/*.xml.gz"); } info!("scanning for files {}", ds); let mut v = Vec::new(); for entry in glob(&ds)? { let entry = entry?; v.push(entry); } Ok(v) } else { Ok(self.files.clone()) } } } <reponame>dochy-ksti/dochy pub mod hash_m; pub mod set_sabun; p...
Rust
0
newidth=.5, label = 'World boundary') # include legends of all layers ax.legend(loc='center left', bbox_to_anchor=(0, 0.5), title='Max similarity') plt.xlabel('Longitude') plt.ylabel('Latitude') plt.tight_layout() save_fig(f'{name}_geo_sim.png'...
Python
1
'SubmitValue': random_string(), 'vbComment': generate_comments(0), 'vbComment4': generate_comments(4), 'vbComment8': generate_comments(8), 'vbComment12': generate_comments(12), 'htmlComment': generate_comments(0, html_format=True), 'htmlComment4': generate_comments(4, ...
Python
1
elif args.command == "delete": for device in devices: response = delete(args.url, args.token, device["guid"], device["id"]) print(response) elif args.command == "assign": if "=" not in args.assign_to: print("Invalid assign_to format, it must be <type>=<value>") ...
Python
1
# 颜色空间转换:cvtColor() # 图像缩放和裁剪:resize()、crop()等 # 图像平滑:blur()、GaussianBlur()等 # 图像形态学操作:erode()、dilate()、morphologyEx()等 # 图像边缘检测:Canny()、Sobel()等 # 直方图均衡化:equalizeHist() # 图像阈值分割:threshold()、adaptiveThreshold()等 # 图像特征检测和匹配:SIFT、SURF、ORB、BFMatcher、FlannBasedMatcher等 # 目标检测和跟踪:Haar特征分类器、HOG特征+SVM分类器、MeanShift、CamShift等 ...
Python
1
from django.contrib import admin from .models import register, Feedback ,Admin # Register your models here. admin.site.register(register) admin.site.register(Feedback) admin.site.register(Admin)
Python
1
_eq!(strm.eof(), false); assert_eq!(strm.unconsumed(), "ttt".to_string()); } <reponame>CaptainHayashi/baps3-cli #![feature(plugin)] extern crate baps3_protocol; #[macro_use] extern crate baps3_cli; extern crate "rustc-serialize" as rustc_serialize; extern crate docopt; #[plugin] #[no_link] extern crate docopt_macr...
Rust
0
Descriptor { static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::Prot...
Rust
0
memory.\n", mcu.mem.size / 1024 ); State { mcu, text_size: 0 } } /// Program the MCU with a string program. pub fn assemble(&mut self, program: String) { let program = program.replace("\\n", "\n"); let words = assemble_program(&program); if words.is_e...
Rust
0
id.clone(), value: result.value.clone() } } } #[derive(Clone, Debug, Serialize, Eq, Copy)] pub struct CustomPlayStatus { pub song_length: Option<u32>, pub song_position: Option<u32>, pub playback_status: Option<u8>, } impl CustomPlayStatus { pub fn new(status: &PlayStatus) -> Self { let pl...
Rust
0
import heapq import math def solve(): n = int(input()) edges = [] for _ in range(n-1): u, v = map(int, input().split()) edges.append((u, v)) m = int(input()) prime_factors = list(map(int, input().split())) k = math.prod(prime_factors) distribution_indices = {} ...
Python
1
// SAFETY: `selector_str!` creates a null-terminated UTF-8 string. #[allow(unused_unsafe)] let sel = unsafe { $crate::objc::Sel::register(ptr as _) }; sel } }; } macro_rules! _cached_selector { ($sel:ident) => { $crate::objc::sel::cached::$sel ....
Rust
0
_to_file(extend_module,main_module) run_jixia(extend_module_path,extend_module) extend_sym_path = "./tmp/"+extend_module+".sym.json" extend_decl_path = "./tmp/"+extend_module+".decl.json" get_code.init(extend_module_path) get_constant_dep(extend_sym_path) for root in extend_root_constants: ...
Python
1
me: (u8, u8, u8), pub sound_theme_strength: (u8, u8), pub sound_index: u8, } #[derive(Debug,PartialEq)] pub struct LevNavigationHeader { pub sections_start: u32, pub sections_count: u32, pub sections: Vec<(String, u32)>, } // // From fabletlcmod.com: // // A Subset has 7 Layers (0-6), each definin...
Rust
0
d\x8c\xd0\x01/\x17\x15\x0aH:kken\xa7\xb7\ \xb6\x16q\xdb\xc6:\x05\x8a\xed\x1c\x93\x09\xbe\xb4\xd73\ 3@'\x94\x0c+\xa0\x83\xcc\x02%\xaf\x91\xdc\xa9\x01\ T\xf8R\xdc\xe5\xc0nx0\xb4r=n\x84\x9d\xf6\ pe4\x04\xfe\x85\xfe\xc0\xd0\x83R\x0f\xcf\xec\xb0=\ \xa4+\xba\xce\xfc\xd6\xd8\xa2\xdb5\xf7\x0a.\xd8\xd6\xf6\ \xec\xe4*%\xc1\x0f\x...
Python
1
ulation completed in {duration:.2f} seconds") if result: log("SUCCESS: formulate_multi returned result") bundles = result.get('bundles', []) log(f"Generated {len(bundles)} bundle(s)") if bundles: first_bundle = bundles[0] log(f"First bun...
Python
1