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 |
|---|---|---|---|---|---|
"""Config flow for kmtronic integration."""
import logging
import aiohttp
from pykmtronic.auth import Auth
from pykmtronic.hub import KMTronicHubAPI
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassi... | w1ll1am23/home-assistant | homeassistant/components/kmtronic/config_flow.py | Python | apache-2.0 | 3,313 |
"""
Copyright (c) 2011, Douban Inc. <http://www.douban.com/>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of con... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/pyspark/join.py | Python | apache-2.0 | 3,453 |
#!/usr/bin/env python
from distutils.core import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (ImportError, IOError):
long_description = open('README.md').read()
version = '1.0.1'
setup(
name='python-status',
version=version,
author='Avinash Sajja... | josuebrunel/status | setup.py | Python | bsd-2-clause | 1,337 |
# -*- coding: UTF-8 -*-
# Copyright 2015-2021 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
SETUP_INFO = dict(
name='lino_extjs6',
version='17.10.0',
install_requires=['lino', 'lino_noi'],
tests_require=[],
test_suite='tests',
description="The Se... | lino-framework/extjs6 | lino_extjs6/setup_info.py | Python | bsd-2-clause | 1,673 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-07 15:24
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('consumption', '0003_auto_20161206_1514'),
]
operation... | Inter-Actief/alexia | alexia/apps/consumption/migrations/0004_auto_20161207_1624.py | Python | bsd-3-clause | 1,004 |
# Copyright (c) 2014, The Boovix authors that are listed
# in the AUTHORS file. All rights reserved. Use of this
# source code is governed by the BSD 3-clause license that
# can be found in the LICENSE file.
"""Main module"""
import wx
# Pylint tests:
# import asd.xyz
# from wx.core import * # no-name-in-module
# as... | CzarekTomczak/boovix | boovix1/main.py | Python | bsd-3-clause | 577 |
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
import pytest
from mne import EpochsArray, SourceEstimate, create_info
from mne.connectivity import spectral_connectivity
from mne.connectivity.spectral import _CohEst, _get_n_epochs
from mne.filter import filter_data
def _stc_ge... | kambysese/mne-python | mne/connectivity/tests/test_spectral.py | Python | bsd-3-clause | 11,203 |
from __future__ import absolute_import, print_function
from ..base import ModelDeletionTask, ModelRelation
class OrganizationDeletionTask(ModelDeletionTask):
def get_child_relations(self, instance):
from sentry.models import (
OrganizationMember,
Commit,
CommitAuthor,
... | mvaled/sentry | src/sentry/deletions/defaults/organization.py | Python | bsd-3-clause | 1,983 |
from app import db
class User(db.Model):
id = db.Column(db.Integer, primary_key = True)
nickname = db.Column(db.String(64), index = True, unique = True)
email = db.Column(db.String(120), index = True, unique = True)
posts = db.relationship('Post', backref='author', lazy='dynamic')
def is_authentic... | pugong/microblog | app/models.py | Python | bsd-3-clause | 961 |
""" Classes for interpolating values.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp',
'ppform', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly',
'RegularGridInterpolator', 'interpn']
import itertools
imp... | pbrod/scipy | scipy/interpolate/interpolate.py | Python | bsd-3-clause | 101,066 |
"""
=====================================
Hawkes simulation with exotic kernels
=====================================
Simulation of Hawkes processes with usage of custom kernels
"""
import matplotlib.pyplot as plt
import numpy as np
from tick.base import TimeFunction
from tick.hawkes import SimuHawkes, HawkesKernelE... | Dekken/tick | examples/plot_hawkes_time_func_simu.py | Python | bsd-3-clause | 1,220 |
"""
test_find_deptid.py -- from a deptid dictionary, find deptids and return
their URIs.
Version 0.1 MC 2013-12-28
-- Initial version. Make a dictionary and make a dictionary with
debug=True
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2013, University of Florida"
__li... | mconlon17/vivo-1.6-upgrade | tools/test_find_deptid.py | Python | bsd-3-clause | 983 |
from ._pls import _PLS
from ..base import _UnstableArchMixin
from ..utils.validation import _deprecate_positional_args
__all__ = ['CCA']
class CCA(_UnstableArchMixin, _PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:... | bnaul/scikit-learn | sklearn/cross_decomposition/_cca.py | Python | bsd-3-clause | 3,317 |
from django.db import models
from constants import APPLICATION_LABEL
from project import Project
from django.contrib.auth.models import User
import os
from django.conf import settings
from django.core.files.storage import FileSystemStorage
def get_upload_path(instance, filename):
"""Function to determine the uplo... | sashakames/COG | cog/models/doc.py | Python | bsd-3-clause | 2,620 |
# -*- coding: utf-8 -*-
"""
baseio
======
Classes
-------
BaseIO - abstract class which should be overridden, managing how a
file will load/write its data
If you want a model for developing a new IO start from exampleIO.
"""
import collections
import logging
from neo import logging_handler
f... | npyoung/python-neo | neo/io/baseio.py | Python | bsd-3-clause | 8,850 |
# -*- coding: utf-8 -*-
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../../... | sunlightlabs/python-sunlight | docs/source/conf.py | Python | bsd-3-clause | 7,153 |
'''
Created on Feb 16, 2013
@author: jasonrudy
'''
from ._version import __version__
from .earth import Earth
| DucQuang1/py-earth | pyearth/__init__.py | Python | bsd-3-clause | 112 |
import simplejson as json
from bamboo.models.dataset import Dataset
from bamboo.tests.controllers.test_abstract_datasets_update import\
TestAbstractDatasetsUpdate
class TestDatasetsUpdateWithCalcs(TestAbstractDatasetsUpdate):
def setUp(self):
TestAbstractDatasetsUpdate.setUp(self)
self._crea... | pld/bamboo | bamboo/tests/controllers/test_datasets_update_with_calcs.py | Python | bsd-3-clause | 2,987 |
import pytest
from stix2.datastore import (
CompositeDataSource, DataSink, DataSource, DataStoreMixin,
)
from stix2.datastore.filters import Filter
from .constants import CAMPAIGN_MORE_KWARGS
def test_datasource_abstract_class_raises_error():
with pytest.raises(TypeError):
DataSource()
def test_da... | oasis-open/cti-python-stix2 | stix2/test/v21/test_datastore.py | Python | bsd-3-clause | 4,765 |
# https://github.com/funkybob/django-array-tags
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.db.models import Count, QuerySet, F
class TagField(ArrayField):
def __init__(self, **kwargs):
self.lower = kwargs.pop('lower', True)
kwargs.setdefault('bl... | vkuryachenko/Django-Shopy | shopifier/admin/tags.py | Python | bsd-3-clause | 2,952 |
import numpy as np
import pytest
from pandas.errors import UnsupportedFunctionCall
import pandas as pd
from pandas import DataFrame, Series
import pandas.core.window as rwindow
from pandas.tests.window.common import Base
import pandas.util.testing as tm
class TestExpanding(Base):
def setup_method(self, method):... | toobaz/pandas | pandas/tests/window/test_expanding.py | Python | bsd-3-clause | 3,707 |
#!/usr/bin/env python
import sys
import time
import random
def write (data):
sys.stdout.write(data + '\n')
sys.stdout.flush()
def main ():
if len(sys.argv) < 2:
print "%s <number of routes> <updates per second thereafter>"
sys.exit(1)
initial = sys.argv[1]
thereafter = sys.argv[2]
if not initial.isdigit(... | mshahbaz/exabgp | dev/self/load/api-internet.py | Python | bsd-3-clause | 2,256 |
# -*- coding: utf-8 -*-
from pyfr.solvers.baseadvec import BaseAdvectionElements
class BaseFluidElements(object):
privarmap = {2: ['rho', 'u', 'v', 'p'],
3: ['rho', 'u', 'v', 'w', 'p']}
convarmap = {2: ['rho', 'rhou', 'rhov', 'E'],
3: ['rho', 'rhou', 'rhov', 'rhow', 'E']}
... | tjcorona/PyFR | pyfr/solvers/euler/elements.py | Python | bsd-3-clause | 2,248 |
from helpdesk.tests.ticket_submission import *
from helpdesk.tests.public_actions import *
| comsnetwork/django-helpdesk | helpdesk/tests/__init__.py | Python | bsd-3-clause | 91 |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | eunchong/build | third_party/oauth2client/oauth2client/multistore_file.py | Python | bsd-3-clause | 13,898 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.ruby
~~~~~~~~~~~~~~~~~~~~
Lexers for Ruby and related languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, ... | wakatime/wakatime | wakatime/packages/py27/pygments/lexers/ruby.py | Python | bsd-3-clause | 22,168 |
# -*- coding: utf-8 -*-
#
# toolchest documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 9 09:59:03 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.
#
#... | openmod-initiative/toolchest | doc/conf.py | Python | bsd-3-clause | 9,604 |
import warnings
import numpy as np
from petram.mfem_config import use_parallel
if use_parallel:
from petram.helper.mpi_recipes import *
import mfem.par as mfem
else:
import mfem.ser as mfem
def make_matrix(x, y, z):
pass
def do_findpoints(mesh, *args):
sdim = mesh.SpaceDimension()
sha... | mfem/PyMFEM | mfem/common/findpoints.py | Python | bsd-3-clause | 1,457 |
# -*- coding: utf-8 -*-
import json
from django.conf import settings
from django.db import connection
from django.test.utils import override_settings
import mock
import six
from six import StringIO
from six.moves.urllib_parse import urlencode
from services import theme_update
from olympia import amo
from olympia.ad... | aviarypl/mozilla-l10n-addons-server | src/olympia/addons/tests/test_theme_update.py | Python | bsd-3-clause | 10,262 |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for cros_mark_as_stable.py."""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpat... | coreos/chromite | scripts/cros_mark_as_stable_unittest.py | Python | bsd-3-clause | 4,604 |
"""
Create a new image.
"""
from PIL import Image
buff = ""
newimage = Image.new("RGBA",(100, 100), None)
newimage = newimage.point(lambda i: i + 257 )
newimage.show()
# PIL.Image.eval(image, *args) may allow us to achieve our goal
| razzius/PyClassLessons | instructors/projects-2015/python_pil/newimage.py | Python | mit | 239 |
from __future__ import absolute_import, print_function, unicode_literals
from django.utils.translation import ugettext_lazy as _
from kolibri.core.hooks import UserNavigationHook
from kolibri.core.webpack.hooks import WebpackBundleHook
from kolibri.plugins.base import KolibriPluginBase
from .hooks import DeviceManage... | christianmemije/kolibri | kolibri/plugins/device_management/kolibri_plugin.py | Python | mit | 835 |
import unittest
import numpy as np
import six
import six.moves.cPickle as pickle
import chainer
from chainer import cuda
from chainer import functions as F
from chainer import testing
from chainer.testing import attr
if cuda.available:
cuda.init()
class MockFunction(chainer.Function):
def __init__(self, ... | woodshop/chainer | tests/test_function_set.py | Python | mit | 4,505 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/vm/_workspace_data_source_settings.py | Python | mit | 6,273 |
#######################################################################
# This file is part of Pyblosxom.
#
# Copyright (C) 2010 by the Pyblosxom team. See AUTHORS.
#
# Pyblosxom is distributed under the MIT license. See the file
# LICENSE for distribution details.
####################################################... | daitangio/pyblosxom | Pyblosxom/plugins/__init__.py | Python | mit | 345 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements methods for writing LAMMPS input files.
"""
import os
import re
import shutil
import warnings
from string import Template
from monty.json import MSONable
from pymatgen.io.lammps.d... | davidwaroquiers/pymatgen | pymatgen/io/lammps/inputs.py | Python | mit | 7,404 |
from __future__ import unicode_literals
from six import with_metaclass
import inspect
from prompt_toolkit.utils import test_callable_args
__all__ = (
'CLIFilter',
'SimpleFilter',
)
class _FilterTypeMeta(type):
def __instancecheck__(cls, instance):
if not hasattr(instance, 'test_args'):
... | Sorsly/subtle | google-cloud-sdk/lib/third_party/prompt_toolkit/filters/types.py | Python | mit | 1,007 |
__version__ = '1.1a1'
__version_long = '1.1a1+007a9b6'
__version_upcoming_annotated_v_tag = '1.1a2'
def version_formatter(dummy):
return '(inplace)'
| kratman/psi4public | psi4/metadata.py | Python | gpl-2.0 | 154 |
"""fforg URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | gpmidi/fragforce.org | ffdonations/urls.py | Python | gpl-2.0 | 1,477 |
# Copyright 2010-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
import sys
from portage import _encodings, _unicode_encode
from portage.exception import PortageException
from portage.tests import TestCase
from _emerge.DependencyArg im... | entoo/portage-src | pym/portage/tests/unicode/test_string_format.py | Python | gpl-2.0 | 3,213 |
#!/usr/bin/python
# -*- coding:UTF-8 -*-
import os
import sys
SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + os.sep
RUNNING_PATH = sys.path[0] + os.sep
| zelotoj/ZLCommon | __init__.py | Python | gpl-2.0 | 168 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... | ipanova/pulp_puppet | pulp_puppet_extensions_admin/test/unit/test_extension_structure.py | Python | gpl-2.0 | 4,415 |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# 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; eithe... | debugger06/MiroX | tv/osx/plat/frontends/widgets/timer.py | Python | gpl-2.0 | 2,181 |
"""A singleton class for accessing global config values
provides access to global configuration file
"""
__author__ = 'raphtee@google.com (Travis Miller)'
import os, sys, ConfigParser, logging
from autotest_lib.client.common_lib import error
class ConfigError(error.AutotestError):
pass
class ConfigValueError... | clebergnu/autotest | client/common_lib/global_config.py | Python | gpl-2.0 | 6,767 |
import os
import sys
import unittest
# should import satyr.py which imports ../../python/.libs/_satyr.so
import satyr
class BindingsTestCase(unittest.TestCase):
def assertGetSetCorrect(self, obj, attr, orig_val, new_val):
'''
Check whether getting/setting an attribute works correctly.
'''
... | airtimemedia/satyr | tests/python/test_helpers.py | Python | gpl-2.0 | 1,112 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | dpniel/snapcraft | integration_tests/test_git_source.py | Python | gpl-3.0 | 5,097 |
"""
Copyright 2013 Steven Diamond
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | SteveDiamond/cvxpy | cvxpy/atoms/elementwise/pos.py | Python | gpl-3.0 | 696 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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... | krips89/robocomp | tools/rcremote/rcremote.py | Python | gpl-3.0 | 2,741 |
# ============================================================================
# FILE: file_rec.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
from .base import Base
from denite.process import Process
from... | omrisim210/dotfiles | .config/nvim/temp/26992/20161015065132/rplugin/python3/denite/source/file_rec.py | Python | gpl-3.0 | 1,813 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from distutils.core import setup
version = None
with open('debops/api.py') as f:
for line in f:
if line.startswith('__version__'):
version = line.replace("'", '').split()[2]
break
setup(
name='debops-api',
description='Machine... | ganto/debops | lib/debops-api/setup.py | Python | gpl-3.0 | 953 |
scalapack = True
compiler = 'gcc43'
libraries = [
'gfortran', 'goto', 'acml',
'scalapack', 'mpiblacsF77init', 'mpiblacs', 'scalapack',
# must not link to mpi explicitly: -export-dynamic must be used instead
]
library_dirs = [
'/opt/openmpi/1.3.3-1.el5.fys.gfortran43.4.3.2/lib64',
'/opt/goto/1.26... | qsnake/gpaw | doc/install/Linux/Niflheim/el5-opteron-gcc43-goto-1.26-acml-4.3.0-TAU.py | Python | gpl-3.0 | 1,846 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@gmail.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | marc-sensenich/ansible | lib/ansible/modules/storage/infinidat/infini_export.py | Python | gpl-3.0 | 5,230 |
"""High-level polynomials manipulation functions. """
from sympy.polys.polytools import (
poly_from_expr, parallel_poly_from_expr, Poly)
from sympy.polys.polyoptions import allowed_flags
from sympy.polys.specialpolys import (
symmetric_poly, interpolating_poly)
from sympy.polys.polyerrors import (
Polifi... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/polys/polyfuncs.py | Python | gpl-3.0 | 7,656 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | dpniel/snapcraft | integration_tests/test_empty_dir.py | Python | gpl-3.0 | 1,186 |
# Orca
#
# Copyright 2010 Joanmarie Diggs, Mesar Hameed.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# ... | ruibarreira/linuxtrail | usr/lib/python3/dist-packages/orca/desktop_keyboardmap.py | Python | gpl-3.0 | 4,636 |
# -*- coding: utf-8 -*-
"""
End-to-end tests for the CCX dashboard.
"""
from nose.plugins.attrib import attr
from common.test.acceptance.fixtures.course import CourseFixture
from common.test.acceptance.tests.helpers import UniqueCourseTest, EventsTestMixin
from common.test.acceptance.pages.lms.auto_auth import AutoAut... | longmen21/edx-platform | common/test/acceptance/tests/lms/test_ccx.py | Python | agpl-3.0 | 1,982 |
# -*- coding: utf-8 -*-
import time
from threading import Lock
from ..utils.struct.lock import lock
class Bucket:
MIN_RATE = 10 << 10 # 10kb minimum rate
def __init__(self):
self._rate = 0
self.token = 0
self.timestamp = time.time()
self.lock = Lock()
def __bool__(sel... | vuolter/pyload | src/pyload/core/network/bucket.py | Python | agpl-3.0 | 1,178 |
import datetime
from itertools import groupby
import warnings
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import connections
from django.db.models import Max
from django.http import Http404
from django.utils.timezone import make_aware, utc
from rest_framework i... | open-craft/edx-analytics-data-api | analytics_data_api/v0/views/courses.py | Python | agpl-3.0 | 26,339 |
from urllib.request import urlopen
import sys
from bs4 import BeautifulSoup
#print(urlopen('http://www.animeka.com/search/index.html?req=%s' % sys.argv[1]).read())
b = BeautifulSoup(urlopen('http://www.animeka.com/search/index.html?req=%s' % sys.argv[1])) # &go_search=1&cat=search&zone_series=1&zone_episodes=1&zone_s... | RaitoBezarius/mangaki | data/search.py | Python | agpl-3.0 | 584 |
"""
Dates Tab Views
"""
from django.http.response import Http404
from edx_django_utils import monitoring as monitoring_utils
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
f... | edx/edx-platform | lms/djangoapps/course_home_api/dates/views.py | Python | agpl-3.0 | 5,595 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from shuup.apps.provides import override_provides
f... | suutari-ai/shoop | shuup_tests/xtheme/test_addon_injections.py | Python | agpl-3.0 | 1,271 |
# -*- coding: utf-8 -*-
##############################################################################
#
# This program 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 version 3 of the L... | alfredoavanzosc/odoo-addons | project_events/wizard/__init__.py | Python | agpl-3.0 | 903 |
#!/usr/bin/env python
"""
show optional Urwid dependencies installed
"""
deps = []
try:
import gi.repository
deps.append("pygobject")
except ImportError:
pass
try:
import tornado
deps.append("tornado")
except ImportError:
pass
try:
import trio
deps.append("trio")
except ImportError:
... | inducer/urwid | bin/deps.py | Python | lgpl-2.1 | 432 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Graphite2(CMakePackage):
"""Graphite is a system that can be used to create "smart fonts" ... | rspavel/spack | var/spack/repos/builtin/packages/graphite2/package.py | Python | lgpl-2.1 | 878 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | var/spack/repos/builtin/packages/signalp/package.py | Python | lgpl-2.1 | 2,610 |
import unittest
from galileo.dongle import DataRing
class testRing(unittest.TestCase):
def testEmpty(self):
r = DataRing(5)
self.assertEqual([], r.getData())
self.assertTrue(r.empty)
self.assertFalse(r.full)
def testCapaNull(self):
r = DataRing(0)
r.add(5)
... | at3560k/fitbit-galileo | tests/testDataRing.py | Python | lgpl-3.0 | 1,680 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | cloud-smokers/openstack-dashboard | django-openstack/django_openstack/dash/views/floating_ips.py | Python | apache-2.0 | 7,277 |
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | sparkslabs/kamaelia_ | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/bencode.py | Python | apache-2.0 | 3,458 |
#!Measurement
'''
baseline:
after: true
before: false
counts: 120
detector: H2
mass: 39.862
settling_time: 15.0
default_fits: nominal
equilibration:
eqtime: 1.0
inlet: H
inlet_delay: 3
outlet: V
use_extraction_eqtime: true
multicollect:
counts: 400
detector: L2(CDD)
isotope: Ar36
peakcenter:... | USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/helix/measurement/felix_analysis400_120_no_save_center.py | Python | apache-2.0 | 2,377 |
import sys
sys.path.insert(1, "../../")
import h2o
def score_history_test(ip,port):
air_train = h2o.import_file(path=h2o.locate("smalldata/airlines/AirlinesTrain.csv.zip"))
gbm_mult = h2o.gbm(x=air_train[["Origin", "Dest", "Distance", "UniqueCarrier", "IsDepDelayed", "fDayofMonth","fMonth"]],
... | weaver-viii/h2o-3 | h2o-py/tests/testdir_misc/pyunit_score_history.py | Python | apache-2.0 | 571 |
# Copyright 2021 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 or agreed to in writing, s... | googleapis/google-cloud-php-managed-identities | owlbot.py | Python | apache-2.0 | 2,665 |
"""The tests for the Netgear Arlo sensors."""
from collections import namedtuple
from unittest.mock import patch
import pytest
from homeassistant.components.arlo import DATA_ARLO, sensor as arlo
from homeassistant.components.arlo.sensor import SENSOR_TYPES
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
... | lukas-hetzenecker/home-assistant | tests/components/arlo/test_sensor.py | Python | apache-2.0 | 7,381 |
# 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 except in compliance with the License. You may obtain
# a ... | openstack/nova | nova/tests/unit/fake_ldap.py | Python | apache-2.0 | 9,212 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# 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
#
# ... | citrix-openstack-build/ceilometer | ceilometer/storage/impl_log.py | Python | apache-2.0 | 7,985 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | ppwwyyxx/tensorflow | tensorflow/python/keras/engine/input_layer.py | Python | apache-2.0 | 10,734 |
config = {
"interfaces": {
"google.cloud.vision.v1p3beta1.ImageAnnotator": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
"in... | jonparrott/google-cloud-python | vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py | Python | apache-2.0 | 1,185 |
"""
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
from __future__ import division
# pylint: disable=E1101,E1103,W0231,E0202
import warnings
from pandas.compat import lmap
from pandas import compat
import numpy as np
from pandas.core.dtypes.missing import isna, notna... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/core/sparse/frame.py | Python | apache-2.0 | 35,083 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | ppwwyyxx/tensorflow | tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py | Python | apache-2.0 | 34,509 |
#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# 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... | xiaoxq/apollo | modules/tools/vehicle_calibration/plot_results.py | Python | apache-2.0 | 2,636 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | ed-/solum | solum/tests/common/test_urlfetch.py | Python | apache-2.0 | 4,353 |
from pynos import device
from st2actions.runners.pythonrunner import Action
class interface_switchport(Action):
def run(self, **kwargs):
conn = (str(kwargs.pop('ip')), str(kwargs.pop('port')))
auth = (str(kwargs.pop('username')), str(kwargs.pop('password')))
test = kwargs.pop('test', False... | tonybaloney/st2contrib | packs/vdx/actions/interface_switchport.py | Python | apache-2.0 | 567 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
# pyeq2 is a collection of equations expressed as Python classes
#
# Copyright (C) 2013 James R. Phillips
# 2548 Vera Cruz Drive
# Birmingham, AL 35235 USA
#
# email: zunzun@zunzun.com
#
... | burkesquires/pyeq2 | ExtendedVersionHandlers/ExtendedVersionHandler_LinearGrowthAndOffset.py | Python | bsd-2-clause | 4,279 |
import math
import random
from collections import defaultdict
def std_dev(values):
"""
Computes the standard deviation of the 'values' list.
TODO: Consider adding support for axes as in numpy and letting this method
accept nested lists:
http://docs.scipy.org/doc/numpy/reference/generated/nump... | murphyke/avocado | avocado/stats/kmeans.py | Python | bsd-2-clause | 25,492 |
"""Test cases for Zinnia's Category"""
from django.contrib.sites.models import Site
from django.test import TestCase
from zinnia.managers import PUBLISHED
from zinnia.models.category import Category
from zinnia.models.entry import Entry
from zinnia.signals import disconnect_entry_signals
class CategoryTestCase(TestC... | Zopieux/django-blog-zinnia | zinnia/tests/test_category.py | Python | bsd-3-clause | 3,097 |
#!/usr/bin/env python
# Python interface to the Data Science Toolkit Plugin
# version: 1.30 (2011-03-16)
#
# See http://www.datasciencetoolkit.org/developerdocs#python for full details
#
# All code (C) Pete Warden, 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | ZachGoldberg/pyaddress | pyaddress/dstk.py | Python | bsd-3-clause | 21,529 |
# -*- coding: utf-8 -*-
import datetime
from decimal import Decimal
import logging as std_logging
import pyelasticsearch
import requests
from django.conf import settings
from django.test import TestCase
from django.utils import unittest
from haystack import connections, reset_search_queries
from haystack import indexe... | manelore/django-haystack | tests/elasticsearch_tests/tests/elasticsearch_backend.py | Python | bsd-3-clause | 49,578 |
#from efl.elementary.access import *
from efl.elementary.actionslider import *
from efl.elementary.background import *
from efl.elementary.box import *
from efl.elementary.bubble import *
from efl.elementary.button import *
from efl.elementary.calendar_elm import *
from efl.elementary.check import *
from efl.elementary... | JeffHoogland/bodhi3packages | python-efl-backsupport/usr/lib/python2.7/dist-packages/elementary/__init__.py | Python | bsd-3-clause | 2,676 |
#!/usr/bin/env python
"""
Burgers equation in 1D solved using discontinous Galerkin method
"""
import argparse
import sys
sys.path.append('.')
from os.path import join as pjoin
import numpy as nm
from examples.dg.example_dg_common import clear_folder, get_gen_1D_mesh_hook
from script.dg_plot_1D import load_and_plot_f... | sfepy/sfepy | examples/dg/imperative_burgers_1D.py | Python | bsd-3-clause | 7,571 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | mindriot101/bokeh | bokeh/core/property/tests/test___init__.py | Python | bsd-3-clause | 1,858 |
import re
from django.utils import datetime_safe
from django.template import loader, Context
from haystack.exceptions import SearchFieldError
class NOT_PROVIDED:
pass
DATETIME_REGEX = re.compile('^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})(T|\s+)(?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2}).*?$')
#... | soad241/django-haystack | haystack/fields.py | Python | bsd-3-clause | 7,150 |
from __future__ import print_function, division
from itertools import product
import numpy as np
import pandas as pd
def inrange(arr, b, f, ind):
"""Ensuring slices are possible.
Parameters
----------
arr: np.ndarray
2d or 3d input array
b: int
The backward adjusted value
f:... | juanshishido/project-eta | code/utils/searchlight.py | Python | bsd-3-clause | 5,199 |
"""
Test that you can set breakpoint and hit the C++ language exception breakpoint
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCPPExceptionBreakpoint (TestBase):
mydir = TestBase.compute_mydir(__file__)
my_var ... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py | Python | bsd-3-clause | 3,056 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2019 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
... | itziakos/haas | haas/tests/test_buffering.py | Python | bsd-3-clause | 3,738 |
# -*- coding: ascii -*-
from doctest import DocFileSuite
import unittest
import os.path
import sys
THIS_DIR = os.path.dirname(__file__)
README = os.path.join(THIS_DIR, os.pardir, os.pardir, 'README.txt')
class DocumentationTestCase(unittest.TestCase):
def test_readme_encoding(self):
'''Confirm the READ... | pexip/os-python-tz | pytz/tests/test_docs.py | Python | mit | 847 |
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
class CvrSoCdAdmin(BaseAdmin):
pass
class Cvr2SoCdAdmin(BaseAdmin):
pass
class Cvr2CampaignDisclosureCdAdmin(BaseAdmin):
pass
class CvrCampaignDisclosureCdAdmin(BaseAdmin):
pass
class Cvr3Verification... | kavyasukumar/django-calaccess-raw-data | calaccess_raw/admin/campaign.py | Python | mit | 1,717 |
# -*- coding: utf-8 -*-
"""Tests for the query parser"""
from unittest import TestCase
from nose.tools import eq_
from dxr.query import query_grammar, QueryVisitor
class VisitorTests(TestCase):
"""Make sure ``QueryVisitor`` is putting together sane data structures."""
def visit(self, query):
retur... | nrc/dxr | tests/test_query_parser.py | Python | mit | 7,049 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import unittest
from wechatpy import parse_message
class ParseMessageTestCase(unittest.TestCase):
def test_parse_text_message(self):
xml = """<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><... | cloverstd/wechatpy | tests/test_parser.py | Python | mit | 14,475 |
# -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Template settings: 'Skeleton' designed to ... | sahana/Turkey | modules/templates/skeleton/config.py | Python | mit | 11,927 |
# Copyright 2014 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from quodlibet.formats import Audio... | Meriipu/quodlibet | tests/plugin/test_brainz.py | Python | gpl-2.0 | 13,585 |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | xkollar/spacewalk | backend/server/rhnSQL/sql_base.py | Python | gpl-2.0 | 11,726 |