repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
meisterkleister/erpnext | refs/heads/master | erpnext/stock/report/serial_no_status/__init__.py | 12133432 | |
SurfasJones/icecream-info | refs/heads/master | icecream/lib/python2.7/site-packages/django/contrib/staticfiles/models.py | 12133432 | |
yigitguler/django | refs/heads/master | tests/timezones/__init__.py | 12133432 | |
andree1320z/deport-upao-web | refs/heads/master | deport_upao/config/__init__.py | 12133432 | |
lwiecek/django | refs/heads/master | django/template/loaders/__init__.py | 12133432 | |
toooooper/oppia | refs/heads/master | extensions/rules/base.py | 26 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
pfnet/chainer | refs/heads/master | tests/chainer_tests/links_tests/connection_tests/test_deconvolution_2d.py | 5 | import numpy
import chainer
from chainer.backends import cuda
import chainer.functions as F
from chainer import links as L
from chainer import testing
from chainer.testing import parameterize
def _pair(x):
if hasattr(x, '__getitem__'):
return x
return x, x
@parameterize(
*testing.product({
... |
AsgerPetersen/tiledrasterio | refs/heads/master | tiledrasterio/scripts/cli.py | 1 | # Skeleton of a CLI
import click
import tiledrasterio
@click.command('tiledrasterio')
@click.argument('count', type=int, metavar='N')
def cli(count):
"""Echo a value `N` number of times"""
for i in range(count):
click.echo(tiledrasterio.has_legs)
|
mmmsplay10/AttackWeakBrowsers | refs/heads/master | lib/flask/testing.py | 783 | # -*- coding: utf-8 -*-
"""
flask.testing
~~~~~~~~~~~~~
Implements test support helpers. This module is lazily imported
and usually not used in production environments.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from contextlib import contextmana... |
wattlebird/Bangumi_Spider | refs/heads/master | bgm/pipelines.py | 1 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.exceptions import DropItem
from twisted.enterprise import adbapi
from scrapy import signals
from scrapy.exporters i... |
antonve/s4-project-mooc | refs/heads/master | common/djangoapps/config_models/tests.py | 2 | """
Tests of ConfigurationModel
"""
from django.contrib.auth.models import User
from django.db import models
from django.test import TestCase
from freezegun import freeze_time
from mock import patch
from config_models.models import ConfigurationModel
class ExampleConfig(ConfigurationModel):
"""
Test model ... |
steven-cutting/latinpigsay | refs/heads/stable | latinpigsay/tmp/experiments/expfunctions.py | 1 | # -*- coding: utf-8 -*-
__title__ = 'latinpigsay'
__license__ = 'MIT'
__author__ = 'Steven Cutting'
__author_email__ = 'steven.c.projects@gmail.com'
__created_on__ = '12/7/2014'
# handle a massive file using generator
def filereader_gen(file):
with open(file) as f:
for line in f:
yield line
|
bsipocz/astropy | refs/heads/hacking | astropy/nddata/tests/test_decorators.py | 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import pytest
import numpy as np
from astropy.tests.helper import catch_warnings
from astropy.utils.exceptions import AstropyUserWarning
from astropy import units as u
from astropy.nddata.nddata import NDData
from astropy.nddata.decorato... |
grischa/mytardis-mrtardis | refs/heads/master | tardis/tardis_portal/templatetags/xmldate.py | 7 | from django import template
from datetime import datetime
from tardis.tardis_portal.rfc3339 import rfc3339
register = template.Library()
@register.filter
def toxmldatetime(value):
return rfc3339(value)
|
jagguli/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/fi/forms.py | 309 | """
FI-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class FIZipCodeField(RegexField):
default_error_messages = {
... |
sadleader/odoo | refs/heads/master | addons/l10n_ch/account_wizard.py | 424 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... |
thinkerou/grpc | refs/heads/master | src/python/grpcio/grpc/_plugin_wrapping.py | 11 | # Copyright 2015 gRPC authors.
#
# 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... |
MOA-2011/enigma2.pli4.0 | refs/heads/master | lib/python/Tools/HardwareInfo.py | 1 | import os
from Tools.Directories import SCOPE_SKIN, resolveFilename
hw_info = None
class HardwareInfo:
device_name = _("unavailable")
device_model = None
device_version = ""
device_revision = ""
device_hdmi = False
def __init__(self):
global hw_info
if hw_info is not None:
# print "using ca... |
walac/build-mozharness | refs/heads/master | configs/builds/releng_sub_linux_configs/64_mulet.py | 1 | import os
config = {
'default_actions': [
'clobber',
'clone-tools',
'setup-mock',
'build',
],
'stage_platform': 'linux64-mulet',
'stage_product': 'b2g',
'tooltool_manifest_src': "b2g/dev/config/tooltool-manifests/linux64/releng.manifest",
'platform_supports_post_... |
nishad-jobsglobal/odoo-marriot | refs/heads/master | addons/fleet/fleet.py | 266 | # -*- 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... |
jeanlinux/calibre | refs/heads/master | src/calibre/devices/edge/__init__.py | 12133432 | |
fafaman/django | refs/heads/master | django/contrib/gis/db/backends/postgis/__init__.py | 12133432 | |
lesina/Hack70 | refs/heads/master | env/lib/python3.5/site-packages/django/conf/locale/ga/__init__.py | 12133432 | |
karrtikr/ete | refs/heads/master | examples/evol/4_branch_models.py | 4 | #!/usr/bin/python
"""
15 Nov 2010
run branches models, contrasting groups of branches over
the rest of the phylogeny.
Test of positive selection and relaxation over them.
"""
__author__ = "Francois-Jose Serra"
__email__ = "francois@barrabin.org"
__licence__ = "GPLv3"
__version__ = "0.0"
try:
input = raw_inpu... |
gnu-sandhi/gnuradio | refs/heads/master | gr-scigen/python/__init__.py | 7 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application 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.
#
# This application is di... |
csachs/openmicroscopy | refs/heads/develop | components/tools/OmeroWeb/test/unit/test_marshal.py | 10 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# 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 Foun... |
wrouesnel/ansible | refs/heads/devel | lib/ansible/modules/cloud/packet/packet_sshkey.py | 101 | #!/usr/bin/python
# Copyright 2016 Tomas Karasek <tom.to.the.k@gmail.com>
# 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',
... |
maxkoryukov/headphones | refs/heads/master | lib/certgen.py | 161 | # -*- coding: latin-1 -*-
#
# Copyright (C) Martin Sjögren and AB Strakt 2001, All rights reserved
# Copyright (C) Jean-Paul Calderone 2008, All rights reserved
# This file is licenced under the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 or later (aka LGPL v2.1)
# Please see LGPL2.1.txt for more information
"""
Cert... |
ksmet1977/pyKS_lib | refs/heads/master | general/fcns.py | 1 | # -*- coding: utf-8 -*-
"""
pylib_KS: general function definitions
Created on Wed Jun 10 15:14:20 2015
@author: kevin.smet
"""
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# explicitely define all variables and functions in current module for export
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
TOCyna/tabelinha | refs/heads/master | flask/lib/python2.7/linecache.py | 4 | /usr/lib/python2.7/linecache.py |
code-sauce/tensorflow | refs/heads/master | tensorflow/contrib/quantization/python/math_ops.py | 179 | # 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... |
ptemplier/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/pulp_repo.py | 33 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Joe Adams <@sysadmind>
#
# 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',
... |
mtdewulf/incubator-airflow | refs/heads/master | tests/dags/test_issue_1225.py | 16 | # -*- 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
... |
jonparrott/gcloud-python | refs/heads/master | bigquery/tests/unit/test_schema.py | 3 | # Copyright 2015 Google LLC
#
# 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, s... |
prune998/ansible | refs/heads/devel | lib/ansible/plugins/lookup/credstash.py | 131 | # (c) 2015, Ensighten <infra@ensighten.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 later version... |
chirilo/mozillians | refs/heads/master | vendor-local/lib/python/tablib/packages/yaml3/serializer.py | 293 |
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
class Serializer:
ANCHOR_TEMPLATE = 'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=None, ta... |
josthkko/ggrc-core | refs/heads/develop | src/ggrc/models/object_person.py | 6 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy import orm
from ggrc import db
from ggrc.models.deferred import deferred
fr... |
skirsdeda/django | refs/heads/master | django/views/decorators/http.py | 18 | """
Decorators for views based on HTTP headers.
"""
import logging
from calendar import timegm
from functools import wraps
from django.utils.decorators import decorator_from_middleware, available_attrs
from django.utils.http import http_date, parse_http_date_safe, parse_etags, quote_etag
from django.middleware.http i... |
alexanderfefelov/nav | refs/heads/master | python/nav/web/seeddb/page/netboxtype.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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.
#
# This program is... |
kaarolch/ansible | refs/heads/devel | lib/ansible/modules/windows/win_webpicmd.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Peter Mounce <public@neverrunwithscissors.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... |
paplorinc/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/metaClassMembers.py | 79 | class GenericMeta(type):
def __getitem__(self, args):
pass
class Generic(object):
__metaclass__ = GenericMeta
class C(Generic['foo']):
pass
print(C['bar'])
c = C()
print(c<warning descr="Class 'C' does not define '__getitem__', so the '[]' operator cannot be used on its instances">[</warning>'... |
zhaogaolong/oneFinger | refs/heads/master | storage/ceph/__init__.py | 17 | #!/usr/bin/env python
# coding:utf8 |
freeflightsim/ffs-app-engine | refs/heads/master | google_appengine/lib/yaml/lib/yaml/events.py | 986 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... |
pratikmallya/hue | refs/heads/master | desktop/core/ext-py/PyYAML-3.09/lib3/yaml/events.py | 986 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... |
thedrow/django | refs/heads/master | tests/template_tests/filter_tests/__init__.py | 12133432 | |
mattcaldwell/django-storages-py3 | refs/heads/py3 | examples/cloudfiles_project/photos/__init__.py | 12133432 | |
Esri/hermes | refs/heads/master | setup.py | 1 | from setuptools import setup,find_packages
with open('src/hermes/version.py') as fin: exec(fin.read())
setup(
name='esri-hermes',
version=__version__,
package_dir={'':'src'},
packages=find_packages('src'),
include_package_data=True,
# PyPI MetaData
author='achapkowski',
author_email... |
viarr/eve-wspace | refs/heads/develop | evewspace/Jabber/management/commands/ejabberd_auth_bridge.py | 14 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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... |
vainotuisk/icecreamratings | refs/heads/master | ENV/lib/python2.7/site-packages/wheel/test/test_tagopt.py | 236 | """
Tests for the bdist_wheel tag options (--python-tag and --universal)
"""
import sys
import shutil
import pytest
import py.path
import tempfile
import subprocess
SETUP_PY = """\
from setuptools import setup
setup(
name="Test",
version="1.0",
author_email="author@example.com",
py_modules=["test"],
... |
detiber/ansible | refs/heads/devel | contrib/inventory/jail.py | 79 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# 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 o... |
lukw00/powerline | refs/heads/develop | powerline/lib/watcher/__init__.py | 38 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
from powerline.lib.watcher.stat import StatFileWatcher
from powerline.lib.watcher.inotify import INotifyFileWatcher
from powerline.lib.watcher.tree import TreeWatcher
from powerline.lib.watche... |
iuliat/nova | refs/heads/master | nova/api/openstack/compute/plugins/v3/virtual_interfaces.py | 6 | # 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 ... |
soarpenguin/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_bfd_view.py | 7 | #!/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... |
bonewell/sdl_core | refs/heads/master | tools/InterfaceGenerator/generator/parsers/SDLRPCV1.py | 14 | """SDLRPCV1 parser.
Contains parser for SDLRPCV1 XML format.
"""
from generator.parsers import RPCBase
class Parser(RPCBase.Parser):
"""SDLRPCV1 parser."""
pass
|
jiffyjeff/mongrel2 | refs/heads/master | examples/ws/python/echo.py | 55 | import simplejson as json
from mongrel2 import handler
import wsutil
import sys
import time
import re
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9990",
"tcp://127.0.0.1:9989")
CONNECTION_TIMEOUT=5
closingMessages={}
badUnicode=... |
mhnatiuk/phd_sociology_of_religion | refs/heads/master | scrapper/lib/python2.7/site-packages/twisted/internet/stdio.py | 44 | # -*- test-case-name: twisted.test.test_stdio -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Standard input/out/err support.
This module exposes one name, StandardIO, which is a factory that takes an
IProtocol provider as an argument. It connects that protocol to standard input
and o... |
RuanJG/paparazzi | refs/heads/master | sw/lib/python/pprz_math/__init__.py | 79 | __all__ = ["geodetic", "algebra"]
|
nelango/ViralityAnalysis | refs/heads/master | model/lib/sklearn/utils/graph.py | 289 | """
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD 3 clause
impo... |
osbzr/gooderp_org | refs/heads/master | website_mail/models/mail_message.py | 264 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
DarrelHsu/cvsClient | refs/heads/master | third_party/pylint/pyreverse/utils.py | 30 | # Copyright (c) 2002-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... |
vladimiroff/humble-media | refs/heads/master | humblemedia/resources/migrations/0007_attachment_mime_type.py | 1 | # encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('resources', '0006_auto_20140426_1458'),
]
operations = [
migrations.AddField(
model_name='attachment',
name='mime_type',
field=models.Ch... |
vitalti/sapl | refs/heads/master | sapl/parlamentares/migrations/0009_auto_20170905_1617.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-09-05 16:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('parlamentares', '0008_adiciona_cargos_mesa'),
]
operations = [
migrations.AlterMode... |
webu/django-cms | refs/heads/develop | cms/south_migrations/0051_fix_content_type.py | 63 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
try:
# Let's fix the brokem page entry
ct = orm['cont... |
hiidef/hiispider | refs/heads/master | hiispider/sleep.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""An asynchronous implementation of time.sleep()"""
from twisted.internet.defer import Deferred
from twisted.internet import reactor
# FIXME: make this a function rather than a class
class Sleep(Deferred):
def __init__(self, timeout):
Deferred.__init__(self... |
dfang/odoo | refs/heads/10.0 | addons/sale_timesheet/models/product.py | 22 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
track_service = fields.Selection(selection_add=[
('timesheet', 'Timesheets on project'),
... |
JackDandy/SickGear | refs/heads/master | lib/tornado_py2/tcpclient.py | 2 | #
# Copyright 2014 Facebook
#
# 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, s... |
janchorowski/fuel | refs/heads/master | fuel/converters/iris.py | 18 | import os
import h5py
import numpy
from fuel.converters.base import fill_hdf5_file
def convert_iris(directory, output_directory, output_filename='iris.hdf5'):
"""Convert the Iris dataset to HDF5.
Converts the Iris dataset to an HDF5 dataset compatible with
:class:`fuel.datasets.Iris`. The converted dat... |
bowlofstew/Impala | refs/heads/cdh5-trunk | thirdparty/gtest-1.6.0/test/gtest_output_test.py | 1733 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/juicenet/switch.py | 14 | """Support for monitoring juicenet/juicepoint/juicebox based EVSE switches."""
from homeassistant.components.switch import SwitchEntity
from .const import DOMAIN, JUICENET_API, JUICENET_COORDINATOR
from .entity import JuiceNetDevice
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up t... |
PandaWei/tp-libvirt | refs/heads/master | libvirt/tests/src/virsh_cmd/domain/virsh_desc.py | 8 | import logging
import os
from autotest.client.shared import error
from virttest import virsh
def run(test, params, env):
"""
Test command: virsh desc.
This command allows to show or modify description or title of a domain.
1). For running domain, get/set description&title with options.
2). For sh... |
karwa/swift | refs/heads/master | utils/cmpcodesize/tests/__init__.py | 65 | # cmpcodesize/tests/__init__.py - Unit tests for cmpcodesize -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt f... |
adamlwgriffiths/Pyglet | refs/heads/master | tests/image/BMP_RGB_32BPP_LOAD.py | 29 | #!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_32bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... |
luzfcb/luzfcb_dj_simplelock | refs/heads/master | luzfcb_dj_simplelock/forms.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
# TODO: Incluir geracao do hash para verificacao se pode ou nao revalidar o bloqueio
class DeleteForm(forms.Form):
def __init__(self, id_obj=None, *args, **kwargs):
self._id = id_obj
super(DeleteForm, self)... |
BhavyaLight/kaggle-predicting-Red-Hat-Business-Value | refs/heads/master | Initial_Classification_Models/Ensemble/VotingClassifier.py | 1 | import pandas as pd
from Classification import Utility
# test_dataset = Utility.loadModel("../Final/test_randomforest")
# test_dataset.set_index(["activity_id"]).drop('act_0')
test_dataset = pd.read_csv("../../Data/Outputs/Best/randomForest500Model_new.csv")
test_dataset = test_dataset[["activity_id", "outcome"]]
test... |
CompMusic/essentia | refs/heads/master | src/examples/python/experimental/beatogram.py | 10 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... |
jvkops/django | refs/heads/master | tests/version/__init__.py | 12133432 | |
xadahiya/django | refs/heads/master | django/contrib/messages/apps.py | 591 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class MessagesConfig(AppConfig):
name = 'django.contrib.messages'
verbose_name = _("Messages")
|
JohanSJA/Qian | refs/heads/master | qian/qian/urls.py | 1 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'base.views.home', name='home'),
url(r"^users/", include("users.urls")),
url(r'^stocks/', include('stocks... |
codepantry/django | refs/heads/master | tests/validation/test_picklable.py | 576 | import pickle
from unittest import TestCase
from django.core.exceptions import ValidationError
class PickableValidationErrorTestCase(TestCase):
def test_validationerror_is_picklable(self):
original = ValidationError('a', code='something')
unpickled = pickle.loads(pickle.dumps(original))
... |
mglukhikh/intellij-community | refs/heads/master | python/testData/inspections/PyProtectedMemberInspection/ImportFromTheSamePackage/my_package/_package_internal_module.py | 39 | def very_smart_func(param):
return None |
Tikitaco/centinel-iclab | refs/heads/master | centinel/client_config.py | 1 | import ConfigParser
import os
from utils.colors import bcolors
class client_conf:
c = { 'server_address' : "24.189.208.220",
'server_port' : "8082",
'centinel_homedir' : os.path.dirname(__file__),
'experiment_data_dir' : os.path.join(os.path.dirname(__file__), "experiment_data"),
'experiments... |
camptocamp/odoo | refs/heads/master | addons/website_twitter/controllers/__init__.py | 7372 | import main
|
aequitas/home-assistant | refs/heads/dev | homeassistant/components/aruba/device_tracker.py | 7 | """Support for Aruba Access Points."""
import logging
import re
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
_LOGG... |
flashvnn/PopclipInstantTranslate | refs/heads/master | src/InstantTranslate.popclipext/requests/packages/chardet/euckrfreq.py | 3120 | ######################## 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... |
bboozzoo/jhbuild | refs/heads/master | scripts/hg-update.py | 2 | #! /usr/bin/env python2
#
# hg-update - pull and update a mercurial repository
#
# Copyright (C) 2007 Marco Barisione <marco@barisione.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 Foundation; eit... |
befelix/scipy | refs/heads/master | scipy/sparse/linalg/eigen/arpack/__init__.py | 159 | """
Eigenvalue solver using iterative methods.
Find k eigenvectors and eigenvalues of a matrix A using the
Arnoldi/Lanczos iterative methods from ARPACK [1]_,[2]_.
These methods are most useful for large sparse matrices.
- eigs(A,k)
- eigsh(A,k)
References
----------
.. [1] ARPACK Software, http://www.caam.rice... |
OSSESAC/odoopubarquiluz | refs/heads/7.0 | openerp/tests/addons/test_impex/tests/test_import.py | 98 | # -*- coding: utf-8 -*-
import openerp.modules.registry
import openerp
from openerp.tests import common
from openerp.tools.misc import mute_logger
def ok(n):
""" Successful import of ``n`` records
:param int n: number of records which should have been imported
"""
return n, 0, 0, 0
def error(row, me... |
jballanc/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/src/omero/util/goodeval.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def goodeval(fn, fnList, *args):
if(fn in fnList):
callFn = fn+'(';
for argCnt in range(0,len(args)):
callFn = callFn+str(args[argCnt])
if(argCnt<len(args)-1):
callFn = callFn+',';
callFn = callFn+')';
print callFn
exec(callFn);
|
polimediaupv/edx-platform | refs/heads/master | common/test/acceptance/accessibility/test_studio_library_axs.py | 71 | """
Accessibility tests for Studio Library pages.
Run just this test with:
SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_studio_library_axs.py
"""
from ..tests.studio.base_studio_test import StudioLibraryTest
from ..pages.studio.library import LibraryEditPage
class StudioLibraryAxsTest(Studi... |
ryyan/thrift-benchmark | refs/heads/master | py/server.py | 1 | from thriftpy import load
from thriftpy.rpc import make_server
from thriftpy.transport import TFramedTransportFactory
echo_thrift = load("/app/sh/echo.thrift", module_name="echo_thrift")
class echoHandler(object):
def echo(self, msg):
return msg.text
make_server(service=echo_thrift.Echo, handler=echoHan... |
dxl0632/deeplearning_nd_udacity | refs/heads/master | language-translation/helper.py | 156 | import os
import pickle
import copy
import numpy as np
CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 }
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, 'r', encoding='utf-8') as f:
return f.read()
def preprocess_and_save... |
leiferikb/bitpop | refs/heads/master | src/native_client/run.py | 5 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client 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 argparse
import os
import subprocess
import sys
import tempfile
import pynacl.platform
# Target architecture for PNaCl ca... |
gold3bear/swift | refs/heads/master | test/unit/common/test_base_storage_server.py | 26 | # Copyright (c) 2010-2015 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 agree... |
mjtamlyn/django | refs/heads/master | tests/migrations/migrations_test_apps/lookuperror_c/migrations/0002_c2.py | 133 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_a', '0002_a2'),
('lookuperror_c', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='C2',
fields=[
('id', models.Aut... |
dvro/sf-open-data-analysis | refs/heads/master | app/core/clustering.py | 1 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import cluster
from sklearn.neighbors import kneighbors_graph
def perform_clustering(algorithm, n_clusters, X):
print algorithm
if algorithm == 'MiniBatchKMeans':
model = cluster.MiniBatchKMeans(n_clusters=n_cluster... |
sanjuro/RCJK | refs/heads/master | vendor/django/contrib/gis/tests/test_spatialrefsys.py | 9 | import unittest
from django.contrib.gis.db.backend import SpatialBackend
from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
if not mysql:
from django.contrib.gis.models import SpatialRefSys
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'aut... |
surligas/cs436-gnuradio | refs/heads/master | gr-blocks/python/blocks/qa_vector_insert.py | 20 | #!/usr/bin/env python
#
# Copyright 2012-2013 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 optio... |
randomtask1155/gpdb | refs/heads/master | gpMgmt/sbin/gpsetdbid.py | 45 | #!/usr/bin/env python
'''
Copyright (c) Greenplum Inc 2010. All Rights Reserved.
This is a private script called by the Greenplum Management scripts.
With the script you can create the gp_dbid file within a segment's data
directory.
This script does NOT modify the configuration information stored within
the databas... |
paalge/scikit-image | refs/heads/master | doc/examples/transform/plot_pyramid.py | 3 | """
====================
Build image pyramids
====================
The ``pyramid_gaussian`` function takes an image and yields successive images
shrunk by a constant scale factor. Image pyramids are often used, e.g., to
implement algorithms for denoising, texture discrimination, and scale-
invariant detection.
"""
im... |
mbayon/TFG-MachineLearning | refs/heads/master | venv/lib/python3.6/site-packages/django/core/cache/utils.py | 585 | from __future__ import unicode_literals
import hashlib
from django.utils.encoding import force_bytes
from django.utils.http import urlquote
TEMPLATE_FRAGMENT_KEY_TEMPLATE = 'template.cache.%s.%s'
def make_template_fragment_key(fragment_name, vary_on=None):
if vary_on is None:
vary_on = ()
key = ':'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.