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 |
|---|---|---|---|---|---|
DavidResin/aps-aalto | stitch/cv/lib/python3.4/site-packages/pip/utils/build.py | 899 | 1312 | from __future__ import absolute_import
import os.path
import tempfile
from pip.utils import rmtree
class BuildDirectory(object):
def __init__(self, name=None, delete=None):
# If we were not given an explicit directory, and we were not given an
# explicit delete option, then we'll default to del... | gpl-3.0 |
open-o/nfvo | lcm/lcm/packages/tests/test_nf.py | 1 | 23203 | # Copyright 2016-2017 ZTE 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 applicable law or agreed t... | apache-2.0 |
emilk/sproxel | distro/common/lib/ctypes/macholib/dylib.py | 59 | 2107 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.comp... | bsd-3-clause |
bitkeeper/python-opcua | examples/client_to_kepware.py | 1 | 1723 | import sys
sys.path.insert(0, "..")
import logging
from opcua import Client
from opcua import uaprotocol as ua
class SubHandler(object):
"""
Client to subscription. It will receive events from server
"""
def datachange_notification(self, node, val, data):
print("Python: New data change even... | lgpl-3.0 |
clumsy/intellij-community | python/lib/Lib/unicodedata.py | 69 | 6437 | from bisect import bisect_left
import operator
import java.lang.Character
# XXX - this is intended as a stopgap measure until 2.5.1, which will have a Java implementation
# requires java 6 for `normalize` function
# only has one version of the database
# does not normalized ideographs
_codepoints = {}
_eaw = {}
_name... | apache-2.0 |
EDRN/CancerDataExpo | src/edrn.rdf/setup.py | 2 | 2657 | # encoding: utf-8
# Copyright 2008-2011 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
from setuptools import setup, find_packages
import os.path
# Package data
# ------------
_name = 'edrn.rdf'
_version = '1.3.8'
_description = 'EDRN RDF S... | apache-2.0 |
stephanie-wang/ray | python/ray/tune/suggest/sigopt.py | 1 | 5550 | import copy
import os
import logging
import pickle
try:
import sigopt as sgo
except ImportError:
sgo = None
from ray.tune.suggest.suggestion import SuggestionAlgorithm
logger = logging.getLogger(__name__)
class SigOptSearch(SuggestionAlgorithm):
"""A wrapper around SigOpt to provide trial suggestions.
... | apache-2.0 |
aetilley/scikit-learn | examples/svm/plot_svm_anova.py | 250 | 2000 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... | bsd-3-clause |
dagdaggo/coala | tests/bearlib/spacing/SpacingHelperTest.py | 26 | 4341 | import unittest
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.settings.Section import Section
class SpacingHelperTest(unittest.TestCase):
def setUp(self):
self.uut = SpacingHelper()
def test_needed_settings(self):
self.assertEqual(list(self.uut.get_optional_sett... | agpl-3.0 |
hanchentech/git-repo | subcmds/help.py | 48 | 4794 | #
# Copyright (C) 2008 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 required by applicable la... | apache-2.0 |
CubicERP/odoo | addons/account/report/account_journal.py | 255 | 10035 | # -*- 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 |
hailongqiu/new-deepin-media-player | src/widget/preview.py | 2 | 6604 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Deepin, Inc.
# 2012 Hailong Qiu
#
# Author: Hailong Qiu <356752238@qq.com>
# Maintainer: Hailong Qiu <356752238@qq.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | gpl-3.0 |
wqer1019/student-work | vendor/psy/psysh/test/tools/vis.py | 710 | 3428 | """
vis.py
======
Ctypes based module to access libbsd's strvis & strunvis functions.
The `vis` function is the equivalent of strvis.
The `unvis` function is the equivalent of strunvis.
All functions accept unicode string as input and return a unicode string.
Constants:
----------
* to select alternate encoding for... | mit |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/util/deprecation_test.py | 17 | 28084 | # 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... | mit |
kaltsimon/youtube-dl | youtube_dl/extractor/myspass.py | 105 | 2721 | from __future__ import unicode_literals
import os.path
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
)
class MySpassIE(InfoExtractor):
_VALID_URL = r'http://www\.myspass\.de/.*'
_TEST = {
'url': 'http://www.myspa... | unlicense |
klenks/jobsportal | venv/lib/python2.7/site-packages/debug_toolbar/panels/templates/views.py | 3 | 2341 | from __future__ import absolute_import, unicode_literals
from django.http import HttpResponseBadRequest
from django.shortcuts import render_to_response
from django.template import TemplateDoesNotExist
from django.template.engine import Engine
from django.utils.safestring import mark_safe
try:
from django.template... | mit |
Eksmo/calibre | src/calibre/ebooks/oeb/transforms/jacket.py | 1 | 8466 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys
from xml.sax.saxutils import escape
from lxml import etree
from calibre ... | gpl-3.0 |
araines/moto | tests/test_s3/test_s3_lifecycle.py | 18 | 3339 | from __future__ import unicode_literals
import boto
from boto.exception import S3ResponseError
from boto.s3.lifecycle import Lifecycle, Transition, Expiration, Rule
import sure # noqa
from moto import mock_s3
@mock_s3
def test_lifecycle_create():
conn = boto.s3.connect_to_region("us-west-1")
bucket = conn... | apache-2.0 |
bourneagain/pythonBytes | quickSort.py | 1 | 1075 | œœdef kthlargest(arr1, arr2, k):
if len(arr1) == 0:
return arr2[k]
elif len(arr2) == 0:
return arr1[k]
mida1 = len(arr1)/2
mida2 = len(arr2)/2
if mida1+mida2<k:
if arr1[mida1]>arr2[mida2]:
return kthlargest(arr1, arr2[mida2+1:], k-mida2-1)
else:
... | mit |
stackforge/networking-nec | networking_nec/nwa/common/config.py | 2 | 4009 | # Copyright 2015-2016 NEC Corporation. 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 |
ergoregion/Rota-Program | Rota_System/UI/People/widget_population.py | 1 | 1876 | __author__ = 'Neil Butcher'
from PyQt4 import QtCore, QtGui
from model_population import PopulationModel
from Rota_System.UI.widget_addDel_list import AddDelListWidget
from widget_person import PersonWidget
class PopulationWidget(QtGui.QWidget):
commandIssued = QtCore.pyqtSignal(QtGui.QUndoCommand)
criticalC... | mit |
williamfeng323/py-web | flask/lib/python3.6/site-packages/sqlalchemy_utils/listeners.py | 2 | 7485 | import sqlalchemy as sa
from .exceptions import ImproperlyConfigured
def coercion_listener(mapper, class_):
"""
Auto assigns coercing listener for all class properties which are of coerce
capable type.
"""
for prop in mapper.iterate_properties:
try:
listener = prop.columns[0].... | mit |
BT-astauder/odoo | addons/web_analytics/__openerp__.py | 305 | 1432 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
brianwoo/django-tutorial | ENV/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.py | 475 | 9162 | """
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'somefile', 'is locked already... | gpl-3.0 |
Boedaxbayah-vpn/boedaxbayah | ps_mem.py | 3 | 17568 | #!/usr/bin/env python
# Try to determine how much RAM is currently being used per program.
# Note per _program_, not per process. So for example this script
# will report RAM used by all httpd process together. In detail it reports:
# sum(private RAM for program processes) + sum(Shared RAM for program processes)
# The... | gpl-3.0 |
introprogramming/exercises | exercises/plot_2d/plot_2d.py | 1 | 5835 | import math, pygame
from pygame.locals import *
#############################################
## Standard colors (RGB)
BLACK = (20, 20, 40)
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
#############################################
## Customize plot here
def function_to_print(x):
... | mit |
hitchtest/hitchvagrant | hitchvagrant/vagrant.py | 1 | 1317 | from sys import argv, stdout, stderr, exit
from subprocess import call, PIPE
from os import path, chdir
import optparse
import time
def run():
parser = optparse.OptionParser()
parser.add_option("-d", "--directory", type="str", dest="directory", default=".",
help="Specify the directory th... | agpl-3.0 |
dannyboi104/SickRage | lib/hachoir_parser/archive/mozilla_ar.py | 74 | 2405 | """MAR (Mozilla ARchive) parser
Author: Robert Xiao
Creation date: July 10, 2007
"""
from hachoir_core.endian import BIG_ENDIAN
from hachoir_core.field import (RootSeekableFieldSet, FieldSet,
String, CString, UInt32, RawBytes)
from hachoir_core.text_handler import displayHandler, filesizeHandler
from hachoir_cor... | gpl-3.0 |
meabsence/python-for-android | python3-alpha/python3-src/Tools/pybench/Unicode.py | 92 | 11110 | try:
unicode
except NameError:
raise ImportError
from pybench import Test
class ConcatUnicode(Test):
version = 2.0
operations = 10 * 5
rounds = 60000
def test(self):
# Make sure the strings are *not* interned
s = unicode(u''.join(map(str,range(100))))
t = unicode(u''... | apache-2.0 |
IgowWang/ML_python3 | kerasgo/qa.py | 2 | 4487 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author igor
# Created by iFantastic on 16-6-3
import re
import tarfile
from functools import reduce
import numpy as np
import nltk
from keras.preprocessing.sequence import pad_sequences
from keras.layers.embeddings import Embedding
from keras.layers.core import Dense, M... | gpl-3.0 |
jwiggins/scikit-image | skimage/transform/tests/test_pyramids.py | 35 | 2302 | from numpy.testing import assert_array_equal, assert_raises, run_module_suite
from skimage import data
from skimage.transform import pyramids
image = data.astronaut()
image_gray = image[..., 0]
def test_pyramid_reduce_rgb():
rows, cols, dim = image.shape
out = pyramids.pyramid_reduce(image, downscale=2)
... | bsd-3-clause |
hqpr/findyour3d | findyour3d/company/forms.py | 1 | 6270 | from django import forms
from .models import Company, SpecialOffer
EXPEDITED_CHOICES = (
(0, 'No, we do not offer any expedited shipping options.'),
(1, 'Yes we offer an expedited process for a fee.')
)
class AddCompanyForm(forms.ModelForm):
class Meta:
model = Company
fields = ['name'... | mit |
seberm/Titulky.com-Downloader | prototypes/captcha-qt/captcha.py | 1 | 2280 | import sys
from PyQt4 import QtGui, QtCore, QtNetwork
from PyQt4.QtCore import SLOT, SIGNAL
CAPTCHA_URL = 'http://www.titulky.com/captcha/captcha.php'
MAX_CAPTCHA_LEN = 8
class CaptchaDialog(QtGui.QDialog):
# Signal is emmited if captcha code is sucessfuly re-typed
codeRead = QtCore.pyqtSignal()
def... | gpl-3.0 |
CEG-FYP-OpenStack/scheduler | nova/tests/unit/pci/test_request.py | 11 | 7404 | # Copyright 2013 Intel Corporation
# 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 require... | apache-2.0 |
hainn8x/gnuradio | gr-blocks/python/blocks/qa_multiply_matrix_ff.py | 19 | 4796 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 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 versio... | gpl-3.0 |
uwosh/Campus_Directory_web_service | getAllSubjectsCX.py | 1 | 1441 | # getAllSubjectsCX
import re
import xmlrpclib
import cx_Oracle
Kim_Nguyen_G5 = '192.168.0.1'
Kim_Nguyen_iMac = '192.168.0.1'
Kim_Nguyen_MacBook = '192.168.0.1'
Plone1 = '192.168.0.1'
Plone3 = '192.168.0.1'
def getAllSubjectsCX (self, usexml):
request = self.REQUEST
RESPONSE = request.RESPONSE
remote_ad... | gpl-2.0 |
crs4/ProMort | promort/utils/__init__.py | 42 | 1098 | # Copyright (c) 2019, CRS4
#
# 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, including without limitation the rights to
# use, copy, modify, merge, publish, distribu... | mit |
SecWiki/windows-kernel-exploits | MS14-068/pykek/pyasn1/type/namedtype.py | 200 | 4794 | # NamedType specification for constructed types
import sys
from pyasn1.type import tagmap
from pyasn1 import error
class NamedType:
isOptional = 0
isDefaulted = 0
def __init__(self, name, t):
self.__name = name; self.__type = t
def __repr__(self): return '%s(%s, %s)' % (
self.__class__.... | mit |
cooniur/ansible-modules-core | cloud/amazon/ec2_vol.py | 11 | 19254 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
hplustree/trove | trove/db/sqlalchemy/migrate_repo/versions/025_add_service_statuses_indexes.py | 4 | 1221 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
dockerera/func | func/minion/modules/netapp/options.py | 5 | 1483 | ##
## NetApp Filer 'options' Module
##
## Copyright 2008, Red Hat, Inc
## John Eckersberg <jeckersb@redhat.com>
##
## This software may be freely redistributed under the terms of the GNU
## general public license.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not... | gpl-2.0 |
ivanalejandro0/bitmask_client | src/leap/bitmask/logs/streamtologger.py | 8 | 2008 | # -*- coding: utf-8 -*-
# streamtologger.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
domenicosolazzo/jroc | tests/jroc/nlp/pos/nltk/test_taggerstorage.py | 1 | 1821 | # -*- coding: utf-8 -*-
from . import TaggerStorageAdapter
import unittest
import os
import codecs
class TaggerStorageAdapterTestCase(unittest.TestCase):
taggerStorage = TaggerStorageAdapter()
currentDirectory = "%s" % (os.path.dirname(os.path.realpath(__file__)), )
testTextsDirectory = "%s/../../../../d... | gpl-3.0 |
karsev/mbed-os | TESTS/netsocket/host_tests/udp_shotgun.py | 39 | 4553 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... | apache-2.0 |
pnavarro/neutron | neutron/tests/base.py | 1 | 13886 | # Copyright 2010-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 required by ap... | apache-2.0 |
ryancanhelpyou/servo | components/script/dom/bindings/codegen/parser/tests/test_enum.py | 134 | 2866 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
enum TestEnum {
"",
"foo",
"bar"
};
interface TestEnumInterface {
TestEnum doFoo(boolean arg);
readonly attribute TestEnum foo;
};
""")
results = parser.finish... | mpl-2.0 |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/utils/data.py | 3 | 1165 | # encoding: utf-8
"""Utilities for working with data structures like lists, dicts and tuples.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the f... | apache-2.0 |
D4wN/brickv | src/build_data/windows/OpenGL/GL/ATI/text_fragment_shader.py | 4 | 3610 | '''OpenGL extension ATI.text_fragment_shader
This module customises the behaviour of the
OpenGL.raw.GL.ATI.text_fragment_shader to provide a more
Python-friendly API
Overview (from the spec)
The ATI_fragment_shader extension exposes a powerful fragment
processing model that provides a very general means of expr... | gpl-2.0 |
Diti24/python-ivi | ivi/agilent/agilentDSA90804A.py | 1 | 1686 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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, including without limitation the... | mit |
mtekel/libcloud | libcloud/test/compute/test_opennebula.py | 46 | 46927 | # Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
# Complutense de Madrid (dsa-research.org)
#
# 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 ... | apache-2.0 |
wangjun/xiaohuangji | tests/test_config.py | 7 | 2111 | #-*-coding:utf-8-*-
"""
Copyright (c) 2012 wgx731 <wgx731@gmail.com>
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, including
without limitation the rights to use, copy, mod... | mit |
ArtsiomCh/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py | 8 | 16622 | # 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 |
niieani/rethinkdb | test/rql_test/connections/http_support/werkzeug/testsuite/compat.py | 146 | 1117 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... | agpl-3.0 |
bwesterb/mirte | src/threadPool.py | 1 | 5025 | from mirte.core import Module
from six.moves import range
import logging
import threading
try:
import prctl
except ImportError:
prctl = None
class ThreadPool(Module):
class Worker(threading.Thread):
def __init__(self, pool, l):
self._name = None
threading.Thread.__init... | agpl-3.0 |
ww9rivers/pysnmp | pysnmp/proto/errind.py | 4 | 5505 | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
class ErrorIndication:
"""SNMPv3 error-indication values"""
def __init__(self, descr=None):
self.__value = self.__descr = self.__class__.__name__[0].lower() ... | bsd-2-clause |
vlachoudis/sl4a | python/src/Lib/distutils/cygwinccompiler.py | 50 | 17299 | """distutils.cygwinccompiler
Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows. It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
"""
# problems:
#
# * if you use a msvc com... | apache-2.0 |
googlearchive/simian | src/tests/simian/client/client_test.py | 1 | 41740 | #!/usr/bin/env python
#
# Copyright 2018 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 require... | apache-2.0 |
alsrgv/tensorflow | tensorflow/contrib/distributions/python/ops/quantized_distribution.py | 22 | 20681 | # 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 |
imiolek-ireneusz/eduActiv8 | eduactiv82exe.py | 1 | 6732 | # -*- coding: utf8 -*-
# This will create a dist directory containing the executable file, all the data
# directories. All Libraries will be bundled in executable file.
#
# Run the build process by entering 'pygame2exe.py' or
# 'python pygame2exe.py' in a console prompt.
#
# To build exe, python, pygame, and py2exe ha... | gpl-3.0 |
moylop260/odoo-dev | addons/hr_timesheet_invoice/wizard/__init__.py | 433 | 1159 | # -*- 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 |
ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/api/openstack/compute/contrib/createserverext.py | 100 | 1156 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | gpl-2.0 |
srcLurker/home-assistant | tests/components/test_input_boolean.py | 15 | 3095 | """The tests for the input_boolean component."""
# pylint: disable=protected-access
import unittest
import logging
from tests.common import get_test_home_assistant
from homeassistant.bootstrap import setup_component
from homeassistant.components.input_boolean import (
DOMAIN, is_on, toggle, turn_off, turn_on)
fro... | mit |
echohenry2006/tvb-library | tvb/tests/library/simulator/noise_test.py | 3 | 2676 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | gpl-2.0 |
iivic/BoiseStateX | cms/djangoapps/contentstore/course_group_config.py | 70 | 13178 | """
Class for manipulating groups configuration on a course object.
"""
import json
import logging
from util.db import generate_int_id, MYSQL_MAX_INT
from django.utils.translation import ugettext as _
from contentstore.utils import reverse_usage_url
from xmodule.partitions.partitions import UserPartition
from xmodule... | agpl-3.0 |
Fedik/gramps | gramps/plugins/importer/import.gpr.py | 4 | 5381 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
#
# 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) ... | gpl-2.0 |
deklungel/iRulez | src/button/_domain.py | 1 | 29130 | from enum import IntEnum
import src.irulez.util as util
from abc import ABC, abstractmethod
import src.irulez.log as log
from datetime import time
from typing import List, Dict, Optional
import src.irulez.constants as constants
from threading import Timer
logger = log.get_logger('button_domain')
class ArduinoPinType... | mit |
wmvanvliet/mne-python | tutorials/sample-datasets/plot_brainstorm_phantom_elekta.py | 10 | 6588 | # -*- coding: utf-8 -*-
"""
.. _tut-brainstorm-elekta-phantom:
==========================================
Brainstorm Elekta phantom dataset tutorial
==========================================
Here we compute the evoked from raw for the Brainstorm Elekta phantom
tutorial dataset. For comparison, see :footcite:`TadelEt... | bsd-3-clause |
uvbs/the-backdoor-factory | payloadtests.py | 13 | 6022 | #!/usr/bin/env python
'''
Copyright (c) 2013-2015, Joshua Pitts
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 notice,
this li... | bsd-3-clause |
jaberg/sigops | sigops/operator.py | 1 | 6049 | import numpy as np
import itertools
from collections import defaultdict
import numpy as np
import networkx as nx
def is_op(thing):
try:
return thing._is_sigops_operator
except AttributeError:
return False
class Operator(object):
"""Base class for operator instances understood by nengo.... | bsd-2-clause |
javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/google/protobuf/descriptor_pool.py | 20 | 46541 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
Ldpe2G/mxnet | example/ssd/tools/visualize_net.py | 10 | 1148 | from __future__ import print_function
import find_mxnet
import mxnet as mx
import importlib
import argparse
import sys
parser = argparse.ArgumentParser(description='network visualization')
parser.add_argument('--network', type=str, default='vgg16_ssd_300',
choices = ['vgg16_ssd_300', 'vgg16_ssd_512... | apache-2.0 |
atupone/xbmc | addons/service.xbmc.versioncheck/lib/aptdeamonhandler.py | 177 | 3661 | # -*- coding: utf-8 -*-
#
# Copyright (C) 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 3 of the License, or
# (at your option) any later versio... | gpl-2.0 |
slaws/kubernetes | examples/selenium/selenium-test.py | 173 | 1109 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
johankaito/fufuka | microblog/flask/venv/lib/python2.7/site-packages/celery/utils/threads.py | 9 | 9636 | # -*- coding: utf-8 -*-
"""
celery.utils.threads
~~~~~~~~~~~~~~~~~~~~
Threading utilities.
"""
from __future__ import absolute_import, print_function
import os
import socket
import sys
import threading
import traceback
from contextlib import contextmanager
from celery.local import Proxy
from celery.fiv... | apache-2.0 |
smolix/incubator-mxnet | example/rcnn/rcnn/pycocotools/setup.py | 41 | 1365 | # 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 |
KasperPRasmussen/bokeh | bokeh/models/tiles.py | 8 | 4095 | from __future__ import absolute_import
from ..model import Model
from ..core.properties import Any, Dict, Float, String, Int, Bool, Override
class TileSource(Model):
""" A base class for all tile source types. ``TileSource`` is
not generally useful to instantiate on its own. In general, tile sources are used ... | bsd-3-clause |
martinohanlon/minecraft-clock | minecraft-clock.py | 1 | 5099 | #www.stuffaboutcode.com
#Raspberry Pi, Minecraft Analogue Clock
#import the minecraft.py module from the minecraft directory
import minecraft.minecraft as minecraft
#import minecraft block module
import minecraft.block as block
#import time, so delays can be used
import time
#import datetime, to get the time!
import d... | mit |
foss-transportationmodeling/rettina-server | flask/local/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/adodbapi.py | 80 | 2493 | # mssql/adodbapi.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
"""
.. dialect:: mssql+adodbapi
:name: adodbapi
:dbapi: adodbapi
:conn... | apache-2.0 |
okanasik/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_smartcamera/sc_config.py | 4 | 5131 | """
SmartCameraConfig class : handles config for the smart_camera project
smart_camera.cnf file is created in the local directory
other classes or files wishing to use this class should add
import sc_config
"""
from os.path import expanduser
import ConfigParser
class SmartCameraConfig(object):
def __init_... | gpl-3.0 |
cselis86/edx-platform | lms/envs/devstack.py | 6 | 4593 | """
Specific overrides to the base prod settings to make development easier.
"""
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
# Don't use S3 in devstack, fall back to filesystem
del DEFAULT_FILE_STORAGE
MEDIA_ROOT = "/edx/var/edxapp/uploads"
DEBUG = True
USE_I18N = True
TEMPLATE_DEB... | agpl-3.0 |
youprofit/scikit-image | skimage/io/_plugins/fits_plugin.py | 28 | 4735 | __all__ = ['imread', 'imread_collection']
import skimage.io as io
try:
from astropy.io import fits as pyfits
except ImportError:
try:
import pyfits
except ImportError:
raise ImportError(
"PyFITS could not be found. Please refer to\n"
"http://www.stsci.edu/resources/... | bsd-3-clause |
nickmoline/feedsanitizer | django/contrib/auth/management/__init__.py | 104 | 2973 | """
Creates permissions for all installed apps that need permissions.
"""
from django.contrib.auth import models as auth_app
from django.db.models import get_models, signals
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retu... | mit |
iradul/phantomjs-clone | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/suggestnominations_unittest.py | 121 | 4444 | # Copyright (C) 2011 Google Inc. All rights reserved.
# Copyright (C) 2011 Code Aurora Forum. 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 th... | bsd-3-clause |
paran0ids0ul/infernal-twin | build/reportlab/tests/test_widgetbase_tpc.py | 15 | 2997 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
"""
Tests for TypedPropertyCollection class.
"""
__version__='''$Id$'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
setOutDir(__name__)
import os, sys, copy
from os.path import join, basename, splitext
i... | gpl-3.0 |
ahmedaljazzar/edx-platform | lms/djangoapps/instructor_task/tasks_helper/runner.py | 16 | 5153 | import json
import logging
from time import time
from celery import current_task
from django.db import reset_queries
import dogstats_wrapper as dog_stats_api
from lms.djangoapps.instructor_task.models import PROGRESS, InstructorTask
from util.db import outer_atomic
TASK_LOG = logging.getLogger('edx.celery.task')
c... | agpl-3.0 |
parksandwildlife/biosys | biosys/apps/main/utils_misc.py | 4 | 2739 | from django.db.models.expressions import RawSQL
def get_value(keys, dict_, default=None):
"""
Given a list of keys, search in a dict for the first matching keys (case insensitive) and return the value
Note: the search is case insensitive.
:param keys: list of possible keys
:param dict_:
:param... | apache-2.0 |
lovette/flask_signedcookies | setup.py | 1 | 1129 | from setuptools import setup
setup(
name='flask_signedcookies',
version='1.0.0',
url='https://github.com/lovette/flask_signedcookies',
download_url = 'https://github.com/lovette/flask_signedcookies/archive/master.tar.gz',
license='BSD',
author='Lance Lovette',
author_email='lance.lovette@gmail... | bsd-3-clause |
fegonda/icon_demo | code/external/SdA.py | 4 | 18933 | """
This tutorial introduces stacked denoising auto-encoders (SdA) using Theano.
Denoising autoencoders are the building blocks for SdA.
They are based on auto-encoders as the ones used in Bengio et al. 2007.
An autoencoder takes an input x and first maps it to a hidden representation
y = f_{\theta}(x) = s(Wx+b),... | mit |
sebfung/yellowpillowcase | vendor/cache/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/lexers/_phpbuiltins.py | 47 | 154371 | # -*- coding: utf-8 -*-
"""
pygments.lexers._phpbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... | mit |
walac/servo | python/servo/build_commands.py | 3 | 12824 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/numpy/lib/tests/test_format.py | 27 | 34230 | from __future__ import division, absolute_import, print_function
r''' Test the .npy file format.
Set up:
>>> import sys
>>> from io import BytesIO
>>> from numpy.lib import format
>>>
>>> scalars = [
... np.uint8,
... np.int8,
... np.uint16,
... np.int16,
... ... | gpl-3.0 |
jcpowermac/ansible | lib/ansible/modules/notification/twilio.py | 47 | 5594 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@gmail.com>
# 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 |
superchilli/webapp | venv/lib/python2.7/site-packages/html5lib/tokenizer.py | 1710 | 76929 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... | mit |
ECastleton/Popstop | popsicle/orders/migrations/0007_auto_20170425_2210.py | 1 | 1295 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-26 04:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('orders', '0006_auto_20170424_2037'),
]
operations ... | gpl-3.0 |
OpenClovis/SAFplus-Availability-Scalability-Platform | src/ide/genshi/genshi/filters/html.py | 22 | 22797 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | gpl-2.0 |
pschmitt/home-assistant | homeassistant/components/jewish_calendar/__init__.py | 7 | 4146 | """The jewish_calendar component."""
import logging
import hdate
import voluptuous as vol
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import async_load_platform
_LOGGER = logging.getLogger(__name__)... | apache-2.0 |
imply/chuu | tools/find_runtime_symbols/prepare_symbol_info.py | 24 | 8217 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import hashlib
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
from proc... | bsd-3-clause |
hbrunn/OpenUpgrade | addons/l10n_syscohada/__openerp__.py | 430 | 1940 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2011 BAAMTU SARL (<http://www.baamtu.sn>).
# contact: leadsn@baamtu.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... | agpl-3.0 |
alipsgh/tornado | archiver/archiver.py | 1 | 1542 | """
The Tornado Framework
By Ali Pesaranghader
University of Ottawa, Ontario, Canada
E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com
"""
import os
import zipfile
from os.path import basename
class Archiver:
"""
This class stores results of experiments in .zip files for fut... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sympy/utilities/runtests.py | 3 | 46156 | """
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly (or
identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* port... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.