repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
tchernomax/ansible | lib/ansible/modules/cloud/amazon/aws_glue_job.py | 27 | 12871 | #!/usr/bin/python
# Copyright: (c) 2018, Rob White (@wimnat)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
... | gpl-3.0 |
dvliman/jaikuengine | .google_appengine/google/appengine/tools/devappserver2/application_configuration_test.py | 6 | 36273 | #!/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... | apache-2.0 |
massot/odoo | addons/hr_payroll/res_config.py | 441 | 1294 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
sandeepdsouza93/TensorFlow-15712 | tensorflow/python/training/training_ops_test.py | 12 | 11303 | # 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... | apache-2.0 |
juergenhamel/cuon | cuon_client/cuon/Databases/xbase.py | 7 | 5402 | import struct, datetime, decimal, itertools
def dbfreader(f):
"""Returns an iterator over records in a Xbase DBF file.
The first row returned contains the field names.
The second row contains field specs: (type, size, decimal places).
Subsequent rows contain the data records.
If a record is marked... | gpl-3.0 |
shubhangiKishore/pattern | test/test_it.py | 3 | 12484 | # -*- coding: utf-8 -*-
from __future__ import print_function
from util import *
from pattern import it
#-------------------------------------------------------------------------
class TestInflection(unittest.TestCase):
def setUp(self):
pass
def test_article(self):
# Assert definite and ... | bsd-3-clause |
dgillis/scrapy | scrapy/crawler.py | 31 | 11176 | import six
import signal
import logging
import warnings
from twisted.internet import reactor, defer
from zope.interface.verify import verifyClass, DoesNotImplement
from scrapy.core.engine import ExecutionEngine
from scrapy.resolver import CachingThreadedResolver
from scrapy.interfaces import ISpiderLoader
from scrapy... | bsd-3-clause |
revmischa/boto | boto/glacier/layer1.py | 121 | 60796 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal ... | mit |
adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_fpformat.py | 129 | 2309 | '''
Tests for fpformat module
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import unittest
fpformat = import_module('fpformat', deprecated=True)
fix, sci, NotANumber = fpformat.fix, fpformat.sci, fpformat.NotANumber
StringType = type('')
# Test the old and obsolescent fpformat mo... | epl-1.0 |
botswana-harvard/bais-subject | bais_subject/models/background_characteristics.py | 1 | 3719 | from django.db import models
from edc_base.model_fields import OtherCharField
from edc_base.model_mixins import BaseUuidModel
from ..choices import (
MALE_FEMALE,
EDUCATION,
EMPLOYMENT_STATUS,
YES_NO,
MINE_OCCUPATION,
COMMODITY,
RELIGION,
MARITAL_STATUS,
SPOUSE_VISIT)
class Backg... | gpl-3.0 |
risent/unidecode | unidecode/x017.py | 252 | 4190 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'[?]'... | gpl-2.0 |
PetePriority/home-assistant | homeassistant/components/switch/anel_pwrctrl.py | 8 | 3373 | """
Support for ANEL PwrCtrl switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.pwrctrl/
"""
import logging
import socket
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from hom... | apache-2.0 |
amraboelela/swift | utils/swift_build_support/tests/test_shell.py | 39 | 5264 | # tests/test_shell.py -------------------------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
Diapostrofo/instabot | instabot/bot/bot_archive.py | 3 | 1525 | from tqdm import tqdm
from . import delay
def archive(self, media_id, undo=False):
delay.small_delay(self)
media = self.get_media_info(media_id)
media = media[0] if isinstance(media, list) else media
if super(self.__class__, self).archiveMedia(media, undo):
self.total_archived += int(not undo... | apache-2.0 |
tornadozou/tensorflow | tensorflow/contrib/estimator/python/estimator/logit_fns_test.py | 9 | 2329 | # 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... | apache-2.0 |
destijl/grr | grr/server/stats_server.py | 2 | 4317 | #!/usr/bin/env python
"""Stats server implementation."""
import BaseHTTPServer
import collections
import json
import socket
import threading
import logging
from grr.lib import config_lib
from grr.lib import registry
from grr.lib import stats
from grr.lib import utils
def _JSONMetricValue(metric_info, value):
... | apache-2.0 |
pombredanne/MOG | nova/tests/api/openstack/compute/contrib/test_extended_ips_mac.py | 10 | 6087 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
# 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/licen... | apache-2.0 |
rbu/ansible-modules-extras | source_control/bzr.py | 23 | 6484 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, André Paramés <git@andreparames.com>
# Based on the Git module by 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 a... | gpl-3.0 |
vlinhd11/vlinhd11-android-scripting | python/src/Lib/binhex.py | 59 | 14828 | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | apache-2.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/numpy/lib/index_tricks.py | 66 | 26204 | from __future__ import division, absolute_import, print_function
import sys
import math
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, ScalarType, array, alltrue, cumprod, arange
)
from numpy.core.numerictypes import find_common_type, issubdtype
from . import function_base
import ... | mit |
srene/ns-3-inrpp | src/mpi/bindings/modulegen__gcc_LP64.py | 38 | 160936 | 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))
... | gpl-2.0 |
renyi533/tensorflow | tensorflow/python/kernel_tests/bincount_op_test.py | 4 | 5627 | # 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... | apache-2.0 |
kaoscoach/crits | crits/actors/handlers.py | 12 | 24902 | import json
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import render_to_string
from crits.actors.actor import Actor, ActorIdentifier, ActorThreatIdentifier
from... | mit |
sunqm/pyscf | pyscf/df/test/test_df_hessian.py | 2 | 1644 | # Copyright 2014-2018 The PySCF Developers. 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 appl... | apache-2.0 |
lebek/reversible-raytracer | test_1ball.py | 1 | 1798 | import os
import numpy as np
import theano.tensor as T
import theano
from scipy import misc
from autoencoder_1obj import Autoencoder_1obj
from transform import *
from scene import *
from shader import *
from optimize import *
if not os.path.exists('output'):
os.makedirs('output')
train_data = np.array([misc.imre... | mit |
blueburningcoder/pybrain | pybrain/tools/neuralnets.py | 26 | 13763 | # Neural network data analysis tool collection. Makes heavy use of the logging module.
# Can generate training curves during the run (from properly setup IPython and/or with
# TkAgg backend and interactive mode - see matplotlib documentation).
__author__ = "Martin Felder"
__version__ = "$Id$"
from pylab import ion, fi... | bsd-3-clause |
moorescloud/holideck | examples/twitter/oauth.py | 3 | 2938 | from __future__ import print_function
from twitter.auth import Auth
from time import time
from random import getrandbits
try:
import urllib.parse as urllib_parse
from urllib.parse import urlencode
PY3 = True
except ImportError:
import urllib2 as urllib_parse
from urllib import urlencode
PY3 =... | mit |
Kitware/girder | plugins/autojoin/plugin_tests/autojoin_test.py | 2 | 2418 | from girder.constants import AccessType
from girder.models.group import Group
from girder.models.user import User
from tests import base
import json
def setUpModule():
base.enabledPlugins.append('autojoin')
base.startServer()
def tearDownModule():
base.stopServer()
class AutoJoinTest(base.TestCase):
... | apache-2.0 |
apache/stratos | components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/tenant/events.py | 11 | 2910 | # 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... | apache-2.0 |
mahak/nova | nova/tests/functional/test_servers_provider_tree.py | 3 | 33234 | # Copyright 2011 Justin Santa Barbara
# 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... | apache-2.0 |
jirikuncar/invenio | invenio/legacy/bibformat/adminlib.py | 13 | 10217 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015 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 th... | gpl-2.0 |
kimjam/pkaers | tests/test.py | 1 | 1275 | # flake8: noqa
import pandas as pd
from pkaers.khan_elo import khan_elo
import unittest
class ObjectTest(unittest.TestCase):
def configure(self):
self.student = pd.read_csv('student.csv').T.to_dict().values()
self.map_data = pd.read_csv('map.csv').T.to_dict().values()
self.khanstudent = pd.read_csv('khanstuden... | mit |
scalable-networks/gnuradio-3.7.2.1 | gnuradio-runtime/python/gnuradio/gru/hexint.py | 78 | 1351 | #
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-3.0 |
nburn42/tensorflow | tensorflow/contrib/autograph/converters/asserts_test.py | 4 | 1349 | # 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... | apache-2.0 |
alfanugraha/LUMENS-repo | processing/algs/ftools/ExportGeometryInfo.py | 5 | 4922 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ExportGeometryInfo.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
vitmod/enigma2 | lib/python/Plugins/Extensions/DVDBurn/Title.py | 50 | 6408 | from Components.config import ConfigSubsection, ConfigSubList, ConfigInteger, ConfigText, ConfigSelection
import TitleCutter
class ConfigFixedText(ConfigText):
def __init__(self, text, visible_width=60):
ConfigText.__init__(self, default = text, fixed_size = True, visible_width = visible_width)
def handleKey(self,... | gpl-2.0 |
goliveirab/odoo | addons/account/product.py | 374 | 2897 | # -*- 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... | agpl-3.0 |
gangadhar-kadam/adb-erp | stock/report/item_prices/item_prices.py | 3 | 4795 | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | agpl-3.0 |
erwilan/ansible | contrib/inventory/zabbix.py | 24 | 4205 | #!/usr/bin/env python
# (c) 2013, Greg Buehler
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
waytai/odoo | addons/mrp_byproduct/mrp_byproduct.py | 150 | 8285 | # -*- 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... | agpl-3.0 |
joaduo/mepinta | developer_tools/mepinta_devtools/python_project/shedskin_project/ShedskinProjectCreator.py | 1 | 5395 | # -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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 opti... | gpl-3.0 |
noroutine/ansible | lib/ansible/module_utils/service.py | 37 | 8222 | # 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... | gpl-3.0 |
Radium-Devices/android_kernel_motorola_msm8916 | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
NeuralProsthesisLab/unlock | unlock/util/__init__.py | 1 | 1966 | # Copyright (c) James Percent, Byron Galbraith and Unlock contributors.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notic... | bsd-3-clause |
anandsimmy/ecommerce | tests/integration/core/test_customisation.py | 6 | 2799 | import pytest
from django.conf import settings
from django.test import TestCase
from oscar.core import customisation
VALID_FOLDER_PATH = 'tests/_site/apps'
class TestUtilities(TestCase):
def test_subfolder_extraction(self):
folders = list(customisation.subfolders('/var/www/eggs'))
self.assertEq... | bsd-3-clause |
plumgrid/plumgrid-nova | nova/api/openstack/compute/contrib/hypervisors.py | 11 | 9862 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
kxliugang/edx-platform | lms/djangoapps/courseware/features/word_cloud.py | 94 | 1516 | # pylint: disable=missing-docstring
from lettuce import world, step
from common import i_am_registered_for_the_course, section_location, visit_scenario_item
@step('I view the word cloud and it has rendered')
def word_cloud_is_rendered(_step):
assert world.is_css_present('.word_cloud')
@step('the course has a W... | agpl-3.0 |
garnaat/boto | boto/sqs/messageattributes.py | 159 | 2487 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2014 Amazon.com, Inc. All rights reserved.
#
# 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, i... | mit |
StratusLab/client | api/code/src/main/python/stratuslab/marketplace/Downloader.py | 1 | 4491 | #
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | apache-2.0 |
vikas-parashar/zulip | zerver/tests/webhooks/test_crashlytics.py | 31 | 1114 | # -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
class CrashlyticsHookTests(WebhookTestCase):
STREAM_NAME = 'crashlytics'
URL_TEMPLATE = u"/api/v1/external/crashlytics?stream={stream}&api_key={api_key}"
FIXTURE_DIR_NAME = 'crashlytics'
def test_crashlytics_verification_messa... | apache-2.0 |
XiaosongWei/chromium-crosswalk | tools/telemetry/third_party/pyserial/serial/serialwin32.py | 147 | 18260 | #! python
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# serial driver for win32
# see __init__.py
#
# (C) 2001-2011 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# Initial patch to use ctypes by Giovanni Bajo <rasky@develer.com>
import ctypes
f... | bsd-3-clause |
108coin/108coin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
appop/bitcoin | contrib/devtools/update-translations.py | 1 | 8076 | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | mit |
zygmuntz/pybrain | pybrain/rl/explorers/discrete/egreedy.py | 31 | 1191 | __author__ = "Thomas Rueckstiess, ruecksti@in.tum.de"
from scipy import random, array
from pybrain.rl.explorers.discrete.discrete import DiscreteExplorer
class EpsilonGreedyExplorer(DiscreteExplorer):
""" A discrete explorer, that executes the original policy in most cases,
but sometimes returns a random... | bsd-3-clause |
auferack08/edx-platform | common/lib/capa/capa/tests/__init__.py | 29 | 2220 | """Tools for helping with testing capa."""
import gettext
import os
import os.path
import fs.osfs
from capa.capa_problem import LoncapaProblem, LoncapaSystem
from capa.inputtypes import Status
from mock import Mock, MagicMock
import xml.sax.saxutils as saxutils
TEST_DIR = os.path.dirname(os.path.realpath(__file__)... | agpl-3.0 |
cavaunpeu/vanilla-neural-nets | vanilla_neural_nets/neural_network/network.py | 1 | 3546 | import numpy as np
from vanilla_neural_nets.neural_network.training_batch_generator import MiniBatchGenerator
from vanilla_neural_nets.neural_network.optimization_algorithm import GradientDescent
from vanilla_neural_nets.neural_network.loss_function import MeanSquaredError
from vanilla_neural_nets.neural_network.activ... | mit |
samdroid-apps/sugar | extensions/globalkey/speech.py | 8 | 1036 | # Copyright (C) 2011 One Laptop Per Child
#
# 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 distribu... | gpl-2.0 |
Alexander-M-Waldman/local_currency_site | lib/python2.7/site-packages/easy_thumbnails/models.py | 6 | 2906 | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from easy_thumbnails import utils, signal_handlers
from easy_thumbnails.conf import settings
class FileManager(models.Manager):
def get_file(self, storage, name, create=False, update_modified=None,
... | gpl-3.0 |
motion2015/edx-platform | lms/djangoapps/courseware/tabs.py | 7 | 10289 | """
This module is essentially a broker to xmodule/tabs.py -- it was originally introduced to
perform some LMS-specific tab display gymnastics for the Entrance Exams feature
"""
from django.conf import settings
from django.utils.translation import ugettext as _, ugettext_noop
from courseware.access import has_access
f... | agpl-3.0 |
candlepin/virt-who | virtwho/virt/ahv/ahv_interface.py | 1 | 27979 | import json
import math
import time
import sys
from . import ahv_constants
from requests import Session
from requests.exceptions import ConnectionError, ReadTimeout
from virtwho import virt
class AhvInterface(object):
""" AHV REST Api interface class"""
NO_RETRY_HTTP_CODES = [400, 404, 500, 502, 503]
event_types... | gpl-2.0 |
snlab-freedom/sdntest | sdntest/exception.py | 1 | 1179 | #!/usr/bin/env python
REASON = {
'OUTDIR': 1
}
class PlatformException(Exception):
"""
When involve invalid platform, this exception will be raised.
"""
def __init__(self, platform):
self.platform = platform
def __str__(self):
return "Unknown or unsupported SDN controller plat... | mit |
jreinhardt/manufac | src/manufac/yaml_loader.py | 1 | 1438 | # manufac - a commandline tool for step-by-step instructions
# Copyright (C) 2014 Johannes Reinhardt <jreinhardt@ist-dein-freund.de>
#
# 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 vers... | gpl-2.0 |
mmasaki/trove | trove/tests/unittests/datastore/base.py | 4 | 3604 | # Copyright (c) 2014 Rackspace Hosting
#
# 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 ... | apache-2.0 |
edisonlz/fruit | web_project/base/site-packages/django/contrib/sessions/backends/cache.py | 122 | 2505 | from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import get_cache
from django.utils.six.moves import xrange
KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
... | apache-2.0 |
narthollis/eve-api-proxy | eveproxy/char.py | 1 | 4453 |
from core import EveProxyBaseRequestHandler
class AccountBalance(EveProxyBaseRequestHandler):
requiredParamaters = ['keyID', 'vCode', 'characterID']
urlPart = "/char/AccountBalance.xml"
class AssetList(EveProxyBaseRequestHandler):
requiredParamaters = ['keyID', 'vCode', 'characterID']
urlPart = "/ch... | bsd-2-clause |
dufresnedavid/hr | __unported__/hr_experience/hr_experience.py | 4 | 1563 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 |
jrennie/weewx-jrennie | bin/user/schemas.py | 1 | 4285 | #
# Copyright (c) 2011 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
# $Revision$
# $Author$
# $Date$
#
"""Database schemas used by weewx"""
#===============================================================================
# This is a list containing the default sche... | gpl-3.0 |
qyou/flaskweb | flask_demo.py | 1 | 2342 | # -*- coding: utf-8 -*-
import os
from werkzeug import secure_filename
from flask import Flask
from flask import url_for # for static files
from flask import render_template
from flask import request
from flask import make_response
from flask import session
from flask import redirect
from flask import flash
from mode... | mit |
wahlmanj/OpenPlex3 | update/OSX/icon/icon/WebServer.py | 2 | 15174 | #!/usr/bin/env python
"""
Sources:
http://fragments.turtlemeat.com/pythonwebserver.php
http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python
...stackoverflow.com and such
after 27Aug - Apple's switch to https:
- added https WebServer with SSL encryption - needs valid (private) vertificate on a... | bsd-3-clause |
fuzeman/trakt.py | examples/search.py | 1 | 1610 | from __future__ import absolute_import, division, print_function
from trakt import Trakt
from trakt.objects import Episode
import logging
import os
logging.basicConfig(level=logging.DEBUG)
def print_lookup(id, service):
print("Trakt['search'].lookup(%r, %r)" % (id, service))
items = Trakt['search'].lookup... | mit |
borysiasty/QGIS | tests/code_layout/test_qgssipcoverage.py | 45 | 5000 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for SIP binding coverage.
.. note:: 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.
... | gpl-2.0 |
duh386/django-mailer | mailer/engine.py | 1 | 7959 | import time
import smtplib
import logging
from lockfile import FileLock, AlreadyLocked, LockTimeout
from socket import error as socket_error
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail as core_send_mail
try:
# Django 1.2
from ... | mit |
JCA-Developpement/Odoo | addons/account_bank_statement_extensions/report/__init__.py | 415 | 1128 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
Midafi/scikit-image | skimage/viewer/widgets/core.py | 35 | 10580 | from ..qt import QtWidgets, QtCore, Qt, QtGui
from ..utils import RequiredAttr
__all__ = ['BaseWidget', 'Slider', 'ComboBox', 'CheckBox', 'Text', 'Button']
class BaseWidget(QtWidgets.QWidget):
plugin = RequiredAttr("Widget is not attached to a Plugin.")
def __init__(self, name, ptype=None, callback=None)... | bsd-3-clause |
birdsarah/bokeh | bokeh/util/serialization.py | 4 | 4029 | """ Functions for helping with serialization and deserialization of
Bokeh objects.
"""
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
_simple_id = 1000
def make_id():
""" Return a new unique ID for a Bokeh object.
Normally this function will return UUIDs to use for ... | bsd-3-clause |
Itxaka/st2 | st2api/tests/unit/controllers/v1/test_base.py | 1 | 2888 | # 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... | apache-2.0 |
jamezpolley/pip | pip/_vendor/requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... | mit |
michaelaye/iuvs | iuvs/profile_movie_plotter.py | 1 | 4393 | import os
import sys
import matplotlib
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from . import io, scaling
from .multitools import IntProgress, display
matplotlib.use('Agg')
def apply_and_compare(l1b, Scaler=scaling.PolyScaler1):
plt.ioff(... | isc |
mgit-at/ansible | test/units/modules/network/f5/test_bigip_gtm_global.py | 21 | 3688 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
phenoxim/cinder | cinder/scheduler/filters/extra_specs_ops.py | 13 | 2432 | # Copyright (c) 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... | apache-2.0 |
Omegaphora/external_chromium_org | tools/telemetry/telemetry/results/page_run_unittest.py | 33 | 2090 | # 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.
import os
import unittest
from telemetry.page import page_set
from telemetry.results import page_run
from telemetry.value import failure
from telemetry.valu... | bsd-3-clause |
ToontownUprising/src | toontown/suit/DistributedCashbotBoss.py | 1 | 43368 | from direct.directnotify import DirectNotifyGlobal
from direct.fsm import FSM
from direct.interval.IntervalGlobal import *
from direct.task.Task import Task
from direct.task.TaskManagerGlobal import *
import math
from pandac.PandaModules import *
import random
import DistributedBossCog
import DistributedCashbotBossGoo... | mit |
rbalint/xbmc | tools/EventClients/lib/python/zeroconf.py | 181 | 4874 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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 opti... | gpl-2.0 |
bcoca/ansible | lib/ansible/modules/uri.py | 19 | 28788 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Romeo Theriault <romeot () hawaii.edu>
# 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
DOCUMENTATION = r'''
---
module: ... | gpl-3.0 |
NTesla/pattern | examples/05-vector/07-slp.py | 21 | 5861 | import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import random
from codecs import open
from collections import defaultdict
from pattern.text import Model
from pattern.vector import shuffled, SLP
from pattern.en import lexicon, parsetree
from random import... | bsd-3-clause |
arangodb/arangodb | 3rdParty/V8/v7.9.317/tools/release/common_includes.py | 6 | 30305 | #!/usr/bin/env python
# Copyright 2013 the V8 project authors. 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... | apache-2.0 |
appsembler/edx-platform | openedx/core/djangoapps/user_api/migrations/0001_initial.py | 13 | 2793 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
import model_utils.fields
import django.core.validators
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration)... | agpl-3.0 |
JamesClough/networkx | networkx/algorithms/components/attracting.py | 5 | 3852 | # -*- coding: utf-8 -*-
# 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.
#
# Authors: Christopher Ellison
"""Attracting components."""
import networkx as nx
from networkx.utils.decora... | bsd-3-clause |
Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/python/lib/encodings/tis_620.py | 272 | 12300 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='st... | gpl-3.0 |
0todd0000/spm1d | spm1d/data/uv0d/anova2nested.py | 1 | 1275 |
import numpy as np
from .. import _base
class QIMacros(_base.DatasetANOVA2nested): #nested
def _set_values(self):
self.www = 'https://www.qimacros.com/hypothesis-testing/anova-two-way-nested-excel/'
self.Y = np.array([3,4,7.1,7.1, 6,5,8.1,8.1, 3,4,7.1,9.1, 3,3,6,8.1, 1,2,5,9.9, 2,3,6,9.9, 2,4,5,8.9... | gpl-3.0 |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/encodings/cp1251.py | 272 | 13361 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | lgpl-3.0 |
edk0/IAmARelayBotAMA | tx_redis.py | 1 | 6135 | from __future__ import print_function
from twisted.internet import protocol
class Node(object):
def __init__(self, length=None, parent=None, data=None):
self.data = data or []
self.parent = parent
self.length = length or (len(self.data) if isinstance(self.data, list) else None) o... | mit |
cboling/SDNdbg | docs/old-stuff/pydzcvr/doc/neutron/plugins/mlnx/db/mlnx_db_v2.py | 15 | 10337 | # Copyright 2013 Mellanox Technologies, Ltd
#
# 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 t... | apache-2.0 |
rowillia/buck | src/com/facebook/buck/python/__test_main__.py | 1 | 13102 | #!/usr/local/bin/python2.6 -tt
#
# Copyright 2004-present Facebook. All rights reserved.
#
"""
This file contains the main module code for buck python test programs.
By default, this is the main module for all python_test() rules. However,
rules can also specify their own custom main_module. If you write your own
m... | apache-2.0 |
NORMA-Inc/AtEar | module/NetBIOS.py | 4 | 3922 | __author__ = 'root'
import random, socket, time, select
import struct, string, re
import types, errno
class NetBIOS():
def __init__(self, broadcast=True, listen_port=0):
self.broadcast = broadcast
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.HEADER_STRUCT_FORMAT = '>HH... | apache-2.0 |
blossomica/airmozilla | mysql2postgres/py-mysql2pgsql-0.1.5/tests/test_writer.py | 26 | 4467 | from __future__ import with_statement, absolute_import
import os
import sys
import re
import tempfile
import unittest
from . import WithReader
sys.path.append(os.path.abspath('../'))
from mysql2pgsql.lib.postgres_writer import PostgresWriter
from mysql2pgsql.lib.postgres_file_writer import PostgresFileWriter
from my... | bsd-3-clause |
aperigault/ansible | lib/ansible/modules/remote_management/oneview/oneview_san_manager.py | 146 | 7717 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# 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',
... | gpl-3.0 |
hsum/sqlalchemy | lib/sqlalchemy/engine/util.py | 81 | 2338 | # engine/util.py
# Copyright (C) 2005-2015 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
from .. import util
def connection_memoize(key):
"""Decorator, memoize a functi... | mit |
campagnola/acq4 | acq4/pyqtgraph/graphicsItems/TextItem.py | 3 | 8282 | import numpy as np
from ..Qt import QtCore, QtGui
from ..Point import Point
from .. import functions as fn
from .GraphicsObject import GraphicsObject
class TextItem(GraphicsObject):
"""
GraphicsItem displaying unscaled text (the text will always appear normal even inside a scaled ViewBox).
"""
def __... | mit |
rahul67/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/tr/formats.py | 118 | 1142 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATE... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.