input
stringlengths
2.65k
237k
output
stringclasses
1 value
from django.shortcuts import get_object_or_404, render from django.template import Template, Context from django.http import HttpResponse from .forms import * from datetime import datetime from .models import Memory from .models import UserProfile from django.contrib.auth.models import User from friendship.models impor...
so.num_words() return (tot_num_adjs + tot_num_pron) / tot_num_words class Noun_Verb_Ratio(object): """Class to calculate the ratio of the number of nouns to the number of verbs Ref: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5337522/ """ def __init__(self, sentence_objs): """The init method to initialize wit...
# Copyright Contributors to the OpenCue Project # # 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 ...
height of the video stream in pixels. codedWidth (int): The coded width of the video stream in pixels. colorPrimaries (str): The color primaries of the video stream. colorRange (str): The color range of the video stream. colorSpace (str): The color space of the video stream (ex: bt2020). colorTrc (str): The color ...
""" # set function name (cannot break function here) _ = str(__NAME__) + '.Keyword.validate()' # deal with no test value (use value set at module level) if test_value is None: value = self.value else: value = test_value # deal with no source if source is None: source = self.source # get true value (and test ...
<gh_stars>10-100 # avocado script augmenting spcc - requires spcc_sn_data.txt file import numpy as np import pandas as pd import astronomical_object import augment from scipy.special import erf import string import math from .instruments import band_central_wavelengths from .utils import settings, logger class SPCC_S...
schema="nistData/atomic/nonPositiveInteger/Schema+Instance/NISTSchema-SV-IV-atomic-nonPositiveInteger-maxExclusive-2.xsd", instance="nistData/atomic/nonPositiveInteger/Schema+Instance/NISTXML-SV-IV-atomic-nonPositiveInteger-maxExclusive-2-5.xml", class_name="NistschemaSvIvAtomicNonPositiveIntegerMaxExclusive2", vers...
{ 'resource_registry': stack_reg, } env = { 'resource_registry': env_reg, 'parameter_defaults': {'NetworkConfigWithAnsible': True} } utils.check_nic_config_with_ansible(mock_stack, env) def test_check_heat_network_config_no_ansible(self): stack_reg = { 'OS::TripleO::Controller::Net::SoftwareConfig': 'val', ...
# -*- coding: utf-8 -*- # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt) # <NAME> (<EMAIL>), Blue Yonder Gmbh, 2016 """ Contains a feature selection method that evaluates the importance of the different extracted features. To do so, for every feature the influenc...
raise ValueError('The default search space was not found!') return search_space def default_searcher(cls, search_space, options): assert search_space is not None, '"search_space" should be specified when "searcher" is None or str.' assert optimize_direction in {'max', 'min'} if options is None: options = {} op...
<reponame>ShubhamThakre/datahub from datetime import datetime from functools import lru_cache from typing import Dict, Iterable, Optional import dateutil.parser as dp import requests from pydantic import validator from pydantic.fields import Field from requests.models import HTTPError from sqllineage.runner import Lin...
<reponame>jaymegordo/SMSEventLog import re from collections import defaultdict as dd from functools import partial from typing import * import pandas as pd from PyQt6.QtCore import QAbstractTableModel, QModelIndex, Qt, pyqtSlot from PyQt6.QtGui import QColor from smseventlog import config as cf from smseventlog impor...
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AdverseEvent Release: R5 Version: 4.5.0 Build ID: 0d95498 Last updated: 2021-04-03T00:34:11.075+00:00 """ import typing from pydantic import Field from pydantic import root_validator from pydantic.error_wrappers import ErrorWrapper, Validatio...
<gh_stars>0 import hashlib import json import logging import os import time import functools from threading import RLock from node import constants, datastore, routingtable from node.protocol import proto_store class DHT(object): def __init__(self, transport, market_id, settings, db_connection): self.log = logging...
return drivers[0].set("io", "native") def filebased_volume(): disk = etree.Element('disk', attrib={'type': 'file', 'device': 'disk'}) e(disk, 'driver', None, {'name': 'qemu', 'type': linux.get_img_fmt(volume.installPath), 'cache': volume.cacheMode}) e(disk, 'source', None, {'file': volume.installPath}) if volu...
# # Copyright (C) 2014 Dell, 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,...
# %% [markdown] # # Crowdsourcing Tutorial # %% [markdown] # In this tutorial, we'll provide a simple walkthrough of how to use Snorkel in conjunction with crowdsourcing to create a training set for a sentiment analysis task. # We already have crowdsourced labels for about half of the training dataset. # The crowdsour...
import math import pytest import numpy as np from verifai.features import * ### Utilities def checkFlattening(domain, point, expectedLength=None, coordsAreNumeric=None): flat = domain.flatten(point) assert type(flat) is tuple assert len(flat) == domain.flattenedDimension if expectedLength is not None: assert l...
flow_id to be used across UL and DL. # Since HSIA flow is the only symmetric flow currently, we need to # re-use the flow_id across both direction. The 'flow_category' # takes priority over flow_cookie to find any available HSIA_FLOW # id for the ONU. flow_category = HSIA_FLOW if self.is_no_l2_modification_flow...
res[3] == {'number': 3, 'letter': 'c'} assert res[4] == {'number': 3, 'letter': 'c'} assert res[5] == {'number': 3, 'letter': 'c'} def test_flat_map_identity(self): t = XFrame({'id': [1, 2, 3], 'val': ['a', 'b', 'c']}) res = t.flat_map(['number', 'letter'], lambda row: [[row['id'], row['val']]], column_types=[i...
current implementation of this API uses Spark's Window without specifying partition specification. This leads to move all data into single partition in single machine and could cause serious performance degradation. Avoid this method against very large dataset. Returns ------- Series or DataFrame Returned objec...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 7 11:33:50 2019 @author: callie_macbookair NOTE: You MUST have a sleep time in between starting the digitizer and starting fifo. The digitizer needs time start up and fifo will time out if you do not wait. I suggest something like 5-7 se...
from cognite.client.data_classes._base import * class TransformationDestination: """TransformationDestination has static methods to define the target resource type of a transformation Args: type (str): Used as data type identifier on transformation creation/retrieval. """ def __init__(self, type: str = None): ...
h2*k2 chiStemp,rhoftemp,grun,KS=getchiSgrun(ytemp[2],ytemp[0],chiSold,scale,param) k3 = eval(diffeq + '(rold+h2,ytemp,ricb,rcmb,rhoftemp,grun,KS,scale)') # 2nd slope at midpoint k3 = np.array(k3) ytemp = yold + h*k3 chiStemp,rhoftemp,grun,KS=getchiSgrun(ytemp[2],ytemp[0],chiSold,scale,param) k4 = eval(diffeq + ...
import json import re import time import requests from multiprocessing.dummy import Pool import lxml.html # # html = requests.get('https://www.baidu.com').content.decode() # # print(html) def query(url): """ 获取网页源代码 :param url: :return: """ requests.get(url) def ca_time(): """ 计算获取100次网页代码多线程时间 :return: ...
Category :type diagnostic_category: str :param slot: Slot Name :type slot: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsfor...
"""Create important distributions classes. Especially provide the logic for a hypererlang distributions with data fitting. """ import logging import multiprocessing as mp from itertools import combinations_with_replacement from typing import Any, Dict, Generator, Iterable, List, Optional, Union import matplotlib.pyp...
# Author: <NAME> # VK: vk.com/maksim2009rus # 1) Generating a Non-Deterministic Finite Automaton by a regular expression. # 2) Translation of NDFA to DFA. # import graphviz as gv # Standard character classes D = frozenset("0123456789") W = D | frozenset("_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") S = fro...
from __future__ import absolute_import from __future__ import print_function from __future__ import division import datetime import time import json try: import arcpy arcpyFound = True except: arcpyFound = False from ..packages import six import copy import os import tempfile import uuid from .spatial import json_to...
import numpy as np import math from .utils import ( MinCurve, get_nev, get_vec, get_angles, HLA_to_NEV, NEV_to_HLA, get_sigmas ) from welleng.error import ErrorModel from welleng.exchange.wbp import TurnPoint class Survey: def __init__( self, md, inc, azi, n=None, e=None, tvd=None, x=None, y=None, ...
<filename>spectramanipulator/treewidget.py from PyQt5.QtCore import Qt, QItemSelectionModel, QItemSelection, pyqtSignal, QModelIndex from PyQt5.QtWidgets import QApplication, QMessageBox, QMenu, QAction from PyQt5.QtGui import QCursor, QColor import numpy as np import os from spectramanipulator.spectrum import Spectr...
self.title_email_5.setGeometry(QtCore.QRect(0, 90, 80, 30)) self.title_email_5.setMinimumSize(QtCore.QSize(0, 30)) self.title_email_5.setMaximumSize(QtCore.QSize(10000, 30)) font = QtGui.QFont() font.setFamily("Segoe UI Black") font.setPointSize(14) font.setBold(False) font.setItalic(False) font.setWeight(10) ...
trp_player = 0 trp_multiplayer_profile_troop_male = 1 trp_multiplayer_profile_troop_female = 2 trp_temp_troop = 3 trp_find_item_cheat = 4 trp_random_town_sequence = 5 trp_tournament_participants = 6 trp_tutorial_maceman = 7 trp_tutorial_archer = 8 trp_tutorial_swordsman = 9 trp_novice_fighter = 10 trp_regular_fighter =...
in memory nLC = len(self.loadCases) self.PLN = [0] * nLC self.PLFx = [0] * nLC self.PLFy = [0] * nLC self.PLFz = [0] * nLC self.PLMx = [0] * nLC self.PLMy = [0] * nLC self.PLMz = [0] * nLC for icase, lc in enumerate(self.loadCases): gx = lc.gx gy = lc.gy gz = lc.gz # copy data over for this case self.P...
<gh_stars>0 ####################################################################### # Module: SQLiteDataAccessLayer # Purpose: This class has all the data access code specific to SQLite ####################################################################### from core.expense_category import ExpenseCategory from core.s...
= Embed( title="Akinator", description="I think it is **{0.first_guess[name]} - {0.first_guess[description]}**\n\nWas I right?".format(aki) ) e.set_footer(text=f"Thanks for playing, {ctx.author.name}!") e.set_image(url=aki.first_guess["absolute_picture_path"]) e.set_thumbnail(url=akimage) except Exception as ex:...
import numpy, logging from sys import exit from Classes.DotData import DotData from Operations.Shari_Operations.localize.xpopMerge import xpopMerge from Operations.Shari_Operations.localize.Scenario import GetSelectionScenarios, GetScenarios from Operations.MiscUtil import MakeAlphaNum, Dict, Sfx, progress, AddFileSfx ...
<reponame>mathpluscode/DeepReg import itertools import numpy as np import tensorflow as tf import deepreg.model.layer_util as layer_util class Activation(tf.keras.layers.Layer): def __init__(self, identifier: str = "relu", **kwargs): """ Layer wraps tf.keras.activations.get(). :param identifier: e...
, logLevel.DEBUG , method , "----- %s == %s" % (resolvedTemplatePath, path)]) resolvedTemplatePath = path[1] else: #logQ.put( [logType , logLevel.DEBUG , method , "----- %s != %s" % (resolvedTemplatePath, path)]) pass logQ.put( [logType , logLevel.WARNING , method , exception]) logQ.put( [logType , logLevel.DEB...
import face_recognition from PIL import Image, ImageDraw import numpy as np from sklearn.svm import LinearSVC import glob import os import matplotlib.pyplot as plt ''' Draw box on all face_locations of an image ''' def draw_face_box(image, face_locations): # Convert the image to a PIL-format image pil_image = Imag...
import theano import theano.tensor as T import lasagne as nn from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams _srng = RandomStreams() class TiedDropoutLayer(nn.layers.Layer): """ Dropout layer that broadcasts the mask across all axes beyond the first two. """ def __init__(self, input_layer,...
<filename>src/huggingface_hub/repository.py import logging import os import re import subprocess from contextlib import contextmanager from pathlib import Path from typing import List, Optional, Union from huggingface_hub.constants import REPO_TYPES_URL_PREFIXES from .hf_api import ENDPOINT, HfApi, HfFolder, repo_typ...
# file eulfedora/api.py # # Copyright 2010,2011 Emory University Libraries # # 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 b...
<gh_stars>10-100 ## # Copyright (c) 2013-2017 Apple 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 require...
or tuple the width of the convolutional kernel. This can be either a two element tuple, giving the kernel size along each dimension, or an integer to use the same size along both dimensions. stride: int or tuple the stride between applications of the convolutional kernel. This can be either a two element tuple, g...
dimension if dim < 2 or dim > 3: raise ValueError('Undefined transform for dimension: %d' % (dim,)) # Obtain grid-to-world transform for sampling grid if sampling_grid2world is None: if apply_inverse: sampling_grid2world = self.codomain_grid2world else: sampling_grid2world = self.domain_grid2world if sampling...
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.637134, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 6.00062, 'S...
params.add('detFrac', 0.65) else: params.add('detFrac', detFracInit) if strutFracInit is None: params.add('strutFrac', 0.07) else: params.add('strutFrac', strutFracInit) if focalPlanePositionInit is None: params.add('dxFocal', 0.0) params.add('dyFocal', 0.0) else: params.add('dxFocal', focalPlanePositionIn...
<reponame>no7hings/Lynxi<filename>workspace/module/python-2.7/LxBasic/bscMtdCore.py # coding:utf-8 from . import bscCfg class Mtd_BscBasic(bscCfg.BscUtility): pass class Mtd_BscPython(Mtd_BscBasic): @classmethod def _bsc_mtd__set_python_module_load_(cls, moduleName): loader = cls.MOD_pkgutil.find_loader(moduleN...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Generator to yield resampled volume data for training and validation """ # %% from keras.models import load_model, Model from matplotlib import pyplot as plt import numpy as np import os from os import path import random import SimpleITK as sitk from stl import mesh...
1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0...
so the first interesting line is called \"line 1\" then. The optional argument `name` is a name identifying this string, and is only used for error messages. """ return [x for x in self.parse(string, name) if isinstance(x, Example)] def _parse_example(self, m, name, lineno): """ Given a regular expression mat...
% macro if not macro in self.sections: message.warning('missing special word macro: [%s]' % macro) # Check all text quotes have a corresponding tag. for q in self.quotes.keys()[:]: tag = self.quotes[q] if not tag: del self.quotes[q] # Undefine quote. else: if tag[0] == '#': tag = tag[1:] if not tag in self.t...
#!/usr/bin/python3 import os import click import sys import csv import time import pandas as pd import country_converter as coco import hashlib import phonenumbers from tqdm import tqdm from uszipcode import SearchEngine HEADER_TRANSLATIONS = { "email1": "Email", "phone1": "Phone", "person_country": "Country", } R...
position_ids, return_dict=False, init_cache=True ) return unfreeze(init_variables["cache"]) @add_start_docstrings_to_model_forward(BERT_INPUTS_DOCSTRING.format("batch_size, sequence_length")) def __call__( self, input_ids, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None, encoder_...
''' New t0 algorithm is getting close, but not close enough. 1. Run previous analysis using only exponential signal. In general, this should predict a t0 that is slightly ahead of the actual t0. 2. Determine a baseline by looking inbetween the LED pulses and taking the average. (Integrate and divide by length?) 3. Fro...
# ****************************************************** ## Revision "$LastChangedDate: 2018-06-01 15:05:44 +0200 (Fri, 01 Jun 2018) $" ## Date "$LastChangedRevision: 1 $" ## Author "$LastChangedBy: arthurbeusen $" ## URL "$HeadURL: https://pbl.sliksvn.com/generalcode/test_allocation.py $" # ***************************...
<gh_stars>0 from functools import reduce from operator import add import concurrent.futures import csv import fire import math import numpy as np import os import pandas as pd import pickle import re ## Utilities ## def map_dict(elem, dictionary): if elem in dictionary: return dictionary[elem] else: return np.n...
# Copyright 2020 AstroLab Software # Author: <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
-t OBJECTS -i ' + file_name + ' > ' + ofile) file = open(ofile,'r').readlines() for line in file: if string.find(line,"Key name") != -1 : red = re.split('\.+',line) key = red[1].replace(' ','').replace('\n','') out_key = prefix + key if reduce(lambda x,y: x+ y, [string.find(out_key,k)!=-1 for k in key_list]): o...
<gh_stars>0 from . import TestConfig from app.api_views.operation import * from app.logic.operation import getCountry, getOperation from app.logic.person import getPerson, getPohto, deletePerson import json import os from io import BytesIO class TestOperationApi(TestConfig): def test_addcountry(self): # first lo...
@param noCenter if True, do not remove the average before computing the covariance, it means we assume variables are already centered @return correlation factor or correlation, sigma1, sigma2 if deviations is True """ if len(values) <= 1: raise ValueError( # pragma: no cover "expecting more than one observation, ...
VMs :param username: user id :type username: string :param cloudname: cloud name :type cloudname: string :param itemkeys: a list of lists, The first item in a sublist is used as header name, the folling ones are the path to the value that user wants in the dict, for example: itemkeys = [ ['id', 'id'], ['n...
<gh_stars>0 # # This file is part of the chi repository # (https://github.com/DavAug/chi/) which is released under the # BSD 3-clause license. See accompanying LICENSE.md for copyright notice and # full license details. # import unittest import numpy as np from scipy.stats import norm, truncnorm import chi class T...
text="\nУстановить сертифиакт(ы) для локального пользователя\nили для всех сразу? (хранилище mRoot)") dialogWindow.set_title("Вопрос") dialogWindow.add_buttons("Локально", Gtk.ResponseType.CANCEL, "Для всех", Gtk.ResponseType.OK) dialogWindow.show_all() response = dialogWindow.run() dialogWindow.destroy() return ...
"ServerResMessage", 0x009F: "Reset", 0x0100: "KeepAliveAckMessage", 0x0101: "StartMulticastMediaReception", 0x0102: "StartMulticastMediaTransmission", 0x0103: "StopMulticastMediaReception", 0x0104: "StopMulticastMediaTransmission", 0x0105: "OpenReceiveChannel", 0x0106: "CloseReceiveChannel", 0x0107: "Connectio...
<filename>src/sol/parser.py """ Data parsing functions applicable to all transactions """ import logging import re from datetime import datetime, timezone from sol import util_sol from sol.api_rpc import RpcAPI from sol.constants import BILLION, CURRENCY_SOL, INSTRUCTION_TYPE_DELEGATE, MINT_SOL, PROGRAM_STAKE from s...
extend this class. """ def __init__(self, value: ATTRIBUTE_TYPES) -> None: """ Initialize a Relation object. :param value: the right value of the relation. """ self.value = value @property @abstractmethod def _operator(self) -> query_pb2.Query.Relation: """The operator of the relation.""" @classmethod ...
is the parent/ancestor of the relation destuser = ndb.KeyProperty(kind=UserModel) def set_dest(self, user_id): """ Set a destination user key property """ k = None if user_id is None else ndb.Key(UserModel, user_id) self.destuser = k @classmethod def list_favorites(cls, user_id, max_len=MAX_FAVORITES): """ Qu...
"order": 11 }, "id": { "type": "string", "title": "ID", "description": "ID", "order": 12 }, "in_group": { "type": "boolean", "title": "In Group", "description": "In group", "order": 13 }, "indicator_count": { "type": "integer", "title": "Indicator Count", "description": "Indicator count", "order": 14 ...
# Copyright <NAME> 2016 # Copyright <NAME> 2016 # Copyright <NAME> 2016 # Licenced under 3 clause BSD licence # # # Solar Control System # # <NAME> --- 30th January 2016 # # # <eventInterface module='EventHandlers.SolarRun' name='SolarRun' > # <check_time type='http://id.webbrick.co.uk/events/config/get' source='s...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
<reponame>pcie-bench/pcie-model ## Copyright (C) 2018 <NAME>. All rights reserved. ## Copyright (C) 2015 Netronome Systems, 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 ...
<reponame>mingwayzhang/tvm # 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 the Apache License, Version 2.0 (the # ...
length is equal to the number of frequency channels, it will be assumed identical for all interferometers. If a 2D array is provided, it should be of size n_baselines x nchan. Tsys = Tnet vis_freq [numpy array] The simulated complex visibility (in Jy or K) observed by each of the interferometers along frequency ...
only the aspects affected by the change in the snapshot.""" return self._inner_dict.get('proposedSnapshot') # type: ignore @proposedSnapshot.setter def proposedSnapshot(self, value: Union["ChartSnapshotClass", "CorpGroupSnapshotClass", "CorpUserSnapshotClass", "DashboardSnapshotClass", "DataFlowSnapshotClass", "Da...
"s004" # 0x050C cia402sts[0-5] S005 = "s005" # 0x050E sts[0-5] S006 = "s006" # 0x0510 rtn[0-5] S007 = "s007" # 0x0512 cia402err[0-5] S008 = "s008" # 0x0514 alarm[0-5] S009 = "s009" # 0x0518 targetplsfb[0-5] S010 = "s010" # 0x051C cia402actualpls[0-5] S011 = "s011" # 0x0520 cia402followingerr[0-5] S012 = "s012" ...
<gh_stars>1-10 ''' show_smnp.py JUNOS parsers for the following commands: * show snmp mib walk system * show configuration snmp ''' # Python import re # Metaparser from genie.metaparser import MetaParser from pyats.utils.exceptions import SchemaError from genie.metaparser.util.schemaengine import (Any, Optional, ...
0, -1, 0, 0, 0, -1), (1, 1, 1, 0, 0, -1, -1, 0, 0)] else: # borders 8, 9 return [(1, 0, 0, 0, 1, 0, 0, 0, 1), (-1, 0, 0, 0, 0, -1, 0, -1, 0), (0, -1, 0, -1, 0, 0, 0, 0, -1), (0, 0, -1, 0, -1, 0, -1, 0, 0), (0, 0, 1, 1, 0, 0, 0, 1, 0), (0, 1, 0, 0, 0, 1, 1, 0, 0)] elif self._border(10): if self._border(11) an...
that model. See more here: http://stackoverflow.com/a/15745652""" self.object = form.save(commit=False) # don't save M2M fields self.object.username = create_username( personal=form.cleaned_data["personal"], family=form.cleaned_data["family"] ) # Need to save that object because of commit=False previously. # ...
tth_eta, gvec_l = xfcapi.detectorXYToGvec( dpts.T, rmat_d, rmat_s, tvec_d, tvec_s, tvec_c, beamVec=beamVec) tth_eta = np.vstack(tth_eta).T # warp measured points if distortion is not None: dpts = distortion.apply_inverse(dpts) # plane spacings and energies dsp = 1. / mutil.columnNorm(np.dot(bMat, dhkl)) wl...
lb, size, value): """set_block(StringDataSet3D self, DataSetIndex3D lb, DataSetIndex3D size, Strings value)""" return _RMF_HDF5.StringDataSet3D_set_block(self, lb, size, value) def set_size(self, ijk): """set_size(StringDataSet3D self, DataSetIndex3D ijk)""" return _RMF_HDF5.StringDataSet3D_set_size(self,...
<filename>peter_sslers/web/lib/form_utils.py # pypi import six # local from ...lib import db as lib_db from ...lib import utils from ...model import objects as model_objects from ...model import utils as model_utils from . import formhandling # ========================================================================...
to # verify the default if logfile is not None: # Logfile is not using Syslog, verify with salt.utils.files.set_umask(0o027): verify_log_files([logfile], self.config["user"]) if logfile is None: # Use the default setting if the logfile wasn't explicity set logfile = self._default_logging_logfile_ cli_log_fil...
############################################################################ # Copyright 2021 Plataux 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 # # # # https://www.apache.or...
<gh_stars>100-1000 """ grdtrack - Sample grids at specified (x,y) locations. """ import pandas as pd from pygmt.clib import Session from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import ( GMTTempFile, build_arg_string, fmt_docstring, kwargs_to_strings, use_alias, ) __doctest_skip__ = ["grdtrack"]...
<reponame>thomasbuttler/leo-editor # -*- coding: utf-8 -*- #@+leo-ver=5-thin #@+node:ekr.20210902073413.1: * @file ../unittests/core/test_leoAst.py #@@first """Tests of leoAst.py""" #@+<< leoAst imports >> #@+node:ekr.20210902074548.1: ** << leoAst imports >> import ast import os import sys import textwrap import time ...
""" Tools for creating and manipulating 1,2, and 3D meshes. .. inheritance-diagram:: proteus.MeshTools :parts: 1 """ from __future__ import print_function from __future__ import absolute_import from __future__ import division from builtins import input from builtins import zip from builtins import next from builtins ...
<gh_stars>0 """ Gradients for truncated and untruncated latent variable models. """ import torch as ch from torch import Tensor from torch import sigmoid as sig from torch.distributions import Gumbel, MultivariateNormal, Bernoulli import math from .utils.helpers import logistic, censored_sample_nll class CensoredM...
if module_name in v2_modules: # already v2 return v2_modules.add(module_name) if module_name in set_up: set_up.remove(module_name) if module_name in done: # some submodules already loaded as v1 => reload imports.extend(done[module_name].values()) del done[module_name] if module_name in ast_by_top_level_mod: ...
<reponame>stippingerm/mypylib<filename>multivariate_distns/copula.py """General copula.""" # Author: <NAME> # Inspired by and based on sci-kit learn mixture models # License: BSD 3 clause # See: Berkes, Wood & Pillow (2009). Characterizing neural dependencies with copula models. NIPS 21, 129–136. # Retrieved from htt...
size is a multiple of this value. length_bucket_width: The width of the length buckets to select batch candidates from. ``None`` to not constrain batch formation. length_fn: A function or list of functions (in case of a parallel dataset) that take features as argument and return the associated sequence length. pad...
the node must have all of the properties defined in the frame. :param state: the current framing state. :param subject: the subject to check. :param frame: the frame to check. :param flags: the frame flags. :return: True if the subject matches, False if not. """ # check ducktype wildcard = True matches_some...
from cgitb import small import pygame import button import random import webbrowser import display_functions # this will store dark/light mode, music manipulation, etc. from pygame import mixer from time import time import math from backend_functions import * from checkDouble import * # initialize pygame a...
"== 0 and input is sparse. Provide a dense " "array instead." ) else: self.statistics_ = self._sparse_fit( X, self.strategy, self.missing_values, fill_value ) else: self.statistics_ = self._dense_fit( X, self.strategy, self.missing_values, fill_value ) return self def _sparse_fit(self, X, strategy, missi...
# python imports import os import os.path import sys import string import re from Tkinter import * from tkFileDialog import * # dependency imports sys.path.append('./Dependencies') import vtk #import vtkTkImageViewerWidget import Pmw # internal imports import MolecularSystem import MolecularViewer import GUICards sys.p...
# Runge-Kutta Driver for quaternions-described object orientation # Import other packages used import numpy as np # Import constants and parameters used from Parameters_and_Constants import pi, moi # Dual Matrix to a vector # Inputs: # - 3D array ( vec[ 3 ] ) # Outputs: # - 3x3 matrix ( dvec ) which is its dual for ...
# -*- coding: utf-8 -*- """ @author: <NAME> <<EMAIL>> Date: Aug 2017 """ import numpy as np import pandas as pd from ..simenv import SimEnv from .. import precomp_funs as _pf class MixingValve(SimEnv): """ type: MixingValve class. The MixingValve **mixes or separates** a flow. The flow on the 2-end-side is mixe...
A boolean flag denoting whether the symbol is a next proc function. The argument is mutually exclusive with arguments: 'parametric_values' and 'is_implicit_token'. Returns: The "mangled" symbol string. """ # Type validation for optional inputs. if parametric_values and type(parametric_values) != "tuple": fail...
"clusters": [ { "id": "clqr4b0ox", "name": "KPS Jobs", "type": "Kubernetes Processing Site", "region": "Private", "cloud": "aws", "teamId": "teo6raui0", "isDefault": False, "dtCreated": "2019-07-22T14:50:10.170Z", "dtModified": "2020-02-28T20:58:26.134Z", "clusterId": 92, "isPrivate": True, "modelName": "t...