code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from permabots.models import TelegramUpdate
from telegram import User
from permabots.test import factories
from django.core.urlresolvers import reverse
from rest_framework import status
from telegram.replykeyboardhide import ReplyKeyboardHid... | jlmadurga/permabots | permabots/test/testcases.py | Python | bsd-3-clause | 16,025 |
from django.urls import include, path, register_converter
from django.urls.converters import StringConverter
from django.contrib import admin
from django.contrib.auth import logout
from django.views.generic import RedirectView, TemplateView
from pontoon.teams.views import team
class LocaleConverter(StringConverter):... | mathjazz/pontoon | pontoon/urls.py | Python | bsd-3-clause | 2,791 |
from django.conf.urls.defaults import *
from corehq.apps.adm.dispatcher import ADMAdminInterfaceDispatcher, ADMSectionDispatcher
from corehq.apps.adm.views import ADMAdminCRUDFormView
adm_admin_interface_urls = patterns('corehq.apps.adm.views',
url(r'^$', 'default_adm_admin', name="default_adm_admin_interface"),
... | gmimano/commcaretest | corehq/apps/adm/urls.py | Python | bsd-3-clause | 691 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Get-KeePassconfig',
# list of one ... | Hackplayers/Empire-mod-Hpys-tests | lib/modules/powershell/collection/vaults/get_keepass_config_trigger.py | Python | bsd-3-clause | 3,104 |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Adapted from portage/getbinpkg.py -- Portage binary-package helper functions
# Copyright 2003-2004 Gentoo Foundation
# Distributed under the terms ... | bpsinc-native/src_third_party_chromite | lib/binpkg.py | Python | bsd-3-clause | 12,642 |
#!/usr/bin/env python
from setuptools import *
setup(
name='dataflow',
version='0.1.1',
description='a dataflow library for python',
author='Tim Cuthbertson',
author_email='tim3d.junk+dataflow@gmail.com',
url='http://github.com/gfxmonk/py-dataflow/tree',
packages=find_packages(exclude=["test"]),
long_descri... | gfxmonk/py-dataflow | setup.py | Python | bsd-3-clause | 694 |
import unittest
from hrt import input_handler
class TestCLIInput(unittest.TestCase):
def setUp(self):
pass
def test_stdin_input(self):
pass
def test_interactive_input(self):
pass
def test_file_input(self):
pass
def test_inline_input(self):
pass
def... | dhruvagarwal/http-request-translator | tests/test_input.py | Python | bsd-3-clause | 524 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | stonebig/bokeh | bokeh/command/subcommands/tests/test_secret.py | Python | bsd-3-clause | 2,391 |
# User Instructions
#
# Write a function 'sub1' that, given a
# string, embeds that string in
# the string:
# "I think X is a perfectly normal thing to do in public."
# where X is replaced by the given
# string.
#
given_string = "I think %s is a perfectly normal thing to do in public."
def sub1(s):
return gi... | KellyChan/python-examples | web/gae/python/b_words_replaced.py | Python | mit | 581 |
from .downloader_base import DownloaderBase
from ... import logger
log = logger.get(__name__)
import traceback
import subprocess
import shutil
from ... import settings
class ExternalDownloader(DownloaderBase):
"""Abstract Base class for downloading through an external utility"""
program = None
args = []... | Colorsublime/Colorsublime-Plugin | colorsublime/http/downloaders/external.py | Python | mit | 843 |
class Solution:
# @param s, a string
# @param dict, a set of string
# @return a boolean
def wordBreak(self, s, dict):
solved = [False for i in range(len(s) + 1)]
solved[0] = True
for i in range(len(s)):
for j in range(i + 1):
if s[j : i + 1] in dict:
... | happylixue/LeetCodeSol | problems/word-break/sol.py | Python | mit | 396 |
# mako/codegen.py
# Copyright 2006-2019 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module
source code."""
import j... | wujuguang/mako | mako/codegen.py | Python | mit | 47,892 |
#!/usr/bin/env python
from circuits.web import Server, JSONController
class Root(JSONController):
def index(self):
return {"success": True, "message": "Hello World!"}
app = Server(("0.0.0.0", 8000))
Root().register(app)
app.run()
| nizox/circuits | examples/web/jsoncontroller.py | Python | mit | 247 |
from __future__ import print_function
import time
import pickle
import time
import numpy as np
import scipy.optimize, scipy.ndimage
from acq4.util import Qt
import acq4.pyqtgraph as pg
from acq4.Manager import getManager
class PipetteTracker(object):
"""Provides functionality for automated tracking and recalibrat... | campagnola/acq4 | acq4/devices/Pipette/tracker.py | Python | mit | 28,251 |
import json
import unittest2
from appengine_fixture_loader.loader import load_fixture
from google.appengine.ext import testbed
from google.appengine.ext import ndb
from helpers.event_simulator import EventSimulator
from helpers.event_team_status_helper import EventTeamStatusHelper
from models.event import Event
from ... | verycumbersome/the-blue-alliance | tests/test_event_team_status_helper.py | Python | mit | 55,040 |
import pyrox.filtering as filtering
class EmptyFilter(filtering.HttpFilter):
pass
| akatrevorjay/pyrox | pyrox/stock_filters/empty.py | Python | mit | 88 |
import subprocess
import os
li = [i for i in os.walk(os.getcwd())]
print(li)
for di in li:
root = di[0]
for fi in di[2]:
lent = len(fi)
if fi[lent-4:lent] == ".jpg":
fi_path = os.path.join(root, fi)
output_file = fi[:lent-4] + "_output"
print(output_file)
... | wonkishtofu/Tesseract-OCR-Tessa | tessa/orbiturary/pictures/get_text.py | Python | mit | 380 |
import math
FREQ = 3000
V = 13.3
REALRPM = 305.6
LIMIT = 2
PWM_IN_MIN = 1100
PWM_IN_MAX = 2000
RPM_MAX = 2000.0 # rpm
RPM_MIN = 300.0 # rpm
# GT: Changed constants?
RPM_SLEW = 10000.0 # rpm/s
DT_LOOP = 0.001 # seconds per slow loop
KP_RPM_UP = 0.3 # mA/rpm
KI_RPM = 0.002 # mA/rpm/s
I_SAT_R... | gtoonstra/foc_esc | escsim/constants.py | Python | mit | 918 |
# 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... | Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/python/ops/functional_ops.py | Python | mit | 23,180 |
from PyQt4 import QtCore, QtGui
import acq4.Manager
import acq4.pyqtgraph as pg
import acq4.pyqtgraph.opengl as gl
import numpy as np
import acq4.util.functions as fn
import re
man = acq4.Manager.getManager()
## update DB field to reflect dir meta info
#for i in db.select('Cell', ['rowid']): ... | hiuwo/acq4 | acq4/analysis/scripts/eventExplorer.py | Python | mit | 15,462 |
from settings.common import *
DATABASES = {
'default': {
"ENGINE": "django.db.backends.mysql",
"NAME": "mhfowler",
"USER": "root",
"PASSWORD": "",
"HOST": "localhost",
"PORT": ""
}
} | mhfowler/mhfowler | settings/local.py | Python | mit | 239 |
#!/usr/bin/env python3
#
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Lint format strings: This program checks that the number of arguments passed
# to a variadic format strin... | dashpay/dash | test/lint/lint-format-strings.py | Python | mit | 10,365 |
from abc import ABCMeta, abstractmethod
class ConfigParser:
"""Configuration file parser ABC"""
__metaclass__ = ABCMeta
"""
Config parser interface
All parsers for configuaration will
need to comply with this interface
so lmdo can understand it
"""
@abstractmethod
def get(self... | liangrog/lmdo | lmdo/config_parser.py | Python | mit | 506 |
import sys, os
if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
sys.path.append("/usr/lib/enigma2/python/enigma.zip")
from Tools.Profile import profile, profile_final
profile("PYTHON_START")
import Tools.RedirectOutput
import enigma
import eConsoleImpl
import eBaseImpl
from boxbranding import getBoxType
enig... | popazerty/test | mytest.py | Python | gpl-2.0 | 17,270 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import os,imp,sys,shlex,shutil
from waflib import Build,Utils,Configure,Task,Options,Logs,TaskGen,Errors... | diedthreetimes/VCrash | .waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Tools/c_config.py | Python | gpl-2.0 | 20,820 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscopio Tecnologia
# Author: Marcelo Jorge Vieira <metal@holoscopio.com>
# Author: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | landell/landell | sltv/input/videotestinput.py | Python | gpl-2.0 | 1,971 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Rasterize.py
-------------------
begin : 2016-10-05
copyright : (C) 2016 by OPENGIS.ch
email : matthias@opengis.ch
**... | GeoCat/QGIS | python/plugins/processing/algs/qgis/Rasterize.py | Python | gpl-2.0 | 10,479 |
""" Page functions for Host Aggregates pages
"""
import attr
from navmazing import NavigateToAttribute
from widgetastic_patternfly import BootstrapNav
from widgetastic_patternfly import BreadCrumb
from widgetastic_patternfly import Button
from widgetastic_patternfly import Dropdown
from widgetastic_patternfly import Vi... | nachandr/cfme_tests | cfme/cloud/host_aggregates.py | Python | gpl-2.0 | 6,202 |
#! /usr/bin/env python
# @ORIGINAL_AUTHOR: Robert Muth
#
# python.org has useful info about the Python programming language
#
# The Python library is described here: http://docs.python.org/lib/lib.html
# An the index for the library here: http://docs.python.org/lib/genindex.html
import sys
import os
import getopt
impo... | cyjseagull/SHMA | zsim-nvmain/pin_kit/source/tools/SimpleExamples/flowgraph.py | Python | gpl-2.0 | 13,531 |
# -*- coding: UTF-8 -*-
__revision__ = '$Id$'
# Written by Christian Sagmueller <christian@sagmueller.net>
# based on PluginMovieIMDB.py, Copyright (c) 2005 Vasco Nunes
# You may use and distribute this software under the terms of the
# GNU General Public License, version 2 or later
import gutils
import movie,string... | santiavenda2/griffith | lib/plugins/movie/PluginMovieOFDb.py | Python | gpl-2.0 | 12,757 |
# -*- coding: utf-8 -*-
#
# Copyright © 2014-2015 Colin Duquesnoy
# Copyright © 2009- The Spyder Developmet Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
"""
Provides widget classes and functions.
.. warning:: Only PyQt4/PySide QtGui classes compatible with PyQt5.QtWidgets
ar... | davvid/git-cola | qtpy/QtWidgets.py | Python | gpl-2.0 | 6,411 |
#
# Alexander Todorov <atodorov@redhat.com>
#
# Copyright 2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will b... | atodorov/pykickstart | tests/commands/install.py | Python | gpl-2.0 | 2,107 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
VoIP (Voice over IP) related functions
"""
import os
###################
## Testing stuff ##
###################
fr... | kinap/scapy | scapy/modules/voip.py | Python | gpl-2.0 | 4,288 |
#
# Copyright (C) 2006 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.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 2 of the License, or
# (at you... | dumbbell/virt-manager | src/virtManager/secret.py | Python | gpl-2.0 | 1,629 |
import math
def PrimeFactors(num):
primeFactors = []
for i in range(2, int(math.sqrt(num)) + 1):
while num % i == 0:
primeFactors.append(i)
num //= i
if num > 2:
primeFactors.append(num)
return primeFactors
def main():
factors = PrimeFactors(36)
print(factors)
if __name__ == '__main__':
main()
| gauravsitlani/programming | prime_factors/prime_factors.py | Python | gpl-3.0 | 315 |
"""
Test of basic 1D plotting methods in MantidPlot
"""
import mantidplottests
from mantidplottests import *
from mantidplot import *
from PyQt4 import QtGui, QtCore
class MantidPlotMdiSubWindowTest(unittest.TestCase):
def test_table(self):
self.doTest( newTable() )
def test_graph(self):
se... | dymkowsk/mantid | MantidPlot/test/MantidPlotMdiSubWindowTest.py | Python | gpl-3.0 | 922 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import uuid
import base64
import os
from django.contrib.gis.db import models
from treemap.models import User
class APIAccessCredential(models.Model):
access_key = models.CharFie... | ctaylo37/OTM2 | opentreemap/api/models.py | Python | gpl-3.0 | 1,113 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-08-14 18:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessao', '0009_auto_20170619_1441'),
]
operations = [
migrations.AddField(
... | cmjatai/cmj | sapl/sessao/migrations/0010_auto_20170814_1804.py | Python | gpl-3.0 | 753 |
## Note: you must install Levenshtein module
# pip install python-Levenshtein
# for this Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
# more info - see: http://stackoverflow.com/questions/18134437/where-can-the-documentation-for-python-levenshtein-be-found-online
from pymongo import Mongo... | benjaminsoellner/2015_Data_Analyst_Project_3 | Project/audit_quality_map.py | Python | agpl-3.0 | 3,625 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Agile Business Group sagl
# (<http://www.agilebg.com>)
# @author Alex Comba <alex.comba@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it ... | jbaudoux/account-invoicing | __unported__/stock_invoice_picking_incoterm/__openerp__.py | Python | agpl-3.0 | 1,830 |
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.core import urlresolvers
from django.http import HttpResponse, HttpResponseServerError
from flexi_auth.models import ObjectWithContext
from rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction, CREATE_CSV
from const... | befair/gasistafelice | gasistafelice/rest/views/blocks/transactions.py | Python | agpl-3.0 | 6,479 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | mrcslws/nupic.research | projects/meta_cl/experiments/oml_regression_test.py | Python | agpl-3.0 | 3,610 |
# Copyright 2013-2020 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)
import spack.util.url
import spack.package
class XorgPackage(spack.package.PackageBase):
"""Mixin that takes care of... | iulian787/spack | lib/spack/spack/build_systems/xorg.py | Python | lgpl-2.1 | 1,541 |
object = {__bases__: [], __name__: 'object'}
object.__mro__ = [object]
type = {__bases__: [object], __mro__: [object], __name__: 'type'}
object.__metaclass__ = type
__ARGUMENTS_PADDING__ = {ARGUMENTS_PADDING: "YES IT IS!"}
def __is__(me, other):
return (me is other)
__is__.is_method = True
object.__is__ = __i... | skariel/pythonium | pythonium/compliant/runtime.py | Python | lgpl-2.1 | 7,045 |
{
'name': 'Control access to Apps',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'category': 'Tools',
'website': 'https://twitter.com/yelizariev',
'price': 10.00,
'currency': 'EUR',
'depends': [
'access_restricted'
],
'data': [
'security/acces... | ufaks/addons-yelizariev | access_apps/__openerp__.py | Python | lgpl-3.0 | 415 |
"""
Classes for interacting with the tor control socket.
Controllers are a wrapper around a ControlSocket, retaining many of its methods
(connect, close, is_alive, etc) in addition to providing its own for
interacting at a higher level.
**Module Overview:**
::
from_port - Provides a Controller based on a port con... | meganchang/Stem | stem/control.py | Python | lgpl-3.0 | 17,273 |
# encoding: utf-8
"""
Utilities for working with strings and text.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/utils/text.py | Python | lgpl-3.0 | 25,044 |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
fX = theano.config.floatX
# ################################## config ##################################
N_TRA... | diogo149/treeano | examples/simple_rnn_comparison/with_treeano.py | Python | apache-2.0 | 2,330 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes_py.K8sExceptions import NotFoundException
from kubernetes_py.K8sObject import K8sObject
from kubernetes_py.K8sPod import K8sPo... | mnubo/kubernetes-py | kubernetes_py/K8sReplicaSet.py | Python | apache-2.0 | 2,940 |
'''
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 this ... | arenadata/ambari | ambari-agent/src/test/python/resource_management/TestLibraryFunctions.py | Python | apache-2.0 | 1,624 |
'''
This module sets up a scheme for validating that arbitrary Python
objects are correctly typed. It is totally decoupled from Django,
composable, easily wrapped, and easily extended.
A validator takes two parameters--var_name and val--and returns an
error if val is not the correct type. The var_name parameter is u... | dwrpayne/zulip | zerver/lib/validator.py | Python | apache-2.0 | 3,704 |
#!/usr/bin/python
"""
Program for creating HTML plots
"""
import os
import sys
import json
import time
from readevtlog import *
def imaging_iters(logs):
start_time = 40.0
start_msg = "kernel init"
end_msg = "imaging cleanup"
got_start = False
for k in sorted(logs):
tt = logs[k].time
... | SKA-ScienceDataProcessor/RC | MS6/visualize/csv_generator.py | Python | apache-2.0 | 744 |
# 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
# distributed under the... | stackforge/blazar | blazar/monitor/base.py | Python | apache-2.0 | 3,283 |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | coufon/neon-distributed | neon/data/ticker.py | Python | apache-2.0 | 13,214 |
# 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... | ghchinoy/tensorflow | tensorflow/contrib/distribute/python/keras_multi_worker_test_base.py | Python | apache-2.0 | 4,173 |
"""Helpers that help with state related things."""
import asyncio
from collections import defaultdict
import datetime as dt
import logging
from types import ModuleType, TracebackType
from typing import Dict, Iterable, List, Optional, Type, Union
from homeassistant.components.sun import STATE_ABOVE_HORIZON, STATE_BELOW... | leppa/home-assistant | homeassistant/helpers/state.py | Python | apache-2.0 | 3,813 |
# Copyright (C) Mesosphere, Inc. See LICENSE file for details.
import copy
import logging
import os
import time
import pytest
import requests
from generic_test_code.common import (
generic_correct_upstream_dest_test,
generic_correct_upstream_request_test,
generic_upstream_headers_verify_test,
generic... | surdy/dcos | packages/adminrouter/extra/src/test-harness/tests/test_master.py | Python | apache-2.0 | 13,807 |
from django.utils.translation import ugettext_lazy as _
import horizon
from {{ dash_path }} import dashboard
class {{ panel_name|title }}(horizon.Panel):
name = _("{{ panel_name|title }}")
slug = "{{ panel_name|slugify }}"
dashboard.register({{ panel_name|title }})
| xhorn/xchorizon | horizon/conf/panel_template/panel.py | Python | apache-2.0 | 280 |
# automatically generated, do not modify
# namespace: NamespaceB
import flatbuffers
class TableInNestedNS(object):
__slots__ = ['_tab']
# TableInNestedNS
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# TableInNestedNS
def Foo(self):
o = flatbuffers.numb... | evanw/flatbuffers | tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.py | Python | apache-2.0 | 693 |
#
# Copyright (C) 2014 Dell, 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 wri... | aidanhs/blockade | blockade/tests/__init__.py | Python | apache-2.0 | 731 |
"""Tests for fan platforms."""
import pytest
from homeassistant.components.fan import FanEntity
class BaseFan(FanEntity):
"""Implementation of the abstract FanEntity."""
def __init__(self):
"""Initialize the fan."""
def test_fanentity():
"""Test fan entity methods."""
fan = BaseFan()
... | tboyce021/home-assistant | tests/components/fan/test_init.py | Python | apache-2.0 | 781 |
# line 1
'A module docstring.'
import sys, inspect
# line 5
# line 7
def spam(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h):
eggs(b + d, c + f)
# line 11
def eggs(x, y):
"A docstring."
global fr, st
fr = inspect.currentframe()
st = inspect.stack()
p = x
q = y // 0
# line 20
class StupidGit... | slozier/ironpython2 | Src/StdLib/Lib/test/inspect_fodder.py | Python | apache-2.0 | 967 |
#!/usr/bin/env python
# Copyright 2015, Rackspace US, 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 applicabl... | byronmccollum/rpc-openstack | maas/plugins/ceph_monitoring.py | Python | apache-2.0 | 6,319 |
#!/usr/bin/env python
"""
@package mi.dataset.parser.metbk_a_dcl
@file marine-integrations/mi/dataset/parser/metbk_a_dcl.py
@author Ronald Ronquillo
@brief Parser for the metbk_a_dcl dataset driver
This file contains code for the metbk_a_dcl parsers and code to produce data particles.
For telemetered data, there is o... | renegelinas/mi-instrument | mi/dataset/parser/metbk_a_dcl.py | Python | bsd-2-clause | 7,536 |
import glob
import os
import sys
from jedi.evaluate.site import addsitedir
from jedi._compatibility import exec_function, unicode
from jedi.parser import tree
from jedi.parser import ParserWithRecovery
from jedi.evaluate.cache import memoize_default
from jedi import debug
from jedi import common
from jedi.evaluate.com... | tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/jedi/evaluate/sys_path.py | Python | bsd-3-clause | 10,686 |
from __future__ import absolute_import
from django.conf.urls import include, url
from django.conf import settings
from django.conf.urls.static import static
from . import views
from . import settings as wooey_settings
wooey_patterns = [
url(r'^jobs/command$', views.celery_task_command, name='celery_task_command'... | alexkolar/Wooey | wooey/urls.py | Python | bsd-3-clause | 3,225 |
# -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
from nagare import log
import pkg_resources
from ..assetsmanager import As... | bcroq/kansha | kansha/services/dummyassetsmanager/dummyassetsmanager.py | Python | bsd-3-clause | 1,033 |
from __future__ import absolute_import
import logging
from rest_framework import serializers
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from uuid import uuid4
from sentry.api.base import Endpoint, SessionAuthentication
from sentry.api.exceptions import Resourc... | mvaled/sentry | src/sentry/api/endpoints/api_application_details.py | Python | bsd-3-clause | 4,091 |
import warnings
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose,
assert_, suppress_warnings)
from pytest import raises as assert_raises
from scipy.signal import (ss2tf, tf2ss, lsim2, impulse2, step2, lti,
dlti, bode,... | aeklant/scipy | scipy/signal/tests/test_ltisys.py | Python | bsd-3-clause | 46,195 |
from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import get_object_or_404
from pdfdocument.utils import pdf_response
import plata
import plata.reporting.product
import plata.reporting.order
@staff_member_required
def product_xls(request):
"""
Returns an XLS conta... | ixc/plata | plata/reporting/views.py | Python | bsd-3-clause | 1,080 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-29 12:16
from __future__ import unicode_literals
from django.contrib.postgres.operations import BtreeGinExtension
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('product', '0037_auto_20171124_0847'... | UITools/saleor | saleor/product/migrations/0038_auto_20171129_0616.py | Python | bsd-3-clause | 383 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 t... | staranjeet/fjord | vendor/packages/translate-toolkit/translate/lang/af.py | Python | bsd-3-clause | 3,846 |
from unittest import TestCase
from chatterbot.corpus import Corpus
import os
class CorpusUtilsTestCase(TestCase):
def setUp(self):
self.corpus = Corpus()
def test_get_file_path(self):
"""
Test that a dotted path is properly converted to a file address.
"""
path = self... | davizucon/ChatterBot | tests/corpus_tests/test_corpus.py | Python | bsd-3-clause | 3,023 |
import sys
import os
import glob
import shutil
import datetime
assert 'pymel' not in sys.modules or 'PYMEL_INCLUDE_EXAMPLES' in os.environ, "to generate docs PYMEL_INCLUDE_EXAMPLES env var must be set before pymel is imported"
# remember, the processed command examples are not version specific. you must
# run cmdcach... | shrtcww/pymel | maintenance/docs.py | Python | bsd-3-clause | 3,694 |
# -*- coding: utf-8 -*-
"""
Classes that process (and maybe abort) responses based on
various conditions. They should be used with
:class:`splash.network_manager.SplashQNetworkAccessManager`.
"""
from __future__ import absolute_import
from PyQt5.QtNetwork import QNetworkRequest
from splash.qtutils import request_repr
f... | pawelmhm/splash | splash/response_middleware.py | Python | bsd-3-clause | 2,510 |
# 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 ... | Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/_configuration.py | Python | mit | 2,179 |
#
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library.
# $Id$
#
# FlashPix support for PIL
#
# History:
# 97-01-25 fl Created (reads uncompressed RGB images only)
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and redistribution.
#
fr... | ryfeus/lambda-packs | pytorch/source/PIL/FpxImagePlugin.py | Python | mit | 6,282 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | wakiyamap/electrum-mona | electrum_mona/dnssec.py | Python | mit | 5,922 |
#!/usr/bin/env python
class PivotFilter(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
... | aspose-cells/Aspose.Cells-for-Cloud | SDKs/Aspose.Cells-Cloud-SDK-for-Python/asposecellscloud/models/PivotFilter.py | Python | mit | 1,456 |
Experiment(description='No with centred periodic',
data_dir='../data/tsdlr/',
max_depth=8,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=4,
max_jobs=600,
verbose=False,
... | jamesrobertlloyd/gpss-research | experiments/2013-09-07.py | Python | mit | 710 |
import pprint
import test.test_support
import unittest
import test.test_set
try:
uni = unicode
except NameError:
def uni(x):
return x
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
pass
class list3(list):
def __repr__(self):
return list.__repr... | bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/test/test_pprint.py | Python | mit | 25,311 |
# -*- coding: utf-8 -*-
"""IPython Test Suite Runner.
This module provides a main entry point to a user script to test IPython
itself from the command line. There are two ways of running this script:
1. With the syntax `iptest all`. This runs our entire test suite by
calling this script (with different arguments)... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/testing/iptest.py | Python | mit | 18,302 |
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
print "need input file"
sys.exit(1)
fin = open(sys.argv[1], "r")
lines = fin.readlines()
fin.close()
fout = open("bootloader.h", "w")
fout.write("/* File automatically generated by hex2header.py */\n\n")
fout.write("const unsigned int bootload... | diydrones/alceosd | firmware/bootloader_updater.X/hex2header.py | Python | gpl-2.0 | 1,513 |
#!/usr/bin/python2.4
# Copyright 2008 Google Inc.
# Author : Anoop Chandran <anoopj@google.com>
#
# openduckbill is a simple backup application. It offers support for
# transferring data to a local backup directory, NFS. It also provides
# file system monitoring of directories marked for backup. Please read
# the READ... | xtao/openduckbill | src/helper.py | Python | gpl-2.0 | 3,110 |
#!/usr/bin/python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.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... | MSusik/invenio | scripts/pep8.py | Python | gpl-2.0 | 29,318 |
#!/usr/bin/env python3
import os
import sys
import subprocess
if os.getenv("MSYSTEM") == "MINGW32":
mingw_dir = "/mingw32"
elif os.getenv("MSYSTEM") == "MINGW64":
mingw_dir = "/mingw64"
p = subprocess.Popen([
"sh", "-c",
"cp {}/bin/{} {}".format(mingw_dir, sys.argv[1], sys.argv[2])])
sys.exit(p.wait(... | cnvogelg/fs-uae | dist/windows/clib.py | Python | gpl-2.0 | 323 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ContactRole'
db.create_table('base_contactrole', (
('id', self.gf('django.db.m... | dwoods/gn-maps | geonode/base/migrations/0001_initial.py | Python | gpl-3.0 | 25,336 |
#! /usr/bin/env python
import sys
from aubio import source, pitch, freqtomidi
if len(sys.argv) < 2:
print "Usage: %s <filename> [samplerate]" % sys.argv[0]
sys.exit(1)
filename = sys.argv[1]
downsample = 1
samplerate = 44100 / downsample
if len( sys.argv ) > 2: samplerate = int(sys.argv[2])
win_s = 4096 / ... | madmouser1/aubio | python/demos/demo_pitch.py | Python | gpl-3.0 | 3,193 |
# Phatch - Photo Batch Processor
# Copyright (C) 2007-2008 www.stani.be
#
# 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... | anish/phatch | phatch/actions/transpose.py | Python | gpl-3.0 | 9,462 |
# -*- coding: utf-8 -*-
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import re, os, shutil, cgi
from anki.utils import checksum, call, namedtmp, tmpdir, isMac, stripHTML
from anki.hooks import addHook
from anki.lang import _
# if you modify ... | sunclx/anki | anki/latex.py | Python | agpl-3.0 | 4,659 |
# -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
from dateutil.relativedelta import relativedelta
class saleOrderLine(models.Model):
_inherit = 'sale.order.line'
@api.multi
@api.dep... | alfredoavanzosc/odoo-addons | stock_information/models/sale_order_line.py | Python | agpl-3.0 | 1,803 |
# -*- coding: utf-8 -*-
import logging
import itertools
import math
import urllib
import httplib as http
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from flask import request
from framework import utils
from framework import sentry
from framework.auth.core import User
from framework.flas... | zachjanicki/osf.io | website/views.py | Python | apache-2.0 | 7,843 |
# 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... | rabipanda/tensorflow | tensorflow/contrib/data/python/kernel_tests/filter_dataset_op_test.py | Python | apache-2.0 | 7,371 |
# 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 ... | rectang/lucy-clownfish | runtime/python/src/clownfish/__init__.py | Python | apache-2.0 | 846 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | Brocade-OpenSource/OpenStack-DNRM-Nova | nova/service.py | Python | apache-2.0 | 15,048 |
from flask import Blueprint, render_template, request, url_for
from CTFd.models import Users
from CTFd.utils import config
from CTFd.utils.decorators import authed_only
from CTFd.utils.decorators.visibility import (
check_account_visibility,
check_score_visibility,
)
from CTFd.utils.helpers import get_errors, ... | LosFuzzys/CTFd | CTFd/users.py | Python | apache-2.0 | 2,090 |
# Copyright (c) 2020 Vestas Wind Systems A/S
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for performing program download over CANopen (DSP 302-3).'''
import argparse
import os
import time
from runners.core import ZephyrBinaryRunner, RunnerCaps
try:
import canopen
from progress.bar import Bar
MISSI... | zephyrproject-rtos/zephyr | scripts/west_commands/runners/canopen_program.py | Python | apache-2.0 | 13,074 |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | yangleo/cloud-github | openstack_dashboard/test/test_data/cinder_data.py | Python | apache-2.0 | 16,279 |
# Copyright 2014, Doug Wiegley, A10 Networks.
#
# 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 appli... | dougwig/acos-client | acos_client/v21/slb/template/persistence.py | Python | apache-2.0 | 2,099 |
# Copyright (c) 2015 OpenStack Foundation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | paninetworks/neutron | neutron/tests/unit/db/quota/test_api.py | Python | apache-2.0 | 10,763 |