text string | label_name string | labels int64 |
|---|---|---|
their
// 2. vocab with embeddings: word and embedding per line
// (example)
// will 0.81544 0.30171 0.5472 0.46581 ...
// their 0.41519 0.13167 -0.0569 -0.56765 ...
// 3. vocab and embeddings: word and embeddings (separated)
// (example... | Rust | 0 |
import os
from app import factory
from app.controllers.chat_router import ChatRouter
from app.logs.logger import get_logger
from app.startup.documents.init_documents import init_documents
from dotenv import load_dotenv
import uvicorn
import asyncio
logger = get_logger(__name__)
async def initialize_services():
""... | Python | 1 |
use std::fs::File;
use std::io::BufReader;
use std::error::Error;
use serde::Deserialize;
use log::{debug, error, info};
use std::fmt::{Display, Formatter, Result as FResult};
use rustls::{ServerConfig, NoClientAuth};
use rustls::internal::pemfile::{certs, rsa_private_keys};
use kube::api::admission::{AdmissionReview, ... | Rust | 0 |
exists.
>>> tony.friends.all()
[<PersonSelfRefM2M: Chris>]
### QUERY TESTS ###
# We can query for the related model by using its attribute name (members, in
# this case).
>>> Group.objects.filter(members__name='Bob')
[<Group: Roll>]
# To query through the intermediary model, we specify its model name.
# In this ca... | Python | 1 |
);
}
#[bench]
fn add_rug(b: &mut Bencher) {
b.iter(|| {
let a = test::black_box(0x12345667ffffffff);
let b = test::black_box(0x76543210aaaaaaaa);
let a = Float::with_val(53, f64::from_bits(a));
let b = Float::with_val(53, f64::from_bits(b));
... | Rust | 0 |
# Copyright 2022 The HuggingFace Team. 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 applicabl... | Python | 1 |
ames => String::from("RefFrames"),
Self::NumAudioStreams => String::from("NumAudioStreams"),
Self::NumVideoStreams => String::from("NumVideoStreams"),
Self::IsSecondaryAudio => String::from("IsSecondaryAudio"),
Self::VideoCodecTag => String::from("VideoCodecTag"),
... | Rust | 0 |
_js["v4"])?,
t1: match __js["t1"].as_i32() { Some(__x__) => __x__, None => return Err(LoadError{}) },
k1: { if !__js["k1"].is_array() { return Err(LoadError{}); } let mut __list__ = vec![]; for __e in __js["k1"].members() { __list__.push(match __e.as_i32() { Some(__x__) => __x__, None => return ... | Rust | 0 |
use serde::{Serialize, Serializer};
use serde::ser::SerializeStruct;
use {Chart, ChartState};
use layout::{Component, IndexedComponent, ComponentIndex};
use event::EventMessage;
use error;
use layout::Layout;
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientMessage<St> {
pub ui_state: St,
pub event... | Rust | 0 |
import numpy as np
from UQpy.utilities.MinimizeOptimizer import MinimizeOptimizer
from UQpy.distributions.collection import Normal
from UQpy.inference.inference_models.DistributionModel import DistributionModel
from UQpy.inference.inference_models.ComputationalModel import ComputationalModel
from UQpy.inference import... | Python | 1 |
"""
Plugins resource control over the API.
"""
import logging
from galaxy import exceptions
from galaxy.managers import (
hdas,
histories,
)
from galaxy.util import asbool
from galaxy.web import expose_api_anonymous_and_sessionless
from . import (
BaseGalaxyAPIController,
depends,
)
log = logging.get... | Python | 1 |
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# ... | Python | 1 |
(input);
match res {
Ok((i, (ch, value))) => {
match ch.to_ascii_lowercase() {
'x' if c.x.is_none() => {
c.x = Some(value);
input = i;
}
'y' if c.y.is_none() => {
... | Rust | 0 |
: i64) -> u64 {
if value > 0 {
return value as u64;
}
(-value) as u64
}
mod codegen;
fn main() {
codegen::codegen();
link_with_external_structures();
}
#[cfg(feature = "link-with-external-c-structures")]
pub(crate) fn link_with_external_structures() {
println!("cargo:rustc-link-search... | Rust | 0 |
incrust
use std::str;
#[allow(unused_imports)]
use nom::{IResult, Err as NomErr, ErrorKind, alpha, alphanumeric, space, multispace};
use container::expression::Mustache;
use container::parsed::ParsedNode;
use parser::statements::statement;
use parser::statements::stmt_edge;
use parser::expressions::full_expression;
... | Rust | 0 |
rams
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = AlipayInsSceneApplicationApplyModel()
if 'activity_id' in d:
o.activity_id = d['activity_id']
if 'applicant' in d:
o.applicant = d['applicant']
if 'bill_title' in d:... | Python | 1 |
lidSum); // FIXME: Err(Error::InvalidSum(e));
} else {
incoins = sum.unwrap();
}
}
Ok(incoins)
}
fn check_outputs_basic(outputs: &[TxOut]) -> Result<(), Error> {
// check that there are outputs
if outputs.is_empty() {
return Err(Error::NoOutputs);
}
// check... | Rust | 0 |
get_name(rx_addr),
op2,
payload
);
}
Opcode::CMP => self.flag.update(dr_cont, op1),
_ => (),
}
}
fn form_five_handler(&mut self, opcode: Opcode, mut decoder: EncoderDecoder) {
// Parse the destination add... | Rust | 0 |
f._write_tree_data(
data.get('meta'), _align_node, Maps.XML_ATTRIBS['Alignment']
)
_coord_geo_node = landxml.add_child(_align_node, 'CoordGeom')
#write the geo coordinate attributes
self._write_tree_data(
data.get('meta'), _coord_geo_node, Maps.XML_ATTRIBS['Coor... | Python | 1 |
_fixed_bytes()),
&simple_transaction,
&Public::from_h256(input_utxo.pubkey)
), "signature must be valid" );
total_input = total_input.checked_add(input_utxo.value).ok_or("input value overflow")?;
} else {
missing_utxos.push(input.outpoint.clone().as_fixed_bytes().to_vec());
}
}
// Check... | Rust | 0 |
git country codes by total grant_amt
markdown += "## Top 10 3-Digit grant_ein Country Codes by Total Grant Amount\n"
markdown += "| Country Code | Country Name | Count | Total Grant Amount |\n"
markdown += "|--------------|--------------|-------|--------------------|\n"
s... | Python | 1 |
bar: A) extends Foo[A] {
@override fun test(x: A): A { self.bar }
}
class Baz[A](let baz: A) extends Foo[Int32] {
@override fun test(x: Int32): Int32 { x+x }
}
");
}
#[test]
fn test_is_types() {
err(
"
trait SomeTrait {}
class Foo[A: Som... | Rust | 0 |
S_FD_ADVISE
| __WASI_RIGHTS_FD_ALLOCATE
| __WASI_RIGHTS_FD_FILESTAT_GET
| __WASI_RIGHTS_FD_FILESTAT_SET_SIZE
| __WASI_RIGHTS_FD_FILESTAT_SET_TIMES
| __WASI_RIGHTS_POLL_FD_READWRITE;
pub(crate) const RIGHTS_REGULAR_FILE_INHERITING: __wasi_rights_t = 0;
// Operations that apply to sockets and socket ... | Rust | 0 |
))
true_distances.extend(val_targets.cpu().numpy())
# Calculate the differences between predicted and true distances
differences = np.array(predicted_distances) - np.array(true_distances)
# Calculate MAE/MAD and RM... | Python | 1 |
ilation_ratio=0.02):
"""
Compute boundary iou between two binary masks.
:param gt (numpy array, uint8): binary mask
:param dt (numpy array, uint8): binary mask
:param dilation_ratio (float): ratio to calculate dilation = dilation_ratio * image_diagonal
:return: boundary iou (float)
"""
... | Python | 1 |
ef tes_lenet_hd(): # HD 720p: 1280(wid)x720(len)
cmp_run_conv_nnet2_classif(seed, (720, 1280), 9, 2, n_train=3,
ignore_error=ignore_error, gpu_only=gpu_only,
cpu_only=cpu_only, verbose=verbose,
check_isfinite=True, version... | Python | 1 |
{:#?}",
parse.errors()
);
}
let pp = pretty_print_macro_expansion(parse.syntax_node());
let indent = IndentLevel::from_node(call.syntax());
let pp = reindent(indent, pp);
format_to!(expn_text, "{}", pp);
if tree... | Rust | 0 |
}
LogicalPlan::Limit { ref input, .. } => {
write!(f, "Limit:")?;
input.fmt_with_indent(f, indent + 1)
}
}
}
}
impl fmt::Debug for LogicalPlan {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
self.fmt_with_indent(f, 0)
}
}
//... | Rust | 0 |
ss(start, slots_to_remove)
def apply_global_optimizations(
start: TealBlock, options: OptimizeOptions, version: int
) -> TealBlock:
# limit number of iterations to length of teal program to avoid potential
# infinite loops.
for block in TealBlock.Iterate(start):
for _ in range(len(block.ops)):... | Python | 1 |
onfigure clock gates, use the clock gate methods on [`PerClock`](struct.PerClock.html).
#[inline(always)]
pub fn configure_selection_divider(&mut self, selection: Selection, divider: u32) {
unsafe {
super::set_clock_gate::<G>(GPT::GPT1, ClockGate::Off);
super::set_clock_gate::<G>... | Rust | 0 |
From: /*m8x1, m16x1, m32x1, */ m128x1 | // FIXME: unary small vector types
/// A 64-bit vector mask with 1 `m64` lanes.
);
impl_f!([f64; 1]: f64x1, m64x1 | f64 | test_v64 | x0 |
From: /*i8x1, u8x1, i16x1, u16x1, i32x1, u32x1, f32x1*/ | // FIXME: unary small vector types
/// A 64-bit vec... | Rust | 0 |
from .calculator_3 import Calculator3
from pytest import raises
from typing import Dict, List
class MockRequest:
def __init__(self, body: Dict) -> None:
self.json = body
class MockDriverHandlerError:
def variance(self, numbers: List[float]) -> float:
# Mock implementation of variance
... | Python | 1 |
c> {
for procedure in &self.procs {
if (is_local_id && proc_id == procedure.lid) || (!is_local_id && proc_id == procedure.rid) {
return Some(&procedure);
}
}
None
}
pub fn set_server(&mut self, server: Option<Box<dyn AsyncServer>>) {
self.... | Rust | 0 |
the generated code back
* to the parent model. For example,
*
* hilite_system('ims_Build5pt1f/M1_HP_Dyn') - opens subsystem ims_Build5pt1f/M1_HP_Dyn
* hilite_system('ims_Build5pt1f/M1_HP_Dyn/Kp') - opens and selects block Kp
*
* Here is the system hierarchy for this model
*
* '<Root>' : 'ims_Build5pt1f'
*... | Rust | 0 |
import socket
import os
import subprocess
import sys
SERVER_HOST = sys.argv[1]
SERVER_PORT = 5003
BUFFER_SIZE = 1024 * 128 # 128KB max size of messages, feel free to increase
# separator string for sending 2 messages in one go
SEPARATOR = "<sep>"
# create the socket object
s = socket.socket()
# connect to the server
... | Python | 1 |
}
impl Resource<Ipv4Addr> for Ipv4Resource {
fn get_name(&self) -> &String {
self.basic.get_name()
}
fn get_ttl(&self) -> u32 {
self.basic.get_ttl()
}
fn get_data(&self) -> &Ipv4Addr {
&self.data
}
}
impl From<&Ipv4Resource> for Vec<u8> {
fn from(r: &Ipv4Resource... | Rust | 0 |
/// * `b_pop` - The population of the new `b`-district.
/// * `a_nodes` - The list of node indices in the new `a`-district.
/// * `b_nodes` - The list of node indices in the new `b`-district.
pub struct TSVWriter {}
/// Writes assignments in space-delimited format (with step number prefix).
pub struct Assignment... | Rust | 0 |
d note directory.
///
/// The returned `PathBuf` is a file name, rather than a path; it _is not_ prefixed by the path to
/// the notes directory.
pub fn new_file_name(config: &Config) -> Result<PathBuf> {
let files = list(config)?;
let base = chrono::Local::today().format("%Y-%m-%d").to_string();
let mut id... | Rust | 0 |
import asyncio
from IMPOC.queries import delete_tables, get, create_tables, insert_val, select_val, select_last_val, ret
# delete_tables()
# get()
# create_tables()
# asyncio.run(get())
# asyncio.run(create_tables())
delete_tables()
create_tables()
# insert_val(7560, 13.02)
# select_val()
# data = select_last_val()
#... | Python | 1 |
rams {
if let Value::String(url) = ¶ms[0] {
let _ = window_tx.send(url.to_string());
}
}
}
None
});
let window_proxy = app.add_window_with_configs(attributes, Some(handler), vec![], None)?;
let app_proxy = app.application_proxy();
std::thread::spawn(move || {
let... | Rust | 0 |
_,_));
}
#[test]
fn record_score_sum() {
fn prop(records: Vec<AddressRecord>) -> bool {
// Make sure the address collection can hold all reports.
let n = std::cmp::max(records.len(), 1);
let mut addresses = Addresses::new(NonZeroUsize::new(n).unwrap());
... | Rust | 0 |
lf, url: String, range: Option<(usize, usize)>) -> Result<Bytes> {
let mut req = self.get(&url);
if let Some((start, end)) = range {
req = req.header("Range", format!("bytes={}-{}", start, end));
}
trace!("starting fetch of {}", url);
let response = req
.s... | Rust | 0 |
cter
current = '' # current character
currentLine = ''
closingBraceRegex = re.compile(r'\s*(\}\)*(?:;|,)?(?:\s+\\)?\n)$', re.DOTALL)
doxyComment = re.compile(r'\s*/\*\*[^<].*\*/\s*$', re.DOTALL)
macroOpenBrace = re.compile(r'.*\{\s*\\$', re.DOTALL)
# Loop over all the characters and build the tree of Block structure... | Python | 1 |
StreamConfig) -> Stream {
device
.build_input_stream(
config,
move |buffer: &[T], _| {
self.exchange_buffer
.push_iter(&mut buffer[..].iter().map(|&s| f64::from(s.to_f32())));
},
|_| {},
... | Rust | 0 |
The version of HTTP for this request.
#[inline]
pub fn version(&self) -> &HttpVersion { &self.version }
}
impl<'a, T> From<HyperRequest<'a, T>> for Request {
fn from(src: HyperRequest<'a, T>) -> Request {
let (method, uri, version, headers) = src.deconstruct();
Request {
metho... | Rust | 0 |
import html
import inspect
import re
import urllib.parse as ul
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import torch
from transformers import CLIPImageProcessor, T5EncoderModel, T5Tokenizer
from diffusers.loaders import LoraLoaderMixin
from diffusers.schedulers import DDPMSched... | Python | 1 |
__GV_PREVIEW_RENDER__.tag_update()
except:
pass
def get_panels():
'''
RenderEngines also need to tell UI Panels that they are compatible with.
We recommend to enable all panels marked as BLENDER_RENDER, and then
exclude any panels that are replaced by custom panels ... | Python | 1 |
# Copyright (c) 2020 - present Vitor Oriel <https://github.com/VitorOriel>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... | Python | 1 |
("triaglf"), // BLACK LEFT-POINTING POINTER
0x25CA => Some("lozenge"), // LOZENGE
0x25CB => Some("circle"), // WHITE CIRCLE
0x25CF => Some("H18533"), // BLACK CIRCLE
0x25D8 => Some("invbullet"), // INVERSE BULLET
0x25D9 => Some("invcircle"), // INVERSE WHITE CIRCLE
... | Rust | 0 |
);
#[doc(alias = "GDK_KEY_Hangul_YO")]
pub const Hangul_YO: Self = Self(ffi::GDK_KEY_Hangul_YO as u32);
#[doc(alias = "GDK_KEY_Hangul_YU")]
pub const Hangul_YU: Self = Self(ffi::GDK_KEY_Hangul_YU as u32);
#[doc(alias = "GDK_KEY_Hangul_YeorinHieuh")]
pub const Hangul_YeorinHieuh: Self = Self(ffi:... | Rust | 0 |
let rustupdir = TempDir::new("rustup").unwrap();
let customdir = TempDir::new("rustup-custom").unwrap();
let cargodir = TempDir::new("rustup-cargo").unwrap();
let homedir = TempDir::new("rustup-home").unwrap();
// The uninstall process on windows involves using the directory above
// CARGO_HOME, s... | Rust | 0 |
import math
from unittest import TestCase
import numpy as np
import polars as pl
import scipy
from packaging import version
from pydantic import TypeAdapter
from ccflow.exttypes.polars import PolarsExpression
class TestPolarsExpression(TestCase):
def test_expression(self):
expression = pl.col("Col1") + ... | Python | 1 |
#!/usr/bin/env python3
import glob, os, pipes, sys, subprocess
device_id = os.environ.get("SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER")
iossim_run_verbose = os.environ.get("SANITIZER_IOSSIM_RUN_VERBOSE")
wait_for_debug = os.environ.get("SANITIZER_IOSSIM_RUN_WAIT_FOR_DEBUGGER")
if not device_id:
raise EnvironmentEr... | Python | 1 |
elanguage.v1alpha.GenerativeService.BidiGenerateContent?key={api_key}"
return jsonify({
"status": "success",
"websocket_url": websocket_url
})
except Exception as e:
return jsonify({
"status": "error",
"error": str(e)
... | Python | 1 |
f'{target_group}'][current_day]})
number_speeches_check_list_nolimited = sorted(number_speeches_check_list,
key=lambda x: x["number_speeches_count"],
... | Python | 1 |
xIndexToClear"]
#[doc = " must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES."]
#[doc = " ulTaskNotifyValueClear() does not have this parameter and always clears bits"]
#[doc = " in the notification value at index 0."]
#[doc = ""]
#[doc = " @param ulBitsToClear Bit mask of the bits to clear in ... | Rust | 0 |
step_over: usize = 0;
loop {
let c = chars.prev()?;
pos = pos.saturating_sub(1);
// ignore other surround pairs that are enclosed *within* our search scope
if c == close {
step_over += 1;
} else if c == open {
if step... | Rust | 0 |
.args(&["exec", container_name, "rm", "-f", "solana_installer.sh"])
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output()
.map_err(|e| anyhow!("Failed to remove installer: {:?}", e))?;
if !exit.status.success() {
return Err(anyhow!(... | Rust | 0 |
ces_bdf.len() + 1) as u16);
// Node offset
viot.append(48u16);
// VIOT reserved 8 bytes
viot.append_slice(&[0u8; 8]);
// Virtio-iommu based on virtio-pci node
viot.append(ViotVirtioPciNode {
type_: 3,
length: 16,
pci_segment: iommu_bdf.segment(),
pci_bdf_number: ... | Rust | 0 |
(result, overflow) = self.overflowing_mul(bignum);
panic_on_overflow!(overflow);
result
}
}
impl<'a> ::core::ops::Mul<&'a $other> for $name {
type Output = $name;
fn mul(self, other: &'a $other) -> $name {
let bignum: $name = (*other).into();
let (result, overflow) = self.overflowing_mul... | Rust | 0 |
.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Field `reg_ctrl_pwron_rst` reader - "]
pub struct REG_CTRL_PWRON_RST_R(crate::FieldReader<bool, bool>);
impl REG_CTRL_PWRON_RST_R {
pub(crate) fn new(bits: bool) -> Self {
REG_CTRL_PWRON_RST_R(crate::FieldReader::new(bit... | Rust | 0 |
T [dir] List files in directory");
println!("MKDIR <dir> Make directory");
println!("PUT <file> <dest> Upload local file `file` to `dest`");
println!("PWD Print working directory");
println!("QUIT ... | Rust | 0 |
delete all the to-do a a user
pub fn delete_done_by_owner(owner_delete: i32) -> usize {
let con = &mut handler::establish_connection();
diesel::delete(
todo.filter(id_owner.eq(owner_delete))
.filter(progress.eq(100)),
)
.execute(con)
.expect("Error deleting todo done")
}
/// Cre... | Rust | 0 |
return client.get(uri);
}
fn exchange(refresh_token: &str) -> String {
let uri = format!("https://login.questrade.com/oauth2/token?grant_type=refresh_token&refresh_token={refresh_token}", refresh_token = refresh_token).parse::<hyper::Uri>()?;
let request = get(uri).and_then(|res| {
println!("Res... | Rust | 0 |
)
}
#[must_use]
fn take_name_list(&mut self) -> Option<std::str::Split<'a, char>> {
let list = self.take_str_framed()?;
Some(list.split(','))
}
// FIXME
#[must_use]
fn take_mpint(&mut self) -> Option<&'a [u8]> {
self.take_bytes_framed()
}
#[must_use]
fn ex... | Rust | 0 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import sys
from destination_typesense import DestinationTypesense
if __name__ == "__main__":
DestinationTypesense().run(sys.argv[1:])
| Python | 1 |
"""
# PyQt比调用windows API简单很多,而且有windows API的很多优势,比如速度快,可以指定获取的窗口,即使窗口被遮挡。
# 需注意的是,窗口最小化时无法获取截图。
# 首先需要获取窗口的句柄。窗口句柄hwnd
pip install PyQt5
pip install pypiwin32
"""
from PyQt5.QtWidgets import QApplication
import win32gui
import sys
# 程序会打印窗口的hwnd和title,有了title就可以进行截图了。
hwnd = win32gui.FindWindow(None, "C:\Windows\syst... | Python | 1 |
fy!(nstime_t))
);
assert_eq!(
::std::mem::align_of::<nstime_t>(),
8usize,
concat!("Alignment of ", stringify!(nstime_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<nstime_t>())).secs as *const _ as usize },
0usize,
concat!(
"Offset of field... | Rust | 0 |
string = "anilkumar"
print("Given input is: ",string)
output = ""
for char in string:
if char not in output:
count = string.count(char)
output += char + "-" + str(count) + "\n"
print(output)
#string equal or not
string2 = "anilkumar"
if string == string2:
print("Equal")
else:
print("Not ... | Python | 1 |
import os
import sys
import open3d as o3d
import numpy as np
def main(filepath):
print("{} is loaded ... ".format(filepath))
text_data = open(filepath, "r")
lines = text_data.readlines()
scale = 0.1
origin_coordinate = o3d.geometry.TriangleMesh.create_coordinate_frame(size = 0.15, origin = [0,0... | Python | 1 |
) -> Result<DOT<Test>, DispatchError> {
let granularity = 5;
let btc = VaultRegistry::polkabtc_to_u128(btc)?;
let btc = U256::from(btc);
// Step 1: inverse of the scaling applied in calculate_max_polkabtc_from_collateral_for_threshold
// inverse of the div
let btc = b... | Rust | 0 |
"""
🎯 Lesson 2: Memory Management & Data Types
This lesson covers:
1. Understanding memory coalescing and access patterns
2. Working with different data types (float32, float16, int32)
3. Memory bandwidth optimization
4. Bank conflicts and how to avoid them
5. Stride patterns and non-contiguous tensors
Prerequisites... | Python | 1 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from .components import CustomDatetimeBasedCursor
from .source import SourceQuickbooks
__all__ = ["SourceQuickbooks", "CustomDatetimeBasedCursor"]
| Python | 1 |
import time
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
url = "https://practice.expandtesting.com/f... | Python | 1 |
import logging
import os
import random
import numpy as np
from util.line_corpus import jsonl_lines, write_open
from util.args_help import fill_from_args
import ujson as json
logging.basicConfig(format='%(filename)s:%(lineno)d - %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=lo... | Python | 1 |
from __future__ import print_function
# add "b2ContactPoint", as it's custom
# First, define some classes not seen by swig
ignore = ["b2ContactConstraint", "b2PolygonContact", "b2PolygonAndCircleContact", "b2CircleContact", "b2JointType", "b2BodyType", "b2ContactSolver", "b2PointState", "b2WorldQueryWrapper", "b2Worl... | Python | 1 |
);
let num_blocks = (left_piece_len as f64 / block_len as f64).ceil() as u32;
(
PieceKey { piece_index },
PieceWorkInfo {
available_blocks: Arc::new(AtomicU32::new(num_blocks)),
blocks: (0..num_blocks)
... | Rust | 0 |
onTarget.IGNORE_PZ \
+ PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ \
+ PositionTarget.IGNORE_YAW
if self.set_start == 0:
self.start = datetime.now()
self.set_start = 1
end = dateti... | Python | 1 |
"""
File: favorite_color_prompt.py
Name: Collin Nunnally
Purpose: Use what I learned in today's programming class
"""
# I added a prompt to answer the questions and to add a line break in the output code
print("Answer the 3 following question:")
print('\n'*1)
# I added more than 2 questions to ask
name = input("what... | Python | 1 |
(consume_iterator(stream));
}));
group.bench_function("batch size: 64KiB", |b| b.iter(|| {
let stream = read_utf8_stream(PATH, 64 << 10).unwrap();
black_box(consume_iterator(stream));
}));
group.bench_function("batch size: 8KiB", |b| b.iter(|| {
let stream = read_utf8_stream(PATH... | Rust | 0 |
ne]
pub fn record(&self) -> Record {
self.record
}
/// Returns the TTL.
#[inline]
pub fn ttl(&self) -> u32 {
self.ttl
}
}
/// Data of a delete request, containing the domain name and record type.
#[derive(Deserialize, Serialize)]
pub struct Delete {
name: String,
record... | Rust | 0 |
e cible.")],
)
def __init__(self, source_artist_id: str | None = None, *args: typing.Any, **kwargs: typing.Any):
super().__init__(*args, **kwargs)
self.source_artist_id = source_artist_id
def validate_target_artist_id(self, field: fields.PCArtistTomSelectField) -> None:
if field.da... | Python | 1 |
self, lba: u32, block: &[u8]) -> Result<(), BlockDeviceError>;
/// Get the maxium valid lba (logical block address)
fn max_lba(&self) -> u32;
}<reponame>mooware/adventofcode2020<gh_stars>0
// day 1b:
// in a list of numbers, find the triple that adds up to 2020 and multiply it
use std::io;
use std::io::p... | Rust | 0 |
# Copyright 2025 WhoMeta Inc.
#
# 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 writing,... | Python | 1 |
__, mod.__file__))
if len(entry)<7 or entry[6] is None:
entry += (None,)*(6-len(entry)) + (mod.__name__.split(".", 1)[1],)
entry = codecs.CodecInfo(*entry)
# Cache the codec registry entry
_cache[encoding] = entry
# Register its aliases (without overwriting previously registere... | Python | 1 |
, requires_grad={self.requires_grad}" if self.requires_grad else ""
device_str = f", device='{self.device}'" if self.device != 'cpu' else ""
return f"Tensor({self.data!r}{grad_str}{device_str})"
# Utility functions
def zeros(shape: Tuple[int, ...], requires_grad: bool = False, device: Optional[str] = ... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import helpdesk_ticket_convert_wizard
from . import project_task_convert_wizard
| Python | 1 |
[[None; BOARD_SIZE]; BOARD_SIZE];
Self { pieces }
}
/// Place a piece at a given position on the board.
///
/// If there was a piece in that position it is returned. Returns [None] otherwise.
pub fn place(&mut self, pos: Position, p: Piece) -> Option<Piece> {
let previous_piece = ... | Rust | 0 |
#!/usr/bin/env python3
"""
엑셀 파일에 상수 관리 시트들을 추가하는 스크립트
기존 game_initial_values_with_formulas.xlsx 파일에
상수 관리를 위한 새로운 시트들을 추가합니다.
"""
import pandas as pd
from pathlib import Path
from typing import Dict, List, Any
import openpyxl
from openpyxl.styles import Font, PatternFill, Alignment
from openpyxl.utils.dataframe imp... | Python | 1 |
nt);
match store {
Ok(VerifyStatus::Trusted) => Ok(rustls::client::ServerCertVerified::assertion()),
Ok(VerifyStatus::Untrusted) => Err(rustls::Error::General("untrusted".into())),
Err(_) => Err(rustls::Error::General("storage error".into())),
}
}
}
pub struct Tl... | Rust | 0 |
import os.path as osp
import pybullet as p
import math
import sys
sys.path.insert(0, osp.join(osp.dirname(osp.abspath(__file__)), '../'))
from my_planar_robot import MyPlanarRobot
import pb_ompl
class Maze2D():
def __init__(self):
self.obstacles = []
p.connect(p.GUI)
p.setGravity(0, 0, -9... | Python | 1 |
imm8
0x230E_001B,// EVEX_Vextractf32x8_ymmm256_k1z_zmm_imm8
0x232E_001B,// EVEX_Vextractf64x4_ymmm256_k1z_zmm_imm8
0x220E_001D,// VEX_Vcvtps2ph_xmmm64_xmm_imm8
0x228E_001D,// VEX_Vcvtps2ph_xmmm128_ymm_imm8
0x220E_001D,// EVEX_Vcvtps2ph_xmmm64_k1z_xmm_imm8
0x228E_001D,// EVEX_Vcvtps2ph_xmmm128_k1z_ymm_imm8
0x230E... | Rust | 0 |
import concurrent.futures
import hashlib
import logbook
import pandas as pd
import os
import pickle
from zipline.utils import paths
log = logbook.Logger(__name__)
def parallelize(mapfunc, workers=10, splitlen=10):
def wrapper(symbols):
result = {}
with concurrent.futures.ThreadPoolExecutor(
... | Python | 1 |
<Input> = plans
.iter()
.map(|p| Input::from(Locator::from(p.result_file_name().as_path())))
.collect();
let mut result_file = test_dir.clone();
result_file.push("results.yaml");
let result_opts = EucalyptOptions::default()
.with_explicit_inputs(in... | Rust | 0 |
if file_type.is_dir() {
subdirs.push(entry.path());
}
}
}
}
subdirs
}
#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::PINMODE2 {
... | Rust | 0 |
>>, Vec<Val<GPUDeviceScalar<T>>>) {
//println!("DEBUG: SumJoinOp: build inplace");
SumJoinOp::build_inplace_device_op(xs_)
}
}
impl<T: ZeroBits + 'static> SumJoinOpExt<GPUDeviceArray1d<T>> for SumJoinOp
{
fn build(xs_: Vec<Val<GPUDeviceArray1d<T>>>) -> Val<GPUDeviceArray1d<T>> {
//println!("DEBUG: SumJ... | Rust | 0 |
""" Example: distilling AutoGluon's ensemble-predictor into a single model for binary classification. """
# NOTE: Distillation can be done in a similar manner for multiclass classification and regression problems.
# NOTE: To distill CatBoost models in multiclass classification, you need to first run: pip install catb... | Python | 1 |
from tkinter import*
root= Tk()
root.title("C-178")
root.geometry("500x500")
class JUICE:
def __init__(self,fruit_name,quantity):
self.fruit= fruit_name
self.quantity= int(quantity)
self.__cost= 75
def __calculatecost(self):
total_amount= self.__cost*self.quantity
... | Python | 1 |
eeMap::new();
// Call `next_round()` on each node to gather a list of all Push gossips.
for node in nodes.iter_mut() {
if !rumors.is_empty() && rng.gen() {
let rumor = unwrap!(rumors.pop());
let _ = node.initiate_rumor(&rumor);
... | Rust | 0 |
"""
===============================================
Objective: Text preprocessing techniques workflow in python
Author: Sharmila.Polamuri
Blog: https://dataaspirant.com
Date: 2020-09-14
===============================================
"""
import pandas as pd
from preprocessing import Preprocess
dataset = pd.read_tab... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.