input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
expected = DateTime(2018, 10, 1, 12, 34, 56, 123456789,
tzinfo=FixedOffset(754))
actual = DateTime.from_iso_format("2018-10-01T12:34:56.123456789+12:34:56.123456")
assert expected == actual
def test_from_iso_format_with_negative_long_tz(self):
expected = DateTime(2018, 10, 1, 12, 34, 56, 123456789,
tzinfo=FixedO... | |
1 0 0 0 0]
[0 0 0 0 0 0 0 0 0 1]
"""
return self._differential.cohomology(n)
def cohomology_generators(self, max_degree):
"""
Return lifts of algebra generators for cohomology in degrees at
most ``max_degree``.
INPUT:
- ``max_degree`` -- integer
OUTPUT:
A dictionary keyed by degree, where the correspond... | |
3 (which is not given in a d-gridded form)
R = zeros(m)
n = m*(mu_d-nu_d+1)
Matr = zeros(n,m+1)
Matr[:,1:] = E
T = zeros(n,m+1)
for i in range(E.cols):
T[:,0] = M*E[:,i]
N1 = (T+Matr).nullspace()
N2 = N1[0] #donne une matrice colonne
N2norm = 1/N2[0,0]*N2
coeff = - N2norm[1:,0]
R[:,i] = coeff
return R
... | |
import datetime
import functools
import json
import multiprocessing
import os
import sys
import tkinter as tk
from pathlib import Path
from tkinter import ttk, messagebox, filedialog
import keyboard
import win32api
import win32event
import winerror
from TextSpitter import TextSpitter
from tkdocviewer im... | |
import os
import shutil
import pytest
from freezegun import freeze_time
from great_expectations import DataContext
from great_expectations.core import RunIdentifier
from great_expectations.data_context.store import ExpectationsStore, ValidationsStore
from great_expectations.data_context.types.resource_identifiers imp... | |
[]
temp.append(region.exterior.coords[index][1])
temp.append(region.exterior.coords[index][0])
region_coords.append(temp)
index += 1
# to plot point's coordinates over the map as polygon
region_plot = folium.Polygon(locations=region_coords,
color=region_color, popup=label)
region_map.add_child(region_plot)
... | |
'verbose_name_plural': '09 Gedung Sosial',
},
bases=('gedungbangunan.gedungbangunan',),
),
migrations.CreateModel(
name='GedungBangunanTebingTinggi',
fields=[
],
options={
'verbose_name': '38 Gedung Tebing Tinggi',
'proxy': True,
'verbose_name_plural': '38 Gedung Tebing Tinggi',
},
bases=('gedungbangunan.g... | |
@param arraylen: many bools will there be? FIX: handle variable
@type unavailable: bool or None
@param unavailable: the default value to use if none given (if not None)
@type bv: str
@param bv: BitVector containing the incoming data
@type dataDict: str
@param dataDict: dictionary in which to place the results
@t... | |
import argparse
import logging
import os
import re
import sys
import traceback
from datetime import datetime
from pathlib import Path
from .bamCLIP import bamCLIP
from .countCLIP import countCLIP
from .createMatrix import MatrixConverter
from .gffCLIP import FeatureOrderException, gffCLIP
'''
-----------------------... | |
over-write because img_metas are needed as inputs for bbox_head.
def forward_train(self,
x,
img_metas,
gt_bboxes,
gt_labels=None,
gt_keypoints=None,
gt_areas=None,
gt_bboxes_ignore=None,
proposal_cfg=None,
**kwargs):
"""Forward function for training mode.
Args:
x (list[Tensor]): Features from backbone.
i... | |
price=price['Caustics'])
# =============================================================================
# Wastewater treatment units
# =============================================================================
# Mix waste liquids for treatment
M501 = bst.units.Mixer('M501', ins=(
S403-1,
# AC401-0,
# S4... | |
= "#a9f971"
#~ GR_color_fit = "#ed0dd9"
GR_color_fit = self._luminosity_color(GR_color_markers, 1.1)
plot_alpha = 0.6
#~ lets plot severEOSs on the up plot and eventually cut out data
for label, data, eos in zip( all_label, all_data, severalEOSs ):
#~ we set mimimal compactenss threshold and cut out all entrie... | |
row.
builder.insert_cell()
builder.write("Row 2, Cell 1 Content")
# Build the second cell.
builder.insert_cell()
builder.write("Row 2, Cell 2 Content.")
builder.end_row()
# Signal that we have finished building the table.
builder.end_table()
doc.save(ARTIFACTS_DIR + "WorkingWithTables.create_sim... | |
<gh_stars>10-100
from nose import SkipTest
from nose.tools import assert_less_equal, assert_almost_equal, assert_equal
from numpy.ma.testutils import assert_close
from numpy.testing.utils import assert_allclose
from kernel_exp_family.estimators.finite.develop.gaussian import compute_b_memory, \
compute_C_memory, _obj... | |
The axes
are temporarily set to values appropriate for the spectrogram, then the
new background (containing the plotted spectrogram) is grabbed and axes
are restored to a scale appropriate for all Track related features.
TODO -- look into automatic zero-padding to fix scaling issues?
TODO -- condense restart bran... | |
# flowbyfunctions.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
"""
Helper functions for flowbyactivity and flowbysector data
"""
import pandas as pd
import numpy as np
from esupy.dqi import get_weighted_average
import flowsa
from flowsa.common import fbs_activity_fields, sector_level_key, \
load_crosswalk, fbs_... | |
Lord Greatsword+4",
314405: "Great Lord Greatsword+5",
314500: "Great Lord Greatsword",
314501: "Great Lord Greatsword+1",
314502: "Great Lord Greatsword+2",
314503: "Great Lord Greatsword+3",
314504: "Great Lord Greatsword+4",
314505: "Great Lord Greatsword+5",
314600: "Great Lord Greatsword",
314601... | |
'''
Created on 27 févr. 2022
@author: slinux
'''
import threading
import logging
import wx
import time
from wxRavenGUI.application.wxcustom import *
import secrets
import math
from multiprocessing import Process
from threading import Thread, Lock
import ctypes
#
#
# Plugin Job is a class for WxRaven JobManager that ... | |
<filename>code/mqsubmit.py
#!/usr/bin/python
"""
mqsubmit.py: submits a maxquant job to the cloud based automation pipeline
"""
import os
import optparse
import random
import re
import sys
import time
import boto3
import botocore
import xml.etree.ElementTree as ET
def adjustConfig(mqconfig, mqdir, mqparams):
"""
Ta... | |
<filename>TESTDPP.py
import argparse
import baselineUtils
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import os
import time
from transformer.batch import subsequent_mask
from torch.optim import Adam,SGD,RMSprop,Adagrad
from transformer.noam_opt import NoamOpt
import numpy ... | |
<reponame>benoitc/pypy<gh_stars>1-10
from pypy.objspace.std.model import registerimplementation, W_Object
from pypy.objspace.std.register_all import register_all
from pypy.objspace.std.multimethod import FailedToImplement
from pypy.interpreter.error import OperationError, operationerrfmt
from pypy.interpreter import ga... | |
# -*- coding: utf-8 -*-
"""
Utility functions for welly.
:copyright: 2016 Agile Geoscience
:license: Apache 2.0
"""
from __future__ import division
import re
import glob
import numpy as np
import matplotlib.pyplot as plt
def deprecated(instructions):
"""
Flags a method as deprecated. This decorator can be used t... | |
= True
elif info[1] == 0:
if tpflag and info[0]<sc:
tpflag = False
fp += 1
if tpflag and (not(info[0]<sc)):
pr[ix-1,1] = fp
indexlist = []
if self.eval_method == apMethod.interp11:
N = 11
P = 10.0
indexlist = [0]
elif self.eval_method == apMethod.interp40:
N = 40
P = N
elif self.eval_method == apMethod.... | |
<reponame>ericphanson/arxiv-search
import os
import json
import time
import pickle
import argparse
import dateutil.parser
from dateutil.tz import tzutc
from datetime import datetime, timedelta
from pytz import timezone
import copy
from random import shuffle, randrange, uniform
from flask.json import jsonify
from sqli... | |
3},
'Putnam': {'pop': 21218, 'tracts': 5},
'Quitman': {'pop': 2513, 'tracts': 1},
'Rabun': {'pop': 16276, 'tracts': 5},
'Randolph': {'pop': 7719, 'tracts': 2},
'Richmond': {'pop': 200549, 'tracts': 47},
'Rockdale': {'pop': 85215, 'tracts': 15},
'Schley': {'pop': 5010, 'tracts': 2},
'Screven': {'pop': 14... | |
# -*- coding: utf-8 -*-
import os
import time
import numpy as np
from pathlib import Path
import h5py
from tqdm import tqdm
class H5DataSet:
"""
Represents an abstract HDF5 dataset.
This class allows the user to read headers and sensor data from hdf5 files
into numpy arrays.
Input params:
"""
def __init__(se... | |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | |
<gh_stars>0
import torch
import torch.nn.functional as F
import math
import numpy as np
from numpy.random import randn
from models.utils.kronecker import sylvester
from models.utils.cholesky import per_batch_cholesky
from models.utils.plotting import plot_confidence
from pytorch_lightning import seed_everything, Lig... | |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | |
5634195.507417285,
6253461.142118783, 11.538003087103846, 0.015129553230613428, 1.646211033468178e-06],
[1115.400748739093, 1265.5877782356972, 1428.3010571928912, 2714079.301423972, 5048177.206187649,
6403353.83122605, 11.579324789874297, 0.015321153721496901, 1.6447615608703846e-06],
[1165.0546070424907, 1263.903... | |
<reponame>Mehul343/discord.py-self<gh_stars>0
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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 li... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.27338,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 9.20538,
'Su... | |
last_batch = self.key_value
self.list_docs = list(self.__chunks(self.all_keys, Atomicity.num_docs))
for op_type in self.op_type:
if op_type == "create":
if len(self.op_type) != 1:
commit = True
else:
commit = self.commit
docs = list(self.__chunks(docs, Atomicity.num_docs))
for doc in docs:
err = Transaction... | |
<reponame>shreeram0206/structure_demo<filename>src/models/layers.py
"""
Mask R-CNN
The main Mask R-CNN model implementation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import os
import random
import datetime
import re
import math
import logging
fr... | |
<gh_stars>0
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 Dynamic': 0.0,
'Runtime Dyn... | |
"en yaXama ": -2099, " baXinda ": -2100, "ken Xen ": -2101, " Xiklik ": 2102,
"vara aX": -2103, "kdire X": 2104, "n Xutu ": 2105, "n aXild": 2106, "sel ekX": 2107,
"yol Xu ": -2108, "len Xu ": -2109, "m yarIX": 2110, "Xuheyd": 2111, "Xakaci": 2112,
"boXta ": 2113, "ton Xu": -2114, "Xilili": 2115, "Ximsir": 2116, " a... | |
<gh_stars>1-10
import sys
import numpy as np
from sira.modelling.component_graph import ComponentGraph
from sira.modelling.iodict import IODict
from sira.modelling.structural import Base, Element
np.set_printoptions(threshold=sys.maxsize)
class InfrastructureFactory(object):
@staticmethod
def create_model(config)... | |
<filename>orig_main.py
import datetime
import time
import json
import os
import yaml
import threading
from fastapi import FastAPI, Request, Query
from fastapi.templating import Jinja2Templates
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import ... | |
pred) in enumerate(zip(LFC_mats, self.predict())):
resids = LFC_data - pred
CL_noise_var = np.nanvar(resids, axis = 0)
CL_tot_var = np.nanvar(LFC_data, axis = 0)
CL_R2 = 1 - CL_noise_var / CL_tot_var
self.CL_R2_df = pd.concat([self.CL_R2_df,
pd.DataFrame({'CCLE_ID': LFC_data.columns.values,
'batch_id': np.one... | |
nao = mol.nao
lmax = pcmobj.lmax
nlm = (lmax+1)**2
atom_coords = mol.atom_coords()
atom_charges = mol.atom_charges()
grids = pcmobj.grids
extern_point_idx = ui > 0
cav_coords = (atom_coords.reshape(natm,1,3)
+ numpy.einsum('r,gx->rgx', r_vdw, coords_1sph))
cav_coords = cav_coords[extern_point_idx]
int3c2e ... | |
# 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... | |
<reponame>MateuszDabrowski/elquent
#!/usr/bin/env python3.6
# -*- coding: utf8 -*-
'''
ELQuent.campaign
Campaign generator utilizing other modules
<NAME>
github.com/MateuszDabrowski
linkedin.com/in/mateusz-dabrowski-marketing/
'''
# Python imports
import os
import re
import sys
import json
import pyperclip
from colo... | |
import numpy as np
import configparser
import json
from datetime import datetime
from datetime import timedelta
import os
import logging
import pyvisa
from pydlcp import arduino_board, hotplate, errors, keithley, impedance_analyzer as ia, datastorage, bts
from apscheduler.schedulers.background import BackgroundSchedule... | |
from template import Template
from template.test import TestCase, main
class Foo:
def __init__(self, **kwargs):
self.__dict = kwargs
def present(self, view):
return "{ %s }" % ", ".join(
"%s => %s" % item for item in sorted(self.__dict.items()))
def reverse(self, view):
return "{ %s }" % ", ".join(
"%s => %... | |
Schedule Name`
Raises:
ValueError: if `value` is not a valid value
Returns:
str: the value of `availability_schedule_name` or None if not set
"""
return self["Availability Schedule Name"]
@availability_schedule_name.setter
def availability_schedule_name(self, value=None):
"""Corresponds to IDD field `Avail... | |
# -*- coding: utf-8 -*-
'''
Return the results of a highstate (or any other state function that returns
data in a compatible format) via an HTML email or HTML file.
.. versionadded:: 2017.7.0
Similar results can be achieved by using the smtp returner with a custom template,
except an attempt at writing such a templat... | |
Returns the metadata for the newly created file and a boolean indicating
whether the moved entity is completely new (``True``) or overwrote a previously-existing
file (``False``).
:param dest_provider: ( :class:`.BaseProvider` ) a provider instance for the destination
:param src_path: ( :class:`.WaterButlerPath` )... | |
#!/usr/bin/env python3
# Copyright 2018 The Chromium 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 script used to manage Google Maven dependencies for Chromium.
For each dependency in `build.gradle`:
- Download the library
-... | |
run in range(nruns):
# print(run)
# Copy the full graph
G_full = copy.deepcopy(G_full_orig)
G_full_cycles = nx.cycle_basis(G_full)
# Randomly remove edges from cycles until no more cycles remain
while len(G_full_cycles)>0:
next_cycle = G_full_cycles[0]
complete_next_cycle = tuple(next_cycle) + (next_cycle[0]... | |
def carrier_ip(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "carrier_ip", value)
@property
@pulumi.getter(name="customerOwnedIp")
def customer_owned_ip(self) -> Optional[pulumi.Input[str]]:
"""
Customer owned IP.
"""
return pulumi.get(self, "customer_owned_ip")
@customer_owned_ip.setter
def c... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 law o... | |
from big_ol_pile_of_manim_imports import *
from active_projects.quaternions import *
W_COLOR = YELLOW
I_COLOR = GREEN
J_COLOR = RED
K_COLOR = BLUE
class QuaternionLabel(VGroup):
CONFIG = {
"decimal_config": {}
}
def __init__(self, quat, **kwargs):
VGroup.__init__(self, **kwargs)
dkwargs = dict(self.decimal_co... | |
'94937000',
'94938005',
'94939002',
'94940000',
'94941001',
'94942008',
'94943003',
'94944009',
'94945005',
'94946006',
'94947002',
'94948007',
'94949004',
'94950004',
'94951000',
'94952007',
'94953002',
'94954008',
'94955009',
'94956005',
'94957001',
'94958006',
'94959003',
'94960008',
'9496100... | |
redo.save()
#I'm going to vandalise a book
conn = sqlite3.connect('storage.db')
c = conn.cursor()
c.execute("SELECT * FROM books WHERE username=? AND bookname=?", (username, bookname,))
r = c.fetchall()
#More changes to graph
if r[0][4] == "Y":
#Get owner's phone number
conn = sqlite3.connect('sto... | |
from datetime import datetime
import pytest
from click.testing import CliRunner
from mock.mock import patch
from ecs_deploy import cli
from ecs_deploy.cli import get_client, record_deployment
from ecs_deploy.ecs import EcsClient
from ecs_deploy.newrelic import Deployment, NewRelicDeploymentException
from tests.test_e... | |
else:
props[output_attr] = candidate.value
break
return None
def max_zoom_filter(ctx):
"""
For features with a max_zoom, remove them if it's < nominal zoom.
"""
params = _Params(ctx, 'max_zoom_filter')
layers = params.required('layers', typ=list)
nominal_zoom = ctx.nominal_zoom
for layer_name in layers:
... | |
# of mute_feedback_notifications and mute_suggestion_notifications
# should match the default values.
exploration_user_model = (
user_services.user_models.ExplorationUserDataModel.get(
user_id, exploration_id))
self.assertIsNone(exploration_user_model)
email_preferences = user_services.get_email_preferences_for_e... | |
)
params.bxy_channel = str(uuid4())
params.bxy_channel = uuid4()
with pytest.raises(TypeError) as excinfo:
params.bxy_channel = 4
assert all(
[s in str(excinfo.value) for s in ["bxy_channel", "type", "int", "str", "UUID"]]
)
def test_bxy_uncertainty():
params = MagneticScalarParams(
validate=True, validator... | |
"form-0-driver": "bill",
"form-0-restaurant": "thai",
# Same data as above: Forbidden because of unique_together!
"form-1-id": str(fd2.id),
"form-1-reference": "456",
"form-1-driver": "bill",
"form-1-restaurant": "thai",
# Same data also.
"form-2-id": str(fd3.id),
"form-2-reference": "789",
"form-2-driver":... | |
----------
# MAGIC %md
# MAGIC Let's take a look at the DataFrame's schema and some of its rows.
# COMMAND ----------
dataDF.printSchema()
# COMMAND ----------
# MAGIC %md
# MAGIC We can register the newly created DataFrame as a named table, using the `registerDataFrameAsTable()` method.
# COMMAND ----------
sql... | |
<reponame>leodengyx/LeoMuFundPicker
#!/usr/bin/python
from mutualfund import MutualFund
import logger
import urllib2
import urllib
import json
import types
from bs4 import BeautifulSoup
import re
import os
import sys
import threading
logger = logger.get_logger(__name__)
def thread_func(downloader, thread_id, expor... | |
<reponame>xPrithvi/Newsfeed<gh_stars>1-10
# Importing the Python modules, the dependencies of the application.
import random
import os
import sys
import json
import time
import urllib.request
import subprocess
from bs4 import BeautifulSoup
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
# Main a... | |
#
# Loxodo -- Password Safe V3 compatible Password Vault
# Copyright (C) 2008 <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 Software Foundation; either version 2
# of the License, or (at your op... | |
<reponame>BorgesGabo/gaia
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# -------------------------------------------------------------------------
# This is a sample controller
# - index is the default action of any application
# - user is required for authent... | |
<gh_stars>0
import datetime
import json
import logging
import time
from typing import Any, Dict, List, cast
from urllib.parse import urljoin
import requests
from dagster import (
EventMetadata,
Failure,
Field,
StringSource,
__version__,
check,
get_dagster_logger,
resource,
)
from dagster.utils.merger import de... | |
<gh_stars>1-10
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 ... | |
<reponame>l2ol33rt/salt
# -*- coding: utf-8 -*-
'''
Manage JBoss 7 Application Server via CLI interface
.. versionadded:: 2015.5.0
This state uses the jboss-cli.sh script from a JBoss or Wildfly installation and parses its output to determine the execution result.
In order to run each state, a jboss_config dictionar... | |
usersDB)
saveDB(bbConfig.bountyDBPath, bountiesDB)
saveDB(bbConfig.guildDBPath, guildsDB)
print(datetime.now().strftime("%H:%M:%S: Data saved manually!"))
await message.channel.send("saved!")
bbCommands.register("save", dev_cmd_save, isDev=True)
dmCommands.register("save", dev_cmd_save, isDev=True)
"""
develope... | |
<filename>train_ic15.py<gh_stars>10-100
import sys
import torch
import argparse
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import shutil
from torch.autograd import Variable
from torch.utils import data
import os
from dataset import IC15Loader
from metrics import runningScore
import model... | |
"""Core implementation of path-based import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public... | |
import base64
import binascii
import collections
import copy
import json
import logging
import os
import traceback
from abc import abstractmethod, ABCMeta
from typing import Tuple
import requests
import yaml
from cryptography.exceptions import InvalidTag
from cryptography.hazmat.backends import default_backend
from cr... | |
self.assertEqual(article.keywords(iso_format='iso 639-2'), None)
def test_keywords_without_subfield_k(self):
article = self.article
article.data['article']['v85'] = [{
u"i": u"1",
u"d": u"nd",
u"_": u"",
u"l": u"en"
}]
self.assertEqual(article.keywords(iso_format='iso 639-2'), None)
def test_keywords_with... | |
(TRUE ? low : high). lParam = PPBRANGE or NULL
PBM_GETPOS = (WM_USER+8)
PBM_SETBARCOLOR = (WM_USER+9) # lParam = bar color
PBM_SETBKCOLOR = CCM_SETBKCOLOR # lParam = bkColor
HOTKEYF_SHIFT = 1
HOTKEYF_CONTROL = 2
HOTKEYF_ALT = 4
HOTKEYF_EXT = 128
HOTKEYF_EXT = 8
HKCOMB_NONE = 1
HKCOMB_S = 2
HKCOMB_C = 4
HKCOMB_A = 8
HK... | |
self.createWindow()
self.p.sigTreeStateChanged.connect(self.change)
def closeEvent(self, event):
print 'Load custom matix: closing'
def okButtonFunct(self):
self.close()
def cancelButtonFunct(self):
self.close()
def createWindow(self):
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
##... | |
from factoratio.fuel import Burner, Fuel
from factoratio.item import Ingredient, Recipe
from factoratio.util import Joule, Watt
class Module():
"""A module for a Producer.
Modifies various aspects of the Producer's operation including energy
consumption, operation speed, productivity bonus, and pollution output.
... | |
thrift_spec = (
)
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
... | |
<gh_stars>0
import sys
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
import Levenshtein
import time
from tqdm import tqdm
import argparse
import yaml
from . import lineageGroup_utils as lg_utils
#import .lineageGroup_utils as lg_utils
# suppress w... | |
# Copyright 2018 MLBenchmark Group. 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 law o... | |
'U') : 'UL1',
(15, 78, 'R', 'B') : 'RB1',
(15, 78, 'R', 'D') : 'DR1',
(15, 78, 'R', 'F') : 'RF1',
(15, 78, 'R', 'U') : 'UR1',
(15, 78, 'U', 'B') : 'UB1',
(15, 78, 'U', 'F') : 'UF1',
(15, 78, 'U', 'L') : 'UL1',
(15, 78, 'U', 'R') : 'UR1',
(16, 29, 'B', 'D') : 'DB2',
(16, 29, 'B', 'L') : 'LB2',
(16, 29, 'B', '... | |
of the lines separating cells, by default 0
colour : str
The colour to use for the plot, by default None. If None, uses the
default colours.
time_ind : int, optional
In each experiment, the state update heatmap is stored at multiple
timesteps at certain intervals. This parameter controls which of the
update heat... | |
<filename>github_code/Discrete_GP_inv_1D_Burgers_equ_RK4.py
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 15 11:34:00 2019
@author: gpang
"""
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import time
#from SALib.sample import sobol_sequence
import scipy as sci
import s... | |
"""
Dataset Specification
Lookup information from the database about the data, particularly which files
are contained in a specific dataset (defined by a `run` global flag) and what
each correlator input is connected to.
Dataspec Format
===============
.. deprecated:: pass1
Use `run` global flag instead.
A dataspe... | |
the words 'freedom' and 'immigration' being said in a speech, or
P(F,I).
The first step is multiplying the probabilities of <NAME> giving a speech with her individual
probabilities of saying the words 'freedom' and 'immigration'. Store this in a variable called p_j_text.
The second step is multiplying the probabilit... | |
times = [self.efield_times[i] + arrival_times[i] for i in range(len(arrival_times))]
efield_permutations = self.relevant_permutations(times)
diagram_instructions = []
for perm in efield_permutations:
diagram_instructions += self.instructions_from_permutation(perm)
self.current_instructions = diagram_instructio... | |
rec["rev"]
# check record was updated
response = client.get("/index/" + rec_2["did"])
assert response.status_code == 200
record = response.json
assert record["metadata"] == dataNew["metadata"]
assert record["acl"] == dataNew["acl"]
assert record["authz"] == dataNew["authz"]
# create record
data = get_doc()
... | |
"""Handling of GNSS broadcast orbits
Description:
------------
The module includes a class for handling apriori GNSS broadcast orbits.
Example:
from where import apriori
# Get broadcast ephemeris object
brdc = apriori.get('orbit', rundate=rundate, station=station, , system=system, apriori_orbit='broadcast')
# W... | |
STEP and RAMP. The default value is STEP.
maintainAttributes
A Boolean specifying whether to retain attributes from an existing step with the same
name. The default value is False.
directDampingByFrequency
A DirectDampingByFrequency object.
rayleighDampingByFrequency
A RayleighDampingByFrequency object.
Return... | |
dist_yy)
return dist_xx, dist_xy, dist_yy
elif mode == 'xy':
if scale is None:
dx = tf.reduce_sum(tf.multiply(x, x), axis=1)
dy = tf.reduce_sum(tf.multiply(y, y), axis=1)
xyt = tf.matmul(x, y, transpose_b=True)
else:
dx = tf.reduce_sum(tf.multiply(x * scale, x), axis=1)
dy = tf.reduce_sum(tf.multi... | |
# from sklearn.cluster._kmeans import *
import copy
from typing import Union
import torch
import torch.nn as nn
from sklearn.cluster._robustq import *
from .quantizer import Quantizer
__all__ = ['MiniBatchRobustqTorch', 'RobustqTorch']
class ClusterQuantizerBase(Quantizer):
def __init__(self, n_feature=1, n_clust... | |
'_mpf_'):
return False
return x._mpf_ in (finf, fninf)
def isint(ctx, x):
"""
For an ``mpf`` *x*, or any type that can be converted
to ``mpf``, determines whether *x* is exactly
integer-valued::
>>> from mpmath import *
>>> isint(3), isint(mpf(3)), isint(3.2)
(True, True, False)
"""
if isinstance(x, int_t... | |
still does not exist
self.assertFalse(RecordField.exists(self.testcoll, "newfield"))
return
def test_post_new_field_missing_id(self):
f = field_view_form_data(action="new")
u = entitydata_edit_url("new", "testcoll", layout.FIELD_TYPEID, view_id="Field_view")
r = self.client.post(u, f)
self.assertEqual(r.status_... | |
######################################################################################################################
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance #
# with the... | |
file's information.
Positional arguments:
executable_directory (str) -- the file path to temporary directory's 'Scripts' directory
executable (str) -- the filename of the script to add to paths.json
"""
with open(os.path.join(executable_directory, executable), 'rb') as script_file:
script_file_contents = script_... | |
<reponame>luxonis/Factory-calibration-DepthAI<filename>python3_ws/src/calibration/scripts/depthai_calibration.py
#!/usr/bin/env python3
import cv2
import sys
import copy
import platform
import signal
import subprocess
import json
import csv
import time
import numpy as np
import os
from pathlib import Path
import shuti... | |
<reponame>aditya-sengupta/tesscomp-prototyping
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A TaskManager which keeps track of which targets to process.
.. codeauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
import os
import sqlite3
import logging
import json
from . import STATUS, utilities
#------------------... | |
<reponame>cdown/statsmodels
from __future__ import division
import os
import numpy as np
from numpy.testing import (assert_, assert_raises, assert_almost_equal,
assert_equal, assert_array_equal, assert_allclose,
assert_array_less)
import statsmodels.api as sm
from .results.results_discrete import RandHIE
class Che... | |
"""Contains DeepSpeech2 model."""
import logging
import os
import shutil
import time
from datetime import datetime
from distutils.dir_util import mkpath
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.compiler as compiler
from visualdl import LogWriter
from utils.error_rate import char_errors, word... | |
catalog specification file for uvotgraspcorr.
- **get_curve** : bool or path
True: activate option to supply the curvature coefficients of all
orders by hand.
path: filename with coefficients of curvature
- **uvotgraspcorr_on** : bool
enable/disable rerun of uvotgraspcorr to update the WCS keywords
- *... | |
<reponame>cancerregulome/inspectra
#!/usr/bin/env python
# Copyright (c) 2012, the GraphSpectrometer Contributors listed at
# http://github.com/ryanbressler/GraphSpectrometer/graphs/contributors
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted p... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import os
import json
import shutil
import tempfile
import subprocess
import itertools
import operator
import click
__all__ = ['check', 'parse_dep']
# https://github.com/davglass/license-checker#custom-format
LICENSE_CHECKER_FORMAT_KEYS = [... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.