repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
EdgarSun/Django-Demo
refs/heads/master
django/contrib/gis/geometry/backend/__init__.py
388
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') try: module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend') except ImportError, e: ...
dmlc/tvm
refs/heads/main
python/tvm/auto_scheduler/loop_state.py
4
# 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...
puzan/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
zhujiangang/shadowsocks
refs/heads/master
tests/graceful_cli.py
977
#!/usr/bin/python import socks import time SERVER_IP = '127.0.0.1' SERVER_PORT = 8001 if __name__ == '__main__': s = socks.socksocket() s.set_proxy(socks.SOCKS5, SERVER_IP, 1081) s.connect((SERVER_IP, SERVER_PORT)) s.send(b'test') time.sleep(30) s.close()
jonnary/keystone
refs/heads/master
keystone/contrib/endpoint_filter/backends/sql.py
8
# Copyright 2013 OpenStack Foundation # # 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...
frederick-masterton/django
refs/heads/master
django/contrib/auth/tests/utils.py
220
from unittest import skipIf from django.conf import settings def skipIfCustomUser(test_func): """ Skip a test if a custom user model is in use. """ return skipIf(settings.AUTH_USER_MODEL != 'auth.User', 'Custom user model in use')(test_func)
adw0rd/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/file_uploads/models.py
110
import tempfile import os from django.db import models from django.core.files.storage import FileSystemStorage temp_storage = FileSystemStorage(tempfile.mkdtemp()) UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload') class FileModel(models.Model): testfile = models.FileField(storage=temp_storage, upload...
uskudnik/ggrc-core
refs/heads/develop
src/tests/ggrc/converters/helpers.py
2
import csv from StringIO import StringIO CREATED_HEADER_STRING = 'Created' UPDATED_HEADER_STRING = 'Updated' HEADER_ROW_INDEX = 4 class AbstractCSV(object): def __init__(self, s): # (nested) list representation of csv object csv_obj = csv.reader(StringIO(s)) self.list_rep = [line for line in c...
onecodex/onecodex
refs/heads/master
onecodex/vendored/potion_client/auth.py
2
from requests.auth import AuthBase class HTTPBearerAuth(AuthBase): """Attaches HTTP Basic Authentication to the given Request object.""" def __init__(self, token): self.token = token def __call__(self, r): r.headers['Authorization'] = 'Bearer {}'.format(self.token) return r
thaim/ansible
refs/heads/fix-broken-link
lib/ansible/modules/network/aos/_aos_blueprint.py
348
#!/usr/bin/python # # (c) 2017 Apstra Inc, <community@apstra.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['removed'], 'supported_by': 'community'} from ansible.module...
sogelink/ansible
refs/heads/devel
lib/ansible/modules/windows/win_eventlog_entry.py
47
#!/usr/bin/python # (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATI...
sabi0/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/where.py
309
from django.db.models.fields import Field, FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sql.where import Constraint, WhereNode from django.contrib.gis.db.models.fields import GeometryField class GeoConstraint(Con...
ofir123/CouchPotatoServer
refs/heads/master
libs/pyutil/scripts/time_comparisons.py
92
# If you run this file, it will make up a random secret and then crack it # using timing information from a string comparison function. Maybe--if it # gets lucky. It takes a long, long time to work. # So, the thing I need help with is statistics. The way this thing works is # extremely stupid. Suppose you want to know...
PowerDNS/exabgp
refs/heads/master
lib/exabgp/bgp/message/update/nlri/evpn/multicast.py
2
""" multicast.py Created by Thomas Morin on 2014-06-23. Copyright (c) 2014-2014 Orange. All rights reserved. """ from exabgp.protocol.ip import IP from exabgp.bgp.message.update.nlri.qualifier.rd import RouteDistinguisher from exabgp.bgp.message.update.nlri.qualifier.etag import EthernetTag from exabgp.bgp.message.u...
kierangraham/dotfiles
refs/heads/master
Sublime/Packages/SublimeCodeIntel/libs/codeintel2/util.py
6
#!python # encoding: utf-8 # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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....
Drooids/odoo
refs/heads/8.0
addons/gamification/tests/__init__.py
268
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
faunalia/rt_geosisma_offline
refs/heads/master
Utils.py
1
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : Omero RT Description : Omero plugin Date : August 15, 2010 copyright : (C) 2010 by Giuseppe Sucameli (Faunalia) email : sucameli@faunalia.i...
fujita-shintaro/readthedocs.org
refs/heads/master
readthedocs/rtd_tests/tests/test_api_version_compare.py
34
from django.test import TestCase from readthedocs.builds.constants import LATEST from readthedocs.projects.models import Project from readthedocs.restapi.views.footer_views import get_version_compare_data class VersionCompareTests(TestCase): fixtures = ['eric.json', 'test_data.json'] def test_not_highest(se...
silentfuzzle/calibre
refs/heads/master
src/calibre/ebooks/conversion/plugins/fb2_input.py
14
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Anatoly Shipitsin <norguhtar at gmail.com>' """ Convert .fb2 files to .lrf """ import os, re from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation from calibre import guess_type FB2NS = 'http://www.gribus...
scalable-networks/ext
refs/heads/master
gnuradio-3.7.0.1/gr-filter/examples/synth_filter.py
58
#!/usr/bin/env python # # Copyright 2010,2012,2013 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 your ...
AgentN/namebench
refs/heads/master
nb_third_party/jinja2/pkg_resources.py
245
"""Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipula...
Ernesto99/odoo
refs/heads/8.0
addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
337
# -*- 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...
epssy/hue
refs/heads/master
desktop/core/ext-py/markdown/markdown/extensions/codehilite.py
130
#!/usr/bin/python """ CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/). Project website: <http://www.freewisdom.org/project/python-markdown/CodeHilite>...
formstack/datadog-gearman_mysql
refs/heads/master
checks.d/gearman_mysql.py
1
""" The MIT License (MIT) Copyright (c) 2016 Formstack, LLC 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, modify, merg...
Brett55/moto
refs/heads/master
moto/dynamodb2/urls.py
18
from __future__ import unicode_literals from .responses import DynamoHandler url_bases = [ "https?://dynamodb.(.+).amazonaws.com" ] url_paths = { "{0}/": DynamoHandler.dispatch, }
orione7/plugin.video.streamondemand-pureita
refs/heads/master
lib/mechanize/_mozillacookiejar.py
149
"""Mozilla / Netscape cookie loading / saving. Copyright 2002-2006 John J Lee <jjl@pobox.com> Copyright 1997-1999 Gisle Aas (original libwww-perl code) 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 distri...
drpaneas/linuxed.gr
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/requests/compat.py
571
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
sachintaware/sublime-wakatime
refs/heads/master
packages/wakatime/packages/requests/packages/urllib3/util/connection.py
679
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform-...
geminy/aidear
refs/heads/master
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/net/data/websocket/echo-request-headers_wsh.py
57
# Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # This handler serializes the received headers into a JSON string and sends it # back to the client. In |headers_in|, the keys are converted to lower-ca...
marratj/ansible
refs/heads/devel
test/integration/targets/aws_lambda/files/mini_lambda.py
139
from __future__ import print_function import json import os def handler(event, context): """ The handler function is the function which gets called each time the lambda is run. """ # printing goes to the cloudwatch log allowing us to simply debug the lambda if we can find # the log entry. ...
TetraAsh/baruwa2
refs/heads/master
baruwa/forms/accounts.py
1
# -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 # Baruwa - Web 2.0 MailScanner front-end. # Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.net> # # 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 S...
cxxgtxy/tensorflow
refs/heads/master
tensorflow/contrib/linalg/python/kernel_tests/linear_operator_addition_test.py
70
# 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...
srajag/contrail-controller
refs/heads/master
src/config/utils/provision_forwarding_mode.py
7
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import argparse import ConfigParser from vnc_api.vnc_api import * class ForwardingModeSetup(object): def __init__(self, args_str=None): self._args = None if not args_str: args_str = ' '....
caorong/ChinaDNS
refs/heads/master
tests/test.py
165
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import signal import time import argparse from subprocess import Popen parser = argparse.ArgumentParser(description='test ChinaDNS') parser.add_argument('-a', '--arguments', type=str, default=[]) parser.add_argument('-t', '--test-command', type=str, defau...
larsbergstrom/skia
refs/heads/master
tools/retrieve_from_googlesource.py
160
#!/usr/bin/python # Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Retrieve the given file from googlesource.com.""" from contextlib import closing import base64 import sys import urllib2 def ...
AndrewGrossman/django
refs/heads/master
django/contrib/gis/db/models/query.py
224
import warnings from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import ( GeometryField, LineStringField, PointField, get_srid_info, ) from django.contrib.gis.db.models.lookups import GISLookup from django.contrib.gis.db.models.sql import ( AreaField, DistanceField, ...
webmasterraj/FogOrNot
refs/heads/master
flask/lib/python2.7/site-packages/numpy/distutils/fcompiler/lahey.py
229
from __future__ import division, absolute_import, print_function import os from numpy.distutils.fcompiler import FCompiler compilers = ['LaheyFCompiler'] class LaheyFCompiler(FCompiler): compiler_type = 'lahey' description = 'Lahey/Fujitsu Fortran 95 Compiler' version_pattern = r'Lahey/Fujitsu Fortran...
UltrosBot/Ultros
refs/heads/master
system/plugins/manager.py
1
# coding=utf-8 import glob import yaml from copy import copy from distutils.version import StrictVersion from twisted.internet.defer import inlineCallbacks, returnValue, Deferred from system.enums import PluginState from system.events.manager import EventManager from system.events.general import PluginUnloadedEvent...
olasitarska/django
refs/heads/master
tests/middleware_exceptions/urls.py
107
from django.conf.urls import url from . import views urlpatterns = [ url(r'^middleware_exceptions/view/$', views.normal_view), url(r'^middleware_exceptions/not_found/$', views.not_found), url(r'^middleware_exceptions/error/$', views.server_error), url(r'^middleware_exceptions/null_view/$', views.null_...
mropert/conan
refs/heads/develop
conans/server/rest/server.py
4
import bottle from conans.server.rest.api_v1 import ApiV1 from conans.model.version import Version class ConanServer(object): """ Server class. Instances api_v1 application and run it. Receives the store. """ store = None root_app = None def __init__(self, run_port, credentials_m...
spadae22/odoo
refs/heads/chris_master_8
addons/website_gengo/controllers/main.py
350
# -*- coding: utf-8 -*- import openerp from openerp import http, SUPERUSER_ID from openerp.http import request import time GENGO_DEFAULT_LIMIT = 20 class website_gengo(http.Controller): @http.route('/website/get_translated_length', type='json', auth='user', website=True) def get_translated_length(self, tran...
hcs/mailman
refs/heads/master
bootstrap.py
9
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
HossainKhademian/YowsUP
refs/heads/master
yowsup/layers/auth/keystream.py
67
import hashlib, hmac, sys from struct import pack from operator import xor from itertools import starmap class RC4: def __init__(self, key, drop): self.s = [] self.i = 0; self.j = 0; self.s = [0] * 256 for i in range(0, len(self.s)): self.s[i] = i for ...
Ginray/my-flask-blog
refs/heads/master
manage.py
2
#!/usr/bin/env python import os from app import create_app, db from app.models import User, Role, Permission, Post from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) migrate = Migrate(app, db) def m...
sbidoul/buildbot
refs/heads/master
master/buildbot/db/pool.py
9
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
woerwin/handy
refs/heads/master
tools/gjslint/build/lib/closure_linter/__init__.py
267
#!/usr/bin/env python # Copyright 2008 The Closure Linter 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 # #...
zhushun0008/sms-tools
refs/heads/master
software/models_interface/models_GUI.py
24
from Tkinter import * from notebook import * # window with tabs from dftModel_GUI_frame import * from stft_GUI_frame import * from sineModel_GUI_frame import * from harmonicModel_GUI_frame import * from stochasticModel_GUI_frame import * from sprModel_GUI_frame import * from spsModel_GUI_frame import * from hprModel...
nicoboss/Floatmotion
refs/heads/master
OpenGL/raw/GLES2/APPLE/framebuffer_multisample.py
8
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLES2 import _types as _cs # End users want this... from OpenGL.raw.GLES2._types import * from OpenGL.raw.GLES2 import _errors from OpenGL.constant import Constant as _C import...
mufaddalq/cloudstack-datera-driver
refs/heads/4.2
tools/marvin/marvin/sshClient.py
1
# 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...
e-q/scipy
refs/heads/master
scipy/ndimage/tests/test_c_api.py
19
import numpy as np from numpy.testing import assert_allclose from scipy import ndimage from scipy.ndimage import _ctest from scipy.ndimage import _cytest from scipy._lib._ccallback import LowLevelCallable FILTER1D_FUNCTIONS = [ lambda filter_size: _ctest.filter1d(filter_size), lambda filter_size: _cytest.filt...
fulmicoton/pylearn2
refs/heads/master
pylearn2/scripts/icml_2013_wrepl/multimodal/make_submission.py
44
from __future__ import print_function import numpy as np import sys from theano.compat.six.moves import xrange from theano import function from theano import tensor as T from pylearn2.utils import serial from pylearn2.utils.string_utils import preprocess def usage(): """ Run python make_submission.py <model> <t...
Keenwawa/libopencm3
refs/heads/master
scripts/data/lpc43xx/yaml_odict.py
54
import yaml from collections import OrderedDict def construct_odict(load, node): """This is the same as SafeConstructor.construct_yaml_omap(), except the data type is changed to OrderedDict() and setitem is used instead of append in the loop. >>> yaml.load(''' ... !!omap ... - foo: bar ......
google-code/android-scripting
refs/heads/master
python/src/Tools/bgen/bgen/bgenStackBuffer.py
44
"""Buffers allocated on the stack.""" from bgenBuffer import FixedInputBufferType, FixedOutputBufferType class StackOutputBufferType(FixedOutputBufferType): """Fixed output buffer allocated on the stack -- passed as (buffer, size). Instantiate with the buffer size as parameter. """ def passOutput...
shaded-enmity/dnf
refs/heads/master
dnf/yum/config.py
1
# Copyright 2002 Duke University # Copyright (C) 2012-2013 Red Hat, Inc. # # 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...
ewanbarr/anansi
refs/heads/master
anansi/tcc/legacy_code/tcc_shutdown.py
1
from lxml import etree from anansi.comms import TCPClient from ConfigParser import ConfigParser from anansi.config import config import sys import os config_path = os.environ["ANANSI_CONFIG"] config = ConfigParser() config.read(os.path.join(config_path,"anansi.cfg")) ANANSI_SERVER_IP = config.get("IPAddresses","anansi...
tdautc19841202/wechatpy
refs/heads/master
wechatpy/pay/__init__.py
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import copy import requests import xmltodict from optionaldict import optionaldict from wechatpy.utils import random_string from wechatpy.exceptions import WeChatPayException from wechatpy.pay.utils import calculate_signature from wechat...
netsec-ethz/scion
refs/heads/scionlab
python/topology/go.py
1
# Copyright 2014 ETH Zurich # Copyright 2018 ETH Zurich, Anapaya Systems # # 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 b...
googleapis/googleapis-gen
refs/heads/master
google/cloud/tpu/v1/tpu-v1-py/tests/unit/gapic/__init__.py
951
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 required by applicable law o...
lonetwin/opencore
refs/heads/master
opencore/models/tests/test_adapters.py
4
# Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz.org # 2010-2011 Large Blue # Fergus Doyle: fergus.doyle@largeblue.com # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version ...
johnbryan/jbryanOrg
refs/heads/master
lib/flask/__init__.py
345
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.10' # utilities we import from Werkzeug and J...
aprefontaine/TMScheduler
refs/heads/master
django/contrib/gis/gdal/srs.py
30
""" The Spatial Reference class, represensents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print srs GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORI...
soarpenguin/ansible
refs/heads/devel
lib/ansible/plugins/callback/default.py
25
# (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...
mach0/QGIS
refs/heads/master
tests/src/python/test_qgsgeometry.py
7
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsGeometry. .. 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 version. """ __aut...
RevelSystems/django
refs/heads/master
tests/auth_tests/settings.py
331
import os from django.utils._os import upath AUTH_MIDDLEWARE_CLASSES = [ 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ] AUTH_TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(os.path...
leeslove/libyuv
refs/heads/master
download_vs_toolchain.py
187
#!/usr/bin/env python # # Copyright 2014 The LibYuv Project Authors. All rights reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All cont...
xmbcrios/xmbcrios.repository
refs/heads/master
script.module.urlresolver/lib/urlresolver/plugins/vidag.py
3
''' thevideo urlresolver plugin Copyright (C) 2014 Eldorado This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is di...
freakboy3742/django
refs/heads/main
tests/gis_tests/geoapp/feeds.py
133
from django.contrib.gis import feeds from .models import City class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/' % item.pk def item_geometry(self, item): ...
FireBladeNooT/Medusa_1_6
refs/heads/master
lib/chardet/sbcharsetprober.py
3
######################## 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...
schinzelh/dash
refs/heads/master
qa/rpc-tests/test_framework/bignum.py
230
# # # bignum.py # # This file is copied from python-bitcoinlib. # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" from __future__ import absolute_import, division, print_function, unicode_literals imp...
cbrewster/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/acceptance_test.py
30
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import os import sys import types import six import _pytest._code import py import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED, EXIT_USAGEERROR class TestGeneralUsage(object): def test_config_error(self, testdir)...
atruberg/django-custom
refs/heads/master
tests/admin_registration/tests.py
150
from __future__ import absolute_import from django.contrib import admin from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from .models import Person, Place, Location class NameAdmin(admin.ModelAdmin): list_display = ['name'] save_on_top = True class TestRegistration(T...
alex-pyasetskiy/rgapi
refs/heads/master
rgapi/services/matches.py
1
class MatchesAPIService(object): __api_version__ = '2.2' __service_name__ = 'matches_api' def __init__(self, client): self.api_request = client.api_request def __repr__(self): return u"<{name}>({service}-v{version})".format(name=self.__class__.__name__, ...
brainwane/zulip
refs/heads/master
zerver/migrations/0272_realm_default_code_block_language.py
7
# Generated by Django 2.2.10 on 2020-03-31 00:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0271_huddle_set_recipient_column_values'), ] operations = [ migrations.AddField( model_name='realm', name...
Nemo112/mediDbase
refs/heads/master
main.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- ## \file main.py ## \brief Louncher method import os.path import subprocess class Chdir: """ \brief Class for rewriting path """ def __init__( self, newPath ): """ Constructor of the class \param self Pointer on class \param newPath New path """ ## Saved path s...
molotof/infernal-twin
refs/heads/master
build/reportlab/src/reportlab/graphics/testdrawings.py
32
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/testdrawings.py __version__=''' $Id $ ''' __doc__="""Defines some standard drawings to use as test cases This contains a nu...
rruebner/odoo
refs/heads/master
addons/l10n_ar/__init__.py
2120
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
mnicholl/MOSFiT
refs/heads/master
mosfit/modules/parameters/gaussian.py
5
"""Definitions for the `Gaussian` class.""" import numpy as np from scipy.special import erfinv from mosfit.modules.parameters.parameter import Parameter # Important: Only define one ``Module`` class per file. class Gaussian(Parameter): """Parameter with Gaussian prior. If the parameter must be positive, ...
cyc805/FR_Comparison_LRD
refs/heads/master
src/tap-bridge/bindings/modulegen__gcc_LP64.py
12
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
HuimingCheng/AutoGrading
refs/heads/master
learning/web_Haotian/venv/Lib/encodings/raw_unicode_escape.py
852
""" Python 'raw-unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is ...
MJJoyce/apachestuff
refs/heads/master
name_to_committer_id.py
2
#!/usr/bin/env python # encoding: utf-8 # 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...
gcodetogit/depot_tools
refs/heads/master
third_party/coverage/annotate.py
55
"""Source file annotation for Coverage.""" import os, re from coverage.report import Reporter class AnnotateReporter(Reporter): """Generate annotated source files showing line coverage. This reporter creates annotated copies of the measured source files. Each .py file is copied as a .py,cover file, with...
sephiroth6/nodeshot
refs/heads/master
nodeshot/core/metrics/views.py
3
import json from django.shortcuts import get_object_or_404 from rest_framework.decorators import api_view from rest_framework.response import Response from influxdb.client import InfluxDBClientError from .models import Metric @api_view(('GET', 'POST')) def metric_details(request, pk, format=None): """ Get ...
Effective-Quadratures/Effective-Quadratures
refs/heads/master
tests/test_subspaces.py
1
from unittest import TestCase import unittest from equadratures import * from equadratures.scalers import scaler_minmax import numpy as np import scipy.stats as st import os def data(): Y = np.asarray([[0.214794386299531], [0.0304864358995189], [0.181108826199520], [0.0364174877995254], [-0.388114...
jlegendary/orange
refs/heads/master
Orange/testing/regression/tests_20/reference_random_classifier.py
6
# Description: Shows a classifier that makes random decisions # Category: classification # Classes: RandomClassifier # Uses: lenses # Referenced: RandomClassifier.htm import orange, orngTest, orngStat data = orange.ExampleTable("lenses") rc = orange.RandomClassifier() rc.classVar = data.domain.classVa...
teltek/edx-platform
refs/heads/master
cms/djangoapps/contentstore/management/commands/utils.py
25
""" Common methods for cms commands to use """ from django.contrib.auth.models import User from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore def user_from_str(identifier): """ Return a user identified by the given string. The string could be an email address, o...
ahnqirage/spark
refs/heads/master
python/pyspark/sql/utils.py
14
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
davidnmurray/iris
refs/heads/master
lib/iris/tests/unit/fileformats/grib/load_convert/test_statistical_forecast_period_coord.py
12
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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 l...
i404ed/portfolio-dir
refs/heads/master
portfolio/settings.py
1
""" Django settings for resume project. Generated by 'django-admin startproject' using Django 2.0.dev20170505004518. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ ""...
valsteen/ableton-live-webapi
refs/heads/master
ext_libs/Cython/Debugger/Tests/test_libcython_in_gdb.py
112
""" Tests that run inside GDB. Note: debug information is already imported by the file generated by Cython.Debugger.Cygdb.make_command_file() """ import os import re import sys import trace import inspect import warnings import unittest import textwrap import tempfile import functools import traceback import itertool...
lilleswing/deepchem
refs/heads/master
deepchem/feat/tests/test_atomic_coordinates.py
1
""" Test atomic coordinates and neighbor lists. """ import os import logging import numpy as np import unittest from deepchem.utils import conformers from deepchem.feat import AtomicCoordinates from deepchem.feat import NeighborListAtomicCoordinates from deepchem.feat import NeighborListComplexAtomicCoordinates logger...
paprykarz/vdebug
refs/heads/master
python3/vdebug/session.py
2
import socket import vim from . import dbgp from . import error from . import event from . import listener from . import log from . import opts from . import util class SessionHandler: def __init__(self, ui, breakpoints): self.__ui = ui self.__breakpoints = breakpoints self.__ex_handler...
SlimRemix/android_external_chromium_org
refs/heads/lp5.1
tools/telemetry/telemetry/core/platform/android_device_unittest.py
26
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.core.platform import android_device from telemetry.unittest import system_stub class AndroidDeviceTest(unittest.TestCase): ...
chinmaygarde/mojo
refs/heads/ios
third_party/re2/re2/make_unicode_groups.py
219
#!/usr/bin/python # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
robinro/ansible
refs/heads/devel
lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py
42
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Dimension Data # # 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 ...
naresh21/synergetics-edx-platform
refs/heads/oxa/master.fic
openedx/core/lib/api/fields.py
53
"""Fields useful for edX API implementations.""" from rest_framework.serializers import Field, URLField class ExpandableField(Field): """Field that can dynamically use a more detailed serializer based on a user-provided "expand" parameter. Kwargs: collapsed_serializer (Serializer): the serializer to us...
TeamExodus/external_chromium_org
refs/heads/EXODUS-5.1
tools/site_compare/commands/measure.py
189
# 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. """Command for measuring how long pages take to load in a browser. Prerequisites: 1. The command_line package from tools/site_compare 2. Either the ...
jabber-at/python-nbxmpp
refs/heads/master
nbxmpp/plugin.py
1
## plugin.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ...
autoreject/autoreject
refs/heads/master
autoreject/tests/test_ransac.py
1
# Author: Mainak Jas <mainak.jas@telecom-paristech.fr> # License: BSD (3-clause) import pytest import numpy as np import mne from mne.datasets import sample from mne import io from autoreject import Ransac import matplotlib matplotlib.use('Agg') data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/s...
utamaro/youtube-dl
refs/heads/master
test/test_postprocessors.py
151
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.postprocessor import MetadataFromTitlePP class TestMetadataFromTitle(unittest.TestCase): de...
bobellis/ghost_blog
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/trac.py
364
# -*- coding: utf-8 -*- """ pygments.styles.trac ~~~~~~~~~~~~~~~~~~~~ Port of the default trac highlighter design. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Na...