code stringlengths 1 199k |
|---|
"""Current user profile.
"""
__docformat__ = 'restructuredtext en'
import weakref
from .utils import *
class Profile(object):
"""Represents the profile of currently logged in user. Access using
`skype.Skype.CurrentUserProfile`.
"""
def __init__(self, Skype):
"""__init__.
:Parameters:
... |
import UniversalLibrary as UL
import numpy
import pylab
BoardNum = 0
UDStat = 0
Gain = UL.BIP5VOLTS
LowChan = 0
HighChan = 0
Count = 10000
Rate = 10000
UL.cbSetTrigger(BoardNum, UL.TRIG_HIGH, 0, 0)
print 'Waiting for trigger'
Options = UL.CONVERTDATA + UL.EXTTRIGGER
ADData = numpy.zeros((Count,), dtype=numpy.int16)
Rat... |
from warnings import catch_warnings
from datetime import datetime, timedelta
from functools import partial
from textwrap import dedent
from operator import methodcaller
import pytz
import pytest
import dateutil
import numpy as np
import pandas as pd
import pandas.tseries.offsets as offsets
import pandas.util.testing as... |
import logging
import os
import numpy as np
import torch
from fairseq import utils
from fairseq.data import (
AppendTokenDataset,
data_utils,
Dictionary,
IdDataset,
MonolingualDataset,
NestedDictionaryDataset,
NumelDataset,
PadDataset,
PrependTokenDataset,
StripTokenDataset,
... |
"""
Custom Authenticator to use Bitbucket OAuth with JupyterHub
"""
import urllib
from jupyterhub.auth import LocalAuthenticator
from tornado.httpclient import HTTPRequest
from tornado.httputil import url_concat
from traitlets import default
from traitlets import Set
from .oauth2 import OAuthenticator
def _api_headers(... |
import sys
import os
from gpu_tests import gpu_integration_test
test_harness_script = r"""
function VerifyHardwareAccelerated(feature) {
feature += ': '
var list = document.querySelector('.feature-status-list');
for (var i=0; i < list.childElementCount; i++) {
var span_list = list.children[i].getEle... |
from django.contrib import admin
from .models import * |
import unittest
import logging
import os
import shutil
from swarm import BaseSwarm as Swarm, define_swarm
from swarm import atomic
class config:
pass
# LOG_LEVEL = logging.DEBUG
# CONCURRENCY = 2
define_swarm.start()
class TestStorageFile(unittest.TestCase):
def test_folder_with_default_instance_path(se... |
"""Code for calling variants with a trained DeepVariant model."""
import os
import time
from absl import flags
from absl import logging
import numpy as np
import six
import tensorflow as tf
from third_party.nucleus.io import tfrecord
from third_party.nucleus.protos import variants_pb2
from third_party.nucleus.util impo... |
from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("SVR_rbf" , "freidman1" , "sqlite") |
""" Utilities for brole package """
from os.path import join as pjoin, split as psplit, abspath, dirname
_HERE = dirname(__file__)
def get_static():
""" Get static paths """
return abspath(pjoin(_HERE, 'static'))
def get_templates():
""" Get template paths """
return abspath(pjoin(_HERE, 'templates')) |
"""
boxhandle
"""
from __future__ import absolute_import, division, print_function
import logging
from PySide import QtCore
import numpy
from mcedit2.rendering import scenegraph
from mcedit2.rendering.selection import SelectionBoxNode, SelectionFaceNode, boxFaceUnderCursor
from mceditlib import faces
from mceditlib... |
from decimal import Decimal
from django.conf import settings
PLATA_PRICE_INCLUDES_TAX = getattr(settings, 'PLATA_PRICE_INCLUDES_TAX', True)
PLATA_ORDER_PROCESSORS = getattr(settings, 'PLATA_ORDER_PROCESSORS', [
'plata.shop.processors.InitializeOrderProcessor',
'plata.shop.processors.DiscountProcessor',
'pla... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Fly',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, a... |
r"""
Nearly incompressible Mooney-Rivlin hyperelastic material model.
Large deformation is described using the total Lagrangian formulation.
Models of this kind can be used to model e.g. rubber or some biological
materials.
Find :math:`\ul{u}` such that:
.. math::
\intl{\Omega\suz}{} \left( \ull{S}\eff(\ul{u})
... |
"""
github3.users
=============
This module contains everything relating to Users.
"""
from __future__ import unicode_literals
from json import dumps
from github3.auths import Authorization
from uritemplate import URITemplate
from .events import Event
from .models import GitHubCore, BaseAccount
from .decorators import ... |
def as_widget_dj_compat(bound_field, widget=None, attrs=None, only_initial=False):
"""
Same as as_widget method of BoundField class from module
django.forms.forms.py but does not use force_text
for widget render method. This behavior is same as in django < 1.7
"""
if not ... |
from django.test import TestCase
import datetime
from django.utils import timezone
from django.core.urlresolvers import reverse
from .models import Question
def create_question(question_text, days):
'''
Creates a question with the given 'question_text' and published the
given number of 'days' offset to now ... |
import logging
from .formatters import ModelFormatter, GearmanFormatter
from .settings import GERMAN_TASK_NAME
class ModelHandler(logging.Handler):
def __init__(self, level=logging.NOTSET):
super(ModelHandler, self).__init__(level)
self.formatter = ModelFormatter()
def emit(self, record):
... |
import re
import types
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.core.validators import *
from django.utils.unittest import TestCase
NOW = datetime.now()
TEST_DATA = (
# (validator, value, expected),
(validate_integer, '42', None),
(validate_inte... |
from distutils.core import setup
setup(name='synergy_flow',
version='0.16',
description='Synergy Flow',
author='Bohdan Mushkevych',
author_email='mushkevych@gmail.com',
url='https://github.com/mushkevych/synergy_flow',
packages=['flow', 'flow.conf', 'flow.core', 'flow.db',
... |
"""
babel.messages.frontend
~~~~~~~~~~~~~~~~~~~~~~~
Frontends for the message extraction functionality.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
try:
from ConfigParser import RawConfigParser
except ImportError:
from configparser import RawConfi... |
import numpy as np
import pytest
from pandas._libs.tslibs.timedeltas import delta_to_nanoseconds
import pandas as pd
from pandas import Timedelta
@pytest.mark.parametrize("obj,expected", [
(np.timedelta64(14, "D"), 14 * 24 * 3600 * 1e9),
(Timedelta(minutes=-7), -7 * 60 * 1e9),
(Timedelta(minutes=-7).to_pyti... |
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_iris
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # Needed for projection='3d'
from sklearn.manifold import TSNE
from pylmnn import LargeMarginNeares... |
import datetime
import BTrees.OOBTree
import zope.component
import zope.interface
import zope.lifecycleevent
import zope.proxy
import zope.app.container.btree
import zeit.calendar.interfaces
class Calendar(zope.app.container.btree.BTreeContainer):
zope.interface.implements(zeit.calendar.interfaces.ICalendar)
de... |
try:
from pymispgalaxies import Clusters
HAVE_PYGALAXIES = True
except:
HAVE_PYGALAXIES = False
def _print_cluster_value(self, cluster_value):
self.log('success', 'Name: {}'.format(cluster_value.value))
if cluster_value.description:
self.log('info', 'Description: {}'.format(cluster_value.des... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "Logit", sigma = 0.0, exog_count = 0, ar_order = 12); |
def extractNononosanctuaryWordpressCom(item):
'''
Parser for 'nononosanctuary.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('I Became the Demon Lord and my Territory is an Uninhabi... |
"""
Adaptive numerical evaluation of SymPy expressions, using mpmath
for mathematical functions.
"""
from __future__ import print_function, division
import math
import mpmath.libmp as libmp
from mpmath import (
make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc, workprec)
from mpmath import inf as mpmath_inf
f... |
"""Run tests in parallel."""
from __future__ import print_function
import argparse
import ast
import collections
import glob
import itertools
import json
import logging
import multiprocessing
import os
import os.path
import pipes
import platform
import random
import re
import socket
import subprocess
import sys
import ... |
"""Generator for C++ structs from api json files.
The purpose of this tool is to remove the need for hand-written code that
converts to and from base::Value types when receiving javascript api calls.
Originally written for generating code for extension apis. Reference schemas
are in chrome/common/extensions/api.
Usage ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('npc', '0010_auto_20160827_0222'),
]
operations = [
migrations.AddField(
model_name='responsetrigger',
name='response_handler',
... |
import numpy as np
from apogee.tools import bitmask as bm
from apogee.spec.continuum import fit
from spectralspace.sample.star_sample import subStarSample
APOGEE_PIXMASK={0:"BADPIX", # Pixel marked as BAD in bad pixel mask
1:"CRPIX", # Pixel marked as cosmic ray in ap3d
2:"SATPIX", # Pix... |
import sys
import os
import sys
from .ipshellapi import Ipshell
from .utils import resource_path
from subprocess import Popen
from .Listener import Listener
ipsh = Ipshell()
@ipsh.magic("values")
def list_values(self, arg):
"""
List all numeric types
"""
ipsh.get_magic('whos int float float64 ndarray')
... |
"""
Create XML document like:
<person id='123'>
<name>Julie</name>
</person>
"""
from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import Element
import xml.etree.ElementTree as etree
def main():
filename = 'person.xml'
root = Element('person')
tree = ElementTree(root)
name = ... |
import os
import collections
import json
class ConfigParser(object):
"""Used to parse the JSON indicator extraction configuration files.
Attributes:
config_dict: the parsed dictionary representation of the main configuration file.
supported_actions: the list of supported Actions (names).
... |
"""
EULA APP
This module provides additional functionality to the EUAL app.
Classes:
EULAAcceptedMixin
Functions:
n/a
Created on 23 Oct 2013
@author: michael
"""
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import login... |
from fractions import Fraction as Fract
import sys
def sqr(x): return x*x
def greenq(x,y,x2,y2): return 2*(x2-x)*(y2-y)
def redq(x,y,x2,y2): return sqr(x2-x)-sqr(y2-y)
def blueq(x,y,x2,y2): return sqr(x2-x)+sqr(y2-y)
xs,ys=[],[]
depth = 20
for m in range(-depth,depth):
for n in range(-depth,depth):
if redq(0,0,m,n)=... |
import os
import sys
import subprocess
from flask.ext.script import Manager, Shell, Server
from flask.ext.migrate import MigrateCommand
from ifasecure.app import create_app
from ifasecure.user.models import User
from ifasecure.settings import DevConfig, ProdConfig
from ifasecure.database import db
if os.environ.get("IF... |
def configuration(parent_package='', top_path=None):
import os.path as op
from numpy.distutils.misc_util import Configuration
from sfepy import Config
site_config = Config()
system = site_config.system()
os_flag = {'posix' : 0, 'windows' : 1}[system]
auto_dir = op.dirname(__file__)
auto_... |
import os
import sys
import subprocess
import time
import json
import nose
import re
dirname = os.path.dirname(os.path.realpath(__file__))
os.chdir(dirname)
sys.path.append("../lib")
from util import cmd
from mzb_test_utils import run_successful_bench, restart_bench, start_mzbench_server
mzbench_dir = dirname + '/../'
... |
from __future__ import absolute_import
import dateutil.parser
import hashlib
import hmac
import logging
import six
from django.db import IntegrityError, transaction
from django.http import HttpResponse
from django.utils.crypto import constant_time_compare
from django.utils.decorators import method_decorator
from django... |
import serial, os
from weioLib.weio import initSerial
def Serial(baudrate, port='/dev/ttyACM1', timeout=1):
if (port is '/dev/ttyACM1'):
# Switch GPIO to UART on WeIO, this is not necessary if some other port is asked
return initSerial(port, baudrate, timeout=timeout)
else :
return seria... |
"""
MagPy
Coverage JSON library
- particularly dedicated to webservice support
Written by Roman Leonhardt June 2019
- contains test, read and write function
"""
from __future__ import print_function
import json
import os, sys
from datetime import datetime
from matplotlib.dates import date2num, num2date
import numpy as ... |
from django.core.management.base import BaseCommand
import traceback
from poll.models import Poll
from unregister.models import Blacklist
from django.conf import settings
from optparse import make_option
from poll.forms import NewPollForm
from django.contrib.sites.models import Site
from django.contrib.auth.models impo... |
import time
import threading
from droneapi.lib import VehicleMode, Location
from pymavlink import mavutil
import requests, json
drone_id = "a015c8dc-e033-4f16-b59f-d4a2dfc13977"
map_url = "http://127.0.0.1:9000/drones/" + drone_id + "/locations"
api = local_connect()
vehicle = api.get_vehicles()[0]
... |
from .bar import Bar
from .foo import Foo
__all__ = ['Foo', 'Bar'] |
"""
structure of a response::
RESPONSE = HEAD [BODY]
HEAD = STATUS *HEADER CRLF
BODY = 1*OCTET CRLF
For example::
RESERVED 10 2\r\nab\r\n
"""
from aiobean.exc import BeanstalkException
from functools import partial
import typing
try:
from yaml import load as load_yaml
except ImportError:
PYYAML ... |
from django.contrib import admin
from monscale.models import *
class ServiceInfrastructureAdmin(admin.ModelAdmin):
pass
admin.site.register(ServiceInfrastructure, ServiceInfrastructureAdmin)
class ScaleActionAdmin(admin.ModelAdmin):
pass
admin.site.register(ScaleAction, ScaleActionAdmin)
class ExecutedActionAdm... |
__version__=''' $Id: flowables.py,v 1.1 2006/05/26 19:19:49 thomas Exp $ '''
__doc__="""
A flowable is a "floating element" in a document whose exact position is determined by the
other elements that precede it, such as a paragraph, a diagram interspersed between paragraphs,
a section header, etcetera. Examples of non... |
import logging
import traceback
from datetime import date
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import connection, transaction
import tidings.events # noqa
from celery import task
from multidb.pinning import pin_this_thread, unpin_this_thread
from statsd import st... |
from __future__ import absolute_import
from collections import namedtuple
from sentry.utils.dates import to_datetime
class Record(namedtuple('Record', 'key value timestamp')):
@property
def datetime(self):
return to_datetime(self.timestamp)
ScheduleEntry = namedtuple('ScheduleEntry', 'key timestamp') |
import re
from django.test import TestCase
from ....simplified import PermissionDenied, FilterValidationError, InvalidNumberOfResults
from ....simplified.utils import modelinstance_to_dict, fix_expected_data_missing_database_fields
from ...core import testhelper
from ..simplified import (SimplifiedDelivery, SimplifiedS... |
"""Defines fixtures available to all tests."""
import pytest
from webtest import TestApp
from webapp.app import create_app
from webapp.database import db as _db
from webapp.settings import TestConfig
from .factories import UserFactory
@pytest.yield_fixture(scope='function')
def app():
"""An application for the test... |
import os
def serve(app, port, debug=False):
from werkzeug.serving import run_simple
run_simple('0.0.0.0', int(port), app, use_debugger=debug, use_reloader=False) |
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from pta.models import Question, Patient, PTAQuestionaire, Staff,Answer,PatientResponses,PictureCard
from django.utils import timezone
from django.contrib.a... |
"""
.. _tut_artifacts_correct_ica:
Artifact Correction with ICA
============================
ICA finds directions in the feature space
corresponding to projections with high non-Gaussianity. We thus obtain
a decomposition into independent components, and the artifact's contribution
is localized in only a small number o... |
"""Fichier contenant la classe SignalRepete."""
from secondaires.navigation.equipage.signaux.base import Signal
class SignalRepete(Signal):
"""Signal utilisé pour répéter le même ordre dans X secondes.
Ce signal est très utile pour demander à un ordre de boucler
(c'est-à-dire de s'exécuter régulièrement). C... |
import json, uuid, re, logging
import tornado.web
import periscope.settings as settings
__manager__ = None
def GetManager():
global __manager__
if not __manager__:
__manager__ = SubscriptionManager()
return __manager__
class SubscriptionManager(object):
def __init__(self):
global __manag... |
import time
import collections
import socket
from zapv2 import ZAPv2
from urllib.parse import urlparse
from prettytable import PrettyTable
import re
class Main:
if __name__ == "__main__":
address = "127.0.0.1"
port = 8080
print(("Checking if ZAP is running, connecting to ZAP on http://" + ad... |
import collections
import logging
import pprint
import socket
import sys
import time
from checks import AGENT_METRICS_CHECK_NAME, AgentCheck, create_service_check
from checks.check_status import (
CheckStatus,
CollectorStatus,
EmitterStatus,
STATUS_ERROR,
STATUS_OK,
)
from checks.datadog import DdFo... |
LEONARDO_APPS = [
'leonardo_theme_productionready',
'leonardo_module_analytics'
]
LEONARDO_JS_FILES = [
'js/productionready.js'
]
LEONARDO_SCSS_FILES = []
LEONARDO_CSS_FILES = [] |
CORE_SOURCE_FILES = [
'src/core/lib/profiling/basic_timers.c',
'src/core/lib/profiling/stap_timers.c',
'src/core/lib/support/alloc.c',
'src/core/lib/support/avl.c',
'src/core/lib/support/backoff.c',
'src/core/lib/support/cmdline.c',
'src/core/lib/support/cpu_iphone.c',
'src/core/lib/support/cpu_linux.c'... |
import unittest
from datetime import datetime
import logging
from emission.core.get_database import get_section_db
import emission.storage.decorations.useful_queries as tauq
class UsefulQueriesTests(unittest.TestCase):
def setUp(self):
get_section_db().remove({"_id": "foo_1"})
get_section_db().remov... |
from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase
class BoolTests(TranspileTestCase):
def test_setattr(self):
self.assertCodeExecution("""
x = True
x.attr = 42
print('Done.')
""")
def test_get... |
from django import forms
from django.contrib.formtools.preview import FormPreview
from signbank.video.fields import VideoUploadToFLVField
from signbank.dictionary.models import Dialect, Gloss, Definition, Relation, Region, defn_role_choices, handshapeChoices, locationChoices
from django.conf import settings
from taggin... |
import os
import sys
import suit_sortable
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = suit_sortable.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("You probably want to also tag the version now:")
print("... |
import abc
import collections
import textwrap
CHunk = collections.namedtuple('CHunk',['source','codeobject','stdout','stderr','traceback','globallocal'])
THunk = collections.namedtuple('THunk',['source'])
class Node(metaclass=abc.ABCMeta):
@property
def type(self):
""" read only property, name of implem... |
import unittest2
from blipp import cmd_line_probe
import shlex
class CmdLineProbeTests(unittest2.TestCase):
def test_init(self):
# basically tests _substitute_command
config = {
'$schema': 'http://unis.incntre.iu.edu/schema/blippmeasurements/20130429/ping#',
'address': 'iu.ed... |
def set_attributes(**kwargs):
def decorator(method):
for name, value in kwargs.items():
setattr(method, name, value)
return method
return decorator |
"""
=======================================================
Extending Auto-Sklearn with Data Preprocessor Component
=======================================================
The following example demonstrates how to turn off data preprocessing step in auto-skearn.
"""
from pprint import pprint
import autosklearn.classifi... |
"""
Management command for loading all the known packages from the official
pypi.
"""
from django.core.management.base import BaseCommand
from packageindex.models import Package
from packageindex.operations.packages import awesome_test
class Command(BaseCommand):
args = '<package_name package_name ...>'
help = ... |
from m5.params import *
from m5.objects import *
def makeTopology(nodes, options):
ext_links = [ExtLink(ext_node=n, int_node=i)
for (i, n) in enumerate(nodes)]
xbar = len(nodes) # node ID for crossbar switch
int_links = [IntLink(node_a=i, node_b=xbar) for i in range(len(nodes))]
return ... |
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.list_persons, name='list_persons'),
url(r'^person/(\d+)/$', views.person),
url(r'^person/(\d+)/edit/$', views.person_edit),
url(r'^message/$', views.message),
) |
import numpy as np
from scipy import interpolate
from scipy.stats import spearmanr
import warnings
import math
from .base import BaseEstimator, TransformerMixin, RegressorMixin
from .utils import check_array, check_consistent_length
from .utils.validation import _check_sample_weight
from ._isotonic import _inplace_cont... |
"""This module contains the route class, a route definition."""
import re
from ext.aboard.router.patterns import types
RE_NAME = re.compile("^([A-Za-z]+)")
ALL_METHODS = ("GET", "POST", "PUT", "DELETE")
class Route:
"""A route definition for the Python Aboard dispatcher.
This class describes the concept of rout... |
import pandas as pd
import pytest
from featuretools import dfs
class MockEntryPoint(object):
def on_call(self, kwargs):
self.kwargs = kwargs
def on_error(self, error, runtime):
self.error = error
def on_return(self, return_value, runtime):
self.return_value = return_value
def loa... |
import os
import StringIO
from django.conf import settings
from jinja2 import Environment, FileSystemLoader
from rest_framework.compat import etree, six
from rest_framework.exceptions import ParseError
from rest_framework.parsers import JSONParser, XMLParser
import amo.utils
from amo.helpers import strip_controls
from ... |
"""
WSGI config for sample_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICAT... |
import string,os
from numpy import *
from component import Component
class radiation(Component):
"""
Interface to atmospheric radiation schemes.
* Instantiation:
x=climt.radiation( <args> )
where <args> are the following OPTIONAL arguments:
Name Dims Meaning Units Defa... |
import glob
import json
import logging
import os
import tempfile
from unittest.mock import ANY, patch
from click.testing import CliRunner
from flask import Flask
from flask_appbuilder import AppBuilder, SQLA
from flask_appbuilder.cli import (
create_app,
create_permissions,
create_user,
export_roles,
... |
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
project = 'libqi'
master_doc = 'index' |
import numpy as np
def pulse(duration, numNeurons, amplitude, t_init=0, t_final=1,
targets=[]):
x = np.zeros((numNeurons, duration))
x[targets, t_init:t_final] = amplitude
return x
if __name__ == '__main__':
# import matplotlib.pylab as plt
# p = pulse(2000, 2, 11.0/3.0, 0, 1500, [0])
... |
from urlparse import urlparse, urlunparse
import urllib2
import urllib
import httplib
import socket
import json
import math
def fetch_raw(url, kwargs=None):
"""
Fetch something from a web page, optionally encoding keyword arguments
"""
urlparsed = urlparse(url)
urlparsed = urlparsed[0:4] + tuple([ur... |
from alternityGeneral import alternityAbilities, alternityPerks, sanitize, alternityDamageTracks
from itertools import starmap
def setAbilityValue(character, stat, val):
def speciesLimitSatisfied():
def _notDoneYetNeedsToBeImplemented():
return True
return _notDoneYetNeedsToBeImplemented... |
from django.test import TestCase
from django.core.exceptions import ValidationError
from mozdns.srv.models import SRV
from mozdns.domain.models import Domain
class SRVTests(TestCase):
def setUp(self):
self.o = Domain(name="org")
self.o.save()
self.o_e = Domain(name="oregonstate.org")
... |
import sys
import os
import datetime
import struct
if struct.calcsize("P") == 8:
binpath = '../x64/'
else:
binpath = '../Win32/'
sys.path.insert(0, os.path.abspath(binpath + 'Development/pymodules'))
sys.path.insert(0, os.path.abspath(binpath + 'Release/pymodules'))
os.environ["PATH"] += os.pathsep + os.path.abspath(... |
default_app_config = "contentcuration.apps.ContentConfig" |
import numpy as np
def filter_2odd( rin,uprate,downrate):
#inputs:rin---vector, uprate--up_slope_threshold=0.25 ,downratre--down_slope_threshold=0.25
#output:r
r=np.copy(rin).astype('int')
if min(rin) != max(rin): #do filting
num=len(r) #; number of points in the vector r
#;determine if th... |
import hashlib
from hashlib import blake2b
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
text = demisto.args()['text']
hashtype = demisto.args()['type']
if hashtype == "sha256":
h = hashlib.sha256()
h.update(text.encode('utf-8'))
elif hashtype == 'sha1':
h = hash... |
from numpy import ndarray, asarray
from lightning.types.base import Base
from lightning.types.decorators import viztype
from lightning.types.utils import add_property, array_to_im, polygon_to_points, polygon_to_mask
@viztype
class Image(Base):
_name = 'image'
_local = False
@staticmethod
def clean(image... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0006_auto_20200203_0951'),
]
operations = [
migrations.CreateModel(
name='ColorTheme',
fields=[
('id', models.AutoField(auto_created=True, prim... |
"""Sensor platform integration for ADC ports of Numato USB GPIO expanders."""
from __future__ import annotations
import logging
from numato_gpio import NumatoGpioError
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import CONF_ID, CONF_NAME, CONF_SENSORS
from homeassistant.core import... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/engine/shared_engine_overdriver_mk3.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
from flask import Blueprint
from ..authentication import requires_authentication
main = Blueprint('main', __name__)
main.before_request(requires_authentication)
@main.after_request
def add_cache_control(response):
response.cache_control.max_age = 24 * 60 * 60
return response
from .views import suppliers, servic... |
import tensorflow as tf
class ConvLSTMCell(tf.contrib.rnn.RNNCell):
"""A LSTM cell with convolutions instead of multiplications.
Reference:
Xingjian, S. H. I., et al. "Convolutional LSTM network: A machine learning approach for precipitation nowcasting." Advances in Neural Information Processing Systems. 2015.
... |
import os
import bctest
import buildenv
if __name__ == '__main__':
bctest.bctester(os.environ["srcdir"] + "/test/data",
"bitcoin-util-test.json",buildenv) |
from django.contrib import admin
from exile_ui.admin import admin_site, DateRangeEX
from Piscix.middleware import get_current_user
from django_autocomplete.admin import PublisherStateFilter
from django.db import models as django_models
from cuser.middleware import CuserMiddleware
from django.db.models import Q
import m... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import numpy.random as npr
from model.config import cfg
from layer_utils.generate_anchors import generate_anchors
from model.bbox_transform import bbox_transform_inv, clip_boxes
from utils.cyt... |
AR = 'arm-none-eabi-ar'
ARFLAGS = 'rcs'
AS = 'arm-none-eabi-gcc'
BINDIR = '/usr/local/bin'
CC = ['arm-none-eabi-gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F = ['-c', '-o']
CC_VERSION = ('4', '7', '2')
CFLAGS = ['-std=c99', '-mcpu=cortex-m3', '-mthumb', '-ffunction-sections', '-fdat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.