text string | label_name string | labels int64 |
|---|---|---|
def test():
b, n = 2, 100
coords = torch.randint(4096, [b, n, DIMENSION])
batch_idxs = torch.arange(b).reshape(b, 1, 1).repeat(1, n, 1)
coords = torch.cat([coords, batch_idxs], 2).reshape(-1, DIMENSION + 1)
in_channels = 3
feats = torch.rand(b * n, in_channels)
x = [coords, feats.cuda()]
... | Python | 1 |
_AUTH_DATA_USAGE = BYTE;
pub type TSS_CMK_DELEGATE = UINT32;
pub type TSS_NV_INDEX = UINT32;
pub type TSS_COUNTER_ID = UINT32;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct tdTSS_VERSION {
pub bMajor: BYTE,
pub bMinor: BYTE,
pub bRevMajor: BYTE,
pub bRevMinor: BYTE,
}
#[test]
fn bindgen_test_layout_tdTSS... | Rust | 0 |
spider_to_org_mapping.items():
sheet_name = f"{prefix} - {spider_name}"
try:
# Create the sheet with exponential backoff
def create_sheet():
return client.create(sheet_name)
sheet = exponential_backoff(create_sheet)
sheet_id = she... | Python | 1 |
.timestamp".to_string(),
);
transforms.insert(
"_kafka_timestamp_type".to_string(),
"kafka.timestamp_type".to_string(),
);
let transformer = Transformer::from_transforms(&&transforms).unwrap();
let _ = transformer
.transform(&mut test_value, ... | Rust | 0 |
miles per joule
mpj /= 1609.0
# convert from miles per joule to miles per megajoule
mpj *= 10 ** 6
return mpj * gain
def miles_per_gallon(env, veh_ids=None, gain=.001):
"""Calculate mpg of either a particular vehicle or the total average of all the vehicles.
Assumes vehicle is an average siz... | Python | 1 |
ate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.
*
* FROM: <https://docs.github.com/rest/reference/actions#list-repository-secrets>
*
* **Parameters:**
*
* * `owner: &str`
* * `repo: &... | Rust | 0 |
child.op);
insert_front!(args, flattened_left);
insert_back!(args, flattened_right);
args.into_iter().collect()
}
Expr::BinaryExpr(
child
@
BinaryExpr {
op: BinaryOperator::Minus,
..
},
... | Rust | 0 |
from typing import Any, Optional, Coroutine
from uuid import UUID
from ..logging import log
from langchain.chat_models import ChatOpenAI
import openai
from langchain.chat_models import ChatOpenAI
from langchain import LLMChain
from langchain.callbacks.streaming_aiter import AsyncIteratorCallbackHandler
from langchain.... | Python | 1 |
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
t... | Rust | 0 |
isper.load_model("base")
result = model.transcribe(temp_path, language="ja")
text = result["text"]
st.session_state['transcripts'].append(text)
st.subheader("文字起こし結果(最新)")
st.write(text)
# OpenAIで要約
if openai.api_key:
summary_prompt = f"以下の日本語の会話を要約してく... | Python | 1 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Context repetition unlikelihood on ELI5: please see.
<parl.ai/projects/dialogue_unlikelihood>.
"""
from .build imp... | Python | 1 |
= Vec::with_capacity(4);
let mut available_neighbors: Vec<usize> = Vec::with_capacity(4);
while !frontier.is_empty() {
let frontier_index = rng.gen_range(0, frontier.len());
let i = frontier[frontier_index];
neighbors.clear();
grid.neighbors(i, &mut neighbors);
available_neighbors.... | Rust | 0 |
", e);
::std::process::exit(1);
}
}
fn gen_sphere(u: usize, v: usize) -> ComboMeshCreator {
let positions = SphereUV::new(u, v)
.vertex(|vertex| vertex.pos)
.triangulate()
.vertices()
.collect::<Vec<_>>();
let normals = positions
.iter()
.map(|pos| S... | Rust | 0 |
None,
decimals,
)?;
instructions.push(create_mint_account_instruction);
instructions.push(initialize_mint_instruction);
if let None = signers.iter().find(|kp| **kp == payer_keypair) {
signers.push(payer_keypair);
}
if let None = signers.iter().find(|kp| **kp == mint_keyp... | Rust | 0 |
*"] -> bool as "bool" {
return self->GetDescription(*descr);
})
})
}
}
<reponame>liamoc/desktop_games<filename>vexation/src/rules.rs
use super::{Table,Card,Rules, Well, GameObject};
pub trait TVVariant {
fn size() -> usize;
}
pub struct TetraVex<V:TVVariant> { _dummy : V }
p... | Rust | 0 |
storyscript/layered-nlp/issues/"
)]
mod create_tokens;
mod ll_line;
mod resolvers;
mod type_bucket;
mod type_id_to_many;
#[cfg(test)]
mod tests;
#[allow(deprecated)]
pub use create_tokens::create_tokens;
pub use create_tokens::{create_line_from_input_tokens, InputToken};
/// Simpler, less featureful version of [crea... | Rust | 0 |
= parse_state.add_offset(1);
let pe = ParseError::of_mismatch(input, ps.next_offset(), 1, msg);
ParseResult::failed_with_uncommitted(pe)
}
} else {
ParseResult::failed_with_uncommitted(ParseError::of_in_complete())
}
})
}
fn elm_ref_in<'a, I>(start: I, end: I) -... | Rust | 0 |
s);
// let new_color = <NearestSampler2D as Sampler2D<f32, u32>>::uv_map(&NearestSampler2D, uv, texture);
// let final_color = !depth_mask & current_color | depth_mask & new_color;
// color_buffer.set(pixel_pos, final_color);
}
<gh_stars>1-10
//revisions: ast mir
//[mir] compile-flags: -Z borrowck=mir
#![a... | Rust | 0 |
MENU = {
"espresso": {
"ingredients": {
"water": 50,
"coffee": 18,
},
"cost": 1.5,
},
"latte": {
"ingredients": {
"water": 200,
"milk": 150,
"coffee": 24,
},
"cost": 2.5,
},
"cappuccino": {
... | Python | 1 |
from stable_baselines3 import PPO
from stable_baselines3.common.monitor import Monitor
from sim.env import DriftSimEnv
# Create env and wrap it in a tensorboard monitor
env = DriftSimEnv(track_radius=15)
env = Monitor(env)
# Create PPO agent for continuous actions
model = PPO("MlpPolicy", env, verbose=1, tensorboard... | Python | 1 |
import torch
from model import MiniUnet
from rectified_flow import RectifiedFlow
import cv2
import os
import numpy as np
def infer(
checkpoint_path,
base_channels=16,
step=50, # 采样步数(Euler方法的迭代次数) 10步效果就很好 1步效果不好
num_imgs=5,
y=None,
cfg_scale=7.0,
save_path='./... | Python | 1 |
很远了。\n',
' ',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0102,
(
'#0020100530V#010F这样的话……\n',
'就请您多多指教了。',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0101,
(
... | Python | 1 |
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
+= "; " + "; ".join(f"{k}/{v}" for k, v in user_agent.items())
elif isinstance(user_agent, str):
ua += "; " + user_agent
return _deduplicate_user_agent(ua)
def _deduplicate_user_agent(user_agent: str) -> str:
"""Deduplicate redundant information in the generated user-agent."""
# Split around... | Python | 1 |
_eq!(&output[..account_id.len()], &account_id);
}
#[test]
fn address() {
// given
let mut engine = Engine::new();
let account_id = vec![1; 32];
engine.set_callee(account_id.clone());
// when
let mut output = get_buffer();
engine.address(&mut &mut output[..]);
// then
assert_eq!(&o... | Rust | 0 |
r_pwd}")
create_security_file(solr_user, solr_pwd)
upload_security_file(solr_host)
else:
print(f"Missing Solr's username, password, and host: {solr_user}/{solr_pwd}/{solr_host}")
sys.exit(-1)
else:
print(f"Solr URL path doesn't match the required forma... | Python | 1 |
OGO");
}
}
}
impl IStateObserver for Syncer {
fn notify_ctor(&self, state: &StateInfo) -> bool {
if 0 == state.total { // racers have free pass,
return true // as no actuall call is invoked here anyway
}
let syncer = self.syncer.as_ref().unwrap();
//let ret = {
... | Rust | 0 |
n(base, &head), "expected a type")),
None if args.is_empty() => TypeKind::Var(name),
None => return Err(ElabError::new_e(try_get_span(base, &head),
format!("unknown type constructor '{}'", self.fe.to(&name)))),
}
} else {
match as_keyword(self.kw, &head) {
... | Rust | 0 |
# Desafio 13
"""
Para este desafio, quero que voce use um loop (nã0 pode ser o for loop) para imprimir os numeros de 1 a 10 na tela.
"""
i = 1
while i <= 10:
print(f'O loop passou aqui -> {i}')
i += 1 | Python | 1 |
"""The schedule domain."""
from jupiter.core.domain.concept.schedule.schedule_event_full_days import (
ScheduleEventFullDays,
)
from jupiter.core.domain.concept.schedule.schedule_event_in_day import (
ScheduleEventInDay,
)
from jupiter.core.domain.concept.schedule.schedule_external_sync_log import (
Schedu... | Python | 1 |
-e5f2-4571-b843-686685905890",
"clientCommandBatchId": "673a8333-7383-44b9-a5a2-10128c461de4",
"createdAt": "2020-11-06T15:44:29.196Z"
}
}
},
{
"ShapeAdded": {
"shapeId": "shape_p5uOLpFNK8",
"baseShapeId": "$unknown",
... | Rust | 0 |
(
(Expr.PushLong, 0x0),
Expr.Nop,
Expr.Return,
),
)
ExecExpressionWithValue(
0x000A,
0x08,
(
(Expr.PushLong, 0x0),
Expr.Nop,
Expr.Return,
),
)
ChrSetChipByIndex(0x0008, 10)
ChrSetChi... | Python | 1 |
pleVertex2D::new([self.x1,self.y2],self.colour),
SimpleVertex2D::new([self.x2,self.y1],self.colour),
SimpleVertex2D::new([self.x1,self.y2],self.colour),
SimpleVertex2D::new([self.x2,self.y1],self.colour),
SimpleVertex2D::new([self.x2,self.y2],self.colour),
]
}... | Rust | 0 |
disabled = False
db.session.add(comment)
db.session.commit()
return redirect(url_for('main.moderate', page=request.args.get('page', 1, type=int)))
@main.app_context_processor
def inject_permissions():
return dict(Permission=Permission)
@main.route('/shutdown')
def server_shutdown():
if not current... | Python | 1 |
IGNORE: u32 = 25;
pub const PAM_ABORT: u32 = 26;
pub const PAM_AUTHTOK_EXPIRED: u32 = 27;
pub const PAM_MODULE_UNKNOWN: u32 = 28;
pub const PAM_BAD_ITEM: u32 = 29;
pub const PAM_CONV_AGAIN: u32 = 30;
pub const PAM_INCOMPLETE: u32 = 31;
pub const _PAM_RETURN_VALUES: u32 = 32;
pub const PAM_SILENT: u32 = 32768;
pub const... | Rust | 0 |
winner_text = winner_font.render(f'The winner is {self.winning_player}!', True, [0, 0, 0])
if self.mode == 2: # Displays large winning symbol at end of game
ending_winner_symbol_font = pygame.font.Font(None, int(self.board_size[0] * 0.9))
... | Python | 1 |
from fastapi import Request
from fastapi.responses import JSONResponse
from starlette.middleware.base import BaseHTTPMiddleware
from . import log_exception, log_message
from asgi_correlation_id.middleware import CorrelationIdMiddleware
class LoggerCorrelationIdMiddleware(CorrelationIdMiddleware):
async def dispa... | Python | 1 |
Deserialize, PartialEq, Clone, Eq, TS)]
pub struct EditProposalInfo {
pub page_id: Uuid,
pub page_proposal_id: Uuid,
pub block_proposals: Vec<BlockProposalInfo>,
}
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Eq, TS)]
pub struct ProposalCount {
pub pending: u32,
pub handled: u32,
}
p... | Rust | 0 |
nt = 8,
num_decoder_layers: int = None,
num_heads: int = 6,
relative_attention_num_buckets: int = 32,
relative_attention_max_distance: int = 128,
dropout_rate: float = 0.1,
layer_norm_epsilon: float = 1e-6,
initializer_factor: float = 1.0,
feed_forward_pro... | Python | 1 |
HEADER: Final[list] = [
# Basic Record Information
'Record Number',
'Record Status', # Instead of 'Good'/'Bad'
'Record Type', # Instead of 'Active'/'Inactive'
'File Type', # Instead of 'Record type'
'Sequence Number',
'Parent Record Number',
'Parent Record Sequence Number',
... | Python | 1 |
ni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "android/os/Debug$MemoryInfo", java.flags == PUBLIC, .name == "readFromParcel", .descriptor == "(Landroid/os/Parcel;)V"
unsafe {
let __jni_args = [__jni_bindgen::AsJVa... | Rust | 0 |
digits = [ '1111110', # 0
'0110000', # 1
'1101101', # 2
'1111001', # 3
'0110011', # 4
'1011011', # 5
'1011111', # 6
'1110000', # 7
'1111111', # 8
'1111011', # 9
]
def print_number(numero):
global digits
digitos = str(numero)
lineas = [ '' for lin in range(5) ]
for digito ... | Python | 1 |
Abi::OPENBSD,
13 => Abi::OPENVMS,
14 => Abi::NSK,
15 => Abi::AROS,
16 => Abi::FENIXOS,
17 => Abi::CLOUDAbi,
18 => Abi::OPENVOS,
_ => Abi::NONE
};
let abi_version: u8 = bytes[8];
let elf_type: ElfType = match bytes[16 ... 17] {
[0x01, 0x00] => E... | Rust | 0 |
urn Ok((relational_node, pos));
}
let mut additive_exp_node = additive_exp_node;
while *tok == lexer::TokType::Lt
|| *tok == lexer::TokType::Gt
|| *tok == lexer::TokType::GreaterEqual
|| *tok == lexer::TokType::LessEqual
{
let mut binexp_node = ParseNode::new();... | Rust | 0 |
at_logits = self.segmentation_layer.build_cell(
features,
output_stride=8,
crop_size=[257, 257])
sess.run(tf.global_variables_initializer())
concat_logits = sess.run(concat_logits)
self.assertTrue(concat_logits.any())
def testBuildCellWithImagePoolingCropSize(self):
... | Python | 1 |
pub const DAQmx_AIConv_DigSync_Enable: ::std::os::raw::c_ushort = 12000;
pub const DAQmx_MasterTimebase_Rate: ::std::os::raw::c_ushort = 5269;
pub const DAQmx_MasterTimebase_Src: ::std::os::raw::c_ushort = 4931;
pub const DAQmx_RefClk_Rate: ::std::os::raw::c_ushort = 4885;
pub const DAQmx_RefClk_Src: ::std::os::raw::c_... | Rust | 0 |
period * cycles;
}
}
}
}
fn run_1_minute(&mut self) {
let mut grid = self.grid.clone();
for y in 0..self.grid.len() {
for x in 0..self.grid[0].len() {
let neighbors: Vec<&Acre> = Loc { x, y }
.neighbors()
... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
1, 0) #ct & c ## element wise logical - 0 or not
ts = np.argwhere(ts == 1)
fp.write(str(len(ts))+"\n")
for j in range(len(ts)):
fp.write(str(ts[j]))
fp.write("\n\n")
# for stats
with open("NCSC_stat.txt","w") as fp:
for e in range(N):
fp.write(np.argwhere(J[e,:]==1))
fp.write(np.argwhere(XT[e,:]==1... | Python | 1 |
msg = f'{export_msg}, retry second time failed'
if finish_event_processor:
finish_event_processor(FinishEventInfo(
event_type="exporter.file_flush.rate",
is_event_fail=not is_export_pass,
item_num=len(files),
det... | Python | 1 |
client.run_send_joint_positions_thread();
let trajectory = vec![
TrajectoryPoint::new(vec![1.0], Duration::from_millis(100)),
TrajectoryPoint::new(vec![2.0], Duration::from_millis(200)),
];
client
.send_joint_trajectory(trajectory)
.unwrap()
.await
.unwr... | Rust | 0 |
let mut h_arr = MemArray4d::<f32>::zeros(shape.0.index_append(shape.1));
{
let dist = Uniform::new_inclusive(lo, hi);
let mut v = h_arr.as_view_mut();
let xs = v.flat_slice_mut().unwrap();
for x in xs.iter_mut() {
*x = dist.sample(&mut thread_rng());
}
}
... | Rust | 0 |
q!(v.len(), 10);
for i in v {
assert_eq!(*i, 123u32);
}
Ok(())
}
#[test]
fn finite_source_mut_fn() -> Result<()> {
let mut fg = Flowgraph::new();
let mut v = vec![0, 1, 2, 3].into_iter();
let src = fg.add_block(FiniteSource::new(move || v.next()));
let snk = fg.add_block(VectorSin... | Rust | 0 |
import boto3 ## Used to invoke the foundational model
import botocore.config
import json
from datetime import datetime
def blog_generate_using_bedrock(blogtopic:str) -> str:
prompt=f"""<s>[INST]Human: Write a 200 words blog on the topic {blogtopic}
assistant: [/INST]
"""
body={
"prompt":prom... | Python | 1 |
auto_publishing_videos_DY_ALL,
inputs=[
link_input,
two_line_input,
pt_file_dropdown,
video_model_dropdown,
api_key,
speed,
pt_files_info,
backg... | Python | 1 |
import click
from .create_crew import create_crew
@click.group()
def crewai():
"""Top-level command group for crewai."""
@crewai.command()
@click.argument("project_name")
def create(project_name):
"""Create a new crew."""
create_crew(project_name)
if __name__ == "__main__":
crewai()
| Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# van der Waals table
#
# Source: https://github.com/openbabel/openbabel/blob/master/src/elementtable.h
# - van der Waals radii (in Angstrom) 2.0 if unknown
# from https://doi.org/10.1021/jp8111556
#
van_der_waals_radius = {
"H": 1.10,
"D": 0.00,
... | Python | 1 |
import pandas as pd
from datetime import datetime
def export_portfolio(portfolio, filename="portfolio_report.csv"):
df = pd.DataFrame(portfolio.get_transactions())
df.to_csv(filename, index=False)
def export_price_history(simulator, filename="price_history.csv"):
data = []
history = simulator.get_pr... | Python | 1 |
ledModel):
def __init__(self, learners: List[DecoupledModel], learners_weights: torch.Tensor):
super().__init__()
self.learners = nn.ModuleList(learners)
self.base = nn.ModuleList([learner.base for learner in self.learners])
self.classifier = nn.ModuleList(
[learner.class... | Python | 1 |
&mut self.0
}
}
<filename>src/eim/eichen.rs
#[doc = "Reader of register EICHEN"]
pub type R = crate::R<u32, super::EICHEN>;
#[doc = "Writer for register EICHEN"]
pub type W = crate::W<u32, super::EICHEN>;
#[doc = "Register EICHEN `reset()`'s with value 0"]
impl crate::ResetValue for super::EICHEN {
type Type = ... | Rust | 0 |
,
pub sctps_cached_strmoq: uint32_t,
pub sctps_left_abandon: uint32_t,
pub sctps_send_burst_avoid: uint32_t,
pub sctps_send_cwnd_avoid: uint32_t,
pub sctps_fwdtsn_map_over: uint32_t,
pub sctps_queue_upd_ecne: uint32_t,
pub sctps_reserved: [uint32_t; 31],
}
#[no_mangle]
pub static mut dddone:... | Rust | 0 |
// wander through destinations
let mut session = output.session(&iter);
for &(src,dst) in &edges {
unsafe {
// this happens a lot, so unsafe helps out a fair bit.
... | Rust | 0 |
#!/usr/bin/python3
"""Script to print the first State object from the database hbtn_0e_6_usa"""
import sys
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from model_state import Base, State
if __name__ == '__main__':
# Database connection parameters
username, password, database ... | Python | 1 |
# run training loop with pytorch nvtx context manager
with torch.autograd.profiler.emit_nvtx():
t0 = datetime.now()
val = play_one_episode(agent, env, args.mode)
dt = datetime.now() - t0
print(f"episode: {e + 1}/{num_episodes}, episode end value: {val:.2f}, duration: {dt}")
portfolio_v... | Python | 1 |
}}", &data).unwrap(),
"teixeira"
);
assert_eq!(
hbs.render_template("{{upper this}}", &data).unwrap(),
"TEIXEIRA"
);
assert_eq!(hbs.render_template("{{hex 16}}", &()).unwrap(), "0x10");
}
<gh_stars>10-100
fn main() {
let mut num = 0;
println!("{}", num.is_set(5));
num... | Rust | 0 |
"t": "pageview",
"_s": "1",
"dl": "https://mubu.com/",
"ul": "zh-cn",
"de": "UTF-8",
"dt": "幕布 - 极简大纲笔记 | 一键生成思维导图",
"sd": "24-bit",
"sr": "1920x1080",
"vp"... | Python | 1 |
ertNumberField(field_label)
KK = K.K()
if 'Isogeny class' in L:
class_label = L.split()[2]
cond_label, iso_label = class_label.split("-")
num = 0
if 'Conductor' in L:
cond_ideal = L.replace("Conductor ","")
if 'Curve' in L:
... | Python | 1 |
Co.,Ltd."),
0x050F => Some("Foundation Engineering LLC"),
0x0510 => Some("UNI-ELECTRONICS, INC."),
0x0511 => Some("Brookfield Equinox LLC"),
0x0512 => Some("Soprod SA"),
0x0513 => Some("9974091 Canada Inc."),
0x0514 => Some("FIBRO GmbH"),
... | Rust | 0 |
cli::get()
.get_matches_from_safe_borrow(&mut args.iter())
.unwrap_or_else(|e| {
analytics::instrument_clap_error(&e);
e.exit();
});
match app_matches.subcommand() {
("config", Some(matches)) => {
match matches.subcommand() {
("app... | Rust | 0 |
es: `\"Win32_Devices_DeviceAndDriverInstallation\"`*"]
pub const DI_FLAGSEX_BACKUPONREPLACE: i32 = 1048576i32;
#[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`*"]
pub const DI_FLAGSEX_CI_FAILED: i32 = 4i32;
#[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`*"]
pub c... | Rust | 0 |
ge_table_iter(root, LEVELS_SV39 - 1, 0, cb, data);
}
fn flag(flags: u8, f: &str, flag: u8) {
let mut spaces = 1;
if (flags & flag) == flag {
print!("{}", f);
} else {
spaces += f.len();
}
for _ in 0..spaces {
print!(" ");
}
}
struct CompressionWalker<'data, Data> {
... | Rust | 0 |
import os
import subprocess
HOSTS_PATH = r"C:\Windows\System32\drivers\etc\hosts"
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
def flush_dns():
try:
result = subprocess.run(["ipconfig", "/flushdns"], capture_output=True, text=True, check=True)
if "success" in result.st... | Python | 1 |
64],
qweight1d: &[f64],
) -> Basis {
Basis::create_tensor_H1(
self, dim, ncomp, P1d, Q1d, interp1d, grad1d, qref1d, qweight1d,
)
}
/// Returns a tensor-product Lagrange basis
///
/// # arguments
///
/// * `dim` - Topological dimension of element
///... | Rust | 0 |
the field bit"]
#[inline(always)]
pub fn clear_bit(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 << 2)) | (((value as u32) & 0x01) << 2);
... | Rust | 0 |
import torch.nn as nn
import torch
import torch.cuda
class MatrixTree(nn.Module):
"""Implementation of the matrix-tree theorem for computing marginals
of non-projective dependency parsing. This attention layer is used
in the paper "Learning Structured Text Representations"
:cite:`DBLP:journals/corr/Li... | Python | 1 |
issues like errors and criticals does not result in hiding the
# message, but Django will not stop you from e.g. running server.
SILENCED_SYSTEM_CHECKS = []
#######################
# SECURITY MIDDLEWARE #
#######################
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_CROSS_ORIGIN_OPENER_POLICY = "same-origin"
SECU... | Python | 1 |
icon on the window or the favicon on the tab
pub icon_path: Option<&'static str>,
/// How many samples to do for MSAA
///
/// By default it is None; if it is Some, it should be a non-zero power of two
///
/// Does nothing on web currently
pub multisampling: Option<u16>,
/// Enable or di... | Rust | 0 |
}
impl Drop for MagickWand {
fn drop(&mut self) {
unsafe {
ffi::DestroyMagickWand(self.as_ptr());
}
}
}
impl From<*mut ffi::MagickWand> for MagickWand {
fn from(ptr: *mut ffi::MagickWand) -> MagickWand {
MagickWand { ptr }
}
}
<gh_stars>1000+
use crate::*;
test_cas... | Rust | 0 |
= "avx512f")]
unsafe fn test_mm512_mask_cmple_pd_mask() {
#[rustfmt::skip]
let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.);
let b = _mm512_set1_pd(-1.);
let mask = 0b01111010;
assert_eq!(_mm512_mask_cmple_pd_mask(mask, a, b), 0b00100000);
}
... | Rust | 0 |
Mean Teacher
_C.TRAINER.MEANTEACHER = CN()
_C.TRAINER.MEANTEACHER.WEIGHT_U = 1.0 # weight on the unlabeled loss
_C.TRAINER.MEANTEACHER.EMA_ALPHA = 0.999
_C.TRAINER.MEANTEACHER.RAMPUP = 5 # epochs used to ramp up the loss_u weight
# MixMatch
_C.TRAINER.MIXMATCH = CN()
_C.TRAINER.MIXMATCH.WEIGHT_U = 100.0 # weight on ... | Python | 1 |
er
@jwt_required()
def duplicatedORdeleted(user_id=None):
id = request.args.get('id')
metodo = request.args.get('metodo').lower()
data = BaseIncidencia.query.filter_by(id=id).first()
if not data:
logger.context_log(40, '404 Not Found')
return jsonify({'me... | Python | 1 |
_mut()) } != 0 {
let _ = unsafe { libc::close(pfd) };
let _ = unsafe { timer_delete(timerid) };
err_exit!("failed to call port_get");
}
println!("event returned:");
debug_port_event(&pe);
println!();
}
}
use rune::ast;
use rune::ast::{Spanned, Spa... | Rust | 0 |
rotli(true)
.user_agent("Densimeter Axiom iOS")
.build()?;
let device = Device::new();
let payload = solver::initial_payload(None)?;
let url = format!(
"https://api2.endclothing.com/rSa9Vzy3KajA9f9m/v1/challenge?p={}",
&payload
);
let response = client
.get(&... | Rust | 0 |
NSE in this distribution
// for license terms.
//! Advent of Code Day 11.
//! <NAME> 2020
use aoc::*;
use aoc_geom::*;
fn read_seats() -> Vec<Vec<char>> {
input_lines()
.map(|line| line.chars().collect())
.collect()
}
fn iterate_near(v: &[Vec<char>]) -> Vec<Vec<char>> {
let mut result = v.... | Rust | 0 |
OP,
/// Ophthalmic Mapping.
OPM,
/// Ophthalmic Tomography.
OPT,
/// Ophthalmic Tomography B-scan Volume Analysis.
OPTBSV,
/// Ophthalmic Tomography En Face.
OPTENF,
/// Ophthalmic Visual Field.
OPV,
/// Optical Surface Scan.
OSS,
/// Other.
OT,
/// Plan.
PLAN,
/// Presentation Stat... | Rust | 0 |
has_node = False
for n in session.nodes:
if(n.role == str(items[i])):
# print("already has node")
new_node = n
has_node = True
break
if(has_node == False):
new_node = Cluster... | Python | 1 |
Error(
"Expression doesnt define a function".into(),
format!("Expected an expression with a function. Got {}", s),
Some(call.head),
None,
Vec::new(),
))
}
};
Ok(expression.int... | Rust | 0 |
import pickle
from dotenv import load_dotenv
from tools.unstructure_pdf import unstructure_pdf
load_dotenv()
# 读取pickle文件
with open("chunk_0.pkl", "rb") as f:
records = pickle.load(f)
def process_pdf(record):
record_id = record[0]
language = [record[1]]
text_list = unstructure_pdf(
pdf_n... | Python | 1 |
from typing import Dict
from omegaconf import DictConfig
class ValueScheduler(object):
def __call__(self, step):
raise NotImplementedError()
class StaticValueScheduler(ValueScheduler):
def __init__(self, value):
self.value = value
def __call__(self, step):
return self.value
cla... | Python | 1 |
direct braille
cpbraille = [i + 0x2800 for i in range(256)]
# reordered braille extended charset:
# - upper square shows highest nibble in a visual form,
# - lower square shows lowest nibble in binary.
cpbraille = cp437[:0x80] + [
0x2800, 0x2840, 0x2880, 0x28c0, 0x2820, 0x2860, 0x28a0, 0x28e0, 0x2804, 0x2844, 0x2884... | Python | 1 |
data).
let syscall_cs_ss_base = (gdt::GDT_KERNEL_CODE as u16) << 3;
// The base selector of the three consecutive segments (of which two are used) for user code
// and user data. It points to a 32-bit code segment, which must be followed by a data segment
// (stack), and a 64-bit code segment.
let s... | Rust | 0 |
}
}
<gh_stars>1-10
use anyhow::{bail, Context, Result};
use clap::ArgEnum;
use console::{style, Term};
use indicatif::{MultiProgress, ProgressBar};
use linter::Linter;
use log::debug;
use path::AbsPath;
use persistent_data::PersistentDataStore;
use render::{render_lint_messages, render_lint_messages_json};
use std::col... | Rust | 0 |
=> "設置場所",
0x82u8 => "規格version",
0x83u8 => "識別番号",
0x84u8 => "瞬時消費電力",
0x85u8 => "積算消費電力",
0x86u8 => "メーカ異常コード",
0x87u8 => "電流制限設定",
0x88u8 => "異常発生状態",
0x89u8 => "異常内容",
0x8Au8 => "メーカコード",
0x8Bu8 => "事業場コード",
0x8Cu8 => "商品コード",
0x8Du8 => "製造番号",
0x8Eu8 => "製造年月日",... | Rust | 0 |
usize);
/// Docs associated with the S2 trait implementation.
impl T for S2 {
/// Docs associated with the S2 trait a_method implementation.
fn a_method(&self) -> usize {
self.0
}
/// Docs associated with the S2 trait c_method implementation.
fn c_method(&self) -> usize {
5
}
}... | Rust | 0 |
from langchain_huggingface.embeddings import HuggingFaceEmbeddings
from langchain_ollama.embeddings import OllamaEmbeddings
from langchain_openai.embeddings import OpenAIEmbeddings, AzureOpenAIEmbeddings
from typing import Union
from src.config import EmbedderConf
from src.utils.logger import get_logger
logger = get... | Python | 1 |
def diagonalDifference(arr):
right_to_left = 0
left_to_right = 0
for i in range(len(arr)): # Linha
for j in range(len(arr)): # Coluna
if i == j:
left_to_right += arr[i][j]
if i + j == len(arr) - 1:
right_to_left += arr[i][j]
return abs(left... | Python | 1 |
"""
Author: Daniela Zamorano-Martinez
Date: 11/25/24
Assignment: Module 05 Practice Exercise 7-5
"fixing" lee code, as well as write a scipt
"""
###
'''
This function works as expected because it prints the sequence and the element
As the sequence continues, is shorten itself until its empty.
The seq[1:] slices by ... | Python | 1 |
store the service id, r1-r3 can contain call parameter.
///
/// The system call service id (`svc xy`) is not passed on, we have to
/// retrieve it from code memory. Thus we load the stack pointer from the
/// callee and read the link register. The link register is pointing to
/// instruction just after the system call,... | Rust | 0 |
("another one".to_string()));
assert_code!(v, "G04 comment 1 *\nG04 another one *\n");
}
#[test]
fn test_command_serialize() {
//! A `Command` should implement `GerberCode`
let c = Command::FunctionCode(FunctionCode::GCode(GCode::Comment("comment".to_string())));
assert_code... | Rust | 0 |
_platform -= 1;
}
// If that doesn't exist... Look for a higher one. This would be the minimum API level supported by the NDK
tmp_platform = platform;
while tmp_platform < 100 {
let path = path_builder(tmp_platform);
if path.exists() {
return Ok(path);
}
tmp... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.