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 |
|---|---|---|---|---|---|
import logging
import pytest
import gen
import pkgpanda.util
from gen.build_deploy.bash import onprem_source
# TODO(cmaloney): Should be able to pass an exact tree to gen so that we can test
# one little piece at a time rather than having to rework this every time that
# DC/OS parameters change.
@pytest.mark.skipif... | GoelDeepak/dcos | gen/tests/test_validate.py | Python | apache-2.0 | 1,923 |
#!/usr/bin/python2.5
# Copyright (C) 2011 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 required by applicable la... | zarnold/transitfeed | extensions/googletransit/pybcp47/__init__.py | Python | apache-2.0 | 637 |
from mi.instrument.seabird.driver import NEWLINE
SAMPLE_GETSD = "<StatusData DeviceType='SBE54' SerialNumber='05400012'>" + NEWLINE + \
"<DateTime>2012-11-06T10:55:44</DateTime>" + NEWLINE + \
"<EventSummary numEvents='573'/>" + NEWLINE + \
"<Power>" + NEWLINE + \
... | janeen666/mi-instrument | mi/instrument/seabird/sbe54tps/test/sample_data.py | Python | bsd-2-clause | 6,003 |
# Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | jhajek/euca2ools | euca2ools/commands/ec2/describebundletasks.py | Python | bsd-2-clause | 2,642 |
from django.core import exceptions
from devserver.logger import GenericLogger
MODULES = []
def load_modules():
global MODULES
MODULES = []
from devserver import settings
for path in settings.DEVSERVER_MODULES:
try:
name, class_name = path.rsplit('.', 1)
except ValueEr... | chriscauley/django-devserver | devserver/models.py | Python | bsd-3-clause | 1,050 |
#!/usr/bin/env python
# Copyright (c) 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.
"""Runs all the buildbot steps for ChromeDriver except for update/compile."""
import bisect
import csv
import datetime
import glob... | hgl888/chromium-crosswalk | chrome/test/chromedriver/run_buildbot_steps.py | Python | bsd-3-clause | 19,323 |
from js_helper import TestCase
class TestFunctionTraversal(TestCase):
"""
Consider the following tree:
- body
|-function a()
| |- foo
| |- bar
|-zip
|-function b()
| |-abc
| |-def
|-zap
In the old traversal technique, it would be evaluated in the order... | mattbasta/perfalator | tests/js/test_traversal.py | Python | bsd-3-clause | 1,900 |
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.db.models.base import ModelBa... | darkryder/django | django/contrib/admin/sites.py | Python | bsd-3-clause | 19,712 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import as _init
__author__ = 'lovelylain'
__version__ = '0.3.0'
class TAError(Exception):
pass
class TAFunc(object):
__slots__ = ('inputs', 'outputs', 'params', 'lookback', 'size')
def __call__(self, stop, start=-1):
return 0
@classmeth... | blmousee/pyctp | example/ctp/talib/__init__.py | Python | mit | 73,624 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the righ... | sephalon/python-ivi | ivi/agilent/agilentDSOX4024A.py | Python | mit | 1,689 |
#!/usr/bin/env python
import pyflag.IO as IO
import pyflag.Registry as Registry
Registry.Init()
import pyflag.FileSystem as FileSystem
from FileSystem import DBFS
case = "demo"
## This gives us a handle to the VFS
fsfd = Registry.FILESYSTEMS.fs['DBFS'](case)
## WE just open a file in the VFS:
#fd=fsfd.open(inode="It... | naototty/pyflag | tests/init.py | Python | gpl-2.0 | 364 |
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete ... | tux-00/ansible | lib/ansible/module_utils/connection.py | Python | gpl-3.0 | 5,170 |
from django import template
register = template.Library()
@register.filter()
def is_assistant_or_coordinator(user, course):
return course.is_assistant_or_coordinator(user)
| mupi/tecsaladeaula | core/templatetags/is_assistant_or_coordinator.py | Python | agpl-3.0 | 179 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def replace_terms_forward(apps, schema_editor):
Instance = apps.get_model("treemap", "Instance")
instances = Instance.objects.filter(config__contains='\"terms\":')
for instance in instances:
terms = i... | maurizi/otm-core | opentreemap/treemap/migrations/0009_restructure_replaceable_terms.py | Python | agpl-3.0 | 1,359 |
# Copyright 2013-2015 DataStax, 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... | bbirand/python-driver | benchmarks/base.py | Python | apache-2.0 | 8,795 |
"""The tests for the device tracker component."""
# pylint: disable=protected-access
import asyncio
import json
import logging
import unittest
from unittest.mock import call, patch
from datetime import datetime, timedelta
import os
from homeassistant.components import zone
from homeassistant.core import callback, Stat... | MungoRae/home-assistant | tests/components/device_tracker/test_init.py | Python | apache-2.0 | 29,746 |
"""Mock helpers for Z-Wave component."""
from unittest.mock import MagicMock
from pydispatch import dispatcher
def value_changed(value):
"""Fire a value changed."""
dispatcher.send(
MockNetwork.SIGNAL_VALUE_CHANGED,
value=value,
node=value.node,
network=value.node._network,
... | leppa/home-assistant | tests/mock/zwave.py | Python | apache-2.0 | 6,379 |
###############################################################################
##
## Copyright (C) 2014, Tavendo GmbH and/or collaborators. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
... | jadami10/crossbarexamples | authenticate/wampcra/client.py | Python | apache-2.0 | 4,761 |
#!/usr/bin/env python2.2
#-----------------------------------------------------------------------------
# Name: wxPyPlot.py
# Purpose:
#
# Author: Gordon Williams
#
# Created: 2003/11/03
# RCS-ID: $Id$
# Copyright: (c) 2002
# Licence: Use as you wish.
#----------------------------------... | nagyistoce/devide | external/wxPyPlot.py | Python | bsd-3-clause | 57,752 |
# Copyright 2016 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 agree... | catapult-project/catapult | third_party/google-endpoints/google/api/config/service_config.py | Python | bsd-3-clause | 4,729 |
# Copyright 2017, 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 ... | eoogbe/api-client-staging | generated/python/gapic-google-cloud-spanner-v1/google/cloud/gapic/spanner/v1/spanner_client.py | Python | bsd-3-clause | 38,513 |
"""
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
import calendar
import datetime
from email.utils import format_datetime as format_datet... | atul-bhouraskar/django | django/utils/dateformat.py | Python | bsd-3-clause | 10,213 |
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from optparse import make_option
from create_indexes import create_indexes
from create_locations import add_location_objects
from setconfig import create_config_if_not_exist
from create_default_dashboard import create_dashb... | Lambdanaut/crits | crits/core/management/commands/create_default_collections.py | Python | mit | 4,409 |
from django.conf.urls import url, patterns
from django.views.generic import TemplateView
urlpatterns = patterns('librehatti.voucher.views',
url(r'^voucher_generate/','voucher_generate'),
url(r'^voucher_show/','voucher_show'),
url(r'^voucher_print/','voucher_print'),
)
| s-monisha/LibreHatti | src/librehatti/voucher/urls.py | Python | gpl-2.0 | 283 |
#!/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... | camradal/ansible | lib/ansible/modules/network/nxos/nxos_ip_interface.py | Python | gpl-3.0 | 23,930 |
"""
Browser set up for acceptance tests.
"""
# pylint: disable=no-member
# pylint: disable=unused-argument
from base64 import encodestring
from json import dumps
from logging import getLogger
import requests
from django.conf import settings
from django.core.management import call_command
from lettuce import after, b... | pepeportela/edx-platform | common/djangoapps/terrain/browser.py | Python | agpl-3.0 | 10,330 |
# -*- 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... | KousikaGanesh/purchaseandInventory | openerp/addons/account_followup/report/account_followup_print.py | Python | agpl-3.0 | 6,338 |
import saas_server
import res_config
| fevxie/odoo-saas-tools | saas_server/models/__init__.py | Python | lgpl-3.0 | 37 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...styles import Styles
from ...format import Format
class TestWriteCellXfs(unittest.T... | jvrsantacruz/XlsxWriter | xlsxwriter/test/styles/test_write_cell_xfs.py | Python | bsd-2-clause | 970 |
# -*- coding: utf-8 -*-
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from .models import Customer
ANONYMOUS_USER_ERROR_MSG = (
"The subscription_payment_required decorator requires the ... | mthornhill/dj-stripe | djstripe/utils.py | Python | bsd-3-clause | 2,190 |
##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2011-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | lucienfostier/gaffer | python/GafferUI/ScrolledContainer.py | Python | bsd-3-clause | 5,893 |
import os
from os.path import splitext, sep as filesep, join as pjoin, relpath
from hashlib import sha1
from distutils.command.build_ext import build_ext
from distutils.command.sdist import sdist
from distutils.version import LooseVersion
def derror_maker(klass, msg):
""" Decorate distutils class to make run met... | FrancoisRheaultUS/dipy | cythexts.py | Python | bsd-3-clause | 11,094 |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F, Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M, Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPU... | hunch/hunch-gift-app | django/conf/locale/ta/formats.py | Python | mit | 459 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | sbidoul/buildbot | worker/buildbot_worker/monkeypatches/testcase_assert.py | Python | gpl-2.0 | 2,243 |
########################################################################
#
# File Name: TextElement.py
#
#
"""
Implementation of the XSLT Spec text stylesheet element.
WWW: http://4suite.com/4XSLT e-mail: support@4suite.com
Copyright (c) 1999-2000 Fourthought Inc, USA. All Rights Reserved.
See htt... | Pikecillo/genna | external/PyXML-0.8.4/xml/xslt/TextElement.py | Python | gpl-2.0 | 2,357 |
# timeNtp.py
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Fondazione Ugo Bordoni.
#
# 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 3 of the License, or
# (at your option) any la... | hellais/nemesys-qos | nemesys/timeNtp.py | Python | gpl-3.0 | 1,035 |
#!/usr/bin/env python
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import ConfigDB_SessionCompute_2
import pprint
# connector and config
client = DataStoreClient("mongodb", ConfigDB_SessionCompute_2)
config = ConfigDB_SessionCompute_2
# according to config
dataList = client.getData() # return an array... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 2/instances/11_2_wikiflow_1sh_1s_annot/sessioncompute_2/SessionCompute_2.py | Python | gpl-3.0 | 2,784 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
from . import wizard
from . import report
| t3dev/odoo | addons/event/__init__.py | Python | gpl-3.0 | 189 |
#
# Copyright (c) 2001 - 2014 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 Software without restriction, including
# without limitation the rights to use, copy, modify, merge... | stonekyx/binary | vendor/scons-local-2.3.4/SCons/Taskmaster.py | Python | gpl-3.0 | 40,520 |
import mock
from mock import call
import time
from typing import Any, Dict, Union, SupportsInt, Text
import gcm
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile, Message
from zerver.models import get_user_profile_by_email, receives_online_notifi... | dawran6/zulip | zerver/tests/test_push_notifications.py | Python | apache-2.0 | 17,956 |
# 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... | szha/mxnet | python/mxnet/api.py | Python | apache-2.0 | 938 |
# 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 t... | froyobin/horizon | openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/tests.py | Python | apache-2.0 | 7,735 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/pdfdoc.py
__version__=''' $Id: pdfdoc.py 3795 2010-09-30 15:52:16Z rgbecker $ '''
__doc__="""
The module pdfdoc.py handles the 'outer structure... | mattjmorrison/ReportLab | src/reportlab/pdfbase/pdfdoc.py | Python | bsd-3-clause | 83,521 |
""" Test functions for limits module.
"""
from numpy.testing import *
from numpy.core import finfo, iinfo
from numpy import half, single, double, longdouble
import numpy as np
##################################################
class TestPythonFloat(TestCase):
def test_singleton(self):
ftype = finfo(floa... | lthurlow/Network-Grapher | proj/external/numpy-1.7.0/numpy/core/tests/test_getlimits.py | Python | mit | 2,703 |
# enigma2 reactor: based on pollreactor, which is
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Maintainer: U{Felix Domke<mailto:tmbinc@elitedvb.net>}
"""
# System imports
import select, errno, sys
# Twisted imports
from twisted.python import log, failure
from twisted.interne... | ACJTeam/enigma2 | e2reactor.py | Python | gpl-2.0 | 5,223 |
# coding=utf-8
# Authors:
# Pedro Jose Pereira Vieito <pvieito@gmail.com> (Twitter: @pvieito)
#
# URL: https://github.com/mr-orange/Sick-Beard
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | srluge/SickRage | sickbeard/clients/download_station_client.py | Python | gpl-3.0 | 2,731 |
"""Views for enabling cross-domain requests. """
import logging
import json
from django.conf import settings
from django.views.decorators.cache import cache_page
from django.http import HttpResponseNotFound
from edxmako.shortcuts import render_to_response
from .models import XDomainProxyConfiguration
log = logging.g... | synergeticsedx/deployment-wipro | openedx/core/djangoapps/cors_csrf/views.py | Python | agpl-3.0 | 2,496 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | ywcui1990/nupic | src/nupic/algorithms/monitor_mixin/temporal_memory_monitor_mixin.py | Python | agpl-3.0 | 14,320 |
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Set of data classes for representing th... | endlessm/chromium-browser | third_party/llvm/debuginfo-tests/dexter/dex/dextIR/ProgramState.py | Python | bsd-3-clause | 3,820 |
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import over... | camilonova/django | tests/gis_tests/relatedapp/tests.py | Python | bsd-3-clause | 14,177 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..utils import WarpPointsToStd
def test_WarpPointsToStd_inputs():
input_map = dict(args=dict(argstr='%s',
),
coord_mm=dict(argstr='-mm',
xor=['coord_vox'],
),
coord_vox=dict(argstr='-vox',
xor=[... | iglpdc/nipype | nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py | Python | bsd-3-clause | 1,546 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/db/dbconfig.py | Python | gpl-2.0 | 3,096 |
import maya.cmds as cmds
import maya.utils as utils
import threading
import time
import sys
from PyQt4 import QtCore, QtGui
pumpedThread = None
app = None
def pumpQt():
global app
def processor():
app.processEvents()
while 1:
time.sleep(0.01)
utils.executeDeferred( processor )
def initializePumpThread():
... | lordtangent/arsenalsuite | cpp/apps/absubmit/maya/pumpThread.py | Python | gpl-2.0 | 504 |
#!/usr/bin/env python
# Copyright (C) 2018 Duncan Macleod, Collin Capano
#
# 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 3 of the License, or (at your
# option) any later versi... | ahnitz/pycbc | docs/_include/distributions-table.py | Python | gpl-3.0 | 1,274 |
"""message contact association
Revision ID: 223041bb858b
Revises: 2c9f3a06de09
Create Date: 2014-04-28 23:52:05.449401
"""
# revision identifiers, used by Alembic.
revision = '223041bb858b'
down_revision = '2c9f3a06de09'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'... | nylas/sync-engine | migrations/versions/018_message_contact_association.py | Python | agpl-3.0 | 1,215 |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | endlessm/chromium-browser | third_party/angle/third_party/VK-GL-CTS/src/scripts/opengl/gen_query_util.py | Python | bsd-3-clause | 2,295 |
"""The tests for the weblink component."""
import unittest
from homeassistant.components import weblink
from tests.common import get_test_home_assistant
class TestComponentWeblink(unittest.TestCase):
"""Test the Weblink component."""
def setUp(self):
"""Setup things to be run when tests are started... | justyns/home-assistant | tests/components/test_weblink.py | Python | mit | 1,040 |
# -*- coding: utf-8 -*-
#
# plot_quantal_stp_synapse.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 th... | tobikausk/nest-simulator | pynest/examples/plot_quantal_stp_synapse.py | Python | gpl-2.0 | 3,593 |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the... | david-ragazzi/nupic | examples/opf/clients/hotgym/simple/model_params.py | Python | gpl-3.0 | 8,905 |
# -*- 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... | andrius-preimantas/odoo | addons/base_action_rule/base_action_rule.py | Python | agpl-3.0 | 15,745 |
# 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... | lavjain/incubator-hawq | tools/bin/gppylib/programs/verify.py | Python | apache-2.0 | 11,749 |
from material.frontend import Module
class Accounting(Module):
icon = "mdi-action-payment"
| MonsterKiller/django-material | tests/examples/accounting/modules.py | Python | bsd-3-clause | 97 |
from ctypes import c_uint, byref
from django.contrib.gis.geos.error import GEOSIndexError
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
from django.contrib.gis.geos.linestring import LinearRing
from django.contrib.gis.geos import pro... | hunch/hunch-gift-app | django/contrib/gis/geos/polygon.py | Python | mit | 6,672 |
from crits.vocabulary.relationships import RelationshipTypes
def migrate_backdoors(self):
"""
Create backdoor objects from backdoors on samples.
"""
if not self.unsupported_attrs:
return
if 'backdoor' not in self.unsupported_attrs:
return
print "Migrating backdoor for %s" % s... | kaoscoach/crits | crits/samples/migrate.py | Python | mit | 3,565 |
#!/usr/bin/env python
"""Execute the tests for the tree_recomb program.
The golden test outputs are generated by the script generate_outputs.sh.
You have to give the root paths to the source and the binaries as arguments to
the program. These are the paths to the directory that contains the 'projects'
directory.
Us... | rrahn/gdf_tools | include/seqan/apps/tree_recon/tests/run_tests.py | Python | gpl-3.0 | 3,621 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP - Import operations model 347 engine
# Copyright (C) 2009 Asr Oss. All Rights Reserved
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense sr... | alessandrocamilli/l10n-italy | account_fiscal_year_closing/wizard/wizard_run.py | Python | agpl-3.0 | 25,619 |
#!/usr/bin/env python
"""
This module demonstrates how to find virtual machines that
exist on a datastore, but are not part of the inventory.
This can be useful to find orphaned virtual machines that
are still taking up datastore space, but not currently
being used.
Issues:
Currently works with Windows based vCent... | pfitzer/pyvmomi-community-samples | samples/getorphanedvms.py | Python | apache-2.0 | 8,239 |
import fnmatch
import glob
import os
import re
import sys
from functools import total_ordering
from itertools import dropwhile
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.temp import NamedTemporaryFile
from django.core.management.base im... | edmorley/django | django/core/management/commands/makemessages.py | Python | bsd-3-clause | 27,345 |
from chainer.backends import cuda
from chainer import function_hook
class CUDAProfileHook(function_hook.FunctionHook):
name = 'CUDAProfileHook'
def __init__(self):
cuda.check_cuda_available()
if not cuda.cupy.cuda.nvtx_enabled:
raise RuntimeError('nvtx is required for CUDAProfile... | rezoo/chainer | chainer/function_hooks/cuda_profile.py | Python | mit | 780 |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado.escape import utf8, _unicode
from tornado import gen
from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy
from tornado import httputil
from tornado.http1connection... | tao12345666333/tornado-zh | tornado/simple_httpclient.py | Python | mit | 23,983 |
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
mats = UnwrapElement(IN[0])
colorlist = list()
glowlist = list()
classlist = list()
shinylist = list()
smoothlist = list()
translist = list()
for mat in mats:
colorlist.append(mat.Color)
if mat.Glow:
glowlist.append(True)
else:
glowlist.ap... | andydandy74/ClockworkForDynamo | nodes/1.x/python/Material.Properties.py | Python | mit | 540 |
# -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... | garrettcap/Bulletproof-Backup | wx/tools/Editra/src/extern/pygments/token.py | Python | gpl-2.0 | 5,662 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class SaleOrderCancel(models.TransientModel):
_inherit = 'sale.order.cancel'
display_delivery_alert = fields.Boolean('Delivery Alert', compute='_compute_display_delivery_al... | ygol/odoo | addons/sale_stock/wizard/sale_order_cancel.py | Python | agpl-3.0 | 553 |
# Copyright 2012 Nebula, Inc.
# 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... | yanheven/nova | nova/tests/functional/v3/test_deferred_delete.py | Python | apache-2.0 | 1,610 |
'''
Audio tests
===========
'''
import unittest
import os
SAMPLE_FILE = os.path.join(os.path.dirname(__file__), 'sample1.ogg')
SAMPLE_LENGTH = 1.402
SAMPLE_LENGTH_MIN = SAMPLE_LENGTH * 0.99
SAMPLE_LENGTH_MAX = SAMPLE_LENGTH * 1.01
class AudioTestCase(unittest.TestCase):
def get_sound(self):
import os
... | JulienMcJay/eclock | windows/kivy/kivy/tests/test_audio.py | Python | gpl-2.0 | 1,707 |
# Copyright (c) 2019 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
class ModuleDocFragment(object):
# Windows shell documentation fragment
# FIXME: set_module... | privateip/ansible | lib/ansible/plugins/doc_fragments/shell_windows.py | Python | gpl-3.0 | 1,460 |
import random
import re
import socket
import threading
import time
import TCPConnectionUtility
from NativeLog import NativeLog
from TCAction import PerformanceTCBase
DELAY_RANGE = [10, 3000]
CONNECTION_STRUCTURE = ("Connection handler", "PC socket", "Target socket id",
"Target port", "PC port"... | icamgo/esp-idf | components/idf_test/integration_test/TestCaseScript/TCPStress/TCPConnection.py | Python | apache-2.0 | 12,186 |
"""
This module provides code to generate and sample probability distributions.
The class RandProbDist provides an interface to randomly generate probability
distributions. Random samples can then be drawn from these distributions.
"""
import random
import const
import obfsproxy.common.log as logging
log = loggin... | masterkorp/obfsproxy | obfsproxy/transports/scramblesuit/probdist.py | Python | bsd-3-clause | 2,788 |
from settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
| mjtamlyn/django-denorm | test_project/settings_sqlite.py | Python | bsd-3-clause | 139 |
#
# The Python Imaging Library.
# $Id$
#
# XPM File handling
#
# History:
# 1996-12-29 fl Created
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7)
#
# Copyright (c) Secret Labs AB 1997-2001.
# Copyright (c) Fredrik Lundh 1996-2001.
#
# See the README file for information on usage and redistribution.
#... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/PIL/XpmImagePlugin.py | Python | bsd-2-clause | 3,101 |
#!/usr/bin/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.
"""Checks third-party licenses for the purposes of the Android WebView build.
The Android tree includes a snapshot of Chromium in orde... | 7kbird/chrome | android_webview/tools/webview_licenses.py | Python | bsd-3-clause | 13,334 |
"""Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | Demolisty24/AlexaFood-Backend | venv/Lib/posixpath.py | Python | mit | 13,925 |
#!/usr/bin/env python
import logging
import sys
from BCBio import GFF
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
if __name__ == "__main__":
attr = sys.argv[2]
for record in GFF.parse(sys.argv[1]):
if len(record.features) == 0:
continue
for feature in sort... | mblue9/tools-iuc | tools/circos/text-from-gff3.py | Python | mit | 1,131 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import versatileimagefield.fields
import jsonfield.fields
from decimal import Decimal
import saleor.product.models.fields
import django.core.validators
import django_prices.models
import satchless.item
class Migr... | taedori81/e-commerce-template | saleor/product/migrations/0001_initial.py | Python | bsd-3-clause | 7,464 |
from sphinx.domains.python import PyXRefRole
def setup(app):
"""
Any time a python class is referenced, make it a pretty link that doesn't
include the full package path. This makes the base classes much prettier.
"""
app.add_role_to_domain('py', 'class', truncate_class_role)
return {'parallel_... | nontas/menpowidgets | docs/sphinxext/ref_prettify.py | Python | bsd-3-clause | 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 use ... | dcorbacho/libcloud | libcloud/test/compute/test_digitalocean_v2.py | Python | apache-2.0 | 11,147 |
# -*- coding: utf-8 -*-
import webapp2
from webapp2_extras import sessions
from webapp2_extras import sessions_memcache
import test_base
app = webapp2.WSGIApplication(config={
'webapp2_extras.sessions': {
'secret_key': 'my-super-secret',
},
})
class TestMemcacheSession(test_base.BaseTestCase):
... | adviti/melange | thirdparty/google_appengine/lib/webapp2/tests/extras_appengine_sessions_memcache_test.py | Python | apache-2.0 | 4,072 |
from reportlab.lib import styles
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY
from reportlab.platypus import Preformatted, Paragraph, Frame, \
Image, Table, TableStyle, Spacer
from reportlab.pdfbase import pdfmetrics
fr... | Distrotech/reportlab | tools/pythonpoint/styles/htu.py | Python | bsd-3-clause | 5,206 |
__author__ = 'ferrard'
| silverfield/pythonsessions | s13_python_day/__init__.py | Python | mit | 23 |
try:
import jni
System = jni.cls("java/lang/System")
except:
print("SKIP")
raise SystemExit
System.out.println("Hello, Java!")
| SHA2017-badge/micropython-esp32 | tests/jni/system_out.py | Python | mit | 144 |
"""
Shogun demo
Fernando J. Iglesias Garcia
This example shows the use of dimensionality reduction methods, mainly
Stochastic Proximity Embedding (SPE), although Isomap is also used for
comparison. The data selected to be embedded is an helix. Two different methods
of SPE (global and local) are applied showing that t... | AzamYahya/shogun | examples/undocumented/python_modular/graphical/converter_spe_helix.py | Python | gpl-3.0 | 2,562 |
# Py2.7+ only
import sys
def test_set_literal():
"""
>>> type(test_set_literal()) is set
True
>>> sorted(test_set_literal())
['a', 'b', 1]
"""
s1 = {1, 'a', 1, 'b', 'a'}
return s1
def test_set_add():
"""
>>> type(test_set_add()) is set
True
>>> sorted(test_set_add())... | andreasvc/cython | tests/run/set_literals.py | Python | apache-2.0 | 2,234 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
)
class MnetIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mnet\.(?:com|interest\.me)/tv/vod/(?:.*?\bclip_id=)?(?P<id>[0-9]+)'
_TESTS =... | vinegret/youtube-dl | youtube_dl/extractor/mnet.py | Python | unlicense | 2,925 |
# Copyright 2016 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... | endlessm/chromium-browser | third_party/grpc/src/test/http2_test/test_max_streams.py | Python | bsd-3-clause | 1,926 |
import os
import sys
from rope.base import utils
def _stdlib_path():
import inspect
return os.path.dirname(inspect.getsourcefile(inspect))
@utils.cached(1)
def standard_modules():
return python_modules() | dynload_modules()
@utils.cached(1)
def python_modules():
result = set()
lib_path = _stdli... | JetChars/vim | vim/bundle/python-mode/pymode/libs3/rope/base/stdmods.py | Python | apache-2.0 | 1,296 |
# Copyright (c) 2013 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 ... | nikesh-mahalka/cinder | cinder/tests/unit/api/contrib/test_availability_zones.py | Python | apache-2.0 | 2,932 |
#
# The Python Imaging Library.
# $Id$
#
# IM Tools support for PIL
#
# history:
# 1996-05-27 fl Created (read 8-bit images only)
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.2)
#
# Copyright (c) Secret Labs AB 1997-2001.
# Copyright (c) Fredrik Lundh 1996-2001.
#
# See the README file for informatio... | zhaochl/python-utils | verify_code/Imaging-1.1.7/build/lib.linux-x86_64-2.7/ImtImagePlugin.py | Python | apache-2.0 | 2,203 |
"""Test script for popen2.py"""
import warnings
warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
DeprecationWarning)
warnings.filterwarnings("ignore", "os\.popen. is deprecated.*",
DeprecationWarning)
import os
import sys
import unittest
import popen... | svanschalkwyk/datafari | windows/python/Lib/test/test_popen2.py | Python | apache-2.0 | 4,315 |
"""Tests for the system_log component."""
| fbradyirl/home-assistant | tests/components/system_log/__init__.py | Python | apache-2.0 | 42 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... | Branlala/docker-sickbeardfr | sickbeard/sickbeard/notifiers/libnotify.py | Python | mit | 4,677 |