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 |
|---|---|---|---|---|---|
ramsateesh/designate | designate/api/admin/views/extensions/quotas.py | 6 | 1826 | # COPYRIGHT 2014 Rackspace
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# 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 r... | apache-2.0 |
squirrelo/qiita | qiita_plugins/target_gene_type/setup.py | 1 | 1803 | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (c) 2013, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------------------... | bsd-3-clause |
ubiar/odoo | addons/account_check_writing/__init__.py | 446 | 1111 | # -*- 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 |
varunnaganathan/django | tests/template_tests/filter_tests/test_join.py | 362 | 2707 | from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class JoinTests(SimpleTestCase):
@setup({'join01': '{{ a|join:", " }}'})
def test_join01(self):
output = self.engine.render_to_string('join01... | bsd-3-clause |
willemneal/Docky | lib/pylint/test/input/func_break_or_return_in_try_finally.py | 4 | 1041 | 'Exeptions may be silently swallowed'
from __future__ import print_function
__revision__ = None
def insidious_break_and_return():
"""I found you !"""
for i in range(0, -5, -1):
my_var = 0
print(i)
try:
my_var += 1.0/i
if i < -3:
break # :D
... | mit |
edx/edx-lint | edx_lint/pylint/super_check.py | 1 | 4006 | """Pylint plugin: check that tests have used super() properly."""
import astroid
from pylint.checkers import BaseChecker, utils
from pylint.checkers.classes import _ancestors_to_call
from pylint.interfaces import IAstroidChecker
from .common import BASE_ID, check_visitors, usable_class_name
def register_checkers(li... | apache-2.0 |
bluesea/zulip | zerver/lib/queue.py | 115 | 9789 | from __future__ import absolute_import
from django.conf import settings
import pika
import logging
import ujson
import random
import time
import threading
import atexit
from collections import defaultdict
from zerver.lib.utils import statsd
# This simple queuing library doesn't expose much of the power of
# rabbitmq... | apache-2.0 |
vincepandolfo/django | tests/template_tests/syntax_tests/test_cycle.py | 104 | 5516 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class CycleTagTests(SimpleTestCase):
@setup({'cycle01': '{% cycle a %}'})
def test_cycle01(self):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle0... | bsd-3-clause |
sbellem/django | tests/lookup/tests.py | 21 | 37308 | from __future__ import unicode_literals
import collections
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .mode... | bsd-3-clause |
beav/pulp | nodes/test/unit/test_handler_strategies.py | 10 | 8349 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | gpl-2.0 |
ns950/calibre | src/calibre/gui2/update.py | 9 | 10105 | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import re, binascii, cPickle, ssl, json
from future_builtins import map
from threading import Thread, Event
from PyQt5.Qt import (QObject, pyqtSignal, Qt, QUrl, QDialog, QGridLayout,
QLabel, QCheckBox, QDialogButtonBox, QIc... | gpl-3.0 |
rkho/code-problems | solutions/python/array-pair-sum.py | 31 | 1944 | import unittest
"""solution to the array pair sum problem"""
def array_pair_sum_iterative(arr, k):
"""
returns the array of pairs using an iterative method.
complexity: O(n^2)
"""
result = []
for i in range(len(arr)):
for j in range(i + 1, len(arr)):
if arr[i] + arr[j] ==... | mit |
shinate/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/text_format_test.py | 252 | 22615 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
hgrif/incubator-airflow | tests/contrib/operators/test_file_to_wasb.py | 38 | 2728 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
Allow2CEO/browser-ios | brave/node_modules/ad-block/vendor/depot_tools/third_party/boto/__init__.py | 51 | 28525 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... | mpl-2.0 |
DTU-ELMA/European_Dataset | Scripts/Build_Capacity_Layouts/1-save_projection_area_ECMWF.py | 1 | 1555 | import numpy as np
import scipy.sparse as sparse
from itertools import izip as zip
# Uses the output of nodal_projection_matrix.py to aggregate signals
# into the nodal domain.
def calc_rel_area_of_grid(lats, lons):
Dlons = np.diff(np.deg2rad(lons), axis=1)
Dlats = -np.diff(np.sin(np.deg2rad(lats)), axis=0)
... | apache-2.0 |
MatthieuBizien/scikit-learn | sklearn/ensemble/iforest.py | 9 | 11652 | # Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy as sp
from warnings import warn
from scipy.sparse import issparse
import numbers
from ..external... | bsd-3-clause |
CIRCL/bgpranking-redis-api | bgpranking_redis/api.py | 1 | 33393 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Entry point of the API
"""
import redis
import IPy
from dateutil import parser
from dateutil import tz
import datetime
from . import constraints as c
HAS_PTR = False
try:
from ipasn_redis import IPASN
HAS_IPASN = True
except ImportError:
HAS_IPASN = Fal... | bsd-2-clause |
wolfier/incubator-airflow | airflow/contrib/operators/emr_add_steps_operator.py | 7 | 2372 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
laurentb/weboob | modules/ekwateur/test.py | 2 | 1292 | # -*- coding: utf-8 -*-
# Copyright(C) 2018 Phyks (Lucas Verney)
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 o... | lgpl-3.0 |
baconricky/sublimetext-codeformatter | codeformatter/pyformatter.py | 2 | 7741 | # @author Avtandil Kikabidze
# @copyright Copyright (c) 2008-2014, Avtandil Kikabidze aka LONGMAN (akalongman@gmail.com)
# @link http://long.ge
# @license GNU General Public License version 2 or later;
import os
import sys
import re
import sublime
st_version = 2
if sublime.version() == '' or int(sublime.ver... | bsd-3-clause |
openqt/algorithms | projecteuler/ac/old/pe053_combinatoric_selections.py | 1 | 1188 | #!/usr/bin/env python
# coding=utf-8
"""
Combinatoric selections
Problem 53
There are exactly ten ways of selecting three from five, 12345:
123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
In combinatorics, we use the notation, 5C3 = 10.
In general,
nCr = n!/r!(n−r)!, where r ≤ n, n! = n×(n−1)×...×3×2×... | gpl-3.0 |
ioam/param | tests/API0/testdateparam.py | 2 | 1854 | """
Unit test for Date parameters.
"""
import unittest
import datetime as dt
import param
class TestDateParameters(unittest.TestCase):
def test_initialization_out_of_bounds(self):
try:
class Q(param.Parameterized):
q = param.Date(dt.datetime(2017,2,27),
... | bsd-3-clause |
brmqk3/uncrustify | scripts/punc.py | 1 | 4082 | #! /usr/bin/env python
#
# Creates a possibly faster lookup table for tokens, etc.
#
# @author Ben Gardner
# @license GPL v2+
#
from __future__ import print_function # python >= 2.6
from os.path import dirname, join, abspath, relpath
from sys import stderr, exit as sys_exit
def scan_file(file_path):
cur_token ... | gpl-2.0 |
Kagami/kisa | lib/twisted/python/lockfile.py | 19 | 6404 | # -*- test-case-name: twisted.test.test_lockfile -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Filesystem-based interprocess mutex.
"""
__metaclass__ = type
import errno, os
from time import time as _uniquefloat
def unique():
return str(long(_... | cc0-1.0 |
vdods/heisenberg | heisenberg/self_similar/plot.py | 2 | 1058 | import matplotlib.pyplot as plt
import pathlib
import typing
class Plot:
def __init__ (self, *, row_count:int, col_count:int, size:float) -> None:
self.fig, self.axis_vv = plt.subplots(
row_count,
col_count,
squeeze=False,
figsize=(size*col_count,size*row_cou... | mit |
xfstudio/electron | tools/posix/generate_breakpad_symbols.py | 185 | 8276 | #!/usr/bin/env python
# Copyright (c) 2013 GitHub, Inc.
# 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.
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only suppo... | mit |
XXMrHyde/android_external_chromium_org | base/android/jni_generator/jni_generator.py | 15 | 40336 | #!/usr/bin/env python
# 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.
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests."""... | bsd-3-clause |
rorasa/NotifyMe | NotifyMe.py | 1 | 1034 | from notifyme_social import TwitterService
import sys
number_argv = len(sys.argv)
if number_argv <2:
print "Please select a service"
sys.exit()
if sys.argv[1] == 'twitter':
print "Selecting twitter service"
if number_argv < 3:
print "Please give NotifyMe a command (Expected command arguments... | mit |
isogeo/isogeo-plugin-qgis | tests/dev/qgis_console/dev_wmts.py | 1 | 7053 | # ################################
# ######## Imports #################
# ################################
from urllib import unquote, urlencode
from sys import exit
try:
from owslib.wmts import WebMapTileService
from owslib.util import ServiceException
import owslib
print("Depencencies - owslib vers... | gpl-3.0 |
fabioticconi/scikit-learn | sklearn/dummy.py | 28 | 17498 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin... | bsd-3-clause |
sy0302/lammps_qtb | tools/moltemplate/src/nbody_fix_ttree_assignments.py | 29 | 5683 | #!/usr/bin/env python
"""
nbody_fix_ttree_assignments.py
This is an ugly little script which was not intended to be run by end users.
Typical usage:
nbody_fix_ttree_assignments.py "angles" new_Angles.template \
< ttree_assignments.txt > ttree_assigmnents_new.txt
What it does:
In this example, this progra... | gpl-2.0 |
tom-slick/pygooglevoice | setup.py | 39 | 1037 | from distutils.core import setup
README = """Python Google Voice
====================
Joe McCall & Justin Quick
Exposing the Google Voice "API" to the Python language
-------------------------------------------------------
Google Voice for Python Allows you to place calls, send sms, download voicemail, and check t... | bsd-3-clause |
DemocracyClub/yournextrepresentative | ynr/apps/candidates/migrations/0011_migrate_loggedaction_person.py | 1 | 1051 | from django.db import migrations
def popit_to_db(apps, schema_editor):
Person = apps.get_model("popolo", "person")
LoggedAction = apps.get_model("candidates", "loggedaction")
for la in LoggedAction.objects.all():
if la.popit_person_id:
try:
la.person = Person.objects.ge... | agpl-3.0 |
geminateCoder/Character-Archive-Website | Lib/site-packages/passlib/exc.py | 8 | 7908 | """passlib.exc -- exceptions & warnings raised by passlib"""
#=============================================================================
# exceptions
#=============================================================================
class MissingBackendError(RuntimeError):
"""Error raised if multi-backend handler ha... | cc0-1.0 |
gmalmquist/pants | tests/python/pants_test/build_graph/test_build_configuration.py | 10 | 7337 | # 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, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | apache-2.0 |
locaweb/python-servicenow | src/servicenow/ServiceNow.py | 1 | 3400 | from servicenow import Utils
ttl_cache=0
class Base(object):
__table__ = None
def __init__(self, Connection):
self.Connection = Connection
@Utils.cached(ttl=ttl_cache)
def list_by_query(self, query, **kwargs):
return self.format(self.Connection._list_by_query(self.__table__, query, ... | apache-2.0 |
kagayakidan/scikit-learn | sklearn/tests/test_isotonic.py | 230 | 11087 | import numpy as np
import pickle
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert_equal,
... | bsd-3-clause |
vkd/python-sophia | tests/bench.py | 2 | 2849 | import sophia, shutil, sys, tempfile
import timeit, random, threading
if sys.version_info.major < 3:
def get_rand_k():
return str(random.randint(0, 10000000))
else:
def get_rand_k():
return str(random.randint(0, 10000000)).encode()
def get_rand_p():
return get_rand_k(), get_rand_k()
class... | bsd-3-clause |
armando-migliaccio/neutron | neutron/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py | 1 | 1873 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 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... | apache-2.0 |
bcarroll/authmgr | python-3.6.2-Win64/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | bsd-3-clause |
msabramo/ansible | lib/ansible/modules/network/a10/a10_virtual_server.py | 16 | 11685 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb virtual server objects
(c) 2014, Mischa Peters <mpeters@a10networks.com>,
Eric Chou <ericc@a10networks.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GN... | gpl-3.0 |
kumarkrishna/sympy | sympy/core/relational.py | 47 | 24474 | from __future__ import print_function, division
from .basic import S
from .compatibility import ordered
from .expr import Expr
from .evalf import EvalfMixin
from .function import _coeff_isneg
from .symbol import Symbol
from .sympify import _sympify
from .evaluate import global_evaluate
from sympy.logic.boolalg import... | bsd-3-clause |
fernandog/Sick-Beard | sickbeard/db.py | 2 | 9406 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 |
mims2707/bite-project | deps/gdata-python-client/samples/webmastertools/SitesFeedSummary.py | 128 | 1975 | #!/usr/bin/python
#
# Copyright (C) 2008 Yu-Jie Lin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
jgoclawski/django | django/core/mail/backends/smtp.py | 477 | 5239 | """SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.core.mail.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
"""
A... | bsd-3-clause |
amisrs/one-eighty | angular_flask/lib/python2.7/site-packages/sqlalchemy/schema.py | 6 | 131491 | # sqlalchemy/schema.py
# Copyright (C) 2005-2013 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
"""The schema module provides the building blocks for database metadata.
Each el... | mit |
nibanks/openthread | tests/scripts/thread-cert/Cert_5_6_06_NetworkDataExpiration.py | 5 | 6344 | #!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread 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:
# 1. Redistributions of source code must retain the above copyright
# not... | bsd-3-clause |
mmnelemane/neutron | neutron/plugins/ml2/drivers/l2pop/db.py | 44 | 5492 | # 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... | apache-2.0 |
mewtaylor/django | django/contrib/gis/geoip/libgeoip.py | 479 | 1075 | import os
from ctypes import CDLL
from ctypes.util import find_library
from django.conf import settings
# Creating the settings dictionary with any settings, if needed.
GEOIP_SETTINGS = {key: getattr(settings, key)
for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY')
... | bsd-3-clause |
yubowenok/vastcha15 | proc/mc2_proc_index.py | 1 | 1998 | import time, sys
from dateutil.parser import parse
# get meta data
ids, events, locations = {}, {}, {} # mapping
file_meta = open("GC.meta", 'r')
num_people = int(file_meta.readline())
for i in range(num_people):
tokens = file_meta.readline().rstrip('\n').split(' ')
index, id = int(tokens[0]), int(tokens[1])
ids... | mit |
mariuszkowalski/BioCounter | gui/main_gui.py | 1 | 15071 | #!/usr/bin/env python3
from tkinter import Canvas, HORIZONTAL, VERTICAL
from tkinter import ttk
from PIL import ImageTk
from markers.marker import Marker
from markers.marker_utilities import MarkerUtilities
from markers.shapes import Shapes
class Main_gui:
'''
Class for creating main part of the window inte... | gpl-3.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/sqlalchemy/testing/assertsql.py | 32 | 12590 | # testing/assertsql.py
# Copyright (C) 2005-2017 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
from ..engine.default import DefaultDialect
from .. import util
import re
impor... | mit |
stonegithubs/odoo | openerp/addons/base/ir/ir_rule.py | 312 | 8048 | # -*- 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 |
LeMeteore/boomer2 | boomer2/settings.py | 1 | 2284 | """
Django settings for boomer2 project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | bsd-2-clause |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/cn/cn_provinces.py | 88 | 1373 | # -*- coding: utf-8 -*-
"""
An alphabetical list of provinces for use as `choices` in a formfield.
Reference:
http://en.wikipedia.org/wiki/ISO_3166-2:CN
http://en.wikipedia.org/wiki/Province_%28China%29
http://en.wikipedia.org/wiki/Direct-controlled_municipality
http://en.wikipedia.org/wiki/Autonomous_regions_of_Chin... | mit |
tombstone/models | research/deeplab/core/feature_extractor.py | 2 | 27688 | # Lint as: python2, python3
# 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
#
#... | apache-2.0 |
blrm/openshift-tools | ansible/roles/lib_oa_openshift/src/test/unit/test_oc_project.py | 64 | 10173 | '''
Unit tests for oc project
'''
import copy
import os
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error,... | apache-2.0 |
spaceone/pyjs | examples/jsonrpc/public/services/jsonrpc/http.py | 24 | 1236 | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later ... | apache-2.0 |
afloren/nipype | nipype/interfaces/semtools/brains/utilities.py | 8 | 2188 | # -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
i... | bsd-3-clause |
QuLogic/meson | mesonbuild/mdist.py | 1 | 13021 | # Copyright 2017 The Meson development team
# 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 ... | apache-2.0 |
Nitaco/ansible | lib/ansible/modules/database/proxysql/proxysql_scheduler.py | 42 | 13835 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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
DOCUMENTATION = '''
---
module: proxysql_scheduler
version... | gpl-3.0 |
BhallaLab/moose-core | tests/support/_neuroml/CA1.py | 5 | 1042 | # -*- coding: utf-8 -*-
## Aditya Gilra, NCBS, Bangalore, 2012
## Dilawar Singh, NCBS, 2015
import os
os.environ['NUMPTHREADS'] = '1'
import sys
import moose
from moose.utils import *
import moose.utils as mu
from . import count
import numpy as np
from moose.neuroml.NeuroML import NeuroML
import unittest
simdt = 1... | gpl-3.0 |
onponomarev/ganeti | lib/server/masterd.py | 7 | 3699 | #
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this... | bsd-2-clause |
forever342/naarad | test/test_netstat_metric.py | 4 | 6805 | # coding=utf-8
"""
Copyright 2013 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | apache-2.0 |
technologiescollege/Blockly-rduino-communication | scripts/Lib/site-packages/jinja2/__init__.py | 71 | 2614 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | gpl-3.0 |
ChristianKniep/QNIB | serverfiles/usr/local/lib/networkx-1.6/networkx/algorithms/bipartite/tests/test_centrality.py | 3 | 5890 | from nose.tools import *
import networkx as nx
from networkx.algorithms import bipartite
class TestBipartiteCentrality(object):
def setUp(self):
self.P4 = nx.path_graph(4)
self.K3 = nx.complete_bipartite_graph(3,3)
self.C4 = nx.cycle_graph(4)
self.davis = nx.davis_southern_women_gr... | gpl-2.0 |
enigmampc/catalyst | catalyst/data/treasuries_can.py | 15 | 5257 | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
xaxa89/mitmproxy | mitmproxy/tools/console/statusbar.py | 1 | 9580 | import os.path
import urwid
from mitmproxy.tools.console import common
from mitmproxy.tools.console import pathedit
from mitmproxy.tools.console import signals
import mitmproxy.tools.console.master # noqa
class PromptPath:
def __init__(self, callback, args):
self.callback, self.args = callback, args
... | mit |
ForgottenKahz/CloudOPC | venv/Lib/site-packages/werkzeug/contrib/sessions.py | 295 | 12450 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... | mit |
allanburleson/python-adventure-game | pag/interfaces.py | 2 | 1493 |
from pag import parser
### These should both be Interface subclasses or something
class SilentUI(object):
def __init__(self):
"""
Silent UI for testing.
"""
self._prompts = {}
pass
def set_reply(self, re_prompt, reply):
"""
Hard-code prompts and repli... | mit |
lastweek/gem5 | tests/quick/se/70.tgen/test.py | 74 | 2122 | # Copyright (c) 2012 ARM Limited
# 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 implementation of the functionality ... | bsd-3-clause |
pspacek/freeipa | ipatests/test_ipalib/test_x509.py | 5 | 5211 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 |
zcbenz/cefode-chromium | media/tools/layout_tests/trend_graph_unittest.py | 175 | 1288 | #!/usr/bin/env python
# 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.
import os
import shutil
import unittest
from trend_graph import TrendGraph
class TestTrendGraph(unittest.TestCase):
def testU... | bsd-3-clause |
PeterWangIntel/chromium-crosswalk | build/android/gyp/jar_toc.py | 11 | 3500 | #!/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.
"""Creates a TOC file from a Java jar.
The TOC file contains the non-package API of the jar. This includes all
public/protected/pack... | bsd-3-clause |
fabian4/ceilometer | ceilometer/event/endpoint.py | 6 | 3362 | # Copyright 2012-2014 eNovance <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
kmonsoor/python-for-android | python-modules/twisted/twisted/scripts/manhole.py | 60 | 1635 | # Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Start a L{twisted.manhole} client.
"""
import sys
from twisted.python import usage
def run():
config = MyOptions()
try:
config.parseOptions()
except usage.UsageError, e:
print str(e)
print str(c... | apache-2.0 |
geodynamics/gale | boost/tools/build/v2/test/default_build.py | 15 | 2437 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that default build clause actually has any effect.
import BoostBuild
t = BoostBu... | gpl-2.0 |
sandeep-n/incubator-systemml | src/main/python/tests/test_mllearn_df.py | 4 | 5381 | #!/usr/bin/python
#-------------------------------------------------------------
#
# 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 f... | apache-2.0 |
qedsoftware/commcare-hq | corehq/apps/export/urls.py | 1 | 3547 | from django.conf.urls import url
from corehq.apps.export.views import (
CreateCustomFormExportView,
CreateCustomCaseExportView,
CreateNewCustomFormExportView,
CreateNewCustomCaseExportView,
EditCustomFormExportView,
EditCustomCaseExportView,
EditNewCustomFormExportView,
EditNewCustomCase... | bsd-3-clause |
bitmovin/bitcodin-python | examples/create_job_keep_aspect_ratio.py | 1 | 1940 | #!/usr/bin/env python
from time import sleep
import bitcodin
bitcodin.api_key = 'INSERT YOUR API KEY HERE'
input_obj = bitcodin.Input(url='http://bitbucketireland.s3.amazonaws.com/Sintel-original-short.mkv')
print("INPUT REQUEST: %s\n\n" % input_obj.to_json())
input_result = bitcodin.create_input(input_obj)
print("I... | unlicense |
SpaceKatt/CSPLN | apps/scaffolding/linux/web2py/gluon/tests/test_web.py | 13 | 5108 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit tests for running web2py
"""
import sys
import os
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import subprocess
import time
import signal
from fix_path import fix_sys_path
fix_sys_path(__file__)
from contrib.webcl... | gpl-3.0 |
ccnmtl/lettuce | lettuce/terrain.py | 7 | 2250 | # -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.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 Foundatio... | gpl-3.0 |
mikaelboman/home-assistant | homeassistant/components/switch/mystrom.py | 9 | 3128 | """
Support for myStrom switches.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.mystrom/
"""
import logging
import requests
from homeassistant.components.switch import SwitchDevice
DEFAULT_NAME = 'myStrom Switch'
_LOGGER = logging.getLogger(... | mit |
jeanlinux/calibre | src/calibre/gui2/store/stores/legimi_plugin.py | 12 | 3505 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 6 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2015, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
import urllib
from b... | gpl-3.0 |
iut-ibk/P8-WSC-GUI | 3dparty/Editra/src/extern/pygments/plugin.py | 74 | 1862 | # -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
yourlexer = yourmodule:YourLexer
formatter pl... | gpl-2.0 |
takeflight/django | django/conf/locale/en_AU/formats.py | 117 | 2117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oc... | bsd-3-clause |
vijayanandnandam/youtube-dl | youtube_dl/extractor/tvplay.py | 9 | 20722 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
parse_iso8601,
qualities,
smuggle_url,
t... | unlicense |
davidharrigan/django | django/core/management/commands/test.py | 69 | 3498 | import logging
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
help = 'Discover and run tests in the specified modules or the current directory.'
requires_system_checks = False
... | bsd-3-clause |
taktik/account-financial-reporting | account_journal_report_xls/wizard/print_journal_wizard.py | 27 | 8349 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | agpl-3.0 |
MrLoick/python-for-android | python3-alpha/extra_modules/pyxmpp2/sasl/__init__.py | 46 | 2837 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
alexmogavero/home-assistant | homeassistant/components/binary_sensor/workday.py | 8 | 5350 | """
Sensor to indicate whether the current day is a workday.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.workday/
"""
import asyncio
import logging
import datetime
import voluptuous as vol
from homeassistant.components.sensor import PL... | apache-2.0 |
KenN7/argos-python | examples/diffusion_distance_scanner.py | 1 | 2049 | import math
# PARAMETERS:
# Maximum tolerance for the angle between
# the robot heading direction and
# the closest obstacle detected.
alpha = 7.5 * math.pi / 180
# Maximum tolerance for the proximity reading between
# the robot and the closest obstacle.
# The proximity reading is 0 when nothing is detected
# and gr... | mit |
kpcyrd/cjdns | node_build/dependencies/libuv/build/gyp/test/variables/commands/gyptest-commands-repeated.py | 330 | 1313 | #!/usr/bin/env python
# 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.
"""
Test variable expansion of '<!()' syntax commands where they are evaluated
more then once..
"""
import TestGyp
test = TestGyp.TestGyp(... | gpl-3.0 |
ray-zhong/github_trend_spider | ENV/Lib/encodings/iso2022_jp_2004.py | 816 | 1073 | #
# iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class I... | mit |
petrus-v/odoo | addons/purchase_double_validation/purchase_double_validation_installer.py | 432 | 2315 | # -*- 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 |
idrogeno/IdroMips | lib/python/Plugins/SystemPlugins/DeviceManager/Disks.py | 4 | 10277 | import os
import re
class Disks():
ptypes = {
"0": "Empty" , "24": "NEC DOS" , "81": "Minix / old Lin" , "bf": "Solaris",
"1": "FAT12" , "39": "Plan 9" , "82": "Linux swap / Solaris", "c1": "DRDOS/sec (FAT)",
"2": "XENIX root" , "3c": "PartitionMagic" , "... | gpl-2.0 |
aviweit/libcloud | libcloud/loadbalancer/drivers/cloudstack.py | 58 | 7735 | # 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 |
MaxQu/ardupilot | Tools/LogAnalyzer/tests/TestVCC.py | 218 | 1278 | from LogAnalyzer import Test,TestResult
import DataflashLog
import collections
class TestVCC(Test):
'''test for VCC within recommendations, or abrupt end to log in flight'''
def __init__(self):
Test.__init__(self)
self.name = "VCC"
def run(self, logdata, verbose):
self.result = ... | gpl-3.0 |
gnu-sandhi/gnuradio | gr-wxgui/src/python/scopesink2.py | 92 | 1447 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.