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 -*-
# Copyright 2012 OpenStack Foundation
#
# 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 applic... | takeshineshiro/keystone | keystone/tests/unit/test_backend_sql.py | Python | apache-2.0 | 37,925 |
# Copyright 2015 Internap.
#
# 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, so... | mat128/netman | netman/api/__init__.py | Python | apache-2.0 | 599 |
# 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 u... | jamesliu/mxnet | tests/python/unittest/test_gluon_trainer.py | Python | apache-2.0 | 7,882 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Mac wifi.log parser."""
import unittest
from plaso.formatters import mac_wifi as _ # pylint: disable=unused-import
from plaso.lib import timelib
from plaso.parsers import mac_wifi
from tests.parsers import test_lib
class MacWifiUnitTest(test_lib.ParserTes... | ostree/plaso | tests/parsers/mac_wifi.py | Python | apache-2.0 | 4,128 |
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import json
import unittest
from amaascore.monitor.item import Item
from amaascore.tools.generate_monitor_item import generate_item
class ItemTest(unittest.TestCase):
def setUp(self):
self.longMessage = True ... | amaas-fintech/amaas-core-sdk-python | tests/unit/monitor/item.py | Python | apache-2.0 | 1,147 |
from __future__ import unicode_literals
import sys
if sys.version_info[0] >= 3:
unicode = str
import os
import io
import unittest
if sys.version_info < (3, 3):
import mock # pylint: disable=import-error
else:
from unittest import mock # pylint: disable=import-error
import datetime as dt
import textwrap... | sytjyjj/Group-Homeproject1 | fredapi/tests/test_fred.py | Python | apache-2.0 | 11,209 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | markodolancic/selenium | py/selenium/webdriver/__init__.py | Python | apache-2.0 | 1,927 |
import logging
import time
import gevent
import msgpack
import zmq.green as zmq
from lymph.core.components import Component
from lymph.utils.sockets import bind_zmq_socket
logger = logging.getLogger(__name__)
class MonitorPusher(Component):
def __init__(self, container, aggregator, endpoint='127.0.0.1', inter... | vpikulik/lymph | lymph/core/monitoring/pusher.py | Python | apache-2.0 | 1,268 |
# -*- 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
#... | lxneng/incubator-airflow | airflow/contrib/task_runner/cgroup_task_runner.py | Python | apache-2.0 | 8,763 |
# 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 u... | Laurawly/tvm-1 | tests/micro/arduino/conftest.py | Python | apache-2.0 | 2,694 |
#!/usr/bin/env python
#
# GrovePi Python library
# v1.2.2
#
# This file provides the basic functions for using the GrovePi.
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? Ask on the fo... | minusetheartbot/minusetheartbot | lib/grove_pi_v1_2_6/grovepi.py | Python | apache-2.0 | 19,052 |
#!/usr/bin/python
#
# Copyright 2015 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 b... | coxmediagroup/googleads-python-lib | examples/adwords/v201506/advanced_operations/add_click_to_download_ad.py | Python | apache-2.0 | 3,318 |
# Copyright 2018-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | rcsanchez97/mongo-c-driver | build/evergreen_config_lib/functions.py | Python | apache-2.0 | 26,392 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. 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.or... | yamt/neutron | quantum/plugins/nec/db/api.py | Python | apache-2.0 | 7,759 |
"""Discover DirecTV Receivers."""
from netdisco.util import urlparse
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
"""Add support for discovering DirecTV Receivers."""
def info_from_entry(self, entry):
"""Return the most important info from a uPnP entry."""
url = urlpar... | brburns/netdisco | netdisco/discoverables/directv.py | Python | apache-2.0 | 693 |
"""Test the Plugwise config flow."""
from unittest.mock import AsyncMock, MagicMock, patch
from plugwise.exceptions import (
ConnectionFailedError,
InvalidAuthentication,
PlugwiseException,
)
import pytest
from homeassistant import setup
from homeassistant.components.plugwise.const import (
API,
D... | Danielhiversen/home-assistant | tests/components/plugwise/test_config_flow.py | Python | apache-2.0 | 13,553 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ve... | sparkslabs/kamaelia | Code/Python/Kamaelia/Tools/VideoReframer/EDL.py | Python | apache-2.0 | 4,771 |
from rest_framework import generics, permissions as drf_permissions
from api.base.views import JSONAPIBaseView
from api.base.utils import get_object_or_error
from api.base.filters import ODMFilterMixin
from api.base.pagination import NoMaxPageSizePagination
from api.base import permissions as base_permissions
from api... | rdhyee/osf.io | api/taxonomies/views.py | Python | apache-2.0 | 3,601 |
import asyncio
import ctypes
import os
import time
import unittest
import sys
clib = ctypes.CDLL('libc.so.6', use_errno=True)
class timespec(ctypes.Structure):
_fields_ = [('tv_sec', ctypes.c_long),
('tv_nsec', ctypes.c_long)]
class itimerspec(ctypes.Structure):
_fields_ = [('it_interval',... | asvetlov/europython2015 | timerfd.py | Python | apache-2.0 | 2,878 |
# -*- coding: utf-8 -*-
""" The module provides functions for conversion of a message body/body lines
into classifiers features space.
The body and the message sender string are converted into unicode before
applying features to them.
"""
from talon.signature.constants import SIGNATURE_MAX_LINES
from talon.signature... | saleswise/talon | talon/signature/learning/featurespace.py | Python | apache-2.0 | 2,878 |
# Copyright 2013 IBM Corp.
#
# 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 agree... | takeshineshiro/nova | nova/tests/unit/objects/test_objects.py | Python | apache-2.0 | 68,588 |
"""
Functions for calculating LOFAR hardware specific properties.
"""
import tkp.telescope.lofar.antennaarrays
import tkp.telescope.lofar.beam
import tkp.telescope.lofar.noise
import tkp.telescope.lofar.quality
| bartscheers/tkp | tkp/telescope/lofar/__init__.py | Python | bsd-2-clause | 211 |
# encoding: utf8
from tests import BaseTestCase
import datetime
from redash.models import Query, Group, Event, db
from redash.utils import utcnow
class QueryTest(BaseTestCase):
def test_changing_query_text_changes_hash(self):
q = self.factory.create_query()
old_hash = q.query_hash
q.quer... | hudl/redash | tests/models/test_queries.py | Python | bsd-2-clause | 13,843 |
from Foundation import *
from AppKit import *
class FileSettings(NSObject):
fsdefault_py = None
fsdefault_pyw = None
fsdefault_pyc = None
default_py = None
default_pyw = None
default_pyc = None
factorySettings = None
prefskey = None
settings = None
def getFactorySettingsForFile... | albertz/music-player | mac/pyobjc-framework-Cocoa/Examples/AppKit/PyObjCLauncher/FileSettings.py | Python | bsd-2-clause | 6,020 |
"""
Scrapy - a web crawling and web scraping framework written for Python
"""
import pkgutil
import sys
import warnings
from twisted import version as _txv
# Declare top-level shortcuts
from scrapy.spiders import Spider
from scrapy.http import Request, FormRequest
from scrapy.selector import Selector
from scrapy.ite... | pawelmhm/scrapy | scrapy/__init__.py | Python | bsd-3-clause | 1,044 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'LatestEntriesPlugin.tagged'
db.add_column('cmsplugin_latestentriesplugin', 'tagged', self.gf('djan... | divio/cmsplugin-blog | cmsplugin_blog/migrations/0015_auto__add_field_latestentriesplug.py | Python | bsd-3-clause | 7,566 |
"""This example shows how to create a scatter plot using the `shell` package.
"""
# Major library imports
from numpy import linspace, random, pi
# Enthought library imports
from chaco.shell import plot, hold, title, show
# Create some data
x = linspace(-2*pi, 2*pi, 100)
y1 = random.random(100)
y2 = random.random(10... | burnpanck/chaco | examples/demo/shell/scatter.py | Python | bsd-3-clause | 533 |
"""Test whether all elements of cls.args are instances of Basic. """
# NOTE: keep tests sorted by (module, class name) key. If a class can't
# be instantiated, add it here anyway with @SKIP("abstract class) (see
# e.g. Function).
import os
import re
import warnings
import io
from sympy import Basic, S, symbols, sqrt... | atsao72/sympy | sympy/core/tests/test_args.py | Python | bsd-3-clause | 116,702 |
"""
Formtools Preview application.
"""
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_ti... | skevy/django | django/contrib/formtools/preview.py | Python | bsd-3-clause | 5,860 |
""" This module loads all the classes from the VTK Charts library into
its namespace. This is an optional module."""
import os
if os.name == 'posix':
from libvtkChartsPython import *
else:
from vtkChartsPython import *
| jeffbaumes/jeffbaumes-vtk | Wrapping/Python/vtk/charts.py | Python | bsd-3-clause | 230 |
from __future__ import absolute_import, division, print_function
from keyword import iskeyword
import re
import datashape
from datashape import dshape, DataShape, Record, Var, Mono, Fixed
from datashape.predicates import isscalar, iscollection, isboolean, isrecord
import numpy as np
from odo.utils import copydoc
impo... | maxalbert/blaze | blaze/expr/expressions.py | Python | bsd-3-clause | 22,980 |
"""
kombu.utils.compat
==================
Helps compatibility with older Python versions.
"""
############## py3k #########################################################
import sys
is_py3k = sys.version_info[0] == 3
if is_py3k: # pragma: no cover
from io import StringIO, BytesIO... | rtucker-mozilla/mozpackager | vendor-local/lib/python/kombu/utils/compat.py | Python | bsd-3-clause | 4,371 |
""" Defines the ScalesTickGenerator class.
"""
from numpy import array
from traits.api import Any
from enable.font_metrics_provider import font_metrics_provider
from ticks import AbstractTickGenerator
# Use the new scales/ticks library
from scales.api import ScaleSystem
class ScalesTickGenerator(AbstractTickGenerat... | tommy-u/chaco | chaco/scales_tick_generator.py | Python | bsd-3-clause | 1,682 |
import pytest
from bokeh.charts.stats import Bins
from bokeh.models import ColumnDataSource
import pandas as pd
@pytest.fixture
def ds(test_data):
return ColumnDataSource(test_data.auto_data)
def test_explicit_bin_count(ds):
b = Bins(source=ds, column='mpg', bin_count=2)
assert len(b.bins) == 2
def ... | pombredanne/bokeh | bokeh/charts/tests/test_stats.py | Python | bsd-3-clause | 818 |
import logging
import numpy as np
import pandas as pd
import numexpr as ne
from astropy import units as u, constants as const
from tardis.plasma.properties.base import ProcessingPlasmaProperty
from tardis.plasma.properties.util import macro_atom
logger = logging.getLogger(__name__)
__all__ = ['StimulatedEmissionFac... | orbitfold/tardis | tardis/plasma/properties/radiative_properties.py | Python | bsd-3-clause | 11,605 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | endlessm/chromium-browser | third_party/catapult/third_party/gsutil/third_party/gcs-oauth2-boto-plugin/setup.py | Python | bsd-3-clause | 3,026 |
import re
import numpy as np
import pytest
from pandas.core.dtypes.common import is_categorical_dtype
import pandas as pd
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,
Index,
Interval,
Series,
Timedelta,
Timestamp,
)
import pandas._testing as tm
from pandas.api.types ... | rs2/pandas | pandas/tests/indexing/test_categorical.py | Python | bsd-3-clause | 19,185 |
from netforce.model import get_model
from netforce import migration
from netforce.database import get_connection
class Migration(migration.Migration):
_name="stock.stock_journal"
_version="1.115.0"
def migrate(self):
res=get_model("stock.journal").search([])
if res:
print("Stoc... | sidzan/netforce | netforce_stock/netforce_stock/migrations/stock_journal.py | Python | mit | 1,123 |
#!/usr/bin/env python
# start braile-converter
#
# Copyright 2012 Jonathan Paugh
# See COPYING for license details
import os, sys
if __name__ == '__main__':
mypath = os.path.realpath(os.path.dirname(__file__))
impath = os.path.dirname(mypath)
init_file = os.path.join(impath, 'braille', '__init__.py')
if os.... | jpaugh/braille-converter | bin/brl.py | Python | mit | 404 |
# -*- coding: utf-8 -*-
from plexapi import utils
from plexapi.base import PlexObject
class PlayQueue(PlexObject):
""" Control a PlayQueue.
Attributes:
key (str): This is only added to support playMedia
identifier (str): com.plexapp.plugins.library
initpath (str): Rela... | adamredfern92/PlexDownload | plexapi/playqueue.py | Python | mit | 3,815 |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Hans-Peter Jansen <hpj@urpla.net>.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_... | Khilo84/PyQt4 | examples/draganddrop/delayedencoding/delayedencoding.py | Python | gpl-2.0 | 4,777 |
#/bin/env python
# -*-coding:utf8-*-
'''
# Any issues or improvements please contact jacob-chen@iotwrt.com
'''
import urllib
import json
if __name__ == '__main__':
choose = int(raw_input('1.write 2.read 3.edit 4.remove 5.history'))
domain = raw_input('domain(as 192.168.10.106:8000) : ')
sensor_i... | wzyy2/PiBox | PiBox/sh/datapoint_tools/num.py | Python | gpl-2.0 | 3,324 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PowerDNS Recursor documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 28 14:56:44 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | Habbie/pdns | docs/conf.py | Python | gpl-2.0 | 8,446 |
### Copyright (C) 2009 Vincent Legoll <vincent.legoll@gmail.com>
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions
### are met:
###
### 1. Redistributions of source code must retain the above copyright
### notice, this list... | oliver/meld | vc/cdv.py | Python | gpl-2.0 | 1,787 |
import os.path
from zope.interface import implements
from twisted.cred import credentials
from twisted.spread import pb
from twisted.application.internet import TCPClient
from twisted.python import log
import cvstoys.common # to make sure VersionedPatch gets registered
from buildbot.interfaces import IChangeSource
... | viswimmer1/PythonGenerator | data/python_files/32959020/freshcvs.py | Python | gpl-2.0 | 5,468 |
# Copyright (C) 2017 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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
# (at your option) ... | Valloric/YouCompleteMe | python/ycm/tests/mock_utils.py | Python | gpl-3.0 | 4,496 |
"""
Pakistani-specific Form helpers
"""
from __future__ import unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import CharField, RegexField, Select
from django.utils.encoding import force_text
from django.utils.translation i... | rodrigolucianocosta/ControleEstoque | rOne/Storage101/django-localflavor/django-localflavor-1.3/localflavor/pk/forms.py | Python | gpl-3.0 | 1,810 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/mtx1_models/SHH_WT_models22582.py | Python | gpl-3.0 | 17,582 |
import sys
import os
import shutil
import fnmatch
import re
from optparse import OptionParser
def normaliselines(in_filename, out_filename=None):
in_filename = os.path.normpath(in_filename)
if out_filename is None:
tmp_filename = in_filename + '.tmp'
else:
out_filename = os.pa... | MartyParty21/AwakenDreamsClient | mcp/runtime/pylibs/normlines.py | Python | gpl-3.0 | 2,437 |
# Test case for property
# more tests are in test_descr
import sys
import unittest
from test.support import run_unittest
class PropertyBase(Exception):
pass
class PropertyGet(PropertyBase):
pass
class PropertySet(PropertyBase):
pass
class PropertyDel(PropertyBase):
pass
class BaseClass(object):
... | technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/test/test_property.py | Python | gpl-3.0 | 7,809 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | QuantumElephant/horton | scripts/horton-convert.py | Python | gpl-3.0 | 2,641 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from erpnext.setup.setup_wizard.operations.tax... | adityaduggal/erpnext | erpnext/regional/united_arab_emirates/setup.py | Python | gpl-3.0 | 4,165 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2013 Star2Billing S.L.
#
# The Initia... | garyjs/Newfiesautodialer | newfies/api/api_playgrounds/campaign_delete_cascade_playground.py | Python | mpl-2.0 | 1,138 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2013 Star2Billing S.L.
#
# The Initia... | garyjs/Newfiesautodialer | newfies/context_processors.py | Python | mpl-2.0 | 564 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
... | suyashphadtare/vestasi-erp-jan-end | erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py | Python | agpl-3.0 | 2,556 |
from kombu.tests.utils import unittest
from kombu import BrokerConnection, Exchange
from kombu import compat
from kombu.tests.mocks import Transport, Channel
class test_misc(unittest.TestCase):
def test_iterconsume(self):
class Connection(object):
drained = 0
def drain_events(... | mzdaniel/oh-mainline | vendor/packages/kombu/kombu/tests/test_compat.py | Python | agpl-3.0 | 10,185 |
# -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
#* ... | timthelion/FreeCAD | src/Mod/Path/PathScripts/PathFromShape.py | Python | lgpl-2.1 | 4,466 |
# Copyright 2019 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... | arborh/tensorflow | tensorflow/python/keras/mixed_precision/experimental/layer_correctness_test.py | Python | apache-2.0 | 5,874 |
# Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import unittest
import six
from ... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/astroid/tests/unittest_helpers.py | Python | apache-2.0 | 9,201 |
"""
Openflow tests on an l2 table
"""
import sys
import os
import logging
from oftest import config
import oftest.base_tests as base_tests
import ofp
from oftest.testutils import *
from oftest.parse import parse_mac
import openflow_base_tests
sys.path.append(os.path.join(sys.path[0], '..', '..', '..', '..',
... | notmem/ops-p4dp | targets/l2_switch/tests/of-tests/openflow.py | Python | apache-2.0 | 7,105 |
# 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 use ... | ollie314/kafka | tests/kafkatest/sanity_checks/test_console_consumer.py | Python | apache-2.0 | 4,449 |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | ml-lab/neon | neon/models/model.py | Python | apache-2.0 | 2,293 |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | Mirantis/vmware-dvs | networking_vsphere/utils/vim_session.py | Python | apache-2.0 | 4,940 |
from typing import Any, Dict, List
from django.utils.timezone import now as timezone_now
from zerver.data_import.import_util import build_user_profile
from zerver.models import UserProfile
class UserHandler:
'''
Our UserHandler class is a glorified wrapper
around the data that eventually goes into
z... | brainwane/zulip | zerver/data_import/hipchat_user.py | Python | apache-2.0 | 2,581 |
# Copyright 2016 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... | ibmsoe/tensorflow | tensorflow/python/kernel_tests/losses_test.py | Python | apache-2.0 | 56,534 |
"""TruTeq transport."""
from vumi.transports.truteq.truteq import TruteqTransport
__all__ = ['TruteqTransport']
| TouK/vumi | vumi/transports/truteq/__init__.py | Python | bsd-3-clause | 114 |
import responses
from django.conf import settings
from olympia import amo
from olympia.amo.tests import TestCase, reverse_ns
from olympia.shelves.forms import ShelfForm
from olympia.tags.models import Tag
class TestShelfForm(TestCase):
def setUp(self):
self.criteria_sea_ext = '?promoted=recommended&sort... | mozilla/addons-server | src/olympia/shelves/tests/test_forms.py | Python | bsd-3-clause | 13,298 |
# -*- coding: utf-8 -*-
from . import basic
Basic = basic.BasicCanonicalSolver | rahulsharma1991/frontera | frontera/contrib/canonicalsolvers/__init__.py | Python | bsd-3-clause | 78 |
# This Python file uses the following encoding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from io import StringIO
from astropy import table
from astropy.io import ascii
from astropy.table import Table, QTable
from astropy.table.table_helpers import simple_... | aleksandr-bakanov/astropy | astropy/table/tests/test_pprint.py | Python | bsd-3-clause | 34,752 |
# Author: Travis Oliphant, 2002
#
# Further enhancements and tests added by numerous SciPy developers.
#
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.random import RandomState
from numpy.testing import (assert_array_equal,
assert_almost_equal, ass... | lhilt/scipy | scipy/stats/tests/test_morestats.py | Python | bsd-3-clause | 70,469 |
from __future__ import absolute_import
__all__ = ['cKDTree']
from . import ckdtree
cKDTree = ckdtree.cKDTree
cKDTreeNode = ckdtree.cKDTreeNode
| mhogg/cKDTree-bench | ckdtreebench/spatial_PR4890/__init__.py | Python | bsd-3-clause | 146 |
# Natural Language Toolkit: IPI PAN Corpus Reader
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Konrad Goluchowski <kodie@mimuw.edu.pl>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import functools
from nltk import compat
from nltk.corpus.reader.util import StreamBackedCorpusView, concat
... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/corpus/reader/ipipan.py | Python | mit | 12,717 |
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
| jozefg/solar-system | src/attrdict.py | Python | mit | 148 |
def maximum_value(maximum_weight, items):
pass
| jmluy/xpython | exercises/practice/knapsack/knapsack.py | Python | mit | 51 |
# xml.etree test for cElementTree
import doctest
import sys
from test import support
ET = support.import_module('xml.etree.cElementTree')
SAMPLE_XML = """
<body>
<tag>text</tag>
<tag />
<section>
<tag>subtext</tag>
</section>
</body>
"""
SAMPLE_XML_NS = """
<body xmlns="http://effbot.org/ns">
<tag>te... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_xml_etree_c.py | Python | mit | 5,876 |
# -*- coding: utf-8 -*-
#
# bearcart documentation build configuration file, created by
# sphinx-quickstart on Mon May 6 20:08:35 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
# autogenerated file.
#
# Al... | jlopezpena/bearcart | docs/conf.py | Python | mit | 7,820 |
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | teeple/pns_server | work/install/node-v0.10.25/deps/v8/tools/run-tests.py | Python | gpl-2.0 | 13,499 |
from twisted.trial import unittest
from twisted.internet import threads
import deluge.component as component
class testcomponent(component.Component):
def __init__(self, name, depend=None):
component.Component.__init__(self, name, depend=depend)
self.start_count = 0
self.stop_count = 0
... | Tydus/deluge | deluge/tests/test_component.py | Python | gpl-3.0 | 6,747 |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
from ...extern.six.moves import range
from ...extern.six import string_types
__all__ = [
'plot_corrcoef_matrix',
'corrcoef',
'cov',
]
def plot_corrcoef_matrix(mat... | mverzett/rootpy | rootpy/plotting/contrib/plot_corrcoef_matrix.py | Python | gpl-3.0 | 12,192 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.core.exceptions import PermissionDenied
from mock import Mock, patch
from nose.tools import eq_, raises
fro... | adini121/oneanddone | oneanddone/users/tests/test_mixins.py | Python | mpl-2.0 | 3,843 |
# Generated by Django 1.11.20 on 2019-03-08 14:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_duration_limits', '0005_auto_20190306_1546'),
]
operations = [
migrations.AddIndex(
model_name='coursedurationlimitcon... | edx/edx-platform | openedx/features/course_duration_limits/migrations/0006_auto_20190308_1447.py | Python | agpl-3.0 | 448 |
### Implementation of support for the Cybersource Credit card processor
### The name of this file should be used as the key of the dict in the CC_PROCESSOR setting
### Implementes interface as specified by __init__.py
import time
import hmac
import binascii
import re
import json
from collections import OrderedDict, de... | TsinghuaX/edx-platform | lms/djangoapps/shoppingcart/processors/CyberSource.py | Python | agpl-3.0 | 18,673 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU L... | cbeck88/fifengine | tests/extension_tests/loaders_tests.py | Python | lgpl-2.1 | 2,394 |
#!/usr/bin/python2
""" SETUP tasks
# workaround for RHEL7
# curl https://copr.fedoraproject.org/coprs/lmr/Autotest/repo/epel-7/lmr-Autotest-epel-7.repo > /etc/yum.repos.d/lmr-Autotest-epel-7.repo
# yum --nogpgcheck -y install python-pip
# pip install selenium
yum --nogpgcheck -y install avocado python-selenium
adduse... | harishanand95/cockpit | test/avocado/seleniumlib.py | Python | lgpl-2.1 | 12,177 |
# -*- encoding: utf-8 -*-
# Pilas engine - A video game framework.
#
# Copyright 2010 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import math
import inspect
import pilas
from . import utils
from .actor import Actor
todos = []
__doc__ = ... | fsalamero/pilas | pilas/actores/__init__.py | Python | lgpl-3.0 | 2,442 |
""" Load extensions. """
from os import listdir, path as op
CURDIR = op.dirname(__file__)
LINTERS = dict()
PREFIX = 'pylama_'
try:
from importlib import import_module
except ImportError:
from ..libs.importlib import import_module
for p in listdir(CURDIR):
if p.startswith(PREFIX) and op.isdir(op.join(CU... | ack8006/Python-mode-klen | pymode/libs/pylama/lint/extensions.py | Python | lgpl-3.0 | 738 |
"""The tests for the MQTT device tracker platform."""
import unittest
from unittest.mock import patch
import logging
import os
from homeassistant.bootstrap import setup_component
from homeassistant.components import device_tracker
from homeassistant.const import CONF_PLATFORM
from tests.common import (
get_test_h... | kyvinh/home-assistant | tests/components/device_tracker/test_mqtt.py | Python | apache-2.0 | 2,571 |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | alexandrul-ci/robotframework | src/robot/model/stats.py | Python | apache-2.0 | 6,395 |
# 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... | mlperf/training_results_v0.5 | v0.5.0/google/cloud_v3.8/ssd-tpuv3-8/code/ssd/model/tpu/models/official/retinanet/retinanet_architecture.py | Python | apache-2.0 | 25,570 |
# Copyright 2011 OpenStack Foundation
# 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 requ... | afrolov1/nova | nova/api/openstack/compute/plugins/v3/server_diagnostics.py | Python | apache-2.0 | 2,189 |
from __future__ import absolute_import
import sys
import traceback
__all__ = ['ExceptionInfo', 'Traceback']
DEFAULT_MAX_FRAMES = sys.getrecursionlimit() // 8
class _Code(object):
def __init__(self, code):
self.co_filename = code.co_filename
self.co_name = code.co_name
self.co_argcount ... | kawamon/hue | desktop/core/ext-py/billiard-3.5.0.5/billiard/einfo.py | Python | apache-2.0 | 3,671 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | neuroidss/neon | setup.py | Python | apache-2.0 | 6,352 |
# 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 u... | Guneet-Dhillon/mxnet | tests/python/unittest/test_loss.py | Python | apache-2.0 | 8,986 |
# Copyright 2017 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 applicab... | jiaphuan/models | research/tcn/utils/luatables.py | Python | apache-2.0 | 2,393 |
'Hello ' + models['mvc'].encoders.html(models['name']) | dmaidaniuk/ozark | test/jsr223/src/main/webapp/WEB-INF/views/index.py | Python | apache-2.0 | 54 |
from paddle.trainer_config_helpers import *
WORD_DIM = 3000
sentence = data_layer(name='sentence', size=WORD_DIM)
sentence_embedding = embedding_layer(
input=sentence,
size=64,
param_attr=ParameterAttribute(
initial_max=1.0, initial_min=0.5))
lstm = simple_lstm(input=sentence_embedding, size=64)
l... | emailweixu/Paddle | paddle/capi/examples/model_inference/sequence/trainer_config.py | Python | apache-2.0 | 420 |
from .tower import (
create_instance,
create_instance_group,
create_organization,
create_job_template,
create_notification_template,
create_survey_spec,
create_workflow_job_template,
)
from .exc import (
NotUnique,
)
__all__ = [
'create_instance',
'create_instance_group',
'... | GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awx/main/tests/factories/__init__.py | Python | apache-2.0 | 486 |
"""Persyst module for conversion to FIF."""
# Author: Adam Li <adam2392@gmail.com>
#
# License: BSD (3-clause)
from .persyst import read_raw_persyst
| rkmaddox/mne-python | mne/io/persyst/__init__.py | Python | bsd-3-clause | 151 |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | juanchopanza/NeuroM | neurom/check/tests/test_morphtree.py | Python | bsd-3-clause | 7,427 |
"""
@author: Deniz Altinbuken, Emin Gun Sirer
@note: Bounded Semaphore Coordination Object
@copyright: See LICENSE
"""
from threading import Lock
from concoord.exception import *
class DBoundedSemaphore():
def __init__(self, count=1):
if count < 0:
raise ValueError
self.__count = int(co... | tempbottle/concoord | concoord/threadingobject/dboundedsemaphore.py | Python | bsd-3-clause | 1,447 |