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 |
|---|---|---|---|---|---|
dinghino/ecommerce_api | tests/test_pictures.py | 2 | 7336 | """
Test suite for PictureHandler and ItemPictureHandler
"""
from tests.test_case import TestCase
import json
from io import BytesIO
import os
import uuid
import http.client as client
from models import Item, Picture
from tests import test_utils
import utils
EXPECTED_RESULTS = test_utils.RESULTS['pictures']
TEST_... | gpl-3.0 |
amagdas/eve | eve/tests/methods/delete.py | 10 | 29272 | from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve.tests.test_settings import MONGO_DBNAME
from eve import ETAG
from bson import ObjectId
from eve.utils import ParsedRequest
import simplejson as json
import copy
from eve.methods.delete import deleteitem_internal
class TestDelete(TestBase)... | bsd-3-clause |
mrucci/moto | moto/cloudwatch/models.py | 3 | 3720 | from moto.core import BaseBackend
import boto.ec2.cloudwatch
import datetime
class Dimension(object):
def __init__(self, name, value):
self.name = name
self.value = value
class FakeAlarm(object):
def __init__(self, name, comparison_operator, evaluation_periods, period,
thres... | apache-2.0 |
robk5uj/invenio | modules/websubmit/lib/functions/Ask_For_Record_Details_Confirmation.py | 35 | 5952 | ## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later versio... | gpl-2.0 |
olhoneles/politicos | settings.py | 1 | 1327 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Marcelo Jorge Vieira <metal@alucinados.com>
#
# 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 License, or (at yo... | agpl-3.0 |
GheRivero/ansible | lib/ansible/modules/cloud/azure/azure_rm_acs.py | 15 | 29357 | #!/usr/bin/python
#
# Copyright (c) 2017 Julien Stroheker, <juliens@microsoft.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 |
drmateo/ecto | test/benchmark/metrics.py | 4 | 4501 | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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
# n... | bsd-3-clause |
hpcugent/hanythingondemand | hod/subcommands/relabel.py | 2 | 2618 | #!/usr/bin/env python
# #
# Copyright 2009-2016 Ghent University
#
# This file is part of hanythingondemand
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
... | gpl-2.0 |
aferr/TemporalPartitioningMemCtl | src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py | 90 | 2440 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... | bsd-3-clause |
aaltinisik/OCBAltinkaya | addons/fetchmail/fetchmail.py | 6 | 15874 | # -*- 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 |
gnuhub/intellij-community | python/lib/Lib/site-packages/django/utils/autoreload.py | 135 | 4239 | # Autoreloading launcher.
# Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org).
# Some taken from Ian Bicking's Paste (http://pythonpaste.org/).
#
# Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with ... | apache-2.0 |
anomitra/articleScraper | PyQt-gpl-5.4.1/examples/widgets/stylesheet/stylesheeteditor.py | 3 | 4557 | #############################################################################
##
## Copyright (C) 2010 Hans-Peter Jansen <hpj@urpla.net>.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENSE:BSD$
## You may ... | gpl-2.0 |
free-z4u/android_kernel_htc_z4u | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
nebril/fuel-web | nailgun/nailgun/openstack/common/timeutils.py | 16 | 5967 | # 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 |
molobrakos/home-assistant | homeassistant/components/fints/sensor.py | 7 | 9289 | """Read the balance of your bank accounts via FinTS."""
from collections import namedtuple
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_USERNAME, CONF_PIN, CONF_URL, CONF_NAME
import homeassistan... | apache-2.0 |
irwinlove/django | django/template/__init__.py | 198 | 2022 | """
Django's support for templates.
The django.template namespace contains two independent subsystems:
1. Multiple Template Engines: support for pluggable template backends,
built-in backends and backend-independent APIs
2. Django Template Language: Django's own template engine, including its
built-in loaders, ... | bsd-3-clause |
lawl/pmbootstrap | pmb/aportgen/linux.py | 2 | 4781 | """
Copyright 2017 Oliver Smith
This file is part of pmbootstrap.
pmbootstrap 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.
pmbootstrap ... | gpl-3.0 |
a-b/PopClip-Extensions | source/InstantTranslate/requests/packages/chardet/gb2312prober.py | 2994 | 1681 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
stevenmizuno/QGIS | python/user.py | 7 | 4676 | # -*- coding: utf-8 -*-
"""
***************************************************************************
user.py
---------------------
Date : January 2015
Copyright : (C) 2015 by Nathan Woodrow
Email : woodrow dot nathan at gmail dot com
********************... | gpl-2.0 |
heidtn/PyDataLearn | PyDataLearn/NeuralNet.py | 1 | 6181 | from math import tanh
from pysqlite2 import dbapi2 as sqlite
def dtanh(y):
#this effectively creates a smaller change multiplier when the value is closest to 0 (when the slope is steepest) P_D controller?
return 1.0-y*y
class SearchNet:
def __init__(self, dbname):
self.con = sqlite.connect(dbname)
def __del__(... | mit |
dfdx2/ancfinder | scripts/update_311.py | 1 | 2533 | import datetime, json, urllib2, os, errno, requests
# Open/create file, deleting info already in it so that we can make fresh info
file_name = open('data/311.json', 'w')
issues = []
working = {'issues':issues}
data = {}
# Get date in the past to start
start_date = (datetime.datetime.today() + datetime.timedelta(-180... | cc0-1.0 |
aveshagarwal/openshift-ansible | roles/lib_openshift/src/lib/storageclass.py | 18 | 3122 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class StorageClassConfig(object):
''' Handle service options '''
# pylint: disable=too-many-arguments
def __init__(self,
name,
provisioner,
parameters=None,
... | apache-2.0 |
izpack/izpack | izpack-wrapper/src/main/resources/utils/wrappers/izpack2jnlp/setup.py | 26 | 1070 | #!/usr/bin/env python
# ........................................................................... #
#
# IzPack - Copyright 2008 Julien Ponge, All Rights Reserved.
#
# http://izpack.org/
# http://izpack.codehaus.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | apache-2.0 |
jejimenez/django | tests/m2m_through_regress/tests.py | 182 | 9847 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core import management
from django.test import TestCase
from django.utils.six import StringIO
from .models import (
Car, CarDriver, Driver, Group, Membership, Person, UserMembership,
)
class M2MThroughTestCase(TestCa... | bsd-3-clause |
bbc/kamaelia | Code/Python/Kamaelia/Kamaelia/Apps/Compose/GUI/ArgumentsPanel.py | 6 | 6027 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | apache-2.0 |
NoahFlowa/glowing-spoon | forms.py | 2 | 1139 | from flask_wtf import Form
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Email, Length
class SignupForm(Form):
first_name = StringField('First name', validators=[DataRequired("Please enter your first name.")])
last_name = StringField('Last name', validato... | apache-2.0 |
tangfeng1/flask | flask/helpers.py | 133 | 36499 | # -*- coding: utf-8 -*-
"""
flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from th... | bsd-3-clause |
AlphaX2/FotoShareN9 | 1.6.1/fotoshare/opt/FotoShareN9/plugins/flickr/libs/flickrapi/reportinghttp.py | 10 | 2712 | # -*- encoding: utf-8 -*-
'''HTTPHandler that supports a callback method for progress reports.
'''
import urllib2
import httplib
import logging
__all__ = ['urlopen']
logging.basicConfig()
LOG = logging.getLogger(__name__)
progress_callback = None
class ReportingSocket(object):
'''Wrapper around a socket. Give... | gpl-3.0 |
CyrilPeponnet/Archipel | ArchipelAgent/archipel-agent-vmparking/setup.py | 4 | 3362 | #
# setup.py
#
# Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
# 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
# License, or (at your option... | agpl-3.0 |
pantaloons/4charm | libvpx/tools/intersect-diffs.py | 98 | 2364 | #!/usr/bin/env python
## Copyright (c) 2012 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENT... | mit |
SatelliteQE/robottelo | tests/foreman/api/test_hostcollection.py | 1 | 14844 | """Unit tests for host collections.
:Requirement: Hostcollection
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: HostCollections
:Assignee: swadeley
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import choice
from random import randint
import pytest
from broker imp... | gpl-3.0 |
druids/django-chamber | setup.py | 1 | 1138 | from setuptools import setup, find_packages
from chamber.version import get_version
setup(
name='django-chamber',
version=get_version(),
description='Utilities library meant as a complement to django-is-core.',
author='Lubos Matl, Oskar Hollmann',
author_email='matllubos@gmail.com, oskar@hollmann... | bsd-3-clause |
rgom/Pydev | plugins/org.python.pydev.jython/Lib/cmd.py | 145 | 15026 | """A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A ... | epl-1.0 |
Jhaefner/PressureDrop | master_example.py | 1 | 2607 | """
@author: Jonah Haefner and Lane Carasik
Title: master_example.py
The purpose of this script is to ensure the four functions included in this package are functioning properly and as an example of use for the user.
It currently only provides checks for the inline geometry with the fluid at a Reynolds number ... | mit |
krkhan/azure-linux-extensions | OSPatching/test/FakePatching3.py | 8 | 1623 | #!/usr/bin/python
#
# Copyright 2014 Microsoft 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... | apache-2.0 |
hehongliang/tensorflow | tensorflow/contrib/specs/python/summaries_test.py | 25 | 3070 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
markYoungH/chromium.src | third_party/closure_linter/closure_linter/not_strict_test.py | 129 | 2318 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | bsd-3-clause |
gertingold/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_Y.py | 47 | 2514 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import abs, sum, cos, pi
from .go_benchmark import Benchmark
class YaoLiu04(Benchmark):
r"""
Yao-Liu 4 objective function.
This class defines the Yao-Liu function 4 [1]_ global optimization problem. This... | bsd-3-clause |
achals/servo | tests/wpt/web-platform-tests/tools/py/py/_path/local.py | 171 | 32118 | """
local path implementation.
"""
from __future__ import with_statement
from contextlib import contextmanager
import sys, os, re, atexit, io
import py
from py._path import common
from py._path.common import iswin32
from stat import S_ISLNK, S_ISDIR, S_ISREG
from os.path import abspath, normpath, isabs, exists, isdir... | mpl-2.0 |
carolinux/QGIS | scripts/mkuidefaults.py | 23 | 1400 | from PyQt4.QtCore import QCoreApplication, QSettings
def chunks(l, n):
for i in xrange(0, len(l), n):
yield l[i:i+n]
QCoreApplication.setOrganizationName( "QGIS" )
QCoreApplication.setOrganizationDomain( "qgis.org" )
QCoreApplication.setApplicationName( "QGIS2" )
s = QSettings()
ba = s.value... | gpl-2.0 |
pinterest/pinball | tests/pinball/master/master_handler_test.py | 6 | 3216 | # Copyright 2015, Pinterest, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
isandlaTech/cohorte-runtime | python/src/lib/python/unidecode/x057.py | 252 | 4631 | data = (
'Guo ', # 0x00
'Yin ', # 0x01
'Hun ', # 0x02
'Pu ', # 0x03
'Yu ', # 0x04
'Han ', # 0x05
'Yuan ', # 0x06
'Lun ', # 0x07
'Quan ', # 0x08
'Yu ', # 0x09
'Qing ', # 0x0a
'Guo ', # 0x0b
'Chuan ', # 0x0c
'Wei ', # 0x0d
'Yuan ', # 0x0e
'Quan ', # 0x0f
'Ku ', # 0x10
'F... | apache-2.0 |
akashsinghal/Speech-Memorization-App | Python_Backend/env/lib/python3.6/site-packages/pip/utils/packaging.py | 343 | 2080 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import sys
from pip._vendor.packaging import specifiers
from pip._vendor.packaging import version
from pip._vendor import pkg_resources
from pip import exceptions
logger = logging.getLogger(__name__)
def check_requires_pyth... | apache-2.0 |
nickanderson/ansible | lib/ansible/inventory/ini.py | 25 | 7628 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
matteoalessiocarrara/HTML-Facebook-API | src/lib/fbwrapper/src/lib/bot_virtualbrowser/src/lib/human/src/requests2.py | 6 | 2370 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# Copyright 2015 - 2016 Matteo Alessio Carrara <sw.matteoac@gmail.com>
#
# 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 ... | gpl-2.0 |
UTSA-ICS/keystone-kerberos | keystone/credential/backends/sql.py | 15 | 3846 | # Copyright 2013 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 or agreed to in... | apache-2.0 |
topic2k/EventGhost | _build/builder/__init__.py | 1 | 7152 | # -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/>
#
# EventGhost 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-2.0 |
wolverineav/neutron | neutron/tests/unit/agent/common/test_ovs_lib.py | 3 | 39120 | # Copyright 2012, VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
Ken69267/config-stuff | .vim/eclim/autoload/eclim/python/rope/base/oi/objectinfo.py | 115 | 8767 | import warnings
from rope.base import exceptions, resourceobserver
from rope.base.oi import objectdb, memorydb, transform
class ObjectInfoManager(object):
"""Stores object information
It uses an instance of `objectdb.ObjectDB` for storing
information.
"""
def __init__(self, project):
s... | mit |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/euc_kr.py | 816 | 1027 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | gpl-2.0 |
AntidoteLabs/Antidote-DM | Antidotes DM/youtube_dl/extractor/footyroom.py | 13 | 1647 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class FootyRoomIE(InfoExtractor):
_VALID_URL = r'http://footyroom\.com/(?P<id>[^/]+)'
_TESTS = [{
'url': 'http://footyroom.com/schalke-04-0-2-real-madrid-2015-02/',
'info_dict': {
'id': 'scha... | gpl-2.0 |
FeMTTU/femus | external/jsoncpp/jsoncpp-src-0.5.0/test/rununittests.py | 249 | 2507 | import sys
import os
import os.path
import subprocess
from glob import glob
import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes'
class TestProxy(object):
def __init__( self, test_exe_path, use_valgrind=False ):
self.test_exe_path = os.path.normpath( os.path.a... | lgpl-2.1 |
xutian/virt-test | virttest/libvirt_xml/nwfilter_protocols/ah_ipv6.py | 26 | 5826 | """
ah-ipv6 protocl support class(es)
http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoMiscv6
"""
from virttest.libvirt_xml import accessors, xcepts
from virttest.libvirt_xml.nwfilter_protocols import base
class Ah_ipv6(base.TypedDeviceBase):
"""
Create new Ah_ipv6 xml instances
Properties:
... | gpl-2.0 |
olafhauk/mne-python | mne/datasets/__init__.py | 6 | 1103 | """Functions for fetching remote datasets.
See :ref:`datasets` for more information.
"""
from . import fieldtrip_cmc
from . import brainstorm
from . import visual_92_categories
from . import kiloword
from . import eegbci
from . import hf_sef
from . import misc
from . import mtrf
from . import sample
from . import som... | bsd-3-clause |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KButtonGroup.py | 1 | 1093 | # encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
cl... | gpl-2.0 |
Intel-tensorflow/tensorflow | tensorflow/python/ops/ctc_ops.py | 6 | 57164 | # 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 |
schmidtc/pysal | pysal/spreg/diagnostics.py | 6 | 35451 | """
Diagnostics for regression estimations.
"""
__author__ = "Luc Anselin luc.anselin@asu.edu, Nicholas Malizia nicholas.malizia@asu.edu "
import pysal
from pysal.common import *
import scipy.sparse as SP
from math import sqrt
from utils import spmultiply, sphstack, spmin, spmax
__all__ = [
"f_stat", "... | bsd-3-clause |
olologin/scikit-learn | examples/linear_model/plot_sgd_iris.py | 286 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
qvit/django-color-captcha | color_captcha/utils.py | 1 | 1095 | # -*- coding: utf-8 -*-
class IncorrectCaptchaColorsFormatError(Exception):
message = "Incorrect 'CAPTCHA_COLORS' setting format (must be iterable of two-string-value tuples)"
def __str__(self):
return self.message
class TooFewCaptchaColorsError(Exception):
message = "Please specify al least tw... | mit |
salabim/salabim | test/test_componentgenerator.py | 1 | 4345 | import salabim as sim
import pytest
class X(sim.Component):
def setup(self, color='red'):
self.color = color
self.enter(components)
class Vehicle(sim.Component):
def setup(self):
self.enter(components)
class Car(Vehicle):
pass
class Bus(Vehicle):
pass
cla... | mit |
imatge-upc/unsupervised-2017-cvprw | autoencoder_train.py | 1 | 7127 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='1'
from os import listdir
import sys
import time
import tools.ops
import subprocess
import numpy as np
import tensorflow as tf
import scipy.misc as sm
from models.autoencoder_net import *
from tools.utilities import *
from tools.ops import *
from random import randint
... | mit |
pichillilorenzo/JavaScriptEnhancements | src/libs/__init__.py | 1 | 1423 | from . import global_vars
from .javascript_enhancements_settings import javaScriptEnhancements
from . import util
from .node import NodeJS
from .npm import NPM
from .flow import main as flow
from .flow.flow_cli import FlowCLI
from .flow.flow_ide_server import FlowIDEServer, flow_ide_clients, JavascriptEnhancementsStart... | mit |
ESOedX/edx-platform | lms/djangoapps/commerce/tests/test_signals.py | 1 | 13844 | # coding=UTF-8
"""
Tests for signal handling in commerce djangoapp.
"""
from __future__ import absolute_import, unicode_literals
import base64
import json
import ddt
import httpretty
import mock
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.test import TestCase
from... | agpl-3.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/encodings/punycode.py | 586 | 6813 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... | gpl-2.0 |
groschovskiy/keyczar | cpp/src/tools/swtoolkit/test/help_test.py | 18 | 2153 | #!/usr/bin/python2.4
# Copyright 2009, 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... | apache-2.0 |
erdc-cm/air-water-vv | 2d/floatingStructures/floating_caisson_chrono/redist_n.py | 12 | 3054 | from proteus.default_n import *
from proteus import (StepControl,
TimeIntegration,
NonlinearSolvers,
LinearSolvers,
LinearAlgebraTools,
NumericalFlux)
from proteus.mprans import RDLS
import redist_p as physics
from ... | mit |
ishanic/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 162 | 9771 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises_regexp
... | bsd-3-clause |
adamreis/nyc-jazz | src/lib/werkzeug/testsuite/multipart/collect.py | 78 | 1584 | #!/usr/bin/env python
"""
Hacky helper application to collect form data.
"""
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
def copy_stream(request):
from os import mkdir
from time import time
folder = 'request-%d' % time()
mkdir(folder)
environ = request.e... | mit |
mikhail-gorobets/chipsec | chipsec/modules/tools/smm/smm_ptr.py | 8 | 24962 | #CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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; Version 2.
#
#This program is distributed in the hope... | gpl-2.0 |
afaheem88/rally | tests/unit/plugins/openstack/scenarios/sahara/test_node_group_templates.py | 12 | 3700 | # Copyright 2014: Mirantis 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 |
flingone/frameworks_base_cmds_remoted | libs/boost/libs/python/pyste/src/Pyste/infos.py | 13 | 9212 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os.path
import copy
import exporters
from ClassExporter import ClassExpo... | apache-2.0 |
aerickson/ansible | lib/ansible/modules/network/nxos/_nxos_mtu.py | 59 | 11681 | #!/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 distribut... | gpl-3.0 |
grpc/grpc | src/python/grpcio/support.py | 10 | 4388 | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
loco-odoo/localizacion_co | openerp/addons-extra/print_receipt/reports/account_cheque_bancolombia.py | 3 | 1068 | # -*- coding: utf-8 -*-
import time
from openerp.report import report_sxw
from openerp import pooler
class account_voucher(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_voucher, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
... | agpl-3.0 |
gxx/lettuce | tests/integration/lib/Django-1.3/django/core/management/sql.py | 229 | 8259 | import os
import re
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models
from django.db.models import get_models
def sql_create(app, style, connection):
"Returns a list of the CREATE TABLE SQL statements for the given app."
if connection.settings_... | gpl-3.0 |
dbarbier/privot-doc | src/UseCasesGuide/script_WhiteNoise.py | 1 | 1386 | from openturns import *
# Time grid over which all the processes will be defined
nt = 100
timeGrid = RegularGrid(0.0, 1.0, nt)
# Definition of the distribution
sigma = 1.0
myDistribution = Normal(0., sigma)
# Definition of the process
myProcess = WhiteNoise(myDistribution, timeGrid)
# We get a realization of the w... | lgpl-2.1 |
AdrianGaudebert/elmo | vendor-local/lib/python/south/management/commands/datamigration.py | 10 | 4665 | """
Data migration creation command
"""
from __future__ import print_function
import sys
import os
import re
from optparse import make_option
try:
set
except NameError:
from sets import Set as set
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from djan... | mpl-2.0 |
ehashman/oh-mainline | vendor/packages/sqlparse/tests/test_parse.py | 16 | 6668 | # -*- coding: utf-8 -*-
"""Tests sqlparse function."""
import pytest
from tests.utils import TestCaseBase
import sqlparse
import sqlparse.sql
from sqlparse import tokens as T
class SQLParseTest(TestCaseBase):
"""Tests sqlparse.parse()."""
def test_tokenize(self):
sql = 'select * from foo;'
... | agpl-3.0 |
sagiss/sardana | src/sardana/spock/magic.py | 1 | 9633 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it... | lgpl-3.0 |
wjo1212/aliyun-log-python-sdk | aliyun/log/es_migration/migration_manager.py | 1 | 8762 | #!/usr/bin/env python
# encoding: utf-8
# Copyright (C) Alibaba Cloud Computing
# All rights reserved.
import logging
import time
from multiprocessing import Pool
from aliyun.log import LogClient
from aliyun.log.es_migration.collection_task import (CollectionTaskStatus,
... | mit |
luoyetx/mxnet | tools/ipynb2md.py | 41 | 2272 | #!/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
# "L... | apache-2.0 |
atpy/atpy | atpy/registry.py | 1 | 6496 | _readers = {}
_writers = {}
_set_readers = {}
_set_writers = {}
_extensions = {}
def register_reader(ttype, function, override=False):
'''
Register a table reader function.
Required Arguments:
*ttype*: [ string ]
The table type identifier. This is the string that will be used to
... | mit |
thomas-sterrenburg/fingerprinting-python | src/static/constants.py | 1 | 1239 | # Copyright 2017 Thomas Sterrenburg
#
# Licensed under the MIT License (the License); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at https://opensource.org/licenses/MIT#
import datetime
# file and directory names
CACHE = 'data/cache'
KNOWN = 'data/known'
R... | mit |
jagguli/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geos/mutable_list.py | 405 | 10386 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://www.aryehleib.com/MutableLists.html
Author: Aryeh Leib Taurog.
"""
class ListMixin(obj... | apache-2.0 |
kochbeck/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/parse/__init__.py | 9 | 4491 | # Natural Language Toolkit: Parsers
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
"""
Classes and interfaces for producing tree struct... | gpl-3.0 |
pbougue/navitia | source/jormungandr/jormungandr/interfaces/v1/Places.py | 2 | 13833 | # coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility an... | agpl-3.0 |
achabotl/pambox | setup.py | 1 | 3387 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import codecs
import os
import re
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding ... | bsd-3-clause |
tseaver/gcloud-python | container/google/cloud/container_v1/proto/cluster_service_pb2.py | 1 | 251488 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/container_v1/proto/cluster_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import mess... | apache-2.0 |
vipulroxx/kivy | examples/demo/multistroke/historymanager.py | 38 | 9447 | __all__ = ('GestureHistoryManager', 'GestureVisualizer')
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.graphics import ... | mit |
aviciimaxwell/odoo | addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py | 337 | 3000 | # -*- 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 |
hmendozap/auto-sklearn | autosklearn/metalearning/metafeatures/plot_metafeatures.py | 1 | 20297 | from __future__ import print_function
import argparse
import cPickle
import itertools
import os
import StringIO
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
try:
from sklearn.manifold import TSNE
from sklearn.metrics.pairwise import P... | bsd-3-clause |
rahlk/Experimental-Algorithms | multiProc/src/parGALE.py | 1 | 4233 | """
"""
from __future__ import print_function, division
import os
from demo import *
import subprocess
import sys
sys.path.append(os.path.abspath('../problems/'))
# Get the git root directory
root=repo_dir = subprocess.Popen(['git'
,'rev-parse'
... | mit |
campbe13/openhatch | vendor/packages/gdata/src/gdata/youtube/client.py | 96 | 9463 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | agpl-3.0 |
wangjun/odoo | addons/sales_team/sales_team.py | 180 | 6131 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
StackPointCloud/libcloud | contrib/generate_provider_feature_matrix_table.py | 6 | 18754 | #!/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 "Licen... | apache-2.0 |
odoo-brazil/l10n-brazil-wip | l10n_br_account_product/__manifest__.py | 3 | 2375 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Account Product',
'summary': "Brazilian Localization Account Product",
'category': 'Localisation',
'license': 'AGPL-3',
'author': '... | agpl-3.0 |
msingh172/youtube-dl | youtube_dl/extractor/screencastomatic.py | 149 | 1713 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
js_to_json,
)
class ScreencastOMaticIE(InfoExtractor):
_VALID_URL = r'https?://screencast-o-matic\.com/watch/(?P<id>[0-9a-zA-Z]+)'
_TEST... | unlicense |
domeger/SplunkTAforPuppetEnterprise | bin/splunktaforpuppetenterprise/solnlib/packages/splunklib/searchcommands/validators.py | 16 | 11478 | # coding=utf-8
#
# Copyright 2011-2015 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
wsmith323/django | django/contrib/sites/management.py | 467 | 1564 | """
Creates the default Site object.
"""
from django.apps import apps
from django.conf import settings
from django.core.management.color import no_style
from django.db import DEFAULT_DB_ALIAS, connections, router
def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs):
... | bsd-3-clause |
linktlh/Toontown-journey | toontown/shtiker/ShtikerBook.py | 1 | 19967 | from direct.directnotify import DirectNotifyGlobal
from direct.fsm import StateData
from direct.gui.DirectGui import *
from direct.showbase import DirectObject
from pandac.PandaModules import *
from toontown.effects import DistributedFireworkShow
from toontown.nametag import NametagGlobals
from toontown.parties import... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.