text string | label_name string | labels int64 |
|---|---|---|
'''
Author: HDJ
StartDate: please fill in
LastEditTime: 2024-11-01 14:11:38
FilePath: \pythond:\LocalUsers\Goodnameisfordoggy-Gitee\AVATFT\src\__init__.py
Description:
* 写字楼里写字间,写字间里程序员;
* 程序人员写程序,又拿程序换酒钱。
* 酒醒只在网上坐,酒醉还来网下眠;
* 酒醉酒醒日复日,网上网下年复年。
* 但愿老死电脑间,不愿鞠躬老板前;
* 奔驰宝马贵者趣,公交自行程序员。
* ... | Python | 1 |
0xc, R)], &[(0x3, 0x6, N), (0xa, 0xb, N), (0xb, 0xc, R), (0xc, 0xd, N)])] // split
#[case(&[(0x3, 0x6, N), (0xa, 0xd, N), (0x2, 0x4, R)], &[(0x2, 0x4, R), (0x4, 0x6, N), (0xa, 0xd, N)])] // overlap before
#[case(&[(0x3, 0x6, N), (0xa, 0xd, N), (0x9, 0xb, R)], &[(0x3, 0x6, N), (0x9, 0xb, R), (0xb, 0xd, N)])] //... | Rust | 0 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def nodesBetweenCriticalPoints(self, head: Optional[ListNode]) -> List[int]:
i = 1
tmp = head
prev_val = tmp.val
tmp ... | Python | 1 |
means we cannot
/// do anything and is fatal for this agent.
///
/// The methods defined on this wrapper are in almost all cases encapsulating
/// unsafe calls to the JVMTI C interface and converting error codes into
/// Results. Every effort was made to ensure safety around the necessary unsafe
/// blocks for calling... | Rust | 0 |
import json
import numpy as np
from typing import List, Tuple
class IndexTTSEmotionVectorNode:
"""
ComfyUI node: Index TTS Emotion Vector
- Outputs an emotion vector as JSON string for Index TTS 2's `emo_vector` input.
- Matches HF demo with 8 sliders: Happy, Angry, Sad, Fear, Hate, Love, Surprise, Ne... | Python | 1 |
--------------------------------------
attrFuncDict dict :{<__main__.ClsMain object at 0x000001C748B236B0>: None}
attrFuncList list :[<__main__.ClsMain object at 0x000001C748B236B0>]
----------METHODS__OBJECTS--------------------------------------------------------------------------
attrCl... | Python | 1 |
cks - no existing firewall
mock_get_response = MagicMock()
mock_get_response.status_code = 200
mock_get_response.json.return_value = {"firewall_groups": []}
mock_get.return_value = mock_get_response
# Setup create firewall response
mock_post_response = MagicMock(... | Python | 1 |
,
// 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.
pub mod analyzers;
pub mod entries;
pub mod offset;
pub mod save_analysis;
use crate::error::KytheError;
use crate::providers::FileProv... | Rust | 0 |
("msvc") {
let curpaths = env::var_os("PATH").unwrap_or_default();
let curpaths = env::split_paths(&curpaths).collect::<Vec<_>>();
for &(ref k, ref v) in self.cc[&compiler.host].0.env() {
if k != "PATH" {
continue
}
... | Rust | 0 |
code;
let outColouredChar =
ScreenChar
{
ascii_character: byte ,
color_code : color_code,
};
self.buffer.chars[row][col].write(outColouredChar);
self.colu... | Rust | 0 |
dex >= reg_universe.allocable {
continue;
}
per_real_reg[rregIndex].add_RealRange(&rlr, &frag_env, &vlr_env);
}
// Do RangeFrag compression.
do_vlr_frag_compression(&mut vlr_env, &mut frag_env);
let mut edit_list_move = Vec::<EditListItem>::new();
let mut edit_list_othe... | Rust | 0 |
const ITERATIONS: &str = "iterations";
pub const RESOLUTION: &str = "resolution";
pub const RANDOMNESS: &str = "randomness";
pub const QUALITY: &str = "quality";
pub const HAS_HEADER: &str = "has_header";
pub struct CliArgs {
pub source_edges: String,
pub output_path: String,
pub separator: String,
pub... | Rust | 0 |
ed_variables)]
/// let response = status::NoContent;
/// ```
// TODO: This would benefit from Header support.
#[derive(Debug, Clone, PartialEq)]
pub struct NoContent;
/// Sets the status code of the response to 204 No Content. The body of the
/// response will be empty.
impl<'r> Responder<'r> for NoContent {
fn re... | Rust | 0 |
gative.')
# Remaining set.
remaining_num = num_samples - chosen_num * 2
remaining_data = latent_codes[chosen_num:-chosen_num]
remaining_scores = scores[chosen_num:-chosen_num]
decision_value = (scores[0] + scores[-1]) / 2
remaining_label = np.ones(remaining_num, dtype=np.int)
remaining_label... | Python | 1 |
cb_dequantized.88x72.bmp) |
| On Cr plane |  |  |
'''
for id in range(3)
)}
### Statistical Comparison
{"".join(
f'''
The image pair with sequence number `{id}`:
On the Y plane:
{get_met... | Python | 1 |
le::open("config.json").expect("config");
let mut config_json = String::new();
file.read_to_string(&mut config_json);
let config: Config = serde_json::from_str(&config_json.to_owned()).unwrap();
let mut client = Client::new(&config.token, Handler)
.expect("Error creating client");
client.wi... | Rust | 0 |
import jax
import jax.numpy as jnp
from jax import lax
def solver(u0_batch, t_coordinate, nu):
# Enable double precision (requires JAX_ENABLE_X64=1 in environment)
jax.config.update("jax_enable_x64", True)
B, N = u0_batch.shape
dx = 1.0 / N
k = 2 * jnp.pi * jnp.fft.fftfreq(N, d=dx).astype(u0_... | Python | 1 |
'C', b'7', b'D', b'7', b'E',
b'8', b'0', b'8', b'1', b'8', b'2', b'8', b'3', b'8', b'4', b'8', b'5', b'8', b'6', b'8', b'7',
b'8', b'8', b'8', b'9', b'8', b'A', b'8', b'B', b'8', b'C', b'8', b'D', b'8', b'E', b'9', b'0',
b'9', b'1', b'9', b'2', b'9', b'3', b'9', b'4', b'9', b'5', b'9', b'6', b'9', b'7', b'9... | Rust | 0 |
ributorLink(
contribution=contribution,
contributor=contributor,
contributor_order=contributor_order,
)
new_contributors.append(contributor)
session.add(contribution_contributor_link)
update_dict = contribution_in.model_dump(
exclude={"discord_cha... | Python | 1 |
.');
assert!(res.is_err());
let res = res.unwrap_err();
assert!(is_match!(res.kind(), &ErrorKind::QueryingValueAsArray(_)));
}
#[test]
fn test_delete_index_from_table_in_table() {
let mut toml : Value = toml_from_str(r#"
table = { another = { int = 1 } }
"#... | Rust | 0 |
Resolver<'a, 'tcx:'a> {
infcx: &'a InferCtxt<'a, 'tcx>,
}
impl<'a, 'tcx> OpportunisticTypeResolver<'a, 'tcx> {
pub fn new(infcx: &'a InferCtxt<'a, 'tcx>) -> OpportunisticTypeResolver<'a, 'tcx> {
OpportunisticTypeResolver { infcx: infcx }
}
}
impl<'a, 'tcx> ty::fold::TypeFolder<'tcx> for Opportunis... | Rust | 0 |
-> Result<()> {
let args = &cli::raw();
let cx = &Context::new(args)?;
exec_on_workspace(cx)
}
fn exec_on_workspace(cx: &Context<'_>) -> Result<()> {
// TODO: Ideally, we should do this, but for now, we allow it as cargo-hack
// may mistakenly interpret the specified valid feature flag as unknown... | Rust | 0 |
"hello-world-docker-action client (rust/stable; client=surf+h1, tls=rustls)",
)
.header("accept", "application/vnd.github.v3+json")
.header("authorization", format!("token {}", &token))
.body(json!( { "body": "Some test comment from a rusty GH action." }))... | Rust | 0 |
fields", &self.fields())
.field("num_fields", &self.num_fields())
.field(
"field_offset_vector_offset",
&self.field_offset_vector_offset(),
)
.finish()
}
}
impl StructDescriptor {
/// Creates an instance from a raw type context des... | Rust | 0 |
p| HIMAGELIST(p as _))
}
fn as_generic_wm(&mut self) -> WndMsg {
WndMsg {
msg_id: co::HDM::CREATEDRAGIMAGE.into(),
wparam: self.index as _,
lparam: 0,
}
}
}
/// [`HDM_DELETEITEM`](https://docs.microsoft.com/en-us/windows/win32/controls/hdm-deleteitem)
/// message parameters.
///
/// Ret... | Rust | 0 |
from __future__ import division, print_function
import os
import pytest
from lxml import etree as ET
from .. import alto_text, distance, page_text
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
@pytest.mark.integration
def test_distance_between_page_files():
# In the fake OCR file... | Python | 1 |
from dataclasses import dataclass
from cartography.models.core.common import PropertyRef
from cartography.models.core.nodes import CartographyNodeProperties
from cartography.models.core.nodes import CartographyNodeSchema
from cartography.models.core.relationships import CartographyRelProperties
from cartography.models... | Python | 1 |
rror = parse(mrz, true).unwrap_err();
assert_eq!(error, Error::BadCheckDigit);
}
#[test]
fn parse_from_str() {
let valid_mrz = "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\
L898902C36UTO7408122F1204159ZE184226B<<<<<10";
valid_mrz.parse::<Document>().unwrap();
... | Rust | 0 |
pub const GL_TEXTURE_LOD_BIAS: GLenum = GLenum(0x8501);
pub const GL_TEXTURE_MAG_FILTER: GLenum = GLenum(0x2800);
pub const GL_TEXTURE_MAX_ANISOTROPY: GLenum = GLenum(0x84FE);
pub const GL_TEXTURE_MAX_LEVEL: GLenum = GLenum(0x813D);
pub const GL_TEXTURE_MAX_LOD: GLenum = GLenum(0x813B);
pub const GL_TEXTURE_MIN_F... | Rust | 0 |
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""Parameterization settings for the default configuration."""
from pydantic import BaseModel, Field
from graphrag.config.defaults import graphrag_config_defaults
from graphrag.config.enums import OutputType
class OutputConfig(BaseModel):... | Python | 1 |
of the same key pair will be held
/// inside the secure boundary, where it can be used to decrypt ("unwrap") the encryption key. Once
/// unwrapped, the key can be used within that same secure boundary to decrypt and execute the payloads
/// of confidential packages.
pub trait EncryptionKeyDestination {
/// Inject... | Rust | 0 |
the memory.
let raw_allocation = alloc(layout) as *mut AsmCoreMachine;
Box::from_raw(raw_allocation)
};
machine.registers = [0; RISCV_GENERAL_REGISTER_NUMBER];
machine.pc = 0;
machine.next_pc = 0;
machine.running = 0;
machine.cycles = 0;
m... | Rust | 0 |
review_df = pd.DataFrame(reviews)
if not review_df.empty:
# Sentiment Distribution
fig_sentiment = px.pie(
review_df,
names='sentiment_label',
title='Review Sentiment Distribution'
... | Python | 1 |
));
Ok(acc)
})?,
nonce: rand::random::<u64>(),
content: Keccak256::new().chain(&serialize(&content)?).result().into(),
metadata: Metadata { end_of_chain: false },
})
}
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Message {
body: M... | Rust | 0 |
}
let mut sum = 0;
manager.iter().run(|(d,): (&Datum,)| sum += d.value);
assert_eq!(sum, 15);
manager.iter().run(|(d,): (&mut Datum,)| d.value += 1);
manager.iter().run(|(d,): (&Datum,)| sum += d.value);
assert_eq!(sum, 35);
}
#[test]
fn tagged_... | Rust | 0 |
0
} else {
let first = u32::from_le(offsets[0]) as usize;
(first - 4) / 4
}
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
pub fn get(&self, idx: usize) -> Option<UncleBlockReader<'_>> {
let len = self.len();
if idx >= len... | Rust | 0 |
"query" => ctx.document.format(&Style::default().indent(0)).replace('\n', " "),
"complexity" => complexity,
);
match options.max_complexity {
Some(max_complexity) if complexity > max_complexity => {
Err(vec![QueryExecutionError::... | Rust | 0 |
e_from_str(string)
}
/// Parses the string `string` into a `Reference`. Allocates minimally on
/// success and error.
///
/// This method should be used instead of [`Reference::parse()`] when the
/// source URI is already a `String`. Returns an `Error` if `string` is not
/// a valid URI ref... | Rust | 0 |
url = ql_url + 'api/user/two-factor/login'
data = json.dumps({
"username": username,
"password": password,
"code": twoCode
})
res = requests.put(url=url, headers=headers, data=data)
... | Python | 1 |
rmines the frame type that the IE will be associated with."]
pub type wifi_vendor_ie_type_t = u32;
pub const wifi_vendor_ie_id_t_WIFI_VND_IE_ID_0: wifi_vendor_ie_id_t = 0;
pub const wifi_vendor_ie_id_t_WIFI_VND_IE_ID_1: wifi_vendor_ie_id_t = 1;
#[doc = " @brief Vendor Information Element index"]
#[doc = ""]
#[doc =... | Rust | 0 |
// CHECK: call void @llvm.trap()
// CHECK: unreachable
Foo(x, *y)
}
// CHECK: attributes #0 = {{{.*}} noreturn {{.*}}}
// CHECK: DISubprogram(name: "empty", {{.*}} DIFlagNoReturn
// CHECK: DISubprogram(name: "foo", {{.*}} DIFlagNoReturn
<gh_stars>0
#![feature(array_chunks)]
#![feature(array_zip)]
mod co... | Rust | 0 |
import regex as re
from utils.lang import KanjiUtils
class OZK5Utils:
@staticmethod
def extract_gendai_reading(soup):
reading = ""
gendai_head = soup.find("GendaiHeadG")
if gendai_head:
gendai_midashi = gendai_head.find("Gendai見出")
... | Python | 1 |
is_boiling = True
stri_count = 5
total_actions = stri_count + is_boiling # upcasting
print(f"Total actions: {total_actions}") #returns 5 + 1 = 6
milk_present = 0 # no milk
print(f"Is there milk? {bool(milk_present)}")
water_hot = True
tea_added = True
can_server = water_hot and tea_added
print(f"Can serve chai? {can... | Python | 1 |
def get_week_day(value: str) -> str:
num = int(value)
result = ""
match num:
case 1:
result = "Monday"
case 2:
result = "Tuesday"
case 3:
result = "Wednesday"
case 4:
result = "Thursday"
case 5:
result = "Fri... | Python | 1 |
// Loop through, receiving packets until we have an entire frame.
loop {
if av_read_frame(context, packet) < 0 {
continue;
}
if (*packet).stream_index != self.videoindex {
continue;
}
let mut got_picture: c_int = 0;
... | Rust | 0 |
Id {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RemoteServiceGroup {
pub browser: BrowserConfig,
pub remaining_sessions: u32,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct RemoteNodeCreate {
#[serde(default)]
name: Stri... | Rust | 0 |
err: LowerError) -> ParserError {
ParserError::Lower { source: err }
}
}
impl From<ParseError> for ParserError {
fn from(err: ParseError) -> ParserError {
use lalrpop_util::ParseError as E;
match err {
E::InvalidToken { location } => ParserError::InvalidToken {
... | Rust | 0 |
* UP)
self.play(MoveAlongPath(moving_dot, arc_ab, rate_func= smoothstep, run_time= 1))
self.play(MoveAlongPath(moving_dot, arc_bc, rate_func= smoothstep, run_time= 0.75))
self.play(MoveAlongPath(moving_dot, arc_cd, rate_func= smoothstep, run_time= 1))
self.... | Python | 1 |
ress<R: io::Read>(data: R, out: &mut Vec<u8>) -> io::Result<()> {
use std::io::Read;
flate2::read::ZlibDecoder::new(data).read_to_end(out).map(drop)
}
#[cfg(not(feature = "zlib"))]
fn zlib_decompress<R: io::Read>(_data: R, _out: &mut Vec<u8>) -> io::Result<()> {
Err(io::Error::new(io::ErrorKind::Other, "un... | Rust | 0 |
#
# deobfuscator for scripts messed up with myobfuscate.com
# by Einar Lielmanis <einar@jsbeautifier.org>
#
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
# CAVEAT by Einar Lielmanis
#
# You really don't want to obfuscate yo... | Python | 1 |
()
}
}
impl<'mutex_lock, Value: CtoSafe> DerefMut for CtoMutexLockGuardWithConditionVariable<'mutex_lock, Value>
{
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target
{
self.cto_mutex_lock_guard.deref_mut()
}
}
impl<'mutex_lock, Value: CtoSafe> Borrow<Value> for CtoMutexLockGuardWithConditionVariabl... | Rust | 0 |
from app.init.init_app import app
from app.routers.app_routers import routers
# 初始化配置路由
app.include_router(routers)
if __name__ == '__main__':
import uvicorn as uvicorn
uvicorn.run("main:app", host="127.0.0.1", port=5001, reload=False)
| Python | 1 |
b(crate) fn new(dynamodb: DynamoDbClient, s3: S3Client) -> DishLoader {
DishLoader {
db_client: dynamodb,
s3_client: s3,
}
}
pub(crate) async fn load_all(&self) -> Result<Vec<Dish>, Error> {
let output = self.db_client.scan().table_name(TABLE_NAME).send().await?;
... | Rust | 0 |
N_SEL_W {
GPIO_FUNC22_OEN_SEL_W { w: self }
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn gpio_func22_out_inv_sel(&mut self) -> GPIO_FUNC22_OUT_INV_SEL_W {
GPIO_FUNC22_OUT_INV_SEL_W { w: self }
}
#[doc = "Bits 0:7"]
#[inline(always)]
pub fn gpio_func22_out_sel(&mut self) ->... | Rust | 0 |
eed('http://feeds.bbci.co.uk/news/world/rss.xml', Color(0.00, 1.00, 0.00), 'Blue_Circle')
addfeed('http://www.nytimes.com/services/xml/rss/nyt/US.xml', Color(1.00, 0.50, 0.00), 'Personal_Computer')
addfeed('http://www.nytimes.com/services/xml/rss/nyt/Europe.xml', Color(1.00, 0.00, 0.00), 'Delivery_Truck')
a... | Python | 1 |
#!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | Python | 1 |
ofer_level" in data:
self._woofer_volume = data["i_woofer_level"]
if "i_curr_eq" in data:
self._equaliser = data["i_curr_eq"]
if "s_user_name" in data:
self._attr_name = data["s_user_name"]
self.schedule_update_ha_state()
def update(s... | Python | 1 |
import numpy as np
from gwstatsmodels.tsa.interp import dentonm
def test_denton_quarterly():
# Data and results taken from IMF paper
indicator = np.array([98.2, 100.8, 102.2, 100.8, 99.0, 101.6,
102.7, 101.5, 100.5, 103.0, 103.5, 101.5])
benchmark = np.array([4000.,4161.4])
x_... | Python | 1 |
from .parse import PDFParser | Python | 1 |
ck"] is not None:
callback_camera = frame_params["callback"](
self.scene,
frame_number,
self.nframes,
**frame_params["kwargs"],
)
else:
callback_camera = None
# see if callback returned a camera
... | Python | 1 |
unwrap();
stdout.flush().unwrap();
None
}
websocket::OwnedMessage::Close(e) => Some(websocket::OwnedMessage::Close(e)),
websocket::OwnedMessage::Ping(d) => Some(websocket::OwnedMessage::Pong(d)),
... | Rust | 0 |
math::Coord,
ptr::Shared,
},
archery::SharedPointerKind,
gfx_hal::{
command::{CommandBuffer as _, CommandBufferFlags, ImageCopy, Level, SubpassContents},
format::Aspects,
image::{
Access as ImageAccess, FramebufferAttachment, Layout, Offset, SubresourceLayer... | Rust | 0 |
field_embedding = self._process_field(field_input, self.field_processors[field_idx])
# Pool the sequence dimension
field_embedding = field_embedding.mean(dim=1)
field_embeddings.append(field_embedding)
# Stack field embeddings for cross-attention
field_tensor = ... | Python | 1 |
{
lhs: Box<StatementElement<'a>>,
rhs: Box<StatementElement<'a>>,
},
Cast {
typ: NativeType,
value: Box<StatementElement<'a>>,
},
Ternary {
cond: Box<StatementElement<'a>>,
lhs: Box<StatementElement<'a>>,
rhs: Box<StatementElement<'a>>,
},
FunctionCall {
name: Cow<'a, str>,
parametres: Vec<Stat... | Rust | 0 |
};
extern crate web_sys;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
fn set_panic_hook() {
// When the `console_error_panic_hook` feature is enabled, we can... | Rust | 0 |
}
}
impl ::std::fmt::Debug for UpdateGCSafePointResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for UpdateGCSafePointResponse {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufVal... | Rust | 0 |
el_domain',
'vpopmail_del_domain_ex',
'vpopmail_del_user',
'vpopmail_error',
'vpopmail_passwd',
'vpopmail_set_user_quota'],
'xattr': ['xattr_get',
'xattr_list',
'xattr_remove',
'xattr_set',
'xattr_supporte... | Python | 1 |
String::from("FeatureCollection Must have message property for delta"), None)); }
}
};
let trans = match conn.transaction() {
Ok(trans) => trans,
Err(err) => { return Err(HecateError::new(500, String::from("Failed to open transaction"), Some(err.to_string()))); }
... | Rust | 0 |
ptmulti("l", "log", &format!("logfile ({})", logfile), "LOG");
opts.optmulti(
"",
"cccsv",
&format!("country continent csv file ({})", cccsv),
"CSV",
);
opts.optmulti(
"",
"geoip",
&format!("GeoIP country mmdb ({})", geoip2_db),
"MMDB",
);
... | Rust | 0 |
,
}]
}
elif endpoint == 'api/l10n_my_edi/1/get_submission_statuses':
return {
'statuses': {
'123458974513518': {
'status': 'valid',
'reason': '',
'valid_datetime': ... | Python | 1 |
context().unwrap();
let prog = ctx.create_program_from_source(src);
prog.build(&device).unwrap();
let k = prog.create_kernel("test");
let v = ctx.create_buffer_from(vec![1is], CL_MEM_READ_WRITE);
k.set_arg(0, &v);
let e = queue.enqueue_async_kernel(&k, 1is, None, ());
... | Rust | 0 |
, txn_id, &path).await?;
let mut chains = HashMap::<Id, Chain>::new();
for (id, (class, schema)) in chain_schema.into_iter() {
let dir = dir.get_or_create_dir(txn_id, id.clone()).await?;
let chain = match class {
ChainType::Sync => {
let schema =
... | Rust | 0 |
(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
self.w
}
}
#[doc = "Reader of field `PAD72_DS1`"]
pub type PAD72_DS1_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `PAD72_DS1`"]
pub struct PAD72_DS1_W<'... | Rust | 0 |
Args:
molfile_string: String representation of a molfile
Returns:
CDK IAtomContainer molecule with existing coordinates
Raises:
ValueError: If the molfile cannot be parsed
"""
if not molfile_string:
raise ValueError("No molfile content provided")
try:
# ... | Python | 1 |
private_key_path),
&network_settings
.wg_private_key
.expect("How did we get here without generating a key above?"),
)?;
// same thing but with the exit key
KI.create_wg_key(
Path::new(&exit_network_settings.wg_private_key_path),
&exit_network_settings.wg_priv... | Rust | 0 |
encoding.
kernel_preds = kernel_preds.view(
kernel_preds.size(0), -1, self.dynamic_conv_size,
self.dynamic_conv_size)
mask_preds = F.conv2d(
mask_feats, kernel_preds, stride=1).squeeze(0).sigmoid()
# mask.
masks = mask_preds > cfg.mask_thr
sum_... | Python | 1 |
::error::Error + 'static)> {
match self {
WaitForTransactionError::GetTransactionError(e) => Some(e),
_ => None,
}
}
}
use cargo::ops;
use cargo::util::{CliResult, Config};
#[derive(Deserialize)]
pub struct Options {
arg_crate: Option<String>,
flag_token: Option<Stri... | Rust | 0 |
// Run bn256 Add between input's p1 and p2
//bn256g1::runBn256Add()
}<filename>sim/simulation/src/systems/mineral_system.rs
use crate::indices::{EntityId, WorldPosition};
use crate::profile;
use crate::storage::views::{DeferredDeleteEntityView, UnsafeView, View};
use crate::tables::JoinIterator;
use crate::{co... | Rust | 0 |
GROUP BY i.id"""
cur.execute(sql)
res = cur.fetchall()
return res
except:
traceback.print_exc()
return res
def get_workspace_instance_list(workspace_id):
"""resource_group은 left join (gpu 설정 안한 경우 group_id 없는 경우도 있음)
"""
res = []
try:
with get_db(... | Python | 1 |
Drive {
temp_dir: Option<TempDir>,
target: PathBuf,
path: PathBuf,
}
impl ConfigDrive {
fn new() -> Result<Self> {
// maybe its already mounted
let path = Path::new("/media/ConfigDrive/cloudstack/metadata/");
if path.exists() {
return Ok(ConfigDrive {
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from typing import Union
from openvino._pyopenvino import FrontEnd as FrontEndBase
from openvino._pyopenvino import FrontEndManager as FrontEndManagerBase
from openvino._pyopenvino import InputModel
from openvino... | Python | 1 |
ch.pitch_range > 1.5:
pitch_multiplier *= 1.2 # Wider pitch ranges take longer
# Calculate final estimate
return int(base_time * style_multiplier * pitch_multiplier)
# Additional endpoint to get vocals status (optional but recommended)
@router.get("/{vocals_id}", response_model=model_types.Vo... | Python | 1 |
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and ... | Python | 1 |
given format arguments. */
pub fn write_args(domain: Domain, level: Level, args: fmt::Arguments) {
unsafe {
if CBLLog_WillLogToConsole(domain as u8, level as u8) {
write(domain, level, &format!("{:?}", args));
}
}
}
//////// LOGGING MACROS:
/// A macro that writes a formatted E... | Rust | 0 |
"test_schema/*",
],
},
install_requires=install_requires,
extras_require=extras_require,
entry_points={
"console_scripts": [
"schema-salad-tool=schema_salad.main:main",
"schema-salad-doc=schema_salad.makedoc:main",
]
},
zip_safe=True,
cl... | Python | 1 |
# Copyright 2017 Google Inc. 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 applicable law or agree... | Python | 1 |
x = b'zoot !'
print(x)
string1 = "geeks For GEEgKS"
print("Title case: ", string1.title())
print("lower case: ", string1.lower())
print("upper case: ", string1.upper())
print("count total 'g': ", string1.lower().count('g'))
print('center: ', string1.center(1))
print(string1.capitalize())
print(string1.casefold())
| Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import OptionParser
import gkcrp
import re
import codecs
import subprocess
import os
patsp = re.compile(r'\s+')
def gen(basedir, aspect, trainfile):
f = codecs.open(trainfile, 'a', 'utf8')
for text in gkcrp.alltext(basedir, aspect):
for item... | Python | 1 |
> {
Ok(*v)
}
fn try_from_i64(v: &i64) -> Result<Self> {
i32::try_from(*v)
.with_context(|| format!("cannot convert i64 value ({}) into i32", v))
.map_err(SpringError::Sql)
}
fn try_from_f32(v: &f32) -> Result<Self> {
Ok(v.ceil() as i32)
}
}
impl ToNn... | Rust | 0 |
exports_t,
) {
let mut instance = unsafe { &mut *(instance as *mut Instance) };
let named_exports: Box<NamedExports> =
Box::new(NamedExports(instance.exports().map(|e| e.into()).collect()));
unsafe { *exports = Box::into_raw(named_exports) as *mut wasmer_exports_t };
}
pub struct NamedExports(Vec<N... | Rust | 0 |
d as PrimeField>::BigInt::from_bits_be(
&cur_bits[cur_bits.len() - params.bits_per_limb..],
); // therefore, the lowest `bits_per_non_top_limb` bits is what we want.
limbs.push(BaseField::from_bigint(cur_mod_r).unwrap());
cur.divn(params.bits_per_limb as u32);
... | Rust | 0 |
awEvent::ScheduleDispatch(2, 0));
assert!(System::events()
.iter()
.any(|record| record.event == schedule_dispatch_event));
assert_noop!(
ScheduleUpdateModule::cancel_deplayed_dispatch(Origin::signed(2), 2, 0),
Error::<Runtime>::NoPermission
);
// OperationalDispatches
let call = Call::Balances(... | Rust | 0 |
import json
from ...backends.facebook import API_VERSION
from ...exceptions import AuthCanceled, AuthUnknownError
from .oauth import OAuth2Test
from .test_open_id_connect import OpenIdConnectTestMixin
class FacebookOAuth2Test(OAuth2Test):
backend_path = "social_core.backends.facebook.FacebookOAuth2"
user_dat... | Python | 1 |
const DictionaryInfo<'a>;
/// Return transtion cost from rcAttr to lcAttr.
/// @return transtion cost
fn mecab_model_transition_cost(
model: *const RawModel,
rcAttr: c_ushort,
lcAttr: c_ushort,
) -> c_int;
fn mecab_model_lookup<'a>(
model: *mut RawModel,
beg... | Rust | 0 |
: &mut usize) -> PathBuf {
loop {
let path = PathBuf::from(format!("{}{}", prefix, ctr));
if !path.exists() {
return path;
} else {
*ctr += 1;
}
}
}
fn main() -> Result<()> {
env_logger::init();
let prefix = env::args().nth(1)
.context("... | Rust | 0 |
impl Dilation {
pub fn setStructuringElementSize(&self, size: i32) {
unsafe { FASTDilationSetStructuringElementSize(self.ir, size) };
}
}
impl Erosion {
pub fn setStructuringElementSize(&self, size: i32) {
unsafe { FASTErosionSetStructuringElementSize(self.ir, size) };
}
}
impl Seede... | Rust | 0 |
utput.vertices[masks][:, foot_idxs]
foot_disp = (foot_loc[1:] - foot_loc[:-1]).norm(2, dim=-1)
contact = foot_disp[:] < thr
pred_feet_loc = pred_output.vertices[:, foot_idxs]
pred_disp = (pred_feet_loc[1:] - pred_feet_loc[:-1]).norm(2, dim=-1)
error = pred_disp[contact]
return error.cpu().num... | Python | 1 |
info!("D = {}", esc.throttle(QuadMotor::D) * 100.0);
}
// User has set a throttle for an output
Ok(Some(Command::SetThrottle { output, percent })) => {
log::info!("SETTING '{:?}' = {}% throttle", output, percent);
esc.set_throttle(output, percent / 100... | Rust | 0 |
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.ext.asyncio import async_sessionmaker
from sqlalchemy.orm import declarative_base
from app.settings import *
# Use asyncpg driver for PostgreSQL async support
SQLALCHEMY_DATABASE_URL = f'postgresql+asyncpg://{POSTGRES_USER}:{POSTGRES_... | Python | 1 |
Ok(Url::parse(&**self)?)
}
}
// impl<'a> IntoUrl for String {
// fn into_url(self) -> Result<Url, Error> {
// Ok(Url::parse(&*self)?)
// }
// }
// pub fn into_url<U: IntoUrl>(u: U) -> Result<Url, Error> {
// match u.into_url() {
// Ok(url) => Ok(url),
// Err(err) => Err(err),
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.