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 |
|---|---|---|---|---|---|
yukoba/sympy | sympy/functions/special/tests/test_mathieu.py | 85 | 1080 | from sympy import (sqrt, sin, cos, diff, conjugate,
mathieus, mathieuc, mathieusprime, mathieucprime)
from sympy.abc import a, q, z
def test_mathieus():
assert isinstance(mathieus(a, q, z), mathieus)
assert mathieus(a, 0, z) == sin(sqrt(a)*z)
assert conjugate(mathieus(a, q, z)) == math... | bsd-3-clause |
vikatory/kbengine | kbe/res/scripts/common/Lib/lib2to3/fixer_util.py | 71 | 15256 | """Utility functions, node construction macros, etc."""
# Author: Collin Winter
from itertools import islice
# Local imports
from .pgen2 import token
from .pytree import Leaf, Node
from .pygram import python_symbols as syms
from . import patcomp
###########################################################
### Common... | lgpl-3.0 |
GdZ/scriptfile | software/googleAppEngine/lib/PyAMF/pyamf/tests/test_codec.py | 26 | 6577 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tests for AMF utilities.
@since: 0.1.0
"""
import unittest
import pyamf
from pyamf import codec
try:
unicode
except NameError:
# py3k
unicode = str
str = bytes
class TestObject(object):
def __init__(self):
self.name... | mit |
andresguisado/andresguisado.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/bw.py | 364 | 1355 | # -*- coding: utf-8 -*-
"""
pygments.styles.bw
~~~~~~~~~~~~~~~~~~
Simple black/white only style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, Strin... | mit |
CyanogenMod/android_prebuilts_gcc_darwin-x86_aarch64_aarch64-linux-android-4.9 | share/gdb/python/gdb/FrameIterator.py | 126 | 1577 | # Copyright (C) 2013-2014 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 later version.
#
# This progr... | gpl-2.0 |
tylerpedley/Tetris | gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | gpl-3.0 |
nkoech/trialscompendium | trialscompendium/utils/keywordsearch.py | 2 | 2922 | from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.db.models import Q
import re
def get_project_models(proj):
"""
:param proj: Project name
:return: model class
:rtype: Class object
"""
third_party_apps = ([app.rsplit('.')[-1] for app in se... | mit |
dex4er/django | tests/extra_regress/tests.py | 59 | 14222 | from __future__ import absolute_import, unicode_literals
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils.datastructures import SortedDict
from .models import TestObject, Order, RevisionableModel
class ExtraRegressTests(TestCase):
def setUp(self):
... | bsd-3-clause |
stabiitb/wiki | extensions/ConfirmEdit/captcha.py | 63 | 9158 | #!/usr/bin/python
#
# Script to generate distorted text images for a captcha system.
#
# Copyright (C) 2005 Neil Harris
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the ... | gpl-2.0 |
zstackio/zstack-woodpecker | integrationtest/vm/perf/host/test_maintain_host_with_max_threads.py | 2 | 2170 | '''
New Perf Test for creating KHost Host with basic L3 network.
The created number will depend on the environment variable: ZSTACK_TEST_NUM
The difference with test_basic_l3_host_with_given_num.py is this case's max thread is 1000
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import... | apache-2.0 |
meizhoubao/three.js | utils/exporters/blender/addons/io_three/logger.py | 176 | 1423 | import os
import logging
import tempfile
from . import constants
LOG_FILE = None
LOGGER = None
LEVELS = {
constants.DEBUG: logging.DEBUG,
constants.INFO: logging.INFO,
constants.WARNING: logging.WARNING,
constants.ERROR: logging.ERROR,
constants.CRITICAL: logging.CRITICAL
}
def init(filename, l... | mit |
jonathanverner/brython | www/src/Lib/test/test_getopt.py | 173 | 6968 | # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
self.env = EnvironmentVarGuard()
if "POSIXL... | bsd-3-clause |
martynovp/edx-platform | common/lib/xmodule/xmodule/foldit_module.py | 30 | 6503 | import logging
from lxml import etree
from pkg_resources import resource_string
from xmodule.editing_module import EditingDescriptor
from xmodule.x_module import XModule
from xmodule.xml_module import XmlDescriptor
from xblock.fields import Scope, Integer, String
from .fields import Date
log = logging.getLogger(__n... | agpl-3.0 |
ThotAlion/FIRE | NAO/walking leap motion/keiser_soze.py | 1 | 1999 | # -*- encoding: UTF-8 -*-
''' Walk: Small example to make Nao walk '''
''' with gait customization '''
''' NAO is Keyser Soze '''
''' This example is only compatible with NAO '''
import argparse
import time
import almath
from naoqi import ALProxy
import Leap
from numpy import *
def mai... | mit |
georgijd/influxdb-python | influxdb/tests/dataframe_client_test.py | 2 | 13437 | # -*- coding: utf-8 -*-
"""
unit tests for misc module
"""
from .client_test import _mocked_session
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import json
import requests_mock
from nose.tools import raises
from datetime import timedelta
from influxdb.tests impor... | mit |
MatthieuBizien/scikit-learn | examples/plot_kernel_ridge_regression.py | 39 | 6259 | """
=============================================
Comparison of kernel ridge regression and SVR
=============================================
Both kernel ridge regression (KRR) and SVR learn a non-linear function by
employing the kernel trick, i.e., they learn a linear function in the space
induced by the respective k... | bsd-3-clause |
lucasdavila/web2py-appreport | modules/plugin_appreport/libs/appreport/libs/pisa/libs/reportlab/src/rl_addons/rl_accel/tests/t5.py | 10 | 1679 | from reportlab.pdfbase.pdfmetrics import getFont, registerFont
from reportlab.pdfbase.ttfonts import TTFont
import time
from sys import getrefcount
registerFont(TTFont("Vera", "Vera.ttf"))
font = getFont('Vera')
_py_getCharWidth = font.face._py_getCharWidth
getCharWidth = font.face.getCharWidth
#assert stringWidth!=_py... | lgpl-3.0 |
alqfahad/odoo | addons/l10n_ae/__openerp__.py | 337 | 1579 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
xiangel/hue | desktop/core/ext-py/boto-2.38.0/boto/directconnect/layer1.py | 148 | 23592 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | apache-2.0 |
yoer/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Hash/SHA256.py | 124 | 2852 | # -*- coding: utf-8 -*-
#
# ===================================================================
# 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 e... | apache-2.0 |
mlperf/training_results_v0.7 | Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-512/lingvo/core/ops/__init__.py | 1 | 2608 | # 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 |
biddyweb/fboss | fboss/agent/tools/fboss_route.py | 2 | 3100 | # Copyright (C) 2004-present Facebook. All Rights Reserved
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
"""Add, change, or delete a route on FBOSS controller
"""
import contextlib
import ipaddr
from argparse impo... | bsd-3-clause |
apahim/avocado-misc-tests | io/disk/arcconf/arcconf_cntl_oper.py | 1 | 5858 | #!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... | gpl-2.0 |
yytang2012/linux-kvm-arm | Documentation/target/tcm_mod_builder.py | 868 | 40692 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
clarkperkins/stackdio | stackdio/api/users/api.py | 2 | 9693 | # -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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 |
edx-solutions/edx-platform | openedx/core/djangoapps/user_authn/views/register.py | 2 | 32027 | """
Registration related views.
"""
import datetime
import json
import logging
from django.conf import settings
from django.contrib.auth import login as django_login
from django.contrib.auth.models import User
from django.core.exceptions import NON_FIELD_ERRORS, PermissionDenied
from django.core.validators import Va... | agpl-3.0 |
VaibhavAgarwalVA/sympy | sympy/core/tests/test_var.py | 125 | 1572 | # Tests for var are in their own file, because var pollutes global namespace.
from sympy import Symbol, var, Function, FunctionClass
from sympy.utilities.pytest import raises
# make z1 with call-depth = 1
def _make_z1():
var("z1")
# make z2 with call-depth = 2
def __make_z2():
var("z2")
def _make_z2():... | bsd-3-clause |
sestrella/ansible | lib/ansible/module_utils/service.py | 86 | 9242 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/matplotlib/scale.py | 8 | 18857 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import numpy as np
from numpy import ma
from matplotlib.cbook import dedent
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
L... | mit |
awetzel/distios | distios.py | 1 | 21647 | #!/usr/bin/env python3.3
# plist nano lib
import xml.etree.ElementTree as ET
from itertools import zip_longest,groupby
import re
plistheader = b'<?xml version="1.0" encoding="UTF-8" ?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n'
def dict2plist(plistdict,by... | mit |
w1ll1am23/home-assistant | homeassistant/components/nissan_leaf/switch.py | 5 | 1765 | """Charge and Climate Control Support for the Nissan Leaf."""
import logging
from homeassistant.helpers.entity import ToggleEntity
from . import DATA_CLIMATE, DATA_LEAF, LeafEntity
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Nissan Leaf switch pl... | apache-2.0 |
cherrygirl/micronaet7 | report_aeroo_pricelist/__openerp__.py | 1 | 2219 | ##############################################################################
#
# Copyright (c) 2008-2010 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
# General contacts <info@kndati.lv>
#
# Copyright (c) 2010-2011"Micronaet s.r.l.". (http://www.micronaet.it)
# All Righ... | agpl-3.0 |
ryfeus/lambda-packs | Keras_tensorflow/source/tensorflow/contrib/learn/python/learn/utils/gc.py | 66 | 5986 | # 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... | mit |
nikesh-mahalka/nova | nova/tests/unit/objects/test_instance_pci_requests.py | 32 | 7584 | # 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
# d... | apache-2.0 |
toddeye/home-assistant | homeassistant/components/media_player/itunes.py | 2 | 13895 | """
homeassistant.components.media_player.itunes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to iTunes API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.itunes/
"""
import logging
import requests
from homeassistant.c... | mit |
DONIKAN/django | django/db/migrations/autodetector.py | 34 | 56193 | from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... | bsd-3-clause |
mrry/tensorflow | tensorflow/contrib/opt/python/training/external_optimizer_test.py | 15 | 5484 | # 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 |
andersinno/django-analog | analog_tests/test_analog.py | 1 | 5720 | import pytest
from django.db import models
from analog import BaseLogEntry, LogEntryKind, define_log_model
from analog.exceptions import NoExtraField, UnknownLogKind
from analog_tests.models import (
FreeLogEntry, LoggedModel, LoggedModelLogEntry, SecondLoggedModel,
ThirdLoggedModel)
class RandomModel(models... | mit |
teltek/edx-platform | openedx/core/djangoapps/password_policy/forms.py | 13 | 1321 | """
Forms for the password policy app.
"""
from django.contrib import messages
from django.contrib.admin.forms import AdminAuthenticationForm
from django.forms import ValidationError
from openedx.core.djangoapps.password_policy import compliance as password_policy_compliance
class PasswordPolicyAwareAdminAuthForm(Ad... | agpl-3.0 |
openstack/neutron | neutron/db/migration/alembic_migrations/agent_init_ops.py | 14 | 1918 | # 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 |
rodrigolucianocosta/ControleEstoque | rOne/Storage101/django-localflavor/django-localflavor-1.3/tests/test_es.py | 7 | 6929 | from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.es.forms import (ESCCCField, ESIdentityCardNumberField, ESPhoneNumberField, ESPostalCodeField,
ESProvinceSelect, ESRegionSelect)
class ESLocalFlavorTests(SimpleTestCase):
def test_ES... | gpl-3.0 |
AmberJBlue/aima-python | tests/test_games.py | 26 | 2508 | """A lightweight test suite for games.py"""
# You can run this test suite by doing: py.test tests/games.py
# Of course you need to have py.test installed to do this.
import pytest
from games import * # noqa
# Creating the game instances
f52 = Fig52Game()
ttt = TicTacToe()
def gen_state(to_move='X', x_positions=[... | mit |
iodoom-gitorious/neotrips-iodoom3 | neo/sys/linux/runner/runner_lib.py | 61 | 6759 | # run doom process on a series of maps
# can be used for regression testing, or to fetch media
# keeps a log of each run ( see getLogfile )
# currently uses a basic stdout activity timeout to decide when to move on
# using a periodic check of /proc/<pid>/status SleepAVG
# when the sleep average is reaching 0, issue a ... | gpl-3.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/contrib/learn/python/learn/learn_io/pandas_io_test.py | 111 | 7865 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
zuotingbing/spark | examples/src/main/python/mllib/pca_rowmatrix_example.py | 128 | 1712 | #
# 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 |
gautam1858/tensorflow | tensorflow/python/data/util/sparse.py | 20 | 5021 | # 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 |
Tehsmash/ironic | ironic/tests/api/v1/test_drivers.py | 7 | 10426 | # Copyright 2013 Red Hat, 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 |
stainsteelcrown/nonsense-story-generator | venv/lib/python2.7/site-packages/pip/log.py | 344 | 9455 | """Logging
"""
import sys
import os
import logging
from pip import backwardcompat
from pip._vendor import colorama, pkg_resources
def _color_wrap(*colors):
def wrapped(inp):
return "".join(list(colors) + [inp, colorama.Style.RESET_ALL])
return wrapped
def should_color(consumer, environ, std=(sys.s... | mit |
olgabot/pelican-plugins | liquid_tags/mdx_liquid_tags.py | 281 | 3447 | """
Markdown Extension for Liquid-style Tags
----------------------------------------
A markdown extension to allow user-defined tags of the form::
{% tag arg1 arg2 ... argn %}
Where "tag" is associated with some user-defined extension.
These result in a preprocess step within markdown that produces
either markdo... | agpl-3.0 |
MatthewThe/kaggle | titanic/bin/visualise.py | 1 | 1648 | #!/usr/bin/python
import csv
import matplotlib.pyplot as plt
import numpy as np
idx = 0
# 0: PassengerId, 1: Survived, 2: Pclass, 3: Name, 4: Sex (male,female), 5: Age, 6: SibSp, 7: ParCh, 8: Ticket, 9: Fare, 10: Cabin, 11: Embarked (S,C,Q)
# 1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/5 21171,7.25,,S
def plotHist(... | apache-2.0 |
Ziqi-Li/bknqgis | pandas/pandas/tests/dtypes/test_generic.py | 2 | 3714 | # -*- coding: utf-8 -*-
from warnings import catch_warnings
import numpy as np
import pandas as pd
from pandas.core.dtypes import generic as gt
from pandas.util import testing as tm
class TestABCClasses(object):
tuples = [[1, 2, 2], ['red', 'blue', 'red']]
multi_index = pd.MultiIndex.from_arrays(tuples, name... | gpl-2.0 |
15Dkatz/pants | tests/python/pants_test/base/test_filesystem_build_file.py | 16 | 10164 | # 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 six
from twit... | apache-2.0 |
Drudenhaus/aws-ec2rescue-linux | lib/requests/packages/chardet/compat.py | 270 | 1134 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Dan Blanchard
# Ian Cordasco
#
# This library 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
# versi... | apache-2.0 |
smclt30p/PCS | ui/Ui_Settings.py | 1 | 4460 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src\settings.ui'
#
# Created by: PyQt5 UI code generator 5.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Settings(object):
def setupUi(self, Settings):
Settings... | bsd-2-clause |
nojhan/weboob-devel | modules/bnporc/enterprise/pages.py | 5 | 11358 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Laurent Bachelier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | agpl-3.0 |
tboyce021/home-assistant | tests/components/device_tracker/test_device_trigger.py | 3 | 6809 | """The tests for Device Tracker device triggers."""
import pytest
import voluptuous_serialize
import homeassistant.components.automation as automation
from homeassistant.components.device_tracker import DOMAIN, device_trigger
import homeassistant.components.zone as zone
from homeassistant.helpers import config_validat... | apache-2.0 |
albertomurillo/ansible | lib/ansible/modules/storage/netapp/na_ontap_ucadapter.py | 27 | 7703 | #!/usr/bin/python
# (c) 2018, NetApp, 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
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_... | gpl-3.0 |
Tatsh-ansible/ansible | lib/ansible/module_utils/facts/network/hpux.py | 232 | 3015 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
guidotack/coreemu | daemon/core/services/bird.py | 11 | 7179 | #
# CORE
# Copyright (c)2012 Jean-Tiare Le Bigot.
# See the LICENSE file included in this distribution.
#
# authors: Jean-Tiare Le Bigot <admin@jtlebi.fr>
# Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
bird.py: defines routing services provided by the BIRD Internet Routing Daemon.
'''
import os
from... | bsd-2-clause |
ChristianAA/python_koans_solutions | python3/libs/colorama/win32.py | 451 | 4833 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... | mit |
arhea/grunt-travis | node_modules/grunt/node_modules/gzip-js/test/unzipTest.py | 182 | 1840 | import os
from colorama import Fore
from helpers import run_cmd
outDirDefault = 'test-outs'
testDirDefault = 'test-files'
"""
Run a single test
@param tFile- required; the file to check against (uncompressed data)
@param level- optional (default: all); the compression level [1-9]
@return True if all tests passed; Fa... | mit |
lsalzman/iqm | blender-2.74/iqm_export.py | 1 | 48420 | # This script is licensed as public domain.
bl_info = {
"name": "Export Inter-Quake Model (.iqm/.iqe)",
"author": "Lee Salzman",
"version": (2019, 2, 3),
"blender": (2, 74, 0),
"location": "File > Export > Inter-Quake Model",
"description": "Export to the Inter-Quake Model format (.iqm/... | mit |
OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/django/db/migrations/optimizer.py | 97 | 14265 | from __future__ import unicode_literals
from django.db import migrations
from django.utils import six
class MigrationOptimizer(object):
"""
Powers the optimization process, where you provide a list of Operations
and you are returned a list of equal or shorter length - operations
are merged into one i... | apache-2.0 |
MoroGasper/client | client/api/push.py | 1 | 5321 | """Copyright (C) 2013 COLDWELL AG
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 program is distributed in the hope that... | gpl-3.0 |
arlolra/stem | test/integ/connection/connect.py | 7 | 1646 | """
Integration tests for the connect_* convenience functions.
"""
import StringIO
import sys
import unittest
import stem.connection
import test.runner
class TestConnect(unittest.TestCase):
def setUp(self):
# prevents the function from printing to the real stdout
self.original_stdout = sys.stdout
sys.... | lgpl-3.0 |
khchine5/xl | lino_xl/lib/polls/models.py | 1 | 26494 | # -*- coding: UTF-8 -*-
# Copyright 2013-2018 Luc Saffre
# License: BSD (see file COPYING for details)
from builtins import str
from builtins import object
import logging
logger = logging.getLogger(__name__)
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.transla... | bsd-2-clause |
mattstep/ansible | lib/ansible/plugins/lookup/random_choice.py | 253 | 1226 | # (c) 2013, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) any lat... | gpl-3.0 |
kbarnes3/BaseDjangoSite | web/users/forms.py | 1 | 2372 | from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import PasswordResetForm
from django.contrib.auth.password_validation import validate_password
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_current... | bsd-2-clause |
sauloal/cnidaria | scripts/venv/lib/python2.7/encodings/mbcs.py | 860 | 1211 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... | mit |
CUCWD/edx-platform | common/test/acceptance/tests/studio/test_studio_accessibility_form.py | 14 | 2592 | """
Bok-choy tests for the Studio Accessibility Feedback page.
"""
import ddt
from common.test.acceptance.pages.studio.index import AccessibilityPage
from common.test.acceptance.tests.helpers import AcceptanceTest
@ddt.ddt
class AccessibilityPageTest(AcceptanceTest):
"""
Test that a user can access the page ... | agpl-3.0 |
GoSteven/Diary | django/contrib/admindocs/urls.py | 13 | 1130 | from django.conf.urls.defaults import *
from django.contrib.admindocs import views
urlpatterns = patterns('',
url('^$',
views.doc_index,
name='django-admindocs-docroot'
),
url('^bookmarklets/$',
views.bookmarklets,
name='django-admindocs-bookmarklets'
),
... | bsd-3-clause |
danieljaouen/ansible | lib/ansible/modules/cloud/ovirt/ovirt_snapshot_facts.py | 55 | 3817 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUM... | gpl-3.0 |
xhorn/xchorizon | horizon/dashboards/syspanel/instances/tests.py | 3 | 3829 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/libconfig/package.py | 3 | 1908 | ##############################################################################
# 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 |
ArnossArnossi/django | tests/serializers_regress/models.py | 169 | 8611 | """
A test spanning all the capabilities of all the serializers.
This class sets up a model for each model field type
(except for image types, because of the Pillow dependency).
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import... | bsd-3-clause |
themoken/Canto | canto/main.py | 1 | 23937 | # -*- coding: utf-8 -*-
#Canto - ncurses RSS reader
# Copyright (C) 2008 Jack Miller <jack@codezen.org>
#
# This program 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.
# The Main object e... | gpl-2.0 |
shakamunyi/ansible | lib/ansible/plugins/action/raw.py | 106 | 1665 | # (c) 2012, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) any lat... | gpl-3.0 |
mtp1376/youtube-dl | youtube_dl/extractor/dbtv.py | 128 | 2639 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
float_or_none,
int_or_none,
clean_html,
)
class DBTVIE(InfoExtractor):
_VALID_URL = r'http://dbtv\.no/(?P<id>[0-9]+)#(?P<display_id>.+)'
_TEST... | unlicense |
boudewijnrempt/breakpad | src/tools/gyp/pylib/gyp/easy_xml_test.py | 60 | 3231 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | bsd-3-clause |
ArtsiomCh/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py | 70 | 49865 | # 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 |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
datapythonista/pandas | pandas/tests/series/methods/test_sort_index.py | 2 | 12500 | import random
import numpy as np
import pytest
from pandas import (
DatetimeIndex,
IntervalIndex,
MultiIndex,
Series,
)
import pandas._testing as tm
@pytest.fixture(params=["quicksort", "mergesort", "heapsort", "stable"])
def sort_kind(request):
return request.param
class TestSeriesSortIndex:
... | bsd-3-clause |
skurochkin/selenium | py/test/selenium/webdriver/common/clear_tests.py | 65 | 3262 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
petteyg/intellij-community | python/lib/Lib/bisect.py | 91 | 2394 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | apache-2.0 |
dmcc/PyStanfordDependencies | test/data.py | 1 | 58776 | # this file contains all the string data (inputs and outputs) for tests
# the SD trees were originally produced on SD 3.4.1 but they work up
# to (at least) SD 3.5.2. the UD trees were produced using UD 3.5.2.
# tests now require SD/UD 3.5.2 (and thus Java 1.8). downside of this
# is that we can't test JPype on older ... | apache-2.0 |
mugwort-rc/idata | idata/config/assertion.py | 1 | 2193 | import re
from . import expression
class AssertionBase:
pass
class RowAssertion(AssertionBase):
def __init__(self, config, assert_config):
assert assert_config["type"] == "row"
self.config = config
self.assert_config = assert_config
def check(self, data):
if self.type =... | gpl-3.0 |
fuselock/odoo | addons/lunch/tests/test_lunch.py | 345 | 5045 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
kharris/prebotc-graph-model | postprocessing_preBotBot/doCollectionPlots.py | 1 | 2612 | #!/usr/bin/env python
import scipy.io
import argparse
import sys
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import os.path
import os
'''
This file looks at a given mat file with the final metrics over all runs given and will
plot this with the standard deviatio... | bsd-3-clause |
ubgarbage/gae-blog | django/contrib/localflavor/pt/forms.py | 309 | 1561 | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | bsd-3-clause |
theflofly/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py | 12 | 50557 | # 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 |
reddymeghraj/showroom | erpnext/shopping_cart/test_shopping_cart.py | 31 | 6992 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.shopping_cart import get_quotation, set_item_in_cart
class TestShoppingCart(unittest.TestCase):
"""
Note:... | agpl-3.0 |
MDAnalysis/mdanalysis | testsuite/MDAnalysisTests/dummy.py | 1 | 6566 | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... | gpl-2.0 |
rombie/contrail-controller | src/storage/stats-daemon/stats_daemon/tests/test_storage_nodemgr.py | 18 | 6557 | import mock
import unittest
import uuid
import sys
import subprocess
import pdb
from stats_daemon.storage_nodemgr import EventManager
from pysandesh.sandesh_base import *
class EventManagerTest(unittest.TestCase):
def setUp(self):
self._api = EventManager("storage-compute")
def mocked_pool_subprocess... | apache-2.0 |
nitin-cherian/Webapps | TalkPython/P4E/.env/lib/python3.5/site-packages/pip/_vendor/__init__.py | 18 | 4781 | """
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... | mit |
ecarm002/vxquery | vxquery-server/src/main/resources/scripts/cluster_cli.py | 11 | 3506 | #!/usr/bin/env 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 file to You under the Apache License, Version 2.0
# (the "Lic... | apache-2.0 |
awslabs/aws-big-data-blog | aws-blog-firehose-lambda-elasticsearch-near-real-time-discovery-platform/lambda-s3-twitter-to-es-python/twitter_to_es.py | 1 | 2055 | '''
Created on Oct 8, 2015
@author: mentzera
'''
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
import config
from elasticsearch.exceptions import ElasticsearchException
from tweet_utils import get_tweet, id_field, get_tweet_mapping
index_name = 'twitter'
doc_type = 'tweet'
# mapping ... | apache-2.0 |
mclois/iteexe | twisted/web/http.py | 14 | 37660 | # -*- test-case-name: twisted.web.test.test_http -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""HyperText Transfer Protocol implementation.
This is used by twisted.web.
API Stability: stable
Future Plans:
- HTTP client support will at some point be refactored to support ... | gpl-2.0 |
sertac/django | tests/responses/tests.py | 226 | 4171 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.http import HttpResponse
from django.http.response import HttpResponseBase
from django.test import SimpleTestCase
UTF8 = 'utf-8'
ISO88591 = 'iso-8859-1'
class HttpResponseBaseTests(SimpleTestCase):
def ... | bsd-3-clause |
Distrotech/reportlab | tests/test_lib_colors.py | 14 | 7291 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
"""Tests for the reportlab.lib.colors module.
"""
__version__='''$Id$'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import os, math
import unittest
from reportlab.pdfgen.... | bsd-3-clause |
jorsea/odoo-addons | inter_company_move/__openerp__.py | 2 | 1922 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.