content string |
|---|
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from custom_importer.forms import ImportFormBase
from custom_importer.views import ImporterBase, ExportTemplateBase
from country.models import Country
from .models import StatDescription, StatValue
from .statsimpor... |
from tests.base_test import BaseTest
from tests import config
from core import modules
from core.sessions import SessionURL
from testfixtures import log_capture
from core import messages
import logging
import os
import subprocess
class FileBzip(BaseTest):
# Create and bzip2 binary files for the test
binstring... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Node.lastname'
db.alter_column('neurotree_node', 'lastname', self.gf('django.db.models.fi... |
from odoo import models, _, api, fields, exceptions
class StockPicking(models.Model):
_inherit = 'stock.picking'
def _compute_customizations(self):
for picking in self:
if picking.picking_type_id.code == 'outgoing':
customization_ids = self.env['kitchen.customization']
... |
import sys, os, re
from distutils.core import setup
from mako.template import Template
from popen2 import popen2
r_scripts = ['fb.py', 'dir_browser.py', 'upload.py', 'itunes.py', 'tags.py',
'config.py', 'genpuid.py', 'db.py', 'hplatform.py', 'hfile.py',
'singleton.py', 'excepthandler.py', 'build.py', 'guimana... |
# -*- coding: utf-8 -*-
from BeamFE2 import HermitianBeam_2D as HB
from BeamFE2 import BeamSections as sections
from BeamFE2 import Structure
from BeamFE2 import Node
"""
A simple vertical cantilever beam with a horizontal endbeam.
"""
NR_BEAMS = 10 # number of finite elements in the vertical part
LENGTH = 1400 # ... |
# coding=utf-8
"""
Pinyto cloud - A secure cloud database for your personal data
Copyright (C) 2105 Johannes Merkert <<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 3 of the ... |
#!/usr/bin/env python
import re, sys, os
from collections import defaultdict
def RunRegressionPrep () :
print "Standard alignment"
command = """phonetisaurus-align --input=g014b2b/g014b2b.train \
--ofile=g014b2b/g014b2b.corpus \
--seq1_del=false \
--grow=false
"""
os.system (command)
p... |
import csv
from consolemsg import error, warn
args = None
def sortData(data, sequence, column, file_excluded):
sorted_data = []
for item in sequence:
for info in data:
if len(info) < column:
data.remove(info)
elif item.lower() == info[1].lower():
... |
from __future__ import unicode_literals
import requests
import six
import json
from xml.dom.minidom import parseString
from xml.etree.ElementTree import tostring, SubElement, Element
from datetime import datetime
from dateutil.parser import parse
from decimal import Decimal
from six.moves.urllib.parse import parse_qs... |
"""A configuration panel for capturing LED assignments."""
import wx
from ..build import led_modes, led_assignments
from .layoutpanel import labels as layers
from .scale import MARGIN
layer_select = ['No Action']
layer_select.extend(layers[1:])
hid_leds = ['Num Lock', 'Caps Lock', 'Scroll Lock', 'Compose', 'Kana']
... |
# This file is part of profileNJ
#
from __future__ import print_function
import subprocess
import TreeUtils
from TreeClass import TreeClass
import re
import sys
import os
import time
import glob
import numpy as np
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etr... |
import argparse
import logging
import numpy as np
from robot.base import get_remote_robot
from robot.sensors import *
from robot.actuators import *
def main(args):
print('preparing ...')
robot = get_remote_robot(args.agent, args.host, args.port)
kinect_depth_cam = KinectDepthCamera()
kinect_video_ca... |
"""
Objects implementing program access.
"""
from .dom import (ElementAccess, ElementDict, AttributeDescriptor,
ElementDescription, CDATAElement, ChildElements, ElementDictNames)
from .tag import Tag
from .net_object import *
from .errors import *
import ctypes
import string
import xml.dom... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Request.seen'
db.delete_column('server_request', 'seen')
def backwards(self, orm):
... |
"""
Authors: Donnie Marino, Kostas Stamatiou
Contact: <EMAIL>
Unit tests for the gbdxtools.Idaho class
"""
import os
from gbdxtools import Interface
from gbdxtools.idaho import Idaho
from auth_mock import get_mock_gbdx_session
import vcr
import tempfile
import unittest
def force(r1, r2):
return True
my_vcr = ... |
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.utils.encoding import smart_text
from django.utils.translation import get_language, ugettext_lazy as _
from rest_framework import fields, serializers
from olympia.amo.utils import to_language
from olymp... |
# -*- coding: utf-8 -*-
import unittest
import os
import sys
sys.path.append(os.getcwd())
#Override NOTE_FETCH_LENGTH for testing purposes
import simplenote
simplenote.simplenote.NOTE_FETCH_LENGTH = 5
class TestSimplenote(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.user = "<EMAIL>"
... |
import info
import bzrlib
from bzrlib.option import Option
from bzrlib.commands import (
Command,
display_command,
)
from bzrlib.lazy_import import lazy_import
lazy_import(globals(), """
import sys
from bzrlib import (
builtins,
bzrdir,
log,
workingtree,
errors
)
from bzrlib.plugins... |
#!/usr/bin/env python
# Visualize the scatter of photon transmission/absorption/reflection events
# in different planes. The input file and user selection determines the
# representation that is produced by the script.
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
import time
# define input... |
"""
Copyright 2009 Myles Braithwaite <<EMAIL>>
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... |
'''
// Copyright 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
import os
import subprocess
from transifex.txcommon.log import logger
from django.core.files.uploadedfile import UploadedFile
from transifex.txcommon.log import logger
def python_to_args(**kwargs):
"""
Convert function arguments to command line ones.
Designed for use with the subprocess module.
>>> ... |
'''This script datamines the reports by simple python operations to find smell related words in the reports and
categorises by smell types. Only nltk sentence tokenizer is used.
SQLite set up. b19952788 Offensive Effluvia.—every purveyor of milk , or person sell milk by
'''
import progressbar
from map2 import mapping... |
# coding=utf8
import asyncio
import time
import threading
import pprint
import sys
import traceback
import aiohttp
import telepot
import telepot.namedtuple
import telepot.aio
def equivalent(data, nt):
if type(data) is dict:
keys = list(data.keys())
# number of dictionary keys == number of non-Non... |
import os
import sys
### Make sure to find the Spirit modules
### This is only needed if you did not install the package
# spirit_py_dir = os.path.dirname(os.path.realpath(__file__)) + "core/python/Spirit"
spirit_py_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), "../core/python"))
sys.path.insert(0, s... |
# -*- coding: utf-8 -*-
import re
import os
import csv
import time
import pickle
import numpy as np
import pandas as pd
def getEmbedding(infile_path="embedding"):
char2id, id_char = loadMap("char2id")
row_index = 0
with open(infile_path, "rb") as infile:
for row in infile:
row = row.strip()
... |
import logging
from kitnirc.client import Channel
from kitnirc.modular import Module
# This is the standard way to get a logger for your module
# via the Python logging library.
_log = logging.getLogger(__name__)
# KitnIRC modules always subclass kitnirc.modular.Module
class HelloWorldModule(Module):
"""A basi... |
import sys
import operator
class UnionFind():
def __init__(self, n_nodes):
"""
Union-Find data structure initialization sets each node to be its own
parent (so that each node is in its own set/connected component), and
to also have rank 0.
Input - n_nodes: no of nodes
... |
import logging
import random
import re
import sys
try:
from gevent import socket
except ImportError:
import socket
from logging.handlers import RotatingFileHandler
class IRCConnection(object):
"""\
Connection class for connecting to IRC servers
"""
# a couple handy regexes for reading text
... |
import sys, os, subprocess, re, xml.etree.ElementTree as ET
from distutils import spawn
scriptDir = os.path.dirname(os.path.abspath(sys.argv[0])) + '/'
# QTC_SRC is expected to point to the source root of Qt Creator
qtcSourceRoot = os.getenv('QTC_SRC', os.path.abspath(scriptDir + '../../..')) \
.replace('\\', '/'... |
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='CertificateAuthority',
field... |
#02-03a.py
#------------------------------------------------------------
# first compute and plot the outlier fraction as a function
# of max_depth
max_depth_array = np.arange(1, 21)
train_error = np.zeros(len(max_depth_array))
cv_error = np.zeros(len(max_depth_array))
for i, max_depth in enumerate(max_depth_array):
... |
# -*- encoding: utf-8 -*-
"""
Python setup file for the flake8_snippets app.
In order to register your app at pypi.python.org, create an account at
pypi.python.org and login, then register your new app like so:
python setup.py register
If your name is still free, you can now make your first release but first you... |
import sys
import simopt
from . import core
from .options import OPTIONS
def main(argv):
## TEMPORARY ---
# Exception to be defined in insane
class InsaneBuildException(BaseException): pass
## <---
## OPTIONS
# Parse options
try:
options = OPTIONS.parse(argv[1:])
except simop... |
import numpy
import unittest
import warnings
import logging
from sedstacker.sed import Stack, Sed, Spectrum, Segment
from sedstacker.exceptions import *
class TestStack(unittest.TestCase):
def test_Stack__init__(self):
segment1 = Sed()
segment2 = Spectrum()
segment3 = Sed()
aggs... |
from elemental_core.util import process_uuids_value
from ._resource_type import ResourceType
from ._property_changed_hook import PropertyChangedHook
from ._resource_reference import ResourceReference
class ContentType(ResourceType):
"""
Represents a collection of `AttributeTypes`.
A `ContentType` can in... |
import gdb
from ...framework.interface.command import StackCommand
from ...framework.interface.command import register_command
from ...framework.interface.parameter import BooleanParameter
from ...framework.interface.parameter import PrefixParameter
from ...framework.interface.parameter import register_parameter
from... |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import IntegrityError
from rest_framework.authentication import TokenAuthentication
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from rest_framework.status import HTTP_201_CRE... |
#!/usr/bin/env python2
import datetime
import os
import time
import shutil
import sys
import nzbtomedia
from subprocess import Popen
from nzbtomedia import logger, nzbToMediaDB
from nzbtomedia.nzbToMediaUtil import convert_to_ascii, CharReplace
from nzbtomedia.nzbToMediaUserScript import external_script
def processTo... |
"""A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... |
import struct
from PyQt5 import QtOpenGL, QtWidgets
import ModernGL
from pyrr import Matrix44
class QGLControllerWidget(QtOpenGL.QGLWidget):
def __init__(self):
fmt = QtOpenGL.QGLFormat()
fmt.setVersion(3, 3)
fmt.setProfile(QtOpenGL.QGLFormat.CoreProfile)
fmt.setSampleBuffers(Tru... |
#!/usr/bin/env python3
import numpy as np
import logging
import pyclamster
import pysolar
import os,glob,re
import datetime,pytz
import pickle
logging.basicConfig(level=logging.DEBUG)
# shape of images
imgshape = (1920,1920) # hard-coded shape here...
# position of wolf-1 camera
LAT = 53.519917
LON = 10.105139
####... |
"""Remove object type table
Revision ID: 37b2a060bdd6
Revises: 262bbe790f4c
Create Date: 2016-02-02 16:17:48.928846
"""
# Disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=C0103
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
# r... |
import time
from ussclicore.utils import printer
from uforge.objects.uforge import *
from hammr.utils.hammr_utils import *
from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \
FileTransferSpeed, FormatLabel, Percentage, \
ProgressBar, ReverseBar, RotatingMarker, \
SimpleProgress, Timer,... |
"""Download and preprocess WMT17 ende training and evaluation datasets."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import random
import sys
import tarfile
import urllib
import six
import urllib.request
from mlperf_log_uti... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
copyright = """
Copyright 2008, 2009 Moritz Doll and Christian Scharkus
This file is part of rattlekekz.
rattlekekz 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 S... |
from __future__ import unicode_literals
import re
from setuptools import find_packages, setup
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Radio-Pi',
version=get_versio... |
#coding=utf-8
"""
__create_time__ = '13-10-16'
__author__ = 'Madre'
"""
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from .models import Translation
class TranslationDetailView(DetailView):
context_object_name = 'translation'
model = Translat... |
import sys, os, csv, pprint, math
from collections import OrderedDict
import numpy as np
import random
import shutil
import math
import matplotlib.gridspec as gridspec
import matplotlib.patches as patches
## uncomment when running under CLI only version ##
#import matplotlib
#matplotlib.use('Agg')
import matplotlib.... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from sys import stdin
import sys
sys.path.append("..")
from Pila import *
import re
class Nodo:
def __init__(self , valor):
self.valor = valor
self.izquierda = None
self.derecha = None
class ArbolPosFijo:
diccionario={}
def buscarOperador(... |
'''
@author: Remi Cattiau
'''
from PyQt4 import QtCore
import time
from threading import Lock
from nxdrive.logging_config import get_logger
from nxdrive.wui.translator import Translator
log = get_logger(__name__)
class Notification(object):
LEVEL_INFO = "info"
LEVEL_WARNING = "warning"
LEVEL_ERROR = "dang... |
from heat.common.i18n import _
from heat.common import template_format
from heat.engine import properties
from heat.engine.resources.openstack.heat import software_config
from heat.engine import support
from heat.rpc import api as rpc_api
class CloudConfig(software_config.SoftwareConfig):
"""A configuration resou... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import jobs.models
import uuid
class Migration(migrations.Migration):
dependencies = [
('jobs', '0006_remove_job_status'),
]
operations = [
migrations.Cr... |
# -*- coding: utf-8 -*-
from enum import IntEnum
from chatbot import api # Needed for typehints. pylint: disable=unused-import
class MessageType(IntEnum):
Normal, Action, System = range(3)
class ChatMessage:
@property
def text(self) -> str:
raise NotImplementedError
@property
def auth... |
# This plotter is a tool for discovering locations where there isn't
# much coverage. It inspects each flight and looks for segments that
# had a longer travel time than we expected. If the duration is above
# a threshold, we plot the segment.
#
# eg. if you grabbed data every 6 minutes, you'd hope that each segment ... |
"""
Handler overrides for JWT authentication.
See ARCH-276 for details of removing additional issuers and retiring this
custom jwt_decode_handler.
"""
import logging
import jwt
import waffle
from django.conf import settings
from edx_django_utils import monitoring as monitoring_utils
from edx_rest_framework_extensi... |
#!/usr/bin/env python
from itty import *
from tropo import Tropo, Session, JoinPrompt, LeavePrompt
from urllib import urlencode
from urllib2 import urlopen
@post('/index.json')
def index(request):
session = Session(request.body)
print 'request.body begin'
print request.body
print 'request.body end'
... |
#!/usr/bin/env python
import csv
from xml.dom import minidom
import sys
if sys.version_info[0] < 3:
from urllib2 import urlopen
# Allow writing utf-8 to stdout
import codecs
UTF8Writer = codecs.getwriter('utf8')
sys.stdout = UTF8Writer(sys.stdout)
else:
from urllib.request import urlopen
... |
"""
Django settings for ebook_finder_project.
Environmental variables triggered in project's env_ebook/bin/activate, when using runserver,
or env_ebook/bin/activate_this.py, when using apache via passenger.
"""
import json, os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.p... |
# coding=utf-8
"""QGIS plugin test suite.
.. note:: 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.
"""
from sa... |
from collections import OrderedDict
from django.test import TestCase
from unittest.mock import patch, PropertyMock
from tablo.exceptions import RelatedFieldsError
from tablo.models import FeatureService, FeatureServiceLayer, FeatureServiceLayerRelations
TABLE_NAME = 'db_table'
class PerformQueryTestCase(TestCase):... |
# third party
import matplotlib.pyplot as plot
import numpy
import pandas as pd
import seaborn
# this code
from common import print_image_directive, STYLE
from common import student_data
seaborn.set_style(STYLE)
n_students = student_data.shape[0]
n_features = student_data.shape[1] - 1
n_passed = sum(student_data.pa... |
from inaugurator import ceremony
import argparse
import traceback
import pdb
import logging
import sys
from inaugurator import packagesvalidation
from inaugurator import log
from inaugurator import consts
PDB_ON_ERROR = True
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("--inauguratorStages", d... |
from tic.development.admin.api import IAdminCommandProvider
from tic.core import Component, implements
from google.appengine.api import datastore
from google.appengine.api import datastore_errors
class TestMigrationCommand(Component):
implements(IAdminCommandProvider)
def get_admin_commands(self):
"""... |
"""
Memory usage functions.
"""
from __future__ import absolute_import
import sys
import collections
import numpy as nm
import scipy.sparse as sp
from sfepy.base.base import basestr, Struct, Output
import six
def get_mem_usage(obj, usage=None, name=None, traversal_order=None, level=0):
"""
Get lower bound of... |
#!/usr/bin/python
#
# tests leaking file descriptors
#
# $Id$
#
# USAGE: $0 SERVER SYSTEMID
import os
import sys
sys.path.append('..')
from rhn.rpclib import Server, GETServer
from threading import Thread
import time
SERVER = "xmlrpc.rhn.redhat.com"
HANDLER = "/XMLRPC"
PROXY=None
system_id_file = '/etc/sysconfig/rhn... |
from django.db import migrations
from django.db.models import CharField
BATCH_SIZE = 100
def fill_evenementafo_fields(apps, schema_editor):
Evenement = apps.get_model('libretto', 'Evenement')
EvenementAFO = apps.get_model('afo', 'EvenementAFO')
qs = Evenement.objects.exclude(
code_programme='', e... |
from math import factorial, floor
def perf_2_n_recurs(t, fun):
"""meant to be general, incomplete"""
def rec(t, i, fun):
if i > 0:
dice_rolls[i] = 0
rec(t, i - 1, fun)
dice_rolls[i] = 1
rec(t, i - 1, fun)
else: # i == 0
count += fun(... |
class Theme:
path = None
assets = {
"core":{
"js":None,
"css":None
},
"geolocation":{
"js":None,
"css":None
},
"datetime":{
"js":None,
"css":None
},
}
template = None
def __init__(self, path):
"""__init__(path:string)
Instantiates a Theme object from the content of the directory ... |
# -*- coding: utf-8 -*-
import sys
import json
from pprint import pprint
CITIES_ID = dict()
duplicationControl = 0
def jsonReader():
global duplicationControl
with open('city.list.json') as json_data:
for line in json_data:
data = json.loads(line)
try:
alreadyInDict = CITIES_ID[data["name"] + "_" + s... |
#!/usr/bin/env python
import webapp2
from google.appengine.api import app_identity
from google.appengine.api import mail
from conference import ConferenceApi
class SetAnnouncementHandler(webapp2.RequestHandler):
def get(self):
"""Set Announcement in Memcache."""
# TODO 1
# use _cacheAnnoun... |
#$Id: entryfield.py,v 1.2 2004/03/17 04:29:31 mandava Exp $
#this is a program depicting the use of entry field widget.
#entry widgets are basic widgets used to collect input from the user.
#entry widgets are limited to a single line of text which can be in only
#one font.
#the root is also packed with 4 buttons along... |
'''
Index collections in MongoDB accordingly
'''
from datanator.util import mongo_util
import pymongo
class IndexCollection(mongo_util.MongoUtil):
def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db=None,
verbose=False, max_entries=float('inf'), username = None,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import logging
import tempfile
from zipfile import ZipFile, ZIP_DEFLATED
logger = logging.getLogger(__name__)
class DataHandler():
GAME_ID_REGEX = re.compile('0(2|3)\d+')
def __init__(self, dir_or_zip):
self.src = dir_or_... |
import unittest
from flask import Flask, json, request
import sys
import os
sys.path.insert(0,'..')
from stargate import Manager
from stargate.resource_info import resource_info
from app.models import User, City, Location, TestPrimaryKey
from app import init_app, db
from .data_insertion import insert_simple_test_data, ... |
__all__ = ['quantity_input']
from numbers import Number
from collections.abc import Sequence
import inspect
import numpy as np
from astropy.utils.decorators import wraps
from .core import (Unit, UnitBase, UnitsError, add_enabled_equivalencies,
dimensionless_unscaled)
from .physical import _unit_ph... |
"""
Copyright (C) 2018 kanishka-linux <EMAIL>
This file is part of vinanti.
vinanti is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
'''
Copyright (c) 2015, Salesforce.com, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the foll... |
import sys
import logging
import json
from nose.tools import assert_equal, assert_true
from mock import MagicMock
from testutils import HttpServerTestBase
sys.path.append("../../backend")
from restserver import RestHandler
logger = logging.getLogger(__name__)
class TestDeleteMethod(HttpServerTestBase):
def se... |
from automaton import exceptions as automaton_exceptions
from automaton import machines
import six
"""State machine modelling.
This is being used in the implementation of:
http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html
"""
from ironic.common import exception as excp
from... |
from __future__ import annotations # isort:skip
import pytest ; pytest
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
#from bokeh.core.json_encoder import serialize_json
#from bokeh.core.template... |
""" A recursive algorithm which sprouts a process within itself.
This creates a sort of sonic fractal."""
from oort import *
control_rate(20000)
print_off()
# Be careful with this one...recursive algorithms can blow up easily!
# Avoid setting the recursion_depth or sustain too high, or the decay_exponent too low.
w ... |
from rdrf.celery import app
import logging
logger = logging.getLogger(__name__)
@app.task(name="rdrf.services.tasks.run_custom_action")
def run_custom_action(custom_action_id, user_id, patient_id, input_data):
logger.debug("running custom action %s async" % custom_action_id)
logger.debug("user_id = %s" % use... |
"""Unittests for lkgm_manager"""
from __future__ import print_function
import contextlib
import os
import sys
import tempfile
from xml.dom import minidom
import mock
from chromite.cbuildbot import lkgm_manager
from chromite.cbuildbot import manifest_version
from chromite.cbuildbot import repository
from chromite.li... |
"""
Created on Fri Feb 29 14:33:17 2015
@author: Open Risk
Purpose: Testing concentration metrics library
"""
import unittest
import numpy as np
import pandas as pd
import concentrationMetrics as cm
ERROR_MARGIN = 1e-10
class TestConcentrationLib(unittest.TestCase):
""" Testing all indexes with uniform vecto... |
from functools import partial
import cv2
import matplotlib
import numpy as np
import pylab
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
from scipy.spatial import ConvexHull
from skimage import measure
from sklearn import metrics
from skl... |
import boto3
def get_export_value(name, client=None, session=None):
def _get_export_value(name, next_token):
resp = _list_exports(next_token=next_token, client=client, session=session)
exports = resp['Exports']
export = next((export for export in exports if export['Name'] == name), None)
... |
'''
read a UBRR file (train) into mem.
Then for the input file, for every uA iB rAB docAB entry, write to disk: uA iB rAB UText BText
where UText and BText does not have docAB
@author: roseck
Created on Mar 10, 2017
'''
from DatasetUtils.DataMgr import DataMgr
from DatasetUtils.TestDataMeta import TestDataMeta
from... |
"""
===========
Legend Demo
===========
Plotting legends in Matplotlib.
There are many ways to create and customize legends in Matplotlib. Below
we'll show a few examples for how to do so.
First we'll show off how to make a legend for specific lines.
"""
from __future__ import (absolute_import, division,
... |
#!python
# -*- coding: latin-1 -*-
"""
(c) by nobisoft 2016-
"""
# Imports
## Standard
# from __future__ import print_function
import datetime
from numbers import Number
import re
## Contributed
## nobi
## Project
class PartialDateTime(object):
"""Defines a generalization of the datetime.datetime objects, whi... |
# -*- coding: utf-8 -*-
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 model 'ScheduledMessage'
db.create_table('sms_messages_scheduledmessage', (
('id', self... |
# -*- coding: utf-8 -*-
# pylint: disable=wildcard-import, unused-wildcard-import, invalid-name, unused-import
""" Transports data from various sources and over diverse protocols fresh to your application.
This is the main build script for Paver.
"""
# Copyright © 2013 Jürgen Hermann
#
# Licensed under the Apache ... |
"""
==============================================================================
Code for builder of a dynamic linear model
==============================================================================
This piece of code provides the basic functionality for constructing the model
of a dlm. It allows flexible mode... |
# coding: utf-8
import re
import string
import random
from collections import OrderedDict
from copy import deepcopy
from formpack.utils.json_hash import json_hash
from kpi.utils.sluggify import sluggify, sluggify_label, is_valid_node_name
def _increment(name):
return name + '_0'
def _rand_id(n):
return ''... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask_restful import reqparse
from emcweb.emcweb_webapi.login_resource import LoginResource
from emcweb.emcweb_webapi.utils import client
from emcweb.emcweb_webapi.views import api
class MessagesAPI(LoginResource):
@staticmethod
def post(... |
"""Control system Device Util Module."""
import copy as _copy
from mathphys.functions import get_namedtuple as _get_namedtuple
from . import util as _util
from .clientweb import beaglebone_ip_list as _bbb_ip_list
from .search import PSSearch as _PSSearch
_DEV_2_IOC_IP_DICT = dict()
class ETypes:
"""Enumerate... |
"""
Provides classes representing the database objects contained in either
the parent or child pulp server. Parent objects are read-only and are used for querying,
comparison and merging to child objects. Child objects are used for querying, comparison
and merging from remote objects. Unlike parent objects, child obj... |
"""Experiments with Toxicity Dataset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import nltk
import tensorflow as tf
from tf_trainer.common import base_model
from tf_trainer.common import model_trainer
from tf_trainer.common import serving_input
fro... |
#!/usr/bin/env python
"""
Copyright (C) 2016, Digium, Inc.
Scott Griepentrog <<EMAIL>>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
import os
import logging
LOGGER = logging.getLogger(__name__)
class RealtimeOdbcModule(object):
"""Test module for r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.