input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>python/nvh.py
#!/usr/bin/python3
# Copyright (c) 2019-2022 Lexical Computing: <NAME>, <NAME>, <NAME>, <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,... | |
<reponame>aParthemer/MidiCompose
from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass, field, Field
from itertools import cycle
from typing import Set, List, Union, Sequence, Tuple, Any, Optional
from enum import Enum
from icecream import ic
from MidiCompose.logic.harmony.int... | |
import enum
import logging
import pathlib
import random
from abc import abstractmethod
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import cloudpickle
import numpy as np
import torch
import torch.nn as nn
import determined as det
from determined import horovod, ipc, util, workload
from determined.... | |
(?,?)", (self.mcqs, self.email))
cur.execute(f"SELECT QDes FROM CalculusOb WHERE Email = '{self.email}';")
result = cur.fetchall()
print(result)
conn.commit()
conn.close()
else:
print("yes")
cur.execute("CREATE TABLE IF NOT EXISTS CalculusSub (QDes TEXT NOT NULL, Email TEXT NOT NULL, FOREIGN KEY (Em... | |
template_name = 'agile_board.html'
def get(self, request, **kwargs):
if request.method == 'GET':
return render(request, self.template_name, context = None)
class timeline_2(TemplateView):
"""docstring for timeline_2."""
template_name = 'timeline_2.html'
def get(self, request, **kwargs):
if request.method == 'GE... | |
self.decompose_nuktas:
# decomposing Nukta based composite characters
text=text.replace('\u09dc','\u09a1'+BengaliNormalizer.NUKTA)
text=text.replace('\u09dd','\u09a2'+BengaliNormalizer.NUKTA)
text=text.replace('\u09df','\u09af'+BengaliNormalizer.NUKTA)
else:
# recomposing Nukta based composite characters
text=te... | |
to the list values
>>> stack = la.constructs.Stack(dft.FeatureInput)
>>> stack_extended = stack_object.add_materials(stack_dict, ['HA', 'PSu'])
>>> stack_extended
defaultdict(<class 'list'>,
{1: ['outer', 400.0, 'HA'], 2: ['inner', 200.0, 'PSu'],
3: ['middle', 800.0, 'HA'], 4: ['inner', 200.0, 'PSu'],
5: ['outer... | |
<gh_stars>0
from EXOSIMS.Prototypes.OpticalSystem import OpticalSystem
from EXOSIMS.OpticalSystem.Nemati import Nemati
import astropy.units as u
from astropy.io import fits
import astropy.constants as const
import numpy as np
import scipy.stats as st
import scipy.optimize as opt
import os
from scipy import interpolate
... | |
import json
import uuid
from os import path
from atom.ext.django_filters.views import UserKwargFilterSetMixin
from atom.views import (
CreateMessageMixin,
DeleteMessageMixin,
UpdateMessageMixin,
ActionView,
ActionMessageMixin,
)
from braces.views import (
MessageMixin,
FormValidMessageMixin,
SelectRelatedMixin,... | |
<filename>appserver/neo4japp/blueprints/projects.py
from typing import List, Optional, Tuple, Dict, Iterable
from flask import jsonify, Blueprint, g
from flask.views import MethodView
from marshmallow import ValidationError
from sqlalchemy import and_
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm impor... | |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: menu.py
# Purpose:
#
# Author: wukan
#
# Created: 2019-01-16
# Copyright: (c) wukan 2019
# Licence: GPL-3.0
#-------------------------------------------------------------------------------
import ... | |
converted and there now can be duplicates (same _id)
# (ex: mygene, ensembl -> entrez conversion). "docs" could produce a duplicated error
# within the batch, so we need to remove duplicates.
all_ids = [d["_id"] for d in docs]
uniq_ids = set(all_ids)
if len(all_ids) != len(uniq_ids):
logging.warning("Found duplic... | |
line = word
word_width = f.size(word)[0]
line_width = word_width
# Some part of a line might be left.
if line:
new_lines.append(line)
line = ""
line_width = 0
else:
# A blank line is being added to old_text.
new_lines = list(old_text)
new_lines.append("")
# Check if height is calculated:
if return_heig... | |
y)
if self.multimetric_:
score = score[self.refit]
return score
@if_delegate_has_method(delegate=('best_estimator_', 'estimator'))
def score_samples(self, X):
"""Call score_samples on the estimator with the best found parameters.
Only available if ``refit=True`` and the underlying estimator supports
``score_sa... | |
from __future__ import annotations
from typing import Union, Optional
import importlib
import os
import pathlib
from enum import Enum
from route import quick_invalid, write, Cause
from route import error as e
class Method(Enum):
GET = "GET"
HEAD = "HEAD"
TRACE = "TRACE"
OPTIONS = "OPTIONS"
CONNECT = "CONNECT"
... | |
u"ru"
for char in u"마":
self.trans[char] = u"ma"
for char in u"니":
self.trans[char] = u"ni"
for char in u"아":
self.trans[char] = u"a"
for char in u"독":
self.trans[char] = u"dok"
for char in u"일":
self.trans[char] = u"il"
for char in u"모":
self.trans[char] = u"mo"
for char in u"크":
self.trans[char] = u"keu... | |
based on model data
class ModelFilterParser(HasAModelManager):
"""
Converts string tuples (partially converted query string params) of
attr, op, val into either:
- ORM based filters (filters that can be applied by the ORM at the SQL
level) or
- functional filters (filters that use derived values or values not
w... | |
:returns: role info
:rtype: :class:`~c4.system.configuration.RoleInfo`
"""
# check if role exists
roleName = role.role.name
roleInfo = self.getRoleInfo(role.role)
if roleInfo is None:
roleKey = "{base}/{role}".format(base=self.ROLES, role=roleName)
self.client.put(roleKey, serialize(role))
else:
# we are alre... | |
<gh_stars>1-10
"""
Provides the following multilateral methods:
* :func:`time_dummy`
* :func:`geary_khamis`
* :func:`geks`
paired with
* :func:`carli`
* :func:`jevons`
* :func:`dutot`
* :func:`laspeyres`
* :func:`paasche`
* :func:`geom_laspeyres`
* :func:`geom_paasche`
* :func:`drobish`
* :func:`marshall_edge... | |
The time at which the partition was created.
- **LastAccessTime** *(datetime) --*
The last time at which the partition was accessed.
- **StorageDescriptor** *(dict) --*
Provides information about the physical location where the partition is stored.
- **Columns** *(list) --*
A list of the ``Columns`` in the tab... | |
import datetime
import numpy as np
from fixed_params import *
import utils
def get_transition_sigmoid(inflection_day, rate_of_inflection, init_r_0, lockdown_r_0):
"""Returns a sigmoid function based on the specified parameters.
A sigmoid helps smooth the transition between init_r_0 and lockdown_r_0,
with the mi... | |
<reponame>CodeLionX/CommentSearchEngine
import os
import re
import functools
from cse.lang import PreprocessorBuilder
from cse.lang.PreprocessorStep import PreprocessorStep
from cse.indexing import (FileIndexer, IndexReader, DocumentMap)
from cse.indexing import DOCUMENT_MAP_NAME, DOCUMENT_MAP_DICT_NAME
from cse.reade... | |
<gh_stars>10-100
# Copyright 2021 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 law or agreed to ... | |
if m:
# Get keys
if m.groupdict()['status_codes']:
status_codes = m.groupdict()['status_codes']
path_type = ''
if m.groupdict()['path_type']:
path_type = str(m.groupdict()['path_type'])
if path_type:
status_codes = status_codes + path_type
else:
status_codes = status_codes.rstrip()
if m.groupdict()['prefix'... | |
#!/usr/bin/env python
## Copyright 2002-2010 by PyMMLib Development Group (see AUTHORS file)
## This code is part of the PyMMLib distribution and governed by
## its license. Please see the LICENSE file that should have been
## included as part of this package.
from __future__ import generators
import sys
import getopt... | |
import requests, re
from typing import List, Optional, Tuple, Literal
#----- Some useful data -----#
regex_version = r'<div class=\"version\">[^<]+<br/>\s*<[^>]+>\s*([^<\n\r]+)\s*</a>'
timeout = 5
#----- Errors management -----#
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class M... | |
< len_y:
# インクリメントしていき全部を舐めていく(effective_lengthずつ飛ばしているけど良い??)
y__ = y[i:i+effective_length]
if effective_length > len(y__):
break
else:
y_.append(y__)
i = i + int(effective_length)
y = np.stack(y_) # (effective_length, 2N)
label = np.zeros(24, dtype='f')
# y: clip nums, seq -> clip_nums, width, height
ret... | |
<reponame>jyothish6190/sift-python
import datetime
import warnings
import json
import mock
import sift
import unittest
import sys
import requests.exceptions
if sys.version_info[0] < 3:
import urllib
else:
import urllib.parse as urllib
def valid_transaction_properties():
return {
'$buyer_user_id': '123456',
'$sel... | |
Return the poset of equivalence classes of the subsets of ``self``.
Each element of the poset is a set of :class:`ManifoldSubset` instances,
which are known to be equal.
INPUT:
- ``open_covers`` -- (default: ``False``) whether to include vertices for open covers
- ``points`` -- (default: ``False``) whether to i... | |
self.connection and self.connection.is_open:
log.debug('Stopping watcher task')
self._watch_stopping.set()
await self._watch_stopped.wait()
log.debug('Closing model connection')
await self.connection.close()
self.connection = None
async def add_local_charm_dir(self, charm_dir, series):
"""Upload a local charm ... | |
<filename>tf_agents/synthetic_experiment.py
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
os.environ["TF_FORCE_GPU_ALLOW_GROWTH"]="true"
import numpy as np
from matplotlib import pyplot as plt
import tensorflow as tf
from tqdm.notebook import tqdm
tf.compat.v1.enable_v2_behavior()
from tf_agents.curiosity import ... | |
# Copyright 2013 Red Hat, Inc.
# 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 or a... | |
<reponame>pppyykknen/LFDisplay-PyTorch
import torch
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
def sign(x):
return torch.sign(x)
class Display:
def __init__(self, observerPositions, height=600, width=800, diffusionPower=[40, 0], halfPhysSize=[200, 150],
viewerDistance=40... | |
E.isModellingError(x,y) :
# previously modelled as 0, we fix the error
E.delModellingError(x,y);
else :
E.delUnmodelledError(x,y);
E.cover(x,y);
else :
if E.isCovered(x,y) :
if not E.isModellingError(x,y) :
E.addModellingError(x,y);
else :
E.addModellingError(x,y);
E.cover(x,y)
if config.... | |
# -*- coding: utf-8 -*-
from .. import config
from .utils import *
from .._constants import *
import theano
import theano.tensor as tt
import numpy as np
from scipy.linalg import block_diag as scipy_block_diag
import theano.tensor.slinalg as sla
import scipy
__all__ = ["lazy_math", "greedy_math", "lazy_linalg", "greed... | |
if s_rep is None or not s_rep.is_present() or \
(not n_rep.is_ro() and s_rep.is_partial()):
t_repsFrom.to_be_deleted = True
continue
# If the KCC did not remove t from n!repsFrom, it updates t
self.modify_repsFrom(n_rep, t_repsFrom, s_rep, s_dsa, cn_conn)
# Loop thru connections and add implied repsFrom tuples... | |
import types
import time
import hashlib
import re
from urlparse import urljoin
from threading import Lock
from externals.reqresp import Request
from framework.core.myexception import FuzzException
from framework.fuzzer.base import BaseFuzzRequest
class FuzzRequest(BaseFuzzRequest, Request):
def __init__(self):
Requ... | |
<reponame>Data-Science-in-Mechanical-Engineering/joint_state_dynamics_estimation_HGOs_GPs
import logging
import os
import shutil
import sys
import GPy
import numpy as np
import pandas as pd
import seaborn as sb
from config import Config
from controllers import sin_controller_02D
from dynamics import dynamics_traj, du... | |
0x31, 0x00,
0x30, 0x00, 0x31, 0x00, 0x31, 0x00, 0x30, 0x00,
0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x31, 0x00,
0x31, 0x00, 0x31, 0x00, 0x31, 0x00, 0x31, 0x00,
0x31, 0x00, 0x31, 0x00, 0x31, 0x00, 0x31, 0x00,
0x31, 0x00, 0x31, 0x00, 0x31, 0x00, 0x31, 0x00,
0x31, 0x00, 0x31, 0x00, 0x31, 0x00, 0x30, 0x00,
0x30, 0x00, 0... | |
_sjcl.codec.base32.REMAINING;
var out = "", i, bits=0, c = _sjcl.codec.base32._chars, ta=0, bl = _sjcl.bitArray.bitLength(arr);
if (_hex) {
c = _sjcl.codec.base32._hexChars;
}
for (i=0; out.length * BASE < bl; ) {
out += c.charAt((ta ^ arr[i]>>>bits) >>> REMAINING);
if (bits < BASE) {
ta = arr[i] << (BASE-bit... | |
from . import ClientCaches
from . import ClientConstants as CC
from . import ClientGUIFunctions
from . import ClientGUIMenus
from . import ClientGUIShortcuts
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusGlobals as HG
import os
from qtpy import QtCore as... | |
<reponame>oliverbritton/drg-pom
# neuron_biomarkers.py
# calculation of AP biomarkers from neuronal voltage traces
import sys
import numpy as np
import pandas as pd
from scipy import optimize
from matplotlib import pyplot as plt
from . import davidson_biomarkers as db
from .. import simulation_helpers as sh
from .. i... | |
new_context_layer_shape = context_layer.size()[:-2] + (self.all_head_size,)
context_layer = context_layer.view(*new_context_layer_shape)
return context_layer, attention_probs
class BertSelfOutput(nn.Module):
def __init__(self, config):
super(BertSelfOutput, self).__init__()
self.dense = nn.Linear(config.hidden... | |
<filename>archive/scripts/make_features.py
import numpy as np
import math
from scipy import stats
from scipy import signal
import sys
from scipy.signal import butter, lfilter, filtfilt
from matplotlib import pyplot as plt
import os.path
data_path = '../data/cleaned_data/'
save_path = '../data/features/'
DT_SCORES = 3... | |
+= ' -o %s' % self._prop['output_file']
if self._prop['quiet']:
cmd += ' -v 0' # verbosity level 0 (warnings and errors only)
return cmd
def _any2any(self, files, basename='tmp_easyviz_',
size=None, ofile_ext='.pnm'):
"""Convert a list of files to the file format specified in the
ofile_ext keyword argument. Usi... | |
# ===============================================================================
# Copyright 2016 dgketchum
#
# 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... | |
<gh_stars>0
'''
----------------------------------------------------------------------------
This file is part of the Sanworks Pulse Pal repository
Copyright (C) 2016 Sanworks LLC, Sound Beach, New York, USA
----------------------------------------------------------------------------
This program is free software: y... | |
<filename>pynetdicom/test/test_ae.py
#!/usr/bin/env python
import logging
import threading
import unittest
from unittest.mock import patch
from pydicom.uid import UID, ImplicitVRLittleEndian
from pynetdicom import AE
from pynetdicom import VerificationSOPClass, StorageSOPClassList, \
QueryRetrieveSOPClassList
logg... | |
# Copyright 2016 Google Inc. 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 or agree... | |
#
# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under ... | |
<gh_stars>0
#!/usr/bin/env python3
import sys
import os
import re
import argparse
import pathlib
import gzip
import threading
from joblib import Parallel, delayed
# These are the effects we need to focus on.
EFFECTS = [
'frameshift_variant',
'exon_loss_variant',
'duplication',
'inversion',
'feature_ablation',
... | |
showarrow=False))
return annotations
def get_perpendicular_bar(self, bar_vals, i, layout):
if isinstance(self.perpendicular_bar_func, str):
val = pd.Series(bar_vals).agg(self.perpendicular_bar_func)
else:
values = self.df_values.iloc[i]
ranks = self.df_ranks.iloc[i]
val = self.perpendicular_bar_func(values, r... | |
z in currentConcensusFeature:
try:
currentConcensusFeatureFilled.append( float (z) )
except ValueError:
currentConcensusFeatureFilled.append( float(0) )
if HeavyResidue == Missing_cleavages + 1 or HeavyResidue == 0:
#if info_in_line[8] == "1":
if charge_state not in charge_states_seen:
for c in range(numCond... | |
<reponame>SaladDais/LSO2-VM-Performance<filename>indra/llcorehttp/tests/test_llcorehttp_peer.py
#!/usr/bin/env python
"""\
@file test_llsdmessage_peer.py
@author <NAME>
@date 2008-10-09
@brief This script asynchronously runs the executable (with args) specified on
the command line, returning its result code. While tha... | |
= True
for DS_i in range(1, 16):
if not pd.isna(df_db.loc[cmp, f'DS{DS_i}-Family']):
empty = False
break
if empty:
cmp_to_drop.append(cmp)
df_db.drop(cmp_to_drop, axis=0, inplace=True)
cmp_kept = df_db.index.get_level_values(0).unique()
cmp_to_drop = []
for cmp in meta_dict.keys():
if cmp not in cmp_kept... | |
from config import TOKEN, unknown, stickers, FAQ_list_inline, list_answers
from states import SVO
from aiogram.dispatcher import FSMContext
from aiogram import Bot, Dispatcher, executor, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from aiogram.types... | |
the
minimum of multiplicitie of the left and right hand side.
'''
items = list(self.__items)
isect = []
for item in other:
try:
items.remove(item)
except ValueError:
pass
else:
isect.append(item)
return frozenmultiset(isect)
def __add__(self, other):
'''
Return a :class:`frozenmultiset` with elements f... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
가지치기 기법(Pruning) 튜토리얼
=====================================
**저자**: `<NAME> <https://github.com/mickypaganini>`_
**번역** : `안상준 <https://github.com/Justin-A>`_
최첨단 딥러닝 모델들은 굉장히 많은 수의 파라미터값들로 구성되기 때문에, 쉽게 배포되기 어렵습니다.
이와 반대로, 생물학적 신경망들은 효율적으로 희소하게 연결된 것으로 알려져 있습니다.
모델의 정확도가 손상되지... | |
true if the left Variable default value is less than or equal to the
right Variable default value. False otherwise.
DOCTEST
=======
>>> w = Variable('x',5)
>>> x = Variable('x',5)
>>> y = Variable('y',3)
>>> z = Variable('z',5)
>>> w == x
True
>>> x == z
False
>>> x == y
False
>>> x > y
True
>>> x < w... | |
# coding=utf-8
#
# Copyright 2017 Google Inc. 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 applic... | |
import math
import time
import sys
from PyQt4 import QtGui, QtCore
import serial
import new_era_vp as new_era
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
import pdb
# ToDo | 1. Add email address for sending email when done (only works if
# ToDo | connected... | |
<reponame>edupo/python-ivi
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014-2016 <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 wit... | |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
#from gym.wrappers.monitoring import VideoRecorder
import gym
from dotmap import DotMap
import time
import sys
import re
import multiprocessing
import os.path as osp
import gym
from collecti... | |
be dense (contain all bits) or sparse (just the on
bits).
use_pharm_features : bool (default=False)
Switch to use pharmacophoric features as atom representation instead of
explicit atomic numbers etc.
Returns
-------
fingerprint : numpy array
Calsulated FP of fixed size (dense) or on bits indices (sparse). Dt... | |
import open3d as o3d
import os, sys
import argparse
import random
from tqdm import tqdm
import numpy as np
import pandas as pd
import cv2
import torch
import pickle
import time
from pathlib import Path
from omegaconf import DictConfig, OmegaConf
from torch.utils.data import Dataset, DataLoader
from ossid.models.dtoi... | |
from __future__ import unicode_literals
import json
import datetime
import pytz
import requests
from dateutil.relativedelta import relativedelta
from django.contrib.gis.db.models.fields import PointField
from django.contrib.gis.db.models.manager import GeoManager
from django.contrib.gis.geos import GEOSGeometry
from ... | |
<reponame>bogdankostic/flair<gh_stars>1-10
import time, datetime
import random
import sys
from pathlib import Path
from typing import Union
from torch import cuda
from torch.utils.data import Dataset, DataLoader
from torch.optim.sgd import SGD
try:
from apex import amp
except ImportError:
amp = None
import flair
f... | |
"баскыһыанньа 14 балаҕан ыйа 1998", "sunday 14 september 1998"),
# saq
param('saq', "1 lapa le okuni 1980 kun 10:45 tesiran", "1 march 1980 monday 10:45 am"),
param('saq', "mderot ee inet 12 lapa le ong'wan 1824", "wednesday 12 april 1824"),
# sbp
param('sbp', "1 mupalangulwa mulungu 08:15 lwamilawu", "1 january... | |
u'finished',
'builder': mock.ANY,
})
def test_api_failure_on_error_in_exit(self):
response = Mock(status_code=500, reason='Internal Server Error')
self.mocks.configure_mock('docker_client', {
'kill.side_effect': BuildEnvironmentError('Failed')
})
build_env = DockerBuildEnvironment(
version=self.version,
pro... | |
# -------------------------------------------------------------------------
# Copyright (c) <NAME>. All rights reserved.
# Licensed under the Apache License, Version 2.0. See
# License.txt in the project root for license
# information.
# ---------------
"""
The sync selection is used to prepare one or more directories... | |
TT as a two-part Julian date.
:type date1, date2: float
:returns: combined precessoin/nutation matrix, as a numpy.matrix of shape \
3x3.
.. seealso:: |MANUAL| page 173
"""
rmatpn = _np.asmatrix(_np.zeros(shape=(3,3), dtype=float, order='C'))
_sofa.iauPnm80(date1, date2, rmatpn)
return rmatpn
# iauPom00
_sof... | |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set ts=4 sw=4 et sts=4 ai:
from __future__ import print_function
import binascii
import crcmod
import ctypes
import enum
import math
import re
import sys
from utils import *
# Remove after https://bugs.python.org/issue19023 is fixed.
assert sys.byteo... | |
<reponame>Joshuaalbert/neural_deprojection<gh_stars>0
import sys
sys.path.insert(1, '/data/s1825216/git/neural_deprojection/')
from neural_deprojection.models.identify_medium_SCD.generate_data import generate_data, decode_examples_old
from neural_deprojection.graph_net_utils import vanilla_training_loop, TrainOneEpoc... | |
Global command to configure PortChannel Graceful shutdown and interface specific gshut configs
:param dut:
:param kwargs:
:return:
Usage:
config_po_graceful_shutdown(dut1)
config_po_graceful_shutdown(dut1,exception_po_list='PortChannel10')
config_po_graceful_shutdown(dut1,config_mode='del')
config_po_graceful_... | |
exponential.
:param rate: the rate of the Exponential with either the same shape as specified for this vertex or scalar
"""
return Double(context.jvm_view().ExponentialVertex, label, cast_to_double_vertex(rate))
def Gamma(theta: vertex_constructor_param_types, k: vertex_constructor_param_types, label: Optional[s... | |
range(len(feats), len(feats) + len(oth))]
names.append(self.names)
names = np.hstack(names)
return Features(feats, n_pts=n_pts, categories=cats, names=names)
return NotImplemented
############################################################################
### Properties to get at the basic data
@property
d... | |
bigquery_options is not None:
pulumi.set(__self__, "bigquery_options", bigquery_options)
if description is not None:
pulumi.set(__self__, "description", description)
if destination is not None:
pulumi.set(__self__, "destination", destination)
if disabled is not None:
pulumi.set(__self__, "disabled", disabled)
i... | |
<reponame>NCAR/lrose-uw-general
#!/usr/bin/env python
#===========================================================================
#
# Produce plots for ZDR bias by volume - paper
#
#===========================================================================
import os
import sys
import subprocess
from optparse import... | |
# deafrica_classificationtools.py
'''
Description: This file contains a set of python functions for conducting
machine learning classification on remote sensing data from Digital Earth
Africa's Open Data Cube
License: The code in this notebook is licensed under the Apache License,
Version 2.0 (https://www.apache.org/l... | |
= self.tetrahedronList[TN].nodes[1]
newNodes[1] = self.tetrahedronList[TN].nodes[2]
self.tetrahedronList[TN].nodes = newNodes
def finalize(self):
self.buildLists()
#self.fixLocalNumbering()
self.buildBoundaryMaps()
self.buildArraysFromLists()
self.hMax = 0.0
self.hMin = 1.0e16
self.sigmaMax = 0.0
self.totalV... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 requ... | |
2, 'probable', 'SRC12'),
Source(13, 'Source 13', 3, 'contested', 'SRC13'),
Source(14, 'Source 14', 3, None, 'SRC14'),
Source(15, 'Source 15', 1, None, 'SRC15'),
Source(16, 'Source 16', 2, 'probable', 'SRC16'),
Source(17, 'Source 17', 3, 'certain', 'SRC17'),
Source(18, 'Source 18', 2, 'probable', 'SRC18'),
Source... | |
<filename>src/pymor/core/cache.py
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
"""This module provides the caching facilities of pyMOR.
Any cl... | |
by_value=True, missing=None, data_key="paymentState"
)
class Meta:
unknown = marshmallow.EXCLUDE
@marshmallow.post_load
def post_load(self, data):
del data["action"]
return types.StagedOrderChangePaymentStateAction(**data)
class StagedOrderChangeShipmentStateActionSchema(StagedOrderUpdateActionSchema):
"Mar... | |
<gh_stars>1-10
""" Read in cluster from Nbody simulations or generate an Nbody cluster
"""
__author__ = "<NAME>"
__all__ = [
"load_cluster",
"advance_cluster",
]
import numpy as np
try:
from galpy.util import conversion
except:
import galpy.util.bovy_conversion as conversion
import os, struct
from .cluster impo... | |
<reponame>NCRAR/psiaudio
import pytest
from collections import Counter, deque
import numpy as np
from psiaudio.calibration import FlatCalibration
from psiaudio.pipeline import extract_epochs
from psiaudio.queue import FIFOSignalQueue, InterleavedFIFOSignalQueue
from psiaudio.stim import Cos2EnvelopeFactory, ToneFact... | |
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import plotly.express as px
import geopandas as gpd
from scipy import stats
from shapely.geometry import Polygon, MultiPoint
import json
from sklearn.cluster import DBSCAN
from geopy.distance import great_circle
from branca.c... | |
cell size units
identifiers (:obj:`list` of :obj:`Identifier`): identifiers
conclusions (:obj:`list` of :obj:`Conclusion`): conclusions
comments (:obj:`str`): comments
references (:obj:`list` of :obj:`Reference`): references
Related attributes:
* dfba_obj_expression (:obj:`DfbaObjectiveExpression`): dFBA object... | |
graph we expect to have built through
subdivision::
sage: paths2 = [2 + k, 5 + k, 9 + k]
sage: paths2 = map(graphs.PathGraph, paths2)
sage: g2 = Graph()
sage: for P in paths2:
....: g2 = g2 + P
sage: g.is_isomorphic(g2)
True
.. SEEALSO::
- :meth:`subdivide_edge` -- subdivides one edge
"""
if isinstance(e... | |
<reponame>GIS-PuppetMaster/TENSILE<filename>pycode/tinyflow/Inceptionv3_test_leo.py<gh_stars>0
import os
GPU = 0
os.environ['CUDA_VISIBLE_DEVICES'] = f'{GPU}'
import sys
sys.path.append('../../')
from pycode.tinyflow import autodiff as ad
from pycode.tinyflow.get_result import get_result
from util import *
class Ince... | |
<reponame>getzneet/transcoded-rhythm-recognition
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Multi-layer Perceptron
# By <NAME>, based on a Nicolas Rougier's program, distributed under the terms of the BSD License.
# --------------------------------------... | |
être fourni",
},
{
"language": "nl",
"use": {
"code": "display",
"system": "http://terminology.hl7.org/CodeSystem/designation-usage",
},
"value": "Ontbrekende identificatie in transactie - entry.id is verplicht",
},
{
"language": "zh",
"use": {
"code": "display",
"system": "http://terminology.hl7.org/Code... | |
<gh_stars>0
def NEXAFS_S_edge(t=0.5):
yield from bps.mv(waxs, 65)
dets = [pil300KW]
name = 'su8_ne'
energies = np.linspace(2430, 2520, 91)
det_exposure_time(t,t)
name_fmt = '{sample}_{energy}eV_xbpm{xbpm}'
for e in energies:
yield from bps.mv(energy, e)
yield from bps.sleep(1)
bpm = xbpm3.sumX.value
... | |
# on the host, lstat won't try to follow symlinks
rstat = os.lstat(filename)
except:
rstat = os.stat(filename)
return rstat[:7] + tuple(tim + TIME_OFFSET for tim in rstat[7:])
def stat(filename):
"""Returns os.stat for a given file, adjusting the timestamps as appropriate."""
import os
rstat = os.stat(filename... | |
import xarray as _xr
import copy as _copy
import xgcm as _xgcm
import numpy as _np
import warnings as _warnings
import sys as _sys
from . import compute as _compute
from . import plot as _plot
from . import animate as _animate
from . import utils as _utils
from . subsample import _subsampleMethdos
from . compute impor... | |
new_iface)
if (bad_scenario_type != bad_scenario_ack_req_session_not_set_up and
bad_scenario_type != bad_scenario_ack_resp_session_not_set_up):
if (bad_scenario_type != bad_scenario_ack_req_session_not_established_init_side and
bad_scenario_type != bad_scenario_ack_resp_session_not_established_init_side and
bad_sc... | |
along axis=0 (first index).
Image sequences are stored in three-dimensional arrays, in rows, columns and frames.
Not all libraries share the same sequencing, some store frames along axis=0 and
others store frames along axis=2. This function reorders an image sequence with
frames along axis=2 to an image sequence w... | |
- initializer : output = initializer ( )
- directory : change to this directory (if it exists)
- environment : additional environment for the job
- append_to : additional variables to be ''appended''
- prepend_to : additional variables to be ''prepended''
"""
if not merger and not collector :
import operator... | |
<filename>BF_functions.py
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from astropy.io import fits
from astropy.time import Time
from PyAstronomy import pyasl
from scipy import ndimage
import pandas as pd
import gaussfitter as gf
... | |
{ '@guid':6, ':value':'f'} ] } ]
# at every stage, if we see a dict we take only the first result
# (we print a complaint if we see another)
# if we see a list we put all the results into that list
if isinstance(query, dict):
if len(result) == 0:
return None
elif len(result) > 1:
guids = [('#' + x[0]) for x in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.