text stringlengths 957 885k |
|---|
import os
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from models.models_flax import SIREN
from train.standard import fit_image
def multi_tone_fitting(
model,
num_samples,
k_values=[],
learning_rate=1e-4,
iters=2000,
test_train_r... |
"""
This module handles the topological elements of force fields.
"""
from simtk import unit
class TopologyElement(object):
"""
A wrapper for any topological element.
"""
_name = None
_writable_attrs = []
class TopologyIterator(object):
"""
An iterator for topological elemen... |
<gh_stars>0
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7
import KratosMultiphysics as KM
import KratosMultiphysics.KratosUnittest as KratosUnittest
from KratosMultiphysics.CoSimulationApplication.coupling_interface_data import Coup... |
import requests
import json
from requests.auth import HTTPBasicAuth
class FodyError(Exception):
pass
class UnknownHandler(FodyError):
pass
class HTTPError(FodyError):
pass
class UnexpectedParameter(FodyError):
pass
class IMQFody:
def __init__(self, url, username, password, sslverify=True)... |
<filename>muddery/server/combat/combat_runner/base_combat.py
"""
Combat handler.
The life of a combat:
1. create: create a combat.
2. set_combat: set teams in the combat and the end time if available, then calls the start_combat.
3. start_combat: start the combat. Characters in the combat are allowed to use skills.
4.... |
<reponame>akashkj/commcare-hq
import json
from decimal import Decimal
from casexml.apps.stock.utils import months_of_stock_remaining, stock_category
from corehq.apps.consumption.const import DAYS_IN_MONTH
from corehq.apps.domain.models import Domain
from dimagi.utils import parsing as dateparse
from datetime import da... |
<gh_stars>1-10
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
<reponame>vatsalag99/mapping_self-harm_risk_twitter
# coding: utf-8
# In[1]:
import warnings
warnings.filterwarnings("ignore")
import ftfy
import matplotlib.pyplot as plt
import nltk
import numpy as np
import pandas as pd
import re
import time
from math import exp
from numpy import sign
from sklearn.metrics impor... |
import pytest
import opentracing
from mock import MagicMock
from opentracing.ext import tags as opentracing_tags
from basictracer import BasicTracer
from .conftest import Recorder
from opentracing_utils import trace, extract_span_from_kwargs
def is_span_in_kwargs(**kwargs):
for _, v in kwargs.items():
... |
<filename>dragon/python/vm/onnx/core/backend/native.py<gh_stars>10-100
# ------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech, Co.,Ltd.
#
# Licensed under the BSD 2-Clause License.
# You should have received a copy of the BSD 2-Clause License
# along with the software. If... |
import os
def prepare_arg(argument):
"""Prepend dashes to conform with cli standards on arguments if necessary"""
keyword, arg = argument.split("=")
if len(keyword) == 1:
keyword = "-" + keyword
elif len(keyword) == 2 and keyword[0] == "-":
pass
elif keyword[:2] != "--":
ke... |
<gh_stars>100-1000
# 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, over... |
<reponame>ikestar99/endopy
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 7 13:06:21 2021
Core code obtained from <NAME>, Barnhart Lab
Class structure and relative imports from Ike Ogbonna, Barnhart Lab
@author: ike
"""
import shutil
import numpy as np
from glob import glob
from .pathutils imp... |
<reponame>windstamp/PaddleSeg
# coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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/licens... |
<reponame>Sebastian-Belkner/LensIt
from __future__ import print_function
import glob
import os
import shutil
import time
import numpy as np
from lensit.pbs import pbs
from lensit.ffs_deflect import ffs_deflect
from lensit.ffs_qlms import qlms as ql
from lensit.ffs_covs import ffs_specmat, ffs_cov
from lensit.misc.mi... |
import os
import logging
import subprocess
import sys
from theano.configparser import (
AddConfigVar, BoolParam, ConfigParam, EnumStr, IntParam, FloatParam,
StrParam, TheanoConfigParser)
_logger = logging.getLogger('theano.configdefaults')
config = TheanoConfigParser()
AddConfigVar('floatX',
... |
<filename>wirelesscomms/plots.py
#!/usr/bin/env python
"""A module with plotting tools for signal visualization."""
from typing import Tuple
import numpy as np
from numpy.fft import fftshift, fft, fftfreq
from matplotlib import pyplot as plt
def frequency_units(data: np.ndarray) -> Tuple[str, float]:
"""Given a d... |
<filename>Albert/models/multi_class_rnn.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : multi_class_rnn.py
@Author : Racle
@Version : 1.0
@Desc : None
'''
import torch
from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
from transformers import (
Pre... |
<reponame>pradeep66927/filesRecords<filename>looppatter.py<gh_stars>0
#pattern printing
#pattern triangle pattern
# print("hi pradeep")
#Qn-1 ************************************************************
"""I=1 #OUTPUT
while i<=5: #*
j=1 #**
whi... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017-2021 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
<filename>yt/frontends/gadget/io.py
"""
Gadget data-file handling functions
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full l... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
import sympy
import mpmath
from math import log
from six.moves import range
from mathics.core.util import unicode_superscript
def get_type(value):
if isinstance(value, sympy.Integer):
... |
<gh_stars>0
# Copyright (C) 2018 Nordstrom, 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 or ag... |
<reponame>amcgrenera-vumc/curation
#!/usr/bin/env python
# coding: utf-8
# # REQUIREMENTS
# - Replace the ```observation_source_value``` and ```observation_source_concept_id``` for all records with
# ```observation_source_value = HealthInsurance_InsuranceTypeUpdate (ID 43528428, from The Basics)``` with the
# ```obser... |
# Filename: normalisation_fuc.py
# Description: normalisation function RIM, OMRI, ISOCOV
# Authors: <NAME>.
from numpy import *
import BWM as bwm
"""
Description :
RIM Normalisation : This normalization has been proposed by Cables and al It is the first normalization approach defined to handle value constraints.... |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import numpy as np
import pandas as pd
from django.db import models
from django.forms import modelformset_factory
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, redirect
from django.template impor... |
"""Config flow for Logitech Squeezebox integration."""
import asyncio
import logging
from pysqueezebox import Server, async_discover
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
HTTP_UNAUTHOR... |
"""
This module contains a class that bundles several approaches to visualize the results of the variations of
the 'SeqClu' algorithm that are contained in the package.
NOTE: This class has actually never been used during the research project and therefore needs major modifications
to make it compatibl... |
<filename>pycity_calc/economic/energy_sys_cost/bat_cost.py
#!/usr/bin/env python
# coding=utf-8
"""
Script to estimate cost of electric batteries
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
def calc_spec_cost_bat(cap, method='sma'):
"""
Calculate specific battery cos... |
""" ensure the development environment is sane
be careful about imports here:
"""
# Copyright (c) 2021 <NAME>.
# Distributed under the terms of the Modified BSD License.
import json
import os
import re
import subprocess
import sys
from datetime import datetime
from pathlib import Path
from pprint import pprint
... |
<filename>src/doc-reST/confluencize.py
#!/usr/bin/env python
import string
from glob import glob
from xml.etree.ElementTree import ElementTree, tostring
def warn_missing(element):
if element.tag not in action: print '============( %s )============' % element.tag
pass
action = {
'title': lambda element, ... |
#!/usr/bin/python
#
import sys, os ;
import datetime;
from bisect import bisect;
usage="""
Usage: copy_new_entry.py pdb_list pdb_dcp_list sourcedir targetdir
Options:
-h|--help : print this help message and exit
-v : verbose
Created 2011-03-16, updated 2011-03-16, Nanjiang
"""
def PrintHel... |
<reponame>Michal-Gagala/sympy
from sympy.core.function import diff
from sympy.core.numbers import (I, pi)
from sympy.core.symbol import Symbol
from sympy.functions.elementary.complexes import conjugate
from sympy.functions.elementary.exponential import exp
from sympy.functions.elementary.miscellaneous import sqrt
... |
<filename>fsbackup/fsbckWrapper.py
#!/usr/bin/python3.6
"""
.. module:: fsbck_wrapper
:platform: Windows, linux
:synopsis: the entrance point script to the backup system
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import sys
import os
import re
import argparse
import json
import pymongo
import logging
from fsba... |
import tensorflow as tf
from ._BaseModel import TransX
class Analogy(TransX):
def embedding_def(self):
# embedding def
self.ent_embeddings_1 = tf.get_variable(name="ent_embeddings_1",
shape=[self.num_ent_tags, self.ent_emb_dim // 2],
... |
# coding=utf-8
"""
Reticular is a lightweight Python module that can be used to create powerful command-line tools.
It lets you define commands easily, without losing flexibility and control.
It can handle subcommand groups and supports interactive mode!
"""
import importlib
__author__ = "<NAME>, and <NAME>"
from fun... |
# -*- coding: utf-8 -*-
"""ShirshakkP_.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1GwKsJm8PK6zV_zVC9gCtAcJuz7rDT69e
"""
import numpy as np
import random
ROWS = 5
COLUMNS = 5
WIN_STATES = [] #Creating a list for win_states
for x in rang... |
<reponame>BastianZim/quantumflow-dev<gh_stars>10-100
# Copyright 2020-, <NAME> and contributors
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
Standard one qubit gates
"""
from typing import Dict, List, Type
import... |
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
from __future__ import division
import numpy as np
from scipy.sparse import isspmatrix
from sklearn.utils.validation import check_array
from .utils import RegisterSubclasses
def compute_laplacian_matrix(affinity_matrix, method='auto', **kw... |
<reponame>Tachashi/ntc-ansible
#!/usr/bin/env python
# Copyright 2015 <NAME> <<EMAIL>>
# Network to Code, 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.org/lic... |
"""
hs - Python Version of the Augmented Lagrangian Harmony Search Optimizer
hso if a global optimizer which solves problems of the form:
min F(x)
subject to: Gi(x) = 0, i = 1(1)ME
Gj(x) <= 0, j = ME+1(1)M
xLB <= x <= xUB
"""
import random, time
from math import floor
import numpy as np
def HS(dimens... |
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import calcular as cl
import checkdiametro as cd
# Funciones
def proceso():
try:
longitud = ent_lg.get()
rb_traslape = Radiobtn1.get()
rb_diametro = Radiobtn2.get()
rb_diametro = cd.dato(rb_diametro)
... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# notebook_metadata_filter: all
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# langu... |
<reponame>popfido/models
# coding=utf-8
"""
Tensorflow implementation of Doc2VecC algorithm wrapper class
:author: <NAME> (<EMAIL>)
:refer: https://openreview.net/pdf?id=B1Igu2ogg
"""
from __future__ import print_function
import tensorflow as tf
import numpy as np
from option import Option
import math
import time
... |
<gh_stars>0
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # Bayesian Optimization
# +
from __futur... |
import abc
from collections import OrderedDict
import numpy as np
from gym.spaces import Box
from rlkit.core.eval_util import create_stats_ordered_dict
from rlkit.envs.wrappers import ProxyEnv
from rlkit.core.serializable import Serializable
from rlkit.core import logger as default_logger
class MultitaskEnv(object,... |
<reponame>madedotcom/ouroboros
#!/usr/bin/python
#
DOCUMENTATION = """
---
module: eventstore_subscription
short_description: create, remove, and manage subscriptions in EventStore
description:
-
options:
host_uri:
description: The fully qualified host for eventstore, eg. https://evenstore.local:2113
... |
from hypothesis import given, assume
import hypothesis.strategies as st
import numpy as np
from latticegen.latticegeneration import *
@given(st.floats(0., exclude_min=True, allow_infinity=False),
st.floats(0, np.pi),
st.floats(0., 10, exclude_min=True),
st.floats(0, np.pi),
st.integers(4,... |
<reponame>IOverflow/cool-compiler-2020
from typing import List
import abstract.tree as coolAst
from abstract.semantics import (
IoType,
Method,
SelfType,
SemanticError,
Type,
VoidType,
IntegerType,
StringType,
ObjectType,
Context,
BoolType,
AutoType,
)
fro... |
# Natural Language Toolkit: Glue Semantics
#
# Author: <NAME> <<EMAIL>>
#
# Copyright (C) 2001-2014 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, division, unicode_literals
import os
import nltk
from nltk.internals import Counter
from nltk.com... |
import asyncio
import base64
import glob
import json
import os
import subprocess
import sys
import tempfile
import urllib.request
from typing import ClassVar, Optional, List, Tuple
import guy
import keyring
import requests
from cerebrate.app import native_gui_utils
from cerebrate.cerebrate import Cerebrate
from cereb... |
import asyncio
import codecs
import os
import random
# Get the globals from Settings
import codes.paths as path
import discord
import dotenv
from discord.ext import commands
from discord.ext.commands import MissingPermissions, has_permissions
from pymongo import MongoClient
from dotenv import load_dotenv
# # # Módulo... |
<reponame>nodaki/HRNet-tensorflow<gh_stars>1-10
# -*- coding: utf-8 -*-
import collections
import json
import logging
import os
from pathlib import Path
import click
import cv2
import numpy as np
import tensorflow as tf
from omegaconf import OmegaConf, DictConfig
from pycocotools.coco import COCO
from tqdm import tqdm... |
<filename>to/lang/OpenCV-2.2.0/samples/python/lkdemo.py
#! /usr/bin/env python
print "OpenCV Python version of lkdemo"
import sys
# import the necessary things for OpenCV
import cv
#############################################################################
# some "constants"
win_size = 10
MAX_COUNT = 500
######... |
# -*- coding: utf-8 -*-
"""
K Nearest Neighbor Classification
---------------------------------
This function is built especially for a learned metric
parameterized by the matrix A where this function takes
the matrix M such that A = M * M'
"""
# Author: <NAME> <<EMAIL>>
def knn(ytr, Xtr, M, k, Xte):
"""K Nearest... |
<filename>graphene_gae/ndb/types.py<gh_stars>100-1000
import inspect
from collections import OrderedDict
from google.appengine.ext import ndb
from graphene import Field, ID # , annotate, ResolveInfo
from graphene.relay import Connection, Node
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
from g... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import pytest
from OpenSSL import crypto
from pretend import call, call_recorder, stub
from twisted.internet import ssl
import pem
from pem.twisted import certificateOptionsFromFiles
from .data import CERT_PEMS, DH_PEM, KEY_P... |
# Copyright 2016 Xiaomi, 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 or agreed to in writing,... |
<reponame>AstroShen/fpga21-scaled-tech
"""Collects all the results produced by >>cruncher.py<< running VPR and builds a single results dictionary.
Besides keeping the separate geomean results for each magic formula, it computes another median, for each
circuit, over all formulas, and then does a final geomean. This way... |
"""
This file defines actions, i.e. functions the URLs are mapped into
The @action(path) decorator exposed the function at URL:
http://127.0.0.1:8000/{app_name}/{path}
If app_name == '_default' then simply
http://127.0.0.1:8000/{path}
If path == 'index' it can be omitted:
http://127.0.0.1:8000/
The pa... |
<gh_stars>0
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modi... |
from tkinter import *
from tkinter import ttk
import pandas as pd
from linearregressmodel import lrmodel
from candlestick import candlestick
import webbrowser
import googlesearch
import lxml
from arima import arimamodel
from betacalc import beta
from optionsfairvalue import options
# pulls expected ticker symbols
de... |
# coding: utf-8
import unittest
import mocker
from scieloapi import exceptions, httpbroker
from . import doubles
class ConnectorHttpBrokerCollaborationTests(mocker.MockerTestCase):
valid_full_microset = {
'objects': [
{
'title': u'ABCD. Arquivos Brasileiros de Cirurgia Digesti... |
<filename>network/mainDvrTrainingDense.py
from __future__ import print_function
import argparse
import math
from math import log10
import os
import os.path
from collections import defaultdict
import itertools
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.util... |
import os
import time
import pytest
# from mock import patch
from time import sleep
from threading import Thread
from hkube_python_wrapper.communication.streaming.StreamingManager import StreamingManager
from hkube_python_wrapper import Algorunner
from tests.configs import config
from tests.mocks import mockdata
from... |
<filename>v0.5.0/intel/intel_minigo_submission_public_tensorflow/code/minigo/tensorflow/minigo/loop_train_eval.py
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... |
# Author: <NAME>
# Student-ID: 801-14-3804
# H.W # 1 : Consumer and Producer problem
# We create the Mobile.py which will have one thread which will do the following:
# 1)Concurrently generate random numbers that simulates the time the mobile job will take in the compute server.
# 2) Send a message for each "job" ... |
<gh_stars>0
#!/usr/bin/python3
# coding: utf-8
import argparse
import re
import sys
import urllib.request
from html_table_parser import HTMLTableParser
# Regex for parsing options on MySQL documentation pages
# Options are (normally) specified as command-line options
# as anchor tags on the page. Certain documentatio... |
<gh_stars>1-10
# Copyright 2013 VMware, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
<filename>src/saltext/vmware/utils/esxi.py
import hashlib
import logging
import socket
import ssl
import salt.exceptions
import saltext.vmware.utils.cluster as utils_cluster
import saltext.vmware.utils.common as utils_common
import saltext.vmware.utils.datacenter as utils_datacenter
# pylint: disable=no-name-in-modul... |
<gh_stars>1-10
#!/usr/bin/env python2
# coding: utf-8
"""Test Taint."""
import unittest
from triton import ARCH, Instruction, MemoryAccess, TritonContext
class TestTaint(unittest.TestCase):
"""Testing the taint engine."""
def test_known_issues(self):
"""Check tainting result after processing."""
... |
<gh_stars>1-10
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
from scipy.signal import butter, lfilter
#from control import matlab
def decimate(data,fs_befor,fs_after):
from scipy.signal import decimate
if fs_after<=8:
data_ = decimate(data,int(fs_befor/8),ftype='iir')
... |
<gh_stars>0
"""Switches for AVM Fritz!Box functions."""
from __future__ import annotations
import logging
from typing import Any
import xmltodict
from homeassistant.components.network import async_get_source_ip
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEn... |
'''
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
from nltk import NgramTagger
from nltk import jsontags
from nltk.corpus import brown
import nltk
"""
5 章 単語の分類とタグ付け
37. 1つ前のタグ情報を利用するデフォルトタガーを作る
'I like to blog on Kim's blog' の blog にどうやってタグを付けるか?
a. 1つ前の単語を調べるが、現在の単語は無視... |
# -*- coding: utf-8 -*-
import datetime
from copy import deepcopy
from pip_services3_commons.config.ConfigParams import ConfigParams
from pip_services3_commons.refer.Descriptor import Descriptor
from pip_services3_container.refer.ManagedReferences import ManagedReferences
# from pip_services3_mongodb.build.DefaultMong... |
<reponame>claydodo/tinkt<gh_stars>0
# -*- coding:utf-8 -*-
import six
import numpy as np
from krux.types.check import is_seq
from matplotlib import colors as mpl_colors
from .. import cmap_utils
class ColorMap(object):
def __init__(self, name='unknown',
type='Normal',
base_cmap_... |
<reponame>d-amien-b/simple-getwordpress
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 2.0
# Copyright (C) 2018-2019 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __... |
import os
from abc import ABC, ABCMeta
import json
import jsonschema
from svlib.svtools import svtools as svt
log = svt.log
class SecureVisionSchemaError(Exception):
"""Error raised when a json document does not match its corresponding
schema.
"""
def __init__(self, message: str, payload: str = Non... |
<reponame>lrwb-aou/curation<filename>tests/integration_tests/data_steward/cdr_cleaner/cleaning_rules/cancer_concept_suppression_test.py
"""
Integration test for cancer_concept_suppression module
This rule sandboxes and suppresses reccords whose concept_codes end in
'History_WhichConditions', 'Condition_OtherCancer', ... |
__copyright__ = """
Copyright 2019 Amazon.com, Inc. or its affiliates.
Copyright 2019 Netflix Inc.
Copyright 2019 Google LLC
"""
__license__ = """
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 cop... |
<gh_stars>0
import random
from datetime import datetime
from functools import total_ordering
from .exceptions import DepartmentNotAvailableError, TooManyMembersOnDayError
from .constants import GRANEN_ID, TALLEN_ID
today = datetime.now().date()
@total_ordering
class Member:
def __init__(self, id=0, first_name=... |
<gh_stars>10-100
# ==============================================================================
# Authors: <NAME>
#
# Python functions: A streaming VHDL parser
#
# Description:
# ------------------------------------
# TODO:
#
# License:
# =================================================================... |
<filename>EasyDraw/__init__.py
"""
EasyDraw
-------------------------------
A graphical library built for visual arts.
EasyDraw is built on top of tkinter and has more functionalities.
Author: <NAME>
https://github.com/vafakaramzadegan/EasyDraw
"""
import tkinter as tk
import time
from EasyDr... |
<reponame>liupeng678/FastAudioVisual
#!/usr/bin/env python
import os
import glob
import argparse
import fnmatch
from collections import defaultdict
__version__ = '0.1.2'
__author__ = 'hj24'
class LineCounter(object):
def __init__(self, dir):
# current location
self.current_dir = dir
# Core counters for the n... |
from IPython.core.display import Markdown, display
import numpy as np
def printmd(string:str):
'''
Markdown printout in Jupyter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prints a ``string`` that contains markdown (or more precisely, can contain markdown) in Jupyter cell output
'''
display(Markdown(string)... |
<filename>RNN/DeepRNN_KERAS.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author:LXM
@file:DeepRNN_KERAS.py
@time:2020/10/13
"""
import numpy as np
import tensorflow.compat.v1 as tf
import matplotlib.pyplot as plt
from tensorflow.keras import layers
from tensorflow import keras
# 定义RNN参数
HIDDEN_SIZE = 30 ... |
""" Cisco_IOS_XR_subscriber_srg_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR subscriber\-srg package configuration.
This module contains definitions
for the following management objects\:
subscriber\-redundancy\: Subscriber Redundancy configuration
Copyright (c) 2013\-2018 by Cisco ... |
<reponame>TRASAL/ALERT_R3<filename>scripts/cumulative_distribution.py
from math import *
import numpy as np
import json, logging
import argparse
import pandas as pd
from astropy.time import Time, TimeDelta
from astropy import units as u
import datetime
import pylab as plt
from matplotlib.patches import Rectangle
from m... |
<reponame>thezakman/CTF-Toolz<filename>Toolz/fimap/src/singleScan.py
#
# This file is part of fimap.
#
# Copyright(c) 2009-2012 <NAME>(<EMAIL>).
# http://fimap.googlecode.com
#
# This file may be licensed under the terms of of the
# GNU General Public License Version 2 (the ``GPL'').
#
# Software distributed under the ... |
<reponame>pmulcaire/allennlp
import torch
from torch.nn.utils.rnn import pack_padded_sequence
from allennlp.common.checks import ConfigurationError
from allennlp.modules.seq2vec_encoders.seq2vec_encoder import Seq2VecEncoder
from allennlp.nn.util import sort_batch_by_length, get_lengths_from_binary_sequence_mask
cla... |
<reponame>anuragpeshne/voyager<filename>server/main.py<gh_stars>0
# -*- coding: utf-8 -*-
from flask import Flask, render_template, redirect, request, url_for
import json
import map_generator
import uuid
app = Flask(__name__, static_url_path='/static')
state = {}
@app.route('/favicon.ico')
def favicon():
return ... |
<reponame>omari-funzone/commcare-hq
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-05-04 00:23
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
depen... |
<gh_stars>0
import random
from time import time
from matplotlib import pyplot as plt
DICE_SIDES = 6
FAILS = 1
def simulation(turns=2 * 10**6, max_strat=70):
"""
This is a simulation for the game pig assuming that strategies are based on stop bidding when you reach a particular
score for a round. This func... |
from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponseForbidden
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from django.utils.safestring import m... |
<gh_stars>0
from PyQt6 import QtCore, QtGui, QtWidgets
from look_password import PasswordEdit
import sqlite3
class Ui_EditLibrarian(object):
def setupUi(self, EditLibrarian, Login):
EditLibrarian.setObjectName("EditLibrarian")
EditLibrarian.resize(518, 516)
EditLibrarian.setStyleSheet(
... |
import numpy as np
import matplotlib.pyplot as plt
import os, sys
from scipy.interpolate import interp2d
from pylab import *
filelist=[]
#error = []
biomrsd1= []
biomrsd2= []
dirname1 = "/home/renato/groimp_efficient/run_1/"
dirname2 = "/home/renato/groimp_efficient/run_1c/jules/"
list = [94]
for i in range(1,2):... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
#
# Author: <NAME> <<EMAIL>
# Version: 1.0
#
import logging
import socket
import re
from importlib import import_module
from .exception import GrumpyException, GrumpyRuntimeException
from .config import GrumpyConfig
class Grumpy:
config = None
plugins = {}
connection = None
def __init__(self, conf... |
import datetime
import boto.ec2
import boto.ec2.cloudwatch
import boto.ec2.autoscale
import boto.ses
from boto.ec2.autoscale import LaunchConfiguration, AutoScalingGroup
from boto.ec2.autoscale.tag import Tag
import boto.utils
from juliabox.plugins.compute_ec2 import CompEC2
from juliabox.jbox_util import LoggerMixin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.