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 |
|---|---|---|---|---|---|
jbking/demo-appengine-django-golang | myproject/django/utils/formats.py | 104 | 7799 | import decimal
import datetime
from django.conf import settings
from django.utils import dateformat, numberformat, datetime_safe
from django.utils.importlib import import_module
from django.utils.encoding import force_str
from django.utils.functional import lazy
from django.utils.safestring import mark_safe
from djang... | mit |
antiface/mne-python | examples/time_frequency/plot_compute_raw_data_spectrum.py | 16 | 2573 | """
==================================================
Compute the power spectral density of raw data
==================================================
This script shows how to compute the power spectral density (PSD)
of measurements on a raw dataset. It also show the effect of applying SSP
to the data to reduce ECG ... | bsd-3-clause |
kamcpp/tensorflow | tensorflow/tools/dist_test/server/grpc_tensorflow_server.py | 31 | 3644 | #!/usr/bin/python
# 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 r... | apache-2.0 |
luistorresm/odoo | openerp/tools/__init__.py | 337 | 1447 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
sumspr/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 249 | 1563 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
kthordarson/youtube-dl-ruv | youtube_dl/extractor/canalplus.py | 3 | 4443 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
url_basename,
qualities,
)
class CanalplusIE(InfoExtractor):
IE_DESC = 'canalplus.fr, piwiplus.fr and d8.tv'
_VALID_URL = r'https?://(?:www\.(?P<site>canal... | unlicense |
NewpTone/stacklab-cinder | cinder/db/base.py | 5 | 1430 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 except in compli... | apache-2.0 |
antiface/audiolazy | audiolazy/lazy_io.py | 1 | 14038 | # -*- coding: utf-8 -*-
# This file is part of AudioLazy, the signal processing Python package.
# Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini
#
# AudioLazy 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 Foun... | gpl-3.0 |
Answeror/aip | aip/imfs/cascade.py | 1 | 1705 | from .base import NameMixin
def load_ext(name, bases):
return need_raw(
name,
bases,
lambda base: base.load(name)
)
def thumbnail_ext(name, width, height, bases):
return need_raw(
name,
bases,
lambda base: base.thumbnail(name, width, height)
)
def mt... | mit |
escapewindow/mozharness | scripts/mobile_l10n.py | 2 | 21172 | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
"""mobile_l10n.py
This currently... | mpl-2.0 |
HusseinReda/Valduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | lgpl-2.1 |
sugartom/tensorflow-alien | tensorflow/python/util/example_parser_configuration_test.py | 157 | 2775 | # 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 |
JustRamon/SpeechController | SC.py | 1 | 1113 | #!/usr/bin/env python3
import speech_recognition as sr
import ksr10
import time
arm = ksr10.ksr10_class()
while 1:
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
try:
rn = r.recognize_google(audio)
except sr.UnknownValueError:
print("Goog... | gpl-2.0 |
alqfahad/odoo | addons/hw_posbox_upgrade/__init__.py | 1894 | 1075 | # -*- 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... | agpl-3.0 |
aleida/django | tests/regressiontests/string_lookup/tests.py | 65 | 2413 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from .models import Foo, Whiz, Bar, Article, Base, Child
class StringLookupTests(TestCase):
def test_string_form_referencing(self):
"""
Regression test for #1661 and #1662
C... | bsd-3-clause |
allotria/intellij-community | python/helpers/py3only/docutils/statemachine.py | 44 | 57608 | # $Id: statemachine.py 7464 2012-06-25 13:16:03Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A finite state machine specialized for regular-expression-based text filters,
this module defines the following classes:
- `StateMachine`, a state m... | apache-2.0 |
QuLogic/specfem3d | EXAMPLES/layered_halfspace/2lay_mesh_boundary_fig8-nodoubling.py | 5 | 4016 | #!/usr/bin/env python
###########################################################################
#### TNM: This is the mesh generation, adapted from a journal file
#### specific to the settings of Komatitsch and Tromp 1999, Fig.8
#### Aug 2009
################################################################... | gpl-2.0 |
ebaskoro/node-gyp | gyp/test/generator-output/gyptest-top-all.py | 74 | 1455 | #!/usr/bin/env python
# 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.
"""
Verifies building a project hierarchy created when the --generator-output=
option is used to put the build configuration files in a sepa... | mit |
Orav/kbengine | kbe/res/scripts/common/Lib/msilib/__init__.py | 2 | 18010 | # Copyright (C) 2005 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
from _msi import *
import os, string, re, sys
AMD64 = "AMD64" in sys.version
Itanium = "Itanium" in sys.version
Win64 = AMD64 or Itanium
# Partially taken from Wine
datasizemask= 0x00ff
type_valid= 0x0100
typ... | lgpl-3.0 |
starbt/flea_market | market/migrations/0006_auto_20161206_2033.py | 1 | 1232 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-06 12:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('market', '0005_auto_20161206_1204'),
]
operations = [
migrations.AddField(
... | mit |
semonte/intellij-community | python/lib/Lib/wsgiref/headers.py | 104 | 5916 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.Message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
from types import ListType, TupleType
# Regular expression that matches `special' characters in para... | apache-2.0 |
shelsonjava/TeaJS | deps/v8/build/gyp/test/variables/filelist/gyptest-filelist-golden.py | 228 | 1584 | #!/usr/bin/env python
# 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.
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format=... | bsd-3-clause |
UbiCastTeam/touchwizard | touchwizard/canvas.py | 1 | 16655 | # -*- coding: utf-8 -*
import clutter
import gobject
import easyevent
import logging
import os
import time
from touchwizard.loading import LoadingWidget
logger = logging.getLogger('touchwizard')
class Canvas(clutter.Actor, clutter.Container, easyevent.User):
"""Wizard main actor which manages the user interfac... | gpl-3.0 |
cernops/neutron | neutron/plugins/nuage/extensions/nuage_subnet.py | 15 | 1769 | # Copyright 2014 Alcatel-Lucent USA 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 l... | apache-2.0 |
cuedpc/edpcmentoring | edpcmentoring/mentoring/test_models.py | 2 | 1986 | from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from cuedmembers.models import Member
from .models import Relationship
class RelationshipActiveInactiveTestCase(TestCase):
fixtures = ['cuedmembers/test_users_and_members']
def setUp(self)... | mit |
bguillot/OpenUpgrade | openerp/tools/graph.py | 441 | 26118 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
bdang2012/taiga-back | taiga/projects/votes/serializers.py | 10 | 1172 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
samzhang111/scikit-learn | sklearn/preprocessing/tests/test_imputation.py | 8 | 12376 |
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.preprocessing.imput... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | plugin.video.SportsDevil/lib/utils/mycrypt.py | 15 | 17416 | #!/usr/bin/env python2
#!python
'''
Implement openssl compatible AES-256 CBC mode encryption/decryption.
This module provides encrypt() and decrypt() functions that are compatible
with the openssl algorithms.
This is basically a python encoding of my C++ work on the Cipher class
using the Crypto.Cipher.AES class.
UR... | gpl-2.0 |
andrey-malets/web-page-replay | third_party/ipaddr/ipaddr.py | 92 | 60528 | #!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | apache-2.0 |
AnthillTech/python-mewa-client | examples/main.py | 1 | 1354 | '''
Created on 27 lip 2014
@author: Krzysztof Langner
'''
from mewa.client import Connection
HOST_URL = "ws://mewa.cc:9001/ws"
# HOST_URL = "ws://localhost:9000/ws"
connection = Connection(HOST_URL)
def onConnected():
connection.getDevices()
connection.sendEvent("serviceA.event2", "78", True)
params =... | bsd-2-clause |
thecodinghub/news-for-good | news/Lib/encodings/cp1258.py | 272 | 13364 | """ Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | bsd-3-clause |
vishwaprakashmishra/xmatrix | vumi/transports/mtn_rwanda/mtn_rwanda_ussd.py | 4 | 8197 | # -*- test-case-name: vumi.transports.mtn_rwanda.tests.test_mtn_rwanda_ussd -*-
from datetime import datetime
from twisted.internet import reactor
from twisted.web import xmlrpc
from twisted.internet.defer import inlineCallbacks, Deferred, returnValue
from vumi.message import TransportUserMessage
from vumi.transports.... | bsd-3-clause |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Coupled_Contact/Steady_State_Single_Foundation_Sysytem_Under_Tension/CoupledHardContact_NonLinHardSoftShear/n_0.3/compare_txt.py | 637 | 2094 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
edx-solutions/edx-platform | lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py | 4 | 3261 | """
Django admin commands related to verify_student
"""
import logging
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification, SSPVerificationRetryConfig
log = logging.getLogger('retry_... | agpl-3.0 |
tencia/deeptrackpy | utils.py | 1 | 10122 | import time
import sys
import os
from PIL import Image
import numpy as np
import lasagne as nn
import theano
import theano.tensor as T
import h5py
from fuel.datasets.hdf5 import H5PYDataset
from fuel.schemes import ShuffledScheme, SequentialScheme
from fuel.streams import DataStream
# runs training loop, expects dat... | mit |
beni55/sympy | sympy/external/tests/test_codegen.py | 13 | 11889 | # This tests the compilation and execution of the source code generated with
# utilities.codegen. The compilation takes place in a temporary directory that
# is removed after the test. By default the test directory is always removed,
# but this behavior can be changed by setting the environment variable
# SYMPY_TEST_CL... | bsd-3-clause |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/python/platform/test.py | 5 | 3624 | # 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... | mit |
cntnboys/410Lab6 | v1/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/tests/__init__.py | 62 | 12335 | """Tests for the 'setuptools' package"""
from unittest import TestSuite, TestCase, makeSuite, defaultTestLoader
import distutils.core, distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
import setuptools, setuptools.dist
from setuptoo... | apache-2.0 |
zxsted/scipy | benchmarks/benchmarks/interpolate.py | 37 | 6314 | from __future__ import division, absolute_import, print_function
import numpy as np
from .common import run_monitored, set_mem_rlimit, Benchmark
try:
from scipy.stats import spearmanr
except ImportError:
pass
try:
import scipy.interpolate as interpolate
except ImportError:
pass
class Leaks(Benchma... | bsd-3-clause |
mikelikespie/AutobahnTestSuite | autobahntestsuite/autobahntestsuite/case/case3_2.py | 12 | 1614 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | apache-2.0 |
andreyvit/pyjamas | examples/toggle/Toggle.py | 6 | 2646 | """ testint our demo slider
"""
import pyjd # dummy in pyjs
from pyjamas.ui.Label import Label
from pyjamas.ui.Button import Button
from pyjamas.ui.ButtonBase import ButtonBase
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.ToggleButton import ToggleButton
from pyjamas.ui.PushButton import PushBu... | apache-2.0 |
vaygr/ansible | docs/bin/dump_keywords.py | 27 | 2748 | #!/usr/bin/env python
import optparse
import re
from distutils.version import LooseVersion
import jinja2
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role import Role
from ansible.playbook.task import Tas... | gpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/document_webdav/cache.py | 67 | 1333 | import time
import heapq
def memoize(maxsize):
"""decorator to 'memoize' a function - caching its results"""
def decorating_function(f):
cache = {} # map from key to value
heap = [] # list of keys, in LRU heap
cursize = 0 # because len() is slow
def wrapper(*args):
... | agpl-3.0 |
JackDanger/sentry | src/sentry/utils/managers.py | 40 | 1799 | """
sentry.utils.db
~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
class InstanceManager(object):
def __init__(self, class_list=None, instances=True... | bsd-3-clause |
WillChilds-Klein/mistress-mapreduce | mrs/master.py | 4 | 34507 | # Mrs
# Copyright 2008-2012 Brigham Young University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
jwlawson/tensorflow | tensorflow/contrib/py2tf/pyct/compiler.py | 3 | 2011 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
sbidoul/odoo | openerp/report/common.py | 457 | 3337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
yeraydiazdiaz/nonrel-blog | django/contrib/gis/tests/geogapp/tests.py | 100 | 4075 | """
Tests for geography support in PostGIS 1.5+
"""
from __future__ import absolute_import
import os
from django.contrib.gis import gdal
from django.contrib.gis.measure import D
from django.test import TestCase
from .models import City, County, Zipcode
class GeographyTest(TestCase):
def test01_fixture_load(se... | bsd-3-clause |
ryanmockabee/golfr | flask/lib/python3.6/site-packages/sqlalchemy/dialects/firebird/base.py | 33 | 28291 | # firebird/base.py
# Copyright (C) 2005-2017 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
r"""
.. dialect:: firebird
:name: Firebird
Firebird Dialects
----------------... | mit |
jotes/boto | boto/sts/credentials.py | 153 | 8210 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# 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
# withou... | mit |
MisterTea/HyperNEAT | boost_1_57_0/libs/python/pyste/tests/GCCXMLParserUT.py | 13 | 11736 | # 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 sys
sys.path.append('../src')
import unittest
import tempfile
import os... | bsd-3-clause |
Project-Bonfire/KOIT | Scripts/include/Help_note.py | 3 | 5439 | from Scripts.include.helper_func import *
def print_help(argv, program_argv):
"""
Gets the program arguments and prints manual for the program.
"""
print BOLD + "Usage:" + ENDC
print
print BOLD + OKBLUE + " Network parameters:" + ENDC
print
print BOLD + " -plasma_with_fpu:" + ENDC
... | gpl-3.0 |
4eek/edx-platform | lms/djangoapps/discussion_api/tests/test_permissions.py | 81 | 4970 | """
Tests for discussion API permission logic
"""
import itertools
import ddt
from discussion_api.permissions import (
can_delete,
get_editable_fields,
get_initializable_comment_fields,
get_initializable_thread_fields,
)
from lms.lib.comment_client.comment import Comment
from lms.lib.comment_client.th... | agpl-3.0 |
fnordahl/nova | nova/tests/unit/test_api_validation.py | 7 | 43908 | # Copyright 2013 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
matburt/ansible | lib/ansible/utils/shlex.py | 59 | 1275 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
abomyi/django | tests/admin_views/admin.py | 9 | 30837 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import tempfile
from wsgiref.util import FileWrapper
from django import forms
from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin import BooleanFieldListFilter
from django.contrib.admin.views.main import ... | bsd-3-clause |
Captnoord/openpli-enigma2 | lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py | 31 | 10584 | from Components.ActionMap import ActionMap
from Components.Sensors import sensors
from Components.Sources.Sensor import SensorSource
from Components.Sources.StaticText import StaticText
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry
from Screens.Screen import Screen... | gpl-2.0 |
sirMackk/ZeroNet | plugins/disabled-Zeroname-local/UiRequestPlugin.py | 6 | 1836 | import re
from Plugin import PluginManager
@PluginManager.registerTo("UiRequest")
class UiRequestPlugin(object):
def __init__(self, *args, **kwargs):
from Site import SiteManager
self.site_manager = SiteManager.site_manager
super(UiRequestPlugin, self).__init__(*args, **kwargs)
# Medi... | gpl-2.0 |
rickerc/cinder_audit | cinder/tests/db/test_finish_migration.py | 1 | 2226 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
DavidNorman/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 2 | 14485 | # 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 |
nzlosh/st2 | st2api/tests/unit/controllers/v1/test_kvps.py | 3 | 25338 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
miguelut/utmbu | mbu/api/scout.py | 1 | 1603 | from django.contrib.admin.views.decorators import staff_member_required
from django.http import JsonResponse
from django.contrib.auth.decorators import permission_required
from rest_framework.decorators import api_view
from mbu.models import Scout, ScoutCourseInstance, ScoutCourseInstanceSerializer, RegistrationStatus
... | mit |
ihsanudin/odoo | addons/purchase/report/__init__.py | 380 | 1070 | # -*- 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 |
Ayrx/cryptography | tests/hazmat/primitives/test_dh.py | 5 | 2669 | # 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
import pytest
from cryptography.hazmat.primitives.asymmetric import dh
... | bsd-3-clause |
Philippe12/external_chromium_org | tools/telemetry/telemetry/core/backends/chrome/cros_browser_finder.py | 23 | 5002 | # Copyright 2013 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.
"""Finds CrOS browsers that can be controlled by telemetry."""
import logging
from telemetry.core import browser
from telemetry.core import possible_browser... | bsd-3-clause |
thbuerg/Heidelberg_2017 | DeeProtein/validate.py | 1 | 1040 | """ Invoke the Model in validation mode and perform a run over the valid set."""
import argparse
import json
from DeeProtein import DeeProtein
import helpers
def main():
with open(FLAGS.config_json) as config_fobj:
config_dict = json.load(config_fobj)
# set the gpu context
if not FLAGS.gpu:
... | mit |
LeahDresd2/Leah | py/openage/convert/drs.py | 46 | 3699 | from . import util
from .util import dbg
from binascii import hexlify
from struct import Struct, unpack_from
#version of the drs file, hardcoded for now
file_version = 57
if file_version == 57:
copyright_size = 40
elif file_version == 59:
copyright_size = 60
#little endian byte-order
endianness = "< "
class... | gpl-3.0 |
Jorge-Rodriguez/ansible | test/units/modules/storage/netapp/test_netapp_e_ldap.py | 56 | 17659 | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import os
import shutil
import tempfile
from ansible.modules.storage.netapp.netapp_e_ldap import Ldap
from units.modules.utils import ModuleTestCase, set_module_args, AnsibleFailJson, AnsibleExitJson
... | gpl-3.0 |
cliqz/socorro | socorro/unittest/external/postgresql/test_graphics_devices.py | 11 | 7594 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
from nose.plugins.attrib import attr
from nose.tools import eq_, assert_raises
from socorro.external impor... | mpl-2.0 |
repotvsupertuga/tvsupertuga.repository | instal/script.module.liveresolver/lib/liveresolver/resolvers/filmon.py | 10 | 1483 | # -*- coding: utf-8 -*-
import re,urlparse,json,xbmcgui
from liveresolver.modules import client
from liveresolver.modules.log_utils import log
def resolve(url):
try:
if '/vod/' in url:
url = re.compile('/(\d+)').findall(url)[-1]
url = 'http://www.filmon.com/vod/info/%s' % url
... | gpl-2.0 |
barbuza/django | django/contrib/gis/db/backends/oracle/operations.py | 307 | 9866 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | bsd-3-clause |
jeremiahyan/odoo | addons/sale_timesheet/tests/test_project_overview.py | 1 | 8777 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale_timesheet.tests.test_reporting import TestReporting
from odoo.tools import float_compare
from odoo.tests import tagged
@tagged('-at_install', 'post_install')
class TestSaleProject(TestReporting):
... | gpl-3.0 |
EqAfrica/machinekit | nosetests/test_netcmd.py | 1 | 3441 | #!/usr/bin/env python
from nose import with_setup
from machinekit.nosetests.realtime import setup_module,teardown_module
from machinekit.nosetests.support import fnear
from machinekit import hal
import os
def test_component_creation():
global c1,c2
c1 = hal.Component("c1")
c1.newpin("s32out", hal.HAL_S32... | lgpl-2.1 |
dongjoon-hyun/tensorflow | tensorflow/python/kernel_tests/weights_broadcast_test.py | 8 | 9719 | # 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 |
sarvex/tensorflow | tensorflow/python/ops/clip_ops.py | 10 | 16102 | # 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 |
joke2k/faker | setup.py | 1 | 2446 | #!/usr/bin/env python
import os
from pathlib import Path
from setuptools import find_packages, setup
here = Path(__file__).resolve().parent
README = (here / 'README.rst').read_text(encoding='utf-8')
VERSION = (here / 'VERSION').read_text(encoding='utf-8').strip()
excluded_packages = ["docs", "tests", "tests.*"]
if... | mit |
prakxys/flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/jinja2/tests.py | 638 | 3444 | # -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from jinja2.runtime import Undefined
from jinja2._compat import text_type, string_types, mappi... | apache-2.0 |
ar7z1/ansible | contrib/inventory/stacki.py | 27 | 6239 | #!/usr/bin/env python
# Copyright (c) 2016, Hugh Ma <hugh.ma@flextronics.com>
#
# This module 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 v... | gpl-3.0 |
daanwierstra/pybrain | pybrain/rl/learners/search/incrementalcomplexity/incrementalcomplexity.py | 1 | 1767 | __author__ = 'Tom Schaul, tom@idsia.ch'
# TODO: inheritance!
class IncrementalComplexitySearch(object):
""" Draft of an OOPS-inspired search that incrementally expands the search space
and the allocated time (to a population of search processes). """
def __init__(self, initSearchProcess, maxPhases =... | bsd-3-clause |
leonhong/thrift | lib/py/src/protocol/TBinaryProtocol.py | 62 | 6475 | #
# 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 |
arunhotra/tensorflow | tensorflow/python/summary/impl/directory_watcher_test.py | 5 | 3056 | """Tests for directory_watcher."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
from tensorflow.python.framework import test_util
from tensorflow.python.platform import googletest
from tensorflow.python.summary.impl import direct... | apache-2.0 |
larsmans/numpy | numpy/matlib.py | 68 | 9569 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
# need * as we're copying the numpy namespace
from numpy import *
__version__ = np.__version__
__all__ = np.__all__[:] # copy numpy namespace
__all__ += ['rand', 'randn', 'repmat... | bsd-3-clause |
shanemcd/ansible | lib/ansible/modules/cloud/amazon/elb_target_group_facts.py | 8 | 9841 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
marteinn/wagtail-alt-generator | wagtailaltgenerator/tests/demosite/settings.py | 1 | 2042 | #!/usr/bin/env python
import os
DEBUG = False
TIME_ZONE = "Europe/Stockholm"
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}}
SECRET_KEY = "not needed"
USE_TZ = True
LANGUAGE_CODE = "en"
INSTALLED_APPS = [
"django.contrib.contenttypes",
"django.contrib.auth",
"django.contrib.sites"... | mit |
gkarlin/django-jenkins | build/Django/django/middleware/gzip.py | 225 | 2140 | import re
from django.utils.text import compress_sequence, compress_string
from django.utils.cache import patch_vary_headers
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header accor... | lgpl-3.0 |
txemi/ansible | lib/ansible/modules/cloud/ovirt/ovirt_networks.py | 25 | 9576 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
jparicka/twitter-tools | profiles/models.py | 1 | 1328 | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
class Profile(models.Model):
user = models.OneToOneField(User)
name = models.CharField(max_length=100, blank=True, verbose_name="name", db_index=True)
headline = models.CharField(max_length=... | mit |
ankurankan/scikit-learn | examples/gaussian_process/plot_gp_regression.py | 253 | 4054 | #!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
=========================================================
Gaussian Processes regression: basic introductory example
=========================================================
A simple one-dimensional regression exercise computed in two different ways:
1. A noise-free cas... | bsd-3-clause |
giggsey/SickRage | lib/hachoir_core/field/basic_field_set.py | 74 | 4776 | from hachoir_core.field import Field, FieldError
from hachoir_core.stream import InputStream
from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN, MIDDLE_ENDIAN
from hachoir_core.event_handler import EventHandler
class ParserError(FieldError):
"""
Error raised by a field set.
@see: L{FieldError}
... | gpl-3.0 |
pradhanta/drunken-robot | tools/profilegen/sforce/tooling.py | 4 | 1605 | from base import SforceBaseClient
import re
class SforceToolingClient(SforceBaseClient):
def __init__(self, wsdl, *args, **kwargs):
super(SforceToolingClient, self).__init__(wsdl, *args, **kwargs)
header = self.generateHeader('SessionHeader')
header.sessionId = kwargs['sid']
self.s... | apache-2.0 |
rcatwood/Savu | savu/data/data_structures/data_type.py | 1 | 4089 | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | gpl-3.0 |
pablolizardo/dotfiles | inkscape/symbols/generate.py | 1 | 1934 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
inkscapeSymbolGenerator: A inkscape symbol library generator
Copyright (C) 2015 Xavi Julián Olmos
See the file LICENSE for copying permission.
"""
import sys, os
import logging
from optparse import OptionParser
####Objetivo
#If select all merge all files... | gpl-2.0 |
andrewcbennett/iris | lib/iris/tests/unit/fileformats/pp/test_load.py | 5 | 1935 | # (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | gpl-3.0 |
willemneal/Docky | lib/werkzeug/http.py | 317 | 33404 | # -*- coding: utf-8 -*-
"""
werkzeug.http
~~~~~~~~~~~~~
Werkzeug comes with a bunch of utilities that help Werkzeug to deal with
HTTP data. Most of the classes and functions provided by this module are
used by the wrappers, but they are useful on their own, too, especially if
the response and ... | mit |
fxfitz/ansible | test/units/modules/network/dellos10/dellos10_module.py | 60 | 2530 | # (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 vers... | gpl-3.0 |
foodszhang/kbengine | kbe/src/lib/python/Lib/test/test_textwrap.py | 80 | 36255 | #
# Test suite for the textwrap module.
#
# Original tests written by Greg Ward <gward@python.net>.
# Converted to PyUnit by Peter Hansen <peter@engcorp.com>.
# Currently maintained by Greg Ward.
#
# $Id$
#
import unittest
from textwrap import TextWrapper, wrap, fill, dedent, indent, shorten
class BaseTestCase(unit... | lgpl-3.0 |
xindus40223115/2015cda_g1 | man3.py | 15 | 11740 |
import cherrypy
# 這是 MAN 類別的定義
'''
# 在 application 中導入子模組
import programs.cdag30.man as cdag30_man
# 加入 cdag30 模組下的 man.py 且以子模組 man 對應其 MAN() 類別
root.cdag30.man = cdag30_man.MAN()
# 完成設定後, 可以利用
/cdag30/man/assembly
# 呼叫 man.py 中 MAN 類別的 assembly 方法
'''
class MAN(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.exp... | gpl-3.0 |
Deepakkothandan/ansible | lib/ansible/modules/remote_management/oneview/oneview_ethernet_network.py | 147 | 8911 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
haad/ansible | lib/ansible/modules/network/netscaler/netscaler_gslb_vserver.py | 124 | 33875 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.