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 |
|---|---|---|---|---|---|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | QingChenmsft/azure-cli | src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/_help.py | Python | mit | 1,221 |
from datetime import datetime
import os
import sys
from django.core.management.base import BaseCommand, CommandError
from workflows import module_importer
from workflows.management.commands import export_package_old as export_package
from workflows.management.commands import import_package_old as import_package
... | xflows/textflows | workflows/management/commands/auto_import_packages.py | Python | mit | 6,445 |
# encoding: UTF-8
import json
from vnpy.trader.vtConstant import EMPTY_STRING
from vnpy.rpc import RpcServer
from vnpy.trader.vtFunction import getJsonPath
########################################################################
class RsEngine(object):
"""RPC服务引擎"""
settingFileName = 'RS_setting.json'... | harveywwu/vnpy | vnpy/trader/app/rpcService/rsEngine.py | Python | mit | 3,098 |
#********************************************************************************
#* Dionaea
#* - catches bugs -
#*
#*
#*
#* Copyright (C) 2010 Mark Schloesser
#*
#* This program is free software; you can redistribute it and/or
#* modify it under the terms of th... | gento/dionaea | modules/python/scripts/hpfeeds.py | Python | gpl-2.0 | 9,299 |
#!/usr/bin/python
'''
Handler for W3C validation api response
'''
from xml.sax import handler
class ValidatorHandler(handler.ContentHandler):
def __init__(self):
self.tags = {}
self.doctype = ''
self.charset = ''
self.validity = ''
self.errors = []
self.warnings =... | huda88/informatics_history_HCI_atelier_2015 | validator/py_w3c/handler.py | Python | gpl-2.0 | 3,533 |
allow_fast_forward = False
| lsjostro/pulp_win | plugins/pulp_win/plugins/migrations/__init__.py | Python | gpl-2.0 | 27 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class diffutils(test.test):
"""
Autotest module for testing basic functionality
of diffutils
@author Shoji Sugiyama (shoji@jp.ibm.com)
"""
version = 1
nfail = 0
... | PoornimaNayak/autotest-client-tests | linux-tools/diffutils/diffutils.py | Python | gpl-2.0 | 1,176 |
#
# package_gui.py: package group selection screen
#
# Copyright (C) 2005 Red Hat, Inc. All rights reserved.
#
# 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, ... | Rogentos/legacy-anaconda | iw/package_gui.py | Python | gpl-2.0 | 1,359 |
#!/usr/bin/env python
########################################################################
# File : dirac-admin-get-banned-sites
# Author : Stuart Paterson
########################################################################
from __future__ import print_function
__RCSID__ = "$Id$"
from DIRAC.Core.Base imp... | chaen/DIRAC | Interfaces/scripts/dirac-admin-get-banned-sites.py | Python | gpl-3.0 | 937 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
## Copyright (C) 2014 Bitergia
##
## 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... | jalonsob/Informes | grimoirelib_alch/query/scr.py | Python | gpl-3.0 | 6,699 |
from ete_dev import Tree
tree = Tree( '(A:1,(B:1,(C:1,D:1):0.5):0.5);' )
# Prints the name of every leaf under the tree root
print "Leaf names:"
for leaf in tree.get_leaves():
print leaf.name
# Label nodes as terminal or internal. If internal, saves also the
# number of leaves that it contains.
print "Labeled tree:... | khughitt/ete | examples/general/label_nodes.py | Python | gpl-3.0 | 592 |
"""
Performance test created using multi-mechnize to analyze time
for query processing with MySQL.
"""
from __future__ import print_function
import random
import time
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
class Transaction(object):
def __init__(self):
self.JobDB = JobDB()
self.custom... | fstagni/DIRAC | tests/Performance/MySQLJobMonitoring/test_scripts/query.py | Python | gpl-3.0 | 705 |
# -*- coding: utf-8 -*-
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""
since 1.9: mutagen.m4a is deprecated; use mutagen.mp4 instead.
since 1.31:... | bbsan2k/nzbToMedia | libs/mutagen/m4a.py | Python | gpl-3.0 | 1,972 |
"""
Discussion component editor in studio
"""
from common.test.acceptance.pages.common.utils import click_css
from common.test.acceptance.pages.studio.xblock_editor import XBlockEditorView
class DiscussionComponentEditor(XBlockEditorView):
"""
Discussion Editor view in studio
"""
@property
def e... | edx-solutions/edx-platform | common/test/acceptance/pages/studio/discussion_component_editor.py | Python | agpl-3.0 | 1,057 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Germany - Accounting',
'author': 'openbig.org',
'website': 'http://www.openbig.org',
'category': 'Accounting/Localizations',
'description': """
Dieses Modul beinhaltet einen deutschen Kont... | ygol/odoo | addons/l10n_de/__manifest__.py | Python | agpl-3.0 | 777 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>)
#
# ... | VitalPet/c2c-rd-addons | stock_product_location/__init__.py | Python | agpl-3.0 | 1,259 |
# 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 PyCfgrib(PythonPackage):
"""Python interface to map GRIB files to the NetCDF Common Data M... | LLNL/spack | var/spack/repos/builtin/packages/py-cfgrib/package.py | Python | lgpl-2.1 | 1,507 |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | wubr2000/googleads-python-lib | examples/dfp/v201411/creative_wrapper_service/get_all_creative_wrappers.py | Python | apache-2.0 | 2,022 |
# 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 applicable ... | jostep/tensorflow | tensorflow/python/training/evaluation_test.py | Python | apache-2.0 | 7,689 |
import sys
from javax.swing import JFrame
from javax.swing import JPanel
from javax.swing import JLabel
from javax.swing import JTextArea
from javax.swing import JScrollPane
from javax.swing import JTabbedPane
from javax.swing import WindowConstants
from java.awt import BorderLayout
from java.lang import Boolean
# myS... | lanchun/myrobotlab | src/resource/Python/pythonConsole.py | Python | apache-2.0 | 929 |
# Lint as: python2, python3
# 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
#
#... | googleinterns/wss | third_party/deeplab/evaluation/eval_coco_format.py | Python | apache-2.0 | 14,106 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Copyright 2012 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... | caioserra/apiAdwords | tests/adspygoogle/dfp/v201204/inventory_service_unittest.py | Python | apache-2.0 | 2,897 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apach... | gerrive/horizon | openstack_dashboard/api/cinder.py | Python | apache-2.0 | 26,708 |
# cython: language_level = 2
#
# Code output module
#
from __future__ import absolute_import
import cython
cython.declare(os=object, re=object, operator=object,
Naming=object, Options=object, StringEncoding=object,
Utils=object, SourceDescriptor=object, StringIOTree=object,
... | madjar/cython | Cython/Compiler/Code.py | Python | apache-2.0 | 87,027 |
from django.apps import AppConfig
import approver.constants as constants
class ApproverConfig(AppConfig):
name = constants.app_label
def ready(self):
from approver.signals import all_signals
| ctsit/qipr_approver | qipr_approver/approver/apps.py | Python | apache-2.0 | 211 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_updateserviceinterfacepoint_input import TapiCommonUpdateserviceinterfacepointInput... | OpenNetworkingFoundation/ONFOpenTransport | RI/flask_server/tapi_server/models/inline_object32.py | Python | apache-2.0 | 1,822 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: vttest.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | HubSpot/vitess | py/vtproto/vttest_pb2.py | Python | apache-2.0 | 7,682 |
from __future__ import absolute_import, division
import contextlib
import itertools
import logging
import sys
import time
from signal import SIGINT, default_int_handler, signal
from pip._vendor import six
from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR
from pip._vendor.progress.bar import Bar, FillingCircle... | xyuanmu/XX-Net | python3.8.2/Lib/site-packages/pip/_internal/utils/ui.py | Python | bsd-2-clause | 13,768 |
from django.core.management.base import AppCommand
from django.utils.encoding import force_unicode
from django.utils.text import capfirst
MODULE_TEMPLATE = ''' {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%}
<tr>
<th>{%% if perms.%(app)s.%(changeperm)s %%}<a href="%(app)s/%(mod)s/">... | wujingke/xbaydns | xbaydnsweb/web/management/commands/myadminindex.py | Python | bsd-2-clause | 1,890 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import re
import signal
import subprocess
import sys
import tempfile
from devil.android import device_errors # pylint: disable=F04... | Chilledheart/chromium | tools/telemetry/telemetry/internal/platform/profiler/perf_profiler.py | Python | bsd-3-clause | 9,275 |
# -*- coding: utf-8 -*-
from cms.utils.conf import get_cms_setting
def media(request):
"""
Adds media-related context variables to the context.
"""
return {'CMS_MEDIA_URL': get_cms_setting('MEDIA_URL')}
| 11craft/django-cms | cms/context_processors.py | Python | bsd-3-clause | 220 |
"""
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with :ref:`bayesian_ridge_regression`.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shifted ... | florian-f/sklearn | examples/linear_model/plot_ard.py | Python | bsd-3-clause | 2,517 |
# coding=utf-8
#########################################################################
# File Name: tests.py
# Original Author: 段凯强
# Mail: duankq@ios.ac.cn
# Created Time: 2013-12-19
# Update:
#########################################################################
################################################... | Yuecai/com-yuecai-dream | src/userinfo/tests.py | Python | bsd-3-clause | 768 |
##########################################################################
#
# Copyright (c) 2012-2013, 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:
#
# * Redi... | hradec/gaffer | python/GafferCortex/IndexedIOPath.py | Python | bsd-3-clause | 3,952 |
from .oauth import BaseOAuth2
class PixelPinOAuth2(BaseOAuth2):
"""PixelPin OAuth authentication backend"""
name = 'pixelpin-oauth2'
ID_KEY = 'id'
AUTHORIZATION_URL = 'https://login.pixelpin.co.uk/OAuth2/Flogin.aspx'
ACCESS_TOKEN_URL = 'https://ws3.pixelpin.co.uk/index.php/api/token'
ACCESS_TO... | tobias47n9e/social-core | social_core/backends/pixelpin.py | Python | bsd-3-clause | 1,178 |
# coding: utf-8
"""
Compatibility functions for unified behavior between Python 2.x and 3.x.
:author: Alex Grönholm
"""
from __future__ import unicode_literals, absolute_import
import inspect
import sys
from threading import Thread
version_info = sys.version_info
if version_info[:2] == (2, 6):
from py4j.backpor... | njwhite/py4j | py4j-python/src/py4j/compat.py | Python | bsd-3-clause | 2,402 |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class DistributedScavengerHuntTargetAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedScavengerHuntTargetAI")
def attemptScavengerHunt(self):
... | Spiderlover/Toontown | toontown/ai/DistributedScavengerHuntTargetAI.py | Python | mit | 328 |
# coding=utf-8
import re
import requests
from bs4 import BeautifulSoup
from slack_bot.ext import cache
from utils import check_cache
from pycoders import MyHTMLParser
URL = 'http://us2.campaign-archive1.com/home/?u=e2e180baf855ac797ef407fc7&id=9e26887fc5' # noqa
ISSUE_REGEX = re.compile(r'(\d+\/\d+\/\d+).*Issue\W+(... | python-cn/slack_bot | slack_bot/plugins/pythonweekly.py | Python | mit | 3,184 |
"""
Module for base class for Data API objects.
"""
# Imports
# Stdlib
import json
import logging
import re
# Local
from doekbase.data_api.util import get_logger
from doekbase.data_api.util import log_start, log_end
from doekbase.data_api.util import get_auth_token
from . import thrift_service, ttypes
# Logging
_lo... | scanon/data_api2 | lib/doekbase/data_api/baseobj/api.py | Python | mit | 2,917 |
"""Module for testing the behavior of generics across different modules."""
import sys
from textwrap import dedent
from typing import TypeVar, Generic, Optional
if sys.version_info[:2] >= (3, 6):
exec(dedent("""
default_a: Optional['A'] = None
default_b: Optional['B'] = None
T = TypeVar('T')
c... | FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/mod_generics_cache.py | Python | gpl-2.0 | 1,160 |
"""
SystemLoggingHandler is the implementation of the Logging service
in the DISET framework.
The following methods are available in the Service interface::
addMessages()
"""
__RCSID__ = "$Id$"
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.Framew... | andresailer/DIRAC | FrameworkSystem/Service/SystemLoggingHandler.py | Python | gpl-3.0 | 2,129 |
##
## Copyright(c) 2009 Syntext, Inc. All Rights Reserved.
## Contact: info@syntext.com, http://www.syntext.com
##
## This file is part of Syntext Serna XML Editor.
##
## COMMERCIAL USAGE
## Licensees holding valid Syntext Serna commercial licenses may use this file
## in accordance with the Syntext Serna Commercial... | amiramix/serna-free | serna/dist/plugins/pyplugin-tutorial/helloWorld.py | Python | gpl-3.0 | 1,993 |
import datetime
import json
import re
import urllib2
from vidscraper.decorators import provide_shortmem, returns_unicode
from vidscraper.errors import BaseUrlLoadFailure
USTREAM_API_KEY = None
def provide_api(func):
"""
A quick decorator to provide the uStream API data for a video.
"""
def wrapper(ur... | norayr/unisubs | libs/vidscraper/sites/ustream.py | Python | agpl-3.0 | 3,057 |
from zeroless import Server
# Binds the pull server to port 12345
# And assigns an iterable to wait for incoming messages
listen_for_push = Server(port=12345).pull()
for id, msg in listen_for_push:
print(id, ' - ', msg)
| x8lucas8x/python-zeroless | examples/multipart/pushPullServer.py | Python | lgpl-2.1 | 226 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class SyfyIE(InfoExtractor):
_VALID_URL = r'https?://www\.syfy\.com/videos/.+?vid:(?P<id>\d+)'
_TEST = {
'url': 'http://www.syfy.com/videos/Robot%20Combat%20League/Behind%20the%20Scenes/vid:2631458',
'md5': ... | MiLk/youtube-dl | youtube_dl/extractor/syfy.py | Python | unlicense | 889 |
"""Support for Xiaomi Gateways."""
import asyncio
from datetime import timedelta
import logging
import voluptuous as vol
from xiaomi_gateway import XiaomiGateway, XiaomiGatewayDiscovery
from homeassistant import config_entries, core
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
ATTR_VOLTAGE,
CONF_... | nkgilley/home-assistant | homeassistant/components/xiaomi_aqara/__init__.py | Python | apache-2.0 | 12,965 |
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | cloudbau/glance | glance/tests/unit/test_domain.py | Python | apache-2.0 | 11,571 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | ewindisch/nova | nova/tests/integrated/v3/test_migrations.py | Python | apache-2.0 | 2,564 |
# See https://zulip.readthedocs.io/en/latest/subsystems/thumbnailing.html
import base64
import os
import sys
import urllib
from urllib.parse import urljoin
from django.conf import settings
from django.utils.http import is_safe_url
from libthumbor import CryptoURL
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.d... | brainwane/zulip | zerver/lib/thumbnail.py | Python | apache-2.0 | 2,678 |
""" TSI{0,1,2,3,5} are private tables used by Microsoft Visual TrueType (VTT)
tool to store its hinting source data.
TSI3 contains the text of the glyph programs in the form of 'VTTTalk' code.
"""
from fontTools import ttLib
superclass = ttLib.getTableClass("TSI1")
class table_T_S_I__3(superclass):
extras = {0xfff... | google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/ttLib/tables/T_S_I__3.py | Python | apache-2.0 | 421 |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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... | glove747/liberty-neutron | neutron/services/metering/agents/metering_agent.py | Python | apache-2.0 | 11,557 |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetDistrictsByCoordinates
# Returns the district that a set of latitude/longitude coordinates falls within.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | jordanemedlock/psychtruths | temboo/core/Library/SunlightLabs/Congress/District/GetDistrictsByCoordinates.py | Python | apache-2.0 | 4,073 |
from temboo.Library.PayPal.Vault.LookupCreditCard import LookupCreditCard, LookupCreditCardInputSet, LookupCreditCardResultSet, LookupCreditCardChoreographyExecution
| jordanemedlock/psychtruths | temboo/core/Library/PayPal/Vault/__init__.py | Python | apache-2.0 | 166 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | tylertian/Openstack | openstack F/nova/nova/api/openstack/compute/contrib/flavormanage.py | Python | apache-2.0 | 3,306 |
from datetime import datetime
from functools import partialmethod
from io import StringIO
from unittest import mock, skipIf
from django.core import serializers
from django.core.serializers import SerializerDoesNotExist
from django.core.serializers.base import ProgressBar
from django.db import connection, transaction
f... | edmorley/django | tests/serializers/tests.py | Python | bsd-3-clause | 16,764 |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import sys
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noreload', action='store_false', dest='use_reloader', default=True,
help='Tells Django to ... | genova/rapidsms-senegal | apps/django_extensions/management/commands/runprofileserver.py | Python | bsd-3-clause | 5,606 |
import inspect
from wagtail.images.exceptions import InvalidFilterSpecError
from wagtail.images.rect import Rect
from wagtail.images.utils import parse_color_string
class Operation:
def __init__(self, method, *args):
self.method = method
self.args = args
# Check arguments
try:
... | kaedroho/wagtail | wagtail/images/image_operations.py | Python | bsd-3-clause | 8,893 |
from django.test import TestCase
from djapian import CompositeIndexer
from djapian.tests.utils import BaseTestCase, BaseIndexerTest, Entry, Comment
class CollapseTest(BaseIndexerTest, BaseTestCase):
def setUp(self):
super(CollapseTest, self).setUp()
self.result = Entry.indexer.search("text")
... | daevaorn/djapian | src/djapian/tests/collapse.py | Python | bsd-3-clause | 1,405 |
"""
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
from __future__ import division, absolute_import, p... | MSeifert04/numpy | numpy/distutils/mingw32ccompiler.py | Python | bsd-3-clause | 25,245 |
# I2C with the Arduino as the master device and the OpenMV Cam as the slave.
#
# Please wire up your OpenMV Cam to your Arduino like this:
#
# OpenMV Cam Master I2C Data (P5) - Arduino Uno Data (A4)
# OpenMV Cam Master I2C Clock (P4) - Arduino Uno Clock (A5)
# OpenMV Cam Ground - Arduino Ground
import... | openmv/openmv | scripts/examples/OpenMV/00-Arduino/arduino_i2c_slave.py | Python | mit | 3,576 |
#!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the generation of UTXO snapshots using `dumptxoutset`.
"""
from test_framework.blocktools import ... | JeremyRubin/bitcoin | test/functional/rpc_dumptxoutset.py | Python | mit | 1,999 |
if __name__ == '__main__':
import sys
import os
pkg_dir = (os.path.split(
os.path.split(
os.path.split(
os.path.abspath(__file__))[0])[0])[0])
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
... | bhansa/fireball | pyvenv/Lib/site-packages/pygame/tests/run_tests__tests/incomplete/fake_2_test.py | Python | gpl-3.0 | 959 |
# 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 by applicable law or a... | Eric-Gaudiello/tensorflow_dev | tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/tensorflow/models/rnn/translate/seq2seq_model.py | Python | gpl-3.0 | 13,620 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
from module.plugins.internal.SimpleHoster import seconds_to_midnight
class HighWayMe(MultiHoster):
__name__ = "HighWayMe"
__type__ = "hoster"
__version__ = "0.13"
__status__ = "testin... | LePastis/pyload | module/plugins/hoster/HighWayMe.py | Python | gpl-3.0 | 2,610 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | a0c/odoo | openerp/osv/expression.py | Python | agpl-3.0 | 57,097 |
# -*- coding: utf-8 -*-
import base64
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.addons.base.res.res_bank import sanitize_account_number
import logging
_logger = logging.getLogger(__name__)
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.state... | Aravinthu/odoo | addons/account_bank_statement_import/account_bank_statement_import.py | Python | agpl-3.0 | 13,487 |
#!/usr/bin/python
'''Test cases for QObject protected methods'''
import unittest
from PySide.QtCore import QObject, QThread, SIGNAL
class Dummy(QObject):
'''Dummy class'''
pass
class QObjectReceivers(unittest.TestCase):
'''Test case for QObject.receivers()'''
def cb(self, *args):
#Dummy cal... | enthought/pyside | tests/QtCore/qobject_protected_methods_test.py | Python | lgpl-2.1 | 1,031 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | tonyli71/designate | designate/network_api/neutron.py | Python | apache-2.0 | 5,892 |
from optparse import make_option, OptionValueError
from django import VERSION
from django.core.management.commands.loaddata import Command as LoadDataCommand
# Because this command is used (instead of default loaddata), then settings have been imported
# and we can safely import MT modules
from modeltranslation impor... | gquirozbogner/contentbox-master | third_party/modeltranslation/management/commands/loaddata.py | Python | apache-2.0 | 2,038 |
import six
from requests import HTTPError
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_AUTH_HEADER
from social.p3 import urlencode, unquote
from social.utils import url_add_parameters, parse_qs
from social.exceptions import AuthFailed, AuthCanceled, AuthUnknownError, \
... | GDGLima/contentbox | third_party/social/backends/oauth.py | Python | apache-2.0 | 15,561 |
import os
import sys
import code
import optparse
import PE
'''
For now, all this does is rename files to their exportname and version info.
(more to come is likely)
'''
def main():
parser = optparse.OptionParser()
parser.add_option('--version', dest='version', default=False, action='store_true')
parser.... | joshuahoman/vivisect | PE/petool.py | Python | apache-2.0 | 1,338 |
#
# Copyright 2013 Red Hat, 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 writi... | eayunstack/ceilometer | ceilometer/tests/functional/api/v2/test_post_samples_scenarios.py | Python | apache-2.0 | 15,432 |
"""
Component to keep track of user controlled booleans for within automation.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_boolean/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_I... | open-homeautomation/home-assistant | homeassistant/components/input_boolean.py | Python | apache-2.0 | 4,641 |
"""Test the Sonarr config flow."""
from homeassistant.components.sonarr.const import (
CONF_UPCOMING_DAYS,
CONF_WANTED_MAX_ITEMS,
DEFAULT_UPCOMING_DAYS,
DEFAULT_WANTED_MAX_ITEMS,
DOMAIN,
)
from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER
from homeassistant.const import CONF_API_KE... | tboyce021/home-assistant | tests/components/sonarr/test_config_flow.py | Python | apache-2.0 | 6,901 |
# coding=utf-8
# Copyright 2014 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)
from pants.backend.a... | sameerparekh/pants | src/python/pants/backend/authentication/register.py | Python | apache-2.0 | 526 |
"""Implementation of the readingdb interface that sticks the data into
postgres. This lets us avoid having a separate readingdb server for
all installs.
"""
import traceback
import psycopg2
import smap.archiver.settings as settings
def db_open(host=None, port=None):
db = psycopg2.connect(host=host,
... | Alwnikrotikz/smap-data | python/smap/iface/pgreadingdb.py | Python | bsd-2-clause | 2,590 |
import os
from glob import glob
import json
def main():
prefix = os.environ['PREFIX']
info_file = glob(os.path.join(prefix, 'conda-meta', 'conda-build-test-build-string-1.0*.json'))[0]
with open(info_file, 'r') as fh:
info = json.load(fh)
assert info['build_number'] == 0
assert info['build... | pelson/conda-build | tests/test-recipes/metadata/build_string/run_test.py | Python | bsd-3-clause | 380 |
#!/usr/bin/env python
#
# 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.
"""Provides a convenient wrapper for spawning a test lighttpd instance.
Usage:
lighttpd_server PATH_TO_DOC_ROOT
"""
import co... | keishi/chromium | build/android/lighttpd_server.py | Python | bsd-3-clause | 9,377 |
# -*- coding: utf-8 -*-
from ..internal.DeadHoster import DeadHoster
class OronCom(DeadHoster):
__name__ = "OronCom"
__type__ = "hoster"
__version__ = "0.19"
__status__ = "stable"
__pattern__ = r'https?://(?:www\.)?oron\.com/\w{12}'
__config__ = [] # @TODO: Remove in 0.4.10
__descripti... | Arno-Nymous/pyload | module/plugins/hoster/OronCom.py | Python | gpl-3.0 | 480 |
"""Show information about the test environment."""
from __future__ import annotations
import datetime
import os
import platform
import sys
import typing as t
from ...config import (
CommonConfig,
)
from ...io import (
write_json_file,
)
from ...util import (
display,
SubprocessError,
get_ansible... | ansible/ansible | test/lib/ansible_test/_internal/commands/env/__init__.py | Python | gpl-3.0 | 5,319 |
#!/usr/bin/python
#
# Copyright 2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list... | eethomas/eucalyptus | clc/eucadmin/eucadmin/validator.py | Python | gpl-3.0 | 11,803 |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | britcey/ansible | lib/ansible/plugins/action/ce.py | Python | gpl-3.0 | 5,476 |
from shutil import which
import sys
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.settings.Setting import typed_list
@linter(executable=sys.executable,
output_format='regex',
output_regex=r'(?P<line>\d+):... | Asnelchristian/coala-bears | bears/hypertext/HTMLLintBear.py | Python | agpl-3.0 | 1,215 |
import redis
import hermes
import hermes.backend
import hermes.backend.dict
import hermes.backend.redis
from flask import current_app as app
from superdesk import json_utils
from superdesk.logging import logger
class SuperdeskRedisBackend(hermes.backend.redis.Backend):
"""Updated init to create redis from URL i... | nistormihai/superdesk-core | superdesk/cache.py | Python | agpl-3.0 | 2,649 |
from flask import Flask, url_for, request, render_template
from app import app
@app.route('/')
def hello():
url = url_for('about');
link = '<a href="' + url + '">About us!</a>';
return link;
@app.route('/about')
def about():
return 'We are the knights who say Ni!!';
@app.route('/question/<title>', me... | KhalidGit/flask | Work/Trivia - Module 3/routes.py | Python | apache-2.0 | 1,438 |
# 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 by applicable law or ag... | KaranToor/MA450 | google-cloud-sdk/lib/surface/compute/routers/list.py | Python | apache-2.0 | 948 |
# 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... | chenjun0210/tensorflow | tensorflow/python/estimator/estimator_test.py | Python | apache-2.0 | 51,435 |
# 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 ... | geeag/kafka | tests/kafkatest/sanity_checks/test_kafka_version.py | Python | apache-2.0 | 2,472 |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.special import factorial
from scipy._lib.six import xrange
from scipy._lib._util import _asarray_validated
__all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator",
"baryc... | lhilt/scipy | scipy/interpolate/polyint.py | Python | bsd-3-clause | 22,678 |
from __future__ import unicode_literals
import json
from django import forms
from django.utils import six
from django.utils.six.moves.urllib.error import HTTPError, URLError
from django.utils.six.moves.urllib.parse import quote
from django.utils.translation import ugettext_lazy as _
from reviewboard.hostingsvcs.erro... | KnowNo/reviewboard | reviewboard/hostingsvcs/unfuddle.py | Python | mit | 9,535 |
"""
WSGI config for {{ project_name }} project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings.... | saydulk/edge | src/project_name/wsgi.py | Python | mit | 942 |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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 Foundation; either
version 2.1 of the License, ... | momm3/WelcomeBot | welcomebot/Lib/site-packages/websocket/_http.py | Python | mit | 7,582 |
##
# Copyright 2015-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 (htt... | ULHPC/modules | easybuild/easybuild-easyblocks/easybuild/easyblocks/generic/systemcompiler.py | Python | mit | 7,274 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
############################################
##### interesting parameters #####
############################################
# Cundall non-viscous damping
# try zero damping and watch total energy...
damping = 0.2
# initial angular velocity
angVel = 3.0
# use two sphe... | bcharlas/mytrunk | examples/simple-scene/simple-scene-energy-tracking.py | Python | gpl-2.0 | 4,783 |
#
# test_codecencodings_tw.py
# Codec encoding tests for ROC encodings.
#
from test import support
from test import multibytecodec_support
import unittest
class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5'
tstring = multibytecodec_support.load_teststring('big5')
codec... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_codecencodings_tw.py | Python | gpl-3.0 | 706 |
# Copyright 2011 OpenStack Foundation
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | eleonrk/SickRage | lib/pbr/builddoc.py | Python | gpl-3.0 | 10,898 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mock
import elasticsearch
from nose.plugins.attrib import attr
from nose.tools import eq_, ok_, assert_raises
f... | Serg09/socorro | socorro/unittest/external/es/test_crashstorage.py | Python | mpl-2.0 | 16,881 |
'''
Created on 5 mai 2009
@author: jmguilla
'''
import sys
import proactivelib
from hyperv_utils import *
import re
import traceback
from subprocess import *
#you have to set the following info to be able to
#bootstrap proactive runtime
#Your hyper-v server url
hypervServerAddress = None
#A hyper-v user
hypervServer... | moliva/proactive | scripts/virtualization/hyperv/hyperv.py | Python | agpl-3.0 | 1,395 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, unittest
import frappe.defaults
from frappe.utils import flt, nowdate, nowtime
from erpnext.stock.doctype.serial_no.serial_no import *
fr... | mahabuber/erpnext | erpnext/stock/doctype/stock_entry/test_stock_entry.py | Python | agpl-3.0 | 23,931 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | manuzhang/incubator-beam | sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py | Python | apache-2.0 | 4,457 |