input
stringlengths
2.65k
237k
output
stringclasses
1 value
ClassVar[str] = "case to entity association mixin" class_model_uri: ClassVar[URIRef] = BIOLINK.CaseToEntityAssociationMixin subject: Union[str, CaseId] = None def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self._is_empty(self.subject): self.MissingRequiredField("subject") if not isinstance...
<reponame>emilydolson/avida-spatial-tools from .utils import * from scipy.spatial.distance import pdist import scipy.cluster.hierarchy as hierarchicalcluster def rank_environment_and_phenotypes(environment, phenotypes, k=15): """ Clusters sets of resources/tasks using a weighted hamming distance such that you can ...
duplicate if parametercollision: # parameters disagree if name != "": raise ooferror.ErrSetupError("Named property in datafile conflicts with existing property '%s'" % name) # reparametrization of unnamed property if reg.materials: raise ooferror.ErrSetupError("Unnamed property in datafile conflicts with existing...
# -*- coding: utf-8 -*- # # *********************************************************************************** # MIT License # # Copyright (c) 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # i...
to libcgroup path.") bz2FileName = g_OSlib.getBz2FilePath() curPath = os.path.dirname(os.path.realpath(__file__)) libCgroupPath = os.path.realpath("%s/../../libcgroup" % curPath) if not os.path.exists(libCgroupPath): os.makedirs(libCgroupPath) cmd = "tar -xf %s -C %s" % (bz2FileName, libCgroupPath) (status, ou...
return self._files def run(self): gem.copyNumberDistribution( self._input(True), output = self.files(), sampleName = self.pipeline.name ) class DuplicationStep(PipelineStep): """ Duplication call step """ def files(self): """Return the output files generated by this step. """ if self._files is None: ...
<reponame>kaparna126/magellanmapper # Regional volume and density management # Author: <NAME>, 2018, 2019 """Measure volumes and densities by regions. Intended to be higher-level, relatively atlas-agnostic measurements. """ from enum import Enum from time import time import numpy as np import pandas as pd from scipy...
file with no "src" or "dest".') if not src: raise BuildConfigError('"bundle" has a file with no "src".') if not dest: raise BuildConfigError('"bundle" has a file with no "dest".') src = StringTemplate(src).substitute(src_vars) dest = do_parse_level_substitutions( dest, src, allow_lang=False, extra_vars=extra_va...
ParallelLoggingManager): self.logging_module: ParallelLoggingManager = logging_module self.api_key = kwargs['api_key'] self.server = kwargs['server'] self.conf, self.secret_conf = self._load_conf_files(kwargs['conf'], kwargs['secret']) self.env_json = self._load_env_results_json() self.is_nightly = kwargs['nightl...
map.get('items'): temp_model = BaseFileResponse() self.items.append(temp_model.from_map(k)) if map.get('next_marker') is not None: self.next_marker = map.get('next_marker') return self class SharePermissionPolicy(TeaModel): """ * """ def __init__(self, file_path=None, permission_inheritable=None, permission_...
not AWS_REGION: print("Please set and export environment variable AWS_ACCOUNT_NUMBER and AWS_REGION!") exit(1) if not buckets: print("WARNING: Without setting buckets (using --buckets)," + "Tibanna would have access to only public buckets." + "To give permission to Tibanna for private buckets," + "use --buckets=...
returnValue(response) @twisted_async @inlineCallbacks def GetAllChannelpartitionConfig(self, request, context): log.info('grpc-request', request=request) response = yield self.dispatcher.dispatch( 'GetAllChannelpartitionConfig', Empty(), context, broadcast=True) if isinstance(response, DispatchError): log.w...
<reponame>t-young31/thesis #!/usr/bin/env python3 import argparse import numpy as np from scipy.spatial import distance_matrix from scipy import integrate class Constants: hbar_au = 1.0 h_au = hbar_au * 2.0 * np.pi amu_to_au = 1822.888486 # m_e amu-1 kj_mol_to_au = 0.00038087980 # Ha (kJ mol-1)-1 kcal_mol_to_a...
<gh_stars>0 # Copyright 2021 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
'''Represents the content of a INDEX_ROOT attribute. The structure of an index is a B+ tree, as such an root is always present. Note: This class receives an Iterable as argument, the "Parameters/Args" section represents what must be inside the Iterable. The Iterable MUST preserve order or things might go boom. Ar...
""" This module has functions that compares the contrast calculation from different methods: 1. E2E coronagraph 2. (Image-based PASTIS) 3. Matrix-based PASTIS All three methods are currently only supported for JWST, and you can pick between the analytical or numerical matrix. HiCAT and LUVOIR only have an E2E vs numer...
pass return sections @staticmethod def write_prox_lua(lua_config): """ Write an .ini-format config file for PROX (parameters.lua) PROX does not allow a space before/after the =, so we need a custom method """ out = [] for key in lua_config: value = '"' + lua_config[key] + '"' if key == "__name__": contin...
is not drawn, but can appear as a legend item (provided that the legend itself is visible). row : 'all', int or None (default) Subplot row index (starting from 1) for the trace to be added. Only valid if figure was created using `plotly.tools.make_subplots`.If 'all', addresses all rows in the specified column(s)...
"""Module to help with executing commands over SSH.""" ## # Copyright 2016 Canonical Ltd. # 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/lice...
<reponame>amirdel/dispersion-continua # Copyright 2017 <NAME>, <EMAIL> # # Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee # is hereby granted, provided that the above copyright notice and this permission notice appear in all # copies. # # THE SOFTWARE IS PROVIDED "A...
# quality = self._select_valid_quality(track, quality) quality = track_formats.TRACK_FORMAT_MAP[quality_key] title = tags["title"] ext = quality["ext"] if not filename: filename = title + ext if not str(filename).endswith(ext): filename += ext filename = util.clean_filename(filename) download_dir = path....
<reponame>Derekt2/PyProofpoint import requests class ProofpointAPIError(BaseException): pass class ProofPoint(object): '''ProofPoint Threat Insights API Class. ''' def __init__(self, servicePrincipal, APISecret): self.auth = (servicePrincipal, APISecret) self.base_url = "https://tap-api-v2.proofpoint.com" ...
isinstance(ret, str): if not self._error_reply(msg=retmsg, err_code=EINVALID_COMMAND, txt=ret): user_message_routing.direct_send_to_user(socket, retmsg) else: retmsg.update(ret) umr.send_message_to_user(retmsg) elif cmd == MsgType.RESPONSE_SIGNATURE: if not self._param_check([KeyType.domain_id, KeyType.destinat...
'americat', 'amethyst', 'amidships', 'amidst', 'amigas', 'amigo', 'amigos', 'amine', 'amir', 'amiss', 'amnesia', 'among', 'amongst', 'amore', 'amos', 'amount', 'amounted', 'amounter', 'amounters', 'amounting', 'amounts', 'amp', 'amphitrite', 'ample', 'amputated', 'amry', 'ams', 'amt', 'amts'...
-1.8, "efficiencies": 1.6, "prosecuted": -1.6, "welling": 1.6, "louseworts": -0.6, "lowly": -1.0, "graciles": 0.6, "idealistic": 1.8, "bl": 2.3, "agreement": 2.2, "looming": -0.5, "vitals": 1.1, "d-:": 1.6, "bz": 0.4, "discontented": -1.8, "stinkpots": -0.7, "exaggerated": -0.4, "flirtations": -0.1, "...
<reponame>webertom/event-Python # -*- coding: utf-8 -*- """ This module contains classes, functions and an example (main) for handling AER vision data. """ import glob import cv2 import numpy as np from win32api import GetSystemMetrics import timer class Events(object): """ Temporal Difference events. ...
'''Relative path to absolute''' if (type(relpath) is object or hasattr(relpath, 'read')): # relpath is either an object or file-like, try to get its name relpath = relpath.name return os.path.abspath(os.path.expanduser(relpath)) def recwalk(inputpath, sorting=True, folders=False, topdown=True, filetype=None): '''R...
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) import six __license__ = 'GPL v3' __copyright__ = '2020, <NAME>, 2011, <NAME> <<EMAIL>>' __docformat__ = 'restructuredtext en' import logging logger = logging.getLogger(__name__) from time import sleep from...
import networkx as nx import statistics import matplotlib.pyplot as plt from queue import PriorityQueue import math class Grafo(object): def __init__(self, grafo_dict={}): self.grafo_dict = grafo_dict def vertices(self): return list(self.grafo_dict.keys()) def arestas(self): return self.gerar_arestas() def...
= ( "ETR '{}' decapsulation <a href='/lisp/show/" + "database'>stats</a>" ) . format ( stats_name ) if 79 - 79: OOooOOo / I1Ii111 . OoOoOO00 - I1ii11iIi11i O0ooo0O0oo0 += "%" + stats_name elif ( rtr_name == "stats" ) : iIii11iI1II = "lisp-rtr" I1II1I1I = ( "RTR '{}' decapsulation <a href='/lisp/show/" + "rtr/map-c...
sweep_iname, sweep_min_value, scan_min_value, stride, tracking_iname): domain = temp_kernel.get_inames_domain(frozenset((scan_iname, sweep_iname))) inames_added_for_scan.add(tracking_iname) new_domain = _create_domain_for_sweep_tracking(domain, tracking_iname, sweep_iname, sweep_min_value, scan_min_value, stride...
<reponame>riclima/django-danceschool<gh_stars>1-10 from django.conf import settings from django.db.models import Sum, Count, Q from django.db.models.functions import TruncDate, TruncMonth from django.http import HttpResponse from django.utils import timezone from django.utils.translation import ugettext_lazy as _ ...
<reponame>karlicoss/my<filename>my/core/__main__.py import functools import importlib import inspect import os import sys import traceback from typing import Optional, Sequence, Iterable, List, Type, Any, Callable from pathlib import Path from subprocess import check_call, run, PIPE, CompletedProcess import click @f...
""" Polarized millimeter-wave atmospheric emission model Copyright (c) 2019 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
<reponame>eonu/tempora<gh_stars>10-100 import numpy as np from ..internals import _Validator __all__ = ['Transform', 'Custom', 'TrimConstants', 'MinMaxScale', 'Center', 'Standardize', 'Downsample', 'Filter'] class Transform: """Base class representing a single transformation.""" def __init__(self): self._val = _V...
the piecewise cost linearization breakpoints. # the time index is redundant, but required. in the Piecewise construct, the breakpoints must be indexed the # same as the Piecewise construct itself. model.PowerGenerationPiecewisePoints = {} model.PowerGenerationPiecewiseValues = {} def power_generation_piecewise_points...
length 1.""" return 1 def __str__(self): return "OP2 Dat: %s on (%s) with datatype %s" \ % (self._name, self._dataset, self.dtype.name) def __repr__(self): return "Dat(%r, None, %r, %r)" \ % (self._dataset, self.dtype, self._name) def _check_shape(self, other): if other.dataset.dim != self.dataset.dim: rai...
# 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 # "License"); you may not use...
there will be no conflict between # letters) # 2) If the lists mentioned above are both not empty, add any letters they have in common to fully_merged. # If one has a letter that the other doesn't, discard it for hashmap in hashmaps: merge_step: dict = {k: [] for k in ALPHABET} for l in ALPHABET: # Step 1 if ...
import bz2 from collections import OrderedDict import gzip from operator import getitem import os import struct import sys from types import MappingProxyType from typing import Any, MutableMapping from zipfile import ZipFile from astropy.io import fits as pyfits import pds4_tools import numpy as np import pandas as pd...
self.KS_CR, self.KS_CM0, self.KS_CM1, self.KS_M0, self.KS_M1, self.KS_M2) elif self.model == 'regression': self._scattered_V = _scattered_V_regression( self.airmass, 0.5 * (np.cos(np.pi * self.moon_phase) + 1.), 90 - self.moon_zenith.value, self.separation_angle.value) * u.mag / u.arcsec**2 else: raise No...
x + D_params[ 5] * y * y shifted_t0 = t0 + t0_params[0] + t0_params[1] * x + t0_params[2] * y + \ t0_params[3] * x * y + t0_params[4] * x * x + t0_params[5] * y * y a = ep.minimum(a, 1) return a * self.truncexpon(-t, -shifted_t0, b) + (1 - a) * self.truncexpon(-t, -shifted_t0, c) def track_point(self, start, ...
"/Mimic/Pi/imgs/eps/array-charged.zip" #elif halfavg_1b >= 151.5: #charging # self.eps_screen.ids.array_1b.source = mimic_directory + "/Mimic/Pi/imgs/eps/array-charging.zip" # self.eps_screen.ids.array_1b.color = 1, 1, 1, 1.0 #if float(c1b) > 0.0: #power channel offline! # self.eps_screen.ids.array_1b.source ...
assert 'Removing image v2-full_web' in result.stderr assert 'Removing image busybox' not in result.stderr assert 'Removing network v2-full_default' in result.stderr assert 'Removing network v2-full_front' in result.stderr def test_down_timeout(self): self.dispatch(['up', '-d'], None) service = self.project.get_s...
self.__get_color(C_CYAN)|curses.A_REVERSE, 'yellow': self.__get_color(C_YELLOW)|curses.A_BOLD }, 'state_yellow': { 'default': self.__get_color(C_YELLOW), 'cursor': self.__get_color(C_CYAN)|curses.A_REVERSE, 'yellow': self.__get_color(C_YELLOW)|curses.A_BOLD }, 'state_green': { 'default': self.__get_color(C_GRE...
end_time: builtins.str, start_time: builtins.str) -> None: """ :param end_time: ``CfnAnomalyDetector.RangeProperty.EndTime``. :param start_time: ``CfnAnomalyDetector.RangeProperty.StartTime``. :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html ...
|- az apim notification recipient-user delete --resource-group "rg1" --service-name \\ "apimService1" --notification-name "RequestPublisherNotificationMessage" --user-id \\ "576823d0a40f7e74ec07d642" """ helps['apim notification recipient-user list'] = """ type: command short-summary: list notification re...
""" MIT License Copyright (c) 2020 Airbyte 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, publish, distr...
<reponame>alexholcombe/twoWords<gh_stars>0 #<NAME> <EMAIL> #See the github repository for more information: https://github.com/alexholcombe/twoWords from __future__ import print_function, division from psychopy import monitors, visual, event, data, logging, core, sound, gui, microphone from matplotlib import pypl...
<reponame>megatron0000/ces22-xadrez from math import sqrt from multiprocessing import Process, Pipe from aiprocess import aiprocess, move2str from chessengine import * from guiengine import * WIDTH = 800 HEIGHT = 600 SCALE = 1 / 15 GAME = None CHOOSINGPROMOTION = False PIPE = None AI_PROC = None WAITING = False PVP =...
from click.testing import CliRunner from unittest.mock import MagicMock import yaml from mai.cli import cli, login_with_profile import mai import os import aws_saml_login.saml import time import pytest TEST_CONFIG = {'example-Administrator': {'saml_identity_provider_url': 'https://auth.example.com', 'saml_role': ['ar...
= t_jit(x, y) jit_o.backward(grad) x.grad.zero_() y.grad.zero_() jit_o = t_jit(x, y) jit_o.backward(grad) self.assertEqual(o.dtype, jit_o.dtype) self.assertEqual(ref_x.grad, x.grad) self.assertEqual(ref_y.grad, y.grad) self.assertTrue(self._compare("comparing output failed", o, jit_o, 1e-3)) self.assertGraph...
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d from scipy.optimize import brentq from scipy.linalg import solve_banded, block_diag from multiprocessing import Pool from itertools import product from functools import partial class qclSolver: fundamentals = { "e...
<filename>tools/SDKTool/libs/AgentAPI/AgentMsgMgr.py # -*- coding: utf-8 -*- """ This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright (C) 2020 THL A29 Limited, a Tencent...
def __init__(self, *args): this = _ghmmwrapper.new_ghmm_dpseq(*args) try: self.this.append(this) except: self.this = this __swig_destroy__ = _ghmmwrapper.delete_ghmm_dpseq __del__ = lambda self : None; def set_discrete(self, *args): return _ghmmwrapper.ghmm_dpseq_set_discrete(self, *args) def set_continuous(sel...
% (656 - 334)) + muddyShoeRect.x mudSplatRect2.y = ((height * prn2) % (590 - 317)) + muddyShoeRect.y mudArray.append(mudSplatRect2) elif scoreMultiplier > 2: prn1 = randomNumber() mudSplatRect1 = mudSplat.get_rect() mudSplatRect1.x = ((width * prn1) % (656 - 334)) + muddyShoeRect.x mudSplatRect1.y = ((h...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
import sys import os import time import errno import signal import select import traceback from multiprocessing.forking import Popen JOIN_RESTART_POLICY = 0 TERMINATE_RESTART_POLICY = 1 def get_current_process(): class CurrentProcess(Process): def __init__(self, *args, **kwargs): self._child = None self._parent...
import re from df_engine.core import Actor, Context from langcodes import normalize_characters from torch import norm, normal from scenario.qcfg import g from nltk import grammar, parse import re from lxml import etree import urllib.request, gzip, io import scenario.config as config # Create the CFG grammar from a st...
""" This script loads in a trained policy neural network and uses it for inference. Typically this script will be executed on the Nvidia Jetson TX2 board during an experiment in the Spacecraft Robotics and Control Laboratory at Carleton University. Script created: June 12, 2019 @author: Kirk (<EMAIL>) """ import ten...
column=4, sticky=tk.W+tk.E+tk.N+tk.S, padx=9, pady=5) Button_ = tk.Button(master=back, text='', command='', width=14, height=3) Button_.grid(row=1, column=5, sticky=tk.W+tk.E+tk.N+tk.S, padx=9, pady=5) Button_ = tk.Button(master=back, text='', command='', width=14, height=3) Button_.grid(row=2, column=1, sticky=tk....
<filename>src/mbed_cloud/_backends/iam/apis/aggregator_account_admin_api.py # coding: utf-8 """ Account Management API API for managing accounts, users, creating API keys, uploading trusted certificates OpenAPI spec version: v3 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __futur...
should fail if the FITS files in the directory # are actually read. bad_dir = tmpdir.mkdtemp() not_really_fits = bad_dir.join('not_fits.fit') not_really_fits.dump('I am not really a FITS file') # Make sure an error will be generated if the FITS file is read with pytest.raises(IOError): fits.getheader(not_really_...
= self.state_dict() self._payout_pots() if self.RETURN_PRE_TRANSITION_STATE_IN_INFO: return state_before_transition return elif self.current_round == Poker.FLOP: self._deal_flop() elif self.current_round == Poker.TURN: self._deal_turn() elif self.current_round == Poker.RIVER: self._deal_river() else: rai...
baselines, t, subkeys): """ Computes batch of estimators for score :math:`\\nabla_Z \\log p(\\Theta, D | Z)` Selects corresponding estimator used for the term :math:`\\nabla_Z E_{p(G|Z)}[ p(\\Theta, D | G) ]` and executes it in batch. Args: zs (ndarray): batch of latent tensors :math:`Z` ``[n_particles, d, k, 2]...
# -*- coding: utf-8 -*- """ p2p-streams (c) 2014 enen92 fightnight This file contains the livestream addon engine. It is mostly based on divingmule work on livestreams addon! Functions: xml_lists_menu() -> main menu for the xml list category addlista() -> add a new list. It'll ask for local or remote and proces...
this is # what top_k does. # --------------------------------------------------------------------- input_vector = tf.reshape(input_tensor, [batch_h_w_size, input_area]) _, top_indices = tf.nn.top_k(input_vector, k=k) # top_k per input_area # Now the problem is that sparse_to_dense requires a 1d vector, or a # ve...
['CD', 'CD2'], ['OE1', 'HD11'], ['OE2', 'HD12'], ['HE2', 'HD13']], ['HD21', 'HD22', 'HD23'], {'LEU-GLH': ['disappear', 1, 0], 'GLH-LEU': ['appear', 0, 1]}, ], 'GLH-LYN': [ ['N', 'H', 'CA', 'HA', 'C', 'O', 'CB', 'HB2', 'HB3', 'CG', 'HG2', 'HG3', 'CD'], [['HE2', 'HE2'], ['OE1', 'HD2'], ['OE2', 'HD3']], ['CE', 'HE3...
#!/usr/bin/env python # title :devops_manager.py # description :Creating a DevOps like on Solaris # author :<NAME> # release date :20181018 # update date :20191127 # version :0.9.0 # usage :python devops_manager.py # notes : # python_version :2.7.14 # ====================================================================...
from typing import Dict from typing import List from botocore.paginate import Paginator class GetClassifiers(Paginator): def paginate(self, PaginationConfig: Dict = None) -> Dict: """ Creates an iterator that will paginate through responses from :py:meth:`Glue.Client.get_classifiers`. See also: `AWS API Documenta...
<filename>main.py<gh_stars>0 from __future__ import print_function from __future__ import division from PACK import * from torch.optim.lr_scheduler import StepLR from model import Graph, adjust_learning_rate from aggregator import MeanPoolAggregator, MaxPoolAggregator, naiveMeanAggr from utils import buildTestData, c...
<reponame>OSLL/apagescan<filename>src/main_view.py import time from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import pyqtSlot, Qt from PyQt5.QtGui import QBrush from PyQt5.QtGui import QGuiApplication from PyQt5.QtWidgets import QMainWindow, QVBoxLayout, QMessageBox, QAbstractItemView, QProgressBar, QTab...
all pages into to a file. Must be path to file, example ${OUTPUT_DIR}/har.file. If not specified, the HAR is not recorded. Make sure to await context to close for the to be saved. `omitContent`: Optional setting to control whether to omit request content from the HAR. Default is False `path`: Path on the filesyste...
if beamline is not None and len(beamline) > 0: try: beam = importlib.import_module('beamlines.' + beamline + '.beam_tabs') except Exception as e: print (e) msg_window('cannot import beamlines.' + beamline + ' module' ) raise self.prep_tab = beam.PrepTab() self.format_tab = DataTab() self.rec_tab = RecTab() se...
""" VirusTotal V3 - Premium API Difference: https://developers.virustotal.com/v3.0/reference#public-vs-premium-api """ import copy from typing import Tuple, Iterable import urllib3 from dateparser import parse from CommonServerPython import * # Disable insecure warnings urllib3.disable_warnings() # pylint: disable=...
value of the `users` property. """ return self._users @users.setter def users(self, value): """ Sets the value of the `users` property. """ self._users = value @property def network_configuration(self): """ Returns the value of the `network_configuration` property. """ return self._network_configuration...
<reponame>YousefMansy/Finding-Lane-Lines<filename>P1.py # coding: utf-8 # [//]: # (Image References) # # [preview]: ./test_images_output/solidWhiteCurveExtended.png "Preview" # # # **Finding Lane Lines on the Road** # # ![preview] # # ## The goals of this project is to setup a pipeline that finds lane lines on th...
#!/usr/bin/env python3 from argparse import ArgumentParser from dataclasses import dataclass, field from itertools import islice from typing import Dict, List, TypeVar import ijson import os import re import subprocess import sys import tempfile TSC_MAX = (1 << 64) - 1 @dataclass class DTraceArgument: """Describes...
<gh_stars>1-10 # -*- coding: UTF-8 -*- # Interstitial Error Detector # Version 0.2, 2013-08-28 # Copyright (c) 2013 AudioVisual Preservation Solutions # All rights reserved. # Released under the Apache license, v. 2.0 # Created on May 14, 2014 # @author: <NAME> <<EMAIL>> import numpy as np from scikits.audio...
""" Managers for handling different ServiceChannels. If a manager for a specific :class:`ServiceChannel` is attached, incoming messages get forwarded there, otherways they are discarded. Managers can be attached by calling `add_manager()` on the :class:`Console` object (see example) Methods of manager are available t...
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanyin...
""" This module contains the core classes of the package that implement the three hyperparameter optimization methods presented in Forward and Reverse Gradient-Based Hyperparameter Optimization (https://arxiv.org/abs/1703.01785). """ # TODO put tf.Session optional parameter in all the methods that require `run` # imp...
# Use the binary cross entropy function self.criterion = nn.CrossEntropyLoss() def forward(self, x, hidden_state=None, seq_lengths=None, total_length=None, get_hidden_state=False, prob_output=True, already_embedded=False): if self.embed_features is not None and already_embedded is False: # Run each embedding la...
(with the outcomes ordered to be the same as the wires in the circuit). """ if isinstance(structure, str): assert(structure == '1Q'), "The only default `structure` option is the string '1Q'" structure = tuple([(q,) for q in pspec.qubit_labels]) n = pspec.number_of_qubits else: assert(isinstance(structure, list) ...
<filename>chapter/5/problems_5_14_x.py from resources.GF2 import one from resources.vecutil import list2vec from resources.vec import Vec from math import pi, sqrt from resources.vecutil import zero_vec def zero_vec_n(n): return zero_vec(set(list(range(n)))) def lin_comb_sum(scalars, vectors): return sum([s*v for ...
# TODO # Add state callbacks - Try to attach to post fork loop #import gc import signal import asyncio import traceback import socket import os, sys, random, mrpacker import multiprocessing import faulthandler import functools from wsgiref.handlers import format_date_time import inspect, copy #from inspect import si...
<reponame>dhoebbel/USIO-Automation<gh_stars>0 #import dependencies import pandas as pd import numpy as np import datetime import math #read in CSVs full_lens = "Dave Files (raw)//2018 H1 Raw Full Lens.csv" buyer_lens = "Dave Files (raw)//2018 H1 Final Buyer Lens.csv" region_map = "region_map.csv" josh_volumes = "201...
keys 'id' and 'shape' are not set. 'size' [scalar] Diameter of the telescope dish (in meters) if the key 'shape' is set to 'dish' or length of the dipole if key 'shape' is set to 'dipole'. Will be ignored if key 'shape' is set to 'delta'. Will be ignored if key 'id' is set and a preset value used for the diameter...
import pygame import os from math import * from memory_pic import * from base64 import * def get_pic(pic_code, pic_name): image = open(pic_name, 'wb') image.write(b64decode(pic_code)) image.close() os.mkdir('_') get_pic(earthfromnorthpole_png, '_\\earthfromnorthpole.png') get_pic(fire_png, '_\\fire.png') get_pi...
<reponame>nanbi/Python-software import numpy as np import regreg.api as rr import regreg.affine as ra from .query import query from .randomization import split class M_estimator(query): def __init__(self, loss, epsilon, penalty, randomization, solve_args={'min_its':50, 'tol':1.e-10}): """ Fits the logistic regres...
for corp in [self.state.unknownCorpus, self.state.hamCorpus, self.state.spamCorpus]: for k in corp.keys(): if len(keys) >= max_results: break msg = corp[k] msg.load() if 'subject' in params: subj = str(msg['Subject']) if self._contains(subj, key, ic): push((k, corp)) if 'body' in params: # For [ 906581 ] A...
selected_jobs ) if queue_paused: parser_status = 'paused' self._parser_status.setText( parser_status ) if current_action == '' and files_paused: current_action = 'paused' self._current_action.setText( current_action ) if files_paused: ClientGUIFunctions.SetBitmapButtonBitmap( self._pause_f...
#!/usr/bin/env python # encoding: utf-8 # # test_map.py # # @Author: <NAME> <andrews> # @Date: 2017-07-02 13:08:00 # @Last modified by: andrews # @Last modified time: 2018-03-01 11:03:79 from copy import deepcopy import numpy as np from astropy import units as u import matplotlib import pytest from marvin import con...
<reponame>Sketos/PyAutoArray<gh_stars>0 import autoarray as aa import autoarray.plot as aplt from os import path import matplotlib.pyplot as plt import os import pytest import numpy as np import shutil directory = path.dirname(path.realpath(__file__)) @pytest.fixture(name="plot_path") def make_plotter_setup(): retu...
import ipaddress import netaddr import numpy as np import pandas as pd from networkml.featurizers.features import Features MAC_BCAST = netaddr.EUI('FF-FF-FF-FF-FF-FF') ETH_TYPE_ARP = 0x806 ETH_TYPE_IP = 0x800 ETH_TYPE_IPV6 = 0x86DD ETH_TYPE_IPX = 0x8137 ETH_IP_TYPES = frozenset((ETH_TYPE_ARP, ETH_TYPE_IP, ETH_TYPE_...
type "to-one" if relation_type == TO_ONE_RELATION: # tries to retrieve the "current" target # entity to be used for the application target_entity = self.get_value(item_name) # in case there is no item (target entity) # in the entity one must be created if target_entity == None: # "resolves" the target...
<reponame>boffman/grizzly<filename>grizzly/users/restapi.py '''Communicates with HTTP and HTTPS, with built-in support for Azure authenticated endpoints. ## Request methods Supports the following request methods: * get * put * post ## Format Format of `host` is the following: ```plain http[s]://<hostname> ``` ##...
len(jobs): Client.killJobs(jobs,2) _logger.debug("killJobs for Anal Active (%s)" % str(jobs)) # kill too long pending jobs timeLimit = datetime.datetime.utcnow() - datetime.timedelta(hours=1) varMap = {} varMap[':jobStatus'] = 'pending' varMap[':creationTime'] = timeLimit status,res = taskBuffer.querySQLS("SE...
"D312", "D314", "D315", "D316", "D317", "D318", "D319", "D321", "D323", "D324", "D325", "D327", "D328", "D329", "D330", "D331", "D332", "D333", "D334", "D338", "D339", "D341", "D344", "D345", "D346", "D347", "D348", "D350", "D351", "D352", "D355", "D356", "D357", "D358", "D360", "D361...
# Convert Font Awesome, Fork Awesome, Google Material Design, Material Design Icons, Kenney Game, Ionicons and Fontaudio # icon font parameters to C89, C++11 and C# compatible formats. # #------------------------------------------------------------------------------ # 1 - Source material # # 1.1 - Font Awesome # 1.1.1 ...