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 |
|---|---|---|---|---|---|
davidbuzz/ardupilot | Tools/scripts/gen_stable.py | 31 | 1612 | #!/usr/bin/env python
'''
create stable-x.y.z directories so we keep all past stable releases for users to download
'''
import os
import shutil
VEHICLES = ['AntennaTracker', 'Copter', 'Plane', 'Rover', 'Sub']
def make_stable(basedir, vehicle):
'''make stable version for a vehicle'''
stable_dir = os.path.joi... | gpl-3.0 |
jordanemedlock/psychtruths | temboo/Library/Salesforce/OAuth/InitializeOAuth.py | 4 | 5366 | # -*- coding: utf-8 -*-
###############################################################################
#
# InitializeOAuth
# Generates an authorization URL that an application can use to complete the first step in the OAuth process.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under ... | apache-2.0 |
pacoqueen/odfpy | tests/teststyleref.py | 3 | 4910 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2007 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in th... | gpl-2.0 |
renalreg/radar | tests/permissions/test_has_permission_for_group.py | 1 | 1306 | from radar.models.groups import Group
from radar.permissions import has_permission_for_group
from radar.roles import PERMISSION, ROLE
from tests.permissions.helpers import make_groups, make_user
def test_admin():
user = make_user()
group = Group()
assert not has_permission_for_group(user, group, PERMISSI... | agpl-3.0 |
numericube/twistranet | twistranet/notifier/__init__.py | 1 | 2867 | """
This is the main notifier service.
The design philisophy here is to send notification for "heads-up" events,
that is events that MAY require a reaction from its recipient.
Emails are sent for "actionnable" events, that is events that require an action
to be taken (accept in a network or community, ...).
"""
from... | agpl-3.0 |
yesho/MITMf | core/sslstrip/URLMonitor.py | 26 | 5758 | # Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati
#
# 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... | gpl-3.0 |
1tush/sentry | src/sentry/migrations/0062_correct_del_index_sentry_groupedmessage_logger__view__checksum.py | 36 | 18947 | # -*- coding: 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):
pass
def backwards(self, orm):
pass
models = {
'sentry.user': {
'Meta': {'obje... | bsd-3-clause |
jzt5132/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
yanjinbin/learnPython | chapter_7/chapter7.py | 1 | 3243 | """映射 集合 ... 高级数据结构类型"""
from string import Template
val_dict = {1: 'a', 2: 'b', 3: 'c'}
print(val_dict)
print(val_dict.keys())
print(val_dict.items())
print(val_dict.values())
factory_dict = dict((['x', 1], ['y', 2]))
print(factory_dict)
ddcit = {}.fromkeys(('x', 'y', 'z'), -24)
ddcit.update(val_dict) # 新值覆盖旧值
prin... | gpl-3.0 |
GISAElkartea/amv2 | antxetamedia/blobs/tasks.py | 1 | 1889 | import traceback
from django.db.models.signals import post_save
from django.conf import settings
from django.core.files.storage import default_storage
from celery import shared_task
from ..shows.models import AbstractPodcast
from .models import Blob, BlobUpload
from .archive import ArchiveS3
RETRY_POLICY = {
'... | agpl-3.0 |
raden/cempaka-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
blrm/openshift-tools | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/openshift_health_checker/openshift_checks/logging/elasticsearch.py | 45 | 9996 | """Check for an aggregated logging Elasticsearch deployment"""
import json
import re
from openshift_checks import OpenShiftCheckException, OpenShiftCheckExceptionList
from openshift_checks.logging.logging import LoggingCheck
class Elasticsearch(LoggingCheck):
"""Check for an aggregated logging Elasticsearch dep... | apache-2.0 |
code4futuredotorg/reeborg_tw | src/libraries/brython_old/Lib/fnmatch.py | 894 | 3163 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | agpl-3.0 |
OpenPymeMx/account-financial-tools | currency_rate_date_check/currency_rate_date_check.py | 31 | 4581 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Currency rate date check module for OpenERP
# Copyright (C) 2012-2013 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: y... | agpl-3.0 |
jamespcole/home-assistant | homeassistant/components/isy994/switch.py | 8 | 2242 | """Support for ISY994 switches."""
import logging
from typing import Callable
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.helpers.typing import ConfigType
from . import ISY994_NODES, ISY994_PROGRAMS, ISYDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, co... | apache-2.0 |
hkawasaki/kawasaki-aio8-0 | common/test/acceptance/pages/xblock/acid.py | 16 | 3297 | """
PageObjects related to the AcidBlock
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, BrokenPromise, Promise
class AcidView(PageObject):
"""
A :class:`.PageObject` representing the rendered view of the :class:`.AcidBlock`.
"""
url = None
def __init__(... | agpl-3.0 |
samtx/whatsmyrankine | venv/lib/python2.7/site-packages/flask/testsuite/config.py | 556 | 11820 | # -*- coding: utf-8 -*-
"""
flask.testsuite.config
~~~~~~~~~~~~~~~~~~~~~~
Configuration and instances.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import flask
import pkgutil
import unittest
from contextlib import contextmanager
fr... | mit |
signed/intellij-community | python/lib/Lib/site-packages/django/utils/translation/trans_null.py | 241 | 2648 | # These are versions of the functions in django.utils.translation.trans_real
# that don't actually do anything. This is purely for performance, so that
# settings.USE_I18N = False can use this module rather than trans_real.py.
import warnings
from django.conf import settings
from django.utils.encoding import force_uni... | apache-2.0 |
christoffkok/auxi.0 | src/tools/chemistry/stoichiometry.py | 1 | 24293 | #!/usr/bin/env python3
"""
This module provides a number of functions for doing stoichiometry
calculations.
"""
import re
from auxi.core.objects import Object
__version__ = '0.3.2'
__license__ = 'LGPL v3'
__copyright__ = 'Copyright 2016, Ex Mente Technologies (Pty) Ltd'
__author__ = 'Christoff Kok, Johan Zietsman'
... | lgpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Mac/Modules/qt/qtsupport.py | 34 | 16253 | # This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
#error missing SetActionFilter
import... | mit |
xmission/d-note | venv/lib/python2.7/site-packages/flask/views.py | 50 | 5632 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | agpl-3.0 |
ktsitsikas/odemis | src/odemis/driver/andorcam2.py | 1 | 106096 | # -*- coding: utf-8 -*-
'''
Created on 15 Mar 2012
@author: Éric Piel
Copyright © 2012-2015 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License version 2 as published by the Free Software
Foundation.
Odem... | gpl-2.0 |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Interface_Mesh_Types/Interface_5/HardContact_NonLinHardShear/Interface_Test_Shear_Plot.py | 23 | 3513 | #!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import matplotlib as mpl
import sys
import numpy as np;
plt.rcParams.update({'font.size': 28})
# set tick width
mpl.rcParams['xtick.major.size'] = 10
mpl.rcParams['xtick.major.width'] = 5
mpl.rcParams['xtick.minor.size'] = 10
mpl.rcParams['xtick.minor.width... | cc0-1.0 |
lundjordan/services | lib/backend_common/backend_common/auth.py | 1 | 15353 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import functools
import time
import flask
import flask_login
import itsdangerou... | mpl-2.0 |
efortuna/AndroidSDKClone | ndk_experimental/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/share/gdb/python/gdb/prompt.py | 137 | 4210 | # Extended prompt utilities.
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
# 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 ... | apache-2.0 |
ferranferri/exif_classifier | src/exif_classifier.py | 1 | 4874 | import getopt
import json
import os
import sys
import logging
from file_item import FileItem
from log_config import get_logger
from percentage_show import printProgress
DEFAULT_CONFIG_FILE = 'conf/config.json'
class ExifClassifier:
"""
Classifies images by their exif creation date information. You need to p... | mit |
datakid/tvet | tafe/migrations/0051_auto__chg_field_course_slug.py | 1 | 24149 | # -*- coding: 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):
# Changing field 'Course.slug'
db.alter_column('tafe_course', 'slug', self.gf('django.db.models.fields.Slug... | gpl-3.0 |
repotvsupertuga/repo | plugin.video.loganaddon/playtvfr.py | 297 | 8750 | import struct
import urllib2,urllib
import re
import json
import math
CRYPT_XXTEA_DELTA= 0x9E3779B9
headers = [('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),( 'Connection','Keep-Alive')]
class Crypt_XXTEA:
_key=None
def setKey(self,key):
if isinstance(key, basestring):
... | gpl-2.0 |
ayoubg/gem5-graphics | gem5/src/unittest/genini.py | 77 | 2696 | #!/usr/bin/env python
# Copyright (c) 2005 The Regents of The University of Michigan
# 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 copyrigh... | bsd-3-clause |
lexor90/node-compiler | node/deps/v8/tools/testrunner/local/junit_output.py | 101 | 2278 | # Copyright 2013 the V8 project authors. 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 conditi... | mit |
jlaura/pysal | pysal/contrib/network/priordict.py | 20 | 2744 | """
Code adapted from source from:
David Eppstein, UC Irvine, 8 Mar 2002
"""
from __future__ import generators
class PriorityDictionary(dict):
def __init__(self):
"""
Initialize PriorityDictionary by creating binary heap
of pairs (value,key). Note that changing or removing a dict entry w... | bsd-3-clause |
fginter/q_top | q_top.py | 1 | 2351 | import subprocess
import datetime
import sys
import time
def user_jobs(user):
proc = subprocess.Popen(["squeue","-u",user],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
outs, errs = proc.communicate()
if proc.returncode:
raise ValueError("Squeue failed")
return outs.decode("ASCII").count("\n")... | gpl-3.0 |
endorphinl/horizon | openstack_dashboard/dashboards/project/network_topology/views.py | 13 | 11671 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
wh1100717/tornado_skeleton | sdk/google/protobuf/internal/test_bad_identifiers_pb2.py | 5 | 4805 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/test_bad_identifiers.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import service as _se... | mit |
ccpgames/eve-metrics | web2py/applications/welcome/controllers/default.py | 1 | 2660 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authori... | mit |
xadahiya/django | tests/gis_tests/tests.py | 281 | 3127 | import sys
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.db import ProgrammingError
from django.utils import six
try:
from django.contrib.gis.db.backends.postgis.operations import PostGISOperations
HAS_POSTGRES = True
except ImportError:
HAS_POSTGRES = False
except Im... | bsd-3-clause |
barnsnake351/neutron | neutron/server/__init__.py | 7 | 2132 | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
xzYue/odoo | addons/account/report/account_financial_report.py | 380 | 6365 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
slightlymadphoenix/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/dispatch/weakref_backports.py | 179 | 2147 | """
weakref_backports is a partial backport of the weakref module for python
versions below 3.4.
Copyright (C) 2013 Python Software Foundation, see LICENSE.python for details.
The following changes were made to the original sources during backporting:
* Added `self` to `super` calls.
* Removed `from None` when rai... | mit |
daizhengy/RDS | trove/tests/unittests/db/test_migration_utils.py | 4 | 5267 | # Copyright 2014 Tesora Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
sestrella/ansible | test/units/modules/remote_management/oneview/test_oneview_fcoe_network.py | 68 | 5980 | # -*- coding: utf-8 -*-
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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 optio... | gpl-3.0 |
smart-developerr/my-first-blog | Lib/site-packages/pip/operations/freeze.py | 342 | 5194 | from __future__ import absolute_import
import logging
import re
import pip
from pip.req import InstallRequirement
from pip.req.req_file import COMMENT_RE
from pip.utils import get_installed_distributions
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.p... | gpl-3.0 |
mozilla/addons-server | src/olympia/bandwagon/tasks.py | 3 | 1228 | from datetime import datetime
from django.db.models import Count
import olympia.core.logger
from olympia.amo.celery import task
from olympia.amo.decorators import use_primary_db
from .models import Collection, CollectionAddon
log = olympia.core.logger.getLogger('z.task')
@task
@use_primary_db
def collection_met... | bsd-3-clause |
numenta/nupic | src/nupic/regions/anomaly_likelihood_region.py | 6 | 4973 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
nexusz99/boto | tests/integration/storage_uri/test_storage_uri.py | 132 | 2355 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# 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 |
dezynetechnologies/odoo | addons/l10n_at/__init__.py | 438 | 1050 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/encodings/euc_jis_2004.py | 816 | 1051 | #
# euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | gpl-2.0 |
Neamar/django | tests/foreign_object/test_empty_join.py | 232 | 1498 | from django.test import TestCase
from .models import SlugPage
class RestrictedConditionsTests(TestCase):
def setUp(self):
slugs = [
'a',
'a/a',
'a/b',
'a/b/a',
'x',
'x/y/z',
]
SlugPage.objects.bulk_create([SlugPage(sl... | bsd-3-clause |
tlakshman26/cinder-bug-fix-volume-conversion-full | cinder/tests/unit/backup/fake_swift_client.py | 34 | 4017 | # Copyright (C) 2012 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/LICEN... | apache-2.0 |
donald-pinckney/EM-Simulator | EM Sim/EM SimContent/Lib/string.py | 124 | 20756 | """A collection of string operations (most are no longer used).
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop is n... | apache-2.0 |
MRigal/django | tests/utils_tests/test_termcolors.py | 337 | 6461 | import unittest
from django.utils.termcolors import (
DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES,
colorize, parse_color_setting,
)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE... | bsd-3-clause |
matthappens/taskqueue | taskqueue/venv_tq/lib/python2.7/site-packages/boto/cloudsearch/optionstatus.py | 185 | 8711 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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... | mit |
dmaticzka/bctools | bin/rm_spurious_events.py | 2 | 3303 | #!/usr/bin/env python
from builtins import str
import argparse
import logging
from subprocess import check_call
import os
tool_description = """
Remove spurious events originating from errors in random sequence tags.
This script compares all events sharing the same coordinates. Among each group
of events the maximum... | apache-2.0 |
jeremiah-c-leary/vhdl-style-guide | vsg/tests/architecture/test_rule_029.py | 1 | 5128 |
import os
import unittest
from vsg.rules import architecture
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_029_test_input.vhd'))
#lExpected = []
#lExpected.append('')
#utils.read_file(os.path.join(sT... | gpl-3.0 |
Ehtaga/partner-contact | partner_firstname/tests/base.py | 12 | 3530 | # -*- coding: utf-8 -*-
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual... | agpl-3.0 |
burzillibus/RobHome | venv/lib/python2.7/site-packages/click/core.py | 136 | 70254 | import errno
import os
import sys
from contextlib import contextmanager
from itertools import repeat
from functools import update_wrapper
from .types import convert_type, IntRange, BOOL
from .utils import make_str, make_default_short_help, echo, get_os_args
from .exceptions import ClickException, UsageError, BadParame... | mit |
maxamillion/ansible-modules-core | cloud/digital_ocean/digital_ocean_domain.py | 22 | 7005 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
chilleo/ALPHA | raxmlOutputWindows/matplotlibCustomBackend/customFormlayout.py | 1 | 20667 | # -*- coding: utf-8 -*-
"""
formlayout
==========
Module creating Qt form dialogs/layouts to edit various type of parameters
formlayout License Agreement (MIT License)
------------------------------------------
Copyright (c) 2009 Pierre Raybaut
Permission is hereby granted, free of charge, to any person
obtaining ... | mit |
unayok/genosha | genoshatest/xmltest.py | 1 | 1201 | #!/usr/bin/env python
# genoshatest/xmltest.py - test cases for Genosha over XML
# Copyright (C) 2009 Shawn Sulma <genosha@470th.org>
#
# 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 Foundat... | gpl-3.0 |
olgabrani/synnefo | snf-cyclades-app/synnefo/userdata/asn1.py | 10 | 5169 | # ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associa... | gpl-3.0 |
akurtakov/Pydev | plugins/org.python.pydev.jython/Lib/unittest/test/test_functiontestcase.py | 115 | 5534 | import unittest
from .support import LoggingResult
class Test_FunctionTestCase(unittest.TestCase):
# "Return the number of tests represented by the this test object. For
# TestCase instances, this will always be 1"
def test_countTestCases(self):
test = unittest.FunctionTestCase(lambda: None)
... | epl-1.0 |
memnonila/django-cms | cms/test_utils/project/pluginapp/plugins/meta/migrations/0001_initial.py | 66 | 1385 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='TestPluginModel',
fields=[
... | bsd-3-clause |
stevekuznetsov/ansible | lib/ansible/modules/identity/ipa/ipa_host.py | 20 | 10200 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... | gpl-3.0 |
mplewis/platformio | platformio/builder/scripts/basearm.py | 6 | 1813 | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
"""
Base for ARM microcontrollers.
"""
from SCons.Script import Builder, DefaultEnvironment
env = DefaultEnvironment()
env.Replace(
AR="arm-none-eabi-ar",
AS="arm-none-eabi-as",
CC="arm-none-eabi-gcc",
CXX="arm-none-eabi-g... | mit |
evansd/django | tests/introspection/models.py | 44 | 1676 | from django.db import models
class City(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class District(models.Model):
city = models.ForeignKey(City, models.CASCADE, primary_key=True)
name = models.CharF... | bsd-3-clause |
weimingtom/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/apps/service_test.py | 128 | 18741 | #!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... | apache-2.0 |
mbareta/edx-platform-ft | lms/djangoapps/ccx/utils.py | 1 | 15996 | """
CCX Enrollment operations for use by Coach APIs.
Does not include any access control, be sure to check access before calling.
"""
import datetime
import logging
import pytz
from contextlib import contextmanager
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from dja... | agpl-3.0 |
JioCloud/neutron | neutron/db/migration/alembic_migrations/versions/3d2585038b95_vmware_nsx.py | 15 | 1462 | # Copyright 2014 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 law ... | apache-2.0 |
DCSaunders/tensorflow | tensorflow/contrib/metrics/python/ops/set_ops.py | 4 | 7480 | # 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 |
rtoma/Diamond | src/diamond/utils/log.py | 14 | 1974 | # coding=utf-8
import logging
import logging.config
import sys
import os
class DebugFormatter(logging.Formatter):
def __init__(self, fmt=None):
if fmt is None:
fmt = ('%(created)s\t' +
'[%(processName)s:%(process)d:%(levelname)s]\t' +
'%(message)s')
... | mit |
nickster5001/ctracker | flask/lib/python3.4/site-packages/whoosh/matching/wrappers.py | 86 | 17446 | # Copyright 2010 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | mit |
campbe13/openhatch | vendor/packages/PyYaml/lib3/yaml/events.py | 985 | 2445 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... | agpl-3.0 |
LABETE/TestYourProject | docs/conf.py | 1 | 7895 | # -*- coding: utf-8 -*-
#
# TestYourProject documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration value... | bsd-3-clause |
Yukarumya/Yukarum-Redfoxes | testing/web-platform/harness/wptrunner/browsers/edge.py | 59 | 2528 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from .base import Browser, ExecutorBrowser, require_arg
from ..webdriver_server import EdgeDriverServer
from ..executors... | mpl-2.0 |
pkariz/nnsearch | nnsearch/approx/LSHFlann.py | 1 | 4840 | from ..flannindex import FlannIndex
from ..datasets import Dataset
import numpy as np
class LSHFlann(FlannIndex):
"""Locality-sensitive hashing algorithm from FLANN."""
def __init__(self):
super(LSHFlann,self).__init__()
self.algorithm = "LSH-flann"
self.valid_types = [np.uint8]
d... | gpl-3.0 |
chokribr/PIST | modules/websearch/lib/websearch_templates.py | 3 | 214284 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; eithe... | gpl-2.0 |
eirki/script.module.pywin32 | lib/x32/win32comext/axscript/test/leakTest.py | 16 | 4510 | import sys
from win32com.axscript.server.error import Exception
from win32com.axscript import axscript
from win32com.axscript.server import axsite
import pythoncom
from win32com.server import util, connect
import win32com.server.policy
class MySite(axsite.AXSite):
def OnScriptError(self, error):
exc = error.Get... | bsd-3-clause |
lhfei/spark-in-action | spark-2.x/src/main/python/ml/count_vectorizer_example.py | 1 | 1595 | #
# 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 n... | apache-2.0 |
baianoweb/google-blog-converters-appengine | src/livejournal2blogger/lj2b.py | 30 | 18135 | #!/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.txt
#
# Unless required by applicable law or ... | apache-2.0 |
fmof/sagepp | gtest-1.7.0/test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-3.0 |
def-/commandergenius | project/jni/python/src/Demo/pdist/rcslib.py | 43 | 10318 | """RCS interface module.
Defines the class RCS, which represents a directory with rcs version
files and (possibly) corresponding work files.
"""
import fnmatch
import os
import re
import string
import tempfile
class RCS:
"""RCS interface class (local filesystem version).
An instance of this class repres... | lgpl-2.1 |
Thhhza/XlsxWriter | xlsxwriter/test/worksheet/test_worksheet01.py | 8 | 1476 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAss... | bsd-2-clause |
pombredanne/bokeh | bokeh/core/tests/test_query.py | 3 | 6856 | from __future__ import absolute_import
import unittest
import bokeh.core.query as query
from bokeh.models import (
Axis, BoxZoomTool, ColumnDataSource, DatetimeAxis, GlyphRenderer, Grid, LinearAxis,
LogAxis, PanTool, Plot, PreviewSaveTool, Range1d, ResetTool, ResizeTool, Tool, WheelZoomTool,
)
from bokeh.mod... | bsd-3-clause |
cloudformdesign/micropython | cc3200/boards/make-pins.py | 24 | 8280 | #!/usr/bin/env python
"""Generates the pins file for the CC3200."""
from __future__ import print_function
import argparse
import sys
import csv
SUPPORTED_AFS = { 'UART': ('TX', 'RX', 'RTS', 'CTS'),
'SPI': ('CLK', 'MOSI', 'MISO', 'CS0'),
#'I2S': ('CLK', 'FS', 'DAT0', 'DAT1'),
... | mit |
ernstp/kivy | kivy/uix/gridlayout.py | 20 | 14758 | '''
Grid Layout
===========
.. only:: html
.. image:: images/gridlayout.gif
:align: right
.. only:: latex
.. image:: images/gridlayout.png
:align: right
.. versionadded:: 1.0.4
The :class:`GridLayout` arranges children in a matrix. It takes the available
space and divides it into columns a... | mit |
davenovak/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/ez_setup.py | 454 | 10334 | #!python
# This file was obtained from:
# http://peak.telecommunity.com/dist/ez_setup.py
# on 2011/1/21.
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup... | gpl-3.0 |
akosyakov/intellij-community | python/lib/Lib/encodings/iso2022_jp_3.py | 816 | 1061 | #
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
AOSPU/external_chromium_org | tools/telemetry/telemetry/unittest/gtest_testrunner.py | 8 | 1527 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implements a unittest TestRunner with GTest output.
This output is ported from gtest.cc's PrettyUnitTestResultPrinter, but
designed... | bsd-3-clause |
Vegasvikk/django-cms | cms/toolbar_base.py | 53 | 1363 | # -*- coding: utf-8 -*-
from cms.exceptions import LanguageError
from cms.utils import get_language_from_request
from cms.utils.i18n import get_language_object
from django.contrib.sites.models import Site
class CMSToolbar(object):
supported_apps = None
def __init__(self, request, toolbar, is_current_app, app... | bsd-3-clause |
biddisco/VTK | ThirdParty/Twisted/twisted/conch/test/test_text.py | 12 | 3557 | # -*- test-case-name: twisted.conch.test.test_text -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.conch.insults import helper, text
A = text.attributes
class Serialization(unittest.TestCase):
def setUp(self):
self.attrs = helpe... | bsd-3-clause |
jeff-regier/Celeste.jl | benchmark/galsim/galsim_benchmarks.py | 1 | 4643 | import logging
import os
import generate_test_image
OUTPUT_LABEL = 'galsim_benchmarks'
# populated by the `galsim_test_case` decorator
TEST_CASE_CALLBACKS = []
def galsim_test_case(fn):
def decorated(test_case):
fn(test_case)
test_case.comment = fn.__name__
decorated.__name__ = fn.__name__
... | mit |
ksrajkumar/openerp-6.1 | openerp/addons/crm_fundraising/report/__init__.py | 9 | 1086 | # -*- 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... | agpl-3.0 |
alexandrucoman/vbox-nova-driver | nova/tests/unit/objects/test_instance_action.py | 7 | 16579 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
indeedops/dd-agent | checks.d/apache.py | 2 | 4195 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import urlparse
# 3rd party
import requests
# project
from checks import AgentCheck
from util import headers
from config import _is_affirmative
class Apache(AgentCheck):
"""Tracks basic connection... | bsd-3-clause |
maheshakya/scikit-learn | sklearn/utils/random.py | 15 | 10411 | # Author: Hamzeh Alsalhi <ha258@cornell.edu>
#
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy.sparse as sp
import operator
import array
from sklearn.utils import check_random_state
from ._random import sample_without_replacement
__all__ = ['sample_without_replacement', 'choic... | bsd-3-clause |
alexteodor/odoo | setup.py | 35 | 5770 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from glob import glob
from setuptools import find_packages, setup
from os.path import join, dirname
execfile(join(dirname(__file__), 'openerp', 'release.py')) # Load release variables
lib_name = 'openerp'
def py2exe_datafiles():
data_files = {}... | agpl-3.0 |
riki2321gamer/RikiStation1 | tools/mapmerge/map_helpers.py | 25 | 24468 | import sys
import subprocess
from datetime import datetime
tgm_header = "//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE"
try:
version = sys.version_info
if version.major < 3 or (version.major == 3 and version.minor < 5):
print("ERROR: You are running an incompat... | agpl-3.0 |
vim-IDE/python-mode | pymode/libs/logilab/common/testlib.py | 22 | 50506 | # -*- coding: utf-8 -*-
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... | lgpl-3.0 |
codekidX/android_kernel_samsung_i9082 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
dabura667/electrum | gui/qt/seed_dialog.py | 1 | 7237 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2013 ecdsa@github
#
# 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 li... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.