text
string
label_name
string
labels
int64
assert success is True assert "已撤銷" in message # 驗證方法被調用 mock_update_status.assert_called_once_with( mock_session, "test_key_123", KeyStatus.REVOKED, "Security breach" ) mock_log_event.assert_called_once() @patch.obje...
Python
1
is expected to work with OpenGL version 3.3 and above, and //! OpenGL ES version 3.0 or above. This should cover the vast majority of even //! fairly dated hardware. Please submit an issue for any incompatibilities //! found with these OpenGL versions, pull requests to extend support to earlier //! versions are welcom...
Rust
0
# East / West ").unwrap(); } let invalid = |_| format!("Invalid coord: \"{}\"", data); let cap = RE.captures(data).ok_or_else(|| format!("Invalid coord: \"{}\"", data))?; let lat = Self::multiplier_lat(&cap[3]).map_err(invalid)? * Self::parse_component(&cap[...
Rust
0
, tweet.created_at); println!(); } } else { for tweet in tweets.iter().rev() { println!("{}: {}", tweet.user.screen_name.red(), tweet.text); } } } fn split_query(query: &str) -> HashMap<Cow<str>, Cow<str>> { let mut param = HashMap::new(); for q in query....
Rust
0
ogies (UK) Ltd. // This file is part of Parity Ethereum. // Parity Ethereum is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // Par...
Rust
0
# 10 - Classificação de Notas: # Crie um programa que solicite uma nota de 0 a 100 # e informe o conceito (A, B, C, D, F) com base na nota. while True: n = intInput('Digite a nota: ') if n < 20: print('F') elif n > 21 and n < 40: print('D') elif n > 41 and n < 60: print('C') elif n > 61 and n < ...
Python
1
= self.maximum_burst_bitrate_kbps { os.write_int32(4, v)?; } if let Some(v) = self.supports_video_hevc { os.write_bool(5, v)?; } if let Some(v) = self.disable_steam_store { os.write_bool(6, v)?; } if let Some(v) = self.disable_client_cu...
Rust
0
fiSetupDialog",s,c) # The Wifi object here is not actual object, Dynamically relevant modules are selected based on # wifi-config value in the models file. def getWifiObject(self,wifiConfVal): self.wifiConfVal = wifiConfVal if wifiConfVal == WIFI_CONFIG_LEDM: self.wifiObj = Led...
Python
1
$fn_name_basics:ident, $fn_name_underflow:ident, $fn_name_underflow_interrupt:ident, $reg_lo:expr, $reg_hi:expr, $reg_cr:expr, $icr_flag:expr ) => { #[test] fn $fn_name_basics() { use crate::timer::fl...
Rust
0
the attestation flow for /// AWS Nitro Enclaves for a secure attestation implementation. This is merely here for /// illustrative purposes. static TOTALLY_INSECURE_ROOT_PRIVATE_KEY: [u8; 32] = [ 0xe6, 0xbf, 0x1e, 0x3d, 0xb4, 0x45, 0x42, 0xbe, 0xf5, 0x35, 0xe7, 0xac, 0xbc, 0x2d, 0x54, 0xd0, 0xba, 0x94, 0xbf, 0...
Rust
0
# ➊ 노드 클래스 정의 class Node: # ➋ 노드 클래스 생성자 def __init__(self, key): self.left = None self.right = None self.val = key # ➌ 이진 탐색 트리 클래스 class BST: # ➍ 초기에 아무 노드도 없는 상태 def __init__(self): self.root = None # ➎ 루트 노드부터 시작해서 이진 탐색 트리 규칙에 맞는 위치에 새 노드 삽입 def insert(self, key): # 루트 노드가 없는 경우 새로...
Python
1
# Copyright (c) 2024 yasuhiro yamashita # Released under the MIT license. # see http://open source.org/licenses/MIT # # ======================================== # pathe motocamera digitlize mod controler # controler program ver.0.0.0 # on Raspberry Pi Zero2W # image sensor:IMX708 # =====================================...
Python
1
import ui def main() -> None: ui.init() if __name__ == '__main__': main()
Python
1
int128::from(10000u128)}; let res = execute(deps.as_mut(), env, info, msg); assert!(res.is_err()); } fn test_compound_zero(deps: &mut OwnedDeps<MockStorage, MockApi, WasmMockQuerier>) { // reinvest zero let env = mock_env(); let info = mock_info(TEST_CONTROLLER, &[]); let msg = ExecuteMsg::comp...
Rust
0
input_strings = self.question_encoder_tokenizer.batch_decode(question_input_ids, skip_special_tokens=True) context_input_ids, context_attention_mask = self.postprocess_docs( docs, input_strings, prefix, n_docs, return_tensors=return_tensors ) return BatchEncoding( { ...
Python
1
cess': False, 'error': str(e)}), 500 @app.route('/api/nodule/<session_id>/<int:nodule_id>', methods=['GET']) def get_nodule_data(session_id, nodule_id): try: # 检查会话是否存在 if session_id not in SESSION_DATA: return jsonify({"success": False, "error": "会话不存在"}), 404 # 获取会话数据 ...
Python
1
flags = 0; let handle = unsafe { fd.as_raw_handle() }; let access_mode = winx::file::query_access_information(handle)?; let mode = winx::file::query_mode_information(handle)?; // Append without write implies append-only (__WASI_FDFLAGS_APPEND) if access_mode.contains(AccessMode::FILE_APPEND_DATA)...
Rust
0
""" Snake, Water, Gun Game This program allows a user to play the classic game against the computer. It uses a function to determine the winner based on the rules. Rules: - Gun beats Snake - Snake beats Water - Water beats Gun """ import random # --- GAME LOGIC FUNCTIONS --- def get_computer_choice(): """ ...
Python
1
omString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) @staticmethod def QueryVectors(request, target, ...
Python
1
use this file except in compliance with the License. // You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF AN...
Rust
0
# Copyright (c) 2024 Microsoft Corporation. # Licensed under the MIT License """Util functions to retrieve text units from a collection.""" from typing import Any, cast import pandas as pd from graphrag.data_model.entity import Entity from graphrag.data_model.text_unit import TextUnit def get_candidate_text_units...
Python
1
def imp( self, url, path, out=None, rev=None, config=None, remote=None, remote_config=None, **kwargs, ): erepo = {"url": url} if rev is not None: erepo["rev"] = rev if remote and remote_config and isinstance(config, str): raise ValueError( "Ca...
Python
1
B, /// BT.2020 10-bit systems BT2020_10Bit, /// BT.2020 12-bit systems BT2020_12Bit, /// SMPTE ST 2084, ITU BT.2100 PQ SMPTE2084, /// SMPTE ST 428 SMPTE428, /// BT.2100 HLG (Hybrid Log Gamma), ARIB STD-B67 HLG, } /// Bit depth (8 = 1 byte, >=10 = 2 bytes) #[repr(C)] #[derive(Deb...
Rust
0
1(&inputs[0].shape().iter().map(|&d| d as i64).collect::<Vec<_>>()); let shape = shape.cast_to_dt(self.dt)?.into_owned(); Ok(tvec![shape.into_arc_tensor()]) } } impl TypedOp for Shape { fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedFact>> { let shape = inputs[0]...
Rust
0
rix[0], matrix[1]): rec[k] = v # 额外行合并(若存在) for extra_row in matrix[2:]: for idx, val in enumerate(extra_row): rec[f"额外字段{idx+1}"] = val records.append(rec) return records def transform_to_2d_l...
Python
1
lf.value elif self.value != self.value_default: state['value'] = self.value return state #---------------------------------------------------------------------------- # MIDI CC processing #---------------------------------------------------------------------------- def midi_control_change(self, val): #...
Python
1
import sys input = lambda : sys.stdin.readline().rstrip('\r\n') arr = [] visited = [[0 for _ in range(5)] for _ in range(5)] for _ in range(5): arr.append(list(map(int, input().split()))) ans = 0 flag = False s = [] for _ in range(5): s.append(list(map(int, input().split()))) for index_i in range(5): fo...
Python
1
鐵鐡 𠮷野家吉野家 𠮷呑み吉呑み 𠮷兆吉兆 弁護士辯護士 弁理士辨理士 新潟県新泻県 深圳市深セン市 ''' sim_glyphs_list = list(sim_glyphs_list.replace('\n','')) for c in set(sim_glyphs_list): glyphs[ord(c)] = c doublew1_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' doublew2_list = 'abcdefghijklmnopqrstuvwxyz' doublew1_list = list(doublew1_list) doublew2_list = list(do...
Python
1
se::<usize>().unwrap())} else {None}) .collect::<Vec<usize>>() ) .collect::<Vec<Vec<usize>>>() } #[cfg(test)] fn part_1() -> usize { let input = parse_input(); let mut result = 0; for (j, line) in input.iter().enumerate() { for (i, val) in line.iter().enumerate() { if is_low_point(&input...
Rust
0
jj||sPtjtjjtjj|||j|}ttjj...
Python
1
rple", [0x80, 0x00, 0x80, 0xFF]); m.insert("rebeccapurple", [0x66, 0x33, 0x99, 0xFF]); m.insert("red", [0xFF, 0x00, 0x00, 0xFF]); m.insert("rosybrown", [0xBC, 0x8F, 0x8F, 0xFF]); m.insert("royalblue", [0x41, 0x69, 0xE1, 0xFF]); m.insert("saddlebrown", [0x8B, 0x45, 0x13, 0xFF]); m.insert("salmon"...
Rust
0
rp_heading_j/heading_scale_j*width_j/2).T point_j3 = (point_down_j + perp_heading_j/heading_scale_j*width_j/2).T point_j4 = (point_down_j - perp_heading_j/heading_scale_j*width_j/2).T if front_rear_only: return (point_up_i, point_down_i, point_up_j, point_down_j) else: r...
Python
1
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
Python
1
&b) in lower_bound_bits.iter().rev().enumerate() { if b == 1 { t = i; break; } } let mut pis = vec![pi_base]; for (i, (&c, a)) in lower_bound_bits .iter() .zip(value_bits.iter()) .rev() .skip(t + 1) .rev() .enumerate() ...
Rust
0
rentindex == 0: self.logger.info('Beginning reached.') return else: self.currentindex -= 1 if currentname.find('_mask') > -1: alpha = 0.5 imgdata = self.images[self.currentindex] parentimg = imgdata['image'] maskshape = imarray.shape targets = apMask.getRegionsAsTargets(self.mas...
Python
1
ature mask1 = self._resize_mask(view1, shape1) # if 'atten_mask' not in view1, return None mask2 = self._resize_mask(view2, shape2) # if 'atten_mask' not in view2, return None # combine all ref images into object-centric representation (dec1, dec2), (self_attn1, cross_attn1, self_attn2,...
Python
1
m_le_bytes(data[0..size_of::<i16>()].try_into().unwrap()) as i128 } else if data.is_empty() { 0 } else { data[0] as i128 }; dbg!(num); let dec_to_str = roc_dec::fuzz_new(num).to_string(); // There should be a dot with something before it and something after. let mut dec_pi...
Rust
0
import ast DEBUG = True def debug_log(msg): if DEBUG: print(f"[>] {msg}") def find_innermost_scope(tree, line_range: tuple[int, int]): """ Finds the innermost function or class definition that encloses a given line number. """ innermost = None for node in ast.walk(tree): if...
Python
1
# Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause from __future__ import annotations """PySide6 port of the widgets/layouts/basiclayout example from Qt v5.x""" import sys from PySide6.QtWidgets import (QAppli...
Python
1
b9\xbd\x86\xa0\x0c\x13\ k\xc7;\xce\xf9\xd2?n\x83w\x0a\xd0\xeb\xf7}\xe1\ &b\xce\x03P\x02\xa2\xb1\x8c\x1e\x84\xc2\x8b\xe5\xfa\xa8\ \x09\xc8G\xda\xc7m\xc6\xe4\xe8\x18|\xf8\x81\x03\xdeM\ \xc1\x8bh:mO\xb6\xd8Y\xd4\xe3Pl\xb4\xfe3\ \x92\xd1\xeb\x9a\x8dk\xbe\xfcO\xd3p\xac\x00%oU\ W\xf5\x93\xf4\xc6q\xef\x12\xf9\xbez,\x8e`\x83\x...
Python
1
chat = await event.get_chat() chat_info = { 'id': chat.id, 'title': getattr(chat, 'title', f'私人對話 {chat.id}'), 'type': 'group' if hasattr(chat, 'title') else 'private' } # 檢查是否已存在 existing = next((...
Python
1
elif isinstance(m, BatchNorm2d_class): nn.init.constant_(m.weight, 1) nn.init.constant_(m.bias, 0) if os.path.isfile(pretrained): pretrained_dict = torch.load(pretrained) logger.info('=> loading pretrained model {}'.format(pretrained)) model_di...
Python
1
from __future__ import annotations from functools import partial import toolz import gdsfactory as gf extend_ports1 = partial(gf.components.extend_ports, length=1) extend_ports2 = partial(gf.components.extend_ports, length=10) straigth_extended1 = toolz.compose( extend_ports1, partial(gf.components.straight, ...
Python
1
s += format_time(epoch_time) #val_AP50 = epoch_entry["metrics"].get("val_AP50","") #val_mAP_coco = epoch_entry["metrics"].get("val_mAP_coco","") #construct full row dict row = {"epoch": epoch+1, "stage": self.stage_name} row.update(dict(zip(metric_keys, metr...
Python
1
53297u32 => "IHSS-1140", 53298u32 => "IHSS-1140", }; let mut ctx = Context::from_semester_data(SemesterData { crn_times: &crn_times, crn_courses: &crn_courses, }); // No courses selected assert_eq!(ctx.generate_schedules_and_conflicts(), 0); assert!(!ctx.everything_confl...
Rust
0
entSeeker, announcePos) tempPath = trackPath(tempFinalState) for i in range(1, len(tempPath)): currentSeeker.updateSeeker(tempPath[i].currentPosition) currentSeeker.clear_current_vision() currentSeeker.find_agen...
Python
1
1], "longitude": record[2], "latitude": record[3], "priority": record[4], "access_period": record[5], "access": record[6], "value": record[7], "last_acc...
Python
1
# Python program to introduce Binary Tree class Node: def __init__(self,key): #Constructor self.left = None self.right = None self.val = key if __name__ == '__main__': # create root root = Node(1) ''' following is the tree after above statement _...
Python
1
n = int(input()) nums = list(map(int, input().split())) print(sum(nums)/n)
Python
1
SSKrSSKrSSKrSSKrSSKrSSKrSSKJrJr Sq SSjr Sr Sr Sr SrS r/qS \S \4S jrSS jrg)NprofileProfilerActivitycg)Nr#torch\_functorch\benchmark_utils.py synchronizer ...
Python
1
} } impl UserContentManager { #[cfg(any(feature = "v2_6", feature = "dox"))] pub fn new() -> UserContentManager { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::webkit_user_content_manager_new()) } } } #[cfg(any(feature = "v2_6", feature = "dox"))]...
Rust
0
le(path): continue ext = os.path.splitext(fname)[1] if extensions and ext not in extensions: continue if (ext in ['.py', '.sh']) or fname.lower().startswith('cmake'): insert_in_script(path, dryrun, border_line="########", comment_sign="#", full_header=py_comme...
Python
1
W { self.bit(variant.into()) } #[doc = "Event not generated"] #[inline(always)] pub fn not_generated(self) -> &'a mut W { self.variant(EVENTS_VALRDY_A::NOTGENERATED) } #[doc = "Event generated"] #[inline(always)] pub fn generated(self) -> &'a mut W { self.variant(...
Rust
0
coordinates[data == lab].mean(axis=0) return dict(zip(labels, centroids)) def closest_centroid(coords, centroids, return_dist=False): """ Returns index of `centroids` closest to `coords` (Euclidean distance) Parameters ---------- coord : (S, 3) array_like Coordinates of samples ...
Python
1
sponse from .models import CarbonFootprint from .serializers import CarbonFootprintSerializer @api_view(['POST']) def submit_carbon_footprint(request): if request.method == 'POST': serializer = CarbonFootprintSerializer(data=request.data) if serializer.is_valid(): # You could adjust thi...
Python
1
LIC_MD, r"^[A-Z]{1}[0-9]{12}$"); /// 25025 Driver's License - MA (25025, REGEX_DRV_LIC_MA, r"(^[A-Z]{1}[0-9]{8}$)|(^[0-9]{9}$)"); /// 25026 Driver's License - MI (25026, REGEX_DRV_LIC_MI, r"(^[A-Z]{1}[0-9]{10}$)|(^[A-Z]{1}[0-9]{12}$)"); /// 25027 Driver's License - MN (25027, REGEX_DRV_LIC_MN, r...
Rust
0
from .keys import ( SigningKey, VerifyingKey, BadSignatureError, BadDigestError, MalformedPointError, ) from .curves import ( NIST192p, NIST224p, NIST256p, NIST384p, NIST521p, SECP256k1, BRAINPOOLP160r1, BRAINPOOLP192r1, BRAINPOOLP224r1, BRAINPOOLP256r1, B...
Python
1
"); let mut builtins = HashSet::new(); builtins.insert("ANY"); builtins.insert("DROP"); builtins.insert("EOI"); builtins.insert("PEEK"); builtins.insert("PEEK_ALL"); builtins.insert("POP"); builtins.insert("POP_ALL"); builtins.insert("SOI"); builtins.insert("ASCII_DIGIT"); b...
Rust
0
# SPDX-FileCopyrightText: 2021 Neradoc NeraOnGit@ri1.fr # # SPDX-License-Identifier: MIT """ This file was automatically generated using Circuitpython_Keyboard_Layouts """ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/Neradoc/Circuitpython_Keyboard_Layouts.git" from adafruit_hid.keyboard_layout_base i...
Python
1
from nltk.internals import find_binary, find_jar def check_binary(binary: str, **args): """Skip a test via `pytest.skip` if the `binary` executable is not found. Keyword arguments are passed to `nltk.internals.find_binary`.""" import pytest try: find_binary(binary, **args) except LookupEr...
Python
1
poly_with_same_inputs(&self) -> Vec<F>; } impl<F: PrimeField> UnnormalizedBivariateLagrangePoly<F> for GeneralEvaluationDomain<F> { fn eval_unnormalized_bivariate_lagrange_poly(&self, x: F, y: F) -> F { if x != y { (self.evaluate_vanishing_polynomial(x) - self.evaluate_vanishing_polynomial(y)) ...
Rust
0
(&self) -> RwLockWriteGuard<'_, T> { self.0.write().expect("Cannot handle a poisoned lock") } /// return the owned type consuming the lock pub fn into_inner(self) -> T { self.0.into_inner().expect("Cannot handle a poisoned lock") } } <reponame>yhchiang-sol/solana #[cfg(not(target_os = "...
Rust
0
def close_far(a, b, c): if abs(b - a) <= 1 and abs(c - a) >= 2 and abs(c - b) >= 2: return True if abs(c - a) <= 1 and abs(b - a) >= 2 and abs(c - b) >= 2: return True return False
Python
1
to_owned()).for_each(|p| ui.print(&p)); ui.newline(); } fn ion_text_string(result: Result<IonCReaderHandle, IonCError>) -> String { let value = match result { Ok(v) => v, Err(e) => { warn!( "unable to display document because it could not be parsed: {}", ...
Rust
0
let instance_id: u32 = unsafe { ::std::mem::transmute(instance_id) }; instance_id as u64 }); __bindgen_bitfield_unit } #[inline] pub fn flags(&self) -> RendererGeometryInstanceFlags { unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 8u8) as u32) } ...
Rust
0
; let preloaded_response = { let mut preloaded_responses = ctx.preloaded_responses.lock(); if !preloaded_responses.is_empty() { Some(preloaded_responses.remove(0)) } else { None } }; ...
Rust
0
create_key( &mut self, key_attributes: KeyAttributes, attributes: Option<ProfileEventAttributes>, ) -> Result<()>; /// Rotate existing key. Key is uniquely identified by label in [`KeyAttributes`] fn rotate_key( &mut self, key_attributes: KeyAttributes, attr...
Rust
0
k_df.meter_reading_l1p) leak_score = np.sqrt(mean_squared_error(leak_df.pred_l1p, leak_df.meter_reading_l1p)) # # LV score print('total score=', leak_score) leak_df = leak_df[['meter_reading', 'row_id']].set_index('row_id').dropna() sample_submission.loc[leak_df.index, 'meter_reading'] = l...
Python
1
ract, amount, msg, } => Ok(execute_send_from(deps, env, info, owner, contract, amount, msg)?), ExecuteMsg::UpdateMarketing { project, description, marketing, } => Ok(execute_update_marketing(deps, env, info, project, description, market...
Rust
0
o one cell type, to be called "dominant". Should be higher than 0.5. index_name - name to give to index column Returns: cluster df - pandas dataframe with for each cluster information on what is the dominant cluster (if there i...
Python
1
'epoch': epoch, } with open(os.path.join(args.output_dir, "log.txt"),"a") as f: f.write(json.dumps(log_stats) + "\n") else: log_stats = {**{f'train_{k}': v for k, v in train_stats.items()}, ...
Python
1
def update_labels_info(self, label): """custom your label format here.""" return label
Python
1
from devup_api_fastapi import CrudRouter from models.user import User print(User) CrudRouter(User) print(User) print("user routes")
Python
1
''' DFS, BFS 풀기 위한 템플릿 ''' # 우선, 인접 리스트 (인접 행렬 사용하는 방법도 있겠지...) 만든다 n, m = map(int, input().split()) #노드 수, 간선 수 입력 받기 graph = [[] for _ in range(n+1)] for _ in range(m): u, v = map(int, input().split()) #u, v는 간선에 연결된 노드 # 무방향 그래프일 경우 아래와 같이 한다 graph[u].append(v) graph[v].append(u) # DFS (stack 사용 - 반복문 방...
Python
1
ssor(argparse.Action): # pylint: disable=missing-docstring def __call__(self, parser, args, webroot_map_arg, option_string=None): webroot_map = json.loads(webroot_map_arg) for domains, webroot_path in six.iteritems(webroot_map): process_domain(args, domains, [webroot_path]) class Doma...
Python
1
""" Unit tests for API. """ import pytest from aiohttp import ClientSession from starlette.testclient import TestClient import app.main from wps_shared.tests.common import default_mock_client_get PERCENTILE_URL = '/api/percentiles/' """ Some basic unit tests. """ def test_stations(monkeypatch: pytest.MonkeyPatch)...
Python
1
> {} } } occ.insert( self.lf_id ); return occ; }, _ => { let mut occ : HashSet<usize> = HashSet::new(); occ.insert( self.lf_id ); return occ; } } } } ...
Rust
0
, "playlist", &mut result) { Ok(_ok) => {} Err(error) => return Err(error), } let v: Value = serde_json::from_str(result.as_str()).unwrap(); let size = v["playlists"]["items"].as_array().unwrap().len(); for x in 0..size { final_result.push(serde_json::...
Rust
0
_id: LocalNodeId, } impl NodeId { /// Makes a new `NodeId` instance. pub fn new(address: SocketAddr, local_id: LocalNodeId) -> Self { NodeId { address, local_id } } /// Returns the RPC server address part of the identifier. pub fn address(&self) -> SocketAddr { self.address } ...
Rust
0
}), read_floor: AtomicUsize::new(n), active: AtomicBool::new(true), read_waiters: Default::default(), writer_waiter: Default::default(), num_sub: AtomicUsize::new(1), } } fn subscriber(self: &Arc<Self>) -> Subscriber<T> { self.num_su...
Rust
0
strict':'0', 'hcountry':'1', 'hprovince':'0', 'hcity':'0', 'hdistrict':'0', 'online':'0'} # 需要提交的cookies # cookies = {'uin':self.cookies_merge_dict_in_qun_qq_com['uin'], 'skey':self.cookies_merge_dict_in_qun_qq_com['skey'], 'ptisp':self.cookies_merge_dict_in_qun_qq_com['ptisp'], 'RK':self.cookies_merge...
Python
1
mmand { transitiontime: Some(a), ..self } } /// Sets the brightness increment value pub fn with_bri_inc(self, b: i16) -> Self { LightCommand { bri_inc: Some(b), ..self } } /// Sets the hue increment value pub fn with_hue_inc(self, h: i16) -> Self { LightCommand { hue_inc: Some(h)...
Rust
0
from django.urls import path from .views import BotuserApiView, FeedbackApiView botuser_list = BotuserApiView.as_view({'get': 'list', 'post': 'create'}) botuser_detail = BotuserApiView.as_view({'put': 'update_botuser'}) feedback_list = FeedbackApiView.as_view({'get': 'list', 'post': 'create'}) feedback_detail = Feedb...
Python
1
") space_fmt = ":" + str(len(str(len(iterable)))) + "d" log_msg = [ header, "[{0" + space_fmt + "}/{1}]", "eta: {eta}", "{meters}", "time: {time}", "data: {data}", ] if torch.cuda.is_available(): log_msg....
Python
1
; } return Ok(result_op); } } <reponame>turboladen/overkill-nvim<gh_stars>1-10 //! Types defined in `globals.h`. //! /// Special values for `current_SID`. /// #[derive(Debug, Clone, Copy)] pub enum Sid { /// When using a modeline. /// Modeline = -1, /// For `--cmd` argument. //...
Rust
0
import re from typing import List def doc_to_text(x): text = re.sub(r" X ", " *" + x["span2_text"] + "* ", _wsc_inputs(x)) return "wsc: " + text def _wsc_inputs(x): words = x["text"].split(" ") # We would need some special logic to handle the case where the pronoun is the # first or last word i...
Python
1
n); let distance = Prec::sqrt(distance_squared(*p, (0.0, 0.0, 0.0))); let distance_sqrt = Prec::sqrt(distance); if distance_sqrt < DISTANCE_EPSILON { (s.0, s.1, s.2) } else { ( s.0 - Prec::sqrt(BLACK_HOLE_MASS * G + distance / RADIUS * N_ELEMS as ...
Rust
0
size[strides_sum as usize] = StrideType::from(*s); strides_sum += s; if strides_sum >= Store::AF::BITS - 1 { break; } } assert_eq!(strides.iter().sum::<u8>(), Store::AF::BITS); let mut stride_stats: Vec<StrideStats> = vec![ StrideS...
Rust
0
let mut genesis_config = GenesisConfig::default(); genesis_config.block_prod_time = 86400 * 1_000_000_000; genesis_config } pub fn init( total_supply: u128, ) -> ( UserAccount, ContractAccount<MockFungibleTokenContract>, ContractAccount<MockFungibleTokenContract>, ContractAccount<TokenM...
Rust
0
rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K5), broadcast: None, }, &[98, 97, 141, 205, 94, 30], OperandSize::Qword, ) } #[test] fn vdivpd_26() { run_test( &Instruction { mne...
Rust
0
}; use ckb_core::{capacity_bytes, Capacity}; use ckb_crypto::secp::{Generator, Privkey}; use ckb_db::MemoryKeyValueDB; use ckb_hash::blake2b_256; use ckb_store::{data_loader_wrapper::DataLoaderWrapper, ChainKVStore, COLUMNS}; use faster_hex::hex_encode; use ckb_test_chain_utils::create_alwa...
Rust
0
), Method::PATCH); assert_eq!(Method::from("OPTIONS"), Method::OPTIONS); assert_eq!(Method::from("TRACE"), Method::TRACE); assert_eq!(Method::from("INVALID"), Method::GET); } #![deny(deprecated)] use pyo3::prelude::*; #[pyclass] struct TestClass { num: u32, } #[pymethods] impl TestClass { #[class...
Rust
0
FieldType::Subform { subform_type: field.ty.clone(), } } else if is_option(field) { FieldType::OptionalSubform { subform_type: parse_option_type_generic_type(&field.ty), } } else if is_vec(field) { ...
Rust
0
# -*- coding: utf-8 -*- #!/usr/bin/env python3 class STIXtoMISPError(Exception): def __init__(self, message): super(STIXtoMISPError, self).__init__(message) self.message = message class AttributeFromPatternParsingError(STIXtoMISPError): pass class InvalidSTIXPatternError(STIXtoMISPError): ...
Python
1
# Creates node to send pwm signals using cmd_vel to motor driver microcontroller (motor_pwm.py) #!/usr/bin/env python3 import rclpy from rclpy.node import Node import serial from geometry_msgs.msg import Twist class MotorPWMController(Node): def __init__(self): super().__init__('motor_pwm_controller') ...
Python
1
import discord from discord.ext import commands import asyncio import ib_insync # Initialize IBKR API client ib = ib_insync.IB() # Discord bot configuration bot = commands.Bot(command_prefix='!') # IBKR API connection details host = 'your_ibkr_host' port = 4001 # Port number for IBKR API (adjust if needed) client_i...
Python
1
# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # w...
Python
1
""" HTTP error handling module. This file defines the custom HTTP error handling classes and utility functions that can be used throughout the FastAPI application to standardize error responses. The module provides: - A base HTTPError class that extends FastAPI's HTTPException - Factory functions for creating common ...
Python
1
ани", "rap": "Рапаню", "rar": "Maori; Cook Islands", "roh": "Romansh", "rom": "Цыганский", "ron": "Румынский", "run": "Рунди", "rup": "Romanian; Macedo-", "rus": "Русский", "sad": "Сандаве", "sag": "Санго", "sah": "Якутский", ...
Python
1
from typing import Sequence import numpy as np from numpy.typing import NDArray from giant.ray_tracer.kdtree import KDTree, get_ignore_inds from giant.ray_tracer.shapes.surface import RawSurface from giant.coverage.utilities.project_triangles_latlon import project_triangles_latlon from giant._typing import DOUBLE_A...
Python
1