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
freezmeinster/avagata-site
django/contrib/staticfiles/handlers.py
160
2359
import urllib from urlparse import urlparse from django.conf import settings from django.core.handlers.wsgi import WSGIHandler from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve class StaticFilesHandler(WSGIHandler): """ WSGI middleware that intercepts calls to th...
bsd-3-clause
isandlaTech/cohorte-platforms
cohorte-home/build/extra/linux/jpype/reflect.py
7
2274
# ***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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:...
apache-2.0
DefyVentures/edx-platform
common/test/acceptance/performance/test_studio_performance.py
139
3307
""" Single page performance tests for Studio. """ from bok_choy.web_app_test import WebAppTest, with_cache from ..pages.studio.auto_auth import AutoAuthPage from ..pages.studio.overview import CourseOutlinePage from nose.plugins.attrib import attr @attr(har_mode='explicit') class StudioPagePerformanceTest(WebAppTest)...
agpl-3.0
zenefits/sentry
src/sentry/templatetags/sentry_features.py
35
1363
from __future__ import absolute_import from django import template from sentry import features register = template.Library() @register.tag def feature(parser, token): bits = token.split_contents() if len(bits) < 2: raise template.TemplateSyntaxError("%r tag requires an argument" % token.contents.sp...
bsd-3-clause
sysalexis/kbengine
kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_dist_info.py
452
2615
"""Test .dist-info style distributions. """ import os import shutil import tempfile import unittest import textwrap try: import ast except: pass import pkg_resources from setuptools.tests.py26compat import skipIf def DALS(s): "dedent and left-strip" return textwrap.dedent(s).lstrip() class TestDist...
lgpl-3.0
ppanczyk/ansible
lib/ansible/modules/cloud/openstack/os_user_group.py
19
3401
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
bool-/btcbot
jsonrpc/authproxy.py
1
3903
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
gpl-3.0
account-login/dnsagent
dnsagent/resolver/dual.py
1
1713
from typing import Mapping, Union, Sequence from twisted.names.error import ResolverError from twisted.python.failure import Failure from dnsagent.resolver.cn import CnResolver from dnsagent.resolver.parallel import PoliciedParallelResolver, BaseParalledResolverPolicy __all__ = ('DualResolver',) class PolicyError...
mit
radosuav/QGIS
python/plugins/processing/algs/qgis/SpatialiteExecuteSQL.py
13
3241
# -*- coding: utf-8 -*- """ *************************************************************************** SpatialiteExecuteSQL.py --------------------- Date : October 2016 Copyright : (C) 2016 by Mathieu Pellerin Email : nirvn dot asia at gmail dot com ******...
gpl-2.0
webgeodatavore/django
tests/utils_tests/test_datastructures.py
262
4154
""" Tests for stuff in django.utils.datastructures. """ import copy from django.test import SimpleTestCase from django.utils import six from django.utils.datastructures import ( DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError, OrderedSet, ) class OrderedSetTests(SimpleTestCase): def ...
bsd-3-clause
jzinner/utils
samples/python_samples/filewalk.py
1
1158
#/usr/bin/python # import os for the os.walk() function # os.walk returns a list of tuples: 3-tuple (dirpath, dirnames, filenames) import os import sys def ParseArgs(): Error1 = """ # USAGE # # filesystemWalk.py [directory] # filesystemWalk.py /Users/mcohoon/Devel/PythonPractice """ if len(sys.arg...
mit
ahaldane/numpy
numpy/lib/tests/test_recfunctions.py
1
39118
from __future__ import division, absolute_import, print_function import pytest import numpy as np import numpy.ma as ma from numpy.ma.mrecords import MaskedRecords from numpy.ma.testutils import assert_equal from numpy.testing import assert_, assert_raises from numpy.lib.recfunctions import ( drop_fields, rename_...
bsd-3-clause
PeterWangIntel/chromium-crosswalk
third_party/cython/src/Cython/Utils.py
90
12805
# # Cython -- Things that don't belong # anywhere else in particular # import os, sys, re, codecs modification_time = os.path.getmtime def cached_function(f): cache = {} uncomputed = object() def wrapper(*args): res = cache.get(args, uncomputed) if res is uncomputed: ...
bsd-3-clause
sciencefreak500/Open_Intelligence
Python/Eyesight/camshift_test.py
1
1347
import numpy as np import cv2 cap = cv2.VideoCapture(0) # take first frame of the video ret,frame = cap.read() # setup initial location of window r,h,c,w = 250,90,400,125 # simply hardcoded the values track_window = (c,r,w,h) # set up the ROI for tracking roi = frame[r:r+h, c:c+w] hsv_roi = cv2.cvtColor(roi, cv2....
gpl-2.0
iAmMrinal0/plexpy
lib/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
gpl-3.0
jdvelasq/cashflows
cashflows/inflation.py
1
4674
""" Constant dollar transformations =============================================================================== Overview ------------------------------------------------------------------------------- The function ``const2curr`` computes the equivalent generic cashflow in current dollars from a generic cashflow ...
mit
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
762
3532
import hashlib import os from pip._vendor.lockfile import LockFile from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile from ..cache import BaseCache from ..controller import CacheController def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode ...
mit
moreati/django
tests/syndication_tests/urls.py
236
1027
from django.conf.urls import url from . import feeds urlpatterns = [ url(r'^syndication/rss2/$', feeds.TestRss2Feed()), url(r'^syndication/rss2/guid_ispermalink_true/$', feeds.TestRss2FeedWithGuidIsPermaLinkTrue()), url(r'^syndication/rss2/guid_ispermalink_false/$', feeds.TestRss2FeedWithG...
bsd-3-clause
svanschalkwyk/datafari
windows/python/Lib/ctypes/test/test_simplesubclasses.py
117
1355
import unittest from ctypes import * class MyInt(c_int): def __cmp__(self, other): if type(other) != MyInt: return -1 return cmp(self.value, other.value) def __hash__(self): # Silence Py3k warning return hash(self.value) class Test(unittest.TestCase): def test_compare(...
apache-2.0
solring/TWCompanyTree
TWCTenv/lib/python2.7/site-packages/setuptools/tests/test_test.py
286
3710
# -*- coding: UTF-8 -*- """develop tests """ import sys import os, shutil, tempfile, unittest import tempfile import site from distutils.errors import DistutilsError from setuptools.compat import StringIO from setuptools.command.test import test from setuptools.command import easy_install as easy_install_pkg from set...
unlicense
mm112287/2015cda-24
static/Brython3.1.0-20150301-090019/Lib/ui/dialog.py
607
4994
from . import widget from browser import html, document class Dialog(widget.DraggableWidget): def __init__(self, id=None): self._div_shell=html.DIV( Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable", style={'position': 'absolute', 'height': 'auto',...
gpl-3.0
23andMe/ansible-modules-core
cloud/openstack/_quantum_network.py
127
10265
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
gpl-3.0
canavandl/bokeh
tests/glyphs/ImageURL.py
44
1383
import numpy as np from bokeh.document import Document from bokeh.models import ColumnDataSource, Range1d, Plot, LinearAxis, Grid from bokeh.models.glyphs import ImageURL from bokeh.plotting import show url = "http://bokeh.pydata.org/en/latest/_static/bokeh-transparent.png" N = 5 source = ColumnDataSource(dict( ...
bsd-3-clause
msebire/intellij-community
python/lib/Lib/encodings/rot_13.py
497
2579
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. See http://ucsub.colorado.edu/~kominek/rot13/ for details. Written by Marc-Andre Lemburg (mal@lemburg.com). """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.c...
apache-2.0
rahushen/ansible
test/units/playbook/test_conditional.py
57
10163
from ansible.compat.tests import unittest from units.mock.loader import DictDataLoader from ansible.plugins.strategy import SharedPluginLoaderObj from ansible.template import Templar from ansible import errors from ansible.playbook import conditional class TestConditional(unittest.TestCase): def setUp(self): ...
gpl-3.0
reingart/suscripciones
controllers/checkout.py
1
1037
# coding: utf8 # try something like def index(): form = SQLFORM.factory( Field("descripcion", "string", default="Barrilete multicolor"), Field("cantidad", "integer", default=1), Field("precio", "float", default=1.00), ) if form.accepts(request.vars, session): p...
agpl-3.0
larsbutler/oq-hazardlib
openquake/hazardlib/tests/calc/disagg_test.py
1
23162
# The Hazard Library # Copyright (C) 2012-2014, GEM Foundation # # This program 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 option) any later version. ...
agpl-3.0
giggsey/SickRage
lib/dogpile/cache/backends/file.py
47
14178
""" File Backends ------------------ Provides backends that deal with local filesystem access. """ from __future__ import with_statement from dogpile.cache.api import CacheBackend, NO_VALUE from contextlib import contextmanager from dogpile.cache import compat from dogpile.cache import util import os __all__ = 'DBM...
gpl-3.0
rwillmer/django
django/db/backends/mysql/schema.py
166
4774
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_...
bsd-3-clause
j3parker/servo
tests/wpt/css-tests/css21_dev/html4/reference/support/fonts/makegsubfonts.py
820
14309
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
yukim/cassandra
pylib/cqlshlib/sslhandling.py
25
3741
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
kyleabeauchamp/mdtraj
mdtraj/tests/test_hdf5.py
2
10468
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: # # MDTraj is free software: y...
lgpl-2.1
allotria/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_operator.py
326
3472
"""Fixer for operator functions. operator.isCallable(obj) -> hasattr(obj, '__call__') operator.sequenceIncludes(obj) -> operator.contains(obj) operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence) operator.isMappingType(obj) -> isinstance(obj, collections.Mapping) operator.isNumberType(obj) ...
apache-2.0
0xffea/keystone
tests/test_versions.py
1
5296
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/scipy/misc/__init__.py
50
2558
""" ========================================== Miscellaneous routines (:mod:`scipy.misc`) ========================================== .. currentmodule:: scipy.misc Various utilities that don't have another home. Note that the Python Imaging Library (PIL) is not a dependency of SciPy and therefore the `pilutil` module...
mit
vnpy/vnpy
vnpy/api/xgj/xgj_constant.py
12
39071
THOST_FTDC_EXP_Normal = '0' THOST_FTDC_EXP_GenOrderByTrade = '1' THOST_FTDC_ICT_EID = '0' THOST_FTDC_ICT_IDCard = '1' THOST_FTDC_ICT_OfficerIDCard = '2' THOST_FTDC_ICT_PoliceIDCard = '3' THOST_FTDC_ICT_SoldierIDCard = '4' THOST_FTDC_ICT_HouseholdRegister = '5' THOST_FTDC_ICT_Passport = '6' THOST_FTDC_ICT_TaiwanCompatri...
mit
ZenDevelopmentSystems/GroundHog
groundhog/layers/basic.py
19
22520
""" Parent classes describing a layer, model or operator """ __docformat__ = 'restructedtext en' __authors__ = ("Razvan Pascanu " "KyungHyun Cho " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import copy import cPickle as pkl import logging import th...
bsd-3-clause
woutersmet/Zeo_thesis
lib/zeobuilder/actions/collections/__init__.py
6
1438
# Zeobuilder is an extensible GUI-toolkit for molecular model construction. # Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of Zeobuilder. # # Zeobuilde...
gpl-3.0
Dandandan/wikiprogramming
jsrepl/build/extern/python/closured/lib/python2.7/decimal.py
34
219383
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module is currently Py2.3 compatibl...
mit
NeovaHealth/odoo
addons/product/wizard/__init__.py
452
1076
# -*- 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
egabancho/invenio
invenio/modules/knowledge/api.py
1
26116
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011, 2013, 2014 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 version 2 of the ## Licens...
gpl-2.0
breakfastdub/CHN-Server
chnctl.py
2
1207
#!/usr/bin/env python # Stubbed out right now just to reset passwords # # Eventually follow the -ctl model (apachectl, rabbitmqctl) # and add support for add_user, change_password, etc etc from flask_security.utils import encrypt_password from mhn.auth.models import User from mhn import mhn, db import argparse import...
lgpl-2.1
rmboggs/django
tests/multiple_database/tests.py
30
94187
from __future__ import unicode_literals import datetime import pickle from operator import attrgetter from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core import management from django.db import DEFAULT_DB_ALIAS, connections, router, transaction from ...
bsd-3-clause
gestrem/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
lgpl-2.1
formiano/enigma2
lib/python/Screens/Scart.py
126
1771
from Screen import Screen from MessageBox import MessageBox from Components.AVSwitch import AVSwitch from Tools import Notifications class Scart(Screen): def __init__(self, session, start_visible=True): Screen.__init__(self, session) self.msgBox = None self.notificationVisible = None self.avswitch = AVSwitch...
gpl-2.0
Livefyre/django-cms
cms/migrations/0006_auto_20140924_1110.py
66
1918
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0005_auto_20140924_1039'), ] operations = [ migrations.AlterModelOptions( name='page', option...
bsd-3-clause
dracos/django
tests/many_to_many/models.py
63
1370
""" Many-to-many relationships To define a many-to-many relationship, use ``ManyToManyField()``. In this example, an ``Article`` can be published in multiple ``Publication`` objects, and a ``Publication`` has multiple ``Article`` objects. """ from django.db import models class Publication(models.Model): title =...
bsd-3-clause
acdcorp/essential
app/assets/bower_components/bootstrap/test-infra/s3_cache.py
70
3507
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/contrib/contenttypes/fields.py
19
26141
from __future__ import unicode_literals from collections import defaultdict from django.contrib.contenttypes.models import ContentType from django.core import checks from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, models, router, transaction from django...
mit
TridevGuha/django
tests/staticfiles_tests/test_views.py
279
1312
from __future__ import unicode_literals import posixpath from django.conf import settings from django.test import override_settings from .cases import StaticFilesTestCase, TestDefaults @override_settings(ROOT_URLCONF='staticfiles_tests.urls.default') class TestServeStatic(StaticFilesTestCase): """ Test sta...
bsd-3-clause
jlettvin/Unicode
py2/test/test_Array.py
1
3301
# -*- coding: utf8 -*- __module__ = "test_Array.py" __author__ = "Jonathan D. Lettvin" __copyright__ = "\ Copyright(C) 2016 Jonathan D. Lettvin, All Rights Reserved" __credits__ = [ "Jonathan D. Lettvin" ] __license__ = "GPLv3" __version__ = "0.0.1" __maintainer__ = "Jonathan D. Lettvin" __email__ ...
gpl-3.0
dhananjay92/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_mux.py
427
91852
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
Azure/azure-documentdb-python
test/aggregate_tests.py
1
10858
# The MIT License (MIT) # Copyright (c) 2017 Microsoft Corporation # 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...
mit
jfpla/odoo
addons/fleet/fleet.py
266
46376
# -*- 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
jopohl/urh
src/urh/models/ProtocolTableModel.py
1
2539
from collections import defaultdict from PyQt5.QtCore import pyqtSignal, QModelIndex, Qt from urh import settings from urh.models.TableModel import TableModel from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer from urh.ui.actions.DeleteBitsAndPauses import DeleteBitsAndPauses class ProtocolTableMode...
gpl-3.0
dsparrow27/vortex
src/ds/vortex/nodes/conversion/toArray.py
1
1063
from ds.vortex.core import baseNode from ds.vortex.core import plug as plugs class ToArray(baseNode.BaseNode): def __init__(self, name): """ :param name: str, the name of the node """ baseNode.BaseNode.__init__(self, name) def initialize(self): baseNode.BaseNode.initia...
mit
onitake/ansible
lib/ansible/plugins/lookup/__init__.py
89
4408
# (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
ujwalp15/android_kernel_motorola_msm8226
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
xlqian/navitia
source/jormungandr/jormungandr/scenarios/tests/protobuf_builder.py
3
4524
# Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
JioCloud/oslo.vmware
oslo/vmware/rw_handles.py
2
26697
# Copyright (c) 2014 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...
apache-2.0
sh4t/Sick-Beard
cherrypy/_cptools.py
39
19150
"""CherryPy tools. A "tool" is any helper, adapted to CP. Tools are usually designed to be used in a variety of ways (although some may only offer one if they choose): Library calls: All tools are callables that can be used wherever needed. The arguments are straightforward and should be detai...
gpl-3.0
DrMeers/django
tests/admin_checks/models.py
7
1335
""" Tests of ModelAdmin system checks logic. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharField(max_length=150) @python_2_unicode_compatible class Song(models.Model): title = models.CharField(max_length=150) ...
bsd-3-clause
afisher1/volttron-applications
pnnl/FakeDrivenMatlabAgent/setup.py
10
4002
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2015, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistri...
bsd-3-clause
factorlibre/OCB
openerp/addons/base/ir/osv_memory_autovacuum.py
447
1450
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
cgvarela/flask
flask/logging.py
194
2683
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys from werkzeug.local import LocalProxy from logging import ...
bsd-3-clause
FreeAgent/djangoappengine-starter
django/contrib/syndication/feeds.py
245
1367
from django.contrib.syndication import views from django.core.exceptions import ObjectDoesNotExist import warnings # This is part of the deprecated API from django.contrib.syndication.views import FeedDoesNotExist, add_domain class Feed(views.Feed): """Provided for backwards compatibility.""" def __init__(sel...
bsd-3-clause
Pold87/paparazzi_clean
sw/tools/tcp_aircraft_server/phoenix/serial_link.py
86
3691
#Copyright 2014, Antoine Drouin import os, serial, logging from gi.repository import GLib, Gio, GObject import phoenix.pprz_transport as transp LOG = logging.getLogger('serial_link') LOG.setLevel(logging.ERROR) #LOG.setLevel(logging.DEBUG) import pdb class PhoenixCommunication(GObject.GObject): DEFAULT_PORT = "...
gpl-2.0
TalShafir/ansible
lib/ansible/plugins/cliconf/dellos9.py
18
2853
# # (c) 2017 Red Hat Inc. # # (c) 2017 Dell EMC. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
jambolo/bitcoin
test/functional/wallet_avoidreuse.py
9
16585
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the avoid_reuse and setwalletflag features.""" from test_framework.test_framework import BitcoinT...
mit
mmalecki/node-gyp
gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
mit
apache/airflow
airflow/providers/google/cloud/utils/field_validator.py
9
22706
# # 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
kjchavez/distributed-deep-q
param-server/tasks.py
2
1198
from celery import Celery import time from redis import Redis import redis_collections as redisC import evaluation from datetime import datetime import pickle redisURL = "redis://localhost:6379/0" redisInstance = Redis(host='localhost', port=6379, db=0) app = Celery('tasks', broker=redisURL, backend=redisURL) app.c...
mit
mwmuni/LIGGGHTS_GUI
OpenGL/GL/ARB/vertex_array_object.py
9
1833
'''OpenGL extension ARB.vertex_array_object This module customises the behaviour of the OpenGL.raw.GL.ARB.vertex_array_object to provide a more Python-friendly API Overview (from the spec) This extension introduces named vertex array objects which encapsulate vertex array state on the client side. These object...
gpl-3.0
odicraig/kodi2odi
addons/plugin.video.roggerstream-4.0.0/mechanize/_headersutil.py
5
8612
"""Utility functions for HTTP header value parsing and construction. Copyright 1997-1998, Gisle Aas Copyright 2002-2006, John J. Lee This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). ...
gpl-3.0
mozilla/olympia
src/olympia/bandwagon/tests/test_admin.py
1
14684
from django.conf import settings from django.urls import reverse from pyquery import PyQuery as pq from olympia import amo from olympia.amo.tests import TestCase, addon_factory, formset, user_factory from olympia.bandwagon.models import Collection, CollectionAddon class TestCollectionAdmin(TestCase): def setUp(...
bsd-3-clause
mjudsp/Tsallis
sklearn/datasets/species_distributions.py
64
7917
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
cbertinato/pandas
pandas/tests/io/test_gcs.py
1
2310
from io import StringIO import numpy as np import pytest from pandas import DataFrame, date_range, read_csv from pandas.util import _test_decorators as td from pandas.util.testing import assert_frame_equal from pandas.io.common import is_gcs_url def test_is_gcs_url(): assert is_gcs_url("gcs://pandas/somethinge...
bsd-3-clause
pelle/talk.org
django/contrib/comments/feeds.py
16
1556
from django.conf import settings from django.contrib.comments.models import Comment, FreeComment from django.contrib.syndication.feeds import Feed from django.contrib.sites.models import Site class LatestFreeCommentsFeed(Feed): """Feed of latest free comments on the current site.""" comments_class = FreeComme...
gpl-3.0
mozilla/stoneridge
python/src/Demo/turtle/tdemo_bytedesign.py
10
4218
#!/usr/bin/env python """ turtle-example-suite: tdemo_bytedesign.py An example adapted from the example-suite of PythonCard's turtle graphcis. It's based on an article in BYTE magazine Problem Solving with Logo: Using Turtle Graphics to Redraw a Design November 1982, p. 118 - 134 ----------------------...
mpl-2.0
shaunstanislaus/flexx
flexx/pyscript/tests/test_parser3.py
21
12162
from pytest import raises from flexx.util.testing import run_tests_if_main from flexx.pyscript import JSError, py2js, evaljs, evalpy def nowhitespace(s): return s.replace('\n', '').replace('\t', '').replace(' ', '') class TestHardcoreBuildins: def test_isinstance(self): # The resulting code i...
bsd-2-clause
kuldat/pyramid_oauthlib
pyramid_oauthlib/provider/oauth2/interfaces.py
1
17421
from zope.interface import Interface, Attribute class IOAuth2Provider(Interface): server = Attribute("""oauthlib.oauth2.Server instance""") class IOAuth2DataProvider(Interface): def get_client(client_id, *args, **kw): """Client getter function. Accepts one parameter `client_id`, and retur...
mit
couwbat/couwbatns3
ns-allinone-3.23/ns-3.23/examples/wireless/wifi-ap.py
108
5883
# -*- Mode: Python; -*- # /* # * Copyright (c) 2005,2006,2007 INRIA # * Copyright (c) 2009 INESC Porto # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This p...
gpl-2.0
cwilson1031/omaha
enterprise/installer/build_enterprise_installer.py
61
20612
#!/usr/bin/python2.4 # # Copyright 2009-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 ...
apache-2.0
nataddrho/DigiCue-USB
Python3/src/venv/Lib/site-packages/pip/_internal/commands/list.py
1
11430
import json import logging from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import IndexGroupCommand from pip._internal.cli.status_codes import SUCCESS from pip._internal.exceptions import CommandError from pip._internal.index.collector import LinkCollector from pip._internal.index.package_f...
mit
akarol/cfme_tests
cfme/tests/networks/test_sdn_crud.py
2
1601
import pytest from cfme.cloud.provider.azure import AzureProvider from cfme.cloud.provider.ec2 import EC2Provider from cfme.cloud.provider.gce import GCEProvider from cfme.cloud.provider.openstack import OpenStackProvider from cfme.utils.appliance.implementations.ui import navigate_to pytestmark = [ pytest.mark.u...
gpl-2.0
javierblasco/tensorflow
tensorflow/python/client/graph_util_test.py
5
5432
"""Tests for tensorflow.python.client.graph_util.""" import tensorflow.python.platform from tensorflow.python.client import graph_util from tensorflow.python.framework import ops from tensorflow.python.framework import types from tensorflow.python.ops import constant_op from tensorflow.python.ops import data_flow_ops ...
apache-2.0
ashokpant/deep-visualization-toolbox
numpy_cache.py
15
1726
import numpy as np from collections import OrderedDict from threading import RLock class FIFOLimitedArrayCache(object): '''Threadsafe cache that stores numpy arrays (or any other object that defines obj.nbytes) and limits total memory. Items are ejected, if necessary, in the same order in which they were a...
mit
inares/edx-platform
openedx/core/djangoapps/self_paced/migrations/0001_initial.py
86
1203
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
agpl-3.0
SCM-NV/qmworks-namd
nanoqm/workflows/schemas.py
1
9939
"""Schemas to valid user input. Index ----- .. currentmodule:: nanoqm.workflows.schemas .. autosummary:: {autosummary} API --- {autodata} """ __all__ = [ 'schema_cp2k_general_settings', 'schema_derivative_couplings', 'schema_single_points', 'schema_distribute_absorption_spectrum', 'schema_dis...
mit
LHM0105/KouKou
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
ray-project/ray
rllib/agents/marwil/marwil.py
1
5753
from typing import Optional, Type from ray.rllib.agents.trainer import with_common_config from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.agents.marwil.marwil_tf_policy import MARWILTFPolicy from ray.rllib.execution.replay_ops import Replay, StoreToReplayBuffer from ray.rllib.execution.repla...
apache-2.0
dekked/dynamodb-mock
tests/functional/pyramid/test_scan.py
1
4232
# -*- coding: utf-8 -*- import unittest, json TABLE_NAME1 = 'Table-1' TABLE_RT = 45 TABLE_WT = 123 TABLE_NAME = 'Table-HR' TABLE_RT = 45 TABLE_WT = 123 TABLE_RT2 = 10 TABLE_WT2 = 10 TABLE_HK_NAME = u'hash_key' TABLE_HK_TYPE = u'N' TABLE_RK_NAME = u'range_key' TABLE_RK_TYPE = u'S' HK_VALUE1 = u'123' HK_VALUE2 = u'4...
lgpl-3.0
kishoredbn/barrelfish
tools/harness/tests/rcce.py
10
2450
########################################################################## # Copyright (c) 2009, 2010, 2011, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Haldeneggstei...
mit
yancz1989/cancer
utilities.py
1
4491
import SimpleITK as sitk import numpy as np import csv import os import json from PIL import Image import matplotlib.pyplot as plt import SimpleITK as sitk from cv2 import imread, imwrite def load_itk_image(filename): itkimage = sitk.ReadImage(filename) numpyImage = sitk.GetArrayFromImage(itkimage) numpyOrigin =...
mit
dan82840/Netgear-RBR50
git_home/samba.git/source/python/samba/printerdata.py
55
2043
#!/usr/bin/env python # # A python module that maps printerdata to a dictionary. We define # two classes. The printerdata class maps to Get/Set/Enum/DeletePrinterData # and the printerdata_ex class maps to Get/Set/Enum/DeletePrinterDataEx # # # TODO: # # - Implement __delitem__ # from samba import spoolss class...
gpl-2.0
xysec/androguard
elsim/elsim/elsign/example_sign.py
2
2134
#!/usr/bin/env python import sys PATH_INSTALL = "./libelsign" sys.path.append(PATH_INSTALL) from .libelsign import libelsign #from libelsign import libelsign2 as libelsign SIGNS = [ [ "Sign1", "a", [ [ 4.4915299415588379, 4.9674844741821289, 4.9468302726745605, 0.0 ],...
apache-2.0
ITJesse/shadowsocks
shadowsocks/common.py
945
8921
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-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 requi...
apache-2.0
MounirMesselmeni/django
django/db/backends/postgresql/base.py
143
10451
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS from django.db.backends.base.base import BaseDatabaseWrapper from djan...
bsd-3-clause
go-bears/Final-Project
weblogo-3.4_rd/corebio/secstruc/__init__.py
1
1920
""" Protein secondary structure and associated tools and data. Constants: - secstruc_alphabet -- Secondary structure alphabet: 'HGIEBbTSC _-L?X' Contains a complete set of secondary structure codes generated by both STRIDE and DSSP - secstruc_ehl_alphabet -- Standard 3 s...
mit
hasgeek/funnel
migrations/versions/daeb6753652a_add_profile_protected_and_verified_flags.py
1
1186
"""Add profile protected and verified flags. Revision ID: daeb6753652a Revises: 8b46a8a8ca17 Create Date: 2020-11-06 02:57:05.891627 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'daeb6753652a' down_revision = '8b46a8a8ca17' branch_labels = None depends_on = ...
agpl-3.0