text
string
label_name
string
labels
int64
!("\n1: 取数 {:032b}\t{}", r, r as u8); // let r = c & (0b111 << 1); // println!("3: 取数 {:032b}\t{}", r, r as u8); // let r = c & (0b1111 << 4); // println!("4: 取数 {:032b}\t{}", r, r as u8); // let r = c & (u64::MAX >> (32 - 24) << 8); // println!("24:取数 {:032b}\t{}", r, r as u32); } struct Bits ...
Rust
0
(len(weighted_returns) - len(portfolio_returns), 0) ) portfolio_returns += weighted_returns if len(portfolio_returns) == 0: return 1.0 # Calculate beta using covariance method covarian...
Python
1
ataset_raw.robotGraphFull.new_urdf_path) model, collision_model, visual_model = pin.buildModelsFromUrdf( str(urdf_path), str(urdf_path.parent.parent), pin.JointModelFreeFlyer(), verbose=True ) data = model.createData() # Setup a viewer viz = pin.visualize.MeshcatVisualizer(model, collision_...
Python
1
pub const tm_os_window_state_TM_OS_WINDOW_STATE_MINIMIZE: tm_os_window_state = 1; pub const tm_os_window_state_TM_OS_WINDOW_STATE_NORMAL: tm_os_window_state = 2; pub type tm_os_window_state = ::std::os::raw::c_int; pub const tm_os_window_cursor_mode_TM_OS_WINDOW_CURSOR_MODE_VISIBLE_AND_FREE: tm_os_window_curso...
Rust
0
# -*- coding: utf-8 -*- { 'name': "HR Attendance Holidays", 'summary': """""", 'category': 'Human Resources', 'description': """ Hides the attendance presence button when an employee is on leave. """, 'version': '1.0', 'depends': ['hr_attendance', 'hr_holidays'], 'auto_install': True, ...
Python
1
wrap().block.block().clone(); blockchain.store().rewind_to_height(block.header.height - 1).unwrap(); let mut malicious_test_params = TestParams::new(); // New key which used to manipulate the input let (malicious_script_private_key, malicious_script_public_key) = malicious_test_params.get_script_keypa...
Rust
0
# grafana URL via Open OnDemand helper app for Adroit cluster condition = '(self.js.cluster == "adroit") and self.js.is_retained()' note = ("See the URL below for various job metrics plotted as a function of time:", 'f"https://myadroit.princeton.edu/pun/sys/jobstats/{self.js.jobid} (VPN required off-campus)"')...
Python
1
Result<(String, Schema), String> { self .execute( None, INTROSPECTION_QUERY.to_owned(), Some("IntrospectionQuery".to_owned()), None, ) .await? .get("data") .and_then(|data| data.get("__schema")) .ok_or_else(|| "data.__schema does not exist.".to_ow...
Rust
0
e not in _bl_node_instantiators: mi_context.log(f'Unknown Blender node type "{node_type}".', 'ERROR') return False if not _bl_node_instantiators[node_type](mi_context, bl_node): mi_context.log(f'Failed to instantiate Blender node "{node_type}".', 'ERROR') return False return True...
Python
1
129i32; #[doc = "*Required features: `\"Win32_Networking_WindowsWebServices\"`*"] pub const WS_TRACE_API_ADD_CUSTOM_HEADER: WS_TRACE_API = 130i32; #[doc = "*Required features: `\"Win32_Networking_WindowsWebServices\"`*"] pub const WS_TRACE_API_ADD_MAPPED_HEADER: WS_TRACE_API = 131i32; #[doc = "*Required features: `\"W...
Rust
0
path: &mut CString, file_mode: libc::mode_t, dir_mode: libc::mode_t, ) -> Result<(), Errno> { touch_path_(cstring_as_slice(path), file_mode, dir_mode) } /// Helper function. The last character in the path is always `\0`. fn touch_path_( path: &mut [libc::c_char], file_mode: libc::mode_t, dir_mo...
Rust
0
if let Some(subreport) = self.stats.report(TimePeriod::Any(from, to))? { subreports.push(subreport); } } return Ok(Some(subreports)); } Ok(None) } } impl Statistics { pub fn new(entries: Vec<Entry>, categories: Vec<Categ...
Rust
0
# Minimal Syntax and Minimal Syntax Dark syntax highlighting themes # Color schemes Copyright 2016 David van Gemeren # MIT License # Minimal Syntax: https://github.com/burodepeper/minimal-syntax # Minimal Syntax Dark: https://github.com/burodepeper/minimal-syntax-dark class SyntaxHighlighter(object): de...
Python
1
Ok(()) } fn set_immutable(&self, immutable: bool) -> nix::Result<()> { let flags = self.inode_flags()?; let flags = match (flags & FS_IMMUTABLE_FL == FS_IMMUTABLE_FL, immutable) { (true, true) | (false, false) => { // Nothing to do. return Ok((...
Rust
0
# Copyright (c) 2014 EMC Corporation. # 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 requ...
Python
1
pylint: disable=protected-access # We make a dummy MethodType object to generate the correct bound method # signature. The actual call is to a function with a weak reference to # `instance`. instance_func = type(original_function)( tf_decorator.make_decorator( types_lib.MethodType(original_func...
Python
1
message_text = f"{downloader.title()} 共删除{len(torrents)}个种子及文件" for torrent in torrents: if self._event.is_set(): logger.info(f"自动删种服务停止") return text_item...
Python
1
Unit::Millisecond, Some(String::from("UTC"))), &[864000000005i64, 1545696000001i64], DataType::Date64, ); } #[test] fn timestamp_to_i64() { test_primitive_to_primitive( &[864000000005i64, 1545696000001], DataType::Timestamp(TimeUnit::Millisecond, Some(String::from("UTC"))), ...
Rust
0
let mut tmp1 = y; tmp1.square(); // tmp2 = (y^2 * d) - a let mut tmp2 = tmp1; tmp2.mul_assign(params.edwards_d()); tmp2.sub_assign(params.edwards_a()); // tmp2.add_assign(&E::Fr::one()); // tmp1 = y^2 - 1 tmp1.sub_assign(&E::Fr::one()); match ...
Rust
0
print("🧹 Cleaning up demonstration resources...") try: if self.synthesis_agent: await self.synthesis_agent.cleanup_session() if self.kb_agent: await self.kb_agent.cleanup_session() except Exception as e: print(f"⚠️ Cleanup warning: {e...
Python
1
n.GcloudStorageTranslationError as e: # Raise error if no_fallback mode has been requested. This mode # should only be used for debuggling and testing purposes. if hidden_shim_mode == HIDDEN_SHIM_MODE.NO_FALLBACK: raise exception.CommandException(e) # For all other cases, we wa...
Python
1
d key in eventWilliamHillDict.keys() and len(value) >= 3 and \ len(eventBet365Dict[key]) >= 2 and len(eventWilliamHillDict[key]) >= 2: self.set_Table_Data(key, value[0], value[1], value[2], eventBet365Dict[key][0], eventBet365Dict[key][...
Python
1
string as a known identifier type") } } #[inline] fn parse(name: &[u8]) -> Option<IdentifierType> { match name { [] | [b'\0'] => None, // special global variable [b'$', name @ ..] if is_special_global_name(name) => Some(IdentifierType::Global), // global variable [b'$',...
Rust
0
_jump_if_nonnegative, )), alt(( parse_load_byte, parse_store_byte, parse_indirect_load_byte, parse_indirect_store_byte, )), ))(input) } pub mod exceptions; pub mod pic; pub mod stack; pub mod syscall; pub mod syscall_legacy; pub fn cli() { u...
Rust
0
/// <li> <p>Steps 2 and 3 in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html">Tutorial: Delegate Access Across Amazon Web Services accounts Using IAM Roles</a> in the <i>IAM User Guide</i> </p> </li> /// </ul> /// <p>The <a href="http://wikipedia.org/wiki/re...
Rust
0
e) m = self.get_slot(var, 'm') v = self.get_slot(var, 'v') m_t = state_ops.assign(m, m * beta_1_t, use_locking=self._use_locking) m_scaled_g_values = grad * (1 - beta_1_t) with ops.control_dependencies([m_t]): m_t = scatter_add(m, ind...
Python
1
# doc-export: Example """ Example demonstrating three kinds of buttons. """ from flexx import flx class Example(flx.HFix): def init(self): with flx.VBox(): self.b1 = flx.Button(text='apple') self.b2 = flx.Button(text='banana') self.b3 = flx.Button(text='pear') ...
Python
1
# Create a program that reads the name of a city and tells whether # it starts or not with the name "Santo" city = str(input("What's the name of the city? ")).strip() # stripou para eliminar espaços inuteis print(city[:5].upper() == 'SANTO') # tacou tudo pra maiscula
Python
1
greater_than = 2 > 1 greater_than_or_equal = 2 >= 2 less_than = 1 < 2 less_than_or_equal = 2 <= 2 equal = "a" == "a" different = "a" != "b" print("gt:", greater_than) print("ge:", greater_than_or_equal) print("lt:", less_than) print("le:", less_than_or_equal) print("==:", greater_than) print("!=:", greater_than)
Python
1
#[test] fn adjust_hue() { assert_eq!( runner().err( "@use \"sass:color\";\ \na {b: color.adjust-hue(#abcdef, 10)}\n" ), "Error: The function adjust-hue() isn\'t in the sass:color module.\n\ \nRecommendation: color.adjust(#abcdef, $hue: 10)\n\ ...
Rust
0
umerate(layers_modify): # obj = model.model.layers[cur_layer].mlp # weights_copy[cur_layer] = obj.forward # obj.forward = MethodType(factory(i, lookup_idxs[train_st:train_ed]), obj) # cur_logits = model(input_tok["input_ids"][train_st:train_ed], ...
Python
1
*SSKJr SSKrSSKrSSKrSSKrSSKJr SSKJ r J r \R"S5Sr \R\R\\\ 4\ 4r\R\\R$\\ 44rS SjrS S jrS ...
Python
1
# YouTube Video: https://www.youtube.com/watch?v=mqaf7vj1AdA&list=PL5tcWHG-UPH1kjiE-Fqt1xCSkcwyfn2Jb """ Bisect: -"Built-in" binary search method in Python. -Can be used to search for an element in a sorted list. """ # Import allows us to make use of the bisect module. import bisect # This sorted list will b...
Python
1
# services/document_processor.py import os import json import re from typing import List, Dict, Any, Optional from pathlib import Path from llama_index.core import Document from llama_index.core.node_parser import SentenceSplitter from utils.logger import logger import hashlib from datetime import datetime class Docu...
Python
1
from abc import ABC, abstractmethod from typing import Dict try: from google.genai import types as gemini_types except ImportError: gemini_types = None class ToolDefinition(ABC): """Abstract base class for static tool definitions. This class should be implemented by all system tools. Each tool shoul...
Python
1
| config.unset($setting)), } }; } impl ConfigKey { pub fn list_all() -> Vec<ConfigKey> { vec![ config_key!(DeviceIdSetting), config_key!(DeviceKeyPathSetting), config_key!(DeviceCertPathSetting), config_key!(C8yUrlSetting), config_key!...
Rust
0
# input[type="file"] { # display: block; # width: 100%; # padding: 10px; # margin-bottom: 20px; # border: 1px solid #ced4da; # border-radius: 4px; # box-sizing: border-box; # } # button { # display: b...
Python
1
al of the coefficients "intercept" and "days_since_signup" AND other_coeff_table.parquet > file of the coefficients "Intercept", "days_since_signup", "np.log(count)", "1|day_index_sigma", "1|user_sigma", "variety_alpha" """ # Fit-Model df = pd.read_parquet(f"{base...
Python
1
'en': 'English' } return language_mapping.get(language, 'English') def get_tool_name(tool_id: str, language: str = "zh-CN") -> str: """ 获取工具的本地化名称 Args: tool_id: 工具ID (如 'crypto_price', 'indicators') language: 语言代码 Returns: 本地化的工具名称 """ to...
Python
1
esenting the time series of action profiles. """ if init_actions is None: random_state = check_random_state(random_state) init_actions = random_pure_actions(self.nums_actions, random_state) actions = list(init_actions) out = np.empty((ts_length, self.N), dtype=i...
Python
1
rs/tokio/0.2 #[cfg(feature = "tokio02")] pub(crate) mod tokio02; // https://docs.rs/tokio/0.3 #[cfg(feature = "tokio03")] pub(crate) mod tokio03; // https://docs.rs/tokio/1 #[cfg(feature = "tokio1")] pub(crate) mod tokio1; //! Ramp up TPS for Tour de SOL until all validators drop out mod notifier; mod results; mod sta...
Rust
0
FILE={}/build/cmake/android.toolchain.cmake", android_ndk_home_env )); args.push(format!("-DANDROID_ABI={}", ANDROID_ARCH_API)); args.push(format!("-DANDROID_NDK={}", android_ndk_home_env)); args.push(format!("-DANDROID_PLATFORM=android-{}", ANDROID_API_LEVEL)); args....
Rust
0
::ES); pub const cs: AsmRegisterSegment = AsmRegisterSegment::new(Register::CS); pub const ss: AsmRegisterSegment = AsmRegisterSegment::new(Register::SS); pub const ds: AsmRegisterSegment = AsmRegisterSegment::new(Register::DS); pub const fs: AsmRegisterSegment = AsmRegisterSegment::new(Register::FS); pub const gs...
Rust
0
argument::<JsFunction>(1)?.root(&mut cx); let channel = cx.channel(); RUNTIME.spawn(async move { let result = client.player.lock().await.stop().await; channel.send(move |mut cx| { let cb = cb.into_inner(&mut cx); let this = cx.undefined(); match result { Ok(v) => { let ar...
Rust
0
from playwright.sync_api import Page from shiny.playwright import controller from shiny.run import ShinyAppProc def test_checkbox_group_kitchen(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) default = controller.InputCheckboxGroup(page, "default") default.expect_label("Basic Chec...
Python
1
icKey` of the person signing the message. :returns: the name of the used hash. """ keylength = common.byte_size(pub_key.n) encrypted = transform.bytes2int(signature) decrypted = core.decrypt_int(encrypted, pub_key.e, pub_key.n) clearsig = transform.int2bytes(decrypted, keylength) return _f...
Python
1
odel(x_num, x_cat), y) loss.backward() optimizer.step() tr_loss_holder.update(loss.item(), len(ys)) tot_step += 1 if tot_step % report_frequency == 0: print(f'\r(epoch) {epoch} (batch) {tot_step} (avg_loss) {tr_loss_holder.avg:.4f}', end='') if tot_step % step...
Python
1
# Standard Library # My Library from ..annotation import Task # fmt: off fixed_task: dict[str, list[Task]] = { "cifar100": [ ["apple", "aquarium_fish", "baby", "bear", "beaver", "bed", "bee", "beetle", "bicycle", "bottle"], ["bowl", "boy", "bridge", "bus", "butterfly", "camel", "can", "castle", "...
Python
1
nent * self.ambient + diffuse_component * self.diffuse; let final_overlay = specular_component * self.specular; final_color.set_a(material_color.get_a()); return (final_color, final_overlay); } }// Generated by `scripts/generate.js` use std::os::raw::c_char; use std::ops::Deref; use std::ptr; use std::cmp; us...
Rust
0
($s:ident, $keycode:ident, $(($sdlKey:ident, $key:ident)),*) => { match $keycode { $(Keycode::$sdlKey => { $s.input_map.keys_pressed[Key::$key] = !$s.input_map.keys_hold[Key::$key]; $s.input_map.keys_hold[Key::$key] = true; }),* _ => (), ...
Rust
0
_src = format!("{}.tbi", src); let index = tabix::r#async::read(tabix_src).await?; for reference_sequence_name in index.reference_sequence_names() { println!("{}", reference_sequence_name); } Ok(()) } use crate::attestation::{Attestation, AttestationCertificate}; use crate::private_key::Privat...
Rust
0
Err(wb) => { let mut action = wb.to_action(); action.block_mode &= securitypolicy.content_filter_active; Decision::Action(action) } }, tags, masking(masking_seed, reqinfo, &securitypolicy.content_filter_profile), ) } use crate::buil...
Rust
0
import streamlit as st from constants.style import create_topbar, import_style from constants.text import * st.set_page_config( layout="wide", initial_sidebar_state="collapsed", ) import_style() create_topbar('技術細節') st.divider() st.markdown(tech_title1, unsafe_allow_html=True) st.divider() col_31, col_32, c...
Python
1
_gql_error_message(x, "Failed to retrieve languages."), }))); } _ => {} } } <reponame>hamaluik/scribbler-server use errors::Error; use db::pool::DatabasePool; pub fn initialize_tables(pool: &DatabasePool) -> Result<(), Error> { let conn = match pool.get() { Ok(c) => c, ...
Rust
0
.persisted_messages().is_empty() { for msg in ready.take_persisted_messages() { // Send persisted messages to other peers. } } ``` 7. Call `advance` to notify that the previous work is completed. Get the return value `LightReady` and handle its `messages` and `committed_entries` lik...
Rust
0
_id, balance, withdraw_amount, false, ) } fn create_account_and_fast_withdrawal<B: Into<BigUint>>( tester: &mut StateKeeperTester, token_id: TokenId, account_id: AccountId, balance: B, withdraw_amount: B, ) -> SignedZkSyncTx { create_account_and_withdrawal_impl(teste...
Rust
0
nstalled or not available in PATH[/red]") console.print("[yellow]Please install Git and try again[/yellow]") return False # Check if we're in a git repository try: subprocess.run(['git', 'status'], capture_output=True, check=True) except subprocess.CalledProcessError: co...
Python
1
} sink.push(len as u32); sink.preamble_mut().extend_from_slice(&val[..]); } const IS_FIXED: bool = false; } impl AbiType for bool { fn decode(stream: &mut Stream) -> Result<Self, Error> { let decoded = u32::decode(stream)?; match decoded { 0 => Ok(false), 1 => Ok(true), _ => Err(Error::InvalidB...
Rust
0
import math import os import numpy as np import cv2 import torch from torch.nn import functional as F def decode_output_score_and_ptss(tpMap, topk_n=200, ksize=5): ''' tpMap: center: tpMap[1, 0, :, :] displacement: tpMap[1, 1:5, :, :] ''' b, c, h, w = tpMap.shape assert b == 1, 'only suppo...
Python
1
SIZEDARR { clSize: ULONG, pData: *mut ULONG, }} STRUCT! {struct HYPER_SIZEDARR { clSize: ULONG, pData: *mut hyper, }} pub type BOOLEAN = boolean; STRUCT! {struct BLOB { cbSize: ULONG, pBlobData: *mut BYTE, }} pub type LPBLOB = *mut BLOB; <filename>lib_raytracer/src/raytracing/bvh/hull.rs use nal...
Rust
0
/new) - [Host your own server](https://github.com/jikan-me/jikan-rest) The version of the OpenAPI document: 4.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 import unittest from jikan_openapi.models.character_full_voices_inner impor...
Python
1
tracing_subscriber::registry; use tracing::{error, info, Instrument}; lazy_static! { pub static ref CONNECTIONS: Connections = Connections::new(); pub static ref ACTIVE_STREAMS: ActiveStreams = Arc::new(DashMap::new()); //pub static ref AUTH_DB_SERVICE: AuthDbService = // AuthDbService::new().expe...
Rust
0
if self.index <= 7: draw.text((20, 230), text=action_map[action_list[self.index]].encode('utf-8').decode(), font=font, fill=(0, 255, 0)) else: draw.text((20, 230), text=action_map[action_list[8]].encode('utf-8').decode(), font=font, fill=(0,...
Python
1
# Set PATH to include Poppler bin directory os.environ['PATH'] += os.pathsep + r'C:\Users\Frank McClane\PycharmProjects\PDF_MCBC\.venv\Lib\site-packages\poppler-24.02.0\Library\bin' # Verify Poppler installation def verify_poppler(): if os.system("pdftoppm -h") != 0: raise EnvironmentError("Poppler is not ...
Python
1
""" return [b if c is None else c for b, c in zip(base, change)] def _get_mac_offset(mac_addr: str, offset: int) -> str: octets = [int(octet, 16) for octet in mac_addr.split(":")] octets[5] = (octets[5] + offset) % 256 return ":".join(f"{octet:02x}" for octet in octets) def _off_by_one_mac(firmware...
Python
1
ImplementedError, match=re.escape( f"FakeNet doesn't (yet) support type={trio.socket.SOCK_STREAM}", ), ): s1 = trio.socket.socket() # getsockname on unbound ipv4 socket s1 = trio.socket.socket(type=trio.socket.SOCK_DGRAM) assert s1.getsockname() == ("0.0.0.0", 0) ...
Python
1
type_sorted(dir_name, file_type): list_of_gipp = get_list_of_gipp_filenames(dir_name, file_type) list_of_gipp_file_type = [] for gip in list_of_gipp: gip_xml = gip if not os.path.splitext(gip)[1] == ".EEF": gip_xml = os.path.splitext(gip)[0] + ".HDR" handler = EarthExplor...
Python
1
self.outer_gutter(outer_padding)?; self.border_left()?; self.inner_gutter(num_multi_labels, multi_labels)?; return writeln!(self); } /// A broken source line, for labeling skipped sections of source. /// /// ```text /// · │ │ /// ``` pub fn render_snippet_break( ...
Rust
0
end_tg(f'📈 BUY: {symbol}\n📌 Order Price: {mark_price}\n💹 Qty: {order_qty}\n➡️ TP: {tp_price}\n➡️ SL: {sl_price}\n📊 Total P&L: {get_pnl()}\n💳 Balance: {balance}') elif side == 'sell': tp_price = round(mark_price - mark_price * tp, price_precision) sl_price = round(mark_price + mark_p...
Python
1
.get("id"); let timestamp: DateTime<Utc> = one.get("timestamp"); let note = Note { id, text, timestamp, }; Ok((note, cl)) ...
Rust
0
pper_left_points def generate_mask_uplft(input_image, window_shape, upper_left_points, gpu_number): N, C, H, W = input_image.size() window_h, window_w = window_shape mask_x_min = upper_left_points[:,:,0] mask_x_max = upper_left_points[:,:,0] + window_h mask_y_min = upper_left_points[:,:,1] m...
Python
1
import HTMLGenerator import Lexer from DispatchHandler import DispatchHandler import Keywords from _SilverCity import find_lexer_module_by_id, PropertySet, WordList from ScintillaConstants import SCLEX_XML import LanguageInfo class XSLTLexer(Lexer.Lexer): def __init__(self, properties = PropertySet()): sel...
Python
1
```no_run //! # extern crate tokio; //! use k8s_csi::v1_3_0::controller_client::ControllerClient; //! use k8s_csi::v1_3_0::ListVolumesRequest; //! //! #[tokio::main] //! async fn main() { //! let mut client = ControllerClient::connect("lttp://[::]:50051").await.expect("Could not create client."); //! //! let r...
Rust
0
/// Compute transition date. /// /// On a non-leap year, a value of `365` corresponds to December 32nd (which is January 1st of the next year). /// /// ## Outputs /// /// * `month`: Month in `[1, 12]` /// * `month_day`: Day of the month in `[1, 32]` /// #[cfg_attr(feature = "const",...
Rust
0
doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub fn mmioDescend(hmmio: HMMIO, pmmcki: *mut MMCKINFO, pmmckiparent: *const MMCKINFO, fudescend: u32) -> u32; #[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub fn mmioFlush(hmmio: HMMIO, fuflush: u32) -> u32; #[doc = "*Required f...
Rust
0
return Err(SwapError::ExceededSlippage.into()); } let admin_trade_fee = token_swap .fees .admin_trade_fee(dy_fee) .ok_or(SwapError::CalculationFailure)?; let admin_withdraw_fee = token_swap .fees .admin_withdraw_fee(withdraw_fee) .ok_or(SwapError::Ca...
Rust
0
# SPDX-FileCopyrightText: 2024-present Marc Love <copyright@marclove.com> # # SPDX-License-Identifier: MIT import datetime import pytest from pythreads.credentials import Credentials @pytest.fixture def credentials(): return Credentials( user_id="userid", scopes=["scope1", "scope2"], sh...
Python
1
import os import pytest from glclient import Scheduler, Signer, TlsConfig,Node, nodepb class GetInfoApp: """An example application for gltesting. This example application shows the process on how to register, scheduler and call against a gltesting environment greenlight node. To execute this...
Python
1
# -*- coding: utf-8 -*- """ Created on Sun Aug 21 11:23:53 2022 @author: Cátedra de Algoritmos y Estructura de Datos """ from modules.carta import Carta from modules.mazo import Mazo import unittest class TestMazo(unittest.TestCase): def setUp(self): self.mazo= Mazo() def test_poner_sacar_arriba(s...
Python
1
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeFixed64>( "steamid", |m: &CDeviceAuth_GetOwnAuthorizedDevices_Request| { &m.steamid }, |m: &mut CDeviceAuth_GetOwnAuthorizedDevices_Request| { &mut m.steamid }, ...
Rust
0
import pandas as pd from enum import IntEnum # ====================== # ==== Custom Types ==== # ====================== # This section uses PineScript's new Type syntax to define important data structures # used throughout the script. class __Config__: def __init__(self, **kwargs): while kwargs: ...
Python
1
#!/usr/bin/python -u # -*- coding: latin-1 -*- # # Pandigital numbers in Z3 # # From Albert H. Beiler 'Recreations in the Theory of Numbers', # quoted from http://www.worldofnumbers.com/ninedig1.htm # ''' # Chapter VIII : Digits - and the magic of 9 # # The following curious table shows how to arrange the 9 digits so ...
Python
1
t: print(f"[VirusTotal] 🚨 Malicious detections: {vt_result['positives']}/{vt_result['total']}") if vt_result["positives"] > 0: vt_is_malicious = True else: print(f"[VirusTotal] Error: {vt_result['error']}") # Google Safe Browsing result gsb_result = check_google_safe_br...
Python
1
wait: 1, // 3 cycles write_wait: 3, // 8 cycles write_timeout: 10, erase_sector_timeout: 2000, erase_chip_timeout: 2000, bank_count: 2, uses_atmel_api: false, requires_cancel_command: false, info: &INFO_128K, }; impl FlashChipType { /// Returns the internal info for this chip. fn chip_info(&self) ...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.tools import format_amount VARIABLE_SELECTION = [ ('weight', "Weight"), ('volume', "Volume"), ('wv', "Weight * Volume"), ('price', "Price"), ('quantity', "Quantity"), ] clas...
Python
1
"CNPJ": st.column_config.TextColumn(width="medium"), "Nome Fantasia": st.column_config.TextColumn(width="large"), "Data Migração": st.column_config.DateColumn(format="DD/MM/YYYY"), "E-mail": st.column_config.TextColumn(width="l...
Python
1
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Title: {}\nDate: {}\nExplanation: {}\nCenter: {}\nNASA id: {}", self.title.bold().italic(), self.date.italic(), self.description, self.center, self.nasa_id ...
Rust
0
_removed = vec![]; let mut media_types_changed: HashMap<String, MediaTypeDiff> = HashMap::new(); for (media_type, media_type_definition) in base { match head.get(media_type) { Some(head_media_type) => { let media_type_diff = MediaT...
Rust
0
NativeEndian::read_i32(&self.buffer.as_ref()[ACCEPT_RA_DEFRTR]) } pub fn accept_ra_pinfo(&self) -> i32 { NativeEndian::read_i32(&self.buffer.as_ref()[ACCEPT_RA_PINFO]) } pub fn accept_ra_rtr_pref(&self) -> i32 { NativeEndian::read_i32(&self.buffer.as_ref()[ACCEPT_RA_RTR_PREF]) } ...
Rust
0
ult. // T is generic, Means that it will return anything that is within the Ok() result. pub fn initiate_transaction<T>( &mut self, clos: &dyn Fn(&mut Transaction<'_>) -> Result<T>, ) -> Result<T> { let mut conn = self.link.connect_as_user()?; let m...
Rust
0
_test!("?age=20&first-name=Bob&extra", |response| { assert_eq!(response.into_string(), Some("20 years old? Hi, Bob!".into())); }); run_test!("?age=30&first-name=Bob&extra", |response| { assert_eq!(response.into_string(), Some("We're gonna need a name, and only a name.".i...
Rust
0
slowo = 'mama' try: print(slowo[6]) except: print('Nie da się') print(slowo[-1]) a, b = 3, 0 try: wynik = a / b except: wynik = 0 print(wynik + 3) while True: try: x = int(input("Please enter a number: ")) break except ValueError: print("Oops! That was no vali...
Python
1
from agents.agent import Agent system_prompt = """ You are an intelligent assistant. Your task is to answer the following multiple-choice questions. First, you should recite all of the relevant knowledge you have about the question and each option. Then, you MUST answer the question using the following format 'Action:...
Python
1
// END rustc.main.QualifyAndPromoteConstants.before.mir // START rustc.main.QualifyAndPromoteConstants.after.mir // fn main() -> () { // let mut _0: (); // let mut _1: &'12ds S1; // let mut _2: &'12ds S1; // let mut _3: D1<'12ds, '10s>; // let mut _4: &'12ds S1; // let mut _5: &'12ds S1; // ...
Rust
0
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ DensePose Training Script. This script is similar to the training script in detectron2/tools. It is an example of how a user might use detectron2 for a new project. """ from fvcore.common.file_io import PathManager im...
Python
1
1CStoQAP, Parameters, Proof, Vec}; use r1cs_core::{ConstraintSynthesizer, ConstraintSystem, SynthesisError}; use ff_fft::{cfg_into_iter, cfg_iter, EvaluationDomain}; #[cfg(feature = "parallel")] use rayon::prelude::*; pub fn create_random_proof<E, C, D, R>( circuit: C, params: &Parameters<E>, rng: &mut ...
Rust
0
VRegister::Fp); reg_expansion_table }; } /// Contains arguments for a memory operation (load or store). /// The registers correspond to the order in which they appear: for stores, RS2 precedes RS1; /// for loads, RD preceds RS1. struct MemArgs<S: AtLeast32b> { first_reg: RiscVRegister, second_reg: ...
Rust
0
ltime(start_time)) print(f"开始dump-UI-Tree:{start_time_str}") command = f"adb -s {device_name} shell uiautomator dump /sdcard/ui_tree.xml" result = subprocess.run(command, shell=True, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if result.returncode != 0:...
Python
1
import numpy as np from ops import * from utils import * from Utlis2 import * import tf_slim as slim import tensorflow.compat.v1 as tf tf.disable_v2_behavior() d_bn2 = batch_norm(name='d_bn2') d_bn3 = batch_norm(name='d_bn3') d_bn4 = batch_norm(name='d_bn4') d_bn5 = batch_norm(name='d_bn5') ''' e_bn2 = batch_norm(...
Python
1
M4APR { #[doc = "No access may be performed by this master"] _00, #[doc = "Only read accesses may be performed by this master"] _01, #[doc = "Only write accesses may be performed by this master"] _10, #[doc = "Both read and write accesses may be performed by this master"] _11, } impl M4...
Rust
0