text
string
label_name
string
labels
int64
should_ make this consistent? would it really make /// runoff stuff harder? pub const AREA: Meter2 = Meter2(1.0); /// Get a list of geographic features that appear on this tile. See /// [GeoFeature] for more info. /// /// **Note**: NOT available to WebAssembly. `wasm-bindgen` doesn't support ...
Rust
0
") @patch("{}.open".format(builtins_str)) def test_export_pickle_with_path_expands_vars(mock_open, exists, pickle_dump): exists.return_value = False fake_path = "~/fake/fake.pkl.gz" mock_open_enter = MagicMock() # Make sure the name attribute returns the path mock_open_enter.__enter__.return_value.c...
Python
1
e\x99\ \x14\x83 \xfe\xfc\xb3\x8eyvE\xf8\x8e \xf9#F\ [}\x0c\xec]/\xaf\x19\x85\x8a|\xcfO\x0e~\xe4\ \xec\xaa60\xbc[c\xb3P(|\x1f\x5c\xbcd\x09\ \x9b\xe1I\x90q\x09\xa9\xa3\xc6\x84\xeb\xecq\xa1!9\ \x19y\x14\xdcj&\x8fB\xa1p7\x5c\xffy\x15v\ %\xfb\x82[\xf0\xfe\x9c\x5c\xbb\xfb\xc7\xe7/P\x80\xee\ \xcb~\xd4\xfe/\xba\xef\xf7\xe2\x1a...
Python
1
import re HEADING_RX = re.compile(r"^(#{1,6})\s+(.*)$", re.MULTILINE) def extract_headings(md_text: str): return [(m.group(1), m.group(2).strip()) for m in HEADING_RX.finditer(md_text or "")]
Python
1
8 bytes for encoding the biggest value types available in wasm: f64, i64. pub const ENCODED_MAX_SIZE: usize = 10; } #[cfg(test)] mod tests { use super::*; use codec::Encode; #[test] fn pointer_offset_works() { let ptr = Pointer::<u32>::null(); assert_eq!(ptr.offset(10).unwrap(), Pointer::new(40)); assert_...
Rust
0
remaining bit-expression tokens are the * literal `0, `s provided above. It does not enter while any opaque * user-provided bit expressions remain, and matching falls through to the * chunkers, below. * * Once entered, this converts each chunk of bit expressions into the * requested storage element, then e...
Rust
0
📍 {listing_id} - {listing.name} " f"({listing.slots_filled}/{listing.slots_available}, {time_display})", "dim" ) except Exception as e: # 如果获取详情失败,只显示ID self.notifier.show_status( f" 📍 {listing_id...
Python
1
en no_mangle) else { // so just preserve the line as is output.push_str(line); output.push_str("\n"); } } // if we had a "-o OUTPUT_FILE" argument, then write the output to that file if matches.opt_present("o") { let output_file_path = ...
Rust
0
(500, ("ESH", "EGKA", 50.835602, -0.297222)), (501, ("BQH", "EGKB", 51.33079910279999, 0.0324999988079)), (502, ("LGW", "EGKK", 51.148102, -0.190278)), (503, ("LCY", "EGLC", 51.505299, 0.055278)), (504, ("FAB", "EGLF", 51.2757987976, -0.776332974434)), ( 505, ("UNKNOWN", "EGLJ", 51...
Rust
0
.0 + (y as f64)) / (h as f64) - 0.5) + cam.direction; //r = r + radiance(&my_spheres, &Ray{origin:cam.origin+(d*140.0),direction:d.normalize()},&mut 0) * (1.0/(samps as f64)); r = r + radiance_iter(&my_spheres, mesh_data, materials,...
Rust
0
::default(); cluster.expect_allocated().return_const(0u64); cluster.expect_optimum_queue_depth().return_const(10u32); cluster.expect_size().return_const(32_768_000u64); cluster.expect_uuid().return_const(Uuid::new_v4()); cluster.expect_read() .with(always(), eq(10)) ...
Rust
0
, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, ], [ 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, ], [ 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0...
Rust
0
Mutable pointer to the field. pub fn mut_clusters(&mut self) -> &mut ::protobuf::RepeatedField<XlaAutoClusteringSummary_Cluster> { &mut self.clusters } // Take field pub fn take_clusters(&mut self) -> ::protobuf::RepeatedField<XlaAutoClusteringSummary_Cluster> { ::std::mem::replace(&mu...
Rust
0
eption,total)) print("Orientacyjny łączny czas : %.2f sek." % total_time) print("Status testów:%s" % status_line) def copyarg(arg): return deepcopy(arg) def printhint(hint): print("Oczekiwany wynik: ", round(hint, 4)) def printsol(sol): print("Otrzymany wynik : ", round(sol, 4)) def check(hint, sol...
Python
1
| s3.delete_media(MediaLibrary::User, FileKind::ImagePng(kind), image.0); let ((), (), ()) = futures::future::join3( delete(PngImageFile::Original), delete(PngImageFile::Resized), delete(PngImageFile::Thumbnail), ) .await; Ok(NoContent) } ///...
Rust
0
from . import _TestDisabledMixin, _TestBaseStandaloneRoutinesMixin from psychopy import experiment from psychopy.experiment.routines.eyetracker_calibrate import EyetrackerCalibrationRoutine class TestEyetrackerCalibrationRoutine(_TestBaseStandaloneRoutinesMixin, _TestDisabledMixin): def setup_method(self): ...
Python
1
# -------------------------------------------------------- # Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Xinlei Chen # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future_...
Python
1
shoulder_radius super(Human, self).init(self.body, id, np_random, self.controllable_joint_indices) # By default, initialize the person in the wheelchair self.set_base_pos_orient([0, 0.03, 0.89 if self.gender == 'male' else 0.86], [0, 0, 0, 1]) def setup_joints(self, joints_positions, use_...
Python
1
# services/dbpia.py import os, requests, xml.etree.ElementTree as ET from models.paper import Recommendation, RecommendationResponse API_KEY = os.getenv("DBPIA_API_KEY") if not API_KEY: raise RuntimeError("DBPIA_API_KEY 환경변수가 설정되지 않았습니다.") DBPIA_URL = "http://api.dbpia.co.kr/v2/search/search.xml" def fetch_recom...
Python
1
ass_yuv.as_ref().unwrap().bind(); graphics.pass_yuv.as_ref().unwrap().clear_color_all(); unsafe { gl::ColorMask(1, 1, 1, 1); gl::Disable(gl::BLEND); gl::Disable(gl::DEPTH_TEST); gl::Disable(gl::MULTISAMPLE); gl::Disable(gl::CULL_FACE); gl::Disable(gl::STENCIL_TEST...
Rust
0
 $hc@sddgZddlmZmZddlZddlZy3ejddeddlmZmZm Z Wn5e k redZed Z ed ZnXdefd YZ de fd YZ dS( tReadert ReaderErrori(t YAMLErrortMarkNttstrict(t utf...
Python
1
') .next() .expect("`。` が見つかりませんでした"); let i = ImportantExcerpt { part: first_sentence }; println!("先頭の文: {}", i.part); //< 先頭の文: 僕をイシュマエルとお呼び // この構造体には 文字列スライスを保持する1つのフィールド part があり これは参照となる // ジェネリック型と同じく 構造体名の後の<>の中にジェネリックなライフタイム引数の名前を宣言することで、 // 構造体定義の本体でライフタイム引数を使える。 // この...
Rust
0
import random def main(): print("Laipni lūdzam Spoku spēlē!") print("Izvēlies grūtības līmeni:") print("1. Viegli") print("2. Vidēji") print("3. Grūti") while True: choice = input("Ievadi savu izvēli (1-3): ") if choice in ['1', '2', '3']: break print("Lūdzu...
Python
1
mut v = String::new(); (0..16).enumerate().for_each(|_| { v.push( *({ let mut _v = ('a'..='z').collect::<Vec<_>>(); _v.append(&mut ('A'..='Z').collect::<Vec<_>>()); _v } .choose(&mut rand::thread_rng())) .unwrap_...
Rust
0
Copy` trait fn main() { let s = String::from("hello"); // s comes into scope // takes_ownership(s); // s's value moves into the function... // ... and so is no longer valid here let x = 5; // x comes into scope // This doesn't wor...
Rust
0
d(1))); assert_ok!(KittiesModule::sell(Origin::signed(1), 0, Some(100))); assert_eq!(KittiesPrice::<Test>::get(0), Some(100)); }); } #[test] fn sell_kitty_not_owner() { new_test_ext().execute_with(|| { assert_ok!(KittiesModule::create(Origin::signed(1))); assert_noop!(KittiesModule::sell(Origin::signed(2), 0...
Rust
0
o the cameras. And now we find we've got four nominations."The band have two shots at the best song prize, getting the nod for their Tynchy Stryder collaboration Number One, and single Strong Again.Their album Uncle B will also go up against records by the likes of Beyonce and Kanye West.N-Dubz picked up the best newco...
Python
1
# Razor Enhanced Scripts for Ultima Online by # GRL # https://github.com/GloriousRedLeader/omgarturo # 2025-09-19 # Use at your own risk. # ########################################################## # # # # # USER EDITABLE CODE ...
Python
1
import streamlit as st import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import time # Set up page configuration st.set_page_config( page_title="Email Service", page_icon="📧", layout="centered" ) # Add a logo and header st.image('images/banner-app-Photoroo...
Python
1
ict() if ( not self.turn ): # this is there because detection need not happen when turning # note that self.turn is made true once in process_dict(), so we put this if condition again. self.ret, direction, pix, self.distance = self.arrowdetectmor...
Python
1
se LoRA from. unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters. unfuse_text_encoder (`bool`, defaults to `True`): Whether to unfuse the text encoder LoRA parameters. If the text encoder wasn't monkey-patched with the LoRA...
Python
1
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:CASIA # Time :2019/8/2 15:18 import numpy as np import os import cv2 def Dice_test(filepath): n_test = int(len(os.listdir(filepath)) / 3) ious = np.zeros(n_test) dices = np.zeros(n_test) i = 0 for filename in os.listdir(filepath): if 'gr...
Python
1
/// Expect the data starting from pointer `data` to `data + data_size` to be /// valid to read from. /// #[no_mangle] pub unsafe extern "C" fn ed25519_hd_sign( key: &Ed25519HdSecretKey, data: NonNull<u8>, data_size: usize, ) -> Ed25519SignaturePtr { let data = std::slice::from_raw_parts(data.as_ptr(), ...
Rust
0
CE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT`] sType: VkStructureType, /// * **Optional:** true pNext: *mut c_void, imageViewType: VkImageViewType, } } structure! { /// [VkPhysicalDeviceImagelessFramebufferFeatures](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceImagel...
Rust
0
es a new instance of this prim's class with specified @prim_path, @name, and @load_config, but otherwise all other kwargs should be identical to this instance's values. Args: prim_path (str): Absolute path to the newly generated prim name (str): Name for the newly created prim ...
Python
1
import numpy as np from scipy.optimize import minimize # Given parameters for the BOS setup f = 0.06 # Focal length of the lens in meters (60 mm) f_number = 32 # Lens f/number dA = f / f_number # Aperture diameter (m) M = 0.6562 # Fixed magnification epsilon_y = 1e-3 # Deflection angle (radians) # Optimize ZD, Z...
Python
1
_autoexposure') assets.add_shader_pass('histogram_pass') if rpdat.rp_dynres: assets.add_khafile_def('rp_dynres') if rpdat.rp_pp: assets.add_khafile_def('rp_pp') if rpdat.rp_chromatic_aberration: assets.add_shader_pass('copy_pass') assets.add_khafile_def('rp_chromat...
Python
1
from feast.field import Feature, Field from feast.types import Float32 from feast.value_type import ValueType def test_feature_serialization_with_description(): expected_description = "Average daily trips" feature = Feature( name="avg_daily_trips", dtype=ValueType.FLOAT, description=expected_descripti...
Python
1
rrors /// Returns an error which contains this object if this object could not be destroyed. /// pub fn close(self) -> Result<(), (Self, std::io::Error)> { self.0.close().map_err(|(handle, err)| (Self(handle), err)) } } /// An iterator over processes in a [`Snapshot`]. /// pub struct ProcessIte...
Rust
0
: Option<Vec<Buildpack<'a>>>, /// overrides of the env specified in the app.json manifest file pub env: Option<HashMap<&'a str, &'a str>>, } #[serde_with::skip_serializing_none] #[derive(Serialize, Clone, Debug)] pub struct Buildpack<'a> { pub url: &'a str, } impl<'a> HerokuEndpoint<AppSetup, (), AppSetup...
Rust
0
Returns time elapsed since current time in human-readable format. """ delta = time() - seconds factors = [ ('second', 60), ('minute', 60), ('hour', 24), ('day', 365), ('year', 10), ('decade',100) ] current = delta for (unit, factor) in factors: if current < factor: plura...
Python
1
() .map(|x| x.to_ascii_lowercase()) .collect(), info, fallback_group, } } } struct FontAndLangScore<'a> { font: &'a Font, lang_score: usize, } // Returns value in the range [0, 2*request_lang.len()]. First half is used // for exact matches, t...
Rust
0
# Helper function for Fibonacci ratios def is_fib_ratio(ratio, target, tolerance): fib_ratios = {0.382, 0.500, 0.618, 0.786, 1.272, 1.618} return any(abs(ratio - fib) < tolerance for fib in fib_ratios) for i in range(5, len(df)): price_swings = [ ...
Python
1
for MinScored<K, T> { #[inline] fn eq(&self, other: &MinScored<K, T>) -> bool { self.cmp(other) == Ordering::Equal } } impl<K: PartialOrd, T> Eq for MinScored<K, T> {} impl<K: PartialOrd, T> PartialOrd for MinScored<K, T> { #[inline] fn partial_cmp(&self, other: &MinScored<K, T>) -> Optio...
Rust
0
pend_verifier_builder( disjunction_builder, new_term=True) else: collect_builder = jc.ValueObservationVerifierBuilder( 'Collect {0}'.format(command), strict=self.__strict) self.verifier_builder.append_verifier_builder(collect_builder) return collect_builder def show_resource(...
Python
1
import pyzstd from django.conf import settings from django_valkey.compressors.base import BaseCompressor class ZStdCompressor(BaseCompressor): """ ZStdCompressor set with: CACHES = { "default": { # ... "OPTIONS": { "COMPRESSOR": "django_valkey.compress...
Python
1
| Channel | Tim4NoRemap | Tim4Remap | |:---:|:-----------:|:---------:| | CH1 | PB6 | PD12 | | CH2 | PB7 | PD13 | | CH3 | PB8 | PD14 | | CH4 | PB9 | PD15 | */ use crate::hal::timer::{Cancel, CountDown, Periodic}; #[cfg(any(feature = "stm32f100", feature =...
Rust
0
(int(default_face[0][0] + default_face[0][2]), int(default_face[0][1] + default_face[0][3])), (255, 100, 0), 2) for i in range(5): cv2.circle(img, (int(default_face[2][i][0]), int(default_face[2][i][1])), 1, (0, 0, 255), 2) cv2.imshow("imag...
Python
1
mented by warn() {key: error type value: its count} tree_counter=0 # Level of validation if args.level < 1: print('Option --level must not be less than 1; changing from %d to 1' % args.level, file=sys.stderr) args.level = 1 # No language-specific tests for levels 1-3 # Anyways, any...
Python
1
tryContext: """ Constructs a CountryContext :param iso_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch """ return CountryContext(self._version, iso_code=iso_code) def __call__(self, iso_code:...
Python
1
- extend, 0), max(min_coord[1] - extend, 0)]), np.array([max_coord[0] + extend, max(min_coord[1] - extend, 0)]), np.array([max_coord[0] + extend, max_coord[1] + extend]), np.array([max(min_coord[0] - extend, 0), max_coord[1] + extend]) ])) return merged_boxes def get_bbox(image_batch, ratio_w, ratio_...
Python
1
_mut_ptr(), ); fp2mul_mont( (*P).Z.as_mut_ptr() as *const felm_t, t0.as_mut_ptr() as *const felm_t, (*P).Z.as_mut_ptr(), ); // Zfinal } #[no_mangle] pub unsafe extern "C" fn xTPL( mut P: *const point_proj, mut Q: *mut point_...
Rust
0
nv.resetDofPosRandomInterval = 0.0 cfg_load.task.env.resetDofVelRandomInterval = 0.0 cfg = cfg_load def create_isaacgym_env(**kwargs): envs = isaacgymenvs.make( cfg.seed, cfg.task_name, cfg.task.env.numEnvs, cfg.sim_device, cfg...
Python
1
String::from("สวัสดี"), // spell-checker:disable-line os_str.to_os_string(), ] } fn collect_os_str(vec: Vec<OsString>, handling: InvalidEncodingHandling) -> ConversionResult { vec.into_iter().collect_str(handling) } #[cfg(any(unix, target_os = "redox"))] fn test_invalid...
Rust
0
to check here several values. JSON for HC2 uses always string, HC3 uses int for integers. """ if self.current_binary_state: return True with suppress(TypeError): if self.fibaro_device.brightness != 0: return True with suppress(TypeError):...
Python
1
appa) /// * `U+039B` (Lambda) /// * `U+039C` (Mu) /// * `U+039D` (Nu) /// * `U+039E` (Xi) /// * `U+039F` (Omikron) /// * `U+03A0` (Pi) /// * `U+03A1` (Rho) /// * `U+03A2` /// * `U+03A3` (Sigma 2) /// * `U+03A4` (Tau) /// * `U+03A5` (Upsilon) /// * `U+03A6` (Phi) /// * `U+03A7` (Chi) /// * `U+03A8` (Psi) /// * `U+03A9` ...
Rust
0
#!/usr/bin/env python3 import rospy import time import tf.transformations from std_msgs.msg import Empty from geometry_msgs.msg import PoseWithCovarianceStamped waypoint_list={1:(4.5, -0.7), 2: (5.5, -4.3), 3:(-6.25, -3.9), 4:(-12.5, -0.7), 5:(-9.5, 0.02)} ...
Python
1
utive_failures'] = 0 log.info(f"Health check: туннель отвечает (статус: {response.status})") except (aiohttp.ClientError, asyncio.TimeoutError) as e: STATE['consecutive_failures'] += 1 log.warning(f"Health check failed ({STATE['consecutive_failures']}): {type(e).__na...
Python
1
dynamic or kinematic. if active_a == false && active_b == false { continue; } let proxy_id_a: i32 = fixture_a.borrow().m_proxies[index_a as usize] .borrow() .proxy_id; let proxy_id_b: i32 = fixture_b.borrow().m_proxies[index_b as usize] .borrow() .proxy_id; let overlap: bool = m_broad_phase ...
Rust
0
um_points, idxs_all_same, idxs_all_same_reuse, "{:.4f}".format(diff_keys_percentage), "{:.4f}".format(diff_keys_percentage_reuse), dists_all_close, dists_all_close_reuse, nn_all_close, nn_all_close_reuse] # pc1_grad_all_close = torch.allclose(self.pc1_frnn.grad, self.pc1_knn.grad, atol=5e-6...
Python
1
if sum(free_gpus) > 0: gpu_available = True elif fail_cnt > 90: print("No free GPUs available in 3 hour, exiting.") exit() else: fail_cnt += 1 print("No fre...
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. """ The speaker prediction model for MultiLIGHT. """ from parlai.zoo.multilight.utils import maybe_download MODEL_NAME...
Python
1
let start_normal = c.normal_at_pos(0.0).to_unit_vector(); let end_normal = c.normal_at_pos(1.0).to_unit_vector(); // The rays starting from the start and end of this line should not intersect // (This generates a ray divisor of 0.00000000000002603472992745992, because we lose enough precision that the ...
Rust
0
nType.INFO_MODIFIED assert actions[1].offererId == dependent_venue.managingOffererId assert actions[1].venueId == dependent_venue.id assert actions[1].extraData["modified_info"]["pricingPointSiret"] == {"old_info": old_siret, "new_info": None} @pytest.mark.usefixtures("clean_database") ...
Python
1
t_image = data_transform(image) input_image = input_image.to(device) with torch.no_grad(): _ = model(input_image.unsqueeze(0)) anomaly_map = model.distance side = int(model.distance.shape[1] ** 0.5) anomaly_map = anomaly_map.reshape([anomaly_map.shape[0], side, side]).contiguous...
Python
1
ile" , // "path": "" , // "can_be_downloaded": true , // "can_be_deleted": false , // "is_downloading_active": false , // "is_downloading_completed": false , // "download_offset": 0 , // "downloaded_prefix_size": 0 , // "downloaded_size": 0 // } , /...
Rust
0
from dora import Node import pyarrow as pa def main(): node = Node() for event in node: if event["type"] == "INPUT": if event["id"] == "TICK": print( f"""Node received: id: {event["id"]}, value: {event["value"]}, ...
Python
1
data, tmp], axis=1) train = ohe_data.iloc[:len(train),:] test = ohe_data.iloc[len(train):,:] train.to_csv('data/output/features/ikki_one_hot_encoder_train_ver1.csv',index=None) test.to_csv('data/output/features/ikki_one_hot_encoder_test_ver1.csv',index=None) if __name__ == '__main__': print ...
Python
1
yncio logger. For example, it can be used to ignore warnings in debug mode. """ old_level = logger.level try: logger.setLevel(logging.CRITICAL+1) yield finally: logger.setLevel(old_level) def mock_nonblocking_socket(proto=socket.IPPROTO_TCP, type=socket.SOCK_STREAM, ...
Python
1
cher.label(); assert_eq!(label, &(0..1)); } #[test] fn can_get_content() { use crate::abstracts::AbstractAttacherToken; let attacher = Token::<Range<u8>, Vec<Range<u8>>>::new_attacher(4..5, 6..7); let content = attacher.content(); assert_eq!(content, &(6..7)); } #[test] #[should_panic] fn cannot_...
Rust
0
_key_index(model: type[BaseModel]) -> int: """Return the key index divider for a model tuple.""" return len(MODEL_REL_MAP[model][0]) ################# # CREATE COMICS # ################# _EXCLUDEBULK_UPDATE_COMIC_FIELDS = { "bookmark", "created_at", "id", "library", "comicfts", } BULK_UPDA...
Python
1
, Display, PartialEq)] #[display(fmt = "is-{}")] pub enum SectionSize { #[display(fmt = "medium")] Medium, #[display(fmt = "large")] Large, } pub mod hex_mesh; pub mod hex_renderer; pub use self::hex_mesh::HexMesh; pub use self::hex_renderer::HexData; pub use self::hex_renderer::HexRenderer; <reponame>...
Rust
0
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer, TextIteratorStreamer device = "cuda" # 初始化模型 model = AutoModelForCausalLM.from_pretrained( "/root/share/new_models/qwen/Qwen2-7B-Instruct", torch_dtype="auto", device_map="auto" ) # 初始化分词器 tokenizer = AutoTokenizer.from_pretrained...
Python
1
, 0]; unsafe { let buf = DeviceBuffer::from_slice_async(&start, &stream).unwrap(); buf.async_copy_to(&mut end, &stream).unwrap(); } stream.synchronize().unwrap(); assert_eq!(start, end); } #[test] #[should_panic] fn test_copy_to_d2h_wrong_size() {...
Rust
0
hyper/mod.rs use std::{str::FromStr, sync::Arc}; use serde::Serialize; pub use hyper::{ header::{HeaderName, HeaderValue}, Body, }; use hyper::{ header::{InvalidHeaderName, InvalidHeaderValue, CONTENT_TYPE}, http::{ method::{InvalidMethod, Method}, request::Builder, uri::{Build...
Rust
0
pub struct ViSurfaceCreateFlagsNn: u32 { const FLAG_BITS_MAX_ENUM_NN = 0x7fffffff; } } bitflags! { #[repr(C)] #[derive(Default)] pub struct DescriptorUpdateTemplateCreateFlagsKhr: u32 { const FLAG_BITS_MAX_ENUM_KHR = 0x7fffffff; } } bitflags! { #[repr(C)] #[derive(Def...
Rust
0
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.chat_message_histories import ( UpstashRedisChatMessageHistory, ) # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation w...
Python
1
a, String, TopicPartitions>, } impl<'a> TopicIter<'a> { fn new(state: &'a ClientState) -> TopicIter<'a> { TopicIter { state, iter: state.topic_partitions().iter(), } } } impl<'a> Iterator for TopicIter<'a> { type Item = Topic<'a>; #[inline] fn next(&mut sel...
Rust
0
", hide_env_values = true )] memo: String, }, /// Receives some tokens from IBC enabled chain Receive { /// Chain ID of IBC enabled chain chain_id: ChainId, /// Amount to receive from IBC enabled chain amount: u32, /// Denom of tokens to re...
Rust
0
arget_id = ? ORDER BY extracted_at DESC """, (target_id,)) extracted_records = [] for row in cursor.fetchall(): record = dict(row) if record['data_content']: try: record['parsed_content'] = json.loads(record['data_content'])...
Python
1
=> err, }) } } <filename>src/main.rs /* * `elf' is a command line utility that reads the binary ELF format. * * Author: <NAME> (<EMAIL>) * License: MIT (see LICENSE.md at https://github.com/DanielSchuette/elf) * * Dev logs: * TODO: Pretty-print prog header table (see `readelf' util). * TODO: Parse s...
Rust
0
2) #pre_cmd = "cp ~/magic_pdf_html_table_cpu.json ~/magic-pdf.json" #os.system(pre_cmd) value = { "model": "tablemaster", "enable": False, "max_time": 400 } common.update_config_file(magic_pdf_config, "table-config", value) common.update_config_...
Python
1
cycle self.last_pos -= NUM_SAMPLES_PER_TABLE as Float; } // TODO: Improve interpolation let translated_index = (self.wave.table.len() - 1) as Float * wave_index; let lower_wave = translated_index as usize; let lower_wave_float = lower_wave as Float; let lower...
Rust
0
# 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, software # distributed under th...
Python
1
largest_width[i] - vec_datatypes[i].len(); // let borrowed_string = " ".repeat(add_space); // let string = vec_datatypes[i].to_string(); //} // make vector of formatted values for i in 0..cols { vf[i] = datatype::trunc_strings(&v[i], col_largest_width[i]); } if debug_mode { ...
Rust
0
# (C) Copyright 2017 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
Python
1
from typing import Dict from app.scrapers.base import BaseScraper from app.scrapers.hacker_news import HackerNewsScraper from app.scrapers.github_trending import GitHubTrendingScraper from app.scrapers.reddit import RedditScraper from app.config.settings import settings # Dictionary of available scrapers scrapers: Dic...
Python
1
batch_count = math.ceil(record_count / self._batch_size) self._completed_step += batch_count self._latest_task_end_time = int(time.time()) def get_completed_step(self): return self._completed_step def recover_task(self, task): if not self._check_exceed_max_task_retries(t...
Python
1
serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize)] #[serde(rename_all = "snake_case")] pub struct Envelope<T: Serialize> { pub content: T, #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] #[serde(with = "serde_bytes")] pub sender_pubkey: Option<Vec<u8>>, #[s...
Rust
0
} #[test] fn dialer_and_listener_timeout() { fn test1(addr: Multiaddr) { task::block_on(async move { let mut timeout_listener = TcpConfig::new().timeout(Duration::from_secs(1)).listen_on(addr).unwrap(); assert!(timeout_listener.accept().await.is_err()); ...
Rust
0
lr scheduler total_steps = len(dataloader) * args.num_epoch num_warmup_steps = int(args.warmup_ratio * total_steps) lr_scheduler = get_linear_schedule_with_warmup( optimizer, num_warmup_steps=num_warmup_steps, num_training_steps=len(dataloader) * args.num_epoch ) # Define criterion def ...
Python
1
#? Shift variable should not be greater equal 25 that may create some problems in the program #? The shift should be greater than 5 and smaller than -5 for better security #? Shift variable should not be smaller equal -25 that may create some problems in the program #* However i have handled this all condition in th...
Python
1
=> unreachable!(), } } statements } <gh_stars>10-100 #![allow(unused_imports)] #![allow(dead_code)] use std::collections::HashMap; use std::path::Path; use std::sync::Arc; use std::sync::Mutex; use std::sync::atomic::AtomicBool; use tokio::sync::mpsc; use tokio::sync::RwLock; #[allow(unused_imports, dead_code)] us...
Rust
0
it self.fetch_user_live_videos(uniqueId) # 判断是否有直播间 if not webcast_data.has_live: logger.info(_("用户:{0} 没有直播间").format(uniqueId)) return # 是否正在直播 if webcast_data.live_status != 2: logger.info(_("当前 {0} 直播已结束").format(webcast_data.live_title_raw)) ...
Python
1
utput = dict(board = game.getBoard(), player1 = game.getP1Turn(), player2 = game.getP2Turn(), bothConnected = game.bothConnected(), time = timePlayer, end = True) output = json.dumps(output) output = output.encode('utf-8') c...
Python
1
) / 2 } _ => return None, } } else { return None; }; Some(m) } fn set_type(&mut self, value: &str) -> io::Result<()> { use Type::*; let type_ = match value { ATSP => Atsp, CVRP => Cvrp, ...
Rust
0
w() { Err(e) => return json_response(Status::InternalServerError, &e.to_string()), Ok(v) => v, }; match db.get_tile(dashboard_name, tile_id) { Err(e) => json_response(Status::InternalServerError, &e.to_string()), Ok(None) => json_response(Status::NotFound, ""), Ok(Some(va...
Rust
0
self, ($($an,)*)) } } #[allow(non_camel_case_types,unused_mut)] impl<$($an: $($at)*,)*> $crate::HetFn<($($an,)*)> for $n { fn call(&self, ($(mut $an,)*): ($($an,)*)) -> $o { $($s);* } } }; {let $n:ident$(<$($p:ident $(: $pb:pa...
Rust
0
== BLUETOOTH_CONNECT_TOKEN { RuwiBluetoothCommand::Connect(get_bluetooth_connect_opts( bluetooth_opts, subcommand_matcher, )?) } else { handle_cmdline_parsing_error(subcommand_name, subcommand_matcher)? }; Ok(cmd) } else {...
Rust
0
from nbodykit.lab import * from nbodykit import setup_logging from numpy.testing import assert_allclose import pytest from mpi4py import MPI setup_logging() @pytest.mark.parametrize("comm", [MPI.COMM_WORLD,]) @pytest.mark.mpi def test_missing_columns(comm): # create FKP catalog source1 = UniformCatalog(nbar...
Python
1