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
vladikr/nova_drafts
nova/cells/scheduler.py
15
11256
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
zeurocoin-dev/zeurocoin
qa/rpc-tests/getblocktemplate_proposals.py
151
6294
#!/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. from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCExce...
mit
Abhinav117/pymtl
pymtl/tools/translation/verilog.py
7
3544
#======================================================================= # verilog.py #======================================================================= from __future__ import print_function import sys import collections import tempfile from subprocess import check_output, STDOUT, CalledProcessError fr...
bsd-3-clause
jquacinella/IS607_Project
PyDTA/StataTools.py
2
6749
from struct import unpack, calcsize from StataTypes import MissingValue, Variable class Reader(object): """.dta file reader""" _header = {} _data_location = 0 _col_sizes = () _has_string_data = False _missing_values = False TYPE_MAP = range(251)+list('bhlfd') MISSING_VALUES = { 'b': (...
gpl-2.0
EducationalTestingService/discourse-parsing
tests/test_discourseparsing.py
1
3613
import json from pathlib import Path from nltk.tree import ParentedTree from nose import SkipTest from nose.tools import eq_ from rstfinder.discourse_parsing import Parser from rstfinder.extract_actions_from_trees import extract_parse_actions MY_DIR = Path(__file__).parent def test_extract_parse_actions(): """C...
mit
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/services/longpoll/adapters/tests/test_storm.py
1
5979
# Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Long-poll event adapter tests.""" __metaclass__ = type from lazr.lifecycle.event import ( ObjectCreatedEvent, ObjectDeletedEvent, ObjectModifiedEvent, ) from s...
agpl-3.0
lneves/FrameworkBenchmarks
frameworks/Python/api_hour/yocto_http/hello/endpoints/world.py
24
1205
import logging import asyncio import ujson from ..services import queries_number from ..services.world import get_random_record, get_random_records, update_random_records, get_fortunes LOG = logging.getLogger(__name__) @asyncio.coroutine def db(request): """Test type 2: Single database query""" container = r...
bsd-3-clause
e-q/scipy
benchmarks/benchmarks/peak_finding.py
8
1520
"""Benchmarks for peak finding related functions.""" try: from scipy.signal import find_peaks, peak_prominences, peak_widths from scipy.misc import electrocardiogram except ImportError: pass from .common import Benchmark class FindPeaks(Benchmark): """Benchmark `scipy.signal.find_peaks`. Notes ...
bsd-3-clause
alcemirfernandes/irobotgame
lib/pyglet/window/__init__.py
2
59143
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
gpl-3.0
google/eclipse2017
scripts/update_user_role.py
1
2497
# # Copyright 2016 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 law or agreed to in writing...
apache-2.0
eoinmurray/icarus
Experiments/power_dep.py
1
1341
import os,sys parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0,parentdir) import numpy as np import matplotlib.pyplot as plt from constants import Constants import Icarus.Experiment as Experiment if __name__ == "__main__": """ Runs power dependance. """ constants = ...
mit
keen99/SickRage
lib/chardet/chardistribution.py
53
9560
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
masterkeywikz/seq2graph
src/theanets-0.6.1/theanets/recurrent.py
1
21139
# -*- coding: utf-8 -*- '''This module contains recurrent network structures.''' import collections import numpy as np import re import sys import theano.tensor as TT import theano import pdb from . import feedforward def batches(samples, labels=None, steps=100, batch_size=64, rng=None): '''Return a callable t...
mit
elky/django
tests/forms_tests/widget_tests/test_nullbooleanselect.py
80
2067
from django.forms import NullBooleanSelect from django.test import override_settings from django.utils import translation from .base import WidgetTest class NullBooleanSelectTest(WidgetTest): widget = NullBooleanSelect() def test_render_true(self): self.check_html(self.widget, 'is_cool', True, html=...
bsd-3-clause
marcinkwiatkowski/buck
third-party/py/unittest2/unittest2/test/test_runner.py
122
4644
import pickle from cStringIO import StringIO from unittest2.test.support import LoggingResult, OldTestResult import unittest2 class Test_TextTestRunner(unittest2.TestCase): """Tests for TextTestRunner.""" def test_init(self): runner = unittest2.TextTestRunner() self.assertFalse(runner.failf...
apache-2.0
Cerberus98/quark
quark/cache/security_groups_client.py
4
8244
# Copyright 2014 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 requ...
apache-2.0
arcean/pyopenssl
doc/tools/sgmlconv/latex2esis.py
37
19704
#! /usr/bin/env python """Generate ESIS events based on a LaTeX source document and configuration data. The conversion is not strong enough to work with arbitrary LaTeX documents; it has only been designed to work with the highly stylized markup used in the standard Python documentation. A lot of information about s...
lgpl-2.1
KNMI/VERCE
scigateway-api/src/scigateway_services/wfs_input_generator/backends/write_SPECFEM3D_CARTESIAN_202_DEV.py
2
7881
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Input file writer for SPECFEM3D_CARTESIAN. :copyright: Emanuele Casarotti (emanuele.casarotti@ingv.it), 2013 Lion Krischer (krischer@geophysik.uni-muenchen.de), 2013 :license: GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) ...
mit
jeffhammond/spaghetty
branches/old/python/fettucini/fettucini.py
2
12491
import fileinput import string import sys import os import commands fortran_compiler = 'ifort' fortran_opt_flags = '-O3 -mtune=core2 -msse3 -align -c' fortran_link_flags = '-O0' src_dir = '/home/jeff/code/spaghetty/trunk/python/fettucini/src/' exe_dir = '/home/jeff/code/spaghetty/trunk/python/fettucini/exe/' log_dir =...
bsd-2-clause
redwards510/shadowsocks
shadowsocks/crypto/util.py
1032
4287
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
40223143/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/sys.py
408
4998
# hack to return special attributes from _sys import * from javascript import JSObject has_local_storage=__BRYTHON__.has_local_storage has_session_storage = __BRYTHON__.has_session_storage has_json=__BRYTHON__.has_json brython_debug_mode = __BRYTHON__.debug argv = ['__main__'] base_exec_prefix = __BRYTHON__.brython_...
gpl-3.0
bremoran/repo_reorg
repo_reorg.py
1
14503
#!/usr/bin/python # PackageLicenseDeclared: Apache-2.0 # Copyright 2015 ARM Holdings PLC import argparse as ap import sys import os.path import subprocess import shutil import stat import re #Inputs: #Source remote #Destination remote #Repo name #List of paths in form: source-path:destination-path moduleJsonTemplate =...
apache-2.0
plone/plone.server
src/plone.server/plone/server/exceptions.py
1
1405
class NoPermissionToAdd(Exception): def __init__(self, container, content_type): self.container = container self.content_type = content_type def __repr__(self): return "Not permission to add {content_type} on {path}".format( content_type=self.content_type, path...
bsd-2-clause
interrogator/topic-grammar
bus.py
1
18839
#!/usr/bin/python def nextbus(where = 'guess', nbus = 5, walking_time = 3): """ tells you when the next bus is from home or to uni where: 'h'/'u'/'guess': home, uni, or try to guess based on wifi connection name walking_time: don't show buses less than n mins from now nbus: show next n buses ...
mit
KellyChan/python-examples
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/template/loaders/filesystem.py
90
1941
""" Wrapper for loading templates from the filesystem. """ from django.conf import settings from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.utils._os import safe_join class Loader(BaseLoader): is_usable = True def get_template_sources(self, temp...
mit
jeffchao/xen-3.3-tcg
dist/install/usr/lib/python/xen/sv/Main.py
46
2777
from xen.sv.NodeInfo import NodeInfo from xen.sv.DomInfo import DomInfo from xen.sv.CreateDomain import CreateDomain from xen.sv.RestoreDomain import RestoreDomain from xen.sv.util import getVar # adapter to make this all work with mod_python # as opposed to Twisted # (c) Tom Wilkie 2005 class Args: def __init...
gpl-2.0
ccxt/ccxt
python/ccxt/async_support/coinfalcon.py
1
15969
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import math from ccxt.base.errors import ExchangeError from ccxt.base.errors import A...
mit
jobiols/odoomrp-wip
purchase_requisition_full_bid_order_generator/models/bids.py
25
1062
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, api class PurchaseRequisitio...
agpl-3.0
aitoralmeida/c4a_data_repository
RestApiInterface/src/packORM/PasswordHash.py
2
2482
# -*- coding: utf-8 -*- """ This is an implementation of Bcrypt to encrypt all passwords in database. It is very recommended to create new passwords with 12 or more rounds. Use new method to set new password. Use __eq__ to compare if the password given is correct. """ import bcrypt from sqlalchemy.ext.mutable impo...
gpl-3.0
openai/baselines
baselines/results_plotter.py
1
3455
import numpy as np import matplotlib matplotlib.use('TkAgg') # Can change to 'Agg' for non-interactive mode import matplotlib.pyplot as plt plt.rcParams['svg.fonttype'] = 'none' from baselines.common import plot_util X_TIMESTEPS = 'timesteps' X_EPISODES = 'episodes' X_WALLTIME = 'walltime_hrs' Y_REWARD = 'reward' Y_...
mit
gojira/tensorflow
tensorflow/python/profiler/tfprof_logger.py
27
8030
# 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
v-iam/azure-sdk-for-python
azure-keyvault/azure/keyvault/models/sas_definition_create_parameters.py
4
1547
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
supersven/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/db/models/fields.py
400
11157
from django.db.models.fields import Field from django.db.models.sql.expressions import SQLEvaluator from django.utils.translation import ugettext_lazy as _ from django.contrib.gis import forms from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.geometry.backend import Geometry, Geometry...
apache-2.0
habibmasuro/kivy
examples/canvas/fbo_canvas.py
59
2544
''' FBO Canvas ========== This demonstrates a layout using an FBO (Frame Buffer Off-screen) instead of a plain canvas. You should see a black canvas with a button labelled 'FBO' in the bottom left corner. Clicking it animates the button moving right to left. ''' __all__ = ('FboFloatLayout', ) from kivy.graphics impo...
mit
caisq/tensorflow
tensorflow/contrib/distribute/python/single_loss_example.py
12
4466
# Copyright 2018 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
timhughes/gnome15
src/plugins/impulse15/impulse15.py
6
16916
# Gnome15 - Suite of tools for the Logitech G series keyboards and headsets # Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.uk> # # 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, e...
gpl-3.0
cpsaltis/pythogram-core
src/gramcore/features/descriptors.py
1
3013
"""Feature descriptors usefull in bag of features approaches. These are applied to numpy.arrays representing images. """ import numpy from skimage import feature def hog(parameters): """Extracts histograms of oriented gradients. It wraps `skimage.feature.hog`. The `visualise` and `normalise` options ar...
mit
TheTypoMaster/ghost
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
bl4ckdu5t/registron
PyInstaller/depend/modules.py
10
4668
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
mit
alexanderturner/ansible
test/units/executor/test_playbook_executor.py
60
6304
# (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
apple/swift-lldb
packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
9
4125
""" Test the iteration protocol for frame registers. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class RegistersIteratorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) ...
apache-2.0
eviljeff/app-validator
tests/js/test_traversal.py
6
1900
from js_helper import TestCase class TestFunctionTraversal(TestCase): """ Consider the following tree: - body |-function a() | |- foo | |- bar |-zip |-function b() | |-abc | |-def |-zap In the old traversal technique, it would be evaluated in the order...
bsd-3-clause
aaugustin/myks-gallery
gallery/test_storages.py
1
2603
import io from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import FileSystemStorage, Storage from django.test import TestCase from django.test.utils import override_settings from .storages import get_storage class MemoryStorage(Storage): """ Limited implementation of an...
bsd-3-clause
zeptonaut/catapult
third_party/mapreduce/mapreduce/control.py
45
4559
#!/usr/bin/env python # # Copyright 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 law o...
bsd-3-clause
cole945/nds32-gdb
gdb/contrib/cleanup_check.py
20
13262
# Copyright 2013 Free Software Foundation, Inc. # # This is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program i...
gpl-2.0
dpressel/baseline
api-examples/transformer_seq2seq_response.py
1
6773
import numpy as np import torch import logging from eight_mile.utils import listify import os import glob from argparse import ArgumentParser import baseline from transformer_utils import TiedEmbeddingsSeq2SeqModel, find_latest_checkpoint from eight_mile.pytorch.serialize import load_transformer_seq2seq_npz from eight_...
apache-2.0
kirca/odoo
addons/website_mail/models/mail_message.py
13
4596
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
zclfly/gensim
gensim/test/test_similarities.py
45
12909
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for similarity algorithms (the similarities package). """ import logging import unittest import os import tempfile...
gpl-3.0
CaHudson94/data-structures
src/working/test_radix.py
1
1181
"""Testing for inesrt sort.""" from radix_sort import radix import pytest from random import randint TEST_PARAMS = [ ([i for i in range(50)]), ([randint(1, 500) for i in range(50)]), ([5, 9, 1, 2, 6]) ] PARAMS_TABLE = [ ([234, 23, 52, 66], [23, 52, 66, 234]), ([4, 3, 2, 1], [1, 2, 3, 4]), ([...
mit
balloob/home-assistant
homeassistant/components/ozw/services.py
14
5169
"""Methods and classes related to executing Z-Wave commands and publishing these to hass.""" import logging from openzwavemqtt.const import ATTR_LABEL, ATTR_POSITION, ATTR_VALUE from openzwavemqtt.util.node import get_node_from_manager, set_config_parameter import voluptuous as vol from homeassistant.core import call...
apache-2.0
hatwar/focal-erpnext
erpnext/utilities/doctype/contact/contact.py
36
2444
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, extract_email_id from erpnext.controllers.status_updater import StatusUpdater class Contact(StatusUpda...
agpl-3.0
Medigate/cutiuta-server
cutiuta-server/env/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
gpl-3.0
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/scipy/linalg/_decomp_polar.py
30
3623
from __future__ import division, print_function, absolute_import import numpy as np from scipy.linalg import svd __all__ = ['polar'] def polar(a, side="right"): """ Compute the polar decomposition. Returns the factors of the polar decomposition [1]_ `u` and `p` such that ``a = up`` (if `side` is "...
gpl-2.0
meteorcloudy/tensorflow
tensorflow/contrib/kfac/examples/tests/convnet_test.py
14
6264
# 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
dato-code/SFrame
oss_src/unity/python/sframe/connect/main.py
5
4999
""" This module contains the main logic for start, query, stop graphlab server client connection. """ ''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' from ..cython.cy_unity import UnityGlobalProxy...
bsd-3-clause
sentinelleader/python-etcd
src/etcd/tests/integration/helpers.py
9
6325
import shutil import subprocess import tempfile import logging import time import hashlib import uuid from OpenSSL import crypto class EtcdProcessHelper(object): def __init__( self, base_directory, proc_name='etcd', port_range_start=4001, internal_port...
mit
timabbott/zulip
zerver/management/commands/merge_streams.py
3
3480
from argparse import ArgumentParser from typing import Any, List from zerver.lib.actions import ( bulk_add_subscriptions, bulk_remove_subscriptions, do_deactivate_stream, ) from zerver.lib.cache import cache_delete_many, to_dict_cache_key_id from zerver.lib.management import ZulipBaseCommand from zerver.mo...
apache-2.0
johndpope/tensorflow
tensorflow/contrib/seq2seq/python/kernel_tests/decoder_test.py
14
6979
# 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
tangram/three.js
utils/converters/msgpack/json2msgpack.py
331
1366
#!/usr/bin/env python __doc__ = ''' Convert a json file to msgpack. If fed only an input file the converted will write out a .pack file of the same base name in the same directory $ json2msgpack.py -i foo.json foo.json > foo.pack Specify an output file path $ json2msgpack.py -i foo.json -o /bar/tmp/bar.pack foo.json...
mit
ronie/script.cu.lrclyrics
resources/lib/scrapertest.py
1
7586
#-*- coding: UTF-8 -*- import time from utilities import * from culrcscrapers.alsong import lyricsScraper as lyricsScraper_alsong from culrcscrapers.azlyrics import lyricsScraper as lyricsScraper_azlyrics from culrcscrapers.baidu import lyricsScraper as lyricsScraper_baidu from culrcscrapers.darklyrics import lyricsScr...
gpl-2.0
jiangzhixiao/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
shruthiag96/ns3-dev-vns
src/aodv/bindings/modulegen__gcc_LP64.py
2
516943
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
sbuss/voteswap
lib/django/db/backends/mysql/schema.py
173
4853
from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import NOT_PROVIDED class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" sql_alter_column_...
mit
rvanlaar/tactic-client
examples/query.py
10
1381
########################################################### # # Copyright (c) 2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/IPython/lib/editorhooks.py
2
3995
""" 'editor' hooks for common editors that work well with ipython They should honor the line number argument, at least. Contributions are *very* welcome. """ import os import pipes import shlex import subprocess import sys from IPython import get_ipython from IPython.core.error import TryNext from IPython.utils imp...
bsd-2-clause
amisrs/one-eighty
venv2/lib/python2.7/site-packages/sqlalchemy/engine/default.py
23
39522
# engine/default.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 """Default implementations of per-dialect sqlalchemy.engine classes. These are se...
mit
dparshin/phantomjs
src/qt/qtwebkit/Tools/TestResultServer/handlers/testfilehandler.py
126
10681
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
jrmontag/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
ExamplesFromChapters/Chapter3/ClusteringWithGaussians.py
90
1034
import numpy as np import pymc as pm data = np.loadtxt("../../Chapter3_MCMC/data/mixture_data.csv", delimiter=",") p = pm.Uniform("p", 0, 1) assignment = pm.Categorical("assignment", [p, 1 - p], size=data.shape[0]) taus = 1.0 / pm.Uniform("stds", 0, 100, size=2) ** 2 # notice the size! centers = pm.Normal("cent...
mit
yglazko/socorro
webapp-django/crashstats/symbols/utils.py
13
2028
import zipfile import gzip import tarfile from cStringIO import StringIO class _ZipMember(object): def __init__(self, member, container): self.name = member.filename self.size = member.file_size self.container = container def extractor(self): return self.container.open(self.n...
mpl-2.0
emgirardin/compassion-modules
sbc_compassion/tests/test_tools.py
1
5172
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __openerp__.p...
agpl-3.0
psiegl/seismic-rtm
tools/bench.py
1
1887
# Copyright 2017 - , Dr.-Ing. Patrick Siegl # SPDX-License-Identifier: BSD-2-Clause #!/usr/bin/python import subprocess import sys import operator import multiprocessing import re kernel = "seismic-rtm.elf" def bench( kernel, iterations, variants ): res = {} g_cmd = "./%s --timesteps=4000 --width=2000 --height=...
bsd-2-clause
loqoman/tgstation
tools/midi2piano/pyperclip/windows.py
110
5405
""" This module implements clipboard handling on Windows using ctypes. """ import time import contextlib import ctypes from ctypes import c_size_t, sizeof, c_wchar_p, get_errno, c_wchar from .exceptions import PyperclipWindowsException class CheckedCall(object): def __init__(self, f): super(CheckedCall, s...
agpl-3.0
iglocska/PyMISP
tests/test_offline.py
1
11333
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import requests_mock import json import os import pymisp as pm from pymisp import PyMISP # from pymisp import NewEventError from pymisp import MISPEvent from pymisp import EncodeUpdate from pymisp import EncodeFull @requests_mock.Mocker() class TestOffli...
bsd-2-clause
ravello/ansible
lib/ansible/module_utils/facts.py
2
119106
# (c) 2012, 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) any lat...
gpl-3.0
acmihal/Cinnamon
files/usr/lib/cinnamon-looking-glass/page_results.py
21
2228
from pageutils import * from gi.repository import Gio, Gtk, GObject, Gdk, Pango, GLib class ModulePage(BaseListView): def __init__(self, parent): store = Gtk.ListStore(int, str, str, str, str) BaseListView.__init__(self, store) self.parent = parent self.adjust = self.get_vadjustmen...
gpl-2.0
betoesquivel/fil2014
build/django/django/contrib/gis/geos/prototypes/__init__.py
314
1305
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs, cs_clone, cs_getordinate, cs_setordinate, cs...
mit
szhem/spark
python/pyspark/streaming/listener.py
75
2333
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
jjmleiro/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/reader/iter_worksheet.py
61
12390
# file openpyxl/reader/iter_worksheet.py # Copyright (c) 2010 openpyxl # # 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 #...
apache-2.0
chinmaygarde/mojo
sky/tools/webkitpy/common/system/workspace.py
189
3391
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
sparbz/nba-stats
nba_stats/nba_stats/settings/base.py
1
2016
""" Django settings for nba_stats project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ from unipath import Path import dj_database_url PROJECT_DIR = Path(__fi...
mit
Sixshaman/networkx
doc/make_gallery.py
35
2453
""" Generate a thumbnail gallery of examples. """ from __future__ import print_function import os, glob, re, shutil, sys import matplotlib matplotlib.use("Agg") import matplotlib.pyplot import matplotlib.image from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCa...
bsd-3-clause
jaywreddy/django
tests/auth_tests/urls.py
80
4661
from django.conf.urls import url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns as auth_urlpatterns from django.contrib.messages.api...
bsd-3-clause
carsongee/edx-platform
common/test/acceptance/tests/test_studio_split_test.py
2
33168
""" Acceptance tests for Studio related to the split_test module. """ import json import os import math from unittest import skip, skipUnless from nose.plugins.attrib import attr from xmodule.partitions.partitions import Group, UserPartition from bok_choy.promise import Promise, EmptyPromise from ..fixtures.course i...
agpl-3.0
frouty/odoogoeen
addons/account/wizard/account_reconcile.py
47
7395
# -*- 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
heran7/edx-platform
common/lib/xmodule/xmodule/tests/test_randomize_module.py
108
1397
import unittest from .test_course_module import DummySystem as DummyImportSystem ORG = 'test_org' COURSE = 'test_course' START = '2013-01-01T01:00:00' class RandomizeModuleTestCase(unittest.TestCase): """Make sure the randomize module works""" @staticmethod def get_dummy_course(start): """Get a...
agpl-3.0
abhaystoic/barati
barati/customers/views_cluster/save_card_preferences.py
1
3997
from django.shortcuts import render from django.template import RequestContext from django.views.generic import View from django.http import HttpResponse from customers import models as m import sys, json from datetime import datetime,timedelta class Save_Card_Preferences(View): try: def __init__(self): ...
apache-2.0
migueldiascosta/pymatgen
pymatgen/io/tests/test_cssr.py
11
1887
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals ''' Created on Jan 24, 2012 ''' __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "S...
mit
hainm/scikit-learn
examples/cluster/plot_kmeans_assumptions.py
270
2040
""" ==================================== Demonstration of k-means assumptions ==================================== This example is meant to illustrate situations where k-means will produce unintuitive and possibly unexpected clusters. In the first three plots, the input data does not conform to some implicit assumptio...
bsd-3-clause
Burus/fats
fats/test/test_service.py
1
1710
# Copyright (c) 2006-2008 Alexander Burtsev # See LICENSE for details """FATS service tests. @author: U{Alexander Burtsev<mailto:eburus@gmail.com>} $Id: test_service.py 24 2008-02-18 12:22:42Z burus $ """ #from twisted.fats.errors import AGICommandFailure, UndefinedTimeFormat, \ # AGICommandTimeout, FailureOnOp...
mit
SIFTeam/enigma2
lib/python/Screens/MinuteInput.py
33
1582
from Screen import Screen from Components.ActionMap import NumberActionMap from Components.Input import Input class MinuteInput(Screen): def __init__(self, session, basemins = 5): Screen.__init__(self, session) self["minutes"] = Input(str(basemins), type=Input.NUMBER) self["actions"] = NumberActi...
gpl-2.0
acshan/odoo
addons/edi/models/res_company.py
437
3186
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
cvandeplas/plaso
plaso/formatters/xchatlog.py
1
1057
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
apache-2.0
ludwiktrammer/odoo
addons/base_action_rule/base_action_rule.py
10
21424
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from collections import defaultdict from datetime import datetime from dateutil.relativedelta import relativedelta import datetime as DT import dateutil import time import logging import openerp from openerp import SUPE...
agpl-3.0
EricCline/CEM_inc
env/lib/python2.7/site-packages/IPython/external/ssh/tunnel.py
2
12338
"""Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections. Authors ------- * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full...
mit
CompMusic/essentia
test/src/unittest/filters/test_highpass.py
10
1619
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
agpl-3.0
cacraig/grib-inventory
gribinventory/base.py
1
9103
from __future__ import absolute_import import sys if (sys.version_info > (3, 0)): # Python 3 code in this block import urllib.request as urllib2 else: # Python 2 code in this block import urllib2 import socket, threading, os ''''' Handles downloading subsets of grib2 files. With this class you can do a once ...
mit
pcmoritz/ray-1
python/ray/serialization.py
3
2703
from __future__ import absolute_import from __future__ import division from __future__ import print_function class RayNotDictionarySerializable(Exception): pass # This exception is used to represent situations where cloudpickle fails to # pickle an object (cloudpickle can fail in many different ways). class Clo...
apache-2.0
jdecuyper/hyper
test/test_abstraction.py
2
3246
# -*- coding: utf-8 -*- import hyper.common.connection from hyper.common.connection import HTTPConnection from hyper.common.exceptions import TLSUpgrade, HTTPUpgrade class TestHTTPConnection(object): def test_h1_kwargs(self): c = HTTPConnection( 'test', 443, secure=False, window_manager=True, ...
mit
GeorgiaTechMSSE/ReliableMD
python/examples/pizza/pdbfile.py
85
9342
# Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html # Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories # # Copyright (2005) Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains # certain rights in this software. This software is...
gpl-3.0
calancha/DIRAC
Core/DISET/private/ServiceConfiguration.py
11
3619
# $HeadURL$ __RCSID__ = "$Id$" from DIRAC.Core.Utilities import Network, List from DIRAC.ConfigurationSystem.Client.ConfigurationData import gConfigurationData from DIRAC.ConfigurationSystem.Client import PathFinder from DIRAC.Core.DISET.private.Protocols import gDefaultProtocol class ServiceConfiguration: def __i...
gpl-3.0