repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
salamer/django | django/contrib/redirects/migrations/0001_initial.py | 108 | 1417 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
... | bsd-3-clause |
herow/planning_qgis | python/plugins/processing/gui/GeometryPredicateSelectionPanel.py | 5 | 4339 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PredicatePanel.py
---------------------
Date : January 2015
Copyright : (C) 2015 by Arnaud Morvan
Email : arnaud dot morvan at camptocamp dot com
Con... | gpl-2.0 |
pipermerriam/django-rest-framework | tests/test_description.py | 79 | 3688 | # -- coding: utf-8 --
from __future__ import unicode_literals
from django.test import TestCase
from django.utils.encoding import python_2_unicode_compatible, smart_text
from rest_framework.compat import apply_markdown
from rest_framework.views import APIView
from .description import (
UTF8_TEST_DOCSTRING, ViewW... | bsd-2-clause |
Observer-Wu/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/applywatchlistlocal.py | 132 | 2288 | # 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 |
currychou/1 | static/Brython3.1.0-20150301-090019/Lib/gc.py | 743 | 3548 | """This module provides access to the garbage collector for reference cycles.
enable() -- Enable automatic garbage collection.
disable() -- Disable automatic garbage collection.
isenabled() -- Returns true if automatic collection is enabled.
collect() -- Do a full collection right now.
get_count() -- Return the curren... | gpl-3.0 |
sebadiaz/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# 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... | agpl-3.0 |
chrrrles/ansible-modules-extras | database/postgresql/postgresql_lang.py | 116 | 9789 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2014, Jens Depuydt <http://www.jensd.be>
#
# 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 L... | gpl-3.0 |
dieface/erpnext | erpnext/hr/doctype/leave_application/test_leave_application.py | 28 | 8447 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError
from frappe.permiss... | agpl-3.0 |
jotes/boto | tests/integration/elastictranscoder/test_layer1.py | 114 | 4984 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
jgcaaprom/android_external_chromium_org | tools/metrics/histograms/print_style.py | 47 | 1866 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Holds the constants for pretty printing histograms.xml."""
import os
import sys
# Import the metrics/common module for pretty print xml.
sys.path.append... | bsd-3-clause |
florianholzapfel/home-assistant | homeassistant/components/wemo.py | 13 | 3047 | """
Support for WeMo device discovery.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wemo/
"""
import logging
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_WEMO
from homeassistant.helpers import discovery
from homeas... | mit |
r9y9/librosa | docs/examples/plot_presets.py | 3 | 3179 | # coding: utf-8
"""
=======
Presets
=======
This notebook demonstrates how to use the `presets` package to change the
default parameters for librosa.
"""
# Code source: Brian McFee
# License: ISC
##################################################
# We'll need numpy and matplotlib for this example
from __future__ imp... | isc |
dannyperry571/theapprentice | script.module.youtube.dl/lib/youtube_dl/extractor/sonyliv.py | 49 | 1257 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SonyLIVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sonyliv\.com/details/[^/]+/(?P<id>\d+)'
_TESTS = [{
'url': "http://www.sonyliv.com/details/episodes/5024612095001/Ep.-1---Achaari-Cheese-Toast---... | gpl-2.0 |
emop/webrobot | src/sailing/xlwt/Bitmap.py | 16 | 10424 | # -*- coding: windows-1251 -*-
# Portions are Copyright (C) 2005 Roman V. Kiseliov
# Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
from BIFFRecords import BiffRecord
from struct import pack, unpack
... | gpl-2.0 |
kartikdhar/djangotest | virt1/lib/python2.7/site-packages/django/test/runner.py | 113 | 14812 | import logging
import os
import unittest
from importlib import import_module
from unittest import TestSuite, defaultTestLoader
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, TestCase
from django.test.utils import setup_test_environment, ... | mit |
40123148/2015cdb_40123148 | static/Brython3.1.1-20150328-091302/Lib/errno.py | 624 | 4096 | """
This module makes available standard errno system symbols.
The value of each symbol is the corresponding integer value,
e.g., on most systems, errno.ENOENT equals the integer 2.
The dictionary errno.errorcode maps numeric codes to symbol names,
e.g., errno.errorcode[2] could be the string 'ENOENT'.
Symbols that ar... | gpl-3.0 |
jonathanfisher/wl18xx | tools/perf/scripts/python/export-to-postgresql.py | 617 | 16128 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
zmlabe/IceVarFigs | Scripts/Temperature/plot_ArcticAmplification_MovingLines.py | 1 | 6837 | """
Plot change in sea ice extent (NSIDC) and temperature (BEST) for annual means
from 1979 to 2017.
Author : Zachary M. Labe
Date : 20 August 2018
"""
### Import modules
import numpy as np
import datetime
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import math
### Time
now = da... | mit |
markmuir87/node-red-template | nenv/src/node-v5.1.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # Copyright (c) 2012 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | apache-2.0 |
Arcanemagus/SickRage | lib/hachoir_parser/audio/s3m.py | 57 | 24155 | """
The ScreamTracker 3.0x module format description for .s3m files.
Documents:
- Search s3m on Wotsit
http://www.wotsit.org/
Author: Christophe GISQUET <christophe.gisquet@free.fr>
Creation: 11th February 2007
"""
from hachoir_parser import Parser
from hachoir_core.field import (StaticFieldSet, FieldSet, Field,
... | gpl-3.0 |
cactusbin/nyt | matplotlib/lib/mpl_toolkits/axisartist/angle_helper.py | 6 | 14365 | from __future__ import print_function
from math import floor
import numpy as np
import math
A = np.array
from mpl_toolkits.axisartist.grid_finder import ExtremeFinderSimple
def select_step_degree(dv):
degree_limits_ = [1.5, 3, 7, 13, 20, 40, 70, 120, 270, 520]
degree_steps_ = [ 1, 2, 5, 10, 15, 30, 45, ... | unlicense |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pip/_vendor/urllib3/util/request.py | 205 | 3705 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b, integer_types
from ..exceptions import UnrewindableBodyError
ACCEPT_ENCODING = 'gzip,deflate'
_FAILEDTELL = object()
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=... | gpl-3.0 |
mattsch/Sickbeard | cherrypy/test/test_logging.py | 1 | 5090 | """Basic tests for the CherryPy core: request handling."""
from cherrypy.test import test
test.prefer_parent_path()
import os
localDir = os.path.dirname(__file__)
import cherrypy
access_log = os.path.join(localDir, "access.log")
error_log = os.path.join(localDir, "error.log")
# Some unicode strings.
... | gpl-3.0 |
sewong/samples | GoPiGoXbox/GoPiGoXboxWebService/GoPiGoXboxWebService/StartupTask.py | 18 | 4040 | from flask import Flask
from flask.ext.restful import Api, Resource, reqparse
import gopigo
# Set some initial parameters
gopigo.enable_com_timeout(1000)
gopigo.stop()
app = Flask(__name__, static_url_path="")
api = Api(app)
class GamePadAPI(Resource):
_button_menu = 1
_button_view = 2
_button_A = 4
... | mit |
luzhijun/Optimization | cma-es/cluster/cluster1.py | 2 | 4179 | #!usr/bin/env python
#encoding: utf-8
__author__="luzhijun"
'''
cma restart test
'''
import cma
import time
import numpy as np
import matplotlib.pyplot as plt
import pickle
from multiprocessing import Pool
up=2
down=-2
def testFunc(X):
#time.sleep(0.1)
return cma.fcts.rosen(X)
rec=lambda v,p:map(lambda x:x/... | apache-2.0 |
Eforcers/inbox-cleaner | src/lib/dateutil/easter.py | 291 | 2633 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTE... | mit |
Danisan/odoo-1 | addons/report_webkit/__openerp__.py | 247 | 3928 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | agpl-3.0 |
dudonwai/dudonsblog | Lib/site-packages/django/utils/http.py | 285 | 9978 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... | mit |
jfhumann/servo | python/servo/testing_commands.py | 2 | 27605 | # 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 |
fbradyirl/home-assistant | homeassistant/components/harman_kardon_avr/media_player.py | 2 | 3406 | """Support for interface with an Harman/Kardon or JBL AVR."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
SUPPORT_TURN_OFF... | apache-2.0 |
rplevka/robottelo | tests/foreman/cli/test_computeresource_rhev.py | 2 | 11063 | """
:Requirement: Computeresource RHV
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: ComputeResources-RHEV
:Assignee: lhellebr
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from fauxfactory import gen_string
from robottelo.cli.computeresource import ComputeResourc... | gpl-3.0 |
panmari/tensorflow | tensorflow/python/kernel_tests/gradient_correctness_test.py | 15 | 1413 | # 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 |
phantomas1234/inspyred | examples/advanced/knapsack_acs_example.py | 4 | 1297 | from random import Random
from time import time
import math
import inspyred
def main(prng=None, display=False):
if prng is None:
prng = Random()
prng.seed(time())
items = [(7,369), (10,346), (11,322), (10,347), (12,348), (13,383),
(8,347), (11,364), (8,340), (8,324), (13,36... | gpl-3.0 |
sphawk/build-ace | sync.py | 1 | 2059 | #!/usr/bin/python3
# sync local and myself from origin
import os
import subprocess
from string import Template
from collections import namedtuple
Command = namedtuple('Command', ['path', 'command'])
FILE_DIR = os.path.dirname(os.path.realpath(__file__))
ACCOUNT_NAME = 'sphawk'
param = dict(GIT='git',
ATCD_MYSEL... | mit |
ChameleonCloud/horizon | openstack_dashboard/dashboards/project/vg_snapshots/tests.py | 3 | 8730 | # 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, software
# d... | apache-2.0 |
theiviaxx/Frog | frog/views/__init__.py | 1 | 9165 | ##################################################################################################
# Copyright (c) 2012 Brett Dixon
#
# 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 r... | mit |
dhermes/gcloud-python | bigtable/synth.py | 2 | 2952 | # Copyright 2018 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 agreed to in writing, s... | apache-2.0 |
sushramesh/lwc | lib/python2.7/site-packages/django/contrib/staticfiles/storage.py | 103 | 14788 | from __future__ import unicode_literals
import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
InvalidCacheBackendError, cache... | mit |
markjin1990/solr | dev-tools/scripts/checkJavadocLinks.py | 5 | 8915 | # 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 use ... | apache-2.0 |
GhostThrone/django | tests/syndication_tests/tests.py | 90 | 21618 | from __future__ import unicode_literals
import datetime
from xml.dom import minidom
from django.contrib.sites.models import Site
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.test.utils import requir... | bsd-3-clause |
scripni/rethinkdb | external/v8_3.30.33.16/tools/generate-builtins-tests.py | 89 | 4569 | #!/usr/bin/env python
# Copyright 2014 the V8 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.
import json
import optparse
import os
import random
import shutil
import subprocess
import sys
BLACKLIST = [
# Skip special d8 fu... | agpl-3.0 |
dkamburov/Deutsch-mit-Spass | deutsch_mit_spass/deutsch_mit_spass/settings.py | 1 | 2261 | """
Django settings for deutsch_mit_spass project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DI... | gpl-3.0 |
mugurrus/superdesk-core | apps/content/__init__.py | 7 | 1916 | """Content related helpers and utils.
"""
from eve.utils import config
from superdesk.notification import push_notification
from apps.auth import get_user
def push_content_notification(items, event='content:update'):
"""Push content:update notification for multiple items.
It can be also 2 versions of same i... | agpl-3.0 |
shepdelacreme/ansible | test/integration/targets/vault/password-script.py | 129 | 1025 | #!/usr/bin/env python
#
# 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 in the hope that it will b... | gpl-3.0 |
mlba-team/open-lighting | python/ola/ClientWrapper.py | 3 | 8343 | #!/usr/bin/python
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope t... | lgpl-2.1 |
prasadtalasila/JavaAutolab | docs/examples/io_tests/student_solution/python3/python31.py | 3 | 1233 | class node:
def __init__(self,key):
self.left = None
self.right = None
self.val = key
def insert(root,node):
if(root == None):
root = node
return root
else:
if(root.val < node.val):
if(root.right == None):
root.rig... | gpl-2.0 |
Krasnyanskiy/bazel | tools/android/build_split_manifest_test.py | 26 | 1758 | # 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 ag... | apache-2.0 |
gangadhar-kadam/sms-wnframework | webnotes/widgets/moduleview.py | 6 | 2459 | # Copyright 2013 Web Notes Technologies Pvt Ltd
# License: MIT. See license.txt
from __future__ import unicode_literals
import webnotes, json
@webnotes.whitelist()
def get_data(module, doctypes='[]'):
doctypes = json.loads(doctypes)
open_count, conditions = get_open_count(doctypes)
return {
"search_criteria": ge... | mit |
google-research/google-research | many_constraints/intersectional_fairness.py | 1 | 20803 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | test programs/test/test/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py | 1152 | 1416 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity... | apache-2.0 |
gkno/gkno_launcher | src/networkx/algorithms/clique.py | 39 | 16077 | """
=======
Cliques
=======
Find and manipulate cliques of graphs.
Note that finding the largest clique of a graph has been
shown to be an NP-complete problem; the algorithms here
could take a long time to run.
http://en.wikipedia.org/wiki/Clique_problem
"""
# Copyright (C) 2004-2008 by
# Aric Hagberg <hagberg... | mit |
drmrd/ansible | test/units/modules/remote_management/oneview/test_oneview_fcoe_network_facts.py | 77 | 1790 | # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.compat.tests import unittest
from oneview_module_loader import FcoeNetworkFactsModule
from hpe_test_utils import FactsParamsTestCase
ERROR_MSG... | gpl-3.0 |
jk1/intellij-community | python/lib/Lib/site-packages/django/db/backends/creation.py | 71 | 21002 | import sys
import time
from django.conf import settings
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific differences that pertain to
database *creation*, ... | apache-2.0 |
PatrickOReilly/scikit-learn | sklearn/tests/test_learning_curve.py | 59 | 10869 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
gcd0318/django | django/contrib/sites/models.py | 316 | 3743 | from __future__ import unicode_literals
import string
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.http.request import split_domain_port
from django.utils.encoding import python_2_unicode_com... | bsd-3-clause |
jairideout/scikit-bio | skbio/util/tests/test_misc.py | 7 | 11338 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
escaped/pyexiv2 | test/buffer.py | 5 | 3157 | # -*- coding: utf-8 -*-
# ******************************************************************************
#
# Copyright (C) 2010 Olivier Tilloy <olivier@tilloy.net>
#
# This file is part of the pyexiv2 distribution.
#
# pyexiv2 is free software; you can redistribute it and/or
# modify it under the terms of the GNU Gene... | gpl-2.0 |
robcarver17/systematictradingexamples | plots_for_perhaps/equitysectorweights.py | 1 | 6074 | from scipy.optimize import minimize
from copy import copy
import random
import pandas as pd
import numpy as np
from datetime import datetime as dt
def create_dull_pd_matrix(dullvalue=0.0, dullname="A", startdate=pd.datetime(1970,1,1).date(), enddate=dt.now().date(), index=None):
"""
create a single valued pd ... | gpl-2.0 |
pybrain2/pybrain2 | pybrain/structure/modules/gaussianlayer.py | 26 | 1579 | __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from scipy import random
from pybrain.structure.modules.neuronlayer import NeuronLayer
from pybrain.tools.functions import expln, explnPrime
from pybrain.structure.parametercontainer import ParameterContainer
class GaussianLayer(NeuronLayer, ParameterContainer):
... | bsd-3-clause |
pelorusjack/BlockDX | qa/rpc-tests/bipdersig.py | 136 | 3261 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test the BIP66 changeover logic
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authpro... | mit |
gvb/odoo | addons/account_test/account_test.py | 342 | 2169 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id: product_expiry.py 4304 2006-10-25 09:54:51Z ged $
#
# WARNING: This program as such is intended to be used by professional
# prog... | agpl-3.0 |
taotie12010/bigfour | lms/djangoapps/commerce/views.py | 13 | 9402 | """ Commerce views. """
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from ecommerce_api_client import exceptions
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest... | agpl-3.0 |
kwss/keystone | keystone/common/sql/migrate_repo/versions/007_add_domain_tables.py | 6 | 2884 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | apache-2.0 |
3manuek/scikit-learn | sklearn/cluster/setup.py | 263 | 1449 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = ... | bsd-3-clause |
falcong/or-tools | examples/python/eq20.py | 34 | 4397 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 |
dmccue/ansible | lib/ansible/module_utils/redhat.py | 324 | 10219 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
yanheven/horizon | openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py | 54 | 1185 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
bfrickert/WFMU_Ken | py/GetComments.py | 2 | 1171 | import requests
from bs4 import BeautifulSoup
import pandas as pd
import re
import time
import datetime
import sys
def scrapeWFMUPlaylist(url):
response = requests.get(url)
soup = BeautifulSoup(response.text)
table = soup.find(id='comments-table')
rows = table.findAll('tr')
cell = ta... | mit |
sriki18/scipy | scipy/spatial/_procrustes.py | 18 | 4370 | """
This module provides functions to perform full Procrustes analysis.
This code was originally written by Justin Kucynski and ported over from
scikit-bio by Yoshiki Vazquez-Baeza.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.linalg import orthogonal_procrustes
... | bsd-3-clause |
XiaJieCom/change | stu103151/days16/mysite/IDC/views.py | 3 | 3801 | from django.shortcuts import render,redirect
from django.shortcuts import HttpResponse
# Create your views here.
from IDC import models
def reg(request):
if request.method == "POST":
i_username = request.POST.get('username')
i_passwd = request.POST.get('passwd')
tmp_dic = models.UserInfo.obj... | lgpl-2.1 |
Aravinthu/odoo | addons/project/tests/test_portal.py | 34 | 2276 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.project.tests.test_access_rights import TestPortalProjectBase
from odoo.exceptions import AccessError
from odoo.tools import mute_logger
class TestPortalProject(TestPortalProjectBase):
@mute_logger... | agpl-3.0 |
40023247/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/xml/dom/xmlbuilder.py | 873 | 12377 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... | agpl-3.0 |
charbeljc/OCB | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
camilonova/sentry | src/sentry/api/endpoints/event_details.py | 1 | 1491 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection, Endpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializers import serialize
from sentry.models import Event
class EventDetailsEndpoint(Endpoint):
doc_section = Doc... | bsd-3-clause |
mpeters/ansible | v2/ansible/playbook/__init__.py | 3 | 1113 | # (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 |
tedder/ansible | lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py | 26 | 19171 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
jofusa/datadogpy | datadog/dogshell/metric.py | 3 | 1913 | from datadog.dogshell.common import report_errors, report_warnings, find_localhost
from datadog import api
class MetricClient(object):
@classmethod
def setup_parser(cls, subparsers):
parser = subparsers.add_parser('metric', help="Post metrics.")
verb_parsers = parser.add_subparsers(title='Ver... | bsd-3-clause |
jiajiechen/mxnet | example/sparse/wide_deep/train.py | 19 | 5299 | # 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 |
talishte/ctigre | env/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py | 86 | 9195 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
from .base import Client
from ..parameters import prepare_grant_uri, prepare_... | bsd-2-clause |
brakhane/panda3d | direct/src/interval/ActorInterval.py | 4 | 9302 | """ActorInterval module: contains the ActorInterval class"""
__all__ = ['ActorInterval', 'LerpAnimInterval']
from panda3d.core import *
from panda3d.direct import *
from direct.directnotify.DirectNotifyGlobal import *
from . import Interval
import math
class ActorInterval(Interval.Interval):
# create ActorInter... | bsd-3-clause |
ax003d/openerp | openerp/addons/pad_project/__openerp__.py | 119 | 1478 | # -*- 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 |
ravibhure/ansible | test/units/modules/network/iosxr/iosxr_module.py | 73 | 2508 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
cchurch/ansible | lib/ansible/modules/network/f5/bigip_iapp_service.py | 38 | 31847 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
zarnold/transitfeed | transitfeed/frequency.py | 8 | 2903 | #!/usr/bin/python2.5
# Copyright (C) 2010 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 la... | apache-2.0 |
drmrd/ansible | test/units/modules/network/netscaler/test_netscaler_module_utils.py | 56 | 5737 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | gpl-3.0 |
zimmermant/dlvo_lammps | doc/utils/sphinx-config/conf.py | 2 | 8669 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# LAMMPS documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 6 14:20:08 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | gpl-2.0 |
nyu-mhealth/project-smsurvey | main/smsurvey/core/model/query/dao.py | 1 | 1200 | import os
import pymysql
class DAO:
class __DAO:
def __init__(self, database_url, database_username, database_password, test):
self.database_url = database_url
self.database_username = database_username
self.database_password = database_password
if test:
... | gpl-3.0 |
ccalleu/halo-halo | CSipSimple/jni/pjsip/sources/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py | 59 | 1125 | # $Id: 001_torture_4475_3_1_1_2.py 2505 2009-03-12 11:25:11Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# Torture message from RFC 4475
# 3.1.1. Valid Messages
# 3.1.1.2. Wide Range of Valid Characters
complete_msg = \
"""!interesting-Method0123456789_*+`.%indeed'~ sip:1_unusual.URI~(to-be!sure)&isn't+it$... | gpl-3.0 |
armersong/zato | code/zato-server/src/zato/server/scheduler.py | 6 | 9627 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import logging
from traceback import format_exc
# crontab
from crontab ... | gpl-3.0 |
prometheanbob/clowdflows | workflows/migrations/0012_auto__del_field_widget_widget_type__add_field_widget_type.py | 6 | 14102 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Widget.widget_type'
db.delete_column('workflows_widget', 'widget_type')
# Addin... | gpl-3.0 |
electrototo/MediCloud | medicloud/interface/models.py | 1 | 1432 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class baseUser(models.Model):
type_of_user = models.CharField(max_length=20, blank=False)
attached = models.OneToOneField(User)
def __str__(self):
return self.attached.username
class doctorExtent(models.Model):
... | gpl-3.0 |
pedestre/Kernel-Apolo-ICS-4.0.4 | mkshbootimg.py | 3 | 1282 | #!/usr/bin/env python
import sys, os
def copydata(outfile, infile):
while 1:
data = infile.read(512)
if (data):
outfile.write(data)
else:
break
def alignoffset(outfile):
offset = outfile.tell()
outfile.seek((offset + 511) & ~511)
return outfile.tell()
d... | gpl-2.0 |
jmighion/ansible | lib/ansible/modules/cloud/amazon/execute_lambda.py | 24 | 10649 | #!/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 |
evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/test/unit/test_commands_git.py | 8 | 27437 | # This file is part of Buildbot. Buildbot 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 that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
mcus/SickRage | lib/sqlalchemy/util/_collections.py | 78 | 26035 | # util/_collections.py
# Copyright (C) 2005-2014 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
"""Collection classes and helpers."""
from __future__ import absolute_import
imp... | gpl-3.0 |
TheWardoctor/Wardoctors-repo | script.module.exodus/lib/resources/lib/modules/jsunfuck.py | 5 | 9713 | #!/usr/bin/python
"""
Exodus Add-on
Copyright (C) 2016 tknorris
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 ... | apache-2.0 |
anant-dev/django | tests/template_tests/filter_tests/test_slice.py | 428 | 1317 | from django.template.defaultfilters import slice_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SliceTests(SimpleTestCase):
@setup({'slice01': '{{ a|slice:"1:3" }} {{ b|slice:"1:3" }}'})
def test_slice01(self):
output = sel... | bsd-3-clause |
Metaswitch/calico-neutron | neutron/tests/unit/test_common_log.py | 39 | 2094 | # Copyright (c) 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... | apache-2.0 |
Zanzibar82/pelisalacarta | python/main-classic/channels/seriesblanco.py | 3 | 8640 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core import logger
from core i... | gpl-3.0 |
sebastienbarbier/723e | seven23/models/currency/migrations/0001_initial.py | 2 | 1054 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-17 14:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Curren... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.