text
string
label_name
string
labels
int64
certificate_free_keys(sc: gnutls_certificate_credentials_t); } extern "C" { pub fn gnutls_certificate_free_cas(sc: gnutls_certificate_credentials_t); } extern "C" { pub fn gnutls_certificate_free_ca_names(sc: gnutls_certificate_credentials_t); } extern "C" { pub fn gnutls_certificate_free_crls(sc: gnutls_ce...
Rust
0
ants.WINDOW_HEIGHT - 50 # Use helper for achievement notification background _draw_text_with_background( frame, notif_text, (nx, ny), UIConstants.FONT_SCALE_LARGE, UIConstants.GREEN, ...
Python
1
.source_tx = source_tx.id WHERE tx.id = ?1", ) .unwrap(); let inputs_iter = inputs_stmt .query_map(params![tx], |row| { Ok(Input { index: row.get(0)?, id: row.get(1)?, }) }) .unwrap(); let inputs: rusql...
Rust
0
(()) } else { Err(ContextError::IoError(io::Error::last_os_error())) } } #[inline] fn is_current(&self) -> bool { unsafe { gl::wgl::GetCurrentContext() == self.context.0 as *const c_void } } fn get_proc_address(&self, addr: &str) -> *const () { let addr ...
Rust
0
::new().on_row(1)) .with_content({ list = ListViewBuilder::new(WidgetBuilder::new()).build(ctx); list }) .build(ctx), ), ...
Rust
0
.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 ...
Rust
0
ose associated TrueType font program is not embedded /// in the PDF file, the Encoding entry shall be a predefined CMap name encoding: Type0FontEncoding<'a>, /// A one-element array specifying the CIDFont dictionary that is the descendant of this Type 0 font descendant_fonts: CidFontDictionary<'a>, ...
Rust
0
andles_data) - 1, 'sell_signal'] = "True" # Ghi lại index của tín hiệu bán # Xử lý tín hiệu bán if sell_signal: #print(f"if current_macd < current_signal : {current_macd} > {current_signal}") if current_macd < current_signal: # ...
Python
1
import pytest import numpy as np from IndexBuilder.hash_index import LSHIndex @pytest.mark.unit def test_lsh_index_insert_and_query(): """Test the insert and query functionality of the LSHIndex class.""" num_hashes = 5 bucket_size = 10 lsh_index = LSHIndex(num_hashes, bucket_size) # Create a samp...
Python
1
let mut response = client.get(&url).send().await?; println!("HTTP status code: {}", response.status()); // Print headers for header_name in response.headers().keys() { for value in response.headers().get_all(header_name) { println!("Header: {}: {:?}", header_name, value); }...
Rust
0
o_x = |z| z == x; let y = 4; assert!(equal_to_x(y)); } /* #[test] fn example_function_capture() { // Does not compile: "error[E0434]: can't capture dynamic environment in a fn item" let x = 4; fn equal_to_x(z: i32) -> bool { z == x } let y = 4; assert!(equal_to_x(y)); } */ #[t...
Rust
0
e.to_string().as_str(), "Any" | "Null" | "boolean" | "number" | "string" | "date" | "date and time" | "time" | "years and months duration" | "days and time duration" ) { self.type_name = false; return Ok((TokenType::BuiltInTypeName, TokenValue::BuiltInTypeName(name))); } // ------...
Rust
0
fore. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) story.append(Paragraph('Heading 2 should always be kept with the next thing (%d)' % len(story), h2)) for j in range(3): story.append(P...
Python
1
require_class_method("java/nio/charset/CharsetDecoder\0", "unmappableCharacterAction\0", "()Ljava/nio/charset/CodingErrorAction;\0"); __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr()) } } /// [onUnmappableCharacter](https://developer.android.co...
Rust
0
lf.child.before]) def python(command="python"): """Start a Python shell and return a :class:`REPLWrapper` object.""" return REPLWrapper(command, u">>> ", u"import sys; sys.ps1={0!r}; sys.ps2={1!r}") def bash(command="bash"): """Start a bash shell and return a :class:`REPLWrapper` object.""" bashrc = o...
Python
1
(Copy, Clone, PartialEq, Eq, Hash)] pub enum TileType { Unusable, Slot, Road, Tower(Entity), } pub struct TileMap { pub tiles: Vec<TileType>, pub rows: i32, pub columns: i32, pub map_rect: Rect, pub tile_width: i32, pub tile_height: i32, pub entities: Vec<Entity>, } impl TileMap { pub fn new( ...
Rust
0
import json import os # File to store tasks tasks_file = "tasks.json" # Load tasks from file def load_tasks(): if os.path.exists(tasks_file): with open(tasks_file, 'r') as file: return json.load(file) return [] # Save tasks to file def save_tasks(tasks): with open(tasks_file, 'w') as ...
Python
1
_view(name))? } else if let Some(ref names) = &attr.attr_info.names { for name in names { sub_proof_request_builder.add_revealed_attr(&attr_common_view(name))? } } } } for predicate in req_predicates_for_credential { le...
Rust
0
import torch x1 = torch.Tensor([2.0]).double() ; x1.requires_grad = True x2 = torch.Tensor([0.0]).double() ; x2.requires_grad = True w1 = torch.Tensor([-3.0]).double() ; w1.requires_grad = True w2 = torch.Tensor([1.0]).double() ; w2.requires_grad = True b = to...
Python
1
t OCI_FNCODE_LOBFREETEMP: ::std::os::raw::c_uint = 88; pub const OCI_FNCODE_LOBISTEMP: ::std::os::raw::c_uint = 89; pub const OCI_FNCODE_AQENQ: ::std::os::raw::c_uint = 90; pub const OCI_FNCODE_AQDEQ: ::std::os::raw::c_uint = 91; pub const OCI_FNCODE_RESET: ::std::os::raw::c_uint = 92; pub const OCI_FNCODE_SVCCTXTOLDA:...
Rust
0
assume we are lukky. assert_eq!(payments, selected_payments); } #[test] fn test_nom_module(){ named!(parens<i64>, delimited!( char!('('), expr, char!(')') ) ); named!(i64_digit<i64>, map_res!( map_res!( digit, str::from_utf8 ), ...
Rust
0
end{lrbox}% \colorbox{sphinxnoteBgColor}{\usebox{\mytempbox}}} """, # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # '...
Python
1
 c@s,ddlTddlTddlTddlTdS(i(t*N(terrorsttypest type_Paramst type_Result(((s __init__.pyt<module>s   
Python
1
] } } } impl CounterSet { pub fn get_timer_counter_set(device: &DeviceRef) -> Option<CounterSet> { unsafe { // TODO: version check let sets: id = msg_send!(device, counterSets); let count: NSUInteger = msg_send![sets, count]; for i in 0..count { ...
Rust
0
or there are additional unknown divs.') for i in range(0, len(numclue_divs), 2): num = numclue_divs[i].text clue_div = numclue_divs[i + 1] clue_end = clue_div.text.rfind(' :') if clue_end < 0: raise XWordInfoParseError(error_text + 'Malformed clue for num...
Python
1
; 5usize], } pub type ip_addr_t = ip_addr; extern "C" { pub static ip_addr_any_type: ip_addr_t; } extern "C" { pub fn ipaddr_ntoa(addr: *const ip_addr_t) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn ipaddr_ntoa_r( addr: *const ip_addr_t, buf: *mut ::std::os::raw::c_char, buf...
Rust
0
import os import launch_ros from launch_ros.actions import Node from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.conditions import IfCondition from launch.substitutions import Command, LaunchConfiguration def generate_launch_description(): use_sim_time = Launch...
Python
1
from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection # plt.switch_backend('agg') from vis import vis_3d_pose def display_model( model_info, model_faces=None, with_joints=False, kintree_table=None, a...
Python
1
mass_number: 226, mass: UncertainFloat::new(226.030_89_f64, 0.000_43_f64), abundance: UncertainFloat::new(0.0, 0.0), xray_scattering: None, neutron_scattering: None }, Isotope { mass_number: 227, mas...
Rust
0
; pub mod unixfd; pub mod unmarshal; pub mod util; pub mod validate_raw; pub mod variant_macros; pub use unixfd::UnixFd; /// The different header fields a message may or maynot have #[derive(Debug)] pub enum HeaderField { Path(String), Interface(String), Member(String), ErrorName(String), ReplySer...
Rust
0
# How many labels are at max put into the output # ranking, everything else will be cut off LABEL_RANKING_LENGTH = 10
Python
1
key, value) in &func.exports.named { exports_mut.set_property(String::from(&**key).into(), Handle::clone(value)); } } vm.stack.discard_multiple(vm.stack.len() - frame.sp); unsafe { vm.stack.set_stack_pointer(frame.sp) }; vm.try_push_stack(exports) } ...
Rust
0
Self { match variant { TXPWDIBIAS_A::VALUE0 => false, TXPWDIBIAS_A::VALUE1 => true, } } } #[doc = "Reader of field `TXPWDIBIAS`"] pub type TXPWDIBIAS_R = crate::R<bool, TXPWDIBIAS_A>; impl TXPWDIBIAS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] ...
Rust
0
import laurelin def test_1_brackets(): output = laurelin.balanced_brackets("[[]]({}[])") assert output == True def test_2_brackets(): output = laurelin.balanced_brackets("[[({}[])") assert output == False def test_3_brackets(): output = laurelin.balanced_brackets("") assert output == True ...
Python
1
_path = rustc_lib_path(); } config.filter = env::args().nth(1); config.host = get_host(); config.src_base = PathBuf::from(path); config.target = target.to_owned(); config.target_rustcflags = Some(flags.join(" ")); compiletest::run_tests(&config); } fn compile_fail(path: &str, target: &str, ...
Rust
0
from flask import Blueprint, request, jsonify from src.model.transient.filter import Filter from src.service.pdv_tipo_plano_service import PdvTipoPlanoService pdv_tipo_plano_bp = Blueprint('pdv-tipo-plano', __name__) service = PdvTipoPlanoService() @pdv_tipo_plano_bp.route('/pdv-tipo-plano', methods=['GET']) @pdv_tip...
Python
1
::InternalError => Err(DiscoveryError::InternalError), } } fn get_channels_to_scan(device_info: &DeviceInfo) -> Vec<u8> { SUPPORTED_CHANNELS.iter() .filter(|chan| device_info.supported_channels.contains(chan)) .map(|chan| *chan) .collect() } const SUPPORTED_CHANNELS: &[u8] = &[ // ...
Rust
0
= max_depth res["n_estimators"] = n_estimators res["n_features"] = n_features if verbose: pprint(res) yield res compilation.extend(list(measure_onnx_runtime(rf, X_test))) ######################################## # HistGradientBoostingClassifier # ++++++++++++++++++++++++++++++ hist = HistGr...
Python
1
else: logger.warning("⚠️ Cannot auto-start voice input: main_window or toggle_voice_input not available") except Exception as e: logger.error(f"Error auto-starting voice input: {e}") import traceback traceback.print_exc() def show_chat_window(self...
Python
1
} } impl FromHex for $uint_type { fn from_byte_iter<I>(iter: I) -> std::result::Result<Self, hex::Error> where I: Iterator<Item=std::result::Result<u8, hashes::hex::Error>> + ExactSizeIterator + DoubleEndedIterator { if ite...
Rust
0
import cv2 import numpy as np draw=False reset=False p1=(0,0) p2=p1 def mouseClick(event,xPos,yPos,flags,param): #print(event,xPos,yPos,flags,param) global draw,reset,p1,p2 if event==cv2.EVENT_LBUTTONDOWN: draw=True reset=False p1=(xPos,yPos) p2=p1 if event==cv2.EVENT...
Python
1
ell.v7", True, namespace="webshell") # 判断base64函数是否可用 if verify_string not in res.r_text: gset("webshell.disable_base64_decode", True, namespace="webshell") gset("webshell.base64_en_func", "b64e", namespace="webshell") gset("webshell.base64_de_func", "b64d", namespace="webshell") i...
Python
1
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2018 Steve R <steversig@virginmedia.com> ## ## 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
import cv2 as cv import numpy as np from matplotlib import pyplot as plt messi_img = cv.imread(r"C:\Users\Kerem\PycharmProjects\cuda_solution\opencv-course-master\roi.jpg",cv.IMREAD_GRAYSCALE) messi_img_copy = messi_img.copy() template = cv.imread(r"C:\Users\Kerem\PycharmProjects\cuda_solution\opencv-course-master\m...
Python
1
from pydub import AudioSegment from pydub.playback import play sound = AudioSegment.from_wav("GI_GMF_B3_353_20140520_n.wav") play(sound)
Python
1
ault::default()); let layer = Layer::random(3, 2, &mut rng); let actual_biases: Vec<_> = layer.neurons.iter().map(|neuron| neuron.bias).collect(); let expected_biases = vec![-0.6255188, 0.5238805]; let actual_weights: Vec<_> = layer .neurons ...
Rust
0
t_angle, OperatorInfix::ShiftLeft)) .one(map(double_period, OperatorInfix::RangeExclusive)) .one(map(double_pipe, OperatorInfix::BooleanOr)) .one(map(double_right_angle, OperatorInfix::ShiftRight)) .one(map(greater_than_or_equals, OperatorInfix::GreaterThanOrEqual)) .one(map(less...
Rust
0
from .views import StoryUpdateAPIView __all__ = ["StoryUpdateAPIView"]
Python
1
import tkinter as tk from tkinter import scrolledtext import keyboard from pynput import mouse import numpy as np from PIL import ImageGrab from ocr.body_util import OcrContext,OcrBodyFactory from ocr.util import TranslationUtil from ocr.frame import ScreenWindow class TranslationWindow: selection_languages = { ...
Python
1
# Copyright (c) 2022 PaddlePaddle Authors. 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 required by appli...
Python
1
id = 6526)] pub struct SymbioticObjectErrorMessage<'a> { pub base: ObjectErrorMessage<'a>, pub error_code: i8, } #[derive(Clone, PartialEq, Debug, Encode, Decode)] #[protocol(id = 3024)] pub struct ObjectDeletedMessage<'a> { #[protocol(var)] pub object_uid: u32, pub _phantom: std::marker::PhantomDa...
Rust
0
896 let parts: Vec<&str> = stat_file_content.split_whitespace().collect(); if parts.len() < 4 { bail!( "{} contains less than the expected number of entries", stat_file_path.display() ); } if !parts[0].eq("user") { bai...
Rust
0
create out file")?; file.write_all(&buf).context("could not write to file")?; Ok(()) } <reponame>undefinedroot/rust<filename>src/librustc_ast/util/comments/tests.rs<gh_stars>1-10 use super::*; use rustc_span::with_default_session_globals; #[test] fn line_doc_comments() { assert!(line_doc_comment_style("//...
Rust
0
} } fn update_qos(&self, proportion: f64, diff: gst::ClockTimeDiff, timestamp: gst::ClockTime) { unsafe { gst_base_sys::gst_base_transform_update_qos( self.as_ref().to_glib_none().0, proportion, diff, timestamp.to_glib(), ...
Rust
0
serialized_length() } } impl FromBytes for ProtocolConfig { fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), bytesrepr::Error> { let (protocol_version_string, remainder) = String::from_bytes(bytes)?; let protocol_version = ProtocolVersion::from_str(&protocol_version_string) .map...
Rust
0
ITERS { let last_block = blocks.get(rng.next_u32() as usize % blocks.len()).unwrap(); let block = last_block.make_child(None); blocks.push(block.clone()); conn.put_block(&block).unwrap() } let mut conn_1 = store.connect().unwrap(); let blocks_1 = ...
Rust
0
, TRACKER.cwd))); // assert!(true); // Ok(()) // } // #[test] // fn test_linkat() -> io::Result<()> { // unsafe { // let fd = dirfd(opendir(CString::new("/tmp").unwrap().as_ptr())); // TRACKER.reportlinkat(fd, CString::new("/a/b/c").unwrap().as_ptr(),fd, CStr...
Rust
0
LExprVar), Clo(LExprVar), Fun(LExprVar), } impl Expr { pub fn for_each_ref<F: FnMut(ExprRef)>(&self, f: &mut F) { match self { Expr::Var(var) => f(ExprRef::Var(*var)), Expr::AppClo(clo, _args) => f(ExprRef::Clo(*clo)), Expr::AppFun(fun, _types, _args) => f(ExprRe...
Rust
0
AA, 0xAA, ], [ 0x12, 0x34, 0x56, 0x78, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,...
Rust
0
ollect(); vars.join("\r") } fn build_function_body(node: &XFlowNode, doc: &XFlowDocument) -> String { let body = match node.nodetype { XFlowNodeType::Flow => build_xflow_body(&node, &doc), XFlowNodeType::Flox => build_flox_body(&node, &doc), XFlowNodeType::Call => "call_xflow();".to_ow...
Rust
0
def compress_str(string): compressed_string = "" counter = 1 for i in range(len(string)): if i != len(string) - 1 and string[i] == string[i + 1]: counter += 1 else: if counter > 1: compressed_string += string[i] + str(counter) elif counter ...
Python
1
""" 图表测试API - 支持模板占位符的完整图表生成测试 """ from typing import Any, Dict, Optional from datetime import datetime from fastapi import APIRouter, Depends, HTTPException, Query from sqlalchemy.orm import Session from pydantic import BaseModel from app.core.architecture import ApiResponse from app.db.session import get_db from a...
Python
1
#!/usr/bin/python3.5 #coding:utf-8 from multiprocessing import Process, Queue import os, time, random # 写数据进程执行的代码: def write(q): print('Process to write: %s' % os.getpid()) print(id(q)) # linux/unix下q的id值相同,windows 不同 for value in ['A', 'B', 'C']: print('Put %s to queue...' % value) ...
Python
1
y::Left) => self.home(), Event::Key(Key::End) | Event::Ctrl(Key::Right) => self.end(), Event::Ctrl(Key::Up) | Event::Ctrl(Key::Home) => self.beginning_of_file(), Event::Ctrl(Key::Down) | Event::Ctrl(Key::End) => self.end_of_file(), Event::Key(Key::Left) => self.left(), ...
Rust
0
transformers import BertGenerationConfig, BertGenerationEncoder >>> # Initializing a BertGeneration config >>> configuration = BertGenerationConfig() >>> # Initializing a model from the config >>> model = BertGenerationEncoder(configuration) >>> # Accessing the model configura...
Python
1
t_ne!("abc", param); } } <filename>RMI/rmi_lib/src/train/two_layer.rs // < begin copyright > // Copyright <NAME> 2020 // // See root directory of this project for license terms. // // < end copyright > use crate::models::TrainingKey; use crate::models::*; use crate::train::{validate, train_model, train_model_...
Rust
0
e, latent_space) @classmethod def get_infer_spec(cls, env_spec, latent_dim, inference_window_size): """Get the embedding spec of the inference. Every `inference_window_size` timesteps in the trajectory will be used as the inference network input. Args: env_spec (ga...
Python
1
String::new(title) { Ok(s) => s, Err(e) => return failed(format!("Could not convert title to UTF-8: {}", e)), }; let c_title_ptr = c_title.as_bytes_with_nul().as_ptr() as *mut c_char; let title_ptr = &mut [c_title_ptr]; let mut prop: x::XTe...
Rust
0
# coding=utf-8 # fish_system.py 单元测试 # 2018.5.26 create by David Yi # 2020.3.27 edit by David Yi; #257 import platform import os import pytest from fishbase.fish_system import * # 定义当前路径 current_path = os.path.dirname(os.path.abspath(__file__)) # 定义配置文件名 conf_filename = os.path.join(current_path, 'test_conf.ini') co...
Python
1
me(Format::Bcf) => BcfSearch::new(&self.storage).search(query), Some(Format::Unsupported(format)) => Err(HtsGetError::unsupported_format(format)), } } fn get_supported_formats(&self) -> Vec<Format> { vec![Format::Bam, Format::Cram, Format::Vcf, Format::Bcf] } fn are_field_parameters_effective(&s...
Rust
0
if self.return_logprob is None: self.return_logprob = [False] * num elif not isinstance(self.return_logprob, list): self.return_logprob = [self.return_logprob] * num if self.logprob_start_len is None: self.logprob_start_len = [0] * nu...
Python
1
WHERE EXISTS ( SELECT * FROM Class WHERE LOWER(classType) = LOWER(?) ) AND NOT EXISTS ( SELECT * FROM Class WHERE LOWER(classType) = LOWER(?) AND NOT EXISTS ( SELECT * FR...
Python
1
ime.time() train_loss = train_epoch(X_train, y_train, LR) X_train, y_train = shuffle(X_train, y_train) val_err, val_loss = val_epoch(X_val, y_val) # test if validation error went down if val_err <= best_val_err: best_val_err = val_err best_epoch = epoc...
Python
1
connectors/sql-query-connector/src/query_builder/mod.rs pub mod read; pub mod write; pub use read::*; pub use write::*; use std::time::{Duration, UNIX_EPOCH}; use chrono::{DateTime, Utc}; use yahoo_finance_api as yahoo; #[cfg(not(feature = "blocking"))] #[tokio::main] async fn main() { let conn = yahoo::Yahoo...
Rust
0
from __future__ import annotations from ncatbot.core import BotClient, GroupMessage from swarmclone.module_bootstrap import * from typing import TYPE_CHECKING if TYPE_CHECKING: from swarmclone.frontend.frontend_qq import NCatBotFrontend @dataclass class NCatBotChatConfig(ModuleConfig): target_group_id: str = f...
Python
1
impl IntoIndex for String { fn to_index(&self) -> Index { Index::Key(self.clone()) } } impl IntoIndex for usize { fn to_index(&self) -> Index { Index::Position(*self) } } #[cfg(test)] mod tests { use super::*; #[test] fn impl_into_index_usize() { assert_eq!(0usiz...
Rust
0
#[test] fn i8() { test(i8::min_value()); test(0i8); test(i8::max_value()); } #[test] fn i16() { test(i16::min_value()); test(0i16); test(i16::max_value()); } #[test] fn i32() { test(i32::min_value()); test(0i32); test(i32::max_value()); } #[test] fn i64() { test(i64::min_val...
Rust
0
i>.<br>" "Please run <span style='font-family:monospace'>pip install --upgrade -r requirements.txt</span> " "in the openvino_env environment to install this version. " "See the <a href='https://github.com/openvinotoolkit/openvino_notebooks'>" "OpenVINO Notebooks README</a...
Python
1
#[test] fn array_range_only_end_index() { setup(); select_and_then_compare( "$[:4]", json!(["first", "second", "third"]), json!(["first", "second", "third"]), ); } #[test] fn array_range_only_from_index() { setup(); select_and_then_compare( "$.school.friends[1: ]"...
Rust
0
Subtree, mbe::ExpandError> { let loc = db.lookup_intern_macro(id); let macro_call = loc.ast_id.to_node(db); let arg = macro_call.token_tree().ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; let arg_start = arg.syntax().text_range().start(); let file = id.as_file(MacroFileKind::Expr); let li...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'IoT Box Homepage', 'category': 'Sales/Point of Sale', 'sequence': 6, 'website': 'https://www.odoo.com/page/point-of-sale-hardware', 'summary': 'A homepage for the IoT Box', 'description...
Python
1
from keras.losses import binary_crossentropy import keras.backend as K def dice_coef(y_true, y_pred): y_true_f = K.flatten(y_true) y_pred = K.cast(y_pred, 'float32') y_pred_f = K.cast(K.greater(K.flatten(y_pred), 0.5), 'float32') intersection = y_true_f * y_pred_f score = 2. * K.sum(intersection) ...
Python
1
class FiguraGeometrica: #Constructor def __init__(self,nombre = str,nLado = int): self.nombre = nombre self.nLado = nLado #Getters def getNombre(self): return self.nombre def getNlado(self): return self.nLado #Setters def setNombre(self,nombre):...
Python
1
raining_tpus) training_strategy = tf.distribute.experimental.TPUStrategy( resolver, device_assignment=training_da) with strategy.scope(): a = tf.Variable(1., trainable=True) temp_grad = tf.Variable( tf.zeros_like(a), trainable=False, synchronization=tf.Variable...
Python
1
ake/ /// Types for the crate pub mod types; /// This is the heart of the crate. The core module contains the /// basic functions required to make a snake game. pub mod core;<gh_stars>1-10 use crate::features::debug3d::{ ExtractedDebugData, Debug3dRenderFeature, DebugDraw2DResource, DebugDraw3DResource, Debug3dUnif...
Rust
0
): Ignore unsupported constraints. if let Some(width) = &self.width { fitness += width.fitness_distance(settings.width.as_ref()); } if let Some(height) = &self.height { fitness += height.fitness_distance(settings.height.as_ref()); } if let Some(aspect_rat...
Rust
0
umber of scans; ratchet up one scan */ (*(*cinfo).progress).pass_limit += (*cinfo).total_iMCU_rows as libc::c_long } } } /* D_MULTISCAN_FILES_SUPPORTED */ } (*cinfo).output_scan_number = (*cinfo).input_scan_number } ...
Rust
0
import numpy as np import matplotlib.pyplot as plt # 读取 CSV 文件(跳过表头) data = np.genfromtxt('/home/test_fss/code/cuda_code/build/course5_1/sgemm_benchmark_v7.csv', delimiter=',', skip_header=1) # 提取三列数据 sizes = data[:, 0] # Size cublas_time = data[:, 1] # CUBLAS_Time_ms mygemm_time = data[:, 2] # MySGEMM...
Python
1
32 { let delta_l_prime = color_2.l - color_1.l; let l_bar = (color_1.l + color_2.l) / 2.0; let c1 = (color_1.a.powi(2) + color_1.b.powi(2)).sqrt(); let c2 = (color_2.a.powi(2) + color_2.b.powi(2)).sqrt(); let (a_prime_1, a_prime_2) = { let c_bar = (c1 + c2) / 2.0; ...
Rust
0
)) """ from time import strptime from calendar import timegm months = ( "Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec" ) time_format = ' %d %H:%M:%S %Y GMT' # NOTE: no month, fixed GMT try: month_number = months.index(cert_time[:3].title()) ...
Python
1
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems Inc. # 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 # # ...
Python
1
f, project_name, file): project_path = "{}/{}".format(self.compose_path, project_name) project_file = "{}/docker-compose.yaml".format(project_path) if not os.path.exists(project_path): os.makedirs(project_path) #补充.env文件 env_file = "{}/.env".format(os.path.dirname(fi...
Python
1
"""Code to help indexing data into a vectorstore. This package contains helper logic to help deal with indexing data into a vectorstore while avoiding duplicated content and over-writing content if it's unchanged. """ from langchain_core.indexing.api import IndexingResult, aindex, index from langchain_core.indexing.b...
Python
1
ckground_process("delete_expired_sessions") async def _delete_expired_sessions(self) -> None: """Remove sessions with expiry dates that have passed.""" def _delete_expired_sessions_txn(txn: LoggingTransaction, ts: int) -> None: sql = "DELETE FROM sessions WHERE expiry_time_ms <= ?" ...
Python
1
Vec<BTreeMap<String, Value>> = (0..DICTIONARY_NAMES.len()) .map(|_| BTreeMap::new()) .collect(); for (dict_index, key_seed, value) in puts { let dict_index = dict_index as usize; assert!(dict_index < DICTIONARY_NAMES.len()); let key = key_seed.to_string(); assert_eq!...
Rust
0
; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const NELOG_Msg_Unexpected_SMB_Type: u32 = 3152u32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const NELOG_Name_Expansion: u32 = 3171u32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetMana...
Rust
0
true )); assert!(hmac_test_runner( &secret_key, &data, ShaVariantOption::SHA384, &expected_hmac_384, None, true )); assert!(hmac_test_runner( &secret_key, &data, ShaVari...
Rust
0
pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _SYSCTL_PCTIMER_P7W<'a> { w: &'a mut W, } impl<'a> _SYSCTL_PCTIMER_P7W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears...
Rust
0
from pathlib import Path basedir = Path(__file__).parent.parent class BaseConfig: SECRET_KEY = "24h5jh25j52GJV%UTGV&G%23" WTF_CSRF_SECRET_KEY = "Asdauif4ihv89nsib26d" UPLOAD_FOLDER = str(Path(basedir, "apps", "images")) LABELS = [ "unlabeled", "person", "bicycle", "car...
Python
1
osu file locally write_osu_file( bytes, format!("{}/{}.osu", glob.local_config.data.osu_files_dir, new_md5), ) .await; // Cache it let c = PPbeatmapCache::new(b); let b = c.get(); glob.caches .cache_pp_beatmap(new_md5.clone(), c.clone()) .await; glob.cach...
Rust
0