text
string
label_name
string
labels
int64
import ssl import sys import optparse import ConfigParser import OpenSSL def getCertificate(s): cert_pem = ssl.get_server_certificate((s, 443)) cert_der = ssl.PEM_cert_to_DER_cert(cert_pem) x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert_pem) fingerprint = x50...
Python
1
#!/usr/bin/env python # Copyright (c) 2025 Carnegie Mellon University. # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE # ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. # CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, # EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUD...
Python
1
} } impl AsRef<str> for PlanBillingScheme { fn as_ref(&self) -> &str { self.as_str() } } impl std::fmt::Display for PlanBillingScheme { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.as_str().fmt(f) } } /// An enum representing the possible values of an `Pl...
Rust
0
from dataclasses import dataclass, field from typing import Optional, Type from dbt.adapters.base.relation import BaseRelation from dbt.adapters.relation_configs import RelationConfigChangeAction, RelationResults from dbt.context.providers import RuntimeConfigObject from dbt.utils import classproperty from dbt.adapte...
Python
1
"platforms": ["Android"], "descr": "Below are the tactics and techniques representing the MITRE ATT&CK<sup>&reg;</sup> Android platform. The techniques below are known to target mobile devices running Android operating systems.", "subtypes": [], }, { ...
Python
1
tialization", test_app_initialization, 10) tester.run_benchmark("File Operations", test_file_operations, 50) tester.run_benchmark("JSON Processing", test_json_processing, 100) tester.run_benchmark("Ollama Mock", test_ollama_mock, 50) # Summary print("\n" + "=" * 50) print("📊 Performance Summar...
Python
1
await _test_local_no_service_call( hass, SERVICE_ALARM_ARM_AWAY, "arm", FIRST_LOCAL_ENTITY_ID, two_part_local_alarm[0], **code, ) await _test_local_no_service_call( hass, SERVICE_ALARM_ARM_AWAY, "arm", SECOND_LOCAL_ENTITY_ID, ...
Python
1
Inhibit(false) }); about_window.set_transient_for(Some(window)); about_window.run(); about_window.destroy(); gtk::main(); } <reponame>spacekookie/clap_generate macro_rules! w { ($buf:expr, $to_w:expr) => { match $buf.write_all($to_w) { Ok(..) =>...
Rust
0
::Dword) } fn vpsrlq_22() { run_test(&Instruction { mnemonic: Mnemonic::VPSRLQ, operand1: Some(Direct(ZMM3)), operand2: Some(Direct(ZMM0)), operand3: Some(IndirectScaledIndexedDisplaced(ESI, EAX, Two, 86367833, Some(OperandSize::Xmmword), None)), operand4: None, lock: false, rounding_mode: None, merge_mode: Some(M...
Rust
0
import sys from .filesystem import FilesystemContext # For backward compatibility context = sys.modules[__name__] __all__ = ["FilesystemContext", "context"]
Python
1
# chromosomes for 2 principal species. If you work with another genome # the chromosomes will have to be specified HUMAN = ['1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '3', '4', '5', '6', '7', '8', '9', 'X', 'Y'] MOUSE = ['1', '10', '11', '12', '13', '14', '15', '16'...
Python
1
yers(self, layer_height): """Calculate which layers intersect which facets, for faster lookup.""" self.layer_facets = {} for facet in self.facets: minz, maxz = facet.z_range() minl = int(math.floor(minz / layer_height + 0.01)) maxl = int(math.ceil(maxz / layer...
Python
1
generate a token # for the main gateway. if is_overkiz_gateway(gateway.id): gateway_id = gateway.id developer_mode = await cloud_client.get_setup_option( f"developerMode-{gateway_id}" ) if developer_mode is None: raise DeveloperM...
Python
1
s.shape[1], coords.shape[2], img.shape[3]), dtype='float32') for k in range(img.shape[0]): xss, yss = xs[k], ys[k] ret[k, :, :, :] = img[k, yss, xss, :].reshape((coords.shape[1], coords...
Python
1
egorize present_key_values into self and cross attention. Split present state from grouped by layer to grouped by self/cross attention. Before: (past_key_self_0, past_value_self_0, past_key_cross_0, past_value_cross_0), (past_key_self_1, past_value_self_1, past_key_cross_1, past_value_c...
Python
1
from django.contrib.auth.models import AbstractUser from django.db import models class CustomUser(AbstractUser): bio = models.TextField(blank=True, null=True) profile_picture = models.ImageField(upload_to='profile_pics/', blank=True, null=True) followers = models.ManyToManyField( 'self', sy...
Python
1
""" Kalp Krizi Risk Tahmin Modeli - Sadece Tansiyon Aykırı Değer Temizleme """ import pandas as pd import numpy as np from pathlib import Path import sys # Proje kök dizinini Python path'ine ekle project_root = Path(__file__).parent sys.path.append(str(project_root)) from src.utils.data_loader import DataLoader from...
Python
1
sert_eq!( 2, count_valid_passwords( &inputs.split_by_blank_lines().collect::<Vec<&str>>(), is_valid_password ) ); } #[test] fn test_invalid_complex_passports() { let passports = "eyr:1972 cid:100 hcl:#18171d ecl:amb hgt:170...
Rust
0
println!("MESSAGE[[\n{}]]", from_utf8(&message).unwrap()); }).map_err(|error| { eprintln!("ERROR: {}", error); }); run(f); } // Copyright 2018 Parity Technologies (UK) Ltd. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software a...
Rust
0
assert!(matches!(msgin, InternalMsg::SetDirectory(_))); match msgin { InternalMsg::SetDirectory(dbuf) => dbuf, _ => panic!(), } } use std::sync::mpsc; #[test] fn test_explore_async() { let config = ExplorerConfig::default(); let path = PathBuf::...
Rust
0
while (not self.Done()): self.Step() return self.gbest[-1], self.gpos[-1] # # Swarm weight vector search: # class Objective: def __init__(self, probs, y): self.probs = probs self.y = y self.fcount = 0 def Evaluate(self, p): self.fcount += 1 ...
Python
1
iter().rev().fold(tail, |tail:SyntaxContext, mrk:&Mrk| {apply_mark_internal(*mrk,tail,table)}) } #[test] fn unfold_marks_test() { let mut t = new_sctable_internal(); assert_eq!(unfold_marks(vec!(3,7),EMPTY_CTXT,&mut t),3); { let table = t.table.borrow(); ...
Rust
0
me == self.shownLineCallstack[0]: # doc.MarkerAdd(self.shownLineCallstack[1], MARKER_CURRENT) def UpdateAllLineStates(self): for doc in editor.editorTemplate.GetDocumentList(): self.UpdateDocumentLineStates(doc) def ShowCurrentLine(self): # Show the current line. Only ever ...
Python
1
e la force du signal if risk_level == "low": signal_strength += 0.5 elif risk_level == "high": signal_strength -= 0.5 # Ne générer un signal que si la force est suffisante if direction and signal_strength >= 1.5: # Emoji en fonction de la dire...
Python
1
class Solution: def sumOfDigits(self, n): # code here lst=[] while(n>0): r=n%10 lst.append(r) n=n//10 return sum(lst)
Python
1
valPacc, valNacc, valPNacc1, valPNacc2, valPNacc3, valPNacc4 = validate(dataloader_test, model1, model2, ema_model1, ema_model2, epoch) #print(valPacc, valNacc, valPNacc1, valPNacc2, valPNacc3) stats_._update(trainPacc, trainNacc, trainPNacc, valPacc, valNacc, valPNacc1) is_best1 = valPNacc1...
Python
1
dark orange bags. dark orange bags contain 2 dark yellow bags. dark yellow bags contain 2 dark green bags. dark green bags contain 2 dark blue bags. dark blue bags contain 2 dark violet bags. dark violet bags contain no other bags." ), 126 ); } <reponame>cptpcrd/unix-cred-rs //! The `xucred` module...
Rust
0
letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] points = [1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, ...
Python
1
import logging import os from pyspark import SparkContext from pyspark.sql import SparkSession from pyspark.sql.types import StructType, StructField, LongType, DoubleType, StringType logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s") logger = logging.getLogger("MinI...
Python
1
import re def extract_criteria(text): text = text.lower() criteria = {} # Hãng (brand) brands = ["samsung", "oppo", "xiaomi", "vivo", "realme", "apple", "iphone", "asus", "sony", "nokia"] for brand in brands: if brand in text: criteria["brand"] = brand.capitalize() ...
Python
1
5, -1.93875, -1.93875], '#D0204': [-1.93875, -1.93875, -1.93875, -1.93875], '#D0205': [-1.833, -1.833, -1.833, -1.833], '#D0206': [-1.152, -1.152, -1.152, -1.152], '#D0207': [-1.1, -1.1, -1.1, -1.1], '#D0301': [-10.664, -10.664, -10.664, -10.664], '#D0302': [-5.5596, -5.5596, -5.5596, -5.5596], ...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """步驟 1 HTML 解析和 RSS 處理功能測試腳本 此腳本用於測試統一下載器中新實現的 HTML 解析和 RSS 處理功能,包括: 1. 證交所重大訊息公告解析 2. 證交所法說會期程解析 3. cnyes 台股新聞 RSS 解析 4. 櫃買中心融資融券 HTML 解析 Usage: python scripts/test_step1_html_rss_parsing.py """ import logging import sys from datetime import date, timedelta from p...
Python
1
thread.join() # 驗證沒有錯誤 assert len(errors) == 0 assert len(results) == 10 class TestCompressionIntegration: """測試壓縮管理器整合功能""" def test_integration_with_schema_fixes(self, test_session): """測試與修正後的 schema 整合""" manager = CompressionManager(test_session) # 創建...
Python
1
print("second lab")
Python
1
boxes = tf.reshape(boxes, [-1, 4]) box_scores = box_confidence * box_class_probs box_scores = tf.reshape(box_scores, [-1, classes_num]) return boxes, box_scores def correct_boxes(self, box_xy, box_wh, input_shape, image_shape): """ Introduction ------------ ...
Python
1
the function lambda_reg_values = np.linspace(0.0, config.lambda_ub, num=21) best_model = torch.load(final_model_path, map_location=device) # print( # "saving possible final model again at:", f"{config.model_dir}/model_{tag}.pth" # ) # torch.save(model, f"{config.model_dir}/model_{tag}.pth")...
Python
1
wn => Style::default().dim(), InstallStatus::Missing => Style::default().yellow().blink(), InstallStatus::Installed => Style::default().green(), }; info!( "{}- {} ({})", prefix, component, style.apply_to(install_status) ); ...
Rust
0
ter_iid def convertToInner(self, df_input, to_inner_uid, to_inner_iid): temp_df = df_input.copy() uids = temp_df['userID'] inner_uid = [to_inner_uid[eachOuter] for eachOuter in uids] iids = temp_df['itemID'] inner_iid = [to_inner_iid[eachOuter] for eachOuter in iids] ...
Python
1
lsch0."] pub struct DUTY_CYCLE_LSCH0_R(crate::FieldReader<u16, u16>); impl DUTY_CYCLE_LSCH0_R { #[inline(always)] pub(crate) fn new(bits: u16) -> Self { DUTY_CYCLE_LSCH0_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for DUTY_CYCLE_LSCH0_R { type Target = crate::FieldReader<u16, u16>...
Rust
0
# Faça um programa que peça o raio de um circulo, calcule e mostre a area pi = 3.14 raio = float(input("Digite o raio do círculo: ")) area = pi * (raio ** 2) print(f"A área de um círculo de raio {raio} é {area} m")
Python
1
()).collect(), failures, ..Default::default() } } } impl From<TestCase> for CoreTestCase { fn from(x: TestCase) -> Self { CoreTestCase { name: x.name, classname: Some(x.classname), status: Some(x.status), time: parse_durati...
Rust
0
n(cur_keyword_ids) > self.max_keyword_len: self.max_keyword_len = len(cur_keyword_ids) self.keyword_ids.append(torch.tensor(cur_keyword_ids)) self.tokenizer = tokenizer self.start_len = input_ids.shape[1] def call_for_batch(self, output_ids: torch.LongTensor, scores:...
Python
1
name = scylla_gdb.resolve(vtable_addr, startswith='vtable for seastar::continuation') if name and 'do_accept_one' in name: return obj_addr.cast(gdb.lookup_type('uintptr_t')) raise gdb.error("no tasks found with expected name") def test_fiber(gdb, task): scylla(gdb, f'fiber {task}') # S...
Python
1
def priority_scheduling(at, bt, priority, N): processes = [] for i in range(N): processes.append((i+1, at[i], bt[i], priority[i])) processes.sort(key=lambda x: x[3]) wt = [0]*N tat = [0]*N ft = [0]*N wt[0] = 0 for i in range(1, N): wt[i] = wt[i - 1] + processes[i - 1][2...
Python
1
fs.iter().map(|x| x.prob).sum::<f64>() / (leafs.len() as f64); let prob = (prob * 255.0) as u8; for i in 0..self.stepwidth { for j in 0..self.stepwidth { if x + i < self.stepwidth / 2 || y + j...
Rust
0
ms (offset, len) -> so offsets are offset, offset + len Agg: RollingAggWindowNoNulls<'a, T>, O: Iterator<Item = (IdxSize, IdxSize)> + TrustedLen, T: IsFloat + NativeType, { if values.is_empty() { let out: Vec<T> = vec![]; return Arc::new(PrimitiveArray::from_data( T::PRIMITIV...
Rust
0
s, createAt=meta.get('createAt',''),modifyAt=meta.get('modifyAt',' '),fileModifyAt=fileModifyAt) return render_template('editor.html',isPost=True,action=url_for('.post_save'),form=form) @pages.route('/save',methods=['POST']) @login_required def post_save(): form=PostForm() if form.validate_on_subm...
Python
1
{ Ok(Self::max_value()) } } Err(e) => Err(e), } } #[inline] fn wrapping_from_str_radix(s: &str, radix: u32) -> Result<Self, Self::Err> { Self::overflowing_from...
Rust
0
import os import json from django.http import HttpResponse import difflib from Shukongdashi.toolkit.pre_load import neo_con import random question_list = [] with open(os.path.dirname(os.getcwd())+'/label_data/questions.txt','r',encoding='utf8') as fr: for question in fr.readlines(): question_list.append(question.s...
Python
1
.set(self.turn(), pos); let board = board.set_win_state(board.evaluate_winner()).swap_turn(); Ok(board) } pub fn check_free_position(self, pos: XOPos) -> bool { !self.token_exist(X, pos) && !self.token_exist(O, pos) } pub fn token_at(self, pos: XOPos) -> Option<XOToken> { ...
Rust
0
_high(); let mut ir_recv_pin = gpioa.pa10; ir_recv_pin.make_interrupt_source(&mut syscfg); ir_recv_pin.enable_interrupt(&mut p.EXTI); ir_recv_pin.trigger_on_edge(&mut p.EXTI, Edge::RisingFalling); let receiver = Receiver::builder() .protocol::<IrProto>() .remotecontrol(IrRemote::de...
Rust
0
culation operations""" tdLog.info("Checking stream computation results after recalculation...") # Allow time for stream processing time.sleep(3) # Check recalculation results for each stream for stream in self.streams: if hasattr(stream, 'res_query_r...
Python
1
x>, ) { let tcx = infcx.tcx; debug!( "apply_requirements(location={:?}, closure_def_id={:?}, closure_substs={:?})", location, closure_def_id, closure_substs ); // Get Tu. let user_closure_ty = tcx.mk_closure(closure_def_id, closure_substs); d...
Rust
0
ca_roots: RootCertStore::empty(), session_cache_mode: SslSessionCacheModes::Both, session_cache_size: SSL_SESSION_CACHE_MAX_SIZE_DEFAULT, verify_modes: VerifyModes::VERIFY_PEER, mode: method.mode.clone(), } } } /// The main TLS structure which is created by a...
Rust
0
['applyToBranches'] n = Node('logicTreeBranchSet', attrib, None, [br.to_node() for br in bset.branches]) out.nodes.append(n) return out def to_nrml(self): """ Converts the logic tree into a string in NRML format """ return nrml.to...
Python
1
from rest_framework import serializers from rest_framework.reverse import reverse from lib.api.fields import NestedHyperlinkedIdentityField from lib.api.serializers import AplusModelSerializer from userprofile.api.serializers import UserBriefSerializer from ..models import Submission, SubmittedFile, BaseExercise __a...
Python
1
g = Arc::new(AtomicBool::new(true)); while running.load(Ordering::SeqCst) { srv.poll_timeout(Duration::from_millis(100)); } Ok(()) } pub fn main() -> Result<()> { let workers = Arc::new(Mutex::new(crate::worker::WorkerPool::start())); let w = workers.clone(); let web_thread = std::th...
Rust
0
loaded_by != request.user: messages.error(request, "You cannot delete this book.") else: book.delete() messages.success(request, "Book deleted successfully!") return redirect('book_list') # ------------------------------ # FAVORITE / UNFAVORITE VIEWS # ------------------------------ @...
Python
1
import mne import pandas as pd import numpy as np import os # OBSERVAÇÃO O ARQUIVO AQ GERADO VAI SAIR NA PASTA QUE ESTÁ O SEU ARQUIVO EDF COM O NOME DO ARQUIVO EDF + _csv_openbci def processar_edf_para_openbci(diretorio_edf, filtragem, canais, algarismos_significativos=5): """ A partir dos diretorio, canais de...
Python
1
bucket: s3::Bucket::new( env("S3_BUCKET"), dotenv::var("S3_REGION").ok(), dotenv::var("S3_ACCESS_KEY").unwrap_or_default(), dotenv::var("S3_SECRET_KEY").unwrap_or_default(), ...
Rust
0
assert caplog.messages == ['Did you mean: workflow/run1//cycle/task'] def test_validate_number(): _validate_number(Tokens('a'), max_workflows=1) with pytest.raises(InputError): _validate_number(Tokens('a'), Tokens('b'), max_workflows=1) t1 = Tokens(cycle='1') t2 = Tokens(cycle='2') _va...
Python
1
tFMMContext( context: *mut TEE_BigIntFMMContext, len: u32, modulus: *const TEE_BigInt, ); } extern "C" { pub fn TEE_BigIntInitFMM(bigIntFMM: *mut TEE_BigIntFMM, len: u32); } extern "C" { pub fn TEE_BigIntConvertFromOctetString( dest: *mut TEE_BigInt, buffer: *const u8...
Rust
0
owmow", "ow", &DEFAULT_DELIMITERS), vec!["mm", "m"], ); assert_eq!( split_with_delimiters( r#"Oct 09 20:22:21 web-001 influxd[188053]: 127.0.0.1 "POST /write \"escaped\" HTTP/1.0" 204"#, " ", &DEFAULT_DELIMITERS ), ...
Rust
0
rror. skip') # de only TODO: Not sure if the path is correct info_path = os.path.join(src_tmp_frame_path,'info.txt') if os.path.isfile(info_path): imdata = leginon.leginondata.AcquisitionImageData().direct_query(m[0]) # image id leginon.ddinfo.saveImageDDinfoToDatabase(imdata,info_path) # falcon3 o...
Python
1
""" Contains info on For loops """ #/ For loops can be used to iterate myList = [1,2,3,4] for item in myList: print(item) print('-----------------------') """Pass""" #/ Pass is very good for a placeholder that doesn't break # your code when run (for funcs and loops) animalLookup = { 'a': ['aardvark', 'ante...
Python
1
)))); let packet = 9u8.to_le_bytes(); let result = TyreCompound::parse(&packet[..]); assert_eq!( result, Ok((&[][..], TyreCompound::F1Classic(F1Classic::Dry))) ); let packet = 10u8.to_le_bytes(); let result = TyreCompound::parse(&packet[..]); ...
Rust
0
import reflex as rx from Web_Analand.styles.styles import Size, MAX_WIDTH from Web_Analand.styles.fonts import Font from Web_Analand.styles.colors import Color, TextColor from Web_Analand.components.title_subtitle import title, subtitle # Motion from Web_Analand.components.motion.motion import motion def focus_info...
Python
1
); }; } match native_os { Os::Linux => match signal { #[cfg(unix)] Signal::Abort => { verify!(CrashReason::LinuxGeneral( errors::ExceptionCodeLinux::SIGABRT, _ )); } #[cfg(uni...
Rust
0
(50) .min_height(20) .padding(10) .on_press(msg) .style(btn_style) .into() } pub fn checkbox<'a>(&self, state: bool, label: &'a str, btn_style: style::ButtonStyle, ...
Rust
0
&elem)?); } else { xml_read_unknown(kdbx, xml, &elem)? } }, KdbContext::EntryCustomData => { if elem.is_name(ELEM_STRING_DICT_EX_ITEM) { return Ok(KdbContext::EntryCustomDataItem); } else { xml_read_unknown(k...
Rust
0
_handle(&mut self) { if let Some(handle) = &self.signal_handle { handle.close(); } self.signal_handle = None; } } #[derive(Debug)] enum InternalEvent<'list> { Test(InternalTestEvent<'list>), Signal(InternalSignalEvent), } #[derive(Debug)] enum InternalTestEvent<'list> {...
Rust
0
p.add_axes() p.set_background('white') p.add_title(title) # Add ground truth surfaces add_class_surfaces(grid_gt, subplot_index=0, title='Ground Truth' if not args.crf else 'Normal Prediction') # Add prediction surfaces add_class_surfaces(grid_pred, subplot_index=1, title='Predict...
Python
1
} .into() } } _ => unreachable!(), }; let data_pattern = match &variant.fields { Fields::Unnamed(unnamed) => { if unnamed.unnamed.len() == 0 { unreachable!() ...
Rust
0
if found: print_result_ok(f"{path} ditemukan pada {target} (kode: {info})", warna=COLOR_DANGER) else: print_result_warn(f"{path} tidak ditemukan pada {target} (info: {info})", warna=COLOR_INFO) print("\n" + COLOR_INFO + "Scan selesai. Lanjut ke mode pemantauan WiFi."...
Python
1
et mut count = 0; if self.values[0] { count += BLACK_COLOR_PRESENCE[0] } if self.values[1] { count += BLACK_COLOR_PRESENCE[1] } if self.values[2] { count += BLACK_COLOR_PRESENCE[2] } if self.values[3] { count += BLACK_COLOR_PRESENCE[3] } if self.values[4] { count += BLACK_COLOR_PRESENCE[4] } if self.values...
Rust
0
print(R+" [-] DMARC policy set to : " + dmrecord.policy) else: print(G+" [+] DMARC policy set to : " + dmrecord.policy) else: print(G+" [+] DMARC record has no Policy...") return polstr def dmPolicy0x00(record): policystr = False try: orgRec = record.ge...
Python
1
#!/usr/bin/env python3 import rclpy from rclpy.node import Node from geometry_msgs.msg import Twist import sys import select import tty import termios from pynput import keyboard # Define key codes LIN_VEL_STEP_SIZE = 0.1 ANG_VEL_STEP_SIZE = 0.1 class KeyboardControlNode(Node): def __init__(self): super...
Python
1
= computed_spu_ingress; self.spus.create_spec(spu_id.to_owned(), update_spu).await?; } else { debug!( "detected no spu: {} ingress changes with svc: {}", spu_id, svc_id ); }; Ok(()) } async fn sync_with_spg( &...
Rust
0
import sys import os sys.path.append('/home/pi/sphero-sdk-raspberrypi-python/') from pylsl import StreamInfo, StreamOutlet, StreamInlet, resolve_stream import asyncio from sphero_sdk import SpheroRvrAsync from sphero_sdk import SerialAsyncDal from sphero_sdk import DriveFlagsBitmask loop = asyncio.get_event_loop()...
Python
1
n = 0 p = 0 c = 0 senha = '1234' while c <= 2: n = input('Tente a senha: ') c += 1 if n == senha: print('Senha correta.') br else: print('Sem tentativas!.')
Python
1
eight, in design units, of the straight bar /// connector material at the start of the glyph in the direction /// of the extension (the left end for horizontal extension, the /// bottom end for vertical extension). start_connector_length: UFWord, /// Advance width/ height, in design units, of the st...
Rust
0
source_room_id(source.id()); if let Some(tags) = source.tags() { query = query.tags(tags.to_owned()); } metrics .measure_query(QueryKey::RoomInsertQuery, query.execute(conn)) .await .context("Failed to insert room") } async fn clone_events( conn: &mut PgConnection, ...
Rust
0
import os import pandas as pd from pydub import AudioSegment import sys audio_path_root = sys.argv[1] audio_path = os.path.join(audio_path_root, "Full/WAV_16000") label_path = "./utility/CMU_MOSEI_Labels.csv" out_path = os.path.join(audio_path_root, "Segmented_Audio") if not os.path.exists(out_path): os.makedirs...
Python
1
ould take appropriate action PRINT, /// As Jump instructions will only support labeled jumps, /// This will return the respective value in label/function map JMP(usize), /// To indicate next instruction should be given to interpreter NEXT, /// For interrupts INT(u8), /// For string r...
Rust
0
bug { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Upgrade") .field("upgrades", &self.upgrades) .finish() } } impl<K, H> UpgradeInfoSend for Upgrade<K, H> where H: UpgradeInfoSend, K: Send + 'static { type Info = IndexedProtoName<H::Info...
Rust
0
""" Copyright (c) 2022, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause Based on https://github.com/mlfoundations/open_clip """ """ OpenAI pretrained model functions Adapte...
Python
1
class Node: def __init__(self, name): self.name = name self.edges = {} def get_weight(self, n): return self.edges.get(n, -1) def add_edge(self, n, w): self.edges[n] = w def num_neighbors(self): return len(self.edges) def get_neighbors(self): return ...
Python
1
XIT_UNKNOWN => Ok(VcpuExit::Unknown), KVM_EXIT_EXCEPTION => Ok(VcpuExit::Exception), KVM_EXIT_HYPERCALL => Ok(VcpuExit::Hypercall), KVM_EXIT_DEBUG => Ok(VcpuExit::Debug), KVM_EXIT_HLT => Ok(VcpuExit::Hlt), KVM_EXIT_IRQ_WINDOW_OPEN => Ok(Vcp...
Rust
0
, project_urls={ 'Documentation': 'https://github.com/yourusername/dark-scanner/wiki', 'Source': 'https://github.com/yourusername/dark-scanner', 'Tracker': 'https://github.com/yourusername/dark-scanner/issues', } ) # Post-installation actions if 'install' in sys.argv: print("\n🎉 In...
Python
1
from pwn import * import subprocess import argparse import os def decompress_with_upx(flag, unpacked_flag): if os.path.exists(unpacked_flag): os.remove(unpacked_flag) try: with open(os.devnull, "w") as devnull: subprocess.run(["upx", "-d", flag, "-o", unpacked_flag], check=True, stdout...
Python
1
1") # Record as Dictionary dictionary = { "measurement": "h2o_feet", "tags": {"location": "us-west"}, "fields": {"level": 125}, "time": 1 } await write_api.write("my-bucket", ...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised)) # Copyright (c) 2016-2021, Cabral, Juan; Luczywo, Nadia # Copyright (c) 2022-2025 QuatroPe # All rights reserved. # =============================================================================...
Python
1
summary: item.summary, details: item.details, created_at: None, priority: item.priority, images, links, custom_details } } pub fn from_db(item: EventQueueItem) -> EventQueueItemJson { let images : Option<Vec<Event...
Rust
0
"""This module represents the behavior of a syntactic analyzer. Author: Carlos Andres Sierra <casierrav@udistrital.edu.co> """ # GRAMMAR DEFINITION: # <S> -> "START" <NOTE_SEQUENCE> "END" # <NOTE_SEQUENCE> -> <NOTE> <NOTE_DURATION> <NOTE_SEQUENCE> | <NOTE> <NOTE_DURATION> # <NOTE> -> ("A" | "B" | "C" | "D" | "E" | "F...
Python
1
aConstrainedSetting_PrintTicket: PrintSchemaConstrainedSetting = 1i32; #[doc = "*Required features: `\"Win32_Graphics_Printing\"`*"] pub const PrintSchemaConstrainedSetting_Admin: PrintSchemaConstrainedSetting = 2i32; #[doc = "*Required features: `\"Win32_Graphics_Printing\"`*"] pub const PrintSchemaConstrainedSetting_...
Rust
0
from datetime import datetime import random class cartao_embarque_voo: def __init__(self,nome,num_voo,cod_reserva,data_embarque,hora_embarque,check=False,assento=['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4']): #Atributos imutáveis self.nome = nome self.num_voo = num_voo self.cod_reserva = self.validar_rese...
Python
1
as stopped increasing. Defaults to 'less'. The ``rule`` is the renaming of ``mode`` in pytorch. factor (float): Factor by which the momentum will be reduced. new_param = param * factor. Defaults to 0.1. patience (int): Number of epochs with no improvement after which ...
Python
1
} else { graphic_2d_service.draw_dotted_line( Vector2d::new(x as f32 / square_unit, screen_bottom_left.y / square_unit), Vector2d::new(x as f32 / square_unit, screen_top_right.y / square_unit), 1, Color::white(),...
Rust
0
from ssi_fc_data import fc_md_client , model import config.config as config import pandas as pd from datetime import datetime def get_vn30_data(start_date, end_date): """ Fetch VN30 intraday OHLC data for the period between start_date and end_date. The start_date and end_date should be strings in "dd/mm/yy...
Python
1
TypedArray::<f32>::from(vertices.as_slice()).buffer(); let webColors = TypedArray::<u8>::from(colors.as_slice()).buffer(); let webNormals = TypedArray::<f32>::from(normals.as_slice()).buffer(); //js_log(format!("Generated {} triangles", tri_count)); let positionVbo = webgl.create_buff...
Rust
0