input
stringlengths
2.65k
237k
output
stringclasses
1 value
# ***************************************************************************** # # Copyright (c) 2019, the jupyter-fs authors. # # This file is part of the jupyter-fs library, distributed under the terms of # the Apache License 2.0. The full license can be found in the LICENSE file. # import os.path import mimetypes i...
classname='', recursive=True): found = DoFindResource(g.tree.mainNode, name, classname, recursive) if found: return found wx.LogError('XRC resource "%s" not found!' % name) ################################################################################ # This is a little special: it is both xxxObject and xxxNod...
day event_factory( team=self.team, event="watched movie", distinct_id="person2", timestamp="2020-01-02T12:00:00Z", properties={"order": "2"}, ) person3 = person_factory(team_id=self.team.pk, distinct_ids=["person3"], properties={"name": "person3"}) event_factory( team=self.team, event="watched movie", dist...
# # Copyright (c) 2009-2015, <NAME> # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # from El.core import * from El.lapack_like.factor import * (FULL_KK...
# Copyright (c) 2010-2013, Regents of the University of California. # All rights reserved. # # Released under the BSD 3-Clause license as published at the link below. # https://openwsn.atlassian.net/wiki/display/OW/License ''' Contains application model for OpenVisualizer. Expects to be called by top-level UI modu...
""" Block definitions for all known level formats Reader for block definitions stored in .yaml files (based on Minecraft X-Ray) """ from __future__ import absolute_import from logging import getLogger import traceback from collections import defaultdict, namedtuple, MutableSet import bisect import numpy from mceditl...
node1.q) def dV1(): return (1/C1) * (branch1.q - node1.q*(G1 + 1/jwC1) - H1 - branch2.q) def dI2(): return (1/L2) * (E2 - branch2.q*(R2 + jwL2) - node2.q + node1.q) def dV2(): return (1/C2) * (branch2.q - node2.q*(G2 + 1/jwC2) - H2) branch1 = liqss.ComplexAtom("branch1", units="A", func=dI1, dq=10.0, freq1...
__author__ = 'horacioibrahim' # python-iugu package modules import base, config, errors, merchant class IuguSubscription(base.IuguApi): """ This class allows handling subscriptions an CRUD with create, get, set, save and remove plus add-ons as getitems, suspend, activate, change_plan, is_credit_based. :attrib...
| Default value: 0.005 Args: value (float): value for IDD Field `Minimum Setpoint Humidity Ratio` Raises: ValueError: if `value` is not a valid value Returns: float: the value of `minimum_setpoint_humidity_ratio` or None if not set """ return self["Minimum Setpoint Humidity Ratio"] @minimum_setpoint_humid...
Success, TimedOut, Cancelled, Failed. To learn more about these events, see `Configuring Amazon SNS Notifications for Run Command <http://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html>`__ in the *AWS Systems Manager User Guide* . - *(string) --* - **NotificationType** *(string) --* ...
#!/usr/bin/env python """ @file visum_mapDistricts.py @author <NAME> @author <NAME> @date 2007-10-25 @version $Id$ This script reads a network and a dump file and draws the network, coloring it by the values found within the dump-file. SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2008-...
Hebei', 'zh': u('\u6cb3\u5317\u7701\u5eca\u574a\u5e02')}, '86186300':{'en': '<NAME>', 'zh': u('\u6cb3\u5317\u7701\u90af\u90f8\u5e02')}, '86186301':{'en': 'Shijiazhuang, Hebei', 'zh': u('\u6cb3\u5317\u7701\u77f3\u5bb6\u5e84\u5e02')}, '86186302':{'en': 'Baoding, Hebei', 'zh': u('\u6cb3\u5317\u7701\u4fdd\u5b9a\u5e02')}...
relationship will automatically create an intermediate table to host its data. Note that you don't necessarily need to define the inverse relationship. In our example, even though we want tags to be usable on several articles, we might not be interested in which articles correspond to a particular tag. In that case, w...
<reponame>aaronspring/xclim """Pre and post processing for bias adjustment.""" from typing import Optional, Sequence, Tuple, Union import dask.array as dsk import numpy as np import xarray as xr from xarray.core.utils import get_temp_dimname from xclim.core.formatting import update_xclim_history from xclim.core.units...
import bitcoinx import os import pytest import sqlite3 import tempfile from typing import List from electrumsv.constants import (TxFlags, ScriptType, DerivationType, TransactionOutputFlag, PaymentState) from electrumsv.logs import logs from electrumsv.wallet_database import (migration, KeyInstanceTable, MasterKeyTabl...
""" Tests for the petl.transform module. """ from datetime import datetime from nose.tools import eq_ import operator from ..util import OrderedDict from ..testutils import ieq from petl import rename, fieldnames, cut, cat, convert, addfield, \ rowslice, head, tail, sort, melt, recast, duplicates, \ ...
<reponame>AdrianGPrado/k8s-jupyterhub-spawner # coding: utf-8 """ Copyright 2015 SmartBear Software 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 ...
jbevc3[case3] = tempvec[case3] #k2,k3,k1 return jbev1, jbev2, jbev3, jbevc1, jbevc2, jbevc3 def cepca_orderevals_cdiffnrmls(OGD, cm, jbev1, jbev2, jbev3, jbevc1, jbevc2, jbevc3): ''' Use central differences to approximate a gradient per pixel. Then calculate the normal of said gradient and compare that to the ...
""" """ import datetime import os # import sys import logging import numpy as np import scipy as sp import scipy.optimize # noqa import tqdm import h5py import zcode.inout as zio import zcode.math as zmath from . import spectra, radiation # , utils from . import PATH_DATA, MASS_EXTR, FEDD_EXTR, RADS_EXTR from . cons...
# Copyright (C) 2019-2022, Pyronear. # This program is licensed under the Apache License version 2. # See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details. import json import numpy as np import pandas as pd import cv2 import os from functools import partial __all__ = ['Ann...
<gh_stars>1-10 # Vibroacoustics # # E.Rohan, V.Lukeš # Homogenization of the vibro–acoustic transmission on periodically # perforated elastic plates with arrays of resonators. # https://arxiv.org/abs/2104.01367 (arXiv:2104.01367v1) from sfepy.homogenization.utils import define_box_regions import sfepy.discrete.fem.per...
mass "M_max":18, # Truncation mass "sigma_A":0 # The (constant) standard deviation of the tracer } sharp_cut = True def _satellite_occupation(self, m): alpha = self.params['alpha'] M_1 = 10 ** self.params['M_1'] A = 10 ** self.params['logA'] M_min = 10 ** self.params['M_min'] M_max = 10 ** self.pa...
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
is set to:\n' '[\'B\', \'C\', \'B\']' ) shutil.rmtree('tests/Temp_output') elif num == 7: os.mkdir('tests/Temp_output') with self.assertRaises(ValueError) as message: draw_boxplots( test_df, 'tests/Temp_output', scale, cushion, class_order, '', True ) self.assertEqual( str(message.exception), 'Unexpected val...
#TFTA stands for TF-target agent whose task is to search for targets known to a TF and vice versa import re import os import operator import logging import sqlite3 import numpy as np from collections import defaultdict, Counter import math from indra import has_config from indra.ontology.bio import bio_ontology from i...
#!/usr/bin/python from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import time import functools import tempfile import platform import configparser import gdb import pwngef.config from pwngef.color import Color from pwngef.color import m...
= open('%s/moe_err.txt' % tmpdir, 'r').read() log.debug("\nStderr:\n%s" % errbuf) output_file = '%s/smiles4moe.txt' % tmpdir if not os.path.exists(output_file): log.error('MOE descriptor calculation failed.') return None log.debug("Reading descriptors from %s" % output_file) result_df = pd.read_csv(output_file, ...
not (param_dt == np.array(flatten(param)).astype(float)).all(): raise TypeError(msg) # check constraint if constraint is not None: if not (eval('np.' + repr(param_dt) + constraint)).all(): raise ValueError(msg) return param def get_link_domain(link, dist): """ tool to identify the domain of a given monotonic...
<reponame>ixc/python-redis-lock<gh_stars>100-1000 from __future__ import division from __future__ import print_function import gc import multiprocessing import os import platform import sys import threading import time from collections import defaultdict from functools import partial import pytest from process_tests ...
the info dictionary. """ try: info = {} res = self._send_request('GET', "/") info['server'] = {} info['server']['name'] = res['name'] info['server']['version'] = res['version'] info['allinfo'] = res info['status'] = self.status() info['aliases'] = self.aliases() self.info = info return True except: self.i...
!= '#e6f1f5': DBPath = self.default_modulelistDB_path temp_con = sqlite3.connect( DBPath ) temp_cursor = temp_con.cursor() SelectQuery = "select HomePage from ModuleList where ModuleName = '" + window.GetItemText(FocusedItem) + "'" temp_cursor.execute( SelectQuery ) ResultList = temp_cursor.fetchone() Util...
<filename>payroll/views.py from django.shortcuts import render, redirect from django.urls import reverse_lazy from django.views.generic import CreateView, UpdateView, DeleteView, ListView, TemplateView # Create your views here. from .forms import TeacherForm, SalaryForm, FeeDefSerchForm, SchedualForm from .models ...
<gh_stars>0 """# Demographics""" # file:///C:/Users/DBSpe/Downloads/F00010738-WVS-7_Master_Questionnaire_2017-2020_English.pdf from .languages import languages from country_list import countries_for_language from flask_login import current_user from hemlock import ( Check, Debug as D, Embedded, Input, Page, RangeIn...
"""Helper functions for file I/O and manipulating MNIST dataset""" import os import glob import struct import pickle import copy import math import numpy as np import xarray as xr import matplotlib.pyplot as plt from littlenet import neural_net as nn def normalize_images(np_array): """Resizes MNIST image inputs to f...
of the surface nodes within the radius of influence to the motion of the fastening point. UNIFORM, LINEAR, QUADRATIC, and CUBIC indicate uniform, linear decreasing, quadratic polynomial decreasing, and cubic polynomial monotonic decreasing weight distributions. Possible values are UNIFORM, LINEAR, QUADRATIC, and CUB...
"Do the import.", cmd = ["%(MAT_PKG_HOME)s/bin/MATWorkspaceEngine", self.wdir, "import", "--strip_suffix", ".txt", "--file_type", "raw", "core"] + someRawFiles) w = self._createWorkspace() # Check to see whether the files are there. rawBasenames = [os.path.basename(p)[:-4] for p in someRawFiles] rawBasena...
an array including IDs of user groups. @param users: an array including IDs of users. @param status: an array including filtering status. @param search_word: the search word which can be instance id and instance name. @param limit: specify the number of the returning results. @param offset: the starting offset of ...
(0.80784, 0.21176, 0.19216), (0.80784, 0.21569, 0.19216), (0.81176, 0.21961, 0.18824), (0.81176, 0.21961, 0.18824), (0.81569, 0.22353, 0.18431), (0.81569, 0.22745, 0.18431), (0.81961, 0.23137, 0.18039), (0.81961, 0.23137, 0.18039), (0.82745, 0.23529, 0.17255), (0.82745, 0.23922, 0.17255), (0.83137, 0.24314, 0...
<reponame>hyperevo/py-helios-node from __future__ import absolute_import import operator from collections import deque import functools from abc import ( ABCMeta, abstractmethod ) import rlp_cython as rlp import time import math from uuid import UUID from typing import ( # noqa: F401 Any, Optional, Callable, ca...
<filename>refine_reduction.py<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Tue Jun 26 12:51:14 2018 @author: gregz """ import matplotlib matplotlib.use('agg') import argparse as ap import numpy as np import os.path as op from astropy.convolution import Gaussian2DKernel from astropy.io import fits from astrop...
<reponame>drliptons/live-financial-data-with-dashboard import time import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.gridspec import GridSpec import matplotlib.ticker as ticker from mplfinance.original_flavor import candlestick_ohlc import da...
= {"check_header": header, "source_frames": [quoted(frame_id) for frame_id in raw_frames], "single_quotes": quotechar == "'"} if separator: kwargs["separator"] = ord(separator) if escapechar: kwargs["escapechar"] = ord(escapechar) if custom_non_data_line_markers is not None: kwargs["custom_non_data_line_marke...
# Copyright 2015 Tigera, 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, soft...
#!/usr/bin/python # -*- coding: utf-8 -*- import math from enum import IntEnum from itertools import permutations, chain from typing import Dict, Tuple, List, Set, Optional, Callable, Generator from pyrsistent import pvector, PVector from data_structure import Graph from semantic_modeling.config import config from se...
<reponame>Natsurii/nicabot-monkee #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Nekozilla is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
"""OrchidAPI: Orchid Core VMS API wrapper. This library is implemented in accordance with the Orchid Core VMS API documentation: https://orchid.ipconfigure.com/api/. """ import json import base64 import requests from typing import Union, Tuple __version__ = '1.0.0' class BearerAuth(requests.auth.AuthBase): """Bea...
"""Objects for recording state of a Markov chain and caching computations.""" import copy from functools import wraps from collections import Counter from mici.errors import ReadOnlyStateError def _cache_key_func(system, method): """Construct cache key for a given system and method pair.""" if not isinstance(metho...
"""JSON implementations of grading managers.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=protected-access # Access to protected methods allowed in package json...
<filename>srttools/converters/classfits.py """Convert fitszilla data to a CLASS-compatible fits format. The conversion makes use of three types of pointings: + SIGNAL or ON, meaning on-source data + REFERENCE or OFF, meaning data taken from an "empty" region in the sky + CAL, meaning data taken with the calibration...
os.remove(self.filename) def test_instantiate_class(self): pass def test_class_has_sensible_description(self): self.assertIn('stack', self.plotter.description) def test_plot_with_1D_dataset_raises(self): dataset_ = aspecd.dataset.CalculatedDataset() dataset_.data.data = np.random.random([5]) with self.assert...
e.g., due to an ARP request. __Input Gates__: 1 __Output Gates__: 1 """ def __init__(self): """ The EtherEncap module wraps packets in an Ethernet header, but it takes no parameters. Instead, Ethernet source, destination, and type are pulled from a packet's metadata attributes. For example: `SetMetadata('dst_m...
<reponame>JeremyXSC/MCN-MT from __future__ import print_function, absolute_import import time import torch from torch.autograd import Variable from .utils.meters import AverageMeter import numpy as np class BaseTrainer(object): def __init__(self, model, criterions, print_freq=1): super(BaseTrainer, self).__init__...
when __getitem__ is enabled # pos = numpy.array([position] * self.positions.shape[1]).transpose() # dist_arr = (self.positions - pos) ** 2 # distances = dist_arr.sum(axis=0) # nearest = distances.argmin() # return self[nearest] raise NotImplementedError # noinspection PyPep8Naming def randomInit(self, distrib...
# ROBOT PANCAKESWAP # Import all the libraries to use import threading import requests from web3 import Web3 from os import system import os from time import sleep import winsound from selenium import webdriver from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import Chr...
################################################################################ ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2.1 of the License, or (at your op...
<reponame>Mindhome/field_service<gh_stars>1-10 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cint, cstr, date_diff, flt, formatdate, getda...
import pandas as pd from unidecode import unidecode from conversion import toString, cleanString, is_numeric def printline(fout, dict, fieldnames): l = len(fieldnames) - 1 for i, key in enumerate(fieldnames): fout.write(dict[key]) if i < l: fout.write('\t') else: fout.write('\n') def getDataCSV(...
the same value. If omitted the value will be computed in order of creation. """ return pulumi.get(self, "priority") @priority.setter def priority(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "priority", value) @property @pulumi.getter def subnets(self) -> Optional[pulumi.Input[Sequence[pulumi....
import numpy as np from scipy.linalg import eigh class Diffusion: """ Regression weights of kernel Laplacian kernel regularization Notes ----- This implementation has not been optimized in term of memory. Memory scales in O(p^2 nd) while it could scale in O(nd + p^2). Examples -------- >>> import numpy as...
# -*- coding: utf8 -*- """ ====================================== Project Name: NLP File Name: train_globalpointer Author: czh Create Date: 2022/2/9 -------------------------------------- Change Activity: ====================================== """ import os import regex import glob import json import time from tq...
import os from musurgia.table.table import Table from musurgia.fractaltree.fractalmusic import FractalMusic from musurgia.fractaltree.fractaltree import FractalTreeException from prettytable import PrettyTable from quicktions import Fraction class Module(FractalMusic): def __init__(self, row_number=None, column_num...
o_info = np.iinfo(out_type) if out_mn >= o_info.min and out_mx <= o_info.max: return i_type return best_float() def working_type(in_type, slope=1.0, inter=0.0): """ Return array type from applying `slope`, `inter` to array of `in_type` Numpy type that results from an array of type `in_type` being combined with ...
<filename>lndgrpc/common.py import binascii import platform import os import grpc import sys from pathlib import Path from lndgrpc.compiled import ( lightning_pb2 as ln, lightning_pb2_grpc as lnrpc, router_pb2 as router, router_pb2_grpc as routerrpc, verrpc_pb2 as ver, verrpc_pb2_grpc as verrpc, walletkit_pb2 a...
''' MergeMove.py Merge components of a bnpy model. Usage -------- Inside a LearnAlg, to try a merge move on a particular model and dataset. >>> hmodel, SS, curEv, MoveInfo = run_merge_move(hmodel, Data, SS) To force a merge of components "2" and "4" >>> hmodel, SS, curEv, MoveInfo = run_merge_move(hmodel, Data, SS, ...
<reponame>FoxoTech/methylcheck # -*- coding: utf-8 -*- try: from importlib import resources # py3.7+ except ImportError: import pkg_resources #py < 3.7 import numpy as np import pandas as pd # app import methylcheck import logging # whilst debugging only: this is on. #logging.basicConfig(level=logging.DEBUG) # ROOT...
import json import re import sys import copy import types import inspect import keyword __all__ = ['configclass', 'field', 'Field', 'FrozenInstanceError', 'InitVar', 'MISSING', # Helper functions. 'fields', 'asdict', 'astuple', 'make_configclass', 'replace', 'is_configclass', ] # Raised when an attempt...
<gh_stars>1-10 #!/usr/bin/env python3 #-*- coding:utf-8 -*- # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 3 # of the License, or (at you...
import csv from os import path import numpy as np from sklearn.cross_validation import train_test_split from scipy.optimize import curve_fit from sys import argv import _vawtwake def starccm_read_vel(fdata,dia,windd,length): start = length/30. lendat = np.linspace(start,length,30)/dia for j in range(np.size(fdat...
self.getEmail(answers, request_email=True, preferred_email_domain='example.net') self.assertEqual(email, ['<EMAIL>']) class GitHubPostCommitHookTests(TracGitHubTests): def testDefaultRepository(self): output = self.openGitHubHook(0).read() self.assertEqual(output, "Running hook on (default)\n" "* Updating clon...
<gh_stars>1-10 """ Cross-comparison of pixels 3x3 kernels or gradient angles in 2x2 kernels """ import numpy as np import functools ave_ga = .78 ave_ma = 2 # at 22.5 degrees? ''' Sobel coefficients to decompose ds into dy and dx: YCOEFs = np.array([-1, -2, -1, 0, 1, 2, 1, 0]) XCOEFs = np.array([-1, 0, 1, 2, 1, 0, -...
from __future__ import absolute_import, division, print_function from iotbx import pdb import iotbx.phil import iotbx.ncs from mmtbx.monomer_library import server from mmtbx.monomer_library import cif_types from mmtbx.monomer_library import rna_sugar_pucker_analysis from mmtbx.monomer_library import conformation_depend...
<reponame>dingmyu/VRDP # -*- coding: utf-8 -*- # Author: <NAME> # Time: 1/4/2021 12:44 PM # Copyright 2019. 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...
= self._convert_canvas_to_patch_pos(end) image_start = self._convert_patch_to_image_pos(start) image_end = self._convert_patch_to_image_pos(end) self._event_logger.log_event("drag", patch_grid_coord, patch_start=start, patch_end=end, image_start=image_start, image_end=image_end, drag_type=drag_type) # ======...
''' Unsupervised/Semi-supervised models for poverty detection <NAME> ''' import torch.utils.data as tud from torch import optim, nn from torch.nn import functional as F from torchvision.models import resnet18 import numpy as np import torch # from numpy.random import permutation as rpm from predictors import elastic_ne...
<reponame>nerdyLawman/mud-board #!/usr/bin/env python """A simple Multi-User Dungeon (MUD) game. Players can talk to each other, examine their surroundings and move between rooms. based on a foundation by: <NAME> - <EMAIL> """ import time from random import randint from blessed import Terminal # import the MUD serv...
<gh_stars>0 import glob import logging import os import time import traceback import cv2 import numpy as np from screeninfo import get_monitors def f1(): height, width = 100, 200 image = np.zeros((height, width, 4), np.uint) image = cv2.cvtColor(image, cv2.COLOR_BGR2BGRA) # image[np.all(image == [0, 0, 0, 255],...
<reponame>vvacula/pyIceCat # use C implementation for speed import xml.etree.cElementTree as ET import json import xmltodict import progressbar import requests import gzip import os import sys import collections from multiprocessing import Process, Queue from IceCat import bulk_downloader import pprint import re im...
parent = self.lowBookModel, text = PLocalizer.RotateSlider, command = self.handleRotateSlider, range = (-1, 1)) self.pgsRotate.setPos(-0.10000000000000001, 0, -0.070000000000000007) self.pgsRotate.setScale(0.5) self.pgsRotate['extraArgs'] = [ self.pgsRotate] if self.isNPCEditor and self.wantNPCViewer or self.wantM...
RADIAL:index', b'Degrees', 'N'], "NAV_RADIAL_ERROR:index": ["Difference between current radial and OBS tuned radial", b'NAV RADIAL ERROR:index', b'Degrees', 'N'], "NAV_LOCALIZER:index": ["Localizer course heading", b'NAV LOCALIZER:index', b'Degrees', 'N'], "NAV_GLIDE_SLOPE_ERROR:index": ["Difference between cu...
<reponame>zychen-ustc/PSD-Principled-Synthetic-to-Real-Dehazing-Guided-by-Physical-Priors<filename>PSD/losses/energy_functions.py import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as tfs from torch.autograd import Variable class energy_dc_loss(nn.Module): def...
<gh_stars>0 #!/usr/bin/python """Calculates optical properties of large hexagonal ice grains. This file calculates the optial properties (single scattering albedo, assymetry parameter, mass absorption coefficient and extinction, scattering and absorption cross sections) for ice grains shaped as arbitrarily large hexa...
historical irrigation areas (done at yearly basis). # ~ # Available datasets are only from 1960 to 2010 (status on 24 September 2010) # ~ yearInInteger = int(yearInInteger) # ~ if float(yearInInteger) < 1960. or float(yearInInteger) > 2010.: # ~ msg = 'Dataset for the year '+str(yearInInteger)+" is not available. ...
from simulation.variables import * def skew(x): return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]]) def dskew(x): return np.array[[x[2][1]],[x[0][2]],[x[1][0]]] def vskew(x): return np.array([[0,-x[2],x[1],x[3]], [x[2],0,-x[0],x[4]], [-x[1],x[0],0,x[5]], [0,0,0,0]]) def dvskew(x): return ...
<filename>modelzoo/DeepFM/train.py import time import argparse import tensorflow as tf import os import sys import math import collections from tensorflow.python.client import timeline import json from tensorflow.python.ops import partitioned_variables # Set to INFO for tracking training, default is WARN. ERROR for l...
import time from typing import List, Any, Dict, Tuple from psycopg2 import connect from psycopg2.extras import execute_values import sshtunnel import pandas as pd from numpy import inf from dbmanager.configuration_service import ConfigurationService as Config class DBManager: """ DBManager handled the read and wri...
""" Utilities for stamping PDF files. Here 'stamping' loosely refers to adding small overlays (QR codes, text boxes, etc.) on top of already existing content in PDF files. The code in this module is also used by the :mod:`.sign` module to render signature appearances. """ import uuid from binascii import hexlify fro...
import os import datetime import random import discord import asyncio from discord.ext import commands import aiohttp from io import BytesIO # import requests from modules.image_functions import randomFile, makeColorImg import modules.checks as checks from gtts import gTTS try: URBANDICTKEY = os.environ["URBANDICTK...
<reponame>Campbell-Muscle-Lab/PyMyoVent<filename>Python_code/single_ventricle_circulation/half_sarcomere/membranes/grandi_2009.py # Size of variable arrays: sizeAlgebraic = 114 sizeStates = 39 sizeConstants = 124 from math import * from numpy import * def createLegends(): legend_states = [""] * sizeStates legend_rat...
#!/usr/bin/env python3 """ -------------------------------------------------------------- Nov 2018 - Payne Originally written by <NAME> Parsing and formatting for four orbit formats: * the 220 column format for minor planets * the 90 column format for minor planets * the 220 column format for natural satellites o...
join pg_namespace n on p.pronamespace = n.oid where quote_ident(n.nspname) || '.' || quote_ident(p.proname) || '(' || oidvectortypes(p.proargtypes) || ')' = '{0}' '''.format(p_function)) def QueryProcedures(self, p_all_schemas=False, p_schema=None): v_filter = '' if not p_all_schemas: if p_schema: v_filter = "...
<filename>pygyver/etl/dw.py """ Module containing BigQueryExecutor for Python """ import os import re import logging import time import json import pandas as pd from pandas._testing import assert_frame_equal from google.cloud import bigquery from google.cloud.exceptions import NotFound from google.oauth2 import service...
<gh_stars>0 import os import time import torch import numpy as np from torch.optim.lr_scheduler import ReduceLROnPlateau, StepLR __all__ = [ 'Hook', 'LoggingHook', 'TensorboardHook', 'CSVHook', 'EarlyStoppingHook', 'MaxEpochHook', 'MaxStepHook', 'LRScheduleHook', 'ReduceLROnPlateauHook', 'ExponentialDecayHook', 'W...
def from_map(self, map={}): self.label = map.get('Label') self.score = map.get('Score') self.timestamp = map.get('Timestamp') return self class GetMediaAuditResultTimelineResponseMediaAuditResultTimelineLogo(TeaModel): def __init__(self, label=None, score=None, timestamp=None): self.label = label self.score = ...
= {} if not sample or not sample.getSampler(): return data sampler = sample.getSampler() mtool = getToolByName(self, 'portal_membership') member = mtool.getMemberById(sampler) if member: mfullname = member.getProperty('fullname') memail = member.getProperty('email') mhomepage = member.getProperty('home_page') ...
The Second Academy China Aerospace Science & Industry Corp", "EC42F0": "ADL Embedded Solutions, Inc.", "EC43E6": "AWCER Ltd.", "EC43F6": "ZyXEL Communications Corporation", "EC4476": "CISCO SYSTEMS, INC.", "EC4644": "TTK SAS", "EC4670": "Meinberg Funkuhren GmbH & Co. KG", "EC473C": "Redwire, LLC", "EC49...
"""Augmentations.""" # pylint: disable=invalid-name from pylint.checkers.base import DocStringChecker, NameChecker from pylint.checkers.design_analysis import MisdesignChecker from pylint.checkers.classes import ClassChecker from pylint.checkers.newstyle import NewStyleConflictChecker from pylint.checkers.variables imp...
<filename>lib/dataset/augmentor/augmentation.py import numbers import os import warnings import numpy as np import cv2 import random import math from train_config import config as cfg ######May wrong, when use it check it def Rotate_aug(src,angle,label=None,center=None,scale=1.0): ''' :param src: src i...
from timeit import default_timer import Funciones as j # Test para funciones def test(): print("Creacion de DBs:") print(j.createDatabase('DB1'), end="-") print(j.createDatabase('DB2'), end="-") print(j.createDatabase('DB3'), end="-") print(j.createDatabase('DB4'), end="-") print(j.createDatabase('DB5'), end="-"...
<filename>forest/jasmine/data2mobmat.py import sys import math import numpy as np from itertools import groupby ## the radius of the earth R = 6.371*10**6 def unique(anylist): """ Args: anylist, an arbitrary list Return: a list of unique items in anylist """ # intilize a null list unique_list = [] # traverse f...
<filename>models/nfp_assembly_loops_typed.py from dummy import Hyper, Param, Var, Runtime, Input, Output, Inline #### Parameters to the model (changes in this block should not require #### any changes in the actual model) maxInt = Hyper() inputNum = Hyper() inputStackSize = Hyper() prefixLength = Hyper() loopBodyLengt...