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 |
|---|---|---|---|---|---|
# Copyright (c) 2016, the Cap authors.
#
# This file is subject to the Modified BSD License and may not be distributed
# without copyright and license information. Please refer to the file LICENSE
# for the text and further information on this license.
from pycap import PropertyTree
from os import remove
import unitte... | Rombur/Cap | python/test/test_property_tree_wrappers.py | Python | bsd-3-clause | 5,738 |
"""
Rate Service Module
===================
This package contains classes to request pre-ship rating information and to
determine estimated or courtesy billing quotes. Time in Transit can be
returned with the rates if it is specified in the request.
"""
from datetime import datetime
from .. base_service import FedexBa... | shivam1111/python-fedex | fedex/services/rate_service.py | Python | bsd-3-clause | 5,261 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import cm
fig = plt.figure()
display_axes = fig.add_axes([0.1, 0.1, 0.8, 0.8], projection='polar')
# This is a ... | sealhuang/brainDecodingToolbox | braincode/util/colorwheel.py | Python | bsd-3-clause | 1,122 |
from .killableprocess import Popen, mswindows
if mswindows:
from .winprocess import STARTUPINFO, STARTF_USESHOWWINDOW | eukaryote/dotfiles | sublime3/.config/sublime-text-3/Packages/SublimeREPL/repls/killableprocess/__init__.py | Python | mit | 118 |
from kivy.app import App
from kivy.factory import Factory
from kivy.lang import Builder
Factory.register('QRScanner', module='electrum.gui.kivy.qr_scanner')
class QrScannerDialog(Factory.AnimatedPopup):
__events__ = ('on_complete', )
def on_symbols(self, instance, value):
instance.stop()
sel... | cryptapus/electrum | electrum/gui/kivy/uix/dialogs/qr_scanner.py | Python | mit | 1,153 |
from django_ical.views import ICalFeed
from .models import Meeting
from datetime import timedelta
class MeetingFeed(ICalFeed):
"""
A iCal feed for meetings
"""
product_id = '-//chipy.org//Meeting//EN'
timezone = 'CST'
def items(self):
return Meeting.objects.order_by('-when').all()
... | tanyaschlusser/chipy.org | chipy_org/apps/meetings/feeds.py | Python | mit | 1,268 |
import unittest
from powerline_shell.utils import RepoStats
class RepoStatsTest(unittest.TestCase):
def setUp(self):
self.repo_stats = RepoStats()
self.repo_stats.changed = 1
self.repo_stats.conflicted = 4
def test_dirty(self):
self.assertTrue(self.repo_stats.dirty)
def ... | banga/powerline-shell | test/repo_stats_test.py | Python | mit | 687 |
# coding: utf-8
#
# Copyright (c) 2008—2014 Andy Mikhailenko
#
# This file is part of django-autoslug.
#
# django-autoslug is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README for copying conditions.
#
"""
Dja... | CS2014/USM | usm/autoslug/settings.py | Python | mit | 2,051 |
# coding: utf-8
"""
Module for created app engine deferred tasks. Mostly sending emails
"""
import logging
import flask
from google.appengine.api import mail #pylint: disable=import-error
from google.appengine.ext import deferred #pylint: disable=import-error
import config
import util
def send_mail_notification(sub... | madvas/gae-angular-material-starter | main/task.py | Python | mit | 3,654 |
## ONLY FOR NOOBS :D
##CONVERSION OF following encryption by shani into python
## only decryption function is implemented
'''
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
*... | kashiif/ShaniXBMCWork | plugin.video.live.streamspro/oneplay.py | Python | gpl-2.0 | 11,723 |
# 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 by applicable law or ... | GirlsCodePy/girlscode-coursebuilder | modules/assessment_tags/questions.py | Python | gpl-3.0 | 14,631 |
#!/usr/bin/env python3
#
# PLASMA : Generate an indented asm code (pseudo-C) with colored syntax.
# Copyright (C) 2015 Joel
#
# 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 ... | chubbymaggie/reverse | plasma/lib/arch/x86/process_ast.py | Python | gpl-3.0 | 2,075 |
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2017- Martin Sinn m.sinn@gmx.de
#########################################################################
# ... | robert-budde/smarthome | tests/test_logics.py | Python | gpl-3.0 | 6,817 |
# -*- coding: UTF-8 -*-
# vim: set noexpandtab ts=8 sw=8:
__kupfer_name__ = _("Empathy")
__kupfer_sources__ = ("ContactsSource", )
__kupfer_actions__ = ("ChangeStatus", 'OpenChat')
__description__ = _("Access to Empathy Contacts")
__version__ = "2010-10-17"
__author__ = "Jakh Daven <tuxcanfly@gmail.com>"
import dbus
i... | labero/kupfer | kupfer/plugin/empathy.py | Python | gpl-3.0 | 8,669 |
# -*- coding: UTF-8 -*-
# translation.py
#
# Copyright (C) 2013 Cleany
#
# Author(s): Cédric Gaspoz <cga@cleany.ch>
#
# This file is part of cleany.
#
# Cleany 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, e... | Degustare/cleany | cleany/maps/translation.py | Python | gpl-3.0 | 1,115 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | zengenti/ansible | lib/ansible/modules/network/exoscale/exo_dns_record.py | Python | gpl-3.0 | 12,408 |
'''
MAVLink protocol implementation (auto-generated by mavgen.py)
Generated from: test.xml
Note: this file has been auto-generated. DO NOT EDIT
'''
import struct, array, time, json, os, sys, platform
from ...generator.mavcrc import x25crc
import hashlib
WIRE_PROTOCOL_VERSION = '2.0'
DIALECT = 'test'
PROTOCOL_MARK... | fqez/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v20/test.py | Python | gpl-3.0 | 31,243 |
# -*- coding: utf-8 -*-
"""Word cloud integration tests using mongo modulestore."""
import json
from operator import itemgetter
from xmodule.x_module import STUDENT_VIEW
from .helpers import BaseTestXmodule
class TestWordCloud(BaseTestXmodule):
"""Integration test for word cloud xmodule."""
CATEGORY = "wo... | edx-solutions/edx-platform | lms/djangoapps/courseware/tests/test_word_cloud.py | Python | agpl-3.0 | 8,875 |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... | ride90/Booktype | lib/booki/editor/management/commands/confdel.py | Python | agpl-3.0 | 1,610 |
"""Python 2.x/3.x compatibility tools"""
import sys
__all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_',
'unicode_', 'raw_input_', 'as_bytes', 'as_unicode']
def geterror ():
return sys.exc_info()[1]
try:
long_ = long
except NameError:
long_ = int
try:
xrange_ = xrange
except Nam... | GertBurger/pygame_cffi | pygame/compat.py | Python | lgpl-2.1 | 2,767 |
# 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 Samrai(AutotoolsPackage):
"""SAMRAI (Structured Adaptive Mesh Refinement Application Infra... | LLNL/spack | var/spack/repos/builtin/packages/samrai/package.py | Python | lgpl-2.1 | 4,890 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the :class:`iris.coords.Cell` class."""
# Import iris.tests first so that some things can be initialised bef... | SciTools/iris | lib/iris/tests/unit/coords/test_Cell.py | Python | lgpl-3.0 | 7,147 |
#!/usr/bin/env python
def my_func(x, y, z=20):
return x + y + z
my_list = [22, 17, 19]
my_dict = {
'x': 13,
'y': 22,
'z': 1,
}
print
return_val = my_func(10, 20, 30)
print "Calling with three positional args: {}".format(return_val)
return_val = my_func(x=10, y=20)
print "Calling with two named args... | ktbyers/pynet-ons-nov16 | day2/func_ex3.py | Python | apache-2.0 | 841 |
from openflow.optin_manager.sfa.util.method import Method
from openflow.optin_manager.sfa.trust.credential import Credential
from openflow.optin_manager.sfa.util.parameter import Parameter
class Update(Method):
"""
Update an object in the registry. Currently, this only updates the
PLC information associa... | dana-i2cat/felix | optin_manager/src/python/openflow/optin_manager/sfa/methods/Update.py | Python | apache-2.0 | 1,376 |
#!/usr/bin/env python
"""Executable Python script for testing the action proxy.
/*
* 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 thi... | jasonpet/openwhisk | tools/actionProxy/invoke.py | Python | apache-2.0 | 5,419 |
# 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... | xzturn/tensorflow | tensorflow/python/training/warm_starting_util.py | Python | apache-2.0 | 23,798 |
#
# 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... | apache/qpid-dispatch | tests/system_tests_core_endpoint.py | Python | apache-2.0 | 9,396 |
# -*- coding: utf-8 -*-
# Verify that each license added to this list has 'OSI Approved?: Y' on https://spdx.org/licenses/
LICENSE_ALIASES = dict((key.lower(), value) for (key, value) in {
'https://polymer.github.io/LICENSE.txt': 'BSD-3-Clause', # Verified on 26-Sep-2016
'http://polymer.github.io/LICENSE.txt':... | andymutton/v2 | src/licenses.py | Python | apache-2.0 | 5,478 |
from datetime import timedelta
import pytest
from furl import furl
from api.preprint_providers.permissions import GroupHelper
from osf_tests.factories import (
ReviewActionFactory,
AuthUserFactory,
PreprintFactory,
PreprintProviderFactory,
ProjectFactory,
)
def get_actual(app, url, user=None, so... | laurenrevere/osf.io | api_tests/reviews/mixins/filter_mixins.py | Python | apache-2.0 | 9,384 |
"""
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by Jeff Heaton
Licensed under the Apache License, Version 2.0 (the "License");
... | PeterLauris/aifh | vol1/python-examples/lib/aifh/train.py | Python | apache-2.0 | 13,698 |
from django.test import TestCase
from rest_framework import serializers
from tests.models import (
ForeignKeySource, ForeignKeySourceWithLimitedChoices,
ForeignKeySourceWithQLimitedChoices, ForeignKeyTarget, ManyToManySource,
ManyToManyTarget, NullableForeignKeySource, NullableOneToOneSource,
NullableU... | tomchristie/django-rest-framework | tests/test_relations_pk.py | Python | bsd-2-clause | 24,852 |
import datetime
from rest_framework.generics import ListAPIView, RetrieveAPIView
from openbudgets.apps.contexts import serializers
from openbudgets.apps.contexts import models
class ContextList(ListAPIView):
"""Called via an API endpoint that represents a list of context objects."""
model = models.Context
... | kobiluria/openbudgets | openbudgets/apps/contexts/views/api.py | Python | bsd-3-clause | 3,078 |
"""
This module contains the core methods for the Batch-command- and
Batch-code-processors respectively. In short, these are two different
ways to build a game world using a normal text-editor without having
to do so 'on the fly' in-game. They also serve as an automatic backup
so you can quickly recreate a world also a... | ypwalter/evennia | evennia/utils/batchprocessors.py | Python | bsd-3-clause | 15,282 |
"""
Tests of the neo.io.pickleio.PickleIO class
"""
import os
import unittest
import numpy as np
import quantities as pq
from neo.core import Block, Segment, AnalogSignal, SpikeTrain, Epoch, Event, \
IrregularlySampledSignal, Group
from neo.io import PickleIO
from numpy.testing import assert_array_equal
from ne... | samuelgarcia/python-neo | neo/test/iotest/test_pickleio.py | Python | bsd-3-clause | 3,272 |
import numpy as np
import pytest
import pandas as pd
from pandas import Series
import pandas._testing as tm
class TestSeriesRound:
def test_round(self, datetime_series):
datetime_series.index.name = "index_name"
result = datetime_series.round(2)
expected = Series(
np.round(dat... | rs2/pandas | pandas/tests/series/methods/test_round.py | Python | bsd-3-clause | 2,273 |
import os
from pprint import pformat
from django import http
from django.core import signals
from django.core.handlers.base import BaseHandler
from django.dispatch import dispatcher
from django.utils import datastructures
from django.utils.encoding import force_unicode, smart_str
# NOTE: do *not* import settings (or ... | paulsmith/geodjango | django/core/handlers/modpython.py | Python | bsd-3-clause | 7,141 |
#!/usr/bin/python
# coding=utf-8
##########################################################################
from diamond.collector import Collector
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from mock import Mock
from etcdstat import EtcdC... | MichaelDoyle/Diamond | src/collectors/etcdstat/test/test_etcdstat.py | Python | mit | 4,410 |
# Originally contributed by Stefan Schukat as part of this arbitrary-sized
# arrays patch.
from win32com.client import gencache
from win32com.test import util
import unittest
ZeroD = 0
OneDEmpty = []
OneD = [1,2,3]
TwoD = [
[1,2,3],
[1,2,3],
[1,2,3]
]
TwoD1 = [
[
... | sserrot/champion_relationships | venv/Lib/site-packages/win32com/test/testArrays.py | Python | mit | 2,505 |
'''Selector functions and selector function factories.'''
import operator
from asq._portability import is_callable
from asq._types import is_string
from asq.initiators import query
__author__ = 'Robert Smallshire'
k_ = operator.itemgetter
'''Create a selector function which indexes into the element by key.... | SlamJam/asq | asq/selectors.py | Python | mit | 4,595 |
# 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 ... | BurtBiel/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/__init__.py | Python | mit | 750 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-01-16 06:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20170116_0653'),
]
operations = ... | hrr20-over9000/9001 | server/project/apps/core/migrations/0007_auto_20170116_0656.py | Python | mit | 1,397 |
# Partname: ATmega16U4
# generated automatically, do not edit
MCUREGS = {
'WDTCSR': '&96',
'WDTCSR_WDIF': '$80',
'WDTCSR_WDIE': '$40',
'WDTCSR_WDP': '$27',
'WDTCSR_WDCE': '$10',
'WDTCSR_WDE': '$08',
'PORTD': '&43',
'DDRD': '&42',
'PIND': '&41',
'SPCR': '&76',
'SPCR_SPIE': '$80',
'SPCR_SPE': '... | hickey/amforth | core/devices/atmega16u4/device.py | Python | gpl-2.0 | 10,989 |
import ns.point_to_point
import ns.csma
import ns.wifi
import ns.bridge
import ns.internet
import ns.mesh
import ns.wimax
import ns.wimax
import ns.lte
import gobject
import os.path
import sys
PIXELS_PER_METER = 3.0 # pixels-per-meter, at 100% zoom level
class PyVizObject(gobject.GObject):
__gtype_name__ = "PyVi... | avicizhu/Load-balancer | src/visualizer/visualizer/base.py | Python | gpl-2.0 | 3,793 |
# -*- coding: utf-8 -*-
import pytest
import env # noqa: F401
from pybind11_tests import pickling as m
try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
import pickle
@pytest.mark.parametrize("cls_name", ["Pickleable", "PickleableNew"])
def test_roundtrip(cls_name):
cls = ... | YannickJadoul/Parselmouth | pybind11/tests/test_pickling.py | Python | gpl-3.0 | 1,191 |
#!/usr/bin/python
# Copyright (C) 2012 The Android Open Source 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 require... | s20121035/rk3288_android5.1_repo | cts/suite/audio_quality/test_description/processing/recording_thd.py | Python | gpl-3.0 | 2,834 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
# Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.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 Lice... | emersonsoftware/ansiblefork | lib/ansible/plugins/connection/ssh.py | Python | gpl-3.0 | 36,337 |
"""
Precompute coefficients of Temme's asymptotic expansion for gammainc.
This takes about 8 hours to run on a 2.3 GHz Macbook Pro with 4GB ram.
Sources:
[1] NIST, "Digital Library of Mathematical Functions",
http://dlmf.nist.gov/
"""
from __future__ import division, print_function, absolute_import
import os
fr... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/special/_precompute/gammainc_asy.py | Python | gpl-3.0 | 2,599 |
# -*- coding: utf-8 -*-
from scrapy_proj.helpers.legal import *
from scrapy_proj.helpers.romanian import *
from scrapy_proj.helpers.text import *
| costibleotu/czl-scrape | sanatate/scrapy_proj/helpers/__init__.py | Python | mpl-2.0 | 147 |
# 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, json, copy
from frappe.utils import cstr, flt, getdate, strip
from frappe import _
from frappe.utils.file_manager import save_file
from ... | hatwar/buyback-erpnext | erpnext/setup/page/setup_wizard/setup_wizard.py | Python | agpl-3.0 | 17,916 |
from course_modes.models import CourseMode
from factory import DjangoModelFactory
# Factories don't have __init__ methods, and are self documenting
# pylint: disable=W0232
class CourseModeFactory(DjangoModelFactory):
FACTORY_FOR = CourseMode
course_id = u'MITx/999/Robot_Super_Course'
mode_slug = 'audit'
... | morpheby/levelup-by | common/djangoapps/course_modes/tests/factories.py | Python | agpl-3.0 | 397 |
##############################################################################
# Copyright (c) 2013-2018, 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... | EmreAtes/spack | var/spack/repos/builtin/packages/py-qtawesome/package.py | Python | lgpl-2.1 | 1,760 |
##############################################################################
# Copyright (c) 2013-2018, 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... | EmreAtes/spack | var/spack/repos/builtin/packages/r-tseries/package.py | Python | lgpl-2.1 | 1,765 |
# Imports operators dynamically while keeping the package API clean,
# abstracting the underlying modules
from airflow.utils.helpers import import_module_attrs as _import_module_attrs
# These need to be integrated first as other operators depend on them
_import_module_attrs(globals(), {
'check_operator': [
... | wxiang7/airflow | airflow/operators/__init__.py | Python | apache-2.0 | 2,497 |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | leeseuljeong/leeseulstack_neutron | neutron/db/securitygroups_rpc_base.py | Python | apache-2.0 | 20,934 |
"""Contains the implementation for the DirectoryWatcher class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.platform import gfile
from tensorflow.python.platform import logging
class DirectoryWatcher(object):
"""A ... | arunhotra/tensorflow | tensorflow/python/summary/impl/directory_watcher.py | Python | apache-2.0 | 4,586 |
"""Support for the Netatmo cameras."""
import logging
import pyatmo
import requests
import voluptuous as vol
from homeassistant.components.camera import (
DOMAIN as CAMERA_DOMAIN,
SUPPORT_STREAM,
Camera,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
import homeassistant.helpers.con... | pschmitt/home-assistant | homeassistant/components/netatmo/camera.py | Python | apache-2.0 | 8,323 |
from temboo.Library.Utilities.Email.SendEmail import SendEmail, SendEmailInputSet, SendEmailResultSet, SendEmailChoreographyExecution
| jordanemedlock/psychtruths | temboo/core/Library/Utilities/Email/__init__.py | Python | apache-2.0 | 134 |
#!/usr/bin/env python
##Copyright 2009-2014 Thomas Paviot (tpaviot@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC 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 3 of the... | siconos/siconos-deb | externals/renderer/SimpleGui.py | Python | apache-2.0 | 7,843 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ZipFile
# Creates a zipped version of the specified Box file and returns a link to the new compressed file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | jordanemedlock/psychtruths | temboo/core/Library/Box/Files/ZipFile.py | Python | apache-2.0 | 4,646 |
"""The test for sensor device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.sensor import DOMAIN
from homeassistant.components.sensor.device_trigger import ENTITY_TRIGGERS
from homeassistant.const import CONF_PLATFORM... | sdague/home-assistant | tests/components/sensor/test_device_trigger.py | Python | apache-2.0 | 14,830 |
def func() -> int:
return <warning descr="Expected type 'int', got '(x: Any) -> int' instead">lambda x: 42<caret></warning> | smmribeiro/intellij-community | python/testData/quickFixes/PyMakeFunctionReturnTypeQuickFixTest/lambda.py | Python | apache-2.0 | 127 |
# Copyright (C) 2012 - 2014 EMC Corporation.
#
# 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 applicab... | Akrog/cinder | cinder/db/sqlalchemy/migrate_repo/versions/026_add_consistencygroup_quota_class.py | Python | apache-2.0 | 2,632 |
#
# Copyright 2015 Quantopian, 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 wr... | wilsonkichoi/zipline | zipline/sources/data_frame_source.py | Python | apache-2.0 | 5,146 |
'''
Created on Jan 16, 2014
@author: sean
'''
from __future__ import absolute_import, division, print_function
import json
import os
from conda.compat import PY3
from .environ import get_dict as get_environ
_setuptools_data = None
def load_setuptools(setup_file='setup.py'):
global _setuptools_data
if _set... | mwcraig/conda-build | conda_build/jinja_context.py | Python | bsd-3-clause | 1,276 |
"""
A view for the Mayavi preferences outside of Envisage.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Standard library imports
from os.path import join
# Enthought library imports.
from traits.api import List
from apptools.pre... | dmsurti/mayavi | mayavi/preferences/preference_manager_view.py | Python | bsd-3-clause | 2,553 |
#!/usr/bin/python
#
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
# test suite to this PyUnit-based version.
#
# $Id: test_optparse.py,v 1.10 2004/10/27 02:43:25 tim_one Exp $
#
import sys
import os
import copy
import unittest
from cStringIO im... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4/Lib/test/test_optparse.py | Python | mit | 57,004 |
from toontown.building.DistributedElevatorExt import DistributedElevatorExt
class DistributedCogdoElevatorExt(DistributedElevatorExt):
def setupElevator(self):
DistributedElevatorExt.setupElevator(self)
self.elevatorSphereNodePath.setY(-1.0)
self.elevatorSphereNodePath.setZ(1.5)
def g... | Spiderlover/Toontown | toontown/cogdominium/DistributedCogdoElevatorExt.py | Python | mit | 561 |
from django.conf.urls.defaults import patterns, include, url
from file_uploader import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'file_uploader.views.home', name='home'),
# url(... | vladapopster/Websms | web/bundles/websms/php/server/python_django/file_uploader/urls.py | Python | gpl-2.0 | 860 |
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import datetime
import decimal
import httplib
import json
import threading
import re
from decimal import Decimal
from electrum.plugins import BasePlugin
from electrum.i18n import _
from electrum_gui.qt.util import *
EXCHANGES = ["BitcoinAverage",
"Bit... | marlengit/electrum198 | plugins/exchange_rate.py | Python | gpl-3.0 | 18,608 |
import os.path
def FlagsForFile( filename, **kwargs ):
d = os.path.dirname( filename )
return { 'flags': [ '-iquote', os.path.join( d, 'quote' ),
'-I', os.path.join( d, 'system' ) ] }
| oblitum/ycmd | ycmd/tests/clang/testdata/test-include/.ycm_extra_conf.py | Python | gpl-3.0 | 212 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Hardware Proxy',
'category': 'IOT',
'sequence': 6,
'summary': 'Connect the Web Client to Hardware Peripherals',
'website': 'https://www.odoo.com/page/iot',
'description': """
Hardware P... | t3dev/odoo | addons/hw_drivers/__manifest__.py | Python | gpl-3.0 | 592 |
#!/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 ***
#
... | resmo/ansible | lib/ansible/modules/cloud/google/gcp_spanner_instance_info.py | Python | gpl-3.0 | 5,026 |
# 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.fondos import fondo
class Color(fondo.Fondo):
def __init__(self, pilas, color):
fondo.Fondo.... | apehua/pilas | pilasengine/fondos/color.py | Python | lgpl-3.0 | 498 |
#!/usr/bin/env python
"""VFS Handler which provides access to the raw physical memory.
Memory access is provided by use of a special driver. Note that it is preferred
to use this VFS handler rather than directly access the raw handler since this
handler protects the system from access to unmapped memory regions such a... | darrenbilby/grr | client/vfs_handlers/memory.py | Python | apache-2.0 | 2,466 |
# Copyright (c) 2015 Alex Meade
# Copyright (c) 2015 Rushil Chugh
# Copyright (c) 2015 Navneet Singh
# Copyright (c) 2015 Yogesh Kshirsagar
# Copyright (c) 2015 Jose Porrua
# Copyright (c) 2015 Michael Price
# Copyright (c) 2015 Tom Barron
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | Hybrid-Cloud/cinder | cinder/volume/drivers/netapp/eseries/library.py | Python | apache-2.0 | 92,586 |
# 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.0
#
# Unless required by applicable law or ... | supunkamburugamuve/mooc2 | models/config.py | Python | apache-2.0 | 8,582 |
"""
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict((color_names[x], '3%s' % x) for x in range(8))
background = dict((color_names[x], '4%s' % x) for x in range(8))
RESET = '0'
opt_dict = {'bold': '1', 'underscore':... | yceruto/django | django/utils/termcolors.py | Python | bsd-3-clause | 7,357 |
# Copyright 2014 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.
from telemetry import benchmark
from telemetry.core import discover
from telemetry.page import page_set
from measurements import skpicture_printer
def _Ma... | guorendong/iridium-browser-ubuntu | tools/perf/benchmarks/skpicture_printer.py | Python | bsd-3-clause | 1,750 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['checksum', 'logger', 'view']
db.delete_unique('... | beni55/sentry | src/sentry/migrations/0015_auto__add_field_message_project__add_field_messagecountbyminute_projec.py | Python | bsd-3-clause | 15,392 |
"""
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... | rebost/django | tests/modeltests/model_forms/models.py | Python | bsd-3-clause | 8,153 |
"""
Provides mathematical functions
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005-2012 Vladimir Lik... | strets123/pyms | Utils/Math.py | Python | gpl-2.0 | 5,643 |
#!/usr/bin/env python
"""
==========================================================
NullPose.py - Pose Handler for single region without Vicon
==========================================================
"""
import sys, time
from numpy import *
from lib.regions import *
import lib.handlers.handlerTemplates as handlerT... | VerifiableRobotics/LTLMoP | src/lib/handlers/share/Pose/NullPoseHandler.py | Python | gpl-3.0 | 1,041 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class FleetVehicleModelCategory(models.Model):
_name = 'fleet.vehicle.model.category'
_description = 'Category of the model'
_order = 'sequence asc, id asc'
_sql_constra... | jeremiahyan/odoo | addons/fleet/models/fleet_vehicle_model_category.py | Python | gpl-3.0 | 477 |
# This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg 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, or (at your option) any later version.
#... | vivekanand1101/fedmsg | fedmsg/tests/__init__.py | Python | lgpl-2.1 | 822 |
# 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 applicable ... | bgshin/doc-classify-multi-gpu | src/preprocessing/lenet_preprocessing.py | Python | apache-2.0 | 1,535 |
# -*- 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
#... | sid88in/incubator-airflow | airflow/utils/dates.py | Python | apache-2.0 | 9,508 |
"""Tests for the ATAG integration."""
import aiohttp
from homeassistant.components.atag import DOMAIN
from homeassistant.config_entries import ENTRY_STATE_SETUP_RETRY
from homeassistant.core import HomeAssistant
from tests.async_mock import patch
from tests.components.atag import init_integration
from tests.test_util... | nkgilley/home-assistant | tests/components/atag/test_init.py | Python | apache-2.0 | 1,472 |
from nose.tools import * # noqa
from modularodm import Q
from website.prereg import prereg_landing_page as landing_page
from website.prereg.utils import drafts_for_user, get_prereg_schema
from website.project.model import ensure_schemas, MetaSchema
from tests.base import OsfTestCase
from tests import factories
cl... | wearpants/osf.io | tests/test_prereg.py | Python | apache-2.0 | 3,366 |
# coding: utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.core.urlresolvers import (
NoReverseMatch, Resolver404, get_script_prefix, resolve
)
from django.db.models import Manager
from django.... | saukrIppl/seahub | thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/relations.py | Python | apache-2.0 | 18,087 |
# View the specified parameters of your Deep Learning model
model.params
# Examine the performance of the trained model
model
| brightchen/h2o-3 | h2o-docs/src/booklets/v2_2015/source/deeplearning/deeplearning_extractmodelparams.py | Python | apache-2.0 | 127 |
from datetime import datetime
import mock
from nose.tools import eq_
import mkt
import mkt.site.tests
from mkt.account.serializers import (AccountSerializer, AccountInfoSerializer,
TOSSerializer)
from mkt.users.models import UserProfile
class TestAccountSerializer(mkt.site.tests... | ingenioustechie/zamboni | mkt/account/tests/test_serializers.py | Python | bsd-3-clause | 3,416 |
#!/usr/bin/env python
import os
import sys
import time
# When the parent dies we are seeing continual newlines, so we only access so many before stopping
counter = 1
# sleep a little bit or we will never see the asm in the configuration file
# and the message received just before we go to the established loop will b... | benagricola/exabgp | qa/self/operational/operational-send.py | Python | bsd-3-clause | 1,319 |
# -*- coding: utf-8 -*-
"""Swap edges in a graph.
"""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from __future__ import division
import math
import random
import networkx as n... | cmtm/networkx | networkx/algorithms/swap.py | Python | bsd-3-clause | 9,824 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
@pytest.mark.usefixtures('tmpdir')
class TestTorrentSize(object):
config = """
tasks:
test_min:
mock:
- {tit... | jawilson/Flexget | flexget/tests/test_content_size.py | Python | mit | 4,349 |
# parser.py
#
# 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, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY... | shaded-enmity/dnf | dnf/conf/parser.py | Python | gpl-2.0 | 9,101 |
'''
Core Abstraction
================
This module defines the abstraction layers for our core providers and their
implementations. For further information, please refer to
:ref:`architecture` and the :ref:`providers` section of the documentation.
In most cases, you shouldn't directly use a library that's already cove... | JulienMcJay/eclock | windows/kivy/kivy/core/__init__.py | Python | gpl-2.0 | 4,391 |
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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... | jmartinm/InvenioAuthorLists | modules/websubmit/lib/functions/Insert_Modify_Record.py | Python | gpl-2.0 | 2,196 |
# Copyright 2011 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/deferred_delete.py | Python | gpl-2.0 | 3,037 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (c) 2014 Kevin B. Hendricks, John Schember, and Doug Massay
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following ... | yuhangwang/Sigil | src/Resource_Files/plugin_launchers/python/inputcontainer.py | Python | gpl-3.0 | 2,521 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@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... | mscherer/ansible-modules-extras | packaging/language/composer.py | Python | gpl-3.0 | 6,165 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.