repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
alirizakeles/zato | refs/heads/dsuch-f-gh723-add-exe-agent | code/zato-common/test/__init__.py | 12133432 | |
figarocorso/mss | refs/heads/master | mss/www/cpserver/management/__init__.py | 12133432 | |
maryklayne/Funcao | refs/heads/master | sympy/mpmath/libmp/libmpf.py | 23 | """
Low-level functions for arbitrary-precision floating-point arithmetic.
"""
__docformat__ = 'plaintext'
import math
from bisect import bisect
import sys
# Importing random is slow
#from random import getrandbits
getrandbits = None
from .backend import (MPZ, MPZ_TYPE, MPZ_ZERO, MPZ_ONE, MPZ_TWO, MPZ_FIVE,
B... |
denis-pitul/django | refs/heads/master | tests/messages_tests/test_mixins.py | 281 | from django.core.urlresolvers import reverse
from django.test import SimpleTestCase, override_settings
from .urls import ContactFormViewWithMsg
@override_settings(ROOT_URLCONF='messages_tests.urls')
class SuccessMessageMixinTests(SimpleTestCase):
def test_set_messages_success(self):
author = {'name': 'J... |
crcresearch/osf.io | refs/heads/develop | addons/dataverse/tests/test_client.py | 24 | import mock
from nose.tools import (
assert_equal, assert_raises, assert_true,
assert_false, assert_in, assert_is, assert_is_none
)
import pytest
import unittest
from dataverse import Connection, Dataverse, DataverseFile, Dataset
from dataverse.exceptions import UnauthorizedError
from addons.dataverse.models ... |
apache/libcloud | refs/heads/trunk | libcloud/compute/drivers/oneandone.py | 7 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
gautam1858/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/string_length_op_test.py | 22 | # 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... |
wger-project/wger | refs/heads/master | wger/gallery/api/serializers.py | 1 | # Third Party
from rest_framework import serializers
# wger
from wger.gallery.models import Image
class ImageSerializer(serializers.ModelSerializer):
"""
Exercise serializer
"""
class Meta:
model = Image
fields = [
'id',
'date',
'image',
... |
swpowell/raintype_python | refs/heads/master | uw_raintype/__init__.py | 1 | # =============================
"""
UW - Rain Type - Python Package that contains functions needed for UW rain
type classification based on Powell et al. (2016, JTECH)
==================================
Top-level package (:mod:`uw_raintype`)
==================================
.. currentmodule:: uw_raintype
"""
|
wilkeraziz/pcfg-sampling | refs/heads/master | generalisedSampling.py | 1 | """
:Authors: - Iason
"""
from symbol import is_nonterminal
import random
import numpy as np
class GeneralisedSampling(object):
def __init__(self, forest, inside_node, omega=lambda edge: edge.log_prob):
"""
:param forest: an acyclic hypergraph
:param inside_node: a dictionary mapping no... |
JSchwerberg/review | refs/heads/master | vagrant_resources/cookbooks/python/files/default/get-pip.py | 2 | null |
40223202/2015cdb_g2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_functools.py | 727 | def partial(func, *args, **keywords):
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
return func(*(args + fargs), **newkeywords)
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
return newfunc
def reduce(func,... |
leowucom/captain | refs/heads/master | src/learn_english/model/utility.py | 2 | # -*- coding:utf-8 -*-
"""
utility function
"""
import platform
import os
import re
import json
import sys
import urllib2
import datetime
import bs4
import requests
from nltk.stem import WordNetLemmatizer
import constants
from datetime import date
import calendar
reload(sys)
sys.setdefaultencoding('utf-8')
REVEAL_ORI... |
skylines-project/skylines | refs/heads/master | migrations/versions/2dade673f10e_add_qnh_column_to_flight.py | 1 | # revision identifiers, used by Alembic.
revision = "2dade673f10e"
down_revision = "1d8eda758ba6"
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column("flights", sa.Column("qnh", sa.Float(), nullable=True))
### end Alembic... |
ninapavlich/caledon | refs/heads/master | celadon/apps/media/migrations/0001_initial.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import imagekit_cropper.fields
import celadon.s3utils
import carbon.atoms.models.media
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = ... |
frishberg/django | refs/heads/master | tests/migrations/test_add_many_to_many_field_initial/0002_initial.py | 65 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.AddField(
model_name='task',
name='projects',
... |
ssorgatem/pulsar | refs/heads/master | pulsar/web/__init__.py | 4 | """ The code explicitly related to the Pulsar web server can be found in this
module and its submodules.
"""
|
edivancamargo/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/api/__init__.py | 174 | import os
import bpy
from . import object as object_, mesh, material, camera, light
from .. import logger
def active_object():
"""
:return: The actively selected object
"""
return bpy.context.scene.objects.active
def batch_mode():
"""
:return: Whether or not the session is interactive
... |
mmclenna/engine | refs/heads/master | build/android/pylib/remote/__init__.py | 1201 | # Copyright 2014 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.
|
Belxjander/Kirito | refs/heads/master | Python-3.5.0-main/Lib/distutils/text_file.py | 16 | """text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
import sys, os, io
class TextFile:
"""Provides a file-like object that takes care of all the things you
commonl... |
wzairix/parameter-framework | refs/heads/master | test/functional-tests-legacy/PfwTestCase/Types/tEnum.py | 10 | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... |
ericzundel/pants | refs/heads/master | src/python/pants/engine/legacy/graph.py | 1 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from... |
drabastomek/learningPySpark | refs/heads/master | Chapter11/additionalCode/utilities/__init__.py | 1 | from .geoCalc import geoCalc
__all__ = ['geoCalc','converters'] |
moio/spacewalk | refs/heads/master | java/scripts/api/usertests.py | 11 | #!/usr/bin/python
import xmlrpclib
import unittest
from config import *
from random import randint
class UserTests(RhnTestCase):
def setUp(self):
RhnTestCase.setUp(self)
self.test_user = "TestUser%s" % randint(1, 1000000)
client.user.create(self.session_key, self.test_user, "testpassword... |
Ecotrust-Canada/terratruth | refs/heads/master | django_app/registration/management/commands/cleanupregistration.py | 232 | """
A management command which deletes expired accounts (e.g.,
accounts which signed up but never activated) from the database.
Calls ``RegistrationProfile.objects.delete_expired_users()``, which
contains the actual logic for determining which accounts are deleted.
"""
from django.core.management.base import NoArgsC... |
IDSIA/sacred | refs/heads/master | tests/test_experiment.py | 1 | #!/usr/bin/env python
# coding=utf-8
from sacred import Ingredient
"""Global Docstring"""
from mock import patch
import pytest
import sys
from sacred import cli_option
from sacred import host_info_gatherer
from sacred.experiment import Experiment
from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedE... |
jeandet/meson | refs/heads/master | mesonbuild/modules/windows.py | 1 | # Copyright 2015 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to ... |
kennedyshead/home-assistant | refs/heads/dev | homeassistant/components/blebox/switch.py | 21 | """BleBox switch implementation."""
from homeassistant.components.switch import SwitchEntity
from . import BleBoxEntity, create_blebox_entities
from .const import BLEBOX_TO_HASS_DEVICE_CLASSES
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a BleBox switch entity."""
create_ble... |
javierTerry/odoo | refs/heads/8.0 | openerp/addons/test_uninstall/__openerp__.py | 435 | # -*- coding: utf-8 -*-
{
'name': 'test-uninstall',
'version': '0.1',
'category': 'Tests',
'description': """A module to test the uninstall feature.""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': ['ir.model.ac... |
SEL-Columbia/commcare-hq | refs/heads/master | corehq/apps/reports/commtrack/data_sources.py | 1 | from dimagi.utils.couch.database import iter_docs
from dimagi.utils.decorators.memoized import memoized
from corehq.apps.locations.models import Location
from corehq.apps.commtrack.models import Product, SupplyPointCase, StockState
from corehq.apps.domain.models import Domain
from dimagi.utils.couch.loosechange import ... |
eudicots/Cactus | refs/heads/master | cactus/i18n/commands.py | 2 | #coding:utf-8
from django.core.management.commands.makemessages import Command as MakeMessagesCommand
from django.core.management.commands.compilemessages import Command as CompileMessagesCommand
from cactus.utils.filesystem import chdir
DEFAULT_COMMAND_KWARGS = {
# Command Options
"verbosity": 3,
"setti... |
mxOBS/deb-pkg_trusty_chromium-browser | refs/heads/master | third_party/cython/src/Cython/Compiler/Tests/TestParseTreeTransforms.py | 89 | import os
from Cython.Compiler import CmdLine
from Cython.TestUtils import TransformTest
from Cython.Compiler.ParseTreeTransforms import *
from Cython.Compiler.Nodes import *
from Cython.Compiler import Main, Symtab
class TestNormalizeTree(TransformTest):
def test_parserbehaviour_is_what_we_coded_for(self):
... |
Simplistix/testfixtures | refs/heads/master | testfixtures/tests/test_sequencecomparison.py | 1 | from testfixtures import SequenceComparison, generator, compare, Subset, Permutation
class TestSequenceComparison(object):
def test_repr(self):
compare(repr(SequenceComparison(1, 2, 3)),
expected='<SequenceComparison(ordered=True, partial=False)>1, 2, 3</>')
def test_repr_long(self):... |
andresgz/django | refs/heads/master | tests/gis_tests/relatedapp/tests.py | 39 | from __future__ import unicode_literals
from django.contrib.gis.db.models import F, Collect, Count, Extent, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point
from django.db import connection
from django.test import TestCase, skipUnlessDBF... |
fuzzy-io/python | refs/heads/master | fuzzyai/__init__.py | 12133432 | |
awatts/boto | refs/heads/develop | boto/pyami/launch_ami.py | 153 | #!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 rig... |
gchp/django | refs/heads/master | django/contrib/sitemaps/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class SiteMapsConfig(AppConfig):
name = 'django.contrib.sitemaps'
verbose_name = _("Site Maps")
|
agiledata/python-gpiozero | refs/heads/master | gpiozero/input_devices.py | 1 | from __future__ import division
from time import sleep, time
from threading import Event
from collections import deque
from RPi import GPIO
from w1thermsensor import W1ThermSensor
from .devices import GPIODeviceError, GPIODevice, GPIOThread
class InputDeviceError(GPIODeviceError):
pass
class InputDevice(GPIO... |
Gillu13/scipy | refs/heads/master | doc/source/tutorial/stats/plots/kde_plot3.py | 132 | import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
np.random.seed(12456)
x1 = np.random.normal(size=200) # random data, normal distribution
xs = np.linspace(x1.min()-1, x1.max()+1, 200)
kde1 = stats.gaussian_kde(x1)
kde2 = stats.gaussian_kde(x1, bw_method='silverman')
fig = plt.figure(figsi... |
tastynoodle/django | refs/heads/master | django/db/models/fields/subclassing.py | 81 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
"""
class SubfieldBase(type):
"""
A metaclass... |
adaussy/eclipse-monkey-revival | refs/heads/master | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/bugs/pr191.py | 31 | # PR#191 instances of Java classes missing __class__ attribute
import java.lang.String
s = java.lang.String('s')
s.__class__
|
grakiss888/testapi | refs/heads/master | opnfv_testapi/tests/unit/conftest.py | 1 | from os import path
import pytest
@pytest.fixture
def config_normal():
return path.join(path.dirname(__file__), 'common/normal.ini')
|
onoga/wm | refs/heads/master | src/gnue/__init__.py | 2 | # GNU Enterprise Common Library - Base Module
#
# Copyright 2001-2006 Free Software Foundation
#
# This file is part of GNU Enterprise
#
# GNU Enterprise 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
... |
denisff/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/difflib.py | 50 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... |
vertexproject/synapse | refs/heads/master | synapse/tests/test_cmds_cron.py | 1 | import asyncio
import logging
import datetime
from datetime import timezone as tz
from unittest import mock
import synapse.lib.cmdr as s_cmdr
import synapse.lib.provenance as s_provenance
import synapse.tests.utils as s_t_utils
MINSECS = 60
HOURSECS = 60 * MINSECS
DAYSECS = 24 * HOURSECS
logger = logging.getLogger(... |
stanlyxiang/incubator-hawq | refs/heads/master | tools/bin/gppylib/gpcoverage.py | 12 | # 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... |
sanjeevtripurari/hue | refs/heads/master | desktop/core/src/desktop/tests.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (... |
SNU-Sigma/rosbridge_suite | refs/heads/develop | rosbridge_library/src/rosbridge_library/capability.py | 12 | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, 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... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/choropleth/colorbar/title/font/_family.py | 1 | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="choropleth.colorbar.title.font",
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=pl... |
gjr80/weewx | refs/heads/master | bin/weewx/drivers/wmr100.py | 3 | #
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Classees and functions for interfacing with an Oregon Scientific WMR100
station. The WMRS200 reportedly works with this driver (NOT the WMR200, which
is a different beast).
The wind sensor reports ... |
ministryofjustice/PyGithub | refs/heads/master | github/tests/IssueEvent.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
AlexChernov/rdo_studio | refs/heads/dev | thirdparty/scintilla/qt/ScintillaEdit/WidgetGen.py | 6 | #!/usr/bin/env python
# WidgetGen.py - regenerate the ScintillaWidgetCpp.cpp and ScintillaWidgetCpp.h files
# Check that API includes all gtkscintilla2 functions
import sys
import os
import getopt
scintillaDirectory = "../.."
scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include")
sys.path.append(scin... |
feer56/Kitsune1 | refs/heads/master | migrations/159-topics-migration.py | 6 | from django.utils.encoding import smart_str
from taggit.models import Tag
from kitsune.wiki.models import Document
from migrations.models import Topic
tags_to_migrate = {
# '<source tag>': '<destination tag>',
'sync': 'sync',
'general': 'general',
'recovery-key': 'recovery-key',
'privacy-security'... |
maestrotf/pymepps-streaming | refs/heads/master | pymeppsstream/submodules/graphmanager.py | 1 | #!/bin/env python
# -*- coding: utf-8 -*-
#
# Created on 20.02.17
#
# Created for pymepps-streaming
#
# @author: Tobias Sebastian Finn, tobias.sebastian.finn@studium.uni-hamburg.de
#
# Copyright (C) {2017} {Tobias Sebastian Finn}
#
# This program is free software: you can redistribute it and/or modify
# it... |
40223234/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_functools.py | 727 | def partial(func, *args, **keywords):
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
return func(*(args + fargs), **newkeywords)
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
return newfunc
def reduce(func,... |
lmtim/sample-code | refs/heads/master | sample-code/examples/python/android_simple.py | 36 | import os
from time import sleep
import unittest
from appium import webdriver
# Returns abs path relative to this file and not cwd
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
)
class SimpleAndroidTests(unittest.TestCase):
def setUp(self):
desired_caps = {}
de... |
garciasolero/oauthlib | refs/heads/develop | oauthlib/oauth2/rfc6749/endpoints/authorization.py | 71 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import logging
from oauthlib.common import Request
from .base import BaseEn... |
DavidNorman/tensorflow | refs/heads/master | tensorflow/python/tools/strip_unused_lib.py | 23 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
ArthurGarnier/SickRage | refs/heads/master | lib/rtorrent/tracker.py | 173 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... |
GabrielBrascher/cloudstack | refs/heads/master | test/integration/smoke/test_portable_publicip.py | 6 | #!/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
# "Li... |
tdtrask/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_user_role.py | 25 | #!/usr/bin/python
# Copyright (c) 2016 IBM
# 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'],
... |
defance/edx-platform | refs/heads/master | common/djangoapps/heartbeat/views.py | 199 | from xmodule.modulestore.django import modulestore
from dogapi import dog_stats_api
from util.json_request import JsonResponse
from django.db import connection
from django.db.utils import DatabaseError
from xmodule.exceptions import HeartbeatFailure
@dog_stats_api.timed('edxapp.heartbeat')
def heartbeat(request):
... |
bregman-arie/ansible | refs/heads/devel | lib/ansible/modules/network/panos/panos_interface.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... |
zerkrx/zerkbox | refs/heads/develop | lib/youtube_dl/extractor/dreisat.py | 40 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
xpath_text,
determine_ext,
qualities,
float_or_none,
ExtractorError,
)
class DreiSatIE(InfoExtractor):
IE_NAME = '3sat'
_VALID_URL = r'(?:https?... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2020_03_01/operations/_iot_hub_resource_operations.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
postlund/home-assistant | refs/heads/dev | homeassistant/components/russound_rio/media_player.py | 2 | """Support for Russound multizone controllers using RIO Protocol."""
import logging
from russound_rio import Russound
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPOR... |
Matrixeigs/Optimization | refs/heads/master | energy_hub/bidding_strategy/__init__.py | 1 | """
The bidding strategy strategy for energy hubs
This function is to provide
1) a deterministic day-ahead bidding strategy for hybrid AC/DC multiple micro-grids
2) a stochstic bidding strategy
3) start-up and shut-down of resources
4) decomposition algorithm, Benders decomposition
"""
import sys
sys.path.append('/home... |
songfj/calibre | refs/heads/master | src/cherrypy/wsgiserver/__init__.py | 238 | __all__ = ['HTTPRequest', 'HTTPConnection', 'HTTPServer',
'SizeCheckWrapper', 'KnownLengthRFile', 'ChunkedRFile',
'MaxSizeExceeded', 'NoSSLError', 'FatalSSLAlert',
'WorkerThread', 'ThreadPool', 'SSLAdapter',
'CherryPyWSGIServer',
'Gateway', 'WSGIGateway', 'WSGIGate... |
shenlong3030/asv-django-guestbook | refs/heads/master | djangoappengine/main/main.py | 11 | import os
import sys
# Add parent folder to sys.path, so we can import boot.
# App Engine causes main.py to be reloaded if an exception gets raised
# on the first request of a main.py instance, so don't add project_dir multiple
# times.
project_dir = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirna... |
openstack/oslo.vmware | refs/heads/master | oslo_vmware/tests/test_rw_handles.py | 1 | # Copyright (c) 2014 VMware, 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... |
hydrospanner/DForurm | refs/heads/master | DForurm/env/Lib/site-packages/django/contrib/admin/views/main.py | 49 | import sys
from collections import OrderedDict
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from djang... |
40223149/2015springcda | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/atexit.py | 743 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... |
GenericStudent/home-assistant | refs/heads/dev | tests/components/canary/conftest.py | 5 | """Define fixtures available for all tests."""
from canary.api import Api
from pytest import fixture
from tests.async_mock import MagicMock, patch
@fixture
def canary(hass):
"""Mock the CanaryApi for easier testing."""
with patch.object(Api, "login", return_value=True), patch(
"homeassistant.componen... |
bkjones/django-taxonomy | refs/heads/master | taxonomy/__init__.py | 1 | __author__ = 'Brian K. Jones'
__version__ = (0, 0, 1)
|
jeroenj/CouchPotatoServer | refs/heads/master | libs/oauthlib/oauth2/draft25/__init__.py | 112 | """
oauthlib.oauth2.draft_25
~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 2.0 draft 25 requests.
"""
class Client(object):
pass
class Server(object):
pass
|
inercia/evy | refs/heads/develop | tests/test_fork.py | 1 | #
# Evy - a concurrent networking library for Python
#
# Unless otherwise noted, the files in Evy are under the following MIT license:
#
# Copyright (c) 2012, Alvaro Saurin
# Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS)
# Copyright (c) 2007-2010, Linden Research, Inc.
# Copyright (c) 2005-2006, Bob Ippo... |
InfraBox/infrabox | refs/heads/master | src/api/settings.py | 1 | import os
from flask import jsonify
from flask_restplus import Resource
from pyinfraboxutils.ibrestplus import api
settings_ns = api.namespace('api/v1/settings',
description="Api settings")
@settings_ns.route('/')
class Settings(Resource):
def get(self):
github_enabled = os.environ['... |
ariel17/poppurri | refs/heads/master | poppurri/common/tests.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: TODO
"""
__author__ = "Ariel Gerardo Rios (ariel.gerardo.rios@gmail.com)"
from django.test import TestCase
# Create your tests here.
# vim: ai ts=4 sts=4 et sw=4 ft=python
|
si618/pi-time | refs/heads/master | node_modules/grunt-pylint/tasks/lib/pylint/test/functional/undefined_variable.py | 4 | """Test warnings about access to undefined variables."""
# pylint: disable=too-few-public-methods, no-init, no-self-use, old-style-class,print-statement
DEFINED = 1
if DEFINED != 1:
if DEFINED in (unknown, DEFINED): # [undefined-variable]
DEFINED += 1
def in_method(var):
"""method doc"""
var = ... |
jendap/tensorflow | refs/heads/master | tensorflow/python/training/training_ops_test.py | 21 | # 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... |
jrrembert/django | refs/heads/master | django/contrib/syndication/__init__.py | 808 | default_app_config = 'django.contrib.syndication.apps.SyndicationConfig'
|
tralamazza/micropython | refs/heads/master | tests/cpydiff/types_str_endswith.py | 30 | """
categories: Types,str
description: Start/end indices such as str.endswith(s, start) not implemented
cause: Unknown
workaround: Unknown
"""
print('abc'.endswith('c', 1))
|
ric2b/Vivaldi-browser | refs/heads/master | chromium/tools/binary_size/generate_official_build_report.py | 1 | #!/usr/bin/python
# 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.
"""Utilities for generating Supersize HTML Reports for official builds."""
import argparse
import json
import logging
import os
import re
... |
lukauskas/scipy | refs/heads/master | scipy/weave/setup.py | 76 | #!/usr/bin/env python
from __future__ import absolute_import, print_function
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('weave',parent_package,top_path)
config.add_data_dir('tests')
config.add... |
EduPepperPDTesting/pepper2013-testing | refs/heads/www0 | lms/djangoapps/courseware/tests/modulestore_config.py | 5 | """
Define test configuration for modulestores.
"""
from xmodule.modulestore.tests.django_utils import xml_store_config, \
mongo_store_config, draft_mongo_store_config,\
mixed_store_config
from django.conf import settings
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
TEST_DATA_XML_MODULESTORE = xml_store_co... |
deliveryhero/dhh-system-engineering | refs/heads/master | terraform/aws/modules/lambda_kubernetes_deployer/patch_deployment.py | 1 | # -*- coding: utf-8 -*-
"""
Kubernetes Deployment Patcher
=============================
Install requirements:
* `python3 -m venv pdep && source pdep/bin/activate`
* `pip install -r requirements.txt`
Required environment variables:
Name | Example
----------------------------| -------
AWS_ECR_... |
modeswitch/barrelfish | refs/heads/default | tools/harness/machines/eth.py | 6 | ##########################################################################
# Copyright (c) 2009-2011, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH... |
NERC-CEH/jules-jasmin | refs/heads/master | majic/joj/tests/functional/test_dap_client.py | 1 | """
# Majic
# Copyright (C) 2014 CEH
#
# 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 pr... |
brianwc/courtlistener | refs/heads/master | cl/celery.py | 3 | from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cl.settings')
from django.conf import settings
app = Celery('cl')
# Using a string here means the worker will not have to
# p... |
lxneng/incubator-airflow | refs/heads/master | tests/operators/test_email_operator.py | 18 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
chromium/chromium | refs/heads/master | third_party/chromevox/third_party/closure-library/closure/bin/build/source.py | 166 | # Copyright 2009 The Closure Library 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 a... |
jwlawson/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/monitors_test.py | 40 | # 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... |
tdtrask/ansible | refs/heads/devel | lib/ansible/plugins/action/ce_config.py | 89 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.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... |
eric-haibin-lin/mxnet | refs/heads/master | example/reinforcement-learning/parallel_actor_critic/config.py | 52 | # 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... |
YueLinHo/Subversion | refs/heads/master | tools/dev/mlpatch.py | 7 | #!/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
#... |
partofthething/home-assistant | refs/heads/dev | homeassistant/components/flunearyou/__init__.py | 4 | """The flunearyou component."""
import asyncio
from datetime import timedelta
from functools import partial
from pyflunearyou import Client
from pyflunearyou.errors import FluNearYouError
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.helpers import aiohttp_client, config_validation ... |
jonesgithub/zulip | refs/heads/master | zerver/management/commands/email-mirror.py | 115 | #!/usr/bin/python
"""
Forward messages sent to the configured email gateway to Zulip.
For zulip.com, messages to that address go to the Inbox of emailgateway@zulip.com.
Zulip voyager configurations will differ.
Messages meant for Zulip have a special recipient form of
<stream name>+<regenerable stream token>@st... |
sportarchive/CloudProcessingEngine-Decider | refs/heads/master | pydecider/plan.py | 1 | from __future__ import (
absolute_import,
division,
print_function
)
import logging
from .step import Step
from .activity import Activity
from .schema import SchemaValidator
_LOGGER = logging.getLogger(__name__)
class Plan(object):
"""Workflow plan.
"""
_DATA_SCHEMA = {
'$schema': ... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python3-alpha/python3-src/Lib/test/test_pkgimport.py | 57 | import os
import sys
import shutil
import string
import random
import tempfile
import unittest
from imp import cache_from_source
from test.support import run_unittest
class TestImport(unittest.TestCase):
def __init__(self, *args, **kw):
self.package_name = 'PACKAGE_'
while self.package_name in sy... |
IlyaDjurin/django-shop | refs/heads/master | orders/admin.py | 1 | from django.contrib import admin
from .models import Order, OrderItem
class OrderItemInline(admin.TabularInline):
model = OrderItem
raw_id_field = ['product']
class OrderAdmin(admin.ModelAdmin):
list_display = ['id', 'first_name', 'last_name', 'email', 'address',
'postal_code', 'city... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.