code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from scout.commands import cli
from scout.server.extensions import store
def test_view_diseases(mock_app):
"""Test CLI that shows all collections in the database"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI
result = runner.invoke(cli, ["view", "collect... | Clinical-Genomics/scout | tests/commands/view/test_view_collections_cmd.py | Python | bsd-3-clause | 491 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['MLP'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_MovingAverage_Seasonal_DayOfMonth_MLP.py | Python | bsd-3-clause | 169 |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2013, The BiPy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------... | biocore/pyqi | pyqi/core/interfaces/html/input_handler.py | Python | bsd-3-clause | 1,074 |
# -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# 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
# lis... | stormi/tsunami | src/primaires/scripting/fonctions/etat_singulier.py | Python | bsd-3-clause | 2,269 |
# Copyright (c) 2016, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import (absolute_import, division, ... | stoewer/nixpy | nixio/pycore/h5group.py | Python | bsd-3-clause | 10,059 |
# -*- coding: utf-8 -*-
"""
GuitarSocieties.org
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2014 Christopher Davis <http://christopherdavis.me>
:license: http://opensource.org/licenses/bsd-3-clause
"""
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.utils.translation import ug... | chrisguitarguy/GuitarSocieties.org | website/urls.py | Python | bsd-3-clause | 624 |
import iotkitclient
import unittest
from config import *
# Test vars
newaccount = "Test101"
class TestAlerts(unittest.TestCase):
def login(self):
iot = iotkitclient.Client(host=hostname, proxies=proxies)
iot.login(username, password)
return iot
# Connection tests
def test_list_a... | bbaltz505/iotkit-libpy | tests/test_alerts.py | Python | bsd-3-clause | 543 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operatio... | tobiasgoecke/django-messages | django_messages/migrations/0001_initial.py | Python | bsd-3-clause | 2,049 |
from indiefilmrentals.products.models import *
from shop_simplecategories.models import *
def categories(request):
return {'categories': Category.objects.all()} | blorenz/indie-film-rentals | indiefilmrentals/products/processors.py | Python | bsd-3-clause | 169 |
from application import app as application
from gevent import monkey
from socketio.server import SocketIOServer
monkey.patch_all()
if __name__ == '__main__':
# SocketIOServer(
# ('', application.config['PORT']),
# application,
# resource="socket.io").serve_forever()
socketio.run(appli... | PhoenixRacing/PhoenixRacingWebApp-noregrets | run_server.py | Python | bsd-3-clause | 327 |
# -*- coding: utf-8 -*-
"""Packaging tools to publish projects on PyPI and GitHub."""
import os
import sys
from pathlib import Path
from shutil import rmtree
from textwrap import dedent
from typing import List, Optional, Tuple
import click
from clit import DRY_RUN_OPTION
from clit.files import shell
from clit.ui impo... | wagnerandreoli/clitoolkit | clit/dev/packaging.py | Python | bsd-3-clause | 17,451 |
"""
Example that sends a single message and exits using the simple interface.
You can use `simple_receive.py` (or `complete_receive.py`) to receive the
message sent.
"""
import eventlet
from kombu import Connection
eventlet.monkey_patch()
def wait_many(timeout=1):
#: Create connection
#: If hostname, u... | ZoranPavlovic/kombu | examples/simple_eventlet_receive.py | Python | bsd-3-clause | 1,188 |
from auditlog.models import LogEntry
from django.contrib import admin
admin.site.unregister(LogEntry)
| OWASP/django-DefectDojo | dojo/admin.py | Python | bsd-3-clause | 103 |
import os
from datetime import date
from unittest.mock import MagicMock, call
import pytest
import imagesize
from kaleidoscope import renderer, generator
from kaleidoscope.model import Gallery, Album, Section, Photo
from kaleidoscope.generator import generate, DefaultListener
def test_generate_gallery_index(tmpdir,... | sergejx/kaleidoscope | tests/test_generator.py | Python | bsd-3-clause | 6,135 |
def extractJstranslationBlogspotCom(item):
'''
Parser for 'jstranslation.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
(... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractJstranslationBlogspotCom.py | Python | bsd-3-clause | 564 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import contextlib
import cStringIO
import datetime
import gzip
import json
import logging
import multiprocessing
import... | nicko96/Chrome-Infra | infra/services/builder_alerts/__main__.py | Python | bsd-3-clause | 12,085 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# ... | ikkebr/PyBozoCrack | docs/conf.py | Python | bsd-3-clause | 8,453 |
"""Application management command utility functions"""
from collections import defaultdict
from django.core.exceptions import ValidationError
from django.db import transaction
from applications.api import derive_application_state
from applications.constants import APPROVED_APP_STATES
from applications.models import (... | mitodl/bootcamp-ecommerce | applications/management/utils.py | Python | bsd-3-clause | 6,610 |
"""Contains miscellaneous utility functions and classes."""
__all__ = ['indent',
'doc', 'adjust', 'difference', 'intersection', 'union',
'sameElements', 'makeList', 'makeTuple', 'list2dict', 'invertDict',
'invertDictLossless', 'uniqueElements', 'disjoint', 'contains',
'replace', 'reduceAngle', 'fitSrcAngle2Dest', 'fit... | brakhane/panda3d | direct/src/showbase/PythonUtil.py | Python | bsd-3-clause | 86,071 |
#!/usr/bin/env python
from distutils.core import setup
from pip.req import parse_requirements
install_reqs = parse_requirements("requirements.txt", session=False)
reqs = [str(ir.req) for ir in install_reqs]
setup(name='pgoapi',
version='1.0',
url='https://github.com/tejado/pgoapi',
packages=['pgoa... | earthchie/PokemonGo-Bot | setup.py | Python | mit | 355 |
#!/usr/bin/python3
"""
Cleans-up Sphinx-only constructs (ie from README.rst),
so that *PyPi* can format it properly.
To check for remaining errors, install ``sphinx`` and run::
python setup.py --long-description | sed -file 'this_file.sed' | rst2html.py --halt=warning
"""
import re
import sys, io
def yie... | iSTB/python-schemata | rst_cleaner.py | Python | mit | 1,813 |
x = [4,6,1,3,5,7,25]
y = [4, "Tom", 1, "Michael", 5, 7, "Jimmy Smith"]
def draw_stars(x):
index = 0
while index < len(x):
if type(x[index])is str:
first_letter = x[index].lower()
print first_letter[0] * len(first_letter)
else:
print "*" * x[index]
index = index + 1
draw_stars(y)
| jiobert/python | Velez_Felipe/Asignments/draw_stars.py | Python | mit | 300 |
# coding: utf-8
__author__ = 'Junki Ishida'
from ._compat import str_types, int_types, int_or_float_types, raise_with_inner, PY2
from .exceptions import FormatError
from decimal import Decimal
from datetime import datetime, date
try:
import dateutil.parser
except ImportError:
pass
def str_to_str(value):
... | gomafutofu/mbserializer | mbserializer/converters.py | Python | mit | 4,218 |
from django.template.loader import get_template
from . import BaseNotification
class EmailNotification(BaseNotification):
def get_message(self):
template = get_template('user_profile/notification/email/issue.txt')
return template.render({
'issue': self.issue,
'notification... | mcallistersean/b2-issue-tracker | toucan/user_profile/notifications/email.py | Python | mit | 561 |
try:
import json as _json
except ImportError:
import sys
sys.path.append("simplejson-2.3.3")
import simplejson as _json
import requests as _requests
import urllib.parse as _urlparse
import random as _random
import base64 as _base64
from configparser import ConfigParser as _ConfigParser
import os as _o... | kbase/narrative | src/biokbase/service/Client.py | Python | mit | 7,649 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0001_squashed_0016_change_page_u... | albertoconnor/website | newsletter/migrations/0001_initial.py | Python | mit | 2,249 |
#!/usr/bin/env python
#
# Copyright (C) 2017 DL
#
import psycopg2
from error_logger.adapter import base_adapter
class PostgresqlAdapter(base_adapter.BaseAdapter):
def __init__(self, *args, **kwargs):
self._args = args
self._kwargs = kwargs
super(PostgresqlAdapter, self).__init__()
... | JShadowMan/package | python/zdl/error_logger/error_logger/adapter/postgresql.py | Python | mit | 412 |
from .base import (BaseGradLogPDF, GradLogPDFGaussian, LeapFrog,
ModifiedEuler, BaseSimulateHamiltonianDynamics, _return_samples)
from .HMC import HamiltonianMC, HamiltonianMCDA
from .NUTS import NoUTurnSampler, NoUTurnSamplerDA
from .Sampling import GibbsSampling, BayesianModelSampling... | sandeepkrjha/pgmpy | pgmpy/sampling/__init__.py | Python | mit | 693 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_s1_gen2.iff"... | anhstudios/swganh | data/scripts/templates/object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_s1_gen2.py | Python | mit | 500 |
import logging
import urllib
import re
from restorm.conf import settings
from restorm.rest import restify
from restorm.exceptions import RestServerException
from restorm.utils import reverse
VALID_GET_STATUS_RESPONSES = (
200, # OK
304, # NOT MODIFIED
)
class ResourceManagerDescriptor(object):
"""
... | joeribekker/restorm | restorm/resource.py | Python | mit | 14,316 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import ijson
import shutil
import logging
import zipfile
import tempfile
import requests
from .. import base
from .record import Record
... | opentrials/collectors | collectors/fdadl/collector.py | Python | mit | 2,443 |
#
import os
import math
from array import array
import optparse
import ROOT
from ROOT import *
import scipy
import Plotting_Header
from Plotting_Header import *
def cutcount(varname):
VAR = [varname, 50, 0, 100 ]
YT = "events / "+str((VAR[3]-VAR[2])/VAR[1])+" GeV"
#YT = "events"
XT = varname+" (GeV)"
H = "Type 1 ... | anovak10/plots | DDTmethod/CutCounter.py | Python | mit | 2,167 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as SignatureHash().
This file is modified from python-ioplib.
... | Anfauglith/iop-hd | test/functional/test_framework/script.py | Python | mit | 25,954 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('lugar', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='DiasEfect... | shiminasai/mapafinca | clima/migrations/0001_initial.py | Python | mit | 4,223 |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
STORAGE_A... | Azure/azure-sdk-for-python | sdk/storage/azure-storage-queue/tests/settings/settings_fake.py | Python | mit | 647 |
# -*- coding: utf-8 -*-
#
# genologics-sql documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 27 15:17:17 2016.
#
# 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... | Galithil/genologics_sql | doc/source/conf.py | Python | mit | 9,443 |
from misc_utils import get_config, get_logger, tokenize
from discourse_relation import DiscourseRelation
from collections import Counter, defaultdict
import json
import abc
import numpy as np
from os.path import join
import os
logger = get_logger(__name__)
class Resource(metaclass=abc.ABCMeta):
def __init__(self,... | jimmycallin/master-thesis | architectures/svm_baseline/resources.py | Python | mit | 5,218 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-01 01:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_v2', '0006_remove_event_is_valid'),
]
operations = [
migrations.AlterFi... | AstroMatt/esa-time-perception | backend/api_v2/migrations/0007_auto_20170101_0101.py | Python | mit | 3,986 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from os import environ
from .base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_... | cubledesarrollo/django-cuble-project | project_name/project_name/settings/production.py | Python | mit | 2,222 |
"""
.. currentmodule:: pylayers.antprop.diff
.. autosummary::
:members:
"""
from __future__ import print_function
import doctest
import os
import glob
import numpy as np
import scipy.special as sps
import matplotlib.pyplot as plt
import pdb
def diff(fGHz,phi0,phi,si,sd,N,mat0,matN,beta=np.pi/2):
""" Luebbers... | dialounke/pylayers | pylayers/antprop/diff.py | Python | mit | 13,499 |
from django.contrib.auth.base_user import BaseUserManager
class UserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, email, password, **extra_fields):
"""
Creates and saves a User with the given email and password.
"""
if not email:
raise V... | jokuf/hack-blog | users/managers.py | Python | mit | 1,053 |
from rpython.rlib import jit
from ..expression_node import ExpressionNode
from .....vmobjects.block_ast import AstBlock
from .....vmobjects.double import Double
from .....vmobjects.integer import Integer
from .....vmobjects.method_ast import AstMethod
class AbstractToDoNode(ExpressionNode):
_immutable_fields_ ... | smarr/RTruffleSOM | src/som/interpreter/ast/nodes/specialized/to_do_node.py | Python | mit | 3,664 |
""" Units module. """
class Units(object):
""" Static class containing units. """
M = 10 ** 6
K = 10 ** 3
m = 10 ** -3
u = 10 ** -6
n = 10 ** -9
p = 10 ** -12
a = 10 ** -15
| ThatSnail/impede | impede-app/server/py/units.py | Python | mit | 207 |
from toast.scene_graph import Component
class Animation(Component):
def __init__(self, key=None, frames=None):
super(Animation, self).__init__()
self.__animation_list = {}
self.key = ''
self.__current_image = None
self.__index = 0
self.__time = 0
... | JoshuaSkelly/Toast | toast/animation.py | Python | mit | 2,328 |
"""General utility functions for pyamg"""
__docformat__ = "restructuredtext en"
from warnings import warn
import numpy as np
import scipy as sp
from scipy.sparse import isspmatrix, isspmatrix_csr, isspmatrix_csc, \
isspmatrix_bsr, csr_matrix, csc_matrix, bsr_matrix, coo_matrix, eye
from scipy.sparse.sputils impo... | huahbo/pyamg | pyamg/util/utils.py | Python | mit | 65,500 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class W... | kleetus/bitcoin | qa/rpc-tests/wallet.py | Python | mit | 13,538 |
import os
import time
import sublime
from .console_write import console_write
from .package_disabler import PackageDisabler
from .settings import pc_settings_filename, load_list_setting, save_list_setting
class PackageRenamer(PackageDisabler):
"""
Class to handle renaming packages via the renamed_packages s... | koery/win-sublime | Data/Packages/Package Control/package_control/package_renamer.py | Python | mit | 5,516 |
"""Tests for the template tests."""
import unittest
from grow.templates import tests
class BuiltinTestsTestCase(unittest.TestCase):
def test_subset_filter(self):
"""Provided value is a subset when has all the required values."""
value = ['banana', 'apple']
test_value = ['banana']
... | grow/pygrow | grow/templates/tests_test.py | Python | mit | 2,013 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/tatooine/shared_pillar_pristine_small_style_01.iff"
result.at... | anhstudios/swganh | data/scripts/templates/object/static/structure/tatooine/shared_pillar_pristine_small_style_01.py | Python | mit | 469 |
"""This module's main class reads a text corpus and assembles a list of n
most common words."""
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
from cltk.corpus.utils.formatter import assemble_tlg_author_filepaths
from cltk.corpus.utils.formatter import assemble_phi... | mbevila/cltk | cltk/utils/frequency.py | Python | mit | 2,334 |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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... | eswartz/RenderPipeline | rpcore/pynative/shadow_atlas.py | Python | mit | 3,799 |
# -*- 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 index on 'Tweet', fields ['analyzed_by']
db.create_index(u'twitt... | michaelbrooks/django-twitter-stream | twitter_stream/migrations/0002_auto__add_index_tweet_analyzed_by__add_index_tweet_created_at.py | Python | mit | 6,130 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/city_deed/shared_theater_corellia_deed.iff"
result.attribute_t... | obi-two/Rebelion | data/scripts/templates/object/tangible/deed/city_deed/shared_theater_corellia_deed.py | Python | mit | 465 |
try:
import simplejson as json
except:
import json
import os
import re
import subprocess
import click
from radiotool.composer import Speech, Segment, Composition
from align import do_alignment
ac_re = re.compile(r"\[Ac=(-?\d+)")
def alignment_with_breaths(speech_file, alignment_file, out_alignment_file=None... | Silance/classTranscribe | p2fa-vislab-master/detect_breaths.py | Python | mit | 4,234 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PrioritiseTransaction code
#
from test_framework.test_framework import BitcoinTestFramework
fro... | patricklodder/dogecoin | qa/rpc-tests/prioritise_transaction.py | Python | mit | 6,684 |
from itertools import tee, chain, combinations
from collections import defaultdict
from pgmpy.factors import Factor
from pgmpy.factors.Factor import factor_product
from pgmpy.inference import Inference, BeliefPropagation
class DBNInference(Inference):
def __init__(self, model):
"""
Class for perf... | anaviltripathi/pgmpy | pgmpy/inference/dbn_inference.py | Python | mit | 18,559 |
#!/usr/bin/env python2
# ============================================================
# File: hex-array.py [input files]
# Description: inputs a file, and formats it in a hex array
# Created by Henry Crute
# 3/5/2015
# ============================================================
#12 hex digits on a line
import sys
... | seadsystem/ShR2 | ESP8266/keys/hex_array.py | Python | mit | 804 |
# import os
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
# from vmprof import DjangoVMPROF
# vmprof = DjangoVMPROF("localhost", 8000, "token")
# app = vmprof(get_wsgi_application())
from django.core.wsgi import get_wsgi_application
app = get_wsgi_application()
| vmprof/vmprof-server | webapp/wsgi.py | Python | mit | 280 |
# encoding: utf-8
from rest_framework import status
from rest_framework.exceptions import APIException
class PDFFileNotFound(APIException):
status_code = status.HTTP_404_NOT_FOUND
| drgarcia1986/drf-pdf | drf_pdf/exceptions.py | Python | mit | 186 |
from iminuit import Minuit
from probfit import UnbinnedLH, gaussian, Extended
from matplotlib import pyplot as plt
from numpy.random import randn
data = randn(1000)*2 + 1
ulh = UnbinnedLH(gaussian, data)
m = Minuit(ulh, mean=0., sigma=0.5)
plt.figure(figsize=(8, 6))
plt.subplot(221)
ulh.draw(m)
plt.title('Unextended... | mtresch/probfit | doc/pyplots/costfunc/ulh.py | Python | mit | 726 |
#!/usr/bin/env python
########################################################################.......
"""Print all arguments to stdout, separated by spaces.
"""
from __future__ import print_function
import sys
def main(args):
# Not using argparse here, because echo should echo anything that is not a
# valid... | jsbain/stash | bin/echo.py | Python | mit | 1,000 |
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from helpcenter import models
# Default Values
ARTICLE_BODY = 'Test article body.'
ARTICLE_TITLE = 'Test Article'
CATEGORY_TITLE = 'Test Category'
def create_article(title=ARTICLE_TITLE, body=ARTICLE_BODY,
... | smalls12/django_helpcenter | helpcenter/testing_utils.py | Python | mit | 2,482 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# EDPC Mentoring Database documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 28 23:28:25 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are pres... | rjw57/edpcmentoring | docs/conf.py | Python | mit | 10,393 |
# coding: utf-8
from __future__ import unicode_literals
from ..util import get_doc
from ...tokens import Doc
from ...vocab import Vocab
from ...attrs import LEMMA
from ...tokens import Span
import pytest
import numpy
@pytest.mark.parametrize('text', [["one", "two", "three"]])
def test_doc_api_compare_by_string_posi... | aikramer2/spaCy | spacy/tests/doc/test_doc_api.py | Python | mit | 10,763 |
"""
Testing frame work for Wrapping Textures
Written by Zachary Ferguson
"""
from __future__ import print_function
import scipy.sparse
import scipy.sparse.linalg
import numpy
import pdb
from recordclass import recordclass
import includes
import bilerp_energy as energy
import seam_gradient
from seam_intervals impo... | zfergus2/Wrapping-Textures | tests/energy_tests/energy_test.py | Python | mit | 7,271 |
"""SCons.Tool.bcc32
XXX
"""
#
# __COPYRIGHT__
#
# 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, ... | datalogics/scons | src/engine/SCons/Tool/bcc32.py | Python | mit | 2,993 |
#!/usr/bin/python
# coding=utf-8
"""
Project MCM - Micro Content Management
SDOS - Secure Delete Object Store
Copyright (C) <2016> Tim Waizenegger, <University of Stuttgart>
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.
"""
import logging,... | timwaizenegger/osecm-sdos | mcm/__init__.py | Python | mit | 1,307 |
"""
Requirements file parsing
"""
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
from __future__ import absolute_import
import optparse
import os
import re
import shlex
import sys
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._internal... | davidharvey1986/pyRRG | unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_internal/req/req_file.py | Python | mit | 19,075 |
import sys
from fabric.api import *
from fabric.contrib import *
from fabric.contrib.project import rsync_project
from defaults import fab
from config import ssh, sudoers
import {%= name %}
@task
def prepare_vm():
sudoers.setup_sudoers_on_vm()
@task(default=True)
def system():
print 'start here'
| haimich/knick-knack | doc/folderstructure/v3.2/ .knick-knack/python-fabric/files/setup.py | Python | mit | 309 |
######################################################################
#
# Copyright (C) 2013
# Associated Universities, Inc. Washington DC, USA,
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Fo... | e-koch/VLA_Lband | 16B/pipeline4.7.1_custom/EVLA_pipe_testgains.py | Python | mit | 8,921 |
"""
components.verisure
~~~~~~~~~~~~~~~~~~~
Provides support for verisure components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/verisure/
"""
import logging
import time
from datetime import timedelta
from homeassistant import bootstrap
from homeas... | nnic/home-assistant | homeassistant/components/verisure.py | Python | mit | 5,074 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resources_move_info.py | Python | mit | 1,105 |
import tacticenv
import unittest
from pyasm.security import Batch
Batch()
from pyasm.biz.pipeline_test import ProcessTest
unittest.main()
| Southpaw-TACTIC/TACTIC | src/test/pipeline_test.py | Python | epl-1.0 | 143 |
#!/usr/bin/python3
import os
import urllib
import socket
from gi.repository import GObject, Nautilus
class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider):
nautilusVFSFile_table = {}
registered_paths = {}
remainder = ''
connected = False
watch_id = 0
d... | ckamm/mirall | shell_integration/nautilus/ownCloud.py | Python | gpl-2.0 | 5,047 |
from concurrent.futures import ThreadPoolExecutor
class SingletonThreadPoolExecutor(ThreadPoolExecutor):
"""
该类不要直接实例化
"""
def __new__(cls, max_workers=None, thread_name_prefix=None):
if cls is SingletonThreadPoolExecutor:
raise NotImplementedError
if getattr(cls, '_object... | skyoo/jumpserver | apps/common/thread_pools.py | Python | gpl-2.0 | 538 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from urbansim.functions import attribute_label
class is_high_income_x_percent_high_income(Variable):
"""Percent of households with high-i... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/household_x_zone/is_high_income_x_percent_high_income.py | Python | gpl-2.0 | 1,967 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.resources import Resources
from opus_core.misc import take_choices, do_id_mapping_dict_from_array
from opus_core.misc import DebugPrin... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/opus_core/datasets/interaction_dataset.py | Python | gpl-2.0 | 33,528 |
import logging
from copy import deepcopy
from montepetro.seed_generators import SeedGenerator
class Model(object):
def __init__(self, name, seed):
self.name = name
self.seed = seed
self.seed_generator = SeedGenerator(self.seed)
self.properties = {}
self.regions = {}
de... | LukasMosser/MontePetro | montepetro/models.py | Python | gpl-2.0 | 2,237 |
# -*- coding: utf-8 -*-
# RTCP Datagram Module
from struct import unpack, pack
debug = 0
# Receiver Reports included in Sender Report
class Report:
SSRC = 0
FractionLost = 0
CumulativeNumberOfPacketsLostH = 0
CumulativeNumberOfPacketsLostL = 0
ExtendedHighestSequenceNumberReceived = 0
Interarr... | plazmer/pyrtsp | rtcp_datagram.py | Python | gpl-2.0 | 6,169 |
"""@package forcebalance.nifty Nifty functions, intended to be imported by any module within ForceBalance.
Table of Contents:
- I/O formatting
- Math: Variable manipulation, linear algebra, least squares polynomial fitting
- Pickle: Expand Python's own pickle to accommodate writing XML etree objects
- Commands for sub... | choderalab/open-forcefield-group | qm/crank/nifty.py | Python | gpl-2.0 | 50,665 |
#!/usr/bin/python
import os
from autotest.client import utils
version = 1
def setup(tarball, topdir):
srcdir = os.path.join(topdir, 'src')
utils.extract_tarball_to_dir(tarball, srcdir)
os.chdir(srcdir)
utils.make()
os.environ['MAKEOPTS'] = 'mandir=/usr/share/man'
utils.make('install')
os.... | nacc/autotest | client/deps/grubby/grubby.py | Python | gpl-2.0 | 518 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019-2020 Philipp Wolfer
#
# 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... | Sophist-UK/Sophist_picard | test/formats/test_asf.py | Python | gpl-2.0 | 6,957 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
class developable_residential_units_capacity(Variable):
""""""
_return_type = "int3... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/gridcell/developable_residential_units_capacity.py | Python | gpl-2.0 | 931 |
# Miro - an RSS based video player application
# Copyright (C) 2012
# Participatory Culture Foundation
#
# 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... | debugger06/MiroX | tv/linux/plat/frontends/widgets/hidemouse.py | Python | gpl-2.0 | 2,042 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either v... | sixuanwang/SAMSaaS | wirecloud-develop/src/wirecloud/platform/tests/__init__.py | Python | gpl-2.0 | 2,777 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"Beam-like behaviour with cylinderConnections for roots interaction with spheres."
from __future__ import print_function
from builtins import range
from yade import pack
from yade.gridpfacet import *
#### Parameter ####
young=4.0e6
poisson=3
density=1e3
frictionAngle1=radians... | cosurgi/trunk | examples/cylinders/cylinderconnection-roots.py | Python | gpl-2.0 | 3,527 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ===========================================================================
# iDevice Para Saber más creado para la FPD por José Ramón Jiménez Reyes
# ===========================================================================
"""
Para Saber mas iDevice
"""
import logging
fr... | luisgg/iteexe | exe/engine/parasabermasfpdidevice.py | Python | gpl-2.0 | 5,051 |
# User creation spoke
#
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed i... | dashea/anaconda | pyanaconda/ui/gui/spokes/user.py | Python | gpl-2.0 | 24,175 |
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | M4rtinK/anaconda | tests/unit_tests/pyanaconda_tests/modules/boss/test_set_file_contexts_task.py | Python | gpl-2.0 | 2,587 |
#coding:utf8
"""Tests the HeaderEval Plugin"""
from __future__ import absolute_import
import datetime
import unittest
import tests.util
# Load plugin and report matched RULES and SCORE
PRE_CONFIG = """
loadplugin Mail::SpamAssassin::Plugin::HeaderEval
report _SCORE_
report _TESTS_
"""
class TestFunctionalCheckForF... | SpamExperts/SpamPAD | tests/functional/test_plugins/test_header_eval.py | Python | gpl-2.0 | 87,077 |
from django.contrib import admin
from tshilo_dikotla.base_model_admin import MembershipBaseModelAdmin
from ..models import Receive
class ReceiveAdmin(MembershipBaseModelAdmin):
date_hierarchy = 'receive_datetime'
list_display = ("receive_identifier", "requisition", "receive_datetime", "drawn_datetime",
... | botswana-harvard/tshilo-dikotla | td_lab/admin/receive_admin.py | Python | gpl-2.0 | 955 |
# Copyright (C) 2011 Canonical Ltd
#
# 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 in ... | stewartsmith/bzr | bzrlib/url_policy_open.py | Python | gpl-2.0 | 10,733 |
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | Jamlum/pytomo | pytomo/dns/rdtypes/ANY/X25.py | Python | gpl-2.0 | 2,219 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# This file is part of qmljs, the QML/JS language support plugin for KDevelop
# Copyright (c) 2014 Denis Steckelmacher <steckdenis@yahoo.fr>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# pub... | mali/kdevelop | languages/qmljs/nodejsmodules/http.py | Python | gpl-2.0 | 3,792 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys, csv
import numpy as np
from scipy.cluster.vq import kmeans
import tensorflow as tf
from matplotlib import pyplot as plt
import matplotlib
import gpflow
def plot(m):
f = plt.figure(figsize=(12, 6))
a1 = f.add_axes([0.05, 0.05, 0.9, 0.6])
a2 = f.add_axes([0.0... | sangwook236/general-development-and-testing | sw_dev/python/rnd/test/probabilistic_graphical_model/gpflow/gpflow_multiclass_classification.py | Python | gpl-2.0 | 4,520 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Arkadiusz Socała <as277575@mimuw.edu.pl>
# Michael Cohen <scudette@google.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the... | google/rekall | tools/layout_expert/layout_expert/parsers/c_parser.py | Python | gpl-2.0 | 18,196 |
import os
import sys
# Make sure we import from working tree
pynagbase = os.path.dirname(os.path.realpath(__file__ + "/.."))
sys.path.insert(0, pynagbase)
import unittest2 as unittest
from mock import patch
import shutil
import tempfile
import pynag.Utils as utils
import pynag.Model
from pynag.Utils import PynagError... | starvingprogrammer/pynag | tests/test_utils.py | Python | gpl-2.0 | 18,508 |
import os
from flask.ext.script import Manager, Server
from flask.ext.migrate import MigrateCommand
from app import app
# Create manager
manager = Manager(app)
# Add migrate
manager.add_command('db', MigrateCommand)
# Set server commands
server = Server (host=os.getenv("HOSTNAME", "0.0.0.0"), port=os.getenv("PORT",... | wazts/user-manager | run.py | Python | gpl-2.0 | 463 |
# -*- coding: utf-8 -*-
#
# amsn - a python client for the WLM Network
#
# Copyright (C) 2008 Dario Freddi <drf54321@gmail.com>
#
# 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... | kakaroto/amsn2 | amsn2/ui/front_ends/qt4/splash.py | Python | gpl-2.0 | 1,624 |
# Copyright (c) 2011-2012, Universite de Versailles St-Quentin-en-Yvelines
#
# This file is part of ASK. ASK 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, version 2.
#
# This program is distributed in the h... | benchmark-subsetting/adaptive-sampling-kit | tests/test_util.py | Python | gpl-2.0 | 2,243 |