text
string
label_name
string
labels
int64
import datetime import tempfile from copy import copy from socket import gethostname import absl.flags as flags import ml_collections import wandb def _recursive_flatten_dict(d: dict): keys, values = [], [] for key, value in d.items(): if isinstance(value, dict): sub_keys, sub_values = _r...
Python
1
Z0; #[allow(non_camel_case_types)] type _0PartialDivP4 = <<A as PartialDiv<B>>::Output as Same<_0>>::Output; assert_eq!(<_0PartialDivP4 as Integer>::to_i64(), <_0 as Integer>::to_i64()); } #[test] #[allow(non_snake_case)] fn test__0_Pow_P4() { type A = Z0; type B = PInt<UInt<UInt<UInt<UTerm, B1>,...
Rust
0
b3 as wbgmeyqdaxd, mi14zxm18ui, pz6ilj4e6vr as v3l0ejdoc8s, u570iv64zuq, qbe2ycqynju as lkiz6rpzn4o wbx6rp4po9f def q9btfccok7_(ns2ymkwy4by: fw4y7az9wh9=None, eiuuovdsz0o=0.0, nhjgt7qkv46: lvkn3io7sim=b'', qpgahprzx8t=0, rguxr63g8jw: qdxrbc2br0_=0j, tzy2k415z3m=False, nzh6ufxeq78: dk6kk46iroy=0j, ph1x7d2_jhv: c316d...
Python
1
); Ok(()) } } <reponame>mjmorais/treerite fn main() { add_search_path(); add_llvm_path(); build_lib(); } #[cfg(feature = "static")] fn build_lib() { let dst = cmake::Config::new("treelite") .define("BUILD_STATIC_LIBS", "ON") .build(); println!("cargo:rustc-link-search...
Rust
0
import re import bleach from bleach.callbacks import nofollow, target_blank def remove_line_breaks(target_string: str) -> str: return target_string.replace('\r', '') def strip_line_breaks(target_string: str) -> str: return target_string.replace('\n', '').replace('\r', '') def clean_up_string(target_strin...
Python
1
(Type), Const(Const), } #[derive(Clone, PartialEq, Eq, Debug, Hash)] pub struct Lifetime { pub debruijn_index: Base62Number, } #[derive(Clone, PartialEq, Eq, Debug, Hash)] pub struct Binder { pub count: Base62Number, } #[derive(Clone, PartialEq, Eq, Debug, Hash)] pub enum Type { BasicType(BasicType),...
Rust
0
import turtle import random #Turtle List turtle_list=[] #Screen drawing_board=turtle.Screen() drawing_board.bgcolor("green") drawing_board.title("Turtle Game ") FONT=('Arial',30,'normal') score=0 game_over=False score_turtle=turtle.Turtle() countdown_Turtle=turtle.Turtle() def Setup_Score_Turtle(): #score Turtle ...
Python
1
en.NAME for u in tokens[i - 2 : i]) and [u.string for u in tokens[i - 2 : i]] == ["from", "__future__"] ): futureimpline = True if t.type == token.NEWLINE and futureimpline: futureimpline = False if fullname == "mercurial.pycompat":...
Python
1
= a_listing.highest_bid; let mut creator_token_manager = bank_read(&deps.storage).may_load(creator_key)?.unwrap_or_default(); creator_token_manager.token_balance = creator_token_manager.token_balance + price; bank(&mut deps.storage).save(creator_key, &creator_token_manager)?; let mut bidder_token_man...
Rust
0
if inner.access.contains(memory::READ) { let memory_range = vk::MappedMemoryRange { sType: vk::STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, pNext: ptr::null(), memory: inner.buffer.resource().memory, offset: 0, ...
Rust
0
} pub fn cur_pots(&self) -> impl Iterator<Item = &PotStatus> { self.pots.iter() } pub fn ind_offset(&self) -> i32 { self.first_ind } pub fn pots_str(&self) -> String { let mut res = String::new(); for status in &self.pots { res.push(match status { ...
Rust
0
) self.assertIs( avatar_xso.Pointer.height.default, None ) def test_as_payload_class(self): with contextlib.ExitStack() as stack: at_Pointer = stack.enter_context( unittest.mock.patch.object( avatar_xso.Pointe...
Python
1
z: p_obj.z, }) .normalize(); if self.reverse_orientation { it.n *= -1.0 as Float; } // reproject _p_obj_ to sphere surface and compute _p_obj_error_ p_obj *= self.radius / pnt3_distancef(&p_obj, &Point3f::default()); let p_obj_error: V...
Rust
0
qttUtf8String"); protocol_name.serialize(buf); let protocol_version = MqttOneBytesInt::new(5); protocol_version.serialize(buf); self.flags.serialize(buf); self.keep_alive.serialize(buf); self.props.serialize(buf); self.clientid.serialize(buf); if let...
Rust
0
# Copyright 2025 DeepMind Technologies Limited # # 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 agre...
Python
1
lename of rendered html """ if 'html' not in filename: filename = os.path.join(filename, ".html") html_plate = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>GitHub Actions Dashboard</title> <sc...
Python
1
: f64, //! } //! ``` //! //! Every symbol except the start symbol we need to annotate with `#[derive(LemonTreeNode)]`, and the start symbol with `#[derive(LemonTree)]`. //! Parser rules that return this symbol we put into `#[lem()]` annotation attributes. //! All `#[derive(LemonTreeNode)]`, `#[derive(LemonTree)]` and `...
Rust
0
FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, O...
Rust
0
ach episode self.episodeTdErr = deque() # record some sample of weights, once after episode self.episodeWeights = deque() # record some sample of weights, once each step, for observing the vary of weights self.weights = deque() if self.compatibilityMode: # bu...
Python
1
"); //! break; //! } //! # #[cfg(not(windows))] //! SIGQUIT => { //! eprintln!("Terminating on the QUIT signal"); //! break; //! } //! _ => unreachable!(), //! } //! } //! //! Ok(()) //! } //! ``` /...
Rust
0
trol_binding: Gst.ControlBinding //} fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_active_trampoline<P, F: Fn(&P) + 'static>( this: *mut ges_sys::GESTrackElement, _param_spec: glib_sys::gpointer, ...
Rust
0
import pandas as pd import matplotlib.pyplot as plt # ============================== # Leitura e preparação dos dados # ============================== df = pd.read_csv("data/vendas.csv", parse_dates=["data"]) df.dropna(subset=["produto", "quantidade", "preco_unitario"], inplace=True) if "valor_total" not in df.column...
Python
1
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import CustomUser @admin.register(CustomUser) class CustomUserAdmin(UserAdmin): fieldsets = UserAdmin.fieldsets + ( ('Дополнительные поля', {'fields': ('telegram_id',)}), ) add_fieldsets = UserAdmin.add_...
Python
1
15:00:52", "Size": 10032728, "ContactedHost": ["136.243.154.86", "52.84.125.27"], "DnsRequest": ["cloud.nitehe-nutete.com", "isrg.trustid.ocsp.identrust.com", "offers.filezilla-project.org"], "PositiveDetections": 1, "Name": "FileZilla_3.47.2.1_win64_sponsored...
Python
1
if mcu_y > 0 { rb[i] = results[i][(mcu_y - 1) * frame.image_size.width as usize + mcu_x]; if mcu_x > 0 { rc[i] = results[i] [(mcu_y - 1) * frame.imag...
Rust
0
refer to the ["choose a combinator" guide](https://github.com/Geal/nom/blob/master/doc/choosing_a_combinator.md) for an exhaustive list of parsers. //! See also the rest of the documentation [here](https://github.com/Geal/nom/blob/master/doc). //! . //! //! ## Making new parsers with function combinators //! //! nom i...
Rust
0
et name = standard_op_name(&self, &self.name, graph, &[self.input_id.clone()], &[self.output_id.clone()]); { let input_shape = self.input_id.shape(); if self.axes.len() == 0 { for i in 0..input_shape.ndim() { if matches!(input_shape.dimensions()[i], NodeDim::Known(_)) { self.axes.push(i as isize...
Rust
0
ut } => process_approve_kicker_coin(program_id, accounts), ShihonInstruction::DenyKickerCoin {} => process_deny_kicker_coin(program_id, accounts), ShihonInstruction::Candidate { coordinator, amount }, {} => process_candidate(program_id, accounts), ShihonInstruction::MixContent { time_shift_a,...
Rust
0
ok!(test_benchmark_lock_price()); }); } #[test] fn test_unlock_price() { new_test_ext().execute_with(|| { assert_ok!(test_benchmark_unlock_price()); }); } } <reponame>urschrei/polyline-ffi vec![ [52.48803, 13.37053], [52.48941, 13.37067], [52.49048, 13.37073], [52.49072, 13.37078], [52...
Rust
0
ow.className="toggle-arrow"; arrow.innerHTML="&#9654;"; header.appendChild(titleW); header.appendChild(arrow); block.appendChild(header); const wrapper = document.createElement("div"); wrapper.className="subcat-list"; wrapper.style.paddingLeft="12px"; const row = document.createElement("div"); row.cla...
Python
1
u8 = 0; let mut regs_write_count: u8 = 0; let rc_ptr: *mut u8 = &mut regs_read_count; let wc_ptr: *mut u8 = &mut regs_write_count; let res = unsafe { cs_regs_access(self.csh, &insn.0 as *const cs_insn, rr_ptr, ...
Rust
0
} #[derive(Debug)] #[allow(non_camel_case_types)] struct MyStructField2_Meth1(usize); impl IntrusiveBase for MyStructField2_Meth1 { type Container = MyStruct; type Field = i32; fn offset() -> usize { containerof_field_offset!(MyStruct:field2) } unsafe fn new(ia: IntrusiveAlias) -> Self { ...
Rust
0
""" Using This Code Example ========================= The code examples provided are provided by Daniel and Audrey Feldroy of Feldroy to help you reference Django Crash Course. Code samples follow PEP-0008, with exceptions made for the purposes of improving book formatting. Example code is provided "as is". Permission...
Python
1
import tkinter as tk from tkinter import messagebox import math def calculate_percentage(expression): """Calculate percentage in the expression.""" operators = ['+', '-', '*', '/'] for operator in operators: if operator in expression: # Split the expression based on the operator ...
Python
1
kRef); fn WebmVideoTrackGetWidth(track: WebmVideoTrackRef) -> c_longlong; fn WebmVideoTrackGetHeight(track: WebmVideoTrackRef) -> c_longlong; fn WebmVideoTrackGetFrameRate(track: WebmVideoTrackRef) -> c_double; fn WebmAudioTrackDestroy(track: WebmAudioTrackRef); fn WebmAudioTrackGetSamplingRate(tra...
Rust
0
import torch import os import pickle import yaml import numpy as np import matplotlib.pyplot as plt def pload(*f_names): """Pickle load""" f_name = os.path.join(*f_names) with open(f_name, "rb") as f: pickle_dict = pickle.load(f) return pickle_dict def pdump(pickle_dict, *f_names): """Pic...
Python
1
------- 登陆类型开关 ------------ # 是否禁用 普通 登录 self.disable_login_mode_normal = False # 是否禁用 QQ空间 登录 self.disable_login_mode_qzone = False # 是否禁用 爱玩 登录 self.disable_login_mode_iwan = False # 是否禁用 安全管家 登录 self.disable_login_mode_guanjia = False # 是否禁用 心悦 ...
Python
1
WriteStorage<'a, NextFrame<BodyPose3<f32>>>, WriteStorage<'a, RotationControl>, Read<'a, WindowFocus>, Read<'a, HideCursor>, ReadStorage<'a, FlyControlTag>, ); fn run( &mut self, ( events, mut transforms, mut body_poses, ...
Rust
0
t_visit::noop_flat_map_impl_item(i, self); } mut_visit::noop_flat_map_impl_item(i, self) } fn flat_map_field_def(&mut self, mut sf: FieldDef) -> SmallVec<[FieldDef; 1]> { if !self.st.marked(sf.id, self.label) { return mut_visit::noop_flat_map_field_d...
Rust
0
from flask import Blueprint, render_template, request views = Blueprint(__name__, "views")
Python
1
) for _, r0 in tail.iterrows(): last_ts_by[r0["symbol"]] = int(r0["ts"]) last_bp_by[r0["symbol"]] = float(r0["bp"]) last_ap_by[r0["symbol"]] = float(r0["ap"]) last_bsz_by[r0["symbol"]] = float(r0["bsz"]) last_asz_by[r0["symbol"]...
Python
1
using=True` we should see an Error with self.assertRaises(ValueError): pipe.fuse_lora(components=self.pipeline_class._lora_loadable_modules, safe_fusing=True) # without we should not see an error, but every image will be black pipe.fuse_lora(components=self.pipeline_...
Python
1
es_net = tf.pad(res_net, paddings, 'REFLECT') res_net = layers.conv2d(res_net, num_filters * 4, activation_fn=None) net += res_net end_points['resnet_block_%d' % block_id] = net ########### # Decoder # ########### with tf.variable...
Python
1
a + Result<T,E> + 'a>) { //~ ERROR expected trait, found //~^ ERROR only a single explicit lifetime bound is permitted panic!() } struct Traitor; trait Trait {} fn g() -> Traitor + 'static { //~ ERROR expected trait, found struct `Traitor` A } fn main() {} <filename>examples/displacement_mapping.rs extern crate...
Rust
0
# Ejercicio 2: Operaciones de conjuntos con listas # Este programa trabaja con 2 listas de palabras y que a continuacion # 1. Lista de palabras que aparecen en las listas. # 2. Lista de palabras que aparecen en la primera lista, pero no en la segunda. # 3. Lista de palabras que aparecen en la segunda lista, pero no en ...
Python
1
_end_step = tuning_cfg.get('profile_end_step', 1) tuning.run_after_tuning = tuning_cfg.get('run_after_tuning', True) tuning.debug = tuning_cfg.get('debug', True) engine_cfg = config['Engine'] engine_cfg['strategy'] = strategy def process_auto_ckpt_dir(config): configs = config["Engine"]["save_loa...
Python
1
d|jy )z} Helper method for special keys. Source: http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac rr)rrri i rrr%rrN)r AppKitNSEvent]otherEventWithType_location_modifierFlags_timestamp_win...
Python
1
import sys import os, glob import numpy as np sys.path.insert( 0, os.path.dirname(os.path.abspath(__file__)) + "/../../") from utils.logger.logger import logger from utils.plot_style.style import * import matplotlib.pyplot as plt from utils.ips.parse import * color = {3: [(63 / 255), (169 / 255), (245 / 255)], ...
Python
1
inkError> { let key = tink::proto::Ed25519PrivateKey::decode(serialized_priv_key) .map_err(|e| wrap_err("Ed25519SignerKeyManager: invalid key", e))?; let mut serialized_pub_key = Vec::new(); key.public_key .ok_or_else(|| TinkError::new("Ed25519SignerKeyManager: invalid ke...
Rust
0
from typing import Union, Tuple from air_benchmark import AIRBench from FlagEmbedding.abc.evaluation import ( AbsEvalRunner, EvalDenseRetriever, EvalReranker ) from .arguments import AIRBenchEvalArgs, AIRBenchEvalModelArgs class AIRBenchEvalRunner: """ Evaluation runner for AIR Bench. Args:...
Python
1
::machine() } pub fn reserve_pages(&self, start_page: usize, page_count: usize) { let mut free = lock!(self.free); if start_page <= free.len() { let page_count = cmp::min(page_count, free.len() - start_page); for i in start_page..start_page + page_count { ...
Rust
0
class Solution(object): def findMaxForm(self, strs, m, n): """ :type strs: List[str] :type m: int :type n: int :rtype: int """ # 01 背包 # 背包容量有两个维度 有多少个1和多少个0 # dp[i][j] 表示装满i个0和j个1容量的背包 最多装了dp[i][j]个物品 # 返回dp[m][n] ...
Python
1
from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow db = SQLAlchemy() ma = Marshmallow() def init_app(app): db.init_app(app) ma.init_app(app) config_db(app) def config_db(app): @app.before_first_request def init_database(): db.create_all() @app.teardown...
Python
1
ддас Елена ороллари', 'Sainte -Hélène', 'Saint -Helena', 'Sveta Jelena', 'SHN', 'سانت هيلنا', 'ⵙⴰⵏⵜⵉⵍⵉⵏ', 'ਸੇਂਟ ਹੇਲੇਨਾ', 'Santa Ilena', 'Sênt -Helêna', 'sɛ́ŋtɛ́ elɛ́ɛnɛ', 'સેન્ટ હેલેના', 'Sveta Helena', 'Sent Helen', 'Shën -Helena', 'Sv.Helēnas sala', 'Sint -Helena', 'ساينىت ھېلېنا', 'წმინდა ელენეს კუნძული', 'ᎠᏥᎸᏉ...
Python
1
OutputTensor { fn clear(&mut self) { self.output_format = ::std::option::Option::None; self.unknown_fields.clear(); } } impl ::std::fmt::Debug for TPUEmbeddingOutputLayout_EmbeddingOutputTensor { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::te...
Rust
0
from .app import app def start(): app.run(debug=True, host='0.0.0.0', port=5000, use_reloader=False)
Python
1
""" Serializer module for ArchitectSpeciality model. This module defines a serializer class for the ArchitectSpeciality model. """ from rest_framework import serializers from app.core.models.ArchitectSpeciality import ArchitectSpeciality class ArchitectSpecialitySerializer(serializers.ModelSerializer): """ ...
Python
1
psbt", "the PSBT file or raw PSBT in base64/hex").required(true), ]) } fn exec_decode<'a>(matches: &clap::ArgMatches<'a>) { let (raw_psbt, _) = file_or_raw(matches.value_of("psbt").unwrap()); let psbt: psbt::PartiallySignedTransaction = deserialize(&raw_psbt).expect("invalid PSBT"); let info = hal::GetInfo::get_...
Rust
0
ivar::<MetalViewPtr>("rustMetalView") }; rust_metal_view_ptr.write() } // Copyright 2020 <NAME>, 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 // // http://www.apache.org/licen...
Rust
0
n(TokenType::TokenStar, scanner), x if x == '!' => { if matchCharacter('=', scanner) { return Make_Token(TokenType::TokenBangEqual, scanner); } return Make_Token(TokenType::TokenBang, scanner); } x if x == '=' => ...
Rust
0
print('--------------------| 筛选level时报错:', e) try:cs.close() except Exception: pass return None try: cs.close() except: pass return month_order_sell_count_by_day_list def select_one_year_every_month_order_sell_count(self, year):...
Python
1
gl.Uniform1i(loc, unit as GLint); } } )*}; } texture_type_uniform! { impl &Texture<D1, C> = (Sampler1D, USampler1D, ISampler1D); impl &Texture<D2, C> = (Sampler2D, USampler2D, ISampler2D); impl &Texture<D3, C> = (Sampler3D, USampler3D, ISampler3D); impl &Textur...
Rust
0
: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::content::Context>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::net::Uri>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::...
Rust
0
# An example with functions in python # NOTE: good practice = a multiline comment at beginning of a function, # also when the function is simple. # Such a comment is an associated docstring, # which can be used in auto generated documentation. # Also see https://peps.python.org/pep-0257/#one-li...
Python
1
cur { low_points.push((x,y,map[x][y].to_string().parse::<i32>().unwrap())); } } } let risk_level: i32 = low_points.iter().map(|(_x,_y,level)| level + 1).sum(); let mut seen: HashMap<(usize, usize),char> = HashMap::new(); let mut basin_points: Vec<i32> = vec!(); ...
Rust
0
ce-connector.yaml".format( strimzi_path=STRIMZI_PATH ).format(version=STRIMZI_VERSION) ) as file: connector_dict = yaml.full_load(file) connector_dict["metadata"]["name"] = connector connector_dict["metadata"]["labels"]["strimzi.io/cluster"] = cluster connector_...
Python
1
# -*- coding: utf-8 -*- """ up2upyun ~~~~~~~~ Save uploaded pictures in Upyun. :copyright: (c) 2019 by staugur. :license: BSD 3-Clause, see LICENSE for more details. """ __version__ = "0.2.2" __author__ = "staugur <staugur@saintic.com>" __hookname__ = "up2upyun" __description__ = "将图片保存到又拍云" __st...
Python
1
data, test_size=0.2, random_state=42) # # -------------------------------------------------------------- K-means-------------------------------------------------------------- colors = ['red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'brown', 'grey', 'black'] # 產生的資料組數 (10) clusters = 10 # K 值...
Python
1
_document(config.clone())), ), TestFn::new( "test_get_a_document_not_found", Box::pin(doc_get::test_get_a_document_not_found(config.clone())), ), TestFn::new( "test_upserts_a_document", Box::pin(doc_upsert::test_upserts_a_document(config.cl...
Rust
0
.reshape(1, -1) J32 = np.sum(coordint2 * DHatPhi3, axis=0).reshape(1, -1) J33 = np.sum(coordint3 * DHatPhi3, axis=0).reshape(1, -1) # 雅可比行列式 DET = (J11 * (J22 * J33 - J32 * J23) - J12 * (J21 * J33 - J23 * J31) + J13 * (J21 * J32 - J22 * J31)) # 雅可比矩阵分量的逆 Jinv11 = (J22 * J33 - J23 * J32) / DET Jinv12 = -(J12 * ...
Python
1
def solve(grid): H, W = len(grid), len(grid[0]) bounds = {} for r in range(H): for c in range(W): v = grid[r][c] if v != 0: if v not in bounds: bounds[v] = [r, c, r, c] else: br = bounds[v] ...
Python
1
ZE); assert_eq!(free_list[1].unwrap().affinity, 4); } /// Test that release and allocate works as expected. /// Also verify free memory reporting along the way. #[test] fn ncache_release_allocate() { let mut ncache = get_an_ncache(); ncache.node = 2; // Insert some ...
Rust
0
file csv_filepath = args.csv_file # Check if the file exists if not os.path.exists(csv_filepath): print(f"CSV file not found: {csv_filepath}") return # Read names from the CSV file (or use single name if specified) if args.single: names = [args.single] print...
Python
1
nline(always)] fn deref(&self) -> &RegisterBlock { unsafe { &*(self.addr as *const _) } } } #[cfg(feature = "rtic")] unsafe impl Send for Instance {} use num_traits::{NumCast, PrimInt, ToPrimitive}; use std::hash::Hash; use std::marker::PhantomData; #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Copy, ...
Rust
0
'''OpenGL extension EXT.timer_query This module customises the behaviour of the OpenGL.raw.GL.EXT.timer_query to provide a more Python-friendly API Overview (from the spec) Applications can benefit from accurate timing information in a number of different ways. During application development, timing informatio...
Python
1
::Integer(x),Value::Integer(y)] => Rc::new(Value::Boolean(x == y)), _ => Rc::new(Value::Error(String::from("can't = on non numbers"))) } }) } fn num_increase(list: Vec<Rc<Value>>) -> Rc<Value> { twoarg(list, |first, second| { match [&*first, &*second] { [Value::Integer(x...
Rust
0
sale', 'wicked', 'wide', 'widespread', 'wild', 'wilful', 'willing', 'windy', 'winged', 'winning', 'wintry', 'wired', 'wise', 'wispy', 'wistful', 'witty', 'wonderful', 'wooden', 'woolen', 'workable', 'working', 'worldwide', 'worn', ...
Python
1
c, "DjangoRosetta", "Django Rosetta Documentation", author, "DjangoRosetta", "One line description of project.", "Miscellaneous", ) ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] # If false, no module index is generated. # texinfo_d...
Python
1
"01892c662c8cd79fab20edec21de1dcb8b75d9353103face7fe086ff5c0098e4", //! "<KEY>", //! ]; //! //! # fn main() -> Result<()> { //! # block_on(async { //! let key_ids: Vec<KeyId> = TRUSTED_ROOT_KEY_IDS.iter() //! .map(|k| KeyId::from_str(k).unwrap()) //! .collect(); //! //! let local = FileSystemRepository:...
Rust
0
class Solution: def isRobotBounded(self, instructions: str) -> bool: x, y, dx, dy = 0, 0, 0, 1 for i in instructions: if i == 'R': dx, dy = dy, -dx if i == 'L': dx, dy = -dy, dx if i == 'G': x, y = x + dx, y + dy return (x, y) == (0, 0) or (dx, dy) != (0,1...
Python
1
lumn {}", c)?, (l, c) => write!(f, " at line {}, column {}", l, c)?, } if let Some(p) = self.file() { write!(f, " in `{}`", p.display())?; } Ok(()) } } impl std::error::Error for ParseError { #[cold] fn source(&self) -> Option<&(dyn std::error::Error ...
Rust
0
# Container With Most Water(maxArea) # You are given an integer array height of length n. # There are n vertical lines drawn such that the two endpoints of the ith line are # (i, 0) and (i, height[i]). # Find two lines that together with the x-axis form a container, such that the container contains # the most water....
Python
1
# # This file is part of the Chemical Data Processing Toolkit # # Copyright (C) Thomas Seidel <thomas.seidel@univie.ac.at> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versi...
Python
1
on["growth_rate"]["comparison"] * 0.4) + (benchmark_comparison["turnover_rate"]["comparison"] * 0.3) + (benchmark_comparison["structure_score"]["comparison"] * 0.3) ) # 制限を適用 growth_health_score = max(min(growth...
Python
1
_line = lang_token.line; let language_end_pos = lang_token.pos + 8; if tokenizer::parse_symbol(&mut token_iter, "LANGUAGE") { tokenizer::parse_whitespace(&mut token_iter); if !tokenizer::parse_e...
Rust
0
, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); self.w } } #[doc = "PWM Mask Enable Bits\nThe PWM output signal will be masked when this bit is enabled. The corresponding PWM channel n will output MSKDATn (PWM_MSK\\[5:0\\]) data.\n\nValue on r...
Rust
0
led(PrimitiveStyle::with_stroke(BinaryColor::Off, 3)) .draw(&mut display) .unwrap(); assert_eq!( display, MockDisplay::from_pattern(&[ " ", " ######### ", " ######### ", " ######### ", ...
Rust
0
y1=0, x2=0, y2=0, text="", font="arial", size=1, foreground=0, *args, **kwargs, ): if pdf.draw_color != rgb(foreground): pdf.set_draw_color(*rgb(foreground)) font = font.lower().strip() if font == "interleaved 2of5...
Python
1
nj!( meta, map_entry!("line",line), map_entry!("column",column) ); meta = merge!(meta,iobj_value.meta()); Ok((rest_input,iobj_value.with_meta(meta).unwrap().to_value())) } else { Ok((rest_input,error_message::custom("In meta reader: metadata ca...
Rust
0
set = ValidatorSet::new(self.size(), self.quorum, rng); let t_approval = start_timer!(|| format!("Each (honest) validators computes the commitment to the new validator set of size {} and signs the commitment", new_validator_set.size())); let approvals = self.validators.iter() .filter(|_| r...
Rust
0
(inst[3]).toBe("foo"); inst[4] = "baz"; expect(inst.bar).toBe("baz"); expect(inst[5]).toBe(14); expect(MyClass[6]).toBe(11); expect(MyClass[7]).toBe(12); expect(typeof inst[8]).toBe("function"); expect(inst[9]).toBe(15); "# ); test_exec!( syntax(), |t| tr(t), nested_class_super_call_in_key_exec, r#" ...
Rust
0
elayTransactionVecReaderIterator<'t, 'r>( &'t RelayTransactionVecReader<'r>, usize, usize, ); impl<'t: 'r, 'r> ::core::iter::Iterator for RelayTransactionVecReaderIterator<'t, 'r> { type Item = RelayTransactionReader<'t>; fn next(&mut self) -> Option<Self::Item> { if self.1 >= self.2 { ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2023/8/18 @Author : mashenquan @File : test_text_to_image.py @Desc : Unit tests. """ import base64 import openai import pytest from pydantic import BaseModel from metagpt.config2 import Config from metagpt.learn.text_to_image import text_to_image fro...
Python
1
let srcclk = self.config.hse.unwrap_or(HSI); // Available clocks let sys_ck = self.config.sys_ck.unwrap_or(srcclk); // The requested system clock is not the immediately available // HSE/HSI clock. Perhaps there are other ways of obtaining // the requested system clock (such as `...
Rust
0
dict["value"] = random.choice(range(1024)) # Step 1: Run mempool through bloom filters workers = [] manager = Manager() results_dict = manager.dict() for tx_id, tx in enumerate(mempool): contract_addr = tx["to"] f_name = tx["f_name"] # TODO: Fix so it is a bit more nuance...
Python
1
(Self::FinalSource, $crate::std::option::Option<X>) where F: FnOnce(Self::InitialTarget) -> (Self::FinalTarget, X) { let (x, aux) = f(v$(.$field_name)*); v$(.$field_name)* = x; (v, $crate::std::option::Option::Some(aux)...
Rust
0
( ((i as f32 / 255.0) * 0.8 - 0.4) * 72.0 / 2.0, ((i as f32 / 255.0) * 0.8 - 0.4) * 72.0 / 2.0, ) }) .collect::<Vec<(f32, f32)>>(), &(0..56) .map(|i| ("#...
Rust
0
g)s --all_kospi --top 20 # KOSPI 상위 20개 종목 분석 %(prog)s --all_kosdaq --top 10 # KOSDAQ 상위 10개 종목 분석 %(prog)s --watchlist # 관심종목 분석 %(prog)s --multiple 005930,000660,035420 # 여러 종목 분석 지원 시장: - KOSPI: 자동으로 .KS 접미사 추가 - KOSDAQ: 자동으로 .KQ 접미사 추가 ...
Python
1
.ok_or_else(|| "provisioner public key is missing".to_owned())? { PathOr::Path(path) => { let pem_str = std::fs::read_to_string(path) .map_err(|e| format!("couldn't read provisioner public key: {}", e))?; let pem = pem_s...
Rust
0
-foo","request_id":"bogus-request-id","success":true,"status":null,"skipped_attrs":["AAAAAASomeThingsFailToEvaluate"],"attempted_attrs":["hello"]}"#; let result: BuildResult = serde_json::from_str(input).expect("result required"); assert_eq!(result.status(), BuildStatus::Success); let output = s...
Rust
0