text string | label_name string | labels int64 |
|---|---|---|
from django.urls import path, include
urlpatterns = [
path(
"api/",
include("ranker.docs.urls"),
),
path(
"api/",
include("ranker.accounts.urls"),
),
path(
"api/",
include("ranker.users.urls"),
),
path(
"api/",
include("ranker... | Python | 1 |
c @ s g Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m
Z
m Z m Z d d l
m Z m Z m Z d d l m Z m Z e j d k p e e d s e d n e j d k rd d l Z d d l m Z d
Z d Z n d Z d
Z e a ... | Python | 1 |
from django.contrib import admin
from django.urls import path, include
from car import views
urlpatterns = [
path('', views.index, name = "index"),
path('index.html', views.index, name = "index"),
path('listing-classic.html', views.listing_classic, name = "listing-classic"),
path('listing-detail.h... | Python | 1 |
"model_parameters/finance/finance.xlsx",
"liabilities_yield",
"HOUSEHOLDS_LIABILITIES_YIELD",
{
"REGIONS 35 I": _subscript_dict["REGIONS 35 I"],
"HOUSEHOLDS I": _subscript_dict["HOUSEHOLDS I"],
},
_root,
{
"REGIONS 35 I": _subscript_dict["REGIONS 35 I"],
"HOUSEHOL... | Python | 1 |
return True, f'{msg}; {v_msg}'
else:
self.get_logger().warn(f'Configured endpoint ok but verification failed: {v_msg}; attempting legacy fallback')
else:
self._states[which] = (mode, mode == 1)
return ok, msg
... | Python | 1 |
le tree hash function for leaf nodes.
pub fn leaf_hash_fn(bytes: &[u8]) -> [u8; 32] {
const LEAF_PREFIX: u8 = 0x00;
hash_with_prefix(&[LEAF_PREFIX], bytes)
}
// Merkle tree Hash function for internal nodes.
pub fn internal_hash_fn(bytes: &[u8]) -> [u8; 32] {
const NODE_PREFIX: u8 = 0x01;
hash_with_pref... | Rust | 0 |
from django.db.models import Count, Max, Q
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
from catalog.models import Product
from inventory.models import Item, TestBench
from inventory.serializers import (
ItemSerializer,
ProductStockSerializer,
TestBenchSerializer,
)
class ItemVi... | Python | 1 |
Zd Zd Zd Zd Zd Z d Z
d Zd
Zd Z
d Zd
ZddZd Zd Zd Zy)AttributesImplc || _ y)zQNon-NS-aware implementation.
attrs should be of the form {name : value}.N_attrs)r attrss r r zAttributesImpl.__init__ s r c ... | Python | 1 |
from flask import Flask, render_template_string
import threading
app = Flask(__name__)
@app.route('/')
def home():
return render_template_string('''
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ham Price Tracker</title>
</head>
... | Python | 1 |
= serde_json::from_str(msg)?;
match value["id"].as_str() {
Some(_idstr) => {}
_ => {
// subscriptions
debug!("no id field found in response. must be subscription");
debug!("method: {:?}", value["method"].as_str());
match value["method"].as_str() {
... | Rust | 0 |
#!/usr/bin/python3
"""Defines a 'Square' class with a private instance attribute"""
class Square:
"""Definition of 'Square'"""
def __init__(self, size=0):
"""Inits Square with 'size' private instance attribute
Args:
size: An integer size of the square.
Raises:... | Python | 1 |
# app/utils/test_wiki_structure.py
import requests
from bs4 import BeautifulSoup
def get_page_content(url):
"""Get the HTML content of a wiki page."""
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
... | Python | 1 |
/// vesting bucket.
#[transactional]
fn do_remove_vesting_schedule(target: &T::AccountId, bucket: VestingBucket) -> DispatchResult
where
<T as frame_system::Config>::AccountId: From<[u8; 32]>,
{
let now = <frame_system::Pallet<T>>::block_number();
<VestingSchedules<T>>::try_mutate_exists(target, |maybe_sched... | Rust | 0 |
from flask import Blueprint, jsonify
# Create a Flask Blueprint for stock routes
stock_bp = Blueprint('stock', __name__)
# Example route (you can add your real routes here)
@stock_bp.route('/stocks', methods=['GET'])
def get_stocks():
# Just returns a sample response for now
return jsonify({"message": "Stocks... | Python | 1 |
p)[2:]).replace(
os.path.sep, "-"
),
)
else:
oup_file = os.path.join(
oup_dir,
"%s-%s.json"
% (
os.path.sep.join(opts.file.split(os.path.sep)[2:]).replace(
os.path.sep, "-"
),
... | Python | 1 |
considered dead immediately after creation
#[test]
fn stillborn_entities() {
struct LCG(u32);
const RANDMAX: u32 = 32_767;
impl LCG {
fn new() -> Self {
LCG(0xdead_beef)
}
fn geni(&mut self) -> i8 {
((self.gen() as i32) - 0x7f) as i8
}
fn ge... | Rust | 0 |
IW, SBIW, one word LDS/STS
match op {
Operation::Adiw | Operation::Sbiw => self.allow(Avr8l),
_ => true,
}
} else {
false
}
}
_ => true,
}
}
... | Rust | 0 |
# -*- coding: utf-8 -*-
# This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
# License: MS-RSL – see LICENSE.md for details
# thin compatibility layer to support python 2 and 3
# to avoid an additional dependency on six & others
from __future__ import absolute_import, print_function
import sys
PY2 = sys.v... | Python | 1 |
ACK".to_owned(),
err,
}
})
}
// Sends a nak with ranges of missing chunks
pub fn nak(channel_id: u32, hash: &str, missing_chunks: &[u32]) -> Result<Vec<u8>, ProtocolError> {
let chunks = if missing_chunks.len() > 20 {
&missing_chunks[0..20]
} else {
&missing_chunks
}... | Rust | 0 |
_id.to_string(),
self.parent_service_instance_id.to_string(),
self.entry_service_instance_id.to_string(),
SegmentRef::string_or_id_to_encode_base64(&self.network_address, self.network_address_id),
SegmentRef::string_or_id_to_encode_base64(&self.entry_endpoint, self.entry_... | Rust | 0 |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
"""
Functions for saving average attention map
"""
import os
import torch
import numpy as np
import utils
def init(model, args):
for tmp_i in range(12):
model.blocks[tmp_i].attn.num_attention.fill_(0)
model.blocks[tmp_i].attn.att... | Python | 1 |
maintenance_results['cleanup'] = cleanup_result.get()
except Exception as e:
logger.error(f"Failed to cleanup translations: {e}")
maintenance_results['cleanup'] = {'error': str(e)}
logger.info("Periodic i18n maintenance completed")
return {
... | Python | 1 |
}
}
}
}
*manhattans.iter().min().unwrap() as u32
}
fn mut_grid_3a(grid: &mut Vec<Vec<bool>>, wires: Vec<&str>) {
let mut grid_point: GridPoint = GridPoint {
x: GRID_X / 2,
y: GRID_Y / 2,
};
for w in wires {
let dir = w.chars().next().unwrap();
let... | Rust | 0 |
d(deserialize = "'de: 'lf"))]
struct Root<'lf> {
sports_content: Content<'lf>,
}
#[derive(Deserialize)]
#[serde(bound(deserialize = "'de: 'lf"))]
struct Content<'lf> {
game: Game<'lf>,
}
#[derive(Deserialize)]
#[serde(bound(deserial... | Rust | 0 |
. The behaviour being tested should be the same
// with the standard lib disabled.
//
// The alternative would be for each of these tests to be defined in a separate
// file, which is :(
#![cfg(feature = "std")]
#[macro_use]
extern crate tracing;
use tracing::{
span,
subscriber::{with_default, Interest, Subscr... | Rust | 0 |
pub const SRC_ADDR: IPAddr = IPAddr([
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
]);
pub const DST_ADDR: IPAddr = IPAddr([
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
]);
/* 6LoWPAN Constants */
const DEFA... | Rust | 0 |
t")
@pytest.mark.skipif(find_test_pdf() is None, reason="No test PDF file found")
def test_add_content_apply_exclusions():
"""Test that add_content instance method also supports apply_exclusions."""
pdf_path = find_test_pdf()
pdf = PDF(pdf_path)
page = pdf[0]
# Find a text marker
text_elemen... | Python | 1 |
layer properties has been "applied"
if not self.isVisible():
# If the dock is not visible, we don't care
return
layer = self.layer.currentLayer()
if not layer:
return
if iface.activeLayer() != layer:
# This function is called when the pr... | Python | 1 |
# Copyright 2025 The kauldron 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 in... | Python | 1 |
uplink_sender,
lifecycle_sender,
id: Default::default(),
}
}
pub fn controller(&self) -> DemandMapLaneController<Key, Value> {
DemandMapLaneController(self.clone())
}
}
impl<Key, Value> LaneModel for DemandMapLane<Key, Value>
where
Key: Form,
Va... | Rust | 0 |
import os
import sys
from antlr4 import *
if "." in __name__:
from .ptmlTranslator import ptmlTranslator
from .ptmlParser import ptmlParser as Parser
from .ptmlLexer import ptmlLexer as Lexer
else:
from ptmlTranslator import ptmlTranslator
from ptmlParser import ptmlParser as Parser
from ptmlL... | Python | 1 |
ations)
# TODO: meta is included regardless of whether include_meta is True or False
ojr = OboJsonGraphRenderer(include_meta=args.include_meta)
json_obj = ojr.to_json(subont, include_meta=args.include_meta)
return json_obj
@api.doc(params={'id': 'CURIE identifier of a GO term, e.g. GO:0... | Python | 1 |
out
}
impl_from_quint!(32);
}
impl Quintable for u64 {
fn to_quint(&self) -> String {
let mut out = String::with_capacity(23);
let first = ((self & 0xFFFF000000000000) >> 48) as u16;
let second = ((self & 0x0000FFFF00000000) >> 32) as u16;
let third = ((self & 0x000... | Rust | 0 |
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from rag import RetrievalAugmentedGeneration
api_base = 'https://australian-assigned-scanners-crowd.trycloudflare.com/v1'
text_file_path = "./aipg.txt"
load_dotenv()
token = os.environ.get("DISCORD_TOKEN_RAG")
# Initialize the ra... | Python | 1 |
= "random_simple_non_symmetric":
symmetric_flag = random.choice([True, False])
if symmetric_flag:
# simple_game_non_symmetric
stag_hunt_rewards: list = [[[3, 3], [-3, -3]], [[-1, -1], [1, 1]]]
else:
# simple_game_non_symmetric_different
sta... | Python | 1 |
name: String, client: TeslaClient) -> Result<(), Error> {
let vehicle = client.get_vehicle_by_name(vehicle_name.as_str())
.ok()
.expect("could not find vehicle")
.expect("could not find vehicle");
let vclient = client.vehicle(vehicle.id);
let influxc = get_influx_client(cfg.clone())... | Rust | 0 |
{ iter: self, ctx }
}
}
impl<'a, I> MapConvWith<'a> for I
where
I: Iterator + 'a,
I::Item: ConvWith,
{
type Ctx = <I::Item as ConvWith>::Ctx;
type Output = <I::Item as ConvWith>::Output;
}
pub struct ConvWithIter<'a, I, Ctx: 'a> {
iter: I,
ctx: &'a Ctx,
}
impl<'a, I, Ctx> Iterator for Co... | Rust | 0 |
),
(27, 27),
(28, 28),
(29, 29),
(30, 30),
(31, 31),
(32, 32),
]),
expect![[r#"
{
"0": 0,
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
... | Rust | 0 |
# -*- coding: utf-8 -*-
# TencentBlueKing is pleased to support the open source community by making
# 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except
# in c... | Python | 1 |
N = nr::CAP_SYS_ADMIN,
/// `CAP_SYS_BOOT` (from Linux)
CAP_SYS_BOOT = nr::CAP_SYS_BOOT,
/// `CAP_SYS_NICE` (from Linux)
CAP_SYS_NICE = nr::CAP_SYS_NICE,
/// `CAP_SYS_RESOURCE` (from Linux)
CAP_SYS_RESOURCE = nr::CAP_SYS_RESOURCE,
/// `CAP_SYS_TIME` (from Linux)
CAP_SYS_TIME = nr::CAP_SYS... | Rust | 0 |
ily evaluated statics.
Using this macro, it is possible to have `static`s that require code to be
executed at runtime in order to be initialized.
This includes anything requiring heap allocations, like vectors or hash maps,
as well as anything that requires function calls to be computed.
# Syntax
```ignore
lazy_stat... | Rust | 0 |
#!/usr/bin/env python3
"""Test if WAL mode configuration is causing hangs."""
import sqlite3
import tempfile
import os
import signal
import sys
def alarm_handler(signum, frame):
print("❌ HANG DETECTED: Operation taking too long!")
sys.exit(1)
signal.signal(signal.SIGALRM, alarm_handler)
def test_wal_configu... | Python | 1 |
hed.
.service(Files::new("/", "./static/root/").index_file("index.html"))
})
.bind("127.0.0.1:8080")?
.run()
.await
}
async fn create_pool() -> SqlitePool {
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL is not set in .env file");
SqlitePool::new(&database_url)
... | Rust | 0 |
rate::utils::JsonMessageError::DownloadError(e) => {
println!(
"=== ERROR ===\nCould not download attachment: {}\n=== END ===",
e
);
$crate::failure!($ctx, $msg, "Could not download attachment!");
}
$crate::u... | Rust | 0 |
is not equal to the value at
/// `start_cycle`.
pub fn cached_next_transition(&mut self, signal_index: usize, mut start_cycle: usize) -> Option<usize> {
let mut horizon = std::cmp::min(
start_cycle + SEARCH_HORIZON,
self.num_cycles()
);
while horizon <= self.num... | Rust | 0 |
date_select)
editing_type: bpy.props.IntProperty(description="用于记录面板类型", override={'LIBRARY_OVERRIDABLE'})
preview: bpy.props.BoolProperty(
default=True,
description="开关所有约束以便预览烘培出的动画之类的",
override={'LIBRARY_OVERRIDABLE'},
update=update_preview
)
sync_select: bpy.p... | Python | 1 |
format!(
"{}/tests/fake_data_generation/random_{}_{}_{}",
env!("CARGO_MANIFEST_DIR"),
NUM_TIMESTEPS,
VOCAB_SIZE,
EMBEDDING_DIM
);
let mut input_file = File::open(file_name).unwrap();
let mut input_buf = Vec::new();
input_file.r... | Rust | 0 |
ll::AUDIO_S16LSB;
pub const AUDIOU16MSB : AudioFormat = ll::AUDIO_U16MSB;
pub const AUDIOS16MSB : AudioFormat = ll::AUDIO_S16MSB;
pub const AUDIOU16 : AudioFormat = ll::AUDIO_U16;
pub const AUDIOS16 : AudioFormat = ll::AUDIO_S16;
pub const AUDIOS32LSB : AudioFormat = ll::AUDIO_S32LSB;
pub const AUDIOS32MSB : Aud... | Rust | 0 |
for row in range(7):
for column in range(5):
if column==0 or column == 4 or (row==2 and column!=2)or row==3 and column==2:
print("*",end=" ")
else:
print(end=" ")
print( ) | Python | 1 |
trix3x3 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct aiMatrix4x4 {
pub a1: ::libc::c_float,
pub a2: ::libc::c_float,
pub a3: ::libc::c_float,
pub a4: ::libc::c_float,
pub b1: ::libc::c_float,
pu... | Rust | 0 |
from modules.model.ChromaModel import ChromaModel
from modules.modelSaver.mixin.LoRASaverMixin import LoRASaverMixin
from modules.util.enum.ModelFormat import ModelFormat
import torch
from torch import Tensor
from omi_model_standards.convert.lora.convert_chroma_lora import convert_chroma_lora_key_sets
from omi_model_... | Python | 1 |
wrap();
let res1 = client.request(req);
let srv1 = poll_fn(|| {
try_ready!(sock1.read(&mut [0u8; 512]));
try_ready!(sock1.write(b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
Ok(Async::Ready(()))
}).map_err(|e: ::std::io::Error| panic!("srv1 poll_fn error:... | Rust | 0 |
from django.shortcuts import render
from rest_framework import viewsets, filters, pagination
from .models import Campaign
from .serializers import CampaignSerializer
from rest_framework.response import Response
# Create your views here.
class CampaignPagination(pagination.PageNumberPagination):
page_size = 25
... | Python | 1 |
and += 2u32.cast_to()
}
}
}
(inexact, significand >> 2)
}
/// Get the finite number overflowing result in current rounding mode.
fn round_overflow(sign: bool) -> Self {
set_exception_flags(ExceptionFlags::OVERFLOW | ExceptionFlags::INEXACT);
// ... | Rust | 0 |
,相当于滑动窗口操作,也即只有卷、没有积
# # 参数为(dim,size,step):dim表明想要切分的维度,size表明切分块(滑动窗口)的大小,step表明切分的步长
# # 这里用于从一个分批输入的张量中提取滑动的局部块
# x_enc = x_enc.permute(0,2,1) # [batch_size, channel, seq_len]
# x_enc = x_enc.unfold(dimension=-1, size=self.patch_len, ste... | Python | 1 |
once
]);
assert_eq!(
"0000000000000002a7bbd25a417c0374cc55261021e8a9ca74442b01284f0569",
sha256d::Hash::hash(&header).to_hex()
);
// as_inner() is the real sequence
assert_eq!(
sha256d::Hash::hash(&header).as_inner(),
sha256::Hash::hash(sha256::Hash::hash(&header).a... | Rust | 0 |
>1-10
use async_trait::async_trait;
use thiserror::Error;
use crate::domain::entities::chapter::Chapter;
#[derive(Debug, Error)]
pub enum ChapterRepositoryError {
#[error("database error: {0}")]
DbError(#[from] sqlx::Error),
#[error("bad argument error: {0}")]
BadArgsError(String),
}
#[async_trait]
... | Rust | 0 |
from .temp import *
__all__ = ['add'] | Python | 1 |
ng_eight::ring_eight,
// benchmarks::ring::cancel_broadcast::ring_nine::ring_nine,
// benchmarks::ring::cancel_broadcast::ring_ten::ring_ten,
// benchmarks::ring::cancel_broadcast::ring_eleven::ring_eleven,
// benchmarks::ring::cancel_broadcast::ring_twenty::ring_twenty,
// //////////
// benchma... | Rust | 0 |
example() -> Result<(), gimli::Error> {
//! # type R = gimli::EndianSlice<'static, gimli::LittleEndian>;
//! # let get_file_section_reader = |name| -> Result<R, gimli::Error> { unimplemented!() };
//! # let get_sup_file_section_reader = |name| -> Result<R, gimli::Error> { unimplemented!() };
//! // Read the DWARF sect... | Rust | 0 |
(false, |re| re.is_match(&*str)),
})
.collect::<std::collections::BTreeSet<_>>();
writeln!(f, "use crate::timezone::{{TzInfo, TzOffset, TzParseError}};\n\n")?;
writeln!(f, "#[derive(Clone, Copy, PartialEq, Eq, Hash)]")?;
writeln!(f, "pub enum Tz {{")?;
for zone in &zones {
writel... | Rust | 0 |
ta_name, sdata_tag);
let entry1 = b"value0".to_vec();
let entry2 = b"value1".to_vec();
let op1 = replica1.append(entry1.clone());
let op2 = replica1.append(entry2.clone());
// we apply the operations in different order, to verify that doesn't affect the result
replica2... | Rust | 0 |
validation['dataset_iter'], validation['metrics'])
# Update and save best result
if validation['metrics'].mean_mae < metrics_best['mean_mae_val']:
metrics_best['step'] = step
metrics_best.update(validation['metrics'].result())
... | Python | 1 |
.break_offset_if_not_bol(1, -(indented as isize))?;
self.s.word("}")?;
if close_box {
self.end()?; // close the outer-box
}
Ok(())
}
pub fn bclose(&mut self, span: syntax_pos::Span) -> io::Result<()> {
self.bclose_(span, INDENT_UNIT)
}
pub fn in_cbox(... | Rust | 0 |
r_2),
}
}
/// Returns the center of this rectangle.
///
/// For rectangles with even width and/or height the returned value is rounded down
/// to the nearest integer pixel.
pub fn center(&self) -> Point {
let dx = self.size.width.saturating_sub(1) / 2;
let dy = self.siz... | Rust | 0 |
p_extract_keywords = """
You are an expert in Applicant Tracking Systems (ATS) and keyword optimization for job descriptions.
Your task is to analyze the job description provided by the user and extract the most relevant keywords that best describe the role.
These keywords should be optimized for ATS f... | Python | 1 |
]
name_extra = ''.join(random.choice(string.digits) for _ in range(random.randint(1, 4)))
email_domain = random.choice(domains) + random.choice(domains2)
email = name + name_extra + '@' + email_domain
password = random.choice(passwordlist)
... | Python | 1 |
import os
import time
#import wandb
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from .base import Trainer
device = torch.device('cu... | Python | 1 |
tern "C" {
fn NE_error() -> ErrorCode;
fn NE_error_string() -> *const c_char;
fn NE_create_bus2(name: *const c_char, server_uri: *const c_char) -> *mut BusHandle;
fn NE_destroy_bus(bus: *mut *mut BusHandle);
fn NE_create_data_node(bus: *mut BusHandle, name: *const c_char) -> *mut DataNodeHandle;
... | Rust | 0 |
st.rs<gh_stars>0
use crate::ui_element::UIElement;
use crate::ui_element::UIWidget;
use std::any::Any;
use std::sync::Arc;
pub struct ListView {
pub items: Vec<Arc<dyn Any + Send + Sync>>,
pub render_item: Arc<dyn Fn(&dyn Any) -> UIElement + Send + Sync>,
}
impl UIWidget for ListView {
fn elem(self) -> UI... | Rust | 0 |
Ok(Some(ReceivedDelta {
delta_tick: delta_tick,
tick: tick,
data_and_crc: Some((&self.result, crc)),
}))
}
}
#[cfg(test)]
mod test {
use common::num::Cast;
use gamenet::msg::system::Snap;
use gamenet::msg::system::SnapEmpty;
use gamenet::msg::syst... | Rust | 0 |
,
}
impl UdpHandlerSendRecv {
fn new(tx: UdpSocket, rx: UdpSocket, connected: bool, msg : &'static str) -> UdpHandlerSendRecv {
UdpHandlerSendRecv {
tx: tx,
rx: rx,
msg: msg,
buf: SliceBuf::wrap(msg.as_bytes()),
rx_buf: RingBuf::new(1024),
... | Rust | 0 |
2) = (Vec::with_capacity(length), Vec::with_capacity(length));
for i in 0..length {
if rng.happens(self.probability) {
child1.push(parent2[i].clone());
child2.push(parent1[i].clone());
} else {
child1.push(parent1[i].clone());
... | Rust | 0 |
lookup table.
Ok(X86_GP_REG_MAP[(reg - bank.first_unit) as usize])
}
"FloatRegs" => Ok(X86_XMM_REG_MAP[(reg - bank.first_unit) as usize]),
bank_name => {
bail!("unsupported register bank: {}", bank_name);
}
}
}
<filename>src/test/ui/did_you_mean/issue-38147-4... | Rust | 0 |
t ReaderBase,
genres: &Genres,
caretaker: &mut Caretaker,
app: &App,
lang: Lang,
) -> Option<String> {
let (s3, r3) = app::channel();
let mut get_author = Input1::<Input>::new(
match lang {
Lang::English => "New Author",
Lang::Russian => "Новый автор",
},
... | Rust | 0 |
),
)
def _estimate_withdrawal(self):
"""
Estimate the amount tokens output after burning our GM
Returns
-------
list
list of amount of long and short tokens.
"""
data_store_contract_address = contract_map[
self... | Python | 1 |
RMTENR {
#[doc = "At the reception of a remote frame, TXRQST is set."]
TXRQSTSET,
#[doc = "At the reception of a remote frame, TXRQST is left unchanged."]
UNCHANGED,
}
impl RMTENR {
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!s... | Rust | 0 |
#!/usr/bin/python
#coding:utf-8
import smtplib
from email.mime.text import MIMEText
import sys,os
from celery import Celery,platforms
import util
work_dir = os.path.dirname(os.path.realpath(__file__))
service_conf = os.path.join(work_dir, 'conf/service.conf')
config = util.get_config(service_conf, 'celery')
cele... | Python | 1 |
rgs: Any) -> VGG:
"""VGG-19_BN from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.
Args:
weights (:class:`~torchvision.models.VGG19_BN_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.V... | Python | 1 |
.to_string())
}
<gh_stars>0
//! Types related to dimensions/chunks.
pub mod generators;
pub mod chunk;
pub mod dimension;
pub use self::chunk::Chunk;
pub use self::dimension::Dimension;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
use chrono::{DateTime, Utc};
use log::error;
use super::{E... | Rust | 0 |
ourth,
enclosing circle will be calculated from them.
@type c1: int or float
@type c2: int or float
@type c3: int or float
"""
self.start = tangentCirclesFromRadii( 1/c1, 1/c2, 1/c3 )
self.genCircles = list(self.start)
def recurse(self, circles, depth, maxDep... | Python | 1 |
= ==
+ -
* /
% &
| ^
( ).0th
[ ].3rd
{ }. 5th
-> =>
. #
, !=
! break
continue // Comment test
/* Comment
test2 */
";
println!("{:?}", TEXT);
let vec = tokenize(TEXT);
println!("{:?}", vec);
let new = CharacterPosition::new;
assert_eq!(
vec,
vec![
... | Rust | 0 |
allationError::Status404(crate::adapters::to_json(github_response)?)),
code => Err(AppsUnsuspendInstallationError::Generic { code }),
}
}
}
/// ---
///
/// # Update a webhook configuration for an app
///
/// Updates the webhook configuration for a GitHub App.... | Rust | 0 |
qyq98qe26z8eg8q0852h622m40s50swtqnrqndruht";
// let engine = RpcTestEngine::init_data(vec![
// AddressData::new(addr_1, 500_000, 0, 0, 0),
// AddressData::new(addr_2, 0, 200, 0, 0),
// AddressData::new(addr_3, 600_000, 0, 0, 0),
// ]);
// let rpc = engine.rpc();
// let expected... | Rust | 0 |
"""Test distributed mulit-host device mesh."""
import os
import unittest
from flax import linen as nn
import jax
import jax.numpy as jnp
from jax.interpreters import pxla
import numpy as np
import ray
from alpa import init, shutdown, parallelize, DistributedArray
from alpa.device_mesh import get_global_physical_mesh... | Python | 1 |
name {
"forward" => Some(Forward { value: value }),
"down" => Some(Down { value: value }),
"up" => Some(Up { value: value }),
_ => None
}
}
fn calculate_part_two(input: Vec<String>) -> Option<i32> {
let calculate_position_adjustment = |current: (Position, i32), command: Command... | Rust | 0 |
let c = c * 255.99;
let c = c.map(&|x: f64| if x > 255.99 { 255.99 } else { x });
// Save to buffer for image out
outbuf.push(c.x as i32);
outbuf.push(c.y as i32);
outbuf.push(... | Rust | 0 |
SEL_A::FALLING_EDGE,
EdgeSelector::Both => evsys::channel::EDGSEL_A::BOTH_EDGES,
}
}
}
pub trait Clock {
}
macro_rules! ev_clock {
($($Clock:ident,)+) => (
$(
impl Clock for clock::$Clock {}
)+
)
}
ev_clock! {
Evch0Clock,
Evch1Clock,
Evch2Clock,
Evch3Clock,
Evch4Clock,
Evch5Clock,
Evch6Clock,
... | Rust | 0 |
rties': {
'name': school.name
}
}
data.append(item)
return JsonResponse(data, safe=False)
elif format == 'json':
if name:
schools = schools.filter(name__icontains=name)
if id:
schools = school... | Python | 1 |
import os
import math
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import pandas as pd
# import latticex.rosetta as rtt
np.set_printoptions(suppress=True)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
np.random.seed(0)
EPOCHES = 1
BATCH_SIZE = 32
learning_rate = 0.003
# real data
# ######... | Python | 1 |
pool. responds OK to sender
fn handle_sender_confirmation(
config: &WalletConfig,
keychain: &Keychain,
partial_tx: &PartialTx,
fluff: bool,
) -> Result<PartialTx, Error> {
let (amount, sender_pub_blinding, sender_pub_nonce, kernel_offset, sender_sig_part, tx) =
read_partial_tx(keychain, partial_tx)?;
let sende... | Rust | 0 |
f._target, task=None, config=None)
record_output = MeasureResult(
costs=(inferred_time,), error_no=0, all_cost=-1, timestamp=-1
)
self._layout_transform_perf_records[ltf_workload] = (record_input, record_output)
continue
re... | Python | 1 |
env['forum.tag'].search([('name', '=', 'Food')])
self.assertEqual(len(food_tags), 2, "One Food tag should have been created in each forum.")
self.assertIn(forum_1, food_tags.forum_id, "One Food tag should have been created for forum 1.")
self.assertIn(forum_2, food_tags.forum_id, "One Food tag s... | Python | 1 |
class Stack:
def __init__(self):
self.items = []
def push(self, item):
print("Item pushed into stack!")
self.items.append(item)
def pop(self):
if len(self.items) == 0:
print("\nStack is empty. Cannot pop from an empty stack.\n")
else:
return ... | Python | 1 |
)
);
}
#[repr(C)]
pub struct LASignore {
pub ignore_mask: root::U32,
pub ignore_classification_mask: [root::U32; 8usize],
}
#[test]
fn bindgen_test_layout_LASignore() {
assert_eq!(
::std::mem::size_of::<LASignore>(),
36usize,
... | Rust | 0 |
#!/usr/bin/env python
# setup.py generated by flit for tools that don't yet use PEP 517
from distutils.core import setup
packages = \
['furo']
package_data = \
{'': ['*'],
'furo': ['assets/*',
'assets/scripts/*',
'assets/styles/*',
'assets/styles/base/*',
'assets/styles/compo... | Python | 1 |
# This file is protected via CODEOWNERS
__version__ = "1.26.8"
| Python | 1 |
ip(1)
.map(|ticket| parse_ticket(ticket))
.filter(|ticket| {
ticket.iter()
.all(|v| rules.iter().any(|(_, lower, upper)| {
lower.contains(v) || upper.contains(v)
}))
})
.collect::<Tickets>();
let cols = my_ticket.len();
nearby_tickets.push(my_ticket.clone());
let mut all_possible_rules = (... | Rust | 0 |
# Copyright 2025 Individual Contributor: Mert Unsal
#
# 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... | Python | 1 |
myWindow.setLevel_(kCGDesktopWindowLevel)
myWindow.setCollectionBehavior_(NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle)
myWindow.setBackgroundColor_(NSColor.blackColor())
myWindow.makeKeyAndOrderFront_(myWindow)
myWindow.d... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.