text
string
label_name
string
labels
int64
str(), "http://www.example.org/where?q=now"); Ok(()) } #[test] fn decode_request_target_absolute_form_with_host() -> Result<()> { let request = decode_request_headers( &mut Cursor::new( "GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1\nHost: example.c...
Rust
0
import sys import numpy as np import tensorflow as tf sys.path.append("../") from config import FLAGS class Discriminator(object): def __init__(self, encoder_rnn_output, temperature, is_training=True, ru=False): with tf.variable_scope("Discriminator_input"): self.encoder_rnn_output = encode...
Python
1
set mp3 quality: 2 for highest quality, 7 for fastest speed """ wav = prevent_clip(wav, mode=clip) path = Path(path) suffix = path.suffix.lower() if suffix == ".mp3": encode_mp3(wav, path, samplerate, bitrate, preset, verbose=True) elif suffix == ".wav": if as_float: ...
Python
1
"employees" } await test_client.post( f"/api/v1/scenarios/{scenario1['id']}/decisions", params={"player_id": sample_player.id}, json=decision_data ) # Generate next scenario response2 = test_client.get( f"/api/v1/scenarios/generate...
Python
1
calculate the bounding rectangle by calculating (min_x, max_x, min_y, max_y). 6. For the N bounding rectangles computed in the last step, find the rectangle with the minimum area. This will give the minimum bounding rectangle for our rotated set of convex hull points (see Step 4). 7. Undo the...
Python
1
use strsim::jaro_winkler; use super::user::UserObject; #[derive(Default)] pub struct UserSearchQueries; #[Object] impl UserSearchQueries { /// Finds users that are similar to the query provided. Matches against /// both username and display name and sorts them by similarity. async fn search_users( &self, cont...
Rust
0
TER => Claims{ iat: 1609459200, exp: 1609545540, iss: 0 }; "format to date time")] #[test_case("2021/01/01 00:00:00", "2021/01/01 23:59:00", 0, FORMATTER_WITH_SEC => Claims{ iat: 1609459200, exp: 1609545540, iss: 0 }; "format to date time with seconds")] #[test_case("2021/01/01 00:00:00.000", "2...
Rust
0
n_usess r%add_use;ConstantFolder.node_to_last_non_output_use.<locals>.add_use_-)# c"#D)005r=rr2rlistsetnextiterreversedmodulernodesrBpytreetree_map_only_rCfxNoderHkwargslenusersr[)r9 output_noder_r]rr^s @@@r%r7*Const...
Python
1
_code_blocks_size } if (*l_current_precinct).incltree.is_null() { (*l_current_precinct).incltree = opj_tgt_create((*l_current_precinct).cw, (*l_current_precinct).ch, manager) } else { (*l_current_precinct).incltree = opj_tgt_ini...
Rust
0
(),"fieldtype".as_bytes().to_vec()); let mandatory=json_get_value(field.clone(),"mandatory".as_bytes().to_vec()); // get the field from "info" let fieldvalue=json_get_value(info.clone(),fieldname); if mandatory==vy { ensure!(fieldvalue....
Rust
0
e_str!("Unexpected field type"), } } None } } impl<'a> Validator<Yaml> for ObjectValidator<'a> { fn validate(&self, yaml: &Yaml) -> Option<String> { match yaml { Yaml::Hash(hash) => self.validate_attributes(hash), _ => some_str!("field is not object")...
Rust
0
from sleekxmpp.test import * from sleekxmpp.stanza.presence import Presence class TestPresenceStanzas(SleekTest): def testPresenceShowRegression(self): """Regression check presence['type'] = 'dnd' show value working""" p = self.Presence() p['type'] = 'dnd' self.check(p, "<presence...
Python
1
핸들링에서 만나는 에러는 여기까지 올라오지 않는다. (...do not bubble up to this point.) if let Err(err) = res { error!(cause = %err, "failed to accept"); } } _ = shutdown => { // 셧다운 시그널을 수신했다. info!("shutting down"); } } // 'shutdown_complete' ...
Rust
0
as regular raw pointer /// casts are safe, access through the produced raw view is only possible /// in an unsafe block or function. pub fn cast<B>(self) -> RawArrayViewMut<B, D> { assert_eq!( mem::size_of::<B>(), mem::size_of::<A>(), "size mismatch in raw view c...
Rust
0
ffi::GRBaddsos( self.ptr, 1, ind.len() as ffi::c_int, &sostype, &beg, ind.as_ptr(), weight.as_ptr(), ) })?; Ok(self.sos.add_new(self.update_mode_lazy()?)) } ///...
Rust
0
from kivy.lang import Builder from examples.common_app import CommonApp from kivymd.app import MDApp from kivymd.uix.menu import MDDropdownMenu KV = """ MDScreen md_bg_color: self.theme_cls.backgroundColor MDIconButton: on_release: app.open_menu(self) pos_hint: {"top": .98} x: "12dp" ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, api class Users(models.Model): """ Update of res.users class - add a preference about username for livechat purpose """ _inherit = 'res.users' livechat_username...
Python
1
import re from typing import Dict, List def to_snake_case(s: str) -> str: """ Convert string to snake_case. Args: s: The string to convert. Returns: String in snake_case. """ # Insert underscore before uppercase letters s = re.sub(r'([a-z0-9])([A-Z])', r'\1_\2', s) # R...
Python
1
::std::mem::size_of::<_opaque_pthread_t>(), 8192usize, concat!("Size of: ", stringify!(_opaque_pthread_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_t)) ); assert_eq!( un...
Rust
0
ome(session)).unwrap(); assert!(cli.room_messages(builder).await.is_ok()); } } use crate::protocol::OutStream; use crate::protocol_version::ProtocolVersion; use super::common::*; /// Request sent when creating cache with name. pub struct CacheCreateWithNameReq<'a> { cache_name: &'a str, } impl<'a> Ca...
Rust
0
c = input("Enter character: ") match c: case 'a' | 'e' | 'i' | 'o' | 'u' | 'A' | 'E' | 'I' | 'O' | 'U': print("Vowel") case _ if len(c) == 1 and c.isalpha(): print("Consonant") case _: print("Invalid input")
Python
1
ks(access_points: &[AccessPoint]) -> Vec<Network> { access_points .iter() .map(|ap| get_network_info(ap)) .collect() } fn get_network_info(access_point: &AccessPoint) -> Network { Network { ssid: access_point.ssid().as_str().unwrap().to_string(), security: get_network_se...
Rust
0
atest_time > 0 else "N/A" ) score = f"{max_score:.4f}".rstrip("0").rstrip(".") self.labelPlayerMaxRecord.setText( f"{score} ( Slot {max_index+1} )" if max_score >= 0 else "N/A" ) def sync_obs_player_info(self, skip_sync_name=False): """ 同步OBS直...
Python
1
(set_config::PacketRepr { flags: set_config::Flags::FragmentNormal, miss_send_len: 128, }), }; repr.set_length_auto(); emit_and_compare(&repr, "set_config"); } } use std::cmp::Reverse; /// Trait for types that have min/max values. pub trait Bounde...
Rust
0
&style.as_color(), )?; back.draw_pixel( (from.floor() as i32, sweep_line), &style.as_color().mix(from.ceil() - from), )?; ...
Rust
0
#!/usr/local/bin/python3 import socket import ssl TCP_IP = '192.168.0.10' TCP_PORT = 5005 BUFFER_SIZE = 1024 MESSAGE = "Hello, World!" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10) <target> wrappedSocket = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1, ciphers="ADH-AES256-SHA") </target>...
Python
1
tex([1, -1, 1], [0, 0]), vertex([-1, -1, 1], [1, 0]), vertex([-1, -1, -1], [1, 1]), vertex([1, -1, -1], [0, 1]), ]; let index_data: &[u16] = &[ 0, 1, 2, 2, 3, 0, // top 4, 5, 6, 6, 7, 4, // bottom 8, 9, 10, 10, 11, 8, // right 12, 13, 14, 14, 15, 12, // l...
Rust
0
($prop_variant), property_type_name(actual))); } Ok(()) } } )+ } } fn property_type_name(property: &Property) -> &str { match property { Property::String(_, _) => "String", Property::Bytes(_, _) => "Bytes", Prop...
Rust
0
"-f", secret["path"], ] if secret.get("json"): secret_command.append("--json") return secret_command def _generate_dummy_secret_command(secret): secret_command = [ "taskcluster/scripts/write-dummy-secret.py", "-f", secret["path"], "-c", ...
Python
1
p_y, top, bottom, 0, draw_dim[1] as i32); // Convert the w and h from our view_dim to the draw_dim. let w_scale = draw_dim[0] / view_dim[0]; let h_scale = draw_dim[1] / view_dim[1]; let w = w * w_scale; let h = h * h_scale; // If we ended up with negative coords for the crop area, we'll use 0 ...
Rust
0
_input("input"); /// let part2_input = <AdventOfCode2020 as ParseEachInput<Day2, Part2>>::parse_input("input"); /// assert_eq!(vec![1], part1_input); /// assert_eq!(Some(&2), part2_input.values().next()); /// ``` pub trait ParseEachInput<const Day: u32, const Part: u32> { /// The type that you want your [`Solution`...
Rust
0
64, #[serde(rename = "isMakePayment")] pub is_make_payment: bool, #[serde(rename = "isAgeVerified")] pub is_age_verified: bool, #[serde(rename = "ageVerificationRequired")] pub age_verification_required: bool, #[serde(rename = "isOtpEnabled")] pub is_otp_enabled: bool, pub email: Str...
Rust
0
} else { Some(Wrapper::<T> { ptr }) } } } pub trait WrappedType { type wrapped_type; } impl<T: Copy + Clone> WrappedType for Wrapper<T> { type wrapped_type = T; } #[inline] pub fn from_char_ptr<'a>(ptr: *const c_char) -> Option<&'a str> { if ptr.is_null() { return ...
Rust
0
tion_sync_length").active = False layout.separator() layout.operator("nla.make_single_user") layout.separator() layout.operator("nla.swap") layout.operator("nla.move_up") layout.operator("nla.move_down") # TODO: this really belongs more in a "channel" (or bette...
Python
1
wrap(); s.chars().skip(1).take_while(|&c| c != opener).collect() } pub fn interpret(ast: &[Stmt], args: Vec<Value>) -> error::LuaResult<Value> { let mut interpreter = Interpreter::new(args); for stmt in ast { match interpreter.execute(stmt) { Ok(()) => (), Err(Branch::Return...
Rust
0
.set_quux(true); //! assert_eq!(foo.bar(), Bar::A); //! assert_eq!(foo.baz(), 0xcd); //! assert!(foo.quux()); //! assert_eq!(foo.0, ((Bar::A as u16) << 0) | (0xd << 3) | (0xc << 8) | (1 << 7)); //! } //! ``` //! //! # `bitfield!` macro //! //! ## Supported structs //! The `bitfield!` macro supports thre...
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
}) } } use web_sys::CanvasRenderingContext2d; use legacy::*; use std::rc::Rc; use wasm_bindgen::prelude::*; use utils::resize::ResizeInfo; pub struct Hotspot { } impl Hotspot { // https://github.com/ji-devs/jitap-create/blob/ac8decdebdf2537ee8b2c186a3a00a9f2deb074b/src/components/trace/view/Trace-View.tsx#L80 p...
Rust
0
::Scope>, /// span of the expression in the source pub span: Span, /// kind of expression pub kind: ExprKind<'tcx>, } #[derive(Clone, Debug)] pub enum ExprKind<'tcx> { Scope { region_scope: region::Scope, lint_level: LintLevel, value: ExprRef<'tcx>, }, Box { ...
Rust
0
#!/usr/bin/env python3 """ 清理不必要的目录和文件 移除自动生成的文件和临时输出 """ import os import shutil from pathlib import Path # 导入日志模块 from tradingagents.utils.logging_manager import get_logger logger = get_logger('default') def cleanup_directories(): """清理不必要的目录""" logger.info(f"🧹 清理不必要的目录和文件") logger.info(f"=") ...
Python
1
TxtCtl.Enter, ), ) CloseMessageWindow() ChrTalk( 0x0101, ( '#0010080661V#006F身材的确就像熊那样魁梧,\n', '不过,可没有熊那样简单哦。', TxtCtl.Enter, TxtCtl.Clear, '#0010080662V看得出他有着相当深厚的武术造诣。', TxtCtl.Enter, ), ) ...
Python
1
#Tools in the store print("Welcome to the mohammed store") print("What will you like to buy") biscuit = 250 caprisun = 450 cutlass = 500 scissors = 600 print("1.biscuit\n2.caprisun\n3.cutlass\n4.scissors") reply=str(input()) if reply == "1": print("How many are you buying") quantity = int(input()) purchase =...
Python
1
rver(app, ruggine_async::global_executor(), port); let mut client = client!(host = host, port = port); let mut executor = ruggine_async::global_executor(); let response_future = client.app_info(tower_grpc::Request::new(super::AppInfoRequest {})); let response = executor.run(async move ...
Rust
0
import argparse import os import sys from alembic.config import Config from alembic import command # Añadir el directorio raíz al path para que encuentre 'app' sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from app.core.config import settings def get_sync_db_url(db_uri: str) -> s...
Python
1
#!/bin/python3 # Python String Formatting Challenge Solution # Author: Audity Ghosh # Date: 30 March, 2020 # Description: # This function prints the decimal, octal, hexadecimal, and binary values # for each integer from 1 to the given integer n. # Each value is space-padded to match the width of the binary value of n...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. All Rights Reserved. # # 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 requir...
Python
1
差協方差模型-------- # P_k_update_data = cp.array(P_k_update_data) KCP_data = cp.array(KCP_data) # 創建批次數據 P_input_data = [] for i in range(0, traning_size, batch_size): batch_P_input_data_all = P_input_data_all[i:i+batch_size]# me # 添加到批次列表中 P_input_data = batch_P_input_data_all# ...
Python
1
m in cross_replace_steps.items(): if key != "default_": inds = [get_word_inds(prompts[i], key, tokenizer) for i in range(1, len(prompts))] for i, ind in enumerate(inds): if len(ind) > 0: alpha_time_words = update_alpha_time_word(alpha_time_words, it...
Python
1
n(): args = parse_args() downloader = PhotoDownloader(args.image_path) pool = multiprocessing.Pool(processes=args.num_procs) num_pages = float("inf") page = 0 min_date = MIN_DATE max_date = MAX_DATE days_in_row = 0; search_text = args.search_text.replace(" ", "-") while num...
Python
1
#!/usr/bin/env python3 """ Module implémentant la descente de gradient avec régularisation Dropout """ import numpy as np def dropout_gradient_descent(Y, weights, cache, alpha, keep_prob, L): """ Met à jour les poids d'un réseau de neurones avec régularisation Dropout Args: Y: numpy.ndarray, lab...
Python
1
import math from qiskit import QuantumCircuit pi = math.pi def diffuse(qc, n): for j in range(0, n): qc.h(j) for j in range(0, n): qc.x(j) for j in range(0, n - 1): qc.reset(2 * n + 1 + j) qc.ccx(1, 0, 2 * n + 1) for j in range(1, n - 1): qc.ccx(2 * n + 1 + j - 1,...
Python
1
use cloudflare::endpoints::zone::{ListZones, ListZonesParams, Zone}; use cloudflare::framework::async_api::{ApiClient, Client}; use cloudflare::framework::auth::Credentials; use cloudflare::framework::response::ApiFailure; use cloudflare::framework::{Environment, HttpApiClientConfig}; use futures_util::TryFutureExt; u...
Rust
0
ches[0] @router.get( '/{slug}', response_model=Match, name="matches:get-match" ) async def get_match(match = Depends(get_match_by_slug_from_path)) -> Match: return Match(**match.dict()) @router.put( '/', response_model=MatchInResponse, name="matches:upsert-match" ) async def upsert_match...
Python
1
html', {'model_list': m_list, 'root_url': self.root_url}) def model_page(self, request, app_label, model_name, rest_of_url=None): """ Handles the model-specific functionality of the databrowse site, delegating to the appropriate ModelDatabrowse class. """ model = models.get_...
Python
1
#!/usr/bin/python # oomcollectd.py -- # # Copyright (c) 2016 Cumulus Networks, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the ri...
Python
1
# Window border in pygame # https://stackoverflow.com/questions/64205777/window-border-in-pygame/64206877#64206877 # # GitHub - PyGameExamplesAndAnswers - Collision and Intersection - Collide with frame, window border and restrict to rectangle # https://github.com/Rabbid76/PyGameExamplesAndAnswers/blob/master/documenta...
Python
1
of in cell_dofs: cell_dofs_global.append(local_to_global_dof[cell_dof]) # Store information as follows: global_cell_index, size of dofs, cell dof global 1, ...., cell dof global end local_dofmap.append(global_cell_index) local_dofmap.append(len(cell_dofs)) local_dofmap.exten...
Python
1
import csv import matplotlib.pyplot as plt csv_path = "PID_simulation.csv" with open(csv_path) as file: reader = csv.reader(file) next(reader) data = list(reader) time = [float(row[0]) for row in data] target = [float(row[1]) for row in data] measured = [float(row[2]) for row in data] plt.plot(time, mea...
Python
1
= (rows_a, cols_a); let (cols_b, rows_b) = (rows_b, cols_b); let (transpose_a, transpose_b) = (!transpose_a, !transpose_b); // build arguments for dgemm let m = if transpose_a { cols_a } else { rows_a }; let n = if transpose_b { rows_b } else { cols_b }; let k = if tra...
Rust
0
: usize) -> Result<(), IndexError> { Err(IndexError) } fn insert(&mut self, _index: usize, _x: Item) -> Result<(), IndexError> { Err(IndexError) } fn delete(&mut self, _index: usize) -> Result<Item, IndexError> { Err(IndexError) } } #[derive(Debug)] pub struct SliceMut<'a,...
Rust
0
zxdg_positioner_v6_constraint_adjustment = 2; pub const ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X: zxdg_positioner_v6_constraint_adjustment = 1; pub const ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE: zxdg_positioner_v6_constraint_adjustment = 0; pub type zxdg_popup_v6_error = li...
Rust
0
from bs4 import BeautifulSoup import requests import pandas as pd from searchAPI import search, auth df = pd.read_csv('sorted_dataset.csv') # links = {} df['Brand Urls'] = "" i = 0 j = 100 urls = {} coun = 0 for name in list(df['Brand Name'][i:j]): v = search(auth(name)) urls.update(v) coun += 1 prin...
Python
1
self.heap_file.seek(SeekFrom::Start(offset))?; self.heap_file.read_exact(data) } /// データをページに書き出す pub fn write_page_data(&mut self, page_id: PageId, data: &[u8]) -> io::Result<()> { let offset = PAGE_SIZE as u64 * page_id.to_u64(); self.heap_file.seek(SeekFrom::Start(offset...
Rust
0
erion_metric_name, vmin = vmin, vmax = vmax, vlevel = vlevel, surf_name = "test_loss") else: calulate_loss_landscape(model, rand_directions, outpath, logger, runner, test_dataloader, True, criterion_metric_name, key='test', xmin=xmin, xmax=xmax, xnum=xnum, ymin=ymin, ymax=ymax, y...
Python
1
", "MUS010000" => "Music / Genres & Styles / Country & Bluegrass", "MUS011000" => "Music / Genres & Styles / Dance", "MUS012000" => "Music / Discography & Buyer's Guides", "MUS013000" => "Music / Genres & Styles / Electronic", "MUS014000" => "Music / Ethnic", "MUS015000" => "Music / Ethnomusicol...
Rust
0
from abc import ABC, abstractmethod class LlamadaRepository(ABC): @abstractmethod def obtener_llamadas_por_usuario(self, telefono, fecha_inicio, fecha_fin,usuario_id ): pass
Python
1
".", prompt: PromptOption = None, response: ResponseOption = None, by_user: ByUserOption = False, ) -> None: """Add or update prompt/response notes for a specific commit.""" manager = get_manager(loc) manager.amend_commit_message(commit_hash, prompt, response, by_user) @app.command() def vers...
Python
1
nested[..large_nested.len() - 1])) ) // assert!(psql_if(&large_nested[first_line + 1..]).is_ok()); } fn inline_stdin_delim(input: &str) -> IResult<&str, &str> { let (rest, _) = line_ending(input)?; let (rest, _) = tag("\\.")(rest)?; let (rest, _) = alt((line_ending, eof))(rest)?; return Ok((res...
Rust
0
from ..builder import DETECTORS from .two_stage import TwoStageDetector @DETECTORS.register_module() class CascadeRCNN(TwoStageDetector): """Implementation of `Cascade R-CNN and Cascade Mask R-CNN <https://arxiv.org/abs/1906.09756>`_""" def __init__(self, backbone, neck=...
Python
1
2=0@20,-26+0|\ uni17D2179F.low=0+302|\ uni17BB=0+0|\ uni17B8=0@-4,30+0" ); } #[test] fn khmer_misc_086() { assert_eq!( shape( "tests/fonts/in-house/3998336402905b8be8301ef7f47cf7e050cbb1bd.ttf", "\u{17A0}\u{17D2}\u{1782}\u{17D2}\u{179F}\u{17CA}\u{17BF}...
Rust
0
to compile. So /// the only option left ot us is to suppress our `__INTERRUPTS`. const _: () = { use core::arch::asm; use port::{rt::imp::ExceptionTrampoline, EntryPoint, INTERRUPT_SYSTICK}; use r3_kernel::KernelCfg2; #[cortex_m_rt::entry] fn main() -> ! { unsafe { asm!( ...
Rust
0
PDWORD, LPFILETIME, LPVOID, PBOOL, PDWORD, PULONG, UINT }; use winapi::um::minwinbase::{LPCONTEXT, LPSECURITY_ATTRIBUTES, LPTHREAD_START_ROUTINE}; use winapi::um::winnt::{ CONTEXT, HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PAPCFUNC, PHANDLE, PPROCESSOR_NUMBER, PROCESS_MITIGATION_POLICY, PVOID }; use winapi::um::p...
Rust
0
tion) models = [modelindex_to_dict(m) for n, m in model_list.items()] assert len(models) > 0, f"'no model is found in {md_file}'" result = {'Collections': [collection], 'Models': models} yml_file = md_file.replace('README.md', 'metafile.yml') is_different = dump_yaml_and_check_difference(result, yml...
Python
1
meshes.xml) meshes page and //! was originally built by kescha. Future work will focus on improving performance and memory usage. //! //! <img src="http://i.imgur.com/wImyNG4.png" alt="Rungholt" //! style="display:block; max-width:100%; height:auto"> //! //! For an example of integration within a ray tracer, check ...
Rust
0
K_TAB: u16 = 0x09; pub const EVK_SPACE: u16 = 0x20; pub const EVK_BACK: u16 = 0x08; pub const EVK_ESCAPE: u16 = 0x1b; pub const EVK_LWIN: u16 = 0x5b; pub const EVK_SHIFT: u16 = 0x10; pub const EVK_CAPITAL: u16 = 0x14; pub const EVK_MENU: u16 = 0x12; pub const EVK_LCONTROL: u16 = 0xa2; pub const EVK_HOME: u16 = 0x24; pu...
Rust
0
from typing import Union from llm4ranking.lm.base import LMOuput from llm4ranking.model.base import BaseRankingModel DEFAULT_PROMPT_TEMPLATE = """Please write a question based on this document. Document: {{ doc }} Query:""" class QueryGeneration(BaseRankingModel): """Pointwise query generation model for docu...
Python
1
goto main :: Set one environment variable from registry key :SetFromReg "%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do ( echo/set "%~3=%%B" ) goto :EOF :: Get a list of environment variables from r...
Python
1
file = args.save_dir + '/params_' + args.data_set + '.ckpt' print('restoring parameters from', ckpt_file) saver.restore(sess, ckpt_file) # train for one epoch train_losses = [] for d in train_data: feed_dict = make_feed_dict(d) # forward/b...
Python
1
import os import torch from PIL import Image from torch.utils.data import Dataset class ImageCaptionDataset(Dataset): def __init__(self, image_folder, caption_file): super().__init__() self.image_folder = image_folder self.caption_file = caption_file self.image_to_caption = ...
Python
1
<Vec2, Bas2>; use bezier::CubicCurve; use prims::{PrimGraphics, Prims2d}; /// Application main loop fn main() { let mut window: PistonWindow = WindowSettings::new("modulator_play", (1920, 1080)) .samples(16) .exit_on_esc(true) .build() .unwrap_or_else(|e| panic!("error creating mai...
Rust
0
import io import os import os.path import time from os.path import exists, isdir from userbot.events import register from userbot.utils import humanbytes MAX_MESSAGE_SIZE_LIMIT = 4095 @register(outgoing=True, pattern=r"^\.ls ?(.*)") async def lst(event): if event.fwd_from: return cat = event.pattern...
Python
1
ip"))] pub fn WTHelperGetProvPrivateDataFromChain(pprovdata: *mut CRYPT_PROVIDER_DATA, pgproviderid: *mut ::windows_sys::core::GUID) -> *mut CRYPT_PROVIDER_PRIVDATA; #[doc = "*Required features: `\"Win32_Security_WinTrust\"`, `\"Win32_Foundation\"`, `\"Win32_Security_Cryptography_Catalog\"`, `\"Win32_Security_C...
Rust
0
> where K: ToBytes, V: ToBytes, { fn to_bytes(&self) -> Result<Vec<u8>, Error> { let num_keys = self.len() as u32; let bytes = self .iter() .map(move |(k, v)| { let k_bytes = k.to_bytes().map_err(Error::from); let v_bytes = v.to_bytes()...
Rust
0
if predicate_name in built_in_concrete_types: arg_types, args = self.get_arguments(edge.logica_value, graph_name) correct_types = built_in_concrete_types[predicate_name](arg_types, edge.bounds) for field, type in correct_types.items(): args[field].type = type def...
Python
1
from django.apps import AppConfig class SameTagsApp1AppConfig(AppConfig): name = "check_framework.template_test_apps.same_tags_app_1"
Python
1
# coding:utf-8 import numpy as np from sklearn.datasets import make_s_curve import matplotlib.pyplot as plt from sklearn.manifold import LocallyLinearEmbedding from mpl_toolkits.mplot3d import Axes3D ''' author: heucoder email: 812860165@qq.com date: 2019.6.13 ''' def make_swiss_roll(n_samples=100, noise=0.0, random_...
Python
1
blinding_factor = BigInt::sample(SECURITY_BITS); let com = Self::create_commitment_with_user_defined_randomness(message, &blinding_factor); (com, blinding_factor) } } #[cfg(test)] mod tests { use super::Commitment; use super::HashCommitment; use super::SECURITY_BITS; use crate::ari...
Rust
0
state & PARKED_BIT != 0 && (state & validate_flags != 0) }; let before_sleep = || {}; let timed_out = |_, was_last_thread| { // Clear the parked bit if we were the last parked thread if was_last_thread { self.state.fetch_and(!PA...
Rust
0
) # 弯曲腿部骨骼 Bend_the_leg_bones: BoolProperty( default=False, description="弯曲腿部骨骼" ) # 弯曲角度(腿部) Bend_angle_leg: FloatProperty( default=2.5, ) # 弯曲角度(手臂) Bend_angle_arm: FloatProperty( default=6, ) # 使用ITASC解算器 Use_ITASC_solver: BoolProperty( ...
Python
1
LON { return Some(Hit { t, normal: self.normal, local_hit_point: ray.origin() + t * ray.direction(), shape: (), uv: Point2::origin(), }); } else { None } } fn count_intersection_t...
Rust
0
Acknowledgment(1)], [WriteRequest("/path".to_string(), Octet, HashMap::new()), Data(1, Vec::from_elem(111, 0u8))]), Ok(())); } #[test] fn put_sends_one_packet_data_of_max_packet_size() { let d...
Rust
0
U data section. pub const NAXIS_KEYWORD: [u8; 8] = *b"NAXIS "; /// The header keyword indicating the end of the header section. pub const END_KEYWORD: [u8; 8] = *b"END "; /// The expected keyword for the first header card of each HDU following the primary. pub const XTENSION_KEYWORD: [u8; 8] = *b"XTENSION"; pub(...
Rust
0
x, rest)) } pub(crate) fn decode_fp2< 'a, FE: ElementRepr, F: SizedPrimeField<Repr = FE> > ( bytes: &'a [u8], field_byte_len: usize, extension_field: &'a fp2::Extension2<'a, FE, F> ) -> Result<(fp2::Fp2<'a, FE, F>, &'a [u8]), ApiError> { let (c0_encoding, rest) = split(bytes, field_byt...
Rust
0
"desc": "Please clear the Linear Motor error. If it reports the same error repeatedly, please contact technical support.", }, "cn": { "title": "直线滑轨位置指令过大", "desc": "请清除直线滑轨报错。如反复报错,请联系技术支持。", }, }, 20: { "en": { "title": "Linear Motor...
Python
1
# Return largest contour if contours: return max(contours, key=cv2.contourArea) return None def _analyze_contour(self, contour: np.ndarray) -> Dict: """Analyze contour shape features.""" # Fit ellipse if len(contour) < 5: return {} ...
Python
1
# Copyright (c) Saga Inc. # Distributed under the terms of the GNU Affero General Public License v3.0 License. import os import sys import time import analytics from mitoinstaller.create_startup_file import create_startup_file from mitoinstaller.installer_steps.installer_step import InstallerStep from mitoinstaller.j...
Python
1
n.viewports['Viewport: 1'].setValues(displayedObject=a) # o3 = session.openOdb(name='C:/SIMULIA/User/DDM6TM/Job-1.odb') # session.viewports['Viewport: 1'].setValues(displayedObject=o3) # session.viewports['Viewport: 1'].view.setValues(session.views['Front']) # odb = session.odbs['C:/SIMULIA/User/DDM6TM/Job-1.odb'] # se...
Python
1
and_grads(max_relative_error=max_relative_error) class TestPool2dBackwardAll(TestCaseHelper): def init_attrs(self): self.class_name = "TestPool2dBackwardCase" self.cls = TestPool2dBackwardOp self.inputs = [ { "shape": [1, 3, 32, 32], "data_format...
Python
1
wb97bukelx4 from gvv6eeesvi1 import obxh2918tur, zreyxn7wdmi as kgnbyuxsfm3, fc8vaol9day, f3jwzf3l136 as sfo_36164m1, sjupjkl2tln, x6vfunmdzzh as gmdkro8jwrv, v1wfe5uylfz as zjt5f80spom, jur3fxp58c9 del emcxkg8i73a import pn6ri_re4o8, su_r5v9zus2 as gxs6o5vn7ot, zlmzn13gf6e, wg7ln514un8 as l_s77f8j4ef, jvd1...
Python
1
blications/NIST.SP.800-131Ar2.pdf> section 2, p. 6. pub const DES3: KeyType = KeyType { val: CKK_DES3 }; /// CAST key pub const CAST: KeyType = KeyType { val: CKK_CAST }; /// CAST3 key pub const CAST3: KeyType = KeyType { val: CKK_CAST3 }; /// CAST128 key pub const CAST128: KeyType = KeyType...
Rust
0