repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
eusi/MissionPlanerHM | Lib/site-packages/numpy/distutils/command/build_py.py | 89 | 1125 |
from distutils.command.build_py import build_py as old_build_py
from numpy.distutils.misc_util import is_string
class build_py(old_build_py):
def run(self):
build_src = self.get_finalized_command('build_src')
if build_src.py_modules_dict and self.packages is None:
self.packages = buil... | gpl-3.0 |
wtsi-hgi/CoGS-Webapp | cogs/mail/_sanitise.py | 1 | 1551 | """
Copyright (c) 2017, 2018 Genome Research Ltd.
Authors:
* Simon Beal <sb48@sanger.ac.uk>
* Christopher Harrison <ch12@sanger.ac.uk>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either v... | agpl-3.0 |
2uller/LotF | App/Lib/site-packages/scipy/interpolate/tests/test_fitpack2.py | 4 | 11326 | #!/usr/bin/env python
# Created by Pearu Peterson, June 2003
from __future__ import division, print_function, absolute_import
import warnings
from numpy.testing import assert_equal, assert_almost_equal, assert_array_equal, \
assert_array_almost_equal, assert_allclose, TestCase, run_module_suite
from numpy.tes... | gpl-2.0 |
MagazinnikIvan/pywinauto | pywinauto/element_info.py | 1 | 3749 | # GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | bsd-3-clause |
s0enke/boto | boto/opsworks/__init__.py | 135 | 1657 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
hkariti/ansible | lib/ansible/modules/database/influxdb/influxdb_query.py | 30 | 2624 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# 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... | gpl-3.0 |
cpennington/edx-platform | openedx/core/djangoapps/lang_pref/tests/test_views.py | 4 | 1361 | """
Tests: lang pref views
"""
import json
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
from django.urls import reverse
from django.utils.translation import LANGUAGE_SESSION_KEY, get_language
from student.tests.factori... | agpl-3.0 |
valtech-mooc/edx-platform | lms/djangoapps/staticbook/tests.py | 131 | 10613 | """
Test the lms/staticbook views.
"""
import textwrap
import mock
import requests
from django.core.urlresolvers import reverse, NoReverseMatch
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django... | agpl-3.0 |
betoesquivel/PLYpractice | env/lib/python2.7/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 487 | 2613 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# s... | mit |
Jgarcia-IAS/SAT | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/l10n_co_vat/base_vat.py | 6 | 2426 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
numba/numba | numba/core/datamodel/packer.py | 7 | 6645 | from collections import deque
from numba.core import types, cgutils
class DataPacker(object):
"""
A helper to pack a number of typed arguments into a data structure.
Omitted arguments (i.e. values with the type `Omitted`) are automatically
skipped.
"""
# XXX should DataPacker be a model for ... | bsd-2-clause |
cubicova17/annet | venv/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py | 219 | 4256 | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from djan... | mit |
wangjun/odoo | addons/stock/wizard/stock_change_product_qty.py | 157 | 6227 | # -*- 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 |
avilaton/sqlalchemy-continuum | tests/test_exotic_listener_chaining.py | 5 | 1068 | import sqlalchemy as sa
from sqlalchemy_continuum import versioning_manager
from tests import TestCase
class TestBeforeFlushListener(TestCase):
def setup_method(self, method):
@sa.event.listens_for(sa.orm.Session, 'before_flush')
def before_flush(session, ctx, instances):
for obj in se... | bsd-3-clause |
tmimori/erpnext | erpnext/selling/doctype/quotation/quotation.py | 27 | 5222 | # 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.model.mapper import get_mapped_doc
from frappe import _
from erpnext.controllers.selling_controller import SellingController
... | agpl-3.0 |
morynicz/pyroshark | tools/dftestlib/time_relative.py | 40 | 1244 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Th... | gpl-2.0 |
nilbody/h2o-3 | h2o-py/tests/testdir_algos/pca/pyunit_prostatePCA.py | 4 | 1038 | from __future__ import print_function
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.transforms.decomposition import H2OPCA
def pca_prostate():
print("Importing prostate.csv data...\n")
prostate = h2o.upload_file(pyunit_utils.locate("smal... | apache-2.0 |
theclanks/mezzanine | mezzanine/pages/migrations/0001_initial.py | 43 | 4644 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mezzanine.core.fields
import mezzanine.pages.fields
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(... | bsd-2-clause |
infoxchange/django-localflavor | tests/test_hu.py | 10 | 1371 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.hu.forms import HUCountySelect
class HULocalFlavorTests(SimpleTestCase):
def test_HUCountySelect(self):
f = HUCountySelect()
out = '''<select name="counties">
<option value... | bsd-3-clause |
rocky/python3-trepan | test/unit/test-lib-file.py | 1 | 1031 | #!/usr/bin/env python3
'Unit test for trepan.lib.file'
import os, stat, sys, tempfile, unittest
from trepan.lib import file as Mfile
class TestLibFile(unittest.TestCase):
def test_lookupmodule(self):
m, f = Mfile.lookupmodule('os.path')
self.assertTrue(f)
self.assertTrue(m)
m, f ... | gpl-3.0 |
renhaoqi/gem5-stable | src/arch/x86/isa/insts/simd128/floating_point/compare/compare_and_write_mask.py | 91 | 4403 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
scwhitehouse/rose | lib/python/rosie/ws_client.py | 2 | 15395 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-7 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | gpl-3.0 |
sysbio-vo/bnfinder | BNfinder/stats.py | 1 | 151525 | # Copyright (c) 1999-2002 Gary Strangman; All Rights Reserved.
#
# This software is distributable under the terms of the GNU
# General Public License (GPL) v2, the text of which can be found at
# http://www.gnu.org/copyleft/gpl.html. Installing, importing or otherwise
# using this module constitutes acceptance of the t... | gpl-2.0 |
beepee14/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
twitter/pants | tests/python/pants_test/backend/jvm/tasks/test_jar_publish.py | 1 | 12758 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
from builtins import object, str
from mock import Mock
from p... | apache-2.0 |
pu239ppy/authentic2 | authentic2/saml/migrations/0009_auto__add_spoptionsidppolicy__del_field_libertyserviceprovider_prefere.py | 3 | 24253 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from authentic2.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SPOptionsIdPPolicy'
db.create_table('sa... | agpl-3.0 |
teaguesterling/sapartition | sapartition/future.py | 1 | 5721 | """:mod:`future` --- SQLAlchemy-Future
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQLAlchemy-Future is a SQLAlchemy_ extension that introduces `future/promise`_
into query.
.. _SQLAlchemy: http://www.sqlalchemy.org/
.. _future/promise: http://en.wikipedia.org/wiki/Futures_and_promises
How to setup
============
In order to ma... | mit |
dannyperry571/theapprentice | script.module.youtube.dl/lib/youtube_dl/extractor/einthusan.py | 34 | 3416 | # coding: utf-8
from __future__ import unicode_literals
import base64
import json
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_str,
)
from ..utils import (
extract_attributes,
ExtractorError,
get_elements_by_class,
urlencode_postdata,
)
class EinthusanIE(I... | gpl-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/sqlite3/test/userfunctions.py | 16 | 15125 | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warran... | gpl-3.0 |
johndpope/tensorflow | tensorflow/python/debug/wrappers/dumping_wrapper.py | 18 | 5151 | # 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 |
antidata/htmengine-traffic-tutorial | python-engine/webapp.py | 5 | 4311 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | gpl-3.0 |
indevgr/django | tests/invalid_models_tests/test_models.py | 5 | 23774 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.conf import settings
from django.core.checks import Error
from django.db import connections, models
from django.test import SimpleTestCase
from django.test.utils import isolate_apps, override_settings
def get_max_column_na... | bsd-3-clause |
nan86150/ImageFusion | ENV2.7/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py | 906 | 1809 | # Copyright 2014 Donald Stufft
#
# 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, so... | mit |
JioCloud/python-openstackclient | openstackclient/volume/v1/backup.py | 2 | 5368 | # Copyright 2012-2013 OpenStack Foundation
#
# 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 |
jseabold/scikit-learn | sklearn/feature_selection/tests/test_rfe.py | 13 | 10007 | """
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris,... | bsd-3-clause |
atsolakid/edx-platform | pavelib/servers.py | 43 | 9473 | """
Run and manage servers for local development.
"""
from __future__ import print_function
import argparse
from paver.easy import *
from .assets import collect_assets
from .utils.cmd import django_cmd
from .utils.process import run_process, run_multi_processes
DEFAULT_PORT = {"lms": 8000, "studio": 8001}
DEFAULT_SE... | agpl-3.0 |
m1ck/bookadoptions | django/contrib/gis/maps/google/gmap.py | 321 | 9000 | from django.conf import settings
from django.contrib.gis import geos
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
class GoogleMapException(Exception): pass
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon
# The default Google ... | bsd-3-clause |
jollyroger/debian-buildbot | buildbot/test/util/fuzz.py | 3 | 1306 | # 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... | gpl-2.0 |
mintoo/NetDim | pyNMS/miscellaneous/network_tree_view.py | 2 | 2831 | # Copyright (C) 2017 Antoine Fourmy <antoine dot fourmy at gmail dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# ... | gpl-3.0 |
Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/numpy/f2py/diagnose.py | 188 | 5295 | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import sys
import tempfile
def run_command(cmd):
print('Running %r:' % (cmd))
os.system(cmd)
print('------')
def run():
_path = os.getcwd()
os.chdir(tempfile.gettempdir())
print('------')
pr... | artistic-2.0 |
dahlstrom-g/intellij-community | python/helpers/third_party/thriftpy/_shaded_thriftpy/tornado.py | 34 | 8621 | # -*- coding: utf-8 -*-
"""
>>> pingpong = thriftpy.load("pingpong.thrift")
>>>
>>> class Dispatcher(object):
>>> def ping(self):
>>> return "pong"
>>> server = make_server(pingpong.PingPong, Dispatcher())
>>> server.listen(6000)
>>> client = ioloop.IOLoop.current().run_sync(
lambda: make_client(pingp... | apache-2.0 |
mfalesni/cfme_tests | cfme/tests/infrastructure/test_rest_automation_request.py | 2 | 12071 | import multiprocessing as mp
import pytest
from manageiq_client.api import ManageIQClient as MiqApi
from cfme import test_requirements
from cfme.rest.gen_data import a_provider as _a_provider
from cfme.rest.gen_data import automation_requests_data as _automation_requests_data
from cfme.rest.gen_data import vm as _vm... | gpl-2.0 |
sexroute/commandergenius | project/jni/python/src/Lib/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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,inp... | lgpl-2.1 |
keishi/chromium | net/tools/testserver/echo_message.py | 187 | 13195 | # Copyright (c) 2011 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.
"""Provides utility functions for TCP/UDP echo servers and clients.
This program has classes and functions to encode, decode, calculate checksum
and ver... | bsd-3-clause |
ianastewart/cwltc-admin | venv/Lib/site-packages/coderedcms/project_template/sass/website/migrations/0001_initial.py | 2 | 264538 | {% comment %}
"""
IMPORTANT!!! This file must be wrapped in `verbatim` tags to avoid accidentally rendering
any labels/help text that might be interpreted as a django template tag (i.e. {{ }} )
"""
{% endcomment %}
{% verbatim %}
# Generated by Django 2.2.4 on 2019-08-03 16:14
import coderedcms.blocks.base_blocks
... | mit |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/cinderclient/tests/unit/v2/test_shell.py | 2 | 48792 | # 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 ... | mit |
alvin319/CarnotKE | jyhton/tests/python/unicode_index_times.py | 7 | 13363 | # -*- coding: utf-8 -*-
# unicode speed tests for access operations and find
# This is part of an effort to supply the Jython implementation of
# unicode with efficient, correct translations between the visible index
# of a character and and the index in the implementation array of the
# UTF-16 code unit(s) that repres... | apache-2.0 |
duyuyang/stealthdemo | stealthdemo/cf_generator.py | 1 | 12768 | """
This template is to create a single web tier with elb and auto scaling group.
The stack will be running in an existing VPC with existing subnets, route table, SecurityGroups and NACLs.
Users are required to select the VPC, subnets and security groups as parameters.
Make sure you have a s3 bucket created for elb acc... | apache-2.0 |
meabsence/python-for-android | python3-alpha/python3-src/Lib/test/time_hashlib.py | 167 | 2887 | # It's intended that this script be run by hand. It runs speed tests on
# hashlib functions; it does not test for correctness.
import sys, time
import hashlib
def creatorFunc():
raise RuntimeError("eek, creatorFunc not overridden")
def test_scaled_msg(scale, name):
iterations = 106201/scale * 20
longSt... | apache-2.0 |
dgzurita/odoo | addons/website/tests/test_views.py | 144 | 9831 | # -*- coding: utf-8 -*-
import itertools
import unittest2
from lxml import etree as ET, html
from lxml.html import builder as h
from openerp.tests import common
def attrs(**kwargs):
return dict(('data-oe-%s' % key, str(value)) for key, value in kwargs.iteritems())
class TestViewSaving(common.TransactionCase):
... | agpl-3.0 |
DarkArtek/FFXIVITAFC | allauth/socialaccount/providers/pinterest/views.py | 10 | 1391 | import requests
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import PinterestProvider
class PinterestOAuth2Adapter(OAuth2Adapter):
provider_id = PinterestProvider.id
... | unlicense |
labcodes/django | tests/staticfiles_tests/test_liveserver.py | 73 | 2882 | """
A subset of the tests in tests/servers/tests exercising
django.contrib.staticfiles.testing.StaticLiveServerTestCase instead of
django.test.LiveServerTestCase.
"""
import os
from urllib.request import urlopen
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.exceptions import... | bsd-3-clause |
ghchinoy/tensorflow | tensorflow/python/training/saving/functional_saver_test.py | 6 | 5040 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
frederica07/Dragon_Programming_Process | PyOpenGL-3.0.2/OpenGL/GL/EXT/framebuffer_object.py | 4 | 6797 | '''OpenGL extension EXT.framebuffer_object
This module customises the behaviour of the
OpenGL.raw.GL.EXT.framebuffer_object to provide a more
Python-friendly API
Overview (from the spec)
This extension defines a simple interface for drawing to rendering
destinations other than the buffers provided to the GL by ... | bsd-2-clause |
google-research/group_testing | group_testing/state_test.py | 1 | 2709 | # coding=utf-8
# Copyright 2020 Google LLC.
#
# 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 ... | apache-2.0 |
widz4rd/WIDzard-A860L | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
OriHoch/pysiogame | game_boards/game081.py | 1 | 18563 | # -*- coding: utf-8 -*-
import classes.level_controller as lc
import classes.game_driver as gd
import classes.extras as ex
import classes.simple_vector as sv
import pygame
import copy
import classes.board
import random
from math import pi,cos,acos,sin,asin,sqrt
class Board(gd.BoardGame):
def __init__(self, mainl... | gpl-3.0 |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/test/test_devpoll.py | 87 | 4637 | # Test case for the select.devpoll() function
# Initial tests are copied as is from "test_poll.py"
import os
import random
import select
import sys
import unittest
from test.support import TESTFN, run_unittest, cpython_only
if not hasattr(select, 'devpoll') :
raise unittest.SkipTest('test works only on Solaris O... | lgpl-3.0 |
acshan/odoo | addons/stock/wizard/stock_change_product_qty.py | 157 | 6227 | # -*- 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 |
apanda/phantomjs-intercept | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/upload.py | 121 | 22928 | # Copyright (c) 2009, 2010 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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 th... | bsd-3-clause |
shanzhenren/PLE | DataProcessor/pruning_heuristics.py | 1 | 8369 | __author__ = 'wenqihe'
import os
import operator
import sys
from collections import defaultdict
reload(sys)
sys.setdefaultencoding('utf8')
class TypeHierarchy:
def __init__(self, file_name):
self._type_hierarchy = {}
with open(file_name) as f:
for line in f:
t = line.st... | gpl-3.0 |
alessandrod/gst-python | examples/bps.py | 3 | 3082 | #!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# gst-python
# Copyright (C) 2003 David I. Lehn
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# versio... | lgpl-2.1 |
chvrga/outdoor-explorer | java/play-1.4.4/python/Lib/warnings.py | 4 | 14575 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
import types
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", ... | mit |
kwikteam/klustakwik2 | klustakwik2/linear_algebra.py | 2 | 1642 | '''
Linear algebra routines
'''
from numpy import *
from numpy.linalg import cholesky, LinAlgError
from scipy.linalg import cho_factor, cho_solve, cholesky, solve_triangular
__all__ = ['BlockPlusDiagonalMatrix']
class BlockPlusDiagonalMatrix(object):
def __init__(self, masked, unmasked, block=None, diagonal=None... | bsd-3-clause |
pgriess/CascadeExplorer | elementtree/ElementInclude.py | 103 | 4926 | #
# ElementTree
# $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | bsd-3-clause |
czhu95/ternarynet | tensorpack/dataflow/format.py | 3 | 4218 | # -*- coding: utf-8 -*-
# File: format.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
from ..utils import logger, get_rng
from ..utils.timer import timed_operation
from ..utils.loadcaffe import get_caffe_pb
from .base import RNGDataFlow
import random
from tqdm import tqdm
from six.moves import range
try:
import h5p... | apache-2.0 |
Yannig/ansible | lib/ansible/modules/cloud/openstack/os_security_group_rule.py | 11 | 11867 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... | gpl-3.0 |
ruziniu/v2ex | mail.py | 20 | 2098 | #!/usr/bin/env python
# coding=utf-8
import logging
import re
from v2ex.babel import Member
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
from google.appengine.ext.webapp.util import run_wsgi_app
from twitter.oaut... | bsd-3-clause |
linked67/p2pool-kryptonite | wstools/logging.py | 292 | 8187 | # Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
"""Logging"""
ident = "$Id$"
import os, sys
WARN = 1
DEBUG = 2
class ILogger:
'''Logger int... | gpl-3.0 |
antoviaque/edx-platform | lms/djangoapps/courseware/management/commands/tests/test_clean_history.py | 30 | 18680 | """Test the clean_history management command."""
import fnmatch
from mock import Mock
from nose.plugins.attrib import attr
import os.path
import textwrap
import dateutil.parser
from django.test import TransactionTestCase
from django.db import connection
from courseware.management.commands.clean_history import Stude... | agpl-3.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/django/utils/encoding.py | 64 | 10076 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import datetime
import locale
from decimal import Decimal
from django.utils import six
from django.utils.functional import Promise
from django.utils.six.moves.urllib.parse import quote, unquote
if six.PY3:
from urllib.parse import un... | bsd-2-clause |
3dfxmadscientist/cbss-server | addons/portal_project/tests/test_access_rights.py | 36 | 16870 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
Just-D/chromium-1 | tools/telemetry/third_party/gsutilz/third_party/pyasn1-modules/setup.py | 25 | 2617 | #!/usr/bin/env python
"""A collection of ASN.1-based protocols modules.
A collection of ASN.1 modules expressed in form of pyasn1 classes.
Includes protocols PDUs definition (SNMP, LDAP etc.) and various
data structures (X.509, PKCS etc.).
"""
classifiers = """\
Development Status :: 5 - Production/Stable
En... | bsd-3-clause |
khushboo9293/mailman3 | src/mailman/rules/administrivia.py | 7 | 3478 | # Copyright (C) 2007-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at you... | gpl-2.0 |
Akasurde/ansible | test/integration/targets/dict_transformations/library/convert_camelCase.py | 29 | 1111 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: convert_camelCase
short_description: test converting data to ca... | gpl-3.0 |
Fedik/gramps | gramps/gen/filters/rules/_hasnotesubstrbase.py | 5 | 2077 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | gpl-2.0 |
michals/hurry-app | main/lib/werkzeug/contrib/securecookie.py | 318 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | mit |
mezz64/home-assistant | tests/components/input_boolean/test_reproduce_state.py | 21 | 1307 | """Test reproduce state for input boolean."""
from homeassistant.core import State
from homeassistant.setup import async_setup_component
async def test_reproducing_states(hass):
"""Test reproducing input_boolean states."""
assert await async_setup_component(
hass,
"input_boolean",
{
... | apache-2.0 |
philetus/geosolver | workbench/panel.py | 1 | 4799 | from includes import *
from pointDialog import *
from distanceDialog import *
from angleDialog import *
from ui_constraint import *
from prototypeObjects import *
class Panel(QtGui.QWidget):
def __init__(self, mainWindow, widget):
QtGui.QWidget.__init__(self, widget)
self.ui = Ui_ConstraintDialog()
self.ui.set... | gpl-3.0 |
systemdaemon/systemd | tools/compile-unifont.py | 37 | 3336 | # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2013-2014 David Herrmann <dh.herrmann@gmail.com>
#
# systemd 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 F... | gpl-2.0 |
quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/sqlalchemy/testing/plugin/plugin_base.py | 23 | 15896 | # plugin/plugin_base.py
# Copyright (C) 2005-2014 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
"""Testing extensions.
this module is designed to work as a testing-framework... | mit |
PytLab/catplot | catplot/grid_components/planes.py | 1 | 2886 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
class Plane3D(object):
""" Plane in 3D canvas.
Parameters:
-----------
x: 1-d array, the range of the plane along "x" axis
(it's a generalized x, it depends on the axis value).
y: 1-d array, the r... | mit |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/django/contrib/gis/measure.py | 118 | 12286 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | bsd-3-clause |
drestuart/delvelib | lib/pygcurse/pygcurse_old.py | 1 | 110209 | """
Please forgive any typos or errors in the comments, I'll be cleaning them up as frequently as I can.
Pygcurse v0.1 alpha
Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applic... | lgpl-3.0 |
cyanfish/heltour | heltour/tournament/migrations/0113_auto_20161129_0415.py | 1 | 1265 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-29 04:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournament', '0112_auto_20161127_1814'),
]
operations = [
migrations.AddField(
model_name='alternate',
... | mit |
tiborsimko/invenio-demosite | invenio_demosite/base/recordext/functions/get_number_of_copies.py | 7 | 1209 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
#
# Invenio Demosite 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 ver... | gpl-2.0 |
MrTheodor/espressopp | src/analysis/MeanSquareInternalDist.py | 6 | 2065 | # Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of the G... | gpl-3.0 |
jpshort/odoo | comunity_modules/account_financial_report_webkit/report/open_invoices.py | 22 | 11994 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright Camptocamp SA 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
DroneBuster/MissionPlanner | ExtLibs/Mavlink/pymavlink/generator/lib/genxmlif/xmlifBase.py | 82 | 5371 | #
# genxmlif, Release 0.9.0
# file: xmlifbase.py
#
# XML interface base classes
#
# history:
# 2005-04-25 rl created
# 2006-08-18 rl some methods for XML schema validation support added
# 2007-05-25 rl performance optimization (caching) added, bugfixes for XPath handling
# 2007-07-04 rl complete re-de... | gpl-3.0 |
jalanb/dotjab | src/python/files.py | 2 | 1359 | """Methods to handle text files"""
from __future__ import print_function
def backup_with_suffix(filename, suffix):
text = file(filename).read()
file('%s%s' % (filename, suffix), 'w').write(text)
# pylint: disable=too-many-arguments
def looks_like_this(filename, limits=None, numbers=True, space=' ', tab='\t'... | mit |
miguelparaiso/OdooAccessible | addons/account_cancel/__openerp__.py | 261 | 1621 | # -*- 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 |
lazytype/ActOne | actone.py | 1 | 3222 | import sys
from functools import partial
_magic_methods = ' '.join([
'getitem',
'divmod neg pos abs invert',
'call',
])
_numerics = 'add sub mul div floordiv mod lshift rshift and xor or pow'
_inplace = ' '.join('i%s' % n for n in _numerics.split())
_right = ' '.join('r%s' % n for n in _numerics.split())... | mit |
tanishqaggarwal/cornellclassmates | graphy/common_test.py | 33 | 3695 | #!/usr/bin/python2.4
#
# Copyright 2008 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 o... | gpl-3.0 |
xrmx/django | django/contrib/gis/db/backends/postgis/schema.py | 18 | 2684 | from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(index_type)s (%(column)s %(ops)s)"
s... | bsd-3-clause |
instituteofpathologyheidelberg/bioconda-recipes | recipes/picard/2.7.1/picard.py | 18 | 2806 | #!/opt/anaconda1anaconda2anaconda3/bin/python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Paramet... | mit |
ttrifonov/horizon | horizon/horizon/utils/reverse_bugfix.py | 8 | 8489 | """
Bugfix for issue #15900: https://code.djangoproject.com/ticket/15900.
This code is largely reproduced from
https://code.djangoproject.com/browser/django/trunk/django/core/urlresolvers.py
and is the work of Django's authors:
https://code.djangoproject.com/browser/django/trunk/AUTHORS
It is licensed under Django's ... | apache-2.0 |
smartscheduling/scikit-learn-categorical-tree | examples/plot_digits_pipe.py | 250 | 1809 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/library_visual_scenes/visual_scene/node/asset/coverage/geographic_location/absolute/absolute.py | 1 | 4480 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit |
kleskjr/scipy | scipy/weave/tests/test_scxx_object.py | 91 | 27994 | """ Test refcounting and behavior of SCXX.
"""
from __future__ import absolute_import, print_function
import sys
from UserList import UserList
from numpy.testing import (TestCase, assert_equal, assert_, assert_raises,
run_module_suite)
from scipy.weave import inline_tools
from weave_test_... | bsd-3-clause |
johnmcdowall/procedural_city_generation | procedural_city_generation/building_generation/building_generation_params.py | 3 | 2772 | """
Module which contains all input parameters for this sudmodule, along with:
- The default (recommmended) value from the developers
- A short description of what the parameter changes
- All values that the parameter accepts without causing this program to break.
This information can also be viewed when calling the G... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.