repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
minghuascode/pyj | library/pyjamas/media/Media.ie6.py | 1 | 1553 |
class Media(Widget):
def setSrc(self, src):
print "setSrc", src
obj = self.getElement()
DOM.setAttribute(obj, "URL", src)
def setControls(self, controls):
print "setControls", controls
self.ctrlparam = DOM.createElement("PARAM")
DOM.setAttribute(self.ctrlparam,... | apache-2.0 |
savoca/zerofltetmo | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
jjdmol/LOFAR | CEP/Calibration/ExpIon/src/parmdbmain.py | 1 | 2049 | # -*- coding: utf-8 -*-
# Copyright (C) 2007
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General ... | gpl-3.0 |
django-extensions/django-extensions | tests/management/commands/test_describe_form.py | 1 | 2203 | # -*- coding: utf-8 -*-
from io import StringIO
from django.test import TestCase
from django.db import models
from django.core.management import CommandError, call_command
class DescribeFormExceptionsTests(TestCase):
"""Tests for describe_form command exceptions."""
def test_should_raise_CommandError_if_inv... | mit |
shellydeforte/PDB | pdb/tests/test_data.py | 1 | 41341 | # -*- coding: utf-8 -*-
from __future__ import (
absolute_import, division, print_function, unicode_literals)
class PDBParseData:
ss_dis = {
'104L_B': {
'disorder': '-----------------------------------------------------------------------------------------------------------------------------... | mit |
buqing2009/MissionPlanner | Lib/site-packages/scipy/ndimage/tests/test_filters.py | 55 | 1118 | ''' Some tests for filters '''
import numpy as np
from numpy.testing import assert_equal, assert_raises
import scipy.ndimage as sndi
def test_ticket_701():
# Test generic filter sizes
arr = np.arange(4).reshape((2,2))
func = lambda x: np.min(x)
res = sndi.generic_filter(arr, func, size=(1,1))
#... | gpl-3.0 |
baloo/libnl | python/netlink/route/links/vlan.py | 22 | 1948 | #
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
"""VLAN network link
"""
from __future__ import absolute_import
from ... import core as netlink
from .. import capi as capi
class VLANLink(object):
def __init__(self, link):
self._link = link
@property
@netlink.nlattr(type=int)
def id(s... | lgpl-2.1 |
jjscarafia/odoo | addons/portal_project_issue/__openerp__.py | 375 | 1713 | # -*- 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... | agpl-3.0 |
CCLab/Raw-Salad | scripts/db/budget/fundtr.py | 1 | 10946 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
import:
PLANY FINANSOWE PANSTWOWYCH FUNDUSZY CELOWYCH
W UKLADIE TRADYCIJNEM
flat structure (each data unit is a separate doc in the collection)
parenting is archieved through 'parent' key
the script also inserts a doc into the schema collection
(warning! if there's alrea... | bsd-3-clause |
cesargtz/YecoraOdoo | addons/account_sequence/__init__.py | 433 | 1104 | # -*- 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... | agpl-3.0 |
hanselke/erpnext-1 | erpnext/accounts/report/financial_statements.py | 42 | 7666 | # 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 import _, _dict
from frappe.utils import (flt, getdate, get_first_day, get_last_day,
add_months, add_days, formatdate)
def g... | agpl-3.0 |
StevenBlack/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/urlfetcher_mock.py | 165 | 2053 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
Gitlab11/odoo | addons/portal_stock/__openerp__.py | 437 | 1600 | # -*- 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... | agpl-3.0 |
marc-sensenich/ansible | lib/ansible/module_utils/vmware.py | 7 | 45357 | # -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# 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
import atexit
impo... | gpl-3.0 |
ylcolala/ShadowsocksFork | shadowsocks/encrypt.py | 990 | 5180 | #!/usr/bin/env python
#
# Copyright 2012-2015 clowwindy
#
# 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... | apache-2.0 |
mongodb/mongo-python-driver | test/test_legacy_api.py | 2 | 38815 | # Copyright 2015-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 |
KerkhoffTechnologies/shinken | shinken/objects/notificationway.py | 17 | 10841 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | agpl-3.0 |
cloudbau/glance | glance/tests/functional/test_cache_middleware.py | 1 | 32705 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | apache-2.0 |
carljm/django | tests/custom_managers/tests.py | 16 | 24154 | from __future__ import unicode_literals
from django.db import models
from django.test import TestCase
from django.utils import six
from .models import (
Book, Car, CustomManager, CustomQuerySet, DeconstructibleCustomManager,
FastCarAsBase, FastCarAsDefault, FunPerson, OneToOneRestrictedModel,
Person, Pers... | bsd-3-clause |
ii0/pybrain | docs/code2tut.py | 27 | 2275 | #!/bin/env python
""" Utility script to convert Python source code into tutorials.
Synopsis:
code2tut.py basename
Output:
Will convert tutorials/basename.py into sphinx/basename.txt
Conventions:
1. All textual comments must be enclosed in triple quotation marks.
2. First line of file is ignored, second li... | bsd-3-clause |
lpakula/django-oscar-paypal | paypal/payflow/facade.py | 3 | 6767 | """
Bridging module between Oscar and the gateway module (which is Oscar agnostic)
"""
from oscar.apps.payment import exceptions
from paypal.payflow import codes, gateway, models
def authorize(order_number, amt, bankcard, billing_address=None):
"""
Make an *authorisation* request
This holds the money on... | bsd-3-clause |
v0i0/lammps | tools/moltemplate/examples/coarse_grained/chromosome_metaphase_Naumova2013/moltemplate_files/interpolate_coords.py | 14 | 1944 | #!/usr/bin/env python
err_msg = """
Usage:
interpolate_coords.py Ndesired [scale] < coords_orig.raw > coords.raw
Example:
interpolate_coords.py 30118 3.0 < coords_orig.raw > coords.raw
# (Note: 30117 ~= 128000/4.25, but using 30118 makes interpolation cleaner.
# See the supplemental section of ... | gpl-2.0 |
tracierenea/gnuradio | gr-digital/python/digital/ofdm_sync_pnac.py | 40 | 6080 | #!/usr/bin/env python
#
# Copyright 2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
... | gpl-3.0 |
alxnov/ansible-modules-core | cloud/amazon/ec2_snapshot.py | 22 | 9974 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/docutils/test/test_transforms/test___init__.py | 19 | 1136 | #! /usr/bin/env python
# $Id: test___init__.py 5174 2007-05-31 00:01:52Z wiemann $
# Author: Lea Wiemann <LeWiemann@gmail.com>
# Copyright: This module has been placed in the public domain.
"""
Test module for transforms/__init__.py.
"""
from __init__ import DocutilsTestSupport # must be imported before docutils
fro... | agpl-3.0 |
mikhaelharswanto/ryu | ryu/tests/integrated/test_flow_monitor_v14.py | 1 | 6717 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
Workday/OpenFrame | tools/cr/cr/commands/build.py | 113 | 2455 | # 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.
"""A module for the build commands."""
import cr
class BuildCommand(cr.Command):
"""The implementation of the build command.
This is a thin shell ove... | bsd-3-clause |
codl/forget | migrations/versions/583cdac8eba1_add_three_way_media_policy.py | 1 | 1796 | """add three-way media policy
Revision ID: 583cdac8eba1
Revises: 7e255d4ea34d
Create Date: 2017-12-28 00:46:56.023649
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '583cdac8eba1'
down_revision = '7e255d4ea34d'
branch_labels = None
depends_on = None
transitio... | isc |
slingcoin/sling-market | test/functional/rpcbind_test.py | 23 | 4773 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running bitcoind with the -rpcbind and -rpcallowip options."""
import socket
import sys
from tes... | mit |
adler-j/lie_grp_diffeo | examples/diffemorphism_2d_shepp_regularized.py | 1 | 3610 | import lie_group_diffeo as lgd
import odl
import numpy as np
action_type = 'geometric'
transform_type = 'affine'
space = odl.uniform_discr([-1, -1], [1, 1], [101, 101], interp='linear')
coord_space = odl.uniform_discr([-1, -1], [1, 1], [101, 101], interp='linear').tangent_bundle
# Select deformation type of the targ... | gpl-3.0 |
fengyc/flasky | migrations/versions/cb9983b1a2b6_init.py | 1 | 1175 | """'init'
Revision ID: cb9983b1a2b6
Revises: None
Create Date: 2016-01-28 21:20:28.690752
"""
# revision identifiers, used by Alembic.
revision = 'cb9983b1a2b6'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op... | mit |
bramwalet/Subliminal.bundle | Contents/Libraries/Shared/requests/packages/urllib3/util/ssl_.py | 305 | 4235 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1
from ..exceptions import SSLError
try: # Test for SSL features
SSLContext = None
HAS_SNI = False
import ssl
from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
from ssl import SSLContext # Modern SSL?
from ssl import... | mit |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Twitter/FriendsAndFollowers/FriendshipsShow.py | 5 | 5218 | # -*- coding: utf-8 -*-
###############################################################################
#
# FriendshipsShow
# Returns detailed information about the relationship between two users.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the ... | gpl-2.0 |
mcs07/mongodb-chemistry | mchem/screening.py | 1 | 3656 | # -*- coding: utf-8 -*-
"""
mchem.screening
~~~~~~~~~~~~~~~
Functions for analysing screening methods for chemical searches in MongoDB.
:copyright: Copyright 2014 by Matt Swain.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import print_function
from __future__ import unicode_literals
from __... | mit |
anthonydillon/horizon | openstack_dashboard/test/integration_tests/pages/project/compute/access_and_security/keypairspage.py | 49 | 2716 | # Copyright 2014 Hewlett-Packard Development Company, L.P
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | apache-2.0 |
XiaominZhang/Impala | tests/comparison/funcs.py | 19 | 24787 | # Copyright (c) 2014 Cloudera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
davidevinavil/kernel_s500_cm10 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
vicnet/weboob | weboob/tools/config/dbmconfig.py | 2 | 2248 | # -*- coding: utf-8 -*-
# Copyright(C) 2016-2019 Edouard Lefebvre du Prey, Laurent Bachelier
#
# This file is part of weboob.
#
# weboob 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... | lgpl-3.0 |
Ikke/ktane | modules/memory.py | 1 | 2079 | from window import Window
import curses
import logging
class Memory(Window):
def new(self):
self.stages = []
self.pos = 0
self.part = "pos"
self.title = "Memory"
def _event(self, ev, c):
if c == "p":
self.part = "pos"
elif c == "l":
self.... | mit |
HunterConnelly/firecares | firecares/firestation/migrations/0023_auto_20160322_1340.py | 3 | 1464 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('firestation', '0022_firedepartment_twitter_handle'),
]
operations = [
migrations.RenameField(
model_name='staffi... | mit |
cberry777/dd-agent | utils/service_discovery/config_stores.py | 6 | 2051 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# project
from utils.service_discovery.abstract_config_store import AbstractConfigStore
from utils.service_discovery.abstract_config_store import CONFIG_FROM_AUTOCONF, CONFIG_FROM_FILE, CONFIG_FROM_TEMPLATE, TRACE... | bsd-3-clause |
ramondelafuente/ansible | lib/ansible/cli/doc.py | 7 | 12586 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... | gpl-3.0 |
nghia-huynh/gem5-stable | src/python/m5/debug.py | 51 | 3475 | # Copyright (c) 2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of... | bsd-3-clause |
XiaodunServerGroup/ddyedx | common/djangoapps/course_groups/views.py | 12 | 6668 | from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_POST
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.http import HttpResponse
import json
impor... | agpl-3.0 |
mcaleavya/bcc-scripts | statsnoop.py | 1 | 4709 | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# statsnoop Trace stat() syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: statsnoop [-h] [-t] [-x] [-p PID]
#
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 08-Feb-2016 Brendan ... | apache-2.0 |
denny820909/builder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/ssh/userauth.py | 16 | 30509 | # -*- test-case-name: twisted.conch.test.test_userauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the ssh-userauth service.
Currently implemented authentication types are public-key and password.
Maintainer: Paul Swartz
"""
import struct, warnings
from twisted.c... | mit |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.8.36-1/roles/lib_utils/library/oo_ec2_group.py | 26 | 37438 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: skip-file
# flake8: noqa
# 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
# (... | apache-2.0 |
gooofy/zamia-ai | tests/bench_aiprolog.py | 3 | 1592 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Guenter Bartsch, Heiko Schaefer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | apache-2.0 |
mykytamorachov/outpost | flask/lib/python2.7/site-packages/sqlalchemy/sql/expression.py | 17 | 193682 | # sql/expression.py
# Copyright (C) 2005-2012 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
"""Defines the base components of SQL expression trees.
All components are derived ... | gpl-2.0 |
cloudera/ibis | ibis/tests/expr/test_literal.py | 2 | 1064 | import ibis
from ibis.expr import datatypes
from ibis.expr.operations import Literal
def test_literal_equality_basic():
a = ibis.literal(1).op()
b = ibis.literal(1).op()
assert a == b
assert hash(a) == hash(b)
def test_literal_equality_int_float():
# Note: This is different from the Python beha... | apache-2.0 |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/reloop-closured/lib/python2.7/encodings/iso8859_2.py | 593 | 13660 | """ Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | agpl-3.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/xlsclients/package.py | 5 | 1787 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
atosorigin/ansible | test/integration/targets/collections/collections/ansible_collections/testns/content_adj/plugins/inventory/statichost.py | 44 | 2221 | # 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 = '''
inventory: statichost
short_description: Add a single host
descripti... | gpl-3.0 |
gaganmac/learnfast | lib/werkzeug/debug/__init__.py | 310 | 7800 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import json
import mimetypes
from os.path import join, dirname, basename, isfile
... | apache-2.0 |
york-2015/yowsup | yowsup/layers/protocol_groups/protocolentities/notification_groups_add.py | 61 | 1946 | from .notification_groups import GroupsNotificationProtocolEntity
from yowsup.structs import ProtocolTreeNode
class AddGroupsNotificationProtocolEntity(GroupsNotificationProtocolEntity):
'''
<notification participant="{{participant_jiid}}" t="{{TIMESTAMP}}" from="{{group_jid}}" type="w:gp2" id="{{id}}" notify="What... | gpl-3.0 |
Crespo911/pyspace | pySPACE/tests/unittests/data_types/test_base.py | 4 | 6699 | """Unit test for BaseData type
This unit test creates TimeSeries objects and FeatureVector,
tries to change and inherit meta information and runs separate
tests for key, tag, specs and inheritance.
.. todo:: test pickling?
:Author: Sirko Straube (sirko.straube@dfki.de), David Feess
:Las... | gpl-3.0 |
sargas/scipy | scipy/weave/tests/test_inline_tools.py | 6 | 1500 | from __future__ import absolute_import, print_function
from numpy.testing import TestCase, dec, assert_
from scipy.weave import inline_tools
class TestInline(TestCase):
""" These are long running tests...
I'd like to benchmark these things somehow.
"""
@dec.slow
def test_exceptions(self):
... | bsd-3-clause |
DataDog/moto | tests/test_emr/test_emr.py | 2 | 9462 | from __future__ import unicode_literals
import boto
from boto.emr.instance_group import InstanceGroup
from boto.emr.step import StreamingStep
import sure # noqa
from moto import mock_emr
from tests.helpers import requires_boto_gte
@mock_emr
def test_create_job_flow():
conn = boto.connect_emr()
step1 = Stre... | apache-2.0 |
yellowcap/academicspam | apps/spamparser/tests.py | 1 | 3028 | """Test suite for spam email parser"""
from django.test import TestCase
from django_dynamic_fixture import G
from django_mailbox.models import Message
from .models import ParseResult
###############################################################################
class ScenarioTests(TestCase):
def test_regular_... | mit |
anand-c-goog/tensorflow | tensorflow/python/framework/registry.py | 18 | 2935 | # 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... | apache-2.0 |
mohamedhagag/community-addons | openeducat_erp/op_student/op_student.py | 1 | 7142 | # -*- coding: utf-8 -*-
###############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/dns/rdtypes/ANY/RP.py | 100 | 3274 | # 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 "... | apache-2.0 |
zsiciarz/django | tests/flatpages_tests/test_forms.py | 43 | 4461 | from django.conf import settings
from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from django.utils import translation
@modify_settings(INSTALLE... | bsd-3-clause |
jstammers/EDMSuite | NavPython/IronPython/Lib/dircache.py | 326 | 1126 | """Read and cache directory listings.
The listdir() routine returns a sorted list of the files in a directory,
using a cache to avoid reading the directory more often than necessary.
The annotate() routine appends slashes to directories."""
from warnings import warnpy3k
warnpy3k("the dircache module has been removed i... | mit |
kula85/perf-sqlite3 | Documentation/target/tcm_mod_builder.py | 337 | 24391 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
mmargoliono/git-cola | cola/widgets/status.py | 1 | 33987 | from __future__ import division, absolute_import, unicode_literals
import itertools
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from PyQt4.QtCore import SIGNAL
from cola import cmds
from cola import core
from cola import qtutils
from cola import utils
from cola.i18n import N_
from co... | gpl-2.0 |
dnet/pyqso | setup.py | 1 | 1183 | #!/usr/bin/env python
# Copyright (C) 2013 Christian T. Jacobs.
# This file is part of PyQSO.
# PyQSO 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
# ... | gpl-3.0 |
strint/tensorflow | tensorflow/python/kernel_tests/unstack_op_test.py | 99 | 5236 | # 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... | apache-2.0 |
stackArmor/security_monkey | security_monkey/auditors/rds/rds_db_instance.py | 3 | 2486 | # Copyright 2017 Netflix, 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... | apache-2.0 |
kid/troposphere | troposphere/cloudformation.py | 22 | 5724 | # Copyright (c) 2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSHelperFn, AWSObject, AWSProperty, Ref, BaseAWSObject
from .validators import integer, boolean, encoding
class Stack(AWSObject):
resource_type = "AWS::CloudFormation::Stack"
props = ... | bsd-2-clause |
acsone/purchase-workflow | purchase_multi_picking/__openerp__.py | 13 | 1765 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it a... | agpl-3.0 |
cpennington/edx-platform | common/djangoapps/student/tests/test_events.py | 4 | 6996 | # -*- coding: utf-8 -*-
"""
Test that various events are fired for models in the student app.
"""
import mock
from django.db.utils import IntegrityError
from django.test import TestCase
from django_countries.fields import Country
from student.models import CourseEnrollmentAllowed
from student.tests.factories import ... | agpl-3.0 |
mvesper/invenio | modules/bibsched/lib/bibsched.py | 3 | 48933 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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
# Li... | gpl-2.0 |
nhicher/ansible | lib/ansible/modules/windows/win_template.py | 52 | 4306 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a virtual module that is entirely implemented server side
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
... | gpl-3.0 |
Kitware/girder | girder/models/assetstore.py | 2 | 6444 | # -*- coding: utf-8 -*-
import datetime
from .model_base import Model
from girder.constants import AssetstoreType, SortDir
from girder.exceptions import ValidationException, GirderException, NoAssetstoreAdapter
from girder.utility import assetstore_utilities
from girder.utility.abstract_assetstore_adapter import Abstr... | apache-2.0 |
jmvrbanac/Specter | tests/test_util.py | 1 | 1929 | from unittest import TestCase
from specter import util, spec, metadata, skip
class TestSpecterUtil(TestCase):
def test_convert_camelcase_error(self):
result = util.convert_camelcase(None)
self.assertEqual(result, '')
def test_get_numbered_source_error(self):
result = util.get_number... | mit |
cfg2015/EPT-2015-2 | addons/hr_timesheet/wizard/__init__.py | 381 | 1079 | # -*- 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... | agpl-3.0 |
ztane/jaspyx | jaspyx/visitor/base_visitor.py | 1 | 4005 | from __future__ import absolute_import, division, print_function
import ast
from jaspyx.context.module import ModuleContext
from jaspyx.compat import basestring
class BaseVisitor(ast.NodeVisitor):
def __init__(self, path, registry, indent=0):
self.path = path
self.registry = registry
self.... | mit |
grpc/grpc | src/python/grpcio_tests/tests/csds/test_csds.py | 5 | 4318 | # Copyright 2021 The 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 writ... | apache-2.0 |
ekmartin/abakaffe-irc | abakaffe.py | 1 | 4298 | import irc.bot
import irc.strings
import os
import urllib2
import simplejson
from urlparse import urljoin
from datetime import datetime
class AbakusCoffeeBot(irc.bot.SingleServerIRCBot):
API_URL = "http://kaffe.abakus.no/api/"
def __init__(self, channelList, nickname, server, port=6667):
irc.bot.Single... | mit |
sbidoul/odoo | addons/l10n_cn/__init__.py | 339 | 1061 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2007-2014 Jeff Wang(<http://jeff@osbzr.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
LUTAN/tensorflow | tensorflow/contrib/tfprof/python/tools/tfprof/print_model_analysis_test.py | 25 | 7217 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Arc-Team/android_kernel_samsung_afyonlte | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
fooelisa/ansible-modules-extras | notification/slack.py | 1 | 7642 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ramon de la Fuente <ramon@delafuente.nl>
#
# 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 ... | gpl-3.0 |
munhanha/mtg-random | django/middleware/http.py | 154 | 1696 | from django.core.exceptions import MiddlewareNotUsed
from django.utils.http import http_date, parse_http_date_safe
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has a ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Since, ... | bsd-3-clause |
miconof/CouchPotatoServer | couchpotato/core/downloaders/blackhole.py | 41 | 7378 | from __future__ import with_statement
import os
import traceback
from couchpotato.core._base.downloader.main import DownloaderBase
from couchpotato.core.helpers.encoding import sp
from couchpotato.core.helpers.variable import getDownloadDir
from couchpotato.core.logger import CPLog
from couchpotato.environment import ... | gpl-3.0 |
kilon/sverchok | old_nodes/circle.py | 4 | 4642 | from math import sin, cos, pi, degrees, radians
import bpy
from bpy.props import BoolProperty, IntProperty, FloatProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import (fullList, match_long_repeat, updateNode,
SvSetSocketAnyType, SvGetSocketAnyType... | gpl-3.0 |
franklinsales/udacity-data-analyst-nanodegree | project3/class-works/data-wrangling/data-quality/location.py | 1 | 2265 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat May 20 13:42:35 2017
@author: franklin
"""
"""
In this problem set you work with cities infobox data, audit it, come up with a
cleaning idea and then clean it up.
If you look at the full city data, you will notice that there are couple of
values that ... | mit |
dpyro/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/_base.py | 715 | 13699 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# fr... | mpl-2.0 |
VanirAOSP/external_chromium_org | tools/clang/scripts/run_tool.py | 72 | 10556 | #!/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.
"""Wrapper script to help run clang tools across Chromium code.
How to use this tool:
If you want to run the tool across all Chrom... | bsd-3-clause |
google/contentbox | third_party/django/contrib/gis/maps/google/gmap.py | 174 | 9102 | from django.conf import settings
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.six.moves import xrange
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
class GoogleMapExcepti... | apache-2.0 |
robbiet480/home-assistant | homeassistant/components/konnected/config_flow.py | 5 | 33122 | """Config flow for konnected.io integration."""
import asyncio
import copy
import logging
import random
import string
from urllib.parse import urlparse
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR,
DEVICE_CLASSES_SCHEM... | apache-2.0 |
vaygr/ansible | lib/ansible/module_utils/openstack.py | 20 | 6346 | # 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 wo... | gpl-3.0 |
zaffra/Donate | django/contrib/localflavor/pt/forms.py | 309 | 1561 | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | bsd-3-clause |
allanm84/linux-imx | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
jrg365/gpytorch | gpytorch/utils/contour_integral_quad.py | 1 | 5563 | import math
import warnings
import torch
from .. import settings
from .broadcasting import _mul_broadcast_shape
from .linear_cg import linear_cg
from .minres import minres
from .warnings import NumericalWarning
def contour_integral_quad(
lazy_tensor,
rhs,
inverse=False,
weights=None,
shifts=None... | mit |
willcodefortea/wagtail | wagtail/wagtailsearch/management/commands/update_index.py | 3 | 2495 | from django.core.management.base import BaseCommand
from django.db import models
from wagtail.wagtailsearch.indexed import Indexed
from wagtail.wagtailsearch.backends import get_search_backend
class Command(BaseCommand):
def handle(self, **options):
# Print info
self.stdout.write("Getting object ... | bsd-3-clause |
PowerShellEmpire/Empire | lib/modules/python/collection/osx/native_screenshot_mss.py | 9 | 3876 | import base64
import os
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'NativeScreenshotMSS',
# list of one or mo... | bsd-3-clause |
linas/atomspace | examples/python/values.py | 3 | 1134 | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
from opencog.scheme_wrapper import scheme_eval_v
atomspace = AtomSpace()
set_default_atomspace(atomspace)
a = FloatValue([1.0, 2.0, 3.0]... | agpl-3.0 |
openiitbombayx/edx-platform | common/lib/xmodule/xmodule/partitions/tests/test_partitions.py | 46 | 16043 | """
Test the partitions and partitions service
"""
from unittest import TestCase
from mock import Mock
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from stevedore.extension import Extension, ExtensionManager
from xmodule.partitions.partitions import (
Group, UserPartition, UserPartitionError, No... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.