input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.0908895,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 3.11333,
'... | |
rc
@classmethod
def RemoveXAttr( cls, volume, msent, xattr_name, xattr_nonce, xattr_hash ):
"""
Delete an extended attribute from the MSEntry msent.
The caller needs to ensure that only the coordinator can call this method.
"""
storagetypes.deferred.defer( MSEntryXAttr.remove_and_uncache, volume, msent,... | |
},
"ContinentalKennelClub": {
"109211": ("Continental Kennel Club", [7481]),
},
"ContinuityEquation": {
"125212": ("Continuity Equation", [12227, 12229]),
},
"ContinuityEquationByMeanVelocity": {
"125213": ("Continuity Equation by Mean Velocity", [12227, 12229]),
},
"ContinuityEquationByPeakVelocity": {
"125... | |
as the
GAIA_ASTROMETRIC_EXCESS_NOISE column will be missing; though we do not
expect this configuration to happen, so it should be fine for now.
TBD: the PLATE_{RA,DEC,REF_EPOCH} columns currently simply are copy of RA,DEC,REF_EPOCH
TBD: but it prepares e.g. to add chromatic offsets.
20210526 : implementation of ... | |
23,
'NameFirst': 'Rob',
'NameLast': 'Ickes'
}},
status=200)
responses.add(
responses.GET,
f"{service.url}/Employees(23)/Addresses(456)",
json={'d': {
'ID': 456,
'Street': 'Baker Street',
'City': 'London'
}},
status=200)
request = service.entity_sets.Employees.get_entity(23)
assert isinstance(request, ... | |
"""
Class for performing a HESS style 2D fit of muon images
To do:
- Deal with astropy untis better, currently stripped and no checks made
- unit tests
- create container class for output
"""
import numpy as np
from scipy.ndimage.filters import correlate1d
from iminuit import Minuit
from astropy import units as u
... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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
... | |
from helpers import quote, quote_length, login_required, stuck, get_metadata, get_courses, get_progression, get_now, good_work, yt_playlist
import bcrypt
from flask import Flask, flash, redirect, render_template, request, session, send_file
from flask_session import Session
from flask_mail import Mail, Message
from wer... | |
the noise.
resistance : float, optional
The resistance (ohm) for the noise. Used in combination with the value
of `temperature` to calculate the RMS voltage of the noise.
uniqueness_factor : int, optional
The number of unique waveform traces that can be expected from this
noise signal. This factor multiplies the ... | |
= 'Duplicate record detected'
@auth.requires_login()
def machselect():
#wanneer weergeven als geen reginfo?
strIkke = ''
intScreenWidth = 0
gintCountryNr = 0
gintPlantNr = 0
gintSubPlantNr = 0
gintDepartmentNr = 0
formtable = SQLFORM.factory()
intFromSeconds = 0
intToSeconds = 0
try:
intScre... | |
import os, string, sys, subprocess
###############################################################################
#
# Purpose:
# This is the primary front end launcher for programs in the VisIt toolchain.
# It is separate from the pieces than change on a per-version basis.
#
# More specifically:
# Parse out version a... | |
-> None:
"""Record extra information on a delta obtained by diffing schemas.
This provides an apportunity for a delta command to annotate itself
in schema diff schenarios (i.e. migrations).
Args:
schema:
Final schema of a migration.
orig_schema:
Original schema of a migration.
context:
Schema comparison c... | |
= 0
for item in prev_ext:
ext_hours += item.amount_completed
if instance.amount_completed + ext_hours > 5:
instance.amount_completed = max(0, 5-ext_hours)
instance.save()
request.session['success_message'] = ('External service '
'successfully updated.')
return redirect('member_resources:view_misc_reqs')
else:... | |
# MIT License
#
# Copyright (c) 2021 Dragorn421
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | |
from warnings import catch_warnings
from warnings import filterwarnings
from warnings import warn
import numpy as np
from numpy import empty
from numpy import vstack
from pydmd import DMD
from pydmd import DMDBase
from sklearn.base import BaseEstimator
from sklearn.metrics import r2_score
from sklearn.pipeline import ... | |
"""
defines methods to access MPC/rigid element data:
- get_mpc_node_ids( mpc_id, stop_on_failure=True)
- get_mpc_node_ids_c1( mpc_id, stop_on_failure=True)
- get_rigid_elements_with_node_ids(self, node_ids)
- get_dependent_nid_to_components(self, mpc_id=None, stop_on_failure=True)
- get_lines_rigid(model: BDF)
-... | |
#! /usr/bin/python3.6
class CATIAMeasurable:
"""
The interface to access a CATIAMeasurable Get measurements on the object.
.. note::
CAA V5 Visual Basic help
Two types of measurement can be done:
| itself : gives dimensions related to the object itself (ex the radius of a circle).
| between : gives dimensio... | |
<filename>metalibm_functions/ml_exp_adaptative.py
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
... | |
<reponame>tacaswell/sardana
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it und... | |
import os
cur_dir = os.path.dirname(os.path.abspath(__file__))
from django.contrib.auth.models import User
from reportlab.lib.pagesizes import A5, A4, letter
from geraldo.utils import BAND_WIDTH, TA_CENTER, TA_RIGHT, TA_LEFT, cm
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_RIGHT
from reportlab.lib.colors... | |
from utilityFunctions import HandleError, printMessage
import sys
import numpy
import math
import operator
import os
import time
class Column(object):
def __init__(self, list):
self.l = list
def max(self):
return max(self.l)
def at(self, i):
return self.l[i]
def append(self, col):
self.l.extend(col.l)
... | |
'termos_comparacao_treino.txt')
lista = []
if os.path.isfile(arq):
linhas = carregar_arquivo(arq=arq,limpar=False,juntar_linhas=False)
else:
# cria uma lista de termos para comparação
if self.model is None:
return []
_novos_termos = [_ for _ in self.model.wv.key_to_index if _.find('#')<0]
random.shuff... | |
:py:class:`L2VpnLoggingEnum <ydk.models.cisco_ios_xr.Cisco_IOS_XR_l2vpn_cfg.L2VpnLoggingEnum>`
"""
_prefix = 'l2vpn-cfg'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.accept_shutdown = None
self.action = None
self.disable = None
self.enable = None
self.logging = None
@property
... | |
= nn.Sequential(
nn.Conv2d(num_features, num_features // 2, kernel_size=3, padding=1), nn.SELU(),
nn.Conv2d(num_features // 2, 1, kernel_size=1), nn.Sigmoid()
)
self.a = nn.Sequential(
nn.AdaptiveAvgPool2d(1),
nn.Conv2d(num_features, num_features, kernel_size=1), nn.SELU(),
nn.Conv2d(num_features, num_features, ... | |
self.do_sq,
serversocketbase.CRUD_delete: self.do_sq,
serversocketbase.CRUD_update: self.do_sq}
self._set_CRUD(i_crud, o_crud)
super().__init__(modelname, dc)
def do_sq(self, qmode: serversocketbase.CRUDMode, kwargs: dict) -> bool:
return self._hidden_do_sq(self._otab[qmode], kwargs)
def _hidden_do_sq(self, qf... | |
from abc import ABCMeta
from array import array
import codecs
import collections
import copy
from dataclasses import dataclass
import enum
from itertools import zip_longest
from functools import wraps
import io
import math
from numbers import Number
from numbers import Real
from numbers import Integral
import operator ... | |
the weight field {self.weight_field}. "
"These destinations will be counted with a weight of 0."))
def _validate_od_settings(self):
"""Validate OD cost matrix settings by spinning up a dummy OD Cost Matrix object.
Raises:
ValueError: If the travel mode doesn't have a name
Returns:
str: JSON string r... | |
== 0)
m.c3103 = Constraint(expr= - m.x59 + m.x2199 + m.x3039 + m.x3119 + m.x3479 + m.x3559 + m.x5949 - m.x5959 == 0)
m.c3104 = Constraint(expr= - m.x59 + m.x2200 + m.x3040 + m.x3120 + m.x3480 + m.x3560 + m.x5950 - m.x5960 == 0)
m.c3105 = Constraint(expr= - m.x59 + m.x2201 + m.x3041 + m.x3121 + m.x3481 + m.x3561 + m.... | |
= os.path.join(log_path, const.COMPONENT_NAME, Rgw._machine_id)
os.makedirs(log_dir_path, exist_ok=True)
return log_dir_path
@staticmethod
def _create_rgw_user(conf: MappedConf):
"""Create RGW admin user."""
user_name = Rgw._get_cortx_conf(conf, const.AUTH_USER_KEY)
access_key = Rgw._get_cortx_conf(conf, const.... | |
import tensorflow as tf
import tensorflow.contrib as tf_contrib
import numpy as np
import os
import time
import sys
def save(sess , checkpoint_dir , step , saver , model_dir='' , model_name="ResNet" , final=False):
checkpoint_dir = os.path.join(checkpoint_dir, model_dir)
checkpoint_dir_final = os.path.join(checkpo... | |
DLPyError('Columns {} are not in results'.format(items_not_in_results))
if self.training_history is not None:
if tick_frequency > 1 and tick_frequency <= self.n_epochs:
x_ticks = np.array([1] + list(range(tick_frequency,
len(self.training_history.Epoch) + 1, tick_frequency)))
else:
x_ticks = self.training_histo... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Adapters for the field names/types returned by the MAST API.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["koi_adapter", "planet_adapter", "star_adapter", "dataset_adapter",
"epic_adapter"]
import logging
import s... | |
<reponame>daisymzhang/python-BeamDynamicsTools
#Trajectory.py
from numpy import *
#import scipy as sp
import pylab as pl
from mpl_toolkits.mplot3d import Axes3D
from numpy.linalg import norm
from Ellipse import *
from AngleCorrection import *
from Target import *
import timeit
#======= Default injection geometry ====... | |
# inverse fourier transform
inverse_fft = np.fft.ifftn(SF_reordered)
# reorder again
inverse_fft = inverse_fft[ndx_x, :, :]
inverse_fft = inverse_fft[:, ndx_y, :]
inverse_fft = inverse_fft[:, :, ndx_z]
# fourier transform of inversion as a test
# ft = np.abs(np.fft.fftn(inverse_fft))**2
# ft = ft[ndx_x, :]
#... | |
or all string
('k', 'g1', 'g2').
Each scale score is the lowest scale score for that performance
level. So 220 is the lowest possible score in kindergarten
Listening as well as the lowest in the 'B'asic performance level.
Note the "Max" column. This is the maximum possible scale score,
at the top of the high... | |
<gh_stars>10-100
import os
import sys
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..'))
from utils.np_op import plabel2subset
from ortools.graph import pywrapgraph
import numpy as np
import copy
def greedy_max_matching_label_solver_hungarian_initialization(array, plamb, labels, k, valu... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
General-purpose sliding-window lossless compression
Based on LZ77/78 work
Aiming to be suitable for embedded systems
This code is licensed according to the MIT license as follows:
----------------------------------------------------------------------------
Copyright (c) 20... | |
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getCritiqueDiscreteInputArch", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
d... | |
os.DirEntry):
st = src.stat(follow_symlinks=follow)
else:
st = lookup("stat")(src, follow_symlinks=follow)
mode = stat.S_IMODE(st.st_mode)
lookup("utime")(dst, ns=(st.st_atime_ns, st.st_mtime_ns),
follow_symlinks=follow)
# We must copy extended attributes before the file is (potentially)
# chmod()'ed re... | |
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def create_card_issue_using_post(self, issue_... | |
<filename>src/transformers/utils/dummy_pt_objects.py
# This file is autogenerated by the command `make fix-copies`, do not edit.
# flake8: noqa
from ..file_utils import DummyObject, requires_backends
class PyTorchBenchmark(metaclass=DummyObject):
_backends = ["torch"]
def __init__(self, *args, **kwargs):
requires... | |
params passed in kwargs can be any of the optional GET arguments specified in the Walmart specification
"""
#Avoid format to be changed, always go for json
kwargs.pop('format', None)
request_params = self.params
for key, value in kwargs.items():
request_params[key] = value
#Convert from native boolean python ty... | |
# -*- coding: utf-8 -*-
"""
ambari_jinja2.testsuite.ext
~~~~~~~~~~~~~~~~~~~~
Tests for the extensions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import unittest
from ambari_jinja2.testsuite import JinjaTestCase, filesystem_loader
from ambari_jinja2 impor... | |
self.Net.int] # child arc objects
# Add binary slack indicator variables to Cplex object
slack_vars = ["sl("+str(a.id)+")" for a in parents]
# Add variables to Cplex object
self.LowerModel.variables.add(names=slack_vars,
types="B"*len(parents))
# Define slack constraint names, senses, and righthand sides
slac... | |
<filename>src/pymodaq/daq_analysis/daq_analysis_main.py
import pymodaq.daq_utils.gui_utils.file_io
from qtpy import QtGui, QtWidgets
from qtpy.QtCore import Qt, QObject, Signal, QByteArray
import sys
import pymodaq
import pymodaq.daq_utils.parameter.ioxml
from pymodaq.daq_utils.plotting.data_viewers.viewer1D import Vi... | |
<gh_stars>1-10
giftstrings = [ # Gift emoji will be prefixed to these strings.
"{0} just sent a 🏈 Football to {1}. <NAME> is proud of you.",
"{0} just sent a 📹️ GIF to {1}. Its expiration date was supposed to be years ago.",
"{0} just sent a 🪆 Matryoshka doll to {1}. There's a lot of dolls in one single package!"... | |
# -*- coding: utf-8 -*-
"""
[fact.py]
Fact Plugin
[Author]
<NAME>
[About]
Returns a random fact.
Facts sourced from Mental Floss
http://mentalfloss.com/article/55443/101-amazing-facts
[Commands]
>>> .fact
returns random fact
"""
import random
class Plugin:
def __init__(self):
pass
def __fact():
return rando... | |
<filename>phasefeatures.py
import numpy as np
import cv2
# References:
#
# <NAME>, "Image Features From Phase Congruency". Videre: A
# Journal of Computer Vision Research. MIT Press. Volume 1, Number 3,
# Summer 1999 http://mitpress.mit.edu/e-journals/Videre/001/v13.html
#
# <NAME>, "Phase Congruency Detects Corners a... | |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ <NAME> + <NAME>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ------------------------... | |
n array of image DN values. Each row of the array matches to the corresponding
column in the :attr:`matched_catalogue_unit_vectors_inertial`, :attr:`matched_catalogue_unit_vectors_camera`,
:attr:`matched_catalogue_image_points`, and :attr:`matched_extracted_image_points` arrays, and the
corresponding row in the :att... | |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2003, 2004 IOPEN Technologies Ltd
# Copyright 2013, 2015 OnlineGroups.net and Contributors.
#
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2... | |
<reponame>jhuboo/sparky<filename>Code/Client/Main.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from ui_led import Ui_led
from ui_face import Ui_Face
from ui_client import Ui_client
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Client impor... | |
# -*- coding: utf-8 -*-
"""
The seismic data class
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ..core import core, io
#, core3d, io
# from ..core.pair import Pair
# from ..core.window import Window
# from . import eigval, rotcorr, transmin, si... | |
getUserPresetKnobValues():
"""getUserPresetKnobValues() -> None
gets a list of knob values for a given preset
@param nodeClassName: Name of the node class to get values for.
@param presetName: Name of the preset to get values for.
@return: a pyDict containing all knob name/value pairs."""
pass
def getUserPreset... | |
assert "gagnstæður" in s
assert "gagn stæður" not in s
errors = {1, 3, 5}
for ix in range(len(g)):
if ix in errors:
assert g[ix].error_code == "C003" # Aðalinngangur, aukaherbergi, gagnstæður
else:
assert not g[ix].error_code
s, g = check("Myndar drengurinn er hálf undarlegur kvenna megin.")
assert len(g) == ... | |
#! /usr/bin/env python
import os
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
# GOLDEN_PATH = SCRIPT_PATH + '/../../../golden-bundle';
import sys
# sys.path.append(SCRIPT_PATH + '/scripts')
# sys.path.append(GOLDEN_PATH + '/src')
import subprocess
import numpy as np
# import filesandfolders;
import fas... | |
species_list in species_list_list:
species_set = set([])
for species in species_list:
species = species_mapping.get(species, species)
species_set.add(species)
species_set_list.append(species_set)
else:
species_set_list = [
set([label])
for label in test_label_list
]
label_list = [
'positive' if category in... | |
<filename>hpo/hpo.py
import warnings
from typing import Any, Dict, Optional, Type, Union
import numpy as np
import torch as th
from gym import spaces
from torch.nn import functional as F
from stable_baselines3.common import logger
from stable_baselines3.common.on_policy_algorithm import OnPolicyAlgorithm
from stable_... | |
'Itapipoca - CE', 'pt': 'Itapipoca - CE'},
'55883632':{'en': u('Vi\u00e7osa do Cear\u00e1 - CE'), 'pt': u('Vi\u00e7osa do Cear\u00e1 - CE')},
'55883633':{'en': u('Ararend\u00e1 - CE'), 'pt': u('Ararend\u00e1 - CE')},
'55883634':{'en': 'Ubajara - CE', 'pt': 'Ubajara - CE'},
'55883635':{'en': u('Irau\u00e7uba - CE'),... | |
= iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self... | |
import numpy as np
import scipy.special as ss
import scipy.signal as ss2
import scipy
from numpy import abs, sin, cos, real, exp, pi, sqrt
def psi_s(z, x, beta):
"""
2D longitudinal potential
Eq. (23) from Ref[1] with no constant factor (e*beta**2/2/rho**2).
Ref[1]: <NAME> and <NAME>, PRAB 23, 014402 (2020).
Not... | |
import csv
import itertools
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.core.exceptions import ObjectDoesNotExist
from ... | |
_validate_coef_prior(coef_prior_list):
for test_dict in coef_prior_list:
if set(test_dict.keys()) != set([
KTRTimePointPriorKeys.NAME.value,
KTRTimePointPriorKeys.PRIOR_START_TP_IDX.value,
KTRTimePointPriorKeys.PRIOR_END_TP_IDX.value,
KTRTimePointPriorKeys.PRIOR_MEAN.value,
KTRTimePointPriorKeys.PRIOR_SD.value,
... | |
<reponame>jayvdb/python-quilt
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2013 - 2017 <NAME> <<EMAIL>>
#
# See LICENSE comming with the source of python-quilt for details.
"""
This module contains classes to parse arguments from a ... | |
from abc import abstractmethod
from datetime import datetime
from typing import TYPE_CHECKING, Any, Dict, Mapping, Union, overload, Literal, Optional, Iterable, Generator
from requests import Response
from arago.hiro.model.graph.attribute import ATTRIBUTE_T
from arago.hiro.model.graph.edge import EdgeId, Edge
from ar... | |
{cv2.INTER_NEAREST, cv2.INTER_LINEAR, cv2.INTER_AREA, cv2.INTER_CUBIC} or list of str or list of int or StochasticParameter, optional
The interpolation mode to use when resizing images.
Can take any value that :func:`~imgaug.imgaug.imresize_single_image`
accepts, e.g. ``cubic``.
* If this is ``KeepSizeByResize.NO_... | |
<filename>ImbalanceDetection/analyze_models.py
from detectron2.engine import default_setup, launch, default_argument_parser
from detectron2.config import get_cfg
import detectron2.utils.comm as comm
from imbalancedetection.build import build_detector, build_gambler
from imbalancedetection.config import add_gambler_conf... | |
0.74, 0.0))
fd(21)
color((0.96, 0.72, 0.02))
fd(1)
color((0.09, 0.22, 0.5))
fd(3)
color((0.0, 0.0, 0.0))
fd(38)
gt(-128.0,40.5)
fd(37)
color((0.09, 0.22, 0.5))
fd(3)
color((0.97, 0.73, 0.0))
fd(1)
color((0.98, 0.74, 0.0))
fd(21)
color((0.84, 0.65, 0.08))
fd(1)
color((0.09, 0.22, 0.5))
fd(3)
color((1.0, 1.0, 1.0))
fd(6)... | |
# campaign/controllers_email_outbound.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
import json
from voter.models import VoterManager
import wevote_functions.admin
from wevote_functions.functions import positive_value_exists
logger = wevote_function... | |
<reponame>timcera/plottoolbox<filename>src/plottoolbox/plotutils.py
# -*- coding: utf-8 -*-
"""Collection of functions for the manipulation of time series."""
from __future__ import absolute_import, division, print_function
import itertools
import os
import warnings
import mando
import typic
from mando.rst_text_form... | |
<reponame>jdrese/SIWeightEditor<filename>Contents/scripts/siweighteditor/weight.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from maya import mel
from maya import cmds
from . import lang
from . import common
import os
import json
import re
class WeightCopyPaste():
def main(self, skinMeshes, mode='copy', saveName='default... | |
<reponame>czero69/acomoeye-NN<filename>tensorflow_toolkit/eyetracking/tools/eval.py
#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation
#
# 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 Licens... | |
materials[material.pop('newmtl')] = material
# start a fresh new material
material = {'newmtl': ' '.join(split[1:])}
elif key == 'map_Kd':
# represents the file name of the texture image
try:
file_data = resolver.get(split[1])
# load the bytes into a PIL image
# an image file name
material['image'] = Image.op... | |
<gh_stars>1-10
''' Spectrum_fitter.py : an obect-oriented framework for fitting dielectric spectra. '''
from numpy import *
import matplotlib.pyplot as plt
from scipy import optimize
from scipy import special as sp
class Lineshape:
"""Class that holds some things common to all Lineshapes"""
def __init__(self,par... | |
##############################################################################
# Copyright 2016-2018 Rigetti Computing
#
# 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.or... | |
<filename>configUtils.py
"""
This file provides the ability through the ConfigReader class to read the configuration file used by tabReader.py and generate the default configuration file if needed.
Note: you can add comments throughout the config file by starting every comment line with a hashtag "#" as with Python. Co... | |
<filename>scalingqa/extractivereader/training/trainer.py
# -*- coding: UTF-8 -*-
""""
Created on 17.09.20
This module contains class for training the QA Reader model.
:author: <NAME>
"""
import csv
import logging
import math
import os
import random
import socket
import time
import traceback
from typing import Dict, Op... | |
<filename>python_bindings/tutorial/lesson_12_using_the_gpu.py<gh_stars>1-10
#!/usr/bin/python3
# Halide tutorial lesson 12.
# This lesson demonstrates how to use Halide to run code on a GPU.
# This lesson can be built by invoking the command:
# make tutorial_lesson_12_using_the_gpu
# in a shell with the current dire... | |
<reponame>Ricyteach/candejar
complicated_msh_file = """
#nodes
815
1 -103.90 -6.38
2 -103.90 0.10
3 -110.38 0.10
4 109.14 -0.38
5 103.14 -0.38
6 103.14 -6.38
7 -103.90 12.10
8 -111.01 12.10
9 -122.38 12.10
10 121.14 11.62
11 110.06 11.62
12 103.14 11.62
13 -82.90 12.10
14 -67.90 9.31
15 -67.65 24.10
16 ... | |
<reponame>rhythmcao/text2sql-lgesql<gh_stars>10-100
#coding=utf8
import os, sqlite3
import numpy as np
import stanza, torch
from nltk.corpus import stopwords
from itertools import product, combinations
from utils.constants import MAX_RELATIVE_DIST
def is_number(s):
try:
float(s)
return True
except ValueError:
ret... | |
from __future__ import division
from itertools import chain
from operator import itemgetter, attrgetter
from collections import defaultdict
import math
from django.db import connection
from django.db import models
from django.db.models import Sum, Q, Count, F
from django.utils.translation import ugettext_lazy as _
fro... | |
name)
values[i] = 'True'
categorical_features = self.categorical_features
discretized_feature_names = None
if self.discretizer is not None:
categorical_features = range(data.shape[1])
discretized_instance = self.discretizer.discretize(data_row)
discretized_feature_names = copy.deepcopy(feature_names)
for f in ... | |
get_path(self):
"""
Only call this if :meth:`is_path` is true.
:rtype: WriteError
"""
if not self.is_path():
raise AttributeError("tag 'path' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(CreateFolderError, self)._process_custom_annotations(... | |
# -*- coding: utf-8 -*-
import datetime
import json
import os
from django.conf import settings
from django.core.urlresolvers import reverse
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import mkt
from mkt.constants.applications import DEVICE_TYPES
from mkt.files.tests.test_models imp... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
mock_nmap.py - 2019.09.17.
This file provides a fake API reproducing the behavior of python-nmap but not
using nmap. This is used only for testing purposes in order to improve testing
speed and reproductibility.
Author:
<NAME> - <EMAIL>
License:
MIT... | |
<filename>venv/lib/python3.6/site-packages/pelican/tests/test_importer.py<gh_stars>0
import locale
import os
import re
from posixpath import join as posix_join
from pelican.settings import DEFAULT_CONFIG
from pelican.tests.support import (mute, skipIfNoExecutable, temporary_folder,
unittest)
from pelican.tools.pelica... | |
from itertools import product
from inspect import signature, isgenerator
from copy import deepcopy
import tempfile
import torch
from torch.testing._internal.common_device_type import instantiate_device_type_tests
from torch.testing._internal.common_modules import module_db, modules
from torch.testing._internal.common_... | |
output.update({'confidence': prediction.confidence})
if add_path:
output.update({'path': prediction.path})
if add_distribution:
output.update(
{'distribution': prediction.distribution,
'distribution_unit': prediction.distribution_unit})
if add_count:
output.update({'count': prediction.count})
if self.tree.regr... | |
<filename>pyvsim/Primitives.py
"""
.. module :: Primitives
:platform: Unix, Windows
:synopsis: Classes representing geometric entities or basic building blocks
The classes contained in this module represent the basics of geometric modelling
in pyvsim. It also contains the ray tracing engine and its models (re... | |
str(coords.y))
a_entry.set('z3', str(coords.z))
bond_array = ET.SubElement(mol, 'bondArray')
for bond in mol_to_save.GetBonds():
atom_1 = _get_atom_name(bond.GetBeginAtom())
atom_2 = _get_atom_name(bond.GetEndAtom())
bond_order = _get_cml_bond_type(bond.GetBondType())
bond_entry = ET.SubElement(bond_array, 'bo... | |
<filename>baseline_modify/models.py
import torch
import torch.nn as nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, NLLLoss, MSELoss
import torch.nn.functional as F
from copy import deepcopy
from transformers import XLNetPreTrainedModel as PreTrainedModel
from transformers import AutoModel
from transfor... | |
f"/PasswordVault/api/Accounts/{account_id}"
self._http_request("DELETE", url_suffix, resp_type='text')
def get_list_accounts(self,
search: str,
sort: str,
offset: str,
limit: str,
filter: str,
):
url_suffix = f"/PasswordVault/api/Accounts?search={search}&sort={sort}&offset={offset}&limit={limit}&filter={filt... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from copy import deepcopy
from datetime import datetime
import boto3
import pytz
import six
import sure # noqa
from botocore.exceptions import ClientError
from nose.tools import assert_raises
from moto import mock_emr
run_job... | |
Is the value valid?=
try:
# Check if store is writeable
if not self.writable:
raise UserWarning(f'The {"persistent" if self.persistent else "ephemeral"} data store "{self}" is not writable')
# Set the value
self.logger.debug(f'Setting value "{token}={value}" in data store "{self}"')
# Validate value before w... | |
vectors
def get_angles(p, k):
# get the angles of the lines which ends in k-point and a plane
# p is (4 x 3) numpy array
# http://kitchingroup.cheme.cmu.edu/blog/2015/01/18/Equation-of-a-plane-through-three-points/
pp = np.delete(p, k, 0)
v1 = pp[1] - pp[0]
v2 = pp[2] - pp[0]
cp = np.cross(v1, v2)
d = np.dot(... | |
#!/usr/bin/env python
import requests, datetime, re, argparse, zipfile, os, sys, json
try:
from MaltegoTransform import *
transform = 1
except:
transform = 0
__author__ = "<NAME> [karttoon]"
__email__ = "<EMAIL>"
__version__ = "1.0.3"
__date__ = "15DEC2016"
#################### [ API KEY ] ####################
pt... | |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import traceback
from datetime import datetime
from typing import List, Union, Tuple, Optional, Callable
from easylogger import Log
from kavalkilu import DateTools
from .tools import BlockKitBuilder, SlackTools, SecretStore
class SlackBotBase(SlackTools):
"""T... | |
the exemplar instances
:param exemplars: the exemplars to use
:param instance: the instance to compare to each exemplar
:param distance_measure: the distance measure to provide similarity
values
:return: list of distances to each exemplar
"""
n_exemplars = len(exemplars)
distances = np.empty(n_exemplars)
min_d... | |
################################################################################################################
## IG generates n number of samples along the straight line path between baseline image and the orig image.
## In our implementation, we put all these samples on the cuda. So assign this value as per the gpu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.