text string | label_name string | labels int64 |
|---|---|---|
raise WebsocketClosedError
n_waiting = len(self.fifo) + len(self.ws.buf)
if not n_waiting:
self.s.setblocking(False)
try:
n_waiting = len(self.s.recv(1024, socket.MSG_PEEK))
except BlockingIOError:
pass
except OSError as ... | Python | 1 |
d3 = command!("cut -d '=' -f 2");
command3.stdout(Stdio::piped());
let output = command1.execute_multiple_output(&mut [&mut command2, &mut command3])?;
match output.status.code() {
Some(exit_code) => {
if exit_code != 0 {
return Err("Is Your CSR... | Rust | 0 |
tringArray):
_storage = "python"
_na_value = np.nan
def _validate(self) -> None:
"""Validate that we only store NaN or strings."""
if len(self._ndarray) and not lib.is_string_array(self._ndarray, skipna=True):
raise ValueError(
"StringArrayNumpySemantics requires... | Python | 1 |
# Generated by Django 5.1.4 on 2025-01-18 20:32
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clubs', '0011_comments_club_alter_comments_create_time_and_more'),
]
operations = [
migrations.AlterField(
... | Python | 1 |
'''
Pi-hole DNS traffic visualizer for the Raspberry Pi Sense HAT
By Sam Lindley, 2/21/2018
'''
import json
import os
import socket
import sys
import time
import urllib.request
import config
def global_access(host="8.8.8.8", port=53, timeout=3):
"""
Host: 8.8.8.8 (Google Public DNS A)
Port: 53/TCP
Se... | Python | 1 |
all(num, args).await;
let exit = syscall.exit;
regs.rax = ret as usize;
exit
}
<reponame>TianyiShi2001/iro
pub mod cmyk;
pub mod hsl;
pub mod rgb;
pub use cmyk::{Cmyk, CmykInt};
pub use hsl::{Hsl, HslInt};
pub use rgb::{Rgb, RgbScaled};
#[cfg(test)]
mod tests {
use test_case::test_case;
use super... | Rust | 0 |
r (index, item) in result.iter_mut().enumerate() {
let time = (index as SampleCalc * self.sample_time) + time_start;
*item = if time < self.duration {
self.tempo_start.beat_duration + (time * self.beat_duration_change_rate)
} else if time < 0.0 {
self.... | Rust | 0 |
Message {
/// When a button is pressed
Press { template: Template, button: Button },
/// When a button is released
Release { template: Template, button: Button },
/// When the user presses a pad button, then changes the template, and then releases the
/// button, this message will be fired on... | Rust | 0 |
::Occlusion => SimplifiedQueryType::Occlusion,
wgt::QueryType::Timestamp => SimplifiedQueryType::Timestamp,
wgt::QueryType::PipelineStatistics(..) => SimplifiedQueryType::PipelineStatistics,
}
}
}
/// Error encountered when dealing with queries
#[derive(Clone, Debug, Error)]
pub enu... | Rust | 0 |
x=10
y=20
while x<y+1:
print(x)
x+=1 | Python | 1 |
# Copyright (c) Alibaba, Inc. and its affiliates.
from typing import Type
import gradio as gr
from swift.ui.base import BaseUI
class Advanced(BaseUI):
group = 'llm_train'
locale_dict = {
'advanced_param': {
'label': {
'zh': '高级参数设置',
'en': 'Advanced sett... | Python | 1 |
"comp_win": "Computer won! Sorry!",
"draw": "It's a draw!",
"n": "No game :p ", # for testing purposes
}
# game starts here!
game_start = 'y'
while game_start == 'y':
# set initial conditions when game is ran
list_user_cards = [] # user's cards in hand
list_comp_cards = [] # computer's card... | Python | 1 |
= field.message_type._concrete_class()
try:
text_format.Parse(value, message_instance)
return message_instance
except text_format.ParseError as e:
raise ValueError(
f'Error parsing proto value for flag {flag_name}: {value}'
) from e
if field.type == descriptor.FieldDescriptor... | Python | 1 |
fn compose_len(&self) -> usize {
self.rmailbx.compose_len() + self.emailbx.compose_len()
}
fn compose<B: BufMut>(&self, buf: &mut B) {
self.rmailbx.compose(buf);
self.emailbx.compose(buf);
}
}
impl<N: Compress> Compress for Minfo<N> {
fn compress(&self, buf: &mut Compresso... | Rust | 0 |
BlockBegin, LeftBrace, BlockEnd, Data, BlockBegin, RightBrace, BlockEnd,
]),
},
TokenizeTestCase {
input: "{{ foo.0.0 ",
tokens: Vec::from([
VariableBegin,
Name,
Dot,
... | Rust | 0 |
#[doc = "Channel connects to UART0_RX"]
#[inline(always)]
pub fn _5(self) -> &'a mut W {
self.variant(REQSRC0_A::_5)
}
#[doc = "Channel connects to UART1_TX"]
#[inline(always)]
pub fn _6(self) -> &'a mut W {
self.variant(REQSRC0_A::_6)
}
#[doc = "Channel connects to UA... | Rust | 0 |
&[
0, 0, 5, 0, 5, 0, 5, 0, 0, 0, 237, 1, 0, 0, 57, 48, 0, 0, 0, 0, 0, 0, 4, 0, 102, 105, 108,
101,
];
const TESTDELTA: &[u8] = &[
177, 104, 222, 58, 0, 0, 0, 0, 57, 48, 0, 0, 0, 0, 0, 0, 21, 205, 91, 7, 0, 0, 0, 0, 0, 0,
];
const TESTDATAPKT: &[u8] = &[49, 212, 0, 0, 0, 0, 0, 0,... | Rust | 0 |
"""The avion component."""
| Python | 1 |
convert_results( mongo_get_data(coll, filter) ) )
}
/// Get compose (natural key for access YAML field)
pub fn get_from_tree<'a>(tree: &'a serde_yaml::Value, access_key: &[&str]) -> ResultParse<serde_json::Value> {
data_getter::run(tree, &access_key, "MESSAGE", None, None)
}
}
struct Co... | Rust | 0 |
import torch
# from memory.LLaVA.llava.utils import disable_torch_init
# from memory.LLaVA.llava.model.builder import load_pretrained_model
# from memory.LLaVA.llava.conversation import conv_templates, SeparatorStyle
from memory.MGM.mgm.utils import disable_torch_init
from memory.MGM.mgm.model.builder import load_pretr... | Python | 1 |
t_shapes[0][1:])
pl_labels = training_set.get_random_labels_tf(pl_minibatch)
fake_images_out, fake_dlatents_out = G.get_output_for(pl_latents, pl_labels, is_training=True, return_dlatents=True)
# Compute |J*y|.
pl_noise = tf.random_normal(tf.shape(fake_images_out)) / np.sqrt(np.... | Python | 1 |
);
let total_size_percent = (f64::from(total_size)) / (f64::from(items.size())) * 100.0;
let mut obj = arr.object()?;
obj.field("name", name.as_str())?;
obj.field("bytes", total_size)?;
obj.field("size_percent", total_size_percent)?;
}
// Scop... | Rust | 0 |
cluster_id, self.min_cluster_size));
let cluster_const_ptr: *const Cluster<Id> = &*cluster;
let cluster_ptr = cluster_const_ptr as *mut Cluster<Id>;
for mut i in 0..points.len() {
// Another thread may rolled us back
if cluster.is_rolled_back() {
self.rol... | Rust | 0 |
rea.verticalScrollBar().setValue(
self.scrollArea.verticalScrollBar().maximum()))
else: # System
self.scroll_layout_system.addWidget(frame, alignment=alignment)
QTimer.singleShot(0, lambda: self.scrollArea_system.verticalScrollBar().setValue(
self.scrollA... | Python | 1 |
e": DataverseDataset,
"rds.icm.edu.pl": DataverseDataset,
"recherche.data.gouv.fr": DataverseDataset,
"redu.unicamp.br": DataverseDataset,
"repod.icm.edu.pl": DataverseDataset,
"repositoriopesquisas.ibict.br": DataverseDataset,
"research-data.urosario.edu.co": DataverseDataset,
"researchdata... | Python | 1 |
st, assert_instr(cmgt))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vcgtzq_s16(a: int16x8_t) -> uint16x8_t {
let b: i16x8 = i16x8::new(0, 0, 0, 0, 0, 0, 0, 0);
simd_gt(a, transmute(b))
}
/// Compare signed greater than zero
#[inline]
#[target_feature(enable = "neon")]
#[cfg_attr(tes... | Rust | 0 |
or &(di, dj) in [(1, 0), (0, 1), (-1, 0), (0, -1)].iter() {
let ii = i as isize + di;
let jj = j as isize + dj;
if ii < 0
|| ii as usize >= data.len()
|| jj < 0
|| jj as usize >= data[i].len()
... | Rust | 0 |
erivative61(
h: Callable[[X1, X2, X3, X4, X5, X6], Y],
x1: X1,
x2: X2,
x3: X3,
x4: X4,
x5: X5,
x6: X6,
delta=1e-5,
) -> np.ndarray:
return numericalDerivative11(lambda x: h(x, x2, x3, x4, x5, x6), x1, delta)
def numericalDerivative62(
h: Callable[[X1, X2, X3, X4, X5, X6], Y],
... | Python | 1 |
from fastapi import APIRouter,Depends,status,HTTPException
from fastapi.security import OAuth2PasswordRequestForm
from ..schemas import schemas
from ..models import models
from ..database import database
from typing import List
from sqlalchemy.orm import Session
from . import hashing
def create_lawyer(request:schem... | Python | 1 |
'));
let mut sx = String::new();
let mut lockedx = Vec::<bool>::new();
let mut schars = Vec::<char>::new();
for c in s.chars() {
schars.push(c);
}
let mut i = 0;
while i < schars.len() {
if schars[i] != '+' {
sx.push(schars[... | Rust | 0 |
it(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
self.w
}
}
#[doc = "Port Data Direction Toggle 13"]... | Rust | 0 |
it]
for i in stream(2) {
async { i * i }.await;
}
};
async {}.await;
}
pub async fn nested2() {
let s = stream_block! {
#[for_await]
for i in stream(2) {
yield async { i * i }.await;
}
};
#[for_await]
for _i in s {
async {}... | Rust | 0 |
oat_eq!((), (), abs <= ());
assert_float_eq!((), (), rel <= ());
assert_float_eq!((), (), rmax <= ());
assert_float_eq!((), (), rmin <= ());
assert_float_eq!((), (), r1st <= ());
assert_float_eq!((), (), r2nd <= ());
assert_float_eq!((), (), ulps <= ());
// (A,)
assert_float_eq!((1.0f32... | Rust | 0 |
cade(self.session)
self.rds = RDSFacade(self.session)
self.redshift = RedshiftFacade(self.session)
self.s3 = S3Facade(self.session)
self.ses = SESFacade(self.session)
self.sns = SNSFacade(self.session)
self.sqs = SQSFacade(self.session)
self.secretsmanager = Secre... | Python | 1 |
Some(ordering) => match ordering {
Ordering::Equal => true,
_ => false
},
None => false
}
}
}
impl<'m, V: Value + Serialize> domain::Memory<V> for Memory<V> {
fn join(self, other: &Memory<V>) -> Result<Memory<V>> {
self.join(other)
}
... | Rust | 0 |
(piece::Type::Bishop, PST_BISHOP),
(piece::Type::Rook, PST_ROOK),
(piece::Type::Queen, PST_QUEEN),
(piece::Type::King, PST_KING),
] {
let mut white_piece = pos.piece_occupancy(Side::White, piece_type);
while white_piece != Bitboard::EMPTY {
... | Rust | 0 |
from unittest import TestCase, mock
from .....didcomm_prefix import DIDCommPrefix
from ...message_types import MENU_REQUEST, PROTOCOL_PACKAGE
from ..menu_request import MenuRequest
class TestMenuRequest(TestCase):
def setUp(self):
self.menu_request = MenuRequest()
def test_init(self):
"""Tes... | Python | 1 |
.unwrap_or(-1),
stderr: stderr,
})?;
}
// We good.
Ok(())
}
}
fn locate_signtool() -> Result<PathBuf, CodeSignError> {
const INSTALLED_ROOTS_REGKEY_PATH: &str = r"SOFTWARE\Microsoft\Windows Kits\Installed Roots";
const KITS_ROOT_REGVALUE_NAME: &str = r"K... | Rust | 0 |
character=input()
ascii_val=ord(character) #ord() expects character, not string
print(ascii_val)
# The ASCII value of a character is its numerical representation in the ASCII (American Standard Code for Information Interchange) table. ASCII is a character encoding standard used for representing text in computers a... | Python | 1 |
import os
from pydantic import BaseModel
from app.engine import (
CHROMA_BASE_DIR,
DATA_BASE_DIR,
DATA_DIR,
MODEL_PROVIDER,
STORAGE_BASE_DIR,
UPLOADED_DATA_DIR,
)
class Setting(BaseModel):
data_dir: str
model_provider: str
__setting = Setting(data_dir=DATA_DIR, model_provider=MODEL... | Python | 1 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
import shutil
import subprocess
from glob import glob
from pathlib import Path
from typing import Dict, Optional
... | Python | 1 |
import argparse
import torch
from tools import evaluate_results_nc
from pytorchtools import EarlyStopping
from aminer.aminer_dataloader import load_aminer
import numpy as np
import random
# from RAS_HGN import RAS_HGN
from MLP import MLP
# from MLP_2 import MLP
from sklearn.manifold import TSNE
import matplotlib.pyp... | Python | 1 |
m_database.log_activity(self.user_id, "APP_CLOSE", "Users", self.user_id, "Zamknięcie aplikacji")
event.accept()
else:
event.ignore()
else:
event.accept()
def show_initial_login():
"""Show initial login dialog"""
login_dialog = LoginDialog()
... | Python | 1 |
::IntoIter")?;
let mut out = f.debug_list();
let mut ptr = self.head;
for _ in 0..self.len {
unsafe {
out.entry(&(*ptr).value);
ptr = (*ptr).next;
}
}
out.finish()
}
}
}
<gh_st... | Rust | 0 |
fn) {
var cache = Object.create(null);
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
console.log(serializeStyles(`:root {
--background-color: rebeccapurple;
}`));
console.log(serializeStyles(`:root {
--background-color: rebecc... | Rust | 0 |
not has_multi_company_access:
user.last_lunch_location_id = user_location = request.env['lunch.location'].search([], limit=1)
alert_domain = expression.AND([
[('available_today', '=', True)],
[('location_ids', 'in', user_location.id)],
[('mode', '=', 'alert')],
... | Python | 1 |
+ 'static;
/// Encodes an `Ipld` object as bytes.
fn encode(
&self,
obj: &Ipld<Self, H>,
) -> Result<Box<[u8]>, <Self as EncodeDecodeIpld<H>>::Error>;
/// Decodes bytes into an `Ipld` object.
fn decode(&self, bytes: &[u8]) -> Result<Ipld<Self, H>, <Self as EncodeDecodeIpld<H>>::Err... | Rust | 0 |
def __init__(self):
self.original_slow_forward = None
| Python | 1 |
nums = [1, 2, 2, 3, 1, 4, 2, 5]
freq = {}
for num in nums:
if num in freq:
freq[num] += 1
else:
freq[num] = 1
print("Frequencies:", freq)
| Python | 1 |
.arch1-1 -> 5.1.14.arch1-1)
[2019-06-26 12:48] [ALPM] upgraded linux (5.1.14.arch1-1 -> 5.1.15.arch1-1)
[2019-07-08 01:01] [ALPM] upgraded linux-firmware (20190618.acb56f2-1 -> 20190628.70e4394-1)
[2019-07-08 01:01] [ALPM] upgraded linux (5.1.15.arch1-1 -> 5.1.16.arch1-1)
[2019-07-11 22:08] [ALPM] upgraded linux (5.1.1... | Rust | 0 |
"""
Utility modules for ADT analysis.
"""
from .binary import (
read_packed_string,
read_string_block,
normalize_model_path,
pack_vector3,
unpack_vector3,
pack_quaternion,
unpack_quaternion,
read_chunks,
detect_chunk_reversal,
decompress_alpha_map
)
from .logging import LogManage... | Python | 1 |
import marsyas
import json
from marsyas_util import *
net = marsyas.system_from_script("""
Network : Series
{
+ public frequency = 440.0
+ public g0 = 1.0
+ public g1 = 0.1
+ public g2 = 0.2
+ public g3 = 0.1
israte = 44100.0
-> Fanout
{
-> f0: Series {-> sin1: Sine... | Python | 1 |
_afe_fifo()) {
(Ok(_), Ok(_)) => cb(&self.adc_frame, &self.afe_frame),
_ => self.fifo_reset(),
}
}
}
pub fn try_read_adc1298_fifo(&mut self) -> Result<(), ()> {
// Дети, не повторяейте это дома
let buf : &mut [u32; 16 + 1] = unsafe { core::mem... | Rust | 0 |
# 소행렬 계산
def getMatrixMinor(m, i, j):
return [row[:j] + row[j+1:] for row in (m[:i] + m[i+1:])]
# 행렬식 계산
def getDeterminant(m):
if len(m) == 1:
return m[0][0]
if len(m) == 2:
return m[0][0] * m[1][1] - m[0][1] * m[1][0]
determinant = 0
for c in range(len(m)):
determinant += ((-1) ** c) * m[0][... | Python | 1 |
"""
@authour:Nagaraj
@guidance:Prabir
it will read the niravana json2csv csv file , look for clinvar colum if its empty it will take the dbsnp colum rs ID and make request. if result found it wll print otherwise it will continue.create csv file and paste the found Clinvar ID in the respective clinvar cloumn.
"""
im... | Python | 1 |
ize, s: &'g Graph<f32>) -> LSTM<'g> {
let rng = ag::ndarray_ext::ArrayRng::<f32>::default();
LSTM {
vector_dim,
hs: vec![],
cells: vec![],
wx: s.variable(rng.random_normal(&[vector_dim, 4 * vector_dim], 0., 0.01)),
wh: s.variable(rng.random_nor... | Rust | 0 |
e_document(html);
let time_selector = Selector::parse("span.ehead").unwrap();
let row_selector = Selector::parse("table table tr").unwrap();
let dt = document.select(&time_selector).next().unwrap().text().next().unwrap();
let re = regex::Regex::new(r"(?P<year>\d{4})\.(?P<month>\d{2})\.(?P<day>\d{2})\.(?... | Rust | 0 |
ase = RemoveServiceEventIntendUseCase {
account,
service_id: std::mem::take(&mut path_params.service_id),
timestamp: query.timestamp,
};
execute(usecase, &ctx)
.await
.map(|_| HttpResponse::Ok().json(APIResponse::default()))
.map_err(NettuError::from)
}
#[derive... | Rust | 0 |
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Integer
from featuretools.primitives.base import AggregationPrimitive
class NUniqueWeeks(AggregationPrimitive):
"""Determines the number of unique weeks.
Description:
Given a list of datetimes, return the nu... | Python | 1 |
import tensorflow as tf
from tensorflow.keras import layers, regularizers
def build_advanced_ids_model(input_dim, num_classes):
"""
Build an advanced neural network for Intrusion Detection
"""
model = tf.keras.Sequential([
# Input layer with L2 regularization
layers.Input(shape=(input_d... | Python | 1 |
#
# MLDBFB-401_where_on_unexisting_col_test.py
# Mich, 2016-03-14
# This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
#
import unittest
from mldb import mldb, MldbUnitTest
class QueryWhereTest(MldbUnitTest): # noqa
def test_where_on_unexisting_col_in_sparse(self):
mldb.create_d... | Python | 1 |
mut_render_buff[_o] = char_space;
// }
// next phi
mut_phi += phi_rotate_steps;
if mut_phi > two_pi {
break;
};
}
mut_theta += theta_rotate_steps;
if mut_theta > two_pi {
... | Rust | 0 |
disassembler-pt-1.html
use std::fs;
use std::env;
// Turns an array of bytes containing the hexdump into a string
fn disassemble(hex: &[u8]) -> String {
let mut asm = "".to_owned();
let mut buffer = "".to_owned();
let mut line_number = 0000;
for i in 0..hex.len() {
if hex[i] as char == ' ' || ... | Rust | 0 |
h),
/// Seal contained within the witness transaction
WitnessVout { vout: u32, blinding: u64 },
}
impl Seal for SealEndpoint {}
impl SealEndpoint {
/// Cnostructs [`SealEndpoint`] for the witness transaction output using
/// provided random number generator for creating blinding factor
pub fn wit... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# test_issue_410.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Foundation, either version 2 of the License,... | Python | 1 |
f.flag3 = false; // Checkprizes Flag
self.flag4 = false; // Double Flag
self.panel.prize = "No prize...".to_string();
self.panel.value = 0;
self.panel.bets = 0;
self.panel.wins = 0;
self.panel.msg = MSG1.to_string();
self.hand = TDeck::new_empty_hand();
}
}
... | Rust | 0 |
class SubTaskConfig():
agent_list = [
{ 'team':0, 'tid':0, 'type':'RLA_CAR_Laser', 'init_fn_name':'init_ground', },
{ 'team':0, 'tid':1, 'type':'RLA_CAR', 'init_fn_name':'init_ground', },
{ 'team':0, 'tid':2, 'type':'RLA_CAR_Laser', 'init_fn_name':'init_ground', },
... | Python | 1 |
ColorTable>,
pub indicies: Vec<u8>,
}
impl IndexedImage {
pub fn left(&self) -> u16 {
self.image_descriptor.left
}
pub fn top(&self) -> u16 {
self.image_descriptor.left
}
pub fn width(&self) -> u16 {
self.image_descriptor.width
}
pub fn height(&self) -> u16 {
self.image_descriptor.height
}
pub fn... | Rust | 0 |
import sys
import numpy as np
def gen_waypoints(cycle, max_range, interval):
wayspoints = list(range(0, max_range + 1, interval))
for i in range(cycle - 1):
wayspoints += list(range(max_range, -max_range - 1, -interval))
wayspoints += list(range(-max_range, max_range + 1, interval))
wayspo... | Python | 1 |
on_activate(self, reader=None):
super().on_activate(reader)
self.owner._set_job_role_state(self.owner.bartender.situation_job, self.owner.bartender.bartender_party_role_state)
self.owner._set_job_role_state(self.owner.host.situation_job, self.owner.host.host_party_role_state)
self.owner... | Python | 1 |
from rest_framework import serializers
from .models import User, Notification, Message, MessageHistory
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ['user_id', 'username', 'password']
extra_kwargs = {'password': {'write_only': True}}
class MessageSe... | Python | 1 |
import os
import re
import sys
def _read_file(path):
with open(path, 'r') as text_file:
text = text_file.read()
return text
def _write_file(text, path):
with open(path, 'w') as text_file:
text_file.write(text)
def _paste_text_into(from_text, to_text, name, delimiter):
start_marker = '%s %s pasted ... | Python | 1 |
import hashlib
import random
import string
import time
import requests
import json
cookies = {
"_horizon_uid": "90ef4ad2-3b96-433c-a425-ad1d570d32f1"
}
url = "https://ygp.gdzwfw.gov.cn/ggzy-portal/search/v2/items"
data = {
"type": "trading-type",
"openConvert": False,
"keyword": "",
"siteCode": "4... | Python | 1 |
ait
}
<gh_stars>10-100
use crate::{AttributeArgs, Config, Ident, Parenthesized, PubVis};
use darling::{util::Override, FromMeta};
use syn::{parse2, AttrStyle, Attribute, Path};
/// Root binding item attrs
#[derive(Default, FromMeta, Debug, PartialEq, Eq)]
#[darling(default)]
pub struct AttrItem {
/// Module name f... | Rust | 0 |
"""
A simple case to use generator for multi-turn interaction
"""
import argparse
from flashrag.config import Config
from flashrag.utils import get_generator, get_dataset, get_retriever
from flashrag.prompt import PromptTemplate
parser = argparse.ArgumentParser()
parser.add_argument("--model_path", type=str)
args = pa... | Python | 1 |
0, witness1, input0, input1
///layer0 is input-layer, The first two items are witnesses, and the last two items are public inputs
///layer1~layer3 are composed of multiple gates.
/// gaten = (op, left, right) represents the nth gate, op represents the operator, add or multiple,
/// left represents the number o... | Rust | 0 |
flags.DEFINE_custom("conf_file", "./conf/test/test.conf",
#"conf file", action=LoadConfFile, sec_name="Train")
"conf file", action=LoadConfFile, sec_name="Evaluate")
sys.stderr.write('----------- Configuration Arguments -----------\n')
for arg, value in sorted(flags.get_flags_dict().it... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Table(object):
def __init__(self, table):
self.row_len = len(table)
self.col_len = len(table[0])
self.table = table
def row(self, n):
return self.table[n]
def col(self, n):
return [self.table[i][n] for i in xran... | Python | 1 |
PARTNUMW::APOLLO3 => 100663296,
PARTNUMW::APOLLO2 => 50331648,
PARTNUMW::APOLLO => 16777216,
PARTNUMW::PN_M => 4278190080,
PARTNUMW::PN_S => 24,
PARTNUMW::FLASHSIZE_M => 15728640,
PARTNUMW::FLASHSIZE_S => 20,
PARTNUMW::SRAM... | Rust | 0 |
rl.restype = c_long
libssl.SSL_get_peer_cert_chain.argtypes = [
P_SSL
]
libssl.SSL_get_peer_cert_chain.restype = P_STACK
libssl.SSL_get1_session.argtypes = [
P_SSL
]
libssl.SSL_get1_session.restype = P_SSL_SESSION
libssl.SSL_set_session.argtypes = [
P_SSL,
... | Python | 1 |
if (freq is not None and freq.size > 0)
else 1,
)
dpg.set_axis_limits(self._y_axis_1, ymin=-error_lim, ymax=error_lim)
dpg.set_axis_limits(self._y_axis_2, ymin=-error_lim, ymax=error_lim)
dpg.split_frame()
dpg.set_axis_limits_auto(self._y_axis_1)
dpg.se... | Python | 1 |
l1": {
"PubMed": [{"title": "Title1", "date": "01/01/2020"}]
}
}
}
merged_graph = merge_mention_graphs(graph1, graph2)
self.assertEqual(merged_graph, graph2)
def test_merge_mention_graphs_empty_graphs(self):
"""Test merging with empty ... | Python | 1 |
}
if not self._cfg.DATA.MULTI_LABEL:
stats["top1_err"] = self.mb_top1_err.get_win_median()
stats["top5_err"] = self.mb_top5_err.get_win_median()
for key in self.extra_stats.keys():
stats[key] = self.extra_stats[key].get_win_median()
logging.log_json_stats(... | Python | 1 |
import argparse
from .orchestration import ToolChain
from .base import WorkflowContext
from orchestration.firebase_wrapper import FirebaseWrapper
import json
def main():
parser = argparse.ArgumentParser(description="LLama Toolbox CLI")
parser.add_argument('--local', action='store_true', help='Run locally')
... | Python | 1 |
if #[cfg(all(target_feature="avx",target_feature="fma"))] {
Self { avx: fused_mul_neg_sub_m256d(self.avx, m.avx, a.avx) }
} else if #[cfg(all(target_feature="avx",target_feature="fma"))]
{
Self { sse0: fused_mul_neg_sub_m128d(self.sse0, m.sse0, a.sse0), sse1: fused_mul_neg_sub_m128d(... | Rust | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self, in_dim: int, hidden_dims: list, p: float, norm: str, actn: str, order: str = 'nd'):
super(MLP, self).__init__()
self.n_layer = len(hidden_dims) - 1
self.in_dim = in_dim
... | Python | 1 |
"""Build command implementation."""
from pathlib import Path
from typing import List, Optional
from rich.console import Console
from rich.panel import Panel
from rich.progress import Progress, SpinnerColumn, TextColumn, TimeElapsedColumn
from claude_code_builder.core.config import BuildConfig
from claude_code_builde... | Python | 1 |
= y_train_full, y_test
def backtest(self):
assert self.pipeline, "Train first"
y_pred = self.pipeline.predict(self.X_test)
print("Confusion matrix (all):")
print(confusion_matrix(self.y_test, y_pred))
print(classification_report(self.y_test, y_pred, zero_division=0))
... | Python | 1 |
epth_limit);
1
}
(lignin::Node::SvgElement { element: e_1, dom_binding: db_1 }, lignin::Node::SvgElement { element: e_2, dom_binding: db_2 }) if e_1.name == e_2.name && e_1.creation_options == e_2.creation_options => {
let span = trace_span!("Diffing SVG element", tag = e_1.name, ?db_1, ?db_2);
... | Rust | 0 |
"""
WireGuard_ConfFileGenerator-v1.0.0
(C) 2024 yuito723(https://github.com/yuito723)
"""
import tkinter as tk
import subprocess as sub
class Window(): # ウィンドウ
def __init__(self, master):
self.master = master
self.master.resizable(False, False)
self.master.iconbitmap("./icon.ico")
... | Python | 1 |
add(TEST_DATE).unwrap()
.add(TEST_ROUND).unwrap();
}
}use gccjit::{LValue, RValue, ToRValue, Type};
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_codegen_ssa::mir::operand::OperandValue;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::{AsmBuilderMe... | Rust | 0 |
nt(FRAME_WIDTH_TOP / 2)
scale = int(FRAME_WIDTH_TOP / 2)
for index in keypoint_indeces:
data[:, :, index[0]] = (data[:, :, index[0]] - shift) / scale
data[:, :, index[1]] = (data[:, :, index[1]] - shift) / scale
data[:, :, index[0] +
state_dim] = (data[:, :, index[0] + stat... | Python | 1 |
)*
if !needs_space {
self.$first_key.to_css(dest)?;
}
Ok(())
}
}
};
}
pub (crate) use shorthand_property;
macro_rules! shorthand_handler {
(
$name: ident -> $shorthand: ident
{ $( $key: ident: $prop: ident($type: ty), )+ }
) => {
#[derive(Default)]
... | Rust | 0 |
from py_ecc.bn128 import G1, multiply, add, FQ, eq, Z1
from py_ecc.bn128 import curve_order as p
import numpy as np
from functools import reduce
import random
def random_element():
return random.randint(0, p)
def add_points(*points):
return reduce(add, points, Z1)
# if points = G1, G2, G3, G4 and scalars = a... | Python | 1 |
def get_world_size():
if is_dist_initialized():
return torch.distributed.get_world_size()
return 1
| Python | 1 |
import numpy as np
import math
from config import Config
import random
class UserEquipment:
def __init__(self, location: np.ndarray, index, mobility_range):
self.location = location
self.index = index
self.mobility_range = mobility_range
self.QoS = 0
self.require = random.... | Python | 1 |
tency_ms": total_latency_ms,
"results": comparison_results,
"successful_models": len([r for r in comparison_results.values() if r.get('success')])
}
else:
print(f" ❌ Comparison failed: HTTP {response.status_code}")
print(f" Error: {respons... | Python | 1 |
x = res.0 + 1;
if res.0 >= 5 {
break;
}
}
};
let fut2 = async move {
loop {
match rep.recv::<Ping>().await {
Ok((msg, handle)) => {
println!("Ping: {}", msg.0);
handle.respond(Pong(msg.0... | Rust | 0 |
DataType::UInt32 => self.u32().unwrap().to_ops(),
DataType::UInt64 => self.u64().unwrap().to_ops(),
DataType::Float32 => self.f32().unwrap().to_ops(),
DataType::Float64 => self.f64().unwrap().to_ops(),
#[cfg(feature = "dtype-categorical")]
DataType::Categ... | Rust | 0 |
#!/usr/bin/env python3
#######################
# VINDICTA Setup Script #
#######################
import os
import sys
import shutil
import platform
import subprocess
import winreg
######## GLOBALS #########
MAINDIR = "z"
PROJECTDIR = "vindicta"
##########################
def main():
FULLDIR = "{}\\{}".format(... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.