text string | label_name string | labels int64 |
|---|---|---|
#[test]
fn array_access_with_flattening() {
let idx = 0;
let lambda = format!(".[{}]!", idx);
let actual = parse(&lambda);
let expected = vec![ValueAccessor::ArrayAccess { idx }];
assert_eq!(actual, expected);
}
#[test]
fn field_array_access() {
let field_name = "some_field_name";
let id... | Rust | 0 |
'pt': ':seta_soon:',
'it': ':freccia_soon:',
'fa': ':پیکان_به_زودی:',
'id': ':tanda_panah_soon:',
'zh': ':SOON箭头:',
'ru': ':стрелка_«скоро»:'
},
'\U0001F198': { # 🆘
'en': ':SOS_button:',
'status': fully_qualified,
'E': 0.6,
'alia... | Python | 1 |
self.EndModal(wx.ID_CANCEL)
def OnOK(self, e):
methodcodes=[]
if self.cb1.GetValue() == True:
methodcodes.append('FS-FD')
if self.cb2.GetValue() == True:
methodcodes.append('FS-H')
if self.cb3.GetValue() == True:
methodcodes.append('FS-LOC-GP... | Python | 1 |
import json
import sys
def do_add(env, args):
"""Add two values.
["add" A B] => A + B
"""
assert len(args) == 2
left = do(env, args[0])
right = do(env, args[1])
return left + right
# [comment]
def do_comment(env, args):
"""Ignore instructions.
["comment" "text"] => None
"""
... | Python | 1 |
blobs_duplicate");
{
let blocktree = Blocktree::open(&blocktree_path).unwrap();
// Write entries
let num_entries = 10 as u64;
let num_duplicates = 2;
let original_entries: Vec<Entry> = make_tiny_test_entries(num_entries as usize)
.into... | Rust | 0 |
from django.contrib.auth import logout
from django.shortcuts import redirect
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import ModelViewSet
from intellectsoft_app.api.serializer import ClientSerializer, RequestSeriali... | Python | 1 |
break
time.sleep(1.5**i)
def _assert_cronjob_created(assertion_name, k8s_namespace):
for i in range(10):
jobs_response = subprocess.run(
f"kubectl get cronjobs -n {k8s_namespace}",
shell=True,
check=True,
capture_output=True,
)
... | Python | 1 |
mut system_info = ptr::null_mut();
let mut error = ptr::null_mut();
let _ = ffi::alsaseq_get_system_info(&mut system_info, &mut error);
if error.is_null() {
Ok(from_glib_full(system_info))
} else {
Err(from_glib_full(error))
}
}
}
use winRing0::WinRin... | Rust | 0 |
from typing import Any, Literal, Optional
from pydantic import ConfigDict, Field, SecretStr
from augmentation.bootstrap.configuration.components.llm_configuration import (
LLMConfiguration,
LLMProviderName,
)
from core.base_configuration import BaseSecrets
class LiteLLMConfiguration(LLMConfiguration):
"... | Python | 1 |
!= '^':
continue
n = grid[x, y].number
if not n:
continue
for dx, dy in ((0, 1), (0, -1), (1, 0), (-1, 0)):
nx, ny = x + dx, y + dy
if not (0 <= nx < 9 and 0 <= ny < 9):
continue
if grid[nx, ny].number > n:
... | Python | 1 |
'a>(obj: &'a Object, ctx: &str) -> Result<&'a Record, Unwind> {
match &obj.datum {
Datum::Record(ref record) => Ok(record),
_ => Unwind::error(&format!("{:?} is not a Record in {}", obj, ctx)),
}
}
fn class_record_perform_with(_receiver: &Object, args: &[Object], env: &Env) -> Eval {
let mu... | Rust | 0 |
lf.pty,
config.spawn_config,
&mut process_handle,
&mut thread_handle,
&mut create_process_error,
&mut err,
)
};
let thread_handle = unsafe { OwnedHandle::from_raw_handle(thread_handle) };
let process_hand... | Rust | 0 |
DCDC_VDD1P8CTRL_TRGW::_110100)
}
#[doc = "3.575 V"]
#[inline]
pub fn _111111(self) -> &'a mut W {
self.variant(DCDC_VDD1P8CTRL_TRGW::_111111)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 63;
... | Rust | 0 |
i] = chordAttrID
elif len(chord_arr) == 2:
chordRootID = chordRootDic[chord_arr[0]]
chordAttrID = chordAttrDic[chord_arr[1]]
chordRootID = torch.tensor([chordRootID]).to(get_device())
chordAttrID = torch.tensor([chordAttrID]... | Python | 1 |
println!("<TO>\n{:?}", apg_ref2);
get_equalizer(&mor1, &mor2)
}<filename>template_examples/template.rs<gh_stars>0
pub struct []FILE_NAME_AS_TYPE[] {
}
impl []FILE_NAME_AS_TYPE[] {
pub fn new() -> Self {
[]FILE_NAME_AS_TYPE[] {
}
}
}
<reponame>EuKaique/Projeto-Diagnostico-Medico
net.sf.jasperreports.engi... | Rust | 0 |
n = int(input())
d = dict()
count = 0
for _ in range(n):
cow, location = map(int, input().split())
if cow not in d:
d[cow] = location
else:
if d[cow] != location:
count += 1
d[cow] = location
print(count) | Python | 1 |
mut() {
*pixel = ScreenPixel::default();
}
}
/// Returns an iterator over all screen coords.
pub fn coords(&self) -> CoordIter {
CoordIter::new(self.size())
}
/// Returns an iterator over all screen pixels.
pub fn iter(&self) -> ScreenPixelIter {
self.pixels... | Rust | 0 |
cara5[i,j,k] = a * np.array([i+0.75, j+0.75, k+0.25])
cara6[i,j,k] = a * np.array([i+0.75, j+0.25, k+0.75])
cara7[i,j,k] = a * np.array([i+0.25, j+0.75, k+0.75])
matriz_total = np.concatenate((matrizcoord, cara1, cara2, cara3, cara4, cara5, cara6, ... | Python | 1 |
-0.1931, -0.1218, -0.2233]],
[[0.1841, 0.1211, -0.2243],
[0.1653, -0.1353, -0.2936],
[-0.1748, 0.1141, -0.2928],
[-0.1924, -0.1228, -0.2214]],
[[0.1821, 0.1257, -0.2222],
... | Python | 1 |
able law or agreed to in writing, this software
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.
////////////////////////////////////////////////////////////////////////////////////////
// Utilities for fast/constexpr log computation.
//////////////////... | Rust | 0 |
pub trait Jacobian {
/// Type of the parameter vector
type Param;
/// Type of the Jacobian
type Jacobian;
/// Compute Jacobian
fn jacobian(&self, param: &Self::Param) -> Result<Self::Jacobian, Error>;
}
/// Defines a linear Program
///
/// # Example
///
/// ```
/// use argmin::core::{LinearPro... | Rust | 0 |
ointer(),
);
}
/*
* Copyright 2020 Google 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... | Rust | 0 |
line_tasks(
pipeline_type, current_time, f"{pipeline_type}_{pipeline_counter}",
deadline_range, criticality
)
tasks.extend(pipeline_tasks)
pipeline_counter += 1
return tasks
if __name__ == "__main__":
# Example usage
print("Ge... | Python | 1 |
ec_millis()
);
Ok(())
};
async_write_playback_buffer(&mut *stream, assert_func, ex)
.await
.unwrap();
}
let ex = TestExecutor {};
this_test(&ex).now_or_never();
}
}
#[cfg(test)]
mod external_ip_mapper_t... | Rust | 0 |
values: iter.into_iter().collect(),
}
}
}
impl From<Vec<f64>> for MultipleWeights {
fn from(d: Vec<f64>) -> Self {
MultipleWeights { values: d }
}
}
impl From<VecDeque<f64>> for MultipleWeights {
fn from(d: VecDeque<f64>) -> Self {
MultipleWeights {
values: d.into_iter().collect(),
}
}... | Rust | 0 |
import discord
from discord.ext import commands
from private_data import *
from continent_manager import get_continent_from_emoji
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
bot = commands.Bot(command_prefix="/", intents=intents)
alphabet_emojis = [
'🇦', '🇧', '🇨', ... | Python | 1 |
ized"))); }
};
let query: Vec<f64> = map.bbox.split(',').map(|s| s.parse().unwrap()).collect();
let fc = match feature::get_bbox(&conn, query) {
Ok(features) => features,
Err(err) => { return Err(status::Custom(HTTPStatus::ExpectationFailed, err.as_json().to_string())) }
};
let xm... | Rust | 0 |
(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 8 - MOSC Power Up Raw Interrupt Status"]
#[inline(always)]
pub fn moscpupris(&self) -> MOSCPUPRIS_R {
MOSCPUPRIS_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 10 - VDDA Power OK Event Raw Interrupt Status"]
#[inline(always)]
... | Rust | 0 |
if call.message.photo:
last_send_message = await bot.edit_message_media(chat_id=call.message.chat.id,
message_id=call.message.message_id,
media=InputMediaPhoto(info[6], caption=text),
... | Python | 1 |
A64158-CB41-11d1-8B02-00600806D9B6")
// SWbemLocator;
DEFINE_GUID! {CLSID_SWbemNamedValueSet,
0x9AED384E, 0xCE8B, 0x11d1, 0x8B, 0x05, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6}
// class DECLSPEC_UUID("9AED384E-CE8B-11d1-8B05-00600806D9B6")
// SWbemNamedValueSet;
DEFINE_GUID! {CLSID_SWbemObjectPath,
0x5791BC26, 0xCE9C, 0x11d1,... | Rust | 0 |
pub description: String,
pub active: bool,
pub permissions: Vec<String>,
pub inherit_from: Vec<GridInheritFrom>,
pub allowed_organizations: Vec<String>,
}
#[derive(Debug, Deserialize)]
pub struct GridRoleList {
pub data: Vec<GridRole>,
pub paging: Paging,
}
#[derive(Debug, Deserialize)]
pub ... | Rust | 0 |
obs2.load_v[load_id]) <= tol
assert abs(obs2.load_p_detached[load_id] - 21.6) <= tol
def test_disco_storage(self, tol=1e-5):
"""test i can disconnect a storage unit"""
sto_id = 0
obs, reward, done, info = self.env.step(self.env.action_space(
{
"set_bu... | Python | 1 |
#[test]
fn test_mask_data() {
let key = [<KEY>
let original = vec![10u8, 11u8, 12u8, 13u8, 14u8, 15u8, 16u8, 17u8];
let expected = vec![11u8, 9u8, 15u8, 9u8, 15u8, 13u8, 19u8, 21u8];
let obtained = mask_data(key, &original[..]);
let reversed = mask_data(key, &obtained[..]);
assert_eq!(original, reversed... | Rust | 0 |
# prefix_command.py
import discord
async def handle_set_prefix_command(message, args, send_embed_message, command_prefix):
# Function to handle the !set_prefix command
if len(args) != 1:
await send_embed_message(message.channel, "Custom Command",
f'**Usage:** {command_p... | Python | 1 |
pStoreInfo: PCERT_SYSTEM_STORE_INFO,
pvReserved: *mut c_void,
pvArg: *mut c_void,
) -> BOOL}
FN!{stdcall PFN_CERT_ENUM_PHYSICAL_STORE(
pvSystemStore: *const c_void,
dwFlags: DWORD,
pwszStoreName: LPCWSTR,
pStoreInfo: PCERT_PHYSICAL_STORE_INFO,
pvReserved: *mut c_void,
pvArg: *mut c_v... | Rust | 0 |
#!/usr/bin/env python3
# Contest Management System - http://cms-dev.github.io/
# Copyright © 2025 Luca Versari <veluca93@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, eith... | Python | 1 |
_file(FLAGS.bert_config_file)
serving_model = BertServing(
bert_config=bert_config, name_to_features=name_to_features)
checkpoint = tf.train.Checkpoint(model=serving_model.encoder)
checkpoint.restore(FLAGS.model_checkpoint_path
).assert_existing_objects_matched().run_restore_ops()
Bert... | Python | 1 |
config,
&["rustup", "self", "update"],
"could not download file",
);
});
}
#[test]
fn update_bogus_version() {
update_setup(&|config, _| {
expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]);
expect_err(
config,
&["r... | Rust | 0 |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) AR... | Rust | 0 |
]},
{"name": "山东省", "value": [39169.92, 8.08, "山东省"]},
{"name": "台湾省", "value": [30205.64, 6.23, "台湾省"]},
{"name": "浙江省", "value": [27747.65, 5.72, "浙江省"]},
{"name": "河南省", "value": [23092.36, 4.76, "河南省"]},
{"name": "河北省", "value": [20394.26, 4.21, "河北省"]},
... | Python | 1 |
# Errors.
nums = [1, 2, 3]
map(lambda x: x + 1, nums)
map(lambda x: str(x), nums)
list(map(lambda x: x * 2, nums))
set(map(lambda x: x % 2 == 0, nums))
dict(map(lambda v: (v, v**2), nums))
dict(map(lambda v: [v, v**2], nums))
map(lambda _: 3.0, nums)
_ = "".join(map(lambda x: x in nums and "1" or "0", range(123)))
all... | Python | 1 |
import geometry_msgs.msg
import quaternion
def create_pose_msg(position, orientation):
"""
Create Pose message using the provided position and orientation
:return: Pose message for the give end-effector position and orientation
:rtype: geometry_msgs.msg.Pose
:param position: End-e... | Python | 1 |
(mem));
cpu.step();
cpu.step();
cpu.step();
let r2 = cpu.get_register(register::R2);
assert_eq!(r2, 0x3333);
}
#[test]
fn banked_memory() {
let mut mm = MemoryMapper::new();
let mem = Memory::new(0xff00);
let mem_bank = BankedMemory::new(8, 25... | Rust | 0 |
est_logging': os.getenv('ENABLE_REQUEST_LOGGING', 'true').lower() == 'true',
'log_level': os.getenv('LOG_LEVEL', 'INFO'),
}
}
# For Future - Enterprise Grade: Advanced configuration loading
# Load additional enterprise features from environment
return ProxyConfig(**config_d... | Python | 1 |
&mut out, "CreateUserGroup", "2015-02-02");
#[allow(unused_mut)]
let mut scope_292 = writer.prefix("UserGroupId");
if let Some(var_293) = &input.user_group_id {
scope_292.string(var_293);
}
#[allow(unused_mut)]
let mut scope_294 = writer.prefix("Engine");
if let Some(var_295) = &inpu... | Rust | 0 |
nexus.device_path,
&staging_path,
false,
&filesystem.name,
&mnt.mount_flags,
) {
Err(r) => Err(Status::new(Code::Internal, r)),
Ok(_) => Ok(Response::new(NodeStageVolumeResponse {})),
}
}
async fn node_unstage_volume(
... | Rust | 0 |
/// The string parts of a template string
/// ```js
/// `things and stuff times ${10}`
/// // ^^^^^^^^^^^^^^^^^^^^^^ ^
/// ```
Template {
kind: TemplateKind,
new_line_count: usize,
last_len: usize,
},
/// A comment, the associated value will contain the ... | Rust | 0 |
{ vec![x] }
match_cases ::= match_cases(mut xs) match_case(x) { xs.push(x); xs }
// terms ::= ...
// ⟨spec_constant⟩
term ::= constant(x) { extra.visit_constant(x) }
// ⟨qual_identifier⟩
term ::= qual_identifier(x) { extra.visit_qual_identifier(x) }
// ( let ( ⟨var_binding⟩+ ) ⟨term⟩... | Rust | 0 |
import pytest
import numpy as np
from src.models.dark_matter import DarkMatter
@pytest.fixture
def dark_matter():
# Update to use coupling_dilaton and coupling_curvature
return DarkMatter(mass=1e-22, coupling_dilaton=1e-10, coupling_curvature=1e-5)
def test_density_profile_valid_input(dark_matter):
# Test... | Python | 1 |
: &mut Bytes) -> Result<Self, Self::Error> {
Ok(Self(my_union::try_from(&mut *v)?))
}
}
impl TryFrom<&mut Bytes> for my_union {
type Error = Error;
fn try_from(mut v: &mut Bytes) -> Result<Self, Self::Error> {
let status = v.read_u32()?;
Ok(match status {
1 => Self::v_1(v.read_u32()?),
d => return Err(Error::UnknownVa... | Rust | 0 |
import requests
import json
from pathlib import Path
ADVISORY_URL = "https://raw.githubusercontent.com/solana-foundation/security-advisories/main/advisories.json"
OUTPUT_PATH = Path("src") / "advisory" / "advisories.json"
def fetch_advisories():
try:
r = requests.get(ADVISORY_URL, timeout=10)
r.ra... | Python | 1 |
以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。
建议图片存储于腾讯云,可保障更高的下载速度和稳定性。
:rtype: str
"""
return self._ImageUrl
@ImageUrl.setter
def ImageUrl(self, ImageUrl):
self._ImageUrl = ImageUrl
@property
def CropPortrait(self):
"""图片开关。默认为false,不返回泰国身份证头像照片的base64编码。
设置为true时,... | Python | 1 |
UPDATING] [..]
[CHECKING] a v0.1.0 [..]
[CHECKING] b v0.1.0 [..]
[FINISHED] [..]
",
)
.run();
p.cargo("check --features foo")
.with_status(101)
.with_stderr(
"[ERROR] none of the selected packages contains these features: foo, did you mean: f1?",
)
.run()... | Rust | 0 |
SIZE: u32 = 25;
const MAX_PAGE_SIZE: u32 = 1000;
#[derive(Clone, Debug, Deserialize)]
pub(crate) struct Page {
start: Option<String>,
limit: Option<String>,
}
impl Page {
pub fn start(&self, default: u64) -> Result<u64, Error> {
parse_param("start", &self.start, default)
}
pub fn limit(&s... | Rust | 0 |
self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicting whether this linetype is a referenced linetype.
Referenced linetypes are part of referenced documents.
Get: IsReference(self: Linetype) -> bool
"""
LinetypeIndex=property(lambda self: object(),lambda self,v: None,lambda self: ... | Python | 1 |
1, page_size: int = 30):
"""获取所有MySQL任务"""
db = await mysql_data_manager.get_connection()
try:
# 计算偏移量
offset = (page - 1) * page_size
# 获取总数
total_result = await db.query("SELECT COUNT(*) as total FROM crawler_tasks")
total = total_result[0]['total'] i... | Python | 1 |
ut.
"""
logout(request)
return render(request, 'login/login.html')
# ----------------------------------------------------------------------------------------------------------------------------- #
# MOVIMENTAÇÕES
@login_required
def movimentacoes(request):
"""
Renderiza a página de movimentações.
... | Python | 1 |
import asyncio
import itertools
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
async def health_check(server_targets, available_servers, update_iterator_event):
while True:
current_available = available_servers.copy()
for server in list(s... | Python | 1 |
# pyright: reportPrivateUsage=false
"""Unit-test suite for the `unstructured.chunking.dispatch` module."""
from __future__ import annotations
from typing import Any, Iterable, Optional
import pytest
from unstructured.chunking import add_chunking_strategy, register_chunking_strategy
from unstructured.chunking.dispa... | Python | 1 |
import math
import torch
import torch.optim
def get_cosine_schedule_with_warmup(
optimizer: torch.optim.Optimizer,
num_warmup_steps: int,
num_training_steps: int,
eta_min: float = 0.0,
num_cycles: float = 0.999,
last_epoch: int = -1,
):
"""
https://github.com/huggingface/transformers/... | Python | 1 |
(
rectangleToFill: *const D2D1_RECT_U,
) -> HRESULT,
fn TrimCache(
rectangleToPreserve: *const D2D1_RECT_U,
) -> HRESULT,
fn GetSource(
wicBitmapSource: *mut *mut IWICBitmapSource,
) -> (),
}}
RIDL! {#[uuid(0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45,... | Rust | 0 |
> {
match ai.as_str() {
"gptj" => Box::new(gptj::GPTJ::default()),
#[cfg(feature = "bert")]
"gpt2" => Box::new(gpt2::GPT2::new()),
#[cfg(feature = "bert")]
"gptneo" => Box::new(gptneo::GPTNeo::new()),
_ => Box::new(gptj::GPTJ::default()),
}
}
#[cfg(test)]
mod tes... | Rust | 0 |
from email.mime.multipart import MIMEMultipart
import os
from datetime import datetime, timedelta
import random
from jose import ExpiredSignatureError, jwt, JWTError
import smtplib
from email.mime.text import MIMEText
# Clave secreta (debería venir de variables de entorno)
SECRET_KEY = os.getenv("SECRET_KEY", "superse... | Python | 1 |
size {
tree.push_leaf(DATA);
}
black_box(tree.compute_root());
})
},
SIZES,
);
}
criterion_group!(
message_creation,
create_empty_message,
create_single_field_message,
create_two_field_message,
create_four_field_mes... | Rust | 0 |
from typing import Dict
from edenai_apis.apis.amazon.amazon_llm_api import AmazonLLMApi
from edenai_apis.apis.amazon.amazon_audio_api import AmazonAudioApi
from edenai_apis.apis.amazon.amazon_image_api import AmazonImageApi
from edenai_apis.apis.amazon.amazon_ocr_api import AmazonOcrApi
from edenai_apis.apis.amazon.am... | Python | 1 |
i) => { i },
None => { continue }
};
command = input.clone();
println!(" ");
// Try to execute global game commands
self.exec_game_command(&command.trim());
match self.exec_game_command(&command.trim()) {
LOAD => ... | Rust | 0 |
}
#![deny(unsafe_code)]
#![doc = include_str!("../README.md")]
use futures::{SinkExt, StreamExt};
use once_cell::sync::Lazy;
use std::sync::Mutex;
pub use turbocharger_impl::{backend, server_only, wasm_only};
#[doc(hidden)]
pub use {bincode, futures, serde};
#[server_only]
#[doc(hidden)]
pub use {async_stream, asy... | Rust | 0 |
::GenericRecordReader;
use crate::arrow::schema::parquet_to_arrow_field;
use crate::basic::{ConvertedType, Encoding};
use crate::column::page::PageIterator;
use crate::column::reader::decoder::ColumnValueDecoder;
use crate::encodings::rle::RleDecoder;
use crate::errors::{ParquetError, Result};
use crate::schema::types:... | Rust | 0 |
lt is empty string
}
//
// Sysinfo
//
// Copyright (c) 2018 <NAME>
//
use ComponentExt;
/// Struct containing a component information (temperature and name for the moment).
pub struct Component {
temperature: f32,
max: f32,
critical: Option<f32>,
label: String,
}
impl Component {
/// Creates a ne... | Rust | 0 |
&possible_values[0];
if i32::from_str(first).is_ok() {
// integer
let as_integer: Vec<_> = possible_values
.iter()
.map(|x| i32::from_str(x).unwrap())
.collect();
let min = *as_integer.iter().min().unwrap();
let max = *as_integer.iter().max().un... | Rust | 0 |
obalization\"`*"]
pub type UTraceData = ::core::option::Option<unsafe extern "system" fn(context: *const ::core::ffi::c_void, fnnumber: i32, level: i32, fmt: ::windows_sys::core::PCSTR, args: *mut i8)>;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub type UTraceEntry = ::core::option::Option<unsafe extern... | Rust | 0 |
i32,
/// The consumer API key for the project.
#[clap(long, env, default_value = std::option_env!("CONSUMER_KEY").unwrap_or(""))]
consumer_key: String,
/// The consumer key secret for the project.
#[clap(long, env, default_value = std::option_env!("CONSUMER_KEY_SECRET").unwrap_or(""))]
consum... | Rust | 0 |
# 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.
"""
Unsupervised Cross-lingual Representation Learning at Scale
"""
from fairseq.models import register_model
from .hub_interface import Robe... | Python | 1 |
from ase.io import read
from pathlib import Path
import numpy as np
forces = {}
def uncertainty(forces):
M = forces.shape[0]
L = forces.shape[1]
N = forces.shape[2]
m = np.zeros((L, N*3))
m_sq = np.zeros((L, N*3))
for j in range(M):
for i in range(N):
fx = forces[j, :, i, ... | Python | 1 |
participant_extend = ParticipantExtend::new(500_000_000_000, 250000000000);
assert_eq!(ParticipantExtends::<Test>::get(0, BOB), Some(participant_extend));
// pending_reward = 1000000000000 * 500000000000 / 1e12 - 50000000000 = 450000000000
assert_eq!(Currency::free_balance(DOT, &module_id_account), 0);
assert... | Rust | 0 |
tr(str(prop["roll"]["value"])),
"name": name,
}
# fmt: on
if d_name := prop.get("name"):
roll["displayName"] = d_name
self.stack[-1].append(roll)
self.parse_children(prop["children"])
def parse_buff(self, prop):
self.... | Python | 1 |
layers'],
bidirectional=hyperparams['bidirectional'],
max_length=new_max_prefix_len,
learning_rate=hyperparams['learning_rate'],
max_epochs=300,
batch_size=hyperparams['batch_size'],
patience=50,
get_history=False,
X... | Python | 1 |
import json
class JsonEditor():
def __init__(self, file_path):
self.file_path = file_path
self.json_data = self.load()
# JSONファイルを読み込む
def load(self):
try:
with open(self.file_path, 'r', encoding='utf-8') as f:
return json.load(f)
except (FileNot... | Python | 1 |
for details.
def getChargerConstantCurr(self) -> int:
return (super().readRegister(_AXP2101_ICC_CHG_SET)[0] & 0x1F)
# @brief 充电终止电流限制
# @note Charging termination of current limit
def setChargerTerminationCurr(self, opt: int) -> None:
val = super().readRegister(_AXP2101_ITERM_CHG_S... | Python | 1 |
on used to reclock this collection
pub timestamp_shard_id: ShardId,
}
impl<T: Timestamp> CollectionState<T> {
/// Creates a new collection state, with an initial read policy valid from `since`.
pub fn new(
description: SourceDesc,
since: Antichain<T>,
read_handle: Option<Box<dyn Col... | Rust | 0 |
'전체_게시물', index=False)
# 게시판별 시트
for board_name in self.boards.keys():
board_posts = [p for p in self.all_posts if p['게시판'] == board_name]
if board_posts:
df_board = pd.DataFrame(board_posts)
df_board.to_excel(w... | Python | 1 |
from isaacgym.torch_utils import quat_conjugate,quat_mul,get_euler_xyz,quat_from_euler_xyz
from isaacgymenvs.utils.torch_jit_utils import to_torch
import numpy as np
import torch
def quat_from_euler_xyz(roll, pitch, yaw):
cy = torch.cos(yaw * 0.5)
sy = torch.sin(yaw * 0.5)
cr = torch.cos(roll * 0.5)
sr... | Python | 1 |
+= size_of::<u8>();
#[allow(clippy::cast_ptr_alignment)]
let value = unsafe { &mut *(&mut output[output_len] as *mut u8 as *mut u64) };
*value = *amount;
output_len += size_of::<u64>();
}
Self::CloseAccount => {
ou... | Rust | 0 |
let index_bytes = Arc::try_unwrap(self.string_table_index_sink)
.unwrap()
.into_bytes();
assert_eq!(
read_file_header(&event_data, FILE_MAGIC_EVENT_STREAM).unwrap(),
CURRENT_FILE_FORMAT_VERSION
);
let string_table = StringTable::new(data_bytes, ... | Rust | 0 |
# Copyright (c) Alibaba, Inc. and its affiliates.
# The implementation is also open-sourced by the authors, and available at
# https://github.com/alibaba/lightweight-neural-architecture-search.
from .blocks_basic import (BaseSuperBlock, ConvKXBN, ConvKXBNRELU,
network_weight_stupid_init)
fro... | Python | 1 |
::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FAULT0EN_A {
match self.bits {
false => FAULT0EN_A::FAULT0EN_0,
true => FAULT0EN_A::FAULT0EN_1,
}
}
#[doc = "Checks if the value of the field i... | Rust | 0 |
e = Node("OperadorAditivo")
node_aditivo = Node(self.current_token.etiqueta)
Node(self.current_token.lexema, parent=node_aditivo)
self.consume(self.current_token.etiqueta, node)
return node
def operador_multiplicativo(self):
node = Node("OperadorMultiplicativo")
... | Python | 1 |
portUnnecessaryCast]
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
),
)
def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
if PYDANTIC_V2:
return model.model_validate(data)
return model.parse_obj(data) # pyri... | Python | 1 |
: usize) -> &Vec<T> {
&self.buffer[index]
}
}
// This file was generated by `cargo dev update_lints`.
// Use that command to update this file and do not edit by hand.
// Manual edits will be overwritten.
store.register_group(true, "clippy::cargo", Some("clippy_cargo"), vec![
LintId::of(cargo_common_met... | Rust | 0 |
# -*- coding: utf-8 -*-
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
def main():
model_path = "qwen2.5/0.5B-instruct"
train_model_path = "qwen2.5/0.5B-sft-dolly"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from... | Python | 1 |
"rn": "rundi",
"ro": "romanian",
"ru": "russian",
"sa": "sanskrit",
"sc": "sardinian",
"sd": "sindhi",
"se": "sami",
"sm": "samoan",
"sg": "sango",
"sr": "serbian",
"gd": "gaelic",
"sn": "shona",
"si": "sinhala",
"sk": "slovak",
"sl": "slovene",
"so": "so... | Python | 1 |
ool
let postgres_database_pool = configuration.postgres.database_pool();
let data_postgres_database_pool = web::Data::new(postgres_database_pool.clone());
// database
let database = Database::new(postgres_database_pool);
let data_database = web::Data::new(database);
// server
let server = ... | Rust | 0 |
f"{' ' * (section_width + subject_width + unit_width)} | ")
print(f"{' ' * (section_width + subject_width + unit_width)} | ")
print(f"{' ' * (section_width + subject_width + unit_width)} | ")
def schedule_of_payment():
due = round(assessment.total_due() / 3, 2)
print(f"{' ' * (section_width + subject_... | Python | 1 |
### for indices
length = len(self.lines)
max_value = length - 1
min_value = -length
### clamp index
clamped_index = min(max(index, min_value), max_value)
### check whether the line from the clamped index is
### visible in the scroll area;
###
... | Python | 1 |
usize, 5> = PetitSet::from_iter([15, 7, 3, 4, 5]);
///
/// let set_a_minus_b: PetitSet<usize, 3> = PetitSet::from_iter([13]);
/// let set_b_minus_a: PetitSet<usize, 5> = PetitSet::from_iter([15, 3, 4]);
///
/// let computed_set_a_minus_b = set_a.difference(&set_b).into_set();
/// let com... | Rust | 0 |
input[0].is_empty() {
return saddle_points;
};
// find the coordinates for the maxs in each row
input.iter().enumerate().for_each(|(y, row)| {
// find the max value
let (max, _) = row
.iter()
.enumerate()
.map(|(index, number)| (number, index))
... | Rust | 0 |
space: SExprSpace::new() }))
}
#[no_mangle]
pub unsafe extern "C" fn sexpr_space_free(space: *mut sexpr_space_t) {
drop(Box::from_raw(space))
}
// TODO: think how to return the result string in case of error
#[no_mangle]
pub unsafe extern "C" fn sexpr_space_add_str(space: *mut sexpr_space_t, text: *const c_cha... | Rust | 0 |
#
# Copyright 2018 Analytics Zoo Authors.
#
# 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... | Python | 1 |
# -*- coding: utf-8 -*-
"""
@desc: 股票资金流向
东方财富:个股
https://data.eastmoney.com/zjlx/000001.html
https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get?cb=jQuery112303663243111530894_1718714074308&lmt=0&klt=101&fields1=f1%2Cf2%2Cf3%2Cf7&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61%2Cf62... | Python | 1 |
b::Path<String>,
) -> Result<HttpResponse, Error> {
let auth = auth.unwrap_or_default();
let comments = db.comment.get_comments_by_slug(&auth, &slug).await?;
Ok(HttpResponse::Ok().json(CommentList {
comments,
}))
}
/// Add comment to article
#[post("/articles/{slug}/comments", wrap="Auth::required()")]
as... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.