code stringlengths 1 199k |
|---|
__author__ = 'Moch'
import tornado.ioloop
import tornado.options
import tornado.httpserver
from application import application
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)
def main():
tornado.options.parse_command_line()
http_server = tornado.h... |
from stard.services import BaseService
class Service(BaseService):
def init_service(self):
self.add_parent('multiuser')
self.add_parent('dhcpcd')
self.add_parent('getty', terminal=1) |
import json
import enum
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib import request
class APINonSingle:
def __init__(self, api_key, agent = "webnews-python", webnews_base = "https://webnews.csh.rit.edu/"):
self.agent = agent
self.api_key = api_key
self.we... |
from django.contrib import admin
from .models import User
from application.models import (Contact, Personal, Wife, Occupation, Children,
Hod, Committee, UserCommittee, Legal)
class ContactInline(admin.StackedInline):
model = Contact
class PersonalInline(admin.StackedInline):
mode... |
import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
fr... |
from __future__ import print_function
import os
import sys
import uuid
import logging
import simplejson as json
import paho.mqtt.client as mqtt
from time import sleep
try:
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../../')
from sanji.connection.connection import Connection
except ImportErr... |
from rest_framework import viewsets
from . import serializers, models
class FileViewSet(viewsets.ModelViewSet):
queryset = models.File.objects.all()
serializer_class = serializers.FileSerializer |
import json
f = open('stations.json')
dict = json.load(f)
f.close()
tables = ["|station_id|group_id|name|type|", "|---:|---:|:--:|:--:|"]
row = "|%s|%s|%s|%s|"
stations = dict['stations']
for s in stations:
r = row % (s['station_id'], s['group_id'], s['station_name'], s['station_type'])
tables.append(r)
md = '\... |
from nodes import Node
class Input(Node):
char = "z"
args = 0
results = 1
contents = ""
def func(self):
"""input() or Input.contents"""
return input() or Input.contents |
import datetime
from south.db import db
from south.v2 import DataMigration
from django.conf import settings
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Set site domain and name."""
Site = orm['sites.Site']
site = Site.objects.get(id=settings.SITE_... |
from django.db import models
from cms.models import CMSPlugin
from community.models import Clan, Member, Game
from django.utils.translation import ugettext as _
class Match(models.Model):
datetime = models.DateTimeField(_("Date"))
game = models.ForeignKey(Game, verbose_name=_("Game"))
clanA = models.ForeignKey(Clan,... |
from....import a
from...import b
from..import c
from.import d
from : keyword.control.import.python, source.python
.... : punctuation.separator.period.python, source.python
import : keyword.control.import.python, source.python
: source.python
a : source.python
from ... |
"""
WSGI config for Courseware project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Courseware.settings")
from django.core... |
import numpy as np
import six
import tensorflow as tf
from tensorflow_probability.python.bijectors.masked_autoregressive import (
AutoregressiveNetwork, _create_degrees, _create_input_order,
_make_dense_autoregressive_masks, _make_masked_constraint,
_make_masked_initializer)
from tensorflow_probability.pyth... |
import os
from pyelliptic.openssl import OpenSSL
def randomBytes(n):
try:
return os.urandom(n)
except NotImplementedError:
return OpenSSL.rand(n) |
from abc import ABC, abstractmethod
from typing import Dict, List, Optional, Tuple
from limits.storage.registry import StorageRegistry
from limits.util import LazyDependency
class Storage(LazyDependency, metaclass=StorageRegistry):
"""
Base class to extend when implementing an async storage backend.
.. warn... |
def DataToTreat(Catalogue = 'WHT_observations'):
Catalogue_Dictionary = {}
if Catalogue == 'WHT_observations':
Catalogue_Dictionary['Folder'] = '/home/vital/Dropbox/Astrophysics/Data/WHT_observations/'
Catalogue_Dictionary['Datatype'] = 'WHT'
Catalogue_Dictionary['Obj_Folder'] =... |
"""
FILE: sample_get_operations.py
DESCRIPTION:
This sample demonstrates how to list/get all document model operations (succeeded, in-progress, failed)
associated with the Form Recognizer resource. Kinds of operations returned are "documentModelBuild",
"documentModelCompose", and "documentModelCopyTo". Note... |
import tornado.ioloop
import tornado.web
import socket
import os
import sys
import time
import signal
import h5py
from datetime import datetime, date
import tornado.httpserver
from browserhandler import BrowseHandler
from annotationhandler import AnnotationHandler
from projecthandler import ProjectHandler
from helphand... |
import numpy as np
import cPickle
import math
import string
import re
import subprocess
from datetime import datetime
from cwsm.performance import Performance
def cafferun(params):
# load general and optimization parameters
with open('../tmp/optparams.pkl', 'rb') as f:
paramdescr = cPickle.load(f)
w... |
import curses
from curses.textpad import Textbox, rectangle
import asyncio
import readline
import rlcompleter
class CursesUi:
def __init__(self):
self.screen = curses.initscr()
self.screen.clear()
def __enter__(self):
print('__enter__')
return self
def __exit__(self, exc_type... |
import _plotly_utils.basevalidators
class MinexponentValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="minexponent",
parent_name="histogram.marker.colorbar",
**kwargs
):
super(MinexponentValidator, self).__init__(
plotly... |
from .sub_resource import SubResource
class IPConfiguration(SubResource):
"""IP configuration.
:param id: Resource ID.
:type id: str
:param private_ip_address: The private IP address of the IP configuration.
:type private_ip_address: str
:param private_ip_allocation_method: The private IP alloca... |
"""
Liana REST API client
Copyright Liana Technologies Ltd 2018
"""
import json
import hashlib
import hmac
import requests
import time
class APIException(Exception):
pass
class RestClient:
def __init__(self, user_id, api_secret, api_url, api_version, api_realm):
self._response = None
self._user_... |
from datetime import datetime
from email.mime import text as mime_text
from unittest.mock import MagicMock
from unittest.mock import Mock
from unittest.mock import patch
import cauldron as cd
from cauldron.session import reloading
from cauldron.test import support
from cauldron.test.support import scaffolds
from cauldr... |
import logging
from ..report.individual import IndividualReport
class IndividualGenerator(object):
logger = logging.getLogger("ddvt.rep_gen.ind")
def __init__(self, test):
self.test = test
async def generate(self, parent):
test_group = None
try:
test_group = self.test(parent.filename)
except... |
import pygame
import os
import data
if pygame.mixer:
pygame.mixer.init()
class dummysound:
def play(self): pass
class SoundPlayer:
def __init__(self, sounds):
self.sounds = {}
for s in sounds:
self.load(*s)
def play(self, sound):
self.sounds[sound].play()
def load... |
from sacred import Experiment
ex = Experiment('my_commands')
@ex.config
def cfg():
name = 'kyle'
@ex.command
def greet(name):
print('Hello {}! Nice to greet you!'.format(name))
@ex.command
def shout():
print('WHAZZZUUUUUUUUUUP!!!????')
@ex.automain
def main():
print('This is just the main command. Try g... |
from OpenGLCffi.GLES3 import params
@params(api='gles3', prms=['first', 'count', 'v'])
def glViewportArrayvNV(first, count, v):
pass
@params(api='gles3', prms=['index', 'x', 'y', 'w', 'h'])
def glViewportIndexedfNV(index, x, y, w, h):
pass
@params(api='gles3', prms=['index', 'v'])
def glViewportIndexedfvNV(index, v):... |
import os
import atexit
import string
import importlib
import threading
import socket
from time import sleep
def BYTE(message):
return bytes("%s\r\n" % message, "UTF-8")
class UserInput(threading.Thread):
isRunning = False
parent = None
def __init__(self, bot):
super().__init__()
self.parent = bot
self.setDae... |
c = get_config() # noqa: F821
c.Completer.use_jedi = False
c.InteractiveShellApp.exec_lines = [
"import biokbase.narrative.magics",
"from biokbase.narrative.services import *",
"from biokbase.narrative.widgetmanager import WidgetManager",
"from biokbase.narrative.jobs import *",
] |
import string
from operator import ge as greater_than_or_equal, gt as greater_than
from collections import deque
OPERATOR_PRECEDENCE = {
'(':0,
'+':1,
'-':1,
'*':2,
'/':2,
'^':3,
}
RIGHT_ASSOCIATIVE_OPERATORS = '^'
LEFT_ASSOCIATIVE_OPERATORS = '+-/*'
def pop_operator_queue(operators, output, tok... |
import random
"""
Generates random trees
"""
import argparse
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
def generate_random_item(length=8, chars=alphabet):
item = ""
for i in range(length):
index = random.randint(0, len(chars) - 1)
item += chars[index]
return... |
from .common import CommonTestCase
class SuggestionsTest(CommonTestCase):
def test_suggestion_url(self):
client = self.client
# self.assertEqual(client.suggestions.address.url, "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address")
self.assertEqual(client.suggestions.address... |
import json
from StringIO import StringIO
from twisted.application import service
from twisted.internet import defer, address
from twisted.python import filepath, failure
from twisted.trial import unittest
from twisted.web import resource, server, http_headers
from twisted.web.test import test_web
from piped import exc... |
defence = 0.4
for x in range(1):
print(x)
for x in range(10):
if x == 0:
defence = defence
else:
defence = defence + (1 - defence) * (1 / 2)
print(defence) |
def pig_it(text):
return ' '.join([x[1:]+x[0]+'ay' if x.isalpha() else x for x in text.split()])
for x in text.split()
if x.isalpha()
x[1:]+x[0]+'ay'
el... |
import tkinter as tk
from tkinter import *
import spotipy
import webbrowser
from PIL import Image, ImageTk
import os
from twitter import *
from io import BytesIO
import urllib.request
import urllib.parse
import PIL.Image
from PIL import ImageTk
import simplejson
song1 = "spotify:artist:58lV9VcRSjABbAbfWS6skp"
song2 = '... |
"""
Plot-related objects. A plot is known as a chart group in the MS API. A chart
can have more than one plot overlayed on each other, such as a line plot
layered over a bar plot.
"""
from __future__ import absolute_import, print_function, unicode_literals
from .category import Categories
from .datalabel import DataLab... |
import codecs
import os
import re
import sys
from setuptools import setup
root_dir = os.path.abspath(os.path.dirname(__file__))
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
package_components = package_name.split('.')
init_path = os.path.join(root_dir, *(pa... |
from tornado.httpclient import HTTPRequest, HTTPError
import ujson
import abc
import socket
from urllib import parse
from .. import admin as a
from .. social import SocialNetworkAPI, APIError, SocialPrivateKey
class XsollaAPI(SocialNetworkAPI, metaclass=abc.ABCMeta):
XSOLLA_API = "https://api.xsolla.com"
NAME =... |
"""Constants for Sonarr."""
DOMAIN = "sonarr"
CONF_BASE_PATH = "base_path"
CONF_DAYS = "days"
CONF_INCLUDED = "include_paths"
CONF_UNIT = "unit"
CONF_UPCOMING_DAYS = "upcoming_days"
CONF_WANTED_MAX_ITEMS = "wanted_max_items"
DATA_HOST_CONFIG = "host_config"
DATA_SONARR = "sonarr"
DATA_SYSTEM_STATUS = "system_status"
DE... |
import sys
import numpy as np
def nonlin(x, deriv=False):
if(deriv==True):
return x*(1-x)
return 1/(1+np.exp(-x))
X = np.array([[0,0,1],
[0,1,1],
[1,0,1],
[1,1,1]])
y = np.array([[0,0,1,1]]).T
np.random.seed(1)
syn0 = 2*np.random.random((3,1)) - 1
for iter in xr... |
from copy import deepcopy
from typing import TYPE_CHECKING
from azure.core import PipelineClient
from msrest import Deserializer, Serializer
from . import models
from ._configuration import ContainerRegistryConfiguration
from .operations import AuthenticationOperations, ContainerRegistryBlobOperations, ContainerRegistr... |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRe... |
from azure.core.exceptions import HttpResponseError
from .._deserialize import (
process_storage_error)
from .._shared.response_handlers import return_response_headers
from .._shared.uploads_async import (
upload_data_chunks,
DataLakeFileChunkUploader, upload_substream_blocks)
def _any_conditions(modified_a... |
import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
fr... |
from decimal import Decimal
map_ones = {
0: "",
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
map_tens = {
10: "Ten",
11: "Eleven",
12: "Twelve",
13: "Thirteen",
14: "Fourteen",
15: "Fifteen",
16: ... |
import numpy as np
import torch
import os
import sys
import functools
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import init
import torch.nn.functional as F
import torchvision.models as M
class GANLoss(nn.Module):
def __init__(self, target_real_label=1.0, target_fake_label=0.0,
... |
"""
Routines for printing a report.
"""
from __future__ import print_function, division, absolute_import
import sys
from collections import namedtuple
from contextlib import contextmanager
import textwrap
from .adapters import BACK, FRONT, PREFIX, SUFFIX, ANYWHERE
from .modifiers import QualityTrimmer, AdapterCutter
fr... |
import pytest
from molecule.verifier import trailing
@pytest.fixture()
def trailing_instance(molecule_instance):
return trailing.Trailing(molecule_instance)
def test_trailing_newline(trailing_instance):
line = ['line1', 'line2', '']
res = trailing_instance._trailing_newline(line)
assert res is None
def ... |
#!python3
import os
import sys
import time
import ctypes
import shutil
import subprocess
IsPy3 = sys.version_info[0] >= 3
if IsPy3:
import winreg
else:
import codecs
import _winreg as winreg
BuildType = 'Release'
IsRebuild = True
Build = 'Rebuild'
Update = False
Copy = False
CleanAll = False
BuildTimeout =... |
""" kNN digit classifier, converting images to binary before
training and classification. Should (or should allow for)
reduction in kNN object size.
"""
import cv2
from utils import classifier as cs
from utils import knn
from utils import mnist
class KnnBinary(knn.KnnDigitClassifier):
def train(self, images... |
"""
Support for Z-Wave.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zwave/
"""
import logging
import os.path
import time
from pprint import pprint
from homeassistant.const import (
ATTR_BATTERY_LEVEL, ATTR_ENTITY_ID, ATTR_LOCATION,
CONF_CUSTOM... |
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
import jsonfield
from .signals import event_logged
class Log(models.Model):
user = models.Foreig... |
from setuptools import setup, find_packages
with open('README.md') as fp:
long_description = fp.read()
setup(
name='typeform',
version='1.1.0',
description='Python Client wrapper for Typeform API',
long_description=long_description,
long_description_content_type='text/markdown',
keywords=[
... |
from epic.utils.helper_functions import lru_cache
from numpy import log
from scipy.stats import poisson
@lru_cache()
def compute_window_score(i, poisson_parameter):
# type: (int, float) -> float
# No enrichment; poisson param also average
if i < poisson_parameter:
return 0
p_value = poisson.pmf(... |
"""
Visualizing H fractal with tkinter.
=======
License
=======
Copyright (c) 2017 Thomas Lehmann
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 t... |
import serial
ser = serial.Serial('COM9', 9600)
ser.write(b'5~')
ser.close() |
from pymongo import MongoClient
import hashlib
client = MongoClient('mongodb://localhost:27017/')
dbh = client.jawdat_internal
dbh.drop_collection("resetpass")
dbh.drop_collection("employees")
eh = dbh.employees
ne = [
{
"username" : "tedhi@jawdat.com",
"secret" : hashlib.md5("J@wdat12345").he... |
import os
import traceback
from mantidqt.utils.asynchronous import AsyncTask
from addie.processing.mantid.master_table.master_table_exporter import TableFileExporter as MantidTableExporter
try:
import total_scattering
print("Mantid Total Scattering Version: ", total_scattering.__version__)
from total_scatte... |
from amqpstorm.management import ManagementApi
from amqpstorm.message import Message
from amqpstorm.tests import HTTP_URL
from amqpstorm.tests import PASSWORD
from amqpstorm.tests import USERNAME
from amqpstorm.tests.functional.utility import TestFunctionalFramework
from amqpstorm.tests.functional.utility import setup
... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
import numpy as np
from SimPEG import Utils
def E_field_from_SheetCurruent(XYZ, srcLoc, sig, t, E0=1., o... |
"""backtest.py, backunttest.py and coveragetest.py are all taken from coverage.py version 3.7.1""" |
"""Tanium SOUL package builder."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import datetime
import imp
import io
import logging
import os
import shutil
import sys
__version__ = "1.0.... |
__author__ = 'mslabicki'
import pygmo as pg
from pyltes.powerOptimizationProblemsDef import maximalThroughputProblemRR
from pyltes.powerOptimizationProblemsDef import local_maximalThroughputProblemRR
from pyltes.powerOptimizationProblemsDef import maximalMedianThrProblemRR
from pyltes.powerOptimizationProblemsDef impor... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Invoice.date_of_issue'
db.add_column('books_invoice', 'date_of_issue',
self.gf('django.db.models.... |
"""
Revision ID: 0356_add_webautn_auth_type
Revises: 0355_add_webauthn_table
Create Date: 2021-05-13 12:42:45.190269
"""
from alembic import op
revision = '0356_add_webautn_auth_type'
down_revision = '0355_add_webauthn_table'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execut... |
from human_bot import HumanBot
class AdaptivePlayBot(HumanBot):
def __init(self):
pass |
import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.rules.MetaChangeFromDefaultRule import MetaChangeFromDefaultRule
from ansiblelint.testing import RunFromText
DEFAULT_GALAXY_INFO = '''
galaxy_info:
author: your name
description: your description
company: your company (optional)
lice... |
import glob
import numpy as np
import pandas as pd
from numpy import nan
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/RRBS_anno_clean")
repeats = pd.read_csv("repeats_hg19.csv")
annofiles = glob.glob("RRBS_NormalBCD19pCD27pcell23_44_CTCTCTAC.G*")
def between_range(row):
subset = repeats.loc... |
from libqtile.manager import Key, Click, Drag, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
from libqtile import xcbq
xcbq.keysyms["XF86AudioRaiseVolume"] = 0x1008ff13
xcbq.keysyms["XF86AudioLowerVolume"] = 0x1008ff11
xcbq.keysyms["XF86AudioMute"] = 0x1008ff12
def windo... |
import os
import glob
from setuptools import setup
from setuptools.command.install import install
def post_install(install_path):
"""
Post install script for pyCUDA applications to warm the cubin cache
"""
import pycuda.autoinit
from pycuda.compiler import SourceModule
CACHE_DIR = os.path.join(i... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
exce... |
from abc import ABC, abstractmethod
class Selector(ABC):
"""docstring"""
def __init__(self):
pass
@abstractmethod
def make(self, population, selectSize, tSize):
pass |
from rest_framework.permissions import BasePermission
class IsOwnerOrReadOnly(BasePermission):
def has_object_permission(self, request, view, obj):
return obj.user == request.user |
import json
import time
import sys
import os
from collections import OrderedDict as dict
content = u"""\n
type cmdConf struct {
name string
argDesc string
group string
readonly bool
}
"""
def json_to_js(json_path, js_path):
"""Convert `commands.json` to `commands.js`"""
keys = []
wit... |
def getSpeciesValue(species):
"""
Return the initial amount of a species.
If species.isSetInitialAmount() == True, return the initial amount.
Otherwise, return the initial concentration.
***** args *****
species: a libsbml.Species object
"""
if species.isSetInitialAmount():
re... |
from distutils.core import setup
import py2exe
import os
import sys
sys.argv.append('py2exe')
target_file = 'main.py'
assets_dir = '.\\'
excluded_file_types = ['py','pyc','project','pydevproject']
def get_data_files(base_dir, target_dir, list=[]):
"""
" * get_data_files
" * base_dir: The full path to ... |
from library import SmartHomeApi
import RPi.GPIO as GPIO
import time
from datetime import datetime
api = SmartHomeApi("http://localhost:5000/api/0.1", id=10, api_key="api_eMxSb7n6G10Svojn3PlU5P6srMaDrFxmKAnWvnW6UyzmBG")
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
last_status = "UNKNOWN"
while True:
preferences... |
def transform(words):
new_words = dict()
for point, letters in words.items():
for letter in letters:
new_words[letter.lower()] = point
return new_words |
from importlib import import_module
from django.apps import AppConfig as BaseAppConfig
class AppConfig(BaseAppConfig):
name = "portal"
def ready(self):
import_module("portal.receivers") |
class Solution(object):
def maxEnvelopes(self, envelopes):
"""
:type envelopes: List[List[int]]
:rtype: int
""" |
import wordtools
import random
from forms.form import Form
class MarkovForm(Form):
def __init__(self):
self.data={}
self.data[""]={}
self.limiter=0
def validate(self,tweet):
cleaned = wordtools.clean(tweet)
if wordtools.validate(cleaned) and len(cleaned)>=2:
return cleaned
else:
return None
def sav... |
from sqlalchemy import Column, Integer, String, Sequence, ForeignKey, Enum, Float
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from . import Base
from .utils import ModelMixin
class Source(Base, ModelMixin):
__tablename__ = 'source'
__repr_props__ = ['id', 'nam... |
from investor_lifespan_model.investor import Investor
from investor_lifespan_model.market import Market
from investor_lifespan_model.insurer import Insurer
from investor_lifespan_model.lifespan_model import LifespanModel
from investor_lifespan_model.mortality_data import π, G, tf |
import pytest
from tests.models.test_etl_record import etl_records # noqa
from tests.models.test_abstract_records import dynamodb_connection # noqa
from mycroft.backend.worker.etl_status_helper import ETLStatusHelper
import mock
RECORDS = [
{'status': 'error', 'date': '2014-09-01', 'start_time': 4, 'end_time': 10... |
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.tcm.v20210413 import models
class TcmClient(AbstractClient):
_apiVersion = '2021-04-13'
_endpoint = 'tcm.tencentcloudapi.com... |
"""
WSGI config for veterinario project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "veterinario.settings")
from django.co... |
from MuellerBrown import getPotentialAndForces
from PlotUtils import PlotUtils
import numpy as np
import matplotlib.pyplot as plt
import MuellerBrown as mbpot
m=1.0
def getKineticEnergy(velocity):
return 0.5*m*(velocity[0]**2+velocity[1]**2)
dt = 0.01
num_steps = 1000
initial_position = mbpot.saddlePoints[0]
initia... |
import os
import pandas as pd
import config
import pandas
import re
import math
from modules.valuations.valuation import Valuation
class PER(Valuation):
def __init__(self, valuation):
data = valuation.get_data()
json = valuation.get_json()
Valuation.__init__(self, data, json)
self.set_json('PER', self... |
class HighScores(object):
def __init__(self, scores):
self.scores = scores
def latest(self):
return self.scores[-1]
def personal_best(self):
return max(self.scores)
def personal_top_three(self):
return sorted(self.scores, reverse=True)[:3] |
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'GitComponentVersion'
copyright = u'2017, Kevin Johnson'
author = u'Kevin Johnson'
version = u'0.0.1'
release = u'0.0.1'
language = None
exclude_patterns = []
pygments_style = 'sphinx'
todo_include_todos = False
html_... |
from .matchengine_request import MatchEngineRequest
class MobileEngineRequest(MatchEngineRequest):
"""
Class to send requests to a MobileEngine API.
Adding an image using data:
>>> from tineyeservices import MobileEngineRequest, Image
>>> api = MobileEngineRequest(api_url='http://localhost/r... |
from noise import pnoise2, snoise2
import numpy as np
from matplotlib import pyplot as plt
import random as random
from PIL import Image
import matplotlib.image as mpimg
def nbackground(sx=1000,sy=1000,octaves=50):
array = np.zeros((sx, sy), np.float)
freq = 16.0 * octaves
for y in xrange(sy):
for x in xrange(s... |
from .workout import Workout
from .duration import Time
from .duration import Distance |
from sqlalchemy import and_
from DBtransfer import *
from zlib import *
def generateFromDB(DBSession, InternData, tmp_name) :
run_list=[]
user_data = DBSession.query(InternData).filter(InternData.timestamp == tmp_name)
for data in user_data :
if not data.run in run_list :
run_list.append(data.run)
return comp... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout,Submit
from .models import Details, Feedback
from crispy_forms.bootstrap import TabHolder, Tab
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class AddmeForm(forms.ModelForm):
clas... |
"""
make_confidence_report_bundle_examples.py
Usage:
make_confidence_report_bundle_examples.py model.joblib a.npy
make_confidence_report_bundle_examples.py model.joblib a.npy b.npy c.npy
where model.joblib is a file created by cleverhans.serial.save containing
a picklable cleverhans.model.Model instance and eac... |
bookprefix = {
'Genesis' : '1',
'genesis' : '1',
'Gen' : '1',
'gen' : '1',
'Exodus' : '2',
'exodus' : '2',
'Exo' : '2',
'exo' : '2',
'Ex' : '2',
'ex' : '2',
'Leviticus' : '3',
'leviticus' : '3',
'Lev' : '3',
'lev' : '3',
'Numbers' : '4',
'numbers' : '4',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.