input
stringlengths
2.65k
237k
output
stringclasses
1 value
downsize_storm_images( storm_image_matrix=storm_image_matrix, radar_field_name=radar_field_name, num_rows_to_keep=num_rows_to_keep, num_columns_to_keep=num_columns_to_keep) return { STORM_IMAGE_MATRIX_KEY: storm_image_matrix, FULL_IDS_KEY: full_id_strings, VALID_TIMES_KEY: valid_times_unix_sec, RADAR_FIELD_NAM...
#!/usr/bin/env python3 import numpy as np import logging import os.path import time import math # logger setup logger = logging.getLogger(__name__) ##### USER DEFINED GENERAL SETTINGS ##### #set new name for each experiment, otherwise files will be overwritten EXP_NAME = 'cas9pace_20210217_darwin_expt' EVOLVER_IP =...
-0.08 0.36 0.74 0.05 2 2.20e+05 -30.91 | 2 2.20e+05 -30.91 | -30.91 1.7 1600 0 | -0.11 0.23 0.60 0.04 2 2.48e+05 -30.91 | -59.86 16.5 1600 0 | -0.04 0.17 0.45 0.03 2 2.73e+05 -30.91 | -66.04 29.2 713 724 | -0.03 0.12 -0.53 0.03 2 2.97e+05 -30.91 | -90.05 35.6 783 485 | -0.10 0.16 -1.07 0.03 2 3.22e+05 -30.91 | -38.24 4...
"""A representation of the configuration form we expect to receive from EpiViz. The hope is that this form will do as much validation and precondition checking as is feasible within the constraint that it must be able to validate a full EpiViz parameter document in significantly less than one second. This is because it...
+ "To be overriden by derived class method") class UKNA_BSEN1991_2_crowd(SteadyStateCrowdLoading): """ Class to implement steady state crowd loading analysis to UK NA to BS EN1991-2 """ def __init__(self, bridgeClass:str=None, crowd_density:float=None, load_direction='vertical', **kwargs): """ Initi...
# MantaFlow fluid solver framework # Copyright 2011 <NAME>, <NAME> # # @author: <NAME> http://marielenaeckert.com/ # # # Reconstruction of both density and velocity volume based on input images # # 0. make sure not to use more than ~4 threads (export OMP_NUM_THREADS=4) # 1. adapt variable path, pathCalib, and captureF...
occluded tracks from the unmatched confirmed tracks # if you used default matching above, (because we merged both into one for default # matching) if default_matching: newly_occluded_tracks = [i for i in newly_occluded_tracks if i in unmatched_tracks] unmatched_tracks = [i for i in unmatched_tracks if i not in new...
EnumInfo('hourglass', 8, 0) e_4055[9] = EnumInfo('icon', 9, 0) e_4055[10] = EnumInfo('size', 10, 0) e_4055[11] = EnumInfo('nopointer', 11, 0) e_4055[12] = EnumInfo('appstarting', 12, 0) e_4055[13] = EnumInfo('help', 13, 0) e_4055[14] = EnumInfo('hyperlink', 14, 0) enum_main[0x4055] = e_4055 e_4056 = dict() e_4056[1] =...
from database.imports import * from database.models.base import Base #some global variables that are used here and there that would be magic otherwise _plusMinus='\u00B1' #FIXME MASSIVELY BROKEN class HasMirrors: #FIXME this should validate that they actually *are* mirrors? @declared_attr def mirrors_from_here(cls)...
<gh_stars>1-10 from BWSDefinitions import * LanguageUsed = 1 # 0 is japanese, 1 is translation patch, globals are bad I know def SetLanguageUsed(v): global LanguageUsed LanguageUsed = v class UnknownAttributeError(Exception): pass class UnknownCommandError(Exception): pass class UnknownItemError(Exception...
""" DynaMake module. """ # pylint: disable=too-many-lines,redefined-builtin,unspecified-encoding import argparse import asyncio import logging import os import re import shlex import shutil import sys import warnings from argparse import ArgumentParser from argparse import Namespace from contextlib import asynccontex...
if (@{{x}}['indexOf']("'") == -1) return "'" + @{{x}}+ "'"; if (@{{x}}['indexOf']('"') == -1) return '"' + @{{x}}+ '"'; var s = @{{x}}['$$replace'](new RegExp('"', "g"), '\\\\"'); return '"' + s + '"'; } """) if hasattr(x, '__repr__'): if callable(x): return x.__repr__(x) return x.__repr__() JS(""" if (t =...
<reponame>huaweicloud/huaweicloud-sdk-python-v3 # coding: utf-8 import re import six from huaweicloudsdkcore.sdk_response import SdkResponse from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ShowRecordSetWithLineResponse(SdkResponse): """ Attributes: openapi_types (dict): The ke...
<reponame>kanepenley/OCS-Samples # program.py # Copyright 2019 OSIsoft, 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 require...
<reponame>tchin-divergent/tacs<gh_stars>0 import numpy as np from tacs import TACS import unittest from mpi4py import MPI ''' This is a base class for static problem unit test cases. This base class will test function evaluations and total and partial sensitivities for the user-specified problem that inherits from i...
import numpy as np import pytest import pygeos from pygeos import Geometry, GEOSException from pygeos.testing import assert_geometries_equal from .common import ( all_types, empty, empty_line_string, empty_point, empty_polygon, line_string, multi_point, point, point_z, ) CONSTRUCTIVE_NO_ARGS = ( pygeos.bou...
import copy import random from dataclasses import dataclass, replace from typing import Iterable, List, Optional, Tuple, TypeVar, Union from bs4 import BeautifulSoup from bs4.element import Tag from leginorma import ArticleStatus, LegifranceArticle, LegifranceSection, LegifranceText from envinorma.io.parse_html impor...
between "'s" if "'" in string: # Split on possessive 's dispos = [] prev = 0 for match in self.possessive.finditer(string): dispos.append((prev, match.start())) prev = match.end() if prev < len(string): dispos.append((prev, len(string))) else: # Shortcut if there's no apostrophe in the string dispos = ((0, ...
: list list of Obs, e.g. [obs1, obs2, obs3]. all_configs : bool if True, the reweighted observables are normalized by the average of the reweighting factor on all configurations in weight.idl and not on the configurations in obs[i].idl. """ result = [] for i in range(len(obs)): if len(obs[i].cov_names): raise...
[0] + [item[2] for item in query_result] + [1], ) auc = 0 for i in range(len(recall) - 1): if recall[i + 1] - recall[i] != 0.0: a = (precision[i + 1] - precision[i]) / (recall[i + 1] - recall[i]) b = precision[i + 1] - a * recall[i + 1] auc = ( auc + a * (recall[i + 1] * recall[i + 1] - recall[i] * recall[i]) ...
# !/usr/bin/env python3 # -*-coding:utf-8-*- # @file: bilateral_filter_np.py # @brief: # @author: <NAME>, <EMAIL>, <EMAIL> # @version: 0.0.1 # @creation date: 26-01-2020 # @last modified: Sun 26 Jan 2020 03:06:15 AM EST # > see: http://jamesgregson.ca/bilateral-filtering-in-python.html import numpy as np import src.pf...
opiate opiates opine opined opines opining opportunism opportunistic oppressively opprobrious opprobrium optically optimistically optometry opulence oracular orally orangeade orangeades orate orated orates orating oratorical oratorio oratorios orb orbs orderings orderliness ordinal ordinals ordinariness ordnance ordure...
#!/usr/bin/env python """ Isosurface rendering results in black image and warning OSPRAY STATUS: ospray::Isosurfaces deprecated parameter use. Isosurfaces will begin taking an OSPVolume directly, with appearance set through the GeometricModel instead. OSPRAY STATUS: ospray::Isosurfaces created: #primitives=1 Even th...
": " + str(reaction.check_mass_balance())) #h_HAOe <-> h_HAOc reaction = Reaction('HAO_H_import') reaction.name = 'H+ import' reaction.subsystem = 'Transport' reaction.lower_bound = 0. # This is the default reaction.upper_bound = 1000. # This is the default reaction.add_metabolites({h_HAOe: -1.0, h_HAOc: 1.0...
<filename>tofu/mag/equimap.py # -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Also if needed: retab ''' EQUIMAP tools module, functions ... ''' # Standard python modules from __future__ import (unicode_literals, absolute_import, \ print_function, division) import numpy as np import os ...
return AutomaticallyRetrievedGraph( "APO", version, "kgobo", directed, preprocess, load_nodes, load_node_types, load_edge_weights, auto_enable_tradeoffs, sort_tmp_dir, verbose, cache, cache_path, cache_sys_var, kwargs )() def CLO( directed = False, preprocess = "auto", load_nodes = True, load_node_types = True, ...
hard_label_fc.size(0) selected_num = int(percent * num_unl) if self.args.filter_type == 'fc': scores_for_prediction = soft_label_uniform_fc scores, hard_label_prediction = torch.max(scores_for_prediction, dim=1) elif self.args.filter_type == 'cluster': scores_for_prediction = soft_label_uniform_kmean scores, har...
# Copyright 2014 PerfKitBenchmarker 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...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
has no container {cont_config.name}" for resource in Resource.values(): current_state = None container_requirements = container.get_resource_requirements(resource) get_requirements = getattr(cont_config, resource).get for requirement in get_requirements: current_state = container_requirements.get(requirement) i...
# # Copyright 2018 Analytics Zoo Authors. # # 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 agreed to in ...
is not None: ms.set("show", "yes" if new_show else "no") def del_manuscript(self, version_title, abbrev): ms = self._book._get("manuscripts/ms", {"abbrev": abbrev}, self._book._get("version", {"title": version_title})) # ms = self._get("version", {"title": version_title}).xpath("manuscripts/ms[@abbrev='{}'".format...
# -*- coding: iso-8859-1 -*- """ MoinMoin - "text/plain" Formatter @copyright: 2000-2002 <NAME> <<EMAIL>> 2007 by <NAME> <<EMAIL>> @license: GNU GPL, see COPYING for details. """ from MoinMoin.formatter import FormatterBase class Formatter(FormatterBase): """ Send plain text data. """ hardspace = u' ' de...
<reponame>zimolzak/wav-in-python import numpy as np import matplotlib.pyplot as plt import wave # so we can refer to its classes in type hint annotations from scipy import signal from typing import Generator import collections from printing import pretty_hex_string, ints2dots def bytes2int_list(byte_list: bytes) -> ...
<gh_stars>10-100 #! usr/bin/python3.6 """ Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-07-06 14:02:20.222384 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions w...
<reponame>shubav/sonic-mgmt import re from spytest.utils import filter_and_select from spytest import st, utils import apis.system.port as port1 from apis.system.rest import get_rest,delete_rest,config_rest from utilities.utils import get_interface_number_from_name def config_bgp_evpn(dut, **kwargs): """ Author: ...
with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) data = json.dumps({"bid_until": "2999-12-24 23:45:10"}) self.app.put('/product/' + str(self.product_id) + "/bidup", data=data, content_type='application/json') data = json.dumps({"bid": "999.99"}) r_json = self.app.pos...
from enum import IntEnum from typing import Callable, Dict, List, Iterable from spherov2.commands.animatronic import R2LegActions, Animatronic from spherov2.commands.api_and_shell import ApiAndShell from spherov2.commands.core import IntervalOptions, Core from spherov2.commands.io import AudioPlaybackModes, IO from sp...
# @Created Date: 2019-12-08 06:46:49 pm # @Filename: api.py # @Email: <EMAIL> # @Author: <NAME> # @Last Modified: 2020-02-16 10:54:32 am # @Copyright (c) 2020 MinghuiGroup, Soochow University from typing import Iterable, Iterator, Optional, Union, Generator, Dict, List from time import perf_counter from numpy import na...
#!/usr/bin/env python3 """Classes and functions to insert cache file data into the database.""" # Standard libraries import os import time import shutil from collections import defaultdict from multiprocessing import Pool import re import pymysql # PIP libraries from sqlalchemy import and_ # Infoset libraries from i...
read_only: Optional[bool] = None, ): self.chapAuthDiscovery = chap_auth_discovery self.chapAuthSession = chap_auth_session self.fsType = fs_type self.initiatorName = initiator_name self.iqn = iqn self.lun = lun self.portals = portals self.secretRef = secret_ref self.targetPortal = target_portal self.iscsiInt...
0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.175148, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic':...
import unittest import pytest _marker = object() class _KeywordIndexTestsBase: def _getTargetClass(self): from . import KeywordIndex return KeywordIndex def _populate(self, index): index.index_doc(1, ("zope", "CMF", "Zope3")) index.index_doc(2, ("the", "quick", "brown", "FOX")) index.index_doc(3, ("Zope",)...
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.shortcuts import render, get_object_or_404, redirect from django.template.loader import render_to_string from django.http.response import HttpResponse from django.contrib import messages from .forms import CourseCreate from djang...
= random.randint(0, 9) if roll > self.defenseRating: self.sink() def isDamaged(self): return self.damage > 0 def isSunk(self): return self.damage == -1 def sink(self): self.damage = -1 if globals.verbose_combat: print('Sub ' + str(self.name) + 'sinks') def retreat(self): self...
is None else f'"{failing_module}" [color=red];' template = f"""\ digraph G {{ rankdir = LR; node [shape=box]; {failing} {edges} }} """ arg = quote(template, safe="") return f"https://dreampuf.github.io/GraphvizOnline/#{arg}" def _get_source_of_module(self, module: types.ModuleType) -> str: filename = getattr(modu...
ATOM LIST", atom_list c = float(len(atom_list)) for a in atom_list: if type(a) == type("a"): a = atomCoord(a) avg[0] += a[0] avg[1] += a[1] avg[2] += a[2] return array([ avg[0]/c, avg[1]/c, avg[2]/c ], 'f') def clusterAtoms(atoms, tol=2.0): """ atoms [x,y,x,z,y,z,x, ...] => [ [x,x,x], [y,y], [ z,z,z,z,z,z,z...
import unittest2 as unittest from nose.plugins.attrib import attr from mock import MagicMock, patch, mock_open, call import os from lxml import etree import sys import json from ncclient.manager import Manager, make_device_handler from ncclient.transport import SSHSession import ncclient.transport.errors as NcErrors f...
<reponame>Jaye-yi/MPoL # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.10.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + nbsphinx="hidden" # %matplotlib inline # + nbs...
"""Driver class A Driver provides an interface to an Entity and its Attributes. """ import re import itertools import logging import clusto from clusto.schema import * from clusto.exceptions import * from clusto.drivers.base.clustodriver import * class Driver(object): """Base Driver. The Driver class provides ...
<reponame>oliverwatts/snickery #!/usr/bin/env python # -*- coding: utf-8 -*- ## Project: ## Author: <NAME> - <EMAIL> import sys import os import glob from argparse import ArgumentParser import h5py import numpy as np from const import target_rep_widths from speech_manip import get_speech from util import safe_ma...
makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.datacenters_post(datacenter, async_req=True) >>> result = thread.get() :param datacenter: Datacenter to be created (required) :type datacenter: Datacenter :param pretty: Controls whethe...
may be obtained by inspecting the return value's `value` attribute. Simple increment:: rv = cb.counter("key") rv.value # 42 Increment by 10:: rv = cb.counter("key", delta=10) Decrement by 5:: rv = cb.counter("key", delta=-5) Increment by 20, set initial value to 5 if it does not exist:: rv = cb.count...
""" True if paramstyle is "numeric". This paramstyle is trickier than all the others. """ insert_single_values_expr = None """When an INSERT is compiled with a single set of parameters inside a VALUES expression, the string is assigned here, where it can be used for insert batching schemes to rewrite the VALUE...
<reponame>JoanAzpeitia/lp_sg # Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you in...
<reponame>gmweir/QuasiOptics # -*- coding: utf-8 -*- """ Created on Thu Nov 11 17:01:28 2021 @author: gawe Functions dealing with rectangular patch antenna. """ import math import numpy as np from math import cos, sin, sqrt, pi, log10, atan2, acos, radians from scipy import integrate import scipy.integrate import j...
# -*- coding: UTF-8 -*- from __future__ import unicode_literals from collections import OrderedDict from string import ascii_uppercase from .. import Provider as AddressProvider class Provider(AddressProvider): """ Provider for addresses for en_PH locale Like many things in the Philippines, even addresses are m...
config = self.GetMethodConfig('SetAccelerator') return self._RunMethod( config, request, global_params=global_params) SetAccelerator.method_config = lambda: base_api.ApiMethodInfo( flat_path='v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:setAccelerator', http_method='PATCH', method_id=...
p.x = 42 assert p.x == 42 assert typeof(p.y) is BArray assert len(p.y) == 0 assert p.y == cast(BIntP, p) + 1 # p = newp(new_pointer_type(BStruct), [100]) assert p.x == 100 assert len(p.y) == 0 # # Tests for # ffi.new("struct_with_var_array *", [field.., [the_array_items..]]) # ffi.new("struct_with_var_array...
<reponame>CavallucciMartina/wav2vec2-sprint from audiomentations import ( Compose, AddGaussianNoise, AddGaussianSNR, ClippingDistortion, FrequencyMask, Gain, LoudnessNormalization, Normalize, PitchShift, PolarityInversion, Shift, TimeMask, TimeStretch, ) import time import torchaudio from torch import nn i...
# # # Copyright (C) University of Melbourne 2012 # # # #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 without limitation the rights #to use, copy, modify...
'83271005', '83412009', '83707009', '83774001', '83883001', '8414002', '84194006', '84224006', '84233008', '84261000119106', '84414000', '84490005', '84681008', '84724007', '84753008', '84889008', '85051008', '8519009', '85224001', '8549006', '85495007', '8555001', '85857008', '85884009', '85904...
<filename>Dataset_Management.py import torch import numpy as np class Artificial_DataLoader: def __init__(self, world_size, rank, device, File, sampling_rate, number_of_concentrations, number_of_durations, number_of_diameters, window, length, batch_size, max_num_of_pulses_in_a_wind=75): assert window < length sel...
first verifies all self-certificates and then only considers successfully verified ones, hence we cannot modify the certificate data, before passing it to _assign_certified_key_info IMO the best solution is a better separation of concerns, e.g. separate self-certificate verification and packet prioritization. ""...
[], 'targets': target_list, 'tests': test_list, } return build_yaml_like def _extract_cc_tests(bazel_rules: BuildDict) -> List[str]: """Gets list of cc_test tests from bazel rules""" result = [] for bazel_rule in list(bazel_rules.values()): if bazel_rule['class'] == 'cc_test': test_name = bazel_rule['name'] ...
#!/usr/bin/env python # -*- coding: utf-8 -*- #2020.0610 # Upgraded tests to v2; set up tests against AOP which seems to be discontinued and thus constant import unittest import requests from unitTestConfig import base_plus_endpoint_encoded, headers, get_headers_not_logged_in # Get session, but not logged in. headers...
#!/usr/bin/python3 from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.views.decorators.csrf import csrf_exempt from .models import Museo, Usuario, Comentario, Pagina_Personal from lxml import etree from django.template.loader import get_template from django.templa...
model, or idf==None (happens when the word is not in the model). idf = self.model.idf(word) idf = idf is None and 1 or idf return self.tf(word) * idf return self.tf(word) tf_idf = tfidf = term_frequency_inverse_document_frequency def information_gain(self, word): """ Returns the information gain for the give...
in comp2): print "input1 = ",comp1 print "input2 = ",comp2 raise Exception("Problem with one input having a . & one not") if type(comp1)==str and '.' not in comp1: #it's a dir if not os.path.isdir(comp1) or not os.path.isdir(comp2): print "input1 = ",comp1 print "input2 = ",comp2 raise Exception("Thes...
to string representation. Returns ------- np.ma Masked array of LULC strings """ return base.convert_lulc_id_to_class( self.lulc_matrix_original, mapping=self.original_lulc_mapping ) def _assign_property_rights(self): arr = self.block_definition_matrix_pixel_lvl.copy() for k, v in dicts.stakeholder_propert...
*, code: Optional[ErrorCode] = None) -> None: self.note_func(msg, ctx, code=code) @contextmanager def tvar_scope_frame(self) -> Iterator[None]: old_scope = self.tvar_scope self.tvar_scope = self.tvar_scope.method_frame() yield self.tvar_scope = old_scope def infer_type_variables(self, type: CallableType) -> ...
3.88') mel.eval('setAttr "lShldr.rotateZ" 7.05') mel.eval('setAttr "rShldr.rotateX" 0.54') mel.eval('setAttr "rShldr.rotateY" -3.88') mel.eval('setAttr "rShldr.rotateZ" -7.05') mel.eval('setAttr "lForeArm.rotateX" -0.26') mel.eval('setAttr "lForeArm.rotateY" 9.49') mel.eval('setAttr "lForeArm.rotateZ" -0.13') ...
<reponame>louisleroy5/archetypal<filename>archetypal/template/opaque_material.py ################################################################################ # Module: archetypal.template # Description: # License: MIT, see full license in LICENSE.txt # Web: https://github.com/samuelduchesne/archetypal #############...
<gh_stars>0 # Copyright 2019 <NAME> <<EMAIL>>. # # 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 agreed t...
#!/usr/bin/python3 # # Copyright 2010 Google Inc. # # 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 agree...
<gh_stars>0 # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: steammessages_clientserver.proto # plugin: python-betterproto from dataclasses import dataclass from typing import List import betterproto from .steammessages_base import CMsgAuthTicket, CMsgIpAddress class EmmsLobbyStatus(betterproto...
255), 'gray38': (97, 97, 97, 255), 'darkorange4': (139, 69, 0, 255), 'mintcream': (245, 255, 250, 255), 'darkorange1': (255, 127, 0, 255), 'antiquewhite': (250, 235, 215, 255), 'darkorange2': (238, 118, 0, 255), 'grey18': (46, 46, 46, 255), 'grey19': (48, 48, 48, 255), 'grey38': (97, 97, 97, 255), 'moccasin':...
""" This module pre-processes the CE-CT acquisitions and associated segmentations and generates a DataFrame tracking the file paths of the pre-processed items, stored as NumPy ndarrays. This module is to be run from the top-level data-processing directory using the -m flag as follows: Usage: $ python3 -m luna.prepr...
<gh_stars>10-100 # Copyright (c) 2014-2019 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and/or associated documentation files (the "Materials"), # to deal in the Materials without restriction, including without limitation # the rights to use,...
from deepmechanics.cell import QuadCell from deepmechanics.utilities import make_array_unique, tensorize_1d, tensorize_2d class Grid: def __init__(self, spatial_dimensions): self.spatial_dimensions = spatial_dimensions self.base_cells = [] self._leaf_cells = [] self._active_leaf_cells = [] self._refinement_str...
<reponame>jihwanlee-alphago/aqt # Copyright 2022 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 la...
<reponame>Skar0/generalizedparity import copy from antichain import Antichain from graph import Graph import operations from collections import deque, defaultdict from attractors import init_out, attractor DEBUG_PRINT = False # TODO careful of aliases on the values in the lists, changing one somewhere might change ...
print('no dot found') continue gloss = Gloss.objects.select_related().get(pk=pk) # This is no longer allowed. The column is skipped. # Updating the lemma idgloss is a special procedure, not only because it has relations to other parts of # the database, but also because it only can be evaluated after reviewing a...
dtype, k): rng = jtu.rand_default(self.rng()) np_fun = lambda arr, k: np.triu_indices_from(arr, k=k) jnp_fun = lambda arr, k: jnp.triu_indices_from(arr, k=k) args_maker = lambda: [rng(shape, dtype), k] self._CheckAgainstNumpy(np_fun, jnp_fun, args_maker) @parameterized.named_parameters(jtu.cases_from_list( {"te...
name in svm_metrics: exec('{}_cv_train = np.mean({}_cv_train)'.format(name, name)) exec('mean{}_shuffle_train.append({}_cv_train)'.format(name, name)) exec('{}_cv_test = np.mean({}_cv_test)'.format(name, name)) exec('mean{}_shuffle_test.append({}_cv_test)'.format(name, name)) # 计算所有shuffle的平均值作为该参数组合下的最终结果 for n...
<reponame>ColeWeinstein/cs257 ''' olympics.py A command line program used to query data from the related olympics database. Code by <NAME>, 21 October 2021 Credits: <NAME> - psycopg2-sample.py For use in the "olympics" assignment from Carleton's CS 257 Software Design class, Fall 2021. ''' import ar...
<gh_stars>0 # Chess by <NAME> WHITE = 'white' BLACK = 'black' import random class Chess: def __init__(self): self.turn = WHITE self.board = {} self.initialize_board() self.all_moves = [] self.promotion_required = False self.promotion_pos = (-1,-1) def initialize_board(self): for i in range(8): s...
isinstance(idx, tuple) else idx for elem_idx, elem in enumerate(idx): # boolean arrays in tuple (cross-indices) must be 1-Dimensional if elem is not None and elem.dtype.kind == 'b' and \ elem.size != self.shape[elem_idx]: raise IndexError( "boolean index array for axis {:} must have " "size {:}.".format(elem_id...
from problog.program import PrologString, PrologFile, LogicProgram from problog.logic import Term, Constant, Clause, AnnotatedDisjunction, Not from problog.engine import ClauseDB, DefaultEngine from problog.tasks.sample import sample import random import re def create_observations(processed_model_filename, n=2): ""...
legend_loc='best', **kwargs): """Plot HOLE profiles :math:`R(\zeta)` in a 1D graph. Lines are colored according to the specified ``color`` or drawn from the color map ``cmap``. One line is plotted for each trajectory frame. Parameters ---------- frames: array-like, optional Frames to plot. If ``None``, plots ...
import os import unittest import vtk, qt, ctk, slicer from slicer.ScriptedLoadableModule import * import logging import fnmatch import numpy as np import random import math import re import csv # # PseudoLMGenerator # class PseudoLMGenerator(ScriptedLoadableModule): """Uses ScriptedLoadableModule base class, availab...
= hour date_str['ppp_tttt'] = ppp_tttt return date_str #%% def create_nc_grid_files_on_native_grid_from_mds(grid_input_dir, grid_output_dir, coordinate_metadata = dict(), geometry_metadata = dict(), global_metadata = dict(), cell_bounds = None, file_basename='ECCO-GRID', title='llc grid geometry', mds_data...
#!/usr/bin/env python """ A component of a findNeighbour4 server which provides relatedness information for bacterial genomes. It does so using PCA, and supports PCA based cluster generation. he associated classes compute a variation model for samples in a findNeighbour4 server. Computation uses data in MongoDb, and ...
# Do NOT edit this file! # It was generated by IdlC class idl.json.python.ProxyAsnVisitor. # # Section generated from "/home/nb/builds/MEGA/px2-3.0.0-3.0.9-branch-20140613-none-release-none-pdu-raritan/fwcomponents/mkdist/tmp/px2_final/libidl_client/topofw/peripheral/idl/PeripheralDeviceSlot.idl" # import raritan.rpc...
# turingmachine.py - implementation of the Turing machine model # # Copyright 2014 <NAME>. # # This file is part of turingmachine. # # turingmachine 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 versi...
<reponame>maurov/xraysloth #!/usr/bin/env python # -*- coding: utf-8 -*- """Analytical expression of $\Delta \theta (x, z)$ from Wittry """ from __future__ import print_function import sys, os import math import numpy as np import numpy.ma as ma from sloth.io.specfile_writer import SpecfileDataWriter # ------------...
""" *Student Name: <NAME> *Student ID: 209399757 *Course Exercise Group: 02 Math *Exercise name: ex7 """ import argparse # mandatory import random import turtle import string import sys def oldMysteryFunc(a, n): while a != 0: temp = a % n print temp a = a/n def mysteryFunc(a, n): """...
""" Manager and Serializer for Library Folders. """ import logging from typing import ( Optional, Union, ) from sqlalchemy.orm.exc import ( MultipleResultsFound, NoResultFound ) from galaxy import util from galaxy.exceptions import ( AuthenticationRequired, InconsistentDatabase, InsufficientPermissionsExceptio...
track.term_id, track.vote, track.star from SI.Terms as term, SI.Tracking as track where track.user_id=%s and track.term_id=term.id and term.owner_id!=%s and track.star=true order by term_string; """, (user_id, user_id)) for row in cur.fetchall(): yield row def getTrackingByTerm(self, term_id): """ Retu...
<filename>tutorials/rstor/TutorialDebugging.py<gh_stars>0 """Build DEBUGGING.rst """ from helpers import * from et_rstor import * def TutorialDebugging(): doc = RstDocument('TutorialDebugging', headings_numbered_from_level=2, is_default_document=True) with pickled.open(mode='r') as f: doc.heading_numbers = json.l...