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 |
|---|---|---|---|---|---|
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | stdweird/aquilon | lib/python2.6/aquilon/worker/commands/update_interface_machine.py | Python | apache-2.0 | 7,493 |
#!/usr/bin/env python2.7
# Copyright 2015 Cisco 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.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | tbarrongh/cosc-learning-labs | src/learning_lab/01_inventory_not_connected.py | Python | apache-2.0 | 1,219 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | akosel/incubator-airflow | airflow/operators/oracle_operator.py | Python | apache-2.0 | 2,130 |
# Copyright (c) 2020 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 app... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_executor_check_feed.py | Python | apache-2.0 | 3,210 |
"""Test the IPython.kernel public API
Authors
-------
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed ... | noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/kernel/tests/test_public_api.py | Python | apache-2.0 | 1,308 |
# 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)
import shutil
import... | pgroudas/pants | tests/python/pants_test/tasks/test_cache_manager.py | Python | apache-2.0 | 4,697 |
#!/usr/bin/python
#
# Author: Rajesh Sinha, Karan Narain
# The base class for Twitter and GPlus Objects
#
import logging
import sys
from bs4 import BeautifulSoup
import urllib2
import re
## Some Important constants
_parser = "lxml" ## remember to pip install lxml or else use another parser
_loggingLevel = loggin... | sinharrajesh/dbtools | google-plus-analysis/SocialNW.py | Python | apache-2.0 | 4,807 |
#!/usr/bin/env python
import logging
import sys
import os
import signal
import conf
import core
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol.TBinaryProtocol import TBinaryProtocolAcceleratedFactory
from thrift.server import TServer
from rpc import RndNodeApi
log... | chadmv/plow | lib/python/plow/rndaemon/server.py | Python | apache-2.0 | 2,191 |
#!/usr/bin/env python
import lib_v2 as lib
import sys
import os
def main(argv=None):
"""
Usage is:
submit.py [--account <chargecode>] [--url <url>] -- <commandline>
Run from the working dir of the job which must contain (in addition
to the job files) a file named scheduler.conf with scheduler prop... | SciGaP/DEPRECATED-Cipres-Airavata-POC | saminda/cipres-airavata/sdk/scripts/remote_resource/trestles/submit_v2.py | Python | apache-2.0 | 5,478 |
# 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... | chemelnucfin/tensorflow | tensorflow/python/autograph/impl/api_test.py | Python | apache-2.0 | 30,339 |
import time
from headset import Headset
from stream import Stream
from common import Version, BytesStatus
class WirelessHeadset(Headset):
"""This class represents the wireless version of the mindwave
Args:
dev: device link
headset: the id of mindwave wireless version
It has the basic f... | jacquelinekay/gsoc-ros-neural | mindwave_driver/src/mindwave_driver/wireless_headset.py | Python | apache-2.0 | 2,166 |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | caioserra/apiAdwords | tests/adspygoogle/dfp/dfp_utils_test.py | Python | apache-2.0 | 10,061 |
# -*- coding: utf-8 -*-
"""Parser for Windows EventLog (EVT) files."""
import pyevt
from plaso import dependencies
from plaso.events import time_events
from plaso.lib import errors
from plaso.lib import eventdata
from plaso.lib import specification
from plaso.parsers import interface
from plaso.parsers import manager... | ostree/plaso | plaso/parsers/winevt.py | Python | apache-2.0 | 7,068 |
#!/usr/bin/env python
"""A simple wrapper to send email alerts."""
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import logging
import re
import smtplib
import socket
from grr.lib import config_lib
from grr.lib im... | pidydx/grr | grr/lib/email_alerts.py | Python | apache-2.0 | 5,328 |
"""
(c) 2020 Kirk Byers <ktbyers@twb-tech.com>
(c) 2016 Elisa Jasinska <elisa@bigwaveit.org>
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, ... | napalm-automation/napalm-ansible | napalm_ansible/modules/napalm_get_facts.py | Python | apache-2.0 | 9,930 |
"""Tests for the nut integration."""
import json
from unittest.mock import MagicMock, patch
from homeassistant.components.nut.const import DOMAIN
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_RESOURCES
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, load_fixture
... | aronsky/home-assistant | tests/components/nut/util.py | Python | apache-2.0 | 1,446 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-06 05:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_hackathon_name'),
]
operations = [
migrations.AlterField(
... | andrewsosa/hackfsu_com | api/api/migrations/0003_auto_20161206_0538.py | Python | apache-2.0 | 458 |
# 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... | nathanbjenx/cairis | cairis/core/ResponseParameters.py | Python | apache-2.0 | 1,469 |
# 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 t... | briancurtin/rackspace-sdk-plugin | rackspace/profile.py | Python | apache-2.0 | 1,044 |
# Copyright (C) 2013-2015 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013-2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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
#
... | Tesi-Luca-Davide/ryu | ryu/ofproto/oxm_fields.py | Python | apache-2.0 | 13,622 |
from plow.gui.manifest import QtCore, QtGui
from plow.gui.util import formatDateTime, formatDuration
__all__ = [
"Text",
"Number",
"Decimal",
"DateTime",
"PillWidget",
"Checkbox"
]
class FormWidget(QtGui.QWidget):
"""
The base class for all form widgets.
"""
__LOCKED_PIX = None... | chadmv/plow | lib/python/plow/gui/form/fwidgets.py | Python | apache-2.0 | 4,081 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | dvliman/jaikuengine | .google_appengine/google/appengine/tools/devappserver2/module_test.py | Python | apache-2.0 | 90,007 |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import debug
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat.integer import from_bytes
from pyasn1.compat.octets import oc... | kawamon/hue | desktop/core/ext-py/pyasn1-0.4.6/pyasn1/codec/ber/decoder.py | Python | apache-2.0 | 58,050 |
# Copyright (c) 2019 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 app... | tensor-tang/Paddle | python/paddle/fluid/contrib/tests/test_distributed_reader.py | Python | apache-2.0 | 1,305 |
"""
Plots a scatter plot of 2 metrics provided.
Data could be given from postgres or a csv file.
"""
from matplotlib.colors import LogNorm
from mpl_toolkits.mplot3d import Axes3D
import sys
import numpy as np
import argparse
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
from common import add_db... | kexinrong/macrobase | tools/py_analysis/plot_distribution.py | Python | apache-2.0 | 7,071 |
"""Implementation of basic magic functions."""
import argparse
import textwrap
import io
import sys
from pprint import pformat
from IPython.core import magic_arguments, page
from IPython.core.error import UsageError
from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes
from IPython.utils.tex... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/core/magics/basic.py | Python | bsd-2-clause | 21,310 |
"""
Django ID mapper
Modified for Evennia by making sure that no model references
leave caching unexpectedly (no use if WeakRefs).
Also adds cache_size() for monitoring the size of the cache.
"""
import os, threading
#from twisted.internet import reactor
#from twisted.internet.threads import blockingCallFromThread
f... | tectronics/evennia | src/utils/idmapper/base.py | Python | bsd-3-clause | 19,327 |
from unittest import mock
from django.db import connection, migrations
try:
from django.contrib.postgres.operations import (
BloomExtension, BtreeGinExtension, BtreeGistExtension, CITextExtension,
CreateExtension, CryptoExtension, HStoreExtension, TrigramExtension,
UnaccentExtension,
)... | kaedroho/django | tests/postgres_tests/migrations/0001_setup_extensions.py | Python | bsd-3-clause | 1,212 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<https://docs.astropy.org/en/latest/cosmology/index.html>`_ for more
detailed usage examples a... | mhvk/astropy | astropy/cosmology/__init__.py | Python | bsd-3-clause | 830 |
# -*- coding:utf-8 -*-
from django.utils.translation import ugettext_lazy as _
# SearchForm's strings
SEARCH_FORM_KEYWORDS = _(u'Key Words / Profession')
SEARCH_FORM_LOCATION = _(u'City, State or Zip Code')
# SearchFiltersForm's strings
SEARCH_FILTERS_FORM_JOB_POSITION = _(u'Job Position')
SEARCH_FILTERS_FORM_EXPERIE... | hellhovnd/dentexchange | dentexchange/apps/search/strings.py | Python | bsd-3-clause | 551 |
# -*- coding: utf-8 -*-
""":mod:`itertools` is full of great examples of Python generator
usage. However, there are still some critical gaps. ``iterutils``
fills many of those gaps with featureful, tested, and Pythonic
solutions.
Many of the functions below have two versions, one which
returns an iterator (denoted by ... | doublereedkurt/boltons | boltons/iterutils.py | Python | bsd-3-clause | 32,952 |
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': 'Prompt',
# list of one or more authors for the module
... | Hackplayers/Empire-mod-Hpys-tests | lib/modules/python/collection/osx/prompt.py | Python | bsd-3-clause | 3,830 |
#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.conf.urls import patterns
from django.conf.urls import url
from django.contrib.admin.sites import AlreadyRegistered
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import Improperl... | django-bmf/django-bmf | djangobmf/core/module.py | Python | bsd-3-clause | 17,355 |
import sys
from apps.cowry.exceptions import PaymentMethodNotFound
from django.utils.importlib import import_module
def _load_from_module(path):
package, attr = path.rsplit('.', 1)
module = import_module(package)
return getattr(module, attr)
# TODO read django settings to find out what adapters to load.
... | onepercentclub/onepercentclub-site | apps/cowry/factory.py | Python | bsd-3-clause | 3,526 |
"""
Example OAuthenticator to use with My Service
"""
import json
from jupyterhub.auth import LocalAuthenticator
from oauthenticator.oauth2 import OAuthLoginHandler, OAuthenticator
from tornado.auth import OAuth2Mixin
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient... | minrk/oauthenticator | docs/source/example-oauthenticator.py | Python | bsd-3-clause | 3,918 |
class ServiceError(Exception):
"""Base class for exceptions in this module."""
pass
class UnsupportedFormatError(ServiceError):
"""Used to raise exceptions when a response doesn't match expected semantics or for failed version checks."""
pass
class MissingLayerError(ServiceError):
... | venicegeo/eventkit-cloud | eventkit_cloud/utils/services/errors.py | Python | bsd-3-clause | 454 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from ionyweb.page.models import Page, Layout
admin.site.register(Page)
admin.site.register(Layout)
| makinacorpus/ionyweb | ionyweb/page/admin.py | Python | bsd-3-clause | 158 |
from distutils.core import setup
setup(
name='PyMonad',
version='1.3',
author='Jason DeLaat',
author_email='jason.develops@gmail.com',
packages=['pymonad', 'pymonad.test'],
url='https://bitbucket.org/jason_delaat/pymonad',
license=open('LICENSE.txt').read(),
description='Collection of c... | fnl/pymonad | setup.py | Python | bsd-3-clause | 824 |
# Copyright (c) 2013 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.
"""Module containing the various stages that a builder runs."""
import json
import logging
import os
from chromite.cbuildbot import commands
from ch... | bpsinc-native/src_third_party_chromite | cbuildbot/stages/release_stages.py | Python | bsd-3-clause | 14,805 |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
from past.utils import old_div
import unittest
import json... | shankari/e-mission-server | emission/incomplete_tests/TestCarbon.py | Python | bsd-3-clause | 13,159 |
"""
Module to read MODPATH output files. The module contains two
important classes that can be accessed by the user.
* EndpointFile (ascii endpoint file)
* PathlineFile (ascii pathline file)
"""
import numpy as np
from ..utils.flopy_io import loadtxt
class PathlineFile():
"""
PathlineFile Class.
Par... | brclark-usgs/flopy | flopy/utils/modpathfile.py | Python | bsd-3-clause | 20,645 |
# -*- encoding: utf-8 -*-
# Module iacolorhist
def iacolorhist(f, mask=None):
import numpy as np
from iahistogram import iahistogram
WFRAME=5
f = np.asarray(f)
if len(f.shape) == 1: f = f[np.newaxis,:]
if not f.dtype == 'uint8':
raise Exception,'error, can only process uint8 images'
... | robertoalotufo/ia636 | ia636/iacolorhist.py | Python | bsd-3-clause | 1,449 |
from os.path import dirname
import sys
from django.test import TestCase
from django.conf import settings
from django.test.utils import override_settings
import oscar
from oscar.core.loading import (
get_model, AppNotFoundError, get_classes, get_class, ClassNotFoundError)
from oscar.test.factories import create_pr... | sonofatailor/django-oscar | tests/integration/core/test_loading.py | Python | bsd-3-clause | 11,789 |
import sys
from time import sleep
from cachey import Cache, Scorer, nbytes
def test_cache():
c = Cache(available_bytes=nbytes(1) * 3)
c.put('x', 1, 10)
assert c.get('x') == 1
assert 'x' in c
c.put('a', 1, 10)
c.put('b', 1, 10)
c.put('c', 1, 10)
assert set(c.data) == set('xbc')
c... | Winterflower/cachey | cachey/tests/test_cache.py | Python | bsd-3-clause | 1,608 |
from __future__ import absolute_import, division, print_function
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed ... | Kleptobismol/scikit-bio | skbio/tree/_exception.py | Python | bsd-3-clause | 814 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test for distributed trial worker side.
"""
import os
from cStringIO import StringIO
from zope.interface.verify import verifyObject
from twisted.trial.reporter import TestResult
from twisted.trial.unittest import TestCase
from... | hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/trial/_dist/test/test_worker.py | Python | bsd-3-clause | 15,115 |
from threading import Thread
import Queue
from django.core.urlresolvers import reverse
from django.conf import settings
from django import forms
from django.http import HttpRequest
from django.test import TestCase
import haystack
from haystack.forms import model_choices, SearchForm, ModelSearchForm
from haystack.query ... | soad241/django-haystack | tests/core/tests/views.py | Python | bsd-3-clause | 7,147 |
from django.conf import settings
def bitgroup_cache_key(slug):
return "%s:%s" % (
getattr(settings, 'PAGEBIT_CACHE_PREFIX', 'pagebits'),
slug
)
| frankwiles/django-pagebits | pagebits/utils.py | Python | bsd-3-clause | 171 |
import logging
import pytest
def test_tracing_by_function_if_enable(track_logger, handler):
msg1 = 'TEST1'
msg2 = 'TEST2'
msg3 = 'TEST3'
track_logger.setLevel(logging.INFO)
track_logger.enable_tracking()
track_logger.debug(msg1)
track_logger.info(msg2)
track_logger.disable_... | kivio/python-structured-logging | tests/test_tracking_logger.py | Python | bsd-3-clause | 3,755 |
#!/usr/bin/env python
import sys
from roslaunch.xmlloader import XmlLoader, loader
from rosgraph.names import get_ros_namespace
from rqt_launchtree.launchtree_context import LaunchtreeContext
class LaunchtreeLoader(XmlLoader):
def _include_tag(self, tag, context, ros_config, default_machine, is_core, verbose):
i... | pschillinger/rqt_launchtree | src/rqt_launchtree/launchtree_loader.py | Python | bsd-3-clause | 2,423 |
"""
Provides Matlab-like tic, tac and toc functions.
"""
import time
import numpy as np
class __Timer__:
"""Computes elapsed time, between tic, tac, and toc.
Methods
-------
tic :
Resets timer.
toc :
Returns and prints time elapsed since last tic().
tac :
Returns and ... | oyamad/QuantEcon.py | quantecon/util/timing.py | Python | bsd-3-clause | 5,239 |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests that a set of symbols are truly pruned from the translator.
Compares the pruned down "on-device" translator with the "fa... | CTSRD-SOAAP/chromium-42.0.2311.135 | native_client/pnacl/prune_test.py | Python | bsd-3-clause | 6,842 |
import os.path
from django.conf import settings
from django.test.utils import override_settings
import mock
from celery.result import AsyncResult
from olympia import amo
from olympia.amo.tests import TestCase, addon_factory, version_factory
from olympia.devhub import tasks, utils
from olympia.files.models import Fi... | lavish205/olympia | src/olympia/devhub/tests/test_utils.py | Python | bsd-3-clause | 10,323 |
"""
Test data sources
"""
from nose.tools import ok_, eq_
from carousel.tests import logging
from carousel.core import UREG
from carousel.core.data_sources import DataSource, DataParameter
from carousel.core.data_readers import XLRDReader
from carousel.tests import PROJ_PATH, TESTS_DIR
import os
LOGGER = logging.getL... | mikofski/Carousel | carousel/tests/test_data.py | Python | bsd-3-clause | 5,322 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | mfem/PyMFEM | mfem/_ser/stable3d.py | Python | bsd-3-clause | 5,714 |
# coding: utf-8
# pylint: disable = invalid-name, W0105, C0301
from __future__ import absolute_import
import collections
from operator import gt, lt
from .compat import range_
class EarlyStopException(Exception):
"""Exception of early stopping.
Parameters
----------
best_iteration : int
The... | Allardvm/LightGBM | python-package/lightgbm/callback.py | Python | mit | 6,890 |
'''Todo:
* Add multiple thread support for async_process functions
* Potentially thread each handler function? idk
'''
import sys
import socket
import re
import threading
import logging
import time
if sys.hexversion < 0x03000000:
#Python 2
import Queue as queue
BlockingIOError = socket.error
else:
imp... | codetalkio/TelegramIRCImageProxy | asyncirc/ircbot.py | Python | mit | 5,983 |
import os
def get_html_theme_path():
theme_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
return theme_dir
| iktakahiro/sphinx_theme_pd | sphinx_theme_pd/__init__.py | Python | mit | 136 |
import unittest
import chainer
from chainer import testing
from chainer.testing import attr
from chainercv.links.model.deeplab import SeparableASPP
class TestSeparableASPP(unittest.TestCase):
def setUp(self):
self.in_channels = 128
self.out_channels = 32
self.link = SeparableASPP(
... | chainer/chainercv | tests/links_tests/model_tests/deeplab_tests/test_aspp.py | Python | mit | 975 |
"""tests/test_output_format.py.
Tests the output format handlers included with Hug
Copyright (C) 2015 Timothy Edmund Crosley
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, ... | janusnic/hug | tests/test_output_format.py | Python | mit | 2,987 |
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.with_requires('theano')
class TheanoFunctionTestBase(object):
fo... | aonotas/chainer | tests/chainer_tests/links_tests/theano_tests/test_theano_function.py | Python | mit | 5,778 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 23 13:23:20 2018
@author: BallBlueMeercat
"""
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize('firstderivs_cython.pyx')) | lefthandedroo/Cosmo-models | zprev versions/Models_py_backup/setup.py | Python | mit | 243 |
import Base
import VS
import GUI
import XGUITypes
import XGUIDebug
XGUIRootSingleton = None
XGUIPythonScriptAPISingleton = None
"""----------------------------------------------------------------"""
""" """
""" XGUIRoot - root management interface for th... | vegastrike/Assets-Production | modules/XGUI.py | Python | gpl-2.0 | 2,379 |
import sys
def inputText():
input = sys.stdin.readline()
return input.strip()
def inputChoices(list, backcmd = "b", backtext = "back"):
repeat = True
while repeat:
repeat = False
count = 0
for item in list:
print count, "-", item
count += 1
print backcmd, "-", backtext
input = inputText()
if inp... | popazerty/beyonwiz-4.1 | tools/host_tools/FormatConverter/input.py | Python | gpl-2.0 | 432 |
#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2015 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 be usef... | cgwalters/pykickstart | tests/commands/reqpart.py | Python | gpl-2.0 | 1,533 |
#!/usr/bin/env python
#
# Plugin.py
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | tweemeterjop/thug | thug/DOM/Plugin.py | Python | gpl-2.0 | 1,536 |
##
# Copyright 2012-2021 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://www.vscentrum.be),
# Flemish Research Foundation (F... | hpcugent/easybuild-framework | easybuild/toolchains/iompi.py | Python | gpl-2.0 | 4,978 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | leohmoraes/weblate | weblate/trans/views/basic.py | Python | gpl-3.0 | 14,336 |
# Copyright (c) 2015-2016 Anish Athalye. Released under GPLv3.
import tensorflow as tf
import numpy as np
import scipy.io
import pdb
MEAN_PIXEL = np.array([ 123.68 , 116.779, 103.939])
def net(data_path, input_image):
layers = (
'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1',
'conv2_1', '... | mgoubran/MeuralPaint | vgg.py | Python | gpl-3.0 | 1,993 |
# Copyright (C) 2009-2010 Sergey Koposov
# This file is part of astrolibpy
#
# astrolibpy 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 ... | segasai/astrolibpy | my_utils/from_hex.py | Python | gpl-3.0 | 1,118 |
from django.contrib import admin
from article.models import Article
# Register your models here.
admin.site.register(Article)
| daimon99/pyer | my_blog/article/admin.py | Python | gpl-3.0 | 127 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | veger/ansible | lib/ansible/template/__init__.py | Python | gpl-3.0 | 30,186 |
# -*- coding: utf-8 -*-
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['admin']
| Karaage-Cluster/karaage-debian | karaage/legacy/admin/south_migrations/0004_auto__del_logentry.py | Python | gpl-3.0 | 237 |
#!/usr/bin/env python2
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Post-Process to CouchPotato, SickBeard, NzbDrone, Mylar, Gamez, HeadPhones.
#
# This script sends the download to your automated media... | DxCx/nzbToMedia | nzbToGamez.py | Python | gpl-3.0 | 2,702 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | sestrella/ansible | lib/ansible/modules/cloud/google/gcp_pubsub_subscription_info.py | Python | gpl-3.0 | 11,806 |
import random
from cloudbot.util import http, formatting
def api_get(kind, query):
"""Use the RESTful Google Search API"""
url = 'http://ajax.googleapis.com/ajax/services/search/%s?' \
'v=1.0&safe=moderate'
return http.get_json(url % kind, q=query)
# @hook.command("googleimage", "gis", "image... | weylin/CloudBot | plugins/google.py | Python | gpl-3.0 | 1,653 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | elfnor/sverchok | nodes/analyzer/kd_tree_edges_mk2.py | Python | gpl-3.0 | 4,347 |
""" UserProfileDB class is a front-end to the User Profile Database
"""
__RCSID__ = "$Id$"
import types
import os
import sys
import hashlib
from DIRAC import S_OK, S_ERROR, gLogger, gConfig
from DIRAC.Core.Utilities import Time
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
from DIRAC.Core.Base.DB im... | arrabito/DIRAC | FrameworkSystem/DB/UserProfileDB.py | Python | gpl-3.0 | 27,552 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import... | rkokkelk/Gulliver | deluge/core/filtermanager.py | Python | gpl-3.0 | 9,642 |
#!/usr/bin/env python
# encoding: utf-8
"""A ${VISUAL} placeholder that will use the text that was last visually
selected and insert it here. If there was no text visually selected, this will
be the empty string. """
import re
import textwrap
from UltiSnips import _vim
from UltiSnips.indent_util import IndentUtil
fr... | eduardomallmann/vim-and-bash | pythonx/UltiSnips/text_objects/_visual.py | Python | gpl-3.0 | 2,074 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | elego/tkobr-addons | unported/tko_purchase_show_only_supplier_products/__init__.py | Python | agpl-3.0 | 1,094 |
# -*- coding: 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 field 'Order.name'
db.add_column('valueaccounting_order', 'name',
self.gf('dj... | thierrymarianne/valuenetwork | valuenetwork/valueaccounting/migrations/0003_auto__add_field_order_name__add_field_economicresource_independent_dem.py | Python | agpl-3.0 | 47,400 |
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class IRActionsWindow(models.Model):
_inherit = 'ir.actions.act_window'
@api.multi
def read(self, fields=None, context=None, load='_classic_read'):
actions = super(IRActionsW... | brain-tec/partner-contact | partner_contact_in_several_companies/models/ir_actions.py | Python | agpl-3.0 | 922 |
"""
Logistration API View Tests
"""
from unittest.mock import patch
from urllib.parse import urlencode
import socket
import ddt
from django.conf import settings
from django.urls import reverse
from rest_framework.test import APITestCase
from common.djangoapps.student.models import Registration
from common.djangoapps.s... | edx/edx-platform | openedx/core/djangoapps/user_authn/api/tests/test_views.py | Python | agpl-3.0 | 7,808 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
def execute(filters=None):
args =... | gangadharkadam/v5_erp | erpnext/accounts/report/accounts_payable/accounts_payable.py | Python | agpl-3.0 | 461 |
default_app_config = 'apps.datasetmanager.apps.datasetmanagerConfig'
| almey/policycompass-services | apps/datasetmanager/__init__.py | Python | agpl-3.0 | 69 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Schedulers determine how worker's queues get filled. They control which
locations get scanned, in what order, at what time. This allows further
optimizations to be easily added, without having to modify the existing
overseer and worker thread code.
Schedulers will recieve... | slgphantom/RocketMap | pogom/schedulers.py | Python | agpl-3.0 | 46,757 |
# -*- coding: utf-8 -*-
#
# privacyIDEA is a fork of LinOTP
# May 08, 2014 Cornelius Kölbel
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# 2014-10-17 Fix the empty result problem
# Cornelius Kölbel, <cornelius@privacyidea.org>
#
# Copyright (C) 2010 - 2014 LSE Leading Security Experts G... | woddx/privacyidea | privacyidea/lib/auditmodules/base.py | Python | agpl-3.0 | 7,831 |
"""
Django Admin pages for DiscountRestrictionConfig.
"""
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from openedx.core.djangoapps.config_model_utils.admin import StackedConfigModelAdmin
from .models import DiscountPercentageConfig, DiscountRestrictionConfig
class Disco... | edx/edx-platform | openedx/features/discounts/admin.py | Python | agpl-3.0 | 2,665 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | lib/spack/external/__init__.py | Python | lgpl-2.1 | 2,139 |
from __future__ import absolute_import, unicode_literals
from case import Mock, patch
from amqp.five import text_t
from amqp.utils import (NullHandler, bytes_to_str, coro, get_errno, get_logger,
str_to_bytes)
class test_get_errno:
def test_has_attr(self):
exc = KeyError('foo')
... | pexip/os-python-amqp | t/unit/test_utils.py | Python | lgpl-2.1 | 2,126 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | var/spack/repos/builtin/packages/lzma/package.py | Python | lgpl-2.1 | 1,935 |
#!/usr/bin/env python
import sys, math
if len(sys.argv) != 3:
print("Usage:")
print("%s [RA HH:MM:SS] [DEC Deg:Arcmin:Arcsec] " % sys.argv[0])
exit(0)
ra = sys.argv[1]
dec = sys.argv[2]
rai = ra.split(":")
deci = dec.split(":")
radeg = float(rai[0]) * 15.0 + float(rai[1]) * (1.0 / 60.0) + float(rai[2])... | ari-zah/gaiasky | core/scripts/radec-conv.py | Python | lgpl-3.0 | 472 |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | caioserra/apiAdwords | examples/adspygoogle/dfp/v201306/deactivate_placements.py | Python | apache-2.0 | 2,253 |
"""The tests for hls streams."""
from datetime import timedelta
from io import BytesIO
from unittest.mock import patch
from homeassistant.setup import async_setup_component
from homeassistant.components.stream.core import Segment
from homeassistant.components.stream.recorder import recorder_save_worker
import homeassi... | auduny/home-assistant | tests/components/stream/test_recorder.py | Python | apache-2.0 | 2,235 |
# Copyright 2019 The Oppia 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 ... | kevinlee12/oppia | scripts/run_presubmit_checks.py | Python | apache-2.0 | 3,619 |
# Copyright 2015-2017 Capital One Services, LLC
#
# 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 ... | jimmyraywv/cloud-custodian | tests/test_offhours.py | Python | apache-2.0 | 21,903 |
# rfkill tests
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import hostapd
from hostapd import HostapdGlobal
import hwsim_utils
from wpasupplicant import Wpa... | wangybgit/Chameleon | hostapd-OpenWrt/tests/hwsim/test_rfkill.py | Python | apache-2.0 | 6,236 |
# Copyright 2014 The Oppia 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 ... | kennho/oppia | scripts/install_third_party.py | Python | apache-2.0 | 13,118 |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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... | ilveroluca/pydoop | test/common/test_pydoop.py | Python | apache-2.0 | 2,152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.