text
string
label_name
string
labels
int64
# Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE from grpc_interfaces.credit_system.client import CreditSystemClient, ProductsList from geti_logger_tools.logger_config import initialize_logger logger = initialize_logger(__name__) async def create_subscription(organization_id...
Python
1
file(bib_data2.as_bytes(), ()); //! let entries = db.into_entries(()); //! assert_eq!(&entries[0].fields[&b"author"[..]], b"<NAME>"); //! assert_eq!(&entries[1].fields[&b"author"[..]], b"<NAME>."); //! ``` //! //! # Compatibility //! //! This crate aims to be compatible with standard BibTex, including all the weird cor...
Rust
0
from odoo.tests.common import TransactionCase class TestCurrencyRates(TransactionCase): @classmethod def setUpClass(cls): super(TestCurrencyRates, cls).setUpClass() cls.env["res.currency"].create( [ { "name": "MC1", "symbol": "...
Python
1
//! dinic.flow(0, 2); //! //! assert_eq!(dinic.get_edge(key), Edge { from: 1, to: 2, cap: 15, flow: 10 }); //! ``` //! //! Moreover [`get_edges`](Dinic::get_edges), [`get_network`](Dinic::get_network) will summarize the //! whole network. //! //! ``` //! use dinic::{Edge, Dinic}; //! //! let mut dinic = Dinic::new(3); ...
Rust
0
troposphere.Ref or Troposphere.GetAtt """ if not self.ext_sources: LOG.debug("No external rules defined. Skipping.") return for allowed_source in self.ext_sources: if not keyisset(self.ipv4_key, allowed_source) and not keyisset( self.ipv6_key,...
Python
1
a> { Borrowed(&'a [Row]), Owned(Vec<Vec<DataType>>), } impl<'a> RecordResult<'a> { pub(crate) fn len(&self) -> usize { match *self { RecordResult::Borrowed(rs) => rs.len(), RecordResult::Owned(ref rs) => rs.len(), } } pub(crate) fn is_empty(&self) -> bool { ...
Rust
0
num_blocks: int = 1, shortcut: bool = True, ) -> None: """ Args: in_channels (int): Input channels. out_channels (int): Output channels. num_blocks (int): Number of Bottlenecks, default = 1. """ # ch_in, ch_out, number, shortcut, gr...
Python
1
iator); let role = Role::Unassigned; assert_eq!(role.opposite_role(), Role::Unassigned); let role = Role::Negotiating; assert_eq!(role.opposite_role(), Role::Negotiating); } } <filename>standalone/replay/src/main.rs mod replay_gk; use clap::{AppSettings, Parser}; #[derive(Parser,...
Rust
0
@g H k&&OӰ-Fٿ"= O@WF!-zn :w%vͻ]nǡ] f[qGB׍QeZ菖bqϴ-y78Ȧ9rIY.HaI@*t}$HUN''  ËP-1?hixHWQ#y0fgd3-$";h";'ZEvrq{6CVB8ml*,zPJ Q(MjW݆, ੗HeK`Ӏ߹\Z&iJie29AsdP!{4d}ə 3aQi ܃)k)^~Ѱ2UWuT'wˍ8{ lQmjb۩ʝ=!Oo7%Y/s}Z,<! ?PK'6W)ߡ:game/quarry_rush/tech/__pycache__/__init__.cpytho...
Python
1
1985-2", [ "iso-ir-122", "ISO646-CA2", "csa7-2", "csa72", "csISO122Canadian2", ], [ "CSISO122CANADIAN2", "ISO-IR-122", "ISO646-CA2", "CSA72", "CSA7-2", "CSA_Z243.4-1985-2", ], CSA_Z243_4_1985_GR, std::option::Option::None, "CSA_Z243.4-1985-gr", ["iso-ir-123", "csISO123CSAZ24341985gr",], [...
Rust
0
# -*- coding: utf-8 -*- import os import sys import json import argparse import numpy as np import scipy.linalg as la import random import glob import joblib from scipy.interpolate import interp1d from scipy.spatial.transform import Rotation as R from collections import defaultdict os.chdir(os.path.dirname(os.path.abs...
Python
1
_heights) => ci::NodeCommsRequest::FetchBlocks(block_heights.heights), FetchBlocksWithHashes(block_hashes) => ci::NodeCommsRequest::FetchBlocksWithHashes(block_hashes.outputs), GetNewBlockTemplate(pow_algo) => { ci::NodeCommsRequest::GetNewBlockTemplate(PowAlgorithm::try_from(pow...
Rust
0
it_asset_loader::<asset_loader::LevelsAssetLoader>() .add_system(exit.system()); } } pub struct LevelResetEvent; pub struct GameState { pub current_level: cutscene::Level, pub mode: Mode, pub controlling: Kid, pub last_positions: HashMap<Kid, Option::<Vec3>>, pub kid_colors: HashM...
Rust
0
_base_ = ['ban_vit-b16-in21k_mit-b0_512x512_40k_levircd.py'] vit_checkpoint_file = 'pretrain/augreg_L_16-i21k-300ep-lr_0.001-aug_strong1-wd_0.1-do_0.0-sd_0.0.pth' # noqa model = dict( pretrained=None, asymetric_input=True, encoder_resolution=dict( size=(224, 224), mode='bilinear'), im...
Python
1
e=200, content={"message": "Event deleted"}) elif event_id[0] == "t": event_id = int(event_id[1:]) # Check if the user is in a team if not user.team_id: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Not authorized to delete team events") # Check if e...
Python
1
from unitxt import add_to_catalog from unitxt.metrics import Wer from unitxt.test_utils.metrics import test_metric metric = Wer() predictions = ["this is the prediction", "there is an other sample"] references = [["this is the reference"], ["there is another sample"]] instance_targets = [ { "wer": 0.25, ...
Python
1
OS).saturating_mul(validators.len() as Weight)) ] fn set_invulnerables(origin, validators: Vec<T::AccountId>) { ensure_root(origin)?; <Invulnerables<T>>::put(validators); } /// Force a current staker to become completely unstaked, immediately. /// ...
Rust
0
error!(NON_FASTBOOT_MSG).into()), Err(e) => Err(anyhow!("unexpected failure connecting to Fastboot: {:?}", e)), } } async fn get_remote_proxy() -> Result<RemoteControlProxy> { let daemon_proxy = get_daemon_proxy().await?; let (remote_proxy, remote_server_end) = create_proxy::<RemoteControlMarker>()...
Rust
0
from collections import deque # Define the city map city_map = [ [13, 'x', 'x', 3, 10, 20, 3, 'x', 5], ['x', 'x', 'x', 'x', 20, 16, 'x', 'x', 17], [3, 14, 18, 8, 1, 20, 14, 'x', 7], [13, 3, 6, 10, 7, 4, 6, 6, 1], [10, 12, 2, 'x', 11, 'x', 10, 8, 11], ['x', 'x', 'x', 11, 6, 18, 13, 20, 17], ...
Python
1
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
Python
1
hine to actually reboot"); Ok(()) } else { Err(HtbError::boxed(status.status)) } } else { Err(HtbError::boxed("No machine was found by that name")) } } pub async fn start(name: &str) -> Result<(), Box<dyn Error>> { let machine = api::machines::get_by_name(na...
Rust
0
"""Copyright 2024 Google LLC 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
Python
1
DWORD, }} pub type PREADER_SEL_RESPONSE = *mut READER_SEL_RESPONSE; STRUCT!{struct OPENCARDNAMEA { dwStructSize: DWORD, hwndOwner: HWND, hSCardContext: SCARDCONTEXT, lpstrGroupNames: LPSTR, nMaxGroupNames: DWORD, lpstrCardNames: LPSTR, nMaxCardNames: DWORD, rgguidInterfaces: LPCGUID, ...
Rust
0
ld not parse -freq command line as number"); } "-proxy" => { IS_PROXY = true; } "--" => { // Collect remaining arguments as applications argv //ToDo -> we know the length here, so we could (should convert this into a safe // rust type (at least for rust applications) COMMAND_LINE_APPLICA...
Rust
0
# https://www.tensorflow.org/api_docs/python/tf/keras/utils/to_categorical # Need to look into integer encoding or other methods for the future... return model model = create_model() model.compile(loss=categorical_crossentropy, optimi...
Python
1
import os import sys from glob import glob import matplotlib.pyplot as plt import numpy as np import torch from matplotlib import colormaps from PIL import Image from torchvision import transforms from models import builder from utils import constants, options, utils DEVICE = "cuda:0" DEMO_DIR = "demo" opt_cmd = op...
Python
1
ture stored in a Twizzler queue object. Used to open Twizzler queue objects /// and create a [Queue]. #[repr(C)] pub struct QueueBase<S, C> { sub_hdr: usize, com_hdr: usize, sub_buf: usize, com_buf: usize, _pd: PhantomData<(S, C)>, } fn get_raw_sub<S: Copy, C>(obj: &Object<QueueBase<S, C>>) -> RawQ...
Rust
0
d_hms(1997, 9, 9, 18, 0, 0), ], ); } #[test] fn daily() { let rrule = RRule { freq: Frequency::Daily, count: Some(3), by_hour: vec![9], by_minute: vec![0], by_second: vec![0], ..Default::default() }; test_recurring_rrule( rrule, ym...
Rust
0
* ( motion_lengths - self.env.motion_manager.motion_times[passed_target_pose_time] ) + self.env.motion_manager.motion_times[passed_target_pose_time] ) sample_max_time = ( torch.rand( self.target_pose_visible_mask[pass...
Python
1
scaG_k_val = tl.load(vecB + idx_b_NH * str_vecB_B_NH + (k - 1) * str_vecB_NC + (L - 1)).to(tl.float32) vecB_val = tl.load( vecB + idx_b_NH * str_vecB_B_NH + (k - 1) * str_vecB_NC + tl.arange(0, L), ).to(tl.float32) scaM_inter_km1_val = tl.load(scaM_inter + idx_b_NH * str_scaM_i...
Python
1
er: (), _1: PhantomData, _2: PhantomData, _3: PhantomData, }; } <filename>dochy_manual/src/make_manual/get_content.rs use dochy::error::DpResult; use std::path::Path; pub(crate) fn get_content(src : &str) -> DpResult<String>{ let s = std::fs::read_to_string(format!("src/{}", src))?; ...
Rust
0
_metrics_fn, threshold): def _streaming_metrics(predictions, labels, weights=None): precision_tensor, update_op = streaming_metrics_fn( predictions, labels=labels, thresholds=[threshold], weights=_float_weights_or_none(weights)) return array_ops.squeeze(precision_tensor), upda...
Python
1
old; } // computing (j mod n) points and integers let idxL = (n+1)*32; let idxR = (n+2)*32; while j != index { // compute L s_vec[j] = Scalar::random(&mut rng); // let sG = G * s_vec[j]; // let cpk_j = pk[j] * c_old; /...
Rust
0
""" control_surfaces > controls > fader Defines a fader control surface. Authors: * Maddy Guthridge [hello@maddyguthridge.com, HDSQ#2154] This code is licensed under the GPL v3 license. Refer to the LICENSE file for more details. """ from . import ControlSurface from .encoder import Encoder from .knob import Knob, M...
Python
1
Number of threads to use #[structopt(short, long, default_value = "8")] threads: usize, } fn main() -> MyResult<()> { let Opts { repr_results_file, out_file, nr_of_random_preferences, save_random_results, threads, } = Opts::from_args(); let mut results = re...
Rust
0
tetra is a library that helps integrate [egui](https://crates.io/crates/egui), //! an immediate mode GUI library, with [Tetra](https://crates.io/crates/tetra), //! a 2D game framework. //! //! ## Usage //! //! The easiest way to use egui-tetra is to make your main state struct implement //! egui-tetra's [`State`] trait...
Rust
0
from .. import Provider as DateTimeProvider class Provider(DateTimeProvider): DAY_NAMES = { "0": "domingo", "1": "lunes", "2": "martes", "3": "miércoles", "4": "jueves", "5": "viernes", "6": "sábado", } MONTH_NAMES = { "01": "enero", ...
Python
1
eck if it is still available ticket_pricing1.destroy(None, connection).unwrap(); let ticket_pricings = ticket_type.ticket_pricing(false, connection).unwrap(); let found_index1 = ticket_pricings.iter().position(|ref r| r.id == ticket_pricing1.id); let found_index2 = ticket_pricings.iter().position(|ref r...
Rust
0
"""Repository package.""" from .base_repository import BaseRepository from .system_repository import SystemRepository __all__ = ['BaseRepository', 'SystemRepository']
Python
1
proposed_batch.get_service_id().as_bytes().into(), )) .map_err(|err| ServiceError::UnableToHandleMessage(Box::new(err))) } ScabbardMessage_Type::UNSET => Err(ServiceError::InvalidMessageFormat(Box::new( ScabbardError::Messag...
Rust
0
class Solution: """ @param: numCourses: a total of n courses @param: prerequisites: a list of prerequisite pairs @return: true if can finish all courses or false """ def canFinish(self, numCourses, prerequisites): # dfs version if not prerequisites: return True ...
Python
1
Result<String, Error> { let html = if escaped { let input = Esc(input).to_string(); html::ansi_to_html(&input, &ansi_regex())? } else { html::ansi_to_html(&input, &ansi_regex())? }; let html = if optimized { optimize(&html) } else { html }; Ok(html) } const ANSI_REGEX: &st...
Rust
0
import cv2 import numpy as np import os import shutil import soundfile as sf def write_video(images, fn_output='output.mp4', frame_rate=20, overwrite=False): """Takes a list of images and interprets them as frames for a video. Source: http://tsaith.github.io/combine-images-into-a-video-with-python-3-and-open...
Python
1
from json import load from sis.config import configFile langFile = load(open('langs/{}.json'.format(configFile['lang']), encoding='utf-8'))
Python
1
vector/issues/8182> pub fn get_legacy_checksum( &self, path: &Path, buffer: &mut Vec<u8>, ) -> Result<Option<FileFingerprint>, io::Error> { match self.strategy { FingerprintStrategy::Checksum { ignored_header_bytes, bytes: _, ...
Rust
0
for (i, row) in data.chunks_exact(width as usize * 4).enumerate() { let start = (y as usize + i) * (atlas_width as usize * 4) + (x as usize * 4); texture[start..start + row.len()].copy_from_slice(row); } } let texture = Texture { size: (atlas_width, atlas_height), data:...
Rust
0
} } } pub(crate) fn recover_from_expr(p: &mut Parser) { let m = p.mark(); p.bump(); m.complete(p, SyntaxKind::NODE_PARSE_ERROR); } use crate::input::{self, gamepad, keyboard, mouse}; /// A user interface event. /// /// This is a subset of [`input::Event`]. /// /// [`input::Event`]: ../../input/enum....
Rust
0
""" from page 250 of comp prog handbook and also : https://www.youtube.com/watch?v=Tg1w-0a1xew """ def calc_z_arr(s): n = len(s) # the main z_arr z = [0] * n # l for left handler , r for right handler , and k for helper when it is in box l,r,k = 0,0,0 for i in range(1,n): # if ...
Python
1
Count files by language if language not in summary['files_by_language']: summary['files_by_language'][language] = 0 summary['files_by_language'][language] += 1 # Count symbols by language if language not in summary['symbols_by_language']: ...
Python
1
} 3 => { // 16K mode, fix high bank self.prg_bank_selector_16_lo = self.load_register & 0x0F; self.prg_bank_selector_16_hi = self.prg_banks - 1; } ...
Rust
0
>> { // TODO: implement unimplemented!() } // =========================================================================== // company // =========================================================================== async fn get_company(&self, id: ID) -> TGResult<Option<Company>> { ...
Rust
0
import heapq # Read input n, m, s, d = map(int, input().split()) ''' n = Number of nodes m = number of edges s = source node d = destination node ''' u = list(map(int, input().split())) # Nodes v = list(map(int, input().split())) # Nodes w = list(map(int, input().split())) # weights def dijkstra(grap...
Python
1
DETAIL_TYPES: xcb_xkb_gbn_detail_t = 1; /// The `xkb::GBNDetail::CompatMap` enum variant. /// /// This is a variant of [`xcb_xkb_gbn_detail_t`]. pub const XCB_XKB_GBN_DETAIL_COMPAT_MAP: xcb_xkb_gbn_detail_t = 2; /// The `xkb::GBNDetail::ClientSymbols` enum variant. /// /// This is a variant of [`xcb_xkb_gbn_detail_t`]....
Rust
0
pub version: i32, } impl_endpoint! { PUT ("/author/{:x}", id), #[body auth] UpdateAuthor<'_>, #[flatten_result] AuthorResponse } /// Delete author (requires authentication) /// /// Call to `DELETE /author/{id}` #[derive(Debug, Clone)] pub struct DeleteAuthor<'a> { /// Author id pub id: &'a Uu...
Rust
0
ring::from("An error occurred"), }, ), }; rb.content_type("application/json") .body(serde_json::to_string(&body).unwrap()) } } <reponame>Georgiy-Tugai/dfw // Copyright 2017 - 2019 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 <LICENSE-A...
Rust
0
or plaintext secrets in code files') parser.add_argument('files', nargs='*', help='Files to scan (default: staged files)') parser.add_argument('--staged-only', action='store_true', help='Only scan staged files') args = parser.parse_args() if args.staged_only or not args.files: # Get staged file...
Python
1
""" def __init__(self): r""" :param _Region: 资源所属地域。 当前支持ap-shanghai :type Region: str :param _Bucket: 桶名,存储资源的唯一标识 :type Bucket: str :param _CdnDomain: cdn 域名 :type CdnDomain: str :param _AppId: 资源所属用户的腾讯云appId :type AppId: str """ ...
Python
1
""" Website Content Scraper Module. This module handles the extraction of content from websites listed in the search results. It performs the following functions: 1. Reads search results from 'gsearch_results.json' 2. For each URL in the results: - Makes an HTTP request to fetch the webpage - Parses the HTML con...
Python
1
or to improve numerical stability (default: 1e-10)  fused (bool, optional): whether the fused implementation (CPU only) is used. Currently, `torch.float64`, `torch.float32`, `torch.float16`, and `torch.bfloat16` are supported. (default: None). Please note...
Python
1
a `target` purse. fn transfer_from_purse_to_purse( &mut self, source: URef, target: URef, amount: U512, ) -> Result<(), Error>; /// Records era info at the given era id. fn record_era_info(&mut self, era_id: EraId, era_info: EraInfo) -> Result<(), Error>; } /// Provide...
Rust
0
parts = line.split('\t') if '\t' in line else line.split() if len(parts) >= 3: if parts[-1] in ['高', '中', '低', '官方', '官方统计', '教育部']: if len(parts) >= 4: ...
Python
1
pt_save_path, "w", encoding="utf-8", ) as f: f.write(text) if save_emo: emo_save_path = save_path / rel_path.parent / f"{file_stem}_{i:03d}.emo" with open( emo_save_path, "w",...
Python
1
from dotenv import load_dotenv import streamlit as st import os import google.generativeai as ganai # Load environment variables load_dotenv() # Configure Google Generative AI API_KEY = os.getenv("GOOGLE_API_KEY") if not API_KEY: st.error("Error: GOOGLE_API_KEY is not set in the environment.") else: ganai.con...
Python
1
#N peças (total de peças). #Pode-se retirar 1 ou m peças. #Quem tirar a ultima possivel ganha o jogo. #Quem retirar a ultima peça ganha o jogo. import random def ehMultiplo(n, m): if(n % (m + 1) == 0): return True else: return False def computador_escolhe_jogada(n, m): num = random.ran...
Python
1
ighbors=5) knn_model.fit(x_train, y_train) # Predictions and evaluation y_pred_knn = knn_model.predict(x_test) # Convert y_test and y_pred_knn from one-hot encoding (if they are one-hot encoded) to class indices if len(y_test.shape) > 1: y_test_classes = np.argmax(y_test, axis=1) # Co...
Python
1
"cert {:?} is configured to be issued by EST, \ but EST identity could not be obtained \ and EST bootstrap identity is not configured; {}", id, identity_err, )) }; match bootstrap_identity { Ok((bootstrap_identity_cert, bootstrap_identity_private_key...
Rust
0
BY", vec![], vec![]), ex_fun("having", vec![], vec![]), ex_fun("ORDER_BY", vec![], vec![]), ], )), ), ( r#" let foobar = a1 + 3; //# cache foobar foobar * 5"#, Ok(ex_let( ...
Rust
0
fn pnt3_permutei(v: &Point3i, x: usize, y: usize, z: usize) -> Point3i { let v3: [i32; 3] = [v.x, v.y, v.z]; let xp: i32 = v3[x]; let yp: i32 = v3[y]; let zp: i32 = v3[z]; Point3i { x: xp, y: yp, z: zp, } } /// Interpolate linearly between two provided points. pub fn pn...
Rust
0
from sklearn.metrics import precision_score from sklearn.metrics import confusion_matrix y_true = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1] y_pred = [0, 1, 1, 1, 1, 0, 0, 0, 1, 1] print(precision_score(y_true, y_pred)) # 0.3333333333333333 print(precision_score(y_true, y_pred, pos_label=0)) # 0.25 print(precision_score(y_true...
Python
1
# Pluma comment functions # Copyright (C) 2019 Andrew Fowlie # Copyright (C) 2012-2021 MATE Developers # # 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 2 of the...
Python
1
MULTISAMPLE) }, false => unsafe { gl.Disable(gl::MULTISAMPLE) }, } } } pub(crate) fn bind_draw_color_buffers(gl: &GlContainer, num: usize) { let attachments: SmallVec<[gl::types::GLenum; 16]> = (0..num).map(|x| gl::COLOR_ATTACHMENT0 + x as u32).collect(); unsafe { gl.DrawBuffers...
Rust
0
import os import sys import types from setuptools import Command from .. import _scripts, warnings class easy_install(Command): """Stubbed command for temporary pbr compatibility.""" def __getattr__(name): attr = getattr( types.SimpleNamespace( ScriptWriter=_scripts.ScriptWriter, ...
Python
1
peed * seconds # time-based turning zoom *= zoomfactor # the surface shrinks and zooms and moves by rotating oldrect = snake.get_rect() # store current surface rect snake = pygame.transform.rotozoom(snake_original, angle, zoom) newrect = snake.get_rect() # store new surface rect...
Python
1
生成的词" } list_word_wcode_temp, words_done_temp = generate_dict_yaml_ciku( file_in, dict_char_codes_new, self.dict_word_freq, dict_meta, self.dir_out, words_done ) list_word_wcode += list_word_wcode_temp # (3)生...
Python
1
from django.contrib import admin from .models import Category, Course, Lesson, Unit, Review, AcademicLevel # Register your models here. class ReviewInline(admin.TabularInline): model = Review extra = 0 @admin.register(Category) class CategoryAdmin(admin.ModelAdmin): list_display = ['title', 'slug', 'is_act...
Python
1
/// When the row was last updated. pub updated_at: NaiveDateTime, /// When the row was created. pub created_at: NaiveDateTime, } #[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)] pub struct NewQuestion { /// The bucket to which the question belongs. pub bucket_uuid: Uuid, ...
Rust
0
te(vld3q_dup_s64(transmute(a))) } /// Load single 3-element structure and replicate to all lanes of three registers #[inline] #[target_feature(enable = "neon")] #[cfg_attr(test, assert_instr(ld3r))] #[stable(feature = "neon_intrinsics", since = "1.59.0")] pub unsafe fn vld3_dup_f64(a: *const f64) -> float64x1x3_t { ...
Rust
0
max(depth(A), depth(B)), where A and B are VPS's. /// depth("(" + A + ")") = 1 + depth(A), where A is a VPS. /// /// For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's. /// /// Given a VPS represented as string s, return the nesting depth of s. ///...
Rust
0
let input = args_1!(inputs); unsafe { let input = input.to_array_view::<f32>()?; let mut output = ArrayD::<f32>::uninitialized(&*self.output_shape.shape); let filters = self.packed_filters.as_ptr::<f32>()?; for n in 0..*self.input_shape.n() { ...
Rust
0
uilding = gis_models.ForeignKey(Building, on_delete=gis_models.CASCADE, null=True, blank=True) geom = gis_models.MultiLineStringField(srid=3857, spatial_index=True, null=True, blank=True) tags = ArrayField(ArrayField(gis_models.CharField(max_length=150), blank=True, null=True), null=True, blank=True) cla...
Python
1
msg.hops(){ hops.iter().for_each(|r|{ let hop = lib_data::AppHop::new( r.route_id(), std::net::Ipv4Addr::from(r.src()), std::net::Ipv4Addr::from(r.this()), r.ttl(), r.rtt() );...
Rust
0
gǒng"), ('𢀡', "huī,zuǒ"), ('𢀪', "ěr"), ('𢀵', "hàn"), ('𢀼', "fú"), ('𢁀', "fú"), ('𢁁', "zhuó"), ('𢁂', "jī,jì"), ('𢁏', "bāng"), ('𢁒', "qí"), ('𢁓', "shǐ,hài"), ('𢁕', "diǎo"), ('𢁖', "pèi"), ('𢁗', "xiǎn,gàn"), ('𢁘', "sān"), ('𢁝', "cháng"), ('𢁞', ...
Rust
0
232AM\" is"] #[doc = " available from the Application Notes section of the FTDI website describes how to calculate the divisor for"] #[doc = " a non-standard baud rate."] pub fn FT_SetDivisor(ftHandle: FT_HANDLE, usDivisor: USHORT) -> FT_STATUS; } extern "C" { #[doc = " @noop FT_SetDataCharacteristics"]...
Rust
0
import os import wx import wx.lib.throbber import leginon.gui.wx.Icons class Throbber(wx.lib.throbber.Throbber): def __init__(self, parent): emptybitmap = leginon.gui.wx.Icons.null() images = [emptybitmap] for i in range(1, 9): path = os.path.join('processing', 'green%d' % i) bitmap = leginon.gui.wx.Icon...
Python
1
::aya_bpf_cty::c_void) -> __u64 = ::core::mem::transmute(174usize); fun(ctx) } pub unsafe fn bpf_task_pt_regs(task: *mut task_struct) -> ::aya_bpf_cty::c_long { let fun: unsafe extern "C" fn(task: *mut task_struct) -> ::aya_bpf_cty::c_long = ::core::mem::transmute(175usize); fun(task) } pub...
Rust
0
.await .into(); let collection_items: Vec<CollectionItem> = serde_json::from_str(&support::unwrap_body_to_string(&response).unwrap()).unwrap(); assert_eq!( collection_items .iter() .find(|&i| i.collectible_id == collectible_id1) .unwrap() ...
Rust
0
from .store import Store from .utils import request_json from .urls import Urls, COUNTRY_USA class Address(object): """Create an address, for finding stores and placing orders. The Address object describes a street address in North America (USA or Canada, for now). Callers can use the Address object's met...
Python
1
onal[str] = None # 标题 content: str # 内容 drug_name: Optional[str] = None # 药物名称 condition: Optional[str] = None # 适应症/疾病 source: Optional[str] = None # 信息来源 last_updated: Optional[str] = None # 最后更新时间 reliability_score: Optional[float] = None # 可靠性评分 class MedicalScenario(BaseModel): ...
Python
1
from langchain_community.document_loaders.twitter import ( TwitterTweetLoader, ) __all__ = ["TwitterTweetLoader"]
Python
1
leaf let leaf_private = LeafPrivate::new(secret, nullifier); let leaf_hash = Leaf_x5::create_leaf(&leaf_private, &params5)?; let nullifier_hash = Leaf_x5::create_nullifier(&leaf_private, &params5)?; let leaf_bytes = leaf_hash.into_repr().to_bytes_le(); let nullifier_hash_bytes = nullifier_hash.into_repr().to_by...
Rust
0
The xor-beauty of the given array is 34.
Python
1
from torch import nn from lightning_protein.model.genie1.modules.pair_transition import PairTransition from lightning_protein.model.genie1.modules.triangular_attention import ( TriangleAttentionStartingNode, TriangleAttentionEndingNode, ) from lightning_protein.model.genie1.modules.triangular_multiplicative_update i...
Python
1
# ----------------------------------------------------------------------------- # From Numpy to Python # Copyright (2017) Nicolas P. Rougier - BSD license # More information at https://github.com/rougier/numpy-book # ----------------------------------------------------------------------------- import math import random...
Python
1
sing(&mut self, path: &str, e: io::Error) { println!("\rError accessing {}: {}.", path, e); // Print another byte count message ASAP. self.last_reported_count = 0; } } extern crate chrono; use chrono::prelude::*; use std::env; use std::fs; use std::process; fn main() -> Result<(), Box<dyn std::error::...
Rust
0
ref: Self::TxRef, ) -> Result<Self::NoteRef, Self::Error> { Ok(0u32) } fn insert_witness( &mut self, _note_id: Self::NoteRef, _witness: &IncrementalWitness<Node>, _height: BlockHeight, ) -> Result<(), Self::Error> { ...
Rust
0
fn write_indent(&mut self) { for _ in 0..self.level { self.inner.push_str(" "); } } } } use error::Result; use untyped::Table; use serde::de::DeserializeOwned; use std::marker::PhantomData; /// An iterator over a [`Table`]. pub struct TableIterator<'a, V> { pu...
Rust
0
ifeCycle, LifeCycleCtx, MouseButton, MouseEvent, Widget, }; pub struct ExClick<T> { button: Option<MouseButton>, action: Box<dyn Fn(&mut EventCtx, &MouseEvent, &mut T, &Env)>, } impl<T: Data> ExClick<T> { pub fn new( button: Option<MouseButton>, action: impl Fn(&mut EventCtx, &MouseEve...
Rust
0
! Then simply show that each of these reductions transform uniformly distributed variables to //! uniformly distributed variables. //! //! # Inner workings //! //! In technical terms, SeaHash follows a alternating 4-state length-padded Merkle–Damgård //! construction with an XOR-diffuse compression function (click to e...
Rust
0
# The MIT License (MIT) # # Copyright (c) 2021, NVIDIA CORPORATION. # # 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, co...
Python
1
use super::*; fn generate_primitive<T, R>( rng: &mut R, len: usize, valid_percent: f64, range: Range<T::Native>, ) -> ArrayRef where T: ArrowPrimitiveType, T::Native: SampleUniform, R: Rng, { Arc::new(PrimitiveArray::<T>::from_iter((0..len...
Rust
0