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 |
|---|---|---|---|---|---|
# Copyright 2017 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 json
import os
import sys
from gpu_tests import common_browser_args as cba
from gpu_tests import color_profile_manager
from gpu_tests import gpu_int... | chromium/chromium | content/test/gpu/gpu_tests/maps_integration_test.py | Python | bsd-3-clause | 7,116 |
# Authors: David Goodger, Ueli Schlaepfer
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 3892 $
# Date: $Date: 2005-09-20 22:04:53 +0200 (Tue, 20 Sep 2005) $
# Copyright: This module has been placed in the public domain.
"""
This package contains modules for standard tree transforms available
to Docut... | pombreda/django-hotclub | libs/external_libs/docutils-0.4/docutils/transforms/__init__.py | Python | mit | 6,690 |
class TelemetryLimited:
Sng = SerialNumGen()
def __init__(self):
self._telemetryLimiterId = self.Sng.next()
self._limits = set()
def getTelemetryLimiterId(self):
return self._telemetryLimiterId
def addTelemetryLimit(self, limit):
self._limits.add(limit)
def remo... | ksmit799/Toontown-Source | otp/distributed/TelemetryLimited.py | Python | mit | 522 |
import sys
if sys.version_info < (3, 7):
from ._symbolsrc import SymbolsrcValidator
from ._symbol import SymbolValidator
from ._sizesrc import SizesrcValidator
from ._sizeref import SizerefValidator
from ._sizemode import SizemodeValidator
from ._sizemin import SizeminValidator
from ._size ... | plotly/python-api | packages/python/plotly/plotly/validators/splom/marker/__init__.py | Python | mit | 2,113 |
#
# The Python Imaging Library.
# $Id$
#
# TIFF tags
#
# This module provides clear-text names for various well-known
# TIFF tags. the TIFF codec works just fine without it.
#
# Copyright (c) Secret Labs AB 1999.
#
# See the README file for information on usage and redistribution.
#
##
# This module provides constant... | FreddieShoreditch/image_folder_organiser | venv/lib/python2.7/site-packages/PIL/TiffTags.py | Python | mit | 9,273 |
from sympy import (
Abs, And, Derivative, Dummy, Eq, Float, Function, Gt, I, Integral,
LambertW, Lt, Matrix, Or, Piecewise, Poly, Q, Rational, S, Symbol,
Wild, acos, asin, atan, atanh, cos, cosh, diff, erf, erfinv, erfc,
erfcinv, erf2, erf2inv, exp, expand, im, log, pi, re, sec, sin,
sinh, solve, so... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/solvers/tests/test_solvers.py | Python | mit | 58,517 |
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, 'client')
sys.path.insert(0, '../../client')
sys.path.insert(0, '.')
sys.path.insert(0, '../')
import unittest
from entropy.core import EntropyPluginStore, Singleton
from entropy.core.settings.base import SystemSettings
import tests._misc as _misc
class CoreTest(un... | kidaa/entropy | lib/tests/core.py | Python | gpl-2.0 | 1,396 |
#################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... | bhansa/fireball | pyvenv/Lib/site-packages/pygame/tests/color_test.py | Python | gpl-3.0 | 37,664 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import mrp_document
from . import mrp_abstract_workorder
from . import res_config_settings
from . import mrp_bom
from . import mrp_routing
from . import mrp_workcenter
from . import mrp_production
from . import st... | t3dev/odoo | addons/mrp/models/__init__.py | Python | gpl-3.0 | 608 |
"""
Helpers for the API
"""
import re
from collections import namedtuple
from jedi._compatibility import u
from jedi.evaluate.helpers import call_of_leaf
from jedi import parser
from jedi.parser import tokenize
from jedi.cache import time_cache
from jedi import common
CompletionParts = namedtuple('CompletionParts', ... | snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/jedi/api/helpers.py | Python | gpl-3.0 | 10,756 |
#!/usr/bin/env python
#
# Copyright 2005-2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | iohannez/gnuradio | gr-filter/python/filter/qa_rational_resampler.py | Python | gpl-3.0 | 8,932 |
# 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 https://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.base import BasePage
from pages.regions.download_button import ... | flodolo/bedrock | tests/pages/firefox/developer.py | Python | mpl-2.0 | 870 |
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from decimal import Decimal
from numbers import Number
from django.forms import DecimalField
clas... | lawzou/shoop | shoop/admin/forms/fields.py | Python | agpl-3.0 | 1,234 |
test_records = [
[{"doctype":"Campaign", "campaign_name":"_Test Campaign"}],
[{"doctype":"Campaign", "campaign_name":"_Test Campaign 1"}],
] | gangadhar-kadam/mtn-erpnext | selling/doctype/campaign/test_campaign.py | Python | agpl-3.0 | 142 |
# 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... | ghchinoy/tensorflow | tensorflow/python/distribute/multi_worker_util_test.py | Python | apache-2.0 | 8,226 |
"""Support for Legacy MQTT vacuum."""
import json
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.components.mqtt import (
MqttAttributes,
MqttAvailability,
MqttDiscoveryUpdate,
MqttEntityDeviceInfo,
subscription,
)
from homeassistant.components... | sdague/home-assistant | homeassistant/components/mqtt/vacuum/schema_legacy.py | Python | apache-2.0 | 19,424 |
## @file
# Warning information of Eot
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the lic... | bitcrystal/buildtools-BaseTools | Source/Python/Eot/ParserWarning.py | Python | bsd-2-clause | 1,000 |
from werkzeug import redirect
from werkzeug.exceptions import NotFound
from shorty.utils import Session, Pagination, render_template, expose, \
validate_url, url_for
from shorty.models import URL
@expose('/')
def new(request):
error = url = ''
if request.method == 'POST':
url = request.form.get('u... | dbbhattacharya/kitsune | vendor/packages/Werkzeug/examples/shorty/views.py | Python | bsd-3-clause | 1,742 |
from __future__ import unicode_literals
from threading import local
from django.utils import six
from django.utils.encoding import force_text, iri_to_uri
from django.utils.functional import lazy
from django.utils.six.moves.urllib.parse import urlsplit, urlunsplit
from django.utils.translation import override
from .e... | ABaldwinHunter/django-clone-classic | django/urls/base.py | Python | bsd-3-clause | 5,754 |
# Copyright 2015 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 json
from profile_chrome import chrome_startup_tracing_agent
from systrace import decorators
from systrace.tracing_agents import agents_unittest
cl... | endlessm/chromium-browser | third_party/catapult/systrace/profile_chrome/chrome_startup_tracing_agent_unittest.py | Python | bsd-3-clause | 1,066 |
"""
Support the OwnTracks platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.owntracks/
"""
import json
import logging
import threading
from collections import defaultdict
import homeassistant.components.mqtt as mqtt
from homeassist... | mikaelboman/home-assistant | homeassistant/components/device_tracker/owntracks.py | Python | mit | 7,427 |
#!/usr/bin/python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 l... | whbruce/upm | examples/python/gprs.py | Python | mit | 3,287 |
"""Development settings and globals."""
from os.path import join, normpath
from base import *
########## DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
########## END... | browning/shows | shows/shows/settings/local.py | Python | mit | 1,629 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padcv.py
-------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************************... | drnextgis/QGIS | python/plugins/processing/algs/grass7/ext/r_li_padcv.py | Python | gpl-2.0 | 1,324 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for indirect confirmation measures in the indirect_confirmation_measure module.
"""
import logging
import unittest
... | midnightradio/gensim | gensim/test/test_indirect_confirmation.py | Python | gpl-3.0 | 2,906 |
"""CherryPy Benchmark Tool
Usage:
benchmark.py [options]
--null: use a null Request object (to bench the HTTP server only)
--notests: start the server but do not run the tests; this allows
you to check the tested pages with a browser
--help: show this help ... | JonnyWong16/plexpy | lib/cherrypy/test/benchmark.py | Python | gpl-3.0 | 12,563 |
import unittest
import urllib
from datetime import datetime, timedelta
from flask import url_for
from app import current_app as app
from app.helpers.data import save_to_db
from app.helpers.flask_ext.helpers import slugify
from tests.unittests.object_mother import ObjectMother
from tests.unittests.utils import OpenEve... | Achint08/open-event-orga-server | tests/unittests/views/guest/test_search.py | Python | gpl-3.0 | 5,392 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | mrshelly/openerp71313 | openerp/addons/hr_attendance/wizard/hr_attendance_error.py | Python | agpl-3.0 | 2,918 |
"""
Mixin to support editing in Studio.
"""
from xmodule.x_module import AUTHOR_VIEW, STUDENT_VIEW, module_attr
class StudioEditableBlock(object):
"""
Helper methods for supporting Studio editing of XBlocks.
This class is only intended to be used with an XBlock!
"""
has_author_view = True
de... | pepeportela/edx-platform | common/lib/xmodule/xmodule/studio_editable.py | Python | agpl-3.0 | 2,287 |
from __future__ import unicode_literals
from django.contrib.admin.util import label_for_field
from .utils import AppTestCase
from .testapp.models import SimpleModel, ConcreteModel, AbstractModel
class AdminTests(AppTestCase):
"""
Test admin features
"""
def test_list_label(self):
# Ensure mod... | ellmetha/django-parler | parler/tests/test_admin.py | Python | apache-2.0 | 1,318 |
#
# 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
# distributed under ... | apache/aurora | src/main/python/apache/aurora/client/cli/cron.py | Python | apache-2.0 | 5,179 |
fob(...)
1 + ...
| DinoV/PTVS | Python/Tests/TestData/Grammar/Ellipsis.py | Python | apache-2.0 | 17 |
# Copyright 2015, 2018 IBM Corp.
#
# 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 require... | rahulunair/nova | nova/tests/unit/virt/powervm/test_mgmt.py | Python | apache-2.0 | 7,781 |
"""
Tests to ensure that typeguard is working as expected.
This mostly contains negative tests as proof that typeguard can catch errors.
"""
import unittest
from numba.tests.support import TestCase, skip_unless_typeguard
def guard_args(val: int):
return
def guard_ret(val) -> int:
return val
@skip_unless_t... | seibert/numba | numba/tests/test_typeguard.py | Python | bsd-2-clause | 765 |
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkMergeFilter(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vt... | nagyistoce/devide | modules/vtk_basic/vtkMergeFilter.py | Python | bsd-3-clause | 550 |
#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-
# generated by wxGlade 0.3.5.1 on Sat Jun 04 00:11:24 2005
import wx
class FilenameViewModuleMixinFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: FilenameViewModuleMixinFrame.__init__
kwds["style"] = wx.CAPTION|wx.MINIMIZE_BOX... | chrisidefix/devide | resources/python/filename_view_module_mixin_frame.py | Python | bsd-3-clause | 2,169 |
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
# this test is not suitable for autotest because it uses a special clock
# that clashes wi... | google-code-export/los-cocos | test/test_recorder.py | Python | bsd-3-clause | 1,317 |
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
# stdlib
import copy
import random
# pyglet related
import pyglet
from pyglet.window imp... | Alwnikrotikz/los-cocos | samples/tetrico/gamectrl.py | Python | bsd-3-clause | 2,744 |
import unittest
import numpy as np
import pydrake
from pydrake.solvers import ik
import os.path
class TestRBTIK(unittest.TestCase):
def testPostureConstraint(self):
r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf"))
q = -0.9
posture_con... | billhoffman/drake | drake/bindings/python/pydrake/test/testRBTIK.py | Python | bsd-3-clause | 1,165 |
# -*-coding:utf-8 -*-
'''
dac的@indicator版本
提供更简单的使用方式和实现方式
'''
import operator
from collections import (
deque,
)
from .base import (
BaseObject,
fcustom,
indicator,
icache,
t2order_if,
)
from .dac import (
XBASE, #100
... | blmousee/pyctp | example/pyctp/dac2.py | Python | mit | 22,134 |
#*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... | ktan2020/legacy-automation | win/Lib/site-packages/jpype/_jpackage.py | Python | mit | 1,988 |
#! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# This module implements a loop back connection receiving itself what it sent.
#
# The purpose of this module is.. well... You can run the unit tests with it.
# and it was so easy to implement ;-)
#
# (C) 2001-2011 Chris Liecht... | masahir0y/barebox-yamada | scripts/serial/urlhandler/protocol_loop.py | Python | gpl-2.0 | 9,646 |
"""SCons.Tool.sunf90
Tool-specific initialization for sunf90, the Sun Studio F90 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20... | michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/scons-2.3.1/SCons/Tool/sunf90.py | Python | gpl-2.0 | 2,198 |
"""SCons.Scanner.IDL
This module implements the depenency scanner for IDL (Interface
Definition Language) files.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a ... | FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/scons-2.3.1/SCons/Scanner/IDL.py | Python | gpl-2.0 | 1,878 |
#!/usr/bin/env python
'''
xtreme Rat Config Decoder
'''
__description__ = 'xtreme Rat Config Extractor'
__author__ = 'Kevin Breen http://techanarchy.net http://malwareconfig.com'
__version__ = '0.1'
__date__ = '2014/04/10'
#Standard Imports Go Here
import os
import sys
import string
from struct import unpack
from op... | 0x0mar/RATDecoders | Xtreme.py | Python | gpl-3.0 | 10,565 |
# -*- coding: utf-8 -*-
#
## This file is part of Zenodo.
## Copyright (C) 2012, 2013 CERN.
##
## Zenodo 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... | otron/zenodo | zenodo/modules/deposit/tasklets/__init__.py | Python | gpl-3.0 | 922 |
import unittest
import sys
import numpy as np
from opm.util import EModel
try:
from tests.utils import test_path
except ImportError:
from utils import test_path
class TestEModel(unittest.TestCase):
def test_open_model(self):
refArrList = ["PORV", "CELLVOL", "DEPTH", "DX", "DY", "DZ", "PORO", "... | blattms/opm-common | python/tests/test_emodel.py | Python | gpl-3.0 | 5,037 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible 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) any later version.
#
... | andreaso/ansible | lib/ansible/modules/cloud/amazon/ec2_group.py | Python | gpl-3.0 | 22,124 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | addition-it-solutions/project-all | addons/resource/faces/__init__.py | Python | agpl-3.0 | 1,258 |
# Copyright 2020 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... | karllessard/tensorflow | tensorflow/python/keras/tests/get_config_test.py | Python | apache-2.0 | 2,173 |
from nose.tools import * # flake8: noqa
import functools
from framework.auth.core import Auth
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory
)
class TestNodeEmbeds(ApiTestCase):
def setUp(self):
su... | ticklemepierce/osf.io | api_tests/nodes/views/test_node_embeds.py | Python | apache-2.0 | 3,294 |
# -*- coding: utf-8 -*-
import time
import mock
import datetime
import unittest
from nose.tools import * # noqa
import httplib as http
import jwe
import jwt
import furl
import itsdangerous
from modularodm import storage, Q
from framework.auth import cas
from framework.auth import signing
from framework.auth.core im... | wearpants/osf.io | tests/test_addons.py | Python | apache-2.0 | 40,457 |
# 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... | GabrielBrascher/cloudstack | test/selenium/smoke/TemplatesAndISO.py | Python | apache-2.0 | 6,757 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAss... | jvrsantacruz/XlsxWriter | xlsxwriter/test/worksheet/test_sparkline07.py | Python | bsd-2-clause | 14,757 |
# LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
https://docs.djangoproject.com/en/dev/ref/contrib/gi... | jsoref/django | django/contrib/gis/utils/layermapping.py | Python | bsd-3-clause | 27,310 |
"""Inspectors allow you to visually browse through the members of
various python objects. To open an inspector, import this module, and
execute inspector.inspect(anObject) I start IDLE with this command
line: idle.py -c "from inspector import inspect"
so that I can just type: inspect(anObject) any time."""
__all__ =... | ee08b397/panda3d | direct/src/tkpanels/Inspector.py | Python | bsd-3-clause | 15,271 |
from __future__ import unicode_literals
from django.db import models
from django_evolution.mutations import AddField
MUTATIONS = [
AddField('ReviewRequest', 'changedescs', models.ManyToManyField,
related_model='changedescs.ChangeDescription'),
AddField('ReviewRequestDraft', 'changedesc', models.... | chipx86/reviewboard | reviewboard/reviews/evolutions/change_descriptions.py | Python | mit | 432 |
# module 'zmod'
# Compute properties of mathematical "fields" formed by taking
# Z/n (the whole numbers modulo some whole number n) and an
# irreducible polynomial (i.e., a polynomial with only complex zeros),
# e.g., Z/5 and X**2 + 2.
#
# The field is formed by taking all possible linear combinations of
# a set of d ... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/lib-old/zmod.py | Python | gpl-2.0 | 2,363 |
"""
End-to-end test for cohorted courseware. This uses both Studio and LMS.
"""
import json
from nose.plugins.attrib import attr
from studio.base_studio_test import ContainerBase
from ..pages.studio.settings_group_configurations import GroupConfigurationsPage
from ..pages.studio.auto_auth import AutoAuthPage as Stud... | beni55/edx-platform | common/test/acceptance/tests/test_cohorted_courseware.py | Python | agpl-3.0 | 9,754 |
# 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 agreed t... | hayderimran7/tempest | tempest/api/compute/admin/test_servers.py | Python | apache-2.0 | 8,833 |
"""The tests for the GeoNet NZ Quakes Feed integration."""
import datetime
from unittest.mock import patch
from homeassistant.components import geonetnz_quakes
from homeassistant.components.geonetnz_quakes import DEFAULT_SCAN_INTERVAL
from homeassistant.components.geonetnz_quakes.sensor import (
ATTR_CREATED,
... | sander76/home-assistant | tests/components/geonetnz_quakes/test_sensor.py | Python | apache-2.0 | 4,517 |
# 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 ... | CSCI1200Course/csci1200OnlineCourse | modules/dashboard/utils.py | Python | apache-2.0 | 2,730 |
for i in range(1000000):
def f(x, y=1, *args, **kw):
pass
| jonathanverner/brython | www/speed/benchmarks/create_function_complex_args.py | Python | bsd-3-clause | 71 |
# -*- 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 model 'OrganizationOption'
db.create_table('sentry_organizationo... | JackDanger/sentry | src/sentry/south_migrations/0212_auto__add_organizationoption__add_unique_organizationoption_organizati.py | Python | bsd-3-clause | 40,363 |
#!/usr/bin/env python
from db_test import DBDakTestCase
from daklib.dbconn import *
from daklib.cruft import *
import unittest
class CruftTestCase(DBDakTestCase):
"""
This class checks various functions of cruft-report.
"""
def setUp(self):
super(CruftTestCase, self).setUp()
self.in... | purism/pdak | tests/dbtest_cruft.py | Python | gpl-2.0 | 2,916 |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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) any later version.
#
# Ansible is distributed... | chrismeyersfsu/ansible-modules-core | cloud/google/gc_storage.py | Python | gpl-3.0 | 16,863 |
import sys
import os
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler, FileModifiedEvent
class LessCompiler(FileSystemEventHandler):
def __init__(self, source):
self.source = source
FileSystemEventHandler.__init__(self)
def compile_css(s... | hzlf/openbroadcast | website/tools/suit/watch_less.py | Python | gpl-3.0 | 1,306 |
# 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/.
import datetime
import os
import re
import stat
import tempfile
import time
import requests
from socorro.lib import ex... | pcabido/socorro | socorro/external/http/correlations.py | Python | mpl-2.0 | 6,839 |
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest2 as unittest
from mock.tests import support
from mock.tests.support import inPy3k, SomeClass, is_instance, callable
from mock import ... | darkwing/kuma | vendor/packages/mock/tests/testpatch.py | Python | mpl-2.0 | 55,260 |
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | adelez/grpc | src/python/grpcio_testing/grpc_testing/_common.py | Python | apache-2.0 | 4,406 |
"""
Contains things to detect changes - either using options passed in on the
commandline, or by using autodetection, etc.
"""
from __future__ import print_function
from django.db import models
from django.contrib.contenttypes.generic import GenericRelation
from django.utils.datastructures import SortedDict
from sou... | glogiotatidis/mozillians-new | vendor-local/lib/python/south/creator/changes.py | Python | bsd-3-clause | 24,279 |
from unittest import TestCase
import simplejson as json
from operator import itemgetter
class TestItemSortKey(TestCase):
def test_simple_first(self):
a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'}
self.assertEqual(
... | NeostreamTechnology/Microservices | venv/lib/python2.7/site-packages/simplejson/tests/test_item_sort_key.py | Python | mit | 1,376 |
from info import __doc__
from numpy.version import version as __version__
from type_check import *
from index_tricks import *
from function_base import *
from shape_base import *
from stride_tricks import *
from twodim_base import *
from ufunclike import *
import scimath as emath
from polynomial import *
#import conv... | lthurlow/Network-Grapher | proj/external/numpy-1.7.0/numpy/lib/__init__.py | Python | mit | 972 |
class TestStatic(object):
@staticmethod
def static1(self):
pass
@staticmethod
def static2(self):
pass | siddhika1889/Pydev-Editor | tests/pysrc/extendable/static.py | Python | epl-1.0 | 143 |
"""Auto-generated file, do not edit by hand. SJ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_SJ = PhoneMetadata(id='SJ', country_code=47, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='0\\d{4}|[4789]\\d{7}', possible_number_pa... | roubert/python-phonenumbers | python/phonenumbers/data/region_SJ.py | Python | apache-2.0 | 1,827 |
# (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | mo-g/iris | lib/iris/tests/unit/analysis/test_PROPORTION.py | Python | gpl-3.0 | 2,261 |
"""SCons.Tool.JavaCommon
Stuff for processing Java.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# 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 Softw... | carlos-lopez-garces/mapnik-trunk | scons/scons-local-1.2.0/SCons/Tool/JavaCommon.py | Python | lgpl-2.1 | 12,539 |
# Copyright (c) 2016 Baidu, 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 o... | qingqing01/Paddle | python/paddle/trainer/__init__.py | Python | apache-2.0 | 599 |
from lib.action import BaseVMsAction
__all__ = [
'SetVMMetadataItem'
]
class SetVMMetadataItem(BaseVMsAction):
def run(self, vm_id, key, value, region=None):
if region:
cs = self.pyrax.connect_to_cloudservers(region=region)
else:
cs = self.pyrax.cloudservers
s... | armab/st2contrib | packs/rackspace/actions/set_vm_metadata_item.py | Python | apache-2.0 | 490 |
"""Logging for Python YQL."""
import os
import logging
import logging.handlers
LOG_DIRECTORY_DEFAULT = os.path.join(os.path.dirname(__file__), "../logs")
LOG_DIRECTORY = os.environ.get("YQL_LOG_DIR", LOG_DIRECTORY_DEFAULT)
LOG_LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
'warni... | project-fondue/python-yql | yql/logger.py | Python | bsd-3-clause | 1,435 |
#!/usr/bin/env python
#encoding: UTF-8
'''
网易云音乐 Api
'''
import re
import json
import requests
import hashlib
# list去重
def uniq(arr):
arr2 = list(set(arr))
arr2.sort(key=arr.index)
return arr2
default_timeout = 10
class NetEase:
def __init__(self):
self.header = {
'Accept': '*... | liujianpc/NetEase-MusicBox | src/api.py | Python | mit | 9,571 |
# coding: utf-8
from test.util import build_grab
from test.util import BaseGrabTestCase
class TestContentLimit(BaseGrabTestCase):
def setUp(self):
self.server.reset()
def test_nobody(self):
g = build_grab()
g.setup(nobody=True)
self.server.response['get.data'] = 'foo'
... | giserh/grab | test/grab_limit_option.py | Python | mit | 719 |
"""
Tests for courseware middleware
"""
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.http import Http404
from mock import patch
import courseware.courses as courses
from courseware.middleware import RedirectUnenrolledMiddleware
from xmodule.modulestore.tests.d... | eestay/edx-platform | lms/djangoapps/courseware/tests/test_middleware.py | Python | agpl-3.0 | 1,873 |
import platform,subprocess
import posixpath
import os,sys,re,string
import shutil,ConfigParser
import ctypes
import SCons.Action
import SCons.Builder
import SCons.Util
from SCons.Script import *
from SCons.Node.FS import _my_normcase
from SCons.Tool.JavaCommon import parse_java_file
from version_helper import *
from j... | dpauls/OpenMAMA | site_scons/site_init.py | Python | lgpl-2.1 | 932 |
import json
class MapReduce:
def __init__(self):
self.intermediate = {}
self.result = []
def emit_intermediate(self, key, value):
self.intermediate.setdefault(key, [])
self.intermediate[key].append(value)
def emit(self, value):
self.result.append(value)
def e... | iluoyi/data-science-coursera | src/assignment3/MapReduce.py | Python | apache-2.0 | 693 |
# -*- coding: utf-8 -*-
#
# hl_api_models.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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, ... | weidel-p/nest-simulator | pynest/nest/lib/hl_api_models.py | Python | gpl-2.0 | 5,367 |
# coding=utf-8
"""
Test encoding
"""
# pylint: disable=line-too-long
import locale
import os.path
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import sickbeard
fro... | Maximilian-Reuter/SickRage-1 | tests/encoding_tests.py | Python | gpl-3.0 | 1,728 |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QDialog, QUrl
from calibre import url_slash_cleaner
from calibre.... | ashang/calibre | src/calibre/gui2/store/web_store_dialog.py | Python | gpl-3.0 | 1,721 |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | trustedanalytics/spark-tk | python/sparktk/frame/ops/box_cox.py | Python | apache-2.0 | 2,662 |
from __future__ import unicode_literals
import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
def test_sts_get_session_token():
backend = server.create_backend_app("sts")
test_client = backend.test_client()
res = test_client.get('/?Action=GetSessionToken')
res... | botify-labs/moto | tests/test_sts/test_server.py | Python | apache-2.0 | 1,095 |
# 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... | zhimin711/nova | nova/tests/unit/virt/vmwareapi/test_volumeops.py | Python | apache-2.0 | 33,041 |
from mongoengine.base import ValidationError
from crits.core.class_mapper import class_from_id
from crits.core.crits_mongoengine import EmbeddedLocation
from crits.core.handlers import get_item_names
from crits.locations.location import Location
def get_location_names_list(active):
listing = get_item_names(Locat... | kaoscoach/crits | crits/locations/handlers.py | Python | mit | 4,991 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Script to install ARM root image for cross building of ARM chrome on linux.
This script can be run manually but is more often ru... | AndroidOpenDevelopment/android_external_chromium_org | build/linux/install-arm-sysroot.py | Python | bsd-3-clause | 2,718 |
"""Printing subsystem driver
SymPy's printing system works the following way: Any expression can be
passed to a designated Printer who then is responsible to return an
adequate representation of that expression.
The basic concept is the following:
1. Let the object print itself if it knows how.
2. Take the best f... | NikNitro/Python-iBeacon-Scan | sympy/printing/printer.py | Python | gpl-3.0 | 9,328 |
"""AWS plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ..util import (
ApplicationError,
display,
ConfigParser,
)
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..core_ci ... | azaghal/ansible | test/lib/ansible_test/_internal/cloud/aws.py | Python | gpl-3.0 | 3,937 |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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, ei... | hatchetation/freeipa | tests/test_ipalib/__init__.py | Python | gpl-3.0 | 843 |
"""Denon HEOS Media Player."""
from functools import reduce, wraps
import logging
from operator import ior
from typing import Sequence
from pyheos import HeosError, const as heos_const
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
ATT... | tchellomello/home-assistant | homeassistant/components/heos/media_player.py | Python | apache-2.0 | 12,782 |
# This is a helper for the win32trace module
# If imported from a normal Python program, it sets up sys.stdout and sys.stderr
# so output goes to the collector.
# If run from the command line, it creates a collector loop.
# Eg:
# C:>start win32traceutil.py (or python.exe win32traceutil.py)
# will start a process wit... | leighpauls/k2cro4 | third_party/python_26/Lib/site-packages/win32/lib/win32traceutil.py | Python | bsd-3-clause | 1,423 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible 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 Lice... | garyjyao1/ansible | lib/ansible/modules/extras/cloud/cloudstack/cs_securitygroup_rule.py | Python | gpl-3.0 | 14,213 |
# -*- coding: utf-8 -*-
# Copyright 2013 Julien Goret <jgoret@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 3 of the Licen... | kikokubo/Sick-Beard-TPB | lib/subliminal/services/usub.py | Python | gpl-3.0 | 4,305 |