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
aakash-cr7/zulip
analytics/migrations/0010_clear_messages_sent_values.py
14
1174
# -*- coding: utf-8 -*- from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps from django.db import migrations def clear_message_sent_by_message_type_values(apps, schema_editor): # type: (StateApps, DatabaseSchemaEditor) -> None UserCoun...
apache-2.0
bowang/tensorflow
tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_graph_test.py
76
10239
# 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
Arable/evepod
lib/python2.7/site-packages/pip/vendor/html5lib/treewalkers/dom.py
1229
1457
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node import gettext _ = gettext.gettext from . import _base class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYP...
apache-2.0
antepsis/anteplahmacun
sympy/integrals/transforms.py
20
62137
""" Integral Transforms """ from __future__ import print_function, division from sympy.core import S from sympy.core.compatibility import reduce, range from sympy.core.function import Function from sympy.core.numbers import oo from sympy.core.symbol import Dummy from sympy.integrals import integrate, Integral from sy...
bsd-3-clause
MarishaYasko/interactive-stories-stands
InteractiveStands/Lib/shutil.py
4
40048
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat import fnmatch import collections import errno try: import zlib del zlib _ZLIB_SUPPORTED = True except ImportError:...
mit
ioram7/keystone-federado-pgid2013
build/paste/paste/auth/basic.py
28
4076
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ Basic HTTP/1.0 Authentication This module implements ``Basic`` authentication...
apache-2.0
aospo/platform_external_skia
platform_tools/android/tests/var_dict_tests.py
146
2613
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test the VarsDict. """ import sys import test_variables import unittest sys.path.append(test_variables.GYP_GEN_DIR) import vars_dict_lib from vars_dict_lib impo...
bsd-3-clause
schroeder-dewitt/polyomino-self-assembly
test/GeneticAlgorithm/templates/fitness/alpha-beta/main.py
4
8071
import pycuda.autoinit import pycuda.driver as drv import numpy from pycuda.compiler import SourceModule from jinja2 import Environment, PackageLoader def main(): #FourPermutations set-up FourPermutations = numpy.array([ [1,2,3,4], [1,2,4,3], ...
apache-2.0
tomas-edwardsson/tommi-func
func/utils.py
2
16550
""" Copyright 2007, Red Hat, Inc see AUTHORS This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, U...
gpl-2.0
joyxu/autotest
cli/test_unittest.py
4
6667
#!/usr/bin/python # # Copyright 2008 Google Inc. All Rights Reserved. """Tests for test.""" import unittest import sys import os try: import autotest.common as common except ImportError: import common from autotest.cli import cli_mock, topic_common, test class test_list_unittest(cli_mock.cli_unittest): ...
gpl-2.0
jcoady9/python-for-android
python3-alpha/python3-src/Lib/email/_parseaddr.py
46
16272
# Copyright (C) 2002-2007 Python Software Foundation # Contact: email-sig@python.org """Email address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. """ __all__ = [ 'mktime_tz', 'parsedate', 'parsedate_tz', 'quote', ] import time SPACE = ' ' EMPTYSTRING = ''...
apache-2.0
Petr-Kovalev/nupic-win32
tests/unit/py2/nupic/data/file_record_stream_test.py
1
7707
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
gpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/cherrypy/cherrypy/test/test_httpauth.py
42
5844
import cherrypy from cherrypy._cpcompat import md5, sha, ntob from cherrypy.lib import httpauth from cherrypy.test import helper class HTTPAuthTest(helper.CPWebCase): def setup_server(): class Root: def index(self): return "This is public." index.exposed = True ...
bsd-3-clause
miguelsousa/Robofont-scripts
ScaleFast/ScaleFast.roboFontExt/lib/mutatorScale/utilities/fontUtils.py
4
10530
#coding=utf-8 from __future__ import division from math import atan2, tan, hypot, cos, degrees, radians from robofab.world import RGlyph import fontTools import fontTools.misc.bezierTools as bezierTools import fontTools.misc.arrayTools as arrayTools import fontTools.misc.transform as transform from fontTools.pens.bou...
mit
cce/kombu
examples/complete_receive.py
22
1526
""" Example of simple consumer that waits for a single message, acknowledges it and exits. """ from kombu import Connection, Exchange, Queue, Consumer, eventloop from pprint import pformat #: By default messages sent to exchanges are persistent (delivery_mode=2), #: and queues and exchanges are durable. exchange = Exc...
bsd-3-clause
TShapinsky/ardupilot
Tools/LogAnalyzer/tests/TestDualGyroDrift.py
273
5396
from LogAnalyzer import Test,TestResult import DataflashLog # import scipy # import pylab #### TEMP!!! only for dev # from scipy import signal class TestDualGyroDrift(Test): '''test for gyro drift between dual IMU data''' def __init__(self): Test.__init__(self) self.name = "Gyro Drift" self.enable = Fals...
gpl-3.0
noironetworks/nova
nova/compute/rpcapi.py
4
43954
# Copyright 2013 Red Hat, 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...
apache-2.0
gurneyalex/odoo
addons/utm/models/ir_http.py
11
1081
# -*- coding: utf-8 -*- from odoo.http import request from odoo import models class IrHttp(models.AbstractModel): _inherit = 'ir.http' @classmethod def get_utm_domain_cookies(cls): return request.httprequest.host @classmethod def _set_utm(cls, response): if isinstance(response, E...
agpl-3.0
x303597316/hue
desktop/core/ext-py/pysqlite/pysqlite2/test/dbapi.py
45
27943
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/dbapi.py: tests for DB-API compliance # # Copyright (C) 2004-2009 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages...
apache-2.0
OopsOutOfMemory/finagle
doc/src/sphinx/exts/includecode.py
121
5444
import os import codecs from os import path from docutils import nodes from docutils.parsers.rst import Directive, directives class IncludeCode(Directive): """ Include a code example from a file with sections delimited with special comments. """ has_content = False required_arguments = 1 opti...
apache-2.0
daizuozhuo/kubernetes
hack/verify-flags-underscore.py
38
8954
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
pixbuffer/django-cms
cms/migrations/0013_site_copy.py
385
19523
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Dummy migration pass def backwards(self, orm): # Dummy migration pass models = { ...
bsd-3-clause
ozamiatin/glance
glance/tests/unit/test_schema.py
20
5937
# Copyright 2012 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 req...
apache-2.0
baozoumanhua/elk-rtf
kibana-4-darwin-x64/node/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
446
43487
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
apache-2.0
0jpq0/kbengine
kbe/src/lib/python/Lib/test/test_threading.py
72
36686
""" Tests for the threading module. """ import test.support from test.support import verbose, strip_python_stderr, import_module, cpython_only from test.script_helper import assert_python_ok import random import re import sys _thread = import_module('_thread') threading = import_module('threading') import time import...
lgpl-3.0
oliverhr/odoo
addons/account_check_writing/wizard/__init__.py
437
1082
# -*- 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
Radiotechniman/Anorak
lib/web/test.py
118
1393
"""test utilities (part of web.py) """ import unittest import sys, os import web TestCase = unittest.TestCase TestSuite = unittest.TestSuite def load_modules(names): return [__import__(name, None, None, "x") for name in names] def module_suite(module, classnames=None): """Makes a suite from a module.""" ...
gpl-3.0
pwong-mapr/private-hue
desktop/core/ext-py/ctypes-1.0.2/ctypes/wintypes.py
9
4954
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### # The most useful windows datatypes from ctypes import * BYTE = c_byte WORD = c_ushort DWORD = c_ulong W...
apache-2.0
djolent/WebApp
LifeSciences/AzureBlast/AzureBlast/BatchScripts/AnalysisJobManager.py
1
4604
import os import sys import datetime import time import azure.batch.batch_service_client as batch import azure.batch.batch_auth as batchauth import azure.batch.models as batchmodels from azure.storage.table import TableService, TableBatch from azure.storage.blob import BlockBlobService def get_analysis_state(all_task...
mit
niboshi/chainer
tests/chainermn_tests/communicator_tests/test_node_aware_communicator_base.py
6
2939
import collections import os import unittest import mpi4py.MPI import pytest from chainermn.communicators.mpi_communicator_base import MpiCommunicatorBase class NodeAwareNaiveCommunicator(MpiCommunicatorBase): def __init__(self, mpi_comm): super(NodeAwareNaiveCommunicator, self).__init__(mpi_comm) ...
mit
lilida/teletraan
deploy-board/deploy_board/webapp/group_view.py
2
50302
# Copyright 2016 Pinterest, 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 writi...
apache-2.0
fernandezcuesta/ansible
hacking/tests/gen_distribution_version_testcase.py
80
1878
#!/usr/bin/env python """ This script generated test_cases for test_distribution_version.py. To do so it outputs the relevant files from /etc/*release, the output of platform.dist() and the current ansible_facts regarding the distribution version. This assumes a working ansible version in the path. """ import platf...
gpl-3.0
efortuna/AndroidSDKClone
ndk/prebuilt/linux-x86_64/lib/python2.7/ctypes/test/test_functions.py
16
12908
""" Here is probably the place to write the docs, since the test-cases show how the type behave. Later... """ from ctypes import * import sys, unittest try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test dll = CDLL(_ctypes_test.__file__) if ...
apache-2.0
kernelmilowill/PDMQBACKTEST
vn.archive/vn.lts_old/vnltstd/test/lts_data_type.py
167
86932
# encoding: UTF-8 defineDict = {} typedefDict = {} #////////////////////////////////////////////////////////////////////// #@company shanghai liber information Technology Co.,Ltd #@file SecurityFtdcUserApiDataType.h #@brief 定义业务数据类型 #////////////////////////////////////////////////////////////////////// #/////////...
mit
jelly/calibre
src/calibre/gui2/tweak_book/check.py
2
9562
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import sys from PyQt5.Qt import ( QIcon, Qt, QSplitter, QListWidget, Q...
gpl-3.0
Peddle/hue
desktop/libs/liboozie/src/liboozie/credentials_tests.py
33
2933
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
stargaser/astropy
astropy/time/tests/test_custom_formats.py
3
7565
# Licensed under a 3-clause BSD style license - see LICENSE.rst from datetime import date from itertools import count import pytest import numpy as np from astropy._erfa import DJM0 from astropy.time import Time, TimeFormat from astropy.time.utils import day_frac class SpecificException(ValueError): pass @p...
bsd-3-clause
jimbobhickville/libcloud
libcloud/dns/providers.py
3
2999
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
pigeonflight/strider-plone
docker/appengine/lib/webob-1.1.1/webob/response.py
21
39356
import re, urlparse, zlib, struct from datetime import datetime, date, timedelta from webob.headers import ResponseHeaders from webob.cachecontrol import CacheControl, serialize_cache_control from webob.descriptors import * from webob.datetime_utils import * from webob.cookies import Cookie, Morsel from webob.util im...
mit
amenonsen/ansible
lib/ansible/modules/network/cloudengine/ce_acl.py
10
36859
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
fidomason/kbengine
kbe/src/lib/python/Lib/test/test_crypt.py
91
1084
from test import support import unittest crypt = support.import_module('crypt') class CryptTestCase(unittest.TestCase): def test_crypt(self): c = crypt.crypt('mypassword', 'ab') if support.verbose: print('Test encryption: ', c) def test_salt(self): self.assertEqual(len(cr...
lgpl-3.0
alexliew/learn_python_the_hard_way
ex5.py
1
2837
my_name = "Alex Liew" my_age = 25 # this is no lie my_height = 174 # cm my_weight = 65 # kg my_eyes = 'Brown' my_teeth = 'White' my_hair = 'Black' print("Let's talk about {0}.".format(my_name)) print("He's {0} centimeters tall.".format(my_height)) print("He's {0} kilograms heavy.".format(my_weight)) print("Actually th...
mit
filias/django
django/conf/locale/ko/formats.py
404
2320
# -*- 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 = 'Y년 n월 j일' TIME_FORMAT = 'A g:i' D...
bsd-3-clause
mthh/geopy
test/geocoders/geonames.py
7
1454
# -*- coding: UTF-8 -*- import unittest from geopy.compat import u from geopy.geocoders import GeoNames from test.geocoders.util import GeocoderTestBase, env class GeoNamesTestCaseUnitTest(GeocoderTestBase): def test_user_agent_custom(self): geocoder = GeoNames( username='DUMMYUSER_NORBERT',...
mit
fretsonfire/fof-python
src/midi/RawInstreamFile.py
7
3005
# -*- coding: ISO-8859-1 -*- # standard library imports from types import StringType from struct import unpack # custom import from DataTypeConverters import readBew, readVar, varLen class RawInstreamFile: """ It parses and reads data from an input file. It takes care of big endianess, and ke...
mit
TakayukiSakai/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_test.py
3
2794
# 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
maxwward/SCOPEBak
askbot/views/readers.py
1
27155
# encoding:utf-8 """ :synopsis: views "read-only" for main textual content By main textual content is meant - text of Exercises, Problems and Comments. The "read-only" requirement here is not 100% strict, as for example "exercise" view does allow adding new comments via Ajax form post. """ import datetime import loggi...
gpl-3.0
uptimerobot/uptimerobot-cli
uptimerobot/client.py
1
12485
from __future__ import absolute_import, division, print_function, unicode_literals import re import sys import json import requests from . import APIError, HTTPError from .monitor import Monitor from .alert_contact import AlertContact # Ensure that we can test against the appropriate string types. if sys.version_in...
gpl-3.0
daodaoliang/neural-network-animation
matplotlib/tests/test_table.py
10
2083
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import matplotlib.pyplot as plt import numpy as np from matplotlib.testing.decorators import image_comparison @image_comparison(baseline_images=['table_zorder'], extensions=['png...
mit
sashakames/COG
cog/plugins/esgf/permissionDAO.py
2
6818
''' Class to manage Permission objects in the ESGF database. @author: Luca Cinquini ''' from sqlalchemy.orm.exc import NoResultFound from cog.plugins.esgf.objects import ESGFGroup, ESGFRole, ESGFUser, ESGFPermission, ROLE_USER from django.core.exceptions import ObjectDoesNotExist class PermissionDAO(object): ...
bsd-3-clause
TriplePoint-Software/django_access_logs
access_logs/migrations/0002_accesslogconfiguration.py
1
1978
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('access_logs', '0001_initial'), ] operations = [ migrations.CreateModel( name='AccessLogConfiguration', ...
apache-2.0
shawnwanderson/cmput404-project
venv/lib/python2.7/site-packages/setuptools/command/easy_install.py
9
89537
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ from...
gpl-3.0
Grumbel/dirtool
dirtools/cmd_desktop.py
1
2895
# dirtool.py - diff tool for directories # Copyright (C) 2018 Ingo Ruhnke <grumbel@gmail.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 opt...
gpl-3.0
magicrub/MissionPlanner
Lib/site-packages/scipy/stats/tests/test_continuous_extra.py
53
3782
# contains additional tests for continuous distributions # # NOTE: one test, _est_cont_skip, that is renamed so that nose doesn't # run it, # 6 distributions return nan for entropy # truncnorm fails by design for private method _ppf test import numpy.testing as npt import numpy as np from scipy imp...
gpl-3.0
mmcdermo/helpinghand
server/venv/lib/python2.7/site-packages/django/contrib/gis/tests/geogapp/tests.py
109
4362
""" Tests for geography support in PostGIS 1.5+ """ from __future__ import absolute_import import os from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.measure import D from django.contrib.gis.tests.utils import postgis from django.test import TestCase fr...
mit
dexterx17/nodoSocket
clients/Python-2.7.6/Lib/json/tests/__init__.py
145
2452
import os import sys import json import doctest import unittest from test import test_support # import json with and without accelerations cjson = test_support.import_fresh_module('json', fresh=['_json']) pyjson = test_support.import_fresh_module('json', blocked=['_json']) # create two base classes that will be used...
mit
quokkaproject/flask-htmlbuilder
setup.py
1
1061
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='quokka-flask-htmlbuilder', version='0.13', url='http://github.com/quokkaproject/flask-htmlbuilder', license='MIT', author='QuokkaProject', author_email='rochacbruno@gmail.com', description='Fork of Flex...
bsd-3-clause
phvu/DDF
python/tests/test_ml.py
3
1794
from __future__ import unicode_literals import unittest import pandas as pd from py4j.java_gateway import Py4JJavaError import test_base from ddf import ml class TestMl(test_base.BaseTest): """ Test ML functions """ def testKmeans(self): model = ml.kmeans(self.mtcars, 2, 5, 10) self...
apache-2.0
Rfam/rfam-production
scripts/support/mirnas/validate_family.py
1
3027
import os import json import argparse import urllib import logging # ------------------------------------------------------------------------------------------ search_dirs = ["/hps/nobackup/production/xfam/rfam/RELEASES/14.3/miRNA_relabelled/batch1_chunk1_searches", "/hps/nobackup/production/xfam/rfam/...
apache-2.0
jesramirez/odoo
addons/stock_landed_costs/product.py
364
1611
# -*- 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
GavinCando/twisted_test
twisted-client-3/get-poetry.py
10
2405
# This is the Twisted Get Poetry Now! client, version 3.0. # NOTE: This should not be used as the basis for production code. import optparse from twisted.internet.protocol import Protocol, ClientFactory def parse_args(): usage = """usage: %prog [options] [hostname]:port ... This is the Get Poetry Now! client,...
mit
denniss17/charm
charm/test/schemes/chamhash_rsa_hw09_test.py
2
1393
import unittest from charm.schemes.chamhash_rsa_hw09 import ChamHash_HW09 from charm.toolbox.integergroup import integer debug = False class ChamHash_HW09Test(unittest.TestCase): def testChamHash_HW09(self): # test p and q primes for unit tests only p = integer( 164960892556379843852...
lgpl-3.0
apixandru/intellij-community
plugins/hg4idea/testData/bin/mercurial/scmutil.py
90
31626
# scmutil.py - Mercurial core utility functions # # Copyright Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ from mercurial.node import nullrev import util, error, osutil, revset...
apache-2.0
cmheisel/django-jamsession
jamsession/forms/admin.py
1
1149
from django import forms from jamsession.forms.fields import SchemaField from jamsession.models import Schema class SchemaAdminForm(forms.Form): error_css_class = 'error' required_css_class = 'required' name = forms.CharField(required=True, widget=forms.TextInput( ...
mit
rbiswas4/SNsims
snsims_previous/snsims/tmp/models.py
1
2804
#!/usr/bin/env python import sncosmo.models import numpy class SEDFileSource(sncosmo.models.TimeSeriesSource): """A TimeSeriesSource stored in a 3-column ASCII file format, for PHASE, LAMBDA, and F_LAMBDA. The hash symbol # is a comment line. The spectral flux density of this model is given by .....
mit
ericmjl/bokeh
sphinx/source/docs/user_guide/examples/categorical_bar_dodged.py
1
1153
from bokeh.io import output_file, show from bokeh.models import ColumnDataSource from bokeh.plotting import figure from bokeh.transform import dodge output_file("dodged_bars.html") fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] years = ['2015', '2016', '2017'] data = {'fruits' : fruits...
bsd-3-clause
amishb/youtube-dl
youtube_dl/extractor/vuclip.py
31
2706
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, ) from ..utils import ( ExtractorError, parse_duration, qualities, ) class VuClipIE(InfoExtractor): _VALID_URL = r'http://(?:m\.)?vuclip\.com/w\?.*?cid=(?P<id>...
unlicense
cryptobanana/ansible
lib/ansible/modules/packaging/language/composer.py
7
8773
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_versi...
gpl-3.0
gravyboat/streamlink
tests/plugins/test_showroom.py
8
1281
import unittest from streamlink.plugins.showroom import Showroom _should_match = ( "https://www.showroom-live.com/48_NISHIMURA_NANAKO", "https://www.showroom-live.com/room/profile?room_id=61734", "http://showroom-live.com/48_YAMAGUCHI_MAHO", "https://www.showroom-live.com/4b9581094890", "https://w...
bsd-2-clause
GetSomeBlocks/ServerStatus
resources/src/mythbox/mythtv/protocol.py
5
9945
# # MythBox for XBMC - http://mythbox.googlecode.com # Copyright (C) 2011 analogue@yahoo.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 2 # of the License, or (at yo...
mit
jereze/scikit-learn
sklearn/utils/fixes.py
39
13318
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
maestro-hybrid-cloud/ceilometer
ceilometer/event/endpoint.py
6
3362
# Copyright 2012-2014 eNovance <licensing@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
wyom/sympy
sympy/physics/mechanics/lagrange.py
19
18431
from __future__ import print_function, division __all__ = ['LagrangesMethod'] from sympy import diff, zeros, Matrix, eye, sympify from sympy.physics.vector import dynamicsymbols, ReferenceFrame from sympy.physics.mechanics.functions import (find_dynamicsymbols, msubs, _f_list_parser) from sympy.physics.mechan...
bsd-3-clause
seanballais/Progen
progen/engine.py
2
1573
# Progen class # License under the GPL v3.0 # Copyright (C) 2015 Sean Francis N. Ballais from os import listdir from os.path import isfile, join from .version import __version__ import os class Progen: gen_path = os.path.dirname(os.path.abspath(__file__)) + "/generators/" def usageHelp(self): print("u...
gpl-3.0
alanconway/dispatch
python/qpid_dispatch_internal/router/engine.py
3
9295
# # 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...
apache-2.0
andriibekker/biddingsbase
django/contrib/admin/media/js/compress.py
784
1896
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
bsd-3-clause
iRudy6/TeachPlan
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/buildbot/buildbot_run.py
1467
4228
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys BUILDBOT_DIR = os....
mit
vasyarv/edx-platform
openedx/core/djangoapps/content/course_structures/tests.py
54
8934
import json from xmodule_django.models import UsageKey from xmodule.modulestore.django import SignalHandler from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from openedx.core.djangoapps.content.course_structures.models imp...
agpl-3.0
JuliBakagianni/META-SHARE
metashare/repository/supermodel.py
3
58890
import datetime import logging import re import urllib from Queue import Queue from traceback import format_exc from xml.etree.ElementTree import Element, fromstring, tostring from django import db from django.core.cache import cache from django.core.exceptions import ValidationError, ObjectDoesNotExist, \ Imprope...
bsd-3-clause
lucadealfaro/cis-crowd
languages/fr.py
13
7668
# coding: utf8 { '!langcode!': 'fr', '!langname!': 'Français', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOI...
bsd-3-clause
jendrikseipp/rednotebook-elementary
win/utils.py
1
1582
import logging import os import shutil import sys import subprocess import urllib.request def ensure_path(path): if not os.path.exists(path): os.mkdir(path) def confirm_overwrite(dir): if os.path.exists(dir): answer = input( 'The directory {} exists. Overwrite it? (Y/n): '.format(...
gpl-2.0
youdonghai/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/tests/views.py
71
14822
import os import re import urllib from django.conf import settings from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.test import TestCase from dja...
apache-2.0
apporc/neutron
neutron/tests/unit/extensions/test_l3_ext_gw_mode.py
2
21097
# Copyright 2013 VMware, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/django/contrib/staticfiles/views.py
96
1616
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath try: from urllib.parse import unquote except ImportError: # Python 2 from urllib import unquote from django.conf import settings fr...
gpl-2.0
shaftoe/home-assistant
homeassistant/const.py
1
12266
# coding: utf-8 """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 46 PATCH_VERSION = '0.dev0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) REQUIRED_PYTHON_VER_WIN = (3, 5...
apache-2.0
fallen/linux-milkymist
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
foomango/linux-3.7.1
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
kostimarko/portfolio-v2
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/sql.py
198
23461
# -*- coding: utf-8 -*- """ pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and dat...
mit
cvanwie/namebench
nb_third_party/dns/rdtypes/IN/NSAP.py
248
2173
# Copyright (C) 2003-2007, 2009, 2010 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 ...
apache-2.0
kyle-elsalhi/opencv-examples
CalibrationByChessboard/CalibrateCamera.py
1
5055
# System information: # - Linux Mint 18.1 Cinnamon 64-bit # - Python 2.7 with OpenCV 3.2.0 # Resources: # - OpenCV-Python tutorial for calibration: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html # - Variable names were changed for clarity import num...
mit
yinjun322/quick-ng
tools/cocos2d-console/plugins/plugin_update.py
33
1759
# ---------------------------------------------------------------------------- # cocos2d "update" plugin # # Author: Luis Parravicini # # License: MIT # ---------------------------------------------------------------------------- ''' "update" plugin for cocos2d command line tool ''' __docformat__ = 'restructuredtext' ...
mit
Blackclaws/client
src/client/_clientwindow.py
1
52765
from functools import partial from PyQt4.QtCore import QUrl from PyQt4.QtGui import QLabel, QStyle from PyQt4.QtNetwork import QAbstractSocket import config import connectivity from base import Client from config import Settings import chat from client.player import Player from client.players import Players from clie...
gpl-3.0
apc-llc/moose
framework/scripts/distcc/MachineOutput.py
8
5729
# Import the MachineWarehouse object from MachineWarehouse import * ## @class MachineOutput # Provides screen output functionality class MachineOutput(object): ## Class constructor. # @param warehouse The MachineWarehouse object that output is desired from # @see MachineWarehouse def __init__(self, wareh...
lgpl-2.1
m-kuhn/QGIS
tests/src/python/test_qgsdelimitedtextprovider.py
10
31086
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDelimitedTextProvider. .. note:: 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 versi...
gpl-2.0
meghana1995/sympy
sympy/physics/hydrogen.py
108
4497
from __future__ import print_function, division from sympy import factorial, sqrt, exp, S, assoc_laguerre, Float def R_nl(n, l, r, Z=1): """ Returns the Hydrogen radial wavefunction R_{nl}. n, l quantum numbers 'n' and 'l' r radial coordinate Z atomic number (1 for Hydrog...
bsd-3-clause
henryse/pi-weather-pro
groot-jr/weather/Adafruit_Python_GPIO/test/test_PWM.py
3
4020
# Copyright (c) 2014 Adafruit Industries # Author: Tony DiCola # # 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, m...
apache-2.0
mikelambert/flask-admin
flask_admin/contrib/mongoengine/ajax.py
28
4204
import mongoengine from flask_admin._compat import string_types, as_unicode, iteritems from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE class QueryAjaxModelLoader(AjaxModelLoader): def __init__(self, name, model, **options): """ Constructor. :param fields: ...
bsd-3-clause
sputnick-dev/weboob
modules/entreparticuliers/module.py
4
2203
# -*- coding: utf-8 -*- # Copyright(C) 2015 Bezleputh # # This file is part of weboob. # # weboob 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, either version 3 of the License, or # (at your opt...
agpl-3.0
goodlyrottenapple/DEAK-calculus-tool
build.py
4
2877
#!/usr/bin/env python import os,sys,time,getopt,shlex, shutil from subprocess import Popen, PIPE from glob import glob LAST_COMPILE_TIME = 0 def cmd_output_throws_error(flags, response, err, error_msg): if "error" in response.lower() or "bad session" in response.lower() or "unfinished session" in response.lower(): ...
mit
studio666/cjdns
contrib/python/cjdnsadminmaker.py
6
3533
#!/usr/bin/env python import json import os import sys import subprocess # possibly search for running cjdroute processes and check the same folder as they're in # and/or running find on the home folder ## Wanted: Everyone's favorite place to store their shit. conflocations = ["/etc/cjdroute.conf", os.getenv("H...
gpl-3.0