text
string
label_name
string
labels
int64
""" JupyterHub config for the littlest jupyterhub. """ import os from glob import glob from tljh import configurer from tljh.config import CONFIG_DIR, INSTALL_PREFIX, USER_ENV_PREFIX from tljh.user_creating_spawner import UserCreatingSpawner from tljh.utils import get_plugin_manager c = get_config() # noqa c.Jupyte...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType from .contract import Contract class PatchContractRequest(BaseRequest): def __init__(self) -> Non...
Python
1
import streamlit as st import pandas as pd from views import View import time class AbrirContaUI: def main(): st.header("Abrir Conta no Sistema") AbrirContaUI.inserir() def inserir(): nome = st.text_input("Informe o nome") email = st.text_input("Informe o e-mail") fone ...
Python
1
earch(r'\((\d+), (\d+)\) (Error: .+)', line) if match: line_no, column, error_msg = int(match.group(1)), int(match.group(2)), match.group(3) errors.append({"line": line_no, "column": column, "error": error_msg}) return errors except Except...
Python
1
import asyncio import aoc_lube import numpy as np from aoc_lube.utils import Vec2, extract_ints from aoc_theme import AOC_THEME, AocButton, AocText, AocToggle from batgrl.app import App from batgrl.colors import rainbow_gradient from batgrl.gadgets.grid_layout import GridLayout from batgrl.gadgets.progress_bar import ...
Python
1
import os PATH = '/mnt/Data/dataset/ReiD/AIC23_Track1_MTMC_Tracking/outputs/Detection_YOLO_pretrain' print(os.listdir(PATH)[3]) scene_cam_files = dict() for file in os.listdir(PATH): if not os.path.isfile(os.path.join(PATH, file)): continue scene, cam = file.split('_')[:2] scene_cam = scene + '_...
Python
1
subject_head_count(), 0); assert_eq!(manager.vacancies(), 1); // Subject 2 slot 0 is pointing to Subject 1 let head2 = slab.new_memo_basic_noparent(Some(2), MemoBody::FullyMaterialized { v: HashMap::new(), r: RelationSlotSubjectHead::single(0, 1, head1.clone()) }).to_head(); manager.set...
Rust
0
png", "wb") as f: f.write(requests.get(jasme).content) img = Image.open("temp.png") if img.mode != "RGB": img = img.convert("RGB") img.save("temp.jpg", "jpeg") return "temp.jpg" async def trash(text): r = requests.get(f"https://nekobot.xyz/api/imagegen?type=trash&url={text}").json(...
Python
1
ians. Inclination is from 0 to pi, azimuth is from 0 to 2 pi. fn from_spherical(radius: f64, inclination: f64, azimuth: f64) -> WorldVec { vec3::Vec3( radius * inclination.sin() * azimuth.cos(), radius * inclination.sin() * azimuth.sin(), radius * inclination.cos(), ...
Rust
0
conv6_2), conv3]) else: up7 = K.concatenate([UpSampling2D(size=(2, 2))(conv6_2), conv3]) up7 = BatchNormalization()(up7) conv7 = Conv2D(n_filters, (3, 3), activation=activation, padding='same')(up7) conv7 = Conv2D(n_filters, (3, 3), activation=activation, padding='same')(conv7) conv7 = Dropo...
Python
1
m} for m in args.modes] else: modes = STRUCTURED_OPTIONS # Build parameters params = { "max_images": args.max_images, "max_workers": args.max_workers } # Calculate total runs total_runs = sum(len(config["thinking_budgets"]) for config in selecte...
Python
1
itchio_body += f"{lang_content['body']}\n\n" write_file(file_path, xml_content) print(f"Generated {file_path}") # Write the Itch.io body content itchio_file_path = f'notes/{version}/itchio.txt' write_file(itchio_file_path, itchio_body.strip()) def generate_google_notes(version, content=...
Python
1
class Solution: def partitionLabels(self, s: str) -> List[int]: m = defaultdict(int) for i in s: m[i] += 1 res = [] curr_count = 0 curr_chars = set() for char in s: if char in curr_chars or m[char] == 1: m[char] -= 1 ...
Python
1
: *const c_void, pub flags: VkPipelineCreateFlags, pub stage: VkPipelineShaderStageCreateInfo, pub layout: VkPipelineLayout, pub basePipelineHandle: VkPipeline, pub basePipelineIndex: i32, } // @see https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkPipelineShaderStageCreateInf...
Rust
0
from autogen_agentchat.agents import AssistantAgent from autogen_ext.models.ollama import OllamaChatCompletionClient import asyncio from dotenv import load_dotenv import os load_dotenv() from langchain_community.utilities import GoogleSerperAPIWrapper os.environ["SERPER_API_KEY"] = os.getenv("SERPER_API_KEY") ollama...
Python
1
let mut opts = Options::default(); let mut got_dashdash = false; for f in args.into_iter().map(Into::into) { if got_dashdash { opts.interpreter_args.push(f.clone()); continue; } if f.is_empty() { } else if f.starts_with('-')...
Rust
0
# Copyright 2017-2023 Posit Software, PBC # # 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 ...
Python
1
::Binary, false), Field::new("c17", DataType::Utf8, true), Field::new("c18", DataType::Utf8, false), ]); Postgres::create_table(connection, "t1", &Arc::new(schema.clone()))?; let read_schema = Postgres::get_table_schema(connection, "t1")?; assert_eq!(schema, read_...
Rust
0
result_dict = { 'scenario': result.scenario_name, 'success': result.success, 'execution_time': result.execution_time, 'cache_hit': result.cache_hit, 'error': result.error_message } if result.result...
Python
1
{ let mut op = libc::sembuf { sem_num: SEM_NUM, sem_op: -1, sem_flg: SEM_UNDO, }; cvt(libc::semop(self.id, &mut op as *mut libc::sembuf, NSOPS))?; Ok(LockGuard { id: self.id }) } } ...
Rust
0
anual_seed(seed) # np.random.seed(seed) # random.seed(seed) torch.manual_seed(seed) np.random.seed(seed) random.seed(seed) if torch.cuda.is_available(): torch.cuda.manual_seed_all(seed) #转换director3d相机pose def convert_camera_parameters_into_viewpoint_cameras(cameras, h=None, w=None,i...
Python
1
self.cursor.consume_string_sigil()?; let s = self.cursor.consume_string_contents(count)?; self.cursor.consume_string_closer()?; Ok(Some(s)) } fn consume_and_validate(mut self) -> Result<Cursor<'s>, ParseError<'s>> { loop { if self.next_or_error()?.is_none() ...
Rust
0
-> u8 { debug_assert!(n < 8); (self.0 >> n) & 0b1 } #[inline] pub unsafe fn set_unchecked(&mut self, n: usize) { debug_assert!(n < 8); self.0 |= 0b1 << n; } } impl Default for Byte { #[inline] fn default() -> Self { Byte(0) } } pub(crate) trait Bit {...
Rust
0
" Warning: Priority value for {item} is greater than the maximum value ({priority_max_value}). Default set to maximum value.") priority = priority_max_value ordered.append((priority, item)) foundPriority = True ...
Python
1
RIGHT-ENTERPRISE-MIB", "trapChannelId"), ("BBRIGHT-ENTERPRISE-MIB", "trapAlarmId"), ("BBRIGHT-ENTERPRISE-MIB", "trapAlarmName"), ("BBRIGHT-ENTERPRISE-MIB", "trapAlarmStatus"), ("BBRIGHT-ENTERPRISE-MIB", "trapAlarmTime"), ("BBRIGHT-ENTERPRISE-MIB", "trapAlarmCriticity"), (...
Python
1
resp.json::<serde_json::Value>() .context(error::ReqwestError { msg: String::from("Could not deserialize MultiContainersResponseBody"), }) }) .and_then(|json| { // This json object can be either { data: { containers: { } } } if the ca...
Rust
0
lf, message: OWNLightingEvent): """Handle an event message.""" if self._attr_device_class == SwitchDeviceClass.SWITCH: LOGGER.info( "%s %s", self._gateway_handler.log_id, message.human_readable_log.replace("Light", "Switch"), ) ...
Python
1
ons under the License. use std::collections::HashMap; use proc_macro2::Span; use syn::parse::{Parse, ParseStream}; use syn::punctuated::Punctuated; use syn::token::*; use syn::*; /// Matches `label_enum` keyword. struct LabelEnum { pub span: Span, } impl Parse for LabelEnum { fn parse(input: ParseStream) ->...
Rust
0
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from taskgraph.transforms.base import TransformSequence from taskgraph.util.schema import resolve_keyed_by from ..buil...
Python
1
from dotenv import load_dotenv from pydantic.v1 import ConfigDict from pydantic_settings import BaseSettings from utils.browser_settings.browser_type import BrowserType load_dotenv() class Settings(BaseSettings): browser: BrowserType = BrowserType.CHROME headless: bool = False model_config = ConfigDict(...
Python
1
sionMachineNum: int :param _MalwareNum: 木马文件数。 :type MalwareNum: int :param _NonlocalLoginNum: 异地登录数。 :type NonlocalLoginNum: int :param _BruteAttackSuccessNum: 暴力破解成功数。 :type BruteAttackSuccessNum: int :param _VulNum: 漏洞数。 :type VulNum: int :param...
Python
1
em)) }, NamedGroup::SIKEP434COMPRESSED => { oqs::init(); let kem = oqs::kem::Kem::new(oqs::kem::Algorithm::SikeP434Compressed).unwrap(); Some(KexAlgorithm::KEM(kem)) }, NamedGroup::SIKEP434COMPRESSED1CCA => { oqs::init(); let...
Rust
0
477c\u4e3d/\u3012' test_1 = u'\u4ee4\u477c\u3080\u304b\u3057\u3080\u304b\u3057\u3042\u308b\u3068\u3053\u308d\u306b' test_2 = u' foo = "Quoted string ****\u4ee4\u477c" ' ereplace = {'errors': 'replace'} exml = {'errors': 'xmlcharrefreplace'} for codec in ("iso-2022-jp", "iso-2022...
Python
1
from models.admin import * from models.user import * __all__= ['create_admin', 'create_user']
Python
1
'labels': self.labels, 'sort': self.sort, 'since': self.since, }) @dataclass class current_user(Retrieval): """a reference to the current user""" type = User request = snug.GET('user') @dataclass class issues(Retrieval): type = t.List[Issue] requ...
Python
1
Bc7)); assert_eq!(1, ImageFormat::tile_dimension(&ImageFormat::RgbaF32)); } } use crate::decl::ToDecl; use crate::errors::Error; use crate::instance::ToInstance; use crate::param::Param; use crate::port::{ConnectionMap, DefaultPort, Port, WidthMap}; use crate::vec_expr_try_from_expr; use verilog::ast as vl;...
Rust
0
"""Module containing factory class for building uvicorn app for the Galaxy Tool Shed. Information on uvicorn, its various settings, and how to invoke it can be found at https://www.uvicorn.org/. The Galaxy Tool Shed can be launched with uvicorn using the following invocation: :: uvicorn --app-dir lib --factory ...
Python
1
# coding: utf8 # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # # 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 requ...
Python
1
for SettingsUpdate2Flags { fn static_type() -> Type { unsafe { from_glib(ffi::nm_settings_update2_flags_get_type()) } } } #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] impl glib::value::ValueType for SettingsUpdate2Flags { type Type = Self...
Rust
0
from django.contrib import admin from django.db.models import Count from django.templatetags.l10n import localize from django.templatetags.static import static from django.utils.html import format_html from django.utils.translation import gettext_lazy as _ from .conf import settings from .models import Cookie, CookieG...
Python
1
tem() return dpi / 96.0 def get_screen_resolution(self)->Size: user32 = ctypes.windll.user32 width = user32.GetSystemMetrics(0) height = user32.GetSystemMetrics(1) return Size(width=width,height=height) def screenshot_in_bytes(self,screenshot:PILImage)->bytes: ...
Python
1
d6\xfa\xee\x0d1?\x0b\xa9\x1e\xcdw\x86y\ \x06\x04\xa5=\xf4\xd3\xa2r\xd1\x98\xdf\x03\xd2\x16\xb5\xcf\ z~O\x12\xf1a\xab\xf9\x86\xc2\xd6*\xe6\x01d\x90\ \xbe\xb6\xc4\xfc\xd6\xc0\xfcna\xde\xcf\x98\xb4\xf9\xf9\xc4\ \xfa\x17\x14mzs\xf6\x87[k\xccK\xf9\xed\x10\xda\ \xd8\xd9\xd9\xae\x18\xa0\x87\xf0\x1dw\x9f\x86\xf47\xf6\xf7\ \xc1...
Python
1
= (self.w.bits & !0x03ff_ffff) | ((value as u32) & 0x03ff_ffff); self.w } } impl W { #[doc = "Bits 0:25"] #[inline(always)] pub fn enable_w1tc(&mut self) -> ENABLE_W1TC_W { ENABLE_W1TC_W { w: self } } } <reponame>malywonsz/book-pl // ANCHOR: all fn main() { // ANCHOR: here let s1 ...
Rust
0
ETRY_FIELD, crs=self.net.planar_crs) match_link_gdf = match_link_gdf.to_crs(self.net.geo_crs) # heading vec layer match_heading_gdf = prj_p_layer.copy() match_heading_gdf.dropna(subset=[net_field.X_DIFF], inplace=True, axis=0) match_heading_gdf = match_heading_gdf.to_crs(self.ne...
Python
1
&self) -> &Bytes { if self.br.is_none() { let bytes = self.identity.body().as_ref(); let mut buffer = utils::WriteableBytes::with_capacity(bytes.len() / 2 + 64); let mut c = brotli::CompressorWriter::new(&mut buffer, 4096, 8, 21); c.write_all(bytes) ...
Rust
0
Key::Z, "spawn agents here".to_string())], _ => Vec::new(), } } pub fn execute(ctx: &mut EventCtx, app: &mut App, id: ID, action: String) -> Transition { match (id, action.as_ref()) { (ID::Building(b), "start a trip here") => { Transition::Push(AgentSpawner::new(ctx, app, Some(b))) ...
Rust
0
.ok_or(BalloonConfigError::DeviceNotFound) .map(|balloon_mutex| balloon_mutex.lock().expect("Poisoned lock").config()) .map(BalloonDeviceConfig::from) } } #[cfg(test)] pub(crate) mod tests { use super::*; pub(crate) fn default_config() -> BalloonDeviceConfig { BalloonDev...
Rust
0
ctorian-era outfit with brass goggles and leather straps. " pipeline = LuminaText2ImgPipeline.from_pretrained("Alpha-VLLM/Lumina-Next-SFT-diffusers", torch_dtype=torch.bfloat16).to("cuda") # TeaCache pipeline.transformer.__class__.enable_teacache = True pipeline.transformer.__class__.cnt = 0 pipeline.transformer.__cla...
Python
1
if callback: if not blocking: t = context.Thread(target = callback, args = (r,)) t.daemon = True t.start() else: callback(r) else: self.con...
Python
1
refresh_redirect(flask.request.path) # Global tasks for all requests # === @app.before_request def clear_trailing(): """ Remove trailing slashes from all routes We like our URLs without slashes """ parsed_url = urlparse(unquote(flask.request.url)) path =...
Python
1
, address, value, data, gas_limit, } => Self::TransactCall { caller, address, value, data: data.to_vec(), gas_limit, }, evm::tracing::Event::TransactCreate { caller, value, init_code, gas_limit, address, } => Self::TransactCreate { caller, valu...
Rust
0
# 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. import torch import unittest from fairseq.modules.multihead_attention import MultiheadAttention class TestMultiheadAttention(unittest.TestCa...
Python
1
/// [isZoomSupported](https://developer.android.com/reference/android/telecom/VideoProfile.CameraCapabilities.html#isZoomSupported()) pub fn isZoomSupported<'env>(&'env self) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> { // class.path == "and...
Rust
0
address: Address, args: Bytes, current_cycle: u64, ) -> ServiceResponse<(String, u64)> { let json_payload = match ExecPayload::new(address, args).json() { Ok(p) => p, Err(e) => return e.into(), }; let resp = self.service_read("riscv", "call", ...
Rust
0
ool) { debug_assert!(self.len() >= 3); let rview = self.rview(); let r0 = rview[0].as_u64(); let r1 = rview[1].as_u64() << 32; let r2 = rview[2].as_u64(); let (v, n) = u64_to_hi64_2(r0, r1 | r2); (v, n || nonzero(self, 3)) }} perftools_inline!{ fn hi6...
Rust
0
mem.write_obj_at_addr(mpc_lintsrc, base_mp) .map_err(|_| Error::WriteMpcLintsrc)?; base_mp = base_mp.unchecked_add(size); checksum = checksum.wrapping_add(compute_checksum(&mpc_lintsrc.0)); } { let size = mem::size_of::<MpcLintsrcWrapper>(); let mut mpc_lintsr...
Rust
0
Create a new stage template code within the cargo crate (assumes certain dependencies). <stagename> Stage name for the template. --main (Optional) Create a stage template with just main (no split/join) adapter Create a new martian rust adapter executable. <adaptername> Name of the adapter...
Rust
0
::new(String::from("html"), AttrMap::new()); let html = Node::new(NodeType::Element(elem_html), vec![head, body]); assert_eq!(vec![html], parser.parse_nodes()); } /// Test parse nodes unclosed tag (invalid) #[test] fn nodes_unclosed_invalid() { let content = "<html>...
Rust
0
e=False): """ Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) total - Required : total iterations (Int) prefix - Optional : prefix string (Str) suffix - Optional : suffix string (Str) decimal...
Python
1
q0, q1 = self.qubits theta = self.param("theta") return -theta * (1 - sZ(q0) * sZ(q1) - sZ(q0) + sZ(q1)) / (4) @cached_property def tensor(self) -> QubitTensor: unitary = [ [1.0, 0, 0, 0], [0, 1.0, 0, 0], [0, 0, np.exp(1j * var.asfloat(self.pa...
Python
1
; use syn::{ braced, parenthesized, parse::{Parse, ParseStream}, token::{Brace, SelfValue}, Token, }; use super::{ Annotated, Ownership, VisitorDef, VisitorSignature, WalkerDef, WalkerMethod, }; impl Parse for VisitorDef { fn parse(input: ParseStream) -> syn::Result<Self> { let visitor_ident = input.parse::<I...
Rust
0
} /// Sets the display format using *a C-style printf string* pub fn display_format<F2: AsRef<str>>(self, display_format: F2) -> Drag<T, L, F2> { Drag { label: self.label, speed: self.speed, min: self.min, max: self.max, display_format: So...
Rust
0
); } } } else { println!("Bad status: {:?}", response.status); } } fn parse_result(response: &str) -> Result<String, LoginError> { use rustc_serialize::json::Json; if let Ok(root) = Json::from_str(response) { if let Some(obj_ro...
Rust
0
{ width: f32, height: f32, depth: f32, } struct Sphere { radius: f32, } struct Cone { base_radius: f32, height: f32, } trait Volume { fn volume(&self) -> f32 { 0.0 } } impl Volume for Cube { fn volume(&self) -> f32 { self.width * self.height * self.depth } } ...
Rust
0
Theorem.Register.Eta` ABI call. pub(crate) const ABI_THEOREM_REGISTER_ETA_INDEX: usize = 66; /// The index of the `Theorem.Register.Application` ABI call. pub(crate) const ABI_THEOREM_REGISTER_APPLICATION_INDEX: usize = 67; /// The index of the `Theorem.Register.Lambda` ABI call. pub(crate) const ABI_THEOREM_REGISTER_L...
Rust
0
# -*- coding: utf-8 -*- # @Author : llc # @Time : 2021/6/21 11:23 from flask_openapi3 import Info, OpenAPI info = Info(title="oauth API", version="1.0.0") # https://spec.openapis.org/oas/v3.1.0#implicit-oauth2-sample oauth2 = { "type": "oauth2", "flows": { "implicit": { "authorizationU...
Python
1
pub fn read_xwd_file_header(mmap : &Mmap) -> XwdFileHeader { XwdFileHeader { header_size : u32::from_be_bytes((&mmap[0..4]).try_into().unwrap()), file_version : u32::from_be_bytes((&mmap[4..8]).try_into().unwrap()), pixmap_format : u32::from_be_bytes((&mmap[8..12]).try_into().u...
Rust
0
ult according to the expectations. /// /// # Examples /// /// ``` /// use pixie_rust::recommender::Recommender; /// use pixie_rust::recommender::RecommenderNode; /// /// let mut recommender: Recommender<String> = Recommender::new(); /// /// let raid = String::from("The Raid"); ...
Rust
0
0..index].replace(" ", ""); let value = item[index + 1..item.len()].replace("\"", ""); hawk_auth.insert(key, value); } } debug!("hawk_auth is {:?}", hawk_auth); let id = hawk_auth....
Rust
0
; for n in 0..VERT_COUNT { let curr_step = n as f32 * 2.0 * PI / STEPS as f32; let x = center.x + (x_radius * cosf(curr_step)); let y = center.y + (y_radius * sinf(curr_step)); vertexes.push(Vertex::new_colored(Vec2::new(x, y), self.color)); } v...
Rust
0
from django.contrib.auth.models import AbstractUser class AdminUser(AbstractUser): class Meta: verbose_name = "Админ. пользователи"
Python
1
# type: ignore # adapted from https://github.com/ProjectNUWA/DragNUWA import functools import torch.nn as nn def weights_init(m): classname = m.__class__.__name__ if classname.find("Conv") != -1: nn.init.normal_(m.weight.data, 0.0, 0.02) elif classname.find("BatchNorm") != -1: nn.init.nor...
Python
1
import eth_abi import rlp import web3 from hexbytes import HexBytes BLOCK_NUMBER = 18578883 SCRVUSD = "0x0655977FEb2f289A4aB78af67BAB0d17aAb84367" VERIFIER = "" ASSET_PARAM_SLOTS = [ 21, # total_debt 22, # total_idle, slot doesn't exist ] SUPPLY_PARAM_SLOTS = [ 20, # totalSupply 38, # full_profit...
Python
1
import os import numpy as np import pytest from fastembed import SparseTextEmbedding from tests.utils import delete_model_cache @pytest.mark.parametrize("model_name", ["Qdrant/bm42-all-minilm-l6-v2-attentions", "Qdrant/bm25"]) def test_attention_embeddings(model_name: str) -> None: is_ci = os.getenv("CI") m...
Python
1
cucumber::gherkin::Step; use cucumber::{given, then, when, World, WorldInit}; use ray_tracer::graphics::{canvas, canvas_to_ppm, color, pixel_at, write_pixel, Canvas, Color}; #[derive(Debug, WorldInit)] struct CanvasWorld { canvas: Option<Canvas>, paint_colors: Vec<Color>, output: Option<String>, } #[asy...
Rust
0
import os import json from dotenv import load_dotenv from langchain.prompts import PromptTemplate from langchain_google_genai.chat_models import ChatGoogleGenerativeAI # Load environment variables (GOOGLE_API_KEY, etc.) load_dotenv() # Load the external prompt for code generation prompt_template = PromptTemplate.from...
Python
1
!(), but it's not ready. // This is what a macro that uses concat_ident!() might produce, written out in full. enum SenderContextX25519HkdfSha256HkdfSha256 { AesGcm128(AeadCtxS<AesGcm128, HkdfSha256, X25519HkdfSha256>), ChaCha20Poly1305(AeadCtxS<ChaCha20Poly1305, HkdfSha256, X25519HkdfSha256>), } enum SenderCo...
Rust
0
les: the Gaussian log stddev Tensor. :return: a tensor like x of log probabilities (in nats). """ assert x.shape == means.shape == log_scales.shape centered_x = x - means inv_stdv = th.exp(-log_scales) plus_in = inv_stdv * (centered_x + 1.0 / 255.0) cdf_plus = approx_standard_normal_cdf(plus...
Python
1
= "oz_tr")] OzTr, /// Metric Tons (aka Tonne) #[serde(rename = "t")] _T, /// Tons (US) #[serde(rename = "tn")] Tn, /// US Dollars #[serde(rename = "USD")] Usd, /// Allowances #[serde(rename = "Alw")] Alw, /// Cubic Meters #[serde(rename = "CBM")] Cbm, /// Certified Emissions Reduction #[serde(rename =...
Rust
0
loop_no = debug_info.looptoken.number asminfo = debug_info.asminfo asmaddr = space.w_nil asmlen = space.w_nil if asminfo is not None: asmaddr = space.wrap_int(asminfo.asmaddr) asmlen = space.wrap_int(asminfo.asmlen) return space.wrap_list([ _assoc(space, "type", space.wr...
Python
1
Opcode::ADD, Opcode::ADDC, Opcode::SUBC, Opcode::SUB, Opcode::CMP, Opcode::DADD, Opcode::BIT, Opcode::BIC, Opcode::BIS, Opcode::XOR, ...
Rust
0
'\u{48f}', '\u{491}', // \u{490} -> ґ '\u{491}', '\u{493}', // \u{492} -> ғ '\u{493}', '\u{495}', // \u{494} -> ҕ '\u{495}', '\u{497}', // \u{496} -> җ '\u{497}', '\u{499}', // \u{498} -> ҙ '\u{499}', '\u{49b}', // \u{49a} -> қ '\u{49b}', '\u{49d}', // \u{49c} -> ҝ '\u{49d}', '\u{49f}', // \u{49e} -> ҟ ...
Rust
0
""" Relativistic shocktube tests for MHD in dynamical spacetimes Nearly identical to shocktube tests for GRMHD; just skips hydro tests Runs tests for different - reconstruction algorithms - Riemann solvers For MHD runs "test1" from Mignone, Ugliano, & Bodo 2009, MNRAS 393 1141 Since no analytic solutions are avail...
Python
1
"""Tests the lock platform of the Loqed integration.""" from loqedAPI import loqed from homeassistant.components.loqed import LoqedDataCoordinator from homeassistant.components.loqed.const import DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_LOCK, SERVICE_OPEN, SERVICE_UNLOCK, ST...
Python
1
use serde; use serde_json::{self, from_value, to_string, to_value}; use crate::BoxFuture; #[derive(Debug, PartialEq)] pub struct ServerError<E> { pub message: String, pub data: Option<E>, } impl<E, D> From<E> for ServerError<D> where E: fmt::Display, { fn from(err: E) -> ServerError<D> { Serv...
Rust
0
cess_traits::ContainsVariant for Enum { fn has_variant<T: 'static>(&self) -> bool { is_integral::<T>() || is_float::<T>() } fn contains_variant<T: 'static>(&self) -> Result<bool, variant_access_traits::VariantAccessError> { if self.has_variant::<T>() { match &self { ...
Rust
0
-> &mut Self { self.divided_by_zero_as_warning = new_value; self } pub fn set_max_warning_cnt(&mut self, new_value: usize) -> &mut Self { self.max_warning_cnt = new_value; self } pub fn set_sql_mode(&mut self, new_value: u64) -> &mut Self { self.sql_mode = new_v...
Rust
0
''' FashionStar Uart舵机 > 读取舵机的状态信息 < -------------------------------------------------- - 作者: 阿凯 - Email: kyle.xing@fashionstar.com.hk - 更新时间: 2020-12-5 -------------------------------------------------- ''' # 添加uservo.py的系统路径 import sys sys.path.append("continuum/fashionstar-uart-servo-python-master/src") # 导入依赖 impo...
Python
1
`eval_metric_fn` take exclusively Tensor arguments. This helper can help create such a function from a more generic function that can take both Tensor and non-Tensor arguments. Args: fn: A eval_metric_fn that takes both Tensor and non-Tensor arguments. This function must return a dict of form {...
Python
1
# Copyright (c) Saga Inc. # Distributed under the terms of the GNU Affero General Public License v3.0 License. from datetime import datetime, timedelta from typing import Union import pandas as pd from mitosheet.public.v3.rolling_range import RollingRange # Input types StringRestrictedInputType = Union[pd.Series, s...
Python
1
and yellow tend to trip up HSV and HSL: the /// color system doesn't account for how much brighter the color yellow is compared to the color /// purple. What would equiluminant purple and yellow look like? We can find out. /// /// ``` /// # use scarlet::prelude::*; /// # use scarlet::colors::HS...
Rust
0
# Create a function that solves a word search puzzle. # Provide a 2D grid representing the puzzle and a list of words to find. # Implement a backtracking algorithm to search for the words in the grid, marking visited cells to avoid repetition. # Output the locations of the found words within the grid. #neatly prints w...
Python
1
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from sparse_cc import * def test_h2o_eom_ccsdtq(): mol = pyscf.gto.M( atom=""" O H 1 1.1 H 1 1.1 2 104""", basis="sto-6g", symmetry="c2v", ) mf = pyscf.scf.RHF(mol) mf.kernel() ...
Python
1
SetFilterIndex(AObj: usize, AValue: i32); pub fn SelectDirectoryDialog_GetInitialDir(AObj: usize) -> *const c_char; pub fn SelectDirectoryDialog_SetInitialDir(AObj: usize, AValue: *const c_char); pub fn SelectDirectoryDialog_GetOptions(AObj: usize) -> TOpenOptions; pub fn SelectDirectoryDialog_SetOptions(AObj: ...
Rust
0
) # 移除空值筛选条件 active_filters = {k: v for k, v in filters.items() if v} # 验证筛选条件有效性 if not validate_filter_conditions(active_filters): return ResponseManager.error("筛选条件无效", 400) # 执行筛选查询 filtered_users = filter_users_by_conditions(cur...
Python
1
orch.ones((N, 1, 1, 1)).to(device) * self.cfg.get("max_d", 50.0) min_d = torch.ones((N, 1, 1, 1)).to(device) * self.cfg.get("min_d", 0.0) # Adjust the maximum minimum depth thresholds for current scale if (depth_scales is not None) and (depth_shifts is not None): max_d = depth_scale...
Python
1
time.sleep(0.001) def turn_off(self): """ Sets the gate voltage to zero. Args: is_wait (bool): If True, waits until the voltage reaches zero. """ self.voltage(0.0, is_wait = True) def is_at_target_voltage( self, target_voltage: float, tolerance: ...
Python
1
KeyCode::KeyS => s.push('S'), KeyCode::KeyT => s.push('T'), KeyCode::KeyU => s.push('U'), KeyCode::KeyV => s.push('V'), KeyCode::KeyW => s.push('W'), KeyCode::KeyX => s.push('X'), KeyCode::KeyY => s.push('Y'), KeyCode::KeyZ => s.push('Z'), KeyCode::Digit0 => s.push('0'), KeyCode...
Rust
0
methods based on a new `Style`, created with //! [`Style::new()`]. Each method creates a new style that has that specific //! property set. For example: //! //! ``` //! use nu_ansi_term::Style; //! //! println!("How about some {} and {}?", //! Style::new().bold().paint("bold"), //! Style::new().under...
Rust
0
from typing import Optional import paddle from paddle import Tensor from paddle.nn import Linear class DenseGraphConv(paddle.nn.Layer): r"""See :class:`paddle_geometric.nn.conv.GraphConv`.""" def __init__( self, in_channels: int, out_channels: int, aggr: str = 'add', b...
Python
1