text
string
label_name
string
labels
int64
# -*- coding: utf-8 -*- """ Created on Sat Oct 10 17:28:01 2015 @author: Steve Elston Code for visualization of the residuals (errors) of the regression model. """ def azureml_main(BikeShare): import matplotlib matplotlib.use('agg') # Set backend matplotlib.rcParams.update({'font.size': 20}) i...
Python
1
tree: OCamlRef<DynBox<WorkingTreeFFI>>, ) -> OCaml<Option<OCamlBytes>> { let ocaml_tree = rt.get(tree); let tree: &WorkingTreeFFI = ocaml_tree.borrow(); let result = tree.get_value(); result.to_ocaml(rt) } // OCaml = val of_value : context -> value -> tree Lwt.t fn ...
Rust
0
.csv"; let mut file = match File::create(&path) { Err(why) => panic!("couldn't create {}: {}", path, why.description()), Ok(file) => file, }; match file.write_all(header.as_bytes()) { Err(why) => { pani...
Rust
0
); //let mut topic_filter = subscribe.topic_filter.clone(); //topic_filter.insert(0, Level::Normal("PPP".into())); //return (true, Some(HookResult::TopicFilter(Some(topic_filter)))) } Parameter::ClientUnsubscribe(_session, c, unsubscribe) => { ...
Rust
0
e: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" tool = await response.parse() assert_matches_type(ToolListResponse, tool, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize ...
Python
1
import logging import os from datetime import datetime from pathlib import Path from typing import Any, Callable import torchrunx import torchrunx.utils.environment __all__ = ["distribute"] def build_logging_handlers(hostnames): log_dir = os.environ["TORCHRUNX_LOG_DIR"] Path(log_dir).mkdir(parents=True, exi...
Python
1
from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.ScrollLabel import ScrollLabel class TextBox(Screen): def __init__(self, session, text="", title=None, pigless=False): Screen.__init__(self, session) if pigless: self.skinName=["TextBoxPigLess", "TextBox"] self.text ...
Python
1
; } } false } fn update_speed(&self) -> f64 { let update_speed = if self.soft_drop { // TODO remove magic number // this is the constant soft drop number 0.05 } else { let level = (self.level as f64) - 1.0; ...
Rust
0
0] = 0; fishes.rotate_left(1); fishes[8] = ready; fishes[6] += ready; } fishes.iter().sum() } pub fn part1() { println!("Day 6, part 1: {}", solve(80)); } pub fn part2() { println!("Day 6, part 2: {}", solve(256)); } <reponame>paulalesius/seed //! The Response interface of the...
Rust
0
lf) -> &mut dyn (::std::any::Any) { self as &mut dyn (::std::any::Any) } fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { Self::descriptor_static() } ...
Rust
0
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Code for :undo --window.""" import collections import dataclasses from typing import cast, TYPE_CHECKING from collections.abc import MutableSequence from qutebrowser.qt.core import QObject,...
Python
1
mock_changelog.rst = ('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' 'Changelog for package fake_pkg\n' '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' '\n' 'Forthcoming\n' '-----------\n'...
Python
1
## Bu program, Viola ve Jones algoritmasına dayalı Haar Cascade sınıflandırıcısını kullanır ## Gerçek zamanlı olarak algılanan yüzlerin veritabanını oluşturur ## Kullanılan mikrodenetleyici kartı: "Arduino Uno" import numpy as np import cv2 import serial # Seri iletişim ayarları ser = serial.Serial(port='COM5', baudr...
Python
1
# Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ """ A variation of example 1 where client handling is performed in a separate function that in theory can be forked. """ from nagini_contracts.contracts import ( Assert, ContractOnly, Ensures, Impli...
Python
1
# SPDX-FileCopyrightText: 2022 Linh Hoang for NVIDIA # SPDX-FileCopyrightText: 2022 Melissa LeBlanc-Williams for Adafruit Industries # # SPDX-License-Identifier: MIT """Tegra T234 pin names""" import atexit from Jetson import GPIO GPIO.setmode(GPIO.TEGRA_SOC) GPIO.setwarnings(False) # shh! class Pin: """Pins d...
Python
1
.ok_or_else(|| invalid_data_error("unknown context ID"))?; let resp = GetDeviceTypeId_Return::new(ReturnCode::SCARD_S_SUCCESS); debug!("sending {:?}", resp); Ok(Some(resp.encode()?)) } fn handle_read_cache(&mut self, input: &mut Payload) -> RdpResult<Option<Vec<u8>>> { l...
Rust
0
ab_keypress(self, event): """Handles key presses specifically bound when the Map Tab is active.""" key = event.keysym.lower() if key == 'c': # Only cycle color if the key is 'c' (this handler is only active on map tab) # print("Map Tab Key: 'c' pressed. Cycling grid colo...
Python
1
ol is overloaded with work. fn grow_pool(&'static self, mut inner: MutexGuard<'static, Inner>) { // If runnable tasks greatly outnumber idle threads and there aren't too many threads // already, then be aggressive: wake all idle threads and spawn one more thread. while inner.queue.len() > in...
Rust
0
)*) => ( impl<'a $(,const $N: usize)*> fmt::Debug for $ty { #[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.as_str().fmt(f) } } impl<'a $(,const $N: usize)*> fmt::Display for $ty { #[inline] fn fmt...
Rust
0
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that the global xcode_settings processing doesn't throw. Regression test for http://crbug.com/109163 """ import TestGyp impor...
Python
1
import os import requests from langchain.tools import tool from langchain.text_splitter import CharacterTextSplitter from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import FAISS from sec_api import QueryApi from unstructured.partition.html import partition_html clas...
Python
1
ize, Serialize, Debug)] pub struct Volume { /// Volume level. pub level: Option<f32>, /// Mute/unmute state. pub muted: Option<bool>, } #[derive(Deserialize, Debug)] pub struct LaunchErrorReply { #[serde(rename = "requestId")] pub request_id: i32, ...
Rust
0
InfiniteContinuedFraction] represents a infinite simple continued fraction on an iterator //! 3. [GeneralContinuedFraction][GeneralContinuedFraction] is a trait that provides method to operate on a general continued fraction. //! //! # References: //! - <https://pi.math.cornell.edu/~gautam/ContinuedFractions.pdf> //! -...
Rust
0
import pytest from spacy import registry FUNCTIONS = [ ("loggers", "spacy.WandbLogger.v1"), ("loggers", "spacy.WandbLogger.v2"), ("loggers", "spacy.WandbLogger.v3"), ("loggers", "spacy.WandbLogger.v4"), ("loggers", "spacy.WandbLogger.v5"), ("loggers", "spacy.MLflowLogger.v1"), ("loggers", "...
Python
1
ension, AllocatedExtension}; use std::convert::AsRef; use std::error::Error; use std::str::FromStr; use std::convert::TryFrom; use std::{fmt, str}; /// The Request Method (VERB) /// /// This type also contains constants for a number of common HTTP methods such /// as GET, POST, etc. /// /// Currently includes 8 varia...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under both the MIT license found in the # LICENSE-MIT file in the root directory of this source tree and the Apache # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. # pyre-strict i...
Python
1
reset index Columns - Date (pandas.Timestamp): observation date - ISO3 (str): country names - Province (str): province/state/prefecture names - City (str): city names - Confirmed (numpy.float64): the ...
Python
1
ause BSD license. * See LICENSE.md for terms of use. */ use crate::vm::funcs::*; use crate::arm::threading::*; use crate::hos::smc::*; use crate::hos::kernel::*; use crate::arm::exceptions::*; use crate::vm::vmmu::*; use crate::util::*; use crate::arm::mmu::*; use crate::exception_handler::*; use crate::io::smmu::*;...
Rust
0
ow_data: list[NetflixShow]) -> list[str]: """ Returns a sorted list of only the show titles from show_data that are acted in by the 'most popular' actors where the 'most popular' is defined as the actors in the most shows. >>> l_unique_casts = [\ ('Movie', "Viceroy's House", ['Gurinder Chadha']...
Python
1
ain_label,test_label = train_test_split(data,label,test_size=0.2,random_state=42) #尝试分段标准化结束 svm = SVC() #C在0-10之间 gamam在0到1之间 #十折交叉调参,此过程会自动划分验证集 parameters = {'kernel':('linear', 'rbf'), 'C':np.linspace(1e-5,10,10),'gamma':np.linspace(1e-4,1,10)} # clf = GridSearchCV(svm,parameters) clf = RandomizedSearchCV(svm,pa...
Python
1
ive }; use crate::{ assets::Id, ecs::{ Const, Mut, Context }, services::{ Assets, Camera, World }, }; /// Service providing an interface to `WGPU` and `WINIT` /// /// Renderer is the only service added by default by the engine. It may change in future. pub struct Renderer { /// `WINIT` window instance...
Rust
0
# 通过界面与 Gemini 进行连续文字聊天 # 需配置 API 密钥 # 需配置代理 # 需安装 gradio 库 import os import google.generativeai as genai import gradio as gr import logging import time import requests from bs4 import BeautifulSoup from googleapiclient.discovery import build import webbrowser import threading from datetime import datetime # 配置日志 lo...
Python
1
# Copyright 2022 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
/lines.insert(0, format!("│{}│", pad)); //lines.push(format!("│{}│", pad)); lines } } #[derive(Clone, Debug, PartialEq, Eq, Hash)] struct Term { const_mult: i32, /// Says location of term to multiply by. var_mult: Option<[usize; 2]>, det: Determinant, } impl Term { fn new(const...
Rust
0
define_number("sq_ft", sq_ft, nullable=True) if increases is not None: self.increases = self._define_str("increases", increases, nullable=True) if lease_expiry is not None: self.lease_expiry = self._define_str( "lease_expiry", lease_expiry, nullable=True ...
Python
1
new(); 'ma: loop { input.clear(); top1_menu(); if io::stdin().read_line(&mut input).is_err() { println!("you input error!!! "); continue; } match input.as_str().trim() { // .trim 去空白符 "1" => { open_account(); ...
Rust
0
terId: Number, const STRENGTH: usize>( mut sut: SUT<ValueId, ParameterId>, output_path: PathBuf, ) -> Result<(), String> where [(); STRENGTH - 1]:, [(); STRENGTH - 2]: { let mca = time_it!( unconstrained::UnconstrainedIPOG::< ValueId, ParameterId, u128, un...
Rust
0
) => left.or(&[&right]), (mir::BinOp::BitOr, _) => left.bvor(&right), (mir::BinOp::Mul, _) => left.bvmul(&right), (mir::BinOp::Shl, _) => left.bvshl(&right), (mir::BinOp::Shr, kind) if kind.is_signed_int() => left.bvashr(&right), (mir::BinOp::Shr, _) => left...
Rust
0
class Solution: def uniquePathsWithObstacles(self, obstacleGrid: list[list[int]]) -> int: # Get the dimensions of the grid (m rows and n columns) m, n = len(obstacleGrid), len(obstacleGrid[0]) # If the start or end point has an obstacle, no path is possible. if obstacleGrid[...
Python
1
ymmetry['rotations']), msg=("%s" % fname)) for r, t in zip(dataset['rotations'], dataset['translations']): found = False for r_, t_ in zip(symmetry['rotations'], symmetry['translations']): if ...
Python
1
, &times), iqr = percentile(0.75, &times) - percentile(0.25, &times), ); } egraph } /// Utility to make a test proving expressions equivalent /// /// # Example /// /// ``` /// # use egg::*; /// egg::test_fn! { /// // name of the generated test function /// my_test_name, /// // ...
Rust
0
c/include", "aac/libSBRdec/include", "aac/libSBRenc/include", "aac/libArithCoding/include", "aac/libDRCdec/include", "aac/libSACdec/include", "aac/libSACenc/include", ]; fn main() { for src in SOURCES { // Tell cargo to invalidate the built crate whenever the wrapper changes ...
Rust
0
RNS.log(f"Decryption with ratchets failed on {self}, reloading ratchets from storage and retrying", RNS.LOG_ERROR) self._reload_ratchets(self.ratchets_path) decrypted = self.identity.decrypt(ciphertext, ratchets=self.ratchets, enforce_ratchets=self.__enforce_ra...
Python
1
reponame>linianhui/div // https://docs.oracle.com/javase/specs/jvms/se12/html/jvms-4.html#jvms-4.5 /* field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; } */ use crate::...
Rust
0
aster { fn drop(&mut self) { // Errors when closing are ignored because we don't actually know if the file descriptor // was closed. If we retried, it's possible that descriptor was reallocated in the mean // time and the wrong file descriptor could be closed. let _ = ::unistd::close...
Rust
0
lized = y_normalized.reshape(N, C, -1) # (N, C, H*W) # consine similarity cosine_sim = torch.bmm(x_normalized.transpose(1, 2), y_normalized) # (N, H*W, H*W) # convert to distance dist = 1 - cosine_sim return dist # TODO: Considering avoiding OOM. def compute_l1_dist...
Python
1
// /// # Arguments /// /// * `input_path` - The input file path contianing the points and fold instructions. /// * `num_folds` - The number of fold instructions to perform. /// /// # Returns /// /// The number of dots visible after N folds. fn solution(input_path: &str, num_folds: usize) -> usize { let reader = get...
Rust
0
Bfull = cp_block_diag(B, Nhor) constr = [cvx_x[0:nx] == cvx_x0] # Initial condition constr += [cvx_x[nx:] == Afull @ cvx_x[:-nx] + Bfull @ cvx_u] # Dynamics constr += [cvx_u >= -u_max, cvx_u <= u_max] # Input constraints # Build problem prob = cp.Problem(obj, constr) # Functions to generate...
Python
1
from flask import Flask, request, jsonify import tweepy import praw import json import os app = Flask(__name__) def twitter_post(auth_details, post): # Initialize Tweepy Client with bearer token client = tweepy.Client(bearer_token=auth_details['bearer_token'], consumer_key=auth_deta...
Python
1
nder the Apache License, Version 2.0, // found in the LICENSE-APACHE file in the root directory of this source tree. // You may not use this file except in compliance with the License. //! Managing [GPU shaders](https://en.wikipedia.org/wiki/Shader). use crate::*; use std::sync::atomic::{AtomicUsize, Ordering}; use w...
Rust
0
:XaH[UR[>5(d&[SURSURS 35eGMr[SURS35e [AURR5Sn U RS:XdeU RB...
Python
1
hook)*; let val = ($extra).to_uint(ctx, FieldTypeTp::LongLong)?; Ok(Some(val as i64)) } } } }; } cast_as_unsigned_integer!( Int, cast_int_as_uint, *val, if *val < 0 && in_union(extra.implicit_args) { return Ok(Some(...
Rust
0
afe to // reinterpret that range as `[T; $len]`. unsafe { *(array.as_ptr() as *const _ as *const [$ty; LEN]) } } // Safety: See the body of `__assume_init`. unsafe { __assume_init::<$($ctx_t,)* {$len_value}>(array) } }}; } #[cfg(test)] mod tests { use super::U; ...
Rust
0
N]; M], //! } //! //! # impl<T, const M: usize, const N: usize> Matrix<T, M, N> //! # where //! # T: Copy, //! # { //! # pub fn transposed(self) -> Matrix<T, N, M> { //! # let mut result = [[None; M]; N]; //! # for i in 0..M { //! # for j in 0..N { //! # result[j][i]...
Rust
0
_WINNT", "0x0600") .define("WIN32_LEAN_AND_MEAN", None) .file(win_path.join("async.c")) .file(win_path.join("core.c")) .file(win_path.join("detect-wakeup.c")) .file(win_path.join("dl.c")) .file(win_path.join("error.c")) .file(win_path.j...
Rust
0
_completed_idx = cur_len; f(&started_workunits, &completed_workunits) } } pub fn new_span_id() -> String { let mut rng = thread_rng(); let random_u64: u64 = rng.gen(); hex_16_digit_string(random_u64) } fn hex_16_digit_string(number: u64) -> String { format!("{:016.x}", number) } /// /// The per-thread...
Rust
0
#!/usr/bin/python # # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
1
ID_NVIDIA_PROPRIETARY_KHR: VkDriverId = 4; pub const VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR: VkDriverId = 5; pub const VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR: VkDriverId = 6; pub const VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR: VkDriverId = 7; pub const VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR: VkDriverId = 8; pub con...
Rust
0
rn await call_next(request) async def log_request(prompt: str, success: bool, response_time: float, response_text: str = None, store_analytics: bool = False, error: str = None, model: str = None): """Background task for logging requests""" try: # Log system metrics data_co...
Python
1
def f(a): for x in range(90, 101): f = (x&79!=0) and ((x&31==0) <= (x&a!=0)) if not f: return 0 return 1 for a in range(1000): if f(a): print(a) break
Python
1
BlobValue(v.to_owned()) } } impl From<Vec<u8>> for Value { fn from(v: Vec<u8>) -> Self { Self::BlobValue(v) } } impl From<&str> for Value { fn from(v: &str) -> Self { Self::TextValue(v.to_owned()) } } impl From<String> for Value { fn from(v: String) -> Self { Self::Tex...
Rust
0
gistry mutation: {} key {}", show_mutation_type(mutation.mutation_type), key, ); } None } }) .collect::<Vec<_>>(); i...
Rust
0
# views.py from rest_framework import generics from .models import Resume from .serializers import ResumeSerializer class ResumeListCreateView(generics.ListCreateAPIView): queryset = Resume.objects.all() serializer_class = ResumeSerializer class ResumeDetailView(generics.RetrieveUpdateDestroyAPIView): que...
Python
1
# This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # wger W...
Python
1
nfigChanged } /// Update the given chain configuration, by removing it with /// [`Supervisor::remove_chain`] and adding the updated /// chain config with [`Supervisor::remove_chain`]. /// /// If the update had any effect, returns [`CmdEffect::ConfigChanged`] as /// subscriptions need to be reset to take into account t...
Rust
0
from pyrogram import Client, filters from decorators.validate_command_pre_check import validate_command_pre_check from decorators.save_user_chat_db import save_user_chat_in_db from decorators.is_bot_admin import is_bot_admin from decorators.extras import send_message, edit_message from utils import logException, logInf...
Python
1
] { input = input + n; } } assert_eq!(5, input); unsafe { N[(pos ^ 1) * 5 + 0] = 5; } } #[deps(NN_007: NN_001 NN_002 NN_003 NN_004 NN_005)] #[tokio::test] async fn tokio_neural_network_007() { let mut input = 0; let pos = 1 % 2; time::sleep(Duration::from_secs_f6...
Rust
0
def test_depth2img_pndm(self): pipe = StableDiffusionDepth2ImgPipeline.from_pretrained( 'stabilityai/stable-diffusion-2-depth') pipe.to(torch_device) pipe.set_progress_bar_config(disable=None) inputs = self.get_inputs() image = pipe(**inputs).images[0] expected_image = load_numpy( ...
Python
1
my_dict = { "name" : "Abhishek", "age" : 34, "role" : "SDET", "experience" : 1 } print(my_dict["age"]) my_dict["age"] = 43 print(my_dict) del my_dict["age"] print(my_dict) print(type(my_dict)) for key,value in my_dict.items(): print(key,"->",value) print("age" in my_dict) print("experience" in ...
Python
1
) .arg( Arg::new("GFA") .help("Input GFA file.") ), ) .subcommand( Command::new("stats") .about( "Some stats about the input GFA.", ) ...
Rust
0
ts { *self } fn to_scaled(&self, scale: &DisplayScale<T>) -> Self::Scaled { *self / scale.additional } } impl<T> Displayable<T> for Figure<T, Pixels> where T: Div<T, Output = T> + Mul<T, Output = T> + Copy, { type Pixels = Self; type Points = Figure<T, Points>; type Scaled ...
Rust
0
(Statement::Directive(Directive::Prefix(PrefixDirective { prefix: Some(Cow::Borrowed("owl")), iri: IRIReference { iri: Cow::Borrowed("http://example.com/ontology"), }, }))), ], ...
Rust
0
array[0], j1: array[1], k1: array[2], w1: array[3], i2: array[4], j2: array[5], k2: array[6], w2: array[7], i3: array[8], j3: array[9], k3: array[10],w3: array[11], i4: array[12],j4: array[13],k4: array[14],w4: array[15], } } pub fn from_column_major(array : Vec<f64...
Rust
0
# Copyright 2025 The Marin Authors # # 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 wr...
Python
1
::BezPath, piet::{ PietText, PietTextLayout, Text, TextAttribute, TextLayout, TextLayoutBuilder, }, BoxConstraints, Command, Env, Event, EventCtx, FontFamily, FontWeight, LayoutCtx, LifeCycle, LifeCycleCtx, MouseEvent, PaintCtx, Point, Rect, RenderContext, Size, Target, UpdateCtx, Vec2...
Rust
0
as usize] = !(0_i32 as SizeT); char_mask[z.wrapping_add(1_i32 as SizeT) as usize] = char_mask[z.wrapping_add(0_i32 as SizeT) as usize]; char_mask[z.wrapping_add(2_i32 as SizeT) as usize] = char_mask[z.wrapping_add(1_i32 as SizeT) as usize]; ...
Rust
0
d pretrained embeddings. vocab_file = os.path.join( FLAGS.raw_input_dir, "wikitable_glove_vocab.json") embedding_file = os.path.join( FLAGS.raw_input_dir, "wikitable_glove_embedding_mat.npy") embedding_model = word_embeddings.EmbeddingModel(vocab_file, embedding_file) def create_vocab(e...
Python
1
RR(Rw((sp/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/site-packages/future/backports/urllib/request.pyRPY s  N( RRR,R8RzR=RRERRLRP(((sp/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/site-p...
Python
1
changed = True elif stateName == "Combat": display.set_update_speed(badger2040.UPDATE_FAST) if DEBUG_INPUTS and display.pressed(badger2040.BUTTON_A): # DEBUG init combat init_combat() changed = True elif display.pressed(badger2040.BUTTON_A): ...
Python
1
de::VariableNode(ref n) => n._prt(indent, is_last, stdout), SyntaxNode::BadNode(_) => { let _ = print_node(style::Color::Red, &indent, self, is_last, stdout); } } } pub fn can_const_eval(&self) -> bool { match self { SyntaxNode::BinaryNode(ref...
Rust
0
workchain_id => get_top_blocks(custom.shards(), &[workchain_id])? }; for block_id in shard_ids { // println!("{}", block_id.shard()); let vset = config.validator_set()?; let cc_config = config.catchain_config()?; let subset = calc_subset_for_w...
Rust
0
::new(locof!(0, 0, 0, 0))); let v = f.loc(); assert_eq!(v, locof!(0, 0, 0, 0)); } <filename>src/test/ui/traits/default-method-supertrait-vtable.rs // run-pass // Tests that we can call a function bounded over a supertrait from // a default method fn require_y<T: Y>(x: T) -> isize { x.y() } trait Y { fn ...
Rust
0
6 9F 17 DA D8 64 75 54 B1 F3 45 0C 0B 3C 74 B3 9D BC EB 53 73 87 C3 0E 62 47 48 62 CA 59 EB 86 3F 3A FA 86 B5 BF A8 6D 06 16 50 82 C4 CE 62 9E 4E E6 4C C7 30 3E DE A1 0B D8 83 0B B6 B8 28 BC A9 EB 77 43 FC 7A 17 94 85 21 CA 37 6B 30 95 B5 46 77 30 60 B7 12 D6 ...
Rust
0
from django.test import TestCase from wagtail.admin.rich_text.converters.html_ruleset import HTMLRuleset class TestHTMLRuleset(TestCase): def test_html_ruleset(self): ruleset = HTMLRuleset( { "p": "paragraph", "a[href]": "link", "a[linktype=page...
Python
1
tem; type TryDropKton = (); } parameter_types! { pub const Prefix: &'static [u8] = b"Pay RUSTs to the TEST account:"; } impl Trait for Test { type Event = (); type Prefix = Prefix; type RingCurrency = Ring; } fn alice() -> secp256k1::SecretKey { secp256k1::SecretKey::parse(&keccak256(b"Alice")).unwr...
Rust
0
TestManifestError::InvalidTestType(t) => { write!(f, "The test {} has an unsupported or missing rdf:type", t) } TestManifestError::InvalidTestAction(t) => { write!(f, "The test {} has an invalid or missing mf:action", t) } TestManifestError...
Rust
0
r(BaseType::F32, ContainerType::Matrix(MatrixFormat::ColumnMajor, 4, 2)), gl::FLOAT_MAT4x3 => Var(BaseType::F32, ContainerType::Matrix(MatrixFormat::ColumnMajor, 4, 3)), // TODO: double matrices gl::SAMPLER_1D => Sampler(BaseType::F32, SamplerTyp...
Rust
0
e': timezone, 'language': 'en', } # TODO BUG ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmp......upload.png'> # seems to be a leak in Pillow response = self.client.post(reverse('user_profile:edit_profile', kwargs={"username": user_name}), ...
Python
1
K, 3 => TCCLKSR::TIMER_DIV4_CLOCK, 4 => TCCLKSR::TIMER_DIV5_CLOCK, 5 => TCCLKSR::XC0, 6 => TCCLKSR::XC1, 7 => TCCLKSR::XC2, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `TIMER_DIV1_CLOCK`"] #[inline] ...
Rust
0
#!/usr/bin/python3 from jsmin import jsmin import argparse import sys import base64 import urllib.parse import html parser = argparse.ArgumentParser( sys.argv[0], description="Package a payload for XSS", ) parser.add_argument("payload", help="Javascript payload file", default="new-admin-payload.js") parser.add...
Python
1
unsafe { *table = 1 as _ }; CUresult::CUDA_SUCCESS } CONTEXT_LOCAL_STORAGE_INTERFACE_V0301_GUID => { unsafe { *table = CONTEXT_LOCAL_STORAGE_INTERFACE_V0301_VTABLE.as_ptr() as *const _ }; CUresult::CUDA_SUCCESS } _ => CUresult::CUDA_ERROR_NOT_SU...
Rust
0
"pypika.utils.ignore_copy": "https://pypika.readthedocs.io/en/latest/api/pypika.utils.html#pypika.utils.ignore_copy", "pypika.utils.joinexception": "https://pypika.readthedocs.io/en/latest/api/pypika.utils.html#pypika.utils.JoinException", "pypika.utils.queryexception": "https://pypika.readthedocs.io/en/latest/...
Python
1
// Return the drawn frame. frame } <reponame>janx/ckb use crate::txs_pool::pool::TransactionPoolService; use crate::txs_pool::trace::{Action, TxTrace}; use crate::txs_pool::types::*; use channel::select; use channel::{self, Receiver}; use ckb_chain::chain::{ChainBuilder, ChainController}; use ckb_chain_spec::co...
Rust
0
''' This file contains method for generating calibration related plots, eg. reliability plots. References: [1] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. arXiv preprint arXiv:1706.04599, 2017. ''' import math import matplotlib.pyplot as plt plt.rcParams.update({'fon...
Python
1
+ bar.get_height()/2, f'{acc:.3f}', ha='left', va='center', fontsize=9, fontweight='bold') ax.grid(True, alpha=0.3, axis='x') ax.set_xlim(0, 1.1) def _create_improvement_analysis(self, ax, qasa_models, qasa_accs): """創建改進分析""" improvement = qasa_accs[...
Python
1
# -*- coding: utf-8 -*- # @Time : 2017/1/7 17:04 # @Author : woodenrobot from scrapy import Request from scrapy.spiders import Spider from scrapyspider.items import DoubanMovieItem class DoubanMovieTop250Spider(Spider): name = 'douban_movie_top250' headers = { 'User-Agent': 'Mozilla/5.0 (Windo...
Python
1
l::request::auth::AuthStub; pub mod headers; pub mod query; pub mod url; pub mod matcher; pub mod method; pub mod body; pub mod auth; #[derive(Serialize, Deserialize, Debug, Default, Hash)] #[serde(default, rename_all = "camelCase")] pub struct RequestStub { #[serde(default)] pub method: HttpMethodStub, #...
Rust
0
import logging from pathlib import Path from functools import lru_cache import polars as pl logging = logging.getLogger(__name__) @lru_cache(maxsize=128) def create_column_mapping(data_dir: Path, time_column: str) -> dict[str, str]: """Create mapping of measurements to their source files.""" mapping = {} ...
Python
1
), key=lambda x: self.results[x]['avg_step_time']) best_result = self.results[best_key] print(f"\n🏆 最佳性能配置:") print(f" Batch Size: {best_result['batch_size']}") print(f" 模式: {'分布式' if best_result['distributed'] else '單GPU'}") print(f" 加速比: {...
Python
1
`index`. The equivalent of `get_unchecked_mut`. /// /// # Safety /// Behavior is undefined if the `index` value is greater than or equal to the length of the array. unsafe fn index_unchecked_mut(&mut self, index: usize) -> &mut T; } impl<T> IndexUnchecked<T> for [T] { #[cfg(target_arch = "spirv")]...
Rust
0