content string |
|---|
"""
streamswitch.wsgiapp.utils.sqlalchemy_gevent
~~~~~~~~~~~~~~~~~~~~~~~
This module is a fork from sqlalchemy_gevent project
(https://github.com/hkwi/sqlalchemy_gevent)
but we change problems:
1) use a single thread pool for all connections of sqlite
2) make compatible with python2 and python3
3) use another thread ... |
# -*- coding: utf-8 -*-
"""
A base class module for dataset fetcher
"""
__author__ = "Begon Jean-Michel <<EMAIL>>"
__copyright__ = "3-clause BSD License"
__version__ = 'dev'
import logging
from cifarfetcher import fetch_cifar10
if __name__ == "__main__":
folder = "/home/jmbegon/jmbegon/testcifar/"
logger_... |
from django.db import models
import django_filters
from django_filters.filters import RangeFilter, DateTimeFilter, DateRangeFilter
from cdr.models import CDR
from cdr.forms import COMPARE_DICT
#
# this is a work in progress on integrating https://django-filter.readthedocs.org/
#
# Add in views.py
# f = CDRFilter(requ... |
#!/usr/bin/env python
"""Utility functions for the unit tests."""
import unittest
from rivescript import RiveScript
class RiveScriptTestCase(unittest.TestCase):
"""Base class for all RiveScript test cases, with helper functions."""
def setUp(self, **kwargs):
self.rs = None # Local RiveScript bot obj... |
from setuptools import setup, find_packages
setup(
name="yace",
packages=find_packages(),
setup_requires=["pytest_runner"],
tests_require=["pytest"]
) |
"""
Key bindings, for scrolling up and down through pages.
This are separate bindings, because GNU readline doesn't have them, but
they are very useful for navigating through long multiline buffers, like in
Vi, Emacs, etc...
"""
from prompt_toolkit.key_binding.key_processor import KeyPressEvent
__all__ = [
"scrol... |
import logging
import pprint
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.generic.edit import CreateView
from rapidsms.backends.kannel.models import DeliveryReport
from rapidsms.backends.kannel.forms import KannelForm
from rapidsms.backends.http.views import BaseHttpBackendView
log... |
#!/usr/bin/env python
"""Download evidenceontology/gaf-eco-mapping-derived.txt Save in eco2group.py"""
import os
# import sys
# from goatools.associations import dnld_ncbi_gene_file
# from goatools.anno.factory import get_objanno
from goatools.base import http_get
REPO = os.path.join(os.path.dirname(os.path.abspath(_... |
import httplib2
import re
from urllib.parse import urlencode
from bs4 import BeautifulSoup
class PJAction:
"""This class-object will execute the action
also offers some information, such handle progress
"""
encoding = 'gbk'
hidden_name = ''
jwc_href = 'http://202.115.47.141/loginAction.do'
... |
import unittest
from typing import List
import utils
class Solution:
def findDiagonalOrder(self, matrix: List[List[int]]) -> List[int]:
if not matrix or not matrix[0]:
return []
m = len(matrix)
n = len(matrix[0])
result = [0] * (m * n)
r = 0
c = 0
... |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Tsunami Raster Impact on
Road
Contact : <EMAIL>
.. 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 ... |
from framework.dependency_management.dependency_resolver import ServiceLocator
from framework.interface import api_handlers, ui_handlers, custom_handlers
import tornado.web
def get_handlers():
db_plugin = ServiceLocator.get_component("db_plugin")
config = ServiceLocator.get_component("config")
plugin_gro... |
# -*- coding: utf-8 -*-
__author__ = 'luckydonald'
import logging
logger = logging.getLogger(__name__)
class ReplyMarkup(object):
def __init__(self):
super(ReplyMarkup, self).__init__()
class ReplyKeyboardMarkup(ReplyMarkup):
"""
This object represents a custom keyboard with reply options.
"""
def __init__(... |
from __future__ import unicode_literals
from django import template
from gge_proxy_manager.models import UnitListRelation, CastleEconomy
from django.db.models import Sum
register = template.Library()
def available_amount(castle, unit):
try:
rel = castle.economy.unit_list.unit_relations.get(unit=unit)
... |
from __future__ import print_function, unicode_literals
import socket
import sys
import time
from functools import wraps
from .errors import ClientException
from .helpers import normalize_url
from requests import Session
from six import text_type
from six.moves import cPickle # pylint: disable=F0401
from threading im... |
"""
.. module:: location.text
:synopsis: Django location application text module.
Django location application text module.
"""
from django.utils.translation import ugettext_lazy as _
# flake8: noqa
# required because of pep8 regression in ignoring disable of E123
address_labels = {
"country": _("Country"),... |
"""Checks import order rule"""
# pylint: disable=unused-import,relative-import,ungrouped-imports,import-error,no-name-in-module,relative-beyond-top-level
from __future__ import absolute_import
try:
from six.moves import configparser
except ImportError:
import configparser
import logging
import six
import os.p... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import ode
import time
# import my classes
from laser import *
from molecule import *
from integrator import *
from const import *
from expectation_values import *
# close old plots.
# plt.close('all')
class ffa_sim:
'''
simulator of fi... |
import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = [
# ("Your Name", "<EMAIL>"),
]
MANAGERS = ADMINS
DATABASES = {
"default": {
"ENGINE": "django.db.back... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import __builtin__
import cgi
import math
import re
import string
import json as _json
from __builtin__ import round as _round
from __builtin__ import unicode as _unicode
from collections import Mapping
from ... |
# -*- coding: utf-8 -*-
from django.db import migrations
def populate_provenance(apps, schema_editor):
"""
Remove extra records from privileges tables
This change adds a matching provenance record for each record in the corresponding privilege.
This enables undo for existing privileges.
"""
... |
"""
aiohttp server
Docs: http://aiohttp.readthedocs.io/en/stable/index.html
"""
from aiohttp import web
import asyncio
from .hooks import Hooks
class Server:
"""
Easy to use Server Class
Create Server
>>> server = Server(port)
Start Server
>>> server.run()
"""
PORT = None
hook... |
#! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
try :
# TEST NUMBER ZERO : DEFAULT CONSTRUCTOR AND STRING CONVERTER */
print "test number zero : default constructor and string converter"
# Default constructor */
squareMatrix0 = SquareMatrix()
# String converter */
print "squar... |
from __future__ import absolute_import
import sys
from google.api_core.protobuf_helpers import get_messages
from google.api import http_pb2
from google.cloud.vision_v1p1beta1.proto import geometry_pb2
from google.cloud.vision_v1p1beta1.proto import image_annotator_pb2
from google.cloud.vision_v1p1beta1.proto import t... |
# -*- coding: utf-8 -*-
import os
from google.appengine.api import app_identity
from google.appengine.ext import ndb
import modelx
import util
# The timestamp of the currently deployed version
TIMESTAMP = long(os.environ.get('CURRENT_VERSION_ID').split('.')[1]) >> 28
class Base(ndb.Model, modelx.BaseX):
create... |
from madrona.features.forms import FeatureForm, SpatialFeatureForm
from django import forms
from trees.models import Stand, Strata, ForestProperty, Scenario, ScenarioStand, MyRx, Rx, CarbonGroup, Membership
#from madrona.analysistools.widgets import SliderWidget
from django.forms.util import flatatt
from django.utils.s... |
#! /usr/bin/env python
from __future__ import absolute_import, division, print_function
from future.builtins import zip
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# Th... |
import os
import pytest
import qitest.parsers
def test_nothing_specified_json_in_cwd(args, tmpdir, monkeypatch):
monkeypatch.chdir(tmpdir)
qitest_json = tmpdir.ensure("qitest.json")
qitest_json.write("[]")
test_runner = qitest.parsers.get_test_runner(args)
assert test_runner.project.sdk_directory... |
import symmetricjsonrpc, sys
class PongRPCServer(symmetricjsonrpc.RPCServer):
class InboundConnection(symmetricjsonrpc.RPCServer.InboundConnection):
class Thread(symmetricjsonrpc.RPCServer.InboundConnection.Thread):
class Request(symmetricjsonrpc.RPCServer.InboundConnection.Thread.Request):
... |
import numpy as np
import matplotlib.pyplot as plt
def GetCoverage(BigBuffer):
x = [0] * (len(BigBuffer[0]))
for Dev1 in range(len(BigBuffer)):
for Dev2 in range(len(BigBuffer)):
if Dev1 != Dev2:
Device = BigBuffer[Dev1]
Device2 = BigBuffer[Dev2]
i = 1
try:
while Device[i] == D... |
# -*- coding: UTF-8
# utility
# *******
#
# GlobaLeaks Utility Functions
from __future__ import print_function
import cgi
import codecs
import ctypes
import inspect
import logging
import os
import sys
import traceback
import uuid
import re
from datetime import datetime, timedelta
from twisted.internet import react... |
import libtcodpy as libtcod
import algebra
from components import *
import log
import ai
import actions
import miscellany
def _insert(creature, new_map):
new_map.objects.append(creature)
creature.current_map = new_map
def _ignoring_monster(new_map, pos, player, glyph, name, color, hp=12, unarmed_damage=2, ... |
import json
from urllib.parse import urlparse
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
class YoutubeAPI:
youtube_key = ""
apis = {
'videos.list': 'https://www.googleapis.com/youtube/v3/videos',
'search.list': 'https://www.googleapis.c... |
from __future__ import unicode_literals
import os
import os.path
PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
DATA_ROOT = os.path.join(PROJ_ROOT, 'data')
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db'
}
}
INSTALLED_APPS = (
'django... |
import os
from django import template
from django.contrib.staticfiles.templatetags.staticfiles import StaticFilesNode
from django.contrib.staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles import finders
# register the templatetag in the system
from mtDjango.general import get_current_tena... |
from lifemapperTools.common.lmListModel import LmListModel, EnterTextEventHandler
from qgis.core import *
from qgis.gui import *
from PyQt4.Qt import *
import random
class TreeSearchListModel(LmListModel):
"""
@summary: subclass of LmListModel that overrides data
"""
def data(self, index, role):
"""... |
import json
import logging
import sdag2
from stevedore import extension
LOG = logging.getLogger(__name__)
class Runner(object):
def __init__(self, config, environment):
self.store = {}
self.environment = environment
self._load_config(config)
self._load_tasks()
self._buil... |
import cv2
import numpy as np
# CAMERA INIT
cam = cv2.VideoCapture(1)
cam.read()
# GLOBALS
wheel_filename = 'wheel.png'
MIN_MATCH_COUNT = 10
FLANN_INDEX_TREE = 0
index_params = dict(algorithm=FLANN_INDEX_TREE, trees=5)
search_params = dict(checks=50)
# draw_params = dict(matchColor=(0, 255, 0), singlePointColor=None,... |
import contextlib
import itertools
import testtools
from webob import exc
from neutron.common.test_lib import test_config
from neutron import context
from neutron.db import models_v2
from neutron.extensions import external_net as external_net
from neutron.manager import NeutronManager
from neutron.openstack.common im... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 26 17:15:15 2017
@author: Visual.Sensor
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
# Applying Grid Search to find the best hyperparameter
from sklearn.model_selection import GridSearchCV
# Name
file... |
# Made by Mr. - Version 0.3 by DrLecter
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
qn = "320_BonesTellFuture"
BONE_FRAGMENT = 809
ADENA = 57
class Quest (JQues... |
from unittest import TestCase
from SearchEngine import SearchEngine
class TestSearchEngine(TestCase):
def setUp(self):
self.se = SearchEngine(1000, 'word2vec.glove.6B.300d.txt', 'sum', forcebin=True)
def test_execute_query_Summation(self):
self.se.combine = 'sum'
self.assertEqual(se... |
from bstruct import *
#
# Structure definitions
#
class TicksRaw(BStruct):
_endianness = '<'
_fields = [
('symbol', '12s', pretty_print_string),
('time', 'I', pretty_print_time),
('bid', 'd'),
('ask', 'd'),
('counter', 'I'),
('unknown', 'I... |
# -*- coding: utf-8 -*-
"""
PyConES 2016 Almería
"""
import re
import os
import stat
def mail(mail):
"""``mail`` *regex* checker."""
buzon = re.compile(r'''
\A # Comienzo
[\w\d]+[\w\d._-]+ # Usuario
@
... |
import os
import subprocess
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from papyrus.renderers import GeoJSON
from .settings import (
load_processing_settings,
load_local_settings,
)
from .models import (
DBSession,
Base,
)
from apscheduler.schedulers.bac... |
import logging
log = logging.getLogger(__name__)
import os.path
import time
from traits.api import (Instance, Float, Int, push_exception_handler, Bool,
HasTraits, Str, List, Property, on_trait_change)
from traitsui.api import (View, Item, ToolBar, Action, VGroup, HSplit, Tabbed,
... |
from itertools import chain, product
from xml.etree import ElementTree
from collections import defaultdict
from utils import decode_gid, types, parse_properties, read_points
from constants import *
"""
Class declarations and other important stuff
"""
class TiledElement(object):
def set_properties(self, node):... |
import os
from oslo_utils import strutils
class HookableMixin(object):
"""Mixin so classes can register and run hooks."""
_hooks_map = {}
@classmethod
def add_hook(cls, hook_type, hook_func):
if hook_type not in cls._hooks_map:
cls._hooks_map[hook_type] = []
cls._hooks_m... |
"""
<module maturity="stable">
<summary>Module defining interface to the Core.</summary>
<description>
<para>
This module imports all public Zorp interfaces and makes it easy to use
those from the user policy file by simply importing all symbols from
Zorp.Core.
</para>
</description>
</m... |
import json
import sys
import random
sys.path.append("..")
from Models.Host import Host
from Models.Command import Command
from Models.Interface import Interface
from Models.Testbed import Testbed
class Parser:
def __init__(self,file_name):
self.file_name = file_name
with open(file_name) as f:
... |
'''
Created in June 2015
@author: Jose Pedro Matos
'''
import numpy as np
import pyopencl as cl
from collections import namedtuple
from scipy.special import expit
import pkg_resources
class Weights:
def __init__(self, wHL=None, bHL=None, wOL=None, bOL=None):
self.wHL = wHL
self.bHL = bHL
... |
import requests
import pytest
from kubernetes.client.rest import ApiException
from settings import TEST_DATA
from suite.custom_assertions import assert_event_and_get_count, assert_event_count_increased, assert_response_codes, \
assert_event, assert_no_new_events
from suite.custom_resources_utils import get_vs_ngin... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para vidgg
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
from core import httptools
from core import jsont... |
from astropy import cosmology, units
import numpy as np
import functools
from pyRSD.pygcl import transfers
def removeunits(f):
"""
Decorator to remove units from :class:`astropy.units.Quantity`
instances
"""
@functools.wraps(f)
def wrapped(*args, **kwargs):
ans = f(*args, **kwargs)
... |
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
from domain import Permissions
######################################################################################################... |
from functools import partial
import json
from urllib.parse import urljoin
import requests
def _get(url, **kwargs):
r = requests.get(url, **kwargs)
return json.loads(r.text)
def _post(url, payload, **kwargs):
r = requests.post(url, data=json.dumps(payload), **kwargs)
return json.loads(r.text)
def _p... |
"""
Idiot check for Apple Remote Desktop management with ARDAgent
purpose: indicates if Sharing Preferences: Remote Management using Apple Remote Desktop management is permitted to this
machine
daemon:
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent
requirement: ARD permits... |
"""Parses logcat output for VrCore performance logs and computes stats.
Can be used either as a standalone manual script or as part of the automated
VR performance tests.
For manual use, simply pipe logcat output into the script.
"""
import logging
import math
import sys
LINE_SESSION_START = 'PerfMon: Start of sess... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'community',
'metadata_version': '1.1'}
from ansible.module_utils.oneview import OneViewModule
class LabelModule(OneViewModule):
MSG_CREATED = 'Label created successfully.'
MSG_UPDATED = 'Label updated ... |
"""Support for the Philips Hue lights."""
import asyncio
from datetime import timedelta
import logging
from time import monotonic
import random
import aiohue
import async_timeout
from homeassistant.helpers.entity_registry import async_get_registry as get_ent_reg
from homeassistant.helpers.device_registry import async... |
"""Components for layers management."""
import logging
import itertools
from qtpy import QtCore, QtWidgets, QtGui
_log = logging.getLogger(__name__)
SelectCurrentRows = (
QtCore.QItemSelectionModel.SelectCurrent |
QtCore.QItemSelectionModel.Rows
)
class BaseLayerManager(QtCore.QObject):
def __init__(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the fake file system builder object."""
import unittest
from dfvfs.helpers import fake_file_system_builder
from tests import test_lib as shared_test_lib
class FakeFileSystemBuilderTest(shared_test_lib.BaseTestCase):
"""The unit test for the fake file sys... |
"""
Welcome to the encoding dance!
In a nutshell, text columns are actually a proxy class for byte columns,
which just encode/decodes contents.
"""
from __future__ import absolute_import, print_function, division
from mitmproxy.console import signals
from mitmproxy.console.grideditor import col_bytes
class Column(c... |
import unittest
from calculator.TipCalculator import TipCalculator
__author__ = 'joseph swager'
class TipCalculatorTest(unittest.TestCase):
# Tests set amount method
def test_set_bill_amount(self):
# arrange/act
bill_amount = TipCalculator().set_bill_amount("20.00")
# assert
... |
from SBaaS_base.postgresql_orm_base import *
class data_stage02_isotopomer_fittedNetFluxDifferences(Base):
__tablename__ = 'data_stage02_isotopomer_fittedNetFluxDifferences'
id = Column(Integer, Sequence('data_stage02_isotopomer_fittedNetFluxDifferences_id_seq'), primary_key=True)
analysis_id = Column(Strin... |
#!/usr/bin/env python
# encoding: utf-8
import numpy as np
from nd_sort import nd_sort
from crowding_distance import crowding_distance
from tournament import tournament
from environment_selection import environment_selection
from GLOBAL import Global
from matplotlib import pyplot as plt
from mpl_toolkits.m... |
import collections
import errno
import httplib
import socket
import ssl
import warnings
import certifi
import httplib2
import urllib3
def _default_make_pool(http, proxy_info):
"""Creates a urllib3.PoolManager object that has SSL verification enabled
and uses the certifi certificates."""
if not http.ca_c... |
import base64
from pathlib import Path
import aiohttp_jinja2
import aiohttp_session
import jinja2
from aiohttp import web
from aiohttp_jinja2 import APP_KEY as JINJA2_APP_KEY
from aiohttp_session.cookie_storage import EncryptedCookieStorage
from aiopg.sa import create_engine
from sqlalchemy.engine.url import URL
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" @todo add docstring """
# ### imports ###
from collections import OrderedDict
import io
import json
import os
import pprint
import sys
from jsoncomment import JsonComment
# from jsonschema import validate
def decode(s):
""" doc me """
if sys.version_info >= ... |
# -*- coding: utf-8 -*
import scipy.io
from PIL import Image
import numpy as np
import random
import scipy.ndimage
from skimage.transform import rotate
import os
import argparse
import requests
from cStringIO import StringIO
import glob
import math
import tensorflow as tf
import json
parser = argparse.... |
import math
import glob
from textblob import TextBlob as tb
import nltk
sample = ''
path = '/Users/manjunathsindagi/Documents/redhat/python-projects/data/solr/*.txt'
#path = '/Users/manjunathsindagi/Documents/redhat/python-projects/data/test.txt'
files=glob.glob(path)
for file in files:
f=open(file, 'r')
str =... |
"""Test pysma sensors."""
import logging
from json import loads
from unittest.mock import patch
import pytest
from pysma.const import DEVCLASS_INVERTER, JMESPATH_VAL, JMESPATH_VAL_IDX
from pysma.definitions import sensor_map
from pysma.sensor import Sensor, Sensors
_LOGGER = logging.getLogger(__name__)
SB_1_5 = lo... |
"""
Datetime inputs
---------------
Datetime inputs of the following types are supported in PyGMT:
- :class:`numpy.datetime64`
- :class:`pandas.DatetimeIndex`
- :class:`xarray.DataArray`: datetimes included in a *xarray.DataArray*
- raw datetime strings in `ISO format <https://en.wikipedia.org/wiki/ISO_8601>`__
(e.... |
#!/usr/bin/env python
# encoding: utf-8
'''
'''
import py_book
from distutils.core import setup
def install():
try:
long_description = open("README.md").read()
except:
long_description = py_book.__doc__
setup(
name = 'pybook',
version = py_book.VERSION,
desc... |
from __future__ import unicode_literals
from collections import defaultdict
import glob
import json
import os
from .metrics_core import Metric
from .mmap_dict import MmapedDict
from .samples import Sample
from .utils import floatToGoString
try: # Python3
FileNotFoundError
except NameError: # Python >= 2.5
... |
#!/usr/bin/env python
from __future__ import division, print_function
import logging
import numpy as np
FORMAT = '[%(asctime)s] %(name)-15s %(message)s'
DATEFMT = "%H:%M:%S"
logging.basicConfig(format=FORMAT, datefmt=DATEFMT, level=logging.INFO)
import os
import theano
import theano.tensor as T
import fuel
import i... |
"""Contains functions which are convenient for unit testing."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from six.moves import range
from six.moves import zip
import tensorflow.compat.v1 as tf
from object_detection.core import anch... |
# -*- 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 field 'Workspace.order'
db.add_column('ddsc_site_workspace', 'order',
self.gf... |
import datetime
import json
import logging
import os
import random
import re
import string
import subprocess
import sys
from threading import Timer
import pkg_resources
from absl import flags
from absl.testing import parameterized
logging.basicConfig(level=os.getenv("LOG_LEVEL", logging.INFO))
FLAGS = flags.FLAGS
fl... |
#!/usr/bin/env python3
import os
import logging
from gi.repository import Gtk
import lib.connection as Connection
from lib.config import Config
from vocto.composite_commands import CompositeCommand
from lib.toolbar.buttons import Buttons
from lib.uibuilder import UiBuilder
class MixToolbarController(object):
""... |
from mock import Mock, sentinel
from django.core.files.storage import Storage
import txango.resource as resource
class TestStaticResource(object):
def test_prefix(self, monkeypatch):
settings = Mock(name='settings')
settings.STATIC_URL = '/static/'
monkeypatch.setattr(resource, 'settings'... |
from lab import *
from pylab import *
from uncertainties import *
from uncertainties import unumpy
from statistics import *
from scipy.constants import *
import getpass
users={"candi": "C:\\Users\\candi\\Documents\\GitHub\\Lab3.2\\",
"silvanamorreale":"C:\\Users\\silvanamorreale\\Documents\\GitHub\\Lab3.2\\" ,
"Studen... |
"""Logging control and utilities.
Control of logging for SA can be performed from the regular python logging
module. The regular dotted module namespace is used, starting at
'sqlalchemy'. For class-level logging, the class name is appended.
The "echo" keyword parameter, available on SQLA :class:`.Engine`
and :class... |
from __future__ import absolute_import
from __future__ import unicode_literals
from dnfpluginscore import _, logger
import dnf
import dnf.cli
import dnf.exceptions
import dnf.i18n
import dnf.subject
import dnfpluginscore
import hawkey
import itertools
import os
import shutil
class Download(dnf.Plugin):
name = '... |
import nose
from nose.tools import raises
import bdot
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
# ndarray
def test_dot_int64():
matrix = np.random.random_integers(0, 12000, size=(10000, 100))
bcarray = bdot.carray(matrix, chunklen=2**13, cparams=bdot.cparams(clevel=... |
"""Tests for the LKJ distribution."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Dependency imports
from absl.testing import parameterized
import numpy as np
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
from tensorflow_probab... |
from shinken.log import logger
from shinken.basemodule import BaseModule
properties = {
'daemons': ['arbiter'],
'type': 'file_tag',
}
# called by the plugin manager to get a module
def get_instance(plugin):
logger.info("[File Tag] Get a FileTag module for plugin %s" % plugin.get_name())
# Catch... |
"""
Model classes that extend the instances functionality for MySQL instances.
"""
from trove.common import cfg
from trove.common import exception
from trove.common import utils
from trove.common.remote import create_guest_client
from trove.db import get_db_api
from trove.guestagent.db import models as guest_models
fr... |
"""
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two gaussians with EM
and variational dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import time
import tornado.web
import tornado.ioloop
import tornado.websocket
import tornado.httpserver
from tornado.escape import json_decode, json_encode
from tornado.options import define, options, parse_command_line
def... |
from shader import Shader
get_colors = """
uniform vec4 diffuse_color;
void get_colors(out vec4 color1, out vec4 color2)
{
color1 = diffuse_color;
color2 = diffuse_color.zyxw;
} """
apply_filter = """
uniform float intensity;
vec4 apply_filter(vec4 ramp)
{
return mix(ramp, ramp * (1.0 - ramp) * 2.0, inte... |
"""Freeze a model to a GraphDef proto."""
from absl import app, flags
import dual_net_prim
flags.DEFINE_string('model_path', None, 'Path to model to freeze')
flags.mark_flag_as_required('model_path')
flags.DEFINE_boolean(
'use_trt', False, 'True to write a GraphDef that uses the TRT runtime')
flags.DEFINE_inte... |
STOP_WORDS = set(
"""
a à â abord afin ah ai aie ainsi ait allaient allons
alors anterieur anterieure anterieures apres après as assez attendu au
aucun aucune aujourd aujourd'hui aupres auquel aura auraient aurait auront
aussi autre autrement autres autrui aux auxquelles auxquels avaient
avais avait avant avec avoi... |
import modular_core.fundamental as lfu
import modular_dt.libinstruction as lir
import modular_dr.libphidgmotor as lpm
import subprocess,thread,types,time,sys,os
import pdb
if __name__ == '__main__':pass
if __name__ == 'modular_dt.libsignaler':
lfu.check_gui_pack()
lgm = lfu.gui_pack.lgm
lgd... |
"""
"""
import os
import unittest
import shutil
from nose.plugins.attrib import attr
from openquake.sub.slab.rupture import calculate_ruptures
from openquake.sub.create_inslab_nrml import create
from openquake.sub.build_complex_surface import build_complex_surface
BASE_DATA_PATH = os.path.dirname(__file__)
@attr('... |
# set the downloaded status of files purportedly missing of it's somehow gotten borked, not that that has ever happened...
from django.core.management.base import BaseCommand, CommandError
from parsing.read_FEC_settings import FILECACHE_DIRECTORY, FEC_DOWNLOAD
from fec_alerts.models import new_filing
from os import... |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
import re
from functools i... |
# -*- coding: utf-8 -*-
"""
This module contains the class based views and functions
for messages.
:subtitle:`Class and function definitions:`
"""
from datetime import date
from django.core.urlresolvers import reverse
from apps.rcmessages.models import RCMessage
from apps.rcmessages.forms import MessageAddForm, Messag... |
import json
from urllib import parse
import h_pyramid_sentry
from elasticsearch import exceptions
from pyramid import httpexceptions, i18n, view
from pyramid.httpexceptions import HTTPNoContent
from bouncer import util
from bouncer.embed_detector import url_embeds_client
_ = i18n.TranslationStringFactory(__package__... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from ycm.client.base_request import ( BaseRequest, BuildRequestData,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.