input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
(
max_status_len,
uw.Text(
status_map.get(tracker.status, tracker.status),
wrap=uw.CLIP,
),
),
(
num_peers_len,
uw.Text(str(num_peers), align=uw.RIGHT, wrap=uw.CLIP),
),
(
num_seeds_len,
uw.Text(str(num_seeds), align=uw.RIGHT, wrap=uw.CLIP),
),
(
num_leeches_len,
uw.Text(str(num_leeches), align=uw.RIGH... | |
<gh_stars>1-10
bl_info = {
"name": "Vertex Weight Tools",
"description": "Various Vertex Weight Tools",
"author": "<NAME>",
"version": (1, 0, 1),
"blender": (2, 80, 0),
"location": "View3D > Tools",
"support": "COMMUNITY",
"category": "3D View"
}
import bpy, bmesh, math, inspect, time
from timeit import defau... | |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import itertools
from typing import List, Tuple, Dict
from dace import dtypes, config, registry, symbolic, nodes, sdfg, data
from dace.sdfg import graph, state, find_input_arraynode, find_output_arraynode
from dace.codegen import codeobject,... | |
in already_processed:
already_processed.add('_id')
showIndent(outfile, level)
outfile.write('_id="%s",\n' % (self._id,))
if self.Type is not None and 'Type' not in already_processed:
already_processed.add('Type')
showIndent(outfile, level)
outfile.write('Type="%s",\n' % (self.Type,))
def exportLiteralCh... | |
<filename>geomdl/utilities.py
"""
.. module:: utilities
:platform: Unix, Windows
:synopsis: Contains common utility functions for linear algebra, data validation, etc.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import random
import math
from .elements import Vertex, Triangle
def linspace(start, stop, num, decimals=6... | |
"""Dash HTML-ish layout."""
import base64
import logging
from typing import Any, Dict, List, Tuple, Union
import dash_bootstrap_components as dbc # type: ignore[import]
import dash_daq as daq # type: ignore[import]
import visdcc # type: ignore[import]
from dash import dcc, html # type: ignore
from dash.dependencies i... | |
penalty_digit_rate is not None:
if _rs_word_dict["val"].isdigit() == True or _rt_word_dict["val"].isdigit() == True:
fr = fr - (fr * penalty_digit_rate / 100)
input = fr * wm_dict["sco_trg_colidx"]\
* wm_dict["sco_trg_gi"]\
* wm_dict["sco_trg_wi"]\
* wm_dict["sco_src_colidx"]\
* wm_dict["sco_src_gi"]\
* wm_di... | |
<reponame>weishanlee/SAMAV3_1<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on
@author: weishan_lee
Sight-seeing order of Macao World Heritage Sites
Case 2: Travel distance or time for pairs of cities recorded in the following csv files:
(1) carTime.csv records time required for driving a car.
(2) busTime.csv rec... | |
averages*u(units)
else:
return averages
def perform_function_on_state(func, dates, state, column, units="", path="", extension=".xls"):
"""Performs the function given on each state of the data for the given state
in the given column and outputs the result for each instance of the state
Parameters
----------
f... | |
0x29516D: (0x9991, 0), # East Asian ideograph
0x215E2C: (0x93D1, 0), # East Asian ideograph
0x225E2D: (0x7592, 0), # East Asian ideograph
0x4C4D63: (0x6F99, 0), # East Asian ideograph
0x6F5747: (0xC83C, 0), # Korean hangul
0x215E2E: (0x93C3, 0), # East Asian ideograph
0x213D2C: (0x5EE0, 0), # East Asian ideograph... | |
<reponame>ZihaoChen0319/CMB-Segmentation
import torch.nn as nn
import os
import torch.optim as optim
from tqdm import tqdm
import numpy as np
import torch
import torch.nn.functional as nnf
import SimpleITK as sitk
import json
from scipy import ndimage
import medpy.io as mio
from Utils import find_binary_ob... | |
<filename>simoa/nskart.py
# -*- coding: utf-8 -*-
from __future__ import division
import logging
import math
from collections import namedtuple
import numpy as np
import scipy.stats
from simoa.stats import von_neumann_ratio_test
logger = logging.getLogger(__name__)
# check python 3
if not (3 / 2 == 1.5):
raise R... | |
from __future__ import annotations
from canopy.errors import AdatKeyError, AdatMetaError
from typing import Union, List, Set, Tuple, Dict
from canopy.tools.pandas import get_pd_axis
import numpy as np
import warnings
import pandas as pd
class AdatMetaHelpers:
"""A collection of methods to help with altering the adat... | |
FPR is the ratio of
# negative instances that are correctly classified as positive. It is equal to one minus the true negative rate,
# which is the ratio of negative instances that are correctly classified as negative. The TNR is also called s
# specificity.
# Hence the ROC curve plots sensitivity (recall) versus 1-s... | |
1.391796E+04, 1.397492E+04, 1.403193E+04, 1.408898E+04, 1.414607E+04,
1.420321E+04, 1.426039E+04, 1.431761E+04, 1.437487E+04, 1.443217E+04, 1.448951E+04,
1.454690E+04, 1.460432E+04, 1.466178E+04, 1.471928E+04, 1.477682E+04, 1.483440E+04,
1.489202E+04, 1.494968E+04, 1.500737E+04, 1.506510E+04, 1.512287E+04, 1.518067E... | |
"""A library to create YARA rules.
"""
from builtins import chr
from builtins import str
from builtins import range
from builtins import object
import binascii
from copy import deepcopy
import collections
class yara_tools(object):
"""."""
def __init__(self, name, default_identifier=False, tags=False, default_con... | |
button
'Joy_8': {'Type': 'Digital', 'x': 884, 'y': 2007, 'width': 1092}, # Bottom bank third button
'Joy_9': {'Type': 'Digital', 'x': 1034, 'y': 2090, 'width': 1092}, # Bottom bank fourth button
'Joy_10': {'Type': 'Digital', 'x': 304, 'y': 1604, 'width': 1092}, # Rear left button
'Joy_11': {'Type': 'Digital', 'x': ... | |
<reponame>sahareslami/Garfield
# coding: utf-8
###
# @file byzPS.py
# @author <NAME> <<EMAIL>>
#
# @section LICENSE
#
# Copyright (c) 2020 <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | |
<filename>dataloader/statetransformer_Guidance.py
import numpy as np
import torch
from offlineExpert.a_star import PathPlanner
class AgentState:
def __init__(self, config):
# self.config = config
# self.num_agents = self.config.num_agents
self.config = config
self.num_agents = self.config.num_agents
# self.FOV... | |
#, expr='Gd1')
minRes = minimize(residOff, pOffd, args=(Ioff, toff-toff[0]), method=method)
fpOffd = minRes.params
kinetics['off2exp'] = fpOffd
print('tau_{{off1}} = {:.3g}, tau_{{off2}} = {:.3g}'.format(1/fpOffd['Gd1'].value, 1/fpOffd['Gd2'].value))
if config.verbose > 1:
#print(fit_report(minRes))
reportFit(... | |
<filename>python/combine.py
import time
import pathlib
import argparse
import multiprocessing
from typing import Dict, List, Optional, Tuple
import cv2
import numpy
import piexif
from PIL import Image, ImageChops, ImageOps, ImageFilter
JPEG_EXTENSIONS = (
'.JPEG',
'.JPG'
) # valid extensions of JPEG images
VIDEO_E... | |
'str'},
'sampling': {'key': 'properties.sampling', 'type': 'SamplingSettings'},
'frontend': {'key': 'properties.frontend', 'type': 'PipelineDiagnosticSettings'},
'backend': {'key': 'properties.backend', 'type': 'PipelineDiagnosticSettings'},
'log_client_ip': {'key': 'properties.logClientIp', 'type': 'bool'},
'http... | |
server.
"""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "delete_metadata_store" not in self._stubs:
self._stubs["delete_metadata_store"] = self.grpc_channel.unary_unary(
... | |
None
def getUnpushedCommits( self ):
tracking_commit = self.getTrackingBranchCommit()
if tracking_commit is None:
return []
last_pushed_commit_id = tracking_commit.hexsha
all_unpushed_commits = []
for commit in self.repo().iter_commits( None ):
commit_id = commit.hexsha
if last_pushed_commit_id == commit_i... | |
<reponame>Walden-Shen/uoft-profs
import time
import sys
sys.path.append("../util")
import itertools
import Database
import time_conflicts_check
import cost
DB_NAME = "uoftcourses"
DB_PATH = "../../database.info"
def __get_all_possible_course_times(course_code, campus):
"""
course_code: a string e.g. "CSC148"
camp... | |
elif lt > 0 and le == 0:
msg = "{0}, you are as malignantly narcissistic, irrevocably misogynistic, thoroughly corrupt and utterly treasonous as Donald Trump.".format(
target)
elif lt > 0 and le > 0:
msg = "{0}, you are as malignantly narcissistic, irrevocably misogynistic, thoroughly corrupt and utterly treasonous... | |
# -*- coding: utf-8 -*-
import ast
import json
import logging
import operator
import re
from django.core.exceptions import ObjectDoesNotExist
from django.forms.models import model_to_dict
from netaddr import IPNetwork
from networkapi.rack.models import Rack, RackConfigError
from networkapi.ambiente import models as mo... | |
<filename>tests/test_decode.py
#!/usr/env/bin python3
import numpy as np
from unittest import TestCase, main
from fast_ctc_decode import *
class Test1DBeamSearch(TestCase):
def setUp(self):
self.beam_size = 5
self.alphabet = "NACGT"
self.beam_cut_threshold = 0.1
self.probs = self.get_random_data()
def get_ran... | |
"""
Copyright contributors to the Application Gateway project
"""
import atexit
import logging
import time
import requests
import urllib3
import os
import yaml
from ibm_application_gateway.system.environment import Environment
logger = logging.getLogger(__name__)
urllib3.disable_warnings(urllib3.exceptions.Insecure... | |
AS PART OF THIS FILE AT ALL TIMES.
'''
xilinx2_header = '''(c) Copyright 2017 Xilinx, Inc. All rights reserved.
This file contains confidential and proprietary information
of Xilinx, Inc. and is protected under U.S. and
international copyright and other intellectual property
laws.
DISCLAIMER
This disclaimer is not a... | |
"""Manage model parameter settings."""
import json
import copy
import numpy as np
def read_json(json_file):
"""Read parameters from a JSON file."""
with open(json_file, 'r') as f:
par_dict = json.load(f)
par = Parameters()
if 'options' in par_dict:
par.set_options(par_dict['options'])
par.set_free(par_dict[... | |
"councillors",
"agnieszka",
"widest",
"salander",
"inflame",
"honing",
"sterilization",
"comic-book",
"engels",
"ex-lover",
"briareos",
"lajos",
"manolis",
"wouldn`t",
"alcide",
"preoccupation",
"centaurs",
"oversaw",
"teja",
"freakishly",
"high-frequency",
"uninhibited",
"stowaways",
"kurdistan"... | |
import os
import yaml
import zipfile
import shutil
import lmctl.files as files
import lmctl.project.handlers.interface as handlers_api
import lmctl.project.validation as project_validation
import lmctl.utils.descriptors as descriptor_utils
from .brent_content import BrentResourcePackageContentTree, BrentPkgContentTree
... | |
<filename>scripts/python/pheno/datasets/features.py
from scripts.python.pheno.datasets.fields import Field
def get_columns_dict(dataset: str):
d = None
if dataset == "GSE152027":
d = {
'Status': 'status',
'Age': 'ageatbloodcollection',
'Sex': 'gender',
}
elif dataset == "GSE145361":
d = {
'Status': 'disease... | |
<gh_stars>100-1000
#!/usr/bin/env python
#
# Copyright (C) 2021 <NAME>
#
# 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,... | |
this method has been called first by checking the value of the
# "_is_open" attribute.
if self._is_open:
return
if self._filepointer is None:
# This should not happen is just for mypy to be happy
if self._filepath is None:
raise ValueError(f'File not found: "{self._filepath}".')
logger.debug('read File Meta In... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 4 10:59:53 2017
@author: Weber
"""
import sys
import json
import importlib
from PyQt5 import QtWidgets,QtGui
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QLocale, Qt, QDate, QDateTime, QTime, QByteArray
from pyqtgraph.widgets import ColorButton, SpinBox
imp... | |
This function runs the following vtysh command:
::
# no routing
"""
cmd = [
'no routing'
]
result = self.enode(
(' '.join(cmd)).format(**locals()),
shell='vtysh'
)
if result:
raise determine_exception(result)(result)
def shutdown(
self):
"""
Enable an interface.
This function runs the following... | |
output_lines[2])
def test_reportOutcome(self):
"""
_reportOutcome contains output we expect.
"""
self.args.verbose = 1
gtr = GreenTestResult(self.args, GreenStream(self.stream))
gtr._reportOutcome(None, ".", lambda x: x)
self.assertIn(".", self.stream.getvalue())
@patch("green.result.proto_test")
def test_r... | |
from datetime import datetime
import json
from json import JSONEncoder
import logging
import os
from pathlib import Path
import random
import shutil
import yaml
from Cryptodome.PublicKey import RSA
from jinja2 import Environment, PackageLoader, select_autoescape
from . import tools
METADATA_FILENAME = ".metadata"
... | |
#!/usr/bin/env python2
# encoding: utf-8
# This file is taken from the klab repository. Please see that repository for any updates.
# https://github.com/Kortemme-Lab/klab/
# The MIT License (MIT)
#
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this s... | |
import pickle
import warnings
from copy import deepcopy
from typing import Iterable, Optional, Union
import numpy as np
import pandas as pd
from copulae.core import is_psd, near_psd
from copulae.types import Array
from muarch.calibrate import calibrate_data
from muarch.funcs import get_annualized_kurtosis, get_annuali... | |
# 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 applicable ... | |
in dx_measure]
var_w_msr_pad = [Constant(0.0) for _ in ds_measure]
var_dwdu_msr_dic = [Constant(0.0) for _ in dx_measure]
var_dwdf_msr_pad = [Constant(0.0) for _ in ds_measure]
### Model
u = Function(V)
if FIX_BOUNDARY:
material_parameters = [
{'mu': Constant(0),
'jm': Constant(0)},
{'mu': Constant(0),
'jm': ... | |
'''
test_core.py: Python testing for core functions for
Singularity in Python,
including defaults, utils, and shell functions.
Copyright (c) 2016-2017, <NAME>. All rights reserved.
"Singularity" Copyright (c) 2016, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject ... | |
570,
551,
579,
570,
564,
618,
612,
584,
517,
547,
521,
485,
422,
512,
417,
469,
421,
441,
535,
601,
479,
494,
528,
513,
624,
553,
591,
637,
727,
950,
485,
220,
218,
210,
218,
184,
196,
188,
198,
190,
206,
281,
1477,
2806,
2237,
1699,
1444,
1221,
1351,
1500,
2028,
2226,... | |
<filename>tests/test_utility_classes.py
from support import TestCase
import typecheck
def check_type(typ, obj):
typecheck.check_type(typ, None, obj)
class Test_Or(TestCase):
def setUp(self):
from typecheck import Or
def or_type(obj):
check_type(Or(int, float), obj)
self.or_type = or_type
def test_IsOneOf_al... | |
elif this.extended_model_group is not None:
warnings.warn(
"This object has extended_model_group values, other object does not. "
"Filling missing values with empty strings."
)
this.extended_model_group = np.concatenate(
(
this.extended_model_group,
np.full(
other.Ncomponents, "", dtype=this.extended_model_gro... | |
# Copyright 2016 Huawei Technologies India Pvt. Ltd.
#
# 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 ag... | |
= 'Library search paths:'
flag_options = OrderedDict(LDLinker.flag_options,
**{'linker-version': '-mlinker-version=%s',
'library_rpath': '-rpath',
'library_libs_nonstd': ''})
@staticmethod
def before_registration(cls):
r"""Operations that should be performed to modify class attributes prior
to registration inc... | |
= None):
args = args[1:]
level = log.getVerbosity()
message = argSet.pop("message", None)
test = argSet.pop("test", False)
logfile = argSet.pop("log-file", None)
if argSet or len(args) != 1: return self.usage()
if message and logfile:
raise errors.ConaryError("options --message and --log-file are "
"mutually... | |
'''PARM: PAR2 Activation-driven calcium Release Model
PARM is a mechanistic mass action model of PAR2 activation and downstream
calcium signaling via the phospholipase C and IP3 pathway. The model was
designed to mathematically model the underlying signaling dynamics
relevant to the inactivation of PAR2 by Molecular H... | |
FS
#===============================================================================
# Run Fisher Scoring
t1 = time.time()
paramVector_FS,_,nit,llh = FS2D(XtX, XtY, ZtX, ZtY, ZtZ, XtZ, YtZ, YtY, YtX, nlevels, nraneffs, tol, n, reml=REML, init_paramVector=None)
t2 = time.time()
# Add back on constant term for llh... | |
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
Arc-Standard Transition System
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals # compatible with python3 unicode coding
import numpy as np
import sys,os
from collectio... | |
<filename>airflow/bin/cli.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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... | |
<filename>fcsgg/modeling/necks/necks.py<gh_stars>1-10
"""
Implementations of necks (intermediate branches transforming backbone features).
"""
__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2021 Futurewei Inc."
__credits__ = ["Detectron2"]
__license__ = "MIT License"
__version__ = "0.1"
__maintainer__ = "<NAME>"... | |
"""
Utility functions for pgrid.
"""
import numpy as np
import xarray as xr
import seawater as sw
from lo_tools import Lfun, zfun, zrfun
from lo_tools import plotting_functions as pfun
def simple_grid(aa, res):
dlat = aa[3] - aa[2]
dlon = aa[1] - aa[0]
mean_lat = np.mean(aa[2:])
earth_rad = zfun.earth_rad(mean_la... | |
failed)', identifier, account_key.id())
return None, None
new.account = account_key
new.status = account.status
if primary:
account.identifiers.insert(0, new.key)
account.primary_set = True
else:
account.identifiers.append(new.key)
logging.debug('Added %r to %d', new.key.id(), account.key.id())
ndb.put_multi(... | |
<reponame>Buster-2002/Brankobot
# -*- coding: utf-8 -*-
'''
The MIT License (MIT)
Copyright (c) 2021-present Buster
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... | |
#%%
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import shutil
import sys
import datetime
import numpy as np
import pandas as pd
import math
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import ... | |
Wind: The Kingkiller Chronicle:, Book 1"
4 - 'Salem's Lot
...
"""
publisher_lst = []
titles_publisher_lst = []
for key in dictionary: #Loops through keys in dictionary
for book in dictionary[key] : #checks for the book info
if book['publisher'] == publisher: #checks to see if the publisher it is at matches... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
import math
import random
import copy
import dices
from data import chars
from data import animals
from data import races
from data import classes
from data import squads
from data import items
from data import spells
import config
#--------------------------... | |
[SimpleFoo('my_foo1'), SimpleFoo('my_foo2')]
quxs = [SimpleQux('my_qux1', data=[1, 2, 3]), SimpleQux('my_qux2', data=[4, 5, 6])]
# NOTE: unlike in the other tests, links cannot map to the same foos in bucket because of a name clash
links = [SimpleFoo('my_foo3'), SimpleFoo('my_foo4')]
bucket = SimpleBucket(
name='t... | |
= "0.15.3",
sha256 =
"d8dcd6b66492db37e48b95535cf3bf91b1b0f356fedba403eb73f81158e0cd4d",
),
"byteset":
struct(
version = "0.1.1.0",
sha256 =
"13499c5b279f022097e9ae1d0aeef3fcea12b7f18f50157d4950aec58741afa1",
),
"bytestring-builder":
struct(
version = "0.10.8.1.0",
sha256 =
"6d7404773621efb88b256ff88912a7... | |
from torch.nn.utils.rnn import pad_sequence
from torchsummary import summary
from gensim.models import Word2Vec
from scipy.sparse import csr_matrix
from scipy.sparse import vstack as s_vstack
import os
import time
import argparse
import warnings
from random_walk import random_walk
from random_walk_hyper import random... | |
# encoding: utf-8
import os, re, types
from contextlib import contextmanager
from collections import namedtuple
from os.path import exists, expanduser
from objc import super
from .lib.cocoa import *
from .lib import pathmatics
from .util import _copy_attr, _copy_attrs, _flatten, trim_zeroes, numlike, autorelease
from ... | |
lamp using a backwards long jump and end up in a parallel dimension in another room...")
print()
if dead == True:
print("Congratulations! You've been possessed by an ancient evil!")
print("Don't mess with cursed objects kids!")
print("Better luck next time! Try again by hitting the green play button in the top ri... | |
#!/usr/bin/env python
import sys
import os
from datetime import datetime
import time
import json
import sandboxclient as sbclient
import platformclient as pltclient
import monitorclient as monclient
from client.rest import ApiException
from pprint import pprint
from client.models.event_mobility import EventMobility
... | |
import re
from datetime import timedelta
from enum import Enum
from typing import Union, Tuple, List
from django.apps import apps
from django.core import exceptions
from django.conf import settings
from django.db.models import F, Count, Min, Max, Sum, Value, Avg, ExpressionWrapper, DurationField, FloatField, Model, JS... | |
<filename>PyFVCOM/ll2utm.py<gh_stars>1-10
#!/usr/bin/env python
# Lat Long - UTM, UTM - Lat Long conversions
# Adjusted for use with NumPy by <NAME> <pica {at} pml.ac.uk>
import inspect
import numpy as np
from warnings import warn
# LatLong- UTM conversion..h
# definitions for lat/long to UTM and UTM to lat/lng c... | |
pre_run_cmd, ex_sql) = global_sh_executor.extract_sh_cmd('@pre_run', sql)
if found_hd:
sql = ex_sql
else:
(found_hd, post_run_cmd, ex_sql) = global_sh_executor.extract_sh_cmd('@post_run', sql)
if found_hd:
sql = ex_sql
if not flag:
if sql.startswith('!'):
sql = sql[1:]
# Check for execution mode. E.g.
# !\... | |
Island', 'Ngau Island', 'Fiji'],
['NGL', 'Ngala', 'Ngala Airfield', 'South Africa'],
['NGM', 'Guam', 'Agana NAS', 'Guam'],
['NGN', 'Nargana', 'Nargana', 'Panama'],
['NGO', 'Nagoya', 'Komaki AFB', 'Japan'],
['NGP', 'Corpus Christi (TX)', 'NAS', 'USA'],
['NGR', 'Ningerum', 'Ningerum', 'Papua New Guinea'],
['NGS', ... | |
len(tier) == 4})
# full dispersion requires zone two's devices to eat more than
# they're weighted for
self.assertAlmostEqual(rb.get_required_overload(), 0.095238,
delta=1e-5)
# so... if we give it enough overload it we should get full dispersion
rb.set_overload(0.1)
target_replicas = rb._build_target_replicas... | |
# Copyright 2019-2020 Xanadu Quantum Technologies 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 agr... | |
= species_dict[desired_species]
metadata_dict_list = ibs.get_annot_metadata(aid_list)
excluded_list = [
metadata_dict.get('excluded', False) for metadata_dict in metadata_dict_list
]
new_aid_list = ut.compress(aid_list, ut.not_list(excluded_list))
new_aid_list = list(set(new_aid_list))
return new_aid_list
@r... | |
<gh_stars>0
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.interpolate import CubicHermiteSpline as cbs
from matplotlib.gridspec import GridSpec
from numpy import trapz
import matplotlib as mpl
from scipy.ndimage.filters import uniform_filter1d
mpl.rcParams["axes.spines.top"] = True... | |
the name is in the format "[lost] labmac-1" the sorting name is stored as
# "labmac-1a" to differentiate it from "labmac-1"
# the values are added to a list containing the previously processed values as
# [sorting name, computer name, jamf id]
for node in response_json['computers']:
match_id = node['id']
match_na... | |
# -*- coding: utf-8 -*-
# Copyright 2016 Dravetech AB. All rights reserved.
#
# The contents of this file are 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/LI... | |
<filename>bin/multip.py
#!/usr/local/bin/python
import glob, os, re, sys
import basics
import config
import imglib
import mbdata
import models
import useful
# ---------------------------------------------------------------------
# columns, colspan, rowspan, picsize
# columns and picsize MUST NOT exceed 4!
pack_layou... | |
import os
import sys
import string
import random
import time
import subprocess
import traceback
from time import sleep
import json
def getReportID():
seed = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
sa = []
for i in range(8):
sa.append(random.choice(seed))
salt = ''.join(sa)
return salt
... | |
points',
va='bottom',ha='left',fontsize=7,color='black')
f_max = f.squeeze().to_series().groupby(lambda x: x.date).max()
f_min = f.squeeze().to_series().groupby(lambda x: x.date).min()
ax.fill_between(x=f_max.index, y1=f_min, y2=f_max,
color='k', lw=0.0, alpha=0.15, zorder=0)
# plt.show()
if with_era:
plt.sh... | |
<reponame>esovm/asmbf<filename>ide/src/bfstudio.py
#!/usr/bin/env python3
# ___ ___ ___ ___ __ __ ___ _____ _ _ ___ ___ ___
# | _ ) | __| / \ / __| | \/ | / __| |_ _| | | | | | \ |_ _| / _ \
# | _ \ | _| | - | \__ \ | |\/| | \__ \ | | | |_| | | |) | | | | (_) |
# |___/ |_| |_|_| |___/ |_|__|_| |___/ |_| \___/ |___/ |__... | |
'''Define the tasks and code for loading their data.
- As much as possible, following the existing task hierarchy structure.
- When inheriting, be sure to write and call load_data.
- Set all text data as an attribute, task.sentences (List[List[str]])
- Each task's val_metric should be name_metric, where metric is retu... | |
<filename>src/client/main.py
#!/usr/bin/env python2.7
import pprint
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import json
import datetime
import time
import logging
from random import randrange
from shared import liburl_wrapper
from shared.liburl_wrapper import safe_pushtx
f... | |
are returned:
* *PAGE* - Contains a list of child Block objects that are detected on a document page.
* *KEY_VALUE_SET* - Stores the KEY and VALUE Block objects for a field that's detected on a document page. Use the ``EntityType`` field to determine if a KEY_VALUE_SET object is a KEY Block object or a VALUE Block o... | |
""" Account.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import AlreadyExists
from ambra_sdk.exceptions.service import BadPassword
from ambra_sdk.exceptions.service import ByNotFound
from ambra_sdk.exceptions.service import CanNotPromote
from ... | |
constraint_id={constraint_id} group_id={group_id} ioption={ioption} flag={flag}')
n += ntotal0
if flag == 1:
# plane symmetry
constraint_type = 'SYMP'
# 5 X RS X axis of point on plane
# 6 Y RS Y axis of point on plane
# 7 Z RS Z axis of point on plane
# 8 N1 RS X component of vector normal to plane
# 9 N2 RS ... | |
# coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from openlatti... | |
pass
def add_owner(self, kr, feed_id_lst): # must be owner
# to owners: box{'app' = 'encrgrp', 'cmd':'add', .. feed_ID}
# to new o: box{'app' = 'encrgrp', 'cmd':'joined',
# 'display':'name', hkey, dkey, list_of_owners}
# to all members: sch{}
pass
def del_member(self, kr, feed_id): # must be owner
# to owners... | |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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 re... | |
#!/usr/bin/env python
import io
import json
import logging
import pathlib
import zipfile
from types import SimpleNamespace
import boto3
import botocore
import click
import click_log
import retrying
from config import config
logger = logging.getLogger(__name__)
class AWS:
class LeftoversError(Exception):
pass
... | |
admin_sprint_name = "admin_user_sprint"
admin_user_dict = self.aux_find_user_by_user_name(admin_user_name)
admin_user_auth = self.aux_get_user_authorization(admin_user_name, admin_user_name)
create_sprint_response = self.aux_create_sprint_for_user(admin_sprint_name, admin_user_dict["id"],
admin_user_auth)
self.ass... | |
"""
Script to make readable Planelight.dat.YYYYMMDD input files for GEOS-Chem
and read in outputted planeflight.log files in as pandas dataframes with
option to concatenate files.
Created on Sun Mar 21 14:21:14 2021
@author: Dr. <NAME>
"""
import pandas as pd
from astropy.io import ascii ass asc # For ... | |
<reponame>llinke1/TreeCorr
# Copyright (c) 2003-2019 by <NAME>
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, t... | |
self.refFrame.getLookAtMatrix(camPosition[0], camPosition[1], camPosition[2], lookPoint[0], lookPoint[1], lookPoint[2], 0, 1, 0)
#viewMatrix = matrix.Matrix.matIdent()
#print "viewMatrix\n{}".format(viewMatrix)
# =====================================================================
# Projection matrix
# ========... | |
<reponame>arielleoren/clearml<gh_stars>1000+
"""
events service
Provides an API for running tasks to report events collected by the system.
"""
import enum
import six
from ....backend_api.session import BatchRequest, CompoundRequest, NonStrictDataModel, Request, Response, \
schema_property, StringEnum
class Metri... | |
= Low bound for b_iso search
.help = Low bound for b_iso search.
search_b_max = 300
.type = float
.short_caption = High bound for b_iso search
.help = High bound for b_iso search.
search_b_n = 21
.type = int
.short_caption = Number of b_iso values to search
.help = Number of b_iso values to search.
residua... | |
# coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the Logarithmic Units and Quantities
"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ...extern import six
from ...extern.six.moves import zip
import pickle
import itertools
import ... | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Gui Control Panel
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#--
def CtlPanelInit(self, parent, row, column):
""" Create the Navigator frame.
Parameters:
parent - parent to this frame
row - grid row in parent
... | |
<filename>c7n/resources/dynamodb.py
# Copyright 2016-2019 Capital One Services, 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 r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.