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
matthijsvk/TCDTIMITprocessing
countNbPhonemes.py
1
3751
# MIT License # # Copyright (c) 2016 matthijs van keirsbilck # # 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 # to use, copy, mod...
gpl-3.0
dstiert/Wox
PythonHome/Lib/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py
355
6215
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None ...
mit
seewindcn/tortoisehg
src/hgext/largefiles/basestore.py
1
8109
# Copyright 2009-2010 Gregory P. Ward # Copyright 2009-2010 Intelerad Medical Systems Incorporated # Copyright 2010-2011 Fog Creek Software # Copyright 2010-2011 Unity Technologies # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '...
gpl-2.0
tensorflow/graphics
tensorflow_graphics/projects/points_to_3Dobjects/models/singleobjectmodel.py
1
7978
# Copyright 2020 The TensorFlow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
rossant/phy
phy/utils/cli.py
2
3775
# -*- coding: utf-8 -*- # flake8: noqa """CLI tool.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import logging import os import os.path as op import sys from traceback import format_excep...
bsd-3-clause
kisel/trex-core
scripts/external_libs/nose-1.3.4/python3/nose/case.py
11
13224
"""nose unittest.TestCase subclasses. It is not necessary to subclass these classes when writing tests; they are used internally by nose.loader.TestLoader to create test cases from test functions and methods in test classes. """ import logging import sys import unittest from inspect import isfunction from nose.config i...
apache-2.0
saurabh6790/test-med-app
stock/report/item_prices/item_prices.py
14
4349
# 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 webnotes from webnotes.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns(filters) item_map ...
agpl-3.0
rpavlik/rp-mt-scripts
rp-mt-scripts-graphical.py
1
2951
#! /usr/bin/env python """Main module to create GTK interface to the MT scripts.""" # Copyright (c) 2009 Ryan Pavlik <ryan.pavlik@snc.edu> # See COPYING.txt for license terms import os.path import gtk import gobject import subprocess class ScriptsWindow: """Class to manage the demo window for the pile manager.""" ...
mit
gomiero/PTVS
Python/Tests/TestData/DebuggerProject/UnhandledException1_v25.py
18
1621
try: raise Exception() # does not break except: print('handled 1') try: raise Exception() # does not break except Exception: print('handled 2') try: raise Exception() # does not break except Exception, e: print('handled 4') try: raise Exception() # does not break except BaseException: print('handled 5'...
apache-2.0
mitocw/edx-platform
common/djangoapps/pipeline_mako/__init__.py
2
5003
from django.conf import settings as django_settings from django.contrib.staticfiles.storage import staticfiles_storage from pipeline.conf import settings from pipeline.packager import Packager from pipeline.utils import guess_type from edxmako.shortcuts import render_to_string from static_replace import try_staticfi...
agpl-3.0
dotpmrcunha/gnuradio
gr-uhd/examples/python/usrp_wxapt_rcv.py
58
10872
#!/usr/bin/env python # # Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at ...
gpl-3.0
bonitadecker77/python-for-android
python-modules/twisted/twisted/spread/jelly.py
56
36247
# -*- test-case-name: twisted.test.test_jelly -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ S-expression-based persistence of python objects. It does something very much like L{Pickle<pickle>}; however, pickle's main goal seems to be efficiency (both in space and time); jel...
apache-2.0
guerrerocarlos/odoo
addons/crm_helpdesk/report/__init__.py
442
1083
# -*- 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
smaty1/scrapy
tests/test_downloadermiddleware_httpproxy.py
103
3439
import os import sys from twisted.trial.unittest import TestCase, SkipTest from scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddleware from scrapy.exceptions import NotConfigured from scrapy.http import Response, Request from scrapy.spiders import Spider spider = Spider('foo') class TestDefaultHeadersMidd...
bsd-3-clause
pcrews/kewpie
xtrabackup_disabled/bug759225_test.py
5
5702
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
apache-2.0
JuliBakagianni/META-SHARE
misc/tools/lang/gen_langs.py
6
6124
import pycountry import sys from django.utils.encoding import smart_str USE_EXTENDED_LABELS = False USE_ALPHA2 = False def read_lang_alpha2(): langs = pycountry.languages lang_list = [] for index in range(len(langs.objects)): lang = langs.objects[index] if hasattr(lang, 'alpha2'): ...
bsd-3-clause
tommy-u/chaco
chaco/tests/plotcontainer_test_case.py
1
27597
import sys import unittest from chaco.api import HPlotContainer, OverlayPlotContainer, \ PlotComponent, VPlotContainer, GridContainer from traits.api import Any, Tuple SizePrefs = GridContainer.SizePrefs class ContainerTestCase(unittest.TestCase): def assert_tuple(self, t1, t2): ...
bsd-3-clause
thliebig/openEMS
python/openEMS/ports.py
1
18562
# -*- coding: utf-8 -*- # # Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) # # 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 opt...
gpl-3.0
Kazade/NeHe-Website
django/contrib/gis/db/models/sql/compiler.py
222
12579
from itertools import izip from django.db.backends.util import truncate_name from django.db.models.sql import compiler from django.db.models.sql.constants import TABLE_NAME from django.db.models.sql.query import get_proxied_model SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(compiler.SQLCompiler): def ...
bsd-3-clause
fritsvanveen/QGIS
python/ext-libs/pygments/lexers/eiffel.py
47
2482
# -*- coding: utf-8 -*- """ pygments.lexers.eiffel ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Eiffel language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, words from pygments.token import ...
gpl-2.0
slozier/ironpython2
Tests/test_decorator.py
2
3007
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import unittest from iptest import run_test class dn: def d1(self, a): a.append("dn.d1") r...
apache-2.0
rcharp/toyota-flask
venv/lib/python2.7/site-packages/setuptools/tests/test_packageindex.py
16
7339
import sys import distutils.errors from setuptools.compat import httplib, HTTPError, unicode, pathname2url import pkg_resources import setuptools.package_index from setuptools.tests.server import IndexServer class TestPackageIndex: def test_bad_url_bad_port(self): index = setuptools.package_index.Packa...
apache-2.0
umars/npyscreen
build/virtualenv/bin/rebuild-script.py
85
2029
#!/usr/bin/env python """ Helper script to rebuild virtualenv.py from virtualenv_support """ import re import os import sys here = os.path.dirname(__file__) script = os.path.join(here, '..', 'virtualenv.py') file_regex = re.compile( r'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""(.*?)"""\)', re.S)...
bsd-2-clause
sjlehtin/django
tests/gis_tests/layermap/models.py
39
2204
from django.contrib.gis.db import models class NamedModel(models.Model): name = models.CharField(max_length=25) class Meta: abstract = True def __str__(self): return self.name class State(NamedModel): pass class County(NamedModel): state = models.ForeignKey(State, models.CASC...
bsd-3-clause
chrisfilo/NeuroVault
neurovault/apps/statmaps/migrations/0034_auto_20150305_0406.py
4
1068
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('statmaps', '0033_statisticmap_ignore_file_warning'), ] operations = [ migrations.AddField( model_name='nidmresul...
mit
jleivaizq/freesquare
freesquare/geo/management/commands/geonames.py
1
6253
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import sys import traceback from optparse import make_option from itertools import chain from django.core.management.base import BaseCommand, CommandError from ...models import Region from ...feeds.geonames import Geonames...
mit
compstak/selenium
py/selenium/webdriver/support/wait.py
16
3585
#!/usr/bin/python # # Copyright 2011 Software Freedom Conservancy. # # 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 ap...
apache-2.0
jalavik/invenio
invenio/modules/records/testsuite/test_legacy_record.py
15
80262
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either ver...
gpl-2.0
MG-RAST/Shock
test/test_shock.py
1
31077
from __future__ import print_function from os.path import dirname, abspath from subprocess import check_output import json import os import requests import subprocess import pytest from pprint import pprint DATADIR = "testdata" DEBUG = 0 SHOCK_URL = "" SHOCK_USER_AUTH = "" SHOCK_ADMIN_AUTH = "" AUTH = "" FILELIST...
bsd-2-clause
ghorn/rawesome
rawe/rtIntegrator/rtModelExport.py
1
2717
# Copyright 2012-2013 Greg Horn # # This file is part of rawesome. # # rawesome 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 later version. ...
lgpl-3.0
gryf/pythonhelper
ftplugin/python/test_pythonhelper.py
1
4222
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import sys class Command(object): def __call__(self, args): print(args) class Window(object): def __init__(self): self.cursor = (1, 1) class Current(object): def __init__(self): self.buffer = [] self.window ...
bsd-3-clause
GitHublong/hue
desktop/core/ext-py/Django-1.6.10/django/conf/locale/mk/formats.py
118
1758
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATE...
apache-2.0
ric2b/Vivaldi-browser
chromium/chrome/common/extensions/docs/server2/table_of_contents_renderer.py
98
2000
# 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. from extensions_paths import PRIVATE_TEMPLATES from file_system import FileNotFoundError class TableOfContentsRenderer(object): '''Renders a table of con...
bsd-3-clause
umuzungu/zipline
tests/pipeline/test_pipeline_algo.py
2
20033
""" Tests for Algorithms using the Pipeline API. """ from os.path import ( dirname, join, realpath, ) from nose_parameterized import parameterized from numpy import ( array, arange, full_like, float64, nan, uint32, ) from numpy.testing import assert_almost_equal import pandas as pd ...
apache-2.0
jmchilton/pulsar
test/main_util_test.py
1
3624
""" Test utilities in pulsar.main """ from os.path import join from test_utils import temp_directory from pulsar import main def test_pulsar_config_builder_defaults(): with temp_directory() as mock_root: __write_mock_ini(join(mock_root, "server.ini")) config = main.PulsarConfigBuilder(config_dir=m...
apache-2.0
FlorianLudwig/odoo
addons/stock_dropshipping/wizard/__init__.py
313
1077
# -*- 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
Zhaominxin/MyProject
tutorial/tutorial/settings.py
13
3148
# -*- coding: utf-8 -*- # Scrapy settings for tutorial project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/lates...
mit
lbatalha/pastething
main.py
1
9397
#!/usr/bin/env python3 from random import getrandbits, choice from base64 import urlsafe_b64encode from datetime import date, datetime, timedelta from contextlib import contextmanager from psycopg2.extras import DictCursor from psycopg2.pool import SimpleConnectionPool import pygments from pygments import highlight ...
mit
jasmine-contrib/grunt-jasmine-task
node_modules/grunt/node_modules/gzip-js/test/unzipTest.py
182
1840
import os from colorama import Fore from helpers import run_cmd outDirDefault = 'test-outs' testDirDefault = 'test-files' """ Run a single test @param tFile- required; the file to check against (uncompressed data) @param level- optional (default: all); the compression level [1-9] @return True if all tests passed; Fa...
mit
lupyuen/RaspberryPiImage
usr/share/pyshared/ajenti/plugins/main/controls_containers.py
1
2421
from ajenti.api import * from ajenti.ui import p, UIElement @p('width', default=None) @p('height', default=None) @p('scroll', default=False, type=bool) @plugin class Box (UIElement): typeid = 'box' @p('text', default='', bindtypes=[str, unicode]) @plugin class FormLine (UIElement): typeid = 'formline' @p(...
apache-2.0
OCA/account-payment
account_payment_return_import/tests/test_import_file.py
1
3567
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # Copyright 2018 Tecnativa - Luis M. Ontalba # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import base64 import logging from odoo import fields from odoo.tests.common import SavepointCase from odoo.modules.module import get_module_resource _logg...
agpl-3.0
r888888888/models
slim/nets/resnet_v1_test.py
15
19022
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
FlaPer87/django-nonrel
django/contrib/gis/utils/ogrinspect.py
321
8939
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. Author: Travis Pinney, Dane Springmeyer, & Justin Bronn """ from itertools import izip # Requires GDAL to use. from django.contrib.gis.gdal import DataSourc...
bsd-3-clause
KevinJiao/SnapYak
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## 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...
mit
bryancall/trafficserver
tests/gold_tests/h2/h2disable.test.py
6
3964
''' ''' # 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");...
apache-2.0
markeTIC/server-tools
mail_environment/env_mail.py
50
9082
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
XeCycle/indico
indico/modules/rb/controllers/user/photos.py
2
1837
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
legalsylvain/OpenUpgrade
openerp/addons/base/tests/test_basecase.py
379
3895
# -*- coding: utf-8 -*- import unittest2 from openerp.tests import common class test_single_transaction_case(common.SingleTransactionCase): """ Check the whole-class transaction behavior of SingleTransactionCase. """ def test_00(self): """Create a partner.""" cr, uid = self.cr, self.u...
agpl-3.0
OpenUpgrade-dev/OpenUpgrade
openerp/addons/base/tests/test_misc.py
393
1111
import unittest2 from openerp.tools import misc class test_countingstream(unittest2.TestCase): def test_empty_stream(self): s = misc.CountingStream(iter([])) self.assertEqual(s.index, -1) self.assertIsNone(next(s, None)) self.assertEqual(s.index, 0) def test_single(self): ...
agpl-3.0
ychfan/tensorflow
tensorflow/python/keras/_impl/keras/applications/mobilenet.py
12
28029
# 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
intelligent-agent/redeem
redeem/gcodes/M18.py
1
1219
""" GCode M18 Disable all steppers Author: Mathieu Monney email: zittix(at)xwaves(dot)net License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from __future__ import absolute_import import logging from redeem.Stepper import Stepper from .GCodeCommand import GCodeCommand class M18(GCodeCommand): d...
gpl-3.0
rlugojr/django
django/contrib/contenttypes/models.py
16
6543
from collections import defaultdict from django.apps import apps from django.db import models from django.utils.encoding import force_text from django.utils.translation import gettext_lazy as _ class ContentTypeManager(models.Manager): use_in_migrations = True def __init__(self, *args, **kwargs): su...
bsd-3-clause
konefalg/whylog
whylog/tests/tests_config/test_parsers_and_rules_filter.py
5
5731
import itertools import os.path from datetime import datetime from unittest import TestCase import six from whylog.config import YamlConfig from whylog.front.utils import FrontInput from whylog.tests.utils import ConfigPathFactory path_test_files = ['whylog', 'tests', 'tests_config', 'test_files'] class TestBasic(...
bsd-3-clause
mhdella/scikit-learn
sklearn/decomposition/tests/test_fastica.py
272
7798
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from skl...
bsd-3-clause
zerebubuth/mapnik
scons/scons-local-2.5.0/SCons/Tool/mwld.py
3
3651
"""SCons.Tool.mwld Tool-specific initialization for the Metrowerks CodeWarrior linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is here...
lgpl-2.1
ltilve/ChromiumGStreamerBackend
chrome/browser/policy/test/asn1der.py
101
1562
# Copyright (c) 2011 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. """Helper module for ASN.1/DER encoding.""" import binascii import struct # Tags as defined by ASN.1. INTEGER = 2 BIT_STRING = 3 NULL = 5 OBJECT_IDENTI...
bsd-3-clause
maohongyuan/kbengine
kbe/src/lib/python/Lib/wsgiref/validate.py
92
15151
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php # Licensed to PSF under a Contributor Agreement """ Middlew...
lgpl-3.0
yufengg/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/csv_parser.py
26
2228
# 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
geodynamics/burnman
burnman/planet.py
2
26317
from __future__ import print_function # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU # GPL v2 or later. import numpy as np from scipy.integrate import odeint from scipy.integrate imp...
gpl-2.0
Salat-Cx65/python-for-android
python3-alpha/extra_modules/pyxmpp2/ext/component.py
46
7090
# # (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
apache-2.0
Nexenta/s3-tests
virtualenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/big5prober.py
2931
1684
######################## 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...
mit
aametwally/cloudSACA
cloudSACA_Azure/azure/http/httpclient.py
1
8022
#------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apac...
gpl-3.0
davidsamu/seal
examples/preprocessing.py
1
4655
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 9 16:55:34 2016 @author: David Samu """ # Template script to # # 1) import SimpleTPLCell structures (created in Matlab), # 2) convert them into Seal Units and UnitArrays, # 3) test unit quality and recording drifts, # 4) exclude trials and units a...
gpl-3.0
markvl/acrylamid
acrylamid/filters/typography.py
2
12390
# -*- encoding: utf-8 -*- # # License: New BSD Style # # [typography.py][1] is a set of filters enhancing written text output. As the # name says, it adds specific typography things documented in the definitions # itself and [smartypants][2]. # # The typography.py filter comes with two options: ``mode`` and ``default``...
bsd-2-clause
nocko/cfmi
cfmi/imaging/tasks.py
1
2283
import dicom import production_settings import shutil import tempfile import os from celery import Celery, chain from cfmi.database.dicom import Series from cfmi.utils import archive_hash from subprocess import call celery = Celery('imaging') celery.config_from_object('production_settings') #Utility Functions def ...
bsd-3-clause
shumik/skencil-c
Sketch/Graphics/plugobj.py
1
6044
# Sketch - A Python-based interactive drawing program # Copyright (C) 1998, 1999, 2001 by Bernhard Herzog # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the Lice...
gpl-2.0
southpawtech/TACTIC-DEV
src/pyasm/common/system_test.py
6
1431
#!/usr/bin/python ########################################################### # # Copyright (c) 2005, 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 wit...
epl-1.0
sadaf2605/django
tests/admin_inlines/tests.py
8
44126
from __future__ import unicode_literals from django.contrib.admin import ModelAdmin, TabularInline from django.contrib.admin.helpers import InlineAdminForm from django.contrib.admin.tests import AdminSeleniumTestCase from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import...
bsd-3-clause
tulsluper/sanscript
apps/fc/scripts/form_links2.py
1
9605
#!/usr/bin/env python3 import os import sys import json from settings import JSONDIR, TEXTDIR from settings import logging from defs import load_data, dump_data fields = ['name', 'address', 'username', 'password'] dirpath = os.path.dirname(os.path.realpath(__file__)) filepath = os.path.join(dirpath, 'SwitchConnection...
gpl-3.0
aflaxman/scikit-learn
sklearn/decomposition/tests/test_nmf.py
21
17922
import numpy as np import scipy.sparse as sp import numbers from scipy import linalg from sklearn.decomposition import NMF, non_negative_factorization from sklearn.decomposition import nmf # For testing internals from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from sklearn.utils.te...
bsd-3-clause
beblount/Steer-Clear-Backend-Web
env/Lib/site-packages/requests/__init__.py
412
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
mit
ping/youtube-dl
youtube_dl/extractor/unity.py
30
1228
from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE class UnityIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?unity3d\.com/learn/tutorials/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://unity3d.com/learn/tutorials/topics/animation/a...
unlicense
headcrabned/teamcat
beginner_tutorials/scripts/listener.py
7
2406
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
mit
nvoron23/hue
desktop/core/ext-py/MySQL-python-1.2.5/tests/test_MySQLdb_dbapi20.py
41
7818
#!/usr/bin/env python import dbapi20 import unittest import MySQLdb from configdb import connection_kwargs import warnings warnings.simplefilter("ignore") class test_MySQLdb(dbapi20.DatabaseAPI20Test): driver = MySQLdb connect_args = () connect_kw_args = connection_kwargs(dict(sql_mode="ANSI,STR...
apache-2.0
beni55/olympia
settings_test.py
10
5522
from settings import * # noqa import atexit import tempfile from django.utils.functional import lazy _tmpdirs = set() def _cleanup(): try: import sys import shutil except ImportError: return tmp = None try: for tmp in _tmpdirs: shutil.rmtree(tmp) ex...
bsd-3-clause
nriley/NewsBlur
utils/fields.py
18
1241
from django.db.models import OneToOneField from django.db.models.fields.related import SingleRelatedObjectDescriptor from south.modelsinspector import add_introspection_rules add_introspection_rules([], ["^utils\.fields\.AutoOneToOneField"]) class AutoSingleRelatedObjectDescriptor(SingleRelatedObjectDescriptor): ...
mit
salv-orlando/MyRepo
nova/virt/vmwareapi/error_util.py
7
3542
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
Lyrositor/Plasma
Sources/Tests/gtest-1.7.0/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-3.0
cylc/cylc
tests/unit/test_cylc_subproc.py
1
4090
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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,...
gpl-3.0
ChameleonCloud/horizon
openstack_dashboard/test/integration_tests/pages/admin/system/metadatadefinitionspage.py
1
5061
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
hurricup/intellij-community
python/lib/Lib/encodings/iso8859_10.py
593
13845
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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,input,errors...
apache-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-58/modules/sheets/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py
1261
6282
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compa...
gpl-3.0
Eficent/manufacture
mrp_calendar_view/__init__.py
15
1451
# -*- coding: utf-8 -*- ######################################################################### # # # Copyright (C) 2015 Agile Business Group # # # ...
agpl-3.0
duyet-website/api.duyet.net
lib/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
bjeavons/zxcvbn-php
data-scripts/build_frequency_lists.py
2
5386
#!/usr/bin/python import os import sys import time import codecs import json from operator import itemgetter def usage(): return ''' usage: %s data-dir src/Matchers/frequency_lists.json generates frequency_lists.json (zxcvbn's ranked dictionary file) from word frequency data. data-dir should contain frequency co...
mit
rubencabrera/micropython
tests/extmod/uctypes_sizeof_native.py
61
1036
import uctypes S1 = {} assert uctypes.sizeof(S1) == 0 S2 = {"a": uctypes.UINT8 | 0} assert uctypes.sizeof(S2) == 1 S3 = { "a": uctypes.UINT8 | 0, "b": uctypes.UINT8 | 1, } assert uctypes.sizeof(S3) == 2 S4 = { "a": uctypes.UINT8 | 0, "b": uctypes.UINT32 | 4, "c": uctypes.UINT8 | 8, } assert ucty...
mit
ericgarrigues/ansible-modules-extras
notification/irc.py
50
7523
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jan-Piet Mens <jpmens () 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 L...
gpl-3.0
edx/ansible
lib/ansible/runner/lookup_plugins/indexed_items.py
176
1418
# (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
Empire-of-Code-Puzzles/checkio-empire-digits-multiplication
verification/src/tests.py
1
1494
TESTS = { "Level_1": [ { "input": 123405, "answer": 120 }, { "input": 999, "answer": 729 }, { "input": 1000, "answer": 1 }, { "input": 1111, "answer": 1 },...
gpl-2.0
bazelbuild/bazel
tools/android/resource_extractor.py
15
3094
# Copyright 2016 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
svanschalkwyk/datafari
windows/python/Lib/idlelib/configSectionNameDialog.py
37
3979
""" Dialog that allows user to specify a new config file section name. Used to get new highlight theme and keybinding set names. The 'return value' for the dialog, used two placed in configDialog.py, is the .result attribute set in the Ok and Cancel methods. """ from Tkinter import * import tkMessageBox class GetCfgSec...
apache-2.0
titom1986/CouchPotatoServer
libs/requests/packages/urllib3/filepost.py
551
2512
# urllib3/filepost.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import codecs import mimetypes from uuid import uuid4 from io import BytesIO from .packages ...
gpl-3.0
brian-yang/mozillians
vendor-local/lib/python/south/utils/__init__.py
119
1945
""" Generally helpful utility functions. """ def _ask_for_it_by_name(name): "Returns an object referenced by absolute path." bits = str(name).split(".") ## what if there is no absolute reference? if len(bits) > 1: modulename = ".".join(bits[:-1]) else: modulename = bits[0] mo...
bsd-3-clause
jingriver/stocktracker
pytoolkit/yahoo_eod/sector.py
1
9102
from config import * from testHttp import * from TableParse import * import re import sqlite3 from testsqlite3 import purge_industry_ref, getSymList, downloadSymListToDB """Sector: Technology > Industry: Semiconductors url = http://finance.google.com/finance?q=WFR&hl=en Sector summary Sector Change ...
mit
nervenXC/topical_word_embeddings
TWE-1/gensim/test/svd_error.py
71
7330
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> """USAGE: %(program)s MATRIX.mm [CLIP_DOCS] [CLIP_TERMS] Check truncated SVD error for the algo in gensim, using a given corpus. This script runs the decomposition with several internal parameters (number of r...
mit
emon10005/scikit-image
doc/examples/plot_phase_unwrap.py
14
4080
""" ================ Phase Unwrapping ================ Some signals can only be observed modulo 2*pi, and this can also apply to two- and three dimensional images. In these cases phase unwrapping is needed to recover the underlying, unwrapped signal. In this example we will demonstrate an algorithm [1]_ implemented in...
bsd-3-clause
vperron/sentry
src/sentry/models/grouptagkey.py
32
1040
""" sentry.models.grouptagkey ~~~~~~~~~~~~~~~~~~~~~~~~~ :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 from django.db import models from sentry.constants import MAX_TAG_KEY_LENGTH from sentry.db.model...
bsd-3-clause
tangram/django-filer
filer/admin/permissionadmin.py
14
1644
#-*- coding: utf-8 -*- import inspect from django.contrib import admin from filer import settings from filer.fields import folder class PermissionAdmin(admin.ModelAdmin): fieldsets = ( (None, {'fields': (('type', 'folder',))}), (None, {'fields': (('user', 'group', 'everybody'),)}), (None, ...
bsd-3-clause
slashdd/sos
sos/report/plugins/composer.py
4
1519
# 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
ibell/coolprop
dev/Tickets/77.py
5
2204
import matplotlib matplotlib.use('Qt4Agg') import numpy import CoolProp import CoolProp.CoolProp as CP print "Testing the derivatives and store results for "+CoolProp.__gitrevision__ keys = ["dpdT","dpdrho","Z","dZ_dDelta","dZ_dTau","B","dBdT","C","dCdT","phir","dphir_dTau","d2phir_dTau2","dphir_dDelta", "d2phir...
mit