text
string
label_name
string
labels
int64
# Generated by Django 5.0.1 on 2024-01-05 15:51 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('employee', '0001_initial'), ] operations = [ migrations.CreateModel( name='...
Python
1
entity, paddle) in paddle_query.iter() { commands.remove_one::<Hit>(entity); let maybe_collision_point = find_ball_paddle_collision_point( &transform.translation, &ball_translation_previous, &ball, paddle, ); ...
Rust
0
self.nodes[2].getbalance(), bal) #for now, assume the funds of a 2of3 multisig tx are not marked as spendable txDetails = self.nodes[0].gettransaction(txId, True) rawTx = self.nodes[0].decoderawtransaction(txDetails['hex']) vout = False for outpoint in rawTx['vout']: if outp...
Python
1
xes(self._vertexes.reshape(self._vertexes.shape[0]*self._vertexes.shape[1], 3)) self.meshDataChanged() def generateFaces(self): cols = self._z.shape[1]-1 rows = self._z.shape[0]-1 faces = np.empty((cols*rows*2, 3), dtype=np.uint) rowtemplate1 = np.arange...
Python
1
bles") options, args = parser.parse_args(args) if len(args) < 1: print('You must give a template filename') sys.exit(2) template_name = args[0] args = args[1:] vars = {} if options.use_env: vars.update(os.environ) for value in args: if '=' not in value: ...
Python
1
from core import constants, log, json_util def match_particular_property(index, source_data_field, translation_data_field, translation_file): """Logs error if particular 'source_data_field' doesn't match with the particular 'translation_data_field' Parameters: ...
Python
1
cons/stop_video.png')) self.label_video_stop.setScaledContents(True) self.label_image_export.setPixmap(QPixmap(':/image/icons/export.png')) self.label_image_export.setScaledContents(True) self.label_video_export.setPixmap(QPixmap(':/image/icons/export.png')) self.label_video_expo...
Python
1
is currently in maintenance mode, while [user]<NAME>[/user] finishes tweaking the completely overhauled source.") .build(); output.send(msg) .expect("Failed to queue message."); });mod client; mod model; pub use self::client::get; pub use self::model::{Giteki, GitekiInformation, RequestParameters...
Rust
0
Terracotta, // 1.12 (id: 242)| 1.13 (id: 6256) SilverGlazedTerracotta, // 1.12 (id: 243) CyanGlazedTerracotta, // 1.12 (id: 244)| 1.13 (id: 9550) PurpleGlazedTerracotta, // 1.12 (id: 245)| 1.13 (id: 4818) BlueGlazedTerracotta, // 1.12 (id: 246)| 1.13 (id: 23823) BrownGlazedTerracotta, // 1.12 (id: 2...
Rust
0
import json import pandas as pd from sklearn import cross_validation import sys import time from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.naive_bayes import MultinomialNB from sklearn.linear_model import SGDClassifier from sklearn.l...
Python
1
#!/usr/bin/env python3 """Test for potential bug in decode_docs function.""" import json import sys sys.path.insert(0, '/root/hypothesis-llm/envs/yq_env/lib/python3.13/site-packages') from yq import decode_docs def test_decode_docs_no_trailing_character(): """Test decode_docs with JSON that has no trailing chara...
Python
1
import pymem import pymem.process import sys # Опкод для инструкции `shl rcx,04` pattern = b'\xA9\xFF\xF7\xFF\xFF' # Название процесса process_name = "stalcraft.exe" try: # Открываем процесс pm = pymem.Pymem(process_name) except pymem.exception.ProcessNotFound: print(f"Процесс {process_name} не найден.")...
Python
1
cesses.opencv.demo --dataset=demo --draw --out=out-py3 CommandLine: python -m viame.processes.opencv.demo --help # Move to the data directory cd ~/data/opencv_stereo_sample_data_small # Run with args specific to that data directory python -m viame.processes.opencv.demo \ ...
Python
1
on translation table walk, 3rd level" } 0b100001 => "Alignment fault", 0b100010 => "Debug event", _ => "Unknown instruction fault", } } #[no_mangle] unsafe extern "C" fn current_elx_sync(exception: &mut ExceptionInfo) { let mut uart_a = Uart::A; writeln!(&mut uart_a, "\r")....
Rust
0
import imp class LevelLoaderBase: """ Base calss for LevelLoader which you will use to load level editor data in your game. Refer LevelLoader.py for example. """ def __init__(self): self.defaultPath = None # this should be set in your LevelLoader.py self.initLoader() def i...
Python
1
.unwrap() .split("=") .collect::<Vec<_>>(); folds.push((pair[0].chars().nth(0).unwrap(), pair[1].parse().unwrap())); } else if string.len() > 0 { let pair = split_string(",", &string); points.push((pair[0], pair[1])); }...
Rust
0
Fb, En, Hi> { pub user_attributes: &'a [&'a UserAttribute<'a, Ex, Fb, En, Hi>], pub name: Sid<'a>, pub kind: ClassTypeconst<'a>, pub span: &'a Pos<'a>, pub doc_comment: Option<&'a DocComment<'a>>, pub is_ctx: bool, } impl<'a, Ex: TrivialDrop, Fb: TrivialDrop, En: TrivialDrop, Hi: TrivialDrop> T...
Rust
0
#!/usr/bin/env python3 from os import getenv, path from pathlib import Path from sys import argv import hashlib import json if len(argv) != 2: print("ERROR: JSON info script requires output arg") exit(1) json_path = Path(argv[1]) file_path = Path(getenv("FILE_DIR")) / getenv("FILE_NAME") if not file_path.is...
Python
1
import os import wget import zipfile import numpy as np import park from park.utils.misc import create_folder_if_not_exists def get_chunk_time(trace, t_idx): if t_idx == len(trace[0]) - 1: return 1 # bandwidth last for 1 second else: return trace[0][t_idx + 1] - trace[0][t_idx] def load_ch...
Python
1
nt, CTEBeamSpline, CTEBloodSprite, CTEBloodStream, CTEBreakModel, CTEBSPDecal, CTEBubbles, CTEBubbleTrail, CTEClientProjectile, CTEDecal, CTEDust, CTEDynamicLight, CTEEffectDispatch, CTEEnergySplash, CTEExplosion, CTEFireBullets, CTEFizz, CTEFootprintD...
Rust
0
# Copyright 2024 The PyMC Developers # # 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 ag...
Python
1
"""Test the API's checkout process over full digital orders.""" from ....checkout.fetch import fetch_checkout_info, fetch_checkout_lines from ....plugins.manager import get_plugins_manager from ...core.utils import to_global_id_or_none from ...tests.utils import get_graphql_content from ..mutations.utils import update...
Python
1
import asyncio import json import time import aiohttp from tqdm import tqdm async def post_request(session, url, data, headers, progress_bar): async with session.post(url, json=data, headers=headers) as response: print(await response.text()) progress_bar.update(1) num_runs = 10 async def main...
Python
1
)] const UNW_INIT_SIGNAL_FRAME: libc::c_int = 1; // these two things can be quite large, but we need enough area to make sure the compatibility. #[repr(C)] pub union UnwContext { __ucontext: libc::ucontext_t, __mem_block: [usize; LLVM_UNW_CONTEXT_SIZE], } #[repr(C)] pub uni...
Rust
0
from rest_framework import serializers from .models import Memory from django.conf import settings class MemorySerializer(serializers.ModelSerializer): created_by_username = serializers.ReadOnlyField(source='created_by.username') created_by_avatar = serializers.SerializerMethodField() likes_count = seriali...
Python
1
basic information about the transaction pool. struct PoolInfoHandler<T> { tx_pool: Weak<RwLock<pool::TransactionPool<T>>>, } impl<T> Handler for PoolInfoHandler<T> where T: pool::BlockChain + Send + Sync + 'static, { fn handle(&self, _req: &mut Request) -> IronResult<Response> { let pool_arc = w(&self.tx_pool); ...
Rust
0
hasn't lapsed"); invmgr.received_tick(time + REBROADCAST_TIMEOUT, &tree); assert_eq!( messages(&receiver) .filter(|(a, m)| matches!(m, NetworkMessage::Inv(_)) && a == &remote) .count(), 1 ); } #[test] fn test_max_attemps() { ...
Rust
0
masklen = 32; /// table.insert(prefix, masklen, "foo"); /// /// assert_eq!(table.exact_match(prefix, masklen), Some(&"foo")); /// // Mutate value /// if let Some(value) = table.exact_match_mut(prefix, masklen) { /// *value = &"bar"; /// } /// // Get new value /// assert_eq!(tabl...
Rust
0
from turtle import Turtle, Screen tim = Turtle() screen = Screen() def move_forwards(): tim.forward(10) def move_backwards(): tim.backward(10) def turn_left(): new_heading = tim.heading() + 10 tim.setheading(new_heading) def turn_right(): new_heading = tim.heading() - 10 tim.setheading(...
Python
1
utures::stream::once(async move { stream_data }), len, ) .await .context(StoreError)?; Ok(()) } /// Loads the configuration for this server from the configured store. This /// replaces any in-memory configuration that might already be set. pu...
Rust
0
59, 60, 47, 48, 52, 49, 51, 50]], vec![vec![(28, 73), (28, 29)], vec![(32, 31), (32, 73)]]), ), ( "c1ccc(Cc2ccc[n+](CCCCCc3cc(CCCCC[n+]4cccc(Cc5ccccc5)c4)c(CCCCC[n+]4cccc(Cc5ccccc5)c4)cc3CCCCC[n+]3cccc(Cc4ccccc4)c3)c2)cc1", (vec![vec![15, 14, 13, 12, 11, 10, 9, 8...
Rust
0
# coding: UTF-8 import time import torch import numpy as np import pandas as pd from train_eval import train, init_network from utils import build_dataset, build_iterator, get_time_dif from sklearn.model_selection import train_test_split from importlib import import_module import argparse parser = argparse.ArgumentPar...
Python
1
}) Change in arduino code or supply different input file", number, sample_rate); } } } } ...
Rust
0
ch_norm(deepcopy(bn), chunks=CHUNKS) input = torch.rand(16, 3, 224, 224) input = tilt_dist(input) opt = optim.SGD(chain(bn.parameters(), dbn.parameters()), lr=0.1) # 1st step a = bn(input) b = chunked_forward(dbn, input) # Outputs are different. (per-mini-batch vs. per-micro-batch) a...
Python
1
for encoding directives http_equiv = content = None for k, v in attrs: if k == "http-equiv": http_equiv = string.lower(v) elif k == "content": content = v if http_equiv == "content-type" and content: ...
Python
1
from ...widgets.SpinBox import SpinBox from .basetypes import WidgetParameterItem class NumericParameterItem(WidgetParameterItem): """ Subclasses `WidgetParameterItem` to provide the following types: ========================== ============================================================= **Registere...
Python
1
import logging from urllib.parse import quote, unquote from fastapi import APIRouter, HTTPException, status from models.url_encoder_models import UrlEncoderInput, UrlEncoderOutput # Configure logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) router = APIRouter(prefix="/api/url-enc...
Python
1
// Pattern has comma, code doesn't. assert_matches("foo($a, $b,)", "fn f() {foo(1, 2);}", &["foo(1, 2)"]); assert_matches("Foo{$a, $b,}", "fn f() {Foo{1, 2};}", &["Foo{1, 2}"]); } #[test] fn match_type() { assert_matches("i32", "fn f() -> i32 {1 + 2}", &["i32"]); assert_matches("Option<$a>", "fn f() ...
Rust
0
def render_image(self, batch): rays, rgbs = batch _, height, width, _ = rgbs.shape # N H W C single_image_rays, val_mask = rearrange_render_image(rays, self.cfg.val.batch_size) coarse_rgb, fine_rgb = [], [] vol_coarse, vol_fine = [], [] with torch.no_grad(): ...
Python
1
ILDA file. /// /// ``` /// # use ilda::animation::Animation; /// let filename = "examples/files/ildatest.ild"; /// let animation = Animation::read_file(filename).unwrap(); /// /// assert_eq!(2, animation.frame_count()); /// ``` pub fn read_file(filename: &str) -> Result<Animation, IldaError> { let...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from fairseq2_011.data.text.converters import StrSplitter as StrSplitter from fairseq2_011.data.text.converters...
Python
1
f0 + f1) % 1000000007; f0 = f1; f1 = sum; i += 1; } f0 } /// 剑指 Offer 64. 求1+2+…+n https://leetcode-cn.com/problems/qiu-12n-lcof/ /// 求 1+2+...+n ,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 /// 使用match语句是否违规呢? /// 方法1:递归法 pub fn sum_nums(n: i32) -> i32 { let mut sum...
Rust
0
..Default::default() }, ), ); t.add( EventType::ActivityTaskCanceled, history_event::Attributes::ActivityTaskCanceledEventAttributes( ActivityTaskCanceledEventAttributes { scheduled_event_id, ..Default::default() }, ...
Rust
0
hrough_input_type: PhantomData, _act_a_input_type: PhantomData, } } fn tee<'a, 'b, 'i, ActB>(&'a self, other: &'b ActB) -> Tee<'a, 'b, Self, ActB> where Self::Input: 'i, ActB: Action<Input = Self::Input>, Tee<'a, 'b, Self, ActB>: Action<Input = Self::Input, Outpu...
Rust
0
# Imports import argparse import os # Own libs. from models.clustering.evaluation_metrics import evaluate_cluster_configurations # Folder permissions for cluster. os.umask(0o002) # H5 File bug over network file system. os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE' ##### Main ####### parser = argparse.ArgumentParser...
Python
1
expected_output = { 'ipv4_add': { '5.5.5.2/32': { 'child': { 'child_adj': { 'dstmac': 'a0f8.4910.ab57', 'ether_type': '0x8', 'iif_id': '0x553', 'nh_type': 'NHADJ_NORMAL', 'objid': ...
Python
1
.lock() .lines() .map(|s| read_nanobot(&s.expect("Read error"))) .collect(); let strongest = nanobots.iter().max().unwrap(); println!("{:?}", nanobots.iter().filter(|x| strongest.in_range_of(x)).count()); } <gh_stars>100-1000 use super::btleplug_adapter_task::{BtleplugAdapterCo...
Rust
0
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ @Project :ai-comment-analysis @File :routes.py @Author :yohong @Date :2025/1/10 15:05 """ from fastapi import APIRouter, FastAPI from ai_analytics.controller.TaskConfigController import router as TaskConfigRouter from ai_analytics.controller.EnumController impo...
Python
1
); } *e_wd_ptr.offset(a as isize) = blk_max.bits(); } e_widths.set_len(n_blks + 1); c_ptr = scratch.as_mut_ptr(); // Construct index header let mut lvls: Vec<Vec<u64>> = Vec::with_capacity(n_lvls); for a in 0..(n_lvls as isize) { let length:...
Rust
0
Args: x_train (pd.DataFrame): Training features y_train (pd.Series): Training target values Returns: RandomForestRegressor: Trained model with specified parameters """ self.logger.info("Training Random Forest Model with predefined param...
Python
1
::UCVTFS32Float2Int { Rd: 10, Rn: 27 } ); // ucvtf s9, w28 assert_eq!( decode_root_unwrap(0x1E230389), InstructionKind::UCVTFS32Float2Int { Rd: 9, Rn: 28 } ); // ucvtf s4, s1 assert_eq!( decode_root_unwrap(0x7E21D824), InstructionKind::UCVTFAsisdmiscR { ...
Rust
0
le(String), // a variable pattern, of form $name VariablePattern(String), // a constant pattern, of form #name ConstPattern(String), // an any pattern, of form #name AnyPattern(String), // invalid token Invalid(String), // end of file EOF, } #[derive(PartialEq, Clone, Debug...
Rust
0
derive(Debug, Clone, PartialEq)] pub struct Request<'a> { pub method: &'a str, pub uri: &'a str, pub headers: Vec<Header<'a>>, pub body: &'a [u8], } #[derive(Debug, Clone, PartialEq)] pub struct Header<'a> { pub name: &'a str, pub value: &'a str, } pub fn cf_request<'a, 'b, 'c>( i: (&'a mu...
Rust
0
as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ...
Rust
0
st_dev: stat.st_dev.into_pyref(vm), st_nlink: stat.st_nlink.into_pyref(vm), st_uid: stat.st_uid.into_pyref(vm), st_gid: stat.st_gid.into_pyref(vm), st_size: stat.st_size.into_pyref(vm), __st_atime_int: atime.0, ...
Rust
0
::new(val, suit_two); (c1, c2) }, RangeComponent::CardsSuited(val_g,val_l) => { let (suit_one, _) = gen_random_suits(&mut rng); let c1 = Card::new(val_g, suit_one); let c2 = Card::new(val_l, suit_one); (c1, c2) ...
Rust
0
iceType, features: Dict[str, Any], environment_key: UUID, ): self.id = id self.username = username self.device = device self.features = SwitchKeysFeatureType( features=features, environment_key=environment_key, user_id=self.id ) class SwitchKeysE...
Python
1
let unifiedTerm: Term = NarUnify::unifySubst(&*(iv.read().sentence).term, &asgnmts.unwrap()); // unify because we need term with less or no variables! res = (exp, Some((Arc::clone(&iv), unifiedTerm))); } } }, _ => {} ...
Rust
0
:ONE)), Ok(Decimal(Decimal::ZERO)) ); assert_eq!( base.try_subtract(&Bool(true)), Err(ValueError::NonNumericMathOperation { lhs: Decimal(base), operator: NumericBinaryOperator::Subtract, rhs: Bool(true), } ...
Rust
0
import numpy as np import math import cv2 def PSNR(img1, img2): img1 = img1.detach().cpu().numpy() img2 = img2.detach().cpu().numpy() mse = np.mean((img1 - img2) ** 2) if mse == 0: return 100 PIXEL_MAX = 1 return 20 * math.log10(PIXEL_MAX / math.sqrt(mse)) # 计算像素 def CIEDE2000(Lab_1...
Python
1
if settings.DOCS_SHOW_DRAFTS is False and meta.get('status') == 'draft': continue entry['doc_toc'] = mark_safe(doc_toc) entry['doc_toc_absolute'] = mark_safe( re.sub(r'href="#', 'href="{}#'.format(reverse('docs', args=[entry['url']])), doc_toc)) ...
Python
1
{self, create_dir_all, File}; use std::io::{BufReader, Write}; use std::path::Path; use fs_extra::dir::{self, CopyOptions}; use log::info; use serde_json::{Deserializer, Map, Value}; use tempfile::tempdir; use uuid::Uuid; use crate::dump::{compat, Metadata}; use crate::options::IndexerOpts; use crate::tasks::task::Ta...
Rust
0
assert!( delta <= MAX_ERROR, "delta {} too large: {} vs {}", delta, actual, expected ); } } } <reponame>thendo-rambs/redimage use anyhow::Result; use reqwest::blocking::Client; use serde::{Deserialize, Serialize}; #...
Rust
0
get_root_tag(rootNode) if rootClass is None: rootTag = 'Observables' rootClass = ObservablesType rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None rootElement = rootObj.to_etree(None, name_=rootTag) content...
Python
1
, mask), 1) else: emb_token = torch.tile(self.emb_token, (bs,)).reshape(bs, -1) # adding the embedding token for all sequences xseq = torch.cat((emb_token[None], x), 0) # create a bigger mask, to allow attend to emb token_mask = torch.ones((bs, 1), d...
Python
1
24-03-20T10:00:00Z", } ] mock_mem0_memory.from_config.return_value = mock_client # Configure the mock_tool mock_tool.get.side_effect = lambda key, default=None: { "toolUseId": "test-id", "input": { "action": "store", "content": "Test memory content", ...
Python
1
_settlement_port = get_open_port(Some(3000)); let mut connection_info = redis_test_context.get_client_connection_info(); connection_info.db = 1; let node: InterledgerNode = serde_json::from_value(json!({ "ilp_address": NODE_ILP_ADDRESS, "default_spsp_account": USERNAME_1, "admin_aut...
Rust
0
"""Write Python script for converting decimal number into Binary number.""" def decimal_to_binary(n): binary = "" if n == 0: return "0" while n > 0: binary = str(n % 2) + binary n = n // 2 print(binary) return binary decimal = int(input("Enter a de...
Python
1
(0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { ...
Rust
0
, F> where M: MapperAllSizes, F: FrameAllocator<Size4KiB>, { fn new( bytes: &'a [u8], page_table: &'a mut M, frame_allocator: &'a mut F, ) -> Result<Self, &'static str> { log::info!("Elf file loaded at {:#p}", bytes); let kernel_offset = PhysAddr::new(&bytes[0] as...
Rust
0
blocks .iter() .map(|block| match block { &Blob { pages, .. } => pages, &TcsSsa { nssa } => 1 + ((nssa * ssaframesize) as usize), }) .fold(0, std::ops::Add::add); let mut out = stdout(); let mut writer = CanonicalSgxsWriter::new( &mut out, ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : wifi.py # Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------ # Author's Blog: https://blog.csdn.net/qq_32394351 # Date : 2024/9/4 import network import utime def connect_wifi(ssid, password): """ 连接wifi :param ssid: wifi名称 :param password: wifi密码 ...
Python
1
ret } fn decompress_read_byte(state: &mut DecompressorState) -> u32 { let mut ret = 0; for _ in 0..8 { // Read msb -> lsb ret <<= 1; ret |= decompress_read_bit(state); } ret } fn decompress_read_unary(state: &mut DecompressorState) -> u32 { let mut n = 0; while decomp...
Rust
0
from __future__ import absolute_import import os from jarvis.core.atoms import Atoms from jarvis.io.phonopy.outputs import ( bandstructure_plot, total_dos, read_fc, get_phonon_tb, ) from jarvis.io.phonopy.inputs import PhonopyInputs from jarvis.analysis.structure.spacegroup import Spacegroup3D from jarv...
Python
1
from corehq.apps.app_manager.const import ( AMPLIFIES_NO, AMPLIFIES_NOT_SET, AMPLIFIES_YES, ) YES = True NO = False NOT_SET = None AMPLIFY_COUCH_TO_SQL_MAP = { AMPLIFIES_YES: YES, AMPLIFIES_NO: NO, AMPLIFIES_NOT_SET: NOT_SET } TEST_COUCH_TO_SQL_MAP = { "true": YES, "false": NO, "non...
Python
1
4 = m.input("i4", 6); m.output("o2", i3 << i4); let i5 = m.input("i5", 32); let i6 = m.input("i6", 32); m.output("o3", i5 << i6); let i7 = m.input("i7", 64); let i8_ = m.input("i8", 64); m.output("o4", i7 << i8_); let i9 = m.input("i9", 128); let i10 = m.input("i10", 128); m.o...
Rust
0
manifold_edges() # vis_lst = [dec_mesh, pcd] # vis_lst = [dec_mesh, pcd] # o3d.visualization.draw_geometries(vis_lst) # if test_pnts is not None : # tpcd = o3d.geometry.PointCloud() # print("test_pnts",test_pnts.shape) # tpcd.points = o3d.utility.Vector3dVector(test_pnts[:, :3])...
Python
1
, crate::android::nfc::Tag>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> { // class.path == "android/nfc/tech/Ndef", java.flags == PUBLIC, .name == "getTag", .descriptor == "()Landroid/nfc/Tag;" unsafe { let __jni_args = []; let __jni_env = __jni_bi...
Rust
0
match vals[0] { Val(ref s) => Some((*s).clone()), _ => Some(def.to_owned()) } } } fn is_arg(arg: &str) -> bool { arg.len() > 1 && arg[0] == '-' as u8 } fn find_opt(opts: &[Opt], nm: Name) -> Option<uint> { // Search main options. let pos = opts.iter().position(|opt| ...
Rust
0
import numpy as np def mesh_boolean(V1,F1,V2,F2,boolean_type='union'): """Finds intersection, union or subtraction of two triangle meshes. Given two triangle meshes dA and dB, uses exact predicates to compute the intersection, union or subtraction of the two solids A and B, and output its surface dC Para...
Python
1
} } impl<T: std::hash::Hash + Eq> std::hash::Hash for Category<T> { fn hash<H>(&self, state: &mut H) where H: std::hash::Hasher, { self.name.hash(state); self.idx.hash(state); self.elements.iter().for_each(|ele| ele.hash(state)); } } impl<T: Eq> std::cmp::Eq for Ca...
Rust
0
hunder.dds", 0x0700_1439, 0x396B_809C), (r"textures\tx_dwe_weat_overcast.dds", 0x0700_1439, 0xB794_480C), (r"textures\tx_b_n_barenziah_hair.dds", 0x070B_3C5D, 0x5996_B871), (r"textures\tx_b_n_barenziah_head.dds", 0x070B_3C5D, 0xB8F1_378A), (r"textures\tx_pit_concretefloor.dds", 0x0711_0A2D, 0xA10A_C...
Rust
0
for i in range(1, 10): if i
Python
1
) != 0) } #[doc = "Bit 2 - Channel In Use flag. Operating details depend on the MULTITASK bit in the MODCFG register, and affects the use of IDLE_CH. See Idle channel register for details of the two operating modes."] #[inline(always)] pub fn inuse(&self) -> INUSE_R { INUSE_R::new(((self.bits >>...
Rust
0
_1h;ddlZdZdS)Nc|||d}tdd5}|tj|dzddddS#1swxYwYdS)N)message prediction user_inputzuser_feedback.jsona )...
Python
1
active_union, queries, bootstrap=False, parametric=parametric) ...
Python
1
notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEME...
Rust
0
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class ScaleControl(Component): """A ScaleControl component. A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Keyword arguments: ...
Python
1
egKind}; use crate::abi::{self, HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods}; use crate::spec::HasTargetSpec; #[derive(PartialEq)] pub enum Flavor { General, Fastcall } fn is_single_fp_element<'a, Ty, C>(cx: &C, layout: TyLayout<'a, Ty>) -> bool where Ty: TyLayoutMethods<'a, C> + Copy, C:...
Rust
0
okenStream { let input = parse_macro_input!(input as DeriveInput); match body_impl::impl_my_derive(&input) { Ok(output) => { output.into() }, Err(error) =>{ error.to_compile_error().into() } } } <reponame>purposed/landlord<filename>src/cli/release.rs u...
Rust
0
#!/usr/bin/env python # Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # *...
Python
1
num1 = float(input("Enter a number: ")) num2 = float(input("Enter a second number: ")) if num1 > num2: print('The first number is larger.') elif num1 < num2: print('The Second number is larger.') elif num1 == num2: print('Both numbers are equal.') else: print("Error.")
Python
1
Ok((_i3, HciCommand { _opcode, _length, _data, _command })) } } #[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone)] pub struct ResponseStatus { _status_code: u8, } impl ResponseStatus { pub fn get_status_code(&self) -> u8 { self._status_code } pub fn parse<'a>(_i0: &'a [u8])...
Rust
0
import random import time from sorting_algorithms.bubble_sort import bubble_sort from sorting_algorithms.selection_sort import selection_sort from sorting_algorithms.insertion_sort import insertion_sort from sorting_algorithms.merge_sort import merge_sort from sorting_algorithms.quick_sort import quick_sort from sortin...
Python
1
_config = { &config.lock().unwrap().cpus.clone() }; let cpu_manager = cpu::CpuManager::new( cpus_config, &device_manager, &memory_manager, vm.clone(), exit_evt_clone, reset_evt, #[cfg(feature = "gdb")] vm_debug_evt, ...
Rust
0
test = { 'name': 'Problem 8', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" scm> (lambda (x y) (+ x y)) (lambda (x y) (+ x y)) scm> (lambda (x)) ; type SchemeError if you think this causes an error SchemeError """, 'hid...
Python
1
e, isize, isize), x: isize, y: isize, z: isize, ) -> bool { if self.pos[0] == x + rot.3 * rhs.pos[rot.0] && self.pos[1] == y + rot.4 * rhs.pos[rot.1] && self.pos[2] == z + rot.5 * rhs.pos[rot.2] { return true; } false } ...
Rust
0
- text_render_size_x, } }; let mut text_render_area_x: f32 = get_text_render_area_x(self.get_halign(), self._contents_area_size.x, self._contents_area.x, self._text_counts[0]); // text_render_area_y let row_count = self._text_counts.len(); let text_render_size_y = r...
Rust
0
e = stdR)] pub fn std_r(&self, dof: f64) -> FloatsVector { FloatsVector { data: self.data.std_axis(Axis(1), dof), } } /// get weighted std dev of all elements #[wasm_bindgen(js_name = weightedStd)] pub fn weighted_std(&self, weights: &FloatsMatrix, dof: f64) -> f64 { ...
Rust
0
""" This module computes general flight statistics. Uses a provided DB connection via utils. """ import pandas as pd from flights_project import utils def get_all_arrival_airports(conn=None): """ Return a list of all unique arrival airports using a provided DB connection. Returns a DataFrame with columns...
Python
1