code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | sysadminmatmoz/ingadhoc | sale_exceptions_ignore_approve/__openerp__.py | Python | agpl-3.0 | 1,775 |
# -*- coding: utf-8 -*-
"""Adds the default branch to all existing revisions
Note: This file is assumed to be in the same directory
as the project settings.py. Otherwise you have to set the
shell environment DJANGO_SETTINGS_MODULE
"""
import sys
import os
## Setup to import models from Django app ##
def import_from_... | cykl/codespeed | tools/migrate_script.py | Python | lgpl-2.1 | 1,602 |
# -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
from pilasengine.actores.actor import Actor
class Temporizador(Actor):
"""Representa un con... | apehua/pilas | pilasengine/actores/temporizador.py | Python | lgpl-3.0 | 2,226 |
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 applicable ... | ThatRfernand/or-tools | examples/python/bus_schedule.py | Python | apache-2.0 | 3,339 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | grengojbo/st2 | st2client/st2client/formatters/table.py | Python | apache-2.0 | 8,219 |
#
# 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... | Acehaidrey/incubator-airflow | airflow/providers/google/cloud/example_dags/example_tasks.py | Python | apache-2.0 | 5,840 |
# 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... | dmlc/tvm | python/tvm/relay/op/vision/_yolo.py | Python | apache-2.0 | 1,131 |
# 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... | juharris/tensorflow | tensorflow/contrib/metrics/python/ops/confusion_matrix_ops.py | Python | apache-2.0 | 4,520 |
#
# 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... | spektom/incubator-airflow | tests/providers/zendesk/hooks/test_zendesk.py | Python | apache-2.0 | 5,046 |
#
# 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... | rangadi/beam | sdks/python/apache_beam/runners/direct/direct_runner_test.py | Python | apache-2.0 | 4,539 |
"""Test for version 3 of the zero_out op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import tensorflow as tf
from tensorflow.g3doc.how_tos.adding_an_op import gen_zero_out_op_3
class ZeroOut3Test(tf.test.TestCase... | arunhotra/tensorflow | tensorflow/g3doc/how_tos/adding_an_op/zero_out_3_test.py | Python | apache-2.0 | 1,175 |
"""Base Entity for all TelldusLive entities."""
from datetime import datetime
import logging
from tellduslive import BATTERY_LOW, BATTERY_OK, BATTERY_UNKNOWN
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
ATTR_MANUFACTURER,
ATTR_MODEL,
ATTR_VIA_DEVICE,
DEVICE_DEFAULT_NAME,
)
from homeassist... | jawilson/home-assistant | homeassistant/components/tellduslive/entry.py | Python | apache-2.0 | 4,213 |
"""Coverage plugin for pytest."""
import os
import pytest
from coverage.misc import CoverageException
from . import embed
from . import engine
class CoverageError(Exception):
"""Indicates that our coverage is too low"""
def pytest_addoption(parser):
"""Add options to control coverage."""
group = pars... | enriquesanchezb/practica_utad_2016 | venv/lib/python2.7/site-packages/pytest_cov/plugin.py | Python | apache-2.0 | 7,461 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Manage data for pretraining and RL tasks."""
import ast
from collections import namedtuple
from absl import logging
from single_task import code_tasks # brain coder
RLBatch = namedtuple('RLBatch', ['re... | jiaphuan/models | research/brain_coder/single_task/data.py | Python | apache-2.0 | 3,685 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Track
# Records an event in Mixpanel.
#
# 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 use this file except in c... | jordanemedlock/psychtruths | temboo/core/Library/Mixpanel/Events/Track.py | Python | apache-2.0 | 4,842 |
# Copyright (c) 2016 PaddlePaddle 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 applic... | QiJune/Paddle | python/paddle/dataset/tests/flowers_test.py | Python | apache-2.0 | 1,707 |
import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdbp_p.dcl.resource import RESOURCE_PATH
from mi.dataset.driver.flord_g.ctdbp_p.dcl.flord_g_ctdbp_p_dcl_recovered_driver import parse
_author__ = 'jeff roy'
log = get_logger()... | renegelinas/mi-instrument | mi/dataset/driver/flord_g/ctdbp_p/dcl/test/test_flord_g_ctdbp_p_dcl_recovered_driver.py | Python | bsd-2-clause | 893 |
import unittest
from streamlink.plugins.senategov import SenateGov
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlSenateGov(PluginCanHandleUrl):
__plugin__ = SenateGov
should_match = [
"https://www.foreign.senate.gov/hearings/business-meeting-082218"
"https://www.se... | amurzeau/streamlink-debian | tests/plugins/test_senategov.py | Python | bsd-2-clause | 827 |
from django.core.management.base import BaseCommand, CommandError
try:
from django.contrib.auth import get_user_model # Django 1.5
except ImportError:
from django_extensions.future_1_5 import get_user_model
from django.contrib.auth.models import Group
from optparse import make_option
from sys import stdout
fro... | WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django_extensions/management/commands/export_emails.py | Python | bsd-3-clause | 5,292 |
"""
.. _tut_stats_cluster_source_rANOVA:
======================================================================
Repeated measures ANOVA on source data with spatio-temporal clustering
======================================================================
This example illustrates how to make use of the clustering funct... | jaeilepp/mne-python | tutorials/plot_stats_cluster_spatio_temporal_repeated_measures_anova.py | Python | bsd-3-clause | 12,088 |
"""Provide access to Python's configuration information.
"""
import sys
import os
from os.path import pardir, realpath
_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{base}/lib/python{py_version_short}',
'platstdlib': '{platbase}/lib/python{py_version_short}',
'purelib': '{ba... | nmercier/linux-cross-gcc | win32/bin/Lib/sysconfig.py | Python | bsd-3-clause | 23,180 |
import os
import sys
from github import Github
from github.GithubException import GithubException
def tag_to_tag():
SRC_TAG=os.environ.get('SRC_TAG')
ORG_NAME=os.environ.get('ORG_NAME')
REPO_NAME=os.environ.get('REPO_NAME')
USERNAME=os.environ.get('USERNAME')
PASSWORD=os.environ.get('PASSWORD')
... | jorrit-steporange/CumulusCI | ci/github/tag_to_tag.py | Python | bsd-3-clause | 1,855 |
import os
import numpy as np
from Cython.Build import cythonize
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('features', parent_package, top_path)
cythonize(os.path.j... | acrellin/mltsp | cesium/features/setup.py | Python | bsd-3-clause | 616 |
import hashlib
import logging
import requests
from builds.models import Version
from projects.utils import slugify_uniquely
from search.indexes import PageIndex, ProjectIndex, SectionIndex
from betterversion.better import version_windows, BetterVersion
log = logging.getLogger(__name__)
def sync_versions(project, ... | takluyver/readthedocs.org | readthedocs/restapi/utils.py | Python | mit | 4,957 |
#!/usr/bin/env python2
# Copyright (c) 2014 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 re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coin... | wederw/bitcoin | qa/rpc-tests/mempool_coinbase_spends.py | Python | mit | 3,823 |
from django.shortcuts import render
def perfeval_display_summation(request,input_dict,output_dict,widget):
if sum(input_dict['intList']) == input_dict['sum']:
check = 'The calculation appears correct.'
else:
check = 'The calculation appears incorrect!'
return render(request, 'visuali... | janezkranjc/clowdflows | workflows/perfeval/visualization_views.py | Python | gpl-3.0 | 446 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
os.environ[... | electrolinux/pootle | pootle/apps/pootle_app/management/commands/revision.py | Python | gpl-3.0 | 1,022 |
"""
MAVProxy rally module
"""
from pymavlink import mavwp
from pymavlink import mavutil
import time, os, platform
from MAVProxy.modules.lib import mp_module
from MAVProxy.modules.lib import mp_util
if mp_util.has_wxpython:
from MAVProxy.modules.lib.mp_menu import *
class RallyModule(mp_module.MPModule):
... | tridge/MAVProxy | MAVProxy/modules/mavproxy_rally.py | Python | gpl-3.0 | 13,720 |
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import json
import logging
import os
from openerp import api, exceptions, models, tools
from openerp.modules.module import get_module_path
from ..addon_hash import addo... | ddico/server-tools | module_auto_update/models/module.py | Python | agpl-3.0 | 6,204 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from .publis... | plamut/superdesk | server/apps/publish/content/__init__.py | Python | agpl-3.0 | 524 |
__author__ = 'davidcifuentes'
| poxstone/ANG2-TEMPLATE | myApp/tests/unit/__init__.py | Python | apache-2.0 | 30 |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | alexandrul-ci/robotframework | src/robot/parsing/tablepopulators.py | Python | apache-2.0 | 9,810 |
"""
Support for interface with an LG webOS Smart TV.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.webostv/
"""
import logging
import asyncio
from datetime import timedelta
from urllib.parse import urlparse
import voluptuous as vol
import... | JshWright/home-assistant | homeassistant/components/media_player/webostv.py | Python | apache-2.0 | 12,114 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflow/tensorflow | tensorflow/python/data/kernel_tests/optional_test.py | Python | apache-2.0 | 19,306 |
"""Don't warn if the class is instantiated in its own body."""
# pylint: disable=missing-docstring
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class Ala(object):
@abc.abstractmethod
def bala(self):
pass
@classmethod
def portocala(cls):
instance = cls()
return ins... | axbaretto/beam | sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/functional/abstract_class_instantiated_in_class.py | Python | apache-2.0 | 326 |
from __future__ import unicode_literals
from functools import partial
from future.utils import with_metaclass
from django import VERSION
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Model, Field
from django.db.models.signals import class_prepared... | fusionbox/mezzanine | mezzanine/utils/models.py | Python | bsd-2-clause | 8,880 |
"""
sentry.utils.cursors
~~~~~~~~~~~~~~~~~~~~
: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
import six
from collections import Sequence
class Cursor(object):
def __init__(self, value, offset=0,... | JackDanger/sentry | src/sentry/utils/cursors.py | Python | bsd-3-clause | 4,724 |
# Copyright (c) 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 unittest
from telemetry.core import browser_finder
from telemetry.unittest import simple_mock
from telemetry.unittest imp... | pozdnyakov/chromium-crosswalk | tools/telemetry/telemetry/core/chrome/form_based_credentials_backend_unittest_base.py | Python | bsd-3-clause | 4,429 |
# coding=utf-8
import time
import math
import multiprocessing
import os
import random
import sys
import signal
try:
from setproctitle import getproctitle, setproctitle
except ImportError:
setproctitle = None
from diamond.utils.signals import signal_to_exception
from diamond.utils.signals import SIGALRMExcept... | jriguera/Diamond | src/diamond/utils/scheduler.py | Python | mit | 3,514 |
# Natural Language Toolkit: Semantic Interpretation
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
NLTK Semantic Interpretation Package
This package contains classes for representing semantic structure in
formu... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/sem/__init__.py | Python | mit | 2,409 |
# $HeadURL$
__RCSID__ = "$Id$"
import types
from DIRAC import S_OK, S_ERROR
from DIRAC.ConfigurationSystem.Client.Config import gConfig
from DIRAC.ConfigurationSystem.Client.Helpers.CSGlobals import getVO
gBaseRegistrySection = "/Registry"
def getUsernameForDN( dn, usersList = False ):
if not usersList:
retVal... | Sbalbp/DIRAC | ConfigurationSystem/Client/Helpers/Registry.py | Python | gpl-3.0 | 9,778 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Alexandre Lissy
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | frankrousseau/weboob | modules/jvmalin/module.py | Python | agpl-3.0 | 1,678 |
# -*- test-case-name: twisted.mail.test.test_pop3client -*-
# Copyright (c) 2001-2004 Divmod Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
POP3 client protocol implementation
Don't use this module directly. Use twisted.mail.pop3 instead.
@author: Jp Calderone
"""
import re
from h... | ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/mail/pop3client.py | Python | agpl-3.0 | 24,412 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/clear_buffer_object.py | Python | lgpl-3.0 | 845 |
#
# 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... | lukecwik/incubator-beam | sdks/python/apache_beam/runners/portability/fn_api_runner/__init__.py | Python | apache-2.0 | 865 |
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from .. import interaction as inter
@pytest.fixture
def choosers():
return pd.DataFrame(
{'var1': range(5, 10),
'thing_id': ['a', 'c', 'e', 'g', 'i']})
@pytest.fixture
def alternatives():
return pd.DataFrame(
... | apdjustino/urbansim | urbansim/urbanchoice/tests/test_interaction.py | Python | bsd-3-clause | 1,734 |
"""
homeassistant.components.script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scripts are a sequence of actions that can be triggered manually
by the user or automatically based upon automation events, etc.
"""
import logging
from datetime import timedelta
import homeassistant.util.dt as date_util
import threading
from homeas... | michaelarnauts/home-assistant | homeassistant/components/script.py | Python | mit | 5,105 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | thaim/ansible | lib/ansible/module_utils/network/checkpoint/checkpoint.py | Python | mit | 19,463 |
# 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 ... | yaqiyang/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py | Python | mit | 2,204 |
# Standard modules
import os
import socket
import subprocess
import threading
# XBMC modules
import xbmc
import xbmcaddon
import xbmcgui
class OSMC_Communicator(threading.Thread):
''' Class to setup and manage the socket to allow communications between OSMC settings modules and external scripts.
For example, this... | srmo/osmc | package/mediacenter-addon-osmc/src/script.module.osmccommon/resources/lib/osmc_comms.py | Python | gpl-2.0 | 3,448 |
# OCFS2Console - GUI frontend for OCFS2 management and debugging
# Copyright (C) 2002, 2005 Oracle. 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 th... | Thermi/ocfs2-tools | ocfs2console/ocfs2interface/process.py | Python | gpl-2.0 | 4,541 |
from support import *
import datetime
@step('I press the purchase button')
def impl(ctx):
ctx.purchase_order = model('purchase.order').get([('sale_id', '=', ctx.saleorder.id)])
ctx.purchase_order._send('purchase_confirm')
@step('the purchase expected date is {date}')
def impl(ctx, date):
assert_equal(ct... | lepistone/oerpscenario | features/steps/purchase_order.py | Python | gpl-2.0 | 5,237 |
#
# Copyright (C) 2015 The CyanogenMod Project
#
# 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 agr... | TeamEOS/device_xiaomi_cancro | releasetools/releasetools.py | Python | gpl-2.0 | 1,275 |
#!/usr/bin/env python
# Take the pretsv format and make it CoNLL-like ("supertsv", having tweet metadata headers)
import sys,json
from datetime import datetime
for line in sys.stdin:
parts = line.split('\t')
tokens = parts[0].split()
tags = parts[1].split()
try:
d = json.loads(parts[-1])
... | balikasg/SemEval2016-Twitter_Sentiment_Evaluation | src/ark-tweet-nlp-0.3.2/scripts/toconll.py | Python | gpl-3.0 | 595 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2016 Factor Libre S.L. (http://factorlibre.com)
# Kiko Peiro <francisco.peiro@factorlibre.com>
#
#
# This program is free sof... | RamonGuiuGou/l10n-spain | l10n_es_aeat_mod340_cash_basis/wizard/__init__.py | Python | agpl-3.0 | 1,096 |
# 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... | HaebinShin/tensorflow | tensorflow/tools/test/run_and_gather_logs.py | Python | apache-2.0 | 3,287 |
# Copyright (c) 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... | huaweiswitch/neutron | neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py | Python | apache-2.0 | 48,351 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | punalpatel/st2 | st2reactor/st2reactor/container/manager.py | Python | apache-2.0 | 6,484 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Project'
db.create_table(u'logger_project', (
... | spatialdev/onadata | onadata/apps/logger/migrations/0048_auto__add_project__add_unique_project_name_organization__add_projectxf.py | Python | bsd-2-clause | 16,039 |
"""
The :mod:`sklearn.neighbors` module implements the k-nearest neighbors
algorithm.
"""
from .ball_tree import BallTree
from .kd_tree import KDTree
from .dist_metrics import DistanceMetric
from .graph import kneighbors_graph, radius_neighbors_graph
from .unsupervised import NearestNeighbors
from .classification impo... | chrsrds/scikit-learn | sklearn/neighbors/__init__.py | Python | bsd-3-clause | 1,176 |
'''tzinfo timezone information for Africa/Conakry.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Conakry(DstTzInfo):
'''Africa/Conakry timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Conakry'
... | newvem/pytz | pytz/zoneinfo/Africa/Conakry.py | Python | mit | 555 |
"""Dictionary Of Keys based matrix"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['dok_matrix', 'isspmatrix_dok']
import functools
import operator
import numpy as np
from scipy._lib.six import zip as izip, xrange, iteritems, itervalues
from .b... | yuanagain/seniorthesis | venv/lib/python2.7/site-packages/scipy/sparse/dok.py | Python | mit | 17,654 |
# SPDX-License-Identifier: GPL-2.0
#
# Runs UML kernel, collects output, and handles errors.
#
# Copyright (C) 2019, Google LLC.
# Author: Felix Guo <felixguoxiuping@gmail.com>
# Author: Brendan Higgins <brendanhiggins@google.com>
import logging
import subprocess
import os
import kunit_config
KCONFIG_PATH = '.confi... | c0d3z3r0/linux-rockchip | tools/testing/kunit/kunit_kernel.py | Python | gpl-2.0 | 4,537 |
"""Redo the `...` (representation) but with limits on most sizes."""
__all__ = ["Repr","repr"]
class Repr:
def __init__(self):
self.maxlevel = 6
self.maxtuple = 6
self.maxlist = 6
self.maxdict = 4
self.maxstring = 30
self.maxlong = 40
self.maxother = 20
... | remybaranx/qtaste | tools/jython/lib/Lib/repr.py | Python | gpl-3.0 | 3,151 |
# -*- 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... | crmccreary/openerp_server | openerp/addons/procurement/wizard/orderpoint_procurement.py | Python | agpl-3.0 | 2,927 |
# 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 by applicable law or agree... | petrutlucian94/nova | nova/objects/instance_action.py | Python | apache-2.0 | 8,756 |
"""Hubs and authorities analysis of graph structure.
"""
# Copyright (C) 2008-2012 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# NetworkX:http://networkx.github.io/
import networkx as nx
from networkx.... | ltiao/networkx | networkx/algorithms/link_analysis/hits_alg.py | Python | bsd-3-clause | 9,424 |
# Copyright 2017 The Sonnet 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 l... | mumuwoyou/vnpy-master | sonnet/python/modules/pondering_rnn.py | Python | mit | 7,717 |
#!/usr/bin/python
#
# Compares vmstate information stored in JSON format, obtained from
# the -dump-vmstate QEMU command.
#
# Copyright 2014 Amit Shah <amit.shah@redhat.com>
# Copyright 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | mwhudson/qemu | scripts/vmstate-static-checker.py | Python | gpl-2.0 | 12,817 |
# Copyright 2013 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 requ... | ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/api/openstack/compute/plugins/v3/block_device_mapping_v1.py | Python | gpl-2.0 | 2,738 |
# Minimal tests for dis module
from test.test_support import run_unittest
import unittest
import sys
import dis
import StringIO
def _f(a):
print a
return 1
dis_f = """\
%3d 0 LOAD_FAST 0 (a)
3 PRINT_ITEM
4 PRINT_NEWLINE
%3d 5 LOAD_CONST ... | HiSPARC/station-software | user/python/Lib/test/test_dis.py | Python | gpl-3.0 | 4,663 |
"""The GIOS component."""
import logging
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
from gios import ApiError, Gios, InvalidSensorsData, NoStationError
from homeassistant.core import Config, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from h... | sdague/home-assistant | homeassistant/components/gios/__init__.py | Python | apache-2.0 | 2,334 |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | shishaochen/TensorFlow-0.8-Win | third_party/grpc/src/python/grpcio/tests/unit/_links/_lonely_invocation_link_test.py | Python | apache-2.0 | 3,549 |
import unittest
from louie.saferef import safe_ref
class _Sample1(object):
def x(self):
pass
def _sample2(obj):
pass
class _Sample3(object):
def __call__(self, obj):
pass
class TestSaferef(unittest.TestCase):
# XXX: The original tests had a test for closure, and it had ... | bathepawan/workload-automation | wlauto/external/louie/test/test_saferef.py | Python | apache-2.0 | 2,162 |
# This script is used to parse BOOST special function test data into something
# we can easily import in numpy.
import re
import os
# Where to put the data (directory will be created)
DATA_DIR = 'scipy/special/tests/data/boost'
# Where to pull out boost data
BOOST_SRC = "boostmath/test"
CXX_COMMENT = re.compile(r'^\s... | anntzer/scipy | scipy/special/utils/convert.py | Python | bsd-3-clause | 3,448 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django.contrib.admin.options import ModelAdmin, csrf_protect_m
from django.contrib.admin.views.main import SEARCH_VAR, ChangeList
from django.core.exceptions import PermissionDenied
from django.core.paginator imp... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/haystack/admin.py | Python | mit | 6,567 |
# -*- coding: utf-8 -*-
# daemon/pidfile.py
# Part of ‘python-daemon’, an implementation of PEP 3143.
#
# Copyright © 2008–2015 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Apache License, version 2.0 as published by the
#... | madflow/qnap-radicale | shared/lib/daemon/pidfile.py | Python | gpl-2.0 | 2,139 |
plot = variance.plot(norm='log', vmin=.5, cmap='plasma')
ax = plot.gca()
ax.grid()
ax.set_xlim(20, 1500)
ax.set_ylim(1e-24, 1e-20)
ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel(r'[strain/\rtHz]')
ax.set_title('LIGO-Livingston sensitivity variance')
plot.show() | gwpy/gwpy.github.io | docs/v0.5/examples/frequencyseries/variance-3.py | Python | gpl-3.0 | 260 |
# Copyright 2013 Cloudbase Solutions Srl
#
# 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 l... | petrutlucian94/nova | nova/tests/functional/v3/test_console_auth_tokens.py | Python | apache-2.0 | 1,890 |
# 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... | laosiaudi/tensorflow | tensorflow/python/kernel_tests/decode_raw_op_test.py | Python | apache-2.0 | 2,806 |
# Copyright 2013 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 requ... | roopali8/tempest | tempest/api/network/test_extra_dhcp_options.py | Python | apache-2.0 | 4,062 |
#!/usr/bin/env python
'''
This example shows how to display a SimpleCV image in a QT window
the code was taken from the forum post here:
http://help.simplecv.org/question/1866/any-simple-pyqt-sample-regarding-ui-or-display/
Author: Rodrigo gomes
'''
import os
import sys
import signal
from PyQt4 import uic, QtGui, Qt... | beni55/SimpleCV | SimpleCV/examples/display/qt-example.py | Python | bsd-3-clause | 2,247 |
from bamboo_boy.materials import Clump
import random
import factory
from comments.models import DocumentComment, DocumentNode, NodeSnapshot
from rtd_tests.factories.general_factories import UserFactory
from rtd_tests.factories.projects_factories import ProjectFactory
class SnapshotFactory(factory.DjangoModelFactory... | takluyver/readthedocs.org | readthedocs/rtd_tests/factories/comments_factories.py | Python | mit | 2,656 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | SiderZhang/p2pns3 | src/emu/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 285,868 |
# -*- coding: utf-8 -*-
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Pixmap import Pixmap
from Components.Sources.StaticText import StaticText
from Components.MenuList import MenuL... | XTAv2/Enigma2 | lib/python/Screens/SkinSelector.py | Python | gpl-2.0 | 5,279 |
# -*- coding: utf-8 -*-
"""
Holds all the information relevant to the client (addresses for instance)
"""
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
BASE_ADDRESS_TEMPLATE = \
_("""
Name: %(name)s,
Address: %(ad... | NB-Dev/django-shop | shop/addressmodel/models.py | Python | bsd-3-clause | 2,375 |
# Test inplace special methods enabled by MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS
class A:
def __imul__(self, other):
print("__imul__")
return self
def __imatmul__(self, other):
print("__imatmul__")
return self
def __ifloordiv__(self, other):
print("__ifloordiv__")... | MrSurly/micropython | tests/basics/class_inplace_op2.py | Python | mit | 1,293 |
# Copyright 2010 WebDriver committers
# Copyright 2010 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 ap... | ktan2020/legacy-automation | win/Lib/site-packages/selenium/webdriver/remote/errorhandler.py | Python | mit | 6,980 |
#!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... | Jorge-Rodriguez/ansible | lib/ansible/modules/network/netvisor/pn_port_config.py | Python | gpl-3.0 | 12,238 |
# pylint: skip-file
# vim: expandtab:tabstop=4:shiftwidth=4
#pylint: disable=too-many-branches
def main():
''' ansible module for gcloud iam service-account keys'''
module = AnsibleModule(
argument_spec=dict(
# credentials
state=dict(default='present', type='str', choices=['pres... | appuio/ansible-role-openshift-zabbix-monitoring | vendor/openshift-tools/ansible/roles/lib_gcloud/build/ansible/gcloud_iam_sa_keys.py | Python | apache-2.0 | 2,395 |
# -*- coding:utf-8 -*-
from . import swissqr_report | ddico/odoo | addons/l10n_ch/report/__init__.py | Python | agpl-3.0 | 52 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import CalculateNormalizedMoments
def test_CalculateNormalizedMoments_inputs():
input_map = dict(moment=dict(mandatory=True,
),
timeseries_file=dict(mandatory=True,
),
)
inp... | JohnGriffiths/nipype | nipype/algorithms/tests/test_auto_CalculateNormalizedMoments.py | Python | bsd-3-clause | 858 |
#!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | bcoca/ansible-modules-extras | cloud/centurylink/clc_group.py | Python | gpl-3.0 | 17,070 |
# 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... | cg31/tensorflow | tensorflow/contrib/tensor_forest/python/ops/topn_ops.py | Python | apache-2.0 | 1,923 |
# 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.c... | sameerparekh/pants | tests/python/pants_test/tasks/test_builddict.py | Python | apache-2.0 | 1,523 |
# Copyright 2014 Alcatel-Lucent USA 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 l... | samsu/neutron | plugins/nuage/common/exceptions.py | Python | apache-2.0 | 919 |
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.views.generic.base import View
from django.utils.encoding import force_str
from .models import Author, Artist
class ListViewTests(TestCase):
fixtures = ... | beckastar/django | tests/generic_views/test_list.py | Python | bsd-3-clause | 10,510 |
# sqlite/base.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the SQLite database.
For information on connecting using a specific dri... | SohKai/ChronoLogger | web/flask/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/base.py | Python | mit | 32,174 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
VMWARE external inventory script
=================================
shamelessly copied from existing inventory scripts.
This script and it's ini can be used more than once,
i.e vmware.py/vmware_colo.ini vmware_idf.py/vmware_idf.ini
(script can be link)
so if you don'... | mwarkentin/ansible | plugins/inventory/vmware.py | Python | gpl-3.0 | 6,210 |
# 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
# d... | tobegit3hub/cinder_docker | cinder/volume/flows/api/manage_existing.py | Python | apache-2.0 | 6,017 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.