text
string
label_name
string
labels
int64
#[inline] pub fn ch5ens(&mut self) -> _CH5ENSW { _CH5ENSW { w: self } } } // Copyright (c) 2021 - 2022 GreenYun Organization // SPDX-License-Identifier: MIT macro_rules! enum_lang_matches { ($case:expr, $lang:expr, $($val:path => $en:expr, $tc:expr, $sc:expr),+ $(,)?) => { matc...
Rust
0
from __future__ import unicode_literals, print_function, absolute_import, division from threading import Lock try: from queue import Queue except ImportError: from Queue import Queue class ResourceLock(object): def __init__(self): self._resources = {i: _ResourceLock() for i in range(0, 256)} ...
Python
1
AquariaLocationNames.BEATING_FALLEN_GOD, AquariaLocationNames.BEATING_MITHALAN_GOD, AquariaLocationNames.BEATING_DRUNIAN_GOD, AquariaLocationNames.BEATING_LUMEREAN_GOD, AquariaLocationNames.BEATING_THE_GOLEM, AquariaLocationNames.BEATING_NAUTILUS_PRIME, AquariaLocationNames.BEATING_BLASTER_PEG_P...
Python
1
c_log, 'r', encoding='utf-8') as f: source_code = f.read() suspicious_code_alert_details = detect_suspicious_code(source_code) obalerts, techniques = detectob(source_code) suspicious_code_alert_details.extend(obalerts) obfuscation_status = bool(techniques) ...
Python
1
spirate(10, magMulti.top()) m300.flow_rate.aspirate = 30 for _ in range(5): m300.aspirate(160, magMulti.bottom().move(types.Point(x=-1, y=0, z=1))) m300.dispense(170, waste) m300.aspirate(10, waste) m300.drop_tip() flow_rate('reset', m300) # Transfer 200uL of WB1 and mix wel...
Python
1
if data.get('novel') and data['novel'].get(novel_id): content = data['novel'][novel_id].get('content', '') except: pass # 如果预加载数据中没有内容,尝试从页面元素中获取 if not content: content_div = soup.find('div',...
Python
1
from typing import List class Solution: def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int: m = len(obstacleGrid) n = len(obstacleGrid[0]) # If the start or end is blocked, there is no path if obstacleGrid[0][0] == 1 or obstacleGrid[m - 1][n - 1] == 1: ...
Python
1
<filename>b2c2-compiler/src/assign_stmt.rs // b2c2-compiler crate::assign_stmt // author: Leonardone @ NEETSDKASU use super::*; impl Compiler { // Assign Integer Array // int_arr = some_int_arr pub(super) fn compile_assign_integer_array(&mut self, var_name: &str, value: &parser::Expr) { let copyst...
Rust
0
import streamlit as st import matplotlib.pyplot as plt # Title st.title("📊 Classroom Power Consumption Estimator") # User input for custom fan wattage st.sidebar.header("⚙ Customize Your Fan") custom_fan_wattage = st.sidebar.number_input("Enter your fan's wattage (W)", min_value=1, value=25) # Appliance data applia...
Python
1
!['X', 'O', 'X', 'O', 'X'], vec!['O', 'X', 'O', 'O', 'O'], vec!['X', 'X', 'O', 'X', 'O'], ]; let expected = vec![ ['O', 'X', 'X', 'O', 'X'], ['X', 'X', 'X', 'X', 'O'], ['X', 'X', 'X', 'O', 'X'], ['O', 'X', 'O', 'O', 'O'], ...
Rust
0
// No influence SurfletComponents::zeros() } } /* Calculate the contribution from the five corners */ let corner0 = surflet(gi0, distance); let corner1 = surflet(gi1, offset1); let corner2 = surflet(gi2, offset2); let corner3 = surflet(gi3, offset3); let corner4 = surfle...
Rust
0
import glob import os import shutil from tests import get_device_id, get_tests_output_path, run_cli from TTS.tts.configs.vits_config import VitsConfig config_path = os.path.join(get_tests_output_path(), "test_model_config.json") output_path = os.path.join(get_tests_output_path(), "train_outputs") config = VitsConfi...
Python
1
_id: Option<Secret>, /// Message hash. message_hash: Option<H256>, } /// Signing job partial request. pub struct SchnorrPartialSigningRequest { /// Request id. pub id: Secret, /// Message hash. pub message_hash: H256, /// Id of other nodes, participating in signing. pub other_nodes_ids: BTreeSet<NodeId>, } //...
Rust
0
import os from tools.log_tools import log_cmd def post_install(do_reboot, do_ly_dm): home = os.getenv("HOME") waybar_css = f"{home}/.config/waybar/style.css" wallpapers_conf = f"{home}/.config/hypr/wallpapers.conf" multilib_conf = "/etc/pacman.conf" # Waybar config if not os.access(waybar_c...
Python
1
s rTrzCacheFTPHandler.__init__8s%    rUc||_yrW)r)rts rT setTimeoutzCacheFTPHandler.setTimeout?s  rUc||_yrW)r)rrEs rT setMaxConnszCacheFTPHandler.setMa...
Python
1
import base64 from openai import OpenAI from dotenv import load_dotenv load_dotenv() client = OpenAI() def extract_ingredients_from_image(image_path: str) -> str: """Extracts ingredients list from an image.""" with open(image_path, "rb") as f: image_bytes = f.read() image_b64 = base64.b64encode(ima...
Python
1
0), numeric::Vector2f::new(1.0, 1.0), 0.0, 0, ); let scene_transition_effect = Some(effect_object::ScreenTileEffect::new( ctx, TileBatchTextureID::Shoji, numeric::Rect::new( 0.0, 0.0, ...
Rust
0
= 29, #[doc = "28: EVSTAT1.AUXIO28"] AUXIO28 = 28, #[doc = "27: EVSTAT1.AUXIO27"] AUXIO27 = 27, #[doc = "26: EVSTAT1.AUXIO26"] AUXIO26 = 26, #[doc = "25: EVSTAT1.AUXIO25"] AUXIO25 = 25, #[doc = "24: EVSTAT1.AUXIO24"] AUXIO24 = 24, #[doc = "23: EVSTAT1.AUXIO23"] AUXIO23 = ...
Rust
0
k=True) record.to_csv(f'{path}/repeat{repeat}_fold{fold}_{int(time.time())}.tsv', index=False, sep='\t') def sample2tensor(self, sample): halflife = sample['halflife'] features = [sample['r_history'], sample['t_history'], sample['p_history']] r_history = sample['r_history'].spli...
Python
1
# import fastapi from fastapi import APIRouter, Depends, status, HTTPException, Response # Сессия БД from sqlalchemy.orm import Session # Функция подключения к БД from app.backend.db_depends import get_db # Аннотации, Модели БД и Pydantic. from typing import Annotated from app.models.user import User from app.models.ta...
Python
1
eprintln!("energy:{} {}",sss.0,sss.1); } let mut lines:Vec<String> = vec![]; for aa in subenv.atoms.iter(){ let (chainid,(resname,resnum,altcode),att) = aa.to_pdbatom(); lines.push(att.get_pdb_atom_line_string(&chainid,&resname,resnum,&...
Rust
0
clockwise vaporising any asteroids it can see. // What is the 200th asteroid to be vaporised? // Algo: // - Get the visible asteroids. Remove them in order. // - Calculate the newly visible asteroids. Remove them. // - Repeat. vaporise_asteroids(asteroid_matrix.clone(), best_i, best_j); Ok...
Rust
0
adeMsg { exchange: EXCHANGE_NAME.to_string(), market_type: MarketType::Spot, symbol: symbol.to_string(), pair: pair.to_string(), msg_type: MessageType::Trade, timestamp: raw_trade.ts, price: raw_trade.price, quantity_base: r...
Rust
0
ield(blank=True, related_name='utilisateur_set', to='auth.group', verbose_name='Groupes')), ('user_permissions', models.ManyToManyField(blank=True, related_name='utilisateur_set', to='auth.permission', verbose_name='Permissions utilisateur')), ], options={ 'verbos...
Python
1
_bytes", // metric description "Aptos schemadb get call returned data size in bytes", // metric labels (dimensions) &["cf_name"] ) .unwrap() }); pub static DIEM_SCHEMADB_BATCH_COMMIT_LATENCY_SECONDS: Lazy<HistogramVec> = Lazy::new(|| { register_histogram_vec!( // met...
Rust
0
NITY, Max: INFINITY, }, ); ls.SetUnchecked( LimitType::FileSize, Limit { Cur: INFINITY, Max: INFINITY, }, ); ls.SetUnchecked( LimitType::Locks, Limit { Cur: INFINITY, Max: INFINITY, }, ...
Rust
0
from turtle import * import turtle as tur tur.penup () tur.left (90) tur.fd (200) tur.pendown () tur.right (90) tur.fillcolor ("red") tur.begin_fill () tur.circle (10,180) tur.circle (25,110) tur.left (50) tur.circle (60,45) tur.circle (20,170) tur.right (24) tur.fd (30) tur.left (10) tur.circle (30,110) tur.fd (20...
Python
1
self. /// /// This is a convenience function using [Encoder] internally. For streaming encoding, use [Encoder]. #[cfg(feature = "std")] pub fn encode(data: &[u8]) -> Vec<u8> { struct VecWriter<'a>(&'a mut Vec<u8>); impl<'a> Write for VecWriter<'a> { type Error = std::convert::Infallible; fn wri...
Rust
0
s = {8, 7, 12, "Aakarshit", [1,2]} s[4][0] = 9 #first list is unhasable and second we cannot include list in a set
Python
1
# By Gareth Rees # http://gareth-rees.livejournal.com/27148.html import html5lib import html5lib.serializer import html5lib.treewalkers import urllib.parse # List of (ELEMENT, ATTRIBUTE) for HTML5 attributes which contain URLs. # Based on the list at http://www.feedparser.org/docs/resolving-relative-links.html url_at...
Python
1
time.now() # 检查今天是否为交易日 is_today_trading = is_trading_day(today) logger.info(f"今天 {today.strftime('%Y-%m-%d')} 是否为交易日: {is_today_trading}") # 如果今天不是交易日,获取下一个交易日 if not is_today_trading: next_trading_day = get_nearest_trading_date(today, 'forward') logger.info(f"下一个交易日: {nex...
Python
1
_function_stream_success_destination_details.name) # Remove update-function-none-success-destination-details from oci fn function functionsmanagement_cli.function_group.commands.pop(functionsmanagement_cli.update_function_none_success_destination_details.name) # Remove update-function-notification-success-destinati...
Python
1
3\xfd\x98\xc8\x9a\x92C{\xa0\xde^\xac\ \x8cb\x05\x09\xbdY\xa31m\x5c2\x9d\xfbo\x1e\xf8\ \xa6\xca\x0d/[\xd1\xac\xec\xbe&\xf8vx\x1e\xee)\ 4\x8df\xc2\xc3\xc4\xb1XM\x00\xf35\x0d&\xc3S\ h4\xddbi\x89\x8c\xdc\xdb[j:}\xcd\xcc(\ \xc9\x1d\xb5\xc4\x8a\xabX\xd0i\x9e\x11\xf0\xfa\xde\xc5\xa4\ x\x17U\xd1t\xdb\xcf\xb5__i\xdaF\x8f\xa3i\ ...
Python
1
; scrobbler.authenticate_with_session_key(&auth_token); scrobbler.scrobble(&scrobble)?; Ok(()) } pub fn now_playing(db: &DB, username: &str, track: &Path) -> Result<()> { let mut scrobbler = Scrobbler::new(LASTFM_API_KEY.into(), LASTFM_API_SECRET.into()); let scrobble = scrobble_from_path(db, track)?; let auth_t...
Rust
0
heControl` class existed that was used both for request and response. """ max_stale = cache_control_property("max-stale", "*", int) min_fresh = cache_control_property("min-fresh", "*", int) only_if_cached = cache_control_property("only-if-cached", None, bool) class ResponseCacheControl(_CacheC...
Python
1
{ matrix[p.y - 1][p.x] } else { 9 }, }, Point { x: p.x, y: p.y + 1, val: if p.y < matrix.len() - 1 { matrix[p.y + 1][p.x] } else { 9 }, }, ] } fn is_minimum(matrix: &[Vec<u32>], p: &Point) -> bool {...
Rust
0
# mypy: allow-untyped-defs from typing import Optional import mindtorch from mindtorch.utils import _pytree as pytree def _basic_validation(op, args=(), kwargs=None): """ Common validation across all ops go in here. """ from mindtorch.distributed._shard.sharded_tensor import ShardedTensor if len...
Python
1
", Shell::Bash, outdir); } use crate::SdpAttribute; use crate::SdpConnection; use crate::SdpCodecIdentifier; #[derive(Debug, PartialEq, Clone)] pub struct SdpMediaFormat { pub codec: SdpCodecIdentifier, pub connection: Option<SdpConnection>, pub attributes: Vec<SdpAttribute> } impl SdpMediaFormat { p...
Rust
0
cmd::request::Request; use crate::message::handler_msg::{AddMtrfHandler, AddWebHandler}; use crate::message::hap_msg::AddAccessory; use crate::message::web_msg::WebMessage; use crate::mtrf_io::MtrfMessage; use crate::serial::Cmd; pub mod handler_msg; pub mod hap_msg; pub mod web_msg; pub enum Message<S: Send + 'stati...
Rust
0
validate_float(lon, lat) # Floats are entered/displayed as decimal numbers, but your computer # (in fact, your standard C library) stores them as binary. # You get some side effects from this transition: # >>> print len(repr(0.1)) # 19 # >>> ...
Python
1
map any class to a apecific name for .SPEC. # FIXME: Some symbols might be missing. Add them if there are some failures. # TODO: What from this .spec API is deprecated and could be removed? spec_namespace = { # Set of global variables that can be used while processing .spec file. Some of them act as...
Python
1
broader `async_graphql` context let ctx = raw_ctx.data::<Context>() .map_err(|_err| ErrorKind::GraphQLContextNotFound("main context".to_string()))?; let client = ctx.pool.get_client()?; Ok(client) } // A helper function to subscribe to events sent to the subscriptions server on a particular chann...
Rust
0
# Copyright 2021-present, the Recognai S.L. team. # # 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 la...
Python
1
eers = {"30ab::2", "30ab::4"} bfd_mon.frr_v4_peers = {"192.168.1.1"} bfd_mon.frr_v6_peers = {"30ab::2"} result = bfd_mon.update_state_db() assert mocked_syslog.call_count == 1 assert "DPU_BFD_PROBE_STATE table in STATE_DB updated" in mocked_syslog.call_args[0][1] assert all(value in bfd_mon.loca...
Python
1
sible that can fit the number of bits used per sample. #[inline] pub fn bytes_per_sample(self) -> u8 { let rv = self.handle.bytesPerSample; debug_assert!(rv >= 0 && rv <= i32::from(u8::max_value())); rv as u8 } /// log2 subsampling factor, applied to second and third plane. ...
Rust
0
match parsed_input { Ok(amt) => return Some(amt), Err(_) => println!("Please enter a number: "), } } } fn add_bill_menu(bills: &mut Bills) { //get the bill name println!("Enter bill name:"); let name = match get_input() { Some(input) => input, Non...
Rust
0
import pytest from selenium.webdriver.common.by import By from config import * from utils import get_chrome_driver, get_firefox_driver, post_login_request @pytest.fixture(scope="module") def browser(): driver = get_chrome_driver() yield driver driver.quit() def test_empty_username(browser): browser.ge...
Python
1
import yfinance as yf import json def info_ticker(ticker): print("Verificando si el ticker es válido, espere por favor...") try: info = yf.Ticker(ticker).info # Verificamos que haya información válida if not info or 'longName' not in info: resultado = "no válido" ...
Python
1
import numpy as np from scipy.io import loadmat base_dir = './data' def load_mnist(scale=True, usps=False, all_use=False): mnist_data = loadmat(base_dir + '/mnist_data.mat') if scale: mnist_train = np.reshape(mnist_data['train_32'], (55000, 32, 32, 1)) mnist_test = np.reshape(mnist_data['test_3...
Python
1
import math from segment import * from command import * class CommandsProcessor: def processCommands(self, commands: list[Command]) -> list[Segment]: edges : list[Segment] = [] currentPosition = Node(0,0) relativeAngle = 0 penDown = True for command in commands: ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class SaleOrder(models.Model): _inherit = "sale.order" l10n_in_reseller_partner_id = fields.Many2one('res.partner', string='Reseller', domain="[('vat', '!=', False)...
Python
1
import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.signal import savgol_filter, butter, filtfilt from scipy.stats import zscore def hampel_filter(series, window_size=5, n_sigmas=3): """ Hampel filter: replaces outliers in a sliding window with the window median. """ new_s...
Python
1
0x58 ..= 0x5F => debug!(" GPCRJ{}", offset - 0x58), 0xA0 ..= 0xA7 => debug!(" GPCRM{}", offset - 0xA0), 0xF0 ..= 0xFE => debug!(" GCR{}", offset - 0xF0 + 1), 0xE0 ..= 0xE2 => debug!(" GCR{}", offset - 0xE0 + 16), 0xE4 ..= 0xE8 if ec.id ==...
Rust
0
"""Basic tests around pip-check.""" from __future__ import annotations import nox nox.options.default_venv_backend = "uv" nox.options.sessions = [ "lint", "readme", "pip-check-test-py", "coverage", ] python_versions = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] @nox.session(python=pytho...
Python
1
d": True, "key": "${input_test}", "desc": "", "validation": "^.*$", # u'source_step': [u'8f7428b073963641bcf8ce01b447e17d'], "source_info": {"8f7428b073963641bcf8ce01b447e17d": ["input_test"]}, ...
Python
1
#!/usr/bin/env python3 import math def mel_scale(data): return 1127.0 * math.log(1.0 + data / 700.0) def main(): n_mel = 80 fft_bins = 256 s = "// Auto-generated. Do NOT edit!\n\n" s += "\n" s += f"const int LogMelFilterRows = {n_mel};\n" s += f"const int LogMelFilterCols = {fft_bins};\...
Python
1
import cv2 import time import numpy as np import os def nothing(x): pass image_x, image_y = 64, 64 def create_folder(folder_name): if not os.path.exists('./mydata/training_set/' + folder_name): os.mkdir('./mydata/training_set/' + folder_name) if not os.path.exists('./mydata/test_set/' + folder_...
Python
1
rently used for functional tests only) # if not _has_numeric: # raise RuntimeError("realpolyroots_eigenvalue depends on Numeric") # if not cs: # return [0] # try: # f = 1.0/cs[0] # cs = [f*c for c in cs[1:]] # except ArithmeticError: # return realpolyroots_eigenva...
Python
1
u8, } pub struct Grid2D { pub x: u8, pub y: u8, pub width: u8, } impl From<Grid2D> for Grid1D { fn from(g2d: Grid2D) -> Grid1D { Grid1D { x: g2d.x + g2d.y * g2d.width, width: g2d.width, } } } impl From<Grid1D> for Grid2D { fn from(g1d: Grid1D) -> Grid2...
Rust
0
on[i]['expression'] # Select individuals with higher fitness and add them to the new population if child_fitness > parent_fitness: new_population.append(child_population[i]) else: new_population.append(population[i]) # if child_fitness <...
Python
1
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np Deep = __import__('23-deep_neural_network').DeepNeuralNetwork lib_train = np.load('../data/Binary_Train.npz') X_train_3D, Y_train = lib_train['X'], lib_train['Y'] X_train = X_train_3D.reshape((X_train_3D.shape[0], -1)).T lib_dev = np.load('../...
Python
1
: &Vec<&char>) -> bool { let contains = |strs: &Vec<&str>, chars: &Vec<&char>| -> bool { strs.iter().all(|&s| chars.iter().all(|&c| s.contains(*c))) }; let mut char_mapping = HashMap::new(); for (i, &c) in permut.iter().enumerate() { char_mapping.insert(BASE[i], c); } let mut f...
Rust
0
# @Time : 2022/02/19 # @Author : Gaowei Zhang # @email : 1462034631@qq.com """NCE-PLRec ###################################### Reference: Ga Wu, et al. "Noise Contrastive Estimation for One-Class Collaborative Filtering" in SIGIR 2019. Reference code: https://github.com/wuga214/NCE_Projected_LRec ...
Python
1
Ok(()) } // This test is ignored because it tries to fetch a real Gist and runs into // Github rate limits when ran by CI. #[ignore] #[test] fn import_gist() -> color_eyre::Result<()> { let temp_dir = tempdir()?; let config_file = make_config_file(&temp_dir)?; let mut cmd = Command::cargo_bin("the-way")?...
Rust
0
move: Move) -> bool { let latest_move = move_config.parse::<Move>().unwrap(); let (game_state, _) = game_state_config.parse::<GameState>().unwrap().do_move(latest_move); let king_pos = game_state.get_active_king(); let color = game_state.turn_by; let actual_attack_situation = ge...
Rust
0
{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({eta})") .template("[{elapsed_precise}] [{wide_bar}] {bytes}/{total_bytes} ({eta})") .progress_chars("#>-"), ); pb } fn enter_code() -> eyre::Result<String> { use dialoguer::Input; Input::new() .with_prompt("Enter code") ...
Rust
0
= end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.plan.header.frame_id = str[start:end].decode('utf-8') else: self.plan.header.frame_id = str[start:end] start = end end += 16 self.plan.network.uui...
Python
1
s.push_str(&py_arg.get_local_arg()); } return get_local_args; } } #[cfg(test)] mod tests { use super::*; #[test] fn test_arg_list() { let arg_list = ArgList::new(&Some(String::from("arg1: str, arg2: int, arg3: FILE"))).unwrap(); let arg_list_in_c = arg_list....
Rust
0
ntation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentMethodChangeEvent/methodName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEvent`*"] pub fn method_name(this: &PaymentMethodChangeEvent) -> String; # [ wasm_bindgen ( structura...
Rust
0
# thresholds.py HUMAN_THRESHOLDS = { "min_mouse_moves": 60, "min_clicks": 3, "avg_speed_range": (7, 110), # pixel/sec "variance_range": (29, 10900), "min_interaction_time": 10000, # milliseconds "scroll_speed_tolerance": 0.01 } KEYSTROKE_THRESHOLDS = { "min_mean_ms": 210, # Too fast =...
Python
1
eLU(), nn.Conv2d(16, 10, kernel_size=3, stride=2, padding=1), nn.ReLU(), nn.AvgPool2d(4), Lambda(lambda x: x.view(x.size(0), -1)), ) opt = optim.SGD(model.parameters(), lr=lr, momentum=0.9) fit(epochs, model, loss_func, opt, train_dl, valid_dl) ''' 把数据格式转换包到dataloader里面 ''' print("\n\n\n\n\n\n\n") d...
Python
1
', '𝕙', '㋣', '𑫬', '𓅛', '𝟏', '🖛', 'ᑈ', '⚰', '\u{1171d}', 'ȓ', 'લ', 'ᎍ', '\u{11c9a}', '㇢', '𝦻', '४', '𒔫', '\u{825}', '🐆', '𐇹', 'ⓣ', '🞐', 'ᕌ', '\u{110b6}', 'Ⲳ', '𐙞', 'โ', '〈', '🀥', '𝀇', '⫼', '硎', 'Ɵ', '𛆨', 'ꝵ', '🜻', 'ꐐ', '𐑖', '🚤', '🁽', '💁', 'ᓮ', '𖽁', '𛀷', '\u{11a8f}', 'ꂋ', '⧼', '𒎗...
Rust
0
/// var dijkstra_map = DijkstraMap.new() /// dijkstra_map.add_point(0) /// dijkstra_map.add_point(1) /// dijkstra_map.disable_point(0) /// assert(dijkstra_map.is_point_disabled(0)) /// assert(!dijkstra_map.is_point_disabled(1)) # not disabled /// assert(!dijkstra_map.is_point_disabled(2)) # ...
Rust
0
box_y_right = box_y # Mantener la misma altura para que quede paralelo # Cuadro de RESPONSABLE POR CLIENTE c.setStrokeColor(colors.black) c.setFillColor(colors.lightblue) c.rect(box_x_right, box_y_right, box_width, box_height, fill=1) c.setFillColor(colors....
Python
1
if users[message.chat.id].user_menu == 'timetable': if not users[message.chat.id].ishometask: try: for x in timetablesend: if users[message.chat.id].grade_choosen == x.grade: bot.send_message(message.chat.id, text=f'{x.GetTimetable(messa...
Python
1
# Copyright The OpenTelemetry 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
1
# -*- coding: utf-8 -*- # @Author : llc # @Time : 2023/6/1 15:04 from pydantic import BaseModel from flask_openapi3 import FileStorage, OpenAPI app = OpenAPI(__name__) class UploadFilesForm(BaseModel): file: FileStorage str_list: list[str] model_config = dict( openapi_extra={ # ...
Python
1
pub(crate) features: wgt::Features, pub(crate) downlevel: wgt::DownlevelCapabilities, //TODO: move this behind another mutex. This would allow several methods to switch // to borrow Device immutably, such as `write_buffer`, `write_texture`, and `buffer_unmap`. pending_writes: queue::PendingWrites<A>, ...
Rust
0
mytuple = ("apple", "banana", "cherry") myit = iter(mytuple) print(next(myit)) print(next(myit)) print(next(myit)) mystr = "banana" myit = iter(mystr) print(next(myit)) print(next(myit)) print(next(myit)) print(next(myit)) print(next(myit)) print(next(myit)) mytuple = ("apple", "banana", "cherry") for x in myt...
Python
1
tile_width: i32, pub tile_height: i32, pub tile_size: f64, pub tile_padding: f64, pub tile_background_color: [f32; 3], pub tiles_colors: Vec<[f32; 3]>, pub tile_unknow_color: [f32; 3], pub tile_move_time: f64, pub tile_new_time: f64, pub tile_combine_time: f64, pub best_rect: [f...
Rust
0
#######.?????.#######\n\ ........?????........\n\ ?????????????????????\n\ ?????????????????????\n\ ?????????????????????\n\ ?????????????????????\n\ ?????????????????????\n\ ........?????????????\n\ ####...
Rust
0
ter) -> fmt::Result { write!(fmt, "{}", self.name()) } } pub mod account_state; pub mod data_store; pub mod error_mappers; pub mod processor; use crate::processor::MoveProcessor; solana_sdk::declare_loader!( solana_sdk::move_loader::ID, solana_move_loader_program, MoveProcessor::process_instru...
Rust
0
the /// bounds, and it is not at the same place as the snake. fn gen_pos(snake: &Snake, bounds: Bounds) -> Vec2 { loop { // Initializes the random number generator (RNG). let mut rng = rand::thread_rng(); // Generates a random point. let point = Vec2 { ...
Rust
0
splay for SymmetricGroup<S> where S: Enumerable + Clone + Display + Eq, [(); S::N]: , { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "\u{250c}")?; for s in S::enumerate() { write!(f, " {}", s)?; } writeln!(f, " \u{2510}")?; ...
Rust
0
float time; uniform float count; float TRIANGLE_SIZE = 0.02; void main() { float unit_id = id / count; vec2 offset = vec2( 2.0 * (unit_id - 0.5) + 0.1 * sin(unit_id * 30.0 + time * 2.5) + 0.5 * sin(unit_id * 50.0 + time * 5.234),...
Rust
0
X : u32 = OP_EORI | BYTE_SIZED | OPER_IX; pub const OP_EORI_8_AW : u32 = OP_EORI | BYTE_SIZED | OPER_AW; pub const OP_EORI_8_AL : u32 = OP_EORI | BYTE_SIZED | OPER_AL; pub const OP_EORI_16_DN : u32 = OP_EORI | WORD_SIZED | OPER_DN; pub const OP_EORI_16_AI : u32 = OP_EORI | WORD_SIZED | OPER_AI; pub c...
Rust
0
tart(suite_controller).boxed()); builder_proxy.add_suite( &test_params.test_url, run_options.clone().into(), suite_server_end, )?; } let (run_controller, run_server_end) = fidl::endpoints::create_proxy()?; builder_proxy.build(run_server_end)?; struct ...
Rust
0
.96,8.12c0.05,0.5,0.48,0.88,0.99,0.88c0.59,0,1.06-0.51,1-1.1C22.39,5.34,17.7,1,12,1z"/></g></svg> </svg> } } } <reponame>wrl/otf-fea-rs use std::collections::HashMap; use thiserror::Error; use crate::glyph::*; #[derive(Debug, Error)] pub enum GlyphOrderError { #[error("tried to create ...
Rust
0
son>, opts: ListOptions) -> ResultSet { let (curr, offset, limit) = pagination(&opts); let count = people.len(); let subset: Vec<Person> = people .into_iter() .skip(offset) .take(limit) .collect(); let last = count / limit + match count % limit { 0 => 0, _ => 1 }; ...
Rust
0
buf = Vec::with_capacity(256); io::stdin() .read_to_end(&mut buf) .expect("No files provided, and no stdin"); print_keyfile_bytes(&buf); } } <gh_stars>0 use std::mem; use anyhow::Result; use bitflags::bitflags; use log::debug; use bindings::Windows::Win32::{ Foundation:...
Rust
0
") torch.set_float32_matmul_precision("high") model_config = GPTConfig(vocab_size=50304) trainer_config = TrainerConfig() model = GPTLightning(model_config, trainer_config, debug_mode=False) trainer = pl.Trainer( max_epochs=1, # max_steps=50, precision="bf16-mixed", ...
Python
1
view/MenuInflater.html#inflate(int,%20android.view.Menu)) /// /// Required features: "android-view-Menu" #[cfg(any(feature = "all", all(feature = "android-view-Menu")))] pub fn inflate<'env>(&'env self, arg0: i32, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::O...
Rust
0
("Example url: http://127.0.0.1:7878/95?username=jobs"); Server::new(TcpListener::bind("127.0.0.1:7878")).serve(router).await; } <gh_stars>10-100 //! An event loop for windows, using an invisible window to hook into the host's message loop. This //! has only been tested under Wine with [yabridge](https://github....
Rust
0
st the input character is returned. /// /// This performs complex unconditional mappings with no tailoring: it maps /// one Unicode character to its uppercase equivalent according to the /// [Unicode database] and the additional complex mappings /// [`SpecialCasing.txt`]. Conditional mappings (based...
Rust
0
", " ", " ", " ", " ...
Python
1
_node.o.alias_name.alias_name) if isinstance(logic_node, GetNode): return [] if isinstance(logic_node, MathNode) or isinstance(logic_node, DeduceNode): for alias in dep_task.keys(): if alias in logic_node.content: ret.append(dep_task[alias]) ...
Python
1
ctx.sql(&sql).unwrap(); // write the results to a file ctx.write(df1,"_southern_cities.csv").unwrap(); } use glium::Display; use widget::Label; use timer::ProgramTimer; use text::{TextStyle, GlyphCache}; pub struct Engine<'display> { pub timer: ProgramTimer, pub display: &'display Display, pub ...
Rust
0
8_USCALED, B8G8R8A8Sscaled => VK_FORMAT_B8G8R8A8_SSCALED, B8G8R8A8Uint => VK_FORMAT_B8G8R8A8_UINT, B8G8R8A8Sint => VK_FORMAT_B8G8R8A8_SINT, B8G8R8A8Srgb => VK_FORMAT_B8G8R8A8_SRGB, A8B8G8R8UnormPack32 => VK_FORMAT_A8B8G8R8_UNORM_PACK32, A8B8G8R8SnormPack32 => VK_FORMAT_A8...
Rust
0
pub use self::config::Config; pub use self::errors::{error_inc, Error, Result}; pub use self::import_file::sst_meta_to_path; pub use self::sst_importer::SSTImporter; pub use self::sst_writer::{RawSSTWriter, TxnSSTWriter}; pub use self::util::prepare_sst_for_ingestion; <gh_stars>1-10 use server::Transfer; use io::DataT...
Rust
0
d = CryptoKeyTypeId(*b"lend"); pub use crate::crypto; #[pallet::config] pub trait Config: CreateSignedTransaction<Call<Self>> + frame_system::Config + DeFiComposableConfig { type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>; type Oracle: Oracle< AssetId = <Self as DeFiComposa...
Rust
0