repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
sdague/home-assistant | homeassistant/components/tuya/__init__.py | """Support for Tuya Smart devices."""
import asyncio
from datetime import timedelta
import logging
from tuyaha import TuyaApi
from tuyaha.tuyaapi import (
TuyaAPIException,
TuyaFrequentlyInvokeException,
TuyaNetException,
TuyaServerException,
)
import voluptuous as vol
from homeassistant.config_entrie... |
dana-i2cat/felix | ofam/src/src/foam/sfa/methods/RenewSliver.py | import datetime
from foam.sfa.util.faults import InsufficientRights
from foam.sfa.util.xrn import urn_to_hrn
from foam.sfa.util.method import Method
from foam.sfa.util.foam.sfa.ime import utcparse
from foam.sfa.trust.credential import Credential
from foam.sfa.util.parameter import Parameter
class RenewSliver(Method... |
Alex-Chizhov/python_training | home_work_7/fixture/application.py | from selenium.webdriver.firefox.webdriver import WebDriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self):
self.wd = WebDriver()
self.wd.implicitly_wait(60)
self.session = SessionHelper(self)
self... |
stafur/pyTRUST | trustplus-python/setup.py | from setuptools import setup, find_packages
setup(
name='bitcoin-python',
version='0.3',
description='Friendly Bitcoin JSON-RPC API binding for Python',
long_description='This package allows performing commands such as listing the current balance'
' and sending coins to the Satoshi (original) client... |
tuxology/bcc | examples/tracing/urandomread-explicit.py | #!/usr/bin/python
#
# urandomread-explicit Example of instrumenting a kernel tracepoint.
# For Linux, uses BCC, BPF. Embedded C.
#
# This is an older example of instrumenting a tracepoint, which defines
# the argument struct and makes an explicit call to attach_tracepoint().
# See urandomread for... |
kennedyshead/home-assistant | homeassistant/components/bme280/sensor.py | """Support for BME280 temperature, humidity and pressure sensor."""
from contextlib import suppress
from datetime import timedelta
from functools import partial
import logging
from i2csense.bme280 import BME280 # pylint: disable=import-error
import smbus
import voluptuous as vol
from homeassistant.components.sensor ... |
quom/google-cloud-python | speech/unit_tests/_fixtures.py | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
KaranToor/MA450 | google-cloud-sdk/lib/surface/kms/keyrings/get_iam_policy.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 ag... |
Peddle/hue | desktop/libs/metadata/src/metadata/navigator_client.py | #!/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 (th... |
cpcloud/arrow | python/pyarrow/tests/test_convert_builtin.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... |
mcdeoliveira/ctrl | test/test_ctrl.py | import pytest
import time
HOST, PORT = "localhost", 9998
start_server = True
#start_server = False
from pyctrl import BlockType
import pyctrl.client as clnt
def _test_basic(controller):
import pyctrl
import numpy
import pyctrl.block as block
import pyctrl.block.system as system
import pyctrl.blo... |
danvk/oldnyc | nyc/find-missing-geocodes.py | #!/usr/bin/python
"""Find common locations which weren't successfully geocoded."""
import json
import sys
import random
from collections import defaultdict
records = json.load(file(sys.argv[1]))
location_to_urls = defaultdict(list)
for rec in records:
# Find records with 'folder', without 'extracted.latlon'
if ... |
donspaulding/adspygoogle | examples/adspygoogle/dfp/v201302/get_forecast.py | #!/usr/bin/python
#
# Copyright 2013 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 b... |
movmov/cc | vendor/Twisted-10.0.0/doc/core/howto/listings/pb/cache_classes.py | #!/usr/bin/env python
# Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.spread import pb
class MasterDuckPond(pb.Cacheable):
def __init__(self, ducks):
self.observers = []
self.ducks = ducks
def count(self):
print "I have [%d] ducks" % len(self.... |
runtimejs/runtime | deps/v8/test/simdjs/testcfg.py | # Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import sys
from testrunner.local import testsuite
from testrunner.objects import testcase
SIMDJS_SUITE_PATH = ["data", "src"]
... |
bigfootproject/sahara | sahara/service/heat/templates.py | # Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
joopert/home-assistant | tests/components/usgs_earthquakes_feed/test_geo_location.py | """The tests for the USGS Earthquake Hazards Program Feed platform."""
import datetime
from unittest.mock import patch, MagicMock, call
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.usgs_earthquakes_feed.geo_location import... |
mendax-grip/ccw_tutorial_theano | ipnb/02_vector_mat_soln.py | import numpy as np
from theano import function
import theano.tensor as T
def make_vector():
"""
Returns a new Theano vector.
"""
return T.vector()
def make_matrix():
"""
Returns a new Theano matrix.
"""
return T.matrix()
def elemwise_mul(a, b):
"""
a: A theano matrix
... |
epiqc/ScaffCC | rkqc/tools/gui/ui/AddingLines.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AddingLines.ui'
#
# Created: Wed May 4 11:00:30 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... |
SCOREC/core | parma/extractParmaResults.py | #!/usr/bin/python
import sys
import re
import matplotlib.pyplot as plt
if len(sys.argv) is not 2:
print 'Usage:', sys.argv[0], '<parma log file>'
sys.exit()
parmaLogName = sys.argv[1]
infile = open(parmaLogName)
class base(): pass #HACCCCCCCKKKKK
metrics = []
terms = []
class metric():
def __init__(self,name... |
nicproulx/mne-python | tutorials/plot_configuration.py | # -*- coding: utf-8 -*-
"""
========================================
Background information on configurations
========================================
This tutorial gives a short introduction to MNE configurations.
"""
import os.path as op
import mne
from mne.datasets.sample import data_path
fname = op.join(data_pat... |
jsma/django-cms | cms/migrations/0010_migrate_use_structure.py | # -*- coding: utf-8 -*-
import warnings
from django.conf import settings
from django.db import models, migrations
def forwards(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
Permission = apps.get_model('auth', 'Permission')
Group = apps.get_model('auth', 'Group')
use... |
trac-ja/trac-ja | trac/versioncontrol/web_ui/util.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005-2007 Christian Boos <cboos@edgewall.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as pa... |
disqus/django-old | django/utils/html.py | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
from django.utils.text import normalize_newlines
# Config... |
sfpprxy/py-reminder | libs/tests/sqla/test_basic.py | from nose.tools import eq_, ok_, raises, assert_true
from wtforms import fields, validators
from flask_admin import form
from flask_admin._compat import as_unicode
from flask_admin._compat import iteritems
from flask_admin.contrib.sqla import ModelView, filters
from flask_babelex import Babel
from sqlalchemy.ext.hyb... |
jonathanverner/brython | www/src/Lib/_sre.py | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... |
mblondel/scikit-learn | sklearn/preprocessing/label.py | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... |
codenote/chromium-test | tools/telemetry/telemetry/page/actions/scroll_unittest.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
from telemetry.page import page as page_module
from telemetry.page.actions import scroll
from telemetry.test import tab_test_case
class Scroll... |
toontownfunserver/Panda3D-1.9.0 | samples/Texture-Swapping/Tut-Texture-Swapping.py | # Author: Shao Zhang and Phil Saltzman
# Last Updated: 4/18/2005
#
# This tutorial shows how to use a sequence of textures on an object to
# achieve a specific effect. Popular uses of this technique are:
# -Animated sprites
# -Moving shadows
#
# This tutorial also demonstrates the billboard function which orients
# an ... |
alex/raven | tests/contrib/zerorpc/tests.py | import gevent
import os
import random
import shutil
import tempfile
import unittest2
import zerorpc
from raven.base import Client
from raven.contrib.zerorpc import SentryMiddleware
class TempStoreClient(Client):
def __init__(self, servers=None, **kwargs):
self.events = []
super(TempStoreClient, s... |
janez-svetin/resrc | resrc/list/urls.py | # -*- coding: utf-8 -*-:
from django.conf.urls import patterns, url
import views
urlpatterns = patterns(
'',
url(r'^$', views.lists_page, name="lists"),
url(r'^(?P<list_pk>\d+)/$', views.single, name="list-single"),
url(r'^(?P<list_pk>\d+)/upvote$', views.ajax_upvote_list, name="list-upvote"),
url... |
meejah/txaio | txaio/testutil.py | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
jawilson/Flexget | flexget/plugin.py | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.error import HTTPError, URLError
from future.utils import python_2_unicode_compatible
import logging
import os
import re
import time
import warning... |
eltonsantos/quokka | wsgi.py | # -*- coding: utf-8 -*-
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from quokka import create_app, create_api
application = DispatcherMiddleware(create_app(), {
'/api': create_api()
})
if __name__ == "__main__":
run_simple(
'0.0.0.0',
5000,
... |
andydandy74/ClockworkForDynamo | nodes/2.x/python/Element.DependentElements.py | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from Revi... |
DataDog/gunicorn | tests/t.py | # -*- coding: utf-8 -
# Copyright 2009 Paul J. Davis <paul.joseph.davis@gmail.com>
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import array
import os
import tempfile
dirname = os.path.dirname(__file__)
from gunicorn.http.parser import RequestParser
from gu... |
justyns/home-assistant | homeassistant/components/browser.py | """
Provides functionality to launch a web browser on the host machine.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/browser/
"""
DOMAIN = "browser"
SERVICE_BROWSE_URL = "browse_url"
def setup(hass, config):
"""Listen for browse_url events."""
... |
valhallasw/pywikibot-core | scripts/imageuncat.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Program to add uncat template to images without categories at commons.
See imagerecat.py (still working on that one) to add these images to categories.
This script is working on the given site, so if the commons should be handled,
the site commons should be given and not ... |
dannyperry571/theapprentice | script.module.universal/lib/universal/_common.py | '''
universal XBMC module
Copyright (C) 2013 the-one @ XUNITYTALK.COM
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... |
nesi/easybuild-framework | easybuild/tools/module_generator.py | # #
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... |
FiloSottile/Griffith-mirror | lib/plugins/movie/PluginMovieClubedevideo.py | # -*- coding: UTF-8 -*-
__revision__ = '$Id$'
# Copyright (c) 2010
#
# 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.
#... |
mrquim/mrquimrepo | script.module.salts/lib/CustomProgressDialog.py | """
tknorris shared module
Copyright (C) 2016 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
SamuelDSR/YouCompleteMe-Win7-GVIM | python/ycm/completers/completer_utils.py | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... |
tswsl1989/Minecraft-Overviewer | overviewer_core/tileset.py | # This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer 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... |
thresholdsoftware/asylum-v2.0 | openerp/addons/tarun_hotel_ms/wizard/tarun_customer_selection.py | # -*- 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... |
LLNL/spack | var/spack/repos/builtin/packages/argobots/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 Argobots(AutotoolsPackage):
"""Argobots, which was developed as a part of the Argo project... |
richardfergie/googleads-python-lib | examples/dfp/v201502/product_service/update_products.py | #!/usr/bin/python
#
# Copyright 2015 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 b... |
russellb/nova | nova/virt/baremetal/nodes.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 University of Southern California
#
# 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/... |
aselle/tensorflow | tensorflow/python/estimator/canned/dnn_linear_combined.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
brainwane/zulip | zerver/webhooks/stripe/tests.py | from unittest import mock
from unittest.mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
class StripeHookTests(WebhookTestCase):
STREAM_NAME = 'test'
URL_TEMPLATE = "/api/v1/external/stripe?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'stripe'
def test_charg... |
apache/incubator-airflow | tests/providers/amazon/aws/operators/test_sagemaker_processing.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... |
h2oai/h2o-dev | h2o-bindings/bin/pyunit_parser_test.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Test case for pyparser."""
from __future__ import division, print_function
import os
import re
import textwrap
import tokenize
import colorama
from colorama import Fore, Style
from future.builtins import open
import pyparser
def _make_tuple(op):
return lambda x... |
thammegowda/incubator-joshua | scripts/toolkit/shorti.py | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... |
looker/sentry | tests/sentry/api/endpoints/test_project_release_token.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import ProjectOption
from sentry.testutils import APITestCase
class ReleaseTokenGetTest(APITestCase):
def test_simple(self):
project = self.create_project(
name='fo... |
adykstra/mne-python | tutorials/source-modeling/plot_object_source_estimate.py | """
.. _tut-source-estimate-class:
The :class:`SourceEstimate <mne.SourceEstimate>` data structure
===============================================================
Source estimates, commonly referred to as STC (Source Time Courses),
are obtained from source localization methods.
Source localization method solve the s... |
XiaosongWei/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... |
clouserw/zamboni | mkt/inapp/tests/test_views.py | # coding: utf-8
import json
import os
from django.conf import settings
from django.core.urlresolvers import reverse
import mock
from nose.tools import eq_
from rest_framework import status
import mkt.site.tests
from mkt.users.models import UserProfile
from mkt.api.tests.test_oauth import JSONClient, RestOAuthClient... |
looker/sentry | src/sentry/plugins/examples/issue_tracking.py | from __future__ import absolute_import
from sentry.plugins.bases.issue2 import IssuePlugin2
class ExampleIssueTrackingPlugin(IssuePlugin2):
author = 'Sentry Team'
author_url = 'https://github.com/getsentry/sentry'
version = '0.0.0'
description = 'An example issue tracking plugin'
resource_links =... |
skidzo/pydy | pydy/viz/light.py | from sympy.matrices.expressions import Identity
from .visualization_frame import VisualizationFrame
__all__ = ['PointLight']
class PointLight(VisualizationFrame):
"""
Creates a PointLight for the visualization
The PointLight is inherited from VisualizationFrame,
It can also be attached to dynamics o... |
GHubgenius/clusterd | src/core/parse_cmd.py | from auxengine import build_platform_flags
from argparse import ArgumentParser
from random import choice
from log import LOG
import state
import utility
import sys
def parse(arguments):
""" Parse command line options
"""
parser = ArgumentParser(usage='./clusterd.py [options]')
#
# Connection rela... |
deisi/home-assistant | homeassistant/components/media_player/samsungtv.py | """
Support for interface with an Samsung TV.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.samsungtv/
"""
import logging
import socket
from homeassistant.components.media_player import (
DOMAIN, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPP... |
bdelliott/wordgame | web/django/contrib/staticfiles/management/commands/collectstatic.py | import os
import sys
import shutil
from optparse import make_option
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.core.management.base import CommandError, NoArgsCommand
from django.contrib.staticfiles import finders
class Command(NoArgsCommand):
"""
Com... |
aerissecure/rdpy | pyasn1/v1/type/namedtype.py | # NamedType specification for constructed types
from pyasn1 import error
class NamedType:
isOptional = 0
isDefaulted = 0
def __init__(self, name, t):
self.__name = name; self.__type = t
def __repr__(self): return '%s(%s, %s)' % (
self.__class__.__name__, repr(self.__name), repr(self.__t... |
Azure/azure-sdk-for-python | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import lo... |
iseppi/zookeepr | zkpylons/controllers/funding.py | import logging
from pylons import request, response, session, tmpl_context as c
from zkpylons.lib.helpers import redirect_to
from pylons.decorators import validate
from pylons.decorators.rest import dispatch_on
from formencode import validators, htmlfill, ForEach
from formencode.variabledecode import NestedVariables
... |
jarped/QGIS | python/core/__init__.py | import inspect
import string
from qgis._core import *
def register_function(function, arg_count, group, usesgeometry=False, **kwargs):
"""
Register a Python function to be used as a expression function.
Functions should take (values, feature, parent) as args:
Example:
def myfunc(values, feat... |
stevenmizuno/QGIS | python/plugins/processing/algs/grass7/ext/r_li_pielou_ascii.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_pielou_ascii.py
--------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************... |
maartenq/ansible | lib/ansible/modules/files/lineinfile.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# Copyright: (c) 2014, Ahti Kitsik <ak@ahtik.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolu... |
yukisakurai/hhana | mva/samples/data.py | # numpy imports
import numpy as np
from numpy.lib import recfunctions
# rootpy imports
from rootpy import asrootpy
from rootpy.plotting import Hist
# local imports
from . import log; log = log[__name__]
from .sample import Sample
from .db import TEMPFILE, get_file
from ..cachedtable import CachedTable
from ..lumi imp... |
bchiroma/DreamProject_2 | dream/simulation/BatchDecompositionBlocking.py | # ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM 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 Founda... |
impmihai/coala | tests/results/result_actions/OpenEditorActionTest.py | import os
import logging
import subprocess
import tempfile
import unittest
from importlib import reload
import coalib.results.result_actions.OpenEditorAction
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.OpenEditorAction import OpenEditorAction
from co... |
diagramsoftware/l10n-spain | l10n_es_vat_book/models/l10n_es_vat_book_issued_tax_summary.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2017 Praxya (http://praxya.com/)
# Daniel Rodriguez Lijo <drl.9319@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
apache/allura | Allura/allura/tests/tscript_error.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 (t... |
Acehaidrey/incubator-airflow | airflow/providers/microsoft/azure/example_dags/example_local_to_wasb.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... |
skudriashev/incubator-airflow | tests/www/test_views.py | # -*- 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
... |
karllessard/tensorflow | tensorflow/python/framework/memory_checker_test.py | # Copyright 2020 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... |
jordanemedlock/psychtruths | temboo/core/Library/Mixpanel/Profiles/Union.py | # -*- coding: utf-8 -*-
###############################################################################
#
# Union
# Merges list values with an existing list on a profile.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... |
jawilson/home-assistant | homeassistant/components/faa_delays/binary_sensor.py | """Platform for FAA Delays sensor component."""
from __future__ import annotations
from typing import Any
from homeassistant.components.binary_sensor import (
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN,... |
xsixing/blaze | blaze/io/scidb/tests/test_scidb.py | from __future__ import print_function, division, absolute_import
import unittest
from datashape import dshape
from blaze import add, multiply, eval, py2help
from blaze.io.scidb import zeros, ones
from blaze.io.scidb.tests.mock import MockedConn
try:
import scidbpy
from scidbpy import interface, SciDBQueryErr... |
appleseedhq/cortex | test/IECore/config/exceptions/badConfig.py | ##########################################################################
#
# Copyright (c) 2011, Image Engine Design 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:
#
# * Redistribu... |
jlecoeur/Firmware | Tools/mavlink_ulog_streaming.py | #!/usr/bin/env python
"""
Stream ULog data over MAVLink.
@author: Beat Kueng (beat-kueng@gmx.net)
"""
from __future__ import print_function
import sys, select, os
import datetime
from timeit import default_timer as timer
os.environ['MAVLINK20'] = '1' # The commands require mavlink 2
try:
from pymavlink import ... |
mindriot101/bokeh | sphinx/source/docs/user_guide/examples/categorical_bar_pandas_groupby_nested.py | from bokeh.io import show, output_file
from bokeh.plotting import figure
from bokeh.palettes import Spectral5
from bokeh.sampledata.autompg import autompg_clean as df
from bokeh.transform import factor_cmap
output_file("bar_pandas_groupby_nested.html")
df.cyl = df.cyl.astype(str)
df.yr = df.yr.astype(str)
group = df... |
akohlmey/lammps | python/examples/matplotlib_plot.py | #!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# matplotlib_plot.py
# Purpose: plot Temp of running LAMMPS simulation via matplotlib
# Syntax: plot.py in.lammps Nfreq Nsteps compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point every this many ... |
makinacorpus/rdiff-backup | rdiff_backup/restore.py | # Copyright 2002, 2003, 2004, 2005 Ben Escoto
#
# This file is part of rdiff-backup.
#
# rdiff-backup is free software; you can redistribute it and/or modify
# 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 lat... |
Lamecarlate/gourmet | gourmet/gtk_extras/LinkedTextView.py | ### Copyright (C) 2005 Thomas M. Hinkle
### Copyright (C) 2009 Rolf Leggewie
###
### This library 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) an... |
antoniodemora/python-telegram-bot | tests/test_voice.py | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015 Leandro Toledo de Souza <leandrotoeldodesouza@gmail.com>
#
# 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... |
sghai/nailgun | docs/create_organization_nailgun.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create an organization, print out its attributes and delete it.
Use NailGun to accomplish this task.
"""
from nailgun.config import ServerConfig
from nailgun.entities import Organization
from pprint import pprint
def main():
"""Create an organization, print out i... |
aperigault/ansible | lib/ansible/modules/cloud/azure/azure_rm_mariadbconfiguration_facts.py | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
# Copyright (c) 2019 Matti Ranta, (@techknowlogick)
#
# 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_METADAT... |
emersonsoftware/ansiblefork | lib/ansible/modules/cloud/openstack/os_quota.py | #!/usr/bin/python
# Copyright (c) 2016 Pason System Corporation
#
# This module 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.
#
# Thi... |
enthought/pyside | tests/QtGui/qfontdialog_test.py | import unittest
import sys
from PySide import QtGui
from PySide import QtCore
from helper import TimedQApplication
class TestFontDialog(TimedQApplication):
def testGetFont(self):
QtGui.QFontDialog.getFont()
def testGetFontQDialog(self):
QtGui.QFontDialog.getFont(QtGui.QFont("FreeSans",10))
... |
springpear/mongo-connector | mongo_connector/util.py | # Copyright 2012 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
behanceops/moto | tests/test_elb/test_elb.py | from __future__ import unicode_literals
import boto3
import boto
import boto.ec2.elb
from boto.ec2.elb import HealthCheck
from boto.ec2.elb.attributes import (
ConnectionSettingAttribute,
ConnectionDrainingAttribute,
AccessLogAttribute,
)
from boto.ec2.elb.policies import (
Policies,
AppCookieSticki... |
jamesmcm/luigi | luigi/contrib/prometheus_metric.py | from prometheus_client import CollectorRegistry, Counter, Gauge, generate_latest, CONTENT_TYPE_LATEST
from luigi.metrics import MetricsCollector
class PrometheusMetricsCollector(MetricsCollector):
def __init__(self):
super(PrometheusMetricsCollector, self).__init__()
self.registry = CollectorRegi... |
hughsaunders/keystone | keystone/tests/test_ldap_pool_livetest.py | # Copyright 2012 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... |
adit-chandra/tensorflow | tensorflow/python/ops/linalg/sparse/conjugate_gradient.py | # Copyright 2019 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... |
mezz64/home-assistant | tests/components/smhi/test_weather.py | """Test for the smhi weather entity."""
import asyncio
from datetime import datetime, timedelta
from unittest.mock import patch
import pytest
from smhi.smhi_lib import APIURL_TEMPLATE, SmhiForecast, SmhiForecastException
from homeassistant.components.smhi.const import (
ATTR_SMHI_CLOUDINESS,
ATTR_SMHI_THUNDER... |
florian-f/sklearn | sklearn/metrics/cluster/__init__.py | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... |
JackDanger/sentry | src/sentry/models/__init__.py | """
sentry.models
~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.conf import settings
from sentry.utils.imports import import_submodules
import_submodules(globals(), __name_... |
pombredanne/bokeh | bokeh/application/handlers/tests/test_notebook.py | from __future__ import absolute_import, print_function
import unittest
import nbformat
from bokeh.application.handlers import NotebookHandler
from bokeh.document import Document
def _with_temp_file(func):
import tempfile
f = tempfile.NamedTemporaryFile()
try:
func(f)
finally:
f.close... |
cowlicks/numpy | numpy/lib/npyio.py | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core.multiarray import packbits, unpackbits
from ._ioto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.