input
stringlengths
2.65k
237k
output
stringclasses
1 value
-4.77021209e-13, 3.14519374e-11, # -5.56138446e-11, -2.61366665e-16, 1.07178297e-15, 9.40699477e-06, # -1.24737547e-06, -3.51275868e-09, 4.63143752e-10], [-6.39842967e-07, -1.45053745e-12, -4.78570290e-13, 2.52732214e-11, # -5.95511753e-11, -3.58943653e-16, 1.40894562e-15, 1.11866216e-05, # -1.24737547e-06, -3.51275868...
0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.668021, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': ...
weights = array_ops.ones([array_ops.shape(embeddings)[0]], dtype=dtypes.float32) else: use_weight = True if weights.dtype != embeddings.dtype: weights = math_ops.cast(weights, embeddings.dtype) # Reshape weights to allow broadcast ones = array_ops.fill( array_ops.expand_dims(array_ops.rank(embeddings) - 1, 0), 1...
import csv from mongolia.constants import ID_KEY from mongolia.errors import DatabaseConflictError import re import xlrd from pytz import all_timezones from werkzeug import secure_filename from backend.admin_portal.common_helpers import raise_400_error from backend.incoming.new_user import new_user_via_admin_portal ...
pressence of a risk-free assets (Maximum Sharpe Ratio) """ n = er.shape[0] # the optimizer needs an initial point init_guess = np.repeat(1/n, n) # don't want to go lower than zero and not higher than 1 (no shorting, no leverage) bounds = ((0.0, 1.0),) * n # multiplying a tuple generates multiple tuples weight...
''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def remove(self, draw_func): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class VIEW3D_PT_overlay_edit_mesh_measurement(bpy_types.Panel...
dropout: bool, layers: int = 1, activation: str = "relu", d_ff: Optional[int] = None, d_k: Optional[int] = None, rpr_k: Optional[Union[int, List[int]]] = None, layer_norms_after: bool = False, layer_norm_eps: float = 1.0e-6, embeddings_reduction: str = 'sum', **kwargs, ): super().__init__() self.embeddings ...
import idc import idaapi from idc import * from idaapi import * import idautils def SIGNEXT(x, b): m = 1 << (b - 1) x = x & ((1 << b) - 1) return (x ^ m) - m BPF_INST_SIZE = 8 BPF_MAX_OPERAND_COUNT = 3 class BPF_CLASS: BPF_LD = 0x00 BPF_LDX = 0x01 BPF_ST = 0x02 BPF_STX = 0x03 BPF_ALU =...
<reponame>Rangarajbk072/Azure_DMS #/***This Artifact belongs to the Data Migration Jumpstart Engineering Team***/ #!/bin/python36 # $Id: expimpmysql.py 208 2019-11-29 00:21:53Z bpahlawa $ # Created 22-NOV-2019 # $Author: bpahlawa $ # $Date: 2019-11-29 11:21:53 +1100 (Fri, 29 Nov 2019) $ # $Revision: 208 $ import re fr...
p in placed] + [(p + 1) for p in placed] queue = sorted(set(queue)) seen = set(queue) while queue: lowest = queue.pop() if lowest == 0: continue needed_budget = (37 - len(placed)) * lowest for p in placed: needed_budget += max(0, lowest - p) if budget < needed_budget: continue remaining_budget = budget - n...
from app import app from app import db from models.orcid import get_orcid_id_from_oauth from models.person import Person from models.person import PersonExistsException from models.person import make_person from models.person import refresh_orcid_info_and_save from models.person import connect_orcid from models.person...
if no contour level background because it's probably supposed to be a clean looking plot and critical point is labeled on so many others and it also is less interesting to see without the contour level background anyway. #make the dialog box that displays the critical temperature and pressure. #note, not doing ...
<filename>klayout_dot_config/tech/EBeam/pymacros/photonic_crystals/photonic_crystals.py """ KLayout-SiEPIC library for photonic crystals, UBC and SFU ******* PCells: ******* 1) swg_fc - sub-wavelength grating (SWG) fibre coupler (FC) NOTE: after changing the code, the macro needs to be rerun to install the new ...
'/{containerName}/{blob}'} async def break_lease(self, timeout=None, break_period=None, request_id=None, modified_access_conditions=None, *, cls=None, **kwargs): """[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. :param timeout: The timeout parameter is ...
in place of the original ones. Returns: Nothing. """ log = get_logger() if not os.path.isfile(failpath): raise RuntimeError("failure yaml file {} does not exist".format(failpath)) fyml = yaml_read(failpath) step = fyml["step"] name = fyml["task"] workername = fyml["workername"] workeropts = fyml["worke...
<filename>test/test_runtime.py """Tests for Runtime class.""" # pylint: disable=protected-access import logging import os import pathlib import subprocess from contextlib import contextmanager from shutil import rmtree from typing import Any, Iterator, List, Type, Union import pytest from _pytest.monkeypatch import Mo...
# Copyright 2018 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 accompa...
m2/TEU (based on grasshopper layout P. Koster) "pavement": 200, # m2 DUMMY "drainage": 50, # m2 DUMMY "household": 0.1, # moves "digout_margin": 1.2, # percentage "reefer_factor": 2.33, # RHDHV "consumption": 4, # kWh per active reefer "reefer_rack": 3500, # USD "reefers_present": 0.5} # per reefer spot # *** ...
line, 'max', get_text_content(hack_file_text_box)) hack_file_text_box.mark_set(tk.INSERT, new_cursor) highlight_stuff(widget, skip_moving_cursor=center, ctrl_held=ctrl_held) updateWindowScrollbarPos() def navigation_callback(address): widget = check_widget(window.focus_get()) if not address and widget:...
# -*- coding: utf-8 -*- """ tests.http ~~~~~~~~~~ HTTP parsing utilities. :copyright: 2007 Pallets :license: BSD-3-Clause """ from datetime import datetime import pytest from . import strict_eq from werkzeug import datastructures from werkzeug import http from werkzeug._compat import itervalues from werkzeug._...
# -*- coding: utf-8 -*- """ ========== """ # import standard libraries import os # import third-party libraries import numpy as np import matplotlib.pyplot as plt from colour import write_image, read_image # import my libraries import test_pattern_generator2 as tpg import transfer_functions as tf import plot_utili...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.6.0 # kernelspec: # display_name: deep_ml_curriculum # language: python # name: deep_ml_curriculum # --- # # Time Series Forcasting # # In...
CREATE SCALAR TYPE foo EXTENDING str { CREATE CONSTRAINT aaa(10); }; ''') async def test_edgeql_ddl_constraint_03(self): # Test for #1727. Usage of EXISTS in constraints. await self.con.execute(r""" CREATE TYPE TypeCon03 { CREATE PROPERTY name -> str { # emulating "required" CREATE CONSTRAINT expression ON (...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities fro...
10455, 10456, 10457, 10458, 10459, 10460, 10461, 10462, 10463, 10464, 10465, 10466, 10467, 10479, 10498, 10499, 10500, 10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 10511, 10512, 10513, 10514, 10515, 10518, 10538, 10539, 10540, 10541, 10542, 10543, 10544, ...
LCID, 4, 0),()), "Companies": ((34107, LCID, 4, 0),()), "Importance": ((23, LCID, 4, 0),()), "MessageClass": ((26, LCID, 4, 0),()), "Mileage": ((34100, LCID, 4, 0),()), "NoAging": ((34062, LCID, 4, 0),()), "Sensitivity": ((54, LCID, 4, 0),()), "Subject": ((55, LCID, 4, 0),()), "UnRead": ((61468, LCID, 4...
# verify a false deprecated option. assert config.use_multiprocess_workers is False def test_deprecated_env_aware_params(self): os_environ_unicode["SCALYR_DEFAULT_WORKERS_PER_API_KEY"] = "5" self._write_file_with_separator_conversion( """{ api_key: "hi there", } """ ) config = self._create_test_configurati...
verify the required parameter 'name' is set if ('name' not in params) or (params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `proxy_put_namespaced_pod`") resource_path = '/api/v1/proxy/namespaces/{namespace}/pods/{name}'.replace('{format}', 'json') method = 'PUT' path_p...
import pandas as pd import numpy as np from collections import defaultdict from sklearn.preprocessing import scale from sklearn.decomposition import PCA from sklearn.cluster import KMeans from sklearn.mixture import GaussianMixture, BayesianGaussianMixture from sklearn import metrics import hdbscan from scipy.cluster...
+ log(0.0001 + m.x33))*m.x33 + (0.00380676639045951 + log(0.0001 + m.x34))*m.x34 + (-4.17602428751368e-5 + log(0.0001 + m.x35))*m.x35 + (-9.99950003332973e-5 + log( 0.0001 + m.x36))*m.x36 + (7.31660988298921e-5 + log(0.0001 + m.x37))*m.x37 + ( 0.000352695405055885 + log(0.0001 + m.x38))*m.x38 + (0.00241633549088715...
party)) or (any(ally.stress > 0 for ally in party) and any(ally.stressHealer for ally in party))): if len(enemies_not_dead_already) == 1: enemy = enemies_not_dead_already[0] if 'barbaric_yawp' in hero.skills and hero.barbaric_yawp_count < 3 and (hero.rank == 1 or hero.rank == 2) \ and (1 in enemy.rank or 2 in...
<reponame>jglaser/DeepSpeed<filename>deepspeed/runtime/fp16/onebit/lamb.py ''' Copyright 2021 The Microsoft DeepSpeed Team ''' import types import torch import numpy as np import torch.distributed as dist from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors class OnebitLamb(torch.optim.Optimizer)...
# # utils module - common functions for reportbug UIs # Written by <NAME> <<EMAIL>> # Copyright (C) 1999-2008 <NAME> # Copyright (C) 2008-2014 <NAME> <<EMAIL>> # # This program is freely distributable per the following license: # ## Permission to use, copy, modify, and distribute this software and its ## documentation ...
<reponame>cgiraldo/platform-data-mgmnt """ Copyright (c) 2016 Cisco and/or its affiliates. This software is licensed to you under the terms of the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 The code, technical concepts, and all in...
<gh_stars>0 import sys sys.path.append('..') import torch.multiprocessing as multiprocessing try: multiprocessing.set_start_method('spawn') except RuntimeError: pass from contextlib import closing import time import functools import paramparse import pandas as pd from pprint import pformat from torch.utils.data...
preview_response.json(), dict( success=True, previewTable=[ dict( name=self.img1.metadata.name, link=reverse( 'annotation_tool', kwargs=dict(image_id=self.img1.pk)), createInfo="Will create 2 points, 2 annotations", deleteInfo="Will delete 2 existing annotations", ), dict( name=self.img2.metadata.name, li...
<gh_stars>1-10 #!/usr/bin/env python # Copyright 2021 DeepMind Technologies Limited # # 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 r...
# Copyright 2020 The KNIX Authors # # 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,...
import requests import json from sseclient import SSEClient from threading import Thread import colorsys # Preset colours RED = (255, 0, 0) ORANGE = (255, 165, 0) YELLOW = (255, 255, 0) GREEN = (0, 255, 0) LIGHT_BLUE = (173, 216, 230) BLUE = (0, 0, 255) PINK = (255, 192, 203) PURPLE = (128, 0, 128) WHITE = (255, 255, ...
for a valid user with authorization and valid input, ensure correct response: 404 and no metadata if the GUID or alias does not exist in indexd. """ fake_jwt = "1.2.3" guid_or_alias = "test_guid_alias" indexd_did = "dg.hello/test_guid" indexd_data = { "did": indexd_did, "rev": "123", "file_name": "im_a_blank_...
# -*- coding: utf-8 -*- """ TODO: separate out the tests and make this file just generate the demo data """ import logging import itertools as it import numpy as np import utool as ut from wbia.algo.graph.state import POSTV, NEGTV, INCMP, UNREV from wbia.algo.graph.state import SAME, DIFF, NULL # NOQA print, rrr, prof...
run's metadata author_metadata (:obj:`~de_sim.simulation_metadata.AuthorMetadata`): information about the person who runs the simulation, if provided by the simulation application measurements_fh (:obj:`_io.TextIOWrapper`): file handle for debugging measurements file mem_tracker (:obj:`pympler.tracker.SummaryTracke...
#!/usr/bin/env python3 """ CLI implementation to communicate with a connected Arduino based EEPROM Programmer """ import argparse import time import sys from difflib import context_diff as diff_func from io import BytesIO from typing import Sequence, Union, BinaryIO from serial import Serial from tqdm import tqdm ...
211, s.hash['a.com']['cert1'][211], s.hash['a.com']['cert2'][211]), setup.call_line('p', "--not-up=311 --fail-publish", 301, s.hash['a.com']['cert1'][301]), setup.call_line('p', "--not-up=311 --fail-publish", 311, s.hash['a.com']['cert1'][311]), ] assert cl[22:] == calls # posthook renewed again, publish...
# mcu.py # a comprehensive library for communicating with the MATE OQBot. # please read docs/packet_structure.md and docs/command_list.md for more information. # there is a CLI for testing available at mcu_cli.py. read docs/mcu_cli.md for usage. import serial import struct import time import threading from queue impor...
#!/usr/bin/env python3 from concurrent import futures import time import math import logging import argparse import sys import threading import time import grpc import rospy import roslib.message import ros_pb2 as ros_pb import ros_pb2_grpc as ros_grpc class image_view_outputServicer(ros_grpc.image_view_outputS...
form.cleaned_data['comment_author'] comment_author_email = form.cleaned_data['comment_author_email'] article_id = form.cleaned_data['article'] article = Article.objects.get(pk=article_id) parent_id = form.cleaned_data['parent'] if not parent_id: parent = None else: parent = Comment.objects.get(pk=parent_id) pa...
{'member': member, 'plans': plans }, context_instance=RequestContext(request)) @login_required def supply_and_demand(request, from_date, to_date): try: from_date = datetime.datetime(*time.strptime(from_date, '%Y_%m_%d')[0:5]).date() to_date = datetime.datetime(*time.strptime(to_date, '%Y_%m_%d')[0:5]).date() exc...
# coding: utf-8 """***************************************************************************** * Copyright (C) 2021 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * re...
narrowed CpG set to evaluate, try to reduce running time targetedSet = ontCallsKeySet ## ontCalls_narrow_set ## - set: need to intersect ## - None: no need to intersect if ontCalls_narrow_set is not None: targetedSet = targetedSet.intersection(ontCalls_narrow_set) if len(targetedSet) == 0: # no cpg sites for ev...
import rospy import math from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement import humanoid_league_msgs.msg from bitbots_hcm.hcm_dsd.hcm_blackboard import STATE_ANIMATION_RUNNING, STATE_CONTROLLABLE, STATE_FALLEN, STATE_FALLING, \ STATE_HARDWARE_PROBLEM, STATE_MOTOR_OFF, STATE_PENALTY,...
= structure.get_sorted_structure() # If grid_density is in the kpoints_settings use Kpoints.automatic_density if self.kpoints_settings.get('grid_density'): return Kpoints.automatic_density( structure, int(self.kpoints_settings['grid_density']), self.force_gamma) # If length is in the kpoints_settings use Kpoint...
''' The MIT License (MIT) Copyright © 2021 Opentensor.ai 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,...
* self.batch_c * range_c[2] - range_c[2] / 2 # - range_c[2] / 2, so that the last value is ignored which is actually the begining of next batch if range_c_end > range_c[1]: range_c_end = range_c[1] a = np.sqrt(self.dataset[0].system.xyz.cell[0][0]**2+self.dataset[0].system.xyz.cell[0][1]**2+self.dataset[0].s...
Science.""" @staticmethod def get_identifiers(data: dict) -> Dict[str, Any]: """Extract identifier information. :param data: dictionary of web response. :return: Identifier record. """ recognised_types = { "issn", "eissn", "isbn", "eisbn", "art_no", "meeting_abs", "xref_doi", "parent_book_doi", "doi"...
'@odata.type': tval = item["@odata.type"].split('#') tval = tval[-1].split('.')[:-1] tval = '.'.join(tval) instances.append(tval) elif item: instances.append(item[instance._typestring]) return instances def getprops(self, selector=None, props=None, nocontent=None, \ skipnonsetting=True, remread=Fals...
<reponame>Alex-Lian/openctest<filename>core/generate_value/gutil.py import re import random import config import sys NONE = "NOTYPE" INT = "INT" FLOAT = "FLOAT" BOOL = "BOOL" FILEPATH = "FILEPATH" IP = "IP" PORT = "PORT" IPPORT = "IPPORT" CLASSNAME = "CLASSNAME" DIRPATH = "DIRPATH" INTLIST = "INTLIST" STRLIST = "STRLI...
import argparse import hashlib import os import pprint import re import shutil import k3down2 import k3git import yaml from k3color import darkyellow from k3color import green from k3handy import cmdpass from k3handy import pjoin from k3handy import to_bytes from k3fs import fread from .. import mistune def sj(*arg...
= YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:etsi:osm:yang:nst', defining_module='nst', yang_type='string', is_config=True) def _get_floating_ip_required(self): """ Get...
import numpy as np import matplotlib #matplotlib.use('KtAgg') import matplotlib.pylab as plt import matplotlib.gridspec as gridspec from matplotlib import colors from matplotlib.patches import Circle from matplotlib.figure import * from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from ma...
from tkinter import * #imports the tkinter module from tkinter import ttk #imports the ttk submodule in tkinter from tkinter import messagebox #imports the messagebox submodule in tkinter from random import choice, randint #imports the choice and randint functions from the random module #creates the Questionnaire...
from __future__ import absolute_import, division, unicode_literals import re import csv from rasa_sdk import Action from sample_data import * from rasa_sdk.forms import FormAction from rasa.core.policies.policy import confidence_scores_for from rasa_sdk.events import SlotSet, ConversationPaused, ReminderScheduled, Conv...
<gh_stars>0 # # Copyright (c) 2008-2015 Citrix Systems, 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 la...
# coding: utf-8 import math import webbrowser import wx from contextlib import contextmanager from concurrent.futures import Future from functools import partial from pathlib import Path from bookworm import typehints as t from bookworm import app from bookworm import config from bookworm import speech from bookworm.c...
<gh_stars>1-10 # -*- coding: utf-8 -*- from django.conf import settings from django.db import models from django.db.models import Q, QuerySet from django.contrib.postgres.fields import ArrayField from django.utils.functional import cached_property from cms.models.pluginmodel import CMSPlugin from djangocms_text_ckedito...
<filename>channels_graphql_ws/graphql_ws.py<gh_stars>0 # # coding: utf-8 # Copyright (c) 2019 DATADVANCE # # 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 # wit...
MJ_filter_1H_to_3_comon.append(Mj_filter_1H_Phase[row_1H]) MJ_filter_3H_to_1_comon.append(Mj_filter_3H_Phase[row_3H]) Day_count_MJ_filter_1H_3H.append(Filter_1H_day_count[row_1H] +Filter_3H_day_count[row_3H] ) count_n = count_n + 1 N_MJ_filter_1H_3H = count_n -1 #1N to 4N MJ_Phase_1N_to_4_comon = [] MJ_Phase...
""" motifscan.cli.main ------------------ Main command line interface of MotifScan. """ import argparse import os import sys from textwrap import dedent from motifscan import __version__ from motifscan.cli import config, genome, motif, scan from motifscan.config import user_rc_path from motifscan.logging import setu...
<gh_stars>0 import numpy as np import matplotlib import matplotlib.pyplot as plt from danpy.sb import dsb from danpy.useful_functions import save_figures,is_number from scipy import signal import numdifftools as nd import scipy as sp from params import * # from animate import * def LP_filt(filter_length, x): """ Fin...
<gh_stars>1-10 """ common ~~~~~~ Utilities and other commonly reused functions for pjinoise. """ from typing import Any, List, Mapping, Sequence, Tuple, Union import numpy as np from PIL import Image from pjinoise.constants import SUPPORTED_FORMATS, X, Y, Z # General purpose functions. def convert_color_space(a: n...
# -*- coding: utf-8 -*- import pandas as pd import os import configparser, ast import copy #Constants kbh="20836612225.1252" # Boltzmann constant divided by Planck constant, s^-1, string. kbev="8.617333262145E-5" # Boltzmann constant in eV·K−1, string. avogadro=6.02214199E23 # Avogadro's constant. def readconf...
'Unknown': 1, 'Fifo': 2, 'DevChar': 3, 'Directory': 4, 'DevBlock': 5, 'File': 6, 'Symlink': 7, 'Socket': 8, 'WhiteOut': 9, }, 'DnDAction': { 'Ignore': 0, 'Copy': 1, 'Move': 2, 'Link': 3, }, 'DirectoryOpenFlag': { 'None': 0, 'NoSymlinks': 1, }, 'MediumState': { 'NotCreated': 0, 'Created': 1, 'Lock...
**kwargs): pass def MFnMesh_getFaceVertexColorIndex(*args, **kwargs): pass def delete_MFnData(*args, **kwargs): pass def MDGMessage_addNodeChangeUuidCheckCallback(*args, **kwargs): pass def MEdit_setFailed(*args, **kwargs): pass def array2dFloat_swigregister(*args, **kwargs): pass def array3dFloat_get...
formatpost(): """ Formats the posted data into wanted format The data should be a list Currently only working for saol """ # get and parse data request.get_data() data = request.data try: data = json.loads(data) except ValueError as e: raise errors.KarpParsingError(str(e)) # set all allowed lexicons (to av...
<filename>src/db.py #################################################################################################### ### ### ### Functions for database handling (fetching, ...) ### ### Author: <NAME> (EPFL) ### ### Last modified: 03.09.2021 ### ### ### ###############################################################...
(content_id is not None and grade is not None): # i.e. 0 attempts - date_id = date_str[0:len(date_str)-4] post_date = datetime.datetime.strptime(date_id, "%Y-%m-%d %H:%M:%S") #2014-07-11 16:52:53 EST unixtimestamp = time.mktime(post_date.timetuple()) date_id_index = datetime.datetime.strftime(post_date, "%d-%b-%y...
0}, '>14524152': {'str': 0, 'sma': 9, 'larj': 2, 'weaj': 2, '345': 0, '3t4': 0, 'bl4': 0, 'bl1': 5, 'bl5': 0, 'pa1': 0}, '>14525342': {'str': 2, 'sma': 6, 'larj': 4, 'weaj': 2, '345': 0, '3t4': 1, 'bl4': 0, 'bl1': 0, 'bl5': 0, 'pa1': 0}, '>14525452': {'str': 2, 'sma': 6, 'larj': 4, 'weaj': 2, '345': 0, '3t4': 0, 'bl...
<reponame>JaiWillems/SatPy """Localize position information representations. This module provides the `Coordinate` class to allow for a simple interface for converting a position type into various representations. The class is also used for position inputs and outputs for other `Celest` functionality. """ from celes...
not self._vector: self._vector = Vector(((w, self.tfidf(w)) for w in self.terms)) return self._vector def keywords(self, top=10, normalized=True): """ Returns a sorted list of (relevancy, word)-tuples that are top keywords in the document. With normalized=True, weights are normalized between 0.0 and 1.0 (their su...
#-*- coding: utf-8 -*- import sys import random import numpy as np import pandas as pd import utility_1 import h5py import json eps=1e-12 def countCG(strs): strs = strs.upper() return float((strs.count("C")+strs.count("G")))/(len(strs)) def countCG_N(strs): strs = strs.upper() return float((strs.count("C")+strs....
from machaon.core.type import TypeDefinition import os import shutil import sys import tempfile import configparser import re import importlib import traceback from typing import Dict, Any, Union, List, Optional, Iterator from machaon.core.importer import module_loader, walk_modules, module_name_from_path, PyBasicModu...
<reponame>211tbc/synthesis<filename>src/hmiscsv30writer.py #!/usr/bin/env python import os from sqlalchemy import or_, and_ from zope.interface import implementer import csv from .conf import settings #import exceptions from . import dbobjects from .writer import Writer @implementer(Writer) class HmisCSV30Writer():...
# coding: utf-8 """ THORChain API This documentation outlines the API for THORChain. NOTE: This document is a **work in progress**. # noqa: E501 OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python...
<reponame>lpltk/pydriver<filename>pydriver/evaluation/evaluation.py # -*- coding: utf-8 -*- from __future__ import absolute_import, division import math, operator import numpy as np from ..common.constants import FLOAT_dtype class Evaluator(object): """Evaluation curve representation Average precision and orien...
#!/usr/bin/env python # coding: utf-8 # In[ ]: def validate_getConfig_body(rdata): """ Method validate getConfig's body for right structure and not empty, rdata = { "data": [...] } INPUTS: rdata as dict(body) OUTPUT: Returns boolean, True when structure is valid, False when structure is invalid. """ if isinst...
transaction and returns the result. Beware: lists of (small) integers may be (falsely) returned as a string - use str_to_list() to convert such strings. """ result = self.req_list(self.new_req_list().add_read(key))[0] return self.process_result_read(result) def write(self, key, value): """ Issues a write oper...
buf def _decryptAndUnseal(self, header, buf): """Decrypt AEAD encrypted data""" seqnumBytes = self._readState.getSeqNumBytes() # AES-GCM has an explicit variable nonce in TLS 1.2 if "aes" in self._readState.encContext.name and \ not self._is_tls13_plus(): explicitNonceLength = 8 if explicitNonceLength > len(bu...
import demistomock as demisto from CommonServerPython import * ''' IMPORTS ''' import requests import json import os from datetime import datetime, timedelta import collections # disable insecure warnings requests.packages.urllib3.disable_warnings() ''' GLOBAL VARS ''' SERVER = demisto.params().get('serverURL', '').s...
[altchars]" in output assert ">>> base64.b64encode(s, altchars=None)" in output assert "$ py base64.b64encode s [altchars]" in output assert "$ py base64.b64encode --s=... [--altchars=...]" in output assert "--version" not in output assert "[PYFLYBY] import base64" in output if PY2: assert "\n Encode a string us...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import threading import unittest from os import path import time import re import shutil import os import sublime import shellenv import package_events if sys.version_info < (3,): from Queue import Queue e...
((cmd != 'MEM=CLEAR' and echo_time >= self.timeout) or (cmd == 'MEM=CLEAR' and echo_time >= self.mem_clear_timeout)): # The command timed out reading back the echo of the command. # No need to read the values as it will also time out. # Log it and retry. In practice, the retry always works. log.info("%s: times: %f...
<reponame>clreda/patterning-scenario # -*- coding: utf-8 -*- from time import time from z3 import * import numpy as np from formula_to_truthtable import dict_to_tt from utils import * from build_conditions import * from patterns import precompute_pattern, precompute_diffusion from globals import change_grn ########...
<filename>sysroot/usr/lib/python3/dist-packages/apt/cache.py # cache.py - apt cache abstraction # # Copyright (c) 2005-2009 Canonical # # Author: <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free So...
-> builtins.bool: return not (rhs == self) def __repr__(self) -> str: return "SpacerProps(%s)" % ", ".join( k + "=" + repr(v) for k, v in self._values.items() ) @jsii.enum(jsii_type="@aws-cdk/aws-cloudwatch.Statistic") class Statistic(enum.Enum): """Statistic to use over the aggregation period.""" SAMPLE_COU...
<reponame>yurj/timeboard<gh_stars>100-1000 from __future__ import division from .exceptions import (OutOfBoundsError, VoidIntervalError, UnacceptablePeriodError) from .workshift import Workshift from .core import _Frame, _Schedule, VOID_TIME class _BaseInterval(object): """Parent class for Interval and VoidInterna...
import json from random import randint from typing import Callable, Dict, Optional from unittest.mock import patch import pytest from botocore.config import Config from botocore.stub import Stubber from aws_lambda_powertools.utilities.batch import ( BatchProcessor, EventType, PartialSQSProcessor, batch_processor,...
computations for groups of features. """ # Compute contributions for groups of features self.contributions_groups = self.state.compute_grouped_contributions(self.contributions, features_groups) self.features_imp_groups = None # Update features dict with groups names self._update_features_dict_with_groups(features...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
<reponame>Tinka8ell/RCBoat<filename>TestCode/GpioZeroBoat.py # !/usr/bin/python3 """ GpioZeroBoat - A Boat using gpioZero pin control Originally created as a implementation extending the gpiozero robot object. It added a third motor and a ruder. With the inclusion of the turrets that use stepper motors, not dir...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import base64 import itertools import os import textwrap import pytest ...