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
jrabbit/epithet
pyntk/test/test_crypto.py
2
4455
## # This file is part of Netsukuku # (c) Copyright 2009 Francesco Losciale aka jnz <francesco.losciale@gmail.com> # # This source code 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 L...
gpl-2.0
mupi/escolamupi
core/migrations/0010_drop_activity_and_answer.py
3
10197
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ('activities', '0002_create_activity_and_answer'), ) def forwards(self, orm): # Changing field 'Unit.activity'...
agpl-3.0
lindamar/ecclesi
env/lib/python2.7/site-packages/sqlalchemy/sql/selectable.py
14
128014
# sql/selectable.py # Copyright (C) 2005-2016 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 """The :class:`.FromClause` class of SQL expression elements, representing SQL tab...
mit
CMDann/oppia
core/domain/html_cleaner.py
14
2217
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
leezu/mxnet
tools/kill-mxnet.py
20
1641
#!/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
tiagochiavericosta/edx-platform
common/lib/xmodule/xmodule/word_cloud_module.py
104
7981
"""Word cloud is ungraded xblock used by students to generate and view word cloud. On the client side we show: If student does not yet answered - `num_inputs` numbers of text inputs. If student have answered - words he entered and cloud. """ import json import logging from pkg_resources import resource_string from x...
agpl-3.0
neale/CS-program
434-MachineLearning/final_project/linearClassifier/sklearn/datasets/samples_generator.py
26
56554
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing import MultiLabelBin...
unlicense
Refefer/pylearn2
pylearn2/scripts/papers/dropout/tests/test_dropout.py
46
2057
""" Unit tests for dropout paper """ import os from pylearn2.scripts.tests.yaml_testing import limited_epoch_train from pylearn2.testing.skip import skip_if_no_data from theano import config from theano.compile import get_default_mode yaml_file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), ...
bsd-3-clause
keras-team/keras-autodoc
tests/dummy_package/dummy_module.py
1
21401
class Dense: """Just your regular densely-connected NN layer. `Dense` implements the operation: `output = activation(dot(input, kernel) + bias)` where `activation` is the element-wise activation function passed as the `activation` argument, `kernel` is a weights matrix created by the layer, and...
apache-2.0
sarvex/django
tests/gis_tests/geoapp/test_serializers.py
245
3731
from __future__ import unicode_literals import json from django.contrib.gis.geos import LinearRing, Point, Polygon from django.core import serializers from django.test import TestCase, mock, skipUnlessDBFeature from django.utils import six from .models import City, MultiFields, PennsylvaniaCity @skipUnlessDBFeatur...
bsd-3-clause
feilchenfeldt/pypopgen
plot/plottools.py
1
2238
import io, re import itertools import matplotlib as mpl from matplotlib import pyplot as plt import pandas as pd import numpy as np mpl.rcParams['svg.fonttype'] = 'none' #fix svg inkscape bug def fixmiterlimit(svgdata, miterlimit = 10): # miterlimit variable sets the desired miterlimit mlfound = False sv...
mit
henrycg/GSM-Signal-Tracking-
gpx2kml.py
1
5130
#!/usr/bin/python # # Copyright 2011 - Henry Corrigan-Gibbs # www.henrycg.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 3 of the License, or # (at your option) any later v...
gpl-3.0
agaffney/ansible
test/integration/targets/plugin_config_for_inventory/test_inventory.py
5
2408
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: test_inventory plugin_type: inventory authors: - Pierre-Louis Bonicoli (@pilou-) short_description: test inventory description: - test inventory (fetch parameters using c...
gpl-3.0
nightjean/Deep-Learning
tensorflow/contrib/distributions/python/ops/deterministic.py
64
13215
# 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
kuza55/dns-digger
src/resolvers/python/dns/rdtypes/IN/IPSECKEY.py
100
5993
# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-2.0
stewartpark/django
tests/forms_tests/widget_tests/test_passwordinput.py
247
1052
from django.forms import PasswordInput from .base import WidgetTest class PasswordInputTest(WidgetTest): widget = PasswordInput() def test_render(self): self.check_html(self.widget, 'password', '', html='<input type="password" name="password" />') def test_render_ignore_value(self): sel...
bsd-3-clause
PetrDlouhy/django
django/core/servers/basehttp.py
94
7318
""" HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE! """ from __f...
bsd-3-clause
sparkslabs/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Test/Util/test_LossyConnector.py
6
6081
#!/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
ppwwyyxx/tensorflow
tensorflow/tools/test/upload_test_benchmarks.py
61
9222
# 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
ImageEngine/gaffer
python/GafferSceneUI/DeleteObjectUI.py
9
2337
########################################################################## # # Copyright (c) 2018, John Haddon. 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 so...
bsd-3-clause
cloud9UG/odoo
addons/sale/report/invoice_report.py
336
1680
# -*- 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
endlessm/chromium-browser
build/android/pylib/base/test_run_factory.py
3
1775
# 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. from pylib.gtest import gtest_test_instance from pylib.instrumentation import instrumentation_test_instance from pylib.junit import junit_test_instance from ...
bsd-3-clause
larray-project/larray-editor
larray_editor/traceback_tools.py
1
5430
import collections import itertools import linecache import sys import traceback # the classes and functions in this module are almost equivalent to (most code is copied as-is from) the # corresponding class/function from the traceback module in the stdlib. The only significant differences (except from # simplificati...
gpl-3.0
sookasa/heroku-buildpack-python-pipeline
vendor/distribute-0.6.34/setuptools/tests/test_develop.py
66
3435
"""develop tests """ import sys import os, shutil, tempfile, unittest import tempfile import site from StringIO import StringIO from distutils.errors import DistutilsError from setuptools.command.develop import develop from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribu...
mit
jjlee9/openthread
tools/harness-automation/cases/router_5_6_9.py
16
1874
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
Edraak/edraak-platform
common/djangoapps/enrollment/tests/test_data.py
1
14149
""" Test the Data Aggregation Layer for Course Enrollments. """ import datetime import unittest import ddt from django.conf import settings from mock import patch from nose.tools import raises from pytz import UTC from course_modes.models import CourseMode from course_modes.tests.factories import CourseModeFactory f...
agpl-3.0
you21979/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
115
3011
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above # copyright n...
bsd-3-clause
ruishihan/R7-with-notes
src/python/axi2s_c.py
1
4058
import dev_mem import reg_define as reg from const import * import time import sys ## create a memfile and set the AXI2S_EN AXI2S_I(O)SIZE(BASE) and so on. class axi2s_c: def __init__(self,d=None): self.dev = dev_mem.dev_mem(FPGA_BASE,FPGA_SIZE) self.api = { 'ver':self.apiversion , 'rreg':sel...
apache-2.0
mjwestcott/projecteuler
python/problem58.py
1
1488
""" problem58.py https://projecteuler.net/problem=58 Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 39 18 5 4 3 12 29 40 19 6 1 2 11 28 41 20 7 8 9 10 27 42 21 22 23 24 25 26 ...
mit
chrys87/orca-beep
test/keystrokes/gtk-demo/role_combo_box2.py
1
2169
#!/usr/bin/python """Test of labelled combo box output.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyComboAction("<Control>f")) sequence.append(TypeAction("Printing")) sequence.append(KeyComboAction("Return")) sequence.append(KeyComboAction("Right")) sequence.append...
lgpl-2.1
ejeschke/ginga
ginga/misc/tests/test_Task.py
3
8265
"""Unit Tests for the Task class""" import time import random import logging from .. import Task #LOGDEBUG = True # COMMENTED BECAUSE NOT USED # ======================================================================== class simpleTask(Task.Task): """Simple task used in various tests below. Sleeps a random in...
bsd-3-clause
ashishnitinpatil/django_appengine_project_template
django/contrib/gis/management/commands/inspectdb.py
315
1466
from django.core.management.commands.inspectdb import Command as InspectDBCommand class Command(InspectDBCommand): db_module = 'django.contrib.gis.db' gis_tables = {} def get_field_type(self, connection, table_name, row): field_type, field_params, field_notes = super(Command, self).get_field_type(...
bsd-2-clause
MediaSapiens/wavesf
django/contrib/redirects/middleware.py
447
1105
from django.contrib.redirects.models import Redirect from django import http from django.conf import settings class RedirectFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a redirect for non-404 re...
bsd-3-clause
niijv/webvita-heroku
webvita/views.py
1
1223
# -*-coding: utf-8 -*- from webvita import app, db from flask import request, session, redirect, url_for, abort,\ render_template, flash from flask.ext.sqlalchemy import SQLAlchemy from models import Blogpost, Reference, User, Tag @app.route('/index') def index(): ...
mit
avasilevich/spolks
icmp/utils/ip_packet.py
1
1482
import struct import socket from collections import namedtuple IPv4Header = namedtuple('IPv4Header', [ 'version', 'ihl', 'tos', 'total_length', 'id', 'flags', 'fragment_offset', 'ttl', 'proto', 'checksum', 'src', 'dest', ]) class IpHeader(IPv4Header): _format = '!B...
mit
elainenaomi/sciwonc-dataflow-examples
sbbd2016/experiments/4-mongodb-rp-3sh/10_workflow_full_10files_primary_3sh_annot_with_proj_3s_hs/init_0/DataStoreInit.py
1
2180
#!/usr/bin/env python from pymongo import MongoClient import pymongo HOST = "mongos-3sh-ex4q:27017,mongos-3sh-lenv:27017,mongos-3sh-ql7j:27017" c = MongoClient('mongodb://'+HOST) dbname = "google" task = "task_events" avg_cpu = "average_cpu" mm_cpu = "maxmin_cpu" med_cpu = "median_cpu" ratio = "ratio" avg = "aver...
gpl-3.0
AIFDR/inasafe
safe/metadata/property/integer_property.py
6
1252
# -*- coding: utf-8 -*- """Integer property.""" from safe.common.exceptions import MetadataCastError from safe.metadata.property import BaseProperty __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "info@inasafe.org" __revision__ = '$Format:%H$' NoneType = type(None) ...
gpl-3.0
heidsoft/VirtualBox
src/VBox/Additions/common/crOpenGL/defs.py
12
10927
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightDef() # NOTE: if we need a LIBRARY statement, we would need to create a defs-x86.py to generate a .def file for VBoxOGL-x86 librar...
gpl-2.0
ChristianKniep/QNIB
serverfiles/usr/local/lib/networkx-1.6/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py
89
7721
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx from nose.plugins.attrib import attr from networkx import edge_current_flow_betweenness_centrality \ as edge_current_flow from networkx import approximate_current_flow_betweenness_centrality \ as approximate_cfbc class T...
gpl-2.0
curiosityio/taiga-docker
taiga-back/taiga-back/taiga/projects/tasks/serializers.py
2
4631
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can redistribute it and/or mo...
mit
jrha/aquilon
lib/python2.6/aquilon/worker/commands/change_status_cluster.py
2
2403
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013 Contributor # # 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 t...
apache-2.0
elijah513/ice
csharp/test/Ice/interceptor/run.py
3
1046
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
gpl-2.0
chippey/gaffer
python/GafferUI/ProgressBar.py
1
2624
########################################################################## # # Copyright (c) 2011-2012, Image Engine Design 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: # # * Redi...
bsd-3-clause
jonasjberg/autonameow
autonameow/vendor/prompt_toolkit/contrib/validators/base.py
20
1240
from __future__ import unicode_literals from prompt_toolkit.validation import Validator, ValidationError from six import string_types class SentenceValidator(Validator): """ Validate input only when it appears in this list of sentences. :param sentences: List of sentences. :param ignore_case: If True...
gpl-2.0
mcollins12321/anita
venv/lib/python2.7/site-packages/flask_wtf/i18n.py
117
1720
# coding: utf-8 """ flask_wtf.i18n ~~~~~~~~~~~~~~ Internationalization support for Flask WTF. :copyright: (c) 2013 by Hsiaoming Yang. """ from flask import _request_ctx_stack from flask_babel import get_locale from babel import support try: from wtforms.i18n import messages_path except ImportErro...
mit
esc/paramiko
paramiko/win_pageant.py
42
4210
# Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com> # Modified up by: Todd Whiteman <ToddW@ActiveState.com> # # This file is part of paramiko. # # Paramiko 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 # Softwa...
lgpl-2.1
ParticulateFlow/Palabos-PFM
scons/scons-local-2.1.0/SCons/compat/_scons_dbm.py
21
1801
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # 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 # with...
agpl-3.0
sadaf2605/django
django/contrib/auth/migrations/0001_initial.py
110
5133
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.auth.models from django.contrib.auth import validators from django.db import migrations, models from django.utils import six, timezone class Migration(migrations.Migration): dependencies = [ ('contenttypes', '__first__...
bsd-3-clause
likaiwalkman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
121
13709
# Copyright 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 f...
bsd-3-clause
jamessergeant/pylearn2
pylearn2/utils/image.py
39
18841
""" Utility functions for working with images. """ import logging import numpy as np plt = None axes = None from theano.compat.six.moves import xrange from theano.compat.six import string_types import warnings try: import matplotlib.pyplot as plt import matplotlib.axes except (RuntimeError, ImportError, TypeErr...
bsd-3-clause
JordanSilverman/TrainFinder
suds/options.py
17
6500
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will b...
bsd-3-clause
abtreece/ansible
test/units/module_utils/test_facts.py
24
24159
# 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 in the hope that ...
mit
rzambre/servo
tests/wpt/css-tests/tools/wptserve/wptserve/handlers.py
89
13047
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
mpl-2.0
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/startup/bl_ui/space_outliner.py
1
3646
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/setuptools/_vendor/packaging/requirements.py
65
4343
# 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 string import re from setuptools.extern.pyparsing import stringSta...
mit
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/crcmod/python2/crcmod/test.py
72
17011
#----------------------------------------------------------------------------- # Copyright (c) 2010 Raymond L. Buvel # Copyright (c) 2010 Craig McQueen # # 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 ...
bsd-3-clause
piersharding/python-sapnwrfc
sapnwrfc/tests/bugs.py
1
3180
""" Contains tests created to track down bugs """ import logging import os import sapnwrfc import unittest from copy import copy from sapnwrfc import RFCException log = logging.getLogger(__name__) class ConnectionProblemTestCase(unittest.TestCase): def setUp(self): logging.basicConfig(level=logging.DEBU...
lgpl-2.1
gramps-project/addons-source
LastChange/LastChangeGramplet.py
2
4174
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option)...
gpl-2.0
andersinno/suds-jurko
tests/test_xsd_builtins.py
7
28513
# -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify it under # the terms of the (LGPL) GNU Lesser General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distri...
lgpl-3.0
urandu/rethinkdb
test/rql_test/connections/http_support/werkzeug/testsuite/debug.py
146
7859
# -*- coding: utf-8 -*- """ werkzeug.testsuite.debug ~~~~~~~~~~~~~~~~~~~~~~~~ Tests some debug utilities. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest import sys import re from werkzeug.testsuite import WerkzeugTestCase from werkzeug.deb...
agpl-3.0
victorbriz/omim
data/benchmarks/cmd_results_viewer.py
53
2305
import math import sys f1 = open(sys.argv[2], "r") lns1 = f1.readlines() lns1 = [l.split(" ") for l in lns1] bench_cfg = {} for l in lns1: c_name = l[1] is_country = (len(l) == 3) bench_cfg[l[1]] = [] bench_cfg[l[1]].append(is_country) if len(l) > 0: if not is_country: bench...
apache-2.0
ankit01ojha/coala-bears
bears/vcs/git/GitCommitBear.py
3
14670
import nltk import re import shutil import os from urllib.parse import urlparse from coalib.bears.GlobalBear import GlobalBear from dependency_management.requirements.PipRequirement import PipRequirement from coala_utils.ContextManagers import change_directory from coalib.misc.Shell import run_shell_command from coali...
agpl-3.0
sniemi/SamPy
sandbox/src2/fiesta/guiupdate.py
1
20656
from Qwt5.anynumpy import * def updateExposure(form, fies, tcs): """ Update the guide errors """ form.timerLabel.setText(str(tcs['ut'])) # Update the Current Counts plot emc = form.ExposureMeterCur emc.x = concatenate((emc.x[1:], emc.x[:1]), 1) emc.counter = emc.counter + 1 ...
bsd-2-clause
yugangzhang/CHX_Pipelines
2017_1/manisen/night_temperatures.py
1
1533
def night_series(temperatures=[150,130,110,80,190,175],repeats=3): x0=1.37 xr=.02 yr=.03 for i in temperatures: # change temperature set_temperature(i) try: olog_client.log( 'Changed temperature to T='+ str(caget('XF:11IDB-ES{Env:01-Out:1}T-SP')-273.15)[:5]+'C') except: pass print('changed temperatur...
bsd-3-clause
untom/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
atsao72/sympy
sympy/functions/special/polynomials.py
60
39742
""" This module mainly implements special orthogonal polynomials. See also functions.combinatorial.numbers which contains some combinatorial polynomials. """ from __future__ import print_function, division from sympy.core.singleton import S from sympy.core import Rational from sympy.core.function import Function, A...
bsd-3-clause
dracos/QGIS
python/ext-libs/pygments/styles/autumn.py
364
2144
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
gpl-2.0
apophys/freeipa
ipaserver/plugins/idrange.py
1
30898
# Authors: # Sumit Bose <sbose@redhat.com> # # Copyright (C) 2012 Red Hat # see file 'COPYING' for use and warranty information # # 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 vers...
gpl-3.0
eddwinn/Flask-User-0.6.1
flask_user/translations.py
2
2919
""" This file contains functions to translate strings for Flask-User. :copyright: (c) 2013 by Ling Thio :author: Ling Thio (ling.thio@gmail.com) :license: Simplified BSD License, see LICENSE.txt for more details.""" from flask import _request_ctx_stack, current_app # To avoid requiring the Flask-Babel, B...
bsd-2-clause
lsqtongxin/django
tests/template_tests/syntax_tests/test_cache.py
299
6777
from django.core.cache import cache from django.template import Context, Engine, TemplateSyntaxError from django.test import SimpleTestCase, override_settings from ..utils import setup class CacheTagTests(SimpleTestCase): libraries = { 'cache': 'django.templatetags.cache', 'custom': 'template_tes...
bsd-3-clause
G-P-S/depot_tools
third_party/boto/ses/connection.py
56
21582
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Harry Marr http://hmarr.com/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # wit...
bsd-3-clause
svn2github/django
tests/regressiontests/comment_tests/tests/comment_form_tests.py
97
3007
from __future__ import absolute_import import time from django.conf import settings from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment from . import CommentTestCase from ..models import Article class CommentFormTests(CommentTestCase): def testInit(self): ...
bsd-3-clause
sfstpala/Victory-Chat
cherrypy/wsgiserver/ssl_builtin.py
99
3218
"""A library for integrating Python's builtin ``ssl`` library with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ try: import ssl except ImportError: ssl = None try: from _pyio imp...
isc
Bismarrck/tensorflow
tensorflow/python/training/learning_rate_decay_v2.py
6
38287
# 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
leonardocsantoss/ehventos
lib/reportlab/lib/boxstuff.py
14
2083
#Copyright ReportLab Europe Ltd. 2000-2006 #see license.txt for license details __version__=''' $Id: boxstuff.py 3408 2009-01-28 12:25:33Z rptlab $ ''' __doc__='''Utility functions to position and resize boxes within boxes''' def aspectRatioFix(preserve,anchor,x,y,width,height,imWidth,imHeight): """This function h...
gpl-2.0
AlexisEidelman/Til
til/utilisations/Compar_Destinie_Patrimoine/run.py
2
4828
# -*- coding:utf-8 -*- ''' Ce programme compare la base Destinie et la base générée directement à partir de l'enquête patrimoine. Les tables issues de Destinie et de Patrimoine doivent déjà avoir été créées - data//data//Destinie//Patrimoine.py et data//data//Destinie//Destinie.py Pour Patrimoine, ça ne sert...
gpl-3.0
sorenk/ansible
contrib/inventory/nagios_livestatus.py
43
6737
#!/usr/bin/env python # (c) 2015, Yannig Perre <yannig.perre@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 ...
gpl-3.0
Spiderlover/Toontown
toontown/coghq/PlatformEntity.py
5
1933
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from otp.level import BasicEntities import MovingPlatform class PlatformEntity(BasicEntities.NodePathEntity): def __init__(self, level, entId): BasicEntities.NodePathEntity.__init__(self, level, entId) self.start() ...
mit
CMSS-BCRDB/RDSV1.0
trove/tests/api/datastores.py
4
7584
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
sadaf2605/django
django/core/management/commands/check.py
115
2377
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.core import checks from django.core.checks.registry import registry from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = "Checks the entire Django project for p...
bsd-3-clause
vpramo/contrail-controller
src/nodemgr/vrouter_nodemgr/loadbalancer_stats.py
8
2689
import os import sys from haproxy_stats import HaproxyStats from vrouter.loadbalancer.ttypes import \ UveLoadbalancerTrace, UveLoadbalancer, UveLoadbalancerStats LB_BASE_DIR = '/var/lib/contrail/loadbalancer/' class LoadbalancerStats(object): def __init__(self): self.driver = HaproxyStats() t...
apache-2.0
nikgr95/scrapy
scrapy/commands/check.py
30
3420
from __future__ import print_function import time import sys from collections import defaultdict from unittest import TextTestRunner, TextTestResult as _TextTestResult from scrapy.commands import ScrapyCommand from scrapy.contracts import ContractsManager from scrapy.utils.misc import load_object from scrapy.utils.con...
bsd-3-clause
kingvuplus/italysat-enigma2
lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py
67
8753
from boxbranding import getImageVersion from enigma import eConsoleAppContainer, eEnv from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.Console import Console from Components.ActionMap import ActionMap from Components.Sources.StaticText import StaticText from Components.FileList...
gpl-2.0
esc/paramiko
paramiko/file.py
36
18087
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 (a...
lgpl-2.1
arthurljones/bikechurch-signin-python
__main__.py
1
1578
#!/usr/bin/python # -*- coding: utf-8 -*- import wx, datetime from src.csvImport import ReadMembersFromCSV from src.db import CreateTablesFromScratch from src.main_window import MainWindow from src.controller import GetController, ResetController from warnings import warn version = (0, 1, 0) #TODO: Fix shoptime edit...
bsd-3-clause
gdikov/MNIST_Challenge
models/nn/layers/pooling.py
1
3056
import numpy as np from models.nn.layers.layer import AbstractLayer import models.nn.config as cfg class Pool(AbstractLayer): def __init__(self, incoming, pool_params=None): super(Pool, self).__init__(incoming) self.cache = dict() if pool_params is None: self.pool_params = cfg...
mit
srimai/odoo
addons/l10n_co/__init__.py
313
1180
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Iva...
agpl-3.0
dfalt974/SickRage
lib/guessit/rules/properties/bonus.py
34
1523
#!/usr/bin/env python # -*- coding: utf-8 -*- """ bonus property """ from rebulk.remodule import re from rebulk import Rebulk, AppendMatch, Rule from .title import TitleFromPosition from ..common.formatters import cleanup from ..common.validators import seps_surround def bonus(): """ Builder for rebulk obje...
gpl-3.0
GoodgameStudios/crossbar
crossbar/router/broker.py
1
18847
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
agpl-3.0
jhnnsnk/UP-Tasks
NEST/neuron_noise_task/neuron_noise_task.py
3
2406
#! /usr/bin/env python import nest import nest.voltage_trace import pylab from active_worker.task import task @task def neuron_noise_task(): ''' Task Manifest Version: 1 Full Name: neuron_noise_task Caption: One neuron with noise Author: nest-initiative.org Description: | ...
gpl-2.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_copy.py
77
22430
"""Unit tests for the copy module.""" import copy import copyreg import weakref import abc from operator import le, lt, ge, gt, eq, ne import unittest from test import support order_comparisons = le, lt, ge, gt equality_comparisons = eq, ne comparisons = order_comparisons + equality_comparisons class TestCopy(unitt...
gpl-2.0
nnethercote/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_pdb.py
30
21116
from __future__ import absolute_import, division, print_function import sys import platform import os import _pytest._code from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN import pytest _ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "") def runpdb_and_get_report(testdir, source): p = t...
mpl-2.0
flh/odoo
addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py
112
14182
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c): # # 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de) # 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be) # # This program is free software: you can redistribute it and/or ...
agpl-3.0
xianghuzhao/VMDIRAC
VMDIRAC/Resources/Cloud/CloudEndpoint.py
2
16638
########################################################### # $HeadURL$ # File: CloudEndpoint.py # Original author: Victor Mendez # Modified: A.T. ########################################################### """ CloudEndpoint is a base class for the clients used to connect to different cloud providers """ __RCSI...
gpl-3.0
boto/botocore
tests/unit/retries/test_standard.py
2
26658
from tests import unittest import mock from nose.tools import assert_equal, assert_is_instance from botocore.retries import standard from botocore.retries import quota from botocore import model from botocore.awsrequest import AWSResponse from botocore.exceptions import HTTPClientError, ConnectionError from botocore....
apache-2.0
varunagrawal/azure-services
varunagrawal/VarunWeb/env/Lib/site-packages/django/db/backends/mysql/introspection.py
113
5245
import re from .base import FIELD_TYPE from django.db.backends import BaseDatabaseIntrospection, FieldInfo from django.utils.encoding import force_text foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseIntrospect...
gpl-2.0
saurabh6790/medsynaptic-lib
webnotes/widgets/page.py
34
1572
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes import webnotes.model.doc import webnotes.model.code @webnotes.whitelist() def get(name): """ Return the :term:`doclist` of the `Page` specified by `name...
mit
TurboTurtle/sos
sos/report/plugins/nfsganesha.py
4
1244
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
gpl-2.0
double-y/django
tests/http_utils/tests.py
304
2247
from __future__ import unicode_literals import gzip import io from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.http.utils import conditional_content_removal from django.test import SimpleTestCase # based on Python 3.3's gzip.compress def gzip_compress(data): buf = io.BytesIO(...
bsd-3-clause
ericholscher/django
tests/view_tests/generic_urls.py
4
2232
# -*- coding:utf-8 -*- from __future__ import unicode_literals from django.conf.urls import patterns, url from django.views.generic import RedirectView from . import views from .models import Article, DateArticle, UrlArticle date_based_info_dict = { 'queryset': Article.objects.all(), 'date_field': 'date_cre...
bsd-3-clause