input
stringlengths
2.65k
237k
output
stringclasses
1 value
in range(N): # updata of P mu_ti = mu[int(self.points_hawkes[i]/delta_t_mu)] intensity_total = 0 for j in range(i): tji = self.points_hawkes[i] - self.points_hawkes[j] if tji >= self.T_phi: continue intensity_total += phi[int(tji/delta_t_phi)] intensity_total += mu_ti P[i][i] = mu_ti/intensity_total for j in r...
from datetime import date, timedelta import itertools import os from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser from django.conf import settings from django.core import mail from django.core.exceptions import ValidationError from django.test import TestCase, override...
Constraint(expr=m.x1357*m.x1357 - m.x4377*m.b3010 <= 0) m.c4509 = Constraint(expr=m.x1358*m.x1358 - m.x4378*m.b3010 <= 0) m.c4510 = Constraint(expr=m.x1359*m.x1359 - m.x4379*m.b3010 <= 0) m.c4511 = Constraint(expr=m.x1360*m.x1360 - m.x4380*m.b3010 <= 0) m.c4512 = Constraint(expr=m.x1361*m.x1361 - m.x4381*m.b3010 <=...
<filename>visnav/algo/orig/tools.py<gh_stars>0 import math import time import numpy as np import numba as nb import quaternion # adds to numpy # noqa # pylint: disable=unused-import import sys import scipy from astropy.coordinates import SkyCoord from scipy.interpolate import RectBivariateSpline from scipy.interpolat...
["is_null"], }, "url": { "defaultLookup": "equals", "defaultValue": "", "lookups": { "contains": {"prettyName": "contains", "type": "url"}, "ends_with": {"prettyName": "ends with", "type": "url"}, "equals": {"prettyName": "equals", "type": "url"}, "is_null": {"prettyName": "is null", "type": "isnull"}, "not_c...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Jul 13 13:50:26 2016 @author: aholaj """ ###### read ice ################################# ### imports and global values ### ################################# import numpy as np import sys import os import matplotlib.pyplot as plt from itertools im...
from fill import * from ontology import * from unitor import * from shuffle import * from syllepsis import * from tricathom import * _H = Functor("H") _a = ConstPrim0("a") _b = ConstPrim0("b") _c = ConstPrim0("c") _d = ConstPrim0("d") _e = ConstPrim0("e") _Ha = app(_H, _a) _Hb = app(_H, _b) _Hc = app(_H, _c) _Hd = ...
[ALERT] url {url}\n\nUrl {url} registered an alarming change of {round(change,4)} at {datestr}" # set up email server config port = 465 context = ssl.create_default_context() try: with smtplib.SMTP_SSL("smtp.gmail.com", port, context=context) as server: server.login(sender, psswd) server.sendmail(sender, recie...
#!/usr/bin/env python ''' print_all.py - a script to print a MRT format data using mrtparse. Copyright (C) 2016 greenHippo, 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 http://www.apache....
"""NLG is a Natural Language Generator used to produce a human-like response for Dialogue Acts of the agent.""" __author__ = "<NAME>" import random from copy import deepcopy from typing import List from moviebot.dialogue_manager.dialogue_act import DialogueAct from moviebot.dialogue_manager.dialogue_state import Dia...
super(ResNet, self).__init__() self.stem = stem self.num_classes = num_classes current_stride = self.stem.stride self._out_feature_strides = {"stem": current_stride} self._out_feature_channels = {"stem": self.stem.out_channels} self.stages_and_names = [] for i, blocks in enumerate(stages): for block in blocks...
needed to work. """ for line in self: yield line def __delitem__(self, idx): """Delete line or slice of lines from the buffer. This is the same as __setitem__(idx, []) """ self.__setitem__(idx, None) def __ne__(self, other): """Test inequality of Buffers. Necessary for Python 2 compatibility. We never d...
%s' % \ (options.relog_name, config.PhaseStr(config.filter_user_defn))) util.PhaseBegin(options) result = self.phases.RelogWholeName(self.replay_cmd, wp_log_dir, relog_wp_dir, options) if not options.list: msg.PrintMsgDate('Finished filtering whole program pinballs with user defined name: %s %s' % \ (options.relo...
if not (min_size < output_size[d] < max_size): raise ValueError( 'invalid output_size "{}" (dim {} must be between {} and {})' .format(output_size, d, min_size, max_size)) return output_size def max_unpool1d(input, indices, kernel_size, stride=None, padding=0, output_size=None): kernel_size = _single(kernel_si...
<reponame>DominikMa/P5-Vehicle-Detection """Pipeline to find lanes on images or movies.""" import numpy as np import cv2 import glob from os import path import pickle from lane import Lane class Lanefinder(): """docstring for .""" def __init__(self): self.ym_per_pix = 30/720 # meters per pixel in y dimension se...
to marginalize over you must minimize over the unwanted axies of sum_dev i.e for fr np.min(np.min(np.min(np.min(fit['sum_dev'],axis = 4),axis = 3),axis = 2),axis = 1) ''' if error is None: error = np.ones(len(x)) fs = np.linspace(ranges[0][0],ranges[1][0],n_grid_points) Qrs = np.linspace(ranges[0][1],ranges[1][1...
Constraint(expr= m.x2159 - m.b3015 <= 0) m.c2161 = Constraint(expr= m.x2160 - m.b3015 <= 0) m.c2162 = Constraint(expr= m.x2161 - m.b3015 <= 0) m.c2163 = Constraint(expr= m.x2162 - m.b3015 <= 0) m.c2164 = Constraint(expr= m.x2163 - m.b3015 <= 0) m.c2165 = Constraint(expr= m.x2164 - m.b3015 <= 0) m.c2166 = Constrai...
<reponame>stevenrbrandt/nrpytutorial # finite_difference.py: # As documented in the NRPy+ tutorial notebook: # Tutorial-Finite_Difference_Derivatives.ipynb , # This module generates C kernels for numerically # solving PDEs with finite differences. # # Depends primarily on: outputC.py and grid.py. # Author: <NAME> # za...
- 0.00153332*m.x228 - 0.0100498*m.x229 - 0.00785713*m.x230 + 0.00664334*m.x231 + 0.00636725*m.x232 + 0.00180223*m.x233 - 0.00360195*m.x234 + 0.0366567*m.x235 - 0.0185973*m.x236 + 0.014965*m.x237 + 0.000920465*m.x238 - 0.00905371*m.x239 + 0.0171861*m.x240 - 0.000803595*m.x241 - 0.0131086*m.x242 - 0.00149067*m.x243 +...
""" Spiral plotly express documentation module. """ import inspect from textwrap import TextWrapper getfullargspec = inspect.getfullargspec colref_type = "str or int or Series or array-like" colref_desc = ( "Either a name of a column in `data_frame`," " or a pandas Series or array-like object." ) colref_list_type...
* math.pow(stress_frac, m1)*gamma1*(1-gamma_val)\ *self._fraction[idx] def get_damage_slope2(self, idx, curve, int_press, ext_press): m2, log_m2, k, slope = snc.get_paramter(curve,'m2'), snc.get_paramter(curve,'log a2'),\ snc.get_paramter(curve,'k'), snc.get_paramter(curve,'slope') cycles = self._design_life*365*...
for deployed VM" ) self.assertNotEqual( len(vms), 0, "List VMs should return valid response for deployed VM" ) vm = vms[1] self.debug( "VM state after enabling maintenance on first host: %s" % vm.state) if vm.state in [ "Stopping", "Stopped", "Running", "Starting", "Migrating" ]: if vm.state == "Runni...
<filename>tronx/helpers/utils.py import time import re import shlex import os import asyncio import html import math import aiohttp import random import json from time import sleep from hachoir.metadata import extractMetadata from hachoir.parser import createParser from PIL import Image from math import ceil from ty...
1] [0 1] sage: w._h_inverse_transition_matrices[2] [ 1 -1] [ 0 1] sage: w._h_transition_matrices.keys() [0, 1, 2] """ l = len(self._h_transition_matrices) if l <= n: from sage.combinat.partition import Partitions_n from sage.misc.cachefunc import cached_function @cached_function def wsum(m): # expansion of...
import argparse from pathlib import Path import networkx as nx import nxmetis import torch import torch.nn as nn import torch.multiprocessing as mp from torch_geometric.data import Data, DataLoader, Batch from torch_geometric.nn import SAGEConv, GATConv, GlobalAttention, graclus, avg_pool, global_mean_pool from tor...
from django.template import Template from django.template.context import Context from django.test import RequestFactory from cms.test_utils.testcases import CMSTestCase from cms.test_utils.util.mock import AttributeObject from cms.toolbar.toolbar import CMSToolbar from cms.toolbar.utils import get_object_edit_url, get...
clear any recent bombs for bomb in player.bombs: if bomb.recently_exploded == True: self.clear_bomb(bomb) del bomb # don't think this works? player.bombs = [] # will need to fix this for when players have multiple bombs # get player's action action = player_actions[player.number] # get player's new po...
# × <EMAIL> # <EMAIL> # region: Time Functions and Variables -------------------------------------------------- import datetime as dt import pytz class processTime(): """ startTime: a datetime object (usually datatime.now()). format: default 's', returns total seconds, 'f' returns min and secs. startTi...
# -*- coding: utf-8 -*- """XLMRoberta for sentiment analysis (Spanish).ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1MnNGwewJl7rDg1gx6WhQ_pub--sTJ0Dy """ # This sentiment analysis program is modeled off the BERT tutorial by <NAME> and <NAME> foun...
# -*- coding:utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError from odoo.tools.safe_eval import safe_eval from datetime import datetime, date class HrPayrollStructure(models.Model): _inh...
<reponame>rsdoherty/azure-sdk-for-python<gh_stars>1000+ # 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 ...
<filename>qtoggleserver/core/device/attrs.py import asyncio import copy import datetime import hashlib import logging import re import socket import sys import time from typing import Optional from qtoggleserver import system from qtoggleserver import version from qtoggleserver.conf import settings from qtoggleserve...
1 0] [ 0 1] [0 1] [-1 0] [ 0 -1] [-1 0] [0 1], [-1 0], [ 0 -1], [-1 0], [1 0], [ 0 -1], [ 1 0], [ 0 1] ] There are 24 orientation preserving isometries of the 3-cube:: sage: ncube_isometry_group(3) [ [1 0 0] [ 1 0 0] [ 0 1 0] [ 0 0 -1] [ 1 0 0] [ 0 1 0] [0 1 0] [ 0 0 1] [ 0 0 -1] [ 0 -1 0] [ 0 0 -1] [-1 0 0] ...
pertinent to rez ... } } Each requirement has had its package name converted to the rez equivalent. The 'variant_requires' key contains requirements specific to the current variant. TODO: Currently there is no way to reflect extras that may have been chosen for this pip package. We need to wait for rez "packa...
de Necessidades', 'List Notes': 'Lista de Notas', 'List Offices': 'Lista de Escritórios', 'List Organizations': 'Listar Organizações', 'List Patients': 'List Patients', 'List Peers': 'LISTA DE PARES', 'List Personal Effects': 'Lista de objetos pessoais', 'List Persons': 'LISTA DE PESSOAS', 'List Photos': 'Lista...
<reponame>voloshanenko/smsgateway #!/usr/bin/python # Copyright 2015 <NAME> and <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
<filename>sdk/python/pulumi_google_native/compute/alpha/reservation.py # 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, Mapp...
xp.to_streamlit('hip', 'selected_uids').display() fit = variable[int(selected[0])] st.subheader('Displaying results of fit #%i' % (int(selected[0]) + 1)) # -------------------------------------------------------------------------------------------------------------- # ----------------------------------------------...
19, 18]) rectangle_points_definitions[30, :] = np.array([0, 2, 6, 4]) rectangle_points_definitions[31, :] = np.array([1, 3, 7, 5]) rectangle_points_definitions[32, :] = np.array([12, 14, 18, 16]) rectangle_points_definitions[33, :] = np.array([13, 15, 19, 17]) rectangle_points_definitions[34, :] = np.array([1, 2, 6, 5]...
in city: if city["cityNameData"]["Orig"]: cityKey = "_".join(x.upper() for x in city["CityName"].split(" ")) if cityKey in CITY_NAMES: city["cityLocData"] = CITY_NAMES[cityKey] def reorderedCityData(cityData, removeGaps=True): reorderedCityData = [] usedCities = [] replacedCities = [] for idx, city in enumera...
<filename>pyglet/graphics/vertexdomain.py<gh_stars>0 # ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 <NAME> # Copyright (c) 2008-2021 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modi...
) class OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteArray( object ): @classmethod def to_proto(self, resources): if not resources: return resources return [ OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote.to_proto( i ) for i in resources ] @classmethod def ...
<gh_stars>100-1000 # 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 Genera...
<filename>tpx3format/read.py import logging import struct import h5py import numpy as np from lib.constants import * import os # TODO: Logging does not work for multiprocessing processes on Windows logger = logging.getLogger('root') def read_positions(f): control_events = [] i = 0 rollover_counter = 0 approach...
*/ #~ int x, y; /* pointer x, y coordinates in event window */ #~ int x_root, y_root; /* coordinates relative to root */ #~ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ #~ int detail; #~ /* #~ * NotifyAncestor, NotifyVirtual, NotifyInferior, #~ * NotifyNonlinear,NotifyNonlinearVirtual #~ */ #~ Bool s...
<filename>py/test/pytests/fingerprint_mcu.py # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A factory test for the Fingerprint sensor. Description ----------- Tests that the fingerprint sensor is c...
import plotly.graph_objects as go import disnake from datetime import datetime, timedelta, timezone from disnake.ext import commands from utils.discord_utils import image_to_file, format_number from utils.setup import db_stats, db_users from utils.arguments_parser import parse_speed_args from utils.table_to_image impo...
<filename>models.py import ipdb import math import numpy as np import tensorflow as tf # N_DIM_STATE = 4 # N_DIM_ACTIONS = 2 N_DIM_STATE = 210*160 N_DIM_ACTIONS = 9 def batch_norm_init(inits, size, name): return tf.Variable(inits * tf.ones([size]), name=name) def weight_init(shape, name): return tf.Variable(tf.ran...
widgetize(self): Label(self, text='String:', anchor=W).pack(fill=X) ##Text info = Frame(self) vscroll = Scrollbar(info) self.info = Text(info, yscrollcommand=vscroll.set, width=1, height=1, wrap=WORD) self.info.insert(1.0, self.string) self.info.pack(side=LEFT, fill=BOTH, expand=1) vscroll.con...
class UMGrid: """ Interpolate the ocean mask onto the UM grid. Creates the land fraction and mask, later used as an input to the UM. """ def __init__(self, um_restart, num_lon_points, num_lat_points, mom_grid, output_dir): self.SOUTHERN_EXTENT = -89.995002746582031 self.SOUTHERN_EXTENT_CNR = -89.99949645996...
#!/usr/bin/env python # # Public Domain 2014-present MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a com...
<reponame>interoberlin/Wunderbar-Python-SDK """ Implementation of the relayr HTTP RESTful API as individual endpoints. This module contains the API class with one method for each API endpoint. All method names start with the HTTP method followed by the resource name used in that endpoint e.g. ``post_user_app`` for the...
notification queue and notifies # clients. Task triggers subscription `publish` resolvers. notifier_task: asyncio.Task # The callback to invoke when client unsubscribes. unsubscribed_callback: typing.Callable[[], None] def __init__(self, *args, **kwargs): assert self.schema is not None, ( "An attribute 'schema'...
<reponame>felipeek/bullet3 # Lint as: python3 """The base class for all quadrupeds.""" from typing import Any, Callable, Dict, Sequence, Tuple, Text, Union import gin import gym import numpy as np from pybullet_utils import bullet_client from pybullet_envs.minitaur.envs_v2.sensors import sensor as sensor_lib from pybu...
<gh_stars>1-10 import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) import numpy as np import pandas as pd import random import h5py from skimage import io from skimage import feature from skimage.draw import circle from scipy.ndimage.morphology import binary_fill_holes from...
import glob import pickle font = {"family": "normal", "weight": "bold", "size": 16} import matplotlib matplotlib.rc("font", **font) import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.gridspec import GridSpec import numpy as np import imageio from handcam.ltt.util.Utils import so...
<filename>support/unclefuncs.py #!/usr/bin/python import os,random from math import pi,sqrt def crossprod(vec1,vec2): vector = [vec1[1]*vec2[2]-vec1[2]*vec2[1],-(vec1[0]*vec2[2]-vec1[2]*vec2[0]),vec1[0]*vec2[1]-vec1[1]*vec2[0]] return vector def dotprod(vec1,vec2): vector = vec1[0]*vec2[0]+vec1[1]*vec2[1]...
<filename>ceph_deploy/lib/vendor/remoto/lib/vendor/execnet/gateway_base.py<gh_stars>0 """ base execnet gateway code send to the other side for bootstrapping. NOTE: aims to be compatible to Python 2.5-3.X, Jython and IronPython (C) 2004-2013 <NAME>, <NAME>, <NAME>, <NAME> and others """ from __future__ import with_sta...
to represent data to. Defaults to None. Returns: dict: Dictionary containing the created plot and its data table. """ outputs = {} # List of properties needed by the plot, properties are a set of tuples and contain 3 parts: # required True/False, property name and scenarios required, scenarios must be a list....
import glob, logging, os, sys, time, traceback from pprint import pprint, pformat from functools import partial from fnmatch import fnmatch import maya_helpers as mh import prefs, util import maya.OpenMayaUI as omui from maya.OpenMaya import MGlobal from dson import DSON, content import Qt from dsonimport i...
res_2[mask], res_1[mask] steps_taken = 0 success = np.all(np.abs(phi_1 - phi_2) < SOLVE_TOL) while steps_taken < 50 and not success: outputs['phi'][:] = 0.5 * (phi_1 + phi_2) self.apply_nonlinear(inputs, outputs, residuals) new_res = residuals['phi'] mask_1 = new_res < 0 mask_2 = new_res > 0 phi_1[mask_1] =...
<filename>scripts/ccpp_prebuild.py #!/usr/bin/env python # Standard modules import argparse import collections import logging import os import sys # DH* TODO # CONSISTENCY CHECK BETWEEN OPTIONAL ARGUMENTS IN THE METADATA TABLE AND IN # THE ACTUAL ARGUMENT LIST / FORTRAN VARIABLE DECLARATIONS (RANKS, TYPE, INTENT). # ...
<gh_stars>1-10 #!/usr/bin/python # ================ # databaseTools.py # ================ # # See README.md # # =============== # Based on RadioDBTools.py by <NAME>. # =============== # # This code is heavily based upon an open source code developed by <NAME>: # # -----------------------------------------------------...
<gh_stars>10-100 #!/usr/bin/env python #-*- coding: utf-8 -*- ##--------------------------------------------------------------------------------------- # Main Screen # ##--------------------------------------------------------------------------------------- from imports import * import config class MainScreen(Screen)...
""" slice_oper_unset = -1 slice_oper_down = 0 slice_oper_up = 1 slice_oper_na = 2 @staticmethod def _meta_info(): from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_dnx_driver_oper as meta return meta._meta_table['SliceStateEnum'] class Fia(object): """ FIA driver operational data .. attribut...
str(y2) + ", " + str(self.isRaw()) + "]" class RawMBR(MBR): def __init__(self, upper_left, lower_right, contained_item): MBR.__init__(self, upper_left, lower_right) self.contained_item = contained_item def isRaw(self): return True @staticmethod def makeMBRFromPoint(point): upper_left = point lower_right = poin...
directions. verticalFlag = self.splitVerticalFlag = not self.splitVerticalFlag orientation = g.choose(verticalFlag,"vertical","horizontal") g.app.config.setWindowPref("initial_splitter_orientation",orientation) # Reconfigure the bars. bar1.place_forget() bar2.place_forget() self.configureBar(bar1,verticalFlag) ...
<reponame>Joyoe/Magisk-nosbin_magisk-nohide # Author: <NAME> <<EMAIL>> # Author: <NAME> <<EMAIL>> # Author: <NAME> <<EMAIL>> import errno import selinux import setools import glob import sepolgen.defaults as defaults import sepolgen.interfaces as interfaces import sys import os import re import gzip PROGNAME = "polic...
6, 5, 20, 7, 5, 15, 5, 15, 7, 7, 0, 0], [ 7, 16, 9, 8, 2, 4, 5, 15, 2, 5, 2, 4, 5, 15, 2, 4, 5, 15, 2, 4, 5, 6, 5, 20, 7, 5, 15, 5, 15, 7, 7, 0, 0], [ 7, 16, 9, 8, 2, 4, 5, 15, 2, 5, 2, 4, 5, 15, 2, 4, 5, 15, 2, 4, 5, 6, 5, 20, 7, 5, 15, 5, 15, 7, 7, 0, 0], [ 7, 16, 9, 8, 2, 4, 5, 15, 2, 5, 2, 4, 5, 15, 2, 4, 5, 1...
<gh_stars>1-10 from __future__ import division, print_function import argparse import sys, os, time, gzip, glob from collections import defaultdict from base.config import combine_configs from base.io_util import make_dir, remove_dir, tree_to_json, write_json, myopen from base.sequences_process import sequence_set from...
Leakage': 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.400316, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime ...
import pandas as pd from .classes import Dependencies def normalize(dependencies, df): """ Normalizes the dependency relationships in dependencies into new groups by breaking up all partial and transitive dependencies. Arguments: dependencies (Dependencies) : the dependencies to be split up Returns: new_gro...
#!/usr/bin/python # # Copyright (c) 2016, Seraphim Sense Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted # provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this ...
<reponame>montag451/core import atexit import logging import os import re import tempfile import threading import time from concurrent import futures from typing import Type import grpc from grpc import ServicerContext from core import utils from core.api.grpc import ( common_pb2, configservices_pb2, core_pb2, co...
# coding: utf-8 """ Nexus Repository Manager REST API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 3.20.1-01 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 imp...
<gh_stars>1-10 # -*- coding:utf-8 -*- # /usr/bin/env python """ Date: 2019/10/21 12:08 Desc: 获取金十数据-数据中心-主要机构-宏观经济 """ import json import time import pandas as pd import requests from tqdm import tqdm from akshare.economic.cons import ( JS_CONS_GOLD_ETF_URL, JS_CONS_SLIVER_ETF_URL, JS_CONS_OPEC_URL, ) def macro...
mut_cand[1].pos = arg_obj except: pass if isinstance(arg_node, ast.Name): assert self.active_scope is self.cur_frame_original_scope arg_dsym = self.active_scope.lookup_data_symbol_by_name(arg_node.id) if arg_dsym is None: self.active_scope.upsert_data_symbol_for_name( arg_node.id, arg_obj, set(), self.prev_...
for hoverinfo . hoverlabel :class:`plotly.graph_objects.candlestick.Hoverlabel` instance or dict with compatible properties hovertext Same as `text`. hovertextsrc Sets the source reference on Chart Studio Cloud for hovertext . ids Assigns id labels to each datum. These ids for object constancy of data point...
kmer in kmer_probe_map.keys(): for probe, pos in kmer_probe_map[kmer]: native_dict[kmer].append((probe.seq_str, pos)) native_dict = dict(native_dict) return SharedKmerProbeMap(keys, probe_seqs_ind, probe_pos, probe_seqs, k, probe_seqs_to_probe, native_dict) def set_max_num_processes_for_probe_finding_pools(max_...
the transaction node dns endpoint basic auth password. :type password: str :param firewall_rules: Gets or sets the firewall rules. :type firewall_rules: list[~azure.mgmt.blockchain.models.FirewallRule] :param consortium_management_account_password: Sets the managed consortium management account password. :type co...
in info/has_prefix not included in archive'.format( filename ), ) def check_prefix_file_mode(self): """Check that the has_prefix mode is either binary or text.""" if self.prefix_file_contents is not None: _, mode, _ = self.prefix_file_contents if mode not in ["binary", "text"]: return Error( self.path, "C1...
# Tests generated by: guppy.gsl.Tester # Date: Tue May 19 18:54:16 2020 class Tester: tests = {} def get_ex_1(self): from guppy.heapy.heapyc import NodeGraph return NodeGraph() def get_ex_2(self): from guppy.heapy.heapyc import HeapView hv = HeapView((), ()) return hv.cli_none() def get_ex_3(self): from guppy...
import flask import imageio import io import json import os import pandas as pd import sqlalchemy as sa import tifffile import urllib from flask_restful import Resource from opencell.imaging import utils from opencell.api import payloads, cytoscape_payload from opencell.api.cache import cache from opencell.database i...
import asyncio import logging import json import inspect import aiohttp.client_exceptions from botocore.utils import ContainerMetadataFetcher, InstanceMetadataFetcher, \ IMDSFetcher, get_environ_proxies, BadIMDSRequestError, S3RegionRedirector, \ ClientError, InstanceMetadataRegionFetcher, IMDSRegionProvider, \ res...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys import json import time import inspect try: # noinspection PyUnresolvedReferences from fabric.api import local, abort, env # noinspection PyUnresolvedReferences from fabric.colors import red, green, yellow, cyan # noinspection PyUnresol...
"""Collections of library function names. """ class Library: """Base class for a collection of library function names. """ @staticmethod def get(libname, _cache={}): if libname in _cache: return _cache[libname] if libname == 'stdlib': r = Stdlib() elif libname == 'stdio': r = Stdio() elif libname == 'm': ...
<gh_stars>100-1000 # coding: utf-8 '''This module contains miscellaneous commands for additional functionality. Suppose these things are useful, but not essential. ''' from __future__ import print_function import sublime, sublime_plugin from sublime import Region from sublime_plugin import TextCommand, EventListener...
+ 2333.44021035551 * self.t) Y1 += 0.00000000097 * math.cos(0.57476621767 + 26556.11194941211 * self.t) Y1 += 0.00000000118 * math.cos(0.18981536711 + 7994.77225950771 * self.t) Y1 += 0.00000000109 * math.cos(0.03572167179 + 103396.25664217169 * self.t) Y1 += 0.00000000109 * math.cos(4.54205508167 + 79219.552983814...
<reponame>gpescia/MyNetKet # Copyright 2021 The NetKet Authors - 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...
import numpy as np import torch import data import utils class BatchGenerator(object): def __call__(self): pass def for_eval(self): pass def total_batches(self): pass class DocumentBatchGenerator(BatchGenerator): """A batch generator that only generates word batches. Each seq in a batch is a sequence of ...
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import numpy as np import casadi from casadi import SX, DM from math import cos, sin import plotly.graph_objects as go app = dash.Dash(__name__) server = app.server app.layout = html.Div( ch...
Oo0Ooo * oO0o . I11i / i1IIi lisp . lisp_ms_rtr_list = [ ] if ( I1IiIiiIiIII . has_key ( "address" ) ) : for Ii1I1i in I1IiIiiIiIII [ "address" ] : II = lisp . lisp_address ( lisp . LISP_AFI_NONE , "" , 0 , 0 ) II . store_address ( Ii1I1i ) lisp . lisp_ms_rtr_list . append ( II ) if 50 - 50: I1Ii111 / i1IIi % Oo...
np.pi * np.array( [np.square(bins[0])] + [np.square(bins[i+1])-np.square(bins[i]) for i in np.arange(len(bins)-1)] ) cont_per_bin = mean_cont * bin_area fractional_cont = cont_per_bin / n fc = interp1d(bins, fractional_cont, kind='slinear') print '%.3f%% at x=%.2f' % (fc(1.5), 1.5) #for i in np.logspace(-1, 2, 20)...
# from __future__ import unicode_literals import boto3 from botocore.exceptions import ClientError from datetime import datetime, timedelta from freezegun import freeze_time import pytest from uuid import uuid4 import pytz import sure # noqa from moto import mock_cloudwatch @mock_cloudwatch def test_put_list_dashbo...
import os import sys import re import yaml import numpy as np import pandas as pd import math from tqdm import tqdm from scipy import interpolate sys.path.append("..") class MaterialLoader: def __init__(self, wl_s=0.2, wl_e=2.0): super().__init__() self.db_path = './db' self.db_info = self.load_db_in...
import os.path as osp import time from collections import defaultdict, namedtuple from functools import lru_cache import numpy as np from zqy_utils import Registry, TimeCounter, flat_nested_list, load from .table_renderer import TableRenderer Score_Fp_Precision = namedtuple("Score_Fp_Precision", ["score", "fp", "p...
previous=previous, previous_only_aid=previous_only_aid, **kwargs, ) @register_route('/turk/detection/dynamic/', methods=['GET']) def turk_detection_dynamic(**kwargs): ibs = current_app.ibs gid = request.args.get('gid', None) image_src = routes_ajax.image_src(gid) # Get annotations width, height = ibs.get_ima...
= True; x = not (t is True)", "x", False yield self.st, "t = True; x = not (t is False)", "x", True yield self.st, "t = True; x = not (t is None)", "x", True yield self.st, "n = None; x = not (n is True)", "x", True yield self.st, "n = None; x = not (n is False)", "x", True yield self.st, "n = None; x = not (n is ...
is bounded, set model redshift to midpoint of bounds # when doing the guess. if ppfs is None: ppfs = {} if tied is None: tied = {} # Convert bounds/priors combinations into ppfs if bounds is not None: for key, val in six.iteritems(bounds): if key in ppfs: continue # ppfs take priority over bounds...
# -*- coding: utf-8 -*- # Copyright 2017, Digital Reasoning # # 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 l...