text
string
label_name
string
labels
int64
schema != other.schema { return false; } if self.tagged_ptr == other.tagged_ptr { return true; } let num_columns = self.schema.columns().len(); unsafe { // Check the is-set bitmap (if this is a partial row). if self.is_partial_ro...
Rust
0
""" 将多行空行变成单行空行 """ import re import pytest def remove_extra_newlines(content): """ 将文本内容中的多余空行去除,保留一个空行。 Args: content (str): 待处理的文本内容。 Returns: str: 处理后的文本内容,多余的空行被替换为一个空行。 """ # 表达式参考 cf: line 24 in https://github.com/platers/obsidian-linter/blob/master/src/ru...
Python
1
ActivityTaskCompletedEventAttributes { scheduled_event_id, started_event_id, ..Default::default() }, ), ); t.add_workflow_task_started(); t.add_workflow_task_timed_out(); t.add_full_wf_task(); t.add_workflow_execution_completed();...
Rust
0
} #[test] fn test_option() { #[derive(Serialize)] struct Test { int32: i32, option_int32: Option<i32>, } let test = Test { int32: 1, option_int32: Some(1), }; let expected = "INT32=1\nOPTION_INT32=1\n"; ...
Rust
0
aps = [chunk_overlap1, chunk_overlap2, chunk_overlap3] # Load the document data_docs = load_document(file_path) # Get the user's query user_query = st.text_input("Your Question:") if st.button("Submit"): # Create vector stores and retrievers retrievers = create_vector_store(da...
Python
1
ent, position, endTime, level=None, team=None): if equipment.name != 'comp7_recon': return radius = equipment.radius[level - 1] duration = equipment.duration[level - 1] delay = equipment.delay matrix = Math.Matrix() matrix.setTranslate(position) arenaB...
Python
1
class TreeNode(object): def __init__(self, value, left_child=None, right_child=None): self.value = value self.left_child = left_child self.right_child = right_child """ 题目一:二叉树深度 """ def tree_depth(root): if not isinstance(root, TreeNode): return 0 n_left = tree_depth(ro...
Python
1
_SQL_MAPPING } #[no_mangle] #[doc(hidden)] pub extern "C" fn __pgx_source_only_sql_mappings( ) -> &'static ::pgx::utils::__reexports::std::collections::HashSet< ::pgx::utils::sql_entity_graph::RustSourceOnlySqlMapping, > { &::pgx::DEFAULT_SOURCE_O...
Rust
0
xt(net) def test_lstm(): net, _ = tvm.relay.testing.lstm.get_workload(1, 1) astext(net) net, _ = tvm.relay.testing.lstm.get_workload(4, 4) astext(net) def test_inception_v3(): net, _ = tvm.relay.testing.inception_v3.get_workload(batch_size=1) astext(net) def test_squeezenet(): for ver...
Python
1
et2, downsample) in enumerate(self.down_modules): x = resnet(x, global_feature) if idx == 0 and len(h_local) > 0: x = x + h_local[0] x = resnet2(x, global_feature) h.append(x) x = downsample(x) for mid_module in self.mid_modules: ...
Python
1
e to wherever it is pointing) fn flush(&mut self); /// Attempt to access an underlying buffer for mmap fn get_buffer(&self) -> Option<*mut u8>; }//! The Glyph Substitution Table. use alloc::vec::Vec; use crate::glyph_set::GlyphSet; use super::gsubgpos::*; use super::*; #[derive(Clone, Debug)] pub struct...
Rust
0
let result = &msg["body"]["result"]; let typ = &msg["body"]["type"]; //Send it to Kakoune for processing let mut cmd = "dap-evaluate-response ".to_string(); cmd.push_str(&result.to_string()); cmd.push_str(" "); cmd.push_str(&typ.to_string()); kakoune::kak_command(cmd, &ctx); } use std::...
Rust
0
: 0x24, status: StatusFlags::default(), } } } bitflags! { /// Status register /// /// 7 6 5 4 3 2 1 0 /// N V _ B D I Z C /// | | | | | | +--- Carry Flag /// | | | | | +----- Zero Flag /// | | | | +------- Interrupt Disable /// | | | +--------- Deci...
Rust
0
{MOCK_TX_HASH}" in result def test_deploy_token_error(mock_wallet): """Test token deployment error handling.""" provider = cdp_wallet_action_provider() error_message = "Token deployment failed" mock_wallet.deploy_token.side_effect = Exception(error_message) args = { "name": MOCK_NFT_NAME...
Python
1
Regex::new(r"\{[[:space:]]*[^{}]*[[:space:]]*\}").unwrap(); static ref FIELD_NAMED: Regex = Regex::new(r"^\{[[:space:]]*(?P<name>[[:word:]]*)[[:space:]]*\}$").unwrap(); static ref FIELD_SINGLE: Regex = Regex::new(r"^\{[[:space:]]*(?P<num>-?\d+)[[:space:]]*\}$").unwrap(); static ref FIELD_RANGE: Regex = Reg...
Rust
0
# This is a sample Python script. # Press Maj+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. # Write # a # program # that # repeatedly # prompts # a # user # for integer numbers until the user enters 'done'.Once 'done...
Python
1
import weakref import pytest # downloading lora to test lora requests from huggingface_hub import snapshot_download from aphrodite import LLM from aphrodite.distributed import cleanup_dist_env_and_memory from aphrodite.lora.request import LoRARequest MODEL_NAME = "HuggingFaceH4/zephyr-7b-beta" PROMPTS = [ "Hell...
Python
1
TextEdit>> { if let Some(edits) = get_workspace_edit_changes_edits(url, workspace_edit) { Some(edits) } else { get_workspace_edit_document_changes_edits(url, workspace_edit) } } fn get_workspace_edit_changes_edits<'a>( url: &Url, workspace_edit: &'a WorkspaceEdit, ) -> Option<Vec<&...
Rust
0
anner.\n" "3. Proofread for grammatical errors and " "alignment with the brand's voice.\n" "3. Limit the document to only 200 words " "4. Use impressive images and charts to reinforce your insights " ), expected_output="A well-written Document " "providing insights ...
Python
1
agnitude_bins = num_magnitude_bins self.interpolation = interpolation self.fill = fill def _augmentation_space(self, num_bins: int) -> Dict[str, Tuple[Tensor, bool]]: return { # op_name: (magnitudes, signed) "Identity": (torch.tensor(0.0), False), "ShearX...
Python
1
luster where this pool was created #[serde(rename = "birth_cluster_id")] pub birth_cluster_id: Option<String>, /// A brief description of this pool #[serde(rename = "description")] pub description: Option<String>, /// A unique name for this pool #[serde(rename = "name")] pub name: Option...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class TrackVisitor(models.Model): """ Table linking track and visitors. """ _name = 'event.track.visitor' _description = 'Track / Visitor Link' _table = 'event_track...
Python
1
a d{@sZddlZddlZddlZddlZddlTddlmZGdddejZe dkrVe dS)N)*) find_libraryc@s.eZdZddZeejdkdddZdS)Testcstddurtdtdd}tjdkr8|j}n|j}tt f...
Python
1
import os # # OPTIONS ARE SET BY USER IN THIS FILE AS INDICATED BELOW BY: # # # RUN IDENTIFICATION # DEFINES A SUBDIRECTORY TO METRICS OUTPUT RESULTS SO MULTIPLE CASES CAN # BE COMPARED case_id = 'nosftlfTest' # LIST OF MODEL VERSIONS TO BE TESTED - WHICH ARE EXPECTED TO BE PART OF # CLIMATOLOGY FILENAME test_data_...
Python
1
from pydantic import BaseModel, ConfigDict, Field from ..core import QIsabelleSession class IsabelleSuccessResult(BaseModel): """Successful Isabelle command execution result""" success: bool = True is_done: bool result: str state_name: str class IsabelleErrorResult(BaseModel): """Failed Is...
Python
1
curves(True) r1.draw() linecolor('aqua') filled_curves(False) l1.draw() hardcopy() display() # show the plot def rolling_wheel(total_rotation_angle): """Animation of a rotating wheel.""" set_coordinate_system(xmin=0, xmax=10, ymin=0, ymax=10) import time center = (6,2) rad...
Python
1
PortfolioColumn>, pub sort_order: Option<SortOrder>, pub market_session: Option<MarketSession>, pub totals_required: Option<bool>, pub lots_required: Option<bool>, pub view: Option<PortfolioView>, } #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase", default)] pub struct Balance...
Rust
0
'context'][i].tolist() post_str = vocab.ids2string_wo_eos(post_str) resp_str = data['resp'][i].tolist()[1:] resp_str = vocab.ids2string_wo_eos(resp_str) pred_strs = [] for j in prediction[i]: pred...
Python
1
import json import pandas from environments.toy_env import ToyEnv from policies.toy_env_policies import ThresholdPolicy from utils.policy_evaluation import evaluate_policy def main(config): s_threshold = config["s_threshold"] gamma = config["gamma"] results = [] for adversarial_lambda in config["adve...
Python
1
""" ------------------------------------------------------- [program description] ------------------------------------------------------- Author: Benjamin Schmid ID: 169042790 Email: schm2790@mylaurier.ca __updated__ = "2023-03-03" ------------------------------------------------------- """ # Imports from List_...
Python
1
le = os.path.join(TMP, 'modified_model.caffemodel') scale_offset_record_file = os.path.join(TMP, 'record.txt') amct_caffe.create_quant_retrain_model( args.model_file, args.weights_file, config_file, modified_model_file, modified_weights_file, scale_offset_record_file) # Retrain the model. ...
Python
1
x_struct_meta! { vertex_struct_meta $root { $( $field : $ty = $name, )* } }) } #[macro_export] macro_rules! gfx_vertex_struct_meta { ($(#[$attr:meta])* vertex_struct_meta $root:ident { $( $field:ident: $ty:ty = $name:expr, )* }) => (gfx_impl_struct_meta!{ $(#[$at...
Rust
0
{ let pos = self.current_row.get() * self.cols.len() + led; if (bits[pos / 8] >> (pos % 8)) & 0x1 == 1 { self.col_set(self.cols[led]); } else { self.col_clear(self.cols[led]); } } }); self...
Rust
0
&'a mut W, } impl<'a> USB_PRODUCT_ID_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); self.w } } impl R { #[doc = "Bits 0:15 - ."] ...
Rust
0
, equip_type: EquipType) -> ArtifactPosition: if equip_type == EquipType.Flower: return ArtifactPosition.FLOWER if equip_type == EquipType.Feather: return ArtifactPosition.PLUME if equip_type == EquipType.Sands: return ArtifactPosition.SANDS if equip_t...
Python
1
let legend = cell.legend(); let kind = format!("{:?}", cell.kind); assert!( legend.contains(&kind), "Legend '{}' does not contain kind '{}'", legend, kind ); } ...
Rust
0
#사용자에게 수학점수를 입력받아 상/중/하반으로 분류하기 # 상 - 90이상 # 중 - 70이상 # 하 - 나머지 size = int(input("수학 점수 입력")) print(size) if size >= 90 and size <= 100: print("상") elif size >= 70 and size < 90: print("중") elif size >= 0 and size < 70: print("하") else: print("잘못된 점수입니다.")
Python
1
!(_xmlSchemaAttributeGroup), // "::", // stringify!(flags) // ) // ); // assert_eq!( // unsafe { // &(*(::std::ptr::null::<_xmlSchemaAttributeGroup>())).attributeWildcard as *const _ as usize // }, // 80usize, // concat!( // "Offset of field: ", // stringify!(_xmlSc...
Rust
0
line.as_bytes()[j..=i]); prev_b = None; } (None, b'e' | b'w') => path.push(&line.as_bytes()[i..i + 1]), (None, b's' | b'n') => prev_b = Some(i), _ => continue, } } paths.push(path); } paths } pub fn ...
Rust
0
tch args.next() { Some(arg) => arg, None => return Err("Token not provided"), }; let server = match args.next() { Some(arg) => arg, None => { let server = "blynk-cloud.com"; info!("No server name provided, using default ({}...
Rust
0
test_model_kwargs['inpaint_image'] = z_inpaint test_model_kwargs['inpaint_mask'] = Resize( [z_inpaint.shape[-2], z_inpaint.shape[-1]])( test_model_kwargs['inpaint_mask']) shape = [4, 512 // 8, 512 // 8] samples_dd...
Python
1
")] pub fn CertAddCTLLinkToStore(hcertstore: HCERTSTORE, pctlcontext: *const CTL_CONTEXT, dwadddisposition: u32, ppstorecontext: *mut *mut CTL_CONTEXT) -> super::super::Foundation::BOOL; #[doc = "*Required features: `\"Win32_Security_Cryptography\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundati...
Rust
0
mut f64, t); _mm_storeh_pd(out1_ptr as *mut f64, t); t = _mm_castsi128_pd(_mm256_extracti128_si256(s[i],1)); let out2_ptr = out[2].coeffs[idx+8*i..].as_mut_ptr(); let out3_ptr = out[3].coeffs[idx+8*i..].as_mut_ptr(); _mm_storel_pd(out2_ptr as *mut f64, t); _mm_storeh_pd(out3_p...
Rust
0
h[7] = h7 as i32; h[8] = h8 as i32; h[9] = h9 as i32; } pub(crate) fn inverse(&self) -> Self { let mut inv = Self::default(); fe_invert!(&mut inv, self); inv } fn invert(&mut self) { fe_invert!(self, self); } pub(crate) fn assign_product(&mut se...
Rust
0
ate=0.01, start_time=start_time, end_time=end_time, duration=duration, first_constrain=first_constrain, second_constrain=second_constrain ) response_data = [ { 'unit_name': s[0][0], 'unit_code': s[0][1], ...
Python
1
return Err(Error::Common(format!("Spec.solaris is not supported: {:?}", spec))) } if spec.windows.is_some() { return Err(Error::Common(format!("Spec.windows is not supported: {:?}", spec))) } if spec.process.selinux_label.len() > 0 { return Err(Error::Common(format!("SELinux is not sup...
Rust
0
# Dictionaries are used to store data values in key:value pairs. # A dictionary is a collection which is ordered*, changeable and do not allow duplicates. # As of Python version 3.7, dictionaries are ordered. # In Python 3.6 and earlier, dictionaries are unordered. my_dist = { "name" : "Rahul", "age" : 23, ...
Python
1
# Даны средние значения температур за каждый месяц в году. # Найти минимальное и максимальное значения температур за год. # Вывести значения температур по временам года. # Средние значения температур по месяцам (в порядке от января до декабря) temperatures = [-5.2, -3.0, 2.5, 9.3, 15.2, 20.1, 22.3, 21.8, 16.4, 9.0, 2...
Python
1
()); let read_output = if args.binary { read_output_bytes } else { read_output_lines }; let mut predictor = Predictor::new( table, [ read_output(&mut stdin)?, read_output(&mut stdin)?, read_output(&mut stdin)?, read_output...
Rust
0
_DS_CONFLICT: u32 = 20041u32; #[doc = "*Required features: 'Win32_NetworkManagement_Dhcp'*"] pub const ERROR_DHCP_ROGUE_DS_UNREACHABLE: u32 = 20040u32; #[doc = "*Required features: 'Win32_NetworkManagement_Dhcp'*"] pub const ERROR_DHCP_ROGUE_INIT_FAILED: u32 = 20037u32; #[doc = "*Required features: 'Win32_NetworkManage...
Rust
0
re): """查询合约交易权限""" _fields_ = [ ("BrokerID", TThostFtdcBrokerIDType), ("InvestorID", TThostFtdcInvestorIDType), ("reserve1", TThostFtdcOldInstrumentIDType), ("InstrumentID", TThostFtdcInstrumentIDType), ] def getBrokerID(self): '''经纪公司代码''' retu...
Python
1
"""delete cascade for role and user Revision ID: 8e1e76238fa3 Revises: 7546d8736a7a Create Date: 2025-09-01 21:08:56.805165 """ from typing import Sequence, Union from alembic import op # revision identifiers, used by Alembic. revision: str = "8e1e76238fa3" down_revision: Union[str, Sequence[str], None] = "7546d87...
Python
1
; assert_eq!(result, expected); } /// Pushing an item to the front of the list, then popping an item from the front /// of a list, should yield the original item pushed to the front of them list. #[test] fn test_push_front_pop_front() { let mut set = LinkedListSet::new(); let list_index = set.new_list(); ...
Rust
0
n, }); let categories: Vec<&String> = series[0].data.iter().map(|point| &point.label).collect(); let box_group_width = (chart_rect.w - chart_config.bar_group_gap * (categories.len() + 1).to_f64().unwrap()) / categories.len().to_f64().unwrap(); // Draw the X axis labels. if options.should_draw_x_axis_labels.u...
Rust
0
"""Bodymiscale entity module.""" from homeassistant.const import CONF_NAME from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.entity import UNDEFINED, Entity, EntityDescription from .const import DOMAIN, VERSION from .metrics import BodyScaleMetricsHandler class...
Python
1
head_ratio} \\\\\n" # Use calculated overhead ratio else: print(f"Warning: Data for message size 1024 not found for scheme {scheme_name}. Skipping in overhead table.") overhead_table += """\\bottomrule \\end{tabular} \\end{table} """ # Save tables results_dir = Pa...
Python
1
attr(self, key, TJ(key)[:n_frame]) class trajectory(TRAJ_BASE): pass # def init_track(self, key, first_content): # content = first_content # self.check_type_shape(key, first_content) # assert isinstance(content, np.ndarray) or isinstance(content, np.ScalarType), (key, content.__class__)...
Python
1
pending_requests.pop(user, None) def server() -> None: ''' Main process that receives client's connections and starts a new thread to handle their messages ''' LISTENING_PORT = 12000 try: socket_instance = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socke...
Python
1
.iter_mut() { if board_value.value == value { board_value.marked = true; } } } } fn complete(&self) -> bool { // Check for completed columns. for i in 0..BOARD_SIZE { if self.values.iter().map(|c| c[i]).all(|bv|...
Rust
0
Ok(None) } else { s.parse().map(Some).map_err(ParseError::InvalidFrame) } } fn parse_attributes(s: &str) -> Result<Attributes, ParseError> { s.parse().map_err(ParseError::InvalidAttributes) } #[cfg(test)] mod tests { use attributes::Entry; use super::*; #[test] fn test_fmt() { ...
Rust
0
) @ddt.data(({}, None, None), ({'pref-lang': 'en', 'time_zone': 'America/Los_Angeles'}, 'America/Los_Angeles', 'en')) @ddt.unpack def test_get_user_preferences(self, user_preferences, expected_timezone, expected_language): """Verify get_user_preferences returns correct time zone and...
Python
1
output for v in range(1, num_vertices - 1): if matrix[v, num_vertices - 1]: vertex_channels[v] = interior_channels if correction: vertex_channels[v] += 1 correction -= 1 # Set channels for all other vertices to the max of the out edges, going # backward...
Python
1
from fastapi import APIRouter, Depends from like.admin.schemas.channel import ( ChannelOaIn, ChannelOaMenusIn, ChannelH5In, ChannelMpIn, ChannelWxIn, ChannelOaReplyDefaultDetailIn, ChannelOaReplyDefaultCreateIn, ChannelOaReplyDefaultEditIn, ChannelOaReplyDefaultDelIn, ChannelOaReplyDefaultStatusIn, Channel...
Python
1
ite!(f, "DV 50"), AvidEssenceType::DV100 => write!(f, "DV 100"), AvidEssenceType::MJpeg_20_1 => write!(f, "20:1"), AvidEssenceType::MJpeg_2_1S => write!(f, "2:1s"), AvidEssenceType::MJpeg_4_1S => write!(f, "4:1s"), AvidEssenceType::MJpeg_15_1S => write!(f, "15...
Rust
0
} } #[doc = "Field `ICACHE_PRELOCK_SCT1_ADDR` reader - The bits are used to configure the second start virtual address of data prelock, which is combined with ICACHE_PRELOCK_SCT1_SIZE_REG"] pub struct ICACHE_PRELOCK_SCT1_ADDR_R(crate::FieldReader<u32, u32>); impl ICACHE_PRELOCK_SCT1_ADDR_R { #[inline(always)] ...
Rust
0
import qt import slicer # ============================================================================= # # _ui_DirectoryListWidget # # ============================================================================= class _ui_DirectoryListWidget: # ------------------------------------------------------------------...
Python
1
pair); t.mul(&pair); } t.inverse(); s.mul(&t); pair = pair::ate(&g2, &g1); pair = pair::fexp(&pair); //dlog let mut result_bound = BigNum::fromstring(bound.to_str_radix(16)); result_bound = result_bound.powmod(&BigNum::new_int(2), &CURVE_ORDE...
Rust
0
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' AUTH_USER_MODEL = 'account.User' REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_simplejwt.authentication.JWTAuthentication', ), 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE...
Python
1
, PathStep}; pub struct BusNetwork { composite: Composite, unzoomed: Drawable, zoomed: Drawable, show_all_routes: bool, } impl Layer for BusNetwork { fn name(&self) -> Option<&'static str> { Some("bus network") } fn event( &mut self, ctx: &mut EventCtx, app:...
Rust
0
Kind), #[error("The core did not acknowledge a request for reset, resume or halt")] RequestNotAcknowledged, #[error("The version '{0}' of the debug transport module (DTM) is currently not supported.")] UnsupportedDebugTransportModuleVersion(u8), #[error("The version '{0:?}' of the debug module is cu...
Rust
0
import logging import pandas as pd from srdatasets.datasets.dataset import Dataset from srdatasets.datasets.utils import extract logger = logging.getLogger(__name__) class Taobao(Dataset): __corefile__ = "UserBehavior.csv" def download(self): if not self.rootdir.joinpath("UserBehavior.csv.zip").e...
Python
1
t(ERR_FINALIZED); let depth = self.depth; if depth == 1 { inner.execute("COMMIT").await?; } else { let stmt = format!("RELEASE SAVEPOINT _sqlx_savepoint_{}", depth - 1); inner.execute(&*stmt).await?; } Ok(inner) } pub async fn rollb...
Rust
0
e. The `boundary_prob` value indicates the probability of choosing a boundary value, i.e. `[0, 1, PRIME-1, PRIME]` or `[0, 1, PRIME-1]` if `exclude_prime` is `True`. The `small_upper_bound_prob` value indicates the probability of choosing a small integer, i.e. from the domain `[0 - 10]`. """ pr...
Python
1
et Some(ref s) = s { (x.clone(), s) } else { panic!() } }), None => None, }; // Issue #7820 unsafe fn f(x: u32) -> u32 { x } unsafe { let _ = match Some(0) { Some(x) => Some(f(x)), None => None, }; } let _ = match Some(0) { ...
Rust
0
elf.assertEqual(values[0]['terms'][0]['display_name'], 'Square') self.assertEqual(values[0]['terms'][1]['display_name'], 'Triangle') self.assertEqual(values[1]['terms'][0]['display_name'], 'Red') def test_dehydrate(self): res = SherdNoteResource() request = RequestFactory().get('/?c...
Python
1
def tokenize_prompt(prompt, neg_prompt): prompt_ids = pipeline.prepare_inputs(prompt) neg_prompt_ids = pipeline.prepare_inputs(neg_prompt) return prompt_ids, neg_prompt_ids
Python
1
romeDriver...") try: response = requests.get(url) if response.status_code != 200: print(f"下载失败,状态码: {response.status_code}") return False # 解压ZIP文件 print("下载完成,正在解压...") with zipfile.ZipFile(BytesIO(response.content)) as zip_file: ...
Python
1
"""Task-related CLI helpers.""" from __future__ import annotations import json import os import typer from dotenv import load_dotenv from rich.panel import Panel from skyvern.client import Skyvern from skyvern.config import settings from skyvern.utils.env_paths import resolve_backend_env_path from .console import ...
Python
1
ith::*; pub use super::ext::boolean::*; pub use super::ext::complex::*; pub use super::ext::error::*; pub use super::ext::memory::*; pub use super::ext::print::*; pub use super::ext::random::*; pub use super::ext::utils::*; pub use super::ext::rs::*; #[link(name = "R")] extern { pub fn R_FlushConsole() -> (); ...
Rust
0
item in params.get("Usages"): obj = UsageDataItem() obj._deserialize(item) self._Usages.append(obj) self._RequestId = params.get("RequestId") class DescribeTIWRoomDailyUsageRequest(AbstractModel): """DescribeTIWRoomDailyUsage请求参数结构体 """ def __init...
Python
1
""" Fatiamento de strings 012345678 Olá mundo -987654321 Fatiamento [i:f:p] [::] Obs.: a função len retorna a qtd de caracteres da str """ variavel = 'Olá mundo' print(variavel[0:len(variavel):2]) print(len(variavel)) print(variavel[::-1])
Python
1
=> 0 | (B, C, A) => 1 | (_, _, B) => 3 | (_, _, A) => 4 "#, ); } #[test] fn list_missing_nil() { check( r#" fun f xs = case xs of (** ^^ non-exhaustive match: missing [] *) _ :: _ => 0 "#, ); } #[test] fn list_missing_cons() { check( r#" fun f xs = case xs of (** ^^ non-exhaustive ...
Rust
0
r_model().objects.get(email=email) if user.login_type != "DEFAULT": return std_response( message="비밀번호 변경은 일반 로그인(DEFAULT) 사용자만 가능합니다. 소셜 로그인 사용자는 비밀번호를 변경할 수 없습니다.", status="fail", error_code="SERVER_FAIL", status_code=status.HTTP_403_FORBIDDEN )...
Python
1
time"].value > (self.ptz_metrics[camera_name]["ptz_start_time"].value + 10) and self.ptz_metrics[camera_name]["ptz_stop_time"].value == 0 ): logger.debug( f'Start time: {self.ptz_metrics[camera_name]["ptz_start_time"].value}, Stop time: {self.ptz_metrics[camer...
Python
1
1000+ecx*4]` // it should probably be solved via emulation. // see analysis/pe/pointers.rs for some experiments looking at pointer tables. Ok(smallvec![]) } else { if let Ok(Some(dst)) = dis::get_operand_xref(module, va, insn, op) { if is_executable(module, dst) { ...
Rust
0
= None keys: Annotated[list[str] | None, Field()] = None sort_keys: Annotated[list[str] | None, Field()] = None is_cdisc_std: Annotated[bool, Field()] source_ig: Annotated[ str | None, Field( description="Source Implementation Guide, e.g. SDTMIG 3.3 or TAUG-DIABETES 1.0", ...
Python
1
(every 8 dots across the scanline until // 256). Across the scanline the effective coarse X scroll // coordinate is incremented repeatedly, which will also wrap to // the next nametable appropriately. // Coarse X increment if ppu.vram_address & 0x001F == 0x001F { ppu.vram_address &= !0x001F...
Rust
0
import sys import syslog # Requires a Python snapshot circa 0.15.N-r15585 from _fbink import ffi, lib as fbink # ------- Logging & user feedback (from the K5 Fonts Hack) LIBRARIAN_SYNC = "LibrarianSync" # Setup FBInk to our liking... FBINK_CFG = ffi.new("FBInkConfig *") FBINK_CFG.is_quiet = True FBINK_CFG.is_padded ...
Python
1
); assert_impl_all!( RotatingIpDetails: Clone, Debug, Deserialize<'static>, Eq, PartialEq, Serialize ); assert_impl_all!( RotatingIpRoutePlanner: Clone, Debug, Deserialize<'static>, Eq, PartialEq, Serialize ...
Rust
0
// HTTP-POST call \n var method = \"POST\";\n var queryParams = \"\";"); if f.is_attribute_present("path") { str.push_str(" \n var path = self.url + \""); str.push_str(&f.get_attribute_value("path")); str.push_str("\";"); } else { str.push_str("\n var path = self.url;"); }...
Rust
0
40usize, concat!( "Offset of field: ", stringify!(nk_convert_config), "::", stringify!(vertex_layout) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<nk_convert_config>())).vertex_size as *const _ as usize }, 48usize, ...
Rust
0
::new(); let data_provider = test_group_set_registry(subnet_test_id(0), node_port_allocation); let (tls_pubkey, _p_key) = generate_tls_keys(COMMON_NAME, NOT_AFTER); // Use a single tls cert for all Nodes. This is a stress test // and we don't want to generate thousands of unique certs ...
Rust
0
Self { base: BaseFilter::new(radius), } } } impl Filter for BoxFilter { impl_base_filter!(); fn evaluate(&self, _p: &Point2f) -> Float { 1.0 } } pub fn create_box_filter() -> FilterDt { //Fixme Arc::new(Box::new(BoxFilter::new(Point2f::new(0.5, 0.05)))) } <r...
Rust
0
blend_factor($dst_color_blend_factor) .color_blend_op($color_blend_op) .src_alpha_blend_factor($src_alpha_blend_factor) .dst_alpha_blend_factor($dst_alpha_blend_factor) .alpha_blend_op($alpha_blend_op) .color_write_mask($color_write_mask) }; } /// Graphics pipeline creation macro that makes it easier t...
Rust
0
import tkinter as tk def calcular(operacion): numeros = entrada.get().split() if len(numeros) == 2: num1, num2 = float(numeros[0]), float(numeros[1]) if operacion == "+": resultado = num1 + num2 elif operacion == "-": resultado = num1 - num2 elif operacio...
Python
1
oductSHA { packaging: "".to_string(), method: "md5".to_string(), value: md5_val, filepath: Some(path_txt.clone()) }); } } if ext_table.is_sha1(file_ext.to_string()) { if let Some(sha_val) = digest_sha1(filepath).ok() { ...
Rust
0
bbpf_error(function_name!(), LibbpfError::LibbpfSys(err)); } Ok(()) } #[cfg(feature = "userspace")] #[named] pub fn libbpf_num_possible_cpus() -> Result<i32> { let num_cpus = unsafe { libbpf_sys::libbpf_num_possible_cpus() }; if num_cpus < 0 { return map_libbpf_sys_error(function_name!(), num_...
Rust
0
multiband_slice_timing = [0, 0.4525, 0.075, 0.5275, 0.15, 0.605, 0.2275, 0.68, 0.3025, 0.755, 0.3775, 0, 0.4525, 0.075, 0.5275, 0.15, 0.605, 0.2275, 0.68, 0.3025, 0.755, 0.3775, 0, 0.4525, 0.075, 0.5275, 0.15, 0.605, 0.2275, 0.68, 0.3025, 0.755, 0.3775, 0, 0.4525, 0.075, 0.5275, 0.1...
Python
1
def prime_factors(n): factor = 2 while n > 1: if n % factor == 0: print(factor, end=" ") n //= factor else: factor += 1 num = int(input("Enter a number: ")) print("Prime factors:", end=" ") prime_factors(num)
Python
1
f avg_ckpts: best_metric_label = "avg_best_" + metric else: best_metric_label = "best_" + metric utils.add_summary(summary_writer, global_step, "%s_%s" % (label, metric), scores[metric]) # metric: larger is better ...
Python
1