repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
spiritlinxl/BTCGPU | test/functional/rpcnamedargs.py | 33 | 1288 | #!/usr/bin/env python3
# Copyright (c) 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 using named arguments for RPCs."""
from test_framework.test_framework import BitcoinTestFramework
from... | mit |
almarklein/bokeh | examples/glyphs/donut.py | 45 | 4204 | from __future__ import print_function
import base64
from math import pi, sin, cos
from bokeh.browserlib import view
from bokeh.colors import skyblue, seagreen, tomato, orchid, firebrick, lightgray
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Wedge, AnnularWedge... | bsd-3-clause |
PatrickOReilly/scikit-learn | sklearn/decomposition/incremental_pca.py | 83 | 10440 | """Incremental Principal Components Analysis."""
# Author: Kyle Kastner <kastnerkyle@gmail.com>
# Giorgio Patrini
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from .base import _BasePCA
from ..utils import check_array, gen_batches
from ..utils.extmath import svd_flip, _incremental_mean... | bsd-3-clause |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/pip/_vendor/colorama/winterm.py | 442 | 5732 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... | gpl-3.0 |
bhdouglass/remindor-common | tests/test_time_validation.py | 1 | 1362 | import remindor_common.datetimeutil as d
valid_singular = [
"now",
"1:00pm",
"1:00 pm",
"13:00",
"13",
"1300",
"1pm"
]
valid_repeating = [
"every hour",
"every hour from 1 to 1:00pm",
"every minute",
"every minute from 2:00pm to 1500",
"every 3 minutes",
"every ... | gpl-3.0 |
jokajak/itweb | data/env/lib/python2.6/site-packages/repoze.what-1.0.9-py2.6.egg/repoze/what/release.py | 1 | 1208 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008-2009, Gustavo Narea <me@gustavonarea.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the BSD-like license at
# http://www.repoze.org/LICENSE.txt. A copy of the lic... | gpl-3.0 |
t794104/ansible | lib/ansible/plugins/action/command.py | 117 | 1121 | # Copyright: (c) 2017, 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
from ansible import constants as C
from ansible.plugins.action import ActionBase
from ansible.util... | gpl-3.0 |
maestrano/openerp | openerp/addons/account/project/report/analytic_balance.py | 60 | 7010 | # -*- 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 |
picleslivre/schemaprobe | schemaprobe.py | 1 | 2343 | from __future__ import unicode_literals
import sys
import functools
import json
try:
import jsonschema
except ImportError:
jsonschema = None
try:
import requests
except ImportError:
requests = None
__version__ = '1.0.0.dev1'
__all__ = ['ensure', 'JsonProbe']
# --------------
# Py2 compat
# -------... | bsd-2-clause |
michaelpacer/scikit-image | skimage/restoration/tests/test_restoration.py | 38 | 3413 | from os.path import abspath, dirname, join as pjoin
import numpy as np
from scipy.signal import convolve2d
from scipy import ndimage as ndi
import skimage
from skimage.data import camera
from skimage import restoration
from skimage.restoration import uft
test_img = skimage.img_as_float(camera())
def test_wiener():... | bsd-3-clause |
vicky2135/lucious | oscar/lib/python2.7/site-packages/IPython/core/tests/test_completerlib.py | 8 | 5572 | # -*- coding: utf-8 -*-
"""Tests for completerlib.
"""
from __future__ import absolute_import
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import shutil
import sys
import tempfile
impo... | bsd-3-clause |
numerigraphe/sale-workflow | sale_exception_nostock/model/sale.py | 33 | 9058 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi, Leonardo Pistone
# Copyright 2013, 2014 Camptocamp SA
#
# 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 version ... | agpl-3.0 |
sighingnow/sighingnow.github.io | resource/k_nearest_neighbors/dating.py | 1 | 3622 | #! /usr/bin/env python
# -*- coding: utf-8
'''
Name: dating.py(KNN algorithm)
Training and test dataset: dating.txt
Created on Feb 8, 2015
@author: Tao He
'''
__author__ = 'Tao He'
from numpy import array as nmarray
from matplotlib import pyplot as plt
LABEL_MAP = {
'didntLike': 1,
'sma... | mit |
sparkslabs/kamaelia | Code/Python/Axon/Axon/__init__.py | 6 | 6110 | #
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not u... | apache-2.0 |
ZenDevelopmentSystems/scikit-learn | sklearn/cluster/mean_shift_.py | 96 | 15434 | """Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | bsd-3-clause |
mosbasik/buzhug | javasrc/lib/Jython/Lib/email/mime/image.py | 573 | 1764 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing image/* type MIME documents."""
__all__ = ['MIMEImage']
import imghdr
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
class MIMEImage(MIMENonMultipart... | bsd-3-clause |
joemphilips/cloudbiolinux | cloudbio/cloudman.py | 9 | 16113 | """Build instructions associated with CloudMan.
http://wiki.g2.bx.psu.edu/Admin/Cloud
Adapted from Enis Afgan's code: https://bitbucket.org/afgane/mi-deployment
"""
cm_upstart = """
description "Start CloudMan contextualization script"
start on runlevel [2345]
task
exec python %s 2> %s.log
"""
import os
from ... | mit |
satyamrockstar2013/linux | tools/perf/scripts/python/check-perf-trace.py | 1997 | 2539 | # 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 |
chexov/rexpython | rexpython/test_observable.py | 1 | 4158 | import logging
import multiprocessing
import sys
import time
from unittest import TestCase
import rexpython as rx
logging.basicConfig(format="%(asctime)-15s %(name)-25s %(levelname)s %(process)d %(message)s")
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
class TestOnError(TestCase):
def test_on... | mit |
sheppard/django-rest-framework | tests/test_description.py | 79 | 3688 | # -- coding: utf-8 --
from __future__ import unicode_literals
from django.test import TestCase
from django.utils.encoding import python_2_unicode_compatible, smart_text
from rest_framework.compat import apply_markdown
from rest_framework.views import APIView
from .description import (
UTF8_TEST_DOCSTRING, ViewW... | bsd-2-clause |
BigBrother1984/android_external_chromium_org | third_party/protobuf/python/stubout.py | 671 | 4940 | #!/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... | bsd-3-clause |
AYJAYY/KenoDB | keno.py | 1 | 4245 | # Keno Data Logging - QuickKeno
# KDL v1.5.2 - Python 3 Conversion
# Last Edit Date: 1/9/2021
from urllib.request import urlopen
import json
import time
def write_file(file_name, write_mode, file_text):
text_file = open(file_name, write_mode)
text_file.write(file_text)
text_file.close()
#get the keno j... | gpl-3.0 |
mistio/libcloud | libcloud/test/storage/test_local.py | 2 | 20962 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
ColdSauce/IsSittingOnButt | server/env/lib/python2.7/site-packages/pip/_vendor/__init__.py | 252 | 2508 | """
pip._vendor is for vendoring dependencies of pip to prevent needing pip to
depend on something external.
Files inside of pip._vendor should be considered immutable and should only be
updated to versions from upstream.
"""
from __future__ import absolute_import
import glob
import os.path
import sys
# Downstream r... | apache-2.0 |
willthames/ansible | lib/ansible/modules/messaging/rabbitmq_binding.py | 69 | 7328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@gmail.com>
#
# 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... | gpl-3.0 |
dkodnik/Ant | addons/auth_openid/controllers/__init__.py | 443 | 1033 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# 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 |
nephila/djangocms-blog | djangocms_blog/liveblog/migrations/0001_initial.py | 1 | 2058 | import django.db.models.deletion
import filer.fields.image
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("cms", "0013_urlconfrevision"),
("filer", "0003_thumbnailoption"),
]
operations = [
migrations.CreateModel(
nam... | bsd-3-clause |
nirmeshk/oh-mainline | vendor/packages/typecheck/tests/test_internals.py | 16 | 49297 | import support
from support import TODO, TestCase, test_hash, test_equality
if __name__ == '__main__':
support.adjust_path()
### /Bookkeeping ###
import typecheck
def check_type(typ, obj):
typecheck.check_type(typ, None, obj)
class SingleTests(TestCase):
def test_success_builtin_types(self):
fro... | agpl-3.0 |
Mirantis/swift-encrypt | swift/common/ring/utils.py | 1 | 2880 | from collections import defaultdict
def tiers_for_dev(dev):
"""
Returns a tuple of tiers for a given device in ascending order by
length.
:returns: tuple of tiers
"""
t1 = dev['zone']
t2 = "{ip}:{port}".format(ip=dev.get('ip'), port=dev.get('port'))
t3 = dev['id']
return ((t1,),
... | apache-2.0 |
apagac/robottelo-blrm | robottelo/common/ssh.py | 3 | 5956 | """
Utility module to handle the shared ssh connection
"""
import json
import logging
import re
import sys
from contextlib import contextmanager
from robottelo.common import conf
from robottelo.common.helpers import csv_to_dictionary
try:
import paramiko
except ImportError:
print "Please install paramiko."
... | gpl-3.0 |
chrisjaquet/FreeCAD | src/Mod/Draft/importAirfoilDAT.py | 25 | 6141 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2010 Heiko Jakob <heiko.jakob@gediegos.de> *
#* ... | lgpl-2.1 |
Obus/scikit-learn | benchmarks/bench_plot_approximate_neighbors.py | 85 | 6377 | """
Benchmark for approximate nearest neighbor search using
locality sensitive hashing forest.
There are two types of benchmarks.
First, accuracy of LSHForest queries are measured for various
hyper-parameters and index sizes.
Second, speed up of LSHForest queries compared to brute force
method in exact nearest neigh... | bsd-3-clause |
gdgellatly/OCB1 | openerp/osv/osv.py | 8 | 10312 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
jamescpipe/python-oauth2 | example/client.py | 375 | 6700 | """
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | mit |
mwillmott/techbikers | server/wsgi.py | 1 | 1435 | """
WSGI config for techbikers project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | mit |
geomagpy/magpy | magpy/lib/format_lemi.py | 1 | 19241 | '''
Path: magpy.lib.format_lemi
Part of package: stream (read/write)
Type: Input filter, part of read library
PURPOSE:
Auxiliary input filter for Lemi data.
CONTAINS:
isLEMIBIN: (Func) Checks if file is LEMI format binary file.
readLEMIBIN: (F... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/raw/GL/VERSION/GL_4_0.py | 9 | 11219 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
fitermay/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/uk/forms.py | 313 | 1943 | """
UK-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... | apache-2.0 |
priyam0074/musicApp | node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
agogear/python-1 | renzongxian/0010/0010.py | 40 | 1168 | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-12-21
# Python 3.4
"""
第 0010 题:使用 Python 生成字母验证码图片
"""
from PIL import Image, ImageDraw, ImageFont
import string
import random
def generate_authenticode():
# Generate random letters
letters = ''.join([random.ch... | mit |
sergiohs84/sdk | tests/sync_test_megasync.py | 15 | 8754 | """
Application for testing syncing algorithm
(c) 2013-2014 by Mega Limited, Wellsford, New Zealand
This file is part of the MEGA SDK - Client Access Engine.
Applications using the MEGA API must present a valid application key
and comply with the the rules set forth in the Terms of Service.
The MEGA SDK is di... | bsd-2-clause |
murdej/h2pws | h2pws.py | 1 | 2618 | import time
import BaseHTTPServer
from urlparse import urlparse, parse_qs
import subprocess
import base64
import qrcode
import qrcode.image.svg
import cStringIO
#1630-1800
HOST_NAME = 'localhost' # !!!REMEMBER TO CHANGE THIS!!!
PORT_NUMBER = 8000 # Maybe set this to 9000.
class MyHandler(BaseHTTPServer.BaseHTTPReq... | gpl-2.0 |
allanlei/babel | babel/localedata.py | 136 | 6247 | # -*- coding: utf-8 -*-
"""
babel.localedata
~~~~~~~~~~~~~~~~
Low-level locale data access.
:note: The `Locale` class, which uses this module under the hood, provides a
more convenient interface for accessing the locale data.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, s... | bsd-3-clause |
texib/bitcoin-zoo | member/views.py | 1 | 3349 | from django.shortcuts import render
from django.contrib.auth.models import User, Group
from django.contrib.auth import login
from django.contrib.auth import logout
from django.contrib.auth import authenticate
from django.http import HttpResponseRedirect
from rest_framework import viewsets
from rest_framework.authentic... | mit |
Grassboy/plugin.video.plurkTrend | youtube_dl/extractor/ehow.py | 9 | 1735 | import re
from ..utils import (
compat_urllib_parse,
determine_ext
)
from .common import InfoExtractor
class EHowIE(InfoExtractor):
IE_NAME = u'eHow'
_VALID_URL = r'(?:https?://)?(?:www\.)?ehow\.com/[^/_?]*_(?P<id>[0-9]+)'
_TEST = {
u'url': u'http://www.ehow.com/video_12245069_hardwood-fl... | mit |
dnowatsc/Varial | varial/operations.py | 1 | 23334 | """
Operations on wrappers
"""
import array
import __builtin__
import ctypes
import collections
import functools
from ROOT import THStack, TGraphAsymmErrors
import history
import wrappers
class OperationError(Exception): pass
class TooFewWrpsError(OperationError): pass
class TooManyWrpsError(OperationError): pass
c... | gpl-3.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/dist-packages/numpy/distutils/extension.py | 162 | 3043 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.
Overridden to support f2py.
"""
from __future__ import division, absolute_import, print_function
import sys
import re
from distutils.extension import Extension as old_Extension
if sys.version_info[0] >= ... | bsd-3-clause |
jhoffmann/lcd-notification | Adafruit_CharLCDPlate.py | 22 | 18347 | #!/usr/bin/python
# Python library for Adafruit RGB-backlit LCD plate for Raspberry Pi.
# Written by Adafruit Industries. MIT license.
# This is essentially a complete rewrite, but the calling syntax
# and constants are based on code from lrvick and LiquidCrystal.
# lrvic - https://github.com/lrvick/raspi-hd44780/bl... | mit |
pombredanne/pants | src/python/pants/backend/jvm/tasks/jvm_dependency_analyzer.py | 5 | 10360 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | apache-2.0 |
dancingdan/tensorflow | tensorflow/python/training/server_lib_test.py | 7 | 21270 | # Copyright 2017 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 |
flavour/ifrc_qa | modules/tests/org/create_facility.py | 1 | 2200 | """ Sahana Eden Automated Test - INV023 Create Facilty
@copyright: 2011-2016 (c) Sahana Software Foundation
@license: MIT
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 witho... | mit |
andymckay/addons-server | src/olympia/landfill/management/commands/generate_addons.py | 3 | 1675 | from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from olympia.landfill.generators import generate_addons
class Command(BaseCommand):
"""
Generate example addons for development/testing purpose.
Addons will have 1 preview... | bsd-3-clause |
KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/asset/coverage/geographic_location/absolute/absolute.py | 1 | 4333 |
# 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 |
dushu1203/chromium.src | build/android/pylib/uiautomator/test_runner.py | 9 | 3330 | # 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.
"""Class for running uiautomator tests on a single device."""
from pylib import constants
from pylib import flag_changer
from pylib.device import intent... | bsd-3-clause |
joelsmith/openshift-tools | ansible/roles/lib_openshift_3.2/build/ansible/oadm_manage_node.py | 13 | 2805 | # pylint: skip-file
def main():
'''
ansible oadm module for manage-node
'''
module = AnsibleModule(
argument_spec=dict(
debug=dict(default=False, type='bool'),
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
node=dict(default=None... | apache-2.0 |
facebookexperimental/eden | eden/hg-server/tests/test-remotenames-convert-t.py | 2 | 1076 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.... | gpl-2.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/unittest/mock.py | 79 | 76037 | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | lgpl-3.0 |
ericzundel/pants | contrib/scalajs/src/python/pants/contrib/scalajs/register.py | 17 | 1525 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.build_gra... | apache-2.0 |
ministryofjustice/manchester_traffic_offences_pleas | apps/plea/tests/test_accessibility_switcher.py | 1 | 2202 | from django.test import TestCase
from django.test.client import Client
from django.conf import settings
from importlib import import_module
from waffle.models import Switch
class TestAccessibilitySwitcher(TestCase):
def setUp(self):
self.client = Client()
# http://code.djangoproject.com/ticket/1... | mit |
encbladexp/ansible | test/lib/ansible_test/_internal/git.py | 56 | 4379 | """Wrapper around git command-line tools."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from . import types as t
from .util import (
SubprocessError,
raw_command,
)
class Git:
"""Wrapper around git command-line tools."""
def __init__(self, root... | gpl-3.0 |
Distrotech/clamav | libclamav/c++/llvm/utils/lit/setup.py | 21 | 1665 | import lit
# FIXME: Support distutils?
from setuptools import setup, find_packages
setup(
name = "Lit",
version = lit.__version__,
author = lit.__author__,
author_email = lit.__email__,
url = 'http://llvm.org',
license = 'BSD',
description = "A Software Testing Tool",
keywords = 'test... | gpl-2.0 |
mugurrus/superdesk-core | content_api/search/service.py | 4 | 5349 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from content... | agpl-3.0 |
opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/packages/executors.py | 1 | 4271 | from waldur_core.core import executors as core_executors
from waldur_core.core import tasks as core_tasks
from waldur_core.core import utils as core_utils
from waldur_core.structure import executors as structure_executors
from waldur_mastermind.packages.serializers import _get_template_quotas
from waldur_openstack.open... | mit |
synapse-wireless/bulk-reprogramming | snappyImages/synapse/hexFunctions.py | 1 | 1980 | # Copyright (C) 2013 Synapse Wireless, Inc.
# Subject to your agreement of the disclaimer set forth below, permission is given by
# Synapse Wireless, Inc. ("Synapse") to you to freely modify, redistribute or include
# this SNAPpy code in any program. The purpose of this code is to help you understand
# and learn about ... | apache-2.0 |
NeovaHealth/odoo | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
iEngage/python-sdk | iengage_client/models/tag.py | 1 | 3896 | # coding: utf-8
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger... | apache-2.0 |
macanjang/googletest | scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 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... | bsd-3-clause |
huoxudong125/poedit | deps/boost/tools/build/src/build/engine.py | 14 | 7374 | # Copyright Pedro Ferreira 2005.
# Copyright Vladimir Prus 2007.
# Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
bjam_interface = __import__('bjam')
import operator
import re
import b2.build.property_set as prope... | mit |
openiitbombayx/edx-platform | lms/djangoapps/courseware/tests/test_favicon.py | 125 | 1841 | from django.conf import settings
from django.core.urlresolvers import clear_url_caches, resolve
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from nose.plugins.attrib import attr
import sys
@attr('shard_1')
class FaviconTestCase(TestCase):
def setUp(se... | agpl-3.0 |
CristianBB/SickRage | lib/unidecode/x0fc.py | 253 | 3595 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-3.0 |
scieloorg/opac | opac/tests/test_main_views_abstract.py | 1 | 4558 | # coding: utf-8
# import unittest
# from unittest.mock import patch, Mock
from unittest.mock import patch
import flask
from flask import url_for, g, current_app
# from flask import render_template
# from flask_babelex import gettext as _
from .base import BaseTestCase
from . import utils
class TestArticleDetailV3A... | bsd-2-clause |
rebel1/kernel_2.6.36_nvidia_base | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 183 | 5410 | # SchedGui.py - Python extension for perf trace, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
silverfix/django-concierge | concierge/urls.py | 1 | 1808 | # -*- coding: utf-8 -
from django.conf.urls import url
from django.contrib.auth import views as django_auth_views
from . import forms
from . import views
urlpatterns = [
url(r'^signup/$', views.SignupView.as_view(template_name='concierge/signup.html'), name='signup'),
url(r'^login/$', django_auth_views.logi... | bsd-3-clause |
resmo/ansible | test/units/modules/network/onyx/test_onyx_lldp.py | 23 | 2383 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
markllama/openshift-ansible | roles/lib_openshift/library/oc_serviceaccount_secret.py | 18 | 60388 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
zerobatu/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/factories.py | 34 | 21631 | """
Factories for use in tests of XBlocks.
"""
import functools
import pymongo.message
import threading
import traceback
from collections import defaultdict
from decorator import contextmanager
from uuid import uuid4
from factory import Factory, Sequence, lazy_attribute_sequence, lazy_attribute
from factory.container... | agpl-3.0 |
lowtraxx/kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (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, sys
sys.path.append(os.env... | gpl-2.0 |
EvanK/ansible | test/units/modules/network/f5/test_bigip_wait.py | 21 | 3568 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
fujunwei/chromium-crosswalk | tools/telemetry/telemetry/core/backends/android_command_line_backend.py | 11 | 3993 | # 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.
import logging
import pipes
import sys
from telemetry.core import util
util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
from pylib.dev... | bsd-3-clause |
AOKP/external_chromium_org | chrome/app/nibs/PRESUBMIT.py | 126 | 3062 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script to verify that XIB changes are done with the right version.
See http://dev.chromium.org/developers/design-documents/mac-xib-files fo... | bsd-3-clause |
SELYIO/iztlaiptv | servers/royalvids.py | 42 | 2747 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para royalvids
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from cor... | gpl-2.0 |
dgladkov/django | tests/template_tests/syntax_tests/test_firstof.py | 177 | 3215 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FirstOfTagTests(SimpleTestCase):
@setup({'firstof01': '{% firstof a b c %}'})
def test_firstof01(self):
output = self.engine.render_to_string('firstof01', {'a': 0, 'c': 0, 'b': 0})
... | bsd-3-clause |
markflyhigh/incubator-beam | sdks/python/apache_beam/io/source_test_utils.py | 1 | 26317 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
DavidAndreev/indico | indico/modules/events/contributions/models/references.py | 2 | 2079 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
abushaa/solar_project | solar_main.py | 10 | 5906 | # coding: utf-8
# license: GPLv3
import tkinter
from tkinter.filedialog import *
from solar_vis import *
from solar_model import *
from solar_input import *
perform_execution = False
"""Флаг цикличности выполнения расчёта"""
physical_time = 0
"""Физическое время от начала расчёта.
Тип: float"""
displayed_time = Non... | gpl-3.0 |
tudorvio/tempest | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | 17 | 1687 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
alikins/ansible | lib/ansible/modules/cloud/cloudstack/cs_instance_nic_secondaryip.py | 94 | 8006 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
diox/zamboni | mkt/extensions/validation.py | 5 | 10727 | import imghdr
import json
from cStringIO import StringIO
from zipfile import BadZipfile
from django.forms import ValidationError
from django.utils.encoding import smart_unicode
from PIL import Image
from django.utils.translation import ugettext as _
from mkt.api.exceptions import ParseError
from mkt.files.utils impo... | bsd-3-clause |
nightjean/Deep-Learning | tensorflow/examples/learn/text_classification_character_rnn.py | 61 | 3350 | # 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 appl... | apache-2.0 |
AnselZhangGit/fuel-main | utils/jenkins/report-exporter/builds.py | 7 | 3618 | # Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pygments-2.0.2/pygments/styles/vim.py | 135 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | mit |
40123148/2015cdbg11_0420 | static/Brython3.1.1-20150328-091302/Lib/sre_parse.py | 630 | 29657 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | gpl-2.0 |
devaha/archagent | node_modules/grunt-plugin/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 126 | 54475 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import sys
import posixpath
import re
import shutil
import subprocess
import temp... | gpl-2.0 |
Letractively/aha-gae | aha/modelcontroller/tests/test_crudhander.py | 1 | 1715 | # -*- coding: utf-8 -*-
from unittest import TestCase
import logging
log = logging.getLogger(__name__)
from nose.tools import *
from aha.modelcontroller.formcontrol import FormControl, handle_state, validate
FC = FormControl
class TestCRUDControllerMixIn(TestCase):
def test_subclass(self):
"""
... | bsd-3-clause |
EmreAtes/spack | var/spack/repos/builtin/packages/texlive/package.py | 1 | 3446 | ##############################################################################
# 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 |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_dist_info.py | 452 | 2615 | """Test .dist-info style distributions.
"""
import os
import shutil
import tempfile
import unittest
import textwrap
try:
import ast
except:
pass
import pkg_resources
from setuptools.tests.py26compat import skipIf
def DALS(s):
"dedent and left-strip"
return textwrap.dedent(s).lstrip()
class TestDist... | lgpl-3.0 |
damdam-s/OpenUpgrade | addons/event/report/report_event_registration.py | 310 | 4079 | # -*- 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 |
DrKLO/Telegram | TMessagesProj/jni/boringssl/third_party/googletest/scripts/gen_gtest_pred_impl.py | 106 | 21850 | #!/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-2.0 |
junzis/py-adsb-decoder | pyModeS/extra/aero.py | 1 | 5201 | """
Functions for aeronautics in this module
- physical quantities always in SI units
- lat,lon,course and heading in degrees
International Standard Atmosphere
::
p,rho,T = atmos(H) # atmos as function of geopotential altitude H [m]
a = vsound(H) # speed of sound [m/s] as function of H[m]
p = ... | mit |
sencha/chromium-spacewalk | chrome/common/extensions/docs/server2/permissions_data_source.py | 9 | 3650 | # 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.
from itertools import ifilter
from operator import itemgetter
from data_source import DataSource
from extensions_paths import PRIVATE_TEMPLATES
from future ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.