repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
AMObox/teammaniac | plugin.video.specto/resources/lib/resolvers/nowvideo.py | 23 | 1452 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
rudimeier/numpy | numpy/core/tests/test_function_base.py | 68 | 4911 | from __future__ import division, absolute_import, print_function
from numpy import (logspace, linspace, dtype, array, finfo, typecodes, arange,
isnan)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert_array_equal
)
class TestLogspace(TestC... | bsd-3-clause |
eric-haibin-lin/mxnet | example/named_entity_recognition/src/ner.py | 4 | 12663 | # !/usr/bin/env python
# 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
# "... | apache-2.0 |
GodBlessPP/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/browser/markdown.py | 623 | 13060 | # -*- coding: utf-8 -*-
try:
import _jsre as re
except:
import re
import random
import time
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if ... | agpl-3.0 |
ghchinoy/tensorflow | tensorflow/contrib/graph_editor/tests/match_test.py | 132 | 2679 | # 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 |
azurestandard/django | django/contrib/gis/geos/geometry.py | 3 | 24088 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
# Python, ctypes and types dependencies.
from ctypes import addressof, byref, c_double
# super-class for mutable list behavior
from django.contrib.gis.geos.mutable_list import ListMixin
# GEOS-related depend... | bsd-3-clause |
fintech-circle/edx-platform | lms/djangoapps/support/views/enrollments.py | 26 | 7612 | """
Support tool for changing course enrollments.
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models import Q
from django.http import HttpResponseBadRequest
from django.utils.decorators import method_decorator
from django.... | agpl-3.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/scipy/weave/examples/fibonacci.py | 100 | 3980 | # Typical run:
# C:\home\eric\wrk\scipy\weave\examples>python fibonacci.py
# Recursively computing the first 30 fibonacci numbers:
# speed in python: 4.31599998474
# speed in c: 0.0499999523163
# speed up: 86.32
# Looping to compute the first 30 fibonacci numbers:
# speed in python: 0.000520999908447
# speed in c:... | gpl-3.0 |
hsmade/expenses | expenses/tests.py | 1 | 9500 | from django.test import TestCase
from django.utils import timezone
from .models import Month, Withdrawal, Deposit, DepositType, WithdrawalType
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from . import import_data
from expenses.lib import rabo
from tempfile import N... | gpl-2.0 |
elkingtonmcb/nupic | tests/unit/nupic/algorithms/svm_test.py | 35 | 4846 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
MSOpenTech/edx-platform | cms/djangoapps/contentstore/tests/test_users_default_role.py | 48 | 5386 | """
Unit tests for checking default forum role "Student" of a user when he creates a course or
after deleting it creates same course again
"""
from contentstore.tests.utils import AjaxEnabledTestClient
from contentstore.utils import delete_course_and_groups, reverse_url
from courseware.tests.factories import UserFactor... | agpl-3.0 |
hwfwgrp/mbed | workspace_tools/host_tests/midi.py | 111 | 1933 | from __future__ import print_function
import sys
import re
import time
import mido
from mido import Message
def test_midi_in(port):
expected_messages_count=0
while expected_messages_count < 7:
for message in port.iter_pending():
if message.type in ('note_on', 'note_off', 'program_change', 'sysex'):
yield m... | apache-2.0 |
tagliateller/openshift-ansible | roles/lib_utils/test/openshift_master_facts_default_priorities_tests.py | 7 | 2828 | import pytest
DEFAULT_PRIORITIES_3_6 = [
{'name': 'SelectorSpreadPriority', 'weight': 1},
{'name': 'InterPodAffinityPriority', 'weight': 1},
{'name': 'LeastRequestedPriority', 'weight': 1},
{'name': 'BalancedResourceAllocation', 'weight': 1},
{'name': 'NodePreferAvoidPodsPriority', 'weight': 10000... | apache-2.0 |
yannrouillard/weboob | modules/banqueaccord/pages.py | 1 | 5605 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | agpl-3.0 |
bask/or-tools | examples/tests/test_cp_api.py | 30 | 6359 | # Various calls to CP api from python to verify they work.
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import model_pb2
from ortools.constraint_solver import search_limit_pb2
def test_member():
solver = pywrapcp.Solver('test member')
x = solver.IntVar(1, 10, 'x')
ct = x.Member(... | apache-2.0 |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/projects/tasks/signals.py | 2 | 4592 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | mit |
dbaxa/django | tests/utils_tests/test_datastructures.py | 262 | 4154 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
from django.test import SimpleTestCase
from django.utils import six
from django.utils.datastructures import (
DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError,
OrderedSet,
)
class OrderedSetTests(SimpleTestCase):
def ... | bsd-3-clause |
4Quant/tensorflow | tensorflow/models/image/cifar10/cifar10_input.py | 2 | 9627 | # Copyright 2015 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 a... | apache-2.0 |
mani-monaj/ros_buildfarm | scripts/status/build_release_status_page.py | 3 | 1164 | #!/usr/bin/env python3
import argparse
import sys
from ros_buildfarm.argument import add_argument_build_name
from ros_buildfarm.argument import add_argument_cache_dir
from ros_buildfarm.argument import add_argument_config_url
from ros_buildfarm.argument import add_argument_output_dir
from ros_buildfarm.argument impor... | apache-2.0 |
franblas/facialrecoChallenge | itml.py | 1 | 3881 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 19:04:51 2015
@author: Paco
"""
"""
Information Theoretic Metric Learning, Kulis et al., ICML 2007
"""
import numpy as np
from sklearn.metrics import pairwise_distances
from base_metric import BaseMetricLearner
class ITML(BaseMetricLearner):
"""
Information The... | mit |
michelts/lettuce | tests/integration/lib/Django-1.2.5/django/core/cache/__init__.py | 45 | 2650 | """
Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client ... | gpl-3.0 |
rouge8/20questions | web/application.py | 2 | 23444 | #!/usr/bin/python
"""
Web application
(from web.py)
"""
import webapi as web
import webapi, wsgi, utils
import debugerror
from utils import lstrips, safeunicode
import sys
import urllib
import traceback
import itertools
import os
import re
import types
from exceptions import SystemExit
try:
im... | mit |
TileHalo/servo | tests/wpt/css-tests/css-fonts-3_dev/xhtml1/reference/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
mattclay/ansible | lib/ansible/plugins/lookup/random_choice.py | 29 | 1558 | # (c) 2013, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# 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 = """
name: random_choice
author: M... | gpl-3.0 |
rickysarraf/autoEqualizer | autoEqualizer.py | 1 | 8836 | #!/usr/bin/python
# autoEqualizer - Script to load equalizer presets ondemand based on what genre of track is playing
# Copyright (C) 2007 Ritesh Raj Sarraf <rrs@researchut.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-3.0 |
spallavolu/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 248 | 2588 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
chainer/chainercv | tests/links_tests/model_tests/deeplab_tests/test_deeplab_v3_plus.py | 3 | 2191 | import unittest
import chainer
from chainer import testing
from chainer.testing import attr
from chainercv.links import DeepLabV3plusXception65
from chainercv.utils import assert_is_semantic_segmentation_link
import numpy as np
@testing.parameterize(
{'model': DeepLabV3plusXception65},
)
class TestDeepLabV3plu... | mit |
Rio517/pledgeservice | testlib/webob/cookies.py | 35 | 27133 | import collections
import base64
import binascii
import hashlib
import hmac
import json
from datetime import (
date,
datetime,
timedelta,
)
import re
import string
import time
from webob.compat import (
PY3,
text_type,
bytes_,
text_,
native_,
string_types,
)
from webob.uti... | apache-2.0 |
fffy2366/image-processing | api.py | 1 | 10056 | #!bin/evn python
# -*-coding:utf8-*-
import base64
import sys
import os
import logging
import datetime
import re
import multiprocessing
# from pylab import *
from PIL import Image
import cv2
from bceocrapi import BceOCRAPI
from bin.python.models.images import Images
from nude import Nude
import imagehash
from bin.py... | mit |
Theer108/invenio | invenio/modules/formatter/api.py | 6 | 13012 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 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 |
Huyuwei/tvm | tests/python/contrib/test_cublas.py | 1 | 2856 | # 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 |
Mitchkoens/sympy | sympy/core/tests/test_trace.py | 99 | 2825 | from sympy import symbols, Matrix, Tuple
from sympy.core.trace import Tr
from sympy.utilities.pytest import raises
def test_trace_new():
a, b, c, d, Y = symbols('a b c d Y')
A, B, C, D = symbols('A B C D', commutative=False)
assert Tr(a + b) == a + b
assert Tr(A + B) == Tr(A) + Tr(B)
#check trac... | bsd-3-clause |
chrxr/wagtail | wagtail/contrib/modeladmin/menus.py | 9 | 1891 | from __future__ import absolute_import, unicode_literals
from wagtail.wagtailadmin.menu import Menu, MenuItem, SubmenuMenuItem
class ModelAdminMenuItem(MenuItem):
"""
A sub-class of wagtail's MenuItem, used by PageModelAdmin to add a link
to its listing page
"""
def __init__(self, model_admin, or... | bsd-3-clause |
prataprc/eazytext | eazytext/extension/.Attic/box.py | 1 | 4735 | # This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
# Copyright (c) 2010 SKR Farms (P) LTD.
# -*- coding: utf-8 -*-
# Gotcha : none
# Notes : none
# Todo : none
# 1. Unit test case for this extension.
from zope.component impor... | gpl-3.0 |
Maskawanian/ude-components | Components/Client/__init__.py | 1 | 1318 | # See LICENCE for the source code licence.
# (c) 2010 Dan Saul
from Base import Base
SAVE_STATUS_SAVED = 0 # We can close this without losing data.
SAVE_STATUS_NOT_SAVED = 1 # If we close this we will lose data, but we can save.
SAVE_STATUS_NOT_SAVED_NEED_PATH = 2 # If we close this we will lo... | lgpl-3.0 |
kineticgar/UCLA-robomagellan | glados_sensors/src/gpsd_client.py | 2 | 1665 | #!/usr/bin/python
# written by asa to interface with gpsd
# I didn't follow this tutorial here: http://www.ros.org/wiki/gpsd_client/Tutorials/Writing%20a%20Subscriber%20for%20gpsd_client%20%28C%2B%2B%29
#import threading
import time
import gps
import sys
from gps import *
import roslib; roslib.load_manifest('gps_comm... | gpl-2.0 |
Alwnikrotikz/pyfpdf | attic/makefont.py | 26 | 9440 | # ******************************************************************************
# * Utility to generate font definition files *
# * Version: 1.13 *
# * Date: 2004-12-31 ... | lgpl-3.0 |
flh/odoo | addons/email_template/__init__.py | 381 | 1144 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
madhavsuresh/chimerascan | chimerascan/deprecated/segment_reads.py | 6 | 3035 | '''
Created on Jan 7, 2011
@author: mkiyer
chimerascan: chimeric transcript discovery using RNA-seq
Copyright (C) 2011 Matthew Iyer
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... | gpl-3.0 |
cee1/cerbero-mac | cerbero/commands/runit.py | 21 | 1365 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
zncb/wtrace | setup.py | 1 | 4273 | #!/usr/bin/env python
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import p... | agpl-3.0 |
beschulz/ved-decoder | lib/googlepb/protobuf/descriptor_pool.py | 2 | 18677 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.googlepb.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions... | mit |
ChanduERP/odoo | addons/stock_dropshipping/wizard/stock_invoice_onshipping.py | 270 | 2139 | # -*- 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 |
bmhatfield/vagrant | test/buildbot/buildbot_config/master/status.py | 8 | 1644 | """
This module returns the given status handlers to enable for the
buildbot master.
"""
from buildbot.status import html, words
from buildbot.status.web.authz import Authz
from buildbot.status.web.auth import BasicAuth
def get_status(options):
"""
Returns a list of status targets for the build master.
""... | mit |
c0defreak/python-for-android | python-modules/twisted/twisted/test/test_log.py | 59 | 20039 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.log}.
"""
import os, sys, time, logging, warnings
from cStringIO import StringIO
from twisted.trial import unittest
from twisted.python import log, failure
class FakeWarning(Warning):
"""
A uni... | apache-2.0 |
openhatch/oh-mainline | mysite/customs/forms.py | 6 | 6990 | # This file is part of OpenHatch.
# Copyright (C) 2010, 2011 Jack Grigg
# Copyright (C) 2012 John Morrissey
#
# This program 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 Licen... | agpl-3.0 |
defaultnamehere/grr | lib/hunts/output_plugins.py | 3 | 10200 | #!/usr/bin/env python
"""The various output plugins for GenericHunts."""
import csv
import threading
import urllib
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import export
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import renderi... | apache-2.0 |
dimagol/trex-core | scripts/external_libs/pyzmq-14.5.0/python2/intel/ucs4/64bit/zmq/__init__.py | 19 | 1802 | """Python bindings for 0MQ."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import sys
import glob
# load bundled libzmq, if there is one:
here = os.path.dirname(__file__)
bundled = []
bundled_sodium = []
for ext in ('pyd', 'so', 'dll', 'dylib'):
bundled... | apache-2.0 |
altairpearl/scikit-learn | sklearn/gaussian_process/correlation_models.py | 72 | 7654 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# License: BSD 3 clause
"""
The built-in correlation models submodule for the gaussian_process module.
"""
import numpy as np
def absolute_exponential(theta, d):
"""
Abs... | bsd-3-clause |
TylerMoeller/fail2ban | fail2ban/tests/utils.py | 6 | 8741 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | gpl-2.0 |
czhengsci/pymatgen | pymatgen/util/tests/test_coord.py | 7 | 14182 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Created on Apr 25, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "S... | mit |
mardiros/apium | apium/task/__init__.py | 1 | 8390 | import sys
import types
import logging
import asyncio
import inspect
import traceback
import importlib
from collections import defaultdict
from uuid import uuid4
import venusian
from .. import registry
log = logging.getLogger(__name__)
class TaskRegistry(object):
""" Default implementation of the task registry... | bsd-3-clause |
ampax/edx-platform | common/djangoapps/util/tests/test_memcache.py | 62 | 3675 | """
Tests for memcache in util app
"""
from django.test import TestCase
from django.core.cache import caches
from util.memcache import safe_key
class MemcacheTest(TestCase):
"""
Test memcache key cleanup
"""
# Test whitespace, control characters, and some non-ASCII UTF-16
UNICODE_CHAR_CODES = (r... | agpl-3.0 |
paolodedios/tensorflow | tensorflow/compiler/tests/matrix_inverse_op_test.py | 23 | 3160 | # 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 |
spacehitchhiker/test-task | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
aaron-fz/neutron_full_sync | neutron/tests/unit/ml2/test_type_vxlan.py | 3 | 11701 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
julie-sullivan/phytomine | bio/scripts/get_refseq_summaries.py | 11 | 2284 | #!/usr/bin/python
import sys
import urllib2
from xml.sax import make_parser, handler
import time
class SummaryHandler(handler.ContentHandler):
def __init__(self, output):
self.counter = 0
self.content = ''
self.in_summary = False
self.gene_id = None
def startElement(self, name, attrs):
self.content = ''... | lgpl-2.1 |
tuzhaopeng/NMT-Coverage | build/lib/groundhog/trainer/SGD_adadelta.py | 1 | 8042 | """
Stochastic Gradient Descent.
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import time
import logging
import theano
import th... | bsd-3-clause |
jimblasko/xcoin | 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 |
yoer/hue | desktop/core/ext-py/urllib2_kerberos-0.1.6/setup.py | 41 | 1651 | # Copyright 2008 Lime Nest LLC
# Copyright 2008 Lime Spot LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable... | apache-2.0 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_sysconfig.py | 83 | 8393 | """Tests for distutils.sysconfig."""
import os
import shutil
import subprocess
import sys
import textwrap
import unittest
from distutils import sysconfig
from distutils.ccompiler import get_default_compiler
from distutils.tests import support
from test.support import TESTFN, run_unittest, check_warnings
class Sysconf... | lgpl-3.0 |
edulramirez/nova | nova/network/floating_ips.py | 51 | 31780 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | apache-2.0 |
mrquim/mrquimrepo | script.module.covenant/lib/resources/lib/sources/gr/tainiomania.py | 6 | 3366 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
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.
This prog... | gpl-2.0 |
tcheehow/MissionPlanner | Lib/distutils/core.py | 54 | 9335 | """distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
__revision__ ... | gpl-3.0 |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/billing_setup_service/transports/grpc.py | 1 | 11783 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
daineseh/kodi-plugin.video.ted-talks-chinese | youtube_dl/extractor/yahoo.py | 3 | 16681 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import re
from .common import InfoExtractor, SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
clean_html,
unescapeHTML,
Ex... | gpl-2.0 |
paran0ids0ul/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/utils/appdirs.py | 311 | 9173 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suite our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this application.
... | gpl-3.0 |
mcdeoliveira/pyctrl | pyctrl/rc/__init__.py | 3 | 1484 | import time
import rcpy
import pyctrl
class Controller(pyctrl.Controller):
"""
:bases: :py:class:`pyctrl.Controller`
:py:class:`pyctrl.rc.Controller` initializes a controller for the Robotics Cape equiped with a clock based on the MPU9250 periodic interrupts.
:param float period: period in seconds (... | apache-2.0 |
evnpr/herokupython | vendor/distribute-0.6.34/_markerlib/markers.py | 71 | 3878 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | mit |
neoscoin/neos-core | src/ledger/lib/python2.7/site-packages/pip/_internal/utils/misc.py | 5 | 28053 | from __future__ import absolute_import
import contextlib
import errno
import io
import locale
# we have a submodule named 'logging' which would shadow this if we used the
# regular name:
import logging as std_logging
import os
import posixpath
import re
import shutil
import stat
import subprocess
import... | mit |
pombreda/pysal | pysal/core/IOHandlers/tests/test_wk1.py | 20 | 1215 | import unittest
import pysal
from pysal.core.IOHandlers.wk1 import Wk1IO
import tempfile
import os
class test_Wk1IO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal.examples.get_path('spat-sym-us.wk1')
self.obj = Wk1IO(test_file, 'r')
def test_close(self):
f = s... | bsd-3-clause |
joernhees/scikit-learn | sklearn/feature_selection/base.py | 119 | 4187 | # -*- coding: utf-8 -*-
"""Generic feature selection mixin"""
# Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
from warnings import warn
import numpy as np
from scipy.sparse import issparse, csc_matrix
from ..base import TransformerMixin
f... | bsd-3-clause |
wuxianghou/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py | 121 | 2831 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
jsubpy/jsub | jsub/loader.py | 1 | 1148 | import os
import sys
import inspect
from jsub.error import JsubError
class LoadError(JsubError):
pass
class ModuleNotFoundError(LoadError):
pass
class ClassNotFoundError(LoadError):
pass
class NotAClassError(LoadError):
pass
class PackageDirectoryNotFoundError(LoadError):
pass
def load_module(module_name)... | mit |
raymondxyang/tensorflow | tensorflow/contrib/linalg/python/ops/linear_operator_composition.py | 31 | 10320 | # 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 |
googleads/googleads-dfa-reporting-samples | python/v3_3/get_dimension_values.py | 3 | 2139 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
Accelerite/cinder | cinder/zonemanager/fc_san_lookup_service.py | 2 | 3567 | # (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# 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
#
# ... | apache-2.0 |
okfse/froide | froide/foirequest/tasks.py | 1 | 3122 | import os
from django.conf import settings
from django.utils import translation
from django.db import transaction
from django.core.files import File
from froide.celery import app as celery_app
from .models import FoiRequest, FoiAttachment
from .foi_mail import _process_mail, _fetch_mail
from .file_utils import conve... | mit |
noirbizarre/mongoengine | mongoengine/errors.py | 2 | 3562 | from collections import defaultdict
from mongoengine.python_support import txt_type
__all__ = ('NotRegistered', 'InvalidDocumentError', 'LookUpError',
'DoesNotExist', 'MultipleObjectsReturned', 'InvalidQueryError',
'OperationError', 'NotUniqueError', 'FieldDoesNotExist',
'ValidationE... | mit |
jimberlage/servo | tests/wpt/web-platform-tests/xhr/resources/corsenabled.py | 71 | 1099 | import time
def main(request, response):
headers = [("Access-Control-Allow-Origin", "*"),
("Access-Control-Allow-Credentials", "true"),
("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"),
("Access-Control-Allow-Headers", "x-test, x-foo"),
("Access-Co... | mpl-2.0 |
zhoulingjun/django | tests/template_tests/test_smartif.py | 580 | 2178 | import unittest
from django.template.smartif import IfParser
class SmartIfTests(unittest.TestCase):
def assertCalcEqual(self, expected, tokens):
self.assertEqual(expected, IfParser(tokens).parse().eval({}))
# We only test things here that are difficult to test elsewhere
# Many other tests are f... | bsd-3-clause |
birsoyo/conan | conans/client/generators/qmake.py | 2 | 4713 | from conans.model import Generator
from conans.paths import BUILD_INFO_QMAKE
class DepsCppQmake(object):
def __init__(self, cpp_info):
def multiline(field):
return " \\\n ".join('"%s"' % p.replace("\\", "/") for p in field)
self.include_paths = multiline(cpp_info.include_paths)
... | mit |
CaioIcy/CPP_Project_Template | externals/gtest-1.7.0/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
charlesccychen/incubator-beam | sdks/python/apache_beam/runners/direct/direct_runner.py | 4 | 18219 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
rtbortolin/QandA | QandA/QandA/urls.py | 1 | 1936 | """
Definition of urls for QandA.
"""
from datetime import datetime
from django.conf.urls import patterns, url
from app.forms import BootstrapAuthenticationForm
import app
import app.views
import django.contrib.auth.views
# Uncomment the next lines to enable the admin:
# from django.conf.urls import include
# from dj... | mit |
adedayo/intellij-community | python/lib/Lib/email/quopriMIME.py | 93 | 10839 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... | apache-2.0 |
Toreny/UAV | Tools/scripts/add_git_hashes.py | 216 | 1614 | #!/usr/bin/env python
'''
Add git hashes to .px4 file for PX4/Pixhawk build
Written by Jon Challinger January 2015
'''
import json
import sys
import os
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_file')
parser.add_argument('output_file')
parser.add_argument('--ard... | gpl-3.0 |
okeefem2/rhodesiderelics | frontend/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
AstroTech/workshop-devops | devops/setup.py | 24 | 1134 | #!/usr/bin/env python3
from datetime import datetime, timezone
from os import makedirs
from os.path import dirname, abspath, join, basename
from shlex import split
from shutil import rmtree
from subprocess import run
FORMAT = 'html'
SECOND = 1
MINUTE = 60 * SECOND
START_TIME = datetime.now()
sourcedir = dirname(a... | mit |
jumpstarter-io/nova | nova/tests/cmd/test_idmapshift.py | 3 | 25567 | # Copyright 2014 Rackspace, Andrew Melton
#
# 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... | apache-2.0 |
bSr43/udis86 | scripts/ud_opcode.py | 1 | 26794 | # udis86 - scripts/ud_opcode.py
#
# Copyright (c) 2009, 2013 Vivek Thampi
# 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 copyrig... | bsd-2-clause |
rodrigoasmacedo/l10n-brazil | __unported__/l10n_br_account_product/sped/__init__.py | 2 | 1399 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2013 Renato Lima - Akretion #
# ... | agpl-3.0 |
Belxjander/Kirito | Python-3.5.0-Amiga/Tools/pybench/Constructs.py | 92 | 13207 | from pybench import Test
class IfThenElse(Test):
version = 2.0
operations = 30*3 # hard to say...
rounds = 150000
def test(self):
a,b,c = 1,2,3
for i in range(self.rounds):
if a == 1:
if b == 2:
if c != 3:
c = 3... | gpl-3.0 |
onealtom/MYD-C335X-Linux-Kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
baconz/shaka-player | third_party/gjslint/python-gflags-2.0/gflags_validators.py | 488 | 6977 | #!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | apache-2.0 |
cetic/ansible | lib/ansible/modules/network/panos/panos_loadcfg.py | 78 | 3560 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
JioCloud/oslo-incubator | tests/unit/test_authutils.py | 1 | 1104 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apac... | apache-2.0 |
levythu/ThuCloudDisk | ThuCloudDisk/ThuCloudDisk/settings.py | 1 | 6136 | # Django settings for ThuCloudDisk project.
import os.path
dirname = os.path.dirname(__file__).replace("\\", "/")
ROOT_PATH = os.path.dirname(dirname)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('thuclouddisk', 'thuclouddisk@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': ... | apache-2.0 |
eastlhu/zulip | zerver/lib/validator.py | 115 | 3643 | '''
This module sets up a scheme for validating that arbitrary Python
objects are correctly typed. It is totally decoupled from Django,
composable, easily wrapped, and easily extended.
A validator takes two parameters--var_name and val--and returns an
error if val is not the correct type. The var_name parameter is u... | apache-2.0 |
jmetzen/scikit-learn | examples/ensemble/plot_partial_dependence.py | 3 | 4833 | """
========================
Partial Dependence Plots
========================
Partial dependence plots show the dependence between the target function [2]_
and a set of 'target' features, marginalizing over the
values of all other features (the complement features). Due to the limits
of human perception the size of t... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.