text string | label_name string | labels int64 |
|---|---|---|
/// [spn_path_quad_to]
///
/// [spn_path_quad_to]: https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/src/graphics/lib/compute/spinel/spinel.h#92
pub fn quad_to(mut self, points: [Point; 2]) -> Self {
for point in &points {
panic_if_not_finite!(point);
}
self.... | Rust | 0 |
# 17 - Verificação de Palíndromo:
# Escreva um programa que solicite uma palavra ao usuário e
# use um laço while para verificar se a palavra é um palíndromo
# (lê-se da mesma forma de trás para frente).
word = input('Digite a palavra: ')
for letter in word:
if word == letter:
print('letter')
print() | Python | 1 |
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
cloudwifi_pop_20191118_models.UpdateNetDeviceInfoResponse(),
... | Python | 1 |
forward_mag > self.speed {
camera.eye += forward_norm * self.speed;
}
if self.is_backward_pressed {
camera.eye -= forward_norm * self.speed;
}
let right = forward_norm.cross(camera.up);
let forward = camera.target - camera.eye;
let forward_mag ... | Rust | 0 |
from django.shortcuts import render
from django.http import JsonResponse
def currency_list(request):
data = {'currency': 'Bitcoin', 'price': 25000}
return JsonResponse(data)
| Python | 1 |
{
match message {
Messages::OpenChannel(open_channel) => {
if open_channel.has_anchor_outputs() {
channel.add_extender(AnchorOutputs::new())
}
}
_ => {}
}
Ok(())
}
}
#[derive(Clone, PartialEq, Eq, Hash,... | Rust | 0 |
# Generated from exprs.g4 by ANTLR 4.13.2
from antlr4 import *
if "." in __name__:
from .exprsParser import exprsParser
else:
from exprsParser import exprsParser
# This class defines a complete generic visitor for a parse tree produced by exprsParser.
class exprsVisitor(ParseTreeVisitor):
# Visit a parse... | Python | 1 |
he credentials provider you probably want to use if you don't require Sync for your AWS services.
/// Wraps a `ChainProvider` in an `AutoRefreshingProvider` that uses a `RefCell` to cache credentials
///
/// The underlying `ChainProvider` checks multiple sources for credentials, and the `AutoRefreshingProvider`
/// ref... | Rust | 0 |
from pathlib import Path
import subprocess
import asyncio
import json # 新增JSON导入
from api_client import DeepSeekClient
from typing import Optional
from .script_generator import ScriptGenerator
from .no_voiceover_processor import NoVoiceoverProcessor
from config_loader import config
class FinalProcessor:
def __ini... | Python | 1 |
ted.append(best_unconnected)
unconnected.remove(best_unconnected)
# 追加の接続を作成(サイクルを作るため)
extra_connections = rng.randint(1, max(1, len(rooms) // 3))
for _ in range(extra_connections):
room1_idx = rng.randint(0, len(rooms) - 1)
room2_idx = rng.randint(0... | Python | 1 |
[__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.into()), __jni_bindgen::AsJValue::as_jvalue(&arg2), __jni_bindgen::AsJValue::as_jvalue(&arg3.into()), __jni_bindgen::AsJValue::as_jvalue(&arg4), __jni_bindgen::AsJValue::as_jvalue(&arg5.into())];
let __jni_env =... | Rust | 0 |
stop_words = ['i','me','my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', "you're", "you've", "you'll", "you'd", 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', 'she', "she's", 'her', 'hers', 'herself', 'it', "it's", 'its', 'itself', 'they', 'them', 'their', 'theirs', 'themselves', 'what... | Python | 1 |
ct PingProxyRequest {
sender: Member,
target: Member,
sequence_number: u64,
}
#[derive(Debug)]
struct AckIndirectRequest {
target: Member,
sequence_number: u64,
}
#[derive(Debug)]
enum Request {
Init(SocketAddr),
Ping(Header),
PingIndirect(Header),
PingProxy(PingProxyRequest),
... | Rust | 0 |
import pygame as pyg
pyg.font.init()
class Colors:
black = (25, 25, 25)
dark_gray = (50, 50, 50)
gray = (70, 70, 70)
light_gray = (90, 90, 90)
lighter_gray = (120, 120, 120)
white = (255, 255, 255)
green = (0, 200, 0)
dark_green = (0, 160, 0)
aqua = (0, 255, 255)
blue = (0, 0, ... | Python | 1 |
()).await.map_err(Err::from)
} else {
panic!(
"Event({}) fails to convert into Event({}) \
on calling EventHandler({})",
type_name::<AsEv>(),
type_name::<Ev>(),
type_name::<H>()
)
}
}
}
pub trai... | Rust | 0 |
46 => self.instr_lsr(interconnect, AddrMode::Zp), // LSR zeropage
0x49 => self.read_instr_sz(interconnect, AddrMode::Imm, Register::A, |r, m| r ^ m), // EOR imm
0x48 => {
let a = self.reg_a;
self.push_byte(interconnect, a);
} // PHA
0x4A =>... | Rust | 0 |
andlebars.register_template_string("backend_tpl", BACKEND_TPL)?;
let handlebars_ref = web::Data::new(handlebars);
let mut config = ServerConfig::new(NoClientAuth::new());
if opt.tls_cert.is_some() && opt.tls_key.is_some() {
let tls_cert = opt.tls_cert.unwrap();
let tls_key = opt.tls_key... | Rust | 0 |
ted_server_initial_secret: [u8; 32] = [
0xb0, 0x87, 0xdc, 0xd7, 0x47, 0x8d, 0xda, 0x8a,
0x85, 0x8f, 0xbf, 0x3d, 0x60, 0x5c, 0x88, 0x85,
0x86, 0xc0, 0xa3, 0xa9, 0x87, 0x54, 0x23, 0xad,
0x4f, 0x11, 0x4f, 0x0b, 0xa3, 0x8e, 0x5a, 0x2e,
];
assert_eq!(&secret, &... | Rust | 0 |
let verifier = multi_sig_verifier();
let sig = csp_vault
.multi_sign(AlgorithmId::MultiBls12_381, &msg, key_id)
.expect("failed to generate signature");
assert!(verifier
.verify(&sig, &msg, AlgorithmId::MultiBls12_381, csp_pub_key.clone())
.is_ok());
assert!(verifier
... | Rust | 0 |
py_dir
# -> copy_dir/file (from dir1/file1)
os.makedirs(tmp_path / 'dir1')
open(tmp_path / 'dir1' / 'file1', 'w').close()
open(tmp_path / 'delete_file', 'w').close()
os.makedirs(tmp_path / 'delete_folder')
open(tmp_path / 'delete_folder' / 'file', 'w').close()
op... | Python | 1 |
不)', 'Unclear (不清楚)'], index=None)
# 疾病史
factor31 = st.radio('Do you suffer from arthritis? (您是否患有关节炎?)', ['Yes (是)', 'No (否)', 'Unclear (不清楚)'], index=None)
factor32 = st.radio('Do you suffer from prostate disease? (您是否患有前列腺疾病?)', ['Yes (是)', 'No (否)', 'Unclear (不清楚)'], index=None)
factor33 = st.radio('Do you suffer f... | Python | 1 |
t;
use std::i32;
use std::i64;
use std::str::FromStr;
use std::time;
use chrono::prelude::*;
use serde::de::{self, Deserialize, Deserializer, Visitor};
use serde::ser::{Serialize, Serializer};
include!(concat!(env!("OUT_DIR"), "/pbtime/google.protobuf.rs"));
/*
* From prost-types: https://github.com/tokio-rs/prost... | Rust | 0 |
import os
import re
from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
# ボットトークンとソケットモードハンドラーを使ってアプリを初期化します
app = App(token=os.environ.get("SLACK_BOT_TOKEN"))
@app.event("app_mention")
def root_cause_analysis(event, say, client):
# イベントがトリガーされたチャンネルへ say() でメッセージを送信
input... | Python | 1 |
routes::web::admin::pastes::delete,
routes::web::admin::pastes::delete_get,
routes::web::admin::pastes::batch_delete,
routes::web::admin::users::get,
routes::web::admin::users::delete,
routes::web::admin::users::promote,
routes::web::admin::users::demote,
routes::web::user... | Rust | 0 |
scores.entry(String::from("Blue")).or_insert(50);
println!("{:?}", scores);
// Updating a value based on the old value
let text = "hello world wonderful world";
let mut map = HashMap::new();
for word in text.split_whitespace() {
let count = map.entry(word).or_insert(0);
*count +=... | Rust | 0 |
# Copyright 2024 Carnegie Mellon University.
# Released under a MIT (SEI)-style license, please see LICENSE.md in the project
# root or contact permission@sei.cmu.edu for full terms.
import hashlib
import subprocess
def get_vmtools_guestinfo_password():
try:
result = subprocess.run(["vmtoolsd", "--cmd",... | Python | 1 |
.peerset_handle.report_peer(p, rep::TIMEOUT);
}
}
/// Called by peer to report status
fn on_status_message(&mut self, who: PeerId, status: message::Status<B>) -> CustomMessageOutcome<B> {
trace!(target: "sync", "New peer {} {:?}", who, status);
let _protocol_version = {
if self.context_data.peers.contains_... | Rust | 0 |
s affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use std::collections::HashSet;
use std::path::{Path, PathBuf};
use crate::errors::Result;
use crate::FileSourceResult;
use crate::{compiler_state::CompilerState, config::C... | Rust | 0 |
rion, lr, batch_size, num_epochs)
if mse < best_mse:
best_params = {
'hidden_sizes': hidden_sizes,
'lr': lr,
'batch_size': batch_size
}
best_mse = mse
... | Python | 1 |
ithSickness_TimeBefore_Seconds \
= WithSickness_TimeBefore_Seconds
_JSON_FromRecorder_WithSickness_Concat.Items_WithSickness_TimeAfter_Seconds \
= WithSickness_TimeAfter_Seconds
_JSON_FromRecorder_WithSickness_Concat.Folder_Data_Name \
= Folder_JSON_FromRecorder_Concat_Name
_JSON_FromRecorder... | Python | 1 |
])
res["MODA"] = (res["CLR_TP"] - res["CLR_FP"]) / np.maximum(
1.0, res["CLR_TP"] + res["CLR_FN"]
)
res["MOTA"] = (res["CLR_TP"] - res["CLR_FP"] - res["IDSW"]) / np.maximum(
1.0, res["CLR_TP"] + res["CLR_FN"]
)
res["MOTP"] = res["MOTP_sum"] / np.maximum(1.... | Python | 1 |
x22\x23\x24\x25\x26\x27\x28";
let s1 = b"My Tuple App";
let expected = b"\
\xE6\x0F\x20\x2C\x89\xA2\x63\x1E\xDA\x8D\x4C\x58\x8C\xA5\xFD\x07\
\xF3\x9E\x51\x51\x99\x8D\xEC\xCF\x97\x3A\xDB\x38\x04\xBB\x6E\x84\
";
let mut output = [0u8; 32];
let mut hasher = TupleHash::v128(s1);
hash... | Rust | 0 |
ValueMut<'a> {
fn drop(&mut self) {
pnk!(self.hdr.insert(self.key, &self.value));
}
}
impl<'a> Deref for ValueMut<'a> {
type Target = RawValue;
fn deref(&self) -> &Self::Target {
&self.value
}
}
impl<'a> DerefMut for ValueMut<'a> {
fn deref_mut(&mut self) -> &mut Self::Target ... | Rust | 0 |
$name,
format!("{:?}", e));
});
},
Err(Err::Incomplete(i)) => {
NOM_TRACE.with(|trace| {
(*trace.borrow_mut()).close_incomplete(input, $name, i.clone());
});
},
};
res
}
);
(__impl $i:expr, $submac:ident!( $($args:tt)... | Rust | 0 |
er Preferences menu.' % pydevpath)
return {'CANCELLED'}
dirname = os.path.dirname(pydevpath)
basename = os.path.basename(dirname)
if not any(basename in p for p in sys.path):
sys.path.append(dirname)
import pydevd
pydevd.settrace('localhost', port=5678, ... | Python | 1 |
from fastapi import HTTPException, Request, status
from fastapi.responses import JSONResponse
from fastapi.exceptions import RequestValidationError
from fastapi.encoders import jsonable_encoder
from sqlalchemy.exc import SQLAlchemyError, OperationalError, IntegrityError
from os import getenv
async def validation_exce... | Python | 1 |
# DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs
# Based on "crates/store/re_types/definitions/rerun/components/text_log_level.fbs".
# You can extend this class by creating a "TextLogLevelExt" class in "text_log_level_ext.py".
from __future__ import annotations
f... | Python | 1 |
async def summarize_text(request: SummarizeRequest):
"""Summarize text using the summarizer template."""
try:
template = vault.get("summarizer")
# Use the template's run method for automatic logging
result = template.run(
lambda prompt: client.responses.create(
... | Python | 1 |
let expectoutput = vec![0xCE, 0x00, 0x01, 0x11, 0x70];
assert_eq!(&enc.buf, &expectoutput);
let mut enc = Encoder::new();
let input: i64 = 214748364700;
enc.encode_int(input).unwrap();
let expectoutput = vec![0xCF, 0x00, 0x00, 0x00, 0x31, 0xFF, 0xFF, 0xFF, 0x9C];
... | Rust | 0 |
aw_first_query, raw_query_count);
}
}
}<reponame>raskad/regress<gh_stars>1-10
use crate::bytesearch::ByteBitmap;
use crate::codepointset;
use crate::insn::StartPredicate;
use crate::ir;
use crate::ir::Node;
use crate::util::utf8_first_byte;
use std::cmp;
use std::convert::TryInto;
/// Support for quickly f... | Rust | 0 |
.api.dpf.workflow.v0.WorkflowService/UpdateConnectionStreamed',
workflow__pb2.ArrayUpdateConnectionRequest.SerializeToString,
base__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@static... | Python | 1 |
/ 连接Redis,创建TCP连接
fn connect(&mut self) -> Result<()> {
let addr = format!("{}:{}", &self.config.host, self.config.port);
let stream = TcpStream::connect(&addr)?;
stream
.set_read_timeout(self.config.read_timeout)
.expect("read timeout set failed");
stream
... | Rust | 0 |
import time
import requests
OLLAMA_URL = "http://127.0.0.1:11434/api/generate"
MODEL_NAME = "gemma3:4b" # Change if needed
prompt = """You are a classifier. Your job is to evaluate the user's response in context and label it with:
1. [Yes] or [No] — Is this a follow-up or direct answer to the assistant's previous m... | Python | 1 |
if 'user_detail' in response:
self.user_detail = response['user_detail']
if 'user_detail_list' in response:
self.user_detail_list = response['user_detail_list']
if 'user_id' in response:
self.user_id = response['user_id']
if 'user_id_list' in response:
... | Python | 1 |
t Image,
pub last_image: *mut Image,
}
#[repr(C)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Point {
pub x: i16,
pub y: i16,
}
#[repr(C)]
pub struct Image {
_data: [u8; 0x40],
}
#[repr(C)]
pub struct AiTownList {
_data: [u8; 8],
}
#[repr(C)]
pub struct Player {
_data: [u8; 0x24]... | Rust | 0 |
// atom db_log_dir;
// atom wal_dir;
// atom delete_obsolete_files_period_micros;
// atom max_background_compactions;
// atom max_background_flushes;
// atom max_log_file_size;
// atom log_file_time_to_roll;
// atom keep_log_file_num;
// atom max_m... | Rust | 0 |
if is_solvable(&Board, x0, y0) {
return (Board, true);
}
}
Board = laymine_op(row, column, mine_num, x0, y0);
(Board, false)
}
/// 调整法无猜埋雷。可以生成任意雷密度的无猜局面。但雷不满足均匀分布。(还没写好)
/// - 返回局面、是否成功
// 局面中的-10代表还没埋雷。
pub fn laymine_solvable_adjust(
row: usize,
column: usize,
mine_n... | Rust | 0 |
#VERSION 0.0.0
print ("------ AUTHOR: NaTaN ANDRADE ------")
print ("Universidade Federal de São Paulo (UNIFESP)")
print ("Instituto de Ciência e Tecnologia (ICT)" )
print ("São José dos Campos (SJC)")
print ("Estado de São Paulo (SP) ")
print ("BRASIL")
import numpy as np
import matplotlib.pyplot as plt
import matplo... | Python | 1 |
) less the fund amount less
// the transaction fee to open the channel.
let a_balance_after_open = a_wallet.balance().await.unwrap();
let b_balance_after_open = b_wallet.balance().await.unwrap();
let secret = PtlcSecret::new_random();
let point = secret.point();
let ptlc_amount = Amount::from_b... | Rust | 0 |
if dropout > 0:
nn = layers.Dropout(dropout, name="head_drop")(nn)
nn = layers.Dense(num_classes, dtype="float32", activation=classifier_activation, name="predictions")(nn)
model = models.Model(inputs, nn, name=model_name)
reload_model_weights(model, PRETRAINED_DICT, "fastervit", pretrain... | Python | 1 |
.i64_const(-1)
.atomic_wait(memory, ATOMIC_MEM_ARG, false)
.drop()
.br(loop_id);
},
|_| {},
);
});
block(body);
body.i32_const(stack.temp_lock)
.i32_const(0)
.stor... | Rust | 0 |
pResource: image.resource,
Type: d3d12::D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX,
u: unsafe { mem::zeroed() },
};
let mut dst = d3d12::D3D12_TEXTURE_COPY_LOCATION {
pResource: buffer.resource,
Type: d3d12::D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPR... | Rust | 0 |
각 UAV의 미션 선택 로짓 [num_uavs, num_missions]
"""
num_missions = missions.size(0)
num_uavs = uav_positions.size(0)
device = missions.device
# 미션 및 UAV 임베딩
mission_emb, uav_emb = self.embedding(missions, uav_positions, uav_speeds, uav_types)
# 그래프 인코딩
... | Python | 1 |
=status.HTTP_404_NOT_FOUND,
)
# POST login
@router.post("/login")
async def login(form_data: OAuth2PasswordRequestForm = Depends(), db: AsyncSession = Depends(get_session),):
usuario = await autenticar(email=form_data.username, senha=form_data.password, db=db)
if not usuario:
raise HTTPExc... | Python | 1 |
&*map_refi.borrow(),
&*map_mv.borrow(),
self.w_scu as usize,
&self.core.evc_tbl_qp_chroma_dynamic_ext,
self.w as usize,
);
}
//recover best cu info
for j in 0..h_scu {
let ind = (y_scu + j) * self.w_scu as u... | Rust | 0 |
rmat(format: vk::Format) -> vk::ImageAspectFlags {
match format {
vk::Format::D16_UNORM => vk::ImageAspectFlags::DEPTH,
vk::Format::X8_D24_UNORM_PACK32 => vk::ImageAspectFlags::DEPTH,
vk::Format::D32_SFLOAT => vk::ImageAspectFlags::DEPTH,
vk::Format::S8_UINT => vk::ImageAspectFlags::... | Rust | 0 |
with open('voting_clf.pkl', 'rb') as f:
model = pickle.load(f)
with open('preprocessor.pkl', 'rb') as f:
preprocessor = pickle.load(f)
# Load data and calculate model accuracy
data = load_and_explore_data('Dataset of Diabetes .csv')
if data is not None:
... | Python | 1 |
d: false
model_id: {graphrag_config_defaults.extract_claims.model_id}
prompt: "prompts/extract_claims.txt"
description: "{graphrag_config_defaults.extract_claims.description}"
max_gleanings: {graphrag_config_defaults.extract_claims.max_gleanings}
community_reports:
model_id: {graphrag_config_defaults.communi... | Python | 1 |
e, TransactionPayload::Package(package))
.unwrap();
}
Ok(())
}
#[stest::test(timeout = 360)]
fn test_wrong_package_address() -> Result<()> {
let (chain_state, net) = prepare_genesis();
let alice = test_helper::Account::new();
let bob = test_helper::Account::new();
let pre_mint_amou... | Rust | 0 |
import os
import sys
""" BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR) """
import numpy as np
from sklearn.neighbors import NearestNeighbors
from numpy import linalg as la
import scipy.io as sio
#input : matrice avec une ligne par point et 3 colonnes : x,y,z
#en coordonnees cartesien... | Python | 1 |
import urllib.request
u = urllib.request.urlopen(
"https://gist.githubusercontent.com/tacksoo/3944382fa397fd42095890ef94e88365/raw"
"/285ea8af3c2555d4883e86f1b557aae307772d5c/gme.csv")
data = u.read().decode('utf-8')
lines = data.split("\n")
print(lines[0])
# Using the Counter Library
from collections import... | Python | 1 |
------------------------------------+
/// | ERR_MAKER = 0 (1 byte) | UTF-8 String (error) |
/// +------------------------------------------------+
/// ```
///
#[cfg(target_arch = "wasm32")]
macro_rules! wasm_func_call {
($func:ident, $buf_offset:expr) => {{
match api::wasm::$func($buf_offset as usize) {... | Rust | 0 |
import json
import os
import pickle
from tqdm import tqdm
data_folder = '/Volumes/home/cky/RRSIS-D'
# image data: images/rrsisd/JPEGImages
# annotation data: images/rrsisd/ann_split
# instance segmentation data: rrsisd/instances.json
# refs(unc).p data: rrsisd/refs(unc).p
ins_data = json.load(open(os.path.join(data_f... | Python | 1 |
1 << 5;
const VELOCITY_Y = 1 << 6;
const VELOCITY_Z = 1 << 7;
// const AIM_ENT = 1 << 8; // unused
const ITEMS = 1 << 9;
const ON_GROUND = 1 << 10;
const IN_WATER = 1 << 11;
const WEAPON_FRAME = 1 << 12;
const ARMOR = 1 << 13;
const WEAPON = 1 << ... | Rust | 0 |
from typing import Union
import uvicorn
from fastapi import FastAPI, Request, Query, UploadFile, Form, File
from fastapi.responses import JSONResponse
from starlette.responses import RedirectResponse
from api.base import router
from initlize.db import init_db, close_db
from initlize.app import init_app
from initlize.... | Python | 1 |
2], cand[0][2]];
possible_words.contains(&right_v_word)
}
// Returns the 3x3 grid of letters in row major form.
fn presentation_format(cand: &[[char; 3]]) -> Vec<Vec<char>> {
let mut out = Vec::new();
// Fill in the vectors with x's just as a placeholder.
for _ in 0..3 {
out.push(vec!['x', 'x',... | Rust | 0 |
#!/usr/bin/env python3
# Copyright 2003, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", """\
project : requirements <... | Python | 1 |
self.assertEqual(
channel1.json_body["replacement_room"],
channel2.json_body["replacement_room"],
)
def test_second_upgrade_after_delay(self) -> None:
"""A second room upgrade is not deduplicated after some time has passed."""
channel1 = self._upgrade_room()
... | Python | 1 |
pub fn gtk_tree_view_new_with_model(model: *mut GtkTreeModel) -> *mut GtkWidget;
pub fn gtk_tree_view_append_column(tree_view: *mut GtkTreeView, column: *mut GtkTreeViewColumn) -> c_int;
pub fn gtk_tree_view_collapse_all(tree_view: *mut GtkTreeView);
pub fn gtk_tree_view_collapse_row(tree_view: *mut GtkTre... | Rust | 0 |
o"),
],
)
def test_slug(self, env_dict, expected, mocker):
mocker.patch.dict(os.environ, env_dict)
actual = AzurePipelinesCIAdapter().get_fallback_value(FallbackFieldEnum.slug)
assert actual == expected
@pytest.mark.parametrize(
"env_dict,expected",
[
... | Python | 1 |
# Copyright 2019 Google LLC
#
# 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 |
losses, miou_list, pixel_pr=None, dpi=1000):
os.makedirs(exp_path, exist_ok=True)
epochs = list(range(1, len(train_losses) + 1))
# Loss curve
plt.figure()
plt.plot(epochs, train_losses, label='Train Loss')
plt.plot(epochs, val_losses, label='Val Loss')
plt.xlabel('Epoch')
plt.ylabel('To... | Python | 1 |
from pathlib import Path
from fastapi import FastAPI, UploadFile, File
from fastapi.staticfiles import StaticFiles
from fastapi.responses import JSONResponse
from reactpy import component, html, hooks
from reactpy.backend.fastapi import configure
import importlib
from ..shared.components.button import Button
TEMPLATE... | Python | 1 |
e) fn mask() -> $REGISTER<::traits::Mask> {
$REGISTER { bits: 0, _mode: ::core::marker::PhantomData }
}
$(
#[allow(dead_code)]
pub(crate) fn $bitfield(&self) -> $uxx {
use ::traits::OffsetSize;
let size = $... | Rust | 0 |
) = oauth {
query.append_pair("oauth_token", token);
}
query.finish()
};
format!(
"https://api.twitch.tv/api/channels/{}/access_token?{}",
channel.to_lowercase(),
query_string
)
}
fn stream_index_url(channel: &str, token: &AccessToken) -> String {
l... | Rust | 0 |
XMM6)), operand2: Some(IndirectScaledIndexed(RDX, RAX, Eight, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 56, 43, 52, 194], OperandSize::Qword)
}
<reponame>l4l/cloud-stash
pub mod stashfs;
... | Rust | 0 |
size,
&ConvDims {
i: 0,
j: 3,
di: 2,
dj: 2
}
),
Some((1, 3)),
"Top right going down and right"
);
assert_eq!(
c.conv_point(
&siz... | Rust | 0 |
(-half_b - sqrtd) / a;
if root < t_min || root > t_max {
root = (-half_b + sqrtd) / a;
if root < t_min || root > t_max {
return false;
}
}
rec.t = root;
rec.p = r.at(rec.t);
let mut outward_normal = (rec.p - self.center(r.time(... | Rust | 0 |
#!/usr/bin/env python3
import os, sys
from fpdiff import count_differences
RUN_CMD = 'e4shared --job=connection-test --run'
of = open('test-results.txt', 'w')
faces = ["north", "south", "east", "west", "top", "bottom"]
nOrnt = 4
count = 0
for fA in faces:
for fB in faces:
for ornt in range(nOrnt):
... | Python | 1 |
return Err(Status::RemainingRetries(remaining));
}
persistent_state.reset_consecutive_puk_mismatches();
persistent_state.set_puk(new_puk);
self.state.runtime.app_security_status.puk_verified = true;
return Ok(Default::default());
}
// pub fn old_respond(&mut self, com... | Rust | 0 |
erate by [InlineComment] in a file.
pub fn iter_inline_comments(&self) -> impl Iterator<Item = &InlineComment<'input>> {
self.iter().flat_map(Line::iter_inline_comments)
}
/// Iterate by [Whitespace] in a file.
pub fn iter_whitespace(&self) -> impl Iterator<Item = &Whitespace<'input>> {
... | Rust | 0 |
r of dimension D (or N+1+D if return_phase_variance is True) containing inferred mean, Matrix of dimension D x D (or N+1+D x N+1+D if return_phase_variance is True).
def localize(self, measurement, measurement_noise, active_dofs, return_phase_variance = False):
transition_model = self.get_transition_model()... | Python | 1 |
.entry("yoga")
.entry("yokohama")
.entry("you")
.entry("youtube")
.entry("yt")
.entry("yun")
.entry("za")
.entry("zappos")
.entry("zara")
.entry("zero")
.entry("zip")
.entry("zm")
... | Rust | 0 |
pub const _DecklinkStatusID_decklinkStatusReceivedEDID: _DecklinkStatusID = 1701079396;
pub type _DecklinkStatusID = u32;
pub const _DecklinkVideoStatusFlags_decklinkVideoStatusPsF: _DecklinkVideoStatusFlags = 1;
pub const _DecklinkVideoStatusFlags_decklinkVideoStatusDualStream3D: _DecklinkVideoStatusFlags = 2;
pub ty... | Rust | 0 |
ze>,
{
self.frame().resolve_lpc_ref(register)
}
/// Lookup the process with the passed path.
#[inline]
pub fn lookup_process<T>(&self, path: T) -> Option<Rc<RefCell<Process>>>
where
T: AsRef<str>,
{
self.task_context.lookup_process(path)
}
/// Get a clone of... | Rust | 0 |
Data")),
}
}
/// Calculates the strides from a given shape.
fn get_strides_from_shape(shape: &Vec<usize>) -> Vec<usize> {
let mut m = 1;
shape
.iter()
.rev()
.map(|x| {
let n = m;
m = m * x;
n
... | Rust | 0 |
from flask import render_template
from config import init_mysql
from app import app # Importa la instancia de Flask
# Configuración inicial de la aplicación Flask
# Inicializar MySQL
mysql = init_mysql(app)
def detalle_ej(t_evaluacion):
detalle=[]
for numero_ejercicio in range(1,4):
cur = mysql.con... | Python | 1 |
converting the integer to a string?
fn is_palindrome(x: i32) -> bool {
let temp = x
.to_string()
.chars()
.rev()
.collect::<String>()
.parse::<i32>().unwrap_or(0);
temp == x
}
fn main() {
let x = -123;
let ret = is_palindrome(x);
println!("ret = {}", ret)... | Rust | 0 |
LVM optimization level.
pub const CONF_LLVM_OPTIMIZATION_LEVEL_DEFAULT: u32 = 2;
/// Default LLVM loop unroller setting.
pub const CONF_LLVM_UNROLLER_DEFAULT: bool = true;
/// Default LLVM loop vectorizer setting.
pub const CONF_LLVM_VECTORIZER_DEFAULT: bool = true;
/// Default LLVM target analysis passes.
pub const... | Rust | 0 |
}] // Load byte.
adcs {acc}, {acc}, {tmp1} // Sum acc with byte. Accumulate carry.
// Fold 64-bit into 16-bit.
7:
lsr {tmp1}, {acc}, 32 // Store high 32 bit of acc in tmp1.
adcs {acc:w}, {acc:w}, {tmp1:w} // 32-bit sum of acc and r1. Accumulate carry.
adc {acc:w}, {acc:w}, wzr // Sum car... | Rust | 0 |
#!/usr/bin/python
# Generator for encoded NodeJS reverse shells
# Based on the NodeJS reverse shell by Evilpacket
# https://github.com/evilpacket/node-shells/blob/master/node_revshell.js
# Onelineified and suchlike by infodox (and felicity, who sat on the keyboard)
# Insecurety Research (2013) - insecurety.net
import s... | Python | 1 |
,
"model_dim": model_dim,
"ff_dim": ff_dim,
"num_blocks": num_blocks,
"axes_dims": eval(axes_dims),
},
... | Python | 1 |
from lxml import etree
from unittest.mock import patch
from tocky.detector import analyze_page_for_toc
class Test_analyze_page_for_toc:
def test_no_hiddentext(self):
xml_str = build_test_page_object_str(hiddentext=False)
elem = etree.fromstring(xml_str)
result = analyze_page_for_toc(elem, ... | Python | 1 |
it]
impl Action for CreateTopicAction {
async fn undo(&self, state: &mut State) -> Result<(), String> {
let metadata = state
.kafka_producer
.client()
.fetch_metadata(None, Some(Duration::from_secs(1)))
.map_err(|e| e.to_string())?;
let stale_kafka_to... | Rust | 0 |
from typing import List, Dict, Any
from sqlalchemy import Column, String, Index
from src.db import BaseDB
from src.models.chapter import Chapter
class Book(BaseDB):
__tablename__ = 'book'
__table_args__ = (
Index('idx_book', 'book_id', 'source'),
)
id: str = Column(String, primary_key=Tru... | Python | 1 |
# Copyright (c) 2021, Frappe Technologies and Contributors
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
class TestEnergyPointSettings(FrappeTestCase):
pass
| Python | 1 |
from pyrogram import filters
from pyrogram.types import Message
from unidecode import unidecode
from MrArman import app
from MrArman.misc import SUDOERS
from MrArman.utils.database import (
get_active_chats,
get_active_video_chats,
remove_active_chat,
remove_active_video_chat,
)
@app.on_message(filte... | Python | 1 |
actor = self.0.clone();
resp(
async move {
tracing::warn!("Driving Banana.eat() future");
let count = actor
.invoke::<_, GhostError, _>(|count| {
*count += 1;
tracing::w... | Rust | 0 |
. Example: Say `self` is a reference-counted binary from memory-address 150 to 220
/// (length 70) and the given slice points to memory address 170 and has a length of 30,
/// this function returns a slice of the reference-counted binary (start 20, length 30).
///
/// This is `None` if the binary type d... | Rust | 0 |
String,
#[serde(rename = "type")]
pub typ: String,
pub actor: Actor,
pub repo: Repo,
pub payload: Payload,
pub created_at: chrono::DateTime<Utc>,
}
#[derive(Debug, StructOpt)]
#[structopt(rename_all = "kebab-case")]
/// Main options struct
struct Opt {
#[structopt(long, default_value = "0"... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.