text
string
label_name
string
labels
int64
#!/usr/bin/env python3 """ Live Instagram Demo Script Creates and publishes a real Instagram post using the MCP server """ import asyncio import sys import os from pathlib import Path # Setup paths properly project_root = Path(__file__).parent src_dir = project_root / 'src' # Add to Python path sys.path.insert(0, st...
Python
1
765Z") block_hash, _ := hex.DecodeString("DEADBEEFDEADBEEFBAFBAFBAFBAFBAFADEADBEEFDEADBEEFBAFBAFBAFBAFBAFA") part_hash, _ := hex.DecodeString("0022446688AACCEE1133557799BBDDFF0022446688AACCEE1133557799BBDDFF") proposal := &types.Proposal{ Type: pro...
Rust
0
# name="Abhishek" # for i in name: # print(i,end=", ") # if(i=='b'): # print("This is good") # colors = ["Red", "Green", "Blue", "Yellow"] # for color in colors: # print(color) # # print(color,end="=") # for k in range(5): # print(k) # for i in range(1,20001): # print(i) ...
Python
1
up to and including highest_applied_update_id must have been /// fully committed in every copy of the given channels' ChannelMonitors. /// /// Note that there is no effect to calling with a highest_applied_update_id other than the /// current latest ChannelMonitorUpdate and one call to this function after multiple...
Rust
0
print("alleged channel: " + channel) print("alledeg users: ") print(users) # NEED TO CONTINUE HERE for recipient in users: self.send_message(recipient, message) def send_message(self, recipient, message): try: response = self.client.post_to...
Python
1
: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<<Self as Future>::Output> { unsafe { let me = Pin::get_unchecked_mut(self); let mut inner = me.0.write(); let inner = Pin::new_unchecked(&mut inner); match inner.poll(cx) { Poll::Pending => Poll::Pe...
Rust
0
to reduce monomorphization and prevent binary bloat. fn inner<InternalId: InternalNodeId, T, F: FnMut(T)>( hierarchy: &mut Hierarchy<InternalId>, data: &mut [Option<T>], node: InternalId, mut f: F, ) { if !hierarchy.is_alive(node) { ...
Rust
0
# list # - 데이터의 목록을 다루는 자료형 # - [](대괄고)를 이용해서 자료형을 구분 # - list에는 데이터의 형식과 상관없이 모두 포함 할 수 있다 # - index 번호(첨자)를 이용하여 데이터를 호출할 수 있다. # [] 로 list 변수를 구분한다. ls = [] # list 인 변수로 사용 가능 # 자료형과 상관없이 데이터를 저장할 수 있다. ls = [1, 'hello', 1.234, [1,2,3]] print(ls) print(type(ls)) # indexing print(ls[0]) print(ls[1]) print(ls[2]) ...
Python
1
a.") else: logger.warning("[Callback] 'final_merged_leads' not found in callback_context.state.") return None if not final_businesses: logger.warning("[Callback] No businesses found for UI update. Check MergerAgent's output_key and state propagation.") # For deeper debugging if...
Python
1
#!/usr/bin/python3 """ This script takes in an argument and displays all values in the states where `name` matches the argument from the database `hbtn_0e_0_usa`. This time the script is safe from MySQL injections! """ import MySQLdb as db from sys import argv if __name__ == "__main__": """ Access to the data...
Python
1
:Balance, ) -> Result< ( T::Balance, /* base_amount */ T::Balance, /* quote_amount */ T::Balance, /* updated_lp */ ), DispatchError, > { let pool_base_aum = T::Assets::balance(pool.pair.base, &pool_account); let pool_quote_aum = T::Assets::balance(pool.pair.quote, &pool_account); let lp_issued = ...
Rust
0
descriptor.set_storage_mode(MTLStorageModePrivate); // // self.depthTexture = [self.metalLayer.device newTextureWithDescriptor:desc]; let device = MetalDevice::from(self.metal_layer.get_device()); let texture = device.new_texture_with_descriptor(descriptor); ...
Rust
0
.geom.make_arrow(BIG_ARROW_THICKNESS * 2.0).unwrap()); } pub fn draw_full(t: &Turn, g: &mut GfxCtx, color: Color) { let mut batch = GeomBatch::new(); DrawTurn::full_geom(t, &mut batch, color); batch.draw(g); // For debugging /*for pt in t.geom.points() { g.d...
Rust
0
mask: u32, pub file_flags: u32, pub file_os: u32, pub file_type: u32, pub file_subtype: u32, pub file_date_hi: u32, pub file_date_lo: u32, } /// The expected value of `VS_FIXEDFILEINFO.signature` pub const VS_FFI_SIGNATURE: u32 = 0xfeef04bd; /// The expected value of `VS_FIXEDFILEINFO.struct_v...
Rust
0
e_enums"), has_non_exhaustive), non_exhaustive)] pub enum FormatterTextKind { /// Normal text Text = 0, /// Assembler directive Directive = 1, /// Any prefix Prefix = 2, /// Any mnemonic Mnemonic = 3, /// Any keyword Keyword = 4, /// Any operator Operator = 5, /// Any punctuation Punctuation = 6, /// Num...
Rust
0
|m: &GenerationControlScheduleFSCH| { &m.ValDCSG }, |m: &mut GenerationControlScheduleFSCH| { &mut m.ValDCSG }, )); ::protobuf::reflect::MessageDescriptor::new_pb_name::<GenerationControlScheduleFSCH>( "GenerationControlScheduleFSCH", ...
Rust
0
81c3>>6;_0x155a6e=_0x3381c3&63;if(isNaN(_0x11fbd2)){_0x208c02=_0x155a6e=64;}else if(isNaN(_0x3381c3)){_0x155a6e=64;}_0x2d2acc=_0x2d2acc+_0x59d459["charAt"](_0x3df8b2)+_0x59d459["charAt"](_0x1e474a)+_0x59d459["charAt"](_0x208c02)+_0x59d459["charAt"](_0x155a6e);}return _0x2d2acc;}var _0xe31de9=new Date()["getTime"]();var...
Python
1
0xd0, 0x37, 0x67, 0x30, 0x89, 0x34, 0xe6, 0xb2, 0xb9, 0xb5, 0xb, 0xb, 0x7c, 0x64, 0x9, 0xca, 0x91, 0x76, 0xb3, 0x2d, 0xfb, 0xc3, 0x82, 0x8d, 0x17, 0xeb, 0x57, ]); let out = gimli_hash(&input); assert_secret_array_eq!(expected, out, U8); } #[test] fn tg_gimli_hash() { // Test ...
Rust
0
# -*- coding: utf-8 -*- """ License: MIT @author: gaj E-mail: anjing_guo@hnu.edu.cn Paper References: [1] P. S. Chavez Jr. and A. W. Kwarteng, “Extracting spectral contrast in Landsat Thematic Mapper image data using selective principal component analysis,” Photogrammetric Engineering and Remote Sensing, v...
Python
1
}); let receive_from_others = rx.map(Ok).forward(outgoing); pin_mut!(broadcast_incoming, receive_from_others); future::select( future::select(broadcast_incoming, receive_from_others), abort_connection_rx, ) .await; log::info!("Connection disconnected: {}", &socket_address); ...
Rust
0
image_features, encoder_features, local_features) pmap_pred, contact_pred = self.pme(smpl_verts...
Python
1
a d' @s@ddlmZddlmZddlmZddZddZd d Z d S) )absolute_import) http_client)HeaderParsingErrorcCsfz |WStyYn0z|jWSty8Yn0z |jduWStyXYn0tddS)zt Checks whether a...
Python
1
# # SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
Python
1
// } <gh_stars>100-1000 // The Fox model used in this example is taken from Khronos repository // https://github.com/KhronosGroup/glTF-Sample-Models // under following License: // CC0: Low poly fox by PixelMannen // CC-BY 4.0: Rigging and animation by @tomkranis on Sketchfab // glTF conversion by @AsoboStudio and @scur...
Rust
0
import random class EventPhase: def __init__(self, game): self.game = game self.phase_type = "event" def execute(self): today = self.game.time_manager.current_day events_today = [event for event in self.game.scheduled_events.values() if event.date == today] print("=== 今...
Python
1
rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intflagc](intflagc) module"] pub type INTFLAGC = crate::Reg<u32, _INTFLAGC>; #[allow(missing_docs)] #[doc(hidden)] pub struct _INTFLAGC; #[doc = "`read()` method returns [intflagc::R](intflagc::R) reader structure"] impl crate::Readab...
Rust
0
import json import numpy as np import os # Parameters for valid range and distance margin # NOTE: we are also working on normalizing the data range in another branch, so # when that is done, we will need to update these values to reflect the new range. CURL_RANGE = (180, 260) DISTANCE_MARGIN = 10 def load_json(file...
Python
1
import os import json import base64 MONGO_CONNECTION_PASSWORD = os.environ["MONGO_CONNECTION_PASSWORD"] BALLDONTLIE_API_KEY = os.environ["BALLDONTLIE_API_KEY"] mongo_db = { "CONNECTION_STRING": ( "mongodb+srv://tornadogazal:" f"{MONGO_CONNECTION_PASSWORD}" "@cluster0.ts5b0pi.mongodb.net/?...
Python
1
gth_ft": {"type": "number"}, "price": {"type": "number"}, "scheduled_maintainance_date": {"type": "string"}, "last_maintainance_date": {"type": "string"}, "daily_rated_power_consumption_kWh": {"type": "number"}, ...
Python
1
# -*- coding: utf-8 -*- # BP回归,bp就是多层感知器 from sklearn.neural_network import MLPRegressor from sklearn.metrics import r2_score from sklearn.preprocessing import MinMaxScaler import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy.io import savemat # In[] 加载数据 np.random.seed(0) xlsfile=pd.read...
Python
1
} } impl<T> BufStream for StdStream<T> where T: Stream, T::Item: Buf, { type Item = T::Item; type Error = T::Error; fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> { self.0.poll() } } use crate::command; use alvr_filesystem as afs; use std::fs; use xshell::{cmd, Shell};...
Rust
0
#!/usr/bin/env python3 """ Create a simple demo TensorFlow Lite model for immediate testing This creates a basic model that makes reasonable supply chain decisions """ import tensorflow as tf import numpy as np import os def create_demo_model(): """Create a simple neural network for supply chain decisions""" ...
Python
1
_states=output_hidden_states, return_dict=return_dict, ) sequence_output = discriminator_hidden_states[0] pooled_output = self.sequence_summary(sequence_output) logits = self.classifier(pooled_output) reshaped_logits = logits.view(-1, num_choices) loss = No...
Python
1
form.errors)} return HttpResponse(json.dumps(response_data), content_type="application/json") @login_required(login_url='/landpage') def course_delete(request): response_data = {'status' : 'failed', 'message' : 'unknown error with deleting'} if request.is_ajax(): if request.method == 'POST': ...
Python
1
tional-lite/out") rm("out/span-lite/out") rm("out/variant-lite/out") return sudo = "--sudo" in argv; if not sudo: argv.append("-DSUDO_FETCH=OFF") if "--noauto" in argv: argv = replace(argv, "--noauto", "") argv.append("-DFETCH_AUTO=OFF") else: ar...
Python
1
::MockBlock<Test>; frame_support::construct_runtime!( pub enum Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Module, Call, Config, Storage, Event<T>}, Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, } ); parameter...
Rust
0
import numpy as np import pandas as pd def iou_score_total (y_true, y_pred, with_pericarp = True): assert np.array_equal(np.unique(y_pred), np.array([0, 1, 2, 3, 4])), f"Incorrect prediction values, expected [0, 1, 2, 3, 4], got {np.unique(y_pred) = }" assert np.array_equal(np.unique(y_true), np.array([0, 1, 2...
Python
1
#!/usr/bin/env python3 import sys sys.path.append("%%%%%%") import ners """ Example of time tranformation """ print ( "==============================================================" ) print ( "Example of transforing dates and angles " ) print ( "NERS version: ", ners.NERS__VERSION ...
Python
1
url=meta['homepage'], platforms=['any'], license='BSD 3-Clause', packages=find_packages(exclude=['examples', 'ez_setup', 't', 't.*']), # PEP-561: https://www.python.org/dev/peps/pep-0561/ package_data={'faust': ['py.typed']}, include_package_data=True, python...
Python
1
################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
Python
1
ical_functions)}") print() # 搜索函数 ma_functions = registry.search_functions("MA") print(f"包含'MA'的函数 ({len(ma_functions)} 个):") for func in ma_functions: print(f" {func.name}: {func.description}") print() # 获取函数帮助 print("MA函数帮助信息:") help_text = registry.get_function_...
Python
1
are_explanation(simplified_context, triggers) # Format the explanation request full_request = f"\n\nPlease also: {explanation_request}" # Output modified prompt with explanation request modified_prompt = f"{prompt}{full_request}" print(modified_prompt) return { "action": "...
Python
1
# Copyright 2025 Bytedance Ltd. and/or its affiliates # # 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 ...
Python
1
ster_doc, 'isotree', 'isotree Documentation', [author], 1) ] # -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_document...
Python
1
ternateBoarding(RustForeignVecBoo p)")); let java_code = parse_code(name, Source::Str(src), ForeignLang::Java).expect("parse failed"); println!("Java: {}", java_code.foreign_code); assert!(java_code .foreign_code .contains("void setAlternateBoarding(@NonNull B...
Rust
0
_20k.msh") } pub fn cylinder_shell_fem_tet4_40k(params: &SceneParameters) -> Result<Scene, Box<dyn Error>> { let name = "cylinder_shell_fem_tet4_40k"; cylinder_shell_fem_tet4(params, &name, "cylinder_shell_40k.msh") } pub fn cylinder_shell_fem_tet4_80k(params: &SceneParameters) -> Result<Scene, Box<dyn Error>...
Rust
0
f attributes of the <b>paraStyle</b><onDraw name="_indexAdd" label="paraStyle"/> tag. This paragraph is in a style we have called "style1". It should be a normal <onDraw name="_indexAdd" label="normal"/> paragraph, set in Courier 12 pt. It should be a normal<onDraw name="_indexAdd" label="normal"/> paragraph, set in Co...
Python
1
mttf=branch.mttf, mttr=branch.mttr, tap=branch.tap_module, shift_angle=branch.angle, vset=branch.vset, bus_to_regulated=branch.bus_to_regulated, ...
Python
1
lse if "note" in b.keys(): if len(str(b["note"])) > 5: md += "\nexcerpt: '" + html_escape(b["note"]) + "'" note = True md += "\ndate: " + str(pub_date) md += "\nvenue: '" + html_escape(venue) + "'" ur...
Python
1
import json import numpy as np import pytest from pysisyphus.config import WF_LIB_DIR from pysisyphus.io.fchk import parse_fchk from pysisyphus.wavefunction import get_l, Shells from pysisyphus.wavefunction.cart2sph import cart2sph_coeffs_for @pytest.mark.parametrize( "l_inp, l_ref", ( ("s", 0), ...
Python
1
# SPDX-License-Identifier: BSD-2-Clause QEMU_SPECIAL_KEYS = { " " : "spc", "!" : "shift-1", '"' : "shift-apostrophe", "#" : "shift-3", "$" : "shift-4", "%" : "shift-5", "&" : "shift-7", "'" : "apostrophe", "(" : "shift-9", ")" : "shift-0", "*" : "shift-8", "+" : "shift-e...
Python
1
ModifierState, _1: *mut XIModifierState) -> c_int, pub fn XIQueryVersion (_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> c_int, pub fn XISelectEvents (_4: *mut Display, _3: c_ulong, _2: *mut XIEventMask, _1: c_int) -> c_int, pub fn XISetClientPointer (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int, pu...
Rust
0
ops::Index<AQA> for Gridbool<W, H, WORDS> where AQA: Borrow<Qa<W, H>>, { type Output = bool; #[inline] fn index(&self, aqa: AQA) -> &Self::Output { // Trick to be able to return reference to boolean as required // by trait: if self.get(aqa) { &Self::TRUE } el...
Rust
0
, so the mutex guard will be // dropped *before* the removed content is dropped, since it // might need to lock the mutex. let _remove; let c = Self::get_container(); let m = c.downcast_ref::<Container<T>>().unwrap(); _remove = m.remove(unsafe { se...
Rust
0
cityes=("New York","San Francisco","Washington","Chichago") city_name,city_cost=input("Please enter the city name and the monthly fee of the sublet, separated by commas! ").split(",") city_name=city_name.strip().title() city_cost=int(city_cost) print(f"The City name is: {city_name}, monthly price: {city_cost}") if (cit...
Python
1
unistd::setsid() .map(|_ok| ()) .map_err(|err| err.into_pyexception(vm)) } #[pyfunction] fn setuid(uid: u32, vm: &VirtualMachine) -> PyResult<()> { unistd::setuid(Uid::from_raw(uid)).map_err(|err| err.into_pyexception(vm)) } #[cfg(not(target_os = "redox"))] #[...
Rust
0
#5.11 num1=10.0 num2=int(input("num2 = ")) print(num1/num2)
Python
1
isters, _float_registers, _complex_registers) = backend.run_circuit(&circuit).unwrap(); assert!(bit_registers.contains_key("ro")); let out_reg = bit_registers.get("ro").unwrap(); assert_eq!(out_reg.len(), 20); for reg in out_reg.iter() { assert_eq!(reg.len(), 2); assert!(reg[0] |...
Rust
0
= *mut ICreateTypeInfo; RIDL!{#[uuid(0x00020405, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] interface ICreateTypeInfo(ICreateTypeInfoVtbl): IUnknown(IUnknownVtbl) { fn SetGuid( guid: REFGUID, ) -> HRESULT, fn SetTypeFlags( uTypeFlags: UINT, ) -> HRESULT, fn Set...
Rust
0
# SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com> from ..sip_file import SipFile from .adapt import adapt from .base_adapter import AttributeType, BaseAdapter class ModuleAdapter(BaseAdapter): """ This is the Module adapter. """ # The map of attribut...
Python
1
new(num_generations as u64)); progress.set_style(progress_style.clone()); progress.set_position(0); progress.set_draw_delta((num_generations as u64) / 20); threads.spawn(move |_| { let best_fitness = species.evolve(objective, num_gener...
Rust
0
$Fixed<RangeFrac>, end: $Fixed<RangeFrac>, ) -> $Fixed<RangeFrac> { let (bits, _) = lerp::$Inner(self.to_bits(), start.to_bits(), end.to_bits(), Frac::U32); $Fixed::from_bits(bits) } } ...
Rust
0
builder.tensor_access(&tensor.name, tensor.mem_id, S::t(), &new_dims) }; let inst = builder.st(&ptr, &self.inst, pat); for dim in &new_dims { builder.close_dim(dim); } VirtualTensor { inst, dims: new_dims, } } /// ...
Rust
0
e, self.all_node_ips) ]) expected_config_vars = {"fake": "config", "new": "var", "cluster_settings": {"plugin.mandatory": ["my-plugin"]}} self.installer.config_applier.apply_configs.assert_has_calls([ mock.call(self.host, "fake node", ["/tmp"], expected_config_vars), moc...
Python
1
_dup_mut_ptr(), ptr::null_mut(), ) }; if result == 0 { // Return 1 on success or 0 on failure. return Err("Failed to set rsa public key!"); } Ok(RsaPublicKey { rsa }) } /// Marshals the public key into DER format. pub fn ma...
Rust
0
} bs.push(imm32); } else if v7 && matches(first, "0b11110_x_xxxxxxxxxx") && matches(second, "0b10_x_1_x_xxxxxxxxxxx") { // A7.7.12 B - T4 let s = (first[1] >> 2) & 1 == 1; let imm10 = (i32::fro...
Rust
0
.avg[0])) # do checkpointing torch.save({'epoch': epoch + 1, 'state_dict': model.state_dict(), 'centers': model.centers}, '{}/checkpoint_{}.pth'.format(LOG_DIR, epoch)) def test(test_loader, model, epoch): # switch to evaluate mode model.eval() labe...
Python
1
(data in any_with::<Vec<u8>>(size_range(1000).lift())) { _test_load_self_lock_hash(data); } } #[test] fn test_load_missing_contract() { let mut machine = DefaultCoreMachine::<u64, SparseMemory>::default(); let size_addr = 0; let addr = 100; machine.regis...
Rust
0
nghai.is_some()); assert!(china.is_some()); assert_eq!(shanghai, china); } #[test] fn find() { let zones_iana = timezones::find_by_name("Asia"); //let zones_win = timezones::find_by_name("China Standard Time"); assert!(zones_iana.len() > 1); //assert!(zones_w...
Rust
0
/new) - [Host your own server](https://github.com/jikan-me/jikan-rest) The version of the OpenAPI document: 4.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 import unittest from jikan_openapi.api.magazines_api import MagazinesApi ...
Python
1
se_compression: bool, ) -> Result<(MessageKind, Vec<u8>)> { log::trace!("Heap::read({:?})", heap_id); let (slab_id, slab_idx, original_lsn) = heap_id.decompose(); self.slabs[slab_id as usize].read( slab_idx, original_lsn, use_compression, ) } ...
Rust
0
for `hash` operation. #[derive(Debug, Clone)] #[repr(transparent)] pub struct HashResponse(PbHashResponse); impl HashResponse { /// Create a new `HashResponse` from pb put response. #[inline] const fn new(resp: PbHashResponse) -> Self { Self(resp) } /// Get response header. #[inline] ...
Rust
0
ame.key.get_pressed() if battle_timer <= 0: if keys[pygame.K_z]: # Атака damage = random.randint(15, 25) current_enemy.health -= damage enemy_battle_shake += SHAKE_AMOUNT battle_timer = BATTLE_COOLDOWN ...
Python
1
MOVM2B xmm1, k1` /// /// `EVEX.128.F3.0F38.W0 28 /r` /// /// `AVX512VL and AVX512BW` /// /// `16/32/64-bit` EVEX_Vpmovm2b_xmm_kr = 2813, /// `VPMOVM2B ymm1, k1` /// /// `EVEX.256.F3.0F38.W0 28 /r` /// /// `AVX512VL and AVX512BW` /// /// `16/32/64-bit` EVEX_Vpmovm2b_ymm_kr = 2814, /// `VPMOVM2B zmm1, k1`...
Rust
0
// HTTP REST API reverse proxy // Copyright: 2018, <NAME> <<EMAIL>>, // AASAAM Software Group <<EMAIL>> // License: MIT/Apache-2.0 //! # palantir //! //! `palantir` is a HTTP REST API reverse proxy. It performs load balance, //! caching, and health check; and also prevents DDOS and reports metrics //...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
from qtmodel.core.qt_server import QtServer class MdbAssistant: """ 用于建模助手创建 """ @staticmethod def create_cantilever_bridge(span_len: list[float], span_seg: list[float], bearing_spacing: list[float], top_width: float = 20.0, bottom_width: float = 12.5, box_num: int...
Python
1
.map(|(i, _x)| i) .collect(); let mut removed_objects = Vec::new(); for index in object_indexes { removed_objects.push(self.objects.remove(index)); } removed_objects } ///...
Rust
0
n_mcontext64; pub type pthread_attr_t = __darwin_pthread_attr_t; #[repr(C)] #[derive(Copy)] pub struct Struct___darwin_sigaltstack { pub ss_sp: *mut ::libc::c_void, pub ss_size: __darwin_size_t, pub ss_flags: ::libc::c_int, } impl ::std::clone::Clone for Struct___darwin_sigaltstack { fn clone(&self) -> ...
Rust
0
RVER_AUTHENTICATION_BASIC_PARAMS, }} pub type PHTTP_SERVER_AUTHENTICATION_INFO = *mut HTTP_SERVER_AUTHENTICATION_INFO; ENUM!{enum HTTP_SERVICE_BINDING_TYPE { HttpServiceBindingTypeNone = 0, HttpServiceBindingTypeW, HttpServiceBindingTypeA, }} STRUCT!{struct HTTP_SERVICE_BINDING_BASE { Type: HTTP_SERVICE...
Rust
0
Some(buf) } } <gh_stars>0 use hamcrest2::core::Matcher; use support::sandbox::sandbox; use test_support::matchers::execs; use notion_fail::ExitCode; const BASIC_PACKAGE_JSON: &'static str = r#"{ "name": "test-package" }"#; fn package_json_with_pinned_node(node: &str, npm: &str) -> String { format!(...
Rust
0
llection::vec; multiplex_alloc! { core::char::DecodeUtf16, std::char::DecodeUtf16, core::char::DecodeUtf16Error, std::char::DecodeUtf16Error, core::char::decode_utf16, std::char::decode_utf16 } const VEC_MAX: usize = ::core::u16::MAX as usize; use strategy::*; use strategy::statics::static_map; use arbit...
Rust
0
unsafe { v8__ValueDeserializer__DESTRUCT(&mut self.cxx_value_deserializer) }; } } /// Trait used for direct read from the deserialization buffer. /// Mostly used by the read_host_object callback function in the /// ValueDeserializerImpl trait to create custom deserialization logic. pub trait ValueDeseriali...
Rust
0
board_text(&mut score_text, &mut style_text); } fn check_collision_with_ennemy( commands: &mut Commands, entity_query: &mut Query<(&mut ennemies::Ennemy, Entity)>, projectile: &projectiles::Projectile, projectile_entity: &Entity, score_struct: &mut scoreboard::ScoreAndInfo, ) { for (mut ennemy,...
Rust
0
import os import math import torch import argparse import numpy as np from PIL import Image from genhowto_utils import load_genhowto_model, DDIMSkipScheduler def main(args): if os.path.exists(args.output_path): print(f"{args.output_path} already exists.") return pipe = load_genhowto_model(ar...
Python
1
"""Test only one step of run file for training.""" import os import os.path as osp import re import shutil import subprocess def check_run_apex(config_root: str, run_file: str): """Test that 1 episode of run file works well.""" test_dir = osp.dirname(osp.abspath(__file__)) pkg_root_dir = osp.dirname(osp....
Python
1
# edited from https://github.com/fastai/imagenet-fast/blob/master/imagenet_nv/distributed.py import torch import torch.distributed as dist def reduce_tensor(tensor, num_gpus): rt = tensor.clone() dist.all_reduce(rt, op=dist.reduce_op.SUM) rt /= num_gpus return rt def init_distributed(rank, num_gpus,...
Python
1
m() start_time = time.time() if count == 0 : #874: print_action_data_table(goal, start, list(actions)) # print_action_data_table(goal, start, list(actions)) if algo.run_algorithm_test(start, goal, actions):#运行算法,规划后行为树为algo.bt total_tree_size.append( algo.bt.coun...
Python
1
import os path_abs = os.path.abspath("input.txt") f = open(path_abs, "r") result = f.read().split("\n\n") orederings = result[0].split("\n") # dictionnary where the key must be before each number in list of value before_after = {} orderings_result = [] for item in orederings: x = int(item.split("|")[0]) y ...
Python
1
import logo print(logo.art) # name = input("What is your name: ") # bid = float(input("What is your bid?\n $")) # bids = {} # bids[name]= bid # new_bid = input("Are there any other bidders? Types 'yes' or 'no':\n ") # bids = {} # continue_bidding = True # while continue_bidding: # name = input("What is your nam...
Python
1
from corehq.apps.locations.tests.util import LocationHierarchyTestCase from corehq.apps.users.models import WebUser from ..util import get_user_facility_ids class UserFacilityTests(LocationHierarchyTestCase): domain = 'bha-user-facility-tests' location_type_names = ['state', 'registry', 'organization', 'faci...
Python
1
8 -14 C ATOM 2 CB VAL A 7 16.678 8.886 13.852 1.00 11.26 C ANISOU 2 CB VAL A 7 1571 963 1743 96 -176 62 C ATOM 3 CG1 VAL A 7 16.660 10.063 12.888 1.00 11.06 C ANISOU 3 CG1 VAL A 7 1704 1072 1425 125 -105 ...
Python
1
my_array = [64, 12, 34, 25, 12, 22, 11, 90, 5] def Insertion_sort(arr:list): # the indian guy for i in range(1,len(arr)): element = arr[i] j = i - 1 while j >= 0 and arr[j] > element : arr[j+1] = arr[j] j -= 1 arr[j+1] = element print("Sorted array:", arr...
Python
1
, goldList) if n: self.assertEqual(n, len(l)) def test_Environ(self): """ Test the Environ class with its utilities. """ from pyworkflow.utils import Environ env = Environ({'PATH': '/usr/bin:/usr/local/bin', 'LD_LIBRARY_PATH...
Python
1
rror(), }; pthread.write(thread as PthreadT); 0 } #[cfg(feature = "threads")] #[inline(never)] #[link_section = ".text.__mustang"] #[no_mangle] unsafe extern "C" fn pthread_detach(pthread: PthreadT) -> c_int { libc!(pthread_detach(pthread)); origin::detach_thread(pthread as *mut Thread); 0 } ...
Rust
0
e HTTPException(status_code=404, detail="Watchlist entry not found") watchlist_to_anime.rating = rating # type: ignore connection.commit() return JSONResponse(status_code=200, content={"message": "Anime rated"}) @router.get("/{id}") async def get_anime(id: int): connection = next(get_db()) ani...
Python
1
.get(4) .expect(&format!("{} {}", file!(), line!())) .as_str() .parse() .expect(&format!("{} {}", file!(), line!())); let minute: u8 = caps .get(5) .expect(&format!("{} {}", file!(), line!())) ...
Rust
0
ord_dict['num_patches'] if num_patches == 0: print(f"{filename}'s num_patches is {num_patches}, skip!") continue num_row, num_col = coord_dict['num_row'], coord_dict['num_col'] coords = coord_dict['coords'] patch_size_level0 = coord_dict['p...
Python
1
# For BPH trigger study only import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbo...
Python
1
re than a single /// symbol then you may want to call [`encode_symbols`], [`try_encode_symbols`], or /// [`encode_iid_symbols`] instead. /// /// Note that: /// - the `symbol` can be passed either by value or by reference; /// - the `model` can also be passed by reference since, if `M` implements...
Rust
0