text
string
label_name
string
labels
int64
#!/usr/bin/env python # coding:utf8 ''' 一次性爬取豆瓣所有电影的概要信息 author: Honlan email: 493722771@qq.com date: 2015/09/06 ''' import urllib2 import urllib import json import time ISOTIMEFORMAT='%Y-%m-%d %X' outputFile = 'douban_movie.txt' fw = open(outputFile, 'w') fw.write('id;title;url;cover;rate\n') headers = {} h...
Python
1
) real_hp = numpyro.sample( f"{self.prefix}_real_hp", dist.Normal(loc_r, _softplus(rho_r)).to_event(4) ) imag_hp = numpyro.sample( f"{self.prefix}_imag_hp", dist.Normal(loc_i, _softplus(rho_i)).to_event(4) ) r_full, i_full = halfplane_to_full_multi(...
Python
1
----- angle : float Angle in degrees. ndim : int Dimensionality of the shear matrix axes : 2-tuple of int Location of the angle in the shear matrix. Default is the lower left value. Returns ------- matrix : np.ndarray Shear matrix with ones along the main...
Python
1
key() ) .await, 0, ); // Add extra funds, simulating rewards const EXTRA_STAKE_AMOUNT: u64 = 1_000_000; for stake_account in &stake_accounts { transfer( &mut context.banks_client, &context.payer, &context.last_blockhash, &...
Rust
0
ed).base } } let mut derived = Derived::default(); assert_eq!(ptr_location(&derived.base), ptr_location::<&Base>((&derived).upcast())); let _: *const Base = unsafe { Derived::upcast_ptr(&derived) }; let _: *mut Base = unsafe { Derived::upcast_ptr_mut(&mut derived) };...
Rust
0
.unwrap(); let cookie = cookie::make_cookie(keys, &actual_key); let mut response: Vec<u8> = Vec::new(); let mut aead_rec = NtsKeRecord { critical: false, record_type: 4, contents: vec![0, 15], }; let mut end_rec = NtsKeRecord { critical: true, record_type: 0, ...
Rust
0
en(rewriter.assignments) new_nodes.append(possibly_transformed_node) return new_nodes def visit_FunctionDef(self, node): transformed = ast.FunctionDef( name=node.name, args=node.args, body=self.visit_body(node.body), decorator_list=node.de...
Python
1
"v4_iface1_forward_v6_icmp_v4")] #[test_case( "v4_iface2_forward_v4_icmp_v4", test_forwarding_v4( Some(ForwardingConfiguration::Iface2Only(fidl_fuchsia_net::IpVersion::V4)), false, ); "v4_iface2_forward_v4_icmp_v4")] #[test_case( "v6_none_forward_icmp_v6", test_forwarding_v6( ...
Rust
0
} impl core::ops::Deref for P4SEL1_0_R { type Target = crate::FieldReader<bool, bool>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `P4SEL1_0` writer - P4SEL1_0"] pub struct P4SEL1_0_W<'a> { w: &'a mut W, } impl<'a> P4SEL1_0_W<'a> { #[doc = r"Sets the f...
Rust
0
, 1)]); Pallet::<Test>::reward_by_ids(vec![(21, 1)]); mock::start_active_era(1); // 10 and 20 have more votes, they will be chosen. assert_eq_uvec!(validator_controllers(), vec![20, 10]); // old validators must have already received some rewards. let initial_balance_40 = Balances::total_balance(&40...
Rust
0
""" Module printing summary of the contract """ from slither.printers.abstract_printer import AbstractPrinter from slither.utils.myprettytable import MyPrettyTable class VariableOrder(AbstractPrinter): ARGUMENT = "variable-order" HELP = "Print the storage order of the state variables" WIKI = "https...
Python
1
oint-path", # joinpath(resource_path, "looppoint-checkpoint-save"), # ], # valid_isas=(constants.all_compiled_tag,), # valid_hosts=constants.supported_hosts, # length=constants.very_long_tag, # ) # for region in ( # "1", # "2", # "3", # "5", # "6", # "7", # "8", # "9", # "...
Python
1
use protocol::Error; if let Err(e) = copy_bidirectional(cb, metrics, hasher, client, p).await { match e { Error::Quit => {} // client发送quit协议退出 Error::ReadEof => {} e => log::info!("disconnected. {:?} ", e), } ...
Rust
0
import bpy import os from random import randint # Add Cube bpy.ops.mesh.primitive_cube_add() cube_obj = bpy.context.selected_objects[0] cube_obj.name = 'MyCube' # Spawn multiple randomly spaced cubes #how many cubes you want to add #count = 10 #for c in range(0,count): # x = randint(-10,10) # y = randint(-10,1...
Python
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021, Cisco Systems # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = r""" --- module: snmp_properties_info short_description: Information module for Snmp Properties description: - Get all Snmp Propert...
Python
1
facial_features: (B, T, C) # audio_features: (B, Ta, C) # """ # facial_features = facial_features.transpose(1, 2) # assert facial_features.dim() == 3 and audio_features.dim() == 3, "输入必须是三维 (B,T,C)" # B, T, C = facial_features.shape # Ba, Ta, Ca = audio_features...
Python
1
nfo: None, locals_of_current_block: BitSet::new_empty(body.local_decls.len()), } } fn get_const(&self, place: Place<'tcx>) -> Option<OpTy<'tcx>> { let op = self.ecx.eval_place_to_op(place, None).ok(); // Try to read the local as an immediate so that if it is representable a...
Rust
0
current_index['images'][tmdb_id_str][item['image_type']] = { "repo_url": repo_url, "sha": response_data['content']['sha'], "size": response_data['content']['size'], "url": response_data['conten...
Python
1
PartialOrd, Ord)] pub struct MismatchConstError; macro_rules! wrap_impl { ($tb: ty, $t : ident) => { /// Const generic wrapper. #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct $t<const T: $tb>; impl ConstableSeal for $tb{} impl Consta...
Rust
0
a"); f1(~"b"); f1(&"c"); f1("d"); f2(@"a"); f2(~"b"); f2(&"c"); f2("d"); g1(@"a", @"b"); g1(~"b", ~"c"); g1(&"c", &"d"); g1("d", "e"); g2(@"a", @"b"); g2(~"b", ~"c"); g2(&"c", &"d"); g2("d", "e"); } <reponame>capyloon/api-daemon #[link(name = "windows")] exter...
Rust
0
text.tStart = t # not accounting for scr refresh text.frameNStart = frameN # exact frame index win.timeOnFlip(text, 'tStartRefresh') # time at next scr refresh text.setAutoDraw(True) frameRemains = 0.0 + 1.0- win.monitorFramePeriod * 0.75 # most of one frame period left if text.stat...
Python
1
t!(Solution::find132pattern(vec![3, 1, 4, 2])); assert!(Solution::find132pattern(vec![-1, 3, 2, 0])); } } mod push; mod eat; mod reserved_functions; use super::tree::Tree; use super::tree::Op; use super::is; use std::iter::Peekable; use std::str::Chars; pub fn parser(mut cs: Peekable<Chars>) -> Tree { ...
Rust
0
import json import threading from .betting_interface import submit_bet, record_bet from .helix_node import HelixNode, GossipMessageType def run_cli(node: HelixNode, *, keyfile: str | None = None) -> None: """Simple interactive CLI for a :class:`HelixNode`.""" threading.Thread(target=node._message_loop, daem...
Python
1
# Copyright (c) 2022-2023, NVIDIA CORPORATION. # 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...
Python
1
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
Python
1
{"filter":false,"title":"embeddings_search_app.py","tooltip":"/workshop/labs/embeddings_search/embeddings_search_app.py","undoManager":{"mark":6,"position":6,"stack":[[{"start":{"row":0,"column":0},"end":{"row":2,"column":0},"action":"insert","lines":["import streamlit as st #all streamlit commands will be available th...
Python
1
. // Record the stack size so we know what it is when we encounter the adjustment // instruction (which will adjust via the register assigned to this instruction). stack_size = Some(imm as u32); } Opcode::Adj...
Rust
0
} } #[doc = "Checks if the value of the field is `LOW`"] #[inline] pub fn is_low(&self) -> bool { *self == PAD21STRNGR::LOW } #[doc = "Checks if the value of the field is `HIGH`"] #[inline] pub fn is_high(&self) -> bool { *self == PAD21STRNGR::HIGH } } #[doc = "Pos...
Rust
0
ucer] pub fn add_person(ctx: &ReducerContext, name: String) { ctx.db.person().insert(Person { name, age: 70 }); } #[spacetimedb::reducer] pub fn print_persons(ctx: &ReducerContext, prefix: String) { for person in ctx.db.person().iter() { log::info!("{}: {}", prefix, person.name); } } """ def t...
Python
1
取聊天频道详情""" channel = await DBChatChannel.get_or_none(chat_key=chat_key) if not channel: return Ret.fail(msg="聊天频道不存在") # 获取聊天频道数据 message_count = await DBChatMessage.filter(chat_key=chat_key, create_time__gte=channel.conversation_start_time).count() # 获取最近一条消息的时间 last_message = await D...
Python
1
//! //! #[derive(PanicFmt)] //! enum Qux { //! Up, //! Down { x: u32, y: u32 }, //! Left(u64), //! } //! //! ``` //! The above code fails to compile with this error: //! ```text //! error[E0080]: evaluation of constant value failed //! --> src/lib.rs:57:5 //! | //! 7 | / Foo{ //! 8 | | x...
Rust
0
use crate::config::Config; use crate::engine::read_entry_bytes_from_file; use crate::event_listener::EventListener; use crate::log_batch::{Command, LogBatch, LogItemContent, OpType}; use crate::memtable::{MemTable, MemTableAccessor}; use crate::metrics::*; use crate::pipe_log::{FileBlockHandle, FileId, FileSeq, LogQu...
Rust
0
"xyxy": TO_REMOVE = 1 area = (box[:, 2] - box[:, 0] + TO_REMOVE) * (box[:, 3] - box[:, 1] + TO_REMOVE) elif self.mode == "xywh": area = box[:, 2] * box[:, 3] else: raise RuntimeError("Should not be here") return area def copy_with_fields(sel...
Python
1
,// getexpss 0x09, 0x67, 0x65, 0x74, 0x6D, 0x61, 0x6E, 0x74, 0x73, 0x64,// getmantsd 0x09, 0x67, 0x65, 0x74, 0x6D, 0x61, 0x6E, 0x74, 0x73, 0x73,// getmantss 0x06, 0x67, 0x65, 0x74, 0x73, 0x65, 0x63,// getsec 0x03, 0x68, 0x6C, 0x74,// hlt 0x07, 0x69, 0x6E, 0x63, 0x73, 0x73, 0x70, 0x64,// incsspd 0x07, 0x69, 0x6E, ...
Rust
0
E::null()), ..unsafe { zeroed() } } } } /// Simplifies calling [CreateWindowExW](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindowexw). #[inline] pub unsafe fn create_window_ex(args: CreateWindowExArgs) -> Win32Result<HWND> { user32_fn!(CreateWindowExW( ex_style: DWORD...
Rust
0
#!/usr/bin/env python ''' Run latest modified program with PyViz. This required PyBindGen support in ns3. I create an alias "rv" for "run visualized". ''' import sys import os import sort_dir as sort_dir_obj def main(argv): """Main function""" default_program = sort_dir_obj.get_most_recent() print ("Usin...
Python
1
// Lower-case ASCII letters all have the 0x20 bit set. // (Two positions right of 0x80, the highest bit.) // Unsetting that bit produces the same letter, in upper-case. // // Therefore: fn branchless_to_ascii_upper_case(byte: u8) -> u8 { byte & !( ( byte.wrapping_add(0x1f) & !byt...
Rust
0
# Imports from agno.agent import Agent from agno.models.google import Gemini from agno.tools.wikipedia import WikipediaTools import os # Prompt prompt = "Search wikipedia for 'Time series analysis' and summarize the 3 main points" # Create agent agent = Agent( model= Gemini(id="gemini-2.0-flash", ...
Python
1
ubr_m16int, /// `FIDIV m16int` /// /// `DE /6` /// /// `8087+` /// /// `16/32/64-bit` Fidiv_m16int, /// `FIDIVR m16int` /// /// `DE /7` /// /// `8087+` /// /// `16/32/64-bit` Fidivr_m16int, /// `FADDP ST(i), ST(0)` /// /// `DE C0+i` /// /// `8087+` /// /// `16/32/64-bit` Faddp_sti_st0, /// `FMU...
Rust
0
ow's execution method. workflow.execute_morphing() else: # If the configuration was found to be invalid during preparation, # log an error and skip this run. logging.error(f"Run {i + 1} skipped due to invalid configuration d...
Python
1
#!/usr/bin/env python3 """ METALFORGE AI Zero-Day Detection Example Demonstrates advanced zero-day vulnerability detection capabilities """ import asyncio import os from pathlib import Path from metalforge.core.zero_day_detector import ZeroDayDetectionEngine from metalforge.core.reasoning_engine import ReasoningEngin...
Python
1
sk2.mul_assign(&s, &sk1).unwrap(); assert_eq!(sk2, one); } #[test] fn test_negate() { let s = Secp256k1::new(); let (sk1, _) = s.generate_keypair(&mut thread_rng()).unwrap(); let mut sk2: SecretKey = sk1.clone(); sk2.neg_assign(&s).unwrap(); assert!(sk2.add_...
Rust
0
ursiveMutCallback)?; (&mut *method)(lua, &mut userdata, A::from_lua_multi(args, lua)?)?.to_lua_multi(lua) } else { Err(Error::FromLuaConversionError { from: "missing argument", to: "userdata", message: None, ...
Rust
0
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. """Basic example which iter...
Python
1
ies(freqs, 5000, 20, allow_negatives=False) @pytest.mark.xfail(raises=ValueError) @pytest.mark.parametrize( "freqs", [ # Test for ValueError when max_freq is violated and allow_negatives=True np.array([100, -100000]), # Test for ValueError when min_freq is violated and allow_negatives=...
Python
1
icitly_identity def abi_address_to_hex( type_str: TypeStr, data: Any ) -> Optional[Tuple[TypeStr, ChecksumAddress]]: if type_str == "address": validate_address(data) if is_binary_address(data): return type_str, to_checksum_address(data) return None @curry def abi_ens_resolver( ...
Python
1
that you want to end up in the slice. If you're curious why the first argument of `assert_eq!` does not have an ampersand for a reference since the second argument is a reference, take a look at the Deref coercions section of the book: https://doc.rust-lang.org/book/ch15-02-deref.html */ // Copyright (c) 2020 Huawei ...
Rust
0
import sys input = sys.stdin.readline def dfs(x, y, count): stack = [(x, y)] while stack: x, y = stack.pop() for i in range(4): nx = x + delta[i][0] ny = y + delta[i][1] if 0 <= nx < N and 0 <= ny < M and matrix[nx][ny] and not visited[nx][ny]: ...
Python
1
finitions::*; use super::field::Field; use super::segment::MessageSegment; pub struct MessageType { message_code: char, pub headers: MessageSegment, pub body: MessageSegment, } impl MessageType { pub fn from_code_option(code: Option<&char>) -> MessageType { let c = code.unwrap_or(&' '); ...
Rust
0
from itertools import combinations def delet(x, y): return 1 if x%y==0 else 0 def f(x): b = 80 <= x <= 100 a = a_a return delet(x, 17) <= ((not b) or (a < x + 30)) ans = [] line = [x/10 for x in range(79*10, 101*10)] for a_a in range(1000): if all(f(x) for x in line): ans.append(a_a) prin...
Python
1
#[inline(always)] pub fn usbremoved(&mut self) -> USBREMOVED_W { USBREMOVED_W { w: self } } #[doc = "Bit 2 - Enable or disable interrupt for event USBPWRRDY"] #[inline(always)] pub fn usbpwrrdy(&mut self) -> USBPWRRDY_W { USBPWRRDY_W { w: self } } } #![cfg(feature = "neptune"...
Rust
0
# Copyright 2024 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
1
riting'}, 'Shaw': {'am': 'የሻቪያ ፊደል', 'ar': 'الشواني', 'ast': 'shavianu', 'az': 'şavyan', 'az-Latn': 'şavyan', 'bn': 'সাভিয়ান', 'brx': 'शेवियन', 'bs': 'šavian pismo', 'bs-Cyrl': 'шавијанско писмо', 'bs-Latn': 'šavian pismo', 'ca': 'shavià', 'ca-ES-valencia': 'shavià', 'ccp': '𑄥𑄞𑄨𑄠𑄚𑄴', 'cs': 'Shawova abeceda',...
Python
1
class Solution: def numIslands(self, grid: List[List[str]]) -> int: m, n = len(grid), len(grid[0]) islands = 0 seen = set() def bfs(i, j): q = deque([(i,j)]) while q: i,j = q.popleft() for r, c in [(i+1, j), (i-1, j), (i, j+1...
Python
1
() { most_work_height = peer.info.height; // sum the last 5 difficulties to give us the threshold let threshold = chain .difficulty_iter() .filter_map(|x| x.map(|(_, x)| x).ok()) .take(5) .fold(Difficulty::zero(), |sum, val| sum + val); if peer.info.total_difficulty > local_diff.cl...
Rust
0
.min() .unwrap() .chars() .map(|c| c.to_string()) .collect::<Vec<_>>() .join("***") */ <reponame>awkinley/5dchess-tools use super::game; use serde::Deserialize; #[derive(Debug, Deserialize)] struct GameRaw { timelines: Vec<TimelineRaw>, widt...
Rust
0
"a"); /// /// let keys: Vec<i32> = a.into_keys().collect(); /// assert_eq!(keys, [1, 2]); /// ``` pub fn into_keys(self) -> IntoKeys<K, V, N> { IntoKeys { inner: self.into_iter(), } } /// Gets an iterator over the values of the map, in order by key. /// ...
Rust
0
""" License endpoints """ from fastapi import APIRouter, Depends, status from sqlalchemy.orm import Session from typing import List from app.database.database import get_db from app.schemas.license import License as LicenseSchema, LicenseCreate, LicenseUpdate, ActivationRequest from app.services.license_service impor...
Python
1
) = start_server(); tx.send(socket_addr.port()) .expect("To be able to send port"); server.await }); }); rx.recv().expect("To get the bound port.") } /// Configures and starts the server fn start_server() -> (SocketAddr, impl Future<Output = ()> + 'static) { ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ IRR计算器 - 性能优化版 使用向量化操作和缓存机制提升计算速度 """ import numpy as np from typing import Dict, List, Any, Tuple from functools import lru_cache import math class IRRCalculatorOptimized: """IRR计算器 - 性能优化版""" @staticmethod def calculate_irr(cash_flows: List[float], ma...
Python
1
this with Rival? const LOD_SCALE_MAPPING: [f32; 9] = [0.83, 0.67, 0.55, 0.42, 0.30, 0.26, 0.16, 0.09, 0.06]; const ROAD_SIGN_Z_OFFSETS: [f32; 3] = [ SEGMENT_LENGTH * 0.35, SEGMENT_LENGTH * 0.5, SEGMENT_LENGTH * 0.65, ]; const MAX_SPAWNED_RIVALS: usize = 2; const RIVAL_SPAWN_CHANCE: f64 = 0.6; const RIVAL...
Rust
0
helper func dim_order = tuple(dim for dim in self.dim_order if dim in schema.dims) shape = tuple(schema.sizes[dim] for dim in dim_order) chunks = tuple(chunksizes[dim] for dim in dim_order) for name in self.get_data_vars(search, renames=renames): schema[name] = ( ...
Python
1
[cfg(feature = "arbitrary")] fn test_compute_commitment(secret in any::<DlogProverInput>(), challenge in any::<Challenge>()) { let pk = secret.public_image(); let (r, commitment) = interactive_prover::first_message(); let second_message = interactive_prover::second_message(&s...
Rust
0
LocalVariableDeclaration(t, _, expr) => { ccb!(t); ccb!(for_each expr.iter().map(|x| x.as_ref())) } Return(expr) => ccb!(for_each expr.iter().map(|x| x.as_ref())), While(cond, stmt) => { ...
Rust
0
[u8; 30usize] = b"/ebrmain/bin/auto_connect.app\0"; pub const SILENT_CONNECT_CFG: &'static [u8; 46usize] = b"/mnt/ext1/system/config/silent_connection.cfg\0"; pub const SOCIAL_DIRECTORY: &'static [u8; 33usize] = b"/mnt/ext1/system/config/readrate\0"; pub const SOCIAL_PENDING_ACTIONS_FILE: &'static [u8; 52usize] = ...
Rust
0
from langchain.llms.base import LLM from typing import Any, List, Optional from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig import torch class DeepSeek_R1_Distill_Qwen_LLM(LLM): """ 自定义DeepSeek-R1 LLM接入实现 """ tokenizer: AutoTokenizer = None model: AutoModelForCausalLM = N...
Python
1
import matplotlib.pyplot as plt import numpy as np import scipy from modules.fitToData import fit from modules.errorProp import * # Constant function def f(t, c): return c + t * 0 def ds(): # Find l dBall = 0.03 dBallStd = 0.0003 x = np.array([2.010]) d = np.array([0.485])/2 xstd = 0.001 d...
Python
1
andy_type: Vec<i32>) -> i32 { let mut s = HashSet::new(); for &c in &candy_type { s.insert(c); } s.len().min(candy_type.len() / 2) as i32 } } #[cfg(test)] mod tests { use super::*; #[test] fn test_distribute_candies() { assert_eq!(Solution::distribut...
Rust
0
"""Change the names of some attributes in Guess model for easier understanding Revision ID: 7e4adebcbbd4 Revises: d597fbf56cec Create Date: 2024-05-11 23:54:51.074144 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "7e4adebcbbd4" down_revision = "d597fbf56cec"...
Python
1
// FIXME: This is effectively just a CALL. Why is that a dedicated instruction? #[insn(opcode = 0x7E, subopcode = 0x01, operands(I24ZX32))] LCALL, /// The LJMP instruction. /// /// Performs an unconditional branch to an absolute address. // FIXME: This is effectively just a JMP. Why is that a d...
Rust
0
import customtkinter as ctk from tkinter import messagebox import re from Controlador.ControladoresDeUsuario.ControladorDeUsuario import * from Controlador.ControladoresDeVistas.ControladorAplicacion import * class VentanaNombre(ctk.CTkToplevel): def __init__(self, parent, proposiciones): super().__init__...
Python
1
12), ]; let path = "get_plaintexts_hmac_sha512"; let root_str = String::from("👿😀😃😄😫😈😖😇😣😁😩😂😆😅💩😊"); configs.iter() .for_each(|config| test_get_plaintexts(path, &root_str, *config, MESSAGES.len() as u8)); } #[test] fn get_plaintexts_key_...
Rust
0
@staticmethod def _find_batch_size(ensemble_size: int, input_res: int, dtype: torch.dtype ) ->int: """ Automatically search for suitable operating batch size. Args: ensemble_size (`int`): Number of predictions to be ensembled. input_res (`int`): ...
Python
1
&SRulesRamsch::new(10, VDurchmarsch::All, /*ojungfrau*/None), vec![], vec![], /*n_stock*/40, &[ (EPI0, [EO,GO,HO,SO]), (EPI0, [EU,GU,HU,SU]), (EPI0, [HA,HZ,HK,H9]), (EPI0, [EA,EZ,EK,E9]), (EPI0, [GA,GZ,GK,G9]), ...
Rust
0
SPIA> for Pin<PA31, AltFunc1> {} impl PinMosi<SPIA> for Pin<PA30, AltFunc1> {} impl PinMiso<SPIA> for Pin<PA29, AltFunc1> {} pub type SpiAPortASck = Pin<PA31, AltFunc1>; pub type SpiAPortAMosi = Pin<PA30, AltFunc1>; pub type SpiAPortAMiso = Pin<PA29, AltFunc1>; impl PinSck<SPIA> for Pin<PB9, AltFunc2> {} impl PinMosi...
Rust
0
"""Production QC."""
Python
1
# -*- coding:utf-8 -*- """ Author: Weichen Shen,weichenswc@163.com """ import numpy as np import torch def concat_fun(inputs, axis=-1): if len(inputs) == 1: return inputs[0] else: return torch.cat(inputs, dim=axis) def slice_arrays(arrays, start=None, stop=None): """Slice an array ...
Python
1
seMessageWindow() Jump('loc_24F8') def _loc_2176(): pass label('loc_2176') If( ( (Expr.TestScenaFlags, ScenaFlag(0x00C9, 1, 0x649)), Expr.Return, ), 'loc_21A3', ) ChrTalk( 0x00FE, ( '我家也总算能够\n', '消停一阵子了。...
Python
1
[doc = " the TCP protocol control block"] #[repr(C)] #[derive(Copy, Clone)] pub struct tcp_pcb { pub local_ip: ip_addr_t, pub remote_ip: ip_addr_t, pub netif_idx: u8_t, pub so_options: u8_t, pub tos: u8_t, pub ttl: u8_t, pub next: *mut tcp_pcb, pub callback_arg: *mut ::std::os::raw::c_vo...
Rust
0
ad_gyroscope_data(self, address): """Read data from the gyroscope.""" data = [self.bmi_bus.read_byte_data(address, i) for i in range(0x02, 0x08)] gyro_int16 = [self.twos_comp(data[i] * 256 + data[i + 1]) for i in range(0, 6, 2)] return gyro_int16 def assemble_imu_message(self, imu_m...
Python
1
re.search(r"xbadhrebe", strings[63]) re.search(r"znp", "jva32") re.search(r"zbmvyyn", strings[63]) re.search(r"zfvr", strings[63]) re.search(r"ag\s5\.1", strings[63]) re.search(r"bcren", strings[63]) re.search(r"fnsnev", strings[63]) re.search(r"jva", "jva32...
Python
1
output = outputs[0] text_sequence_output = sequence_output[:, :seq_length, :] image_sequence_output = sequence_output[:, seq_length:, :] pooled_output = outputs[1] mlm_logits = self.mlm(text_sequence_output, masked_lm_positions) nsp_logits = self.nsp(pooled_ou...
Python
1
('pointsofsale/<int:pk>/update/', PointOfSaleUpdateView.as_view(), name='pointofsale-update'), path('pointsofsale/<int:pk>/delete/', PointOfSaleDeleteView.as_view(), name='pointofsale-delete'), path('pointsofsale/import/', import_pointofsales, name='pointofsale-import'), path('pointsofsale/export/', export_...
Python
1
GString>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call ffi:gtk_test_init() } //} #[doc(alias = "gtk_test_register_all_types")] pub fn test_register_all_types() { assert_initialized_main_thread!(); unsafe { ffi::gtk_test_register_all_types(); } } #[doc(...
Rust
0
/ Too many generations happened, make sure the writers give the poor node a break for // a while so they don't observe the generation wrapping around. node.start_cooldown(); self.node.take(); } gen } /// Confirm the helping transaction. /// /// The ge...
Rust
0
A', 'G', 'G'] | &['C', 'G', 'A'] | &['C', 'G', 'C'] | &['C', 'G', 'G'] | &['C', 'G', 'U'] => 'R', &['A', 'G', 'C'] | &['A', 'G', 'U'] | &['U', 'C', 'A'] | &['U', 'C', 'C'] | &['U', 'C', 'G'] | &['U', ...
Rust
0
if options.setup_ca: if not options.external_cert_files and options.external_ca: # stage 1 of external CA installation cache_vars = {n: options.__dict__[n] for o, n in options.knobs() if n in options.__dict__} write_cache(cache_vars) try: ...
Python
1
wrap(); } IndexType::ART => { let mut test_bench = TestBench { index: ArtRaw::new(), initial_cnt: 50_000_000, }; let result = shumai::run(&mut test_bench, c, repeat); result.write_json().unwra...
Rust
0
: u16, /// #[nom(BigEndian)] // Field c will always be parsed as BigEndian /// c: u16 /// } /// /// # let input = b"\x00\x00\x00\x01\x12\x34\x56\x78"; /// let res = MixedEndianStruct::parse(input, Endianness::Big); /// # assert_eq!(res, Ok((&input[8..], /// # MixedEndianStruct{a:0x1,b:0x1234,c:0x5678})) /// # )...
Rust
0
mple /// /// ``` /// # use slibc::{Inet6Addr, Inet6SockAddr}; /// let addr = Inet6SockAddr::new(Inet6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 80, 0, 0); /// assert_eq!("[::1]:80".parse(), Ok(addr)); /// ``` #[derive(Copy, Clone)] pub struct Inet6SockAddr(libc::sockaddr_in6); // INVARIANTS: // - self.0.sin6_family == libc::A...
Rust
0
od2.info.version)) .then_with(|| release1.version.cmp(&release2.version))) .collect(); if !to_upgrade.is_empty() { println!(); println!("The following mods will be upgraded:"); for (installed_mod, release) in to_upgrade { println!(" {} {} -> {}", installed_mod.info.name, installed_mod.info.ve...
Rust
0
heck, status in category.items(): if check != 'compliance_score': total_checks += 1 if status == 'PASS': passed_checks += 1 if total_checks > 0: checklist['compliance_score'] = round((passed_checks / tot...
Python
1
"人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单...
Python
1
""" 人提出请求,机器人完成任务 1. 做咖啡(固定动画):接收到做咖啡指令、走到咖啡机、拿杯子、操作咖啡机、取杯子、送到客人桌子上 2. 倒水 3. 夹点心 具体描述:设计一套点单规则(如菜单包含咖啡、水、点心等),按照规则拟造随机的订单。在收到订单后,通过大模型让机器人输出合理的备餐计划,并尝试在模拟环境中按照这个规划实现任务。 """ # todo: 接收点单信息,大模型生成任务规划 from robowaiter.scene.scene import Scene from robowaiter.behavior_lib._base.Behavior import Bahavior class SceneOT(Sce...
Python
1
eInfo, QueryResponse, Response, StdError, }; use provwasm_std::{ bind_name, write_scope, NameBinding, ProvenanceMsg, ProvenanceQuerier, ProvenanceQuery, Record, Records, Scope, Sessions, }; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InitMsg, QueryMsg}; use crate::state::{config, State};...
Rust
0
Type::ApplyMerge}) } else { Ok(RebaseInfo {branch: Some(branch), step: step, total: total, rebase_type: RebaseType::ApplyMergeRebase}) } } else { Err(git2::Error::from_str("HEAD")) } } fn read_file_git_error(p: &Path) -> Result<String, git2::Error> { match read_file(p) {...
Rust
0
Framesetter(CTFramesetter); #[derive(Debug, Clone)] pub(crate) struct Frame { frame: CTFrame, lines: Rc<[Line]>, } #[derive(Debug, Clone)] pub(crate) struct Line(CTLine); #[derive(Debug, Clone)] pub(crate) struct FontCollection(CTFontCollection); pub enum __CTParagraphStyle {} type CTParagraphStyleRef = *con...
Rust
0
from xtuner.chat.utils import GenerationConfig from xtuner.utils import DEFAULT_IMAGE_TOKEN from .base import BaseChat class LlavaChat(BaseChat): def __init__(self, bot, image, bot_name=None, chat_template=None, system_template=...
Python
1
def add_dots(not_dotted): dotted_word = "" for letter in not_dotted[:len(not_dotted)]: letter += "." dotted_word = dotted_word + letter return dotted_word print(add_dots("testtest")) def remove_dots(dotted_word): not_dotted = "" for letter in dotted_word: if letter == ".": ...
Python
1
e == "valuables": data = get_valuable(page) if data: content = ( f"💎 <b>{data['name']}</b>\n" f"💸 <i>Цена:</i> {data['value']}\n" f"📏 <i>Размер:</i> {data['size']}\n" f"⚖️ <i>Вес:</i> {data['mass']...
Python
1