input
stringlengths
2.65k
237k
output
stringclasses
1 value
the list item.') c.argument('microsoft_graph_entity_id', type=str, help='Read-only.', arg_group='Fields') with self.argument_context('sites siteslist create-subscription') as c: c.argument('site_id', type=str, help='key: id of site') c.argument('list_id', type=str, help='key: id of list') c.argument('id_', ...
import re from operator import attrgetter # My files from args import * from error import * from files import * from find_page import * from easy import * from trie import * from parse import * from cache import * glossary_taxon_dict = {} class Glossary: pass def __init__(self, name): self.name = name # user-v...
this is possible. """ request_specs = request.spec return [ pool for pool in pools if utils.pci_device_prop_match(pool, request_specs) ] def _filter_pools_for_numa_cells( self, pools: ty.List[Pool], request: 'objects.InstancePCIRequest', numa_cells: ty.Optional[ty.List['objects.InstanceNUMACell']], ) -> ty...
<gh_stars>1-10 """ Support for reading and writing the LAV format produced by the `blastz`_ pairwise aligner. .. _blastz: http://www.bx.psu.edu/miller_lab/ """ from bx.align import * import bx.seq import sys,math,StringIO import itertools from bx import interval_index_file class Reader(object): """Iterate over al...
<filename>minnowswithmachineguns/minnows.py #!/bin/env python """ The MIT License Copyright (c) 2010 The Chicago Tribune & Contributors 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 re...
<filename>detectron2/modeling/meta_arch/retinanet.py<gh_stars>1-10 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import logging import math import numpy as np from typing import List import torch from fvcore.nn import giou_loss, sigmoid_focal_loss_jit, smooth_l1_loss from torch import nn from t...
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import math import os import random import time from collections import OrderedDict from concurrent.futures.process import Proce...
#!/usr/bin/python # -*- coding: utf-8 -*- import json import csv import re import os import mwparserfromhell as wparser import string import pywikibot import datetime import requests import pymysql import random from urllib.parse import quote from wikidataStuff.WikidataStuff import WikidataStuff as wds site_cache = {}...
and readline history self.history.clear() if self.persistent_history_file: os.remove(self.persistent_history_file) if rl_type != RlType.NONE: readline.clear_history() return # If an argument was supplied, then retrieve partial contents of the history cowardly_refuse_to_run = False if args.arg: # If a chara...
#! /usr/bin/env python3 """ Copyright (c) 2010 - 2020, ETH Zurich, Computer Engineering Group All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copy...
[ 0, 0, 0, 0 ] ], [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ] ] ]) # Declares Weyl curvature tensor "dddd" type class object. self.weyl_tensor_dddd = Matrix([ [ [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ],...
mintraveldistance += 0.95 if iteration > 300: iteration = 0 conflictlimit += 1 mintraveldistance = self.df[SET_TRAVEL_HOURS].min() if conflictlimit > 0: elec_loop += 1 else: still_looking = False print("The electrification rate achieved is {}".format(elecrate)) ### Fast method attempt # self.df['Investment...
<filename>ooni/runner.py import os import sys import time import inspect import traceback import itertools import random import yaml from twisted.python import reflect, usage from twisted.internet import defer from twisted.trial.runner import filenameToModule from twisted.internet import reactor, threads from txtorc...
<reponame>nick-klingaman/ASoP # Copyright 2021 Lawrence Livermore National Security, LLC """ This script is used by cmec-driver to run the ASoP-Spectral metrics. It is based on the workflow in ASoP1_spectral_main.py and can be called with the aruments listed below. Keys that can be set in the config or settings diction...
tf.concat([y_estimates_neg, y_estimates_pos], 0) # # Kneg = tf.size(negative_indices) # mask = tf.tensor_scatter_nd_update(tf.ones([params['K']], dtype=tf.int32), negative_indices, -tf.ones(Kneg, dtype=tf.int32)) # y_estimates = y_estimates * tf.cast(mask, tf.float64) # values = tf.cast(tf.reshape(y_estimates, [-1]), t...
len(maxevals) > 2: self.evaluations = np.median(maxevals) ## meta_parameters.noise_aggregate == None self.f_aggregate = aggregate if not None else {1: np.median, 2: np.mean}[ None ] self.evaluations_just_done = 0 # actually conducted evals, only for documentation self.noiseS = 0 def __call__(self, X, fit, func, ...
**kwargs): pass def disown_MPxAttributePatternFactory(*args, **kwargs): pass def MPxTransform_minRotLimit_get(*args, **kwargs): pass def MPxParticleAttributeMapperNode_computeNodeColor_get(*args, **kwargs): pass def MPxTransform_scalePivotX_set(*args, **kwargs): pass def MPxUITableControl_className(*args...
= [ mock.call(ctx.elevated.return_value, self.placement_client, spec_obj, uuids.instance0, alloc_reqs_by_rp_uuid[uuids.cn2][0], allocation_request_version=None), mock.call(ctx.elevated.return_value, self.placement_client, spec_obj, uuids.instance1, alloc_reqs_by_rp_uuid[uuids.cn1][0], allocation_request_version...
float(A) else: A, n, Ea = items[-3:] dA = '0'; dn = '0'; dEa = '0' A = float(A) kunits = Aunits[len(reactants)+1] if hasThirdBody else Aunits[len(reactants)] if dA[0] == '*': A = Quantity(A,kunits,'*|/',float(dA[1:])) else: dA = float(dA) if dA != 0: A = Quantity(A,kunits,'+|-',dA) else: A = Quantity(A,k...
colored('CS', self.depth()) def default(self, eff_dimensions): return ConstKernel(0., range(eff_dimensions)) def __cmp__(self, other): assert isinstance(other, KernelFamily) if cmp(self.__class__, other.__class__): return cmp(self.__class__, other.__class__) return 0 def depth(self): return 0 def id_n...
# Internal import tkinter as tk import subprocess import asyncio import os from time import localtime, strftime # Ext import webbrowser # User Defined from screen_translate.JsonHandling import JsonHandler from screen_translate.LangCode import * from screen_translate.Mbox import Mbox from screeninfo import get_monitor...
<reponame>hanhossain/OCS-Samples<filename>basic_samples/SDS/Python/SDSPy/Python2/SdsClient.py<gh_stars>0 # SdsClient.py # # Copyright (C) 2018 OSIsoft, LLC. All rights reserved. # # THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF # OSIsoft, LLC. USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOU...
from keras import backend as K import tensorflow as tf import numpy as np def focal_loss(gamma=2., alpha=4.): gamma = float(gamma) alpha = float(alpha) def focal_loss_fixed(y_true, y_pred): """Focal loss for multi-classification FL(p_t)=-alpha(1-p_t)^{gamma}ln(p_t) Notice: y_pred is probability after softmax ...
""" General Utilities file. """ import sys import os ############################ NON-TF UTILS ########################## from skimage.util import img_as_float import numpy as np import cv2 import pickle from PIL import Image from io import BytesIO import math import tqdm import scipy import json import matplotlib...
<gh_stars>1-10 import os import collections import sys import re import relations #### GENE - GO DICTIONARY: GENE ID - (GO ID, EVIDENCE CODE, GO NAME, CATEGORY), (...) #### def dict_g2go(file_g2go): """Creates a dictionary of type {gene1:[(GO_ID, Evidence, GO_name, category), (GO_ID, Evidence, GO_name, category),...
# Generated by h2py from /usr/include/netinet/in.h _NETINET_IN_H = 1 # Included from features.h _FEATURES_H = 1 __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 200809L _XOPEN_SOURCE = 700 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 _ATFILE_S...
processBlockStep(rpFile, thread): #type: (rpp.RenPyFile, rpp.RenPyThread) -> None blk = thread.stack[-1]; i = blk.lineNum; indent = blk.indent; if (not(rpFile.indentIsGood(i, indent))): thread.stack.pop(); return; strippedLine = rpFile.lines[i].strip(); if (strippedLine.startswith("menu:")): # Shift the blo...
# stdlib import logging # pypi import requests import sqlalchemy # from zope.sqlalchemy import mark_changed # localapp from . import actions_acme from . import getcreate from . import update from .logger import _log_object_event from .logger import log__OperationsEvent from .. import errors from .. import events fro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import unittest as ut import numpy as np from mykit.core.cell import (Cell, CellError, atoms_from_sym_nat, axis_list, periodic_duplicates_in_cell, sym_nat_from_atoms) from mykit.core.constants import ANG2AU, AU2ANG, PI from mykit.core.utils import get_dirpath...
import numpy as np import gym, gym.spaces import time import os from collections import OrderedDict import yaml EPS = 1e-5 def parse_config(config): with open(config, 'r') as f: config_data = yaml.load(f) return config_data class ToyEnv: def __init__(self, config_file, should_normalize_observation=True, aut...
<reponame>MCLConsortium/jpl.mcl.site.sciencedata # encoding: utf-8 u'''MCL — Base classes''' from . import MESSAGE_FACTORY as _ from .interfaces import IIngestor from ._utils import IngestResults, publish from .errors import IngestDisabled, RDFTypeMismatchError, TitlePredicateMissing, IngestError from Acquisition imp...
<reponame>tryagainconcepts/graphql-server import json from urllib.parse import urlencode import pytest from .app import create_app, url_string from .schema import AsyncSchema def response_json(response): return json.loads(response.body.decode()) def json_dump_kwarg(**kwargs): return json.dumps(kwargs) def jso...
#!/usr/bin/env python # coding:utf-8 import rospy import numpy as np import time import threading from math import * from collections import deque from settings_new import * from super_minitaur.msg import * from std_msgs.msg import * from scipy.interpolate import interp1d import matplotlib.pyplot as plt class LegContr...
<gh_stars>0 """ This file defines backend code that runs when a user visits a page """ from datetime import datetime from typing import Optional from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.core import mail from django.db.models import...
<gh_stars>1000+ #!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generate keyboard layout and hotkey data for the keyboard overlay. This script fetches data from the keyboard l...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.1 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (3,0,0): new_instancemethod = lambda func, inst, cls: _IntAna2d....
# polytools.py # ALS 2016/04/29 """ Contain functions for shape measurements on polygons. Does not support astropy unit References: https://en.wikipedia.org/wiki/Shape_factor_(image_analysis_and_microscopy) https://en.wikipedia.org/wiki/Feret_diameter PEER REVIEW Particle Shape Factors and Their Use in Image Analy...
<gh_stars>0 # -*- coding: utf-8 -*- _translations = { "req_fine_reduction": { "en": "###Request a Fine Reduction", "es": "###Cómo solicitar una reducción de multa", "zh-s": "###请求减少罚款", "zh-t": "###請求減少罰款" }, "landing_page_description": { "en": """*This online system is an optional way to request a fine reduc...
import numpy as np import tensorflow as tf import sys import gc import time #from tensorflow.python.ops import rnn_cell from tensorflow.python.ops.rnn import bidirectional_dynamic_rnn from tf_utils import variable_summaries, _batch_norm from custom_ops import atrous_pool2d def weight_variable(shape, name=None): initi...
extensions=None, namespace='http://openconfig.net/yang/relay-agent', defining_module='openconfig-relay-agent', yang_type='container', is_config=True)""", }) self.__state = t if hasattr(self, '_set'): self._set() def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_relay_agent__relay_agen...
session. This ``Calendar`` has a default query that matches any superseding event and a default search order that specifies no sequencing. The queries may be examined using a ``SupersedingEventQueryInspector``. The query may be modified by converting the inspector back to a ``SupersedingEventQuery``. """ __met...
0) m.c1516 = Constraint(expr= m.x279 >= 0) m.c1517 = Constraint(expr= - 5*m.x152 + m.x280 >= 0) m.c1518 = Constraint(expr= - 5*m.x153 + m.x281 >= 0) m.c1519 = Constraint(expr= m.x282 >= 0) m.c1520 = Constraint(expr= m.x283 >= 0) m.c1521 = Constraint(expr= m.x284 >= 0) m.c1522 = Constraint(expr= m.x285 >= 0) m.c...
torch.arange(0., seq_length, device=device).repeat(bsz, seq_len, phrase_num, 1) y = gauss_distribution(mus, sigmas, x) * weights y = y.sum(dim=-2) gauss_attention = y return gauss_attention def forward( self, query, key: Optional[Tensor], value: Optional[Tensor], key_padding_mask: Optional[Tensor] = None, i...
<gh_stars>1-10 #!/usr/bin/env python3 #Black Lotus v2-dev- #Copyright of <NAME> #---------------------------------------------------------------------------------------------------------------------- import os from getpass import getpass import time import sys def login(): os.system('cls||clear') usr = input("\033[3...
#! /usr/bin/env python # Copyright 2021 <NAME> # # This file is part of WarpX. # # License: BSD-3-Clause-LBNL import os import sys import yt sys.path.insert(1, '../../../../warpx/Regression/Checksum/') import checksumAPI import numpy as np import scipy.constants as scc ## This script performs various checks for the...
<gh_stars>0 import scipy.stats as spst import warnings import numpy as np from itertools import product, combinations from . import bsm from . import norm from . import gamma from . import nsvh from . import opt_abc as opt class BsmSpreadKirk(opt.OptMaABC): """ Kirk's approximation for spread option. References: ...
ReparsePoint (1024), SparseFile (512), System (4), Temporary (256) """ def __eq__(self, *args): #cannot find CLR method """ x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """ pass def __format__(self, *args): #cannot find CLR method """ __format__(formattable: IFormattable, format: str) -...
<gh_stars>0 """ Classes implementing the partial information decomposition. """ from __future__ import division from abc import ABCMeta, abstractmethod from six import with_metaclass from sys import version_info from itertools import product import networkx as nx import numpy as np import prettytable from .latt...
explain: Return detailed information about the error :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) :arg lenient: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored :arg q: Query in the Lucene...
the display self._update_layout() # central widget position property for bar type widgets @property def widget_position(self) -> ICWidgetPosition: return None if self._central_widget is None else self._central_widget.position @widget_position.setter def widget_position(self, position: ICWidgetPosition) -> None...
image, calculate inception score, and store in a list #Then make some plots based on dimensionality and result #First, remove the directory in checkpoints if it exists #Then, copy desired model to the checkpoints as "latest_blahblah.pth" #Then run the script and see the output in results imgDictVal = {} imgDictTest ...
<reponame>jtallieu/proctor """ Proctor (Audit) System. A stand-alone library that provides a pluggable framework to simplify coding functions that detect/fix data conditions. The objective is to abstract the boilerplate code necessary to expose such functions to the front-end and re-use them throughout the application...
= request.form['daterange'] metric_alert_stats = request.form.getlist('metric_alert_stats') alert_metric_targets = request.form.getlist('alert_metric_targets') events_metric_targets = request.form.getlist('events_metric_targets') export_results_to = request.form.getlist('export_results') selected_analysts = [int...
freq=1, min=PID_EXO_minOut, max=PID_EXO_maxOut) PID_EXO.target = target_arr[target_index] # unpacking PID profile for clarity PID_EXO_frequency = PID_EXO_FLEX_profiles[target_index][5] brake_offset = PID_EXO_FLEX_profiles[target_index][6] error_margin_EXO = PID_EXO_FLEX_profiles[target_index][7] brake_target = t...
<reponame>everlastingwonder/blaseball-mike """For deserializing the json responses""" import abc import math import random from collections import OrderedDict import re from dateutil.parser import parse from blaseball_mike import database, reference, tables class Base(abc.ABC): _camel_to_snake_re = re.compile(r'...
2, 3]) df = to_pandas(df, index='id', sort_index=True) for i, test in enumerate(to_test[:-1]): v = df[features[i].get_name()].tolist() assert v == test[1] i, test = -1, to_test[-1] v = df[features[i].get_name()].tolist() assert (np.isnan(v[0])) assert v[1:] == test[1][1:] def test_arithmetic_of_direct(es): ...
<filename>pwrsrs.py from fractions import Fraction as F from itertools import count, islice, repeat, chain, starmap import math try: from itertools import izip as zip from itertools import imap as map except ImportError: # will be 3.x series pass pstestlimit = 5 def memoizedGenerator( gen ): _iter = gen() _cach...
Exception, e: print e regulated.append(tgMapLibrary[utrSym]) line = mir+'\t'+sig+'\t'+str(jobId)+'\tNEW\traw\t'+tgMapLibrary[utrSym]+'\t'+utrSym+'\t \t \t \t \t'+str(newTPair[key][0])+'\t'+str(newTPair[key][1])+'\t'+utr[newTPair[key][0]-10:newTPair[key][1]+25].strip()+'\n' result.append(line) for key, utrSym ...
#!/usr/bin/env python # encoding: utf-8 """ meshconvert.py A script to convert between tetrahedral mesh formats. Created by <NAME> (<EMAIL>) on 2006-12-07. """ import sys import getopt import os help_message = \ ''' meshconvert.py - a script to convert between tetrahedral mesh formats. Usage: meshconvert.py [-s s...
<reponame>sevyharris/autoscience_workflow # Functions for running a thermo job using this workflow import pandas as pd import os import sys import glob import datetime import time import subprocess import job_manager try: DFT_DIR = os.environ['DFT_DIR'] except KeyError: DFT_DIR = '/work/westgroup/harris.se/autoscie...
<gh_stars>0 # -*- coding: utf-8 -*- """ The database updater module Copyright 2017-2019, <NAME> and <NAME> """ # -- Imports ------------------------------------------------ import os import time import datetime import subprocess # pylint: disable=import-error try: # Python 3.x from urllib.error import URLError exc...
= { 'list': self.ToolMode.LIST_FILES, 'download_file': self.ToolMode.DOWNLOAD_TO_PATH, 'download_blob': self.ToolMode.DOWNLOAD_TO_BLOB }.get(self._prep_xmltext(xml, 'ToolMode'), self.ToolMode.NONE_MODE) # File Handling self.file_handling = { 'keep_files': self.FileHandling.KEEP_FILES, 'delete_files': self.FileH...
import json import logging from flask import Blueprint, request, g from flask_restful import Resource, Api from flask_restful_swagger import swagger from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired from marshmallow import EXCLUDE, ValidationError from sqlalchemy im...
read_only: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. :param str sub_path: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). :param str sub_path_expr: Expanded path within the volume from which the container's vo...
from __future__ import print_function import time import h5py import numpy as np import numexpr as ne import skimage.transform as st import os import sys import scipy.ndimage.filters as snf import concurrent.futures as cf import warnings import importlib import xlrd # for importing excel spreadsheets from ...
--float 1 \ -r {sanitized_base} -i {in_file} -d {dim} --input-image-type {image_type} \ -o {outputs['out_file']} --interpolation {interp} \ {' '.join(xform_cmds)}") if is_bucket: io.change_dim_order(in_file, dim_order='bucket', method='afni') # Change in_file back to bucket io.change_dim_order(outputs['out_file']...
# Copyright (c) 2019. Partners HealthCare and other members of # Forome Association # # Developed by <NAME> based on contributions by <NAME>, # <NAME>, <NAME> and other members of Division of # Genetics, Brigham and Women's Hospital # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
<reponame>NoldAndreas/FINDER<filename>Code/CAML/2.0_Pool_Trn_and_Val_Sets.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Accept files created by 1.0_Data_Preparation and pools points into a set for training and validating new models. @author: dave ''' import os import pandas as pd from natsort import natsorte...
payload = [ ('BDUSS', self.sessions.BDUSS), ('portrait', user.portrait), ('tbs', await self.get_tbs()), ] try: res = await self.sessions.app.post( "http://c.tieba.baidu.com/c/c/user/unfollow", data=self.sessions._pack_form(payload) ) res_json: dict = await res.json(encoding='utf-8', loads=JSON_DECODER.decode...
instance of the spherical harmonics object for the new grid specob_new = Spharmt(nlon_new,nlat_new,gridtype='regular',legfunc='computed') # loop over years of interest and transform...specify trange at top of file iw = 0 if nya > 0: iw = (nya-1)/2 cyears = list(range(trange[0],trange[1])) lt_csave = np.zeros(...
tgrid.ravel() fvec = fgrid.ravel() if key == 'antenna-based': ind1 = NMO.find_list_in_list(labels, a1_labels) ind2 = NMO.find_list_in_list(labels, a2_labels) if NP.sum(ind1.mask) > 0: raise IndexError('Some antenna gains could not be found') if NP.sum(ind2.mask) > 0: raise IndexError('Some antenna gains could ...
0 and 1 :return: Entry [i,j] is the betweenness of the link between i and j, or 0 if i is not linked to j. """ # Calculate link betweenness link_betweenness = self.graph.edge_betweenness() # Initialize result, ecount = np.zeros((self.N, self.N)), 0 # Get graph adjacency list A_list = self.graph.get_adjlist()...
a # 'shot' exists in a certain part of the asset system. One approach would be # to use a 'getChildren' call, on this part of the system. This has the # drawback that is assumes that shots are always something that can be # described as 'immediate children' of the location in question. This lay not # always be the...
<gh_stars>0 import pyopencl as cl import pyopencl.tools import pyopencl.array import datetime import collections import os from copy import deepcopy import threading # import mutex import logging import numpy as np import constant_pyschedcl as cons import time import gc import resource from decimal import * import thre...
"name": "megaphone--minus" }, { "url": "/images/status/megaphone--pencil.png", "name": "megaphone--pencil" }, { "url": "/images/status/megaphone--plus.png", "name": "megaphone--plus" }, { "url": "/images/status/megaphone.png", "name": "megaphone" }, { "url": "/images/status/memory.png", "name"...
var_list[0].name = 'time' var_list[1].name = 'parad_k_par' var_list[2].name = 'int_ctd_pressure' var_list[0].data = np.array([]) var_list[1].data = np.array([]) var_list[2].data = np.array([]) var_list[0].units = 'seconds since 1900-01-01' var_list[1].units = 'umol photons m-2 s-1' var_list[2].units = '...
import traceback,sys import hglib import threading import logging from django.db import connection,transaction from django.core.urlresolvers import reverse from django.contrib import messages from django.http import HttpResponseRedirect from django.utils.safestring import mark_safe from django.utils import timezone f...
<reponame>homm/pillow-lut-tools from __future__ import division, unicode_literals, absolute_import import warnings from pillow_lut import operations, generators, ImageFilter, Image from pillow_lut import (identity_table, transform_lut, resize_lut, amplify_lut, sample_lut_linear, sample_lut_cubic) from . import Pill...
""" Creating and reading file objects, as well as manipulating the maya files. """ # import standard modules import posixpath import re import os import xml.etree.cElementTree as ET import json import glob import ast import shutil # import maya modules from maya import cmds # define local variables # re_slash = re.co...
elif nodeName_ == 'measurementID': measurementID_ = child_.text measurementID_ = self.gds_validate_string(measurementID_, node, 'measurementID') self.measurementID = measurementID_ # end class measurementDependencyType class coilLabelType(GeneratedsSuper): subclass = None superclass = None def __init__(self, co...
import sys import os import time from torchvision import transforms import torch, torchaudio import yarp import numpy as np from speechbrain.pretrained import EncoderClassifier from project.voiceRecognition.speaker_embeddings import EmbeddingsHandler from project.faceRecognition.utils import format_face_coord, face_al...
numpy array, the point (or an approximation thereof when an exact solution is not possible) where the defined lines intersect """ # first, define the lines from the provided points pt1 = a1 vec1 = a2-a1 pt2 = b1 vec2 = b2-b1 # now get the points on the lines that are closest to each other coeffs = numpy...
"""Manager utility implementations of assessment.authoring managers.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods # Number of methods are defined in specification # pylint: disable=too-many-ancestors # Inheritance defined in specification from ..osi...
Family - Woman: Light Skin Tone, Man: Light Skin Tone, Boy: Light Skin Tone, Girl: Light Skin Tone 🏴󠁡󠁺󠁫󠁡󠁬󠁿 Flag for Kalbajar (AZ-KAL) 🏴󠁡󠁺󠁧󠁡󠁤󠁿 Flag for Gadabay (AZ-GAD) 🏴󠁡󠁺󠁬󠁡󠁣󠁿 Flag for Lachin (AZ-LAC) 🏴󠁡󠁺󠁬󠁡󠁿 Flag for Lankaran (AZ-LA) 🏴󠁶󠁮󠁳󠁧󠁿 Flag for Ho Chi Minh City (VN-SG) 🏴󠁡󠁺󠁬󠁥󠁲...
# Modifed from R2C """ Dataloaders for VCR """ import json import pickle import os from collections import defaultdict import numpy as np import numpy import torch from allennlp.data.dataset import Batch from allennlp.data.fields import TextField, ListField, LabelField, SequenceLabelField, ArrayField, Metad...
None, 'e3sm_file': None, 'cam_file': None, 'sam_file': None, 'wrf_file': None, 'var_groups': [VariableGroupBase, VariableGroupLiquidMP, VariableGroupIceMP]} CLEX9_OCT14 = {'name': 'clex9_oct14', 'description': "", 'start_time': 181, 'end_time': 240, 'height_min_value': 2230, 'height_max_value': 6688, 'blackl...
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: map_ops.cc """ import collections from tensorflow.python import pywrap_tfe as pywrap_tfe from tensorflow.python.eager import context as _context from tensorflow.python.eager import core as _core from tens...
# coding: utf-8 """ ML Lab Service Functionality to create and manage Lab projects, services, datasets, models, and experiments. # noqa: E501 OpenAPI spec version: 3.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # pyth...
Attenuation From Seismic Ambient Noise: Numerical Validation and Application, JGR """ def __init__(self, src, savedir=None, verbose=True): """ Parameters ---------- src : str Absolute path to the directory containing the files associated with the continuous seismograms savedir : str Absolute path to t...
#!/usr/bin/env python # # Irrigation system # Release 2020-07-05 First version # Release 2021-02-09 Added queries # Release 2021-02-22 Added meteolib and caluclation of Evaporation via Makkink formula # Release 2021-02-24 Changed days to 28, as too early suggesting to add water # Release 2021-03-01 Added irrigation tab...
positive integer.' ' Got dgap_freq = %s' % dgap_freq) pca = True if not isinstance(evoked, list): evoked = [evoked] _check_reference(evoked[0]) all_ch_names = evoked[0].ch_names if not all(all_ch_names == evoked[i].ch_names for i in range(1, len(evoked))): raise Exception('All the datasets must have the sam...
<reponame>KellyGriffin/kalc from tests.test_util import print_objects from tests.libs_for_tests import prepare_yamllist_for_diff from kalc.model.search import Check_services, Check_deployments, Check_daemonsets, OptimisticRun, CheckNodeOutage, Check_node_outage_and_service_restart from kalc.model.system.Scheduler impor...
def _assign_loaded_columns(self): for ss in range(self.n_storeys): for bb in range(self.n_bays): sect_is = self._loaded_column_section_ids[ss][bb] if hasattr(sect_is, "__len__"): n_sections = len(sect_is) self.columns[ss][bb].split_into_multiple([1] * n_sections) # TODO: should be lengths for sect_i in range(len...
<filename>vaqc/vaqc.py<gh_stars>1-10 import base64 import re import os.path as op from io import BytesIO import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import nibabel as nib import numpy as np from pathlib import Path import pandas as pd import nilearn.image as nim from dipy.segment.mask impor...
[2, 5, 7, 10, 13, 17, 20, 23], "CalmNervous": [3, 6, 9, 12, 15, 19, 22, 24], } _assert_value_range(data, score_range) # Reverse scores 3, 4, 5, 7, 9, 11, 13, 16, 18, 19, 22, 23 # (numbers in the dictionary correspond to the *positions* of the items to be reversed in the item list specified # by the subscale dic...
# -*- coding: utf-8 -*- import asyncio import enum import json import logging import random import time import uuid from typing import * import aiohttp import tornado.websocket import api.base import blivedm.blivedm as blivedm import config import models.avatar import models.translate import models.log logger = logg...
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
evaluate the weighted sum estimate = np.zeros((m, p), dtype) for i in range(n): for j in range(m): arg = 0 for k in range(d): residual = (points_[i, k] - xi_[j, k]) arg += residual * residual arg = np.exp(-arg / 2) * norm for k in range(p): estimate[j, k] += values_[i, k] * arg return np.asarray(estimate) ...
calling replace_photo if file_checksum is None: file_checksum = faw.md5checksum(file) if file_checksum != str(row[4]): self.replace_photo(lock, file, row[1], row[4], file_checksum, last_modified, cur, con) # Closing DB connection litedb.close(con) return success # -----------------------------------------...
<filename>scripts/geodata/neighborhoods/reverse_geocode.py # -*- coding: utf-8 -*- import argparse import logging import operator import os import re import six import subprocess import sys import yaml this_dir = os.path.realpath(os.path.dirname(__file__)) sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pa...