text
string
label_name
string
labels
int64
er does not have permissions we need to determine if # they have read permissions to see 403, or not, and simply see # a 404 response. if request.method in SAFE_METHODS: # Read permissions already checked and failed, no need # to make another lookup. ...
Python
1
ared::ForeignType::as_ptr(&e), engine)?; Ok(e) } } impl crate::ex_data::HasExData<crate::engine::Engine> for openssl_sys::ENGINE { unsafe fn index() -> openssl::ex_data::Index<Self, crate::engine::Engine> { crate::ex_data::ex_indices().engine } } #[no_mangle] #[allow(clippy::similar_names)] unsafe extern "C" ...
Rust
0
review of hydrological, geomorphological, and biological applications. *Hydrological /// processes*, 5(1), 3-30. /// /// # See Also /// `StreamPowerIndex`, `DInfFlowAccumulation`, `FD8FlowAccumulation` pub struct SedimentTransportIndex { name: String, description: String, toolbox: String, parameters: V...
Rust
0
fo["version"] = platform.version() system_info["architecture"] = platform.machine() except Exception as e: system_info["os_info"] = f"Error: {e}" try: system_info["cpu"] = { "processor": platform.processor(), "physical_cores": psutil.c...
Python
1
} /// Transforms an expression into a polynomial relative to some term. /// If `relative_to` is not none, the constructed polynomial will be relative to that term. /// Otherwise, the polynomial will be relative to the term in the expression sequence. /// /// If transformation is successful, th...
Rust
0
wrap(); out = d.bin_output(&z).unwrap().unwrap(); } assert_eq!(out, should_be); assert_eq!(overflow > 0, (y != 0 && x >= y), "x={} y={}", x, y); } } #[test] fn binary_lt() { let mut rng = thread_rng(); let nbits = 16; let q...
Rust
0
from nose.tools import eq_, ok_, assert_raises from peasy import initialize, char, memo, addRecursiveCircles, computeLeftRecursives, parse import peasy as p a = char('a'); b = char('b'); x = char('x') memoA = memo('A') #x1 = Var('x1'); m = Var('m') def parse1(text): class Rules: rootSymbol = 'A' parentToC...
Python
1
] for sol_idx in sol_idx_r] param_idx_d = [[ sol_idx_dict_r[var_id_pos] for var_id_pos in sol_idx ] for sol_idx in sol_idx_d] return param_idx_r, param_idx_d def group_objective(self): '''Split objective into corresponding constraint groups''' var_id_pos_to_i...
Python
1
or> { let render_bundle_encoder_resource = state .resource_table .take::<WebGpuRenderBundleEncoder>(args.render_bundle_encoder_rid)?; let render_bundle_encoder = Rc::try_unwrap(render_bundle_encoder_resource) .ok() .expect("unwrapping render_bundle_encoder_resource should succeed...
Rust
0
, recorder_alias=["6"]), K("KC_7", "&\n7", printable="7", recorder_alias=["7"]), K("KC_8", "*\n8", printable="8", recorder_alias=["8"]), K("KC_9", "(\n9", printable="9", recorder_alias=["9"]), K("KC_0", ")\n0", printable="0", recorder_alias=["0"]), K("KC_ENTER", "Enter", recorder_alias=["enter"], al...
Python
1
[Message]: query = select(Message).where(Message.chat_id == chat_id) if up_to_message_id: subquery = select(Message.timestamp).where(and_( Message.chat_id == chat_id, Message.id == up_to_message_id )).scalar_subquery() query = query.where(Message.timestamp <= subq...
Python
1
ction is to initialize `output_list` with detailed paragraphs involved in completing the main task. if task == : // condition output_list.append( ) // Generate 100 words to describe your paragraph 1 output_list.append( ) // Generate 100 words to describe your paragraph 2 output_list.append(...
Python
1
r, end_year]) dataset.n = dataset.graph['num_nodes'] dataset.c = max(dataset.label.max().item() + 1, dataset.label.shape[1]) dataset.d = dataset.graph['node_feat'].shape[1] print(torch.min(dataset.graph['edge_index'])) print(torch.max(dataset.graph['edge_index'])) print(len(torch.unique(datase...
Python
1
) } } #[inline] fn atan(self) -> f64 { unsafe { cmath::atan(self) } } #[inline] fn atan2(self, other: f64) -> f64 { unsafe { cmath::atan2(self, other) } } /// Simultaneously computes the sine and cosine of the number #[inline] fn sin_cos(self) -> (f64, f64) { ...
Rust
0
= ["python", path.join(cuckoo_root(), "cuckoo.py")] cls.cuckoo = subprocess.Popen(cmd, stderr=subprocess.PIPE) # Now see if it launched successfully. # Basically, what we do here is reading Cuckoo's output until we hit the # success message *OR* the whole thing is terminated due to an er...
Python
1
_glib(gdk_sys::gdk_window_window_class_get_type()) } } } impl<'a> FromValueOptional<'a> for WindowWindowClass { unsafe fn from_value_optional(value: &Value) -> Option<Self> { Some(FromValue::from_value(value)) } } impl<'a> FromValue<'a> for WindowWindowClass { unsafe fn from_value(value: &Valu...
Rust
0
from pytest import mark from scanapi.tree import EndpointNode @mark.describe("endpoint node") @mark.describe("delay") class TestDelay: @mark.context("when node spec has no delay defined") @mark.it("should set delay as 0") def test_when_node_has_no_delay(self): node = EndpointNode({"name": "node"}...
Python
1
from .. import IconBase class IconBookCheck(IconBase): class_name = "lucide lucide-book-check" svg_data = { "attrs": { "width": "24", "height": "24", "view_box": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke_width": "2", "stroke_line...
Python
1
); } #[test] fn returns_invalid_argument_count_error_when_incorrect_count_of_arguments_were_passed( ) { let mut interpreter = Interpreter::new(); let code_vector = vec![ "(list:aperture)", "(list:aperture 1)", "(list:aperture 1 2 3)", ]; ...
Rust
0
from typing import Optional import pytest from d3rlpy.algos.qlearning.bc import BCConfig, DiscreteBCConfig from d3rlpy.types import Shape from ...models.torch.model_test import DummyEncoderFactory from ...testing_utils import create_scaler_tuple from .algo_test import algo_tester @pytest.mark.parametrize( "obs...
Python
1
/3 + x1 * x2 - 4 * x2 ** 2 + 4 * x2 ** 4 return result def f23(x): # Eggholder function: # xi ∈ [-512, 512] # min is f(512, 404.2319) =-959.6407 x1 = x[0] x2 = x[1] result = -(x2 + 47) * math.sin(math.sqrt(math.fabs(x1 + x2/2 + 47))) - x1 * math.sin(math.sqrt(math.fabs(x1 - x2 - 47))) r...
Python
1
AsciiString; use once_cell::unsync::OnceCell; use std::fmt; use std::ops::{Bound, RangeBounds}; #[cfg(not(target_arch = "wasm32"))] #[allow(non_camel_case_types)] pub type wchar_t = libc::wchar_t; #[cfg(target_arch = "wasm32")] #[allow(non_camel_case_types)] pub type wchar_t = u32; pub fn try_get_chars(s: &str, range...
Rust
0
import matplotlib.pyplot as plt import networkx as nx from rdflib import Graph, Namespace, URIRef, Literal, RDF, RDFS, OWL ### Using WebVOWL is easier: ### https://service.tib.eu/webvowl/ def visualize_owl(file_name): # Create a new graph and define namespaces g = Graph() try: g.parse(file_name, ...
Python
1
rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'DNS_Cache' rootClass = DNSCacheObjectType rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None # sys.stdout.write('<?xml version="1.0" ?>\n') # ...
Python
1
from django.urls import path from myapp import views app_name = 'myapp' urlpatterns = [ # 前台管理api path('index/classification/list', views.index.classification.list_api), path('index/tag/list', views.index.tag.list_api), path('index/user/login', views.index.user.login), path('index/user/regis...
Python
1
; #[doc = "*Required features: `\"Win32_Media_Speech\"`*"] pub const DISPID_SRGetFormat: DISPID_SpeechRecognizer = 11i32; #[doc = "*Required features: `\"Win32_Media_Speech\"`*"] pub const DISPID_SRSetPropertyNumber: DISPID_SpeechRecognizer = 12i32; #[doc = "*Required features: `\"Win32_Media_Speech\"`*"] pub const DIS...
Rust
0
date_beam_and_bunch(beam, data): bunch = data.models.bunch schema = sirepo.sim_data.get_class("madx").schema() if "particle" in beam: beam.particle = beam.particle.lower() found = False for pt in schema.enum.ParticleType: if pt[0] == beam.particle: found =...
Python
1
16, 0x00, 0x19, 0x5e, 0x23, 0x56, 0xd5, 0xe1, 0xe9, 0xff, 0xff, 0xff, 0xff, //! # 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xfd, 0x01, 0xff, 0xff, 0xff, //! # 0xff, 0xff, 0xc3, 0x12, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x12, 0x27, 0xff, //! # 0xff, 0xff, 0xff, 0xff, 0xc3, 0x7e, 0x01, 0xff...
Rust
0
from django.urls import include, path import promptbook.register_models from . import views from rest_framework import routers urlpatterns = [ path('login/', views.login, name='login'), path('categories/', views.list_categories, name='list_categories'), path('categories/<int:category_id>/prompts/', views....
Python
1
dx in range(len(headers))) body_lines = [ " | ".join(value.ljust(widths[idx]) for idx, value in enumerate(row)) for row in table_rows ] return "\n".join([header_line, divider, *body_lines]) def resolve_targets_cli( raw_targets: Iterable[str] | None, frames: Iterable[str] | None, ) ...
Python
1
from='FlexMaskBase') # FlexMaskDepthChamberRelative tooltips (inherits from: FlexMaskBase) TooltipManager.register_tooltips("FlexMaskDepthChamberRelative", { "depth_map": "Input depth map (IMAGE type)", "z1": "First depth threshold (0.0 to 1.0)", "z2": "Second depth threshold (0.0 to 1....
Python
1
_from_slice(ascii_bytes); // The conversion will never fail Ok(FieldElement::from_bytes_be(&buffer).unwrap()) } #[cfg(test)] mod tests { use super::*; #[test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] fn test_starknet_keccak() { // Generated from `cairo...
Rust
0
def futhark_mad64(a, b, c): return a * b + c def futhark_fma16(a, b, c): return a * b + c def futhark_fma32(a, b, c): return a * b + c def futhark_fma64(a, b, c): return a * b + c futhark_copysign16 = futhark_copysign32 = futhark_copysign64 = np.copysign def futhark_cond(x, y, z): return ...
Python
1
# Measured the performance of pytorch models on a local environment for various batch sizes. # Varied the batch sizes in factors of 2 from 2 to 1024 # for models: "Namibia_North_2020" and "Malawi_2020_September".The execution time # on the average was fund to be ~1s. The peak process memory was negligible and # peak pr...
Python
1
C_LEN], values_contained: 0 } } } impl RLEBlock { /// Returns the total number of symbols encoded by this RLEBlock #[inline] pub fn get_values_contained(&self) -> u64 { self.values_contained } /// Returns the symbol counts encoded by this RLEBlock #[inline] ...
Rust
0
0x5E31_123D, 0x36D3_C431), (r"meshes\i\in_impbig_blend_01.nif", 0x5E31_123D, 0x375F_1CAE), (r"meshes\i\in_c_plain_corner.nif", 0x5E31_2037, 0xA604_CDC3), (r"meshes\i\in_c_pillar_stone.nif", 0x5E31_2037, 0xC2A0_8036), (r"meshes\i\in_c_plain_endcap.nif", 0x5E31_2037, 0xD630_0A5F), (r"meshes\i\in_...
Rust
0
impl_f64x4_round() { let a = f64x4::from([1.1, 2.5, 3.7, 4.0]); let expected = f64x4::from([1.0, 2.0, 4.0, 4.0]); let actual = a.round(); assert_eq!(expected, actual); // let a = f64x4::from([-1.1, -2.5, -3.7, -4.0]); let expected = f64x4::from([-1.0, -2.0, -4.0, -4.0]); let actual = a.round(); asser...
Rust
0
# Lanzar la moneda import random """ Crea un programa para lanzar la moneda y saber si sale cara o cruz """ list = ["Cara"," Cruz"] element = random.choice(list) if element == "Cara": print("Ha salido cara") else: print("Ha salido cruz")
Python
1
ametricLIFNodeBPTTKernel): if x_seq.dtype == torch.float16 and v_init.numel() % 2 != 0: raise ValueError('When using the the PLIF neuron with half2 cupy backend, the numer of neurons should be even to avoid the wrong gradient of tau caused by padding!') py_dict = { 'x_seq': x_seq...
Python
1
import pandas as pd #Con este código unimos las dos bases de datos def mergeData(df1: pd.DataFrame, df2: pd.DataFrame): try: if 'User ID' not in df1.columns or 'Person ID' not in df2.columns: raise KeyError("Columnas clave no encontradas en los DataFrames.") df = df1.merge( ...
Python
1
algorithm = None
Python
1
/// /// \code /// SDL_version compiled; /// SDL_version linked; /// /// SDL_VERSION(&compiled); /// SDL_GetVersion(&linked); /// printf("We compiled against SDL version %d.%d.%d ...\n", /// compiled.major, compiled.minor, compiled.patch); /// printf("But we linked aga...
Rust
0
max(id) from collects))") session2.execute("select setval('tags_id_seq',(select max(id) from tags))") session2.execute( "select setval('topics_id_seq',(select max(id) from topics))") session2.execute( "select setval('replies_id_seq',(select max(id) from replies))") session2.execute( ...
Python
1
filter. Queries will only find this item if queried with one of the flags. pub fn set_query_filter(&mut self, this_layers: BitFlags<CollisionLayer>) { for mut shape in self.get_shapes() { shape.set_query_filter_data(this_layers); } } pub fn detach_shape(&mut self, shape: &mut S...
Rust
0
use super::{haversine, inverse_vincenty, Coordinate, DeltaCoordinates, Kinematics}; const SMALL1: Coordinate = Coordinate { utc: (0.0), latitude: Some(51.55814), longitude: Some(0.02955), altitude: Some(0.0) }; const SMALL2: Coordinate = Coordinate { utc: (0.0), latitude: Some(51.55795), longitude: Some(0...
Rust
0
Side Effects: - Configures Streamlit page and title. - Prompts users to input an OpenAI API key and a question. - Allows users to upload PDF documents. - Displays responses generated by querying an assistant. Raises: StreamlitWarning: If the OpenAI API key is not provide...
Python
1
+ D * t < x: p = Pr v = vr Ro = Ror T = p / Rg / Ro return p, v, Ro u_exact = np.zeros((rmse_grid.shape[0], 3)) j = 0 for i in rmse_grid: u_exact[j] = exact(i) j += 1 u_exact = torch.from_numpy(u_exact) net = net.cpu() rm...
Python
1
from crypto_data import get_coins, Coin def alert(symbol: str, bottom: float, top: float, coins_list: list[Coin]): """Creates an alert for the given price range of a coin""" for coin in coins_list: if coin.symbol == symbol: if coin.current_price > top or coin.current_price < bottom: ...
Python
1
tin::Type(typ) => typ.schema, Builtin::Func(func) => func.schema, } } pub fn id(&self) -> GlobalId { match self { Builtin::Log(log) => log.id, Builtin::Table(table) => table.id, Builtin::View(view) => view.id, Builtin::Type(typ) => typ...
Rust
0
12u & 63u | tag_cont) as u8; *ptr::mut_offset(buf, off + 4u) = (code >> 6u & 63u | tag_cont) as u8; *ptr::mut_offset(buf, off + 5u) = (code & 63u | tag_cont) as u8; } } raw::set_len(s, new_len); } } /// Convert a c...
Rust
0
s.path.isdir(mdir): continue print(mdir) if args.splitname is None: split_name = '_'.join(dir.split('_')[9:]) else: split_name = args.splitname split_file = os.path.join(args.splitdir, split_name + '.npz') indice...
Python
1
p\xa18\x8d\xc7\xb6g\x0e\xf2\ P\x7f\x99\xe7\xf8\xc5\xc0\x93F\xac\xe3\xa4\xf9NY\x8f\ \xf0c\xe2\x9a\xbee\xc4\xd3W\x8d\xca\xec\x98\xecI\x82\ I\x0c2f\x100a\xcc\xb91\xd8\x8e\xed\xc0lp\ +\xd7\x02\xd3\xb6.8\xab1bs\x8c\xb3\xe18\xea\ C\xe7\xb82\xc8\xad\xac\xe9\x17F\xc5\xe1\x97\x1eP\x9f\ Y\xe6,\x05\xbb:\x002\x1b\xd6\x90\x15\xc1\x...
Python
1
wsSpider(scrapy.Spider): name = 'sina_news_spider' #最后要调用的名字 start_urls = ['http://news.sina.com.cn'] #起始地址 allowed_domains = ['sina.com.cn'] #过滤器 url_pattern = r'http://(\w+)\.sina.com.cn/(\w+)/(\d{4}-\d{2}-\d{2})/doc-([a-zA-Z0-9]{15}).(?:s)html' #匹配新浪新闻的正则表达式 pattern = "<meta name=\"sudameta\" ...
Python
1
) = sync::oneshot::channel(); self.service.with_gossip(move |gossip, _| { let inner_rx = gossip.messages_for(GRANDPA_ENGINE_ID, commit_topic::<B>(set_id)); let _ = tx.send(inner_rx); }); NetworkStream { outer: rx, inner: None } } fn send_commit(&self, _round: u64, set_id: u64, message: Vec<u8>, force: bo...
Rust
0
.is_available() and dist.is_initialized(): # gather the assignments assignments_all = torch.empty( self.world_size, local_assignments.size(0), dtype=local_assignments.dtype, device=loc...
Python
1
/ The handler, boxed up. /// /// The handler is in an Option type because if it is currently being /// used in a callback, we must take ownership to avoid mutability /// cycles. The easiest way to do this is to take() from the Option then /// put it back. handler: Option<Box<Handler + 'h>>, ...
Rust
0
AD_REQUEST, "Pages start at 1", )); } if total_pages < 1 { return Some(MessageResponse::new( StatusCode::NOT_FOUND, &format!("There are only {} pages", total_pages), )); } None } <gh_stars>0 #![doc( html_logo_url = "https://github.com/jen...
Rust
0
from fastapi import APIRouter, Depends, HTTPException, status from dispatch.database.core import DbSession from dispatch.database.service import CommonParameters, search_filter_sort_paginate from dispatch.auth.permissions import SensitiveProjectActionPermission, PermissionsDependency from dispatch.models import Primar...
Python
1
Get the number of path segments. /// /// This is the number of path segments that will be written by the /// path stage; use this for allocating the output buffer. /// /// Also note: it takes `self` for lifetime reasons. pub fn n_pathseg(self) -> u32 { self.n_pathseg } } use super::{...
Rust
0
toml file founded!"); let config: wsa::Config = toml::from_str(&config_file).unwrap(); wsa::init(config); } <reponame>yuoo655/c #![allow(dead_code)] pub fn set_timer(stime_value: u64) { // #[cfg(target_pointer_width = "32")] // sbi_call( // SBI_SET_TIMER, // stime_value as usize,...
Rust
0
schemas.push(SchemaLoc{ schema:s.clone(), location:"any", }); } } if let Some(one) = &self.one_of{ for s in one { schemas.push(SchemaLoc{ schema:s.clone(), lo...
Rust
0
.sum(axis=1), axis=0) * 100 fig_price = px.bar( price_dist_pct, title='데이터 소스별 가격대 분포 (%)', labels={'value': '비율 (%)', 'index': '데이터 소스'}, color_discrete_map={'Low': '#ff9999', 'Medium': '#66b3ff', 'High': '#99ff99'} ) st.plotly_chart(fig_...
Python
1
desc: TestDesc{ name: TestName::StaticTestName(stringify!($func_name)), ignore: false, should_panic: tests!(@should_panic $($attr)?), allow_fail: false, test_type: TestType::IntegrationTest ...
Rust
0
=> panic!("Event decoded into incorrect variant."), } } } <reponame>gguoss/rust-cardano use cardano::{bip39, paperwallet, wallet}; use rand; use termion::{style, color, clear, cursor}; use termion::input::TermRead; use std::io::{Write, stdout, stdin}; use super::config; pub fn get_password() -> String {...
Rust
0
om: str = f"repeatable({course_id.lower()}, {times}, {max_credits})." atoms.append(atom) # Sort the atoms atoms: List[str] = sorted(atoms) return atoms def _extract_credits(description: str) -> int: """Helper function that extracts the number of credits from a course description. Arg...
Python
1
Ref<'a, T, I, P> { match self { CirqueRef::Initial(initial) => initial, CirqueRef::Ready(ready) => ready.reset(reset), } } /// Get ref index. pub fn index(&self) -> usize { match self { CirqueRef::Initial(initial) => initial.index(), C...
Rust
0
etedBookingLog.objects.all().order_by('-deleted_at') return render(request, 'staffpanel/deleted_log.html', {'logs': logs}) def edit_booking(request, booking_id): booking = get_object_or_404(Booking, id=booking_id) if request.method == 'POST': # again, to prevent accidental edits to booking whcih coul...
Python
1
# Define the voting age for each country PETURKSBOUIPO_AGE : int = 16 STANLAU_AGE : int = 25 MAYENGUA_AGE : int = 48 def main(): # Get the user's age user_age = int(input("How old are you? ")) # Check if the user can vote in Peturksbouipo if user_age >= PETURKSBOUIPO_AGE: print("You can vote i...
Python
1
def visit_Number(self, node): return node.value def start(self): return self.visit(self.tree) class CodeGenerator(object): """Class for code generator""" def __init__(self, AST): self.AST = AST def generate(self): """ FIXME: ...
Python
1
context, expr)?; self.subtype(&theta, &alpha.apply(&theta), &ty.apply(&theta))? } }; Ok(ok) } pub fn synthesize( &mut self, context: &Context<Lit>, expr: &Expression<Lit>, ) -> Result<(Type<Lit>, Context<Lit>), Lit> { use ContextKi...
Rust
0
c<Box<dyn ResourceSample>>) -> Self { Self { inner: samples } } /// Move out the samples. pub(crate) fn into_inner(self) -> Vec<Box<dyn ResourceSample>> { self.inner } /// Get reference to the samples. pub(crate) fn inner(&self) -> &Vec<Box<dyn ResourceSample>> { &self.in...
Rust
0
"""Squad size to AT ammo quantity mapping.""" LIGHT_AT_AMMO = { # squad size: ammo quantity 3: 3, # 3-man squad gets 3 AT weapons 4: 4, # 4-man squad gets 4 AT weapons 5: 5, # etc. 6: 6, 7: 6, 8: 7, 9: 7, 10: 8, 11: 8, 12: 8, 13: 9, 14: 9, 15: 9, 16: 10, }
Python
1
per::Foundation::BOOL, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Diagnostics_Etw"))] impl ::core::marker::Copy for DXVA2Trace_DecodeDevGetBufferData {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Diagnostics_Etw"))] impl ::core::clone::Clone for DXVA2Trace_DecodeDevGetBufferD...
Rust
0
StructureMap_TargetTransform::Copy => "copy".to_string(), StructureMap_TargetTransform::Truncate => "truncate".to_string(), StructureMap_TargetTransform::Escape => "escape".to_string(), StructureMap_TargetTransform::Cast => "cast".to_string(), StructureMap_TargetTransform...
Rust
0
+l"); same!("ts12", "s12t"); diff!("s12s23", "s23s12"); diff!("s-+s+#", "s+#s-+"); } #[test] fn test_replace_should_bail_if_from_eq_to() { same!("sabsaa", "sab", "saasabsaa", "saasab"); } #[test] fn test_replace_should_take_previous_replaces_into_account() { ...
Rust
0
ea\xa6\x9a\xbe\xc8\x22&V\x80\xe1?\x89\xe9\xba\ U\xb1\xd6L\x10\x19\x0a\x01\xca\xcf2\xb58\xc7\x843\ \x0c.\xde]\xb1iT\x1d\xa0\xd5\xabs\xc3\x8d)\x8e\ \xb7\xb8\xfd-\xd4]\x8bea\x09\xdew\xe1\x10\xf0\xb9\ \x9bPwU^Z\xe9c>9\x85{\x8f.Z\xbf\ \xa0y\x9f\x10/8\xc7\xfa\x90P\xf8\xa8p\xc8\x0c\xd5\ 3\x91y\xb0\x10 \x15\xf7\x8d\xc5\xdc\xac...
Python
1
import os from rdkit import Chem from rdkit.Chem import AllChem, rdShapeHelpers from rdkit.Chem.FeatMaps import FeatMaps from rdkit import RDConfig # Set up features to use in FeatureMap fdefName = os.path.join(RDConfig.RDDataDir, 'BaseFeatures.fdef') fdef = AllChem.BuildFeatureFactory(fdefName) fmParams = {} for k i...
Python
1
class Perro: contador_perros = 0 # Variable estática # Método __init__ (constructor de la clase) def __init__(self, nombre, raza, edad, pelota = False): """MÉTODO CONSTRUCTOR: - Crearemos el objeto con los argumentos que pasamos a la hora de iniciar el objeto""" #Variables de ins...
Python
1
"""seed_reservations Revision ID: 89bcff19b03b Revises: 0003_seed_guests Create Date: 2025-01-10 12:46:47.732043 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '89bcff19b03b' down_revision: Union[str, None] = '0003_seed...
Python
1
pub fn eat(&mut self) { self.next(); } pub fn eat_while<P>(&mut self, predicate: P) where P: FnMut(char) -> bool { self.consume_while(predicate); } pub fn consume_while<P>(&mut self, mut predicate: P) -> std::vec::IntoIter<char> where P: FnMut(char) -> bool ...
Rust
0
SE6, // Dual/Single voltage: 43/43 Ohm @ 1.8V, 40/26 Ohm @ 3.3V ); // Enabling the lpi2c1 clock and setting the speed. peripherals.lpi2c1.enable_clock(); peripherals .lpi2c1 .set_speed(imxrt1050::lpi2c::Lpi2cSpeed::Speed100k, 8); use imxrt1050::gpio::PinId; let mux_i2c = ...
Rust
0
eatures: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const EVENT_FRS_SYSVOL_READY: i32 = 1073755340i32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const EVENT_FRS_VOLUME_NOT_SUPPORTED: i32 = -1073728317i32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement...
Rust
0
x: int = 0): """ After a model has been scored, this will retrain the model according to the models online learning approach Args: model_index(int): Index of the model to update Returns: int: 0 if model does not support dynamic scoring, 1 if model was scor...
Python
1
Ast::*; match *self { AbstractPins(ref pins) => pins[0].tag(), ComponentDef(ref def) => def.tag(), ConcretePins(ref pins) => pins[0].tag(), ConnectionMap(ref map) => map.tag(), Connect(ref conn) => conn.tag(), Footprint(ref footprint) => fo...
Rust
0
['concepts'] concept_labels = tf.gather(concept_labels, _CONCEPTS_IN_USE, axis=0) concept_labels = tf.cast(concept_labels, tf.int64) concept_labels = tf.clip_by_value(concept_labels, 0, 3) onehot_concept_labels = tf.equal( tf.range(4, dtype=tf.int64)[None, :], concept_labels[:, None]) onehot_conc...
Python
1
O_CLASS_NETWORKSETTINGSSTATE = 9, Network, // ARCOMMANDS_ID_JUMPINGSUMO_CLASS_NETWORK = 10, NetworkState, // ARCOMMANDS_ID_JUMPINGSUMO_CLASS_NETWORKSTATE = 11, AutioSettings, // ARCOMMANDS_ID_JUMPINGSUMO_CLASS_AUDIOSETTINGS = 12, AudioSettingsState, // ARCOMMANDS_ID_JUMPING...
Rust
0
Variable, ) -> *const c_char { output_str(&(*this.1).value) } /// Returns <TRUE> if the custom variable is permanent. Permanent variables get /// stored in the splits file and are visible in the run editor. Temporary /// variables are not. #[no_mangle] pub unsafe extern "C" fn RunMetadataCustomVariable_is_permanen...
Rust
0
''' Implementar un algoritmo greedy que permita obtener el Dominating Set mínimo (es decir, que contenga la menor cantidad de vértices) para el caso de un árbol (en el contexto de teoría de grafos, no un árbol binario). Inlistaar y justificar la complejidad del algoritmo implementado. Justificar por qué se trata de un ...
Python
1
ctMRIFrameofReference), ("1.2.840.10008.3.1.1.1", &uids::DICOMApplicationContextName), ("1.2.840.10008.5.1.1.4", &uids::BasicGrayscaleImageBoxSOPClass), ("1.2.840.10008.1.4.1.16", &uids::SPM2AVG152T2FrameofReference), ("1.2.840.10008.5.1.1.23", &uids::PresentationLUTSOPClass), ("...
Rust
0
w enum members * * Note that wlroots does not make an ABI compatibility promise - in the future, * the layout and size of structs used by wlroots may change, requiring code * depending on this header to be recompiled (but not edited). * * Breaking changes are announced by email and follow a 1-year deprecation * ...
Rust
0
ingFileHandler( log_file, maxBytes=20 * 1024 * 1024, backupCount=10 # 20MB ) # Use JSON format for performance data formatter = JSONFormatter() handler.setFormatter(formatter) perf_logger.addHandler(handler) perf_logger.propagate = False # Don't propagate to root logger return p...
Python
1
ence = ($left - $right).abs(); if difference > $precision { panic!("|{} - {}| = {} > {}", $left, $right, difference, $precision); } }; ($left:expr, $right:expr, $precision:expr, $message:literal $(,$args:expr)* ) => { let difference = ($left - $right)....
Rust
0
import cv2 import os import time import torch import json from torchvision import transforms if 'model' not in globals(): model = torch.hub.load('ultralytics/yolov5', 'yolov5s') processed_files_log = "processed_files.json" if os.path.exists(processed_files_log): with open(processed_files_log, 'r') as f: ...
Python
1
from database.database import Base from sqlalchemy import Column, Integer, String, TIMESTAMP, Boolean, text, func class User(Base): __tablename__ = "users" id = Column(Integer,primary_key=True,nullable=False) firstname = Column(String,nullable=False) lastname = Column(String,nullable=False) email...
Python
1
Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is dist...
Rust
0
s] # Use simple MD format, TODO: format name? header = f"| Model | {' | '.join(header_titles)} |" separator = f"|:---{'|:---' * len(sorted_metrics)}|" # Construct each data row for the table. table_rows = [] sorted_results = sorted(all_model_results, key...
Python
1
atic rte_flow_item_icmp6_mask: rte_flow_item_icmp6; } #[doc = " RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS"] #[doc = ""] #[doc = " Matches an ICMPv6 neighbor discovery solicitation."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rte_flow_item_icmp6_nd_ns { #[doc = "< ICMPv6 type, normally 135."] pub type_: u8, #...
Rust
0
nt_slice_box::<Srgb<u8>>(components); /// ``` #[cfg(feature = "std")] #[inline] pub fn from_component_slice_box<T>(values: Box<[<T::Array as ArrayExt>::Item]>) -> Box<[T]> where T: ArrayCast, { try_from_component_slice_box(values).unwrap() } /// Cast from a boxed slice of color components to a boxed slice of c...
Rust
0
=> 'R', &Square => 'S' }.encode_canvas(append_to) } } impl CanvasEncoding<String> for WindingRule { fn encode_canvas(&self, append_to: &mut String) { use self::WindingRule::*; match self { &NonZero => 'n', &EvenOdd => 'e' }.encode_canvas(appe...
Rust
0
from database.db import db from sqlalchemy import ForeignKey from sqlalchemy.orm import relationship from flask_restx import inputs import datetime class Membros(db.Model): #criando representações das tabelas do bancp (db.Model) def to_dict(self): #to_dict transforma database rows em dicioinarios return{...
Python
1