text
string
label_name
string
labels
int64
e_before(border_style) if subtitle_text is None or width <= 4: yield Segment(box.get_bottom([width - 2]), border_style) else: subtitle_text = align_text( subtitle_text, width - 4, self.subtitle_align, box.bottom, ...
Python
1
_DEFAULT_NO_VERIFY_SSL_CONTEXT) def client_context( ssl_cipher_list: SSLCipherList = SSLCipherList.PYTHON_DEFAULT, ) -> ssl.SSLContext: """Return an SSL context for making requests.""" return _SSL_CONTEXTS.get(ssl_cipher_list, _DEFAULT_SSL_CONTEXT) def create_no_verify_ssl_context( ssl_cipher_list: ...
Python
1
32 = 0x20; const PACK_HI_DQWORD_2X256: i32 = 0x31; macro_rules! zero { () => { _mm256_setzero_si256() }; } macro_rules! pack_lo_dword_2x128 { () => { _mm256_set_epi32(0, 0, 0, 0, 0, 0, 4, 0) }; } macro_rules! xcgh_odd_even_words { () => { _mm256_set_epi32(6, 7, 4, 5, 2, 3,...
Rust
0
ket to the context if '.' in self.train_data_prefix: fragment_pocket_mask = fragment_mask fragment_only_mask = template_data['fragment_only_mask'] pocket_only_mask = fragment_pocket_mask - fragment_only_mask if self.anchors_context: context = torch...
Python
1
3.0 2.0 1.0".parse().unwrap(), ]); assert_eq!(s.comment, "test"); assert_eq!(s.which(), Some(CoordKind::Position)); assert_eq!(s.particles.len(), 2); } #[test] fn read_xyz() { let contents: &[u8] = b"\ 2 t = 1 H 1.0 2.0 3.0 ...
Rust
0
rite(&output).unwrap(); std::process::exit(1); } let row = rows.get(0); let user_id: i32 = row.get(0); if method == "GET" { let path_info = get_env("PATH_INFO"); let mut path = path_info.split('/'); let request_set = path.nth(1).unwrap(); let request_user = path.next().unwrap(); le...
Rust
0
# generate_hard_test_set.py import json from collections import Counter # Load hardest languages with open("hardest_languages.json", "r", encoding="utf-8") as f: hardest = json.load(f) # Combine all hardest languages across all models combined_hardest = set() for langs in hardest.values(): combined_hardest.up...
Python
1
rand.inner_html().trim()); let offline = brand.value().classes().find(|c| *c == "isOffLine"); // println!("offline {}", offline.is_some()); let company = tds.next().unwrap(); // println!("company {}", company.inner_html().trim()); let ad...
Rust
0
#! /usr/bin/env python # coding:utf-8 # Author: WenZhe Zhu from scapy.all import conf from scapy.packet import * from scapy.fields import * from scapy.layers.inet import TCP from icssploit.protocols.s7comm import S7Header from icssploit.protocols.s7comm_plus import S7PlusHeader COTP_PARAMETER_CODE = {0xc0: "tpdu-size...
Python
1
import sys from parse_timestamps import parse_file # Given a slogfile with xsnap timestamps, figure out how much time the # dispatch.bringOutYourDead deliveries spend in the gc() call. This is # a decent proxy for the size of the object graph, so a JS-visible # object leak would cause this number to grow over time. Mo...
Python
1
pi = 3.14159 raio = float(input()) area = pi * raio ** 2 print(f'A={area:.4f}')
Python
1
Error = Error; fn try_from(value: ArgValue) -> Result<Self, Self::Error> { match value { ArgValue::Type(Type::Path(ty)) => { if let Some(ident) = ty.path.get_ident() { Ok(Some(ident.clone())) } else { Err(Error::ArgValueMu...
Rust
0
fn fix_newlines(s: &str) -> String { s.replace("\r\n", "\n") } async fn convert_field(field: &mut Field) -> Option<(String, String)> { let content_disposition = &field.content_disposition().unwrap(); if let Some(f_name) = content_disposition.get_name() { if let Some(s) = field.next().await { ...
Rust
0
p.remove(&node); x.insert(node); } } cliques // Returns the report } /// Pivot implementation of the Bron-Kerbosch algorithm pub fn basic_pivot( graph: Arc<Graph>, r: &mut Vec<Node>, mut p: Set, mut x: Set, opts: Options, ) -> Report { let mut cliques = Report...
Rust
0
) }) .or_else(|| { // Querying for the Sha256 can fail if for example we were linked // against libssh < 1.9, so let's fall back to Sha1 in that case. sess.host_key_hash(ssh2::HashType::Sha1).map(|fingerprint| { let mu...
Rust
0
# This script fetches info about the model by its title # Usage: python get_model_facts.py <model_id> # <model_id> is the human-readable name of the model from numerapi import CryptoAPI import sys # Function to initialize the CryptoAPI (for Numerai Crypto Tournament) def initialize_api(): return CryptoAPI(public_...
Python
1
null syscall. /// Measures this by calling `get_my_current_task_id` of the current task. fn do_null_inner(overhead_ct: u64, th: usize, nr: usize) -> Result<u64, &'static str> { let start_hpet: u64; let end_hpet: u64; let mut mypid = core::usize::MAX; let hpet = get_hpet().ok_or("Could not retrieve hpet counter")?...
Rust
0
dExit(0x0008, 0x0001) TerminateThread(0x0008, 0x00) TerminateThread(0x0009, 0x00) @scena.Lambda('lambda_3287') def lambda_3287(): OP_9E(0x00FE, 20, 0, 300, 4000) ExitThread() DispatchAsync(0x0009, 0x0000, lambda_3287) PlaySE(521, 0x00, 0x64) WaitForThreadExit(0x0101, 0x00...
Python
1
import logging from typing import Optional import torch import torch.nn.functional as F from torch import Tensor, nn from ..utils import ( apply_reduction, contains_known, contains_unknown, is_known, is_unknown, ) from .crossentropy import cross_entropy class EntropicOpenSetLoss(nn.Module): ...
Python
1
reader.run(false, &request_handler).await; }; let power_irq = interrupt::take!(POWER_CLOCK); power_irq.set_handler(on_power_interrupt); power_irq.unpend(); power_irq.enable(); power .intenset .write(|w| w.usbdetected().set().usbremoved().set()); // Run everything c...
Rust
0
$to::from(x.0[1]), $to::from(x.0[2]), $to::from(x.0[3]), ]) } } }; } impl_into_x!(u128x1_sse2, u64x2_sse2); impl_into_x!(u128x1_sse2, u32x4_sse2); ///// Debugging use core::fmt::{Debug, Formatter, Result}; impl<W: PartialE...
Rust
0
features: `\"Win32_Globalization\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] pub fn GetTimeFormatA(locale: u32, dwflags: u32, lptime: *const super::Foundation::SYSTEMTIME, lpformat: ::windows_sys::core::PCSTR, lptimestr: ::windows_sys::core::PSTR, cchtime: i32) -> i32; #[doc = "*Requ...
Rust
0
imizationObjective.MAX_SHARPE ) if max_sharpe_result["success"]: fig.add_trace( go.Scatter( x=[max_sharpe_result["volatility"]], y=[max_sharpe_result["expected_return"]], mode="markers", name="最大...
Python
1
import numpy as np from smartredis import Client, Dataset def finite_volume_simulation(steps=4000, x_res=400, y_res=100, rho0=100, tau=0.6, seed=42): """ Finite Volume simulation """ client = Client() # Addresses passed to job through SmartSim # Lattice speeds / weights NL...
Python
1
from __future__ import annotations import requests from ...typing import Any, CreateResult, Messages from ..base_provider import AbstractProvider class AiService(AbstractProvider): url = "https://aiservice.vercel.app/" working = False supports_gpt_35_turbo = True @staticmethod def create_comple...
Python
1
rime = PPoly(result.T,breaks); t=S1.x.T; # row vector of spline breaks M=len(u); L=len(t)-1; delta_t=np.diff(t); # row vector delta_t_rep=np.tile(delta_t,(M,1)).flatten(); aver_t = (t[:-1] + t[1:]) / 2 aver_t_rep = np.tile(aver_t, (M, 1)).T.flatten() tau_rep = np.tile(tau,...
Python
1
'a>>, config: &config::Model) -> Result<Self> { match config { config::Model::Darknet(config::DarknetModel { .. }) => { todo!(); } config::Model::NewslabV1(config::NewslabV1Model { cfg_file }) => { let graph = graph::Graph::load_newslab_v1_json...
Rust
0
from scipy.fftpack import fft # 导入用于快速傅里叶变换的库 import numpy as np # 导入NumPy库 import pandas as pd from scipy.signal import argrelextrema from scipy.signal import find_peaks def moving_average(signal, window_size): # 使用卷积计算移动平均 return np.convolve(signal, np.ones(window_size) / window_size, mode='valid')...
Python
1
.modify(|_, w| unsafe { w.scs().bits(self.input_src.bits()) }); } InputSrc::Pll(_) => { // todo: DRY with above. rcu.ctl.modify(|_, w| w.hxtalen().set_bit()); while rcu.ctl.read().hxtalstb().bit_is_clear() {} rcu.ctl.modify(|_, w| ...
Rust
0
# setting up device import os if 'THEANO_FLAGS' in os.environ: raise ValueError('Use theanorc to set the theano config') os.environ['THEANO_FLAGS'] = 'device={0}'.format('cuda1') import theano.gpuarray # This is a bit of black magic that may stop working in future # theano releases ctx = theano.gpuarray.type.get_co...
Python
1
.iter() .copied() .collect(); } pub fn is_script(text: &str) -> bool { if text.len() < 2 { return false; } &text[..2] == SCRIPT_SIGN } #[derive(Clone, Copy, PartialEq, Eq, Hash)] pub enum SetList { Length, Frequency, Test, Mods, Nil, } #[allow(dead_code)] pub enum ...
Rust
0
num=0; i=0; for num in range(10): num=int(input(f"enter number{num+1}:")) if num % 4 ==0: i+=1; print(f"yor number %4:{i}")
Python
1
"CO2 rating: {}", co2_rating); // Answer is the product of the ratings println!("Answer: {}", oxygen_rating * co2_rating); } fn main() { // Read all lines of input.txt //let input = fs::read_to_string("example.txt").expect("Unable to read file"); let read_time_start = time::Instant::now(); let...
Rust
0
conjunto_a = {1, 2, 3} conjunto_b = {2, 3, 4} resultado = conjunto_a.intersection(conjunto_b) print(resultado)
Python
1
lections::HashSet; use itertools::Itertools; impl Piece { /// Get the theoretically possible moves for each piece type. /// This does not check reasons which might prevent a piece from doing a move, such as exposing the same colored king to a check. pub fn get_available_squares(&self, board: &Board...
Rust
0
rely as an //! output parameter you may wrapt it into out. Consider a Mircosoft SQL Server with the following //! stored procedure: //! //! ```mssql //! CREATE PROCEDURE TestParam //! @OutParm int OUTPUT //! AS //! SELECT @OutParm = @OutParm + 5 //! RETURN 99 //! GO //! ``` //! //! We bind the return value as the first...
Rust
0
branch, commit, jenkins_url) except KeyError: pass fail_key = "%s:%s" % (name, branch) if status.upper() != "SUCCESS": # complain msg = '<font color="red">[%s] <b>%s - %s</b></font>' % ( name, status, info ...
Python
1
let str530 = &str529.replace(" all ", " ɒl "); let str531 = &str530.replace(" all", " əl"); let str532 = &str531.replace(" al", " ɒl"); let str533 = &str532.replace(" re", " ɹɪ̝"); let str534 = &str533.replace("ation", "æi̞ʃŋ"); let str535 = &str534.replace("tion", "ʃŋ"); let str536 = &str535.repl...
Rust
0
stom rendering settings renderingSettings = pxm.GetProxy('settings', 'RenderViewSettings') renderingSettings.LODThreshold = _Server.settingsLODThreshold # Put something in the scene simple.Cone() rep = simple.Show() rep.Representation = 'Surface With Edges'; rep....
Python
1
idamente models_for_batch = [] for ratio in [1.0, 1.5, 2.0]: model = builder.create_model( L_B_ratio=ratio, B=10.0, nx=4, ny=3, model_name=f"lote_LB_{ratio:.1f}", enabled_analyses=['static'], analysis_params={'visualization': {'enabled': False}} ...
Python
1
{ assert_eq!(edit_distance(b"GCCTACGCAA", b"GCCTACCCAA"), 1); assert_eq!(edit_distance(b"GTACTGTCGG", b"GTACTCGG"), 2); assert_eq!(edit_distance(b"TGTGCAAGCG", b"TGTGAAAACG"), 2); assert_eq!(edit_distance(b"CTTGTACTAT", b"CTTGAACTAT"), 1); assert_eq!(edit_distance(b"TATCCCCTAA",...
Rust
0
Op + 'static, { self.op_registry.register(name, op) } /// Allows a callback to be set whenever a V8 exception is made. This allows /// the caller to wrap the JSError into an error. By default this callback /// is set to JSError::create. pub fn set_js_error_create_fn( &mut self, f: impl Fn(JSEr...
Rust
0
url = self.BT_PANEL + "/files?action=ExecShell" pdata = self.get_key_data() pdata["shell"] = shell pdata["path"] = path self.http_post_cookie(url, pdata) get_time = 3 # 超时间 resp = self.get_execute_msg() start_time = int(time.time()) + get_time while...
Python
1
import numpy as np from pacs.utils.genfeature.genfeat import GenFeatureCore from pacs.utils.logger import generate_logger LOGGER = generate_logger(__name__) def cal_feature( trj_path: str, topology: str, reference: str, selection_fit_trj: str, selection_fit_ref: str, selection1: str, sele...
Python
1
ipe.add(combo_raw, 'combo_raw') pipe.add(combo_raw.rank(mask=total_filter), 'combo_rank') def before_trading_start(context, data): context.output = pipeline_output('ranked_stocks') # Only consider stocks with a positive efficiency rating ranked_stocks = context.output[context...
Python
1
subscription)); let (_, receiver) = channel(2); Box::new(future::ok(Box::new(receiver) as SubscriptionResult)) } } use yew::prelude::*; use yew::web_sys::Element; #[derive(Debug, Clone, Eq, PartialEq, Properties)] pub struct Props { pub inner_html: String, pub class: String, pub style:...
Rust
0
# Synchronize the accelerometer and gyroscope data # # Description: # Create data structure containing IMU and ARKit data. # # Copyright (C) 2018 Santiago Cortes # # This software is distributed under the GNU General Public # Licence (version 2 or later); please refer to the file # Licence.txt, included with the ...
Python
1
# encoding: utf-8 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE.txt 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 # "Li...
Python
1
"DeleteTransitGatewayPrefixListReference", "2016-11-15", ); #[allow(unused_mut)] let mut scope_1912 = writer.prefix("TransitGatewayRouteTableId"); if let Some(var_1913) = &input.transit_gateway_route_table_id { scope_1912.string(var_1913); } #[allow(unused_mut)] let mut s...
Rust
0
# Tag: Array, Hash Table, Sliding Window # Time: O(N) # Space: O(N) # Ref: - # Note: - # Video: https://youtu.be/br1hgtnpq4k # You are given an array nums consisting of positive integers. # We call a subarray of an array complete if the following condition is satisfied: # # The number of distinct elements i...
Python
1
'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 << 22)) | ((value as u32 & 0x01) << 22); self.w } } #[doc = "Secure mask for pin P0_23\n\nValue on reset: 1...
Rust
0
Pabovedot: c_int = 16784982; pub const GDK_KEY_Page_Down: c_int = 65366; pub const GDK_KEY_Page_Up: c_int = 65365; pub const GDK_KEY_Paste: c_int = 269025133; pub const GDK_KEY_Pause: c_int = 65299; pub const GDK_KEY_PesetaSign: c_int = 16785575; pub const GDK_KEY_Phone: c_int = 269025134; pub const GDK_KEY_Pictures: c...
Rust
0
es[i])) .collect::<Result<Vec<Self::Item>, Self::Error>>() .map(BinaryBundle::new)?; let shifted = self.shift(&mul, i).map(BinaryBundle)?; sum = self.bin_addition_no_carry(&sum, &shifted)?; } Ok(sum) } /// Compute the twos complement of t...
Rust
0
CENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use crate::ffi; /// Enum describing the kinds of anchors #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum Anchor...
Rust
0
# -*- coding: utf-8 -*- """Orangetool display functions.""" from .orangetool_params import GENERAL_ERROR_MESSAGE def hdmi_controller(command, debug=False): """ Control hdmi port. :param command: input command :type command: bool :param debug: flag for using debug mode :type debug: bool :r...
Python
1
import sys from loguru import logger from services.config_services import LOG_FILE_NAME class CustomLogger: _instance = None def __new__(cls, log_file=LOG_FILE_NAME, log_level="DEBUG"): if cls._instance is None: cls._instance = super(CustomLogger, cls).__new__(cls) cls._insta...
Python
1
se futures::prelude::*; use net2::unix::UnixTcpBuilderExt; use tokio_core::reactor::Core; use tokio_core::net::TcpListener; use std::{thread, time}; use std::net::SocketAddr; use std::sync::Arc; use hyper::{Get, StatusCode}; use hyper::header::ContentLength; use hyper::server::{Http, Service, Request, Response}; use fu...
Rust
0
in_end) def on_epoch_begin(self, epoch: int): epoch_info = dict(epoch=epoch) self._log_event(LogEvent.epoch_begin, epoch_info) def on_epoch_end(self, epoch: int): epoch_info = dict(epoch=epoch) self._log_event(LogEvent.epoch_end, epoch_info) def on_step_begin(self, step: i...
Python
1
(windows))] #[test] #[should_panic] fn test_map_panic_zero() { unsafe { // Check that zero length causes map to panic. On Windows, our map implementation never // panics. map(0, PROT_READ_WRITE, false); } } #[cfg(all(not(all(target_os = "linux", target_pointer_width = "64")), not(window...
Rust
0
shard_manager.lock().await.shutdown_all().await; }); if let Err(why) = client.start().await { error!("Client error: {:?}", why); } } use async_trait::async_trait; use flo_state::*; #[tokio::test] async fn test_send() { let container = Owner::new(State { value: 0 }); let addr = containe...
Rust
0
(variable_value); } warn!("No user variable with the name of {:} exists in configuration file. ", variable); None } fn import_file(token: &Token) -> Option<String> { use std::fs::read_to_string; if !token.has_variables() { error!("Import token found but no template name wa...
Rust
0
PITER }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87_H2_JUPITER }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87_H3_JUPITER }, aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87_H4_JUPITER } ]; const G_VSOP87_Q_JUPITER: [aavsop87::VSOP87Coefficient2; 4] =...
Rust
0
from mediawords.test.db.create import create_download_for_story from extract_and_vector.dbi.stories.text import get_text_for_word_counts from .setup_test_extract import TestExtract class TestGetTextForWordCountsNotFullText(TestExtract): def test_get_text_for_word_counts_not_full_text(self): """Test get_t...
Python
1
01,// Normal_1 0xFF, 0x04,// 639 = "roundps" // VEX_Vroundps_xmm_xmmm128_imm8 0x81,// 'v', Normal_1 0xFF, 0x04,// 639 = "vroundps" // VEX_Vroundps_ymm_ymmm256_imm8 0x80,// 'v', Previous // EVEX_Vrndscaleps_xmm_k1z_xmmm128b32_imm8 0x81,// 'v', Normal_1 0xFD, 0x04,// 637 = "vrndscaleps" // EVEX_Vrndscaleps_...
Rust
0
# pygame.draw module # https://www.pygame.org/docs/ref/draw.html # # How to draw a dashed curved line with pygame? # https://stackoverflow.com/questions/66943011/how-to-draw-a-dashed-curved-line-with-pygame/66944050#66944050 # # GitHub - PyGameExamplesAndAnswers - Shape and contour - Draw lines and polygons # https:/...
Python
1
"Stanton4a_UGF_001": "Shubin Processing Facility SPMC-3 [CLOSED]", "Stanton4a_UGF_002": "Shubin Processing Facility SPMC-5 [CLOSED]", "Stanton4a_UGF_003": "Shubin Processing Facility SPMC-10", "Stanton4a_UGF_004": "Shubin Processing Facility SPMC-11 [CLOSED]", "Stanton4a_UGF_005": "Shubin Processing Fac...
Python
1
nter_y = int(h/2)+y if Distance_level < 10: Distance_level = 10 # cv2.circle(image, (face_center_x, face_center_y),5, (255,0,255), 3 ) if CallOut == True: # cv2.line(image, (x,y), (face_center_x,face_center_y ), (155,155,155),1) cv2.line(image, (x, y-11), (x+...
Python
1
_value, PostioningType::Relative => self.y + y_value }; if below_y > self.height { panic!("Invalid y value ({}) provided for slice with height {}", below_y, self.height); } let above_height = below_y - above_y; let below_height = self.height - ab...
Rust
0
); systemd_unit.disable()?; if host_containerd_unit.is_active()? { debug!("Cleaning up container '{}'", name); command( constants::HOST_CTR_BIN, &[ "clean-up", "--container-id", ...
Rust
0
channels = connection.channels().unwrap(); while let Some(server_message) = channels.recv::<ServerMessage>() { log::debug!("ServerMessage received on {}: {:?}", handle, server_message); match server_message { ServerMessage::Joined(client_handle) => { ...
Rust
0
0, usize::min(2 * nnz_features, n_features)); // Sort indices by descending order (argmin) let mut sorted_indices = argsort_by(&kkt, |a, b| { // Swapped order for sorting in descending order b.partial_cmp(a).expect("Elements must not be NaN.") }); sorted_indices.truncate(ws_size); ...
Rust
0
"""changed comments to notes Revision ID: 83939d471035 Revises: 2aa349888150 Create Date: 2024-09-13 01:14:11.407822 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '83939d471035' down_revision = '2aa349888150' branch_labels = None depends_on = None def upgra...
Python
1
from typing import Optional import torch import torch.nn as nn __all__ = ['GaussianKernel'] class GaussianKernel(nn.Module): r"""Gaussian Kernel Matrix Gaussian Kernel k is defined by .. math:: k(x_1, x_2) = \exp \left( - \dfrac{\| x_1 - x_2 \|^2}{2\sigma^2} \right) where :math:`x_1, x_2 ...
Python
1
from django.contrib import admin, messages from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from import_export.admin import ImportExportMixin from incredible_data.bins.resources import ContainerResource from incredible_data.contacts.admin import UserStampedModelAdmin from .mod...
Python
1
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.0.0 import enum import winrt.runtime._internals import winrt.system from winrt._winrt_windows_ui_composition_scenes import ( SceneBoundingBox, SceneComponent, SceneComponentCollection, SceneMaterial, SceneMaterialInput, ...
Python
1
.segment("segment-key").is_some()); } #[test_case(0, 1)] #[test_case(2, 2)] fn in_memory_patch_does_not_update_segment_with_older_version( updated_version: u64, expected_version: u64, ) { let mut data_store = InMemoryDataStore::new(); data_store.init(basic_data()); ...
Rust
0
(&m$0) {}", ImmediateLocation::IdentPat); check_location(r"fn my_fn() { let &m$0 }", ImmediateLocation::IdentPat); } #[test] fn test_ref_expr_loc() { check_location(r"fn my_fn() { let x = &m$0 foo; }", ImmediateLocation::RefExpr); } #[test] fn test_item_list_loc() { che...
Rust
0
as usize].as_str(); track!(globals.set(var.name.as_str(), val).map_err(Error::from))?; } else { track!(globals.set(var.name.as_str(), val).map_err(Error::from))?; } } lua_ctx.load(&self.lua_script).eval().map_err(Error::fro...
Rust
0
}_{}_steps_{}_guidance_{}/rank_{}".format(args.aux_name, exp_id, "_".join(args.model.split("/")[1:-1]), num_steps, guidance, i+1) result = evaluator.main(output_dir, args.test_references) result["Steps"] = num_steps result["Guidance Scale"] = guidance result["Instances"] = len(text_prompts) result["...
Python
1
init_var=True, but these are mutually exclusive.', code='clashing-init-and-init-var', ) # TODO: same note as above re validate_assignment continue field_info = FieldInfo_.from_annotated_attri...
Python
1
presence_does_not_warn(self): with unittest.mock.patch("warnings.warn") as warn: node.UseConnected( self.client, presence=aioxmpp.PresenceState(False) ) warn.assert_not_called() def test_access_on_timeout_attribute_warns(self): with s...
Python
1
get_column(_schema: &String, _table: &String) -> Column { unimplemented!() } fn get_foreign_constraint(_schema: &String, _table: &String) -> ForeignKey { unimplemented!() } fn get_sequence(_schema: &String, _table: &String) -> Sequence { unimplemented!() } fn get_index(_schema: &String, _table: &String)...
Rust
0
x = 7 y = 5 print("{}, Hello world{}".format (x,y))
Python
1
"""Add user stats columns Revision ID: a5b3e9222a08 Revises: Create Date: 2025-04-19 18:53:35.395644 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a5b3e9222a08' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands ...
Python
1
import torch.nn as nn import sys import os import torch sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from gvp import GVP, GVPConv from data.mol_to_gvp import mol_to_gvp_graph from data.smile_to_3D import smiles_to_3d_conformer from torch_scatter import scatter_mean class MoleculeGVP(n...
Python
1
boundaries. /// The type itself must also be zero initializable and safe to drop if all bits are zeroable. pub unsafe trait RuntimeType { type Abi; fn abi(&self) -> Self::Abi; fn set_abi(&mut self) -> *mut Self::Abi; } macro_rules! primitive_runtime_type { ($($t:ty),+) => { $(unsafe impl Runt...
Rust
0
Encryptor::new_inbound(&our_node_id); let act_one = hex::decode("00036360e856310ce5d294e8be33fc807077dc56ac80d95d9cd4ddbd21325eff73f70df6086551151f58b8afe6c195782c6a").unwrap().to_vec(); assert_eq!(inbound_peer.process_act_one_with_ephemeral_key(&act_one[..], &our_node_id, our_ephemeral.clone()).unwrap()[..], he...
Rust
0
ay2 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) # Calculate histograms hist1 = cv2.calcHist([gray1], [0], None, [256], [0, 256]) hist2 = cv2.calcHist([gray2], [0], None, [256], [0, 256]) # Compare histograms using correlation correlati...
Python
1
_mask':batch[1], 'encoder_with_oov':batch[2], 'oovs_zero':batch[3], 'context_vec':batch[4], 'coverage':batch[5], 'decoder_input':batch[6], 'decoder_mask':batch[7], ...
Python
1
input_file_name, &feel_file_name); Ok(()) } Action::TestFeelExpression(test_file_name, feel_file_name, summary_only) => { test_feel_expression(&test_file_name, &feel_file_name, summary_only); Ok(()) } Action::ExportFeelExpression(input_file_name, feel_file_name, html_file_name) => { ...
Rust
0
b'\\' => { /* Ignore character close and backslash */ } _ => assert_valid_byte(&(byte as char).to_string()), } } for byte in 128..=255u8 { assert_invalid_byte(&(byte as char).to_string()); } } #[test] fn test_unicode_codepoints() { l...
Rust
0
1).unwrap().shares_count, 1); let shared_post = Social::post_by_id(2).unwrap(); assert_eq!(shared_post.blog_id, 2); assert_eq!(shared_post.created.account, ACCOUNT2); assert!(shared_post.ipfs_hash.is_empty()); assert_eq!(shared_post.extension, self::extension_shared_post(1)); }); } #[test] fn s...
Rust
0
pretty_env_logger; #[macro_use] extern crate log; mod base; use base::*; fn main() { cluster_init!(); kaostest!("epidemic-periodic-index-fp", { // What Bastion does is doing this asynchronously. Thanks. let mut restarts = 0; loop { ...
Rust
0
} /// /// fn flush(&self) {} /// } fn init() { std::env::set_var("SERIALIZE_LOG_LEVEL", "debug"); std::env::set_var("RUST_LOG", "debug"); env_logger::init(); } pub fn import() { init(); let version = VERSION.unwrap(); debug!("{}: {}", "Version".dimmed(), version.bold()); } pub fn v...
Rust
0
_string()) .collect::<Vec<_>>() .join(" "); details.push_str(&boss_emojis); e.field( format!( "{} **{}**", match t.train...
Rust
0
* @param c second rational * @return b*c */ pub fn av_mul_q(b: AVRational, c: AVRational) -> AVRational; } extern "C" { /** * Divide one rational by another. * @param b first rational * @param c second rational * @return b/c */ pub fn av_div_q(b: AVRational, c: AVRational) -> AVRational; } extern "...
Rust
0
glyph: to_cp437(')'), fg: RGB::named(CYAN), bg: RGB::named(BLACK), render_order: 2, }) .with(Name { name: "Magic Missile Scroll".to_string(), }) .with(Item {}) .with(Consumable {}) .with(Ranged { range: 6 }) .wit...
Rust
0
, Hash, PartialOrd, PartialEq, Eq, Ord)] pub struct mach_msg_port_descriptor_t { pub name: mach_port_t, pub pad1: mach_msg_size_t, pub pad2: u16, pub disposition: u8, // mach_msg_type_name_t bitfield pub type_: u8, // mach_msg_descriptor_type_t bitfield } impl mach_msg_port_descriptor_t { ...
Rust
0
""" Паша очень любит кататься на общественном транспорте, а получая билет, сразу проверяет, счастливый ли ему попался. Билет считается счастливым, если сумма первых трех цифр совпадает с суммой последних трех цифр номера билета. Однако Паша очень плохо считает в уме, поэтому попросил вас написать программу, которая пр...
Python
1
########################################################################## # # Copyright (c) 2011, John Haddon. All rights reserved. # Copyright (c) 2011, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
Python
1