src stringlengths 721 1.04M |
|---|
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... |
import pytest
from metaci.testresults.importer import import_test_results, populate_limit_fields
from metaci.testresults.models import TestClass, TestMethod, TestResult
@pytest.mark.django_db
class TestImporter:
def test_import_test_results(self, data):
num_test_classes = TestClass.objects.all().count()
... |
#!c:\python26\python.exe
#
# The Python Imaging Library.
# $Id$
#
# print image files to postscript printer
#
# History:
# 0.1 1996-04-20 fl Created
# 0.2 1996-10-04 fl Use draft mode when converting.
# 0.3 2003-05-06 fl Fixed a typo or two.
#
VERSION = "pilprint 0.3/2003-05-05"
from PIL im... |
# -*- coding: UTF-8 -*-
# tests.py
#
# Copyright (C) 2013 HES-SO // Haute école de gestion Arc
#
# Author: Cédric Gaspoz <cedric@gaspoz-fleiner.com>
#
# This file is part of voices.
#
# voices is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... |
"""
Revision ID: 0119_add_email_reply_to
Revises: 0118_service_sms_senders
Create Date: 2017-09-07 15:29:49.087143
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0119_add_email_reply_to'
down_revision = '0118_service_sms_senders'
def upgrade():
op.crea... |
# -*- coding: utf-8 -*-
# quiz-orm/views.py
from flask import render_template, request, redirect, url_for, abort, flash
from app import app
from models import Pytanie, Odpowiedz
from forms import *
@app.route('/')
def index():
"""Strona główna"""
return render_template('index.html')
@app.route('/lista')
de... |
import json
import asyncio
import logging
from enum import Enum
from aiohttp import ClientSession
from tukio.task import register
from tukio.task.holder import TaskHolder
from tukio.workflow import WorkflowExecState, Workflow
from .utils import runtime
from .utils.uri import URI
log = logging.getLogger(__name__)
c... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
#
# This script get the dat from the sgp.aero server and gen the SW JSON file
#
import sys
import json
import urllib.request, urllib.error, urllib.parse
import datetime
import time
import os
import math
import pycountry
import socket
from ognddbfuncs import *
from geofuncs ... |
#!/usr/bin/env python3
#!/usr/bin/python
"""Cheap and simple API helper
This program is part of "Dive Into Python", a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
"""
__author__ = "Mark Pilgrim (mark@diveintopython.org)"
__version__ = "$Revision: 1.3 $"
__da... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... |
import textwrap
from AttributeNodes import ATTRIBUTE_NODES
from CommonNodes import COMMON_NODES # noqa: I201
from DeclNodes import DECL_NODES # noqa: I201
from ExprNodes import EXPR_NODES # noqa: I201
from GenericNodes import GENERIC_NODES # noqa: I201
from PatternNodes import PATTERN_NODES # noqa: I201
from StmtN... |
#!/usr/bin/env python
import desdb
import numpy as np
import esutil
import pyfits
import sys
import healpy as hp
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
#import seaborn as sns
def CatMatch(c1, c2, band1, band2):
radius = 1/3600.0... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author:
# Mateusz Kruszyński <mateusz.kruszynski@gmail.com>
#
import time
from obci.utils import tags_helper
from multiplexer.multiplexer_constants import peers, types
from obci.logic import logic_helper
from obci.logic.logic_decision_peer import LogicDecision
from ob... |
from models import TtStop,TtStopTime,TtTrip
import gtfs.models
from timetable.models import TtShape
import json
from common import ot_utils
import datetime
def build_from_gtfs(start_date,days=30):
build_stops()
end_date = start_date + datetime.timedelta(days=days-1)
print '=' * 50
print 'Start day = %s... |
import nltk
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
import os, re
from nltk.stem.porter import *
import gensim
from gensim.models import Word2Vec
import pandas as pd
import numpy as np
import xml.etree.ElementTree as xmlTree
class MySentences(object):
def __init__(self, fname):
... |
# -*- coding: utf-8 -*-
##############################################################################
#
# BizzAppDev
# Copyright (C) 2015-TODAY
# bizzappdev(<http://www.bizzappdev.com>).
# ADHOC SA(<http://www.adhoc.com.ar>).
#
# This program is free software: you can redistribute it and/or modify
# ... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
# coding=utf-8
# Copyright 2020 The Google Research Team Authors.
#
# 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 app... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-02 15:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0053_auto_20160529_2355'),
]
operations = [
migrations.RunSQL(
"""... |
#pylint: disable=invalid-name, too-few-public-methods, too-many-public-methods
#pylint: disable=protected-access, missing-docstring, too-many-locals
#pylint: disable=too-many-arguments
#pylint: disable=deprecated-method
from __future__ import print_function, absolute_import, division
from argparse import Namespace
imp... |
from pyevent.event import event
from pyevent.tcpserver import tcpserver
from pyevent.tcpconnection import tcpconnection
class cmdserver(tcpserver):
def __init__(self, pesys):
self.evs = pesys.evs
self.tms = pesys.tms
self.log = pesys.log
self.proc = pesys.proc
self.proc.set... |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: David
#
# Created: 09.01.2011
# Copyright: (c) David 2011
# Licence: <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/en... |
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.core.exceptions import ValidationError
from django.contrib.localflavor.us.models import PhoneNumberField,USStateField
from sorl.thumbnail import ImageField
from decimal import *
import dat... |
import json
from adengine.model import User, Ad
NOT_FOUND_ERROR = {
"error": "Not found"
}
def build_api_url(id_=None):
if id_ is not None:
return "/api/users/{}".format(id_)
return "/api/users"
def _new_ad(user, text="ad-text"):
ad = Ad(text=text, author_id=user.id)
return ad
def _n... |
"""Commands related to projects are in this module"""
import click
import sys
from hil.cli.client_setup import client
@click.group()
def project():
"""Commands related to project"""
@project.command(name='create')
@click.argument('project')
def project_create(project):
"""Create a new project"""
client.... |
# -*- coding: utf-8 -*-
#
# phpMyAdmin documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 26 14:04:48 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
import os
import sdl2
import sdl2ui
from sdl2ui.mixer import Mixer
import sdl2ui.mixins
from sdl2ui.debugger import Debugger
from sdl2ui.joystick import JoystickManager
import meldnafen
from meldnafen.joystick import MenuJoystick
from meldnafen.mixins.bgm import BgmMixin
from meldnafen.mixins.controls import ControlsM... |
#!/usr/bin/env python
# icing.py
#
# Created by Eric Sumner on 2010-10-29.
# Copyright 2010 Haleret Productions. All rights reserved.
#
# See the file named "COPYING" in this directory for licensing information.
import sys
# Syntactic sugar for common object types:
#
# NSNumber: @42
# NSMutableArray: ... |
#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Impala tests for queries that query metadata and set session settings
import logging
import pytest
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from subprocess import call
from tests.common.test_vector import *
from test... |
'''
Documentation Builder Environments
'''
import os
import re
import sys
import logging
import subprocess
import traceback
import socket
from datetime import datetime
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _, ugettext_noop
from docker import Client
from docker.uti... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Join', fields ['email', 'ref_id']
db.creat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab
#
'''
Unit tests for githooks
How it works:
* Create a workspace tmp/ in cwd, set up a dummy STASH_HOME,
a remote repo and a local repo there.
* Replace temp/remote_repo.git/hooks/update in the remote repo with
hook_fixture.py. The hook_fixt... |
# Django settings for jimi project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', ... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free so... |
#!/usr/bin/env python
#
# Copyright 2013 Tristan Bereau and Christian Kramer
#
# 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 requ... |
#! /usr/bin/python
########################################################################
# Backend to dynamicly create and destroy virtual machines
# Copyright (C) 2015 Carl J Smith
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... |
"""
To push a new version to PyPi, update the version number
in rfhub/version.py and then run the following commands:
$ python setup.py sdist
$ python3 -m twine upload dist/*
"""
from setuptools import setup
filename = 'rfhub/version.py'
exec(open(filename).read())
setup(
name = 'robotframe... |
import gtk
from plugins.file_list.plugin import Column, FileList
from plugin_base.column_extension import ColumnExtension
from subprocess import check_output
def register_plugin(application):
"""Register plugin class with application"""
application.register_column_extension(FileList, TagsColumn)
class BaseColumn... |
'''
Copyright 2013 Cosnita Radu Viorel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribu... |
#
# Copyright (C) 2012-2016 Nexedi SA
#
# 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.
#
# This program is distributed... |
# Copyright (C) 2015 Universidad Politecnica de Madrid
#
# 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 la... |
#
# Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat.org.
#
# WeeChat.org 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 License, or
#... |
# coding=utf-8
"""Модуль описывает функции получения синхронного и асинхронного подключения к базе."""
import motor
import pymongo
# pylint: disable=R0913,W0613
def get_connection_async(
host="127.0.0.1",
port=27017,
database="trunk",
user="admin",
password="password",
... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# coding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-11-30 10:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_co... |
# Generated by Django 1.11.29 on 2020-03-17 11:22
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('student', '0030_userpr... |
# -*- 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 'ActionCategory'
db.create_table(u'polisessions_actioncategory', (
(u'id', self.g... |
import logging
import os
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from django.template.loader import get_template
from workshops.models import Badge, Person, Role
logger = logging.getLogger()
class Command(BaseCommand):
help = "Report instructors activity."
... |
import logging
import socket
import sys
from ..common import Message, monitor
from .connection import Connection, ConnectionBroken, ConnectionClosed
from .multiplexer import EpollMultiplexer, SelectMultiplexer
class Server:
def __init__(self, host='', port=0, backlog=socket.SOMAXCONN):
if sys.platform.s... |
# -*- coding: utf-8 -*-
# Django settings for timtec project.
from django.utils.translation import ugettext_lazy as _
import os
SETTINGS_DIR = os.path.dirname(os.path.realpath(__file__))
PROJECT_ROOT = os.path.dirname(SETTINGS_DIR)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
SITE_ID = 1
SITE_HOME = '/'
SITE_NAME = 'Escola Mu... |
## GOX-kerosene sim
#@ Author Juha Nieminen
#import sys
#sys.path.insert(0, '/Users/juhanieminen/Documents/adamrocket')
import RocketComponents as rc
from physical_constants import poise, inches, Runiv, gallons, lbm, \
gearth, atm, psi, lbf
from numpy import pi, linspace, cos, radians, sqrt, exp, log, array, full... |
import numpy as np
import matplotlib.pyplot as plt
import pylab
import h5py
def read_param(h5, name):
if '/parameters/dictionary/'+name in h5:
return h5['/parameters/dictionary/'+name].value
elif '/parameters/'+name in h5:
return h5['/parameters/'+name].value
else:
raise RuntimeErro... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from fnmatch import fnmatch
import click
import toml
from ..config import (
CONFIG_FILE,
SECRET_KEYS,
config_file_exists,
read_config_file,
read_config_file_scrubbed,
re... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import wx
import Breakpoint
import Debugger
import DialogAddBreakpoint
import GUI
class PPUDebuggerFrame(GUI.MainFrame, Debugger.Debugger):
#constructor
def __init__(self, parent):
GUI.MainFrame.__init__(self, parent)
Debugger.Debugger.__init__(self)
self.addBreakpointFra... |
from django.conf import settings
from django.utils.html import strip_tags
from django.utils.text import unescape_entities
from django.utils.encoding import force_unicode
ROA_DJANGO_ERRORS = getattr(settings, 'ROA_DJANGO_ERRORS', False)
class ROAException(Exception):
def __init__(self, exception):
if ROA_D... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This precision method refered by
# http://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html
# https://github.com/sylvan5/PRML/blob/master/ch5/digits.py
#
import time
import cv2
import numpy as np
import Mln as mln
import dump as dp
i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import captcha_input
import config
IMAGE_WIDTH = config.IMAGE_WIDTH
IMAGE_HEIGHT = config.IMAGE_HEIGHT
CLASSES_NUM = config.CLASSES_NUM
CHARS_NUM = config.CHARS_NUM
def inputs(train, b... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 CloudSizzle Team
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
#... |
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
# Author: Immanuel Bayer
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn import metrics
from fastFM import als
from numpy.testing import assert_almost_equal
from fastFM.datasets import make_user_item_regression
from sklearn.metrics import mean_squared_error
from sklearn.utils.testing ... |
"""Metrics to perform pairwise computation."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: MIT
import numpy as np
from scipy.spatial import distance_matrix
from sklearn.base import BaseEstimator
from sklearn.utils import check_consistent_length
from sklearn.utils.multiclass import unique_labels
... |
import unittest
from pkget import BasicConfig, PkgetError
class BasicConfigTest(unittest.TestCase):
def setUp(self):
self.basic_config = BasicConfig(
attributes={"installprefix": None,
"pkginfoprefix": "",
"recipepaths": [],
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# JabberBot: A simple jabber/xmpp bot framework
# Copyright (c) 2007-2011 Thomas Perl <thp.io/about>
#
# 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; ... |
from selenium import webdriver
import requests
from bs4 import BeautifulSoup
page = requests.get("https://www.se.gob.ar/datosupstream/graf_prod_x_pozo.php?gas=1&ejecutar=1&vienede=&idpozo=")
soup = BeautifulSoup(page.content, 'html.parser')
#get all the year options
year=soup.find("select",{"name":"anio"})
year_optio... |
"""Filters for panflute
See:
https://github.com/sergiocorreia/panflute
https://github.com/sergiocorreia/panflute-filters
"""
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description f... |
#!/usr/bin/python2
# -*- coding:Utf-8 -*-
import os
import commands
import tempfile
from vim_utils import *
def validate_prefered_rules(vim):
"""Validate current XML file against prefered rules of prefered rule_type"""
prefered = vimvar(vim,'exvp_validation_prefered')
validate_rules(vim,prefered)
def v... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core import jsontools as json
from core import scrapertools
from core import servertools
from core.item import Item
from platformcode import config, logger
from core import httptoo... |
import redis
from sauron import logger
from sauron.metrics import Metric, MetricException
class RedisMetric(Metric):
@staticmethod
def parseMemory(x):
try:
if 'G' in x:
return (x.replace('G', ''), 'Gigabytes')
elif 'M' in x:
return (x.replace('M'... |
#!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
# the Samba test suite.
# The output of this script is parsed by selftest.pl, which then decides
# which of the tests to actually run. It will, for example, skip all tests
# listed in selftest/skip or only run a subset during ... |
import httplib
import json
import mock
from crane.search.base import SearchResult, SearchBackend
import base
class TestSearch(base.BaseCraneAPITest):
def test_no_query(self):
response = self.test_client.get('/v1/search')
self.assertEqual(response.status_code, httplib.BAD_REQUEST)
def test_... |
iš sudoku_lenta reikalinga SudokuLenta
iš taisykles reikalingas Sprendėjas
klasė Spausdintojas:
@staticmethod
tai spausdinkSudokuLentą(lenta):
res = ""
imk eilnr iš intervalo (0, 9):
imk stulpnr iš intervalo (0, 9):
l = lenta.langeliai[eilnr, stulpnr]
... |
# coding: utf-8
import os.path
import pickle
import numpy as np
#from chainer import cuda
import chainer.functions as F
import Util
"""
CNNによる画像分類 (posi-nega)
- 5層のディープニューラルネット
"""
class ImagePredictor:
def __init__(self, gpu=0):
current_dir_path = os.path.dirname(__file__)
self.model_pkl = cu... |
import re
from .record import Record
from .check import assert_type
from .span import Span
from .token import Token
class TokenRule(Record):
__attributes__ = ['type', 'pattern']
def __init__(self, type, pattern):
self.type = type
self.pattern = pattern
RUSSIAN = 'RU'
LATIN = 'LATIN'
INT =... |
"""
Flask-Exceptional
-----------------
Adds `Exceptional`_ support to Flask applications.
Links
`````
* `documentation <http://packages.python.org/Flask-Exceptional>`_
* `development version
<http://github.com/jzempel/flask-exceptional/zipball/master#egg=Flask-Exceptional-dev>`_
.. _Exceptional: http://www.excep... |
import numpy
def steer2HarmMtx(*args):
''' Compute a steering matrix (maps a directional basis set onto the
angular Fourier harmonics). HARMONICS is a vector specifying the
angular harmonics contained in the steerable basis/filters. ANGLES
(optional) is a vector specifying the angular p... |
import abc
from supriya.ugens.PseudoUGen import PseudoUGen
class LinLin(PseudoUGen):
### CLASS VARIABLES ###
__documentation_section__ = "Line Utility UGens"
### INITIALIZER ###
@abc.abstractmethod
def __init__(self):
raise NotImplementedError
### PUBLIC METHODS ###
@staticm... |
import socket
import sys
import struct
import webbrowser
#este metdo lee la trivia, descarga la imagen y recive la respuesta del usuario
def read_trivia(data):
print 'pokemon id:'+ str(data[1])
size = struct.unpack('I',data[2:6])
#print 'image size:'+ str(size[0])
print 'QUIEN ES ESTE POKEMON?'
im... |
import os
import socket
c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner'
c.JupyterHub.ip = '127.0.0.1'
c.JupyterHub.hub_ip = '127.0.0.1'
# Don't try to cleanup servers on exit - since in general for k8s, we want
# the hub to be able to restart without losing user containers
c.JupyterHub.cleanup_servers = Fals... |
from sympy import sqrt, Rational, oo, Symbol, exp, pi
from sympy.functions import erf
from sympy.statistics.distributions import Normal, Uniform
from sympy.statistics.distributions import PDF
from operator import abs
from sympy.mpmath import mp
def test_normal():
dps, mp.dps = mp.dps, 20
N = Normal(0, 1)
... |
# Copyright 2014-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
class FixedFeesTester(common.TransactionCase):
def setUp(self):
"""Initialize credit control level mock to test fees computations"""
super(FixedFeesTester, self).setUp... |
"""
Django settings for identitone project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... |
# !/usr/bin/env python
"""Test adding objects"""
from __future__ import absolute_import
import os.path
import sys
# Make sure we import from working tree
okconfig_base = os.path.dirname(os.path.realpath(__file__ + "/.."))
sys.path.insert(0, okconfig_base)
import unittest2 as unittest
import okconfig
from pynag impo... |
# Copyright 2017, Fabien Boucher
# Copyright 2017, Red Hat
#
# 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 appli... |
import os
import sys
import csb.test as test
from csb.bio.io.wwpdb import EntryID, StandardID, DegenerateID, SeqResID, InvalidEntryIDError, HeaderFormatError
from csb.bio.io.wwpdb import RobustResidueMapper, FastResidueMapper, CombinedResidueMapper, ResidueMappingError, SparseChainSequence
from csb.bio.io.wwpdb import... |
from mongoforms.forms import *
from .fields import MongoFormFieldGeneratorCustom
import types
from django import forms
from django.utils.datastructures import SortedDict
from mongoengine.base import BaseDocument
from mongoforms.fields import MongoFormFieldGenerator
from mongoforms.utils import mongoengine_validate_wra... |
#!/usr/bin/python
import sys
import argparse
class MddProxyClient(object):
def __init__(self,sock):
if sock==None:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
else:
self.sock = sock
def connect(self,host,port):
self.sock.connect(host,port)
... |
# coding=utf-8
"""preferences.py - Preference handler."""
from __future__ import absolute_import
import cPickle
import os
import gtk
from src import constants
from src import labels
ZOOM_MODE_BEST = 0
ZOOM_MODE_WIDTH = 1
ZOOM_MODE_HEIGHT = 2
ZOOM_MODE_MANUAL = 3
# All the preferences are stored here.
prefs = {
... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2014, Jason Romero
# 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 ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from socket import *
import json
HOST="10.85.156.249"
PORT=9999
ADDR=(HOST,PORT)
s=socket(AF_INET,SOCK_STREAM)
s.bind(ADDR)
s.listen(99999*2)
print("Server Listen...")
while(True):
client,addr=s.accept()
print("Connect from "+str(addr))
RecvStr=cli... |
#***************************************************************************
#* *
#* Copyright (c) 2012 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... |
#Import Libraries
import eventmaster as EM
from time import sleep
import random
import sys
def run_test(name_string, command_send_string, command_recieve_string, test_untyped):
sys.stdout.write('{0!s} Test ...'.format(name_string))
guid_1 = eval(command_send_string)
while s3.has_been_processed(guid_1) != 1:
ti... |
from random import uniform
import numpy
def sigmoidFunction(x):
try:
ret = 1 / (1 + numpy.exp(-x))
except OverflowError:
ret = 0
return ret
def softMax(array):
exp = [numpy.exp(x) for x in array]
return numpy.array([x / sum(exp) for x in exp])
global sigmoid
sigmoid = nump... |
# This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from operator import itemgetter
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.browser.analysisrequest import AnalysisRequestAddView as _ARAV
from ... |
import numpy as np
from skimage.transform import resize
from skimage.util import view_as_blocks
class BlockStatistics():
def __init__(self):
self.name = "Block Statistics Function"
self.description = ("Generates a downsampled output raster by computing a statistical "
... |
"""Basic tests for nav.arnold"""
import unittest
from nav.arnold import find_input_type
class TestArnold(unittest.TestCase):
"""Tests for nav.arnold"""
def test_find_input_type(self):
"""Test find_input_type"""
ip_address = '158.38.129.113'
mac = '5c:f9:dd:78:72:8a'
self.assert... |
# -*- coding: utf-8 -*-
from collections import defaultdict
import json
from typing import Any, DefaultDict, List, Optional, Union
from django.db import connection
from django.http import HttpRequest, Http404, JsonResponse, HttpResponse
from django.shortcuts import get_object_or_404
from rest_framework.decorators i... |
from datetime import datetime
import pytz, sys, re, locale
from dateutil import parser
try:
import simplejson
except ImportError:
import json as simplejson
class Filters():
'''
Checks whether the passed in value is considered useful otherwise will return None
will return None on the f... |
# -*- coding: utf-8 -*-
from wexplorer.database import (
Column,
db,
Model
)
from wexplorer.extensions import bcrypt
class FileUploadPassword(Model):
__tablename__ = 'file_upload_password'
password = Column(db.String(128), nullable=False, primary_key=True)
def __init__(self, password):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.