text string | label_name string | labels int64 |
|---|---|---|
used for sending requests and receiving responses
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub(super) enum Action {
/// Recalculate the current `Segmentation` based on a changed aggregation
RecalculateSegmentation,
/// Push a new `Segmentation`
PushSegmentation,
/// Load the mails for the curre... | Rust | 0 |
{debate_data['pros']}```",
inline=False
)
embed.add_field(
name="🔴 Opposing Arguments",
value=f"```{debate_data['cons']}```",
inline=False
)
embed.add_field(
name="💡 Join The Discussion",
... | Python | 1 |
repo_type="dataset",
)
print(f"Downloaded {csv_file_name} to {csv_file_path}")
else:
print(f"Using existing {csv_file_name}")
parent_to_child_map = {}
with open(csv_file_path, "r", encoding="utf-8") as f:
reader = csv.reader(f)
... | Python | 1 |
{
a: 123,
g: NiL
}
INTO d6ca73c0-41ff-4975-8a60-fc4a061ce536",
);
assert_eq!(
wql.err().unwrap(),
String::from("MATCH UPDATE type is required after entity. Keyword is SET")
);
}
#[test]
fn match_update_missing... | Rust | 0 |
spawn(fut);
Ok(())
}));
Addr::new(stx)
}
}
impl Handler<StopArbiter> for Arbiter {
type Result = ();
fn handle(&mut self, msg: StopArbiter, _: &mut Context<Self>) {
if let Some(stop) = self.stop.take() {
let _ = stop.send(msg.0);
}
... | Rust | 0 |
А -> A
0x412: [0x42], # В -> B
0x413: [0x393], # Г -> Γ
0x415: [0x45], # Е -> E
0x41A: [0x4B], # К -> K
0x41C: [0x4D], # М -> M
0x41D: [0x48], # Н -> H
0x41E: [0x4F], # О -> O
0x41F: [0x3A0], # П -> Π
0x420: [0x50], # Р -> P
0x421: [0x43], # С -> C
0x422: [0x54], ... | Python | 1 |
import json
import re
import subprocess
import sys
def transform_json(input_json):
# Extracting values from the input JSON object
subject_val = input_json.get("subject", "")
predicate_val = input_json.get("relation", "") # Using 'relation' value as the new 'predicate'
object_val = input_json.get("obje... | Python | 1 |
reg_vars.keys()])
with tf.Session() as sess:
# set the appropriate variables for the codebook embeddings
for var_name in cb_books.keys():
print(f"setting codebook/codes for {var_name}")
sess.run([
tf.assign(sess.graph.get_tensor_by_name(var_name + "/codebooks... | Python | 1 |
"""
Example script demonstrating how to train different agents
in the Home Quest environment.
"""
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from framework import load_game_data, newGame, step_game
from agents.agent_dqn import DQNAgent
from agents.agent_linear im... | Python | 1 |
(2, 'c'), (3, 'b')];
assert!(rposition_between(v, 0u, 0u, f).is_none());
assert!(rposition_between(v, 0u, 1u, f).is_none());
assert!(rposition_between(v, 0u, 2u, f) == Some(1u));
assert!(rposition_between(v, 0u, 3u, f) == Some(1u));
assert!(rposition_between(v, 0u, 4u, f) == Som... | Rust | 0 |
uilder {
fn as_ref(&self) -> &SearchEmojis { &self.inner }
}
/// Searches for recently used hashtags by their prefix
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SearchHashtags {
#[doc(hidden)]
#[serde(rename(serialize = "@type", deserialize = "@type"))]
td_name: String,
/// Hash... | Rust | 0 |
from aiogram.fsm.state import StatesGroup, State
class QuestionState(StatesGroup):
question = State()
from_message_id = State()
| Python | 1 |
&Template::GroupDeleted(group_name.to_string(), host_profile.username),
);
Ok(())
}
pub async fn update_group_trust(
pool: &Pool,
scope_and_user: &ScopeAndUser,
group_name: &str,
trust: &TrustType,
cis_client: Arc<impl AsyncCisClientTrait>,
) -> Result<(), Error> {
let connecti... | Rust | 0 |
itr.next().unwrap();
assert_eq!(itm.key(), TKey::new());
assert_eq!(itm.value(), 1.0);
let itm = itr.next().unwrap();
assert_eq!(itm.key(), TKey::from_letter(1));
assert_eq!(itm.value(), 2.0);
let itm = itr.next().unwrap();
assert_eq!(itm.key(), TKey::from_lett... | Rust | 0 |
[OffenceDetails {
offender: (11, Staking::eras_stakers(active_era(), 11)),
reporters: vec![],
}],
&[Perbill::from_percent(20)],
2,
DisableStrategy::WhenSlashed,
);
// 11 was further slashed, but 21 and 101 were not.
assert_eq!(Balances::free_balance(11), 800);
assert_eq!(Balances::free_bala... | Rust | 0 |
from .Secret_Manager import *
from .ADO_Utilities import * | Python | 1 |
wasmer_runtime_core::{
structures::TypedIndex,
types::{FuncIndex, SigIndex},
};
pub mod call_names {
pub const LOCAL_NAMESPACE: u32 = 1;
pub const IMPORT_NAMESPACE: u32 = 2;
pub const SIG_NAMESPACE: u32 = 3;
pub const STATIC_MEM_GROW: u32 = 0;
pub const STATIC_MEM_SIZE: u32 = 1;
pub c... | Rust | 0 |
hours)
for i, hour in enumerate(preictal_hours):
for clip in hour:
x_train.append(np.reshape(clip, (1, clip.shape[0] * clip.shape[1] * clip.shape[2])))
colors.extend([cmap(i)] * len(hour))
markers.extend([marker_list[i]] * len(hour))
for i, hour in enumerate(interictal_hours... | Python | 1 |
_run::docker;
use crate::docker_run::unix_stream;
use crate::docker_run::debug;
#[derive(Debug)]
pub struct RunRequest<Payload: Serialize> {
pub container_config: docker::ContainerConfig,
pub payload: Payload,
pub limits: Limits,
}
#[derive(Clone, Debug)]
pub struct Limits {
pub max_execution_time: ... | Rust | 0 |
te::common::gui_access::findFileChooserDialog;
use crate::common::gui_assertions::{
assertCommitLogViewContentIs, assertCommitLogViewIsEmpty, assertRepositoryPathLabelTextIs, makeCommitLogRow};
use crate::common::gui_interactions::{acceptDialog, clickChooseRepositoryFolderButton, setCurrentFolderInDialog};
use crat... | Rust | 0 |
ice` handle for the slice domain the `BitPtr` represents.
///
/// # Examples
///
/// This example is crate-internal, and cannot be used by clients.
///
/// ```rust
/// # #[cfg(feature = "testing")] {
/// use bitvec::testing::*;
///
/// let store: &[u8] = &[1, 2, 3];
/// let bp = BitPtr::new(store.as_ptr(), 3... | Rust | 0 |
xcept Exception as e:
if 'No stats.' not in repr(e):
logs.error('Failed to preload %s %s %s %s %s.' %
(fuzzer, job_filter, group_by, date_start, date_end))
class RefreshCacheHandler(base_handler.Handler):
"""Refresh cache."""
@handler.cron()
def get(self):
"""Ha... | Python | 1 |
}',
"styl" => '\u{e600}',
"tex" => '\u{e600}',
"tgz" => '\u{f16b}',
"ts" => '\u{e628}',
"twig" => '\u{e61c}',
"txt" => '\u{f15c}',
"txz" => '\u{f16b}',
"video" => '\u{f03d}',
"... | Rust | 0 |
from django.forms import ModelForm, IntegerField, Form, CharField
from main.models import Profile
class ProfileAddForm(ModelForm):
id_user = IntegerField(required=True)
class Meta:
model = Profile
fields = ['name', 'age', 'city']
class ProfileDeleteForm(Form):
id_profile = IntegerField(... | Python | 1 |
ent = (
f"✅ `{tool_name}` result:\n\n"
f"{json.dumps(tool_result, indent=2)}\n\n"
f"Ready to analyze each file: {len(file_tool_calls)} tool calls planned."
)
for call in file_tool_calls:
... | Python | 1 |
from datetime import datetime
from pydantic import BaseModel
from sqlalchemy import Column, Integer, Float, DateTime, Boolean, ForeignKey, func, CheckConstraint
from sqlalchemy.orm import relationship
from models.base import Base
class Buy(Base):
__tablename__ = 'buys'
id = Column(Integer, primary_key=True... | Python | 1 |
from os.path import join
from pythonforandroid.recipe import MesonRecipe
class PandasRecipe(MesonRecipe):
version = 'v2.3.0'
url = 'git+https://github.com/pandas-dev/pandas'
depends = ['numpy', 'libbz2', 'liblzma']
hostpython_prerequisites = ["Cython<4.0.0a0", "versioneer", "numpy"] # meson does not ... | Python | 1 |
is_partial = event.get("partial", True)
# ---- FIX FOR DUPLICATION IS HERE ----
# If the message is partial, append it (streaming).
# If it's not partial, it's the final complete... | Python | 1 |
55, 55, 48, 56, 50, 97, 52, 48, 48, 57, 53, 51, 51, 49, 34, 44, 34, 97, 99, 99, 111, 117, 110, 116, 95, 105, 100, 34, 58, 34, 99, 104, 97, 114, 108, 105, 101, 45, 111, 99, 116, 111, 112, 117, 115, 46, 116, 101, 115, 116, 110, 101, 116, 34, 44, 34, 119, 101, 105, 103, 104, 116, 34, 58, 34, 49, 48, 48,
48, 48, 48, ... | Rust | 0 |
_export]
macro_rules! profile {
($name:tt) => {
let _deferred = $crate::FrameTimer::new(concat!($name, " ", file!(), ":", line!(), ",", column!()));
};
}
#[cfg(not(feature = "profiling"))]
#[macro_export]
macro_rules! profile {
($name:tt) => {};
}
// Implementation detail! Users of the crate shoul... | Rust | 0 |
shape=(1,num_hidden)),
c2o_bias = mx.sym.Variable("l%d_c2o_bias" % i, shape=(1, num_hidden))
))
state = LSTMState(c=mx.sym.Variable("l%d_init_c" % i),
h=mx.sym.Variable("l%d_init_h" % i))
last_states.appe... | Python | 1 |
"""
Copyright 2018 The Matrix Authors
This file is part of the Matrix library.
The Matrix library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any la... | Python | 1 |
asetName::try_from("repo.name/local.id").unwrap();
assert_eq!(dr.dataset(), "local.id");
assert_eq!(dr.account(), None);
assert_eq!(dr.repository(), "repo.name");
assert_matches!(RemoteDatasetName::try_from("repo.name/.invalid"), Err(_));
assert_matches!(RemoteDatasetName::try_from(".invalid/local.... | Rust | 0 |
tion (int/float): 时长。
intensity (int/float): 平移强度,单位为像素。
direction (str): 平移方向,支持 'left', 'right'。
返回:
VideoClip: 模拟摄像机的绕z轴旋转的新视频剪辑。
"""
w, h = clip.size
original_size = (w, h)
def make_frame(t):
frame = clip.get_frame(t)
frame = fisheye_distortion(f... | Python | 1 |
52052, 52152, 52852, 55022, 55122, 55822, 56092, 56192, 56892, 58082, 58182, 58882,
59062, 59162, 59862, 60009, 60109, 60809, 61019, 61119, 61819, 62059, 62159, 62859,
65029, 65129, 65829, 66099, 66199, 66899, 68089, 68189, 68889, 69069, 69169, 69869,
80008, 80108, 80808,... | Rust | 0 |
import os
from pathlib import Path
import pandas as pd
from sp500.sentiment_analysis.visualization.create_word_cloud import create_wordcloud, map_stock_names_to_company_names
PICTURE_PATE = os.path.dirname(os.path.abspath(__file__))
COMPANY_LOGO_PATHS = {
"AAPL": os.path.join(PICTURE_PATE, "saved_pictures", "app... | Python | 1 |
Do not mention anything else, just summarize a precise, clear and helpful answer.
Do not make things up or add any information on your own.
CHAT HISTORY: {history}
QUESTION: {question}
RETRIEVED CONTEXT: {retrieved_context}
QUERY RESULT ON GRAPH: {query_result}
... | Python | 1 |
\xd7\xb1\xb3\
\xc7u\x04.\xd2]\x80\xa6\xdaF\x04\xa40?\x9ae\
\x85\xa4\x8e[\xaf1aQ#`\xb1V\x0a\x01T\xd5\
a\xf1%\xae\x87,zW\x95u\xabA\x86c|\xc2\
\x0bT\x8d\x8c[f\x10\xb1\xd9\xb8&\xf0\xf0\xb3<\xa4\
G\xbd\x10\xe5r\x97\x91\xbe\x8fp\xf6\xd1\xdc\xc1u\x0d\
\xcd\xbcZ\x84zd\xcb<R[\x14U\x133\x07\x08\
\x8e\x17\x7f\x97\x18\x96}\xa4\xa9... | Python | 1 |
import argparse
import random
import time
import requests
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--host", type=str, default="http://127.0.0.1")
parser.add_argument("--port", type=int, default=None)
parser.add_argument("--backend", type=str, default="srt")
... | Python | 1 |
d3d12::D3D12_RESOURCE_UAV_BARRIER {
pResource: barrier.texture.resource.as_mut_ptr(),
};
self.temp.barriers.push(raw);
}
}
if !self.temp.barriers.is_empty() {
self.list
.unwrap()
.ResourceBarrie... | Rust | 0 |
import pytest
from django.test import Client
@pytest.fixture
def client():
return Client()
@pytest.fixture
def create_product():
from shop.models import Product, Category
def _create_product(name, price):
category = Category.objects.create(name="Test Category")
return Product.objects.creat... | Python | 1 |
ascii=False, indent=2),
encoding="utf-8"
)
print(f"세션 저장 완료: {session_file}")
await browser.close()
async def automated_login_with_csrf(self):
"""CSRF 토큰을 올바르게 처리하는 자동 로그인"""
print("\n[자동 로그인 - CSRF & CAPTCHA 처리]")
print("... | Python | 1 |
30", "4.13.32",
"4.13.34", "4.13.36", "4.3.3", "4.3.11", "4.14.2", "4.14.3", "4.14.6",
"4.14.8", "4.14.9", "4.7.4", "4.7.5",
]
.contains(&case_name.as_str())
{
panic!("Unexpected result fo... | Rust | 0 |
pend_stream, str(i), i, datetime.now()) for i in range(5, 10)] + [
_record(overwrite_stream, str(i), i, datetime.now()) for i in range(5, 10)
]
expected_states = [first_state_message, second_state_message]
output_states = list(
destination.write(
config, configured_catalog, [*fi... | Python | 1 |
# This is DMOJ problem wc16c1j1
# https://dmoj.ca/problem/wc16c1j1
# C.C. will be absolutely satisfied if the pizza she gets has a width of 3 units and an extra-cheesiness of at least 95 % .
# C.C. will be fairly satisfied if the pizza she gets has a width of 1 unit and an extra-cheesiness of at most 50 % .
# ... | Python | 1 |
# Copyright 2023 Flavien Solt, ETH Zurich.
# Licensed under the General Public License, Version 3.0, see LICENSE for details.
# SPDX-License-Identifier: GPL-3.0-only
# This script generates many Cascade ELFs.
from analyzeelfs.genmanyelfs import gen_many_elfs
from params.runparams import PATH_TO_TMP
import os
import ... | Python | 1 |
PSECURITY_DESCRIPTOR,
OptionalSecurityDescriptorArray: *mut PSECURITY_DESCRIPTOR,
OptionalSecurityDescriptorCount: DWORD,
pReply: *mut AUTHZ_ACCESS_REPLY,
phAccessCheckResults: *mut AUTHZ_ACCESS_CHECK_RESULTS_HANDLE
) -> BOOL;
pub fn AuthzCachedAccessCheck(
Flag... | Rust | 0 |
Value and their type representation
#[derive(Debug, Clone)]
pub struct ValueType {
pub value: LetValueName,
pub value_type: Option<BuildInTypes>,
}
impl<'a> Codegen<'a> {
#[allow(clippy::ptr_arg)]
fn new(ast: &'a Main) -> Self {
Self {
ctx: Context::new(),
global_ctx: C... | Rust | 0 |
let mut sig = [0u8; constants::SIGNATURE_LENGTH];
let mut public_key = [0u8; constants::PUBLIC_KEY_LENGTH];
let private_key = [0u8; constants::PRIVATE_KEY_LENGTH];
let message = b"message";
let context1 = b"Context 1 2 3";
let context2 = b"Context 1 2 3 4";
sign(&mut si... | Rust | 0 |
ValueEntry>, StoryDiscoverError>> {
LocalFutureObj::new(Box::new(async move {
let (snapshot, server_end) = fidl::endpoints::create_proxy::<PageSnapshotMarker>()
.map_err(|_| StoryDiscoverError::Storage)?;
self.page
.get_snapshot(server_end, &mut prefix.byt... | Rust | 0 |
points.hitchOLB
hitchORB = plan.points.hitchORB
hitchOLF = plan.points.hitchOLF
hitchORF = plan.points.hitchORF
self.outlineO.add(
cornerArc2D(hitchRadius, thumbOLF, hitchOLB, hitchOLF),
cornerArc2D(hitchRadius, hitchOLB, hitchOLF, hitchORF... | Python | 1 |
ExternalLinkAlt => fas("fa-external-link-alt"),
InfoCircle => fas("fa-info-circle"),
OutlinedQuestionCircle => far("fa-question-circle"),
Pause => fas("fa-pause"),
Play => fas("fa-play"),
PlusCircleIcon => fas("fa-plus-circle"),
QuestionCircle => fas("fa-question-circle"),
Times => f... | Rust | 0 |
escription, category)
texinfo_documents = [
(
master_doc,
"VotingInformationProjectSpecification",
"Voting Information Project Specification Documentation",
author,
"VotingInformationProjectSpecification",
"Standard for open election data",
"Miscellaneous",
... | Python | 1 |
ON CONFLICT (key) DO UPDATE SET value = $2 WHERE metadata.key = $1;",
)
.bind(&self.key)
.bind(&self.value)
.execute(db)
.await?;
Ok(())
}
async fn get(db: impl Executor<'_, Database = Postgres>, key: &str) -> Result<T, Error> {
let metadata:... | Rust | 0 |
ern crate cortex_m;
extern crate cortex_m_rt as rt;
extern crate embedded_graphics;
extern crate embedded_hal as ehal;
extern crate panic_semihosting;
extern crate ssd1351;
extern crate stm32l4xx_hal as hal;
use ehal::spi::{Mode, Phase, Polarity};
use hal::delay::Delay;
use hal::prelude::*;
use hal::spi::Spi;
use hal:... | Rust | 0 |
错误信息。
let tt = multiply("t", "2");
print(tt);
}
fn result_test2() {
fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {
let first_number = first_number_str.parse::<i32>()?;
let second_number = second_number_str.parse::<i32>()?;
Ok(first_numb... | Rust | 0 |
rom)
with open(os.path.join(args.start_from, 'infos.pkl')) as f:
infos = cPickle.load(f)
# override and collect parameters
opt = infos['opt']
for k in vars(args).keys():
if k in vars(opt):
vars(opt).update({k: vars(args)[k]}) # copy over options from model
else:
... | Python | 1 |
0-3][pile 0-6]
*/
// TODO: Stats, StatsReset
pub enum Command {
ShowHelp,
Retire,
Quit,
DrawFromStock,
WasteToFoundation,
AutoFinish,
WasteToPile{pile_index: u8},
PileToFoundation{pile_index: u8},
PileToPile{src_pile: u8, dest_pile: u8},
FoundationToPile{foundation_index: u8, pile_index: u8},
}
... | Rust | 0 |
e: Keyed<Key>,
{
fn locate(&self, _left: D::Summary, node: &D::Value, _right: D::Summary) -> LocResult {
// find the index of the current node
let key = node.get_key();
if key < self.0.start {
GoRight
} else {
Accept
}
}
}
/// Locator instance for... | Rust | 0 |
fn without_error1() {}
}
use serde::de::{self};
use serde_json::error::Error;
use serde_json::Value;
use crate::Response;
impl Response {
///
/// Try deserialize response JSON data into T
///
pub fn try_into<'a, T>(&'a self) -> Result<T, Error>
where
T: de::Deserialize<'a>,
{
... | Rust | 0 |
import re
from flask import Flask, render_template, request
from search import Search
app = Flask(__name__)
es = Search()
@app.get('/')
def index():
return render_template('index.html')
@app.post('/')
def handle_search():
query = request.form.get('query', '')
filters, parsed_query = extract_filters(quer... | Python | 1 |
# 如果使用增强型模型,添加掩码损失
if hasattr(args, 'use_enhanced_diffusion') and args.use_enhanced_diffusion and hasattr(model, 'mask_branch'):
loss = loss + mask_loss
# 损失缩放和梯度累积
scaled_loss = loss / grad_accum_steps
... | Python | 1 |
from collections import defaultdict
def solve(instructions):
pos = [0,0]
registers = [defaultdict(int), defaultdict(int)]
registers[1]['p'] = 1
onesendcount = 0
active = 0
queues = [[], []]
stuck = [False, False]
while True:
if not 0 <= pos[active] < len(instructions):
... | Python | 1 |
]
etas = [ 0.2*i for i in range(0,18) ]
etax = 2850.#6850.
etay = 1240.#5200.
lineL = 110#8600.
offT = 10.
for ieta in etas:
th = 2*atan(exp(-ieta))
talign = 21
#IP
lineh = TLine(-20.,0.,20.,0.)
lineh.Draw()
linev = TLine(0.,-10.,0.,10.)
... | Python | 1 |
import sys
sys.path.append("../src")
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from scipy import interpolate
from sklearn import metrics
from src import kernels
from src.conv import conv1d_interpolate
sns.set()
#functions to interpolate
def function1(x):
return np.sin(2*x)
... | Python | 1 |
(raw, 2);
Self {
fast_mode_plus,
i2c_threshold_halved,
sda_current_limiter,
}
}
}
impl From<I2cRegister> for [u8; 2] {
fn from(register: I2cRegister) -> Self {
let mut raw = 0u16;
// And here we translate back to "not disabled" land.
i... | Rust | 0 |
fn from(x: u32) -> Direction {
match x % 4 {
0 => Direction::Up,
1 => Direction::Right,
2 => Direction::Down,
3 => Direction::Left,
_ => panic!(),
}
}
}
impl From<Direction> for u32 {
fn from(x: Direction) -> u32 {
match x ... | Rust | 0 |
// let mut top = closest_neighbors.peek_mut().unwrap();
// if scored_session <= *top {
// *top = scored_session;
// }
// }
// }
closest_neighbors
}
use std::io;
use std::io::Write;
use super::super::tokens::{tokenize, Tokens};
pub fn new(input: &st... | Rust | 0 |
ionUpdates,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
if let Some(var_496) = &input.user_name {
object.key("UserName").string(var_496);
}
if let Some(var_497) = &input.password {
object.key("Password").string(var_497);
}
if let Some(var_498) = &input.dns_ips {... | Rust | 0 |
_chat_id"] is None:
# st.error("请先上传文件再进行对话")
# st.stop()
# chat_box.ai_say([
# f"正在查询文件 `{st.session_state['file_chat_id']}` ...",
# Markdown("...", in_expander=True, title="文件匹配结果", state="complete"),
# ])
# text = ""
... | Python | 1 |
import requests
import os
# --- CONFIGURATION ---
BOT_TOKEN = '7989024669:AAF3WZNZtBatFnivCzweR_ftsFYMrgyDb-4'
VIDEO_PATH = '/home/carleaux/python-telegram-bot/media/media2.mp4'
YOUR_CHAT_ID = '5141207096'
CONFIG_FILE = 'video_config.py'
def get_and_save_video_id():
"""
Uploads a video to Telegram to get i... | Python | 1 |
gnore-tidy-linelength
static XXX: &'static Foo = &Foo {
tup: "hi",
data: &[
(0, 1), (0, 2), (0, 3),
(0, 1), (0, 2), (0, 3),
(0, 1), (0, 2), (0, 3),
(0, 1), (0, 2), (0, 3),
(0, 1), (0, 2), (0, 3),
(0, 1), (0, 2), (0, 3),
(0, 1), (0, 2), (0, 3),
(0,... | Rust | 0 |
class Solution:
def convertTemperature(self, celsius: float) -> List[float]:
return [celsius + 273.15, celsius * 1.8 + 32]
| Python | 1 |
# In small and tiny arch, remove drop path and EMA hook comparing with the
# original config
_base_ = [
'../_base_/datasets/imagenet_bs64_swin_224.py',
'../_base_/schedules/imagenet_bs1024_adamw_swin.py',
'../_base_/default_runtime.py'
]
# model settings
model = dict(
type='ImageClassifier',
backbo... | Python | 1 |
rk_mode else '#2d2d2d'};
color: {'#2c3e50' if not dark_mode else '#ffffff'};
padding: 0;
}}
""")
# Inputs
for input_field in (parent.login_email_input, parent.login_password_input, parent.login_confirm_password_input):
input_field.setStyleSheet(
f"""
... | Python | 1 |
self.cal_size = cal_size;
unsafe {
let () = msg_send![self.ca_layer, setDrawableSize: CGSize {width: cal_size.x as f64, height: cal_size.y as f64}];
let () = msg_send![self.ca_layer, setContentsScale: self.window_geom.dpi_factor as f64];
}
... | Rust | 0 |
approx::assert_relative_eq!(envelope.multiplier(2.0), 0.5);
approx::assert_relative_eq!(envelope.multiplier(3.0), 0.5);
approx::assert_relative_eq!(envelope.multiplier(200.0), 0.5);
approx::assert_relative_eq!(envelope.release_multiplier(0.0).unwrap(), 0.5);
approx::assert_relativ... | Rust | 0 |
# Copyright (c) 2022 Homalozoa
#
# 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 pathlib import Path
from plot_results import plot_all_runs
if __name__ == "__main__":
for env_dir in Path("results").glob("*/"):
if env_dir.is_dir():
plot_all_runs(str(env_dir), scalar_tag="evaluation/average_means", title="Return", ylabel="Return")
print(f"Plotted results for ... | Python | 1 |
"""
This file is part of TA-Eval-Rep.
Copyright (C) 2022 University of Luxembourg
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 Foundation, version 3 of the License.
This program is distributed... | Python | 1 |
ORTABLE = 1 << 1;
}
}
bitflags! {
/// <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalSemaphoreHandleTypeFlags.html>
#[repr(transparent)]
#[derive(Default)]
pub struct ExternalSemaphoreHandleTypeFlags: Flags {
const OPAQUE_FD = 1;
const OPAQUE_WIN32 ... | Rust | 0 |
elf):
return self.get_default_ip(socket.AF_INET6)
def emit_state_changed(self):
logging.debug("Network state changed: online = %s" % str(self.online))
self.emit("state-changed", self.online)
# TODO: Do this with libnm
def same_subnet(self, other_ip_info):
if self.current_ip... | Python | 1 |
of current git head.
let proc = Command::new("git").args(&["rev-parse", "HEAD"]).output();
if let Ok(output) = proc {
let git_hash = String::from_utf8(output.stdout).expect("Got non utf-8 response from `git rev-parse HEAD`");
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}
}// Copyright... | Rust | 0 |
::channel::SgxTrustedChannel::<{}, {}>::new(addr, enclave_addr)?
}}
}};
Ok({} {{ channel }})
}}
}}
"#,
client_name, request_name, response_name, client_name
));
// impl operation
buf.push_str(&format!("impl {} {{", client_name));
for method in... | Rust | 0 |
for (index, (position, _)) in self.playback().enumerate() {
let (x, y, z) = position.coords();
let x_letter = ['A', 'B', 'C', 'D'][x as usize];
buffer += &format!("{}. {}{} ({}) ", index + 1, x_letter, y + 1, z + 1);
}
buffer
}
}
pub struct HistoryPlay... | Rust | 0 |
& 0xFFFFFFFFu64) as u32;
c >>= 32;
c += p4 as u64 + p8 as u64;
let r4 = (c & 0xFFFFFFFFu64) as u32;
c >>= 32;
c += p5 as u64;
let r5 = (c & 0xFFFFFFFFu64) as u32;
c >>= 32;
c += p6 as u64;
let r6 = (c & 0xFFFFFFFFu64) as u32;
c >>= 32;
... | Rust | 0 |
WebKit/537.36 (KHTML, like Gecko) "
"Chrome/90.0.4430.85 Safari/537.36",
"X-Requested-With": "XMLHttpRequest",
}
url = "http://data.10jqka.com.cn/funds/ddzz/order/desc/ajax/1/free/1/"
r = requests.get(url, headers=headers)
soup = BeautifulSoup(r.text, features="lxml")
raw_page = soup... | Python | 1 |
match value {
0 => ::std::option::Option::Some(SortDirection::NOT_SORTED),
1 => ::std::option::Option::Some(SortDirection::DESC),
2 => ::std::option::Option::Some(SortDirection::ASC),
_ => ::std::option::Option::None
}
}
fn values() -> &'static [S... | Rust | 0 |
# %%
import taichi as ti
import taichi.math as tm
# %%
vec5f = ti.types.vector(5, float)
vec7f = ti.types.vector(7, float)
vec16f = ti.types.vector(16, float)
@ti.func
def get_spherical_harmonic_from_xyz(
xyz: tm.vec3
):
xyz = tm.normalize(xyz)
x, y, z = xyz.x, xyz.y, xyz.z
l0m0 = 0.28209479177387814
... | Python | 1 |
to execute contiguously in time with the"]
#[doc = " interrupt - just as if the callback had executed in the interrupt itself."]
#[doc = ""]
#[doc = " @param xFunctionToPend The function to execute from the timer service/"]
#[doc = " daemon task. The function must conform to the PendedFunction_t"]
... | Rust | 0 |
nombre= "bonjour tous le monde"
l=len(nombre)
compteur=0
for i in range (0 , l):
if(nombre[i]== "e"):
compteur=compteur+1
print (compteur) | Python | 1 |
Assign,
Self: BitXor<Output = Self> + BitXorAssign,
Self: Shl<u32, Output = Self> + ShlAssign<u32>,
Self: Shr<u32, Output = Self> + ShrAssign<u32>,
Self: Sum + Product,
Self: FixedBitsCast<i8> + FixedBitsCast<i16> + FixedBitsCast<i32>,
Self: FixedBitsCast<i64> + FixedBitsCast<i128> + FixedBitsCa... | Rust | 0 |
'''
Created on 27-Dec-2023
@author: gianni
'''
import anchorscad as ad
from anchorscad_models.basic.trapezoid_prism import TrapezoidPrism
from anchorscad_models.screws.CountersunkScrew import CountersunkScrew
from anchorscad_models.screws.tnut import TnutM8
@ad.shape
@ad.datatree
class FootMount(ad.CompositeShape... | Python | 1 |
ontract(query=query)
contracts.append(contract)
# Listar contratos activos
active_contracts = spec_layer.list_active_contracts()
print(f"Contratos activos: {len(active_contracts)}")
for contract in active_contracts:
print(f"- {contract.id}: {contract.task_type.value} ({contract... | Python | 1 |
index(redis_graph, 'fruit', 'other_property')
self.env.assertEquals(result.indices_created, 1)
# Verify that all indexes are reported.
actual_resultset = redis_graph.query("CALL db.indexes() YIELD type, label, properties RETURN type, label, properties ORDER BY type").result_set
expected... | Python | 1 |
}
pub struct LittleEndian;
impl ByteOrder for LittleEndian
{
fn read_u16(buf: &[u8]) -> u16 {
(buf[0] as u16) | (buf[1] as u16) << 8
}
fn read_u32(buf: &[u8]) -> u32 {
(buf[0] as u32) | (buf[1] as u32) << 8 | (buf[2] as u32) << 16 | (buf[3] as u32) << 24
}
fn read_u64(buf: &[u8]) -> u64 {
Self::read_u32(&... | Rust | 0 |
atches += len(patches[file])
logger.info("Number of patches: " + str(number_of_patches))
for file in patches:
logger.info("Patch file: " + file)
for patch in patches[file]:
logger.info("Detector: " + patch["detector"])
logger.info("Old string: " + patch["old_string"].repl... | Python | 1 |
SomeIp + ?Sized,
{
super::from_bytes::<Self, T>(data)
}
/// Convenience wrapper for [super::to_vec]
#[inline]
fn to_vec<T>(value: &T) -> Result<Vec<u8>>
where
T: Serialize + SomeIp,
{
super::to_vec::<Self, _>(value)
}
/// Convenience wrapper for [super::app... | Rust | 0 |
engths: Vec<Spanned<'a>>,
/// Type constraints.
pub type_params: Vec<(Spanned<'a>, TypeConstraintsAst<'a>)>,
}
/// Bounds that can be placed on a type variable.
#[derive(Debug, Default, Clone, PartialEq)]
#[non_exhaustive]
pub struct TypeConstraintsAst<'a> {
/// Object constraint, such as `{ x: 'T }`.
... | Rust | 0 |
dgen::std::option::Option<&'env crate::java::lang::String>>, arg2: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String>>, arg3: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env __jni_bindgen::ObjectArray<crate::java::lang::String, crat... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.