text string | label_name string | labels int64 |
|---|---|---|
rter (unit-of-duration)",
b.reg(r#"quarters?"#)?,
|_| Ok(UnitOfDurationValue::new(Grain::Quarter))
);
b.rule_1_terminal("year (unit-of-duration)",
b.reg(r#"years?"#)?,
|_| Ok(UnitOfDurationValue::new(Grain::Year))
);
... | Rust | 0 |
_per_batch = first_tensor.shape[0] * first_tensor.shape[1]
# Calculate total memory usage and count tensors
total_memory_usage = 0
for batch in batches:
if 'input' in batch:
input_count += 1
total_memory_usage += batch['input'].nbytes
if 'target' in batch:
... | Python | 1 |
k=link,
agenda=agenda,
uid=uid,
transcript_url=transcript_url,
transcript=None,
parsed_transcript=None,
)
return result
def _parse_index_item(self, index_item: MeetingItem) -> MeetingItem:
transcript_url = index_item.get("transcri... | Python | 1 |
,
AlignedByteOffset: 0,
InputSlotClass: D3D11_INPUT_PER_VERTEX_DATA,
InstanceDataStepRate: 0
}
];
// CreateInputLayout requires the compiled vertex shader code.
// This is because it will actually validate the input signature of the VS... | Rust | 0 |
.normalize(self.X, dim=1)
# now compute attention over dictionary matrix X
scores = torch.mm(dict_query, topic_dict.t())
return torch.nn.functional.softmax(scores, dim=1) # bsz x K
def rank_vocab_for_topics(self, word_embedding_matrix, to_be_removed):
vocab_input = wo... | Python | 1 |
}
CONFIG.lock().expect("not poisoned")
}
/// Nvme Arg Values taken from the command line
#[derive(Default)]
pub(crate) struct NvmeArgValues(HashMap<String, String>);
impl TryFrom<NvmeArgValues> for NvmeConfig {
type Error = String;
fn try_from(src: NvmeArgValues) -> Result<Self, Self::Error> {
le... | Rust | 0 |
IN C API
//
const INPUT_SIZE : usize = 28; // 26 Letters, space, EOL.
const SPACE_CHARACTER : usize = 26;
const TERMINAL_CHARACTER : usize = 27;
const ASCII_a : u8 = 97; // Lower-case is 97.
const ASCII_z : u8 = 122;
const ASCII_SPACE : u8 = 32;
// Helpers.
fn string_to_vector(s : &str) -> Vec<Vec<f32>> {
let mut res... | Rust | 0 |
ve::evaluate::evaluate;
use maeve::io::extract_protobuf;
use maeve::io::prompt_path;
use maeve::load::load;
use maeve::load::new;
use maeve::protos::master::Game;
use maeve::screen::Interfaceable;
use maeve::screen::Screen;
fn menu<I: Interfaceable>(src: &mut I) -> Result<Game, MaeveError> {
loop {
src.pri... | Rust | 0 |
e(f"{xi},{yi},{zi}\n")
def save_projection_images(self, vdw_points_images_path, adsorbate, x, y, z):
os.makedirs(vdw_points_images_path, exist_ok=True)
angles = [(90, 90), (0, 0), (90, 0)]
for i, (az, el) in enumerate(angles):
self.plot_projection_graph(x, y, z, az, el... | Python | 1 |
module.fail_json(msg="SELinux is disabled on this host.")
target = module.params['target']
ftype = module.params['ftype']
setype = module.params['setype']
seuser = module.params['seuser']
serange = module.params['selevel']
state = module.params['state']
do_reload = module.params['reload']... | Python | 1 |
if len(unknown_args)>0:
print("args not recognized: "+str(unknown_args))
raise Exception("Unknown command line arguments")
main()
class TestCtmrg(unittest.TestCase):
def setUp(self):
args.instate=None
args.j2=0.0
args.bond_dim=2
args.chi=16
args.GLOB... | Python | 1 |
y: 0, pixels: &image});
bitmaps.push(Bitmap{w: png.0, h: png.1, x: 0, y: 320, pixels: &png.2});
bitmaps.push(Bitmap {w: 50, h: 50, x: 590, y: 470, pixels: &image2});
bitmaps.push(Bitmap {w: 10, h: 10, x: 630, y: 460, pixels: &image3});
let mut window = Window::new(
"Test - ESC to exit",
... | Rust | 0 |
{x1.shape}, expected [batch,30,h,w]")
if x2.dim() != 4 or x2.size(1) != 1:
print(f"Warning: LiDAR shape mismatch! Got {x2.shape}, expected [batch,1,h,w]")
x2 = x2.unsqueeze(1) # 自动添加通道维度
x1 = self.conv1(x1)
x2 = self.conv4(x2)
x1 = self.conv2(x1)
x2 = s... | Python | 1 |
applying each element against the predicate
* `f` up to `n times.
*/
fn rsplitn<T: Copy>(v: &[T], n: uint, f: fn(T) -> bool) -> ~[~[T]] {
let ln = len(v);
if (ln == 0u) { return ~[] }
let mut end = ln;
let mut count = n;
let mut result = ~[mut ];
while end > 0u && count > 0u {
match r... | Rust | 0 |
match(token_ref) && token_ref.len() > 1
}
//Checks if token is in the list of NEGATION_SCALAR
fn is_negated(token: &UniCase<&str>) -> bool {
if NEGATION_TOKENS.contains(token) {
return true;
}
token.contains("n't")
}
//Normalizes score between -1.0 and 1.0. Alpha value is expected upper limit for ... | Rust | 0 |
ware::Origin;
/// let o1 = Origin::parse("http://exämple.com");
/// let o2 = Origin::parse("hTtP://user:password@eXämpLe.cOm:80/a/path.html");
/// assert_eq!(o1, o2);
/// ```
pub fn parse(s: &str) -> Result<Origin, String> {
match Url::parse(s) {
Err(_) => Err(format!("Could not ... | Rust | 0 |
""" /*
* EJERCICIO:
* - Crea ejemplos de funciones básicas que representen las diferentes
* posibilidades del lenguaje:
* Sin parámetros ni retorno, con uno o varios parámetros, con retorno...
* - Comprueba si puedes crear funciones dentro de funciones.
* - Utiliza algún ejemplo de funciones ya creadas en el ... | Python | 1 |
# LOCAL DEV (ENV VARS)
from pandas import read_csv
from plotly.express import line
from app.alpha_service import API_KEY
from app.email_service import send_email
def fetch_stocks_csv(symbol):
request_url = f"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol={symbol}&apikey={API_KEY}&... | Python | 1 |
MainEventsCleared => {
//! i += if incrementing { step } else { -step };
//! if i >= 1.0 { incrementing = false } else if i <= 0.0 { incrementing = true }
//! window.request_redraw();
//! }
//! Event::RedrawRequested(_) => {
//! viewport.fill_triangle((0.0, 0.0, -0.1), (0.0 + i, -0... | Rust | 0 |
to disk is enabled
pub no_artifacts: bool,
/// Whether writing artifacts to disk is enabled
pub auto_detect: bool,
/// How to handle compiler output
pub artifacts: PhantomData<Artifacts>,
/// Errors/Warnings which match these error codes are not going to be logged
pub ignored_error_codes: V... | Rust | 0 |
atedCompilerOutput::default();
aggregated.extend_all(outputs);
Ok(aggregated)
}
#[cfg(test)]
#[cfg(feature = "project-util")]
mod tests {
use super::*;
use crate::{project_util::TempProject, MinimalCombinedArtifacts};
use std::path::PathBuf;
#[allow(unused)]
fn init_tracing() {
l... | Rust | 0 |
:[1,12,-5,-6,50,3], k = 4
输出:12.75
解释:最大平均数 (12-5-6+50)/4 = 51/4 = 12.75
提示:
1 <= k <= n <= 30,000。
所给数据范围 [-10,000,10,000]。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/maximum-average-subarray-i
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
impl Solution {
pub fn find_max_average(nums: Vec<i32>, k: i32) -> f64... | Rust | 0 |
(2);
}
},
Err(err) => {
println!("Unexpected server response:\n{}", err);
process::exit(1);
}
}
Ok(())
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let args: Vec<String> = env::args().collect();
... | Rust | 0 |
# coding=utf-8
# Author: Wentao Yuan (wyuan1@cs.cmu.edu) 05/31/2018
import argparse
import importlib
import models
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from data_util import resample_pcd
from mpl_toolkits.mplot3d import Axes3D
from open3d import *
tf.reset_default_graph()
d... | Python | 1 |
='lower', aspect='auto',
cmap=cmap, interpolation=interpolation)
plt.colorbar(im, ax=ax[i], orientation="horizontal", label='FK Power')
# Semblance
i += 1
H = np.flipud(np.fliplr(relpow_map.T))
if plot_normalize:
... | Python | 1 |
ponent_metadata):
"""Extracting action checklist of the impact layer to its own report.
For PDF generations
:param impact_report: the impact report that acts as a proxy to fetch
all the data that extractor needed
:type impact_report: safe.report.impact_report.ImpactReport
:param component... | Python | 1 |
import os
from unittest import skipIf
import swapper
from django.contrib.auth import get_user_model
from django.test import TestCase
from .. import settings as app_settings
from ..models import RadiusUserGroup
from . import CreateRadiusObjectsMixin, PostParamsMixin
from .base.test_api import (
BaseTestApi, BaseTe... | Python | 1 |
usize - 1 - i;
view[i / 8] |= if bit { 1 << (i % 8) } else { 0 };
}
F::from_bytes_wide(&bytes)
}
}
impl<F: FieldExt> Iterator for Grain<F> {
type Item = bool;
fn next(&mut self) -> Option<Self::Item> {
// Evaluate bits in pairs:
// - If the first bit is a 1, o... | Rust | 0 |
_1_70B_OL = Model.LLAMA3_1_70B_OL.value
LLAMA3_3_70B = Model.LLAMA3_3_70B.value
LLAMA3_1_70BQ8 = Model.LLAMA3_1_70BQ8.value
LLAMA3_2_1B = Model.LLAMA3_2_1B.value
LLAMA3_2_3B = Model.LLAMA3_2_3B.value
QWEN2_5_7B_OL = Model.QWEN2_5_7B_OL.value
QWEN2_5_7B_FP16 = Model.QWEN2_5_7B_FP16.value
QWEN... | Python | 1 |
StunPkt {
msg_mt: msg_mt,
msg_cl: msg_cl,
msg_len: msg_len,
trans_id: trans_id,
attrs: HashMap::new(),
};
/* Header is always 20 bytes, rest of packet are attributes */
self.parse_attrs(&raw, msg_len as usize, &mut pkt);
Some(... | Rust | 0 |
pub unsafe extern "C" fn Java_java_lang_StackTraceElement_toString(jni_env: *mut JNIEnv, this: jobject) -> jobject {
return match append_param_to_string(jni_env, this) {
Result::Err(err_str) => {
debug!("Stack elem toString err: {}", err_str);
ptr::null_mut()
},
Resul... | Rust | 0 |
target: "dkg_persistence", "Trying to restart dkg for queued validators");
let mut rounds = set_up_rounds(
&best_authorities,
round_id,
&public,
worker.get_signature_threshold(header),
worker.get_keygen_threshold(header),
queued_local_key_path,
);
let _ = rounds.start_keygen(latest_blo... | Rust | 0 |
| Self::Armv8_2a
| Self::Armv8_3a
| Self::Armv8_4a
| Self::Armv8_5a
| Self::Armv8mBase
| Self::Armv8mMain
| Self::Armv8r
| Self::Thumbv6m
| Self::Thumbv7a
| Self::Thumbv7em
| Self::Thumbv7m
... | Rust | 0 |
TLocation> {
fn at(self, pos: TLocation) -> T;
}
impl<T> AtLocation<Locatable<T>, Location> for T {
fn at(self, pos: Location) -> Locatable<T> {
Locatable::new(self, pos)
}
}
impl<T, TLocation: HasLocation> AtLocation<Locatable<T>, &TLocation> for T {
fn at(self, pos: &TLocation) -> Locatable... | Rust | 0 |
assic Mac OS Traditional Chinese encoding maps 0xA5CF to Unicode '\u0x7529' 甩
// ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CHINTRAD.TXT describes the encoding.
// The expected value was determined by examining the glyph table generated by the tx tool
// that is part of https://github.com/adobe-typ... | Rust | 0 |
self.0.str(v)
}
fn none(&mut self) -> stream::Result {
self.0.none()
}
fn map_begin(&mut self, len: Option<usize>) -> stream::Result {
self.0.map_begin(len)
}
fn map_key(&mut self) -> stream::Result {
self.0.map_key()
}
fn map_key_collect(&mut self, k... | Rust | 0 |
}
let mut vec1: Vec<i32> = Vec::new();
let mut vec2: Vec<i32> = Vec::new();
for i in 1..nums.len() {
if nums[i] >= nums[0] {
vec2.push(nums[i]);
} else {
vec1.push(nums[i]);
}
}
let mut result = Self::q... | Rust | 0 |
import os
import base64
import lzma
import time
import unicodedata
import arrow
import pyfiglet
from cryptography.fernet import Fernet
# Exibe ASCII art
def exibir_ascii_art():
ascii_art = pyfiglet.figlet_format("PyEncrypt\nLZMA + Base64\nFernet", font="slant")
print(f"\033[1;92m{ascii_art}\n\033[1;93m")
# Ob... | Python | 1 |
"]
#[inline(always)]
pub fn is_p1ifg7(&self) -> bool {
*self == P1IV_A::P1IFG7
}
}
#[doc = "Write proxy for field `P1IV`"]
pub struct P1IV_W<'a> {
w: &'a mut W,
}
impl<'a> P1IV_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: P1IV_A) -... | Rust | 0 |
key: dummy_spanned(key.to_string()),
value: dummy_spanned(value),
}
}
<reponame>TyberiusPrime/snpdiffrs
//todo: remove these, clean up
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(unused_variables)]
mod chunked_genome;
mod consts;
mod coverage;
mod runner;
#[macro_use]
extern crate lazy... | Rust | 0 |
.await?
.ok_or(MintClientError::OutputNotReadyYet(outpoint))?;
let coins = issuance.finalize(bsig, &self.context.config.tbs_pks)?;
batch.append_from_iter(
coins
.into_iter()
.map(|(amount, coin): (Amount, SpendableCoin)| {
... | Rust | 0 |
map_from_slice(&[
(Atom::str_to_term("b"), process.integer(2)),
(Atom::str_to_term("c"), process.integer(2)),
])
},
First,
);
}
#[test]
fn with_same_map_returns_first() {
max(|first, _| first, First);
}
#[test]
fn with_same_value_map_returns_first() ... | Rust | 0 |
Sample {
wait_time: u64,
local_mean: f64
}
/*
*
* The population estimate represents what we need
* to help in computing zTest results. A population estimate object contains:
*
* population_estimate (float): The population estimate for the corresponding
* block
* previous_block_id (str): The ID of the blo... | Rust | 0 |
urn: A string describing the SplitCamera and its component models
"""
return f'SplitCamera:\n\nModel 1:\n{self.model1.__str__()}\n\nModel 2:\n{self.model2.__str__()}'
def __repr__(self):
"""
Return a string representation of the SplitCamera object that can be used to recreate th... | Python | 1 |
*/
/* *
* @ingroup iface_xdg_positioner
*/
/* *
* @ingroup iface_xdg_positioner
*/
/* *
* @ingroup iface_xdg_positioner
*/
/* *
* @ingroup iface_xdg_positioner
*/
/* *
* @ingroup iface_xdg_positioner
*/
/* *
* @ingroup iface_xdg_positioner
*/
pub type xdg_surface_error = libc::c_uint;
pub const XDG_SURFACE... | Rust | 0 |
raise HTTPException(status_code=404, detail="Conversation not found")
# Validate message index
if message_index < 0 or message_index >= len(conversation.messages):
raise HTTPException(status_code=404, detail="Message not found")
# Update feedback in the m... | Python | 1 |
from guizero import App, Box, Text, PushButton
def hide1():
t1.hide()
def show1():
t1.show()
def hide2():
t2.hide()
def show2():
t2.show()
def destroy3():
t3.destroy()
def hide(widget):
widget.hide()
def show(widget):
widget.show()
a = App()
b = Box(a, layout="grid")
b.border = True
... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResPartner(models.Model):
_inherit = 'res.partner'
def _can_edit_name(self):
""" Name can be changed more often than the VAT """
self.ensure_one()
return T... | Python | 1 |
match="the failure message"):
with raises(TypeError, match="hello", err_msg="the failure message") as cm:
raise TypeError("Bad message")
assert not cm.raised_and_matched
# no raise with default may_pass=False
with pytest.raises(AssertionError, match="Did not raise"):
with raises... | Python | 1 |
rseErrorKind::UnexpectedTokenKind {
found: found_kind,
expected: expected_kind.into(),
})
}
pub fn bad_response(response: ResponseError, invoked_cmd: Command) -> Self {
Self::from(CommandResponseError::new(response, invoked_cmd))
}
}
//!
//! # Delete Topic Request
//... | Rust | 0 |
# 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, software
# distributed under t... | Python | 1 |
me}" field, but found {found} elements in record"#,
)]
FieldSizeMismatchError {
field_name: String,
expect: usize,
found: usize,
},
#[error("record has {expect} fields, but the line has {found} tokens")]
TextTokenMismatchError { expect: usize, found: usize },
#[error("Inv... | Rust | 0 |
tiffness_mask
indices, values = self.stiffness_on_batch(batch, radius=radius, p=p)
stiffness_indices.append(indices)
stiffness_values.append(values)
stiffness_indices = torch.cat(stiffness_indices, dim=1)
stiffness_values = torch.cat(stiffness_values)
... | Python | 1 |
"""Test the peptide transformers."""
import pytest
import torch
from depthcharge.tokenizers import PeptideTokenizer
from depthcharge.transformers import (
AnalyteTransformerDecoder,
AnalyteTransformerEncoder,
SpectrumTransformerEncoder,
)
@pytest.mark.filterwarnings("error")
@pytest.mark.parametrize(
... | Python | 1 |
from django.urls import include, path
from rest_framework import routers
from api import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
router.register(r'tags', views.TagViewSet)
router.register(r'category', views.CategoryViewSet)
rou... | Python | 1 |
# Mobile Verification Toolkit (MVT)
# Copyright (c) 2021-2023 The MVT Authors.
# Use of this software is governed by the MVT License 1.1 that can be found at
# https://license.mvt.re/1.1/
import logging
import os
import sqlite3
from typing import Optional, Union
from mvt.common.utils import convert_chrometime_to_da... | Python | 1 |
unwrap();
}
#[test]
fn call_execute_works() {
let mut instance = mock_instance(&CONTRACT, &[]);
// init
let info = mock_info("creator", &coins(1000, "earth"));
let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#;
call_instantiate::<_, _, _, Empty>(&m... | Rust | 0 |
, other: &Self) -> std::cmp::Ordering {
self.name.cmp(&other.name)
}
}
impl Display for NameP {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.name)
}
}
<reponame>fedir-molchan/exonum
// spell-checker:ignore rustc, walkdir
extern crate protoc_rust... | Rust | 0 |
-> Self {
let beep = block_on(load_sound_from_bytes(include_bytes!(
"../../../assets/sounds/beep.wav"
)))
.unwrap();
Self { beep }
}
}
impl Default for MQAudioDriver {
fn default() -> Self {
Self::new()
}
}
impl AudioInterface for MQAudioDriver {
f... | Rust | 0 |
lueRef::Integer(i) => Ok(Some(i)),
_ => Err(FromSqlError::InvalidType),
}
}
/// If `self` is case `Real`, returns the floating point value. Otherwise,
/// returns [`Err(Error::InvalidColumnType)`](crate::Error::
/// InvalidColumnType).
#[inline]
pub fn as_f64(&self) -> FromS... | Rust | 0 |
ake_i32("content size")?;
let content_crc = self.core.take_u32("content crc")?;
let content_data = self.core.view_data(content_size as usize).map_err(|e| {
ParseError::ParseError("content data", self.core.bytes_read(), Box::new(e))
})?;
let body = self.crc_section(content_d... | Rust | 0 |
args.get(0).cloned().ok_or_else(|| {
EvalError::AvlTree("eval is missing first arg (new_digest)".to_string())
})?;
let bytes_vec = v.try_extract_into::<Vec<u8>>()?;
ADDigest::try_from(bytes_vec).map_err(map_eval_err)?
};
avl_tree_data.digest = new_digest;
Ok(Value::AvlTr... | Rust | 0 |
y_clipping;
// mod style_system_new;
// pub(crate) use style_system_new::apply_styles2;
mod hover_system;
pub use hover_system::*;
mod new_layout;
pub(crate) use new_layout::*;
mod layer_system;
pub use layer_system::*;
// pub mod draw_system;
// pub use draw_system::*;
<filename>src/lib.rs<gh_stars>0
extern crat... | Rust | 0 |
VkStructureType_VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR: VkStructureType =
1000244001;
pub const VkStructureType_VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR:
VkStructureType = 1000257002;
pub const VkStructureType_VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR:
... | Rust | 0 |
ext/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'accept-language': 'en-US,en;q=0.9',
'cache-control': 'max-age=0',
# 'cookie': 'datr=2aiJZdN1lkgP_N9wcM9K6I-K; sb=2aiJZchYyvjbzFREUwwptmj_; m_pixel... | Python | 1 |
+= self.beta * torch.mean(
deltas[true_label == cls_no], dim=0
)
class entropic_openset_loss:
def __init__(self, num_of_classes=10):
self.num_of_classes = num_of_classes
self.eye = tools.device(torch.eye(self.num_of_classes))
self.ones = tools.device(torch.ones... | Python | 1 |
s.insert(0, i[rest/factor:])
buf = []
y = 0
continue
else:
_add_line(t, step + ' '.join(buf))
# t.append(step + ' '.join(buf))
x = 1
s.insert(0, i)
... | Python | 1 |
dget() {
let checkbox = Checkbox::new("Hello", false);
Harness::run_test_window(checkbox, |harness| {
let checkbox_state = harness.get_root_debug_state();
assert_debug_snapshot!(checkbox_state);
let new_checkbox = Checkbox::new("Hello", true);
harness.up... | Rust | 0 |
command!(
ExprAggGroups,
"dfr agg-groups",
"creates an agg_groups expression",
vec![Example {
description: "",
example: "",
result: None,
}],
agg_groups
);
// ExprFlatten command
// Expands to a command definition for a flatten expression
expr_command!(
ExprFlatten,
... | Rust | 0 |
"""
Celery tasks for fetching glucose data.
"""
import logging
from datetime import datetime
from typing import List, Dict, Any
from celery import Task
from app.celery_app import celery_app
from app.services.librelinkup import llu_service
from app.services.database import db_service
# Set up logging
logging.basicCo... | Python | 1 |
return self._TotalCount
@TotalCount.setter
def TotalCount(self, TotalCount):
self._TotalCount = TotalCount
@property
def AddressSet(self):
return self._AddressSet
@AddressSet.setter
def AddressSet(self, AddressSet):
self._AddressSet = AddressSet
@property
... | Python | 1 |
shot")
p.add('--eval_it', type=int, default=1000, help="Num iterations to evaluate result")
p.add('--export_it', type=int, default=5000, help="Num iterations to export mesh data")
p.add('--avg_loss_it', type=int, default=100, help="Num iterations for average loss")
def make_run_args(p: configargparse.ArgP... | Python | 1 |
v_list += [np.array([[(D02+D12)/np.sqrt(2.0*(1.0+d)),(D02-D12)/np.sqrt(2.0*(1.0-d)),np.sqrt(1.0-a)]])]
rho = []
for state in v_list:
rho += [np.kron(np.conjugate(np.transpose(state)),state)]
start = time.process_time()
#Run the SDPs (either the Primal or the Dual)... | Python | 1 |
RaisuPalace = [
(24090.0, 1284.0),
(24090.0, 5505.0),
(19992.0, 7624.0),
(16662.0, 8435.0),
(12694.0, 8359.0),
(12877.0, 10123.0),
(13675.0, 13132.0),
(11175.0, 10204.0),
(8420.0, 6489.0),
(7214.0, 5342.0),
(4900.0, 6273.0),
(2191.0, 5494.0),
(1354.0, 6217.0),
(-3... | Python | 1 |
.py"
script_content = f'''#!/bin/bash
cd "{self.project_path}"
{sys.executable} {script_to_run}
'''
with open(executable_path, 'w', encoding='utf-8') as f:
f.write(script_content)
# Make executable
os.chmod(executable_path, 0o755)
print(f"✅... | Python | 1 |
eprintln!("{}", e);
},
};
1
},
}
}
fn write_streams(
mut stdout: &mut StdoutLock,
mut stderr: &mut StderrLock,
chunks: &[(Stream, Vec<u8>)],
) {
for (stream, bs) in chunks {
let out =
match stream {
Stream:... | Rust | 0 |
.)
# ----- Resize uv
xs, ys = np.max(mesh.corners.UVMap, axis=0)
mesh.corners.UVMap *= uv_size[0]/xs, uv_size[1]/ys
return mesh
# =================================================================================================... | Python | 1 |
b::GString;
use glib::Value;
use glib_sys;
use gobject_sys;
use nm_sys;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
use Setting;
use SettingSecretFlags;
glib_wrapper! {
pub struct SettingGsm(Object<nm_sys::NMSettingGsm, nm_sys::NMSettingGsmClass, SettingGsmClass>) @extends Setting;
mat... | Rust | 0 |
true;
let _ans1 = JIA3 && YI3;
let BING3 = _ans1;
let _ans2 = JIA3 || YI3;
let BING3 = _ans2;
let _ans3 = !JIA3;
let BING3 = _ans3;
}
mod game;
mod menu;
mod matchmaking;
mod util;
mod connection;
mod controls;
mod buttons;
mod persistent;
mod stats;
use quicksilver::{
Result,
geom::{T... | Rust | 0 |
# -*- coding: utf-8 -*-
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)"
__copyright__= "Copyright 2015, LCPT and AOO"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
import geom
from materials.ehe import EHE_materials
width= 0.2 # Section width expressed in meters.
depth= 0.4 # ... | Python | 1 |
.frames_received();
self.parser.restart();
while elapsed.as_millis() < 2000 {
let mut read_buffer = [0u8; 1024];
let res = port.read(&mut read_buffer[..]);
if let Ok(bytes_read) = res {
let data = read_buffer[0..bytes_read].to_vec();
/... | Rust | 0 |
ice = None
try:
if ticker:
last_price = float(ticker.get('lastPrice') or 0)
change_pct = float(ticker.get('priceChangePercent') or 0)
high_price = float(ticker.get('highPrice') or 0)
low_price = float(ticker.get(... | Python | 1 |
PUBLIC_LENGTH]);
pub struct Signature/signature(pub [u8; SIG_LENGTH]);
}
#[inline]
pub fn keypair<R: RngCore + CryptoRng>(mut rng: R) -> (SecretKey, PublicKey) {
let mut sk = [0; SECRET_LENGTH];
let mut pk = [0; PUBLIC_LENGTH];
rng.fill_bytes(&mut sk);
unsafe {
ffi::ed25519::Hacl_Ed25519... | Rust | 0 |
so please ensure that the content wrapped in {} remains the same in both the new and old prompts. Avoid adding or removing variables as much as possible.
2. Ensure that your outputted new prompt template can be directly converted to a dictionary using the json.loads() method, so you need to pay attention to the use of... | Python | 1 |
# Copyright (c) 2014-2015 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse.org/legal/epl-v10.html
#
#... | Python | 1 |
import os
import requests
# ----[USER CUSTOM CONFIG]----
# App Config
LANGUAGE = 'fr'
# App LLM Config
LLM_CHOOSE = "llama3.1:latest"
LLM_REFLEXION = "wizardlm2:latest"
REFLEXION = True
# ----[SYSTEM CONFIG]----
# App Paths
PATH_CONFIG_FILE = 'app/CONFIG.py'
PATH_ICON_LOGO_AUXILIUM = 'app/ressources/auxilium-logo.pn... | Python | 1 |
EnvBuilder::new().with_pot(100000).execute(|| {
// Max bids is 1000, when extra bids come in, it pops the larger ones off the stack.
// Try to put 1010 users into the bid pool
for i in (100..1110).rev() {
// Give them some funds
let _ = Balances::make_free_balance_be(&(i as u128), 1000);
assert_ok!(Soci... | Rust | 0 |
/// .done();
/// }
/// }
///
/// // Now, wrap the method (this can do anything and does not need to actually call a method)
/// struct MyMethod;
/// impl Method<MyType> for MyMethod {
/// fn call(&self, this: TInstance<'_, MyType, Shared>, _args: Varargs<'_>) -> Vari... | Rust | 0 |
~5..HEAD"],
cwd=pathlib.Path.cwd()
).decode().strip().split('\n')
return {
"commits_last_week": len(week_ago) if week_ago[0] else 0,
"active_authors": list(unique_authors),
"recently_changed_files": len([f for f in changed_files if f]),
... | Python | 1 |
();
if use_s3 {
config_lines.push("#define ENABLE_S3 1");
cfg.file("htslib/hfile_s3.c");
println!("cargo:rerun-if-changed=htslib/hfile_s3.c");
cfg.file("htslib/hfile_s3_write.c");
println!("cargo:rerun-if-changed=htslib/hfile_s3_write.c");
}
// write out config.h whi... | Rust | 0 |
_class: _,
online: _,
addresses: _,
has_default_ipv4_route: _,
has_default_ipv6_route: _,
}) => {
assert_eq!(*id, router_ep2_id);
name.clone()
}
fnet_interfaces_ext::InterfaceState::Unknow... | Rust | 0 |
y_interface::{DataFormat::U8, DisplayError, WriteOnlyDataCommand};
/// Holds commands which can be sent to the display.
pub enum Command {
Unlock0x12,
Unlock0xB1,
DisplayOff,
ClockDivider,
Muxratio,
ColumnAddress,
RowAddress,
SegmentRemapping,
DisplayStartLine,
DisplayOffset,
... | Rust | 0 |
primitive.to_string()
}
}
}
#[cfg(test)]
mod tests {
use super::JSONExtractor;
fn get_value() -> serde_json::Value {
json!({
"root": {
"obj": {
"strKey": "str1",
"intKey": 1
},
"arr"... | Rust | 0 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/collect_daily_bonus_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message ... | Python | 1 |
m.commit()?;
let mut m = tline.begin_modification(Lsn(0x30));
walingest.put_rel_page_image(&mut m, TESTREL_A, 0, TEST_IMG("foo blk 0 at 3"))?;
m.commit()?;
let mut m = tline.begin_modification(Lsn(0x40));
walingest.put_rel_page_image(&mut m, TESTREL_A, 1, TEST_IMG("foo blk 1 at 4... | Rust | 0 |
# 📚 Python Program to Count Frequency of Elements in a List
'''
This program counts the frequency of each element in a list of numbers.
'''
def count_frequency(numbers):
# Initialize an empty dictionary to store frequency
frequency = {}
# Iterate through the list and count occurrences
for num in n... | Python | 1 |
)
# Creating a list of prompts for the Knowledge Base section
knowledge_base_prompts = [
{"Prompt": "Webscrape this url and tell me the main features of pikachu 'https://www.pokemon.com/us/pokedex/pikachu'"},
{"Prompt": "Webscrape this url and tell me the main villians that Goku had to fight on planet earth 'h... | Python | 1 |
fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'sta... | Rust | 0 |
pub storage_profile: StorageProfile,
#[doc = "Settings for terminal appearance."]
#[serde(rename = "terminalSettings")]
pub terminal_settings: TerminalSettings,
#[doc = "The shell type of the cloud shell."]
#[serde(rename = "preferredShellType")]
pub preferred_shell_type: user_properties::Pre... | Rust | 0 |
..max_size).contains(&y),
"y should be between 0 and {}",
max_size - 1
);
}
fn to_grid_coordinates(x: usize, y: usize) -> (usize, usize) {
(x / SUBGRID_SIZE, y / SUBGRID_SIZE)
}
fn to_subgrid_coordinates(x: usize, y: usize) -> (usize, usize) {
(x % GRID_SIZE, y % GRID_SIZE)
}
#[cfg(test)]... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.