text string | label_name string | labels int64 |
|---|---|---|
import hashlib
import os
import random
from sympy import nextprime
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def modinv(a, m):
m0, x0, x1 = m, 0, 1
if m == 1:
return 0
while a > 1:
q = a // m
m, a = a % m, m
x0, x1 = x1 - q * x0, x0
if x1 < 0... | Python | 1 |
_err();
assert_eq!(e.as_fail().to_string(), "unable to parse: {\"field\": 42");
assert!(e
.as_fail()
.cause()
.unwrap()
.downcast_ref::<serde_json::Error>()
.is_some());
}
use std::cmp::min;
/// Calculates the suffix array for a given text in `O(n^2 log n)` runtime.
///
... | Rust | 0 |
h,
NoPosHash,
Ord,
PartialEq,
PartialOrd,
Serialize,
ToOcamlRep
)]
pub struct Enum_ {
pub base: Hint,
pub constraint: Option<Hint>,
pub includes: Vec<Hint>,
pub enum_class: bool,
}
#[derive(
Clone,
Debug,
Deserialize,
Eq,
FromOcamlRep,
Hash,
NoPosHash... | Rust | 0 |
# the example is taken from https://fresnel.readthedocs.io/en/stable/examples/00-Basic-tutorials/00-Introduction.html
# image display is altered to use PIL
## generate image
import fresnel
scene = fresnel.Scene()
geometry = fresnel.geometry.Sphere(scene, N=8, radius=1.0)
geometry.position[:] = [[1,1,1],
... | Python | 1 |
, play_type: PlayType, play_from_top: bool) -> Result<()> {
unsafe {
dx_PlaySoundMem(self.handle, play_type as i32, play_from_top as i32).ensure_zero()
}
}
pub fn is_playing(&self) -> Result<bool> {
match unsafe { dx_CheckSoundMem(self.handle) } {
1 => Ok(true),
... | Rust | 0 |
if is_file {
// If a file is already required, short circuit.
if interp.0.borrow().vfs.is_required(path.as_path()) {
return Ok(interp.convert(false));
}
let context = Context::new(ffi::os_str_to_bytes(path.as_os_str())?.to_vec())
... | Rust | 0 |
#!/usr/bin/python
###############################################################################
#
# SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal.
#
# Copyright (C) 2014, William Stein
#
# This program is free software: you can redistribute it and/or modify
# it ... | Python | 1 |
_frame.width(), src_frame.height());
let mut dst = utils::frame_to_mat(&mut out);
photo::fast_nl_means_denoising_colored(&src, &mut dst, 3.0, 3.0, 7, 3)?;
Ok(out)
}
#[allow(dead_code)]
pub fn pixelate(src_frame: &Video, k: i32) -> Result<Video, Box<dyn Error>> {
let src = utils::frame_to_mat(src_fram... | Rust | 0 |
RNING: You probably don\'t mean to use the color value yellow in interpolation here.\
\nIt may end up represented as #ff0, which will likely produce invalid CSS.\
\nAlways quote color names when using them as strings or map keys (for example, \"yellow\").\
\nIf you really want to use the colo... | Rust | 0 |
the event a bad arg is passed
fn usage() -> ! {
let program_name = env::args().next().unwrap_or_else(|| "program".to_string());
eprintln!(
r"Usage: {}
--data-store-base-path PATH
[ --version X.Y.Z ]
[ --log-level trace|debug|info|warn|error ]
If --version is... | Rust | 0 |
#
# Copyright 2014 James Kermode (Warwick U.)
#
# matscipy - Materials science with Python at the atomic-scale
# https://github.com/libAtoms/matscipy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | Python | 1 |
ut = hex::decode(vector[0]).unwrap();
let output = hex::decode(vector[1]).unwrap();
let point = EdwardsPoint::hash_from_bytes::<sha2::Sha512>(&input);
assert_eq!(point.compress().to_bytes(), output[..]);
}
}
}
<reponame>Skareeg/ProcFlow<gh_stars>1-10
use crate::catalogue... | Rust | 0 |
(0, 1, 0),
(0, 0, 1),
(1, 1, 0),
(0, 1, 1),
(1, 0, 1),
(1, 1, 1),
]
n = 1 << 7
so_far = [[0, 0, 0]]
while True:
if n == 0: # This happens after 2**24 colours; presumably, never
yield "#000000" # black
copy_so_far = list(so_far)
... | Python | 1 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
# from fastapi.staticfiles import StaticFiles
# from fastapi.templating import Jinja2Templates
# Routers
from app.routes.teachers import router as teachers_router
from app.routes.classes import router as classes_router
from app.routes.subje... | Python | 1 |
ql: "CREATE DATABASE db1",
expect: "Create database db1, engine: Remote, if_not_exists:false, option: {}",
error: "",
},
Test {
name: "create-database-if-not-exists-passed",
sql: "CREATE DATABASE IF NOT EXISTS db1",
expect: "Create database db1... | Rust | 0 |
l="x", pady=(0, 8))
for col in range(4):
ticket_frame.columnconfigure(col, weight=1 if col in (1, 3) else 0)
ttk.Label(ticket_frame, text="关键词").grid(row=0, column=0, sticky="w", pady=2)
keyword_entry = ttk.Entry(ticket_frame, textvariable=self.app_form_vars["keyword"], width=24... | Python | 1 |
R_EOI_BCAST_SUPPRESSION: usize = 12;
pub const SIVR_FOCUS_PROCESSOR_CHECKING: usize = 9;
pub const SIVR_APIC_SOFTWARE_ENABLE: usize = 8;
pub const SIVR_VECTOR: Range<usize> = 0..8;
pub const ICR_DESTINATION: Range<usize> = 32..64;
pub const ICR_DEST_SHORTHAND: Range<usize> = 18..20;
pub const ICR_TRIGGER_MODE: usize =... | Rust | 0 |
_name": s.split("/")[-1], "url": s}
elif Path(s).exists():
return {**data, "orig_name": Path(s).name}
else:
raise ValueError(
f"File {s} does not exist on local filesystem and is not a valid URL."
)
def file(filepath_or_url: str | Path):
warnings.warn(
"file() i... | Python | 1 |
anch<E>,
pub target_intermediate: OperationBranch<E>,
pub target_after: OperationBranch<E>,
pub args: OperationArguments<E>,
pub before_root: Option<E::Fr>,
pub intermediate_root: Option<E::Fr>,
pub after_root: Option<E::Fr>,
pub tx_type: Option<E::Fr>,
}
impl Witness for ForcedExitWitness<... | Rust | 0 |
`"]
#[inline]
pub fn is_0000(&self) -> bool {
*self == SUBFAMIDR::_0000
}
#[doc = "Checks if the value of the field is `_0001`"]
#[inline]
pub fn is_0001(&self) -> bool {
*self == SUBFAMIDR::_0001
}
#[doc = "Checks if the value of the field is `_0010`"]
#[inline]
... | Rust | 0 |
og::trace!("font {:?} loaded at index `{:?}`", font.name, ix);
Ok(FontHandle { ix })
}
}
// --------------------------------------------------------------------------------
// Immediate-mode rendering procedures
/// Sets a text quad
#[inline]
pub fn set_text_quad(q: &mut QuadData, fons_quad: &FonsQuad, b... | Rust | 0 |
format: bottom left */
if i + 8 >= size && j < 9 {
return 1;
}
/* Finder + format: top right */
if i < 9 && j + 8 >= size {
return 1;
}
/* Exclude timing patterns */
if i == 6 || j == 6 {
return 1;
}
/* Exclude version info, if it exists. Version info sits ad... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: DaMall商城系统sql注入
referer: http://www.wooyun.org/bugs/wooyun-2015-0115170
author: Lucifer
description: DaMall CMS文件selloffer.html?key参数存在搜索型SQL注入漏洞,可获取敏感信息。
'''
import sys
import requests
class damall_selloffer_sqli_BaseVerify:
def __init__(self, url):
... | Python | 1 |
on.
BadCpuIsa,
/// A bad parameter was supplied
BadParam,
/// The block size is out of range of the supported sizes.
BadBlockSize,
/// The supplied profile is unsupported
BadProfile,
BadQuality,
/// The supplied swizzle is unsupported
BadSwizzle,
/// The flags are contradict... | Rust | 0 |
};
}
assert_get_address_eq!(
"164244176fddb5d769b7de2027469d027ad428fadcc0c02396e6280142efb718",
"<KEY>"
);
assert_get_address_eq!(
"3ca187a58f09da346844964310c7e0dd948a9105702b716f4d732e042e0c172e",
"<KEY>"
);
ass... | Rust | 0 |
робнее: [начальная и минимальная маржа](<https://help.tinkoff.ru/margin-trade/short/initial-and-maintenance-margin/>).
#[prost(message, optional, tag = "2")]
pub starting_margin: ::core::option::Option<MoneyValue>,
/// Минимальная маржа — это минимальное обеспечение для поддержания позиции, которую вы уже о... | Rust | 0 |
#
# Copyright 2025 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 1 |
from __future__ import absolute_import
import os
import sys
from hatchling.metadata.plugin.interface import MetadataHookInterface
class CustomMetadataHook(MetadataHookInterface):
def update(self, metadata):
metadata["optional-dependencies"] = get_optional_dependencies(self.root)
def get_optional_depen... | Python | 1 |
/// from multiple threads. As a result, this function may perform other non-thread-safe
/// operations.)
pub unsafe fn closefrom(&self, minfd: libc::c_int) {
close::close_fds(
core::cmp::max(minfd, 0),
self.keep_fds.clone(),
self.it.clone(),
);
}
}
impl<'... | Rust | 0 |
# Convert a CSV file to a Lua table script that can be imported using `dofile`.
import csv
def csv2lua(in_file, out_file, global_name):
fp_in = open(in_file, 'r')
rows = list(csv.reader(fp_in))
fp_in.close()
headers = rows[0]
lua_rows = []
for row in rows[1:]:
cells = []
print... | Python | 1 |
et(&t).arg("start").arg("foo").assert().success();
c.iter(|| cmd_quiet(&t).arg("status").status());
}
benchmark_group!(
benches,
empty_status_bench,
non_empty_status_bench,
);
benchmark_main!(benches);
pub fn cmd(td: &TestDirectory) -> Command {
let mut r = Command::cargo_bin(env!("CARGO_PKG_NAME... | Rust | 0 |
innumf64
| sym::maxnumf32
| sym::rustc_peek
| sym::maxnumf64
| sym::type_name
| sym::variant_count => hir::Unsafety::Normal,
_ => hir::Unsafety::Unsafe,
}
}
/// Remember to add all intrinsics here, in `compiler/rustc_codegen_llvm/src/intrinsic.rs`,
/// and in `librar... | Rust | 0 |
contatos = {
"guilherme@gmail.com": {"nome": "Guilherme", "telefone": "3333-2221"},
"giovanna@gmail.com": {"nome": "Giovanna", "telefone": "3443-2121"},
"chappie@gmail.com": {"nome": "Chappie", "telefone": "3344-9871"},
"melaine@gmail.com": {"nome": "Melaine", "telefone": "3333-7766"},
}
resultado = (
... | Python | 1 |
l"]
total_TP += TP
total_FP += FP
total_FN += FN
precision = TP / (TP + FP) if (TP + FP) > 0 else 0
recall = TP / (TP + FN) if (TP + FN) > 0 else 0
f1 = 2 * precision * recall / (precision + recall) if (precision + recall) > 0 else 0
accuracy = TP / Total if Tota... | Python | 1 |
/// `price` directives for currency exchange rates work the same way:
///
/// ```text
/// 2014-07-09 price USD 1.08 CAD
/// ```
///
/// <https://docs.google.com/document/d/1wAMVrKIA2qtRGmoVDSUBJGmYZSygUaR0uOMW1GV3YE0/edit#heading=h.f78ym1dxtemh>
#[derive(Clone, Debug, PartialEq, TypedBuilder)]
pub struct Price<'a> {
... | Rust | 0 |
from dataclasses import dataclass, field
from enum import Enum
from io import BytesIO
from numbers import Number
from typing import Union
class FontType(Enum):
COURIER = "Courier"
TIMES = "Times"
@dataclass
class Margins:
top: Number = 5
right: Number = 5
bottom: Number = 5
left: Number = 5
... | Python | 1 |
= ck_exp(cx, st, rhs)?;
let ret_ty = Ty::Var(st.new_ty_var(false));
let arrow_ty = Ty::Arrow(Ty::pair(lhs_ty, rhs_ty).into(), ret_ty.clone().into());
st.unify(exp.loc, func_ty, arrow_ty)?;
Ok(ret_ty)
}
// SML Definition (9)
Exp::Typed(inner, ty) => {
let exp_ty = ck_exp(cx, st... | Rust | 0 |
S: StreamApp + 'static,
{
match self {
ResourceManager::LocalResourceManager(rm) => rm.worker_allocate(stream_app, stream_env),
ResourceManager::StandaloneResourceManager(rm) => {
rm.worker_allocate(stream_app, stream_env)
}
ResourceMa... | Rust | 0 |
ition, nutrient_b=nutrition2, lower_val=lower_val, upper_val=upper_val)
else:
if not 'desired' in str(dish_graph['neighbors'][nutrition.lower()][0]):
dish_graph['neighbors'][nutrition.lower()][0] = ''
... | Python | 1 |
_modified: String,
permissions: u32,
path: String,
}
fn string_into_words(input: String) -> Vec<Word> {
let mut inp = input;
let mut words: Vec<Word> = Vec::new();
while inp.len() > 4 {
let substring: String = inp.drain(..4).collect();
words.push(Word::from_string(substring));
}... | Rust | 0 |
fn serde_metadata_path() {
let s = "foo/bar";
let m = serde_json::from_str::<MetadataPath>(&format!("\"{}\"", s)).unwrap();
assert_eq!(m.to_string().as_str(), s);
assert_eq!(serde_json::to_value(m).unwrap(), json!("foo/bar"));
}
#[test]
fn serde_target_description() {
... | Rust | 0 |
.build(device)?;
cubes[i].descriptor_set = descriptor_sets.remove(0);
// Update the descriptor set with the actual descriptors matching shader bindings set in the layout.
// Binding 0: Object matrices Uniform buffer.
let ubo_write_info = DescriptorBufferSetWI::new(cubes[i].descripto... | Rust | 0 |
) {
crate::sync();
}
unsafe { libc::reboot(reboot_flags); }
Err(io::Error::last_os_error())
}
}
crate::attr_group! {
#![cfg(any(target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly", target_os = "netbsd"))]
use std::io;
use crate::externs;
use... | Rust | 0 |
revious_expr)
oneOf = replaced_by_pep8("oneOf", one_of)
dictOf = replaced_by_pep8("dictOf", dict_of)
originalTextFor = replaced_by_pep8("originalTextFor", original_text_for)
nestedExpr = replaced_by_pep8("nestedExpr", nested_expr)
makeHTMLTags = replaced_by_pep8("makeHTMLTags", make_html_tags)
makeXMLTags = replaced_by... | Python | 1 |
from CommonServerPython import *
from typing import Any
def display_cve_chart() -> dict[str, Any]:
cves_count = demisto.args().get("CvesCount", 0)
trending_cves_count = demisto.args().get("TrendingCvesCount", 0)
entry_result = {
"Type": 17,
"ContentsFormat": "bar",
"Contents": {
... | Python | 1 |
(-53 % 4) == 3`,
/// `-55 % 3 == 2`, and `-53 % 5 == 2`, all numbers
/// we expect.
///
/// For positive numbers, this is quite simple: `(48 % 5) => == 3`,
/// which is just the modulus operation as well (which for positive
/// numbers, this is identical to Rust's remainder operator).
#[inline(always)]
fn calculate_shl... | Rust | 0 |
tity"].sum() <= hidden.shape[0]
for key, layer in self.layers.items():
mask = None
mask = action_targets[key]
embs = embeddings.get(key)
if embs is not None and embs.shape[1] != mask.shape[1]:
b, _, f = embs.shape
zeros = torch.zero... | Python | 1 |
::time::SystemTime,
leader_id: &LeaderId,
enclave: &Enclave,
task_parameters: &TaskParameters,
slot_idx: u32,
) {
let leadership = &task_parameters.leadership;
let slot = task_parameters
.leadership
.era()
.from_era_to_slot(EpochPos... | Rust | 0 |
pub tag: sha256::Hash,
/// Tweaking factor stored after [KeysetContainer::commit_verify] procedure
pub tweaking_factor: Option<Hmac<sha256::Hash>>,
}
impl Container for KeysetContainer {
/// Out supplement is a protocol-specific tag in its hashed form
type Supplement = sha256::Hash;
/// Proof ... | Rust | 0 |
og = upgrade_weak!(settings_dialog_weak);
settings_dialog.save_settings();
});
let settings_dialog_weak = settings_dialog.downgrade();
record_format.connect_changed(move |_| {
let settings_dialog = upgrade_weak!(settings_dialog_weak);
settings_dialog.save_settings();
});
//... | Rust | 0 |
coder.load_state_dict(decoder_store_dict)
print('Use pretrained weights')
def forward(self, CT_img,MRI_img):
CT_img_F_ds, CT_Skips = self.image_encoder(CT_img)
MRI_img_F_ds, MRI_Skips = self.image_encoder(MRI_img)
#CT_img_F_mia = self.MIA_module(CT_img_F_ds)
#MRI_img_F_mia ... | Python | 1 |
learning_rate: float = 1e-5
n_evals: int = 1 # The number of evaluations to run and checkpoints to save.
lora: bool = False
lora_r: int = 8
lora_alpha: int = 8
lora_dropout: float = 0.0
suffix: str = "" # Together suffix to append to the model name
save_model: bool = False
# Relevant Do... | Python | 1 |
r in results]
assert all(cat in ["Programming", "AI"] for cat in categories)
def test_logical_or_with_different_fulltext_modes(self):
"""Test logical_or with different fulltext search modes."""
# Test simplified version: just test natural language mode works
natural_condition = ... | Python | 1 |
current_process().resume();
self.queue
.lock()
.retain(|proc| !Arc::ptr_eq(proc, current_process()));
return ret_value;
}
// Run other threads until someone wake us up...
switch();
}
}
... | Rust | 0 |
iat_p256_addcarryx_u32 is an addition with carry.
* Postconditions:
* out1 = (arg1 + arg2 + arg3) mod 2^32
* out2 = ⌊(arg1 + arg2 + arg3) / 2^32⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffff]
* arg3: [0x0 ~> 0xffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffff]
* out2: [... | Rust | 0 |
2)
# Display both frames
cv2.imshow('Front Camera', front_frame)
cv2.imshow('Bottom Camera', bottom_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
front_cam.release()
bottom_cam.release()
cv2.destroyAllWindows()
"""
Note -- Output:
>> offset_... | Python | 1 |
#[structopt(short, long)]
pub all: bool,
#[structopt(short, long)]
pub regex: bool,
#[structopt(short, long)]
pub hidden: bool,
#[structopt(short = "i", long)]
pub case_insensitive: bool,
#[structopt(short, long, allow_hyphen_values = true, verbatim_doc_comment)]
/// Match files ... | Rust | 0 |
, ButtplugMessageSpecVersion, ButtplugServerMessage}, server::ButtplugServer, server::comm_managers::test::TestDeviceCommunicationManagerBuilder, util::async_manager};
use futures::StreamExt;
#[test]
fn test_test_device_comm_manager() {
async_manager::block_on(async {
let server = ButtplugServer::defau... | Rust | 0 |
import pytest
from models.coord.polar import CoordPolar
from pages.recon.reconAiming import ReconAimingPage
from models.coord.rect import CoordRect
from models.error_messages import (
TARGET_MISMATCH,
POST_MISMATCH,
RESULT_MISMATCH
)
test_cases = [
(
CoordRect(6588525, 5661034, 36), # Observe... | Python | 1 |
'''
dx, dy 테크닉을 활용한 문제 3
숫자 0과 1로만 이루어진 n * n 크기의 격자 상태가 주어졌을 때,
각 칸 중 상하좌우로 인접한 칸 중 숫자 1이 적혀 있는 칸의 수가 3개 이상인 곳의 개수를 세는 프로그램
'''
# 범위 내에 있는지 확인하는 함수
def in_range(x, y, n):
return 0 <= x < n and 0 <= y < n
# 배열 크기 설정
n = int(input())
# 배열 입력(n * n)
arr = [
list(map(int, input().split()))
for _ in... | Python | 1 |
instruction immediate in ORI using zero register
smallvec![Inst::AluRRImmLogic {
alu_op: ALUOp::Orr64,
rd,
rn: zero_reg(),
imml,
}]
} else {
let mut insts = smallvec![];
// If the top 32 bits are zer... | Rust | 0 |
G_DOZE_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 14 - LPSPI4 stop mode selection, cannot change when ipg_stop is asserted."]
#[inline(always)]
pub fn lpspi4_ipg_stop_mode(&self) -> LPSPI4_IPG_STOP_MODE_R {
LPSPI4_IPG_STOP_MODE_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc ... | Rust | 0 |
warning: "⚠️".to_string(),
done: "✔️".to_string(),
not_done: "❌".to_string(),
};
match env::var("DISABLE_TODO_PRETTY") {
Ok(value) => {
if value == "1" {
return fallback_signs;
} else {
... | Rust | 0 |
import tkinter
def convert_C_to_F():
do_C = float(entry_C.get())
do_F = (do_C * 9/5) + 32
entry_F.insert(1, do_F)
root = tkinter.Tk()
root.title("Ứng dụng tkinter đầu tiên")
root.minsize(width=1000, height=600)
entry_C = tkinter.Entry()
entry_C.grid(row=0, column=0, padx=10, pady=10)
label_C = tkinter.... | Python | 1 |
(question=self).exclude(comment="")
return comments
class AssessmentData(models.Model):
question = models.ForeignKey(
Question, related_name="question_data", on_delete=models.CASCADE, null=True
)
solution = models.ForeignKey(
Solution, related_name="solution_data", on_delete=models... | Python | 1 |
"""
This module contains the exceptions that can be raised by the library.
The exceptions are used to handle errors that occur during the indexing or searching process.
"""
class MissingRequiredFieldError(Exception):
"""Exception raised when a required field is missing."""
class CreateIndexError(Exception):
... | Python | 1 |
, 0.5);//左上方移动
testbed.run();
}
fn add_point(world: &mut World<f32>, x:f32, y:f32, size:f32){
ColliderDesc::new(ShapeHandle::new(NBall::new(size)))
.translation(Vector2::new(x, y))//y值要负值
.build(world);
}
<gh_stars>0
use super::{
font::Font,
mesh::{fill_builder, Mesh},
Backend,
};
... | Rust | 0 |
_TEXT)-(LEADING*1)))
# text("", ((MARGIN-4)+MARGIN*SIDE, (TOP_TEXT)-(LEADING*2)))
# text("", ((MARGIN-4)+MARGIN*SIDE, (TOP_TEXT)-(LEADING*3)))
# text("", ((MARGIN-4)+MARGIN*SIDE, (TOP_TEXT)-(LEADING*4)))
# text("", ((MARGIN-4)+MARGIN*SIDE, (TOP_TEXT)-(LEADING*5)))
# text("", ((MARGIN-4)+MARGIN*SIDE, (TOP_TEXT)-(LEADING... | Python | 1 |
ck_with_size(2);
A::set_field(&mut block, 0, alloc.add(&self.0));
A::set_field(&mut block, 1, alloc.add(&self.1));
block.build()
}
fn from_ocamlrep(value: Value<'_>) -> Result<Self, FromError> {
let block = from::expect_tuple(value, 2)?;
let f0: T0 = from::field(block, 0... | Rust | 0 |
-> QueryResult:
"""
Execute a script passed in as a string.
Single queries are separated by a semicolon.
We keep the semicolon at the end of each query so that the parser works
correctly.
"""
queries = [query.strip() + ";" for query in script.split(";")
... | Python | 1 |
# ------------------------------------------------------------------------------------------------
# Modified from:
# Voltron: https://github.com/siddk/voltron-robotics
# ------------------------------------------------------------------------------------------------
"""
overwatch.py
Utility class for creating a centr... | Python | 1 |
from django.contrib import admin
from django.contrib.admin.sites import NotRegistered
from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicParentModelAdmin
from dojo.models import (
Answer,
Answered_Survey,
Choice,
ChoiceAnswer,
ChoiceQuestion,
Engagement_Survey,
Question,
... | Python | 1 |
Skipping constant LIBPATHFLAG with class String
// Skipping constant RPATHFLAG with class String
// Skipping constant LIBARG with class String
interp.def_rb_source_file(
b"mkmf.rb",
&include_bytes!(concat!(env!("OUT_DIR"), "/src/generated/mkmf.rb... | Rust | 0 |
mut self, cx: &impl HasDataLayout, range: AllocRange) -> AllocResult
where
Tag: Provenance,
{
// Find the start and end of the given range and its outermost relocations.
let (first, last) = {
// Find all relocations overlapping the given range.
let relocations = s... | Rust | 0 |
import tkinter as tk
import customtkinter as ctk
# Configurações do tema
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("dark-blue")
# funçao Add o contato
def add_contact():
nome = nomeentry.get()
numero = numeroentry.get()
if nome and numero:
contato = f"{nome} - {numero}"
... | Python | 1 |
H2221E,
AncillaryStream,
_144961SLPacketizedStream,
_144961SLFlexMuxStream,
MetadataStream,
ExtendedStreamId,
ReservedDataStream,
ProgramStreamDirectory,
#[cfg_attr(test, proptest(strategy("(0..0xBCu8).prop_map(|n| StreamId::Unknown(n))")))]
Unknown(u8)
}
#[derive(Copy, Clone, ... | Rust | 0 |
ame) {
Some((
func_info.call(context, x, y, angle_unit),
func_unit.to_string(),
))
} else {
None
}
}
fn to_angle_unit(context: &mut interpreter::Context, x: KalkNum, angle_unit: &str) -> KalkNum {
match angle_unit {
"rad" => x,
_ => interprete... | Rust | 0 |
}
fn get_current_velocities_as_array(input: &Vec<SprintVelocityInformation>) -> Vec<(u32, u32)> {
input
.iter()
.map(|entry| (entry.sprint_number as u32, entry.current_velocity as u32))
.collect()
}
fn get_running_velocities_as_array(input: &Vec<SprintVelocityInformation>) -> Vec<(u32, u3... | Rust | 0 |
t lzham_decompress_params {
pub m_struct_size: lzham_uint32,
pub m_dict_size_log2: lzham_uint32,
pub m_table_update_rate: lzham_uint32,
pub m_decompress_flags: lzham_uint32,
pub m_num_seed_bytes: lzham_uint32,
pub m_pSeed_bytes: *const ::std::os::raw::c_void,
pub m_table_max_update_interval:... | Rust | 0 |
e=False)
###################################################################################################################
# make model for metric learning
from networks import basenet, Deep4Net, EmbeddingDeep4CNN,EmbeddingDeep4CNN_bn, TripletNet, FineShallowCNN, EmbeddingDeepCNN, QuintupletNet, Embeddin... | Python | 1 |
# Run analyses
res_x = analyze_voxel_matrix(vm, voxel_size, material_properties=material, boundary_conditions=bc_x, visualization=False)
res_y = analyze_voxel_matrix(vm, voxel_size, material_properties=material, boundary_conditions=bc_y, visualization=False)
res_z = analyze_voxel_matrix(vm, voxel_size, mat... | Python | 1 |
al': # list of past k frames' sample interval with later frame
# 'avg_past_k_time_diffs': # avg_past_k_time_diffs,
# 'avg_past_k_sample_interval': # avg_past_k_sample_interval,
'if_no_point': # bool, 用于判断是否合法
'flow_gt': # [2... | Python | 1 |
field") {
return Err(SVDError::NotExpectedTag("field".to_string()).at(tree.id()));
}
let bit_range = BitRange::parse(tree, config)?;
FieldInfo::builder()
.name(tree.get_child_text("name")?)
.description(tree.get_child_text_opt("description")?)
.bi... | Rust | 0 |
,
)))
.expect("To Send Query Result to Client");
let source = Source::new(self.select_input.table_id, self.data_manager.clone());
let mut projection = match self.select_input.predicate {
None => Projection::new(self.select_input.selected_columns, Box::new(source)),
... | Rust | 0 |
(1000);
let mut remaining_duration = timeout_duration;
debug!("Awaiting 200 OK response from {}", url);
loop {
let mut span = global_tracer().start("Sending healthcheck request");
span.set_attribute(trace::NET_UPSTREAM_NAME.string(url.to_string()));
let telemetry_context = Telemetr... | Rust | 0 |
3da6b, o2j0a8kj93_ as m3q7uqu7pmf, v16j0v8ez7a
from we3te3a65pb import hh0v6jzca3q as wtgv0zgb148
global xdnbn3nca4y
iysu9qve2ij **= b''
nonlocal cxetxbotdat
@o_m674ox7tf(iwhsinse2h2, 0j, p0nie9s7a2s=nh39s4j54sk, hvn_e04884j=b'', nm8goupml7u=cw70i92jglz, ms2l3p_r6rz='', y_rf4exzxfc=z2mttiz6tlk)
def v4sp... | Python | 1 |
let mut c = 0;
for (i,x) in slanted_out.iter().enumerate() {
//println!("node{} slanted={:?}", i,x);
if *x { c += 1; }
}
println!("x count {}", x_size);
println!("y count {}", y_max);
println!("slanted count {}", c);
let edgedir = edge_shapes... | Rust | 0 |
def get_top10(df: pd.DataFrame) -> pd.DataFrame:
if df.empty:
return df
def _find_col(frame, names):
low = {c.lower(): c for c in frame.columns}
for n in names:
if n.lower() in low:
return low[n.lower()]
return None
col_stock = _find_col(df, ["st... | Python | 1 |
then uint;
scan_uint then u8;
scan_uint then u16;
scan_uint then u32;
scan_uint then u64;
scan_float then f32;
scan_float then f64;
}
impl FromStrPrefix for char {
fn from_str_prefix<'a>(s: &'a str) -> Option<(cha... | Rust | 0 |
Serialize::serialize(&self, &mut bytes).unwrap();
}
}
impl FromDatabaseValue for WalletAccount {
fn copy_from_database(bytes: &[u8]) -> io::Result<Self>
where
Self: Sized,
{
let mut cursor = io::Cursor::new(bytes);
Ok(Deserialize::deserialize(&mut cursor)?)
}
}
use QlRes... | Rust | 0 |
"""DataUpdateCoordinator for pegel_online."""
import logging
from aiopegelonline import CONNECT_ERRORS, PegelOnline, Station, StationMeasurements
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import MIN_TIME_BETWEEN_U... | Python | 1 |
ls
if let Some(v) = o.symbols.get(&res_suffix) {
res_suffix = (*v).clone();
}
// Locale
// Separator
let res_ = res;
let res: String = if let Locale::Defined(true) = o.locale {
js_sys::Number::from(res).to_locale_string("en-US").into()
} else if let Locale::Value(s) = o.loca... | Rust | 0 |
e);
}
//
// assisted greatly by https://github.com/actix/examples/tree/master/r2d2
fn register(path: Path<String>, db: Database) -> HttpResponse {
let channel = path.into_inner();
info!("registering channel {:#?}", channel);
if !is_valid_table_name(&channel) {
return HttpResponse::NotAcceptable().fi... | Rust | 0 |
, 102, 0 Annoying Ocean Warp
// PShip, Stage -> sea, 47, 103, 0 Annoying Ocean Warp
// PShip, Stage -> sea, 48, 100, 0 Annoying Ocean Warp
// PShip, Stage -> sea, 48, 101, 0 Annoying Ocean Warp
// PShip, Stage -> sea, 48, 102, 0 Annoying Ocean Warp
// PShip, Stage -> sea, 48, 103, 0 Annoying Ocean Warp
// PShip, ... | Rust | 0 |
64|size) )? |
(\d_*)+ ( \. (\d_*)+ )? ( [eE] [+-]? _* (\d_*)+ )? ( [ui] (8|1(6|28)|32|64|size) )?
";
const BOOL: &str = r"\b(true|false)\b";
const RAW_LITERAL: &str = r"r#[\p{Alphabetic}_]\w*\b";
const MACRO: &str = r"[\p{Alphabetic}_]\w*!";
const FUNCTION: &str = r"[\p{Alphabetic}_]\w*\b";
const FUNCTION_AHEAD:... | Rust | 0 |
timeout=0.5)
r.close()
data = data[:data.index("\nWelCome")]
except ValueError as e:
data = data
except Exception as e:
continue
if len(data.split()) == 0:
data = '\x00'
dump += data
now += len(d... | Python | 1 |
::entry;
use stm32l0xx_hal::{
pac::{
self,
rcc::cfgr::{MCOPRE_A, MCOSEL_A},
},
prelude::*,
rcc::Config,
};
#[entry]
fn main() -> ! {
let dp = pac::Peripherals::take().unwrap();
// Configure the 16MHz internal clock
let mut rcc = dp.RCC.freeze(Config::hsi16());
let gpio... | Rust | 0 |
fn parse(p: &mut $crate::parse::Parser<'_>) -> Result<Self, $crate::parse::ParseError> {
let t = p.tok_at(0)?;
match $crate::ast::Item::parse(p)? {
$crate::ast::Item::$ty(item) => Ok(item),
_ => Err($crate::parse::ParseError::expected(... | Rust | 0 |
DoublePlantVariant::Peony => 3,
DoublePlantVariant::DoubleTallgrass => 4,
DoublePlantVariant::LargeFern => 5,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum FlowerPotVariant {
Empty,
Poppy,
Dandelion,
OakSapling,
SpruceSapling,
Birch... | Rust | 0 |
------------------------")
print(f"Ground Truth SQL: {ground_truth_sql}")
print(f"Generated SQL: {predicted_sql}")
print(f"Solution string: {solution_str}")
# If unable to extract SQL statement, return 0 score
if predicted_sql is None:
if do_print:
print(f"No... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.