repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
Alex-Chizhov/python_training | home_work_7/model/info_contact.py | __author__ = 'Alex'
class Infos:
def __init__(self, firstname,middelname,lastname,nickname, title,company,addres,home,mobile,
fax,homepage,day_Birthday,month_Birthday,year_Birthday,day_Anniversary,
month_Anniversary,year_Anniversary,address2,phone2,notes,work,ph... |
MartinHjelmare/home-assistant | homeassistant/components/orangepi_gpio/binary_sensor.py | """Support for binary sensor using Orange Pi GPIO."""
import logging
from homeassistant.components import orangepi_gpio
from homeassistant.components.binary_sensor import (
BinarySensorDevice, PLATFORM_SCHEMA)
from homeassistant.const import DEVICE_DEFAULT_NAME
from . import CONF_PIN_MODE
from .const import CONF_... |
tylertian/Openstack | openstack F/nova/nova/network/manager.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... |
sharifelgamal/runtimes-common | ftl/python/cached/main.py | # Copyright 2017 Google 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 applicable law or agreed t... |
spatialdev/onadata | onadata/apps/logger/migrations/0061_auto__add_field_xform_instances_with_osm.py | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'XForm.instances_with_osm'
db.add_column(u'logger_xform', ... |
jlecoeur/Firmware | Tools/px4.py | #!/usr/bin/env python
############################################################################
#
# Copyright (c) 2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... |
nvoron23/scipy | scipy/optimize/optimize.py | #__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
# A collection of optimization algorithms. Version ... |
zcbenz/cefode-chromium | tools/telemetry/telemetry/core/wpr_server.py | # 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 sys
from telemetry.core import util
# Get chrome/test/functional scripts into our path.
# TODO(tonyg): Move webpagereplay.py to a commo... |
pprett/scikit-learn | sklearn/decomposition/nmf.py | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck
# Mathieu Blondel <mathieu@mblondel.org>
# Tom Dupre la Tour
# License: BSD 3 clause
from __future__ import division, print_function
from math import sqrt
import warnings
import numbers
import time
import numpy ... |
Giftingnation/GN-Oscar-Custom | oscar/apps/payment/migrations/0002_auto__chg_field_source_reference__chg_field_source_label__chg_field_tr.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
no_dry_run = True
def forwards(self, orm):
# Replace nulls with emp... |
flavour/eden | modules/templates/historic/RLP/tools/pooladjust.py | # -*- coding: utf-8 -*-
#
# Tool to adjust pool assignments of volunteers
#
# RLP Template Version 1.6.0
#
# Execute in web2py folder after code upgrade like:
# python web2py.py -S eden -M -R applications/eden/modules/templates/RLP/tools/pooladjust.py -A <rules-file>
#
import sys
from gluon import current
# ---------... |
levilucio/SyVOLT | UMLRT2Kiltera_MM/merge_preprocess_rules/models/delete_uncollapsed_element_match_diff_rules_MDL.py | """
__delete_uncollapsed_element_match_diff_rules_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: levi
Modified: Mon Jun 3 15:07:37 2013
_______________________________________________________________________________________________... |
Sorsly/subtle | google-cloud-sdk/lib/surface/compute/https_health_checks/describe.py | # Copyright 2014 Google 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 applicable law or ag... |
firebitsbr/pwn_plug_sources | src/set/src/payloads/powershell/prep.py | #!/usr/bin/python
import base64,sys,subprocess,re,os,time
from src.core.setcore import *
# grab ipaddress
if os.path.isfile("src/program_junk/ipaddr.file"):
fileopen = file("src/program_junk/ipaddr.file", "r")
ipaddr = fileopen.read()
else:
ipaddr = raw_input("Enter the ipaddress for the rever... |
ofer43211/unisubs | apps/comments/forms.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 3 of the
# License, or (at your op... |
LLNL/spack | var/spack/repos/builtin/packages/r-rhmmer/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRhmmer(RPackage):
"""rhmmer: Utilities Parsing 'HMMER' Results"""
homepage = "https:... |
jawilson/home-assistant | homeassistant/components/insteon/api/properties.py | """Property update methods and schemas."""
from itertools import chain
from pyinsteon import devices
from pyinsteon.constants import RAMP_RATES, ResponseStatus
from pyinsteon.device_types.device_base import Device
from pyinsteon.extended_property import (
NON_TOGGLE_MASK,
NON_TOGGLE_ON_OFF_MASK,
OFF_MASK,
... |
anaderi/hep_ml | tests/_metrics_oldimplementation.py | from __future__ import division, print_function, absolute_import
import numpy
import pandas
from sklearn.utils import column_or_1d
from hep_ml.commonutils import check_sample_weight, compute_cut_for_efficiency, compute_knn_indices_of_signal
from hep_ml.metrics_utils import compute_bin_weights, compute_bin_efficiencie... |
airbnb/airflow | airflow/providers/google/cloud/example_dags/example_mysql_to_gcs.py | # 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 u... |
jnewland/home-assistant | homeassistant/components/xs1/climate.py | """Support for XS1 climate devices."""
from functools import partial
import logging
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import SUPPORT_TARGET_TEMPERATURE
from homeassistant.const import ATTR_TEMPERATURE
from . import ACTUATORS, DOMAIN as COMPONENT_DOM... |
nagyistoce/eutester | testcases/cloud_user/s3/osg_concurrency_test.py | #!/usr/bin/env python
from __future__ import division
import time
import os
import hashlib
import tempfile
from math import ceil
from cStringIO import StringIO
from concurrent.futures import ThreadPoolExecutor
from eucaops import Eucaops
from eucaops import S3ops
from eutester.eutestcase import EutesterTestCase
clas... |
tectronics/smap-data | python/tx/ipv6/internet/udp6.py | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Exceedingly minor changes by B. A. Shelton, zancarius@gmail.com
# !!! Do not blame Twisted Matrix Laboratories if using this monkey patch breaks
# your application. !!!
# UDP support by Stephe... |
danakj/chromium | ui/webui/resources/PRESUBMIT.py | # Copyright 2016 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 re
def PostUploadHook(cl, change, output_api):
rietveld_obj = cl.RpcServer()
description = rietveld_obj.get_description(cl.issue)
existing_bo... |
chromium/chromium | build/android/pylib/local/emulator/local_emulator_environment.py | # Copyright 2019 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
from six.moves import range # pylint: disable=redefined-builtin
from devil import base_error
from devil.android import device_errors
from d... |
jaeilepp/mne-python | mne/realtime/tests/test_fieldtrip_client.py | # Author: Mainak Jas <mainak@neuro.hut.fi>
#
# License: BSD (3-clause)
import time
import os
import threading
import subprocess
import warnings
import os.path as op
from nose.tools import assert_true, assert_equal
import mne
from mne.utils import requires_neuromag2ft, run_tests_if_main
from mne.realtime import Field... |
EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/docs/core/examples/pbgtk2.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import gtk2reactor
gtk2reactor.install()
import gtk
from gtk import glade
from twisted import copyright
from twisted.internet import reactor, defer
from twisted.python import failure, log, util
from twisted.spread import pb
... |
abaldwin1/thumbor | vows/blacklist_vows.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from pyvows import Vows, expect
from tornado_pyvows.context import To... |
sephalon/python-ivi | ivi/agilent/agilentDSOX4154A.py | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014 Alex Forencich
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 righ... |
colemanja91/PyEloqua-Examples | venv/lib/python3.4/site-packages/psycopg2/tests/test_quote.py | #!/usr/bin/env python
# test_quote.py - unit test for strings quoting
#
# Copyright (C) 2007-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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 Foundat... |
upliftaero/MAVProxy | MAVProxy/modules/lib/optparse_gui/__init__.py | '''
A drop-in replacement for optparse ( "import optparse_gui as optparse" )
Provides an identical interface to optparse(.OptionParser),
But displays an automatically generated wx dialog in order to enter the
options/args, instead of parsing command line arguments
'''
import os
import sys
import re
import optparse
fro... |
bw4sz/DeepMeerkat | training/Detection/slim/preprocessing/inception_preprocessing.py | # 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... |
Serg09/socorro | socorro/unittest/cron/jobs/test_laglog.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import mock
from nose.tools import eq_
from socorro.cron.jobs.laglog import LagLog
from socorro.unitte... |
jfriedly/rethinkdb | scripts/visualize_btree.py | #!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
from collections import namedtuple
from parse_binary import *
import sys, traceback
def escape(string):
return string.replace("&", "&").replace("<", "<").replace(">", ">")
class Block(object):
pass
class GoodBlock(Block):
... |
sputnick-dev/weboob | modules/jvmalin/__init__.py | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Alexandre Lissy
#
# 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 your op... |
ddico/odoo | addons/web/tests/test_click_everywhere.py | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import odoo.tests
_logger = logging.getLogger(__name__)
@odoo.tests.tagged('click_all', 'post_install', '-at_install', '-standard')
class TestMenusAdmin(odoo.tests.HttpCase):
def test_01_click_everywhere_as_admin(self):
... |
fueghan/navitia | source/jormungandr/jormungandr/interfaces/v1/Ptobjects.py | # coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility an... |
dwhswenson/mdtraj | tests/test_utils.py | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2017 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Matthew Harrigan
#
# MDTraj is... |
frreiss/tensorflow-fred | tensorflow/python/autograph/converters/directives.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
petrutlucian94/nova | nova/api/openstack/compute/plugins/v3/flavors_extraspecs.py | # Copyright 2010 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... |
tboyce021/home-assistant | homeassistant/components/camera/__init__.py | """Component to interface with cameras."""
import asyncio
import base64
import collections
from contextlib import suppress
from datetime import timedelta
import hashlib
import logging
import os
from random import SystemRandom
from aiohttp import web
import async_timeout
import attr
import voluptuous as vol
from homea... |
thundernet8/WRGameVideos-API | venv/lib/python2.7/site-packages/sqlalchemy/ext/mutable.py | # ext/mutable.py
# Copyright (C) 2005-2015 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
"""Provide support for tracking of in-place changes to scalar values,
which are propa... |
endticket/uwsgi | plugins/rack/uwsgiplugin.py | import os
NAME = 'rack'
RUBYPATH = os.environ.get('UWSGICONFIG_RUBYPATH', 'ruby')
rbconfig = 'Config'
version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
v = version.split('.')
GCC_LIST = ['rack_plugin', 'rack_api']
if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
CFLAGS = os.popen(RUB... |
creichlin/captivout | tests/mysql/connector/errors.py | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... |
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | openstack/common/network_utils.py | # 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 req... |
shakamunyi/beam | sdks/python/apache_beam/examples/complete/autocomplete.py | #
# 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... |
eharney/nova | nova/api/openstack/compute/contrib/virtual_interfaces.py | # Copyright (C) 2011 Midokura KK
# 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 ... |
laosiaudi/tensorflow | tensorflow/contrib/training/python/training/training_test.py | # 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 applicable ... |
rubendura/django-rest-framework | tests/test_fields.py | import datetime
import os
import uuid
from decimal import Decimal
import django
import pytest
from django.http import QueryDict
from django.utils import timezone
import rest_framework
from rest_framework import serializers
# Tests for field keyword arguments and core functionality.
# -------------------------------... |
bp-kelley/rdkit | rdkit/Chem/ChemUtils/UnitTestAlignDepict.py | from contextlib import contextmanager
import sys
import unittest
from rdkit import Chem
from rdkit.Chem.ChemUtils.AlignDepict import initParser, processArgs, AlignDepict
from io import StringIO
class TestCase(unittest.TestCase):
def test1(self):
parser = initParser()
with outputRedirect() as (ou... |
armandobs14/rdflib | test/test_slice.py |
from rdflib import Graph, URIRef
import unittest
class GraphSlice(unittest.TestCase):
def testSlice(self):
"""
We pervert the slice object,
and use start, stop, step as subject, predicate, object
all operations return generators over full triples
"""
sl=lamb... |
herow/planning_qgis | python/plugins/processing/algs/taudem/slopearea.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
slopearea.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************... |
swapnakrishnan2k/tp-qemu | generic/tests/trans_hugepage_relocated.py | import logging
import time
import commands
import os
import re
from autotest.client.shared import error
from virttest import utils_test
from virttest.staging import utils_memory
def run(test, params, env):
"""
Transparent hugepage relocated test with quantification.
The pages thp deamon will scan for on... |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/ipaddress.py | # Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
"""A fast, lightweight IPv4/IPv6 manipulation library in Python.
This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.
"""
__version__ = '1.0'
import functools
IPV4LENGTH = 32
IPV6LENGTH = 128
class Add... |
renatofb/weblate | openshift/wsgi.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Daniel Tschan <tschan@puzzle.ch>
#
# This file is part of Weblate <http://weblate.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 Found... |
EthanBlackburn/sync-engine | migrations/versions/075_drop_contacts_search_signals.py | """drop contacts search signals
Revision ID: 1763103db266
Revises: 3c02d8204335
Create Date: 2014-08-07 04:50:58.382371
"""
# revision identifiers, used by Alembic.
revision = '1763103db266'
down_revision = '3c02d8204335'
from alembic import op
def upgrade():
op.drop_table('searchsignal')
op.drop_table('s... |
renatonlima/PySPED | pysped/nfe/leiaute/conscad_200.py | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... |
hayderimran7/tempest | tempest/api/compute/admin/test_services_negative.py | # Copyright 2013 NEC Corporation. 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 ... |
rdo-management/heat | heat/tests/test_nokey.py | #
# 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
# ... |
tylertian/Openstack | openstack F/nova/nova/network/__init__.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
lakshmi-kannan/matra | openstack/common/notifier/list_notifier.py | # Copyright 2011 OpenStack LLC.
# 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 b... |
tchellomello/home-assistant | homeassistant/components/homekit/type_humidifiers.py | """Class to hold all thermostat accessories."""
import logging
from pyhap.const import CATEGORY_HUMIDIFIER
from homeassistant.components.humidifier.const import (
ATTR_HUMIDITY,
ATTR_MAX_HUMIDITY,
ATTR_MIN_HUMIDITY,
DEFAULT_MAX_HUMIDITY,
DEFAULT_MIN_HUMIDITY,
DEVICE_CLASS_DEHUMIDIFIER,
DEV... |
sdague/home-assistant | homeassistant/components/hunterdouglas_powerview/entity.py | """The nexia integration base entity."""
from aiopvapi.resources.shade import ATTR_TYPE
import homeassistant.helpers.device_registry as dr
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import (
DEVICE_FIRMWARE,
DEVICE_MAC_ADDRESS,
DEVICE_MODEL,
DEVICE_NAME,
DE... |
atul-bhouraskar/django | tests/view_tests/tests/test_csrf.py | from django.template import TemplateDoesNotExist
from django.test import (
Client, RequestFactory, SimpleTestCase, override_settings,
)
from django.utils.translation import override
from django.views.csrf import CSRF_FAILURE_TEMPLATE_NAME, csrf_failure
@override_settings(ROOT_URLCONF='view_tests.urls')
class Csrf... |
jakevdp/sklearn_pycon2014 | notebooks/solutions/05_color_compression.py | def compress_image(image, n_colors=64):
"""Compress an image
Parameters
==========
image : numpy array
array of shape (height, width, 3) with integer values between 0 and 255
n_colors : integer
the number of colors in the final compressed image
(i.e. the number of KMeans clu... |
xavierdutreilh/djangoproject.com | aggregator/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
SNoiraud/gramps | gramps/plugins/gramplet/eval.py | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/network/nova_ipam_lib.py | # Copyright 2011 Nicira Networks, 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 requ... |
walbert947/ansible-modules-core | database/mysql/mysql_db.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.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 publishe... |
glogiotatidis/bedrock | lib/l10n_utils/extract.py | # mostly borrowed from tower
from babel.messages.extract import extract_python as babel_extract_py
from jinja2 import ext
from lib.l10n_utils.utils import strip_whitespace
def add_context(context, message):
# \x04 is a magic gettext number.
return u"%s\x04%s" % (context, message)
def tweak_message(message... |
ywcui1990/nupic.research | htmresearch/support/shared_tests/apical_tiebreak_sequences_test_base.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
chenjun0210/tensorflow | tensorflow/tensorboard/backend/event_processing/event_accumulator_test.py | # 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... |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/core/error.py | # encoding: utf-8
"""
Global exception classes for IPython.core.
Authors:
* Brian Granger
* Fernando Perez
* Min Ragan-Kelley
Notes
-----
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008 The IPython Development Team
#
# Distributed under the terms of the BSD ... |
rpbarnes/nmrglue | examples/convert/bruker2pipe_1d.py | #! /usr/bin/env python
import nmrglue as ng
# read in the varian data
dic,data = ng.bruker.read("../common_data/1d_bruker/")
# Set the parameters (many of these can be found in the procpar file
u = ng.bruker.guess_udic(dic,data)
u[0]['size'] = 2048
u[0]['complex'] = True
u[0]['encoding'] = 'direct'
u[0]['sw'] ... |
nkhuyu/mycli | release.py | #!/usr/bin/env python
from __future__ import print_function
import re
import ast
import subprocess
import sys
DEBUG = False
def version(version_file):
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open(version_file, 'rb') as f:
ver = str(ast.literal_eval(_version_re.search(
f.r... |
danielsuo/mobot | src/move/PhidgetsPython/Phidgets/Devices/GPS.py | """Copyright 2012 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
"""
__author__="Adam Stelmack"
__version__="2.1.8"
__date__ ="13-Jan-2011 12:29:34 PM"
import ctypes
from ctypes import ... |
noroutine/ansible | lib/ansible/modules/network/ios/ios_facts.py | #!/usr/bin/python
#
# 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 distribut... |
ta2-1/pootle | pootle/apps/accounts/migrations/0004_allow_null_last_login.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_remove_pootleprofile_id'),
]
operations = [
migrations.AlterField(
model_name='user',
... |
zestrada/nova-cs498cc | nova/tests/test_context.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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/LICEN... |
DVSBA/ajenti | plugins/openvpn/backend.py | # coding=utf-8
"""OpenVPN plugin backend"""
from ajenti.com import Plugin
from ajenti.utils.error import ConfigurationError
import manager
class OpenVPNBackend(Plugin):
"""
OpenVPN plugin and widget backend
@ivar _m: manager instance
"""
icon = "/dl/openvpn/icon.png"
text = "OpenVPN"
def _... |
rethinkdb/rethinkdb | test/regression/issue_4383.py | #!/usr/bin/env python
# Copyright 2015-2016 RethinkDB, all rights reserved.
'''Test that a backfill will resume after restarting a cluster'''
import os, pprint, sys, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, scenario_common, utils, vcoptpa... |
idlead/scikit-learn | sklearn/utils/multiclass.py |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... |
okfish/django-oscar | tests/unit/dashboard/reports_form_tests.py | from django.test import TestCase
from oscar.apps.dashboard.reports import forms
class TestReportsForm(TestCase):
def test_date_range_empty(self):
form = forms.ReportForm(data={})
self.assertFalse(form.is_valid())
def test_date_range_complete(self):
form = forms.ReportForm(data={
... |
thaim/ansible | lib/ansible/modules/network/fortios/fortios_system_ipv6_neighbor_cache.py | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... |
mhnatiuk/phd_sociology_of_religion | scrapper/build/lxml/src/lxml/tests/test_threading.py | # -*- coding: utf-8 -*-
"""
Tests for thread usage in lxml.etree.
"""
import unittest, threading, sys, os.path
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, HelperTestCase, BytesIO, _bytes
try:
from Queue im... |
liduanw/viewfinder | backend/db/identity.py | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Viewfinder identity.
Identities are provided by OAuth authorities such as Google, Facebook
or Twitter. A viewfinder user account may have multiple identities for
a user. However, each identity may be associated with only one viewfinder
account.
TODO(spencer): ... |
ekasitk/sahara | sahara/db/migration/alembic_migrations/versions/008_security_groups.py | # 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 or agreed to in ... |
bkahlert/seqan-research | raw/workshop13/workshop2013-data-20130926/trunk/misc/renaming/helpers.py | import os
import os.path
def test_file_type(filename):
"""
Tests whether the given filename is a C++ header or implementation file
(based on the filename extension.)
"""
pos = filename.rfind(".")
if (pos >= 0): ext = filename[pos+1:]
else: ext = ""
return ext in ["c", "C", "cpp", "CPP"... |
xingyepei/edx-platform | cms/djangoapps/models/settings/course_metadata.py | """
Django module for Course Metadata class -- manages advanced settings and related parameters
"""
from xblock.fields import Scope
from xmodule.modulestore.django import modulestore
from django.utils.translation import ugettext as _
from django.conf import settings
class CourseMetadata(object):
'''
For CRUD ... |
kerneltask/micropython | tests/pyb/can.py | try:
from pyb import CAN
except ImportError:
print("SKIP")
raise SystemExit
from array import array
import micropython
import pyb
# test we can correctly create by id (2 handled in can2.py test)
for bus in (-1, 0, 1, 3):
try:
CAN(bus, CAN.LOOPBACK)
print("CAN", bus)
except ValueErr... |
madelynfreed/rlundo | venv/lib/python2.7/site-packages/IPython/terminal/console/tests/writetofile.py | #-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------------------------------------------------------... |
ruzhytskyi/Koans | python3/runner/path_to_enlightenment.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The path to enlightenment starts with the following:
import unittest
from koans.about_asserts import AboutAsserts
from koans.about_none import AboutNone
from koans.about_lists import AboutLists
from koans.about_list_assignments import AboutListAssignments
from koans.ab... |
wwf5067/statsmodels | statsmodels/regression/tests/test_lme.py | import warnings
import numpy as np
import pandas as pd
from statsmodels.regression.mixed_linear_model import MixedLM, MixedLMParams
from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose,
dec, assert_)
from . import lme_r_results
from statsmodels.base import _penalties ... |
jwiggins/scikit-image | skimage/feature/tests/test_corner.py | import numpy as np
from numpy.testing import (assert_array_equal, assert_raises,
assert_almost_equal)
from skimage import data
from skimage import img_as_float
from skimage.color import rgb2gray
from skimage.morphology import octagon
from skimage._shared.testing import test_parallel
from sk... |
uclaros/QGIS | tests/src/python/test_core_additions.py | # -*- coding: utf-8 -*-
"""QGIS Unit tests for core additions
From build dir, run: ctest -R PyCoreAdditions -V
.. note:: 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 Licen... |
CoolCloud/taiga-back | taiga/userstorage/migrations/0002_fix_json_field_not_null.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_pgjson.fields import JsonField
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('userstorage', '0001_initial'),
]
operations = [
migrations.RunSQL(
s... |
UpSea/thirdParty | pyqtgraph-0.9.10/examples/ConsoleWidget.py | # -*- coding: utf-8 -*-
"""
ConsoleWidget is used to allow execution of user-supplied python commands
in an application. It also includes a command history and functionality for trapping
and inspecting stack traces.
"""
import initExample ## Add path to library (just for examples; you do not need this)
import pyqtgra... |
LumPenPacK/NetworkExtractionFromImages | win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/linalg/laplacianmatrix.py | """Laplacian matrix of graphs.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric ... |
HuaweiSwitch/ansible | test/units/modules/network/junos/test_junos_command.py | # (c) 2017 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 dis... |
chienlieu2017/it_management | odoo/addons/website_crm/tests/test_website_crm.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.api import Environment
import odoo.tests
@odoo.tests.common.at_install(False)
@odoo.tests.common.post_install(True)
class TestWebsiteCrm(odoo.tests.HttpCase):
def test_tour(self):
self.phantom_js... |
o3project/ryu-oe | ryu/tests/unit/lib/test_hub.py | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.