text
string
label_name
string
labels
int64
import pymavlink from pymavlink import mavutil import time # simple test to move ardusub vehicle forward # connect to the vehicle master = mavutil.mavlink_connection('udpin:127.0.0.1:14550') # Make sure the connection is valid master.wait_heartbeat() def wait_conn(): """ Sends a ping to stabilish the UDP ...
Python
1
ify(|_, w| unsafe { w.ppre1().bits(0) }); while rcc.cfgr.read().ppre1f().bit_is_clear() { compiler_fence(SeqCst); } // PCLK2 configuration rcc.cfgr.modify(|_, w| unsafe { w.ppre2().bits(0) }); while rcc.cfgr.read().ppre2f().bit_is_clear() { compiler_fence(SeqCst); } assert!...
Rust
0
bump.name(); if let Some(patches) = package_bump .changesets() .map(|changesets| create_patches(package_name, changesets)) { if dry_run { println!( "dry_run - update changelog {:?}\n{}", changelog_path, fill_output(&next_version, &patches) .sp...
Rust
0
#!/usr/bin/env python3 from pwn import * the_binary = "./trick_or_deal" context.binary = the_binary elf = context.binary context.terminal = ["tmux", "splitw", "-v"] if args.REMOTE: io = remote("167.71.138.246", 31103) else: io = process(the_binary) if args.GDB: gdb.attach(io, """ continue "...
Python
1
t_0_ft_center = np.mean(id_fts_0, axis=0) ft_grid = ft_grid + cat_0_ft_center ft_grid = to_np(fc(torch.tensor(ft_grid, dtype=torch.float32).cuda())) energy_grid = get_ft_energy(ft_grid, dim=2) plt.figure() xv, yv = np.meshgrid(np.linspace(0, 100, 101), np.linspace(0, 100, 101)) plt.pcolormesh(xv, yv, energy_grid - ene...
Python
1
input, ) self.assertEqual(paddle_result4.dtype, dtype_input) paddle_result5 = paddle.sum( x_paddle, self.axis, keepdim=False, dtype=dtype_input ) self.assertEqual(paddle_result5.dtype, dtype_inpu...
Python
1
from django.db import models # Create your models here. class Company(models.Model): description = models.CharField(max_length=255, null=False, blank=False) photo = models.ImageField(upload_to='img/') def __str__(self): return f"{self.description}" class Position(models.Model): description = ...
Python
1
'],'y_pred'], mode='markers', name='买入(多开)', marker=dict(symbol='triangle-up', color='#2ecc71', size=9), customdata=['买入']*len(d), hovertemplate=hover_s, secondary_y=True) else: fig.add_scatter(x=d['date'], y=one.set_index('date').loc[d['date'],'y_pred'], mode='markers', name='买入(多开)...
Python
1
import pygame import random import sys from pygame.locals import * # Khởi tạo Pygame pygame.init() # Cài đặt màn hình RONG, CAO = 800, 400 man_hinh = pygame.display.set_mode((RONG, CAO)) pygame.display.set_caption("Game Xe Đi Trên Đồi Núi") # Màu sắc TRANG = (255, 255, 255) DEN = (0, 0, 0) # Font chữ và đồng hồ fon...
Python
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/copyleft/gpl.txt from pisi.actionsapi import cmaketools from pisi.actionsapi import get from pisi.actionsapi import pisitools from pisi.actionsapi import shelltools WorkDir="lxqt-com...
Python
1
new(); for word in &words { let stat = word_freq_map.entry(word).or_insert(1); *stat += 1; } for word in &words { if word_freq_map.contains_key(word) { let curr = FreqPair{ word: word.clone(), freq: *wo...
Rust
0
MeshBasicPrefabJsonFormatObjectLightKind::Directional => { PrefabBasicAssetDataObjectLightKind::Directional } } } } #[derive(Serialize, Deserialize, Debug)] pub struct MeshBasicPrefabJsonFormatObjectLightSpot { inner_angle: f32, outer_angle: f32, } #[derive(Ser...
Rust
0
sum[k]/video_lens[k] * 1.0)) f.write("{}\t\t{:.6f}\t{:.6f}\n".format('total ans' , priecision_float_sum / sum(video_lens.values()) * 1.0, recall_float_sum / sum(video_lens.values()) * 1.0)) print('total ans' + '\t' + str(priecision_float_sum / sum(video_len...
Python
1
0 } } <gh_stars>100-1000 #[doc = "Reader of register BUSYCH"] pub type R = crate::R<u32, super::BUSYCH>; #[doc = "Reader of field `BUSYCH0`"] pub type BUSYCH0_R = crate::R<bool, bool>; #[doc = "Reader of field `BUSYCH1`"] pub type BUSYCH1_R = crate::R<bool, bool>; #[doc = "Reader of field `BUSYCH2`"] pub type B...
Rust
0
} } } let rng = rand::rng(); let mut i = 500u; while i != 0u { let v0 = get_random_object(rng, 0u32); alt from_bytes(to_bytes(v0)) { (some(v1), rest) if rest == [] { assert eq(v0, v1); ...
Rust
0
E AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ use cortex_a::asm; us...
Rust
0
let _ = remove_dir_all(cfg.dist.clone()).await; if cfg.cargo { let output = Command::new("cargo") .arg("clean") .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output() .await?; ensure!(output.status....
Rust
0
from time import sleep import re import playsound from tkinter import * from threading import Thread def startTimer(query): nums = re.findall(r'[0-9]+', query) time = 0 if "minute" in query and "second" in query: time = int(nums[0])*60 + int(nums[1]) elif "minute" in query: time = int(nums[0])*60 elif "second...
Python
1
, (LOC_NUMPAD)) => KeyCode::NumpadAdd, //(KeyEvent::DOM_VK_SEPARATOR, (_)) => KeyCode::SEPARATOR, (KeyEvent::DOM_VK_SUBTRACT, (LOC_NUMPAD)) => KeyCode::NumpadSubtract, (KeyEvent::DOM_VK_DECIMAL, (LOC_NUMPAD)) => KeyCode::NumpadDecimal, (KeyEvent::DOM_VK_DIVIDE, (LOC_NUMPAD)) => KeyCode::NumpadDivide, ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class ResCountry(models.Model): _inherit = 'res.country' street_format = fields.Text( help="Format to use for streets belonging to this country.\n\n" "...
Python
1
# test/tools/test_patch_tool.py import textwrap import shutil import pytest from tools.patch_tool import _apply_unified_diff, PatchApplyError, PatchTool has_git = shutil.which("git") is not None def make_git_style_diff(old_path, new_path, hunk): """Minimal git diff wrapper.""" return f"""diff --git a/{old_pa...
Python
1
if new_count == 0 { // We just removed the last refcount for this inode. There's no need for an // acquire fence here because we hold a write lock on the inode map and any // thread that is waiting to do a forget on the same inode will have to ...
Rust
0
c.s1-1 ~ .s1-2\", \".c ~ .s2\");\n}\n", "a {\n color: .c.s1-1 ~ .s1-2.s2;\n}\n" ); test!( combinator_sibling_and_sibling_overlap, "a {\n color: selector-unify(\".c.s1-1 ~ .s1-2\", \".c.s2-1 ~ .s2-2\");\n}\n", "a {\n color: .c.s1-1 ~ .c.s2-1 ~ .s1-2.s2-2, .c.s2-1 ~ .c.s1-1 ~ .s1-2.s2-2, .c.s2-1.s1-1 ~...
Rust
0
= process_w_table("sort 'Heading 3' | rev", defs); let exp = vec![ vec![o("first"), o("snd"), o("Heading 3")], vec![n(-30), n(100), o("z")], vec![n(1), n(20), o("b")], vec![n(0), n(3), o("a")], ]; check_is_table(x, exp); let x = process_w_str("rev", defs); assert_eq!...
Rust
0
, 74, 126, 25, 17, 162, 4, 106, 136, 77, 155, 115, 237, 183, 71, 245, 144, 197, 71, 247, 147, 142, 89, 195, 170, 137, 163, 22, 130, 176, 182, 228, 45, 11, 126, 64, 223, 77, 5, 20, 126, 39, 74, 39, 6, 145, 68, 128, 6, 199, 85, 107, 105, 122, 133, 39, 23, 12, 65, 126, 46, 158, 84, 21, 224, 66, 64, ...
Rust
0
, X, Y, Z, } impl std::ops::Index<Var> for Memory { type Output = Val; fn index(&self, index: Var) -> &Self::Output { match index { Var::W => &self[0], Var::X => &self[1], Var::Y => &self[2], Var::Z => &self[3], } } } impl std::o...
Rust
0
offset: offset.x as u32, yoffset: offset.y as u32, width: width, height: height, mosaic_x: mosaic.0 as u32, mosaic_y: mosaic.1 as u32, first_target: first_target, second_target: second_target, } } // #[inline] // fn...
Rust
0
t3D::new(0., 5., 0.); let mut outer = Loop3D::new(); outer.push(p0).unwrap(); outer.push(p1).unwrap(); outer.push(p2).unwrap(); outer.push(p3).unwrap(); outer.push(p4).unwrap(); outer.push(p5).unwrap(); outer.close().unwrap(); assert_eq!(6, outer.n...
Rust
0
n(uni_ele)) print('updated precentage', len(nodes) / len(uni_ele)) # 保存采样结果 sample_results.to_csv(upd_path) # 如果比例在0.18到0.22之间 else: uni_ele = neighbors[['role_id', 't_role_id']].values.flatten().tolist() ...
Python
1
r""" .. _super-exp-cutoff-powerlaw-4fgl-dr3-spectral-model: Super Exponential Cutoff Power Law Model used for 4FGL-DR3 ========================================================== This model parametrises super exponential cutoff power-law model spectrum used for 4FGL. It is defined by the following equation: .. math:...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Gauge Widget for Kanban', 'category': 'Hidden', 'description': """ This widget allows to display gauges using d3 library. """, 'version': '1.0', 'depends': ['web'], 'data' : [ '...
Python
1
tore_from_options, register_rendezvous_handler, rendezvous, ) set_debug_level_from_env() else: # This stub is sufficient to get # python test/test_public_bindings.py -k test_correct_module_names # working even when USE_DISTRIBUTED=0. Feel free to add more # stubs as necessar...
Python
1
class Solution: def countPairs(self, nums: List[int], k: int) -> int: ''' i*j % k=> i%k==0 or j%k==0 or i*j %k==0 * using gcd. Store all indices for same number. Find all the divisors of k starting from indices, add all the divisors of k that can be formed from val using gcd,...
Python
1
, pf.ExtrusionSpec(tl_mask, tl_metal, (z_tl, z_top)), pf.ExtrusionSpec(ht_mask, tl_metal, (z_tl, z_top)), ] if include_substrate: extrusion_specs.append(pf.ExtrusionSpec(bounds, si, (-pf.Z_INF, -box_thickness))) if include_top_opening: extrusion_specs.append(pf.ExtrusionSpe...
Python
1
Should be within `[-1, 1]` /// /// # Arguments /// * `sin_theta`: The sine of `theta` /// * `cos_theta`: The cosine of `theta` /// * `sin_phi`: The sine of `phi` /// * `cos_phi`: The cosine of `phi` /// /// # Returns /// * The corresponding cartesian vector pub fn spherical_to_cartesian_trig( sin_theta: Float, ...
Rust
0
''' Create a list of 10 numbers and print only the even numbers. ''' num=[10,7,8,4,3,77,33,23,89] for i in num: if i%2==0: print(f"{i} is even number") ''' Reverse a list without using the reverse() function. ''' a=[10,7,8,4,3,77,33,23,89] b=[] for x in a: b.insert(0,x) print(b) ''' Count how man...
Python
1
1, 1, 1, 1)) lblx = ax.set_xlabel(r"Scene Heading, $\varphi_s$") lbly = ax.set_ylabel(r"Depth Disparity, $d$") ax.set_xticks([5, 15, 25]) ax.set_xticklabels(["5°", "15°", "25°"]) ax.set_yticks([0.0, 0.25, 0.5, 0.75, 1.0]) ax.set_zticks([4, 6, 8, 10]) ax.set_ztick...
Python
1
def threeSum(nums): # n=len(nums) # # m=[] # b=set() # nums.sort() # for i in range(n-2): # if i>0 and nums[i]==nums[i-1]: # continue # j=i+1 # k=n-1 # while j<k: # s=nums[i]+nums[j]+nums[k] # if s==0: # ...
Python
1
[0.127, 0.053, 0.011, 0.031, 0.017, 0.061, 0.661, 9.2, 130.0, 1837.0, 25966.0]; assert!( max_order < COEFFS.len(), "don't have enough information about Riemann-Siegel formula" ); let mut levels: Vec<(f64, usize)> = vec![]; let mut cur_t = max_height; ...
Rust
0
import os import time from wxauto import * # 获取当前微信客户端 wx = WeChat() # 设置监控路径(系统图片文件夹/已处理/分类/霸凌) pictures_folder = os.path.join(os.environ['USERPROFILE'], 'Pictures') monitor_folder = os.path.join(pictures_folder, '已处理', '分类', '霸凌') # 创建已发送文件记录 sent_files = set() # 支持的图片格式 image_extensions = {'.png', '.jpg', '.jpeg...
Python
1
a=10 #here "a" is variable b=5 #also "b" print(a*b) ''' E.g : variable is like a container in which we can store a value . Means both <a,b> are container here . in which we store 10and5 respectively. '''
Python
1
import pandas as pd import geopandas as gpd # create isochrone polygon a for a single weight limit def create_isochrones_polygons(gdf_edges, v_buffer_meters, v_buffer_distance, f_dissolve='weight_limit'): weight_limit_value = list(gdf_edges[f_dissolve].unique())[0] v_buffer_distance_retract = (-0.99) * v_buffe...
Python
1
-MIB", "hwDHCPRelayDiscoverPktNum"), ("A3COM-HUAWEI-DHCPR-MIB", "hwDHCPRelayRequestPktNum"), ("A3COM-HUAWEI-DHCPR-MIB", "hwDHCPRelayDeclinePktNum"), ("A3COM-HUAWEI-DHCPR-MIB", "hwDHCPRelayReleasePktNum"), ("A3COM-HUAWEI-DHCPR-MIB", "hwDHCPRelayInformPktNum"), ("A3COM-HUAWEI-DHCPR...
Python
1
--------------------------------" ) print( f'reduced nonlinearity dimension n_out from {nx+nz} to {gnsf["n_out"]}' ) print(f"reduced nonlinearity from {n_nodes_current} to {n_nodes_next} nodes") print(" ") print("phi now reads as:") print_casadi_ex...
Python
1
from tkinter import * from tkinter.messagebox import * from tkinter.scrolledtext import * from sqlite3 import * def mtov(): mw.withdraw() vw.deiconify() def vtom(): vw.withdraw() mw.deiconify() def save(id): money=ent_money.get() if money.strip()=="": showerror("Issue","Don't leave Blank Spaces") ent_money....
Python
1
(BOB, BTC, 70)); assert_eq!( RewardsModule::pools(PoolId::ExchangeIncentive(BTC)), PoolInfo { total_shares: 90, total_rewards: 0, total_withdrawn_rewards: 0 } ); assert_eq!( RewardsModule::pools(PoolId::ExchangeSaving(BTC)), PoolInfo { total_shares: 90, total_rewards: 0, tot...
Rust
0
st.session_state.journal_entries = [] st.session_state.journal_entries.append(new_entry) add_activity("Journal", "Wrote new journal entry") st.success("Journal entry saved!") st.rerun() # Display past entries st.markdown("### 📚 P...
Python
1
e(self); #[inline] fn mark<T: $crate::gc::GcTrace + ?Sized>(it: &T) { $crate::gc::GcTrace::finalize_glue(it); } let $this = self; $body } }; } /// Creates an empty finalize and trace implementation. /// Appropriate for types that h...
Rust
0
from setuptools import setup, find_packages with open("requirements.txt") as f: requirements = f.read().splitlines() setup( name="reinforceui-studio", version="1.3.2", author="David Valencia", author_email="support@reinforceui-studio.com", description="A GUI to simplify the configuration and m...
Python
1
err = NetError::new( ErrCode::DATA_STORE, "vt:origin-public-encryption-key-list:1", ); error!("{}, {}", err, e); conn.route_reply(req, &*err)?; } } Ok(()) } pub fn origin_secret_key_create( req: &mut Message, conn: &mut RouteCo...
Rust
0
.len()-1]{//全部チェックするので、必ず順方向逆方向二つある res.push(r); } } } return res; } pub fn get_all_path(next_atoms:&HashMap<usize,Vec<usize>> ,path:& Vec<usize>,maxlength:usize)->Vec<Vec<usize>>{ let current = path[path.len()-1].clone(); let next:&Vec<usize> = next_atoms.g...
Rust
0
custom_preview_texts[i] = preview_text # 开始批量处理 if st.button("🚀 开始批量克隆", type="primary"): if not base_voice_id and not any(custom_voice_ids.values()): st.error("请设置基础音色ID或自定义音色ID") else: # 验证所有音色ID ...
Python
1
: u32, idx : u32) -> i32 { return voxels[parent as usize].sub_voxels[idx as usize]; } fn interval_nonempty(t : Vec2) -> bool { return t.x < t.y; } fn interval_intersect(a : Vec2, b : Vec2) -> Vec2 { return Vec2::new(f32::max(a.x,b.x), f32::min(a.y, b.y)); // return ((b.x > a.y || a.x > b.y) ? vec2(1,...
Rust
0
# Collect all metrics values metrics_values = [] for state in PostgresqlState: value = state.index metrics_values.append(value) # Check for duplicates unique_values = set(metrics_values) self.assertEqual(len(metrics_values), len(unique_values), ...
Python
1
.005, 'readOperations': 10, 'debugStats': {} } } explain_metrics = ExplainMetrics.from_repr(data) assert isinstance(explain_metrics, ExplainMetrics) assert isinstance(explain_metrics.plan_summary, PlanSummary) assert isinstance(explai...
Python
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
_tokens=max_tokens ) if "error" in response: msg.content = f"❌ **Error**: {response['error']}" await msg.update() return # Extract assistant response assistant_response = response.get("choices", [{}])[0].get("message", {}).get("conten...
Python
1
# -------------------------------------------------------- # In-Hand Object Rotation via Rapid Motor Adaptation # https://arxiv.org/abs/2210.04887 # Copyright (c) 2022 Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- # Based on: IsaacGymEnvs...
Python
1
progressfn(member) if progressfn else None if pattern and not re.match(pattern, member): continue prefix, name = member.split('/', 1) store = omega.store_by_prefix(f'{prefix}/') meta = store.from_archive(arc, name) if ...
Python
1
CALAPPDATA", f"C:\\Users\\{user_name}\\AppData\\Local" ) target_dir = os.path.join(local_appdata, "ms-playwright") # 如果目标目录已存在,先删除 if os.path.exists(target_dir): logger.info(f"删除已存在的目录: {target_dir}") shutil.rmtree(target_dir) # 创建目标目录 os.makedir...
Python
1
"""Tests for `metalens.component`. Copyright (c) 2023 The INVRS-IO authors. """ import dataclasses import unittest import fmmax import jax import jax.numpy as jnp import numpy as onp from jax import tree_util from invrs_gym.challenges.metalens import challenge, component class MetalensComponentTest(unittest.TestC...
Python
1
_point(pz)); } } bounds } } #![deny(warnings, missing_debug_implementations, missing_docs)] //! Shuttle is a library for testing concurrent Rust code, heavily inspired by [Loom][]. //! //! Shuttle focuses on randomized testing, rather than the exhaustive testing that Loom offers. This /...
Rust
0
import cv2 import csv import numpy as np import os import sys min_float = sys.float_info.min print(f"The minimum float value in Python is: {min_float}") max_float = sys.float_info.max print(f"The maximum float value in Python is: {max_float}") csv_file = "directory_structure.csv" recognizer = cv2.face.LBPHFaceReco...
Python
1
} } } assert_eq!(Foo::V1(1, "".into()).get(0), ("", 1)); assert_eq!(Foo::V2("bar").get(5), ("bar", 5)); assert_eq!(Foo::V3.get(10), ("3", 10)); } use std::sync::Arc; use druid::{Command, Env, EventCtx, Modifiers, Point, Target, WidgetId}; use crate::{ command::{ CommandExe...
Rust
0
, 'dlpack.cpp')) ext = Extension(modulename, sources=sources, libraries=["astra"]) assert not hasattr(ext, 'cython_directives') ext.cython_directives = {'language_level': "3"} ext_modules.append(ext) return ext_modules # See https://github.com/pypa...
Python
1
for a given key. Args: series (List[dict]): A list of dictionaries to check. key (str): The key to check in each dictionary. Returns: Tuple[bool, str]: A tuple containing a boolean indicating if all values are the same, and a string message indicating the number of unique v...
Python
1
entialAlreadyExist) } new_credential_info = UserCredentialInfo { user_id: owner_id.clone(), people_id: credential_info.people_id.clone(), platform: credential_info.platform.clone(), }; credential_id = Self::generate_credential_id(owner_id, credential_info, &credential_count); cr...
Rust
0
} let lgl = R.is_match(&text); return lgl; } pub fn is_time(text: &str) -> bool { //let time = "11:59:37 UTC"; //https://stackoverflow.com/a/25873711 lazy_static! { static ref R: Regex = Regex::new(r"^(?:[01][0-9]|2[0123]):(?:[012345][0-9]):(?:[012345][0-9])$").unwrap(); ...
Rust
0
E_ENUM_ALL: CLUSTER_NODE_ENUM = 3i32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub type CLUSTER_NODE_RESUME_FAILBACK_TYPE = i32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const DoNotFailbackGroups: CLUSTER_NODE_RESUME_FAILBACK_TYPE = 0i32; #[doc = "*Required features...
Rust
0
import networkx as nx from queue import Queue, deque def has_cycle(graph: nx.DiGraph): try: nx.find_cycle(graph, orientation='original') return True except: return False def get_graph_levels(graph: nx.DiGraph): """ Find graph level for each node level[node] := 0 if the no...
Python
1
; } #[test] #[should_panic] fn test_unique_paths_with_obstacles3() { // 这个路径数超过了 i32 的范围。 let grid = vec![ vec![ 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, ], ...
Rust
0
import logging from biostar.forum.settings import * #from biostar.recipes.settings import * logger = logging.getLogger("biostar") # Debugging flag. DEBUG = True # Set your known secret key here. SECRET_KEY = "secretkey" # Admin users will be created automatically with DEFAULT_ADMIN_PASSWORD. ADMINS = [ ("Admin ...
Python
1
tinue map_types[id(var), i] = dt # replace input types when known new_possible_inputs = [] for var, index, dt in possible_inputs: if dt is None and (id(var), index) in map_types: dt = map_types[id(var), index] new_p...
Python
1
): if not model: print("服务未初始化") raise HTTPException(status_code=500, detail="服务未初始化") try: # print(f"收到聊天完成请求: {request}") print(f"已经进入到请求中") customer_domain = request.messages[-1].customer_domain project_description = request.messages[-1].project_description ...
Python
1
#!/usr/bin/env python3 # Read the file with open('/Users/divyanshchugh/Desktop/chat bot/user_bot.py', 'r') as file: lines = file.readlines() # Find the problematic section for i in range(5045, 5055): if "Authentication code sent" in lines[i]: start_line = i break # Define the corrected messag...
Python
1
fail_too_many_chunks() { ChunkedMessage::new(ChunkSize::Custom(1), get_data(129)).unwrap(); } #[test] fn chunk_message_len() { let msg_1_chunk = ChunkedMessage::new(ChunkSize::Custom(1), get_data(1)).unwrap(); let msg_2_chunks = ChunkedMessage::new(ChunkSize::Custom(1), get_data(2)...
Rust
0
=> (), | notify::DebouncedEvent::Create(_) | notify::DebouncedEvent::Remove(_) | notify::DebouncedEvent::Rename(_, _) => { main_thread_tx.send(true).unwrap(); } } } Err(e) => println!("watch error: {:?}", e), ...
Rust
0
wn = int(root.attrib.get("thumbsDown")) if(root.attrib.get("stars")!=None and len(root.attrib.get("stars").strip()) > 0): self.stars = root.attrib.get("stars") #tag name if(root.find("summary")!=None): self.summary = root.find("summary").text if(root.fi...
Python
1
trixN { $($field: matrix.$field / scalar),+ } } }); impl_operator!(<S: BaseFloat> Rem<S> for $MatrixN<S> { fn rem(matrix, scalar) -> $MatrixN<S> { $MatrixN { $($field: matrix.$field % scalar),+ } } }); impl_assignment_operator!(<S: BaseFloat> MulAssign<S> for $MatrixN<S> { ...
Rust
0
#[doc = " Check that numbers of Rx and Tx descriptors satisfy descriptors limits from"] #[doc = " the ethernet device information, otherwise adjust them to boundaries."] #[doc = ""] #[doc = " @param port_id"] #[doc = " The port identifier of the Ethernet device."] #[doc = " @param nb_rx_desc"] ...
Rust
0
nkRecordingExecutor( recording, func, init_func, init_args, verbose=verbose, job_name="write_zarr_recording", **job_kwargs ) executor.run() # used by write_zarr_recording + ChunkRecordingExecutor def _init_zarr_worker(recording, zarr_datasets, dtype): import zarr # create a local dict per wor...
Python
1
from flask import Flask, request, jsonify app = Flask(__name__) # Welcome route @app.route("/", methods=["GET"]) def get_welcome(): return "Welcome to the Flask API" heights = [160, 175, 180, 165, 170] # Sort heights in ascending order @app.route("/heights/sort-ascending", methods=["GET"]) def heights_sort_asce...
Python
1
oad::new(vec1, |d| tremor_value::parse_to_value(d).unwrap().into()); /// let vec2 = br#"{"snot": "badger"}"#.to_vec(); /// let e2 = EventPayload::new(vec2, |d| tremor_value::parse_to_value(d).unwrap().into()); /// let mut v = Value::null(); /// // We try to move the data ov v2 outside of this cl...
Rust
0
_VDDM_CTRL {} #[doc = "`write(|w| ..)` method takes [acs_vddm_ctrl::W](acs_vddm_ctrl::W) writer structure"] impl crate::Writable for ACS_VDDM_CTRL {} #[doc = "Memories Voltage Regulator Configuration / Control register"] pub mod acs_vddm_ctrl; #[doc = "RF Block Regulator Configuration / Control register\n\nThis registe...
Rust
0
value -= 5 # Calculating the shortest walk solution to account for solvability, difficulty and linearity solution = self.shortest_walk_least_keys(ROOT, graph_und) # undirected graph because in real play you can go in any direction # Validity criterion #4: the dungeon is solvable ...
Python
1
sb::C_SkWStream_write( self.native_mut().base_mut(), bytes.as_ptr() as _, bytes.len(), ) } } pub fn detach_as_data(&mut self) -> Data { Data::from_ptr(unsafe { sb::C_SkDynamicMemoryWStream_detachAsData(self.native_mut()) }) ...
Rust
0
] fn ttstub_input_get_size(handle: rust_input_handle_t) -> size_t; #[no_mangle] fn ttstub_input_read(handle: rust_input_handle_t, data: *mut i8, len: size_t) -> ssize_t; #[no_mangle] fn ttstub_input_close(handle: rust_input_handle_t) -> i32; #[no_mangle] fn pdf_release_obj(object: *mut pdf_o...
Rust
0
2 => Some(WSTATE0_A::BELOW), _ => None, } } #[doc = "Checks if the value of the field is `ABOVE`"] #[inline(always)] pub fn is_above(&self) -> bool { **self == WSTATE0_A::ABOVE } #[doc = "Checks if the value of the field is `INSIDE`"] #[inline(always)...
Rust
0
# Copyright (c) Saga Inc. # Distributed under the terms of the GNU Affero General Public License v3.0 License. from typing import List, Dict, Any from sqlalchemy import create_engine, text from sqlalchemy.exc import SQLAlchemyError from mito_ai.db.crawlers.constants import SUPPORTED_DATABASES from mito_ai.db.models im...
Python
1
S2, S3, S1, S2, S1, S2, S5, S4, S5, S4, S1 ] }, c ); } #[test] fn slice_s() { let s = Move::Slice(Slice::S, Amount::Single, Direction::Clockwise); let mut c = StickerCube::solved(); c.do_move_mut(s); assert_eq!(UR, c.edge(UR)); assert_eq!(DR, c.edge(DR)); ...
Rust
0
the limit is hit). pub fn read_nested(encoded_cbor: &[u8], max_nest: Option<i8>) -> Result<Value, DecoderError> { let mut reader = Reader::new(encoded_cbor); let value = reader.decode_complete_data_item(max_nest)?; if !reader.remaining_cbor.is_empty() { return Err(DecoderError::ExtraneousData); ...
Rust
0
to a `usize` value. If there is nothing to read, it will return `Ok(None)`. /// /// ```rust /// extern crate scanner_rust; /// /// use scanner_rust::Scanner; /// /// let mut sc = Scanner::new("1 2".as_bytes()); /// /// assert_eq!(Some(1), sc.next_usize().unwrap()); /// assert_eq...
Rust
0
_ => panic!("Pattern mismatch"), } } #[test] fn fire_types_cannot_be_burned() { let mut backend = battle! { "Hitmonchan" 24 (max ivs, Serious) vs "Charmander" 24 (max ivs, Serious) }; test_rng_mut!(backend.rng).force_secondary_effect(1); let events = backend.process_turn("FirePunch", "Sl...
Rust
0
import os import re from ingestsql import VectorSearch from tools.db import DatabaseManager from sqlalchemy import create_engine from llama_index.core import SQLDatabase from llama_index.core.query_engine import NLSQLTableQueryEngine from llama_index.llms.openai import OpenAI from llama_index.llms.anthropic import A...
Python
1
crate_ident("minecrevy_io_str", "McRead"); let ast = generate_ast(&input.attrs, &input.data); quote! { #[automatically_derived] impl #gen_impl #mcread for #ident #gen_ty #gen_where { type Options = (); fn read<R: ::std::io::Read>(mut reader: R, (): Self::Options) -> ::...
Rust
0
Error("無効なドローンインデックス") drone1 = self.drones[drone_idx1] drone2 = self.drones[drone_idx2] # 各特徴点についての確率を計算 probs = [] for fp in self.feature_points: prob = drone1.calculate_cofov_probability(drone2, fp.position) probs.append(prob) ...
Python
1
.with_activation_point(DEFAULT_ACTIVATION_POINT) .with_new_round_seigniorage_rate(new_round_seigniorage_rate) .build() }; builder .upgrade_with_upgrade_request(*builder.get_engine_state().config(), &mut upgrade_request); let initial_supply = builder.total_supply(None); ...
Rust
0
apenas **observação**." conflict_warning = None if game_rhythm.get("context") == "hot" and top_opportunity["profile"] == "Contrarian": conflict_warning = "ALERTA DE TENSÃO: O ritmo do jogo é de 'Momentum', mas a oportunidade mais forte é 'Contrarian'. Apostar contra a tendência é um movimento de alto r...
Python
1
::<Vec<_>>() } fn make_batch( schema: Arc<Schema>, mut arrays: Vec<Box<dyn ArrayBuilder>>, ) -> ArrowResult<RecordBatch> { let columns = arrays.iter_mut().map(|array| array.finish()).collect(); RecordBatch::try_new(schema, columns) } fn get_columns(mut arrays: Vec<Box<dyn ArrayBuilder>>) -> Vec<ArrayR...
Rust
0
assemble_mnemonic, }), _ => match (word >> 5) & 0x3 { 0 => match (word >> 12) & 0x1 { 0 => Ok(&CompressedInstruction { mnemonic: "c.sub", decompress: c_sub, disassemble: disassemble_mnemon...
Rust
0