input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
10271, 10273, 10289, 10301, 10303,
10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369,
10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459,
10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531,
10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627,
10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691,
... | |
+ 1 and j == i + 1:
STRAIGHT_DHHSC.append({D[i], H[j], H[k], S[l], C[m]})
STRAIGHT_DHHSC.append({D[9], H[10], H[11], S[12], C[0]})
STRAIGHT_DHHSH = []
for i in range(13):
for j in range(1, 13):
for k in range(2, 13):
for l in range(3, 13):
for m in range(4, 13):
if m == l + 1 and l == k + 1 and k == j + 1 and j ... | |
(" + n_args + " given)")));
}
} else {
if (f.func_args.length > args.length) {
if (f.func_minargs == 1) {
@{{raise}}($new(@{{TypeError}}, B$str(f.__name__ + "() takes at least 1 argument (0 given)")));
} else {
@{{raise}}($new(@{{TypeError}}, B$str(f.__name__ + "() takes at least " + f.func_minargs + " arguments... | |
vanilla option to minus the identical knock out.
Parameters:
----------
Ns: Number of points in price axis
Nt: Number of points in time axis
theta:
0 : Fully implicit method
0.5 : Crank-nicolson method
According to reference, fully implicit method is better than crank-nicolson method
Reference :
... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
import os
import logging
from chatterbox.models import Activity
from .date import tumblr_date_to_datetime, datetime_to_string
log = logging.getLogger(__name__)
def activity_from_dict(data):
log.debug("Converting Tumblr dict to Activity Model")
activity_dict = activity_dict_from_dict(data)
return Activity.from_ac... | |
area time series for all L3 regions
tf.random.set_seed(seed)
#X_test_dat= np.array(X_test_dat, dtype= np.float32)
if debug:
n_regions= 1 #18
else:
n_regions= 18
tot_months= 60
reg_size_df= pd.DataFrame({'mean_size': pd.Series(dtype= 'int'), 'low_1sig_size': pd.Series(dtype= 'int'), 'high_1sig_size': pd.Seri... | |
0, 0, 0, 1, -360, 360],
[49, 54, 0.073, 0.289, 0.0738, 9900, 0, 0, 0, 0, 1, -360, 360],
[49, 54, 0.0869, 0.291, 0.073, 9900, 0, 0, 0, 0, 1, -360, 360],
[54, 55, 0.0169, 0.0707, 0.0202, 9900, 0, 0, 0, 0, 1, -360, 360],
[54, 56, 0.00275, 0.00955, 0.00732, 9900, 0, 0, 0, 0, 1, -360, 360],
[55, 56, 0.00488, 0.0151, 0.... | |
"""
Inference Dataset
-----------------
"""
from abc import ABC, abstractmethod
from typing import Optional, Sequence, Tuple, Union
import numpy as np
from torch.utils.data import Dataset
from darts import TimeSeries
from darts.logging import raise_if_not
from .utils import CovariateType
class InferenceDataset(AB... | |
<gh_stars>10-100
import os
import pickle
import math
from PIL import Image
import warnings
import datetime
import configparser
import numpy as np
np.random.seed(20200501)
warnings.filterwarnings("ignore")
"""Set seed and Init cuda"""
os.environ["TF_CPP_MIN_LOG_LEVEL"] = '2' # 只显示 warning 和 Error
os.environ["CUDA_DEVIC... | |
relative_uris: bool = True
) -> Dict[str, Any]:
r: Dict[str, Any] = {}
for ef in self.extension_fields:
r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef]
if self.fields is not None:
r["fields"] = save(
self.fields, top=False, base_url=base_url, relative_uris=relative_uris
)
if self.type ... | |
"""Twitter class for f451 Communications module.
This module adds an abstraction layer to the Tweepy Twitter API package and the main
purpose is to provide a standard interface for some core methods for sending Twitter
status updates and DMs to specific recipients.
Note:
This module assumes that we have an active Tw... | |
# widgets
from tkinter import *
from tkinter import simpledialog
from tkinter import ttk
from tkinter import messagebox as msg
import tkinter as tk
from tkinter.filedialog import asksaveasfilename as save
from tkinter.filedialog import askopenfilename as openfile
from tkinter.colorchooser import *
from tkinterhtml impo... | |
import datetime
import math
import pandas as pd
import re
#region Lipid subclass information
fatty_aclys = ['FA', 'NAGly', 'NAGlySer', 'NAOrn', 'NAE', 'CAR', 'FAHFA']
glycerolipids = ['DG', 'EtherDG', 'DGDG', 'EtherDGDG', 'MGDG', 'EtherMGDG',
'SQDG', 'EtherSMGDG' 'MG', 'ADGGA', 'DGCC', 'DGGA', 'DGTS/A',
'LDGCC', ... | |
# -*- coding: utf-8 -*-
"""
BSD 3-Clause License
Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
Redistribution and use in source and binary forms, with or without... | |
<gh_stars>100-1000
'''
Created on 2016/2/19
:author: hubo
'''
from vlcp.config import defaultconfig
from vlcp.server.module import Module, api, depend, call_api, ModuleNotification
from vlcp.event.runnable import RoutineContainer
from vlcp.service.connection import jsonrpcserver
from vlcp.protocol.jsonrpc import Json... | |
" " + status)
@deprecated
def find_worker(self, node):
"""Get worker instance which emulates the specified node.
Replaced by get_worker.
Args:
node: nodename or NodeWrapper instance.
Returns:
Worker instance
"""
return self.get_worker(node)
def get_worker(self, node):
"""Get worker instance which emula... | |
1L), groups=1, bias=False)
self.conv5_2_1x1_reduce_bn = self.__batch_normalization(2, 'conv5_2_1x1_reduce/bn', num_features=512, eps=9.99999974738e-06, momentum=0.0)
self.conv5_2_3x3 = self.__conv(2, name='conv5_2_3x3', in_channels=512, out_channels=512, kernel_size=(3L, 3L), stride=(1L, 1L), groups=1, bias=False)
s... | |
<filename>src/Placeholders.py
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
"""
Evaluated signal values for use in HERON
"""
import os
import sys
import abc
import copy
import _utils as hutils
from base import Base
FRAMEWORK_PATH = hutils.get_raven_loc()
sys.path.append(FRAMEWORK_PATH)
from ... | |
<gh_stars>0
#
#Authors: <NAME>,<NAME>
#
#NOTES:This class finds and returns dependencies of all packages or one
#patricular package.When run with -V option finds dependencies at file level
#
#
import os, sys, re,string
from os.path import walk
import getopt,warnings
os.system('rm -rf depresult')
vinfo = sys.version_in... | |
int_hamming_distance(a, b):
"""
Bit-wise and between float tensors.
:param a: first tensor
:type a: torch.Tensor
:param b: first tensor
:type b: torch.Tensor
:return: bit-wise and
:rtype: torch.Tensor
"""
if not a.is_contiguous():
a = a.contiguous()
if not b.is_contiguous():
b = b.contiguous()
check_ty... | |
in - 0 bytes out - OutObject<0,0>'),
('nn::am::service::IOverlayAppletProxy', 1000, '0 bytes in - 0 bytes out - OutObject<0,0>'),
('nn::am::service::IOverlayFunctions', 0, '0 bytes in - 0 bytes out'),
('nn::am::service::IOverlayFunctions', 1, '0 bytes in - 0 bytes out'),
('nn::am::service::IOverlayFunctions', 2, '0... | |
<gh_stars>0
# 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... | |
<reponame>mayc2/PseudoKnot_research
# ==============================================================================
# ==============================================================================
# ht_sampling.py ===============================================================
#
# Parses output from SFold. Then carrie... | |
import os
import logging
import tempfile
import rasterio
import whitebox
import yaml
import numpy as np
import geopandas as gpd
import cerf.package_data as pkg
from rasterio import features
from cerf.utils import suppress_callback
# instantiate whitebox toolset
wbt = whitebox.WhiteboxTools()
class Interconnecti... | |
"""
This File contains Pythons Program related to List, Questiona take from Geeks of Geeks.
Some Libraries are imported before all the Programs Please check them before trying any program
"""
#Creating some inputs for testing
L1 = [12, 35, 9, 56, 24]
L2 = [1, 2, 3]
L3 = [10,20,30,40,50]
L4 = [2,3,7,13,17,23]
L5 = [-1,1... | |
<reponame>zuoziji/transaction
# -*- coding: utf-8 -*-
"""
1)根据 wind_code 获取净值记录,调整成 return rate 生成csv文件
2)调用 fhs_garch.R,返回对应压力测试 csv文件
3)读取压力测试文件,进行整个
"""
from rpy2 import robjects
from os import path
import matplotlib.pyplot as plt # pycharm 需要通过现实调用 plt.show 才能显示plot
from itertools import product
import nu... | |
<reponame>alitalia598/mssdk
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2021/5/4 15:58
Desc: 交易所网站获取期货日线行情
"""
import datetime
import json
import re
import warnings
import zipfile
from io import BytesIO, StringIO
import numpy as np
import pandas as pd
import requests
from mssdk.futures import cons
from mss... | |
#!/usr/bin/python2.7
"""
Copyright (c) 2014, ICFLIX Media FZ LLC All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Desc: Generate Nagios configuration from given file, resp. from check_multi.
"""
import logging
import logging.handlers
import json
imp... | |
<reponame>TugberkArkose/MLScheduler
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dyna... | |
True},
'system_data': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'etag': {'key': 'etag', 'type': 'str'},
... | |
15.149, 15.150, 15.151, 15.152, 15.153, 15.154, 15.155, 15.156, 15.157,
15.158, 15.159, 15.160, 15.161, 15.162, 15.163, 15.164, 15.165, 15.166, 15.167, 15.168,
15.169, 15.170, 15.171, 15.172, 15.173, 15.174, 15.175, 15.176, 15.177, 15.178, 15.179,
15.180, 15.181, 15.182, 15.183, 15.184, 15.185, 15.186, 15.187, 15.18... | |
that will be pushed onto the name stack.
:type name: unsigned int
'''
pass
def glRasterPos(x, y, z, w):
'''Specify the raster position for pixel operations
:param w: Specify the x,y,z, and w object coordinates (if present) for the raster position. If function prototype ends in ‘v’ specifies a pointer to an a... | |
import datetime as dt
import operator
import random
import arrow
import blazeutils.strings
import pytz
import six
import sqlalchemy as sa
import wrapt
from blazeutils import tolist
from keg.db import db
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy_utils import ArrowType, EmailType
import keg_elem... | |
#!/usr/bin/env python3
"""
RESOURCE MANAGEMENT - POLICIES MODULE
Area Resilience - Keep always a Leader in the area!
"""
import threading
import requests
import socket
from time import sleep
from random import randrange
from common.logs import LOG
from common.common import CPARAMS, URLS
from policies.leaderprotec... | |
<filename>nitorch/nn/experimental/_affine.py
import torch
import torch.nn as tnn
from ..modules.base import Module
from ..modules.cnn import UNet, CNN
from ..modules.spatial import GridPull, GridExp, GridResize, AffineGrid, \
AffineExp, AffineLog, AffineClassic, \
AffineClassicInverse
from .. import check
from nitorc... | |
hits=self.hits,
hits_index=self.hits_index,
last_completed_m26_frame_ids=self.last_completed_m26_frame_ids,
timing_offset=self.timing_offset,
build_all_events=build_all_events,
analyze_m26_header_ids=self.analyze_m26_header_ids,
plane_id_to_index=self.plane_id_to_index)
# Create a copy of the hits array that is ... | |
import random
from modules import scorecard
from modules.commentary import scoreRun
from modules.scoreinput import playBall
from modules.batterchoice import batterChoice
from modules.bowlerchoice import fieldChoice
# First Innings - Main code
# team_1_array : Array containing name of all players in the first team
# ... | |
import datetime as dt
import numbers
from functools import cached_property, partial
from typing import List, Sequence, Union
import numpy as np
import pandas as pd
from . import algo, constants, DateUtils, utils
from .config import get_db_interface
from .DBInterface import DBInterface
from .utils import TickerSelecto... | |
= None
try:
dev = DeviceProxy(dev_name)
except:
self.tango_dev_channels_in_error += 1
tg_dev_chs[dev_name] = dev_data = [dev, CaselessDict()]
dev, attr_data = dev_data
attr_data[attr_name] = channel_data
# get attribute configuration
attr_info = None
if dev is None:
self.tango_channels_info_in_error += 1
e... | |
<filename>SLU/fairseq/fairseq/tasks/TArCMultiTask.py
# Code for MultiTask TArC annotation/collection
import os
import re
import sys
import csv
import glob
import torch
from fairseq.tarc_utils import *
from fairseq.data import Dictionary, TarcMultiTaskDataset
from fairseq.tasks import FairseqTask, register_task
from ... | |
copy=False),
pad_width_by_index,
mode=mode,
**pad_option_kwargs,
)
return type(self)(self.dims, array)
def _roll_one_dim(self, dim, count):
axis = self.get_axis_num(dim)
count %= self.shape[axis]
if count != 0:
indices = [slice(-count, None), slice(None, -count)]
else:
indices = [slice(None)]
arrays = ... | |
ac.showCalltipsForce
@cmd('show-calltips-force')
def showCalltipsForce(self, event=None):
'''Show the calltips at the cursor, even if calltips are not presently enabled.'''
return self.showCalltips(event, force=True)
#@+node:ekr.20061031131434.15: *4* ac.showAutocompleter/CalltipsStatus
def showAutocompleterStatu... | |
* self.t)
Y2 += 0.00000000007 * math.cos(0.56178116893 + 69160.04624808849 * self.t)
Y2 += 0.00000000009 * math.cos(4.89006567905 + 7994.77225950771 * self.t)
Y2 += 0.00000000009 * math.cos(1.87204677749 + 73711.99974514729 * self.t)
Y2 += 0.00000000008 * math.cos(6.11573252209 + 59414.7256922319 * self.t)
Y2 += 0... | |
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.210273,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime ... | |
"""
recipestr1 = """
class TestApplyMacrosSource(PackageRecipe):
name = 'tmpwatch'
version = '2.9.0'
clearBuildReqs()
def cleanup(r, builddir, destdir):
pass
def setup(r):
# avoid cleanup
r.macros.sourcemacros = 'source-apply-macros'
r.addSource('myfile', contents="%(sourcemacros)s %(destdir)s",
macros=T... | |
using re.match(). If a match is found, the "read" event is not logged.
LOG_IGNORE_USER_AGENT = []
LOG_IGNORE_IP_ADDRESS = []
LOG_IGNORE_SUBJECT = []
# Ignore "read" events for DataONE trusted subjects.
# True (default):
# - "read" events are not logged in requests made by subjects which are in the
# DATAONE_TRUSTED_SU... | |
import bpy
from bpy_extras import view3d_utils
from .functions_drawing import *
from .functions_modal import *
from .classes import *
def basic_ui_hover_keymap(self, context, event):
status = {'RUNNING_MODAL'}
# test hover panels
if event.type == 'MOUSEMOVE' and self.click_hold == False:
hov_status =... | |
<filename>desktop/core/ext-py/openpyxl-2.6.4/openpyxl/styles/builtins.py
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
# Builtins styles as defined in Part 4 Annex G.2
from .named_styles import NamedStyle
from openpyxl.xml.functions import fromstring
normal = """
<namedStyle builtinId="... | |
= True
inside &= (theta[0]>=grid.minage and theta[0]<=grid.maxage)
inside &= (theta[1]>=grid.minmetal and theta[1]<=grid.maxmetal)
# no distmod limits
inside &= (theta[3]>=0)
if inside:
return 0.0
return -np.inf
def emcee_lnprob(theta, x, y, yerr, grid, isonames, fixpars, fixparvals):
"""
This helper functio... | |
# Copyright 2020-present, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
best_args = {'perm-mnist': {
'sgd': {-1: {'lr': 0.2, 'batch_size': 128, 'n_epochs': 1}},
'ewc_on': {-1: {'lr... | |
iter <= max_iter:
#step 1, parallel
b_0 = -Phi - Theta + nu * (W_i_h + W_i_t)
for t in range(T):
ind = np.ravel_multi_index((i,t),(N,T))
b = USP[(i,t,ll)] + b_0[:,t]
if not big_data:
W_i[:,t] = np.dot(A_inv[ind], b)
else:
tmp = A_inv[str(i) + '/' + str(t)]
W_i[:,t] = np.dot(tmp, b)
#step 2
W_i_t = np.... | |
"""
@author: <NAME> "Mayou36"
DEPRECEATED! USE OTHER MODULES LIKE rd.data, rd.ml, rd.reweight, rd.score and rd.stat
DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!
Contains several tools to convert, load, save and plot data
"""
import warnings
import os
import copy
import pandas as pd
import numpy... | |
0.00000183 0.00000157
0.9999727 0. 0.00001186 0. ]
[0.00722851 0.01526725 0.43565944 0.53661335 0.000001 0.00006741
0.00000368 0.00106217 0.00325301 0.00084417]
[0.00000036 0.0000674 0.00041761 0.00037681 0.9802423 0.00182406
0.00046407 0.00000784 0.00130148 0.01529808]
[0.00000001 0. 0.00000001 0.00000141 0.0000... | |
iterator like instance of Product
:rtype: ~paging.models.ProductPaged[~paging.models.Product]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
def prepare_request(next_link=None):
if not next_link:
# Construct URL
url = self.get_multiple_pages_retry_second.metadata['url']
# Construct p... | |
Array),
BinaryExpression(Control, Keyword('lnbdata'), Array, String),
BinaryExpression(Control, Keyword('lnbdeletecolumn'), Number, Nothing),
BinaryExpression(Control, Keyword('lnbdeleterow'), Number, Nothing),
BinaryExpression(Control, Keyword('lnbpicture'), Array, String),
BinaryExpression(Control, Keyword('lnbp... | |
<gh_stars>1-10
# Copyright 2013 by <NAME> (<EMAIL>).
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code for dealing with Codon Seq.
CodonSeq class is interited from Seq cla... | |
<reponame>atten/django-docker-helpers
import inspect
import logging
import os
import textwrap
import typing as t
from collections import deque, namedtuple
from pprint import pformat
from django_docker_helpers.utils import import_from, shred, wf, run_env_once
from . import exceptions
from .backends import *
DEFAULT_PA... | |
= self.request.config.getini("pytester_example_dir")
if example_dir is None:
raise ValueError("pytester_example_dir is unset, can't copy examples")
example_dir = self.request.config.rootdir.join(example_dir)
for extra_element in self.request.node.iter_markers("pytester_example_path"):
assert extra_element.args
e... | |
# coding=utf-8
import pytest
from django.test import TestCase, RequestFactory, Client
from django.utils import timezone
from django.urls import reverse
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.contrib.contenttypes.models import ContentType
from mock imp... | |
<filename>script_tools/parse_script.py<gh_stars>1-10
"""
This module parses a script and places all of the lines, episodes, characters, and scenes into the appropriate classes.
Author: <NAME>
"""
from containers.episode import Episode
from containers.line import Line
from containers.scene import Scene
from typing im... | |
<filename>airtable/airtable.py
# -*- coding: utf-8 -*-
"""Python Airtable Client Library
This is an Airtable client library for python.
This library has wrapped what is provided functions by Airtable API.
When you use this library, you are able to easy implements Airtable's operations.
Thereby, you are able to down a ... | |
(JJ suitable) (NNS '
'accommodations)))))))) (. .)))',
'pos_tags': ['IN',
'DT',
'NN',
',',
'PRP',
'VBP',
'JJ',
'PRP',
'MD',
'VB',
'PRP',
'JJ',
'NNS',
'.'],
'text': "In the meantime, I'm sure we could find you suitable "
'accommodations.',
'tokens': ['In',
'the',
'meantime',
','... | |
find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
self.id = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'Action_Reference':
obj_ = cybox_core.ActionReferenceType.factory()
obj_.build(child_)
self.Acti... | |
in the list.")
facet_chain = [end_facets[-1]]
other_facets = chain_facets.copy()
other_facets.remove(facet_chain[0])
for i in range(len(other_facets)):
options = []
for facet in other_facets:
# See if the facet connects to the last facet in the chain
if len(set(facet.sites) & set(facet_chain[-1].sites)) ==... | |
<filename>test/unit/test_comparer.py
# -*- coding: utf-8 -*-
import pytest
from unittest.mock import Mock, patch, call
from sqlalchemydiff.comparer import (
_compile_errors,
_diff_dicts,
_discard_ignores,
_discard_ignores_by_name,
_get_columns,
_get_columns_info,
_get_common_tables,
_get_foreign_keys,
_get_f... | |
still be fine. By disabling automatic Windows updates you will have
greater control of when that happens.
Would you like to disable automatic Windows updates?
''' ),
buttons=[
('Disable', 1),
('Skip', 2),
('Quit', False)
]
).run()
if result == 2:
return True
if not result:
return result
# Based on Debloa... | |
chromophore to a particular position and orientation
from pymol import cmd
cmd.translate(vector=phenolCOMPosition, selection=selection)
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
def generateRando... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 <NAME> <<EMAIL>>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, thi... | |
return
coef, cov = curve_fit(fun3, x_p, y_nm)
sigma_p = np.sqrt(np.diag(cov))
text = 'Y(nm) = %.3Ex%s+%.3Ex%s+%.7fx+%.4f'
cali_formula = text%(coef[0],s3,coef[1],s2,coef[2],coef[3])
self.results.setText(cali_formula)
text_p = 'Y(nm) = %.3Ex$^3$+%.3Ex$^2$+%.7fx+%.4f'
text_plot = text_p%(coef[0],coef[1... | |
# Copyright 2019, The TensorFlow 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 required by applicable... | |
return isinstance(self.inner, IDLInterface) or \
isinstance(self.inner, IDLExternalInterface)
def isCallbackInterface(self):
return self.isInterface() and self.inner.isCallback()
def isNonCallbackInterface(self):
return self.isInterface() and not self.inner.isCallback()
def isEnum(self):
return isinstance(sel... | |
0.5], [1, 1], [0.5, 0.5], [0, 0]]))
def test_Polygon_to_shapely_polygon():
exterior = [(0, 0), (1, 0), (1, 1), (0, 1)]
poly = ia.Polygon(exterior)
poly_shapely = poly.to_shapely_polygon()
for (x_exp, y_exp), (x_obs, y_obs) in zip(exterior, poly_shapely.exterior.coords):
assert x_exp - 1e-8 < x_obs < x_exp + 1e-8... | |
----------
single_layer : integer or None
If not None, all polygons will be transfered to the
layer indicated by this number.
single_datatype : integer or None
If not None, all polygons will be transfered to the
datatype indicated by this number.
single_datatype : integer or None
If not None, all labels will be... | |
= QtGui.QFont()
font.setFamily("Arial")
font.setWeight(75)
font.setBold(True)
self.labelRef_ManEditImage.setFont(font)
self.labelRef_ManEditImage.setObjectName("labelRef_ManEditImage")
self.gridLayout_3.addWidget(self.labelRef_ManEditImage, 0, 5, 1, 1)
spacerItem10 = QtGui.QSpacerItem(138, 20, QtGui.QSizePolicy.... | |
<gh_stars>1-10
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import sys
import llnl.util.tty as tty
class Hdf5(CMakePackage):
"""HDF5 is a d... | |
"""
Working with PSID in python
@author : <NAME> <<EMAIL>>
@date : 2015-02-04 09:02:56
use the read_csv option `usecols` to only keep what we need
"""
import re
import os
import gc
import os.path
import zipfile
import requests
import lxml.html
import numpy as np
import pandas as pd
# ----------- #
# Downloading #
... | |
def LogError(self, *args): return _pysmile_impl.DSL_errorStringHandler_LogError(self, *args)
def GetError(self, *args): return _pysmile_impl.DSL_errorStringHandler_GetError(self, *args)
def GetLastError(self): return _pysmile_impl.DSL_errorStringHandler_GetLastError(self)
def GetErrorMessage(self, *args): return _py... | |
<reponame>wcastello/splunk-sdk-python<gh_stars>1-10
#!/usr/bin/env python
# coding=utf-8
#
# Copyright 2011-2015 Splunk, 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.ap... | |
1)
invoked_bulk.pop()
logger.info("Querying VNs by obj_uuids for children+backref fields.")
ret_objs = self._vnc_lib.resource_list('virtual-network',
detail=True, obj_uuids=vn_uuids, fields=['routing_instances',
'virtual_machine_interface_back_refs'])
self.assertEqual(len(invoked_bulk), 1)
invoked_bulk.pop()
... | |
<filename>article_separation/baseline_clustering/dbscan_baselines.py
# -*- coding: utf-8 -*-
""" DBSCAN based on <NAME> "https://github.com/chrisjmccormick/dbscan" """
import math
import jpype
import collections
import numpy as np
from python_util.geometry.rectangle import Rectangle
from python_util.geometry.util imp... | |
alpha,
np.uint8)
else:
if self._imcache is None:
self._imcache = self.to_rgba(A, bytes=True, norm=(A.ndim == 2))
output = self._imcache
# Subset the input image to only the part that will be
# displayed
subset = TransformedBbox(clip_bbox, t0.inverted()).frozen()
output = output[
int(max(subset.y... | |
= self.get_trigger_sha_and_repo(job_id)
gradle9 = self.dispatcher.analyze(file_path, job_id,
trigger_sha=trigger_sha, repo=repo)
self.compare_status(gradle9, 'broken')
self.compare_analyzer(gradle9, 'java-gradle')
self.compare_num_t_run(gradle9, 1544)
self.compare_num_t_ok(gradle9, 1543)
self.compare_num_t_faile... | |
o.website:
properties["web"] = o.website
n = f.req_site_needs
if n:
if n.needs:
needs = json.loads(n.needs)
if "urgent" in needs:
properties["urgent"] = needs["urgent"]
if "need" in needs:
properties["need"] = needs["need"]
if "no" in needs:
properties["no"] = needs["no"]
f = dict(type = "Feature",
propert... | |
import json
import signal
import Queue
from ironsource.atom.ironsource_atom import IronSourceAtom
from ironsource.atom.queue_event_storage import QueueEventStorage
from ironsource.atom.batch_event_pool import BatchEventPool
from ironsource.atom.event import Event
import ironsource.atom.atom_logger as logger
import iron... | |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.backends.backend_pdf import PdfPages
"""
Notes for future:
You set up the basic elements of a curve, but not everything
is truly automated. Need to:
1. Automate Coordinates o... | |
BeamNG execution")
ax2.set_xticklabels(['values '], rotation="0")
ax2.set_ylabel("time in seconds")
extent_2 = self.full_extent(ax2).transformed(fig.dpi_scale_trans.inverted())
fig.savefig(self.output_folder + '{}_crisce_beamng_efficiency.jpg'.format(self.process_number), bbox_inches=extent_2)
# If you don't do t... | |
<reponame>nicholasadamou/python-proxy<filename>venv/lib/python3.7/site-packages/scapy/contrib/diameter.py<gh_stars>0
##########################################################################
#
# Diameter protocol implementation for Scapy
# Original Author: <NAME>
#
# This implements the base Diameter protocol RFC6733 ... | |
<filename>raredecay/tools/data_storage.py
"""
@author: <NAME> "Mayou36"
DEPRECEATED! USE OTHER MODULES LIKE rd.data, rd.ml, rd.reweight, rd.score and rd.stat
DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!
This module contains the data handling. The main part is the class which
takes data, weights, t... | |
<filename>testnet/prolog/interpreter/arithmetic.py
import py
import math
from prolog.interpreter.parsing import TermBuilder
from prolog.interpreter import helper, term, error
from prolog.interpreter.signature import Signature
from prolog.interpreter.error import UnificationFailed
from rpython.rlib.rarithmetic import in... | |
<filename>museum_site/file.py
import hashlib
import io
import os
import subprocess
import zipfile
from datetime import datetime
from random import randint, seed, shuffle
from django.db import models
from django.db.models import Avg, Q
from django.template.defaultfilters import date, filesizeformat
try:
import zooke... | |
rather than the letter grade.
"pass/complete/fail/incomplete":: A string value of "pass" or "complete"
will give a score of 100%. "fail" or "incomplete" will give a score of
0.
Note that assignments with grading_type of "pass_fail" can only be
assigned a score of 0 or assignment.points_possible, nothing inbetween... | |
<gh_stars>1-10
''' A base point spread function interface
'''
import numpy as np
from scipy import interpolate
from scipy.special import j1
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1.axes_rgb import make_rgb_axes
from prysm.conf import config
from prysm.mathops import pi, fft2, ifft2, fftshift... | |
from __future__ import division
from collections import Counter, defaultdict
import os
from random import shuffle
import tensorflow as tf
import pickle
import os.path
import numpy as np
import collections
import math
import numpy
from pathlib import Path
SUCCESS_HEADER = 'S_'
class NotTrainedError(Exception):
pass
... | |
399 2 1 398 400
1 400 0 0
1 401 2 1 402 403
1 402 2 1 401 403
1 403 0 0
1 404 2 1 405 406
1 405 2 1 404 406
1 406 0 0
1 407 2 1 408 409
1 408 2 1 407 409
1 409 0 0
1 410 2 1 411 412
1 411 2 1 410 412
1 412 0 0
1 413 2 1 414 415
1 414 2 1 413 415
1 415 0 0
1 416 2 1 417 418
1 417 2 1 416 418
1 418 0 0
1 419 2 1 420 421
... | |
61
1 741 1 0 89
1 741 1 0 117
1 741 1 0 145
1 742 1 0 23
1 742 1 0 40
1 742 1 0 65
1 742 1 0 93
1 742 1 0 121
1 742 1 0 149
1 743 1 0 27
1 743 1 0 44
1 743 1 0 69
1 743 1 0 97
1 743 1 0 125
1 743 1 0 153
1 744 1 0 30
1 744 1 0 48
1 744 1 0 73
1 744 1 0 101
1 744 1 0 129
1 744 1 0 157
1 745 1 0 33
1 745 1 0 52
1 745 1 0... | |
<filename>simulator_control/simulator_util.py
# Copyright 2017 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | |
'left'
delete_old : bool
Whether to delete the old column (``X[left_on]``)
Default = True
Examples
--------
TODO
"""
def __init__(self, df, left_on, right_on, how='left', delete_old=True):
# Check types
if not isinstance(df, pd.DataFrame):
raise TypeError('df must be a pandas DataFrame')
if not isinst... | |
<reponame>mikedh/kinematic
"""
kinematic.py
--------------
PROTOTYPE for support for rigid body kinematics. Not sure if
supporting this is something that is feasible or desirable for trimesh,
this is just exploring what it might look like. If this improves, it
could feasibly live as `trimesh.kinematic`.
Challenge: cr... | |
<filename>build/lib/tracc/tracc.py
import tracc
import pandas as pd
import numpy as np
class costs:
def __init__(self,
travelcosts_df,
columns = None
):
"""
Inputs data and prunes columns if desired
"""
if columns is not None:
self.data = travelcosts_df[columns]
else:
self.data = travelcosts_df
def ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.