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 |
|---|---|---|---|---|---|
#
# THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
# THE 'COPYING' FILE FOR DETAILS
#
# EffectPresets.py
#
# This module implements support for effects presets. These presets are used
# to store settings for single effects and multiple effects strung together
# (called a 'chain').
#
# The wa... | mjumbewu/jokosher | Jokosher/EffectPresets.py | Python | gpl-2.0 | 15,541 |
#! /usr/bin/env python
# Decompress a jpeg or jpeggrey video file to rgb format
# Usage:
#
# Vunjpeg [infile [outfile]]
# Options:
#
# infile : input file (default film.video)
# outfile : output file (default out.video)
import sys
import jpeg
sys.path.append('/ufs/guido/src/video')
import VFile
# Main p... | sensysnetworks/uClinux | user/python/Demo/sgi/video/Vunjpeg.py | Python | gpl-2.0 | 1,978 |
{ "fedora_rpm":
{
'(_perl-5.10.0-62.17.1_, _Fedora release 11 (Leonidas)_)':dict(
setProductKey=('perl-5.10.0-62.17.1', 'Fedora release 11 (Leonidas)'),
setDescription="The Perl interpreter",
setInstallDate="2009/6/9",
),
}
}
| zenoss/ZenPacks.community.Fedora | ZenPacks/community/Fedora/tests/plugindata/linux/server1/fedora_rpm.py | Python | gpl-2.0 | 262 |
# We import importlib *ASAP* in order to test #15386
import importlib
from test.libregrtest.cmdline import _parse_args, RESOURCE_NAMES, ALL_RESOURCES
from test.libregrtest.main import main
| FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/libregrtest/__init__.py | Python | gpl-2.0 | 190 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007-2009 Brian G. Matherly
# Copyright (C) 2009-2010 Benny Malengier <benny.malengier@gramps-project.org>
# Copyright (C) 2010 Peter Landgren
# Copyright (C) 2010 Tim Lyons
# Copyright (C) 2... | jralls/gramps | gramps/plugins/docgen/htmldoc.py | Python | gpl-2.0 | 22,595 |
PLUGIN_NAME = 'Release Type'
PLUGIN_AUTHOR = 'Elliot Chance'
PLUGIN_DESCRIPTION = 'Appends information to EPs and Singles'
PLUGIN_VERSION = '1.2'
PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"]
from picard.metadata import register_album_metadata_processor
import re
#==================
# options
#==================
_S... | lalinsky/picard-debian | contrib/plugins/release_type.py | Python | gpl-2.0 | 884 |
#!/usr/bin/env python
"""
Show how to make date plots in matplotlib using date tick locators and
formatters. See major_minor_demo1.py for more information on
controlling major and minor ticks
"""
import datetime
from pylab import figure, show
from matplotlib.dates import MONDAY, SATURDAY
from matplotlib.finance import... | ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/lib/mpl_examples/pylab_examples/date_demo2.py | Python | gpl-2.0 | 1,162 |
##
# Copyright 2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http://w... | geimer/easybuild-easyblocks | easybuild/easyblocks/g/go.py | Python | gpl-2.0 | 2,638 |
#!/usr/bin/env python
x = 0
print 'x is currently:', x
while x < 5:
x += 1
print 'incrementing x to:', x
| opensvn/test | src/study/python/cpp/ch14/alt/xcount.py | Python | gpl-2.0 | 114 |
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | pneerincx/easybuild-framework | test/framework/easyblock.py | Python | gpl-2.0 | 26,390 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgsrulebasedrenderer.py
---------------------
Date : September 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
*******... | stevenmizuno/QGIS | tests/src/python/test_qgsrulebasedrenderer.py | Python | gpl-2.0 | 11,534 |
#!/usr/bin/env python
from numpy import reshape, dot
from ase.visualize import view
from ase.lattice.surface import fcc111, add_adsorbate
from gpaw import GPAW
from gpaw.mixer import MixerSum
from gpaw import dscf
filename='lumo'
#-------------------------------------------
c_mol = GPAW(nbands=9, h=0.2, xc='RPBE',... | qsnake/gpaw | doc/documentation/dscf/lumo.py | Python | gpl-3.0 | 2,428 |
################# Sample 1 #################
"""
>>> import pandas as pd
>>> df = pd.read_csv('data/SMSSpamCollection', delimiter='\t', header=None)
>>> print df.head()
0 1
0 ham Go until jurong point, crazy.. Available only ...
1 ham Ok l... | moonbury/notebooks | github/MasteringMLWithScikit-learn/8365OS_04_Codes/ch4.py | Python | gpl-3.0 | 25,282 |
#!/usr/bin/python
#
# Copyright (C) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# SPDX-License-Identifier: GPL-2.0+
#
import fdt_util
import libfdt
import sys
# This deals with a device tree, presenting it as a list of Node and Prop
# objects, representing nodes and properties, respectively.
#... | Jerry-X-Meng/AlphaBoxPlus | u-boot/tools/dtoc/fdt.py | Python | gpl-3.0 | 5,540 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
from frappe.utils import flt
from frappe.utils.nestedset import NestedSet, get_root_of
from erpnext import get_default_currency
class SalesPerson(NestedS... | mhbu50/erpnext | erpnext/setup/doctype/sales_person/sales_person.py | Python | gpl-3.0 | 3,186 |
# Unix SMB/CIFS implementation.
# Copyright (C) Kai Blin <kai@samba.org> 2011
#
# 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 ... | msimacek/samba | python/samba/tests/dns.py | Python | gpl-3.0 | 33,091 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import getopt
import h5py
import os
import sys
import plot_compose as pc
import pvf_settings as ps
exten = ps.f_exten
plotdir = ps.f_plotdir
cmap = ps.plot2d_colormap
sctype = ps.plot2d_sctype
psize = ps.particles_size
pcolor = 'default'
gcolor = ''
linstyl = ''
axcuts =... | mogrodnik/piernik | visual/pvf.py | Python | gpl-3.0 | 11,241 |
import logging
import newrelic.agent
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from treeherder.etl.common import (fetch_json,
generate_revision_hash,
to_timestamp)
from treeherder.etl.push import store_p... | MikeLing/treeherder | treeherder/etl/push_loader.py | Python | mpl-2.0 | 9,763 |
"""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('contentstore.git_export_utils', 'cms.djangoapps.co... | eduNEXT/edunext-platform | import_shims/studio/contentstore/git_export_utils.py | Python | agpl-3.0 | 410 |
# flake8: noqa: F811
from inbox.test.util.base import (generic_account, gmail_account, db,
add_fake_yahoo_account)
from inbox.test.api.base import api_client, new_api_client
__all__ = ['db', 'api_client', 'generic_account', 'gmail_account']
def test_account(db, api_client, generic_accoun... | jobscore/sync-engine | inbox/test/api/test_account.py | Python | agpl-3.0 | 3,554 |
"""Fix Category column defaults.
Revision ID: 516024977fc5
Revises: 59e1cc690da9
Create Date: 2016-04-13 00:05:16.542436
"""
# revision identifiers, used by Alembic.
revision = '516024977fc5'
down_revision = '59e1cc690da9'
from alembic import op
from sqlalchemy.sql import text
def upgrade():
conn = op.get_bin... | nylas/sync-engine | migrations/versions/221_fix_category_column_defaults.py | Python | agpl-3.0 | 1,148 |
from __future__ import absolute_import
import random
from .hashed import murmur2
class DefaultPartitioner(object):
"""Default partitioner.
Hashes key to partition using murmur2 hashing (from java client)
If key is None, selects partition randomly from available,
or from all partitions if none are c... | OpenBankProject/OBP-Kafka-Python | lib/kafka/partitioner/default.py | Python | agpl-3.0 | 1,021 |
'''Test cases for PySide API2 support'''
import unittest
import sys
from PySide2.QtGui import QIntValidator, QValidator
from PySide2.QtWidgets import QWidget, QSpinBox, QApplication
from helper import UsesQApplication
class WidgetValidatorQInt(QWidget, QIntValidator):
def __init__(self, parent=None):
... | BadSingleton/pyside2 | tests/QtWidgets/api2_test.py | Python | lgpl-2.1 | 1,698 |
#
# This file is part of Mapnik (c++ mapping toolkit)
#
# Copyright (C) 2015 Artem Pavlenko
#
# Mapnik is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your op... | zerebubuth/mapnik | plugins/input/geojson/build.py | Python | lgpl-2.1 | 2,641 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | timvideos/flumotion | flumotion/common/__init__.py | Python | lgpl-2.1 | 725 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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... | zuck/prometeo-erp | core/registration/urls.py | Python | lgpl-3.0 | 1,146 |
# encoding: utf-8
"""Tests for io.py"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#------... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/utils/tests/test_io.py | Python | lgpl-3.0 | 2,724 |
# Copyright 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 req... | wolverineav/neutron | neutron/tests/unit/test_wsgi.py | Python | apache-2.0 | 25,906 |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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
#
# ... | xushiwei/nova | plugins/xenserver/networking/etc/xensource/scripts/ovs_configure_vif_flows.py | Python | apache-2.0 | 7,617 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationcertaction.py | Python | apache-2.0 | 13,239 |
# 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 ... | Kami/libcloud | libcloud/test/container/test_kubernetes.py | Python | apache-2.0 | 5,199 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA, Junki MIZUSHIMA
#
# 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:/... | hasegaw/IkaLog | ikalog/utils/image_filters/__init__.py | Python | apache-2.0 | 732 |
# Copyright 2014 Rackspace
#
# 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... | zhangg/trove | trove/tests/examples/client.py | Python | apache-2.0 | 11,824 |
# a small 2-node example, just a producer and consumer
import os
import stat
import sys
print("Executing python script.")
file = open('test-2.sh','w')
file.write('#!/bin/sh\n')
#file.write('echo "Executing binary for 2" >'+sys.argv[-1][8:-1]+'\n')
file.write('echo "Executing binary for 2" >'+sys.argv[-1]+'\n')
fil... | mF2C/COMPSs | tests/sources/python/3_module_decaf_constrained/src/decaf/test-2.py | Python | apache-2.0 | 366 |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | tgarc/pyOCD | pyOCD/target/target_kl46z.py | Python | apache-2.0 | 1,060 |
from twisted.internet import reactor
from rackattack.tcp import transportserver
import sys
import simplejson
class Server:
def handle(self, string, respondCallback, peer):
obj = simplejson.loads(string)
respondCallback(simplejson.dumps(["Echoing", obj]))
server = Server()
factory = transportserv... | eliran-stratoscale/rackattack-api | test/twistedserver_echojson.py | Python | apache-2.0 | 414 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nachi Ueno, NTT MCL, 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... | Frostman/eho-horizon | openstack_dashboard/dashboards/project/routers/ports/tables.py | Python | apache-2.0 | 3,558 |
import pytest
from rancher import ApiError
from .common import random_str
from .conftest import wait_for
from .alert_common import MockReceiveAlert
dingtalk_config = {
"type": "/v3/schemas/dingtalkConfig",
"url": "http://127.0.0.1:4050/dingtalk/test/",
}
microsoft_teams_config = {
"type": "/v3/schemas/msT... | rancher/rancher | tests/integration/suite/test_alert.py | Python | apache-2.0 | 2,622 |
# 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... | apache/incubator-airflow | airflow/utils/callback_requests.py | Python | apache-2.0 | 3,597 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Report.report_filter_fields'
db.delete_column('autoreports_report', 'report_filter_field... | fatihzkaratana/intranet | backend/autoreports/migrations/0002_auto__del_field_report_report_filter_fields__del_field_report_advanced.py | Python | apache-2.0 | 2,623 |
# Copyright (c) 2013 NEC Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | varunarya10/oslo.middleware | tests/test_request_id.py | Python | apache-2.0 | 1,364 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Sleuthkit (TSK) bodyfile (or mactime) event formatter."""
import unittest
from plaso.formatters import mactime
from tests.formatters import test_lib
class MactimeFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the mactime event formatter."""... | ostree/plaso | tests/formatters/mactime.py | Python | apache-2.0 | 870 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | openstack/tempest | tempest/lib/services/image/v1/image_members_client.py | Python | apache-2.0 | 2,551 |
# -*- coding: utf-8 -*-
'''
Manage chassis via Salt Proxies.
.. versionadded:: 2015.8.2
Below is an example state that sets basic parameters:
.. code-block:: yaml
my-dell-chassis:
dellchassis.chassis:
- chassis_name: my-dell-chassis
- datacenter: dc-1-us
- location: my-location
... | smallyear/linuxLearn | salt/salt/states/dellchassis.py | Python | apache-2.0 | 25,828 |
# Copyright 2015 Mirantis, 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 ... | huntxu/fuel-web | nailgun/nailgun/test/unit/test_migration_fuel_7_0.py | Python | apache-2.0 | 29,060 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/models/slim/nets/resnet_v1_test.py | Python | bsd-2-clause | 18,554 |
"""Add FastCache for avoiding retrieving the app_url in every single update
Revision ID: 471e6f7722a7
Revises: 6d09f595667
Create Date: 2015-04-14 07:40:57.006143
"""
# revision identifiers, used by Alembic.
revision = '471e6f7722a7'
down_revision = '6d09f595667'
from alembic import op
import sqlalchemy as sa
def... | porduna/appcomposer | alembic/versions/471e6f7722a7_add_fastcache_for_avoiding_retrieving_.py | Python | bsd-2-clause | 1,130 |
import jingo
import paypal
def handle_paypal_error(fn):
"""Wraps the view so that if a paypal error occurs, you show
a more menaningful error message. May or may not make sense for
all views, so providing as a decorator."""
def wrapper(request, *args, **kw):
try:
return fn(re... | wagnerand/zamboni | apps/paypal/decorators.py | Python | bsd-3-clause | 746 |
from django.conf.urls import url
from olympia.addons.urls import ADDON_ID
from olympia.versions.feeds import VersionsRss
from . import views
urlpatterns = [
url('^$',
views.version_list, name='addons.versions'),
url('^format:rss$',
VersionsRss(), name='addons.versions.rss'),
url('^(?P<ve... | lavish205/olympia | src/olympia/versions/urls.py | Python | bsd-3-clause | 1,022 |
"""
S3 Storage object.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import os
from boto.s3.key import Key
from boto.s3.connection import S3Connection
from io import BytesIO
from django.conf import settings
from tempfile import SpooledTemporaryFile
from... | gerhc/django-dbbackup | dbbackup/storage/s3_storage.py | Python | bsd-3-clause | 3,264 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Marijn van Vliet <w.m.vanvliet@gmail.com>
# Jona Sassenhagen <jona.sassenhagen@gmai... | bloyl/mne-python | mne/channels/montage.py | Python | bsd-3-clause | 53,823 |
import logging
import numpy as np
from ginga import AstroImage
from ginga.mockw.ImageViewMock import CanvasView
class TestImageView(object):
def setup_class(self):
self.logger = logging.getLogger("TestImageView")
self.viewer = CanvasView(logger=self.logger)
self.data = np.identity(2000)... | pllim/ginga | ginga/tests/test_ImageView.py | Python | bsd-3-clause | 1,805 |
from __future__ import print_function, division
from sympy.core import S, Add, Expr, Basic
from sympy.assumptions import Q, ask
from sympy.core.logic import fuzzy_not
def refine(expr, assumptions=True):
"""
Simplify an expression using assumptions.
Gives the form of expr that would be obtained if symbol... | Designist/sympy | sympy/assumptions/refine.py | Python | bsd-3-clause | 8,560 |
from pallets_sphinx_themes import get_version
from pallets_sphinx_themes import ProjectLink
# Project --------------------------------------------------------------
project = "Jinja"
copyright = "2007 Pallets"
author = "Pallets"
release, version = get_version("Jinja2")
# General -------------------------------------... | pallets/jinja | docs/conf.py | Python | bsd-3-clause | 1,995 |
from __future__ import print_function
from getpass import getpass
from os.path import join, dirname
from re import match
from urllib import urlencode
from urlparse import urljoin
from datetime import datetime
from time import sleep
import json
from boto.ec2 import EC2Connection
from boto.route53 import Route53Connect... | yudiutomo/chime | chime/instantiation/functions.py | Python | bsd-3-clause | 11,112 |
"""
oauthlib.openid.connect.core.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import logging
from oauthlib.oauth2.rfc6749.grant_types.authorization_code import (
AuthorizationCodeGrant as OAuth2AuthorizationCodeGrant,
)
from .base import GrantTypeBase
log = logging.getLogger(__name__)
class Authori... | idan/oauthlib | oauthlib/openid/connect/core/grant_types/authorization_code.py | Python | bsd-3-clause | 1,441 |
# Generated by Django 1.10.7 on 2017-05-02 12:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gallery", "0005_image_phash")]
operations = [
migrations.AddField(
model_name="image",
name="gallery_ready",
field=m... | manti-by/M2-Blog-Engine | manti_by/apps/gallery/migrations/0006_auto_20170502_1246.py | Python | bsd-3-clause | 694 |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | pankajp/pyface | pyface/heading_text.py | Python | bsd-3-clause | 876 |
from __future__ import unicode_literals
from collections import OrderedDict
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from .models import TestObject, Order, RevisionableModel
class ExtraRegressTests(TestCase):
def setUp(self):
self.u = User.objects.cr... | rogerhu/django | tests/extra_regress/tests.py | Python | bsd-3-clause | 14,987 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Simple utility functions and bug fixes for compatibility with all supported
versions of Python. This module should generally not be used directly, as
everything in `__all__` will be imported into `astropy.utils.compat` and can
be accessed from there.
... | bsipocz/astropy | astropy/utils/compat/misc.py | Python | bsd-3-clause | 2,023 |
import json
import unittest
import urllib.request
from unittest.mock import patch
from urllib.error import URLError
from django import template
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from django.urls import reverse
from wagtail.core import blocks
from wa... | mikedingjan/wagtail | wagtail/embeds/tests/test_embeds.py | Python | bsd-3-clause | 22,486 |
# -*- coding: utf-8 -*-
from quixote.errors import PublishError
class CodeAPIError(PublishError):
title = "Internal Server Error"
status_code = 400
problem_type = ""
def __init__(self, detail=""):
super(CodeAPIError, self).__init__()
self.detail = detail
def __dict__(self):
... | douban/code | vilya/views/api/errors.py | Python | bsd-3-clause | 2,662 |
from __future__ import absolute_import, unicode_literals
import abc
from textwrap import dedent
from six import add_metaclass
from virtualenv.create.describe import Python3Supports
from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest
from virtualenv.create.via_global_ref.store import is_store_pytho... | pypa/virtualenv | src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py | Python | mit | 3,312 |
import time
import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import function_hooks
from chainer import functions
from chainer.functions.math import basic_math
from chainer import testing
from chainer.testing import attr
def check_history(self, t, function_type, r... | rezoo/chainer | tests/chainer_tests/function_hooks_tests/test_timer.py | Python | mit | 5,956 |
from sqlalchemy.testing import assert_raises_message, eq_, \
AssertsCompiledSQL, is_
from sqlalchemy.testing import fixtures
from sqlalchemy.orm import relationships, foreign, remote
from sqlalchemy import MetaData, Table, Column, ForeignKey, Integer, \
select, ForeignKeyConstraint, exc, func, and_
from sqlalch... | alex/sqlalchemy | test/orm/test_rel_fn.py | Python | mit | 37,493 |
# test builtin range type
# print
print(range(4))
# len
print(len(range(0)))
print(len(range(4)))
print(len(range(1, 4)))
print(len(range(1, 4, 2)))
print(len(range(1, 4, -1)))
print(len(range(4, 1, -1)))
print(len(range(4, 1, -2)))
# subscr
print(range(4)[0])
print(range(4)[1])
print(range(4)[-1])
# slice
print(ra... | Vogtinator/micropython | tests/basics/builtin_range.py | Python | mit | 440 |
"""
Return dictionary of clausulae found in the prosody of Latin prose.
The clausulae analysis function returns a dictionary in which the key is the type of clausula and the value is the number
of times it occurs in the text. The list of clausulae used in the method is derived from the 2019 Journal of Roman Studies
pa... | kylepjohnson/cltk | src/cltk/prosody/lat/clausulae_analysis.py | Python | mit | 3,300 |
# coding: utf-8
# Abstract classes.
if False: # MYPY
from typing import Any, Dict, Optional, List # NOQA
def CommentCheck():
# type: () -> None
pass
class Event(object):
__slots__ = 'start_mark', 'end_mark', 'comment'
def __init__(self, start_mark=None, end_mark=None, comment=CommentCheck):... | explosion/srsly | srsly/ruamel_yaml/events.py | Python | mit | 3,902 |
# Data sources
database(
thermoLibraries = ['KlippensteinH2O2', 'primaryThermoLibrary','DFT_QCI_thermo','CH','CHN','CHO','CHON','CN','NISTThermoLibrary','thermo_DFT_CCSDTF12_BAC','GRI-Mech3.0-N'],
reactionLibraries = [('Nitrogen_Dean_and_Bozzelli',False)],
seedMechanisms = ['ERC-FoundationFuelv0.9'],
k... | pierrelb/RMG-Py | examples/rmg/ch3no2/input.py | Python | mit | 1,947 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class urlview(test.test):
"""
Autotest module for testing basic functionality
of urlview
@author Kingsuk Deb <kingsdeb@linux.vnet.ibm.com> ##
"""
v... | PoornimaNayak/autotest-client-tests | linux-tools/urlview/urlview.py | Python | gpl-2.0 | 1,199 |
'''
Copyright (C) 2014 Travis DeWolf
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 version.
This program is distributed in the hope t... | msunardi/blog | Control/Tasks/write_numbers.py | Python | gpl-3.0 | 2,983 |
# -*- 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'
import re, string
from operator import attrgetter
from PyQt5.Qt import (Qt, QAbstractI... | drxaero/calibre | src/calibre/gui2/store/search/models.py | Python | gpl-3.0 | 18,913 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, 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... | t0mk/ansible | lib/ansible/modules/cloud/cloudstack/cs_nic.py | Python | gpl-3.0 | 8,594 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | pgmillon/ansible | lib/ansible/modules/crypto/openssl_privatekey_info.py | Python | gpl-3.0 | 26,377 |
import os
# display
DISPTYPE = 'pygame'
DISPSIZE = (1920,1080)
# rumble on/off
RUMBLE = True
# we can only use the rumble function in Windows
if os.name != u'nt':
RUMBLE = False | smathot/PyGaze | examples/joystick_test/constants.py | Python | gpl-3.0 | 192 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | alexlo03/ansible | lib/ansible/modules/network/f5/bigiq_device_facts.py | Python | gpl-3.0 | 70,468 |
import imp
import os
import sys
from marshal import Unmarshaller
__debugging__ = False
# Todo: This should be stored in a central place.
supported_magic = 62211 # CPython 2.7
def __readPycHeader(file):
def read():
return ord(file.read(1))
magic = read() | (read()<<8)
if not ( file.read(1) == '\r'... | bikashgupta11/javarobot | src/main/resources/jython/Lib/pycimport.py | Python | gpl-3.0 | 3,296 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 NUMA Extreme Systems (www.numaes.com) for Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be use... | Jgarcia-IAS/SAT | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/l10n_pe_ple03/sunat_3_4.py | Python | agpl-3.0 | 10,529 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Personalizzazione realizzata da Andrea Cometa
# Compatible with OpenERP release 6.0.0
# Copyright (C) 2012 Andrea Cometa. All Rights Reserved.
# Email: info@andreacometa.it
# Web site: http://www.... | john-wang-metro/metro-openerp | third_modules/stock_cancel/__init__.py | Python | agpl-3.0 | 431 |
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | macopedia/hr | __unported__/hr_contract_hourly_rate/hr_hourly_rate_class.py | Python | agpl-3.0 | 2,229 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from odoo.addons.stock_landed_costs.models.stock_landed_cost import SPLIT_METHOD
class ProductTemplate(models.Model):
_inherit = "product.template"
landed_cost_ok = fields.Boole... | ygol/odoo | addons/stock_landed_costs/models/product.py | Python | agpl-3.0 | 595 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
from frappe.model.document import Document
class CForm(Document):
def validate(self):
... | gsnbng/erpnext | erpnext/accounts/doctype/c_form/c_form.py | Python | agpl-3.0 | 2,722 |
#!/usr/bin/env python
from PyQt5 import QtCore, QtWidgets
from peacock import PeacockApp
from peacock.utils import Testing
import os
class TestPostprocessorState(Testing.PeacockImageTestCase):
"""
Test for ExodusViewer state when executable is re-run.
"""
qapp = QtWidgets.QApplication([])
def setU... | Chuban/moose | python/peacock/tests/peacock_app/check_postprocessor_state/test_postprocessor_state.py | Python | lgpl-2.1 | 3,134 |
# 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 Yoda(AutotoolsPackage):
"""YODA - Yet more Objects for Data Analysis"""
homepage = "h... | LLNL/spack | var/spack/repos/builtin/packages/yoda/package.py | Python | lgpl-2.1 | 6,268 |
# 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 Xsm(AutotoolsPackage, XorgPackage):
"""X Session Manager."""
homepage = "https://cgit... | LLNL/spack | var/spack/repos/builtin/packages/xsm/package.py | Python | lgpl-2.1 | 712 |
# 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 FailingBuild(Package):
"""This package has a trivial install method that fails."""
ho... | LLNL/spack | var/spack/repos/builtin.mock/packages/failing-build/package.py | Python | lgpl-2.1 | 601 |
# Copyright (c) 2010-2013 by Yaco Sistemas <goinnn@gmail.com> or <pmartin@yaco.es>
#
# This program 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)... | tlevine/django-inplaceedit | testing/testing/unusual_fields/urls.py | Python | lgpl-3.0 | 1,091 |
"""
REQUIREMENTS:
- install pip with distribute (http://packages.python.org/distribute/)
- sudo pip install Fabric
"""
from fabric.api import local
def lang(mode="extract"):
"""
REQUIREMENTS:
- Install before pip with distribute_setup.py (Read the environment setup document)
... | shupelneker/gae_new_structure | fabfile.py | Python | lgpl-3.0 | 2,916 |
# Copyright 2017 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 law or agreed to in writing,... | shashankrajput/seq2seq | seq2seq/data/vocab.py | Python | apache-2.0 | 4,274 |
# -*- coding: utf-8 -*-
# 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... | sebgoa/client-python | doc/source/conf.py | Python | apache-2.0 | 2,569 |
# Copyright 2013-2016 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 writin... | ShaneHarvey/mongo-connector | tests/test_rollbacks.py | Python | apache-2.0 | 12,660 |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | bigswitch/nova | nova/tests/unit/api/openstack/compute/test_image_metadata.py | Python | apache-2.0 | 15,727 |
from __future__ import print_function
import numpy as np
from openmdao.api import IndepVarComp, Component, Group, Problem
class AngularVelocity321(Component):
"""
Notes
------
Evaluates the body frame angular velocity from 321 Euler angles and their derivatives
Units are in radians and radians/s
Params
... | jcchin/Hyperloop_v2 | src/hyperloop/Python/angular_velocity321.py | Python | apache-2.0 | 3,785 |
"""Validate dependencies."""
import pathlib
from typing import Dict
import re
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
from homeassistant.util.yaml import load_yaml
from .m... | fbradyirl/home-assistant | script/hassfest/services.py | Python | apache-2.0 | 2,462 |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | davidzchen/tensorflow | tensorflow/lite/testing/zip_test_utils.py | Python | apache-2.0 | 20,899 |
from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime
import re
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from djang... | molokov/mezzanine | mezzanine/twitter/models.py | Python | bsd-2-clause | 6,660 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.management.base import BaseCommand
from olympia.files.models import WebextPermissionDescription
from olympia.files.tasks import update_webext_descriptions_all
class Command(BaseCommand):
help = ('Download and update webextension permission... | tsl143/addons-server | src/olympia/files/management/commands/update_permissions_from_mc.py | Python | bsd-3-clause | 1,322 |
"""
Using VTK to assemble a pipeline for segmenting MRI images. This example
shows how to insert well-controled custom VTK filters in Mayavi.
This example downloads an MRI scan, turns it into a 3D numpy array,
applies a segmentation procedure made of VTK filters to extract the
gray-matter/white-matter boundary.
The s... | liulion/mayavi | examples/mayavi/advanced_visualization/tvtk_segmentation.py | Python | bsd-3-clause | 5,023 |
"""
Plot MEG inverse solution
=========================
Data were computed using mne-python (http://martinos.org/mne)
"""
import os
import numpy as np
from surfer import Brain
from surfer.io import read_stc
print(__doc__)
"""
define subject, surface and hemisphere(s) to plot
"""
subject_id, surface = 'fsaverage', ... | diego0020/PySurfer | examples/plot_meg_inverse_solution.py | Python | bsd-3-clause | 1,574 |
"""
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.domains.std import Cmdoption
from sphinx.util.compat import Directive
fr... | frishberg/django | docs/_ext/djangodocs.py | Python | bsd-3-clause | 10,734 |