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 |
|---|---|---|---|---|---|
from django.urls import include, re_path
from rest_framework.routers import SimpleRouter
from rest_framework_nested.routers import NestedSimpleRouter
from olympia.bandwagon.views import CollectionAddonViewSet, CollectionViewSet
from . import views
accounts = SimpleRouter()
accounts.register(r'account', views.Accou... | wagnerand/addons-server | src/olympia/accounts/urls.py | Python | bsd-3-clause | 2,043 |
import sys
sys.path.append('..')
from dojo.tools.generic.parser import GenericFindingUploadCsvParser
from dojo.models import Finding
from dojo.models import Test
import unittest
import datetime
import csv
import StringIO
class TestFile(object):
def read(self):
return self.content
def __init__(self, ... | yan99uic/django-DefectDojo | tests/generic_finding_upload_unit_test.py | Python | bsd-3-clause | 14,167 |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import matplotlib.pyplot as plot
import numpy
from numpy.polynomial.polynomial import polyfit,polyadd,Polynomial
import yaml
INCHES_PER_ML = 0.078
VOLTS_PER_ADC_UNIT = 0.0049
def load_numpy_data(path):
with open(path,'r') as fid:
hea... | JaneliaSciComp/hybridizer | tests/adc_to_volume.py | Python | bsd-3-clause | 5,112 |
#!/usr/bin/python3
############################################################
# etcdlib.py -- etcdlib provides a python etcd client
# author : Bao Li <libao14@pku.edu.cn>, UniAS, SEI, PKU
# license : BSD License
############################################################
import urllib.request, urllib.error
import ... | FirmlyReality/docklet | src/utils/etcdlib.py | Python | bsd-3-clause | 7,437 |
class KeyInvalidException(Exception):
pass
class KeyDisabledException(Exception):
pass
class FastQueryException(Exception):
def __init__(self, last_access=None):
self.last_access = last_access
| krautradio/PyRfK | lib/rfk/exc/api.py | Python | bsd-3-clause | 217 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from shutil import rmtree
import nibabel as nif
import numpy as np
from tempfile import mkdtemp
from nipype.testing import assert_equal, assert_raises, skipif
import nipype.interfaces.freesurfer a... | sgiavasis/nipype | nipype/interfaces/freesurfer/tests/test_preprocess.py | Python | bsd-3-clause | 4,150 |
from __future__ import unicode_literals, division, absolute_import
from datetime import datetime
import logging
import re
import sys
from path import Path
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.entry import Entry
log = logging.getLogger('... | xfouloux/Flexget | flexget/plugins/input/find.py | Python | mit | 3,623 |
import re
from .utils import validator
ip_middle_octet = r"(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5]))"
ip_last_octet = r"(?:\.(?:0|[1-9]\d?|1\d\d|2[0-4]\d|25[0-5]))"
regex = re.compile( # noqa: W605
r"^"
# protocol identifier
r"(?:(?:https?|ftp)://)"
# user:pass authentication
r"(?:[-a-z\u00a1-\uffff0... | kvesteri/validators | validators/url.py | Python | mit | 4,913 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# 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
DOCUMENTATION = '''
---
module: proxysql_mysql_users
versi... | kustodian/ansible | lib/ansible/modules/database/proxysql/proxysql_mysql_users.py | Python | gpl-3.0 | 16,216 |
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class WarserverCz(DeadHoster):
__name__ = "WarserverCz"
__type__ = "hoster"
__version__ = "0.13"
__pattern__ = r'http://(?:www\.)?warserver\.cz/stahnout/\d+'
__description__ = """Warserver.cz... | sebdelsol/pyload | module/plugins/hoster/WarserverCz.py | Python | gpl-3.0 | 472 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Brian Coca <bcoca@ansible.com>
#
# 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... | cmelange/ansible | lib/ansible/modules/system/systemd.py | Python | gpl-3.0 | 16,941 |
# -*- coding: utf-8 -*-
#
# manage.py
#
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Softwa... | ctruchi/deluge-webui2 | deluge/ui/console/commands/manage.py | Python | gpl-3.0 | 5,820 |
# Copyright 2009-2015 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 writi... | pdxwebdev/yadapy | yada/lib/python2.7/site-packages/pymongo/server.py | Python | gpl-3.0 | 6,957 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# 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
DOCUMENTATION = """
name: su
short_description: Substitute User
... | nitzmahone/ansible | lib/ansible/plugins/become/su.py | Python | gpl-3.0 | 5,169 |
#!/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 distribut... | kvar/ansible | lib/ansible/modules/network/cloudengine/ce_interface.py | Python | gpl-3.0 | 31,784 |
import json
import datetime
import HTMLParser
import urllib
import bleach
import jinja2
import pytz
from babel import localedata
from babel.dates import format_date, format_datetime, format_time
from babel.numbers import format_decimal
from jingo import env, register
from pytz import timezone
from soapbox.models impor... | robhudson/kuma | kuma/core/helpers.py | Python | mpl-2.0 | 10,358 |
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from UIElements.scrollableLabel import ScrollableLabel
class ScrollableTextPopup(FloatLayout):
'''
A Pop-up Di... | abetusk/dev | projects/maslowcnc/software/GroundControl-master/UIElements/scrollableTextPopup.py | Python | agpl-3.0 | 494 |
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Appraisal Template')
class TestAppraisalTemplate(unittest.TestCase):
pass
| gangadhar-kadam/verve_test_erp | erpnext/hr/doctype/appraisal_template/test_appraisal_template.py | Python | agpl-3.0 | 297 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Netease 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... | zestrada/nova-cs498cc | nova/tests/test_availability_zones.py | Python | apache-2.0 | 6,307 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ProjectCounts
# Retrieves a count of all projects sorted by project status.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... | jordanemedlock/psychtruths | temboo/core/Library/Basecamp/ProjectCounts.py | Python | apache-2.0 | 3,555 |
"""Offer API to configure the Home Assistant auth provider."""
import voluptuous as vol
from homeassistant.auth.providers import homeassistant as auth_ha
from homeassistant.components import websocket_api
from homeassistant.components.websocket_api import decorators
from homeassistant.exceptions import Unauthorized
... | sdague/home-assistant | homeassistant/components/config/auth_provider_homeassistant.py | Python | apache-2.0 | 5,545 |
#!/usr/bin/env python
"""Load all rdfvalues in this directory to populate the registry.
"""
# These need to register plugins so, pylint: disable=unused-import
from grr.lib.rdfvalues import aff4_rdfvalues
from grr.lib.rdfvalues import anomaly
from grr.lib.rdfvalues import client
from grr.lib.rdfvalues import config_file... | darrenbilby/grr | lib/rdfvalues/registry_init.py | Python | apache-2.0 | 933 |
# Copyright 2014 Open Source Robotics Foundation, 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... | davetcoleman/catkin_tools | catkin_tools/verbs/catkin_build/common.py | Python | apache-2.0 | 4,816 |
# Copyright 2012 VMware, 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 a... | leeseuljeong/leeseulstack_neutron | neutron/db/l3_db.py | Python | apache-2.0 | 55,905 |
"""Support for the AEMET OpenData service."""
from homeassistant.components.weather import WeatherEntity
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import (
ATTR_API_CONDITION,
ATTR_API_HUMIDITY,
ATTR_API_PRESSURE,
ATT... | kennedyshead/home-assistant | homeassistant/components/aemet/weather.py | Python | apache-2.0 | 3,266 |
from __future__ import print_function
import sys
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import jit, types
from numba.tests.support import TestCase, MemoryLeakMixin
import numba.unittest_support as unittest
from numba import testing
enable_pyobj_flags = Flags()
enable_pyobj_f... | ssarangi/numba | numba/tests/test_generators.py | Python | bsd-2-clause | 14,740 |
from streamlink.plugins.n13tv import N13TV
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlN13TV(PluginCanHandleUrl):
__plugin__ = N13TV
should_match = [
"http://13tv.co.il/live",
"https://13tv.co.il/live",
"http://www.13tv.co.il/live/",
"https://www.1... | chhe/streamlink | tests/plugins/test_n13tv.py | Python | bsd-2-clause | 1,113 |
""""
Dummy mocking module for pandas.
When pandas is not avaialbe we will import this module as graphlab.deps.pandas,
and set HAS_pandas to false. All methods that access pandas should check the HAS_pandas
flag, therefore, attributes/class/methods in this module should never be actually used.
"""
'''
Copyright (C) 201... | ylow/SFrame | oss_src/unity/python/sframe/deps/pandas_mock.py | Python | bsd-3-clause | 469 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bokeh/bokeh | tests/integration/tools/__init__.py | Python | bsd-3-clause | 347 |
import os
import re
from subprocess import Popen, PIPE
from django.core.management.utils import find_command
can_run_extraction_tests = False
can_run_compilation_tests = False
# checks if it can find xgettext on the PATH and
# imports the extraction tests if yes
xgettext_cmd = find_command('xgettext')
if xgettext_cm... | postrational/django | tests/i18n/commands/tests.py | Python | bsd-3-clause | 794 |
import os
from optparse import make_option
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import setup_test_environment, teardown_test_environment
from django.utils import unittest
from django.utils.unittest import TestSu... | postrational/django | django/test/runner.py | Python | bsd-3-clause | 10,748 |
###########################################################
#
# Copyright (c) 2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | sadanandb/pmt | src/tactic/ui/panel/freeform_layout_wdg.py | Python | epl-1.0 | 7,039 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2013, 2014 CERN.
#
# Invenio 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... | zenodo/invenio | invenio/modules/ranker/models.py | Python | gpl-2.0 | 10,897 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | KohlsTechnology/ansible | lib/ansible/modules/monitoring/grafana_datasource.py | Python | gpl-3.0 | 18,623 |
#!/usr/bin/python
# encoding: utf-8
# Copyright: (c) 2012, Matt Wright <matt@nobien.net>
# Copyright: (c) 2013, Alexander Saltanov <asd@mokote.com>
# Copyright: (c) 2014, Rutger Spiertz <rutger@kumina.nl>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ imp... | srvg/ansible | lib/ansible/modules/apt_repository.py | Python | gpl-3.0 | 25,568 |
import agoclient
client = agoclient.AgoConnection("test")
def messageHandler(internalid, content):
if "command" in content:
if content["command"] == "test":
retval = {}
retval["hallo"] = "blah"
return retval
return {}
client.addHandler(messageHandler)
client.addDevice("123", "test")
client.run()
| JoakimLindbom/agocontrol | test/test-device.py | Python | gpl-3.0 | 311 |
from __future__ import unicode_literals
def execute():
import webnotes
from webnotes.modules import reload_doc
reload_doc('stock', 'doctype', 'serial_no')
webnotes.conn.sql("update `tabSerial No` set sle_exists = 1")
| gangadhar-kadam/mtn-erpnext | patches/april_2012/serial_no_fixes.py | Python | agpl-3.0 | 222 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('xblock_django.models', 'common.djangoapps.xblock_d... | eduNEXT/edunext-platform | import_shims/studio/xblock_django/models.py | Python | agpl-3.0 | 389 |
# Copyright 2013-2021 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 PySphinxcontribTrio(PythonPackage):
"""This sphinx extension helps you document Python cod... | LLNL/spack | var/spack/repos/builtin/packages/py-sphinxcontrib-trio/package.py | Python | lgpl-2.1 | 851 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GLES2/NV/shadow_samplers_array.py | Python | lgpl-3.0 | 601 |
# -*- coding: utf-8 -*-
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models.pluginmodel import CMSPlugin
from cms.models.titlemodels import Title
from cms.plugin_pool import plugin_pool
from django.core.management.base import NoArgsCommand
from django.db.utils import DatabaseError
c... | mpetyx/palmdrop | venv/lib/python2.7/site-packages/cms/management/commands/subcommands/list.py | Python | apache-2.0 | 3,426 |
# 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/resnet-tpuv3-8/code/resnet/model/models/official/utils/export/export_test.py | Python | apache-2.0 | 2,628 |
# 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... | tensorflow/tensorflow | tensorflow/python/kernel_tests/math_ops/zero_division_test.py | Python | apache-2.0 | 2,457 |
#!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... | foxish/test-infra | mungegithub/issue_labeler/simple_app.py | Python | apache-2.0 | 4,947 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import logging
import os
from modellers.MalletLDA import BuildLDA
def TrainMallet( corpus_path, model_path, token_regex, num_topics, num_iters, is_quiet, force_overwrite ):
logger = logging.getLogger( 'termite' )
logger.addHandler( logging.StreamHandler(... | maoxuxiang/termite_mallet_project | bin/train_mallet.py | Python | bsd-3-clause | 2,344 |
# -*- coding: utf-8 -*-
from cms.models import CMSPlugin
from cms.models.fields import PlaceholderField
from cms.utils.copy_plugins import copy_plugins_to
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class PlaceholderReference(CMSPlugin):
... | jproffitt/django-cms | cms/models/placeholderpluginmodel.py | Python | bsd-3-clause | 1,387 |
"""Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved."""
from __future__ import absolute_import
import json
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import PIL.Image
import skfmm
import digits
from digits.utils import subclass, override
from digits.utils.c... | ethantang95/DIGITS | digits/extensions/view/imageSegmentation/view.py | Python | bsd-3-clause | 10,647 |
import re
from django.conf import settings
from django.utils.encoding import smart_bytes
from pipeline.compilers import CompilerBase
from pipeline.exceptions import CompilerError
class BrowserifyCompiler(CompilerBase):
output_extension = 'browserified.js'
def match_file(self, path):
# Allow for cac... | mythmon/kitsune | kitsune/lib/pipeline_compilers.py | Python | bsd-3-clause | 1,506 |
import os
from django.conf import settings
from django.http import HttpResponse
from django.views.generic import View
from knox.auth import TokenAuthentication
from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework... | lroyland/SalaSIS | src/base/views.py | Python | mit | 1,044 |
# coding: utf-8
import re
SLUG_REMOVE = re.compile(r'[,\s\.\(\)/\\;:]*')
class DatasetException(Exception):
pass
class FreezeException(DatasetException):
pass
| Backflipz/plugin.video.excubed | resources/lib/dataset/util.py | Python | gpl-2.0 | 172 |
#!/usr/bin/env python
#
# System.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | palaniyappanBala/thug | src/Java/System.py | Python | gpl-2.0 | 1,103 |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 28 02:31:03 2015
@author: winpython
"""
import os
import sys, getopt
import time
import numpy as np
from cnn_training_computation import fit, predict
import pickle, cPickle
from matplotlib.pyplot import imshow
import matplotlib.pyplot as plt
from PIL import Image
def ... | artmusic0/theano-learning.part02 | Myfile_run-py_releasev5_SFMAKE/run_v5.0_predict.py | Python | gpl-3.0 | 2,332 |
# Copyright (C) 2007-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | khushboo9293/mailman | src/mailman/interfaces/roster.py | Python | gpl-3.0 | 2,570 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\updateCheckDialog.ui'
#
# Created: Fri Jan 31 15:29:49 2014
# by: PyQt4 UI code generator 4.9.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
ex... | ilektrojohn/creepy | creepy/ui/UpdateCheckDialog.py | Python | gpl-3.0 | 4,920 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob 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 License, or
# (at your op... | sputnick-dev/weboob | weboob/applications/qcineoob/minimovie.py | Python | agpl-3.0 | 3,257 |
from django.test import TestCase
from django.contrib.auth.models import User
from userena import forms
from userena import settings as userena_settings
class SignupFormTests(TestCase):
""" Test the signup form. """
fixtures = ['users']
def test_signup_form(self):
"""
Test that the ``Signu... | MareAtlantica/agora-ciudadana | userena/tests/forms.py | Python | agpl-3.0 | 7,002 |
"""
Tests for discussion pages
"""
import datetime
from pytz import UTC
from uuid import uuid4
from nose.plugins.attrib import attr
from .helpers import BaseDiscussionTestCase
from ..helpers import UniqueCourseTest
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.courseware import CoursewarePage
from... | dkarakats/edx-platform | common/test/acceptance/tests/discussion/test_discussion.py | Python | agpl-3.0 | 44,559 |
# 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 ... | dcorbacho/libcloud | libcloud/common/base.py | Python | apache-2.0 | 36,111 |
#!/usr/bin/env python
# Copyright 2013 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 unittest
from extensions_paths import CHROME_EXTENSIONS
from server_instance import ServerInstance
from test_file_s... | AndroidOpenDevelopment/android_external_chromium_org | chrome/common/extensions/docs/server2/features_bundle_test.py | Python | bsd-3-clause | 9,222 |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Regression tests for the units package."""
import pickle
from fractions import Fraction
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy import units as u
from astropy import constants as ... | aleksandr-bakanov/astropy | astropy/units/tests/test_units.py | Python | bsd-3-clause | 24,065 |
from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.db.models import signals
from django.dispatch import receiver
from django.test import TestCase, mock
from django.test.utils import isolate_apps
from django.utils import six
from .models import Author... | guettli/django | tests/signals/tests.py | Python | bsd-3-clause | 12,295 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from . import Request
from pygithub3.resources.repos import Repo
class List(Request):
uri = 'repos/{user}/{repo}/forks'
resource = Repo
class Create(Request):
uri = '/repos/{user}/{repo}/forks'
resource = Repo
| dongguangming/python-github3 | pygithub3/requests/repos/forks.py | Python | isc | 282 |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | burzillibus/RobHome | venv/lib/python2.7/site-packages/dns/inet.py | Python | mit | 3,242 |
class A(object):
def __init__(self, attribute):
self.attribute = attribute
print "Initializing A"
attribute = "hello"
def my_method(self):
print self.attribute
a = A()
a.my_method()
##c
<config>
<classSelection>0</classSelection>
<attributeSelection>
<int>0</int... | aptana/Pydev | tests/org.python.pydev.refactoring.tests/src/python/codegenerator/generateproperties/testGenerateProperties3.py | Python | epl-1.0 | 995 |
#
# -*- coding: utf-8 -*-
# Copyright 2019 Cisco and/or its affiliates.
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Telemetry Command Reference File
from __future__ import absolute_import, division, print_function
__metaclass__ = type
TMS_GLOBAL = '''
# The cmd_r... | shsingh/ansible | lib/ansible/module_utils/network/nxos/cmdref/telemetry/telemetry.py | Python | gpl-3.0 | 4,241 |
# Copyright 2013 Brocade Communications System, 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
#
#... | virtualopensystems/neutron | neutron/plugins/brocade/nos/fake_nosdriver.py | Python | apache-2.0 | 3,548 |
# -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
class PagerDutyHookTests(WebhookTestCase):
STREAM_NAME = 'pagerduty'
URL_TEMPLATE = u"/api/v1/external/pagerduty?api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'pagerduty'
def test_trigger(self)... | mahim97/zulip | zerver/webhooks/pagerduty/tests.py | Python | apache-2.0 | 2,743 |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for ``flocker.provision._install``.
"""
import yaml
from twisted.trial.unittest import SynchronousTestCase
from pyrsistent import freeze, thaw
from textwrap import dedent
from .._install import (
task_configure_flocker_agent,
task_enab... | AndyHuu/flocker | flocker/provision/test/test_install.py | Python | apache-2.0 | 10,236 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
head = os.path.dirname(__file__)
pygtkweb = os.path.join(head, '..', '..', '..', 'pygtkweb')
TARGETS = {
'AutoGtk.py': dict(
options=[
'--library_dir',
os.path.join(pygtkweb, 'library'),
],
)
}
PACKAGE = {
'... | spaceone/pyjs | examples/deprecated/pywebgtkbuilder/__main__.py | Python | apache-2.0 | 1,294 |
# Tracing in Jython works somewhat similarly to CPython, with the following exceptions:
#
# - No support for jump. Can't do that without dynamic bytecode
# rewriting OR at least until we support a Python bytecode
# interpreter
#
# - Some differences in how we compile, which results in different
# trace orders. Th... | zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_trace.py | Python | epl-1.0 | 23,027 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2015 Douglas S. Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License... | sam-m888/gramps | gramps/gen/db/undoredo.py | Python | gpl-2.0 | 4,160 |
##############################################################################
#
# 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 GNU Affero General Public L... | Johnzero/erp | openerp/addons/product_manufacturer/product_manufacturer.py | Python | agpl-3.0 | 1,864 |
# -*- 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... | crmccreary/openerp_server | openerp/addons/hr_attendance/wizard/hr_attendance_byweek.py | Python | agpl-3.0 | 1,878 |
# Copyright (C) Research In Motion Limited 2011. All rights reserved.
#
# 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 of conditions... | Xperia-Nicki/android_platform_sony_nicki | external/webkit/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null_wsh.py | Python | apache-2.0 | 2,523 |
"""This test suite test general Pen stuff, it should not contain
FontLab-specific code.
"""
import unittest
from robofab.pens.digestPen import DigestPointPen
from robofab.pens.adapterPens import SegmentToPointPen, PointToSegmentPen
from robofab.pens.adapterPens import GuessSmoothPointPen
from robofab.pens.reverseCont... | schriftgestalt/robofab | Lib/robofab/test/test_pens.py | Python | bsd-3-clause | 4,340 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/DiskEncounterResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
fr... | Mickey32111/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Responses/DiskEncounterResponse_pb2.py | Python | mit | 5,576 |
# XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - more doc strings
# - tooltips
# object browser
# XXX TO DO:
# - for classes/modules, add "open source" to object browser
from reprlib import Repr
from idlelib.tree import TreeItem, TreeNode, ScrolledCanvas
myrepr = Repr()
myrepr.maxstring = 100
... | FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/idlelib/debugobj.py | Python | gpl-2.0 | 4,055 |
# -*- coding: utf-8 -*-
# This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Foundation.... | sunshine027/iris-panel | iris/core/views/__init__.py | Python | gpl-2.0 | 385 |
import mmap
import string, os, re, sys
PAGESIZE = mmap.PAGESIZE
def test_both():
"Test mmap module on Unix systems and Windows"
# Create an mmap'ed file
f = open('foo', 'w+')
# Write 2 pages worth of data to the file
f.write('\0'* PAGESIZE)
f.write('foo')
f.write('\0'* (PAGESIZE... | kidmaple/CoolWall | user/python/Lib/test/test_mmap.py | Python | gpl-2.0 | 3,304 |
"""Tests for Multireddit class."""
from __future__ import print_function, unicode_literals
from praw import errors, objects
from .helper import PRAWTest, betamax
class MultiredditTest(PRAWTest):
def betamax_init(self):
self.r.login(self.un, self.un_pswd, disable_warning=True)
def test_multireddit_r... | julianwachholz/praw | tests/test_multireddit.py | Python | gpl-3.0 | 3,055 |
from PyQt4.QtTest import *
| M4rtinK/pyside-android | tests/util/module_wrapper/PySide/QtTest.py | Python | lgpl-2.1 | 28 |
#
# Autogenerated by Thrift Compiler
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTranspor... | zapier/evernote-sdk-python | lib/evernote/edam/notestore/NoteStore.py | Python | bsd-2-clause | 790,217 |
# Copyright 2019 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.
from .composition_parts import DebugInfo
from .composition_parts import WithIdentifier
class Proxy(object):
"""
Proxies attribute access on this ob... | scheib/chromium | third_party/blink/renderer/bindings/scripts/web_idl/reference.py | Python | bsd-3-clause | 7,668 |
# -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# 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, thi... | android-ia/hardware_intel_parameter-framework | test/functional-tests/PfwTestCase/Domains/tDomain_rename.py | Python | bsd-3-clause | 14,770 |
# orm/relationships.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Heuristics related to join conditions as used in
:func:`.relationship`.
Pro... | gdimitris/FleetManagerBackend | virtual_env/lib/python2.7/site-packages/sqlalchemy/orm/relationships.py | Python | mit | 116,411 |
def my_generator():
print 'starting up'
yield 1
print "workin'"
yield 2
print "still workin'"
yield 3
print 'done'
for n in my_generator():
print n
| shankisg/twisted-intro | inline-callbacks/gen-1.py | Python | mit | 182 |
#!/usr/bin/env python
import ConfigParser
import os
import sys
from base import get_parser, run_command
def get_repo_info(config_file="config_test_repos.cfg"):
config = ConfigParser.ConfigParser()
config.read(config_file)
repos = {}
for repo_id in config.sections():
repos[repo_id] = {"id":rep... | nthien/pulp | playpen/certs/create_test_repos.py | Python | gpl-2.0 | 1,527 |
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 vers... | simonwydooghe/ansible | test/units/modules/network/dellos10/test_dellos10_facts.py | Python | gpl-3.0 | 4,729 |
#
# Author: Gregory Fleischer (gfleischer@gmail.com)
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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... | basicScandal/raft | core/fuzzer/TemplateDefinition.py | Python | gpl-3.0 | 5,500 |
"""
Validate JSON format.
Licensed under MIT
Copyright (c) 2012-2015 Isaac Muse <isaacmuse@gmail.com>
"""
import re
import codecs
import json
RE_LINE_PRESERVE = re.compile(r"\r?\n", re.MULTILINE)
RE_COMMENT = re.compile(
r'''(?x)
(?P<comments>
/\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comme... | facelessuser/TabsExtra | tests/validate_json_format.py | Python | mit | 7,430 |
import uwsgi
import time
def slow_task(args):
time.sleep(10)
return uwsgi.SPOOL_OK
uwsgi.spooler = slow_task
def application(env, start_response):
name = uwsgi.spool({'Hello':'World', 'I am a':'long running task'})
print("spooled as %s" % name)
start_response('200 Ok', [('Content-Type','text/... | jyotikamboj/container | uw-tests/spoolme.py | Python | mit | 385 |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import socket
import threading
from sleekxmpp.util import Queue
class TestLiveSocket(object):
"""
A live test socke... | danielvdao/facebookMacBot | venv/lib/python2.7/site-packages/sleekxmpp/test/livesocket.py | Python | mit | 4,752 |
# pylint: skip-file
# pylint: disable=too-many-instance-attributes
class RoleBindingConfig(object):
''' Handle route options '''
# pylint: disable=too-many-arguments
def __init__(self,
sname,
namespace,
kubeconfig,
group_names=None,
... | appuio/ansible-role-openshift-zabbix-monitoring | vendor/openshift-tools/ansible/roles/lib_openshift_3.2/build/lib/rolebinding.py | Python | apache-2.0 | 7,587 |
from swampdragon.route_handler import BaseModelPublisherRouter
from swampdragon.serializers.model_serializer import ModelSerializer
from swampdragon.testing.dragon_testcase import DragonTestCase
from .models import TwoFieldModel
class Serializer(ModelSerializer):
class Meta:
publish_fields = ('id')
... | jonashagstedt/swampdragon | tests/test_base_model_publisher_router_deleted.py | Python | bsd-3-clause | 1,148 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import purchase
from . import mrp_production
from . import stock_move
| jeremiahyan/odoo | addons/purchase_mrp/models/__init__.py | Python | gpl-3.0 | 177 |
# testing/warnings.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""NOTE: copied/adapted from SQLAlchemy master for backwards compatibility;
t... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/alembic/testing/warnings.py | Python | mit | 1,380 |
#!/usr/bin/env python
# File created on 05 Jun 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso", "Jose Antonio Navas Molina", "Daniel McDonald"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Capor... | ssorgatem/qiime | tests/test_split_libraries_fastq.py | Python | gpl-2.0 | 96,688 |
#!/usr/bin/env python
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski", "Jose Carlos Clemente Litran", "Rob Knight",
"Greg Caporaso", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__ma... | antgonza/qiime | qiime/rarefaction.py | Python | gpl-2.0 | 6,795 |
import os
import base64
import shutil
import gettext
import unittest
from test.test_support import run_suite
# TODO:
# - Add new tests, for example for "dgettext"
# - Remove dummy tests, for example testing for single and double quotes
# has no sense, it would have if we were testing a parser (i.e. pygettext)
#... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_gettext.py | Python | gpl-2.0 | 17,583 |
"""
Defines the URL routes for this app.
NOTE: These views are deprecated. These routes are superseded by
``/api/user/v1/accounts/{username}/image``, found in
``openedx.core.djangoapps.user_api.urls``.
"""
from django.conf import settings
from django.conf.urls import url
from .views import ProfileImageRemoveView, P... | BehavioralInsightsTeam/edx-platform | openedx/core/djangoapps/profile_images/urls.py | Python | agpl-3.0 | 665 |