input
stringlengths
2.65k
237k
output
stringclasses
1 value
if p > lowest] if larger: next_larger = min(larger) can_replicate = min(next_larger - lowest - 1, remaining_budget / lowest_cnt) else: can_replicate = remaining_budget / lowest_cnt if can_replicate > 0: if lowest + can_replicate not in seen: seen.add(lowest + can_replicate) queue.append(lowest + can_replicat...
<gh_stars>0 #!/usr/bin/env python import os import sys import argparse import math import subprocess global MAKEBLASTDB global TBLASTN global CDHIT global MAFFT ALPHABET = {'A','C','G','T'} DEG_CODE = { 'A': 'A', 'C': 'C', 'G': 'G', 'T': 'T', 'AG': 'R', 'CT': 'Y', 'CG': 'S', 'AT': 'W', 'GT': 'K', 'AC': 'M',...
0x00, 0x00, # 0x00, 0x00, 0x00, # 0x00, 0x00, 0x00, # 0x01, 0xF8, 0x00, # OOOOOO 0x06, 0x07, 0x00, # OO OOO 0x18, 0x01, 0xC0, # OO OOO 0x30, 0x00, 0xE0, # OO OOO 0x20, 0x00, 0x70, # O OOO 0x40, 0x00, 0x38, # O OOO 0x40, 0x00, 0x3C, # O OOOO 0x80, 0x00, 0x1C, # O OOO 0x80, 0x00, 0x1E, # O OOOO 0x8...
<reponame>askingalot/amy import re from dal import autocomplete import django_filters from django.db.models import Q from django.forms import widgets from django_countries import Countries from workshops.forms import bootstrap_helper_filter, SIDEBAR_DAL_WIDTH from workshops.models import ( Event, Organization, Per...
<reponame>HybridRobotics/car-racing import numpy as np import sympy as sp import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.animation as anim from utils import base, racing_env from system import vehicle_dynamics from matplotlib import animation from utils.constants import * import ...
"""Run unit tests. Use this to run tests and understand how tasks.py works. Setup:: mkdir -p test-data/input mkdir -p test-data/output mysql -u root -p CREATE DATABASE testdb; CREATE USER 'testusr'@'localhost' IDENTIFIED BY 'test<PASSWORD>'; GRANT ALL PRIVILEGES ON testdb.* TO 'testusr'@'%'; Run tests:: pyt...
self.B2.dag() return self.Hqrot + self.Hint + Scl * Hdrive def calcStaticZZ(self, H): self.dressedEnergyLevels(H=H) self.staticZZ = self.eigenlevels[0][self.keys['11']] - self.eigenlevels[0][self.keys['10']] - self.eigenlevels[0][self.keys['01']] return self.staticZZ class QQQ(): # For tunable coupling simulat...
import pytest from unittest.mock import Mock, patch import os import numpy.testing as npt from paths_cli.compiling.core import * from paths_cli.compiling import compiler_for from paths_cli.tests.compiling.utils import mock_compiler class MockNamedObject: # used in the tests for CategoryCompiler._compile_dict and ...
not be allowed to exceed `source_length`. To maintain backwards compatibility, this is not enforced if a `key_provider` is provided. :param dict encryption_context: Dictionary defining encryption context :param algorithm: Algorithm to use for encryption (optional) :type algorithm: aws_encryption_sdk.identifiers.Al...
= Button(description='initial number of unbound ACE2 receptors on surface', disabled=True, layout=desc_button_layout) description_btn.style.button_color = 'lightgreen' row = [name_btn, self.float58, units_btn, description_btn] box66 = Box(children=row, layout=box_layout) name_btn = Button(description='bound_exter...
= Constraint(expr= - 6*m.b103 + m.x1384 <= 0) m.c4525 = Constraint(expr= - 6*m.b104 + m.x1385 <= 0) m.c4526 = Constraint(expr= - 6*m.b105 + m.x1386 <= 0) m.c4527 = Constraint(expr= - 6*m.b106 + m.x1387 <= 0) m.c4528 = Constraint(expr= - 6*m.b107 + m.x1388 <= 0) m.c4529 = Constraint(expr= - 6*m.b108 + m.x1389 <= 0)...
import os import shutil import importlib import inspect from glob import glob import re import json from scrapy.http import Request from scrapy.utils.python import to_unicode from scrapy.utils.reqser import request_from_dict, _get_method from scrapy.exceptions import _InvalidOutput, UsageError def get_cb_settings(te...
<filename>test/replaybuffer.py # Copyright (c) 2021: <NAME> (<EMAIL>). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. import numpy as np import random from collections import deque import torch as T from test.segment_tree import MinSegmentTree, S...
<reponame>jkabalar/3DSSG if __name__ == '__main__' and __package__ is None: from os import sys sys.path.append('../') import argparse, trimesh import open3d as o3d import numpy as np from tqdm import tqdm from pathlib import Path from utils import util, util_label, define from utils.util_search import SAMPLE_METHODS,...
None, 4, None, None, "UserInformationTransportSettingFlags"), 0x31e9: (0x101f, None, None, 4, None, None, "UserInformationUMAddresses"), 0x31ea: (0x101f, None, None, 4, None, None, "UserInformationUMCallingLineIds"), 0x31eb: (0x101f, None, None, 4, None, None, "UserInformationUMDtmfMap"), 0x31ec: (0x0003, None, Non...
<gh_stars>0 """ Sources: <NAME>, https://docs.python.org/2/tutorial/datastructures.html """ from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset import random black = Color(0x000000, 1.0) white = Color(0xffffff, 1.0) clear = Color(0xffffff, 0.0) red = Color(0xff0000...
self._real_archetype = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('_desynched_atts', node) if value is not None and '_desynched_atts' not in already_processed: already_processed.add('_desynched_atts') self._desynched_atts = value value = find_attr_value_('Compone...
#assert(str(v) == s) s = 'frob 2012.4.1' #v = Version.parse(s) #assert(str(v) == s) s = 'frob 2012.04.01' #v = Version.parse(s) #assert(str(v) == s) s = 'frob 20120401' #v = Version.parse(s) #assert(v.release_date == date(2012, 4, 1)) def test_parse_semver(): #### #### Semver-specific tests (Semver 2...
<gh_stars>100-1000 import os import re from typing import List, Dict import codecs import json from itertools import chain import logging from collections import Counter import numpy as np import baseline.data from baseline.vectorizers import Dict1DVectorizer, Token1DVectorizer, create_vectorizer, HasPredefinedVocab fr...
os.path.join(b + '/textures/items', str('chestplateiron.png'))) except: pass try: file_path = a + '/assets/minecraft/textures/items' file_names = os.listdir(file_path) shutil.copy(file_path + '/chicken_cooked.png', b + '/textures/items') if 'chicken_cooked.png' in file_names: os.rename(os.path.join(b ...
# Copyright (c) 2016 Cisco Systems # 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 applicable law ...
###################################################################### # mat4 - Matrix class (4x4 matrix) # # Copyright (C) 2002, <NAME> (<EMAIL>) # # You may distribute under the terms of the BSD license, as # specified in the file license.txt. ###################################################################...
''' @author: <NAME> ''' from domeniu.entitati import Numar from infrastrctura.repos import Repo from erori.exceptii import RepoError, ValidError from business.services import ServiceNumere from valid.validatoare import Validator class Teste(object): def __init__(self): ''' Functie de tip constructor care constr...
""" Abstract method for sending/receiving requests for forecast weather data from an api service :param location: location for which to query the remote api :return: list of dictionaries containing weather data corresponding to forecast timestamp """ # @RPC.export # def get_hourly_historical(self, locations, s...
# # print ("plane_now.look") # plane_now.look() # # game.look() check, new_pos = self.check_plane_action(plane_now.position, joint_action[2 + self.cars + i][0].index(1)) if (check): plane_now.position = new_pos # # print ("plane_now.look") # plane_now.look() # print ("plane%d end:" % i) # pr...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys from datetime import time import _init_paths import os import pprint import argparse import numpy as np import torch import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader impo...
machine scale set id. :type recovery_virtual_machine_scale_set_id: str """ _validation = { 'instance_type': {'required': True}, 'initial_primary_zone': {'readonly': True}, 'initial_primary_fabric_location': {'readonly': True}, 'initial_recovery_zone': {'readonly': True}, 'initial_recovery_fabric_location': {'r...
#!/usr/bin/env python3 """ Tests for the path database """ # Standard lib import pathlib import unittest # Our own imports from deep_hipsc_tracking import utils from .. import helpers # Tests class TestIsNonemptyDir(helpers.FileSystemTestCase): def test_returns_false_for_empty_dirs(self): p1 = self.tempdir / ...
import functools import os import random import threading import time from dataclasses import dataclass from datetime import datetime, timedelta from enum import Enum from typing import Dict, Iterator, Optional from uuid import UUID, uuid4 import requests from fastapi import FastAPI, HTTPException from fastapi.excepti...
w : the height of every gaussian centers: list of tuple optional (default=([1,1],[-1,-1])) The bounding box for each cluster center when centers are generated at random. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; ...
checks # in such case, it will error when accessing the .shape attribute. is_param_lazy = torch.nn.parameter.is_lazy(param) # Backward compatibility: loading 1-dim tensor from 0.3.* to version 0.4+ if not is_param_lazy and len(param.shape) == 0 and len(input_param.shape) == 1: input_param = input_param[0] if not...
#!/usr/bin/env python """ Test code for the BBox Object """ import numpy as np import pytest from geometry_utils.bound_box import (BBox, asBBox, NullBBox, InfBBox, fromBBArray, from_points, ) class TestConstructors(): def test_creates(self): B = BBox(((0, 0), (5, 5))) assert isinstance(B, BBox) def tes...
<gh_stars>1-10 import itertools from field.point import Point from field.field import Field from move.move import Move from move.move_type import MoveType import numpy as np from config import config class GameState: """ A state of the game, i.e. the game board. These are the only functions which are absolutely n...
config. The configuration on the master allows minions to be matched to salt functions, so the minions can only publish allowed salt functions The config will look like this: peer: .*: - .* This configuration will enable all minions to execute all commands. peer: foo.example.com: - test.* This configuration ...
adjsObj[obj2.id]; } return this.edges[obj.id][obj2.id]; }, /** * @param {Array} id * @return {undefined} */ removeNode : function(id) { if (this.hasNode(id)) { delete this.nodes[id]; var adjs = this.edges[id]; var to; for (to in adjs) { delete this.edges[to][id]; } delete this.edges[id]; } }, /** * ...
import os import logging import copy import numpy as np import pandas as pd import time import uuid import json import operator from supervised.algorithms.algorithm import BaseAlgorithm from supervised.algorithms.registry import BINARY_CLASSIFICATION from supervised.algorithms.registry import MULTICLASS_CLASSIFICATION...
provided. NotImplementedError: If ``auto_current_user_add`` is provided. """ _auto_current_user = False _auto_current_user_add = False def __init__( self, name=None, *, auto_current_user=None, auto_current_user_add=None, indexed=None, repeated=None, required=None, default=None, choices=None, validator...
return self * ~other div = _div_ def __call__(self, y): """ Return the composition of this power series and the power series y. EXAMPLES:: sage: L = LazyPowerSeriesRing(QQ) sage: s = L([1]) sage: t = L([0,0,1]) sage: u = s(t) sage: u.coefficients(11) [1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34] Test Compose 2 ...
) idxs = np.nonzero(cond)[0] assert len(idxs) == 1 idx = idxs[0] orig_data2d_rownum = frame2d_idxs[idx] if not old_sync_timestamp_source: # Change the next line to 'timestamp' for old # data (before May/June 2009 -- the switch to # fview_ext_trig) frame_timestamp = frame2d[idx]["cam_received_timestamp"] els...
""" American Academy of Actuaries stochastic log volatility interest rate process References ---------- https://www.actuary.org/sites/default/files/pdf/life/lbrc_dec08.pdf, page 8 """ from typing import Dict import numpy as np from pyesg.stochastic_process import StochasticProcess class AcademyRateProcess(Stochasti...
from __future__ import division, print_function, absolute_import from multiprocessing import Process, Pipe import yaml import cv2 # Konwn issue: - No module named 'scipy.spatial.transform', To resolve, try pip3 install scipy==1.2 from scipy.spatial.transform import Rotation as R from real_robots.constants import * fr...
<reponame>xiaozheshao/Policy-based-routing-verifier from topo import * import sys import getopt from z3 import * import pickle import gc import threading import ctypes import random class Usage(Exception): def __init__(self, msg): self.msg = msg # This is the latest version: JUly 3th 2019 # We try to implement th...
sample_weight=sample_weight) return cv_estimator.alpha_ def _get_theta_hat(self, X, sample_weight): # Assumes that X has already been offset n_samples, n_features = X.shape # Special case: n_features=1 if n_features == 1: C_hat = np.ones((1, 1)) tausq = (X.T @ X / n_samples).flatten() return np.diag(1 / tausq...
(asyncio.CancelledError, SystemExit, KeyboardInterrupt): raise except BaseException as e: self._results.append( Diagnostic( range=range_from_token_or_node(value, keyword_token), message=str(e), severity=DiagnosticSeverity.ERROR, source=DIAGNOSTICS_SOURCE_NAME, code=type(e).__qualname__, ) ) if result is no...
get_stat_value( self, stat_name: str, stat_category: str = "allTime", character_id: Optional[int | str] = None, ) -> int | float: """Returns the value of the given stat. Int if no decimals, else float""" possible_stat_categories = [ "allTime", "allPvE", "allPvP", ] assert stat_category in possible_stat_cat...
import json from ibmcloud_python_sdk.config import params from ibmcloud_python_sdk.utils.common import query_wrapper as qw from ibmcloud_python_sdk.power import get_power_headers as headers from ibmcloud_python_sdk.utils.common import resource_not_found from ibmcloud_python_sdk.utils.common import resource_deleted from...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2021 PaddlePaddle 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...
n in self.net["neuron_pools"]: self.net_np_nps[n] = [n] self.net_np_sps[n] = [] for s,S in self.net["synapse_pools"].items(): assert("target" in S), "ERROR: st_meta_network: " \ + "no target parameter found for sp " + s if S["target"] == n: # further on with graph for np self.net_np_sps[n].append(s) sources = ...
<filename>rbb_server/src/rbb_swagger_server/models/simulation_detailed.py # coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from rbb_swagger_server.models.base_model_ import Model from rbb_swagger_server.models.simulatio...
from datetime import date, datetime from decimal import Decimal import pytest from django.shortcuts import reverse from faker import Faker from freezegun import freeze_time from pytz import timezone from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST from baserow.contrib.database.fields.handler import...
payment. if remote_config.initial_msat < calc_fees_for_commitment_tx( num_htlcs=0, feerate=feerate, is_local_initiator=False)[REMOTE]: raise Exception( "the funder's amount for the initial commitment transaction " "is not sufficient for full fee payment") # The receiving node MUST fail the channel if: # both t...
<reponame>vivlai/qanta import textwrap from collections import defaultdict, Counter import argparse from csv import DictReader from time import sleep import os kSHOW_RIGHT = False kPAUSE = .25 kSYSTEM = "QANTA" kBIGNUMBERS = {-1: """ 88888888 88888888 """, 0: """ .n~~%x. x88X 888. X888X 8888L X8888X ...
not None: # mask first to only process the stuff that goes into the loss function! raw_node_in = raw_node_in[readout_mask] raw_node_out = raw_node_out[readout_mask] if graph_nodes_list is not None: graph_nodes_list = graph_nodes_list[readout_mask] gate_input = torch.cat((raw_node_in, raw_node_out), dim=-1) gati...
if m.group(1) == "Compendium" and m.group(3): (system, entrytype, idnum) = m.group(2).split(".", 2) if args.compendium: slug = uuid.uuid5(moduuid, idnum) else: slug = slugify(m.group(3)) entrytype = entrytype.lower().replace("actor", "monster").rstrip("s") if "packs" in mod: for p in mod["packs"]: if p["name"]...
Exception as e: logger.error('error :: metrics_manager :: sync_cluster_files - failed to determine authorative_host for %s - %s' % ( str(metric), e)) if authorative_host: USE_REMOTE_SKYLINE_INSTANCES = [] for remote_skyline_instance in REMOTE_SKYLINE_INSTANCES: try: if remote_skyline_instance[3] == authorative_h...
# Copyright 2018 The TensorFlow Hub 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...
the base object if len(args) > 0: register_handle(self, args[0]) DownCast = staticmethod(_Extrema.Handle_Extrema_SequenceNodeOfSequenceOfPOnCurv2d_DownCast) __swig_destroy__ = _Extrema.delete_Handle_Extrema_SequenceNodeOfSequenceOfPOnCurv2d Handle_Extrema_SequenceNodeOfSequenceOfPOnCurv2d.Nullify = new_instancem...
from collections import OrderedDict, namedtuple from string import whitespace import pdb import sys ADD = 'ADD' SUB = 'SUB' MUL = 'MUL' INT_DIV = 'INT_DIV' REAL_DIV = 'REAL_DIV' DOT = 'DOT' SEMI = 'SEMI' COLON = 'COLON' COMMA = 'COMMA' PROGRAM = 'PROGRAM' INT_CONST = 'INT_CONST' REAL_CONST = 'REAL_CONST' INT_TYPE = '...
<filename>teki_main_app.py # -*- coding: utf-8 -*- ########################### # Standard libraries ########################### import csv import logging import os import sys import timeit from datetime import datetime if __name__ == "__main__": """ Starting the program will take a bit of time due to the amount ...
while True: try: pil_image.seek( i ) except: break if 'duration' not in pil_image.info: duration = 83 # (83ms -- 1000 / 12) Set a 12 fps default when duration is missing or too funky to extract. most stuff looks ok at this. else: duration = pil_image.info[ 'duration' ] # In the gif frame he...
030400 0.0000000E+00 0.0000000E+00 0.6296256E+08 0.1647892E+10 0.0000000E+00 201400 0.0000000E+00 0.0000000E+00 0.9951448E+10 0.5164005E+10 0.0000000E+00 111400 0.0000000E+00 0.0000000E+00 0.7414713E+10 0.3544284E+10 0.0000000E+00 021400 -0.2259765E+10-0.9989260E+09 0.0000000E+00 0.0000000E+00-0.1003933E+10 102400 ...
<filename>iperf_test/myiperf.py<gh_stars>0 #!/usr/bin/env python # -*- coding: cp936 -*- ''' <Auther> : guolei <Function> : Used to finish net test projects with iperf.This script is used for windows, and this port must be the device who will be test and an other port best for linux.This is the enviroment for my t...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use thi...
import numpy as np import pyrealsense2 as rs import cv2 from enum import Enum from typing import List, Tuple # ----------------------------- Helper functions ----------------------------- # class Device: def __init__(self, pipeline, pipeline_profile, align, product_line): self.pipeline = pipeline self.pipeline_pr...
<filename>sdk/python/pulumi_snowflake/stage.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Opt...
<gh_stars>0 # from django import http import json import re from django_redis import get_redis_connection from django.conf import settings from django.contrib.auth import logout from django.http.response import HttpResponse, HttpResponseForbidden, JsonResponse from django.shortcuts import render, redirect from django....
2), # new bucket (2, 2, 4, 4), # new bucket because of overlap with previous bucket (0, 0, 3, 3), # new bucket because of size (5, 5, 7, 7), # same as first ] expected = [[0, 3], [1], [2]] buckets = aggregate.bucketize(bboxes) self.assertEqual([0, 1, 2, 3], sorted(i for b in buckets for i in b)) self.assertEqua...
#!/usr/bin/python3 # This code originated as a project for the COMP 520 class at McGill # University in Winter 2015. Any subsequent COMP 520 student who is # viewing this code must follow the course rules and report any viewing # and/or use of the code. import sys, os, logging, argparse, cmd, posixpath from subproces...
Blue":0x5b92e5, "Unity":0x264d8e, "Universal Green":0x006b38, "Universal Khaki":0xb8a992, "University of California Gold":0xb78727, "University of Tennessee Orange":0xf77f00, "Unloaded Texture Purple":0xc154c1, "Unmarked Trail":0xd2cab7, "Unmatched Beauty":0xb12d35, "Unmellow Yellow":0xfefe66, "Unplugged":0x4b4840, "Un...
<filename>viscid/dipole.py """A collection of tools for dipoles""" # pylint: disable=bad-whitespace from __future__ import print_function, division import sys import numpy as np import viscid from viscid import field from viscid import seed from viscid.calculator import interp_trilin # from viscid import vutil try: ...
""" run the below command under 'activity_recognition' folder: PYTHONPATH=../:./ python3 models/classical/detector_feature_A_mirror-2.py """ import os import shutil from collections import Counter from shutil import copyfile import cv2 import numpy as np import sklearn import pandas as pd from sklearn.ensemble i...
""" Defines the project API """ import endpoints, re from protorpc import message_types from django.contrib.auth import get_user_model from django.db.models import Q, Count from django.conf import settings from django.utils import timezone from greenday_core import eventbus from greenday_core.memoize_cache import ca...
the beginning - # not after creating interaction terms and weeding out collinear variables? # ============================================================================= data = data1_cl oversampling_data = data.copy(deep=True) for i in range(0,1): oversampling_data = pd.concat([oversampling_data,oversampling_dat...
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `managed = False` lines if you wish...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # File name: glide_calc.py """ Created on Mon Mar 26 16:21:26 2018 @author: Neo(<EMAIL>) Some functions related to glide component calculation. History N.Liu, 20 Mar 2018: """ import numpy as np from numpy import sin, cos import matplotlib.pyplot as plt f...
a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. :param str value: The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and ...
only_now 안쓰면 한 파일에 모두 씀 self.action_visualize_sceneMap() # 인식 결과 출력 (read SceneMap) if self.SAVE_IMAGE: image_dir = '/media/ailab/D/ai2thor/thorDBv2/images' depth_dir = '/media/ailab/D/ai2thor/thorDBv2/depth_images' if not os.path.isdir(image_dir): os.makedirs(image_dir, exist_ok=True) if not os.path.isdir(depth...
# Copyright 2017 Mycroft AI 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 agreed to in writing, ...
<gh_stars>0 """ Parsers for GAF and various Association TSVs. All parser objects instantiate a subclass of the abstract `AssocParser` object """ # TODO: Refactor - move some stuff out into generic parser object import re import requests import tempfile from contextlib import closing import subprocess import logging...
# QLocator # Copyright (C) 2020-2022 qcomixdev # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program i...
end timestamps if robot.timestamp_start_initiate is not None and robot.timestamp_finish is not None: trade_outcome, trade_commissions, trade_funding, percent_gained = sell_results_process(e_api, robot, robot.timestamp_start_initiate, robot.timestamp_finish) # If start timestamp comes from process - need to consider...
<filename>permuta/permutils/pin_words.py # pylint: disable=too-many-public-methods # pylint: disable=eval-used from bisect import bisect_left from collections import defaultdict from functools import lru_cache from pathlib import Path from typing import DefaultDict, Dict, Iterator, List, Set, Tuple from automata.fa....
<reponame>Naras-KS/progressive-transformers<filename>Architecture/progressive_transformer_lstm.py<gh_stars>1-10 ################################################ Author - <NAME> ####################################################### ################################################ Thanks to tensorflow and Keras #######...
distance plot""" if ax is None: return ax.set_xlabel('Distance (pc)') ax.set_ylabel('E(B-V)') ax.grid(which='both', zorder=1, color='0.5', alpha=0.5) ax.set_title('l=%.2f, b=%.2f' % (self.l, self.b)) #### Test the comparison def testOneSightline(l=0., b=4., Rv=3.1, useCoarse=False): """Try a single sight ...
multiTime_cell_id_t1 = [adata.uns["Tmap_cell_id_t1"]] multiTime_cell_id_t2 = [adata.uns["Tmap_cell_id_t2"]] proportion = adata.uns["proportion"] transition_map = adata.uns["transition_map"] X_clone = clone_annot.copy() if not ssp.issparse(X_clone): X_clone = ssp.csr_matrix(X_clone) demultiplexed_map = tmap_co...
type: ignore def _update_mongo_db_collection_throughput_initial( self, resource_group_name, # type: str account_name, # type: str database_name, # type: str collection_name, # type: str update_throughput_parameters, # type: "_models.ThroughputSettingsUpdateParameters" **kwargs # type: Any ): # type: (...) ->...
'tool_dependencies.xml', filepath=os.path.split( xml_filename )[0], commit_message='Uploaded dependency on %s.' % ', '.join( repo.name for repo in depends_on[ 'repositories' ] ) ) def create_repository_dependency( self, repository=None, depends_on=[], filepath=None ): dependency_description = '%s depends on %s.' ...
<gh_stars>0 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file '.\ResidenceAndProcessesBigData.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtWebEngineWidgets import sys from PyQt5 import QtCore, QtGui, QtWidgets...
"yeh continue me phas gaya,lit me, fruit me, nahi hai") continue if feature.GetField("name") in dynadead: print(feature.GetField("name"), "yeh continue me phas gaya,dynadead me nahi hai") continue if (feature.GetField("name")) == (id): print(feature.GetField("name"), "end ho gaya") s = "THE END" return feature,...
<filename>tti/utils/trading_simulation.py """ Trading-Technical-Indicators (tti) python library File name: trading_simulation.py Trading simulation class implementation defined under the tti.utils package. """ import pandas as pd import numpy as np from ..utils.data_validation import validateInputData from ..utils....
= GEOM.altaz2hadec(pointings_altaz, latitude, units='degrees') pointings_radec = NP.hstack(((lst-pointings_hadec[:,0]).reshape(-1,1), pointings_hadec[:,1].reshape(-1,1))) pointings_radec[:,0] = pointings_radec[:,0] % 360.0 pointings_ha = pointings_hadec[:,0] pointings_ha[pointings_ha > 180.0] = pointings_ha[pointi...
velocity along x-axis. vinf_lims: limit of velocity at large distance along x-axis. """ # check input sig_x_lims = np.array(sig_x_lims) assert np.all(sig_x_lims > 0.) sig_y_lims = np.array(sig_y_lims) assert np.all(sig_y_lims > 0.) #alpha_lims = np.array(alpha_lims) #assert np.all(alpha_lims >= 1.) vmax_lims...
<reponame>Zer0Credibility/sympy<gh_stars>0 from sympy import symbols, IndexedBase, Identity, cos, Inverse from sympy.codegen.array_utils import (CodegenArrayContraction, CodegenArrayTensorProduct, CodegenArrayDiagonal, CodegenArrayPermuteDims, CodegenArrayElementwiseAdd, _codegen_array_parse, _recognize_matrix_expre...
Data", body="station did not got ip Test failed.") assert False else: if float(str(kpi_val[0])[1:-1]) > float(500): print("Test passed successfully") allure.attach(name="Kpi Data", body=str(kpi_val)) assert True else: print(" valueTest faled due to lesser") allure.attach(name="Kpi Data", body=str(kpi_val)) as...
<filename>service/tasks/driver.py<gh_stars>100-1000 """ Tasks for driver operations. NOTE: At this point create options do not have a hard-set requirement for 'CoreIdentity' Delete/remove operations do. This should be investigated further.. """ from operator import attrgetter import time from django.conf import settin...
dx, y=self._view_rect.bottom + dy) else: raise ValueError('unknown position, only west, east, north, and' 'south are allowed') if pos in (POSITION_NORTH, POSITION_SOUTH): if self.get_hidden_width() != 0: sbar.set_length(self._view_rect.width + d_size) sbar.set_maximum(self.get_hidden_width()) sbar.set_page_st...
# coding: utf-8 """Mapping of production and consumption mixes in Europe and their effect on the carbon footprint of electric vehicles This code performs the following: - Import data from ENTSO-E (production quantities, trades relationships) - Calculates the production and consumption electricity mixes for Europea...
#!/usr/bin/env python3 import sqlite3 import json import flask import re import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import re import time from plotly.validators.scatter.marker import SymbolValidator import math import dash_table from ...
# SimpleCV Cameras & Devices #load system libraries from SimpleCV.base import * from SimpleCV.ImageClass import Image, ImageSet, ColorSpace from SimpleCV.Display import Display from SimpleCV.Color import Color #Globals _cameras = [] _camera_polling_thread = "" class FrameBufferThread(threading.Thread): """ **SU...
import torch import torch.nn.functional as F import torch.nn as nn # Custom imports from .base_semi_apppearance_temporal_simclr import SemiAppTemp_SimCLR_BaseRecognizer from ..builder import RECOGNIZERS from ..losses import CosineSimiLoss from ...utils import GatherLayer @RECOGNIZERS.register_module() class Semi_App...