text
string
label_name
string
labels
int64
import numpy as np import mujoco as mj def DomainRandomize(env, alter_gravity, alter_friction): # Modify all the envs in a synced vector of envs floor_geom_id = 0 # This is the floor geometry id for Ant-v5 env num_envs = len(env.envs) for idx, _ in enumerate(env.envs): # Change the floor geo...
Python
1
third argument is optional. /// Should we keep the same restriction in zelkova ? Tuple(Box<Pattern>, Box<Pattern>, Option<Box<Pattern>>), Constructor { ctor: TypeConstructor, args: Vec<Pattern>, }, } impl Pattern { fn from_parser(p: &parser::Pattern, env: &dyn Environment) -> Patte...
Rust
0
import time from typing import Callable, List from adapters.ds.sinks.always_on_rtsp.config import Config from adapters.ds.sinks.always_on_rtsp.last_frame import LastFrameRef from adapters.shared.thread import BaseThreadWorker from savant.config.schema import PipelineElement from savant.gstreamer import Gst from savant...
Python
1
import mysql.connector def connect_to_mysql(database): return mysql.connector.connect( host='localhost', port='3306', user='root', password='root', database=database ) def insert_data_into_dim_empresa(codigo_empresa, nome_empresa): connection = connect_to_mysql('db_...
Python
1
y_{}", i)), &precomp, &[bits[0], bits[1]], &y_coords, )?; // Add the value computed in this chunk to the accumulator match i { // First chunk -> initialize acc chunk if chunk == 0 => { ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def calculate_harmonic_mean(*args): if not args: return None reciprocal_sum = sum(1 / num for num in args) harmonic_mean = len(args) / reciprocal_sum return harmonic_mean if __name__ == "__main__": values = [2, 4, 6, 8] result = calculate...
Python
1
should be called exactly once. /// When a node is initialized with boot or boot_non_voter, start it with MetaStore::new(). #[tracing::instrument(level = "info")] pub async fn boot( node_id: NodeId, config: &configs::Config, ) -> common_exception::Result<Arc<MetaNode>> { // 1. Br...
Rust
0
ut mesh.normals); texcoords.append(&mut mesh.texcoords); } (models, positions, indices, normals, texcoords) } fn empty_image( queue: Arc<vulkano::device::Queue>, ) -> ( Arc<vulkano::image::ImmutableImage<vulkano::format::R8G8B8A8Srgb>>, Box<vulkano::sync::GpuFuture>, ) { let pixel = vec...
Rust
0
for i, line in enumerate(clauses): # if line == "FILTER (!isLiteral(?x) OR lang(?x) = '' OR langMatches(lang(?x), 'en'))": # clauses = clauses[:i + 1] + addline + clauses[i + 1:] # break # sparql_query = '\n'.join(c...
Python
1
on" print(count_json_items(file_path)) file_path = "/Users/liuxuejin/Desktop/Data/生成、解释、补全数据/CD_UI_code_description_0423.json" print(count_json_items(file_path)) file_path = "/Users/liuxuejin/Desktop/Data/生成、解释、补全数据/EG_code_description.json" print(count_json_items(file_path)) file_path = "/Users...
Python
1
_key_path') with open(private_key_path, 'r') as f: private_key = f.read() pub_key_path = config.get('wechat_pay', 'pub_key_path') with open(pub_key_path) as f: public_key = f.read() public_key_id = config.g...
Python
1
w?".into()); opts.push("*.sw?x".into()); // Emacs opts.push("#*#".into()); opts.push(".#*".into()); // VCS opts.push(format!("*{s}.hg{s}**", s = MAIN_SEPARATOR)); opts.push(format!("*{s}.git{s}**", s = MAIN_SEPARATOR)); opts.push(format!("*{s}.svn{s}**", s = MAIN_SEPARATOR)); // S...
Rust
0
lti process parameters mp_cfg=dict(mp_start_method="fork", opencv_num_threads=0), # set distributed parameters dist_cfg=dict(backend="nccl"), ) # set visualizer visualizer = None # set log level log_level = "INFO" # load from which checkpoint load_from = None # whether to resume training from the loaded...
Python
1
/// ); /// /// let m = cmd.try_get_matches_from_mut(["cmd", "true"]).unwrap(); /// let port: bool = *m.get_one("download") /// .expect("required"); /// assert_eq!(port, true); /// /// assert!(cmd.try_get_matches_from_mut(["cmd", "forever"]).is_err()); /// ``` pub const f...
Rust
0
96780", 152 ); } pub fn testcase_3_even_odd_frames< T: harness::EmulatorInterface >() { static ROM: &'static [u8] = include_bytes!( "../roms/vbl_nmi_timing/3.even_odd_frames.nes" ); harness::standard_testcase::< T >( ROM, "cfa81bdc8309c4ff06f75fd1cc87d3e0", 97 ); } pub fn testcase_4_vbl...
Rust
0
for TokioCharDevice { #[inline] fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket { self.0.as_raw_handle_or_socket() } } #[cfg(not(windows))] impl AsFd for TokioCharDevice { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { self.0.as_fd() } } #[cfg(windows)] impl AsHandle for ...
Rust
0
ime, typically from the start of an operation to the end. //! In other words, you generally start a span at the beginning of a function or block, and end //! it at the end of the function/block. //! //! The purpose of this crate is to let you easily record spans and send them to a Jaeger server, //! which will aggerate...
Rust
0
units: get_units() }; Template::render("modify_class", &context) } #[derive(FromForm, Debug, Insertable, AsChangeset, Serialize)] #[table_name="classes"] pub struct ClassForm { name: String, unit: String, schema: String } #[get("/delete/<id>")] pub fn delete_class(conn: Conn, id: i32) -> Redirec...
Rust
0
s| self.push_str(s)); } } impl<'a> Extend<Box<str>> for ArcStringWriter<'a> { #[inline] fn extend<T: IntoIterator<Item = Box<str>>>(&mut self, iter: T) { iter.into_iter().for_each(move |s| self.push_str(&s)); } } impl<'a> Extend<String> for ArcStringWriter<'a> { #[inline] fn extend<T: ...
Rust
0
from misaki import en, espeak import numpy as np import phonemizer import soundfile as sf import onnxruntime as ort def basic_english_tokenize(text): """Basic English tokenizer that splits on whitespace and punctuation.""" import re tokens = re.findall(r"\w+|[^\w\s]", text) return tokens class TextC...
Python
1
let int64_reg = value_to_reg(ehx, b, span, value, &abitype::AbiType::Int); Some(NumOperand::Int(int64_reg)) } else if !possible_type_tags.contains(boxed::TypeTag::Int) { let float_reg = value_to_reg(ehx, b, span, value, &abitype::AbiType::Float); Some(NumOperand::Float(f...
Rust
0
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib import messages from django.http import JsonResponse from django.core.paginator import Paginator from django.db.models import Q from .models import RuleCategory, Rule, IPBlackl...
Python
1
Unused132, Unused133, Unused134, Unused135, Unused136, Unused137, Unused138, Unused139, Unused140, Unused141, Unused142, Unused143, Unused144, Unused145, Unused146, Unused147, Unused148, Unused149, Unused150, Unused151, Unused152, U...
Rust
0
from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from restapi.models import Student from rest_framework.views import APIView @api_view(['GET']) @permission_classes([IsAuthenticated]) def get_all_stude...
Python
1
r.post_process_object_detection( outputs, threshold=0.3, target_sizes=[image.size[::-1]] )[0] expected_scores = torch.tensor([0.6831, 0.6826, 0.5684, 0.5464, 0.4392], device=torch_device) expected_labels = [17, 17, 75, 75, 63] expected_slice_boxes = torch.tensor([345.8478, 23...
Python
1
# Add actions from silx.gui.plot.action to the toolbar resetZoomAction = actions.control.ResetZoomAction(parent=self, plot=self._plot) toolBar.addAction(resetZoomAction) # Add tool buttons from silx.gui.plot.PlotToolButtons aspectRatioButton = PlotToolButtons.AspectToolButton( ...
Python
1
# -*- coding: utf-8 -*- # Scrapy settings for makedream project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/late...
Python
1
GAEBuehsDBBLTAEBwKesDB csnjBEB14qtDBnk4AEBHvssDBJmPBEB0iLtDB cMI9BEB2jnuDBlYtBEBwK6tDByL2BEBtITuDB cmOFCEBKx9uDBUt/BEBvJvuDBZwCCEB671uDB cIlICEBjXJvDB4aGCEB0iBvDBAAHCEBzhMvDB c7xGCEBnE9uDBoFKCEBiWGvDBqGHCEB8SBvDB cUYCCEB0iSuDBgqFCEBgquuDBktECEBJbguDB cMI4BEBzMTtDBc9+BEBSM+tDB2u8BEB9omtDB ...
Rust
0
ses_lsoda)) end_lsoda = time.time() start_euler = time.time() solution_euler = solve_euler_method(neuron=neuron_synapse, time_samples = time_samples, input_signal=np.asarray(input_synapses), delta_t=delta_t) end_euler = time.time() np.save(f"./ode_solved{link_id}/neuron{link_id +...
Python
1
_element < self.msg.data.len() { self.index += 1; Some((self.index, self.msg[self.index])) } else { None } } else { if (self.index as usize) <= self.msg.last_positive_element { self.index += 1; So...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class DatadigitalFincloudGeneralsaasBankcardCheckResponse(AlipayResponse): def __init__(self): super(DatadigitalFincloudGeneralsaasBankcardCheckResponse, self).__init__() s...
Python
1
if needle.len() == 0 { // special case when anchored is true: return possible matches if anchored { return match search_type { SearchType::All => { let mut i = 0; let mut cost = costs.start_gap_cost as u32; let m...
Rust
0
}; // Element with subsequent elements (@struct $index:expr, ($name:ident: $input:ty = $handler:expr, $($next:tt)*) -> {$($output:tt)*}) => { _ctx_struct!(@struct $index + 1usize, ($($next)*) -> {$($output)* ($index, $name | $input | $handler)}) }; // Expand to a dispatcher trait impl (@...
Rust
0
# coding: utf-8 """ Postmark API Postmark makes sending and receiving email incredibly easy. The version of the OpenAPI document: 1.0.0 Generated by: https://konfigthis.com """ from postmark_python_sdk.paths.messages_outbound_clicks.get import GetAllClicksRaw from postmark_python_sdk.paths.messages...
Python
1
'Сокрушительный', 'Гривастый', 'Лютый', 'Ужасный', 'Могучий', 'Строгий', 'Бурый', 'Хищный', 'Монстрозный', 'Гордый', 'Дикий'] def __init__(self, level): super().__init__("Медведь", 80 + 10 * level, 100 + 30 * level) self.n...
Python
1
) return self._stubs["cancel_operation"] @property def get_operation( self, ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: r"""Return a callable for the get_operation method over gRPC.""" # Generate a "stub function" on-the-fly which will ...
Python
1
last_grid.clone(); for y in 0..grid.height { for x in 0..grid.width { let seat = last_grid.get_mut(x, y).unwrap(); match *seat { 'L' => if grid.adjacent(x, y, f) == 0 { *seat = '#'; count += 1 }, '#' => if grid.adjacent(x, y, ...
Rust
0
let result = program[offsets.0] + program[offsets.1]; program[offsets.2] = result; iptr += 4; } 2 => { let offsets = (program[iptr + 1], program[iptr + 2], program[iptr + 3]); let result = program[offsets.0] * program[offsets.1]...
Rust
0
# -*- encoding: utf-8 -*- # # Copyright 2013 Martin Zimmermann <info@posativ.org>. All rights reserved. # License: BSD Style, 2 clauses -- see LICENSE. from acrylamid import log from acrylamid.filters import Filter from acrylamid.lib.html import HTMLParser class Text(HTMLParser): """Strip tags and attributes fr...
Python
1
import cv2 import numpy as np import tensorflow as tf import keras model_path = r"C:\olivy\disease_detection\Aimodels\,2" file_path = r"C:\olivy\leaf_tests\670.jpg" def process_image(image_path): img = cv2.imread(image_path) if img is not None: print('GOT THE IMAGE !!') predicted_class, confide...
Python
1
import pygame from src.config import config_instance as CONFIG from src.ui.assets import Background class MainMenuScreen: @staticmethod def handle_input(app, event): if event.type == pygame.MOUSEBUTTONDOWN: app.environment_button_rect.handle_event(event) app.sensor_button_re...
Python
1
Example: ```rust # use deku::prelude::*; # use std::convert::{TryInto, TryFrom}; # #[derive(Debug, PartialEq, DekuRead, DekuWrite)] struct DekuTest { #[deku(update = "self.items.len()")] count: u8, #[deku(count = "count")] items: Vec<u8>, } let data: Vec<u8> = vec![0x02, 0xAB, 0xCD]; let value = Deku...
Rust
0
let mut schedule = Builder::default() .add_system(town_connector_system(100.0)) .add_system(sir_system(0.25, 7.0, 360.0)) .add_thread_local(draw_system(1)) .build(); let now = Instant::now(); let max_steps = 10000; for tick in 0..max_steps { if tick % 100 == 0 { ...
Rust
0
operator(Symbol::LT).into(), operator(Symbol::GT).into(), operator(Symbol::Exclamation).into(), operator(Symbol::Question).into(), ], ); } } #[cfg(test)] mod associations { use crate::io::slice::SourceSlice; use crate::ir:...
Rust
0
9, 0x47, 0xd1, 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42], }, ] <gh_stars>10-100 use crate::process::caching::*; use std::fs::File; use std::io::BufWriter; use std::io::Write; use std::path::Path; use svc_shader::drivers; use svc_shader::error::{Error, ErrorKind, Result}; use svc_shader::identity::co...
Rust
0
from datetime import datetime class Time: @staticmethod def count_time(distance, speed): return distance / speed class Driver: @staticmethod def calculate_fuel_costs(distance, fuel_consumption, price_per_liter): liters_needed = (distance / 100) * fuel_consumption return round(l...
Python
1
ete.assert_called_once_with( pinecone.DeleteRequest(delete_all=True, filter=self.filter1, namespace='ns') ) def test_delete_deleteAllNoFilter_deleteNoFilter(self, mocker): mocker.patch.object(self.index._vector_api, 'delete', autospec=True) self.index.delete(delete_all=True) ...
Python
1
for reg, xdec in decs) block.ops.extend(IncRef(reg) for reg in incs) block.ops.append(Goto(label)) cache[label, decs, incs] = block return block def make_value_ordering(ir: FuncIR) -> dict[Value, int]: """Create a ordering of values that allows them to be sorted. This omits registers that ar...
Python
1
GUARD | RelayFlags::EXIT) .build_into(&mut bld) .unwrap(); } let consensus = bld.testing_consensus().unwrap(); let params = NetParameters::default(); let ws = WeightSet::from_consensus(&consensus, &params); assert_eq!(ws.bandwidth_fn, BandwidthFn...
Rust
0
'c1', 'h1')} state, predicted_word = self.forward_one_step_for_image(img_feature,state, volatile=volatile) index=predicted_word.data.argmax(1) index=cuda.to_cpu(index)[0] #genrated_sentence_string+=index2word[index] #dont's add it because this is <SOS> for i in xrange(50): ...
Python
1
bar_proc), Self::TOOL_BAR_SUBCLASS_UID, 0, ) .expect("failed to install subclass") } new } pub fn add_tab(&self, title: String, index: TabIndex, key: TabKey) -> Result<()> { let handle = self.handle; let mut text: Vec<_> = ...
Rust
0
default_features { args.insert("no-default-features", vec![]); } let current = ws.current()?; let find_by_name = |name: &str, kind: &'static str| -> _ { current .targets() .iter() .find(|t| t.name() == name && t.kind().des...
Rust
0
as minimal overhead compared to wrapping with `func` //! #[cfg(feature = "derive")] //! #[ocaml::native_func] //! pub unsafe fn incr(value: ocaml::Value) -> ocaml::Value { //! let i = value.int_val(); //! ocaml::Value::int(i + 1) //! } //! //! // This is equivalent to: //! #[no_mangle] //! pub unsafe extern "C"...
Rust
0
impl NewProxyInner { pub(crate) fn is_queue_on_current_thread(&self) -> bool { self.queue_thread == thread::current().id() } pub(crate) unsafe fn implement<I: Interface, F>( self, implementation: F, user_data: UserData, ) -> ProxyInner where I: From<Proxy<I...
Rust
0
# Getting all the Divisors def get_divisors(n): for i in range(1, int(n / 2) + 1): if n % i == 0: print(i) print(n) get_divisors(220)
Python
1
!self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct AUXIO0R { bits: bool, } impl AUXIO0R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn ...
Rust
0
plib.SMTP_SSL', autospec=True) as mock_smtp: send_messages.send(asic_gcd, event, "import", "0") mock_smtp.assert_not_called() context = mock_smtp.return_value.__enter__.return_value context.login.assert_not_called() context.sendmail.assert_not_called() def test_email_step_ind...
Python
1
r for setting docstring pass __init__.__doc__ = __new__.__doc__ @staticmethod def _compose_rotation_and_translation(rot, translation, parent): r = lambda x, y, z: CoordSys3D._rotation_trans_equations(rot, (x, y, z)) if parent is None: return r dx, dy, dz = [tra...
Python
1
''' TASK: You're given a 0-indexed integer array nums os size 3 which can form the sides of a triangle A triangle is equilateral if it has all the sides of equal length A triangle is isosceles if it has exactly two sides of equal length A triangle is scalene if all its sides are of different lengths Return a string rep...
Python
1
TUS_LINEFEEDS + TITLE_LINEFEEDS + 1; pub fn get_term_size() -> (usize, usize) { match term_size::dimensions() { Some((w, h)) => (w.saturating_sub(SIZE_AUTO_PAD_W), h.saturating_sub(SIZE_AUTO_PAD_H)), None => panic!("Can't get terminal size, try removing -a"), } } pub fn clear_line_msg(lck: &mu...
Rust
0
# Copyright (c) 2020 PaddlePaddle Authors. 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 required by app...
Python
1
gin; #[derive(Component, Default, Reflect)] #[reflect(Component)] pub struct Person; #[derive(Deref, DerefMut)] struct GreetTimer(Timer); impl Plugin for {{crate_name|pascal_case}}Plugin { fn build(&self, app: &mut App) { app.insert_resource(GreetTimer(Timer::from_seconds(2.0, true))) .add_st...
Rust
0
/// Deposit collateral to market. /// - `origin` : Sender of this extrinsic. /// - `market` : Market index to which collateral will be deposited. /// - `amount` : Amount of collateral to be deposited. #[pallet::weight(<T as Config>::WeightInfo::deposit_collateral())] #[transactional] pub fn deposit_coll...
Rust
0
import torch import torch.nn.functional as F # Assuming node_features is your input tensor where each row represents a time series data for a station # Function to calculate trend and remainder features for each row def decompose_trend_remainder(node_features): trend_features = [] remainder_features = [] ...
Python
1
atus::Open => write!(f, "open"), Status::Rejected => write!(f, "rejected"), Status::Passed => write!(f, "passed"), Status::Executed => write!(f, "executed"), Status::Closed => write!(f, "closed"), } } } //! Tests auto-converted from "sass-spec/spec/libsass-clo...
Rust
0
04, 0xc5541fd48046b7e7, 0x16080cf4071e0b05, 0x1225f2901aea514e ]) ); a.shr(1); assert_eq!( a, FqRepr([ 0xd52e6eb0b9423ffe, 0x21921603576aa943, 0xceeead98979ee882, 0xe2aa0fea40235bf3, 0xb04...
Rust
0
f\xd1\xbd\ V,\xbb?B\xe8\xc89:-P6\xf4k!|\ \x05\x0b\xa4&\x02\x0a\x19\xc5\xf8\x04\x93\x1c\xcf\x22\xea~\ \xc7\xbe\xfd=b\xe9\x17#\xdb\x1c\xc4\x87\xa2\x8d\x1d\xd6\ Q\x00SC\xa1\x1b\xd9[jKR=\xd5\x07\xfd\xd3\ \xc3\xa5\xcb*\xc4\x18v\x8e\x1dx^|1\x9cag\ \x01\xac\xe0\xf9z\xfcN\x1f\xc5\xbb\x03\x22\xf0t08\ \xd0\xd4mm\xca\xa2H\x15\xe5...
Python
1
pcode_costs, storage_costs, host_function_costs, } } pub fn opcode_costs(&self) -> OpcodeCosts { self.opcode_costs } pub fn storage_costs(&self) -> StorageCosts { self.storage_costs } pub fn take_host_function_costs(self) -> HostFunctionCosts { ...
Rust
0
#1- İlk iki elemanı 1'e eşit olan, en az 20 elemanlı bir fibonacci serisini liste halinde oluşturan döngü yazalım. x = 1 y = 1 fibonacci = [x,y] for i in range(20): x,y=y,x+y fibonacci.append(y) print(fibonacci) #2- Kullanıcıdan aldığı sayının mükemmel olup olmadığını söyleyen bir program yazınız.(Arş. Müke...
Python
1
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. __title__ = "packaging" __summary__ = "Core utilities for Python packages" __uri__ = "https://github.com/pypa/packaging" __version__ = "24...
Python
1
, value, value_min, value_max) } //////////////////////////////////////////////////////////////////////////////////////////////////// // GUI #[inline] pub fn gui_begin_frame() { get_gui().begin_frame() } #[inline] pub fn gui_end_frame() { get_gui().end_frame() } #[inline] #[must_use = "It returns whether th...
Rust
0
Block = aast::Block<Ty, SavedEnv>; pub type Class_ = aast::Class_<Ty, SavedEnv>; pub type ClassId = aast::ClassId<Ty, SavedEnv>; pub type TypeHint = aast::TypeHint<Ty>; pub type Targ = aast::Targ<Ty>; pub type ClassGetExpr = aast::ClassGetExpr<Ty, SavedEnv>; pub type ClassTypeconstDef = aast::ClassTypeconstDef<T...
Rust
0
# ---------------------------------------------- # HASHING IN PYTHON – FULL EXPLANATION & EXAMPLES # ---------------------------------------------- # What is Hashing? # Hashing is a method of mapping data to fixed-size values (hash values). # It's used for fast data access, lookups, counting frequency, etc. # Why Use...
Python
1
da family "oldp1254": r"([.!?])", # Old Persian: generic punctuation "oldi1245": r"([.!?])", # Early Irish: Latin punctuation "ugar1238": r"([𒑰])", # Ugaritic: generic punctuation "phoe1239": r"([𐤟])", # Phoenician: generic punctuation "moab1234": r"([𐤟])", # Moabite (Pho...
Python
1
// Get client let cromwell_client: CromwellClient = CromwellClient::new(Client::default(), &mockito::server_url()); // Create job data with simple test workflow let test_path = PathBuf::from("testdata/requests/cromwell_requests/test_workflow.wdl"); // Make fake param...
Rust
0
+ "r:" + str( # int(roll_predicted[i])) cv2.putText(img_rgb, text, (cx - 10, cy - 25), cv2.FONT_HERSHEY_TRIPLEX, 0.6, (255, 0, 255)) # landms cv2.circle(img_rgb, (b[5], b[6]), 1, (0, 0, 255), 4) cv2.circle(img_rgb, (b[7], b[8]), 1, (0, 255, 255), 4) ...
Python
1
from langchain.embeddings import init_embeddings from langchain_chroma import Chroma from dotenv import load_dotenv load_dotenv() embedding = init_embeddings( model="amazon.titan-embed-text-v2:0", provider="bedrock", ) texts = [ "AIチャットボットプラットフォーム「SmartChat」(Orion)は自然言語で会話を自動化します。ユーザーの質問に24時間対応するよう設計されてい...
Python
1
assert_eq!(ref_pos_vec.len(), 1); let act_pos = KmerPos { start: SeqPos { orient: SeqOrient::Forward, position: 0, }, end: SeqPos { orient: SeqOrient::Forward, position: 3, }, }; ...
Rust
0
[ Text.assemble( (element.filter_prompt, self.console.get_style("text")), (element.text, self.console.get_style("text")), "\n", ) ] if element.allow_filtering ...
Python
1
time_ptr: u32) -> i32 { debug!("emscripten::_timegm {}", time_ptr); unsafe { let time_p_addr = emscripten_memory_pointer!(ctx.memory(0), time_ptr) as *mut guest_tm; let x: *mut c_char = CString::new("").expect("CString::new failed").into_raw(); let mut rust_tm = libc_tm { t...
Rust
0
r wider definition of invertibility without identity // assert!(x.clone().operate(y.clone()).operate(y.invertibility()) == x); } } /// `x * z == y * z => x == y` /// /// `z * x == z * y => x == y` pub trait Cancellativity<I: PartialEq + Clone>: Operation<I> { fn check_cancellativity(x: I, y: I, z: I) {...
Rust
0
input: Arc<dyn PhysicalExpr>, by: Vec<Arc<dyn PhysicalExpr>>, reverse: Vec<bool>, expr: Expr, ) -> Self { Self { input, by, reverse, expr, } } } fn prepare_reverse(reverse: &[bool], by_len: usize) -> Vec<bool> { ...
Rust
0
ilter").start_object(); crate::json_ser::serialize_structure_crate_model_aws_s3_bucket_notification_configuration_s3_key_filter(&mut object_2588, var_2587); object_2588.finish(); } } pub fn serialize_structure_crate_model_aws_rds_db_subnet_group_subnet_availability_zone( object: &mut smithy_jso...
Rust
0
umpTarget::Spr(index) => self.spr[SPR_PROGRAM_COUNTER] = self.spr[index], } } fn alu_stage2( &mut self, target: Option<AluSource>, carry_override: Option<u16>, ) -> [bool; FLAG_COUNT] { let lhs: u8 = self.lhs_latch.into(); let rhs: u8 = self.rhs_latch.into();...
Rust
0
from __future__ import annotations import pandas as pd from sdgx.utils import logger class ColumnMetric(object): """ColumnMetric Metrics used to evaluate the quality of synthetic data columns. """ upper_bound = None lower_bound = None metric_name = "Accuracy" def __init__(self) -> Non...
Python
1
# 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
import cv2 import numpy as np import pyautogui import time resolution = pyautogui.size() codec = cv2.VideoWriter_fourcc(*'mp4v') filename = "video.mp4" fps = 5 out = cv2.VideoWriter(filename, codec, fps, resolution) def record_video(sec): # Video settings RECORD_SEC = sec # Specify how many seconds to reco...
Python
1
# 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
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 메일 페이지 구조 분석 스크립트 저장된 스크린샷과 HTML을 분석 """ import asyncio from pathlib import Path from playwright.async_api import async_playwright from cookie_manager import CookieManager from utils import load_config, print_banner, print_status async def analyze_mail_page(): ""...
Python
1
println!("notify: {}", item.desc()); // item // } <filename>mdr32f9q2i-pac/src/mdr_porta.rs #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - PORT Data Register"] pub rxtx: crate::Reg<rxtx::RXTX_SPEC>, #[doc = "0x04 - PORT Output Enable Register"] pub oe: crate::Reg<o...
Rust
0
""" patch command test module """ from tests.base import RemoteGefUnitTestGeneric from tests.utils import ERROR_INACTIVE_SESSION_MESSAGE, debug_target, u16, u32, u64, u8 class PatchCommand(RemoteGefUnitTestGeneric): """`patch` command test module""" def test_cmd_patch(self): gdb = self._gdb ...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: envoy/config/filter/http/health_check/v2/health_check.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google...
Python
1
ontent paths than it does in later inventories. Expected: [v1/content/file-3.txt]; Found: [v1/content/file-2.txt]", ), version_error( "v1", ErrorCode::E066, "Inventory version v1 state contains a path not in later inventories: file-1.txt", ), ]); has_w...
Rust
0
from fastapi.testclient import TestClient import app as app_module client = TestClient(app_module.app) def test_list_recipes_smoke(): r = client.get("/api/v1/recipes", params={"query": "salad", "limit": 5}) assert r.status_code == 200 data = r.json() assert isinstance(data, list) def test_get_reci...
Python
1
ines = s .lines() .skip(1) .map(|l| l.chars().map(|c| c.to_string()).collect::<Vec<String>>()) .collect::<Vec<Vec<String>>>(); // fl - top line, as-is // ll - bottom line, as-is // flr - top line, flipped Y ...
Rust
0
mol.nelec = 5 assert mol.charge is None mol = IOData() mol.charge = 1 assert mol.nelec is None def test_spinpol1(): mol = IOData(spinpol=3) assert mol.spinpol == 3 def test_spinpol2(): mol = IOData() mol.spinpol = 3 assert mol.spinpol == 3 def test_derived1(): # When lo...
Python
1
# ------------------------------------------------------------------ # Copyright (c) 2020 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in LICENSE, distributed with # this software. # # SPDX-Licens...
Python
1
# coding: utf-8 # In[1]: # get_ipython().magic('matplotlib inline') # In[2]: # importing required libraries import os import subprocess import stat import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from datetime import datetime sns.set(style="white") # In[3]: # absolu...
Python
1
job, eps| { Box::new(once(job).chain( problem.jobs.neighbors(profile, job, 0.).take_while(move |(_, cost)| *cost < eps).map(|(job, _)| job), )) }); create_clusters(problem.jobs.all_as_slice(), eps, min_items, &neighbor_fn) } /// Estimates DBSCAN epsilon parameter. fn estimate_epsil...
Rust
0
query=""" SELECT name FROM slice ORDER BY name; """, out=Csv(""" "name" "mapped_name1" "mapped_name2" "raw_name3" "slice_begin" """)) def test_process_track_name(self): return DiffTestBlueprint( trace=Path('process_track_name.textpro...
Python
1