text string | label_name string | labels int64 |
|---|---|---|
tangle {
const fn new(origin: Point, width: f32, height: f32) -> Self {
Self {
origin,
width,
height,
}
}
}
struct Gradient {
pub extents: Rectangle,
pub color_first: u32,
pub color_second: u32,
}
impl Gradient {
const fn new(extents: Rectang... | Rust | 0 |
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2024 Henri Wahl <henri@dhcpy6d.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any lat... | Python | 1 |
try:
idade = int(input("digite a sua idade:"))
except:
print("voce digitou errado a idade") | Python | 1 |
std::ops::Deref;
match v {
Some(t) => {
arrow_array_deserialize_iterator_internal::<<T as ArrowField>::Type, T>(t.deref())
.ok()
.map(|i| i.collect::<Vec<<T as ArrowField>::Type>>())
}
None => None,
}
}
// Blanket implementation for Vec
impl<... | Rust | 0 |
remove.contains(hash) {
delete(&path);
}
}
}
}
Ok(())
}
use std::{borrow::Cow, io::Write};
use log::debug;
use petgraph::Direction;
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use rustc_hash::FxHashSet;
use smol_str::SmolStr;
use ... | Rust | 0 |
!= length && length > 2 && dummy_length > 2));
verify_len_dist(in_, inend, pos, dist, length);
store_litlen_dist(length, dist, pos, store);
_total_length_test += length as usize;
} else {
length = 1;
store_litlen_dist(in_[pos] as u16, 0, pos, store);
... | Rust | 0 |
# Problem: Number of Boomerangs - https://leetcode.com/problems/number-of-boomerangs/description/
class Solution:
def numberOfBoomerangs(self, points: List[List[int]]) -> int:
res = 0
for i in points:
dist_count = {}
for j in points:
if i == j:
... | Python | 1 |
assert!(ok);
let mut result = HashMap::default();
for list_index in set.list_indices() {
let result_list = set.iter(list_index).copied().collect();
result.insert(list_index, result_list);
}
assert_eq!(result, expected);
}
/// Given a linked list set with multiple linked lists in ... | Rust | 0 |
# arr =3 -7 0
def minimumAbsoluteDifference(arr):
arr.sort()
min_diff = float('inf')
for i in range(len(arr) - 1):
diff = abs(arr[i] - arr[i+1])
if diff < min_diff:
min_diff = diff
return min_diff
if __name__ == '__main__':
arr = list(map(int, input().rstrip().split... | Python | 1 |
r:
HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY.
*backup-window-start*::: Start time of the interval during which
backup jobs should be executed. It can be defined as backup-window-start=2,
that means backup window starts at 2 a.m. The start time and end time must
have an ... | Python | 1 |
from typing import Optional
from agenthalo.core.tool import AgentHaloToolBase
from agenthalo.services.cookiefun.cookiefun_client import AgentMetrics, CookieFunClient, Interval, PagedAgentsResponse
class GetCookieMetricsByTwitter(AgentHaloToolBase):
"""
Retrieve AI agent metrics such as mindshare, market cap,... | Python | 1 |
os.makedirs(os.path.dirname(fixed_path))
if isinstance(entry, FileEntry):
with open(fixed_path, 'wb') as out:
shutil.copyfileobj(entry.fileobj, out)
elif isinstance(entry, SymlinkEntry):
os.symlink(entry.target, fixed_path)
else:
raise TypeError('unknown entry typ... | Python | 1 |
self.conv_dw(x)
x = self.bn_dw(x)
if self.se is not None:
x = self.se(x)
x = self.ghost2(x)
x += self.shortcut(residual)
#print("check ghostv2BOTTLENCK OUTPUIT size:",x.size())
return x
class Contract(nn.Module):
# Contract width-height into chann... | Python | 1 |
no hypertensive retinopathy",
1: "hypertensive retinopathy"}
data = []
for i in range(dataframe.shape[0]):
iFile = dataframe["Image"][i]
dr = dataframe["Hypertensive Retinopathy"][i]
if os.path.isfile(PATH_DATASETS + path_dataset + subpath +subpath_images + iFile):
... | Python | 1 |
0R, {0}", in(reg) vaddr);
asm!("mrs {0}, PAR_EL1", out(reg) taddr);
return (taddr & 0xffffffffff000) | (vaddr & 0xFFF);
}
}
pub fn translate_el1_stage1(vaddr: u64) -> u64
{
unsafe
{
let mut taddr: u64 = 0;
asm!("AT S1E1R, {0}", in(reg) vaddr);
asm!("mrs {0}, PAR_EL1", out(reg) taddr);
... | Rust | 0 |
=> {
let amounts = vec![10000000u128, 20000000u128];
assert_ok!(StableAsset::mint(Origin::signed(1), 0, amounts, 0));
assert_noop!(
StableAsset::redeem_proportion(
Origin::signed(1),
0,
100000000000000000u128,
vec![0u128, 0u128, 0u128]
),
Error::<Test>::ArgumentsMisma... | Rust | 0 |
27b70a8546d22ffc,0x2e1b21385c26c926,0x4d2c6dfc5ac42aed,0x53380d139d95b3df,0x650a73548baf63de,0x766a0abb3c77b2a8,0x81c2c92e47edaee6,0x92722c851482353b,
0xa2bfe8a14cf10364,0xa81a664bbc423001,0xc24b8b70d0f89791,0xc76c51a30654be30,0xd192e819d6ef5218,0xd69906245565a910,0xf40e35855771202a,0x106aa07032bbd1b8,
0x19a4c1... | Rust | 0 |
>
//! Ensure be_list is sorted.
let len = self.be_list.len();
let mut b = usize::MAX;
for i in self.get_be_list_leftmost(minx)..len {
if self.be_list[i].1 == id {
b = i;
break;
}
}
let mut e = usize::MAX;
for i in se... | Rust | 0 |
turns:
tensor: Elementwise inverse hyperbolic cosine.
"""
y = numpy.clip(x,1+T.EPSILON, numpy.inf)
return ne.evaluate('arccosh(y)')
def logit(x: T.Tensor) -> T.Tensor:
"""
Elementwise logit function of a tensor. Inverse of the expit function.
Args:
x (between 0 and 1): A tenso... | Python | 1 |
RSION=8"];
#[cfg(feature = "v7")]
return &["-DNAPI_VERSION=7"];
#[cfg(feature = "v6")]
return &["-DNAPI_VERSION=6"];
#[cfg(feature = "v5")]
return &["-DNAPI_VERSION=5"];
#[cfg(feature = "v4")]
return &["-DNAPI_VERSION=4"];
#[cfg(feature = "v3")]
return &["-DNAPI_VERSION=3"];
... | Rust | 0 |
;
while x_cur <= x_max {
points.push((x_cur, evaluate(&parsed_eq, x_cur)?));
x_cur += step_size;
}
Ok(EquationData {
literal,
points,
zeros,
})
}
#[derive(Debug, PartialEq)]
pub struct EquationData {
pub literal: String,
pub points: Vec<(f32, f32)>,
... | Rust | 0 |
ogical-not (!) is not interchangeable with ones-complement (~)",
6328 : "Wrong parameter type passed",
6334 : "Sizeof operator applied to an expression with an operator might yield unexpected results",
6336 : "Arithmetic operator has precedence over question operator, use parentheses to clarify intent",
6522 : "Inv... | Python | 1 |
#!/usr/bin/env python3
"""Entry point for PicSort executable."""
import sys
import os
# Add the project root to Python path
project_root = os.path.dirname(os.path.abspath(__file__))
if project_root not in sys.path:
sys.path.insert(0, project_root)
# For PyInstaller, also add the src directory to path
src_path = o... | Python | 1 |
ezultate Random Forest, fisier plin:\n")
print(results)
# 8. Plot Predicții vs Valori reale
for target in ['NO2', 'PM2.5', 'PM10']:
y_test, y_pred = predictions[target]
min_axis = min(min(y_pred), min(y_test))
max_axis = max(max(y_pred), max(y_test))
plt.figure(figsize=(8,5))
plt.scatter(y_test, y... | Python | 1 |
import tempfile
import pytest
from embedchain.loaders.xml import XmlLoader
# Taken from https://github.com/langchain-ai/langchain/blob/master/libs/langchain/tests/integration_tests/examples/factbook.xml
SAMPLE_XML = """<?xml version="1.0" encoding="UTF-8"?>
<factbook>
<country>
<name>United States</name>
<... | Python | 1 |
etTextRelBase(ctx: *mut _Unwind_Context) -> _Unwind_Ptr {
unreachable!();
}
#[no_mangle]
pub unsafe extern "C" fn _Unwind_GetDataRelBase(ctx: *mut _Unwind_Context) -> _Unwind_Ptr {
unreachable!();
}
#[no_mangle]
pub unsafe extern "C" fn _Unwind_GetLanguageSpecificData(ctx: *mut _Unwind_Context) -> *mut c_void... | Rust | 0 |
import MySQLdb
try:
query="update stdinfo set birth='18july1988' where name='anirudha'"
mycon=MySQLdb.connect(host="localhost",user="root",passwd="",database="stddbms_info")
cur=mycon.cursor()
cur.execute(query)
mycon.commit()
print("\n Record updated sucessfully")
except:
print("\n Record ... | Python | 1 |
'frame_id': frame_id})
for token_name, instance in instances.items():
pre_time = None
centers = []
time_intervels = []
for ins in instance:
if isinstance(ins['timestampe'], float):
cur_time = ins['timestampe']
... | Python | 1 |
): (u32, usize) = <u32>::from_bytes(bytes)?;
Some((EventMask { inner: inner }, sz))
}
#[inline]
fn size(&self) -> usize {
self.inner.size()
}
}
impl core::ops::Not for EventMask {
type Output = EventMask;
#[inline]
fn not(self) -> EventMask {
EventMask { inner: !self.... | Rust | 0 |
t(f"Epoch {epoch + 1}/{epochs}, Validation Loss: {avg_val_loss:.4f}")
import matplotlib.pyplot as plt
def plot_images(original, reconstructed, n=10):
plt.figure(figsize=(10, 4))
for i in range(n):
plt.subplot(2, n, i + 1)
plt.imshow(original[i].view(28, 28).cpu().numpy(... | Python | 1 |
a_api_macros::_FakeDeriveRumaApi)]
#[ruma_api(error_ty = #error_ty)]
#( #struct_attributes )*
pub struct #response_ident {
#fields
}
}
}
}
pub mod api;
// fic remotec2
#[macro_use]
pub mod rpc;
pub mod types;
use arch::memory::*;
use arch::pagi... | Rust | 0 |