text string | label_name string | labels int64 |
|---|---|---|
n_bytes, receive_buffer_size_in_bytes)?;
this.set_internet_protocol_server_listener_socket_options();
this.bind_internet_protocol_version_6_socket(socket_address)?;
Ok(DatagramServerListenerSocketFileDescriptor(this))
}
/// Creates a new instance of a User Datagram Protocol (UDP) socket over Internet Protocol ... | Rust | 0 |
int-fish-setup")
.help("Prints fish completion code.")
)
.option(
Opt::new("<PROJECT_NAME>")
.long("print-path")
.help("Print project path on stdout.")
)
.option(
Opt::new("<OPTIONS>")
.long("print-zsh-setup")
.help("Print zsh completion code.")
)
... | Rust | 0 |
(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_imports)]
include!(concat!(env!("OUT_DIR"), "/throttle_test.rs"));
extern crate quickcheck;
extern crate rand;
use quickcheck::{QuickCheck, TestResult, Arbitrary, StdGen, Gen};
use rand::Rng;
extern "C"... | Rust | 0 |
).abs() < 1e-12);
assert!((res.v1[1] - 0.255891862958350).abs() < 1e-12);
assert!((res.v2[(0, 0)] - -0.365498208944163).abs() < 1e-12);
assert!((res.v2[(0, 1)] - -0.365498208944163).abs() < 1e-12);
assert!((res.v2[(1, 0)] - -0.365498208944163).abs() < 1e-12);
assert!((res.v2[(1, 1)] - -0.36549820894... | Rust | 0 |
import os
from celery import Celery
from dotenv import load_dotenv
load_dotenv()
celery_app = Celery(__name__, broker=os.getenv("CELERY_BROKER_URL"), backend=os.getenv("CELERY_RESULT_BACKEND"))
celery_app.conf.update(
imports=['tasks.celery_tasks'],
broker_connection_retry_on_startup=True,
task_track_sta... | Python | 1 |
,
PublicKey::new(ACCOUNT_1_ADDR),
)
.commit()
.expect_success();
}
#[ignore]
#[test]
fn should_run_get_caller_subcall_contract() {
WasmTestBuilder::default()
.run_genesis(GENESIS_ADDR, HashMap::new())
.exec_with_args(
GENESIS_ADDR,
"get_ca... | Rust | 0 |
# set_store_predicate设置了store的条件,适用于在多线程调度中预防写操作之间的冲突。
import tvm
from tvm import te
n = 1024
A = te.placeholder((n,), name='A')
k = te.reduce_axis((0, n), 'k')
B = te.compute((1,), lambda i: te.sum(A[k], axis=k), name='B')
s = te.create_schedule(B.op)
ko, ki = s[B].split(B.op.reduce_axis[0], factor=16)
BF = s.rfact... | Python | 1 |
expected9 = r#"\begin{document}
\textbf{
Hallo!\TeX and \foo{bar1}{bar2{a}{}}; today}
\end{document}
"#;
let mut parser1 = Parser::new(Lexer::new(source1));
let mut parser2 = Parser::new(Lexer::new(source2));
let mut parser3 = Parser::new(Lexer::new(source3));
let mut parser4 = Parser::new(Lexer::... | Rust | 0 |
# Copyright 2019 The FastEstimator 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 appl... | Python | 1 |
2173506824, 1089055278,
1748401123, 2941380082, 968412354, 1818753861, 2973200866,
3875951774, 1119354008, 3988604139, 1647155589, 2232450826,
3486058011, 3655784043, 3759258462, 847163678, 1082052057,
989516446, 2871541755, 3196311070, 3929963078, 658187585,
3664944641, 2175149170, 2203709147, ... | Rust | 0 |
def addition(num1, num2):
return num1 + num2
def subtraction(num1, num2):
return num1 - num2
def multiplication(num1, num2):
return num1 * num2
def division(num1, num2):
return num1 / num2
def rad(num):
return num**(1/2)
def square(num):
return num**2
def quad_form(... | Python | 1 |
, then a Request Error exists.
// The device deals with the Request Error by returning a STALL PID in response
// to the next Data stage transaction or in the Status stage of the message.
// It is preferred that the STALL PID be returned at the next Data stage transaction,
// as this avo... | Rust | 0 |
&mut Response,
ctrl: &mut FlowCtrl,
) -> Result<(), salvo::http::HttpError> {
let permission = {
depot
.get::<Option<i16>>(crate::PERMISSION)
.map(|a| a.map(|b| b == 0))
.flatten()
.unwrap_or_default()
};
if permission {
ctrl.call_next(req,... | Rust | 0 |
Data) };
unsafe {
GetForegroundWindow() == data.hwnd
}
}
fn get_window_minimized(viewport: &mut ImGuiViewport) -> bool {
let data = unsafe { &mut *(viewport.platform_user_data as *mut ViewportData) };
unsafe {
IsIconic(data.hwnd) != 0
}
}
... | Rust | 0 |
"name": path_display, "len": len);
f.write_all(&contents)?;
chunk_complete_callback(len);
}
}
} else {
unreachable!();
}
{
trace_scoped!("close", "name:": path_display);
drop(f);
}
Ok(())
}
pub fn create_dir<P: AsRef<Path>... | Rust | 0 |
_color {
let clear_color: ColorF = clear_color.into();
gl_context.clear_color(clear_color.r, clear_color.g, clear_color.b, clear_color.a);
}
gl_context.clear_depth(0.0);
gl_context.clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT);
// Draw the actual layers
... | Rust | 0 |
import tensorflow as tf
from data.utils import clean_task_instruction, euler_to_rotation_matrix, rotation_matrix_to_ortho6d
def process_step(step: dict) -> dict:
"""
Unify the action format and clean the task instruction.
DO NOT use python list, use tf.TensorArray instead.
"""
# Convert raw acti... | Python | 1 |
-> &FDCAN {
&self.rb
}
}
/// Extension trait for CAN controller
pub trait CanExt: Sized
where
Can<Self>: fdcan::Instance,
{
fn fdcan<TX, RX>(
self,
_tx: TX,
_rx: RX,
prec: rec::Fdcan,
) -> fdcan::FdCan<Can<Self>, fdcan::ConfigMode>
where
TX: sealed::... | Rust | 0 |
RS 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.";
println!("{}", license_text);
}
fn version() {
const VERSION: Option<&'static... | Rust | 0 |
#EXERCÍCIO 70: Crie um programa que leia o nome e o preço de vários produtos. O programa deverá perguntar se o usuário vai continuar ou não. No final, mostre:A) qual é o total gasto na compra.B) quantos produtos custam mais de R$1000.C) qual é o nome do produto mais barato.
print('Cadastro de produtos')
print('~='*15)
... | Python | 1 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
import time
import math
import pyperclip
def calc(x:str) -> str:
return str(math.log(abs(12*math.sin(int(x)))))
try:
br... | Python | 1 |
import cv2
import numpy as np
import tensorflow as tf
import time
from datetime import datetime, timedelta
# Placeholder for vehicle detection model (You should replace this with an actual model)
class VehicleDetector:
def __init__(self):
# Load your pre-trained model here
pass
def detect(self... | Python | 1 |
urn x**5
count = [0]
res = quad_vec(f, 0, 1, norm='max', full_output=True, quadrature=quadrature)
assert res[2].neval == count[0]
def test_info():
def f(x):
return np.ones((3, 2, 1))
res, err, info = quad_vec(f, 0, 1, norm='max', full_output=True)
assert info.success is True
ass... | Python | 1 |
def Buenos_dias (despedida):
def decoradora():
print("Buenos dias")
despedida()
print("hasta luego")
return decoradora()
@Buenos_dias
def saludo():
nombre = input("ingrese su nombre: ")
print(f"Soy {nombre}")
| Python | 1 |
#!/usr/bin/python
import re
import sys
import polib
import localizable
def _deshort(s):
if s.endswith('...'):
s = s.rstrip('...')
if s.endswith(':'):
s = s.rstrip(':')
s = re.sub(r'_([A-Z])', r'\1', s)
return s
def deshortcut(k, v):
k2 = _deshort(k)
if k != k2:
v = _d... | Python | 1 |
eral: char,
}
impl Debug for Character {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?} {}", self.literal, self.name())
}
}
impl Character {
fn name(self) -> &'static str {
let start = self.pos & 0xFF_FF_FF;
let end = start + (self.pos >> 24);
... | Rust | 0 |
"""
Linear interpolation schedule (lerp).
"""
from typing import Tuple, Union
import torch
from enum import Enum
class LinearSchedule:
"""
Linear interpolation schedule (lerp) is proposed by flow matching and rectified flow.
It leads to straighter probability flow theoretically. It is also used by Stable... | Python | 1 |
().is_ok());
assert_eq!(on_off.is_on(), true);
assert_eq!(on_off.is_off(), false);
assert!(on_off.bang().is_ok());
assert_eq!(on_off.is_on(), false);
assert_eq!(on_off.is_off(), true);
assert!(on_off.bang().is_ok());
assert_eq!(on_off.is_on(), true);
assert_eq!(on_off.is_off(), false);... | Rust | 0 |
}
}
/// Gets the [`BaseDirectory`] associated with the given variable, or [`None`] if the variable doesn't match any.
pub fn from_variable(variable: &str) -> Option<Self> {
let res = match variable {
"$AUDIO" => Self::Audio,
"$CACHE" => Self::Cache,
"$CONFIG" => Self::Config,
"$D... | Rust | 0 |
hhr_hit(lines[block_starts[i] : block_starts[i + 1]])
)
return hits
def parse_e_values_from_tblout(tblout: str) -> Dict[str, float]:
"""Parse target to e-value mapping parsed from Jackhmmer tblout string."""
e_values = {"query": 0}
lines = [line for line in tblout.splitlines() if line[0] !... | Python | 1 |
# encoding: utf-8
"""A fancy version of Python's builtin :func:`dir` function.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import inspect
import types
def safe_hasattr(obj, attr):
"""In recent versions of Python, hasattr() only catches AttributeError.... | Python | 1 |
# Copyright (c) 2008 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | Python | 1 |
t_helpMODULE_EXAMPLES)rD argskwargss r rN zTestProgram._print_helpu sx ;;$##//12-64=="99:""--/$##//12/VT]]$;;<r c | j | j vt | dkD r+|d j dk( ... | Python | 1 |
import asyncio
import json
import os
from datetime import datetime, timezone
from dotenv import load_dotenv
import logging
from hn_fetcher import HNFetcher
from content_fetcher import ContentFetcher
from summarizer import Summarizer
load_dotenv()
async def main():
logging.basicConfig(level=logging.INFO)
logg... | Python | 1 |
.bindings.clone();
bindings.push_front(new_binding);
TypeEnv { bindings }
}
/// Returns a new environment extended with the provided bindings.
pub fn add_bindings(&self, new_bindings: Vector<(String, Type)>) -> TypeEnv {
let mut bindings = self.bindings.clone();
for binding ... | Rust | 0 |
ter import Deployment
# Create a mock router
mock_router = Mock()
# Setup mock to not find by model_id but find by model_name
mock_router.get_deployment.return_value = None
mock_router.get_model_list.return_value = [
{
"model_name": "gpt-3.5-turbo",
"litellm_params"... | Python | 1 |
partition_key =
StringArray::from_iter(chunks.iter().map(|c| Some(c.partition_key.as_ref())));
let table_name = StringArray::from_iter(chunks.iter().map(|c| Some(c.table_name.as_ref())));
let storage = StringArray::from_iter(chunks.iter().map(|c| Some(c.storage.as_str())));
let estimated_bytes =
... | Rust | 0 |
from mediawords.db import connect_to_db
from mediawords.dbi.downloads.store import get_content_for_first_download
from mediawords.test.db.create import create_test_topic, create_test_medium, create_test_feed, create_test_story
# noinspection PyProtectedMember
from topics_fetch_twitter_urls.fetch_twitter_urls import _a... | Python | 1 |
in &FOUR_NEIGHBOURS {
if field.get_edge(LP::of_vertex(pos) + d) == Edge::Line {
fill_line_id(pos + d, field, ids, id);
}
}
}<filename>northstar/src/seccomp/bpf.rs
use crate::{
common::non_null_string::NonNullString,
seccomp::{profiles::default, Profile, SyscallArgRule, SyscallRu... | Rust | 0 |
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
j=1
for i in range(1,len(nums)):
if nums[i]!=nums[i-1]:
nums[j]=nums[i]
j+=1
return j
| Python | 1 |
ist(&mut self, i: &mut TokenIterator, t0: &Token, terminator: Symbol)
-> ResultAST
{
let mut v: Vec<Rc<AST>> = Vec::new();
let mut selfarg = false;
let mut variadic = false;
let p = i.next_token(self)?;
let t = &p[i.index];
if t.value == terminator {
i.index += 1;
} else {
lo... | Rust | 0 |
over all points that are directly adjacent to a given point. It
/// will yield one point for each cardinal direction:
///
/// * Right
/// * Down
/// * Left
/// * Up
pub struct AdjacentIter {
starting_point: Point,
position: usize,
}
impl AdjacentIter {
pub fn new(starting_point: Point) -> Self {
... | Rust | 0 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.10 (default, Feb 6 2017, 23:53:20)
# [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
# Embedded file name: __init__.py
MCL_OS_ARCH_I386 = 0
MCL_OS_ARCH_SPARC = 1
MCL_OS_ARCH_ALPHA = 2
MCL_OS_ARCH_ARM = 3
MCL_OS_ARCH_PPC =... | Python | 1 |
import argparse
import os
import re
import numpy as np
import pandas as pd
if __name__=='__main__':
parser = argparse.ArgumentParser(description='label_BUSI.py')
parser.add_argument('--directory', type=str, help='Directory where encoded images are saved', required=True)
args = parser.parse_args()
file_... | Python | 1 |
particle.calculate_dilated_time(global_time.dt, global_time)
return cesium_atoms, intrinsic_times, global_time.time_flow_rates, [p.dilated_times for p in particles]
def print_and_plot_results(use_ath, cesium_atoms, intrinsic_times, time_flow_rates, dilated_times):
# Identifying the simulation type
sim_... | Python | 1 |
store
);
let addr1 = CUBEApiUrl::from_str("https://one.example.com/api/v1/").unwrap();
assert!(config.remove(&addr1, None));
assert!(!config.remove(&addr1, None), "login already removed");
assert!(config.get_cube(Some(&addr1), None).is_none());
let addr2 = CUBEApiUrl::f... | Rust | 0 |
e.init(&exe, &Default::default());
assert_eq!(e.get_state(), State::Running);
assert_eq!(e.execute_cycles(u64::MAX).1, StopReason::ForfeitTimeslot);
assert_eq!(e.cpu.get_rax(), 0);
// return from main()
assert_eq!(e.execute_cycles(u64::MAX).1, StopReason::Terminated(-1));
}
#[test]
fn test_abo... | Rust | 0 |
ed successfully, False otherwise
"""
try:
# Validate report
if not isinstance(report, dict) or not report:
logger.error("Invalid report: must be a non-empty dictionary")
return False
reference_id = report.get("reference_id")
if not reference_id:
... | Python | 1 |
#!/usr/bin/env python
"""
Created by howie.hu at 08/04/2018.
"""
import asyncio
import sys
import time
sys.path.append('../../')
from hproxy.database import DatabaseSetting
from hproxy.utils import logger
from hproxy.spider.proxy_tools import get_proxy_info
db_client = DatabaseSetting()
async def valid_proxies():... | Python | 1 |
std::process::exit(1);
}
}
macro_rules! fail_immediate {
($($t:tt)*) => {{
println!($($t)*);
_task_failed!();
}}
}
let (config, artifact_path, toolchain_paths) = match &options.sub_command {
Subcommand::Init { project_root, output_type } => {
... | Rust | 0 |
# -*-coding:utf-8-*-
# @auth ivan
# @time 20191119 14:55:32
# @goal test
"""
T2019_600.json
[{"x": 22890, "y": 3877, "w": 396, "h": 255,"p": 0.94135},
{"x": 20411, "y": 2260, "w": 8495, "h": 7683,"p": 0.67213},
{"x": 26583, "y": 7937, "w": 172, "h": 128,"p": 0.73228},
{"x": 2594, "y": 18627, "w": 1296, "h": 1867,"... | Python | 1 |
tests above
assert_eq!(
enddate(""),
Err(nom::Err::Error(nom::error::Error {
input: "",
code: ErrorKind::Eof
}))
);
assert_eq!(
enddate("20210920T000000F"),
IResult::Ok((
"F",
... | Rust | 0 |
ams:
https://web.cecs.pdx.edu/~markem/CS333/exams/Final%202019-01.pdf
<NAME>
http://web.cecs.pdx.edu/~bart/
Rust textbook:
<NAME>., & <NAME>. (2018). Programming Rust: Fast, safe systems development. Sebastopol: OReilly Media.
Rocket Crate examples and project:
https://github.com/SergioBe... | Rust | 0 |
from django.db import models
from django.conf import settings
class Group(models.Model):
name = models.CharField(max_length=100)
# Memberships handled via GroupMembership
class GroupMembership(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
group = models.F... | Python | 1 |
ss.into(),
};
let result: cw20::BalanceResponse =
app.wrap().query_wasm_smart(contract_addr, &msg).unwrap();
result.balance
}
fn instantiate_cw20(app: &mut App, initial_balances: Vec<Cw20Coin>) -> Addr {
let cw20_id = app.store_code(contract_cw20());
let msg ... | Rust | 0 |
content_stripped.endswith('```'):
content = content_stripped[11:-3].strip()
cleaned = True
try:
current_app.logger.info("✅ 检测到```markdown代码块格式,已自动提取内容")
except RuntimeError:
print("✅ 检测到```markdown代码块格式,已自动提取内容")
#... | Python | 1 |
) => return Err(SearchError::from(err)),
};
debug!("requesting control schema from: {}", uri);
let client = Client::new();
let resp = hyper::body::to_bytes(client.get(uri).await?.into_body())
.map_err(SearchError::from)
.await?;
debug!("handling schema response from: {}", addr);
... | Rust | 0 |
ircles and degrees.
pub fn semicircles_to_degrees(semicircles: i32) -> f64 {
let degrees = (semicircles as f64) * 0.000000083819032; // (180.0 / f64::powf(2.0, 31.0));
degrees
}
// Auto-generated by print_message_struct in lib.rs
pub struct FitFileIdMsg {
pub manufacturer: Option<u8>,
pub serial_number... | Rust | 0 |
ntized inference performance will be limited"
)
cpu_provider = FrameworkInferenceProviderInfo(
name="cpu",
description=(
"Performant CPU provider within DeepSparse specializing in speedup of "
"sparsified models using AVX and VNNI instruction sets"
),
... | Python | 1 |
import torch.nn as nn
from models.seg_net.encoders.res2net_encoder import res2net_Encoder
from models.seg_net.decoders.attn_decoders import att_Decoder
class Seg_Net(nn.Module):
def __init__(self,):
""""""
super().__init__()
self.encoder = res2net_Encoder(pretrained=True)
self.deco... | Python | 1 |
distancia = float(input("Digite a distância percorrida em quilômetros: "))
tipoCarro = input("Digite o tipo do carro (A, B ou C): ")
if tipoCarro == "A":
consumoMedio = distancia / 8
print(f"A média estimada de consumo de combustível é de {consumoMedio:.2f} litros.")
elif tipoCarro == "B":
consumoMedio = ... | Python | 1 |
nfig.update({argname: self.args[argname]})
if logfun:
logger.info(logstring.format(logfun(config[argname])))
else:
logger.info(logstring.format(config[argname]))
if deprecated_msg:
warnings.warn(f"DEPRECATED: {deprecated_msg}", Deprecat... | Python | 1 |
ern("\\p{Script=Greek}", true),
Ok(())
);
assert_eq!(validator.validate_pattern("\\p{Alphabetic}", true), Ok(()));
assert_ne!(validator.validate_pattern("\\", false), Ok(()));
assert_ne!(validator.validate_pattern("a**", false), Ok(()));
assert_ne!(validator.validate_pattern("++a", false), Ok... | Rust | 0 |
UnixStream) -> UnixStream {
let mio_stream = mio_uds::UnixStream::from_stream(stream).unwrap();
UnixStream {
raw_fd: mio_stream.as_raw_fd(),
io_handle: IoHandle::new(mio_stream),
}
}
}
impl AsRawFd for UnixStream {
fn as_raw_fd(&self) -> RawFd {
self.raw_... | Rust | 0 |
mut PacketReader,
manifest: &Manifest<P>,
owned_entity: LocalEntity,
replica_kind: P::Kind,
) -> bool {
let new_command = manifest.create_replica(replica_kind, reader, 0);
if let Some(server_tick) = server_tick_opt {
if sequence_greater_than(client_tick, server_t... | Rust | 0 |
= kani::any();
if x < u32::MAX >> 1 {
let y = x * 2;
assert!(y % 2 == 0);
assert!(y % 2 != 3);
}
}
use std::fs::{File, create_dir_all};
use std::io::{prelude::*};
use std::collections::HashMap;
use std::path::Path;
use chrono::NaiveDateTime;
use chrono::format::ParseError;
const TRANS... | Rust | 0 |
n1 = ['','One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten']
n2 = ['','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen']
n3 = ['Twenty','Thirty','Forty','Fifty','Sixty','Seventy','Eighty','Ninety','Hundred']
n4 = ['Thousand']
n = int(input("Enter a number b... | Python | 1 |
# method 1
sum_prime = 0
sum_non_prime = 0
is_prime = 0
while True:
command = input()
if command == 'stop':
break
current_number = int(command)
if current_number < 0:
print('Number is negative.')
continue
for number in range(1, current_number + 1):
if current_number ... | Python | 1 |
doc = "0x20 - Counter Top Value Buffer Register"]
pub topb: TOPB,
#[doc = "0x24 - Counter Value Register"]
pub cnt: CNT,
_reserved10: [u8; 4usize],
#[doc = "0x2c - TIMER Configuration Lock Register"]
pub lock: LOCK,
#[doc = "0x30 - I/O Routing Pin Enable Register"]
pub routepen: ROUTEPEN... | Rust | 0 |
pnCustomTextBox
VpnDomainNameAssignment = _ns_module.VpnDomainNameAssignment
VpnDomainNameInfo = _ns_module.VpnDomainNameInfo
VpnForegroundActivatedEventArgs = _ns_module.VpnForegroundActivatedEventArgs
VpnForegroundActivationOperation = _ns_module.VpnForegroundActivationOperation
VpnInterfaceId = _ns_module.VpnInterfa... | Python | 1 |
Ok(())
}
#[allow(unused_mut)]
pub fn serialize_structure_crate_model_phase2_dh_group_numbers_request_list_value(
mut writer: aws_smithy_query::QueryValueWriter,
input: &crate::model::Phase2DhGroupNumbersRequestListValue,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
#[allow(unused_m... | Rust | 0 |
0,
max_x: 0.05,
max_y: 10.0,
max_z: 0.05,
})),
material: materials.add(StandardMaterial {
base_color: Color::hex("5d9900").unwrap(),
unlit: true,
..default()
}),
transform: Tra... | Rust | 0 |
alue": [con]
}
}
run_kwargs["grd_keyword_retriever_demo"] = { # type: ignore
"query": content4retrieval_grd_demo,
"top_k": 1,
"filters": {
"field": "meta.label",
... | Python | 1 |
nformation in 2023")
print("2. View team information in 2023")
print("3. Logout")
choice = input("Please input the option number: ")
if choice == "1":
view_current_team_player(username)
elif choice == "2":
view_current_team_info(username)
elif choi... | Python | 1 |
bour_indices(&self, x: usize, y: usize) -> Vec<(usize, usize)> {
let row_above = ((self.edge_size - 1) + y) % self.edge_size;
let row_below = (y + 1) % self.edge_size;
let column_to_the_left = ((self.edge_size - 1) + x) % self.edge_size;
let column_to_the_right = (x + 1) % self.edge_size... | Rust | 0 |
import unittest
from benedict.core import standardize as _standardize
class standardize_test_case(unittest.TestCase):
"""
This class describes a standardize test case.
"""
def test_standardize(self) -> None:
d = {
"CamelCase": 1,
"CamelCamelCase": 1,
"Came... | Python | 1 |
elf) -> I
where I: Integral {
self.as_bitslice().load_le()
}
#[inline(always)]
fn load_be<I>(&self) -> I
where I: Integral {
self.as_bitslice().load_be()
}
#[inline(always)]
fn store_le<I>(&mut self, value: I)
where I: Integral {
self.as_mut_bitslice().store_le(value)
}
#[inline(always)]
fn store_b... | Rust | 0 |
P) -> Vec<String>
where
P: AsRef<Path>,
{
let file = File::open(filename).expect("Cannot open file");
let buf = io::BufReader::new(file);
buf.lines()
.map(|l| l.expect("Cannot parse string").trim().to_string())
.collect()
}
fn do_flash(matrix: &mut Vec<Vec<u8>>, x: usize, y: usize) {
... | Rust | 0 |
fn next_id() -> ast::node_id {
ret parse::next_node_id(self.parse_sess);
}
}
let imp : ctxt_repr = {
parse_sess: parse_sess,
cfg: cfg,
mut backtrace: none,
mut mod_path: ~[]
};
ret imp as ext_ctxt
}
fn expr_to_str(cx: ext_ctxt, expr: @ast::expr, e... | Rust | 0 |
avail {
return;
} /* Postprocessor exactly filled output buf */
(*main_ptr).context_state = 0 as libc::c_int;
if *out_row_ctr >= out_rows_avail {
return;
}
current_block_26 = 10531413684724535507;
}
0 => {
... | Rust | 0 |
from map import Map
from utils.config import Config
from objects import *
from user import User, UserSwitcher
if __name__ == '__main__':
# Create users
UserManager = UserSwitcher()
murat = User('muratbay61')
arda = User('ardabak16')
UserManager.add_user(murat)
UserManager.add_user(arda)
# ... | Python | 1 |
from flask import jsonify
from webargs.flaskparser import use_args
from crime_data.extensions import DEFAULT_MAX_AGE
from flask.ext.cachecontrol import cache
from marshmallow import fields
from crime_data.common import cdemodels, marshmallow_schemas, models
from crime_data.common.base import CdeResource, tuning_page
... | Python | 1 |
# Copyright (c) 2023, Sowaan and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.utils import date_diff
class LoanSkipInstalment(Document):
def validate(doc):
doc.repayment_dates.clear()
loan = frappe.get_doc("Loa... | Python | 1 |
_list_answers(path);
return get_answers(list);
}
pub fn compute2() -> u32 {
let path = "data/6th_day/input.txt";
let list = get_list_same_answers(path);
return get_answers(list);
}
fn get_answers(list: Vec<u32>) -> u32 {
let mut answers = 0;
for i in 0..list.len() {
answers += list[i];
}
return an... | Rust | 0 |
_WM_STATE_REMOVE
Add = 1, // _NET_WM_STATE_ADD
Toggle = 2, // _NET_WM_STATE_TOGGLE
}
impl From<bool> for StateOperation {
fn from(op: bool) -> Self {
if op {
StateOperation::Add
} else {
StateOperation::Remove
}
}
}
/// X window type. Maps directly to... | Rust | 0 |
if media_config['common'].get(unique_key):
media_config['common'][unique_key] = st.text_area('如果有人发消息, 根据最后5条对话内容作为参考, 回复对方', value=media_config['common'].get(unique_key, ''), key=f'{media_name}_common_{unique_key}_{index}')
new_media_configs.append(media_config)
st.session_state.media_config... | Python | 1 |
from atlassian import Jira, Confluence
from datetime import datetime as dt
import os
import sys
import argparse
## Handle arguments parsing for incoming service now change number.
parser = argparse.ArgumentParser(description='Get change number process.')
parser.add_argument('--change_number', type=str, help='The c... | Python | 1 |
ensorsr r r rF rX )r r r r/ s r; _sum_tensors_uint8r _ :=c:K
1$ %'F
(F;;vq#&))%++66r: c [ R " U 5 R 5 nSn[ R " X!R S9n... | Python | 1 |
# Taken from:
# https://github.com/WongKinYiu/yolov7/blob/HEAD/models/common.py
# The file is modified by Deeplite Inc. from the original implementation on Nov 29, 2022
# Refactoring (subset from the aforemnetioned source file)
import torch
from torch import nn
from deeplite_torch_zoo.src.dnn_blocks.common import Con... | Python | 1 |
from tkinter import*
scl=Tk()
scl.title=("SCHOOL")
scl.geometry=("500x500")
scl.state("zoomed")
def login():
name=(box1.get())
year=(box2.get())
group=(box3.get())
Tenthmark=str(box4.get())
if(Tenthmark>="450"):
print("YOUR ELIGIBLE IN FIRST GROUP")
elif(Tenthmark>"380") and (Tenthma... | Python | 1 |
import numpy as np
import pandas as pd
import pickle
import logging
from collections import Counter
# for site_id, site_domain, app_id, app_domain, device_model,
# device_ip, device_id fields,C14,C17,C19,C21, one-hot using frequency
# for other fields, one-hot-encoding directly
# one-hot encoding directly
click = set... | Python | 1 |
do_dump(
&mut x_val_28 as *mut i32 as *mut i8,
::std::mem::size_of::<i32>() as u64,
1i32 as size_t,
fmt_out,
);
let mut x_val_29: i32 = *hyph_word.offset(k as isize);
do_dump(
&mut x_val_29 a... | Rust | 0 |
web = {
"name": "petanikode",
"url": "https://www.petanikode.com",
"rank": "5"
}
for key, val in web.items():
print("%s : %s" % (key, val)) | Python | 1 |
#from IPython.display import display
import pandas as pd
import numpy as np
import requests
import time
# 台新銀行爬蟲
def taishinbank(name=None):
url ="https://www.taishinbank.com.tw/TS/TS06/TS0605/TS060502/index.htm?urlPath1=TS02&urlPath2=TS0202"
df = pd.read_html(url)[11]
df = df.drop([0])
df.columns=['幣... | Python | 1 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import unittest
import copy
import torch
# import modules to to register feature extractors
from paa_core.modeling.backbone import build_backbone # NoQA
from paa_core.modeling.roi_heads.roi_heads import build_roi_heads # NoQA
from paa_core.modelin... | Python | 1 |
, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35}
DEFINE_GUID! {GUID_Friction,
0x13541c2a, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35}
DEFINE_GUID! {GUID_CustomForce,
0x13541c2b, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35}
<filename>bee-crypto/src/ternary/bigint/t243/mod.rs<gh_st... | Rust | 0 |
llback and hasattr(self.node_executor, 'set_progress_callback'):
self.node_executor.set_progress_callback(progress_callback)
# 初始化状态
state = AgentState(
session_id=session_id,
raw_md=raw_md,
ppt_template_path=ppt_templa... | Python | 1 |
_addr: NULL,
base_size: 0,
entry_point: NULL,
base_contents: Box::new(Vec::new()),
};
if success == FALSE {
return None;
}
// Read process name
let mut raw_name: Vec<i8> = vec![0; MAX_PATH];
... | Rust | 0 |
mut lock, _) = self.cvar.wait_timeout_ms(lock, timeout).unwrap();
lock.try_unwrap()
}
fn unwrap(&self) -> Vec<T> {
let mut lock = self.inner.lock().unwrap();
loop {
if let Some(data) = lock.try_unwrap() {
return data;
}
lock = self.c... | Rust | 0 |
pub use views::view::Buffers;
pub use notify::{RecommendedWatcher, DebouncedEvent};
pub use std::ops::Deref;
lazy_static! {
/// Vertex shader compiled at build and loaded lazily
pub static ref VERT_SHADER: Vec<u32> = {
let bytes = include_bytes!("../../shaders/vertices.vert.spv");
let mut rs = vec![0; bytes.len(... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.