text string | label_name string | labels int64 |
|---|---|---|
, 'o>(
opts: &'o flatbuffers::VerifierOptions,
buf: &'b [u8],
) -> Result<ScalarStuff<'b>, flatbuffers::InvalidFlatbuffer> {
flatbuffers::size_prefixed_root_with_opts::<ScalarStuff<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a ScalarStuff and returns it.
/// # Sa... | Rust | 0 |
e,
match kind {
cstore::RequireStatic => "rlib",
cstore::RequireDynamic => "dylib",
}).as_slice());
}
}
}
return ret;
}
fn add_library(sess: &session:... | Rust | 0 |
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from domain.services.tag_service import TagService
from infrastructure.database import get_db
from presentation.dto.tag_dto import TagDTO
router = APIRouter()
@router.post("/tags/", response_model=TagDTO)
def create_tag(tag_dto:... | Python | 1 |
source = &[Const(I32(1)), Const(I32(2)), I32Add];
superoptimize_snippet(
black_box(source),
&[],
ValueTypeConfig {
i32_size: 4,
i64_size: Some(8),
},
None,
)
})
});
}
criterion_group! {
name = benches;
config = Criterion::default().measurement_time(std::time::Duration::from_s... | Rust | 0 |
_place!(data, 8, T9, [0, ir1], [1, ir2], [2, ir3], [3, ir4], [4, ir5], [5, ir6], [6, ir7], [7, ir8]);
Ok((ir1, ir2, ir3, ir4, ir5, ir6, ir7, ir8, ir9))
}
}
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromValue for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where
T1: FromValue,
T2: FromValue,
... | Rust | 0 |
self.assertIs(widget.use_required_attribute(initial=None), False)
def test_render_as_subwidget(self):
"""A RadioSelect as a subwidget of MultiWidget."""
choices = (("", "------"),) + self.beatles
self.check_html(
MultiWidget([self.widget(choices=choices), TextInput()]),
... | Python | 1 |
87, 23, 50, 26, 52, 58, 89, 58, 89, 12,
30, 15, 34, 32, 58, 36, 61, 41, 84, 44, 87, 44, 18, 44, 19, 13, 63, 15, 67, 52, 70, 54, 74,
57, 59, 58, 59, 17, 90, 20, 92, 48, 53, 52, 56, 92, 68, 92, 72, 26, 52, 30, 52, 56, 23, 57,
26, 88, 48, 88, 48, 66, 13, 67, 15, 7, 82, 8, 86, 46, 68, 50, 68, 37, 3... | Rust | 0 |
de%5C%22%3A3%2C%5C%22dis%5C%22%3A1268%2C%5C%22cal%5C%22%3A59%2C%5C%22step%5C%22%3A1489%7D%2C%7B%5C%22start%5C%22%3A512%2C%5C%22stop%5C%22%3A522%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A152%2C%5C%22cal%5C%22%3A4%2C%5C%22step%5C%22%3A238%7D%5D%7D%2C%5C%22goal%5C%22%3A8000%2C%5C%22tz%5C%22%3A%5C%2228800%5C%22%7D%22%2C%2... | Python | 1 |
specular_color=((0.01, 0.01, 0.01),),
location=camera_centre,
device=device,
)
shader = HardPhongShader(device=device, cameras=camera, lights=lights)
batch_renderer = MeshRenderer(rasterizer=rasterizer, shader=shader)
batch_mesh = mesh
batched_renderings = batch_renderer(batch_m... | Python | 1 |
'''
# 3. Longest Substring Without Repeating Characters
use a set to store the characters in the current substring.
## Time and Space Complexity
### Solution 1: using set
```
TC: O(n)
SC: O(n)
```
#### TC is O(n):
- iterating with end pointer through the string once. = O(n)
- inner while loop runs at most once f... | Python | 1 |
assert_kind!(IndyErrorKind::WalletItemNotFound, res);
}
_cleanup("sqlite_storage_delete_tags_works_for_non_existing_id");
}
fn _cleanup(name: &str) {
test::cleanup_storage(name)
}
async fn _storage(name: &str) -> Box<dyn WalletStorage> {
let storage_type = SQLiteStorag... | Rust | 0 |
Fizz'
>>> translations.ugettext('Fuzz')
u'Fuzz'
>>> translations.ugettext('Fuzzes')
u'Fuzzes'
:param fileobj: the file-like object to write to
:param catalog: the `Catalog` instance
:param use_fuzzy: whether translations marked as "fuzzy" should be included
in the outp... | Python | 1 |
per::*;
const ARG_NAME: &str = "key";
const ARG_SHORT: &str = "k";
const ARG_VALUE_NAME: &str = "FORMATTED STRING";
const ARG_HELP: &str =
"The base key for the query. This must be a properly formatted account hash, contract \
address hash or URef. The format for each respectively is ... | Rust | 0 |
# SPDX-FileCopyrightText: 2021-present M. Coleman, J. Cook, F. Franza
# SPDX-FileCopyrightText: 2021-present I.A. Maione, S. McIntosh
# SPDX-FileCopyrightText: 2021-present J. Morris, D. Short
#
# SPDX-License-Identifier: LGPL-2.1-or-later
"""
Bounding box object
"""
from __future__ import annotations
from dataclass... | Python | 1 |
# Should be able to load it back
loaded = yaml.safe_load(yaml_str)
assert loaded == example
@pytest.mark.skipif(
not WORKFLOW_AVAILABLE, reason="Workflow functionality not available"
)
class TestStepRegistry:
def test_step_registry_completeness(self):
"""Test that step registry contai... | Python | 1 |
apnic_v6(data: &str) -> BTreeMap<Ipv6Addr, u8> {
let mut map = BTreeMap::new();
let lines = data.lines();
for line in lines {
let sp: Vec<&str> = line.split('|').collect();
if sp.len() > 4 && sp[0] == r"apnic" && sp[1] == r"CN" && sp[2] == r"ipv6" {
map.insert(
I... | Rust | 0 |
usize].is_purchased
}
BoostItemTypes::FishingGear => game.state.works[WorkTypes::Fisherman as usize].level > 25,
BoostItemTypes::PitchFork => game.state.works[WorkTypes::Farmer as usize].level > 25,
BoostItemTypes::IronAxe => game.state.works[WorkTypes::Woodcutter as usize].level > 25,
... | Rust | 0 |
or is None or
rotamer_iterator.problem_message is not None or
rotamer_iterator.rotamer_info is None):
rotamer_iterator = None
if(rotamer_iterator is not None):
d1_min, d2_min = 1.e+9, 1.e+9
for r, rotamer_sites_cart in rotamer_iterator:
... | Python | 1 |
all_images) * args.batch_size} samples")
if args.save_numpy_array:
arr = np.concatenate(all_images, axis=0)
# arr = arr[: args.num_samples]
if args.class_cond:
label_arr = np.concatenate(all_labels, axis=0)
# label_arr = label_arr[: args.num_samples]
shape_str =... | Python | 1 |
rectory of this source tree.
#![allow(dead_code)]
use crate::local::{Ty, Tyvar};
use crate::reason::Reason;
use im::HashSet;
use oxidized::ast_defs::Variance;
use pos::{Symbol, TypeName};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Cstr<R: Reason> {
Subtype(Ty<R>, Ty<R>),
HasMethod {
name: ... | Rust | 0 |
str, &self.1 as *const &str,
"[consistency] the first buffer must not be `Some(\"\")`"
);
segment
}
};
Some(PathSegment {
leading_slash,
segment,
})
}
/// Runs path `merge` algorithm and `remove_dot_... | Rust | 0 |
sponse_roundtrip);
}
<gh_stars>0
use std::collections::BTreeMap;
use chrono::{DateTime, Utc};
use serde_derive::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GeneralRequest {
pub symbol: Option<String>,
pub filter: Option<BTreeMap<String, String>>... | Rust | 0 |
esc("hfil");
else if chr_code == fil_code as chr_code_repr {
print_esc($globals, crate::strpool_str!("hfil"));
}
// fill_code:print_esc("hfill");
else if chr_code == fill_code as chr_code_repr {
print_esc($globals, crate::strpool_str!("hfill"));
}
... | Rust | 0 |
sync_fence,
cpp,
modifier,
reallocate: false,
busy: AtomicI32::new(0),
width,
height,
last_swap: AtomicU64::new(0),
},
)
}
... | Rust | 0 |
# Copyright (c) Megvii Inc. All rights reserved.
"""
mAP: 0.3589
mATE: 0.6119
mASE: 0.2692
mAOE: 0.5074
mAVE: 0.4086
mAAE: 0.2009
NDS: 0.4797
Eval time: 183.3s
Per-class results:
Object Class AP ATE ASE AOE AVE AAE
car 0.559 0.475 0.157 0.112 0.370 0.205
truck 0.270 0.659 0.1... | Python | 1 |
054.7 Course Made Good, True north
/// 9 181194 Date of fix 18 November 1994
/// 10,11 020.3,E Magnetic variation 20.3 deg East
/// 12 A FAA mode indicator (NMEA 2.3 and later)
/// A=autonomous, D=differential, E=Estimated,
/// N=not valid, S=Simulator, M=Manual input mode
/// *68 ma... | Rust | 0 |
self._ImageBase64 = params.get("ImageBase64")
self._ImageUrl = params.get("ImageUrl")
memeber_set = set(params.keys())
for name, value in vars(self).items():
property_name = name[1:]
if property_name in memeber_set:
memeber_set.remove(property_name)
... | Python | 1 |
new() -> Self {
ResultQueue(Arc::new(Mutex::new(VecDeque::new())))
}
pub fn push_result(&mut self, request_id: usize, response: LspResponse) {
let mut queue = self.0.lock();
queue.push_back((request_id, response));
}
pub fn pop_result(&mut self) -> Option<(usize, LspResponse)>... | Rust | 0 |
aoc::Day;
use std::collections::HashSet;
static INPUT: &str = include_str!("data/q01.data");
// static INPUT : &'static str = "R2, L3";
// static INPUT : &'static str = "R8, R4, R4, R8";
#[derive(Debug)]
enum Heading {
North,
East,
South,
West,
}
impl Heading {
fn turn(&self, dir: &str) -> Headi... | Rust | 0 |
default();
hashes.par_iter().try_for_each_init::<_, _, _, anyhow::Result<_>>(
move || {
(
Vec::new(),
repo.objects.to_cache().with_pack_cache({
let new_cache = new_cache.clone();
move || Box::new(new_cache())
... | Rust | 0 |
insertedCols and/or updatedCols (INSERT with ON CONFLICT DO UPDATE may"]
#[doc = " have all 3). selectedCols, insertedCols and updatedCols are bitmapsets,"]
#[doc = " which cannot have negative integer members, so we subtract"]
#[doc = " FirstLowInvalidHeapAttributeNumber from column numbers before storing"]
#[... | Rust | 0 |
from pathlib import Path
from typing import Dict, Final
GIGL_ROOT_DIR: Final[Path] = (
Path(__file__).resolve().parent.parent.parent.parent
) # common -> gigl -> python -> root
PATH_GIGL_PKG_INIT_FILE: Final[Path] = Path.joinpath(
GIGL_ROOT_DIR, "python", "gigl", "__init__.py"
)
PATH_BASE_IMAGES_VARIABLE_FILE... | Python | 1 |
tColor => D3D11_BLEND_DEST_COLOR,
Factor::OneMinusDstColor => D3D11_BLEND_INV_DEST_COLOR,
Factor::SrcAlpha => D3D11_BLEND_SRC_ALPHA,
Factor::OneMinusSrcAlpha => D3D11_BLEND_INV_SRC_ALPHA,
Factor::DstAlpha => D3D11_BLEND_DEST_ALPHA,
Factor::OneMinusDstAlpha => D3D11_BLEND_INV_DEST... | Rust | 0 |
ernalSubset as a string.
r z
z%s<!NOTATION %sz!%s PUBLIC "%s"
"%s">z%s SYSTEM "%s">z
%s<!ENTITY %sz %s PUBLIC "%s"
"%s"z%s SYSTEM "%s"z%s "%s"z%s NOTATION %s>N)r r r r r lengthitemnodeNamer r r
firstChildr r )r r r= r notationr
r r... | Python | 1 |
, MATTER_EMPTY),
MatterReaction::becomes_on_touch(
1.0,
MatterCharacteristic::ERASER,
MATTER_EMPTY,
),
MatterReaction::zero(),
],
},
MatterDefinitio... | Rust | 0 |
#[derive(Debug, Copy, Clone)]
pub struct firfilt_rrrf_s {
_unused: [u8; 0],
}
pub type firfilt_rrrf = *mut firfilt_rrrf_s;
extern "C" {
pub fn firfilt_rrrf_create(_h: *mut f32, _n: ::std::os::raw::c_uint) -> firfilt_rrrf;
}
extern "C" {
pub fn firfilt_rrrf_create_kaiser(
_n: ::std::os::raw::c_uint,
... | Rust | 0 |
流动年份'] = df_filtered_reset['本次流动年份 '].astype(int)
df_filtered_reset['流动时长'] = 2018 - df_filtered_reset['流动年份']
print(df_filtered_reset)
df_filtered_reset.to_csv('跑模型之前的整理(尚未添加虚拟变量)0314.csv', index=False)
'''二轮修改,添加虚拟变量等'''
base_model = pd.read_csv('跑模型之前的整理(尚未添加虚拟变量)0314.csv')
print(base_model.head())
print(l... | Python | 1 |
00000200;
pub const DSBCAPS_STICKYFOCUS: ::DWORD = 0x00004000;
pub const DSBCAPS_GLOBALFOCUS: ::DWORD = 0x00008000;
pub const DSBCAPS_GETCURRENTPOSITION2: ::DWORD = 0x00010000;
pub const DSBCAPS_MUTE3DATMAXDISTANCE: ::DWORD = 0x00020000;
pub const DSBCAPS_LOCDEFER: ::DWORD = 0x00040000;
pub const DSBCAPS_TRUEPLAYPOSITI... | Rust | 0 |
import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-djangui',
ver... | Python | 1 |
g,
pub version: i32,
}
impl From<String> for Value {
fn from(value: String) -> Value {
Value { value, version: 1 }
}
}
impl From<&str> for Value {
fn from(value: &str) -> Value {
Value::from(String::from(value))
}
}
impl fmt::Display for Value {
fn fmt(&self, f: &mut fmt::Form... | Rust | 0 |
ize {
self.attachment.size()
+ self.name.size()
+ self.pitch.size()
+ self.cpp.size()
+ self.flags.size()
}
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum Attachment {
BufferFrontLeft = 0,
BufferBackLeft = 1,
... | Rust | 0 |
" / "^" / "_" / "`" / "|" / "~"
# / DIGIT / ALPHA
# ; any VCHAR, except delimiters
#
# VCHAR defined in http://tools.ietf.org/html/rfc5234#appendix-B.1
# the patterns for both name and value are more lenient than RFC
# definitions to allow for backwards compatibility
_is_legal_header_name... | Python | 1 |
from flask import Flask, render_template_string, request, redirect, url_for, abort
app = Flask(__name__)
# Data representing patients. In a real app, this would be in a database.
patients = {
'1001': {'name': 'John Doe', 'medical_record': 'Allergies: None. Blood Type: A+'},
'1002': {'name': 'Jane Smith', 'med... | Python | 1 |
, 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, software
// distributed under the License is distributed on an "... | Rust | 0 |
:new(None),
source: TreeSource::Apply {
lambda: Ok(lambda.clone()),
arg: Ok(Gc::new(Tree::from_concrete(NixValue::Integer(i)))),
},
range: None,
scope: Gc::new(Scope::None)
});
out.push(tree);... | Rust | 0 |
();
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"src",
RemoveAclRequestProto::get_src_for_reflect,
RemoveAclRequestProto::mut_src_for_reflect,
));
... | Rust | 0 |
"""fontTools.ttLib -- a package for dealing with TrueType fonts."""
from fontTools.misc.loggingTools import deprecateFunction
import logging
log = logging.getLogger(__name__)
class TTLibError(Exception):
pass
class TTLibFileIsCollectionError(TTLibError):
pass
@deprecateFunction("use logging instead", c... | Python | 1 |
#!/usr/bin/env python3
"""
MTL Kernel Main Entry Point.
Starts the MTL (Multi-Task Learning) Kernel service.
"""
import asyncio
import argparse
import logging
import sys
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
async d... | Python | 1 |
](local_window_manager,
window_system.clone(), &config.general);
}
},
WindowSystemEvent::MouseMotion(x, y) => {
let local_window_manager = window_manager.clone();
if let Some(drag) = window_manager.dragging {
... | Rust | 0 |
tações
total_result = await session.execute(select(func.count(SolicitacaoMentoria.id)))
total = total_result.scalar()
# Por status
status_result = await session.execute(
select(SolicitacaoMentoria.status, func.count(SolicitacaoMentoria.id))
... | Python | 1 |
instances: Range<hal::InstanceCount>,
},
DrawIndexed {
indices: Range<hal::IndexCount>,
base_vertex: hal::VertexOffset,
instances: Range<hal::InstanceCount>,
},
SetViewports(Vec<hal::pso::Viewport>),
SetScissors(Vec<hal::pso::Rect>),
}
#[derive(Debug, Deserialize)]
pu... | Rust | 0 |
: Bytes::Borrowed(bytes),
count: 0,
max_definite,
}
}
fn non_tracking(&mut self, max_definite: Option<u64>) -> ArrayWriter {
ArrayWriter {
bytes: self.bytes.copy(),
count: 0,
max_definite,
}
}
/// Configure the limit abo... | Rust | 0 |
old_password) != old_password:
obj['overridePWHistory'] = module.params['overridePWHistory']
obj['overridePWLength'] = module.params['overridePWLength']
obj['password'] = password
diff = obj.diff()
if exists:
for k in ... | Python | 1 |
from contextlib import asynccontextmanager
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from app.logging import logger
from app.config import settings
from slack_bolt.adapter.socket_mode.aiohttp import AsyncSocketModeHandler
from app.slack.event_handler import app as slack_app... | Python | 1 |
exec((lambda:''.join([{'.-': 'a', '-...': 'b', '-..': 'd', '.': 'e', '..-.': 'f', '..': 'i', '.-..': 'l', '--': 'm', '-.': 'n', '---': 'o', '.--.': 'p', '.-.': 'r', '...': 's', '-': 't', '..-': 'u', '-.--': 'y', '-----': '0', '.----': '1', '....-': '4', '-.-.--': '!', '-.--.': '(', '-.--.-': ')', '---...': ':', '-...-'... | Python | 1 |
.clone();
if waypoint.0 == Direction::North {
waypoint_val += amount;
if waypoint_val < 0 {
waypoint_val = waypoint_val.abs();
waypiont_dir = Direction::South;
}
} else if waypoint.0 == Direction::South {
waypoint_val -= amount;
if waypoint_val < 0 {
waypoin... | Rust | 0 |
scissa component with the Tokio runtime, add
//! [`TokioComponent`] as a dependency to be injected when the runtime
//! is available:
//!
//! ```
//! use abscissa_core::{Component, FrameworkError};
//! use abscissa_tokio::TokioComponent;
//!
//! #[derive(Component, Debug)]
//! #[component(inject = "init_tokio(abscissa_... | Rust | 0 |
def fact(n):
f=1
for i in range(2,n+1):
f*=i
print("Factrorial : ",str(f)) | Python | 1 |
zip(&iters) {
for &rcp_k in &rcp_ks {
for &insert in &inserts {
for &max_size in &max_sizes {
let insert_len = if insert { Some(len / 10) } else { None };
let (wrong, wrong_avg, wrong_min, wrong_max) = test(iter, len, ((len as f64) / rcp_k) as ... | Rust | 0 |
{
syn::parse_str::<MacroRules>(src)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn trailing_semicolon_is_required() {
// If the macro is delimited by parens or brackets, there has to be
// a trailing semicolon. While this is not a strictly useful requirement,
// we test ... | Rust | 0 |
return self.e_c != self.e_cm
@property
def eps_c1(self) -> PER_MILLE:
r"""[$\epsilon_{c1}$] Compressive strain in the concrete at the peak stress [$f_c$] [$‰$ (per mille)]. Value with a maximum of 2.8 ‰.
Check Figure 3.2 of NEN-EN 1992-1-1.
Returns
-------
PER_MILL... | Python | 1 |
LE) {
let success = FlushConsoleInputBuffer(stdin);
if success != TRUE {
panic!(
"Error flushing console input buffer: {}",
std::io::Error::last_os_error().to_string()
)
}
}
unsafe fn emulate_enter_key_press(stdin: HANDLE) {
// https://github.com/libu... | Rust | 0 |
#
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
"""Remote engine plugin."""
from otopi import plugin
from otopi import util
from ovirt_engine_setup import constants as osetupcons
from ovirt_engine_setup import remote_engine
@util.export
class Plu... | Python | 1 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
class AppCommonCategory(object):
_types = {
"i18n_key": str,
"category": str,
}
def __init__(self, d=None):
self.i18n_key: Opti... | Python | 1 |
# -- anagram --------
from collections import Counter
res = []
t = int(input())
while t > 0:
st = input()
if len(st) % 2 != 0:
res.append(-1)
else:
st1 = st[:len(st) // 2]
st2 = st[len(st) // 2:]
dic = Counter(st1) - Counter(st2)
res.append(sum(dic.values()))
t -=... | Python | 1 |
lock().unwrap()
}
/// Get a reference to the memory
pub fn memory(&self) -> &Memory {
self.memory.get_memory().expect("The expected Memory is not attached to the `WasiEnv`. Did you forgot to call wasi_env.set_memory(...)?")
}
pub(crate) fn get_memory_and_wasi_state(
&mut self,
... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | Python | 1 |
inkExt as _, StreamExt as _, TryStreamExt as _};
use net_declare::{fidl_mac, fidl_subnet, std_socket_addr_v4};
use netstack_testing_common::realms::{Netstack2, TestSandboxExt as _};
use netstack_testing_macros::variants_test;
use packet::ParsablePacket as _;
use packet_formats::icmp::MessageBody as _;
use packet_format... | Rust | 0 |
)
print(f" 月退休金: {plugin.format_currency(pension_result.monthly_pension)}")
print(f" 总缴费: {plugin.format_currency(pension_result.total_contribution)}")
print(f" ROI: {pension_result.roi:.2f}%")
if pension_result.break_even_age:
print... | Python | 1 |
e_pre_instance_ar.item_metadata.status.value,
version=objective_pre_instance_ar.item_metadata.version,
change_description=objective_pre_instance_ar.item_metadata.change_description,
author_username=objective_pre_instance_ar.item_metadata.author_username,
library=Library.f... | Python | 1 |
ess required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
... | Rust | 0 |
such as 28F comprised of a Zone Number (one or two digits) and Zone Letter
/// (C-X, minus I and O)
#[derive(Default, Copy, Clone, Debug)]
pub struct Gzd {
/// 6° longitudinal zone (1..60 covering 180°W..180°E)
pub zone: u8,
/// 8° latitudinal band (C..X covering 80°S..84°N)
pub band: LatBand,
}
/// 1... | Rust | 0 |
Returns:
str: The augmented query with web search results.
"""
web_search_results = webscout.WEBS().text(query, max_results=3)
if web_search_results:
formatted_results = "\n".join(
f"{i+1}. {result['title']} - {result['href']}\n\nBody: {result['body... | Python | 1 |
self) -> &Option<String> {
&self.text
} /// If action is 'set times and display' get `Some((fade_in, stay, fade_out))` else get `None`
pub fn get_times(&self) -> &Option<(i32, i32, i32)> {
&self.times
}
}
#[derive(Debug, PartialEq, Clone)]
pub struct EntitySoundEffect {
sound_id: i32... | Rust | 0 |
,
pub height: f32,
}
impl KamadaKawai {
pub fn new<G, F>(graph: G, length: &mut F) -> KamadaKawai
where
G: IntoEdgeReferences + IntoNodeIdentifiers + NodeCount,
G::NodeId: Eq + Hash,
F: FnMut(G::EdgeRef) -> f32,
{
let eps = 1e-1;
let width = 1000.;
let height = 1000.;
let n = graph.... | Rust | 0 |
from llama_index.tools import QueryEngineTool, ToolMetadata
from llama_index.agent import ReActAgent
from llama_index.llms import OpenAI
import openai
from llama_index.callbacks.base import CallbackManager
from index_wikipages import create_index
from utils import get_apikey
def wikisearch_engine(index):
query_eng... | Python | 1 |
ut u32, ENABLE_OUTPUT);
ptr::write_volatile(BUTTON1_CONFIG as *mut u32, ENABLE_INPUT | PULL_UP);
ptr::write_volatile(BUTTON2_CONFIG as *mut u32, ENABLE_INPUT | PULL_UP);
ptr::write_volatile(BUTTON3_CONFIG as *mut u32, ENABLE_INPUT | PULL_UP);
ptr::write_volatile(BUTTON4_CONFIG as *mut u... | Rust | 0 |
ring::new() + &dbxref.db.name + ":" + &dbxref.accession;
let rc_termid = RcString::from(&termid);
Cvterm {
name,
cv,
dbxref,
definition,
is_obsolete,
is_relationshiptype,
cvtermsynonyms: RefCell::new(vec![]),
... | Rust | 0 |
tiles[idx];
if t.fg != last_fg {
cp_fg = find_nearest_color(t.fg, &be.color_map);
last_fg = t.fg;
}
if t.bg != last_bg {
cp_bg = find_nearest_color(t.bg, &be.color_map);
... | Rust | 0 |
erminate()
print("\ntfdbg: caught SIGINT; calling sys.exit(1).", file=sys.stderr)
sys.exit(1)
def _mouse_mode_command_handler(self, args, screen_info=None):
"""Handler for the command prefix 'mouse'.
Args:
args: (list of str) Arguments to the command prefix 'mouse'.
screen_info: (dict) I... | Python | 1 |
#!/usr/bin/env python3
"""
Datagen - Generate Origin ASN summary per country.
"""
import argparse
import asyncio
import sys
from dgen.datagen import Datagen
async def main():
"""Datagen"""
parser = argparse.ArgumentParser(
description="Datagen - Generate Origin ASN summary per country."
)
pa... | Python | 1 |
{"form": form,
"page_title": PAGE_TITLE,
"button_label": "Create", }
return render(request, "creating_or_updating_base.html", context)
def update_booking(request, booking_id):
PAGE_TITLE = "Update Booking"
booking = get_object_or_404(Booking, pk=booking_id)
if request.me... | Python | 1 |
field_name_to_use = f"{field_name}_" if field_name in kwlist else field_name
dataclass_fields.append(
field_name_to_use,
)
return _make_datacls(name, dataclass_fields)
def _idl_typedef_to_python_type(
typedef: IdlTypeDefinition,
types: TypeDefs,
) -> Type:
"""Gener... | Python | 1 |
import math
class Solution:
def isPerfectSquare(self, num: int) -> bool:
a = int(math.sqrt(num))
b=a*a
if b==num:
return True
return False
| Python | 1 |
import numpy as np
import pytest
from napari.layers import Shapes
from napari_builtins._measure_shapes import (
toggle_shape_measures,
update_features_with_measures,
)
@pytest.mark.parametrize(
('shape_type', 'shape_data', 'perimeter', 'area'),
[
('line', [[0, 0], [1, 1]], np.sqrt(2), 0),
... | Python | 1 |
"""
Correct wind data for ship motion
---------------------------------------------------
This example shows how to calculate course and speed
over ground of the ship and use it to correct the
wind speed and direction data.
"""
from arm_test_data import DATASETS
import xarray as xr
import act
# Read in the navigatio... | Python | 1 |
O_RCVTIMEO;
pub const SO_SNDTIMEO: c_int = libc::SO_SNDTIMEO;
pub const SO_REUSEADDR: c_int = libc::SO_REUSEADDR;
pub const SO_REUSEPORT: c_int = libc::SO_REUSEPORT;
pub const SO_RXQ_OVFL: c_int = libc::SO_RXQ_OVFL;
pub const SO_SNDBUF: c_int = libc::SO_SNDBUF;
pub const SO_SNDBUFFORCE: c_int = ... | Rust | 0 |
import os
import numpy as np
import pandas as pd
# log_dir = '/data/codes/ProtoRKD/logs/codebase_test/U[mobilenet_v3_large-h2]-L[CLIP-from-RN50]-bs1024-YFCC-56ep-lr1e-5/ELEVATER_evaluation/5-shot/log'
mode_dir = input('Input your log dir (end with "../ELEVATER_evaluation/<eval_mode>"):\n>>> ')
mode = mode_dir.split... | Python | 1 |
\textrm{real,cross}}^{\textrm{e-ion}}
+ E_{\textrm{recip},k>0}^{\textrm{e-ion}} + E_{\textrm{recip},k=0}^{\textrm{e-ion}} \\
E^{\textrm{ion-ion}} &= E_{\textrm{real,cross}}^{\textrm{ion-ion}} + E_{\textrm{real,self}}^{\textrm{ion-ion}}
+ E_{\textrm{recip},k>0}^{\textrm{ion-io... | Python | 1 |
def voxelize_surface(mesh, resolution):
vertices = mesh.vertices
faces = mesh.faces
vertices = (vertices + 0.5) * resolution
face_loc = vertices[faces]
occ = np.full((resolution,) * 3, 0, dtype=np.int32)
face_loc = face_loc.astype(np.float32)
voxelize_mesh_(occ, face_loc)
occ = occ != 0
... | Python | 1 |
import pandas as pd
import json
import regex as re
datasets = [
"Proxifier",
"Linux",
"Apache",
"Zookeeper",
"Hadoop",
"HealthApp",
"OpenStack",
"HPC",
"Mac",
"OpenSSH",
"Spark",
"Thunderbird",
"BGL",
"HDFS",
]
def modify_prompt(new_prompt, dataset):
new_d... | Python | 1 |
# Copyright (c) 2022-2024 Intel Corporation
#
# 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... | Python | 1 |
import scipy.interpolate as spi
import numpy as np
import matplotlib.pyplot as plt
from planning_playground.search.types import Node, PathPlanningResult
from planning_playground.motion_models.abstract_motion_model import AbstractMotionModel
class SplineSmoother:
def __init__(
self,
motion_model: A... | Python | 1 |
},
};
<reponame>ken-matsui/mincoin<gh_stars>1-10
pub mod client;
pub mod server;
pub mod state;
//use log::{Level, Log, Metadata, Record, SetLoggerError};
// use oslog_sys::_os_log_fault;
// use oslog_sys::{
// OS_LOG_TYPE_DEBUG, OS_LOG_TYPE_DEFAULT, OS_LOG_TYPE_ERROR, OS_LOG_TYPE_FAULT, OS_LOG_TYPE_INFO,
// };
us... | Rust | 0 |
req_x_lock_args.tips_ckb;
verify_ckb_cell(
ckb_change_index,
Source::Output,
expected_ckb_capcatiy.try_into().unwrap(),
user_lock_hash,
)?;
let amount_x =
decode_u128(&load_cell_data(req_x_index, Source::Input)?)? - req_x_lock_args.tips_sudt_x;
let amount_y =
... | Rust | 0 |
uldn't ever call this from client until the job is complete
job, status = get_job(id)
filePath = job['id'] + '.wav'
job['status'] = 'cleanup'
queues['finished'].remove(job)
queues['cleanup'].append(job)
return FileResponse(path=filePath, filename=filePath, media_type='text/wav')
@app.post("/set... | Python | 1 |
if free_memory_current < free_memory_size
{
println!("iteration {}, pruning tree", iteration);
tree.prune();
// we cannot use RAM usage here as it is not refreshed quicly enough
free_memory_current = free_memory_base - (memory_used(&tree) as i64);
... | Rust | 0 |
#!/usr/bin/python
# This python script can be used to extract HTTP request and responses from an SDK log
# and beautify json payloads
from __future__ import print_function
import json, sys, re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--print-cs-post', '-r', action='store_true', dest='... | Python | 1 |
::{G, MAX_PLAYERS_COUNT};
/// A damage per one pixel of height with which tank was dropped.
const TANK_THROWING_DAMAGE_POWER: f32 = 0.1;
#[derive(Debug, Clone)]
pub enum GameState {
TanksThrowing,
Aiming,
FlyingOfMissile(Missile),
Exploding(Vec<Explosion>),
Subsidence,
Finish,
}
pub struct Ro... | Rust | 0 |
set_version(package_version)
}
}
pub(crate) fn bump_version_and_update_state(
run_type: RunType,
rule: Rule,
) -> Result<RunType, StepError> {
match run_type {
RunType::DryRun {
mut state,
mut stdout,
} => {
let version = bump_version(rule, true,... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.