text string | label_name string | labels int64 |
|---|---|---|
# Copyright (c) OpenMMLab. All rights reserved.
import json
import os
import shutil
from huggingface_hub import snapshot_download
from lmdeploy.turbomind.utils import get_hf_config_content
def export_turbomind_config(model_name: str,
model_path: str,
work_dir:... | Python | 1 |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import pos_order
| Python | 1 |
run("server-write", move |sync| {
let mut write_server = try!(write_server.0.wait());
sync.send(()).unwrap();
while let Ok(buffer) = send_rx.recv() {
let size = buffer.len() as u32;
try!(write_server.write... | Rust | 0 |
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def scale(img, xScale, yScale):
res = cv2.resize(img, None, fx=xScale, fy=yScale, interpolation=cv2.INTER_AREA)
return res
def crop(infile, height, width):
im = Image.open(infile)
imgwidth, imgheight = im.si... | Python | 1 |
InitiatorNodeNameW(initiatornodename: ::windows_sys::core::PWSTR) -> u32;
#[doc = "*Required features: `\"Win32_Storage_IscsiDisc\"`*"]
pub fn GetIScsiSessionListA(buffersize: *mut u32, sessioncount: *mut u32, sessioninfo: *mut ISCSI_SESSION_INFOA) -> u32;
#[doc = "*Required features: `\"Win32_Storage_Iscsi... | Rust | 0 |
-> VhostUserResult<()> {
self.backend
.write()
.unwrap()
.set_config(offset, buf)
.map_err(VhostUserError::ReqHandlerError)
}
}
<reponame>therealyingtong/rage
use rand::{
distributions::{Distribution, Uniform},
thread_rng, RngCore,
};
use secrecy::{Exp... | Rust | 0 |
row number.
/// # Arguments
/// * `col` - Specify the column number. (first column number is 1)
/// * `row` - Specify the row number. (first row number is 1)
/// # Return value
/// *`&mut Cell` - Cell with mutable.
/// # Examples
/// ```
/// let mut book = umya_spreadsheet::new_file();
... | Rust | 0 |
();
self.function
.insert((new_start, None), vec![start1, start2]);
self.function.insert((end1, None), vec![new_end]);
self.function.insert((end2, None), vec![new_end]);
(new_start, new_end)
}
fn add_optional_subgraph(&mut self, (start, end): (usize, usize)) -> (usiz... | Rust | 0 |
p]
fn get_app(&self) -> App<'a> {
self.get_base_app()
.about("List the units collected to a relation")
.arg(Arg::with_name("relation_id")
.help("The relation id to list the connected units for")
.long("relation-id")
.short('r')
... | Rust | 0 |
"\
HTTP/1.1 200 OK\r\n\
Server: test-dst\r\n\
Content-Length: 0\r\n\
\r\n\
"
};
let url = format!("http://{}/{}", redirect.addr(), code);
let dst = format!("http://{}/{}", redirect.addr(), "dst");
let res = ... | Rust | 0 |
# Time: O(n + 26)
# Space: O(26)
# freq table, sliding window, two pointers
class Solution(object):
def maximumLengthSubstring(self, s):
"""
:type s: str
:rtype: int
"""
COUNT = 2
result = 0
cnt = [0]*26
left = invalid_cnt = 0
for right, x in... | Python | 1 |
FirstStartActions(test_machine) == []
# Check if adding multiple (the same) actions to first start actions work.
machine_action_manager.addFirstStartAction(test_machine, "test_action")
machine_action_manager.addFirstStartAction(test_machine, "test_action")
assert machine_action_manager.getFirstStartAct... | Python | 1 |
scale,
adh_break,
crl_one_at,
zero_at,
too_close_dist,
snap_period,
max_on_ram,
rgtp_distrib_defs: rgtp_distribs,
seeds,
int_opts,
randomization,
} = args;
let (num_cells, chem_dist, chem_mag) =
if let ExperimentType::NCell... | Rust | 0 |
r#"
import array
a = array.array("i", [0, 1, 2, 3])
b = array.array("i", [2, 3, 4, 5])
f(a, b)
assert a, array.array("i", [2, 4, 6, 8])
"#
);
}
#[cfg(not(Py_LIMITED_API))]
#[pyfunction]
fn function_with_pyfunction_arg(fun: &PyFunction) -> PyResult<&PyAny> {
fun.call((), None)
}
#[pyfunction]
fn functio... | Rust | 0 |
[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EDREQ_15_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Disable asynchronous DMA request for channel 15."]
#[inline(always)]
pub fn edreq_15_0(self) -> &'a mut W {
self.variant(EDREQ_15_A::E... | Rust | 0 |
integer (possible overflow).",
))
.build()
}
}
impl From<connection_string::Error> for Error {
fn from(err: connection_string::Error) -> Error {
Self::builder(ErrorKind::DatabaseUrlIsInvalid(err.to_string())).build()
}
}
impl From<url::ParseError> for Error {
fn from(e: url::Pa... | Rust | 0 |
rogress_value)
progress.set_value(100)
return pcd_pred
if __name__ == "__main__":
import os
import glob
import laspy
config_file=os.path.join("woodcls_branch_tls_segformer3D_112_4cm(GPU8GB).json")
data_dir="../../data"
pcd_fnames = glob.glob(os.path.join(data_dir, "*.la*"))
model... | Python | 1 |
"""
Constants for plotting routines in the project.
"""
from typing import List, Optional
import numpy as np
STAR_ORDER: List[str] = ['F', 'G', 'K', 'M']
BIN_LABELS: List[str] = ['<1.5', '1.5–3.0', '3.0–6.0', 'Rocky HZ']
TEMP_ZONES: List[str] = ['hot', 'habitable', 'cold']
DISTANCE_LABELS: List[str] = ['< 3', '3 - 5',... | Python | 1 |
'1208198002.0kmuller': '["Objects"]["1150922126.828659a2"]["Objects"]["1157072777.9dxschafe"]["Objects"]["1208198002.0kmuller"]',
'1212679545.39kmuller': '["Objects"]["1150922126.828659a2"]["Objects"]["1212679545.39kmuller"]',
'1212679801.36kmuller': '["Objects"]["1150922126.828659a2"]["Objects"]["121... | Python | 1 |
(insifficient permissions to access the target address space)"),
libc::ESRCH => Error::Connector("process_vm_readv failed: ESRCH (process not found)"),
libc::EINVAL => Error::Connector("process_vm_readv failed: EINVAL (invalid value)"),
_ => Error::Connector("process_vm_readv failed... | Rust | 0 |
flags": ["-c", "--config"],
"default": "benchcomp.yaml",
"type": benchcomp.ConfigFile,
"metavar": "F",
"help": "read configuration from file F (default: %(default)s)",
}, {
"flags": ["-v", "--verbose"],
"action": "store_true",
"help": "enable verbose output",
... | Python | 1 |
import urllib.request
from os import path
from pathlib import Path
from typing import Optional
class Yolov7TestConstants:
YOLOV7_MODEL_URL = "https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt"
YOLOV7_MODEL_PATH = "tests/data/models/yolov7/yolov7.pt"
YOLOV7_TINY_MODEL_URL = "https://gi... | Python | 1 |
from scipy.optimize import linear_sum_assignment
import torch
from torch import nn
def box_cxcyczlwh_to_xyxyxy(x):
'''
将(x,y,z,l,w,h) 变为 (min_x, min_y, min_z, max_x, max_y, max_z)
'''
x_c, y_c, z_c, l, w, h = x.unbind(-1)
b = [
(x_c - 0.5 * l),
(y_c - 0.5 * w),
(z_c - 0.5 ... | Python | 1 |
lee --example register_test -r -k -g -v
// ...
// Reading symbols from register.replay...done.
//
// (gdb) set env KTEST_FILE=klee-last/test000001.ktest
// (gdb) run # for the generated test the program will run to end
// Starting program: /home/pln/rust/trustit/klee-examples/target/debug/examples/register_test.replay
... | Rust | 0 |
//~ WARN: unused import
baz!(pub fn undocumented() {}); //~ WARN: missing documentation for a function
baz2!(pub fn undocumented2() {}); //~ WARN: missing documentation for a function
fn main() {}
<gh_stars>0
//! Contains information about the stop/station for this part of the trip.
use crate::latlng::LatLng;
use se... | Rust | 0 |
import pytest
import torch
from diffusion_for_multi_scale_molecular_dynamics.utils.basis_transformations import \
get_positions_from_coordinates
from diffusion_for_multi_scale_molecular_dynamics.utils.structure_utils import (
compute_distances, compute_distances_in_batch,
get_orthogonal_basis_vectors)
@p... | Python | 1 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from .models import Course
from .models import EnrollmentHistory
# Show the number of enrolled students in the Course admin list view
@admin.register(Course)
class CourseAdmin(a... | Python | 1 |
, &input)?;
let (scheme, mut expr, warnings) = check::check(file, &ast, |path| {
pipeline.process_import(path, |pipeline, file, input| {
generate_impl(pipeline, file, input, optimize_opts)
})
})?;
optimize::optimize(&mut expr, optimize_opts);
let cmds = generate::generate(&ex... | Rust | 0 |
_data_enum_to_protobuf() {
test_model_definition_conversion(
&[Definition(
"SuchDataEnum".into(),
Rust::DataEnum(
vec![DataVariant::from_name_type(
"MuchVariant",
RustType::String(Size::Any, Charset::... | Rust | 0 |
eserialize, PartialEq)]
struct Test {
#[serde(rename = "$value")]
items: Vec<Item>,
}
#[derive(Debug, Deserialize, PartialEq)]
enum Item {
Unit,
Newtype(String),
Tuple(u8, i16),
Struct { name: String, flag: bool },
}
let input = r##"
<tes... | Rust | 0 |
, 128]));
}
#[test]
fn reverse_test() {
assert_eq!(reverse_u16(0b1011010000), 0b0000101101000000)
}
#[test]
fn parse_test() {
let tile = r#"Tile 2311:
..##.#..#.
##..#.....
#...##..#.
####.#...#
##.##.###.
##...#.###
.#.#.#..##
..#....#..
###...#.#.
#.###..###
"#;
asser... | Rust | 0 |
tex_id);
gl::tex_image_2d(GL_TEXTURE_2D, 0, GL_ALPHA as i32, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data);
gl::tex_parameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR as i32);
gl::tex_parameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR as i32);
gl::tex_parameteri(GL_TEXTURE_2D, ... | Rust | 0 |
# TRIPLESINGLE),
# (text.indexOf(self.tripleDoubleRe),
# TRIPLEDOUBLE)):
# if self.previousBlockState() == state:
# if i == -1:
# i = text.length()
# self.setCurrentBlockState(state)
... | Python | 1 |
eprintln!("Cannot have phi nodes on entry block");
},
ValidatorErrorKind::PhiEntriesMismatch(ref expected_preds) => {
eprint!("Phi predecessor mismatch, expected [ ");
for pred in expected_preds.iter().copied() {
eprint!("{} ", pred);
};
... | Rust | 0 |
from rest_framework import serializers
from apps.jobs.models import JobAssessment, Jobs
class JobsListSerializer(serializers.ModelSerializer):
"""
Lightweight serializer for job list operations
"""
class Meta:
model = Jobs
fields = [
"uid",
"title",
... | Python | 1 |
ScenaFlag(0x00C4, 1, 0x621)),
Expr.Return,
),
'loc_5886',
)
Jump('loc_58AB')
def _loc_5886(): pass
label('loc_5886')
If(
(
(Expr.TestScenaFlags, ScenaFlag(0x00C3, 6, 0x61E)),
Expr.Return,
),
'loc_5890',
)
Jump('... | Python | 1 |
"""Test action management operations"""
import pytest
import pytest_asyncio
@pytest.mark.asyncio
async def test_command_lookup(reaper_mcp_client):
"""Test command lookup operations"""
# Look up a known command name
result = await reaper_mcp_client.call_tool(
"named_command_lookup",
{"comman... | Python | 1 |
D::Def).powi(-2),
nd2di(0.039999999999999994, 0.11111111111111112, D::Def)
);
assert_eq2!(
nd2di(-5.0, 3.0, D::Com).powi(-2),
nd2di(0.039999999999999994, f64::INFINITY, D::Trv)
);
assert_eq2!(
nd2di(3.0, 5.0, D::Dac).powi(-3),
nd2di(0.007999999999999998, 0.037037... | Rust | 0 |
e IntoIter = std::vec::IntoIter<Self::Item>;
fn into_iter(self) -> Self::IntoIter {
self.inner.into_iter()
}
}
#[cfg(test)]
mod test {
use super::*;
use pretty_assertions::assert_eq;
#[test]
fn test_parse() {
assert_eq!(
parse("foo.bar = \"baz\";").unwrap(),
... | Rust | 0 |
}
#[test]
fn test_dropout_no_tape_0d() {
let mut rng = StdRng::seed_from_u64(0);
let t: Tensor0D = Tensor0D::new(3.0);
let r = t.dropout(1.0, &mut rng);
assert_eq!(r.data(), &3.0);
}
#[test]
fn test_dropout_1d() {
let mut rng = StdRng::seed_from_u64(3);
... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(100)
def birthDeath(_firstPopulation, _maxPopulation, _nPath , _birthRate, _deathRate):
X0 = _firstPopulation # initial population size
s = np.zeros((_nPath , _maxPopulation))
X = np.zeros((_nPath , _maxPopulation))
X[:,0] = X0
s[:... | Python | 1 |
_list.difference(set(add_face))
if -1 in seed_list:
seed_list.remove(-1)
else:
sink_list = sink_list.union(set(add_face))
seed_list = seed_list.difference(set(a... | Python | 1 |
PDBFile | mol.SDFile | pdbx.CIFBlock):
format = {
pdbx.CIFFile: "cif",
pdb.PDBFile: "pdb",
mol.SDFile: "sdf",
pdbx.CIFBlock: "cif",
}[type(structure)]
buffer = io.StringIO()
if isinstance(structure, pdbx.CIFBlock):
_tmp = pdbx.C... | Python | 1 |
s shape
(num_proposals, 4) when `concat=False`, otherwise just a
single tensor has shape (num_all_proposals, 4).
"""
pos_inds_list = [res.pos_inds for res in sampling_results]
neg_inds_list = [res.neg_inds for res in sampling_results]
pos_bboxes_list =... | Python | 1 |
<PathBuf, PathForIdError> {
match id.algorithm() {
blob_pb::HashAlgorithm::Unknown => Err(PathForIdError::UnknownHashAlgorithm),
blob_pb::HashAlgorithm::Blake3 => {
assert_eq!(id.hash.len(), 32);
let mut hash_hex = [0; 64];
hex::encode_to_slice(&id.hash[..], &mut... | Rust | 0 |
from __future__ import annotations
from pathlib import Path
import yaml
from tools.configs import path_define, options
from tools.configs.options import FontSize, LanguageFileFlavor
class FallbackConfig:
@staticmethod
def load() -> dict[FontSize, list[FallbackConfig]]:
data = yaml.safe_load(path_de... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Calculate mean and std."""
__author__ = 'Chong Guo <armourcy@gmail.com>'
__copyright__ = 'Copyright 2018, Chong Guo'
__license__ = 'MIT'
import os
import numpy as np
from torchvision import datasets, transforms
train_transform = transforms.Compose([transforms.ToTens... | Python | 1 |
::ENOSYS)
}
/// Allows the calling thread to sleep for
/// an interval specified with nanosecond precision
pub async fn sys_nanosleep(&self, req: UserInPtr<TimeSpec>) -> SysResult {
info!("nanosleep: deadline={:?}", req);
let req = req.read()?;
kernel_hal::sleep_until(req.into()... | Rust | 0 |
s = 4i32;
#[doc = "*Required features: 'Win32_Media_KernelStreaming'*"]
pub const KS_VideoControlFlag_Trigger: KS_VideoControlFlags = 8i32;
#[doc = "*Required features: 'Win32_Media_KernelStreaming'*"]
pub const KS_VideoControlFlag_IndependentImagePin: KS_VideoControlFlags = 64i32;
#[doc = "*Required features: 'Win32_M... | Rust | 0 |
type Range = std::ops::Range<usize>;
#[derive(Debug, Fail)]
pub enum ScrubMinidumpError {
#[fail(display = "failed to parse minidump")]
InvalidMinidump(#[cause] MinidumpError),
#[fail(display = "invalid memory address when reading {:?}", _0)]
InvalidAddress(StreamType),
#[fail(display = "failed ... | Rust | 0 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
# As long as the file is opened in binary mode, both Python 2 and Python 3
# can write response body to it without decoding.
with open('out.html', 'wb') as f:
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDA... | Python | 1 |
ll_request_commit.commit_message()) {
if let Some(ticket) = captures.name("ticket") {
title = title + " " + ticket.as_str();
}
}
}
if pull_request.title() == title {
return Err("No title altering commits founds.".into());
... | Rust | 0 |
self) -> &'static str {
IDENT
}
fn param_info(&self) -> ParamInfo {
ParamInfo {
num_required: 2,
num_optional: 0,
param_docs: vec![
make_param_doc("<position_x>", ""),
make_param_doc("<position_y>", ""),
],
... | Rust | 0 |
.strip('\n')
yield str(len(ctx))+'字正在计算'
for response in generate_stream(model,tokenizer, ctx,
max_length=max_length, top_p=top_p, temperature=temperature):
yield response['text']
def sum_values(dict):
total = 0
for value i... | Python | 1 |
def is_even(number):
if number % 2 == 0:
print(f"{number} is even")
else:
print(f"{number} is odd")
for i in range(15, 34):
is_even(i)
for i in range(153, 219):
is_even(i) | Python | 1 |
https://citeseerx.ist.psu.edu/doc_view/pid/1f41c3c2a4880dc49238e46d555f16d28da2940d
if vil.ancestor in v.parent.children:
return vil.ancestor
else:
return default_ancestor
def second_walk(v, m=0, depth=0, min=None):
v.x += m
v.y = depth
if min is None or v.x < min:
min = v... | Python | 1 |
AGE = {};",
serde_json::to_string_pretty(&self.cpu_usage)?
)?;
Ok(())
}
/// Render the table of all units.
fn write_unit_table(&self, f: &mut impl Write) -> CargoResult<()> {
write!(
f,
r#"
<table class="my-table">
<thead>
<tr>
<th></t... | Rust | 0 |
onsensus']
header_line_2 += ['len (bp)']
if verbosity > 2 and bridge_type == 'LongReadBridge':
header_line_1 += ['Consensus', 'Target']
header_line_2 += ['time (s)', 'len (bp)']
if verbosity > 1:
header_line_1 += ['', 'Search', 'Path']
header_line_2 += ['Sea... | Python | 1 |
Option<String>,
cert: TlsPublicKeyCert,
}
impl OpenSslClient {
pub fn builder(node_id: NodeId, server_node_id: NodeId) -> OpenSslClientBuilder {
OpenSslClientBuilder {
node_id,
server_node_id,
msg_expected_from_server: None,
msg_for_server: None,
... | Rust | 0 |
}
impl PartialEq for RegexpInfo {
fn eq(&self, other: &Self) -> bool {
if Rc::ptr_eq(&self.0, &other.0) {
return true;
}
self.as_str() == other.as_str()
}
}
impl std::ops::Deref for RegexpInfo {
type Target = Regex;
fn deref(&self) -> &Regex {
&self.0
}... | Rust | 0 |
dic_info = {
'nome': 'Jeff',
'idade': 30,
'sexo': 'M',
'estado': 'casado',
'profissao': 'autonomo'
}
print(dic_info['nome'])
print(dic_info['sexo'])
print(list(dic_info))
print(dic_info['estado'])
computador = {'CPU': 'Intel', 'RAM': '16gb', 'SSD': '480'}
computador['Pvideo']= 'Gforce'
print(computador)
print... | Python | 1 |
writer
///
/// See [`DifferentialEvent`] for the events logged
///
/// ## Examples
///
/// ```rust
/// use std::{env, net::TcpStream};
///
/// timely::execute_directly(|worker| {
/// // If `TIMELY_WORKER_LOG_ADDR` is set, `ddshow_sink` will
/// // send all events to the address that it's set with
/// if le... | Rust | 0 |
{
// this will prevent any overflow of exponent
if len > (f32::MAX_EXP as usize) / big_digit::BITS {
None
} else {
let exponent = (len - 2) * big_digit::BITS;
// we need 25 significant digits, 24 to be stored and... | Rust | 0 |
from fraude_preventie.datasets import DatasetBase
from fraude_preventie.datasources import DatasetDBSource
from wpi_onderzoekswaardigheid_aanvraag.datasources.azure import (
AzureAPIDatasource,
AzureDatasource,
)
from wpi_onderzoekswaardigheid_aanvraag.preprocessing.clean import WPICleanTransformer
class Soc... | Python | 1 |
: &HashMap<String, PromLabels>, output: &mut String) {
let mut metrics = HashMap::new();
// Iterate over the 'recv' or the 'sent' HashMap by peer name.
for (peer, stats) in peer_stats.$field.iter() {
// Generate labels for this peer.
let mut labels =... | Rust | 0 |
i::GtkCellRendererMode;
fn to_glib(&self) -> ffi::GtkCellRendererMode {
match *self {
CellRendererMode::Inert => ffi::GTK_CELL_RENDERER_MODE_INERT,
CellRendererMode::Activatable => ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE,
CellRendererMode::Editable => ffi::GTK_CELL_RENDE... | Rust | 0 |
#/*
# * EJERCICIO:
# * Explora el concepto de manejo de excepciones según tu lenguaje.
# * Fuerza un error en tu código, captura el error, imprime dicho error
# * y evita que el programa se detenga de manera inesperada.
# * Prueba a dividir "10/0" o acceder a un índice no existente
# * de un listado para intentar provo... | Python | 1 |
@!has - 'comment'
// @has - '# <span class="ident">single'
// @has - '## <span class="ident">double</span>'
// @has - '### <span class="ident">triple</span>'
// @has - '<span class="attribute">#[<span class="ident">outer</span>]</span>'
// @has - '<span class="attribute">#![<span class="ident">inner</span>]</span>'
/... | Rust | 0 |
{
key: NiaKey,
}
impl NiaRemoveModifierRequest {
pub fn new(key: NiaKey) -> NiaRemoveModifierRequest {
NiaRemoveModifierRequest { key }
}
pub fn take_key(&self) -> NiaKey {
self.key
}
}
impl
Serializable<
NiaRemoveModifierRequest,
nia_protocol_rust::RemoveModi... | Rust | 0 |
_ => ("", ""),
}
}
/// Update the command line according to the given event.
pub fn update(&mut self, key: KeyEvent) -> Option<CommandLineSignal> {
match key.code {
KeyCode::Up => self.action_up(),
KeyCode::Down => self.action_down(),
KeyCode:... | Rust | 0 |
_file)) {
error!("Unable to seek to the end of the RecordFile: {}", e.to_string());
return;
}
if let Err(e) = self.rec_file.fd.write(&buff) {
error!("Error writing serialized term map to file: {}", e.to_string());
}
info!("Closed index: {}", self.ind... | Rust | 0 |
/// 4) `StorageNotAvailable2`: If the object2 is stored in a storage area which is
/// currently inaccessible.
///
/// # Panics
///
/// 1) If operation is not a valid opened object.
/// 2) If object1 and object2 are not both null and object1 or object2 or both are not a valid key object.... | Rust | 0 |
/// Works the same as `vec!` except that values may be of any type that can be
/// converted into the item type via an implementation of `Into`.
///
/// The type of the item must be known at compile time, and usually this means an
/// explicit type annotation is required.
///
/// # Usage
///
/// ```rust
/// use velcr... | Rust | 0 |
import numpy as np
import pandas as pd
from typing import Dict, List, Tuple, Union
from sfaira.versions.metadata import OntologyCl, OntologyList, OntologyUberon
TARGET_UNIVERSE_KEY_NAME = "name"
TARGET_UNIVERSE_KEY_ID = "id"
class CelltypeUniverse:
"""
Cell type universe (list) and ontology (hierarchy) cont... | Python | 1 |
# Copyright (c) 2021-2022, InterDigital Communications, Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistributions of source cod... | Python | 1 |
ls)
job_skills = extract_skills(job_description, common_skills)
matched_skills = list(set(resume_skills) & set(job_skills))
missing_skills = list(set(job_skills) - set(resume_skills))
# Display skills
st.subheader("💡 ... | Python | 1 |
!= 0);
assert!(path.as_ref().unwrap().len() != 1);
assert!(path.as_ref().unwrap().len() == 2);
for curve in path.as_ref().unwrap()[0].to_curves::<Curve<Coord2>>() {
for t in 0..100 {
let t = (t as f64)/100.0;
let distance = circle_center.distance_to(&curve.point... | Rust | 0 |
VU",
/// `U.RAVU`:
U_RAVU, "U.RAVU",
/// `U.RDGU`:
U_RDGU, "U.RDGU",
/// `U.RDSU`:
U_RDSU, "U.RDSU",
/// `U.RFSU`:
U_RFSU, "U.RFSU",
/// `U.RFU`:
U_RFU, "U.RFU",
/// `U.RISU`:
U_RISU, "U.RISU",
/// `U.RMPU`:
U_RMPU, "U.RMPU",
/// `U.RNGU`:
U_RNGU, ... | Rust | 0 |
st
.get_class_from_type::<f64>()
.unwrap()
.cast_to_instance(f),
Value::List(v) => host
.get_class_from_type::<Vec<Term>>()
.unwrap()
.cast_to_instance(v),
Value::String(s) => host
.ge... | Rust | 0 |
from os import getcwd
import json
import pickle
from starknet_py.net.signer.stark_curve_signer import KeyPair
SETTINGS_PATH = (getcwd() + "/data/").replace("\\", "/")
KEY = "CEy426oSSaOTWDPgtuKxm1nS2uWN_4-L_eyt0dmAr40="
def json_remove_comments(invalid_json: str):
comment_start = -1
for char in range(len(i... | Python | 1 |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# author:MDSEC
# from:https://github.com/MD-SEC/MDPOCS
# product="小猪CMS"
import sys
import requests
import csv
import urllib3
import hashlib
from concurrent.futures import ThreadPoolExecutor
if len(sys.argv) != 2:
print(
'+-----------------------------------------... | Python | 1 |
alues[i][0] - actual_values[i-1][0] if len(actual_values[i]) > 0 else 0.0
value_delta_y = actual_values[i][1] - actual_values[i-1][1] if len(actual_values[i]) > 1 else 0.0
deltas_x.append(value_delta_x)
deltas_y.append(value_delta_y)
time_... | Python | 1 |
1),
19 => self.transformed(16).flipped(0).flipped(1).flipped(2),
20 => self.transformed(16).flipped(0).flipped(2),
21 => self.transformed(16).flipped(1),
22 => self.transformed(16).flipped(1).flipped(2),
23 => self.transformed(16).flipped(2),
24 =>... | Rust | 0 |
0x000C,
(
'#0490041116V#661F嗯,那么各位。\n',
'我们这就告辞了。',
TxtCtl.Enter,
TxtCtl.Clear,
'#0490041117V要是刚才那些人再来找麻烦,\n',
'尽管来通知我就行了。',
TxtCtl.Enter,
TxtCtl.Clear,
'#0490041118V就让我这个卢安市长\n',
'好好地履... | Python | 1 |
<field name="NUMBER_OF_IMAGE_ROWS" value="64" />
<field name="NUMBER_OF_CODES_PER_ROW" value="64" />
<field name="IMAGE_CODE_BIT_LENGTH" value="12" />
</content>
</group>"""
in md
)
###############################################################################
def test... | Python | 1 |
size, layer_filter_sizes, layer_strides, layer_paddings, prototype_kernel_size):
assert (len(layer_filter_sizes) == len(layer_strides))
assert (len(layer_filter_sizes) == len(layer_paddings))
rf_info = [img_size, 1, 1, 0.5]
for i in range(len(layer_filter_sizes)):
filter_size = layer_filter_si... | Python | 1 |
.
//! for event in input_sequence {
//! // An event contains a timestamp and an atom.
//! let (timestamp, atom): (i64, &UnidentifiedAtom) = event;
//! // If the read atom is a 32-bit integer...
//! if let Ok(integer) = atom.read(urids.atom.int) {
//! // Multiply it by two... | Rust | 0 |
ypes, B2NCollisionToolsPanel.bl_idname):
return
bpy.utils.register_class(CollisionToolsData)
bpy.utils.register_class(B2NCollisionToolsPanel)
bpy.utils.register_class(B2NApplyCollisionToAllSelected)
bpy.utils.register_class(B2NJoinCollisionObjects)
bpy.utils.register_class(B2NSelectEmptyColl... | Python | 1 |
from aalpy.base import Oracle, SUL
class ProvidedSequencesOracleWrapper(Oracle):
def __init__(self, alphabet: list, sul: SUL, oracle: Oracle, provided_counterexamples: list):
"""
Oracle wrapper which first executes provided sequences (possible counterexamples) and then switches to another
... | Python | 1 |
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Serialize, Deserialize, Debug, Hash, PartialEq, Eq)]
pub enum Category {
#[serde(rename = "XXX (18+)")]
Xxx,
#[serde(rename = "Movies/XVID")]
MoviesXvid,
#[serde(rename = "Movies/XVID/720")]
MoviesXvid720,
#[serde(rename = "Movies/... | Rust | 0 |
result.push(' ');
}
result.push_str(WORDS[*w as usize]);
}
result
}
// rs1024 checksum calculator
fn checksum(values: &[u16]) -> u32 {
const GEN: [u32; 10] = [
0xE0E040, 0x1C1C080, 0x3838100, 0x7070200, 0xE0E0009, 0x1C0C2412, 0x38086C24,... | Rust | 0 |
from trackit.core.runtime.build_context import BuildContext
from trackit.core.runtime.context.task import TaskContext
from trackit.data.context import DataContext
from trackit.miscellanies.printing import print_centered_text
from typing import Mapping
def build_runner(runner_name: str,
runner_config:... | Python | 1 |
&` chaining doesn't work as expected, etc.)
// This will work on both Unix and Windows (and so theoretically any other weird OSes that make any sense at all)
Ok(match exit_status.code() {
Some(exit_code) => exit_code, // If we have an exit code, use it
None if exit_status.s... | Rust | 0 |
usize> {
input.lines().filter_map(|x| x.parse().ok()).collect()
}
pub fn part1(input: &str) -> usize {
let nums = parse(input);
for &x in nums.iter() {
let y = 2020 - x;
if nums.contains(&y) {
return x * y;
}
}
unreachable!()
}
pub fn part2(input: &str) -> usi... | Rust | 0 |
// at least one of which must have been a multiple of j.
r = r * (NeighCount::from(n) - i) / (i + 1);
}
r
}
fn bit_width(n: usize) -> usize {
let mut w = 0;
let mut n = n;
while n > 0 {
w += 1;
n >>= 1;
}
w
}
fn active(s: &str) -> Vec<(usize, usize)> {
... | Rust | 0 |
f, String) {
use std::fmt::Write;
let mut sl = String::with_capacity(4 * 1024);
let mut spans = Vec::with_capacity(krates.len());
for krate in krates.krates().map(|kn| &kn.krate) {
let span_start = sl.len();
match &krate.source {
Some(src) => writ... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
e(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
self.w
}
}
#[doc = "Fiel... | Rust | 0 |
&self,
specifier: &ModuleSpecifier,
emit_options: &ast::EmitOptions,
bundle_type: &BundleType,
) -> Result<(String, Option<String>), AnyError> {
let cm = Rc::new(swc_common::SourceMap::new(
swc_common::FilePathMapping::empty(),
));
let globals = swc_common::Globals::new();
let l... | Rust | 0 |
)
# Get roles from access token
token_roles = self.keycloak.roles_from_token(token)
if token_roles is None:
return JsonResponse(
{'detail': 'This token has no client_id roles and no realm roles or client_id is not configured '
'correctly.... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.